Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
}
[27000] Fix | Delete
[27001] Fix | Delete
validatePropTypes$2(userProps, useSelect); // Props defaults and destructuring.
[27002] Fix | Delete
[27003] Fix | Delete
var props = extends_extends({}, defaultProps$2, userProps);
[27004] Fix | Delete
[27005] Fix | Delete
var items = props.items,
[27006] Fix | Delete
scrollIntoView = props.scrollIntoView,
[27007] Fix | Delete
environment = props.environment,
[27008] Fix | Delete
initialIsOpen = props.initialIsOpen,
[27009] Fix | Delete
defaultIsOpen = props.defaultIsOpen,
[27010] Fix | Delete
itemToString = props.itemToString,
[27011] Fix | Delete
getA11ySelectionMessage = props.getA11ySelectionMessage,
[27012] Fix | Delete
getA11yStatusMessage = props.getA11yStatusMessage; // Initial state depending on controlled props.
[27013] Fix | Delete
[27014] Fix | Delete
var initialState = getInitialState$2(props);
[27015] Fix | Delete
[27016] Fix | Delete
var _useControlledReducer = useControlledReducer$1(downshiftSelectReducer, initialState, props),
[27017] Fix | Delete
state = _useControlledReducer[0],
[27018] Fix | Delete
dispatch = _useControlledReducer[1];
[27019] Fix | Delete
[27020] Fix | Delete
var isOpen = state.isOpen,
[27021] Fix | Delete
highlightedIndex = state.highlightedIndex,
[27022] Fix | Delete
selectedItem = state.selectedItem,
[27023] Fix | Delete
inputValue = state.inputValue; // Element efs.
[27024] Fix | Delete
[27025] Fix | Delete
var toggleButtonRef = Object(external_React_["useRef"])(null);
[27026] Fix | Delete
var menuRef = Object(external_React_["useRef"])(null);
[27027] Fix | Delete
var itemRefs = Object(external_React_["useRef"])({}); // used not to trigger menu blur action in some scenarios.
[27028] Fix | Delete
[27029] Fix | Delete
var shouldBlurRef = Object(external_React_["useRef"])(true); // used to keep the inputValue clearTimeout object between renders.
[27030] Fix | Delete
[27031] Fix | Delete
var clearTimeoutRef = Object(external_React_["useRef"])(null); // prevent id re-generation between renders.
[27032] Fix | Delete
[27033] Fix | Delete
var elementIds = useElementIds(props); // used to keep track of how many items we had on previous cycle.
[27034] Fix | Delete
[27035] Fix | Delete
var previousResultCountRef = Object(external_React_["useRef"])();
[27036] Fix | Delete
var isInitialMountRef = Object(external_React_["useRef"])(true); // utility callback to get item element.
[27037] Fix | Delete
[27038] Fix | Delete
var latest = useLatestRef({
[27039] Fix | Delete
state: state,
[27040] Fix | Delete
props: props
[27041] Fix | Delete
}); // Some utils.
[27042] Fix | Delete
[27043] Fix | Delete
var getItemNodeFromIndex = Object(external_React_["useCallback"])(function (index) {
[27044] Fix | Delete
return itemRefs.current[elementIds.getItemId(index)];
[27045] Fix | Delete
}, [elementIds]); // Effects.
[27046] Fix | Delete
// Sets a11y status message on changes in state.
[27047] Fix | Delete
[27048] Fix | Delete
useA11yMessageSetter(getA11yStatusMessage, [isOpen, highlightedIndex, inputValue, items], extends_extends({
[27049] Fix | Delete
isInitialMount: isInitialMountRef.current,
[27050] Fix | Delete
previousResultCount: previousResultCountRef.current,
[27051] Fix | Delete
items: items,
[27052] Fix | Delete
environment: environment,
[27053] Fix | Delete
itemToString: itemToString
[27054] Fix | Delete
}, state)); // Sets a11y status message on changes in selectedItem.
[27055] Fix | Delete
[27056] Fix | Delete
useA11yMessageSetter(getA11ySelectionMessage, [selectedItem], extends_extends({
[27057] Fix | Delete
isInitialMount: isInitialMountRef.current,
[27058] Fix | Delete
previousResultCount: previousResultCountRef.current,
[27059] Fix | Delete
items: items,
[27060] Fix | Delete
environment: environment,
[27061] Fix | Delete
itemToString: itemToString
[27062] Fix | Delete
}, state)); // Scroll on highlighted item if change comes from keyboard.
[27063] Fix | Delete
[27064] Fix | Delete
var shouldScrollRef = useScrollIntoView({
[27065] Fix | Delete
menuElement: menuRef.current,
[27066] Fix | Delete
highlightedIndex: highlightedIndex,
[27067] Fix | Delete
isOpen: isOpen,
[27068] Fix | Delete
itemRefs: itemRefs,
[27069] Fix | Delete
scrollIntoView: scrollIntoView,
[27070] Fix | Delete
getItemNodeFromIndex: getItemNodeFromIndex
[27071] Fix | Delete
}); // Sets cleanup for the keysSoFar callback, debounded after 500ms.
[27072] Fix | Delete
[27073] Fix | Delete
Object(external_React_["useEffect"])(function () {
[27074] Fix | Delete
// init the clean function here as we need access to dispatch.
[27075] Fix | Delete
clearTimeoutRef.current = debounce(function (outerDispatch) {
[27076] Fix | Delete
outerDispatch({
[27077] Fix | Delete
type: FunctionSetInputValue$1,
[27078] Fix | Delete
inputValue: ''
[27079] Fix | Delete
});
[27080] Fix | Delete
}, 500); // Cancel any pending debounced calls on mount
[27081] Fix | Delete
[27082] Fix | Delete
return function () {
[27083] Fix | Delete
clearTimeoutRef.current.cancel();
[27084] Fix | Delete
};
[27085] Fix | Delete
}, []); // Invokes the keysSoFar callback set up above.
[27086] Fix | Delete
[27087] Fix | Delete
Object(external_React_["useEffect"])(function () {
[27088] Fix | Delete
if (!inputValue) {
[27089] Fix | Delete
return;
[27090] Fix | Delete
}
[27091] Fix | Delete
[27092] Fix | Delete
clearTimeoutRef.current(dispatch);
[27093] Fix | Delete
}, [dispatch, inputValue]);
[27094] Fix | Delete
useControlPropsValidator({
[27095] Fix | Delete
isInitialMount: isInitialMountRef.current,
[27096] Fix | Delete
props: props,
[27097] Fix | Delete
state: state
[27098] Fix | Delete
});
[27099] Fix | Delete
/* Controls the focus on the menu or the toggle button. */
[27100] Fix | Delete
[27101] Fix | Delete
Object(external_React_["useEffect"])(function () {
[27102] Fix | Delete
// Don't focus menu on first render.
[27103] Fix | Delete
if (isInitialMountRef.current) {
[27104] Fix | Delete
// Unless it was initialised as open.
[27105] Fix | Delete
if ((initialIsOpen || defaultIsOpen || isOpen) && menuRef.current) {
[27106] Fix | Delete
menuRef.current.focus();
[27107] Fix | Delete
}
[27108] Fix | Delete
[27109] Fix | Delete
return;
[27110] Fix | Delete
} // Focus menu on open.
[27111] Fix | Delete
[27112] Fix | Delete
[27113] Fix | Delete
if (isOpen) {
[27114] Fix | Delete
// istanbul ignore else
[27115] Fix | Delete
if (menuRef.current) {
[27116] Fix | Delete
menuRef.current.focus();
[27117] Fix | Delete
}
[27118] Fix | Delete
[27119] Fix | Delete
return;
[27120] Fix | Delete
} // Focus toggleButton on close, but not if it was closed with (Shift+)Tab.
[27121] Fix | Delete
[27122] Fix | Delete
[27123] Fix | Delete
if (environment.document.activeElement === menuRef.current) {
[27124] Fix | Delete
// istanbul ignore else
[27125] Fix | Delete
if (toggleButtonRef.current) {
[27126] Fix | Delete
shouldBlurRef.current = false;
[27127] Fix | Delete
toggleButtonRef.current.focus();
[27128] Fix | Delete
}
[27129] Fix | Delete
} // eslint-disable-next-line react-hooks/exhaustive-deps
[27130] Fix | Delete
[27131] Fix | Delete
}, [isOpen]);
[27132] Fix | Delete
Object(external_React_["useEffect"])(function () {
[27133] Fix | Delete
if (isInitialMountRef.current) {
[27134] Fix | Delete
return;
[27135] Fix | Delete
}
[27136] Fix | Delete
[27137] Fix | Delete
previousResultCountRef.current = items.length;
[27138] Fix | Delete
}); // Add mouse/touch events to document.
[27139] Fix | Delete
[27140] Fix | Delete
var mouseAndTouchTrackersRef = useMouseAndTouchTracker(isOpen, [menuRef, toggleButtonRef], environment, function () {
[27141] Fix | Delete
dispatch({
[27142] Fix | Delete
type: MenuBlur
[27143] Fix | Delete
});
[27144] Fix | Delete
});
[27145] Fix | Delete
var setGetterPropCallInfo = useGetterPropsCalledChecker('getMenuProps', 'getToggleButtonProps'); // Make initial ref false.
[27146] Fix | Delete
[27147] Fix | Delete
Object(external_React_["useEffect"])(function () {
[27148] Fix | Delete
isInitialMountRef.current = false;
[27149] Fix | Delete
}, []); // Reset itemRefs on close.
[27150] Fix | Delete
[27151] Fix | Delete
Object(external_React_["useEffect"])(function () {
[27152] Fix | Delete
if (!isOpen) {
[27153] Fix | Delete
itemRefs.current = {};
[27154] Fix | Delete
}
[27155] Fix | Delete
}, [isOpen]); // Event handler functions.
[27156] Fix | Delete
[27157] Fix | Delete
var toggleButtonKeyDownHandlers = Object(external_React_["useMemo"])(function () {
[27158] Fix | Delete
return {
[27159] Fix | Delete
ArrowDown: function ArrowDown(event) {
[27160] Fix | Delete
event.preventDefault();
[27161] Fix | Delete
dispatch({
[27162] Fix | Delete
type: ToggleButtonKeyDownArrowDown,
[27163] Fix | Delete
getItemNodeFromIndex: getItemNodeFromIndex,
[27164] Fix | Delete
shiftKey: event.shiftKey
[27165] Fix | Delete
});
[27166] Fix | Delete
},
[27167] Fix | Delete
ArrowUp: function ArrowUp(event) {
[27168] Fix | Delete
event.preventDefault();
[27169] Fix | Delete
dispatch({
[27170] Fix | Delete
type: ToggleButtonKeyDownArrowUp,
[27171] Fix | Delete
getItemNodeFromIndex: getItemNodeFromIndex,
[27172] Fix | Delete
shiftKey: event.shiftKey
[27173] Fix | Delete
});
[27174] Fix | Delete
}
[27175] Fix | Delete
};
[27176] Fix | Delete
}, [dispatch, getItemNodeFromIndex]);
[27177] Fix | Delete
var menuKeyDownHandlers = Object(external_React_["useMemo"])(function () {
[27178] Fix | Delete
return {
[27179] Fix | Delete
ArrowDown: function ArrowDown(event) {
[27180] Fix | Delete
event.preventDefault();
[27181] Fix | Delete
dispatch({
[27182] Fix | Delete
type: MenuKeyDownArrowDown,
[27183] Fix | Delete
getItemNodeFromIndex: getItemNodeFromIndex,
[27184] Fix | Delete
shiftKey: event.shiftKey
[27185] Fix | Delete
});
[27186] Fix | Delete
},
[27187] Fix | Delete
ArrowUp: function ArrowUp(event) {
[27188] Fix | Delete
event.preventDefault();
[27189] Fix | Delete
dispatch({
[27190] Fix | Delete
type: MenuKeyDownArrowUp,
[27191] Fix | Delete
getItemNodeFromIndex: getItemNodeFromIndex,
[27192] Fix | Delete
shiftKey: event.shiftKey
[27193] Fix | Delete
});
[27194] Fix | Delete
},
[27195] Fix | Delete
Home: function Home(event) {
[27196] Fix | Delete
event.preventDefault();
[27197] Fix | Delete
dispatch({
[27198] Fix | Delete
type: MenuKeyDownHome,
[27199] Fix | Delete
getItemNodeFromIndex: getItemNodeFromIndex
[27200] Fix | Delete
});
[27201] Fix | Delete
},
[27202] Fix | Delete
End: function End(event) {
[27203] Fix | Delete
event.preventDefault();
[27204] Fix | Delete
dispatch({
[27205] Fix | Delete
type: MenuKeyDownEnd,
[27206] Fix | Delete
getItemNodeFromIndex: getItemNodeFromIndex
[27207] Fix | Delete
});
[27208] Fix | Delete
},
[27209] Fix | Delete
Escape: function Escape() {
[27210] Fix | Delete
dispatch({
[27211] Fix | Delete
type: MenuKeyDownEscape
[27212] Fix | Delete
});
[27213] Fix | Delete
},
[27214] Fix | Delete
Enter: function Enter(event) {
[27215] Fix | Delete
event.preventDefault();
[27216] Fix | Delete
dispatch({
[27217] Fix | Delete
type: MenuKeyDownEnter
[27218] Fix | Delete
});
[27219] Fix | Delete
},
[27220] Fix | Delete
' ': function _(event) {
[27221] Fix | Delete
event.preventDefault();
[27222] Fix | Delete
dispatch({
[27223] Fix | Delete
type: MenuKeyDownSpaceButton
[27224] Fix | Delete
});
[27225] Fix | Delete
}
[27226] Fix | Delete
};
[27227] Fix | Delete
}, [dispatch, getItemNodeFromIndex]); // Action functions.
[27228] Fix | Delete
[27229] Fix | Delete
var toggleMenu = Object(external_React_["useCallback"])(function () {
[27230] Fix | Delete
dispatch({
[27231] Fix | Delete
type: FunctionToggleMenu$1
[27232] Fix | Delete
});
[27233] Fix | Delete
}, [dispatch]);
[27234] Fix | Delete
var closeMenu = Object(external_React_["useCallback"])(function () {
[27235] Fix | Delete
dispatch({
[27236] Fix | Delete
type: FunctionCloseMenu$1
[27237] Fix | Delete
});
[27238] Fix | Delete
}, [dispatch]);
[27239] Fix | Delete
var openMenu = Object(external_React_["useCallback"])(function () {
[27240] Fix | Delete
dispatch({
[27241] Fix | Delete
type: FunctionOpenMenu$1
[27242] Fix | Delete
});
[27243] Fix | Delete
}, [dispatch]);
[27244] Fix | Delete
var setHighlightedIndex = Object(external_React_["useCallback"])(function (newHighlightedIndex) {
[27245] Fix | Delete
dispatch({
[27246] Fix | Delete
type: FunctionSetHighlightedIndex$1,
[27247] Fix | Delete
highlightedIndex: newHighlightedIndex
[27248] Fix | Delete
});
[27249] Fix | Delete
}, [dispatch]);
[27250] Fix | Delete
var selectItem = Object(external_React_["useCallback"])(function (newSelectedItem) {
[27251] Fix | Delete
dispatch({
[27252] Fix | Delete
type: FunctionSelectItem$1,
[27253] Fix | Delete
selectedItem: newSelectedItem
[27254] Fix | Delete
});
[27255] Fix | Delete
}, [dispatch]);
[27256] Fix | Delete
var reset = Object(external_React_["useCallback"])(function () {
[27257] Fix | Delete
dispatch({
[27258] Fix | Delete
type: FunctionReset$2
[27259] Fix | Delete
});
[27260] Fix | Delete
}, [dispatch]);
[27261] Fix | Delete
var setInputValue = Object(external_React_["useCallback"])(function (newInputValue) {
[27262] Fix | Delete
dispatch({
[27263] Fix | Delete
type: FunctionSetInputValue$1,
[27264] Fix | Delete
inputValue: newInputValue
[27265] Fix | Delete
});
[27266] Fix | Delete
}, [dispatch]); // Getter functions.
[27267] Fix | Delete
[27268] Fix | Delete
var getLabelProps = Object(external_React_["useCallback"])(function (labelProps) {
[27269] Fix | Delete
return extends_extends({
[27270] Fix | Delete
id: elementIds.labelId,
[27271] Fix | Delete
htmlFor: elementIds.toggleButtonId
[27272] Fix | Delete
}, labelProps);
[27273] Fix | Delete
}, [elementIds]);
[27274] Fix | Delete
var getMenuProps = Object(external_React_["useCallback"])(function (_temp, _temp2) {
[27275] Fix | Delete
var _extends2;
[27276] Fix | Delete
[27277] Fix | Delete
var _ref = _temp === void 0 ? {} : _temp,
[27278] Fix | Delete
onMouseLeave = _ref.onMouseLeave,
[27279] Fix | Delete
_ref$refKey = _ref.refKey,
[27280] Fix | Delete
refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,
[27281] Fix | Delete
onKeyDown = _ref.onKeyDown,
[27282] Fix | Delete
onBlur = _ref.onBlur,
[27283] Fix | Delete
ref = _ref.ref,
[27284] Fix | Delete
rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref, _excluded$2);
[27285] Fix | Delete
[27286] Fix | Delete
var _ref2 = _temp2 === void 0 ? {} : _temp2,
[27287] Fix | Delete
_ref2$suppressRefErro = _ref2.suppressRefError,
[27288] Fix | Delete
suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;
[27289] Fix | Delete
[27290] Fix | Delete
var latestState = latest.current.state;
[27291] Fix | Delete
[27292] Fix | Delete
var menuHandleKeyDown = function menuHandleKeyDown(event) {
[27293] Fix | Delete
var key = normalizeArrowKey(event);
[27294] Fix | Delete
[27295] Fix | Delete
if (key && menuKeyDownHandlers[key]) {
[27296] Fix | Delete
menuKeyDownHandlers[key](event);
[27297] Fix | Delete
} else if (isAcceptedCharacterKey(key)) {
[27298] Fix | Delete
dispatch({
[27299] Fix | Delete
type: MenuKeyDownCharacter,
[27300] Fix | Delete
key: key,
[27301] Fix | Delete
getItemNodeFromIndex: getItemNodeFromIndex
[27302] Fix | Delete
});
[27303] Fix | Delete
}
[27304] Fix | Delete
};
[27305] Fix | Delete
[27306] Fix | Delete
var menuHandleBlur = function menuHandleBlur() {
[27307] Fix | Delete
// if the blur was a result of selection, we don't trigger this action.
[27308] Fix | Delete
if (shouldBlurRef.current === false) {
[27309] Fix | Delete
shouldBlurRef.current = true;
[27310] Fix | Delete
return;
[27311] Fix | Delete
}
[27312] Fix | Delete
[27313] Fix | Delete
var shouldBlur = !mouseAndTouchTrackersRef.current.isMouseDown;
[27314] Fix | Delete
/* istanbul ignore else */
[27315] Fix | Delete
[27316] Fix | Delete
if (shouldBlur) {
[27317] Fix | Delete
dispatch({
[27318] Fix | Delete
type: MenuBlur
[27319] Fix | Delete
});
[27320] Fix | Delete
}
[27321] Fix | Delete
};
[27322] Fix | Delete
[27323] Fix | Delete
var menuHandleMouseLeave = function menuHandleMouseLeave() {
[27324] Fix | Delete
dispatch({
[27325] Fix | Delete
type: MenuMouseLeave$1
[27326] Fix | Delete
});
[27327] Fix | Delete
};
[27328] Fix | Delete
[27329] Fix | Delete
setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);
[27330] Fix | Delete
return extends_extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {
[27331] Fix | Delete
menuRef.current = menuNode;
[27332] Fix | Delete
}), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = elementIds.labelId, _extends2.tabIndex = -1, _extends2), latestState.isOpen && latestState.highlightedIndex > -1 && {
[27333] Fix | Delete
'aria-activedescendant': elementIds.getItemId(latestState.highlightedIndex)
[27334] Fix | Delete
}, {
[27335] Fix | Delete
onMouseLeave: callAllEventHandlers(onMouseLeave, menuHandleMouseLeave),
[27336] Fix | Delete
onKeyDown: callAllEventHandlers(onKeyDown, menuHandleKeyDown),
[27337] Fix | Delete
onBlur: callAllEventHandlers(onBlur, menuHandleBlur)
[27338] Fix | Delete
}, rest);
[27339] Fix | Delete
}, [dispatch, latest, menuKeyDownHandlers, mouseAndTouchTrackersRef, setGetterPropCallInfo, elementIds, getItemNodeFromIndex]);
[27340] Fix | Delete
var getToggleButtonProps = Object(external_React_["useCallback"])(function (_temp3, _temp4) {
[27341] Fix | Delete
var _extends3;
[27342] Fix | Delete
[27343] Fix | Delete
var _ref3 = _temp3 === void 0 ? {} : _temp3,
[27344] Fix | Delete
onClick = _ref3.onClick,
[27345] Fix | Delete
onKeyDown = _ref3.onKeyDown,
[27346] Fix | Delete
_ref3$refKey = _ref3.refKey,
[27347] Fix | Delete
refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,
[27348] Fix | Delete
ref = _ref3.ref,
[27349] Fix | Delete
rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref3, _excluded2$2);
[27350] Fix | Delete
[27351] Fix | Delete
var _ref4 = _temp4 === void 0 ? {} : _temp4,
[27352] Fix | Delete
_ref4$suppressRefErro = _ref4.suppressRefError,
[27353] Fix | Delete
suppressRefError = _ref4$suppressRefErro === void 0 ? false : _ref4$suppressRefErro;
[27354] Fix | Delete
[27355] Fix | Delete
var toggleButtonHandleClick = function toggleButtonHandleClick() {
[27356] Fix | Delete
dispatch({
[27357] Fix | Delete
type: ToggleButtonClick$1
[27358] Fix | Delete
});
[27359] Fix | Delete
};
[27360] Fix | Delete
[27361] Fix | Delete
var toggleButtonHandleKeyDown = function toggleButtonHandleKeyDown(event) {
[27362] Fix | Delete
var key = normalizeArrowKey(event);
[27363] Fix | Delete
[27364] Fix | Delete
if (key && toggleButtonKeyDownHandlers[key]) {
[27365] Fix | Delete
toggleButtonKeyDownHandlers[key](event);
[27366] Fix | Delete
} else if (isAcceptedCharacterKey(key)) {
[27367] Fix | Delete
dispatch({
[27368] Fix | Delete
type: ToggleButtonKeyDownCharacter,
[27369] Fix | Delete
key: key,
[27370] Fix | Delete
getItemNodeFromIndex: getItemNodeFromIndex
[27371] Fix | Delete
});
[27372] Fix | Delete
}
[27373] Fix | Delete
};
[27374] Fix | Delete
[27375] Fix | Delete
var toggleProps = extends_extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (toggleButtonNode) {
[27376] Fix | Delete
toggleButtonRef.current = toggleButtonNode;
[27377] Fix | Delete
}), _extends3.id = elementIds.toggleButtonId, _extends3['aria-haspopup'] = 'listbox', _extends3['aria-expanded'] = latest.current.state.isOpen, _extends3['aria-labelledby'] = elementIds.labelId + " " + elementIds.toggleButtonId, _extends3), rest);
[27378] Fix | Delete
[27379] Fix | Delete
if (!rest.disabled) {
[27380] Fix | Delete
toggleProps.onClick = callAllEventHandlers(onClick, toggleButtonHandleClick);
[27381] Fix | Delete
toggleProps.onKeyDown = callAllEventHandlers(onKeyDown, toggleButtonHandleKeyDown);
[27382] Fix | Delete
}
[27383] Fix | Delete
[27384] Fix | Delete
setGetterPropCallInfo('getToggleButtonProps', suppressRefError, refKey, toggleButtonRef);
[27385] Fix | Delete
return toggleProps;
[27386] Fix | Delete
}, [dispatch, latest, toggleButtonKeyDownHandlers, setGetterPropCallInfo, elementIds, getItemNodeFromIndex]);
[27387] Fix | Delete
var getItemProps = Object(external_React_["useCallback"])(function (_temp5) {
[27388] Fix | Delete
var _extends4;
[27389] Fix | Delete
[27390] Fix | Delete
var _ref5 = _temp5 === void 0 ? {} : _temp5,
[27391] Fix | Delete
item = _ref5.item,
[27392] Fix | Delete
index = _ref5.index,
[27393] Fix | Delete
onMouseMove = _ref5.onMouseMove,
[27394] Fix | Delete
onClick = _ref5.onClick,
[27395] Fix | Delete
_ref5$refKey = _ref5.refKey,
[27396] Fix | Delete
refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,
[27397] Fix | Delete
ref = _ref5.ref,
[27398] Fix | Delete
rest = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref5, _excluded3$1);
[27399] Fix | Delete
[27400] Fix | Delete
var _latest$current = latest.current,
[27401] Fix | Delete
latestState = _latest$current.state,
[27402] Fix | Delete
latestProps = _latest$current.props;
[27403] Fix | Delete
[27404] Fix | Delete
var itemHandleMouseMove = function itemHandleMouseMove() {
[27405] Fix | Delete
if (index === latestState.highlightedIndex) {
[27406] Fix | Delete
return;
[27407] Fix | Delete
}
[27408] Fix | Delete
[27409] Fix | Delete
shouldScrollRef.current = false;
[27410] Fix | Delete
dispatch({
[27411] Fix | Delete
type: ItemMouseMove$1,
[27412] Fix | Delete
index: index
[27413] Fix | Delete
});
[27414] Fix | Delete
};
[27415] Fix | Delete
[27416] Fix | Delete
var itemHandleClick = function itemHandleClick() {
[27417] Fix | Delete
dispatch({
[27418] Fix | Delete
type: ItemClick$1,
[27419] Fix | Delete
index: index
[27420] Fix | Delete
});
[27421] Fix | Delete
};
[27422] Fix | Delete
[27423] Fix | Delete
var itemIndex = getItemIndex(index, item, latestProps.items);
[27424] Fix | Delete
[27425] Fix | Delete
if (itemIndex < 0) {
[27426] Fix | Delete
throw new Error('Pass either item or item index in getItemProps!');
[27427] Fix | Delete
}
[27428] Fix | Delete
[27429] Fix | Delete
var itemProps = extends_extends((_extends4 = {
[27430] Fix | Delete
role: 'option',
[27431] Fix | Delete
'aria-selected': "" + (itemIndex === latestState.highlightedIndex),
[27432] Fix | Delete
id: elementIds.getItemId(itemIndex)
[27433] Fix | Delete
}, _extends4[refKey] = handleRefs(ref, function (itemNode) {
[27434] Fix | Delete
if (itemNode) {
[27435] Fix | Delete
itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;
[27436] Fix | Delete
}
[27437] Fix | Delete
}), _extends4), rest);
[27438] Fix | Delete
[27439] Fix | Delete
if (!rest.disabled) {
[27440] Fix | Delete
itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);
[27441] Fix | Delete
itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);
[27442] Fix | Delete
}
[27443] Fix | Delete
[27444] Fix | Delete
return itemProps;
[27445] Fix | Delete
}, [dispatch, latest, shouldScrollRef, elementIds]);
[27446] Fix | Delete
return {
[27447] Fix | Delete
// prop getters.
[27448] Fix | Delete
getToggleButtonProps: getToggleButtonProps,
[27449] Fix | Delete
getLabelProps: getLabelProps,
[27450] Fix | Delete
getMenuProps: getMenuProps,
[27451] Fix | Delete
getItemProps: getItemProps,
[27452] Fix | Delete
// actions.
[27453] Fix | Delete
toggleMenu: toggleMenu,
[27454] Fix | Delete
openMenu: openMenu,
[27455] Fix | Delete
closeMenu: closeMenu,
[27456] Fix | Delete
setHighlightedIndex: setHighlightedIndex,
[27457] Fix | Delete
selectItem: selectItem,
[27458] Fix | Delete
reset: reset,
[27459] Fix | Delete
setInputValue: setInputValue,
[27460] Fix | Delete
// state.
[27461] Fix | Delete
highlightedIndex: highlightedIndex,
[27462] Fix | Delete
isOpen: isOpen,
[27463] Fix | Delete
selectedItem: selectedItem,
[27464] Fix | Delete
inputValue: inputValue
[27465] Fix | Delete
};
[27466] Fix | Delete
}
[27467] Fix | Delete
[27468] Fix | Delete
var InputKeyDownArrowDown = false ? undefined : 0;
[27469] Fix | Delete
var InputKeyDownArrowUp = false ? undefined : 1;
[27470] Fix | Delete
var InputKeyDownEscape = false ? undefined : 2;
[27471] Fix | Delete
var InputKeyDownHome = false ? undefined : 3;
[27472] Fix | Delete
var InputKeyDownEnd = false ? undefined : 4;
[27473] Fix | Delete
var InputKeyDownEnter = false ? undefined : 5;
[27474] Fix | Delete
var InputChange = false ? undefined : 6;
[27475] Fix | Delete
var InputBlur = false ? undefined : 7;
[27476] Fix | Delete
var MenuMouseLeave = false ? undefined : 8;
[27477] Fix | Delete
var ItemMouseMove = false ? undefined : 9;
[27478] Fix | Delete
var ItemClick = false ? undefined : 10;
[27479] Fix | Delete
var ToggleButtonClick = false ? undefined : 11;
[27480] Fix | Delete
var FunctionToggleMenu = false ? undefined : 12;
[27481] Fix | Delete
var FunctionOpenMenu = false ? undefined : 13;
[27482] Fix | Delete
var FunctionCloseMenu = false ? undefined : 14;
[27483] Fix | Delete
var FunctionSetHighlightedIndex = false ? undefined : 15;
[27484] Fix | Delete
var FunctionSelectItem = false ? undefined : 16;
[27485] Fix | Delete
var FunctionSetInputValue = false ? undefined : 17;
[27486] Fix | Delete
var FunctionReset$1 = false ? undefined : 18;
[27487] Fix | Delete
var ControlledPropUpdatedSelectedItem = false ? undefined : 19;
[27488] Fix | Delete
[27489] Fix | Delete
var stateChangeTypes$1 = /*#__PURE__*/Object.freeze({
[27490] Fix | Delete
__proto__: null,
[27491] Fix | Delete
InputKeyDownArrowDown: InputKeyDownArrowDown,
[27492] Fix | Delete
InputKeyDownArrowUp: InputKeyDownArrowUp,
[27493] Fix | Delete
InputKeyDownEscape: InputKeyDownEscape,
[27494] Fix | Delete
InputKeyDownHome: InputKeyDownHome,
[27495] Fix | Delete
InputKeyDownEnd: InputKeyDownEnd,
[27496] Fix | Delete
InputKeyDownEnter: InputKeyDownEnter,
[27497] Fix | Delete
InputChange: InputChange,
[27498] Fix | Delete
InputBlur: InputBlur,
[27499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function