Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
return dispatch({
[12500] Fix | Delete
type: "down",
[12501] Fix | Delete
allTheWay: allTheWay
[12502] Fix | Delete
});
[12503] Fix | Delete
}),
[12504] Fix | Delete
first: useAction(function () {
[12505] Fix | Delete
return dispatch({
[12506] Fix | Delete
type: "first"
[12507] Fix | Delete
});
[12508] Fix | Delete
}),
[12509] Fix | Delete
last: useAction(function () {
[12510] Fix | Delete
return dispatch({
[12511] Fix | Delete
type: "last"
[12512] Fix | Delete
});
[12513] Fix | Delete
}),
[12514] Fix | Delete
sort: useAction(function () {
[12515] Fix | Delete
return dispatch({
[12516] Fix | Delete
type: "sort"
[12517] Fix | Delete
});
[12518] Fix | Delete
}),
[12519] Fix | Delete
unstable_setVirtual: useAction(function (value) {
[12520] Fix | Delete
return dispatch({
[12521] Fix | Delete
type: "setVirtual",
[12522] Fix | Delete
virtual: value
[12523] Fix | Delete
});
[12524] Fix | Delete
}),
[12525] Fix | Delete
setRTL: useAction(function (value) {
[12526] Fix | Delete
return dispatch({
[12527] Fix | Delete
type: "setRTL",
[12528] Fix | Delete
rtl: value
[12529] Fix | Delete
});
[12530] Fix | Delete
}),
[12531] Fix | Delete
setOrientation: useAction(function (value) {
[12532] Fix | Delete
return dispatch({
[12533] Fix | Delete
type: "setOrientation",
[12534] Fix | Delete
orientation: value
[12535] Fix | Delete
});
[12536] Fix | Delete
}),
[12537] Fix | Delete
setCurrentId: useAction(function (value) {
[12538] Fix | Delete
return dispatch({
[12539] Fix | Delete
type: "setCurrentId",
[12540] Fix | Delete
currentId: value
[12541] Fix | Delete
});
[12542] Fix | Delete
}),
[12543] Fix | Delete
setLoop: useAction(function (value) {
[12544] Fix | Delete
return dispatch({
[12545] Fix | Delete
type: "setLoop",
[12546] Fix | Delete
loop: value
[12547] Fix | Delete
});
[12548] Fix | Delete
}),
[12549] Fix | Delete
setWrap: useAction(function (value) {
[12550] Fix | Delete
return dispatch({
[12551] Fix | Delete
type: "setWrap",
[12552] Fix | Delete
wrap: value
[12553] Fix | Delete
});
[12554] Fix | Delete
}),
[12555] Fix | Delete
setShift: useAction(function (value) {
[12556] Fix | Delete
return dispatch({
[12557] Fix | Delete
type: "setShift",
[12558] Fix | Delete
shift: value
[12559] Fix | Delete
});
[12560] Fix | Delete
}),
[12561] Fix | Delete
unstable_setIncludesBaseElement: useAction(function (value) {
[12562] Fix | Delete
return dispatch({
[12563] Fix | Delete
type: "setIncludesBaseElement",
[12564] Fix | Delete
includesBaseElement: value
[12565] Fix | Delete
});
[12566] Fix | Delete
}),
[12567] Fix | Delete
reset: useAction(function () {
[12568] Fix | Delete
return dispatch({
[12569] Fix | Delete
type: "reset"
[12570] Fix | Delete
});
[12571] Fix | Delete
})
[12572] Fix | Delete
});
[12573] Fix | Delete
}
[12574] Fix | Delete
[12575] Fix | Delete
[12576] Fix | Delete
[12577] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-system/es/createComponent.js + 3 modules
[12578] Fix | Delete
var createComponent = __webpack_require__("dQ10");
[12579] Fix | Delete
[12580] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-system/es/createHook.js + 4 modules
[12581] Fix | Delete
var createHook = __webpack_require__("1k9I");
[12582] Fix | Delete
[12583] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/useForkRef.js
[12584] Fix | Delete
var useForkRef = __webpack_require__("mFP7");
[12585] Fix | Delete
[12586] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-warning/es/index.js + 1 modules
[12587] Fix | Delete
var es = __webpack_require__("FyLM");
[12588] Fix | Delete
[12589] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/useLiveRef.js
[12590] Fix | Delete
var useLiveRef = __webpack_require__("+LFj");
[12591] Fix | Delete
[12592] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/isSelfTarget.js
[12593] Fix | Delete
var isSelfTarget = __webpack_require__("eXCq");
[12594] Fix | Delete
[12595] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/es/Role/Role.js
[12596] Fix | Delete
var Role = __webpack_require__("zGFp");
[12597] Fix | Delete
[12598] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/es/Tabbable/Tabbable.js
[12599] Fix | Delete
var Tabbable = __webpack_require__("G3V0");
[12600] Fix | Delete
[12601] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-system/es/useCreateElement.js
[12602] Fix | Delete
var useCreateElement = __webpack_require__("sej1");
[12603] Fix | Delete
[12604] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js
[12605] Fix | Delete
var es_rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__("vk5B");
[12606] Fix | Delete
[12607] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/createEvent.js
[12608] Fix | Delete
var createEvent = __webpack_require__("roOW");
[12609] Fix | Delete
[12610] Fix | Delete
// CONCATENATED MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/fireBlurEvent.js
[12611] Fix | Delete
[12612] Fix | Delete
[12613] Fix | Delete
[12614] Fix | Delete
[12615] Fix | Delete
function createFocusEvent(element, type, eventInit) {
[12616] Fix | Delete
if (eventInit === void 0) {
[12617] Fix | Delete
eventInit = {};
[12618] Fix | Delete
}
[12619] Fix | Delete
[12620] Fix | Delete
if (typeof FocusEvent === "function") {
[12621] Fix | Delete
return new FocusEvent(type, eventInit);
[12622] Fix | Delete
}
[12623] Fix | Delete
[12624] Fix | Delete
return Object(createEvent["a" /* createEvent */])(element, type, eventInit);
[12625] Fix | Delete
}
[12626] Fix | Delete
/**
[12627] Fix | Delete
* Creates and dispatches a blur event in a way that also works on IE 11.
[12628] Fix | Delete
*
[12629] Fix | Delete
* @example
[12630] Fix | Delete
* import { fireBlurEvent } from "reakit-utils";
[12631] Fix | Delete
*
[12632] Fix | Delete
* fireBlurEvent(document.getElementById("id"));
[12633] Fix | Delete
*/
[12634] Fix | Delete
[12635] Fix | Delete
[12636] Fix | Delete
function fireBlurEvent(element, eventInit) {
[12637] Fix | Delete
var event = createFocusEvent(element, "blur", eventInit);
[12638] Fix | Delete
var defaultAllowed = element.dispatchEvent(event);
[12639] Fix | Delete
[12640] Fix | Delete
var bubbleInit = Object(es_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(es_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, eventInit), {}, {
[12641] Fix | Delete
bubbles: true
[12642] Fix | Delete
});
[12643] Fix | Delete
[12644] Fix | Delete
element.dispatchEvent(createFocusEvent(element, "focusout", bubbleInit));
[12645] Fix | Delete
return defaultAllowed;
[12646] Fix | Delete
}
[12647] Fix | Delete
[12648] Fix | Delete
[12649] Fix | Delete
[12650] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/getWindow.js
[12651] Fix | Delete
var getWindow = __webpack_require__("OQof");
[12652] Fix | Delete
[12653] Fix | Delete
// CONCATENATED MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/fireKeyboardEvent.js
[12654] Fix | Delete
[12655] Fix | Delete
[12656] Fix | Delete
[12657] Fix | Delete
function createKeyboardEvent(element, type, eventInit) {
[12658] Fix | Delete
if (eventInit === void 0) {
[12659] Fix | Delete
eventInit = {};
[12660] Fix | Delete
}
[12661] Fix | Delete
[12662] Fix | Delete
if (typeof KeyboardEvent === "function") {
[12663] Fix | Delete
return new KeyboardEvent(type, eventInit);
[12664] Fix | Delete
} // IE 11 doesn't support Event constructors
[12665] Fix | Delete
[12666] Fix | Delete
[12667] Fix | Delete
var event = Object(getDocument["a" /* getDocument */])(element).createEvent("KeyboardEvent");
[12668] Fix | Delete
event.initKeyboardEvent(type, eventInit.bubbles, eventInit.cancelable, Object(getWindow["a" /* getWindow */])(element), eventInit.key, eventInit.location, eventInit.ctrlKey, eventInit.altKey, eventInit.shiftKey, eventInit.metaKey);
[12669] Fix | Delete
return event;
[12670] Fix | Delete
}
[12671] Fix | Delete
/**
[12672] Fix | Delete
* Creates and dispatches `KeyboardEvent` in a way that also works on IE 11.
[12673] Fix | Delete
*
[12674] Fix | Delete
* @example
[12675] Fix | Delete
* import { fireKeyboardEvent } from "reakit-utils";
[12676] Fix | Delete
*
[12677] Fix | Delete
* fireKeyboardEvent(document.getElementById("id"), "keydown", {
[12678] Fix | Delete
* key: "ArrowDown",
[12679] Fix | Delete
* shiftKey: true,
[12680] Fix | Delete
* });
[12681] Fix | Delete
*/
[12682] Fix | Delete
[12683] Fix | Delete
[12684] Fix | Delete
function fireKeyboardEvent(element, type, eventInit) {
[12685] Fix | Delete
return element.dispatchEvent(createKeyboardEvent(element, type, eventInit));
[12686] Fix | Delete
}
[12687] Fix | Delete
[12688] Fix | Delete
[12689] Fix | Delete
[12690] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/canUseDOM.js
[12691] Fix | Delete
var canUseDOM = __webpack_require__("PcbF");
[12692] Fix | Delete
[12693] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/getActiveElement.js
[12694] Fix | Delete
var getActiveElement = __webpack_require__("z222");
[12695] Fix | Delete
[12696] Fix | Delete
// CONCATENATED MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/getNextActiveElementOnBlur.js
[12697] Fix | Delete
[12698] Fix | Delete
[12699] Fix | Delete
[12700] Fix | Delete
[12701] Fix | Delete
[12702] Fix | Delete
var isIE11 = canUseDOM["a" /* canUseDOM */] && "msCrypto" in window;
[12703] Fix | Delete
/**
[12704] Fix | Delete
* Cross-browser method that returns the next active element (the element that
[12705] Fix | Delete
* is receiving focus) after a blur event is dispatched. It receives the blur
[12706] Fix | Delete
* event object as the argument.
[12707] Fix | Delete
*
[12708] Fix | Delete
* @example
[12709] Fix | Delete
* import { getNextActiveElementOnBlur } from "reakit-utils";
[12710] Fix | Delete
*
[12711] Fix | Delete
* const element = document.getElementById("id");
[12712] Fix | Delete
* element.addEventListener("blur", (event) => {
[12713] Fix | Delete
* const nextActiveElement = getNextActiveElementOnBlur(event);
[12714] Fix | Delete
* });
[12715] Fix | Delete
*/
[12716] Fix | Delete
[12717] Fix | Delete
function getNextActiveElementOnBlur(event) {
[12718] Fix | Delete
// IE 11 doesn't support event.relatedTarget on blur.
[12719] Fix | Delete
// document.activeElement points the the next active element.
[12720] Fix | Delete
// On modern browsers, document.activeElement points to the current target.
[12721] Fix | Delete
if (isIE11) {
[12722] Fix | Delete
var activeElement = Object(getActiveElement["a" /* getActiveElement */])(event.currentTarget);
[12723] Fix | Delete
return activeElement;
[12724] Fix | Delete
}
[12725] Fix | Delete
[12726] Fix | Delete
return event.relatedTarget;
[12727] Fix | Delete
}
[12728] Fix | Delete
[12729] Fix | Delete
[12730] Fix | Delete
[12731] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/es/__keys-6742f591.js
[12732] Fix | Delete
var _keys_6742f591 = __webpack_require__("TFuP");
[12733] Fix | Delete
[12734] Fix | Delete
// EXTERNAL MODULE: ./node_modules/reakit/es/userFocus-e16425e3.js
[12735] Fix | Delete
var userFocus_e16425e3 = __webpack_require__("Mih7");
[12736] Fix | Delete
[12737] Fix | Delete
// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/Composite.js
[12738] Fix | Delete
[12739] Fix | Delete
[12740] Fix | Delete
[12741] Fix | Delete
[12742] Fix | Delete
[12743] Fix | Delete
[12744] Fix | Delete
[12745] Fix | Delete
[12746] Fix | Delete
[12747] Fix | Delete
[12748] Fix | Delete
[12749] Fix | Delete
[12750] Fix | Delete
[12751] Fix | Delete
[12752] Fix | Delete
[12753] Fix | Delete
[12754] Fix | Delete
[12755] Fix | Delete
[12756] Fix | Delete
[12757] Fix | Delete
[12758] Fix | Delete
[12759] Fix | Delete
[12760] Fix | Delete
[12761] Fix | Delete
[12762] Fix | Delete
[12763] Fix | Delete
[12764] Fix | Delete
[12765] Fix | Delete
[12766] Fix | Delete
[12767] Fix | Delete
var Composite_isIE11 = canUseDOM["a" /* canUseDOM */] && "msCrypto" in window;
[12768] Fix | Delete
[12769] Fix | Delete
function canProxyKeyboardEvent(event) {
[12770] Fix | Delete
if (!Object(isSelfTarget["a" /* isSelfTarget */])(event)) return false;
[12771] Fix | Delete
if (event.metaKey) return false;
[12772] Fix | Delete
if (event.key === "Tab") return false;
[12773] Fix | Delete
return true;
[12774] Fix | Delete
}
[12775] Fix | Delete
[12776] Fix | Delete
function useKeyboardEventProxy(virtual, currentItem, htmlEventHandler) {
[12777] Fix | Delete
var eventHandlerRef = Object(useLiveRef["a" /* useLiveRef */])(htmlEventHandler);
[12778] Fix | Delete
return Object(external_React_["useCallback"])(function (event) {
[12779] Fix | Delete
var _eventHandlerRef$curr;
[12780] Fix | Delete
[12781] Fix | Delete
(_eventHandlerRef$curr = eventHandlerRef.current) === null || _eventHandlerRef$curr === void 0 ? void 0 : _eventHandlerRef$curr.call(eventHandlerRef, event);
[12782] Fix | Delete
if (event.defaultPrevented) return;
[12783] Fix | Delete
[12784] Fix | Delete
if (virtual && canProxyKeyboardEvent(event)) {
[12785] Fix | Delete
var currentElement = currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current;
[12786] Fix | Delete
[12787] Fix | Delete
if (currentElement) {
[12788] Fix | Delete
if (!fireKeyboardEvent(currentElement, event.type, event)) {
[12789] Fix | Delete
event.preventDefault();
[12790] Fix | Delete
} // The event will be triggered on the composite item and then
[12791] Fix | Delete
// propagated up to this composite element again, so we can pretend
[12792] Fix | Delete
// that it wasn't called on this component in the first place.
[12793] Fix | Delete
[12794] Fix | Delete
[12795] Fix | Delete
if (event.currentTarget.contains(currentElement)) {
[12796] Fix | Delete
event.stopPropagation();
[12797] Fix | Delete
}
[12798] Fix | Delete
}
[12799] Fix | Delete
}
[12800] Fix | Delete
}, [virtual, currentItem]);
[12801] Fix | Delete
} // istanbul ignore next
[12802] Fix | Delete
[12803] Fix | Delete
[12804] Fix | Delete
function useActiveElementRef(elementRef) {
[12805] Fix | Delete
var activeElementRef = Object(external_React_["useRef"])(null);
[12806] Fix | Delete
Object(external_React_["useEffect"])(function () {
[12807] Fix | Delete
var document = Object(getDocument["a" /* getDocument */])(elementRef.current);
[12808] Fix | Delete
[12809] Fix | Delete
var onFocus = function onFocus(event) {
[12810] Fix | Delete
var target = event.target;
[12811] Fix | Delete
activeElementRef.current = target;
[12812] Fix | Delete
};
[12813] Fix | Delete
[12814] Fix | Delete
document.addEventListener("focus", onFocus, true);
[12815] Fix | Delete
return function () {
[12816] Fix | Delete
document.removeEventListener("focus", onFocus, true);
[12817] Fix | Delete
};
[12818] Fix | Delete
}, []);
[12819] Fix | Delete
return activeElementRef;
[12820] Fix | Delete
}
[12821] Fix | Delete
[12822] Fix | Delete
function findFirstEnabledItemInTheLastRow(items) {
[12823] Fix | Delete
return Object(getCurrentId_5aa9849e["a" /* f */])(flatten(reverse(groupItems(items))));
[12824] Fix | Delete
}
[12825] Fix | Delete
[12826] Fix | Delete
function isItem(items, element) {
[12827] Fix | Delete
return items === null || items === void 0 ? void 0 : items.some(function (item) {
[12828] Fix | Delete
return !!element && item.ref.current === element;
[12829] Fix | Delete
});
[12830] Fix | Delete
}
[12831] Fix | Delete
[12832] Fix | Delete
function useScheduleUserFocus(currentItem) {
[12833] Fix | Delete
var currentItemRef = Object(useLiveRef["a" /* useLiveRef */])(currentItem);
[12834] Fix | Delete
[12835] Fix | Delete
var _React$useReducer = Object(external_React_["useReducer"])(function (n) {
[12836] Fix | Delete
return n + 1;
[12837] Fix | Delete
}, 0),
[12838] Fix | Delete
scheduled = _React$useReducer[0],
[12839] Fix | Delete
schedule = _React$useReducer[1];
[12840] Fix | Delete
[12841] Fix | Delete
Object(external_React_["useEffect"])(function () {
[12842] Fix | Delete
var _currentItemRef$curre;
[12843] Fix | Delete
[12844] Fix | Delete
var currentElement = (_currentItemRef$curre = currentItemRef.current) === null || _currentItemRef$curre === void 0 ? void 0 : _currentItemRef$curre.ref.current;
[12845] Fix | Delete
[12846] Fix | Delete
if (scheduled && currentElement) {
[12847] Fix | Delete
Object(userFocus_e16425e3["c" /* u */])(currentElement);
[12848] Fix | Delete
}
[12849] Fix | Delete
}, [scheduled]);
[12850] Fix | Delete
return schedule;
[12851] Fix | Delete
}
[12852] Fix | Delete
[12853] Fix | Delete
var useComposite = Object(createHook["a" /* createHook */])({
[12854] Fix | Delete
name: "Composite",
[12855] Fix | Delete
compose: [Tabbable["a" /* useTabbable */]],
[12856] Fix | Delete
keys: _keys_6742f591["a" /* C */],
[12857] Fix | Delete
useOptions: function useOptions(options) {
[12858] Fix | Delete
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, options), {}, {
[12859] Fix | Delete
currentId: Object(getCurrentId_5aa9849e["b" /* g */])(options)
[12860] Fix | Delete
});
[12861] Fix | Delete
},
[12862] Fix | Delete
useProps: function useProps(options, _ref) {
[12863] Fix | Delete
var htmlRef = _ref.ref,
[12864] Fix | Delete
htmlOnFocusCapture = _ref.onFocusCapture,
[12865] Fix | Delete
htmlOnFocus = _ref.onFocus,
[12866] Fix | Delete
htmlOnBlurCapture = _ref.onBlurCapture,
[12867] Fix | Delete
htmlOnKeyDown = _ref.onKeyDown,
[12868] Fix | Delete
htmlOnKeyDownCapture = _ref.onKeyDownCapture,
[12869] Fix | Delete
htmlOnKeyUpCapture = _ref.onKeyUpCapture,
[12870] Fix | Delete
htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["ref", "onFocusCapture", "onFocus", "onBlurCapture", "onKeyDown", "onKeyDownCapture", "onKeyUpCapture"]);
[12871] Fix | Delete
[12872] Fix | Delete
var ref = Object(external_React_["useRef"])(null);
[12873] Fix | Delete
var currentItem = findEnabledItemById(options.items, options.currentId);
[12874] Fix | Delete
var previousElementRef = Object(external_React_["useRef"])(null);
[12875] Fix | Delete
var onFocusCaptureRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnFocusCapture);
[12876] Fix | Delete
var onFocusRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnFocus);
[12877] Fix | Delete
var onBlurCaptureRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnBlurCapture);
[12878] Fix | Delete
var onKeyDownRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnKeyDown);
[12879] Fix | Delete
var scheduleUserFocus = useScheduleUserFocus(currentItem); // IE 11 doesn't support event.relatedTarget, so we use the active element
[12880] Fix | Delete
// ref instead.
[12881] Fix | Delete
[12882] Fix | Delete
var activeElementRef = Composite_isIE11 ? useActiveElementRef(ref) : undefined;
[12883] Fix | Delete
Object(external_React_["useEffect"])(function () {
[12884] Fix | Delete
var element = ref.current;
[12885] Fix | Delete
[12886] Fix | Delete
if (options.unstable_moves && !currentItem) {
[12887] Fix | Delete
false ? undefined : void 0; // If composite.move(null) has been called, the composite container
[12888] Fix | Delete
// will receive focus.
[12889] Fix | Delete
[12890] Fix | Delete
element === null || element === void 0 ? void 0 : element.focus();
[12891] Fix | Delete
}
[12892] Fix | Delete
}, [options.unstable_moves, currentItem]);
[12893] Fix | Delete
var onKeyDownCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyDownCapture);
[12894] Fix | Delete
var onKeyUpCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyUpCapture);
[12895] Fix | Delete
var onFocusCapture = Object(external_React_["useCallback"])(function (event) {
[12896] Fix | Delete
var _onFocusCaptureRef$cu;
[12897] Fix | Delete
[12898] Fix | Delete
(_onFocusCaptureRef$cu = onFocusCaptureRef.current) === null || _onFocusCaptureRef$cu === void 0 ? void 0 : _onFocusCaptureRef$cu.call(onFocusCaptureRef, event);
[12899] Fix | Delete
if (event.defaultPrevented) return;
[12900] Fix | Delete
if (!options.unstable_virtual) return; // IE11 doesn't support event.relatedTarget, so we use the active
[12901] Fix | Delete
// element ref instead.
[12902] Fix | Delete
[12903] Fix | Delete
var previousActiveElement = (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || event.relatedTarget;
[12904] Fix | Delete
var previousActiveElementWasItem = isItem(options.items, previousActiveElement);
[12905] Fix | Delete
[12906] Fix | Delete
if (Object(isSelfTarget["a" /* isSelfTarget */])(event) && previousActiveElementWasItem) {
[12907] Fix | Delete
// Composite has been focused as a result of an item receiving focus.
[12908] Fix | Delete
// The composite item will move focus back to the composite
[12909] Fix | Delete
// container. In this case, we don't want to propagate this
[12910] Fix | Delete
// additional event nor call the onFocus handler passed to
[12911] Fix | Delete
// <Composite onFocus={...} />.
[12912] Fix | Delete
event.stopPropagation(); // We keep track of the previous active item element so we can
[12913] Fix | Delete
// manually fire a blur event on it later when the focus is moved to
[12914] Fix | Delete
// another item on the onBlurCapture event below.
[12915] Fix | Delete
[12916] Fix | Delete
previousElementRef.current = previousActiveElement;
[12917] Fix | Delete
}
[12918] Fix | Delete
}, [options.unstable_virtual, options.items]);
[12919] Fix | Delete
var onFocus = Object(external_React_["useCallback"])(function (event) {
[12920] Fix | Delete
var _onFocusRef$current;
[12921] Fix | Delete
[12922] Fix | Delete
(_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event);
[12923] Fix | Delete
if (event.defaultPrevented) return;
[12924] Fix | Delete
[12925] Fix | Delete
if (options.unstable_virtual) {
[12926] Fix | Delete
if (Object(isSelfTarget["a" /* isSelfTarget */])(event)) {
[12927] Fix | Delete
// This means that the composite element has been focused while the
[12928] Fix | Delete
// composite item has not. For example, by clicking on the
[12929] Fix | Delete
// composite element without touching any item, or by tabbing into
[12930] Fix | Delete
// the composite element. In this case, we want to trigger focus on
[12931] Fix | Delete
// the item, just like it would happen with roving tabindex.
[12932] Fix | Delete
// When it receives focus, the composite item will put focus back
[12933] Fix | Delete
// on the composite element, in which case hasItemWithFocus will be
[12934] Fix | Delete
// true.
[12935] Fix | Delete
scheduleUserFocus();
[12936] Fix | Delete
}
[12937] Fix | Delete
} else if (Object(isSelfTarget["a" /* isSelfTarget */])(event)) {
[12938] Fix | Delete
var _options$setCurrentId;
[12939] Fix | Delete
[12940] Fix | Delete
// When the roving tabindex composite gets intentionally focused (for
[12941] Fix | Delete
// example, by clicking directly on it, and not on an item), we make
[12942] Fix | Delete
// sure to set the current id to null (which means the composite
[12943] Fix | Delete
// itself is focused).
[12944] Fix | Delete
(_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, null);
[12945] Fix | Delete
}
[12946] Fix | Delete
}, [options.unstable_virtual, options.setCurrentId]);
[12947] Fix | Delete
var onBlurCapture = Object(external_React_["useCallback"])(function (event) {
[12948] Fix | Delete
var _onBlurCaptureRef$cur;
[12949] Fix | Delete
[12950] Fix | Delete
(_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event);
[12951] Fix | Delete
if (event.defaultPrevented) return;
[12952] Fix | Delete
if (!options.unstable_virtual) return; // When virtual is set to true, we move focus from the composite
[12953] Fix | Delete
// container (this component) to the composite item that is being
[12954] Fix | Delete
// selected. Then we move focus back to the composite container. This
[12955] Fix | Delete
// is so we can provide the same API as the roving tabindex method,
[12956] Fix | Delete
// which means people can attach onFocus/onBlur handlers on the
[12957] Fix | Delete
// CompositeItem component regardless of whether it's virtual or not.
[12958] Fix | Delete
// This sequence of blurring and focusing items and composite may be
[12959] Fix | Delete
// confusing, so we ignore intermediate focus and blurs by stopping its
[12960] Fix | Delete
// propagation and not calling the passed onBlur handler (htmlOnBlur).
[12961] Fix | Delete
[12962] Fix | Delete
var currentElement = (currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current) || null;
[12963] Fix | Delete
var nextActiveElement = getNextActiveElementOnBlur(event);
[12964] Fix | Delete
var nextActiveElementIsItem = isItem(options.items, nextActiveElement);
[12965] Fix | Delete
[12966] Fix | Delete
if (Object(isSelfTarget["a" /* isSelfTarget */])(event) && nextActiveElementIsItem) {
[12967] Fix | Delete
// This is an intermediate blur event: blurring the composite
[12968] Fix | Delete
// container to focus an item (nextActiveElement).
[12969] Fix | Delete
if (nextActiveElement === currentElement) {
[12970] Fix | Delete
// The next active element will be the same as the current item in
[12971] Fix | Delete
// the state in two scenarios:
[12972] Fix | Delete
// - Moving focus with keyboard: the state is updated before the
[12973] Fix | Delete
// blur event is triggered, so here the current item is already
[12974] Fix | Delete
// pointing to the next active element.
[12975] Fix | Delete
// - Clicking on the current active item with a pointer: this
[12976] Fix | Delete
// will trigger blur on the composite element and then the next
[12977] Fix | Delete
// active element will be the same as the current item. Clicking on
[12978] Fix | Delete
// an item other than the current one doesn't end up here as the
[12979] Fix | Delete
// currentItem state will be updated only after it.
[12980] Fix | Delete
if (previousElementRef.current && previousElementRef.current !== nextActiveElement) {
[12981] Fix | Delete
// If there's a previous active item and it's not a click action,
[12982] Fix | Delete
// then we fire a blur event on it so it will work just like if
[12983] Fix | Delete
// it had DOM focus before (like when using roving tabindex).
[12984] Fix | Delete
fireBlurEvent(previousElementRef.current, event);
[12985] Fix | Delete
}
[12986] Fix | Delete
} else if (currentElement) {
[12987] Fix | Delete
// This will be true when the next active element is not the
[12988] Fix | Delete
// current element, but there's a current item. This will only
[12989] Fix | Delete
// happen when clicking with a pointer on a different item, when
[12990] Fix | Delete
// there's already an item selected, in which case currentElement
[12991] Fix | Delete
// is the item that is getting blurred, and nextActiveElement is
[12992] Fix | Delete
// the item that is being clicked.
[12993] Fix | Delete
fireBlurEvent(currentElement, event);
[12994] Fix | Delete
} // We want to ignore intermediate blur events, so we stop its
[12995] Fix | Delete
// propagation and return early so onFocus will not be called.
[12996] Fix | Delete
[12997] Fix | Delete
[12998] Fix | Delete
event.stopPropagation();
[12999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function