@konstructio/ui 0.1.2-alpha.103 → 0.1.2-alpha.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -21
- package/dist/{AdditionalOptions-Cj29eeMF.js → AdditionalOptions-D0BAS2HG.js} +1 -1
- package/dist/{AlertDialogTrigger-CgcsW_ta.js → AlertDialogTrigger-BGo_acd5.js} +3 -3
- package/dist/{Checkbox-DzAx7n67.js → Checkbox-B_ngk9Dj.js} +56 -56
- package/dist/{Combination-cjXRJS03.js → Combination-CnMM05mt.js} +51 -45
- package/dist/{CommandInput-BnvRMfLI.js → CommandInput-BLq69pOT.js} +1 -1
- package/dist/Counter-BV680M5r.js +195 -0
- package/dist/DropdownButton-DfNojmCW.js +493 -0
- package/dist/{FlagSelectorList-BoYG-_It.js → FlagSelectorList-CkTR3j6O.js} +222 -218
- package/dist/{HamburgerTrigger-1vOTrm8-.js → HamburgerTrigger-DRylBL2d.js} +1 -1
- package/dist/{ImageUpload-DZTm4SBB.js → ImageUpload-DiwymQcU.js} +1 -1
- package/dist/{Input-CW0VwW2T.js → Input-Cf44DzfE.js} +18 -18
- package/dist/{Loading-fD0Xiyeq.js → Loading-DUh9PMJN.js} +3 -1
- package/dist/Modal-Dyn088X7.js +81 -0
- package/dist/Sidebar.css +1 -1
- package/dist/{Spinner-Lw9mZYhg.js → Spinner-CUwE2bLm.js} +1 -1
- package/dist/{Switch-WBRr8uOJ.js → Switch-aPhL5rNG.js} +4 -4
- package/dist/{Toast-ByH-l4XK.js → Toast-3NEz7LLa.js} +149 -148
- package/dist/Wrapper-BhqUVI1G.js +171 -0
- package/dist/Wrapper-CVJSuYWx.js +114 -0
- package/dist/{Wrapper-XeeD3av7.js → Wrapper-DP6Sxngx.js} +185 -180
- package/dist/components/Alert/Alert.js +21 -21
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/AlertDialog/hooks/useAlertDialog.js +14 -10
- package/dist/components/Autocomplete/components/List/List.js +22 -26
- package/dist/components/Autocomplete/components/List/List.variants.js +7 -19
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +39 -38
- package/dist/components/Autocomplete/hooks/useNavigationList.js +2 -1
- package/dist/components/Badge/Badge.js +37 -36
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +6 -6
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +2 -2
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Command/components/index.js +1 -1
- package/dist/components/Command/contexts/Command.provider.js +16 -12
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +57 -58
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +42 -43
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +42 -50
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +61 -79
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.js +89 -122
- package/dist/components/Datepicker/DatePicker.js +13 -13
- package/dist/components/Drawer/Drawer.js +54 -49
- package/dist/components/Drawer/hooks/useDrawer.js +39 -44
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +23 -22
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +42 -56
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +30 -43
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +36 -49
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +1 -1
- package/dist/components/Filter/components/ResetButton/ResetButton.js +21 -18
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +1 -1
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +31 -45
- package/dist/components/Filter/contexts/filter.provider.js +15 -10
- package/dist/components/Filter/events/index.js +26 -5
- package/dist/components/Filter/hooks/index.js +4 -0
- package/dist/components/Filter/hooks/useFilterDropdownSync.js +26 -0
- package/dist/components/ImageUpload/ImageUpload.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Loading/Loading.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Modal/contexts/Modal.provider.js +26 -19
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/MultiSelectDropdown/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +14 -13
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +6 -4
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +16 -16
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PieChart/PieChart.js +33 -32
- package/dist/components/ProgressBar/ProgressBar.js +26 -20
- package/dist/components/Radio/Radio.js +28 -30
- package/dist/components/RadioCardGroup/RadioCardGroup.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.js +24 -24
- package/dist/components/Range/Range.js +15 -13
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
- package/dist/components/Select/components/List/List.js +2 -2
- package/dist/components/Select/components/ListItem/ListItem.js +30 -30
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/Select/components/index.js +2 -2
- package/dist/components/Select/hooks/useSelect.js +39 -38
- package/dist/components/Sidebar/Sidebar.js +21 -18
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +30 -0
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.js +20 -0
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +14 -10
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +14 -4
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +41 -37
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +4 -5
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +75 -68
- package/dist/components/Sidebar/components/index.js +17 -15
- package/dist/components/Sidebar/contexts/SidebarContext.js +8 -5
- package/dist/components/Slider/Slider.js +17 -15
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stepper/Stepper.variants.js +6 -6
- package/dist/components/Stepper/hooks/useStepItemLogic.js +12 -17
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +17 -17
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/TagSelect/components/index.js +1 -1
- package/dist/components/TagSelect/hooks/useTagSelect.js +12 -11
- package/dist/components/TimePicker/components/HoursList/HoursList.js +34 -38
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +25 -29
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +33 -33
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +91 -99
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +29 -30
- package/dist/components/TimePicker/contexts/time-picker.provider.js +10 -10
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Toast/Toast.variants.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +32 -29
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +0 -2
- package/dist/components/VirtualizedTable/components/Body/Body.js +5 -5
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +55 -53
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +1 -1
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/VirtualizedTable/events/filters/filters.js +7 -0
- package/dist/components/VirtualizedTable/events/index.js +10 -25
- package/dist/components/VirtualizedTable/events/refresh/refresh.js +7 -0
- package/dist/components/VirtualizedTable/events/row/row.js +22 -0
- package/dist/components/VirtualizedTable/utils/get-table-id.js +4 -0
- package/dist/components/VirtualizedTable/utils/index.js +4 -2
- package/dist/components/index.js +95 -89
- package/dist/{components-BIHlj4yH.js → components-Cf345jTv.js} +45 -41
- package/dist/constants-CxJJRVK3.js +31 -0
- package/dist/{dist-DISvWx7U.js → dist-BUocnzkM.js} +1 -1
- package/dist/{dist-Dse3gSmZ.js → dist-BZNE2Tnx.js} +4 -4
- package/dist/{dist-2bGlmy8N2.js → dist-BaPW7qXd2.js} +27 -26
- package/dist/dist-BdobXn93.js +192 -0
- package/dist/dist-BlPTJNIm.js +118 -0
- package/dist/{dist-BiJrNvNo.js → dist-C3YVLapk.js} +29 -28
- package/dist/dist-C4j75TwZ.js +20 -0
- package/dist/dist-CCdbu9GU.js +46 -0
- package/dist/dist-CzKqHuqJ2.js +427 -0
- package/dist/dist-D-yS0HN8.js +228 -0
- package/dist/dist-D5XYRjmR.js +15 -0
- package/dist/dist-DDck_2lb.js +451 -0
- package/dist/{dist-C2aTw0m62.js → dist-DFCz63oC2.js} +5 -5
- package/dist/dist-DGOjiAnB2.js +14 -0
- package/dist/dist-DKryKPmP.js +193 -0
- package/dist/{dist-CTvBzxW8.js → dist-DX0sBG3Q.js} +1 -1
- package/dist/dist-DYIabsrY.js +17 -0
- package/dist/dist-pWlMx4Fi2.js +36 -0
- package/dist/{dist-CVDFmWf2.js → dist-tGUUcv8n.js} +17 -16
- package/dist/dist-xCbHbMLA.js +116 -0
- package/dist/{es2015-BWf6xQHm.js → es2015-CoHq2g4y.js} +95 -86
- package/dist/es2015-DigR3dar.js +795 -0
- package/dist/events.types-BG1Uh8i6.js +6 -0
- package/dist/hooks/index.js +6 -4
- package/dist/hooks/useClickOutside.js +14 -0
- package/dist/index.js +146 -138
- package/dist/lib/components/Autocomplete/components/List/List.variants.d.ts +0 -1
- package/dist/lib/components/DropdownButton/DropdownButton.d.ts +5 -6
- package/dist/lib/components/DropdownButton/DropdownButton.types.d.ts +2 -0
- package/dist/lib/components/Filter/Filter.types.d.ts +2 -0
- package/dist/lib/components/Filter/contexts/filter.context.d.ts +1 -0
- package/dist/lib/components/Filter/events/index.d.ts +10 -2
- package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
- package/dist/lib/components/Filter/hooks/useFilterDropdownSync.d.ts +2 -0
- package/dist/lib/components/Filter/hooks/useFilterDropdownSync.types.d.ts +5 -0
- package/dist/lib/components/PieChart/PieChart.types.d.ts +4 -4
- package/dist/lib/components/ProgressBar/ProgressBar.types.d.ts +2 -0
- package/dist/lib/components/Select/hooks/useSelect.d.ts +2 -1
- package/dist/lib/components/Sidebar/Sidebar.d.ts +2 -2
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +6 -5
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.types.d.ts +4 -0
- package/dist/lib/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.d.ts +1 -0
- package/dist/lib/components/Sidebar/components/Logo/Logo.types.d.ts +8 -0
- package/dist/lib/components/Sidebar/components/Logo/Logo.variants.d.ts +3 -1
- package/dist/lib/components/Sidebar/components/index.d.ts +2 -0
- package/dist/lib/components/Sidebar/contexts/SidebarContext.d.ts +12 -0
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/events/events.types.d.ts +11 -0
- package/dist/lib/components/VirtualizedTable/events/filters/filters.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/events/index.d.ts +4 -14
- package/dist/lib/components/VirtualizedTable/events/refresh/refresh.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/events/refresh/refresh.types.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/events/row/row.d.ts +3 -0
- package/dist/lib/components/VirtualizedTable/utils/get-table-id.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/utils/index.d.ts +1 -0
- package/dist/lib/components/index.d.ts +2 -2
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/useClickOutside.d.ts +2 -0
- package/dist/package.json +24 -24
- package/dist/styles.css +1 -1
- package/dist/{table.provider-2sAkE7z_.js → table.provider-B0BafHuU.js} +395 -381
- package/dist/ui/civo-theme.css +4 -0
- package/dist/ui/kubefirst-theme.css +4 -0
- package/package.json +24 -24
- package/dist/Counter-CY0xGnVM.js +0 -208
- package/dist/DropdownButton-DnlwdPmb.js +0 -92
- package/dist/Modal-Bfzggwlr.js +0 -76
- package/dist/Wrapper-ClJ_Mham.js +0 -110
- package/dist/Wrapper-DNEn4fef.js +0 -161
- package/dist/constants-DXrF9vV4.js +0 -31
- package/dist/dist-B-Aoze_D.js +0 -10
- package/dist/dist-BuFiu480.js +0 -13
- package/dist/dist-C2s4VX-42.js +0 -31
- package/dist/dist-CT6d9xe7.js +0 -441
- package/dist/dist-CVy-ulDZ.js +0 -42
- package/dist/dist-D4FePjTS.js +0 -194
- package/dist/dist-Db6UeFo4.js +0 -291
- package/dist/dist-DqKFpce5.js +0 -98
- package/dist/dist-j7FOUrFU.js +0 -206
- package/dist/dist-l-aDnQZC.js +0 -62
- package/dist/dist-ppXKUlVt.js +0 -10
- /package/dist/{x-a_LpoXzG.js → x-a_LpoXzG2.js} +0 -0
|
@@ -0,0 +1,795 @@
|
|
|
1
|
+
import { o as Sr } from "./rolldown-runtime-Ck3dxwZt.js";
|
|
2
|
+
import { t as Nr } from "./prop-types-CfEYxTbR.js";
|
|
3
|
+
import { i as Tr, n as ie, r as Pr } from "./Combination-CnMM05mt.js";
|
|
4
|
+
import O, { Fragment as Ce, PureComponent as _r, createContext as Ar, forwardRef as Le, useCallback as L, useEffect as Dr, useMemo as Mr, useRef as X, useState as Z } from "react";
|
|
5
|
+
function Cr(e, r) {
|
|
6
|
+
if (e == null) return {};
|
|
7
|
+
var t = {};
|
|
8
|
+
for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
|
|
9
|
+
if (r.indexOf(n) !== -1) continue;
|
|
10
|
+
t[n] = e[n];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
function W() {
|
|
15
|
+
return W = Object.assign ? Object.assign.bind() : function(e) {
|
|
16
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
17
|
+
var t = arguments[r];
|
|
18
|
+
for (var n in t) ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
19
|
+
}
|
|
20
|
+
return e;
|
|
21
|
+
}, W.apply(null, arguments);
|
|
22
|
+
}
|
|
23
|
+
var ne = "data-focus-lock", ke = "data-focus-lock-disabled", Lr = "data-no-focus-lock", kr = "data-autofocus-inside", Rr = "data-no-autofocus", d = /* @__PURE__ */ Sr(Nr()), R = {
|
|
24
|
+
width: "1px",
|
|
25
|
+
height: "0px",
|
|
26
|
+
padding: 0,
|
|
27
|
+
overflow: "hidden",
|
|
28
|
+
position: "fixed",
|
|
29
|
+
top: "1px",
|
|
30
|
+
left: "1px"
|
|
31
|
+
}, Wr = function(r) {
|
|
32
|
+
var t = r.children, n = t === void 0 ? null : t;
|
|
33
|
+
return /* @__PURE__ */ O.createElement(Ce, null, /* @__PURE__ */ O.createElement("div", {
|
|
34
|
+
key: "guard-first",
|
|
35
|
+
"data-focus-guard": !0,
|
|
36
|
+
"data-focus-auto-guard": !0,
|
|
37
|
+
style: R
|
|
38
|
+
}), n, n && /* @__PURE__ */ O.createElement("div", {
|
|
39
|
+
key: "guard-last",
|
|
40
|
+
"data-focus-guard": !0,
|
|
41
|
+
"data-focus-auto-guard": !0,
|
|
42
|
+
style: R
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
Wr.propTypes = process.env.NODE_ENV !== "production" ? { children: d.default.node } : {};
|
|
46
|
+
var Re = ie({}, function(e) {
|
|
47
|
+
return {
|
|
48
|
+
target: e.target,
|
|
49
|
+
currentTarget: e.currentTarget
|
|
50
|
+
};
|
|
51
|
+
}), We = ie(), Ur = ie(), Br = Pr({
|
|
52
|
+
async: !0,
|
|
53
|
+
ssr: typeof document < "u"
|
|
54
|
+
}), Gr = /* @__PURE__ */ Ar(void 0), jr = [], ce = /* @__PURE__ */ Le(function(r, t) {
|
|
55
|
+
var n, o = Z(), u = o[0], a = o[1], f = X(), v = X(!1), c = X(null), m = Z({})[1], s = r.children, i = r.disabled, l = i === void 0 ? !1 : i, p = r.noFocusGuards, h = p === void 0 ? !1 : p, F = r.persistentFocus, x = F === void 0 ? !1 : F, b = r.crossFrame, y = b === void 0 ? !0 : b, E = r.autoFocus, S = E === void 0 ? !0 : E, H = r.allowTextSelection, V = r.group, Y = r.className, sr = r.whiteList, dr = r.hasPositiveIndices, ge = r.shards, z = ge === void 0 ? jr : ge, Fe = r.as, Ee = Fe === void 0 ? "div" : Fe, Oe = r.lockProps, lr = Oe === void 0 ? {} : Oe, vr = r.sideCar, xe = r.returnFocus, q = xe === void 0 ? !1 : xe, mr = r.focusOptions, J = r.onActivation, Q = r.onDeactivation, pr = Z({})[0], br = L(function(I) {
|
|
56
|
+
var _ = I.captureFocusRestore;
|
|
57
|
+
if (!c.current) {
|
|
58
|
+
var A, N = (A = document) == null ? void 0 : A.activeElement;
|
|
59
|
+
c.current = N, N !== document.body && (c.current = _(N));
|
|
60
|
+
}
|
|
61
|
+
f.current && J && J(f.current), v.current = !0, m();
|
|
62
|
+
}, [J]), hr = L(function() {
|
|
63
|
+
v.current = !1, Q && Q(f.current), m();
|
|
64
|
+
}, [Q]), yr = L(function(I) {
|
|
65
|
+
var _ = c.current;
|
|
66
|
+
if (_) {
|
|
67
|
+
var A = (typeof _ == "function" ? _() : _) || document.body, N = typeof q == "function" ? q(A) : q;
|
|
68
|
+
if (N) {
|
|
69
|
+
var Ie = typeof N == "object" ? N : void 0;
|
|
70
|
+
c.current = null, I ? Promise.resolve().then(function() {
|
|
71
|
+
return A.focus(Ie);
|
|
72
|
+
}) : A.focus(Ie);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, [q]), gr = L(function(I) {
|
|
76
|
+
v.current && Re.useMedium(I);
|
|
77
|
+
}, []), Fr = We.useMedium, Er = L(function(I) {
|
|
78
|
+
f.current !== I && (f.current = I, a(I));
|
|
79
|
+
}, []);
|
|
80
|
+
process.env.NODE_ENV !== "production" && (typeof H < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), Dr(function() {
|
|
81
|
+
!f.current && typeof Ee != "string" && console.error("FocusLock: could not obtain ref to internal node");
|
|
82
|
+
}, []));
|
|
83
|
+
var Or = W((n = {}, n[ke] = l && "disabled", n[ne] = V, n), lr), we = h !== !0, xr = we && h !== "tail", wr = Tr([t, Er]), Ir = Mr(function() {
|
|
84
|
+
return {
|
|
85
|
+
observed: f,
|
|
86
|
+
shards: z,
|
|
87
|
+
enabled: !l,
|
|
88
|
+
get active() {
|
|
89
|
+
return v.current;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}, [
|
|
93
|
+
l,
|
|
94
|
+
v,
|
|
95
|
+
z,
|
|
96
|
+
f
|
|
97
|
+
]);
|
|
98
|
+
return /* @__PURE__ */ O.createElement(Ce, null, we && [/* @__PURE__ */ O.createElement("div", {
|
|
99
|
+
key: "guard-first",
|
|
100
|
+
"data-focus-guard": !0,
|
|
101
|
+
tabIndex: l ? -1 : 0,
|
|
102
|
+
style: R
|
|
103
|
+
}), dr ? /* @__PURE__ */ O.createElement("div", {
|
|
104
|
+
key: "guard-nearest",
|
|
105
|
+
"data-focus-guard": !0,
|
|
106
|
+
tabIndex: l ? -1 : 1,
|
|
107
|
+
style: R
|
|
108
|
+
}) : null], !l && /* @__PURE__ */ O.createElement(vr, {
|
|
109
|
+
id: pr,
|
|
110
|
+
sideCar: Br,
|
|
111
|
+
observed: u,
|
|
112
|
+
disabled: l,
|
|
113
|
+
persistentFocus: x,
|
|
114
|
+
crossFrame: y,
|
|
115
|
+
autoFocus: S,
|
|
116
|
+
whiteList: sr,
|
|
117
|
+
shards: z,
|
|
118
|
+
onActivation: br,
|
|
119
|
+
onDeactivation: hr,
|
|
120
|
+
returnFocus: yr,
|
|
121
|
+
focusOptions: mr,
|
|
122
|
+
noFocusGuards: h
|
|
123
|
+
}), /* @__PURE__ */ O.createElement(Ee, W({ ref: wr }, Or, {
|
|
124
|
+
className: Y,
|
|
125
|
+
onBlur: Fr,
|
|
126
|
+
onFocus: gr
|
|
127
|
+
}), /* @__PURE__ */ O.createElement(Gr.Provider, { value: Ir }, s)), xr && /* @__PURE__ */ O.createElement("div", {
|
|
128
|
+
"data-focus-guard": !0,
|
|
129
|
+
tabIndex: l ? -1 : 0,
|
|
130
|
+
style: R
|
|
131
|
+
}));
|
|
132
|
+
});
|
|
133
|
+
ce.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
134
|
+
children: d.node,
|
|
135
|
+
disabled: d.bool,
|
|
136
|
+
returnFocus: (0, d.oneOfType)([
|
|
137
|
+
d.bool,
|
|
138
|
+
d.object,
|
|
139
|
+
d.func
|
|
140
|
+
]),
|
|
141
|
+
focusOptions: d.object,
|
|
142
|
+
noFocusGuards: d.bool,
|
|
143
|
+
hasPositiveIndices: d.bool,
|
|
144
|
+
allowTextSelection: d.bool,
|
|
145
|
+
autoFocus: d.bool,
|
|
146
|
+
persistentFocus: d.bool,
|
|
147
|
+
crossFrame: d.bool,
|
|
148
|
+
group: d.string,
|
|
149
|
+
className: d.string,
|
|
150
|
+
whiteList: d.func,
|
|
151
|
+
shards: (0, d.arrayOf)(d.any),
|
|
152
|
+
as: (0, d.oneOfType)([
|
|
153
|
+
d.string,
|
|
154
|
+
d.func,
|
|
155
|
+
d.object
|
|
156
|
+
]),
|
|
157
|
+
lockProps: d.object,
|
|
158
|
+
onActivation: d.func,
|
|
159
|
+
onDeactivation: d.func,
|
|
160
|
+
sideCar: d.any.isRequired
|
|
161
|
+
} : {};
|
|
162
|
+
function oe(e, r) {
|
|
163
|
+
return oe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, n) {
|
|
164
|
+
return t.__proto__ = n, t;
|
|
165
|
+
}, oe(e, r);
|
|
166
|
+
}
|
|
167
|
+
function Hr(e, r) {
|
|
168
|
+
e.prototype = Object.create(r.prototype), e.prototype.constructor = e, oe(e, r);
|
|
169
|
+
}
|
|
170
|
+
function U(e) {
|
|
171
|
+
"@babel/helpers - typeof";
|
|
172
|
+
return U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
|
|
173
|
+
return typeof r;
|
|
174
|
+
} : function(r) {
|
|
175
|
+
return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
|
|
176
|
+
}, U(e);
|
|
177
|
+
}
|
|
178
|
+
function Vr(e, r) {
|
|
179
|
+
if (U(e) != "object" || !e) return e;
|
|
180
|
+
var t = e[Symbol.toPrimitive];
|
|
181
|
+
if (t !== void 0) {
|
|
182
|
+
var n = t.call(e, r || "default");
|
|
183
|
+
if (U(n) != "object") return n;
|
|
184
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
185
|
+
}
|
|
186
|
+
return (r === "string" ? String : Number)(e);
|
|
187
|
+
}
|
|
188
|
+
function qr(e) {
|
|
189
|
+
var r = Vr(e, "string");
|
|
190
|
+
return U(r) == "symbol" ? r : r + "";
|
|
191
|
+
}
|
|
192
|
+
function $r(e, r, t) {
|
|
193
|
+
return (r = qr(r)) in e ? Object.defineProperty(e, r, {
|
|
194
|
+
value: t,
|
|
195
|
+
enumerable: !0,
|
|
196
|
+
configurable: !0,
|
|
197
|
+
writable: !0
|
|
198
|
+
}) : e[r] = t, e;
|
|
199
|
+
}
|
|
200
|
+
function Kr(e, r) {
|
|
201
|
+
if (process.env.NODE_ENV !== "production") {
|
|
202
|
+
if (typeof e != "function") throw new Error("Expected reducePropsToState to be a function.");
|
|
203
|
+
if (typeof r != "function") throw new Error("Expected handleStateChangeOnClient to be a function.");
|
|
204
|
+
}
|
|
205
|
+
function t(n) {
|
|
206
|
+
return n.displayName || n.name || "Component";
|
|
207
|
+
}
|
|
208
|
+
return function(o) {
|
|
209
|
+
if (process.env.NODE_ENV !== "production" && typeof o != "function")
|
|
210
|
+
throw new Error("Expected WrappedComponent to be a React component.");
|
|
211
|
+
var u = [], a;
|
|
212
|
+
function f() {
|
|
213
|
+
a = e(u.map(function(c) {
|
|
214
|
+
return c.props;
|
|
215
|
+
})), r(a);
|
|
216
|
+
}
|
|
217
|
+
var v = /* @__PURE__ */ (function(c) {
|
|
218
|
+
Hr(m, c);
|
|
219
|
+
function m() {
|
|
220
|
+
return c.apply(this, arguments) || this;
|
|
221
|
+
}
|
|
222
|
+
m.peek = function() {
|
|
223
|
+
return a;
|
|
224
|
+
};
|
|
225
|
+
var s = m.prototype;
|
|
226
|
+
return s.componentDidMount = function() {
|
|
227
|
+
u.push(this), f();
|
|
228
|
+
}, s.componentDidUpdate = function() {
|
|
229
|
+
f();
|
|
230
|
+
}, s.componentWillUnmount = function() {
|
|
231
|
+
var l = u.indexOf(this);
|
|
232
|
+
u.splice(l, 1), f();
|
|
233
|
+
}, s.render = function() {
|
|
234
|
+
return /* @__PURE__ */ O.createElement(o, this.props);
|
|
235
|
+
}, m;
|
|
236
|
+
})(_r);
|
|
237
|
+
return $r(v, "displayName", "SideEffect(" + t(o) + ")"), v;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
var w = function(e) {
|
|
241
|
+
for (var r = Array(e.length), t = 0; t < e.length; ++t) r[t] = e[t];
|
|
242
|
+
return r;
|
|
243
|
+
}, P = function(e) {
|
|
244
|
+
return Array.isArray(e) ? e : [e];
|
|
245
|
+
}, Ue = function(e) {
|
|
246
|
+
return Array.isArray(e) ? e[0] : e;
|
|
247
|
+
}, Yr = function(e) {
|
|
248
|
+
if (e.nodeType !== Node.ELEMENT_NODE) return !1;
|
|
249
|
+
var r = window.getComputedStyle(e, null);
|
|
250
|
+
return !r || !r.getPropertyValue ? !1 : r.getPropertyValue("display") === "none" || r.getPropertyValue("visibility") === "hidden";
|
|
251
|
+
}, Be = function(e) {
|
|
252
|
+
return e.parentNode && e.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? e.parentNode.host : e.parentNode;
|
|
253
|
+
}, Ge = function(e) {
|
|
254
|
+
return e === document || e && e.nodeType === Node.DOCUMENT_NODE;
|
|
255
|
+
}, zr = function(e) {
|
|
256
|
+
return e.hasAttribute("inert");
|
|
257
|
+
}, Jr = function(e, r) {
|
|
258
|
+
return !e || Ge(e) || !Yr(e) && !zr(e) && r(Be(e));
|
|
259
|
+
}, je = function(e, r) {
|
|
260
|
+
var t = e.get(r);
|
|
261
|
+
if (t !== void 0) return t;
|
|
262
|
+
var n = Jr(r, je.bind(void 0, e));
|
|
263
|
+
return e.set(r, n), n;
|
|
264
|
+
}, Qr = function(e, r) {
|
|
265
|
+
return e && !Ge(e) ? et(e) ? r(Be(e)) : !1 : !0;
|
|
266
|
+
}, He = function(e, r) {
|
|
267
|
+
var t = e.get(r);
|
|
268
|
+
if (t !== void 0) return t;
|
|
269
|
+
var n = Qr(r, He.bind(void 0, e));
|
|
270
|
+
return e.set(r, n), n;
|
|
271
|
+
}, Ve = function(e) {
|
|
272
|
+
return e.dataset;
|
|
273
|
+
}, Xr = function(e) {
|
|
274
|
+
return e.tagName === "BUTTON";
|
|
275
|
+
}, qe = function(e) {
|
|
276
|
+
return e.tagName === "INPUT";
|
|
277
|
+
}, $e = function(e) {
|
|
278
|
+
return qe(e) && e.type === "radio";
|
|
279
|
+
}, Zr = function(e) {
|
|
280
|
+
return !((qe(e) || Xr(e)) && (e.type === "hidden" || e.disabled));
|
|
281
|
+
}, et = function(e) {
|
|
282
|
+
var r = e.getAttribute(Rr);
|
|
283
|
+
return ![
|
|
284
|
+
!0,
|
|
285
|
+
"true",
|
|
286
|
+
""
|
|
287
|
+
].includes(r);
|
|
288
|
+
}, fe = function(e) {
|
|
289
|
+
var r;
|
|
290
|
+
return !!(e && (!((r = Ve(e)) === null || r === void 0) && r.focusGuard));
|
|
291
|
+
}, ue = function(e) {
|
|
292
|
+
return !fe(e);
|
|
293
|
+
}, rt = function(e) {
|
|
294
|
+
return !!e;
|
|
295
|
+
}, tt = function(e, r) {
|
|
296
|
+
var t = Math.max(0, e.tabIndex), n = Math.max(0, r.tabIndex), o = t - n, u = e.index - r.index;
|
|
297
|
+
if (o) {
|
|
298
|
+
if (!t) return 1;
|
|
299
|
+
if (!n) return -1;
|
|
300
|
+
}
|
|
301
|
+
return o || u;
|
|
302
|
+
}, nt = function(e) {
|
|
303
|
+
return e.tabIndex < 0 && !e.hasAttribute("tabindex") ? 0 : e.tabIndex;
|
|
304
|
+
}, se = function(e, r, t) {
|
|
305
|
+
return w(e).map(function(n, o) {
|
|
306
|
+
var u = nt(n);
|
|
307
|
+
return {
|
|
308
|
+
node: n,
|
|
309
|
+
index: o,
|
|
310
|
+
tabIndex: t && u === -1 ? (n.dataset || {}).focusGuard ? 0 : -1 : u
|
|
311
|
+
};
|
|
312
|
+
}).filter(function(n) {
|
|
313
|
+
return !r || n.tabIndex >= 0;
|
|
314
|
+
}).sort(tt);
|
|
315
|
+
}, ot = [
|
|
316
|
+
"button:enabled",
|
|
317
|
+
"select:enabled",
|
|
318
|
+
"textarea:enabled",
|
|
319
|
+
"input:enabled",
|
|
320
|
+
"a[href]",
|
|
321
|
+
"area[href]",
|
|
322
|
+
"summary",
|
|
323
|
+
"iframe",
|
|
324
|
+
"object",
|
|
325
|
+
"embed",
|
|
326
|
+
"audio[controls]",
|
|
327
|
+
"video[controls]",
|
|
328
|
+
"[tabindex]",
|
|
329
|
+
"[contenteditable]",
|
|
330
|
+
"[autofocus]"
|
|
331
|
+
], de = ot.join(","), ut = "".concat(de, ", [data-focus-guard]"), Ke = function(e, r) {
|
|
332
|
+
return w((e.shadowRoot || e).children).reduce(function(t, n) {
|
|
333
|
+
return t.concat(n.matches(r ? ut : de) ? [n] : [], Ke(n));
|
|
334
|
+
}, []);
|
|
335
|
+
}, at = function(e, r) {
|
|
336
|
+
var t;
|
|
337
|
+
return e instanceof HTMLIFrameElement && (!((t = e.contentDocument) === null || t === void 0) && t.body) ? C([e.contentDocument.body], r) : [e];
|
|
338
|
+
}, C = function(e, r) {
|
|
339
|
+
return e.reduce(function(t, n) {
|
|
340
|
+
var o, u = Ke(n, r), a = (o = []).concat.apply(o, u.map(function(f) {
|
|
341
|
+
return at(f, r);
|
|
342
|
+
}));
|
|
343
|
+
return t.concat(a, n.parentNode ? w(n.parentNode.querySelectorAll(de)).filter(function(f) {
|
|
344
|
+
return f === n;
|
|
345
|
+
}) : []);
|
|
346
|
+
}, []);
|
|
347
|
+
}, it = function(e) {
|
|
348
|
+
return w(e.querySelectorAll("[".concat(kr, "]"))).map(function(r) {
|
|
349
|
+
return C([r]);
|
|
350
|
+
}).reduce(function(r, t) {
|
|
351
|
+
return r.concat(t);
|
|
352
|
+
}, []);
|
|
353
|
+
}, le = function(e, r) {
|
|
354
|
+
return w(e).filter(function(t) {
|
|
355
|
+
return je(r, t);
|
|
356
|
+
}).filter(function(t) {
|
|
357
|
+
return Zr(t);
|
|
358
|
+
});
|
|
359
|
+
}, Se = function(e, r) {
|
|
360
|
+
return r === void 0 && (r = /* @__PURE__ */ new Map()), w(e).filter(function(t) {
|
|
361
|
+
return He(r, t);
|
|
362
|
+
});
|
|
363
|
+
}, ve = function(e, r, t) {
|
|
364
|
+
return se(le(C(e, t), r), !0, t);
|
|
365
|
+
}, B = function(e, r) {
|
|
366
|
+
return se(le(C(e), r), !1);
|
|
367
|
+
}, ct = function(e, r) {
|
|
368
|
+
return le(it(e), r);
|
|
369
|
+
}, T = function(e, r) {
|
|
370
|
+
return e.shadowRoot ? T(e.shadowRoot, r) : Object.getPrototypeOf(e).contains !== void 0 && Object.getPrototypeOf(e).contains.call(e, r) ? !0 : w(e.children).some(function(t) {
|
|
371
|
+
var n;
|
|
372
|
+
if (t instanceof HTMLIFrameElement) {
|
|
373
|
+
var o = (n = t.contentDocument) === null || n === void 0 ? void 0 : n.body;
|
|
374
|
+
return o ? T(o, r) : !1;
|
|
375
|
+
}
|
|
376
|
+
return T(t, r);
|
|
377
|
+
});
|
|
378
|
+
}, ft = function(e) {
|
|
379
|
+
for (var r = /* @__PURE__ */ new Set(), t = e.length, n = 0; n < t; n += 1) for (var o = n + 1; o < t; o += 1) {
|
|
380
|
+
var u = e[n].compareDocumentPosition(e[o]);
|
|
381
|
+
(u & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0 && r.add(o), (u & Node.DOCUMENT_POSITION_CONTAINS) > 0 && r.add(n);
|
|
382
|
+
}
|
|
383
|
+
return e.filter(function(a, f) {
|
|
384
|
+
return !r.has(f);
|
|
385
|
+
});
|
|
386
|
+
}, Ye = function(e) {
|
|
387
|
+
return e.parentNode ? Ye(e.parentNode) : e;
|
|
388
|
+
}, me = function(e) {
|
|
389
|
+
return P(e).filter(Boolean).reduce(function(r, t) {
|
|
390
|
+
var n = t.getAttribute(ne);
|
|
391
|
+
return r.push.apply(r, n ? ft(w(Ye(t).querySelectorAll("[".concat(ne, '="').concat(n, '"]:not([').concat(ke, '="disabled"])')))) : [t]), r;
|
|
392
|
+
}, []);
|
|
393
|
+
}, st = function(e) {
|
|
394
|
+
try {
|
|
395
|
+
return e();
|
|
396
|
+
} catch {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
}, G = function(e) {
|
|
400
|
+
if (e === void 0 && (e = document), !(!e || !e.activeElement)) {
|
|
401
|
+
var r = e.activeElement;
|
|
402
|
+
return r.shadowRoot ? G(r.shadowRoot) : r instanceof HTMLIFrameElement && st(function() {
|
|
403
|
+
return r.contentWindow.document;
|
|
404
|
+
}) ? G(r.contentWindow.document) : r;
|
|
405
|
+
}
|
|
406
|
+
}, dt = function(e, r) {
|
|
407
|
+
return e === r;
|
|
408
|
+
}, lt = function(e, r) {
|
|
409
|
+
return !!w(e.querySelectorAll("iframe")).some(function(t) {
|
|
410
|
+
return dt(t, r);
|
|
411
|
+
});
|
|
412
|
+
}, ze = function(e, r) {
|
|
413
|
+
return r === void 0 && (r = G(Ue(e).ownerDocument)), !r || r.dataset && r.dataset.focusGuard ? !1 : me(e).some(function(t) {
|
|
414
|
+
return T(t, r) || lt(t, r);
|
|
415
|
+
});
|
|
416
|
+
}, vt = function(e) {
|
|
417
|
+
e === void 0 && (e = document);
|
|
418
|
+
var r = G(e);
|
|
419
|
+
return r ? w(e.querySelectorAll("[".concat(Lr, "]"))).some(function(t) {
|
|
420
|
+
return T(t, r);
|
|
421
|
+
}) : !1;
|
|
422
|
+
}, mt = function(e, r) {
|
|
423
|
+
return r.filter($e).filter(function(t) {
|
|
424
|
+
return t.name === e.name;
|
|
425
|
+
}).filter(function(t) {
|
|
426
|
+
return t.checked;
|
|
427
|
+
})[0] || e;
|
|
428
|
+
}, pe = function(e, r) {
|
|
429
|
+
return $e(e) && e.name ? mt(e, r) : e;
|
|
430
|
+
}, pt = function(e) {
|
|
431
|
+
var r = /* @__PURE__ */ new Set();
|
|
432
|
+
return e.forEach(function(t) {
|
|
433
|
+
return r.add(pe(t, e));
|
|
434
|
+
}), e.filter(function(t) {
|
|
435
|
+
return r.has(t);
|
|
436
|
+
});
|
|
437
|
+
}, Ne = function(e) {
|
|
438
|
+
return e[0] && e.length > 1 ? pe(e[0], e) : e[0];
|
|
439
|
+
}, Te = function(e, r) {
|
|
440
|
+
return e.indexOf(pe(r, e));
|
|
441
|
+
}, Pe = "NEW_FOCUS", bt = function(e, r, t, n, o) {
|
|
442
|
+
var u = e.length, a = e[0], f = e[u - 1], v = fe(n);
|
|
443
|
+
if (!(n && e.indexOf(n) >= 0)) {
|
|
444
|
+
var c = n !== void 0 ? t.indexOf(n) : -1, m = o ? t.indexOf(o) : c, s = o ? e.indexOf(o) : -1;
|
|
445
|
+
if (c === -1)
|
|
446
|
+
return s !== -1 ? s : Pe;
|
|
447
|
+
if (s === -1) return Pe;
|
|
448
|
+
var i = c - m, l = t.indexOf(a), p = t.indexOf(f), h = pt(t), F = n !== void 0 ? h.indexOf(n) : -1, x = o ? h.indexOf(o) : F, b = h.filter(function(Y) {
|
|
449
|
+
return Y.tabIndex >= 0;
|
|
450
|
+
}), y = n !== void 0 ? b.indexOf(n) : -1, E = o ? b.indexOf(o) : y, S = y >= 0 && E >= 0 ? E - y : x - F;
|
|
451
|
+
if (!i && s >= 0 || r.length === 0) return s;
|
|
452
|
+
var H = Te(e, r[0]), V = Te(e, r[r.length - 1]);
|
|
453
|
+
if (c <= l && v && Math.abs(i) > 1) return V;
|
|
454
|
+
if (c >= p && v && Math.abs(i) > 1) return H;
|
|
455
|
+
if (i && Math.abs(S) > 1) return s;
|
|
456
|
+
if (c <= l) return V;
|
|
457
|
+
if (c > p) return H;
|
|
458
|
+
if (i)
|
|
459
|
+
return Math.abs(i) > 1 ? s : (u + s + i) % u;
|
|
460
|
+
}
|
|
461
|
+
}, ht = function(e) {
|
|
462
|
+
return function(r) {
|
|
463
|
+
var t, n = (t = Ve(r)) === null || t === void 0 ? void 0 : t.autofocus;
|
|
464
|
+
return r.autofocus || n !== void 0 && n !== "false" || e.indexOf(r) >= 0;
|
|
465
|
+
};
|
|
466
|
+
}, _e = function(e, r, t) {
|
|
467
|
+
var n = Se(e.map(function(o) {
|
|
468
|
+
return o.node;
|
|
469
|
+
}).filter(ht(t)));
|
|
470
|
+
return n && n.length ? Ne(n) : Ne(Se(r));
|
|
471
|
+
}, ae = function(e, r) {
|
|
472
|
+
return r === void 0 && (r = []), r.push(e), e.parentNode && ae(e.parentNode.host || e.parentNode, r), r;
|
|
473
|
+
}, ee = function(e, r) {
|
|
474
|
+
for (var t = ae(e), n = ae(r), o = 0; o < t.length; o += 1) {
|
|
475
|
+
var u = t[o];
|
|
476
|
+
if (n.indexOf(u) >= 0) return u;
|
|
477
|
+
}
|
|
478
|
+
return !1;
|
|
479
|
+
}, Je = function(e, r, t) {
|
|
480
|
+
var n = P(e), o = P(r), u = n[0], a = !1;
|
|
481
|
+
return o.filter(Boolean).forEach(function(f) {
|
|
482
|
+
a = ee(a || f, f) || a, t.filter(Boolean).forEach(function(v) {
|
|
483
|
+
var c = ee(u, v);
|
|
484
|
+
c && (!a || T(c, a) ? a = c : a = ee(c, a));
|
|
485
|
+
});
|
|
486
|
+
}), a;
|
|
487
|
+
}, Ae = function(e, r) {
|
|
488
|
+
return e.reduce(function(t, n) {
|
|
489
|
+
return t.concat(ct(n, r));
|
|
490
|
+
}, []);
|
|
491
|
+
}, yt = function(e, r) {
|
|
492
|
+
var t = /* @__PURE__ */ new Map();
|
|
493
|
+
return r.forEach(function(n) {
|
|
494
|
+
return t.set(n.node, n);
|
|
495
|
+
}), e.map(function(n) {
|
|
496
|
+
return t.get(n);
|
|
497
|
+
}).filter(rt);
|
|
498
|
+
}, gt = function(e, r) {
|
|
499
|
+
var t = G(P(e).length > 0 ? document : Ue(e).ownerDocument), n = me(e).filter(ue), o = Je(t || e, e, n), u = /* @__PURE__ */ new Map(), a = B(n, u), f = a.filter(function(p) {
|
|
500
|
+
var h = p.node;
|
|
501
|
+
return ue(h);
|
|
502
|
+
});
|
|
503
|
+
if (f[0]) {
|
|
504
|
+
var v = B([o], u).map(function(p) {
|
|
505
|
+
return p.node;
|
|
506
|
+
}), c = yt(v, f), m = c.map(function(p) {
|
|
507
|
+
return p.node;
|
|
508
|
+
}), s = c.filter(function(p) {
|
|
509
|
+
return p.tabIndex >= 0;
|
|
510
|
+
}).map(function(p) {
|
|
511
|
+
return p.node;
|
|
512
|
+
}), i = bt(m, s, v, t, r);
|
|
513
|
+
if (i === "NEW_FOCUS") {
|
|
514
|
+
var l = _e(a, s, Ae(n, u)) || _e(a, m, Ae(n, u));
|
|
515
|
+
if (l) return { node: l };
|
|
516
|
+
console.warn("focus-lock: cannot find any node to move focus into");
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
return i === void 0 ? i : c[i];
|
|
520
|
+
}
|
|
521
|
+
}, Ft = function(e) {
|
|
522
|
+
var r = me(e).filter(ue), t = se(C([Je(e, e, r)], !0), !0, !0), n = C(r, !1);
|
|
523
|
+
return t.map(function(o) {
|
|
524
|
+
var u = o.node;
|
|
525
|
+
return {
|
|
526
|
+
node: u,
|
|
527
|
+
index: o.index,
|
|
528
|
+
lockItem: n.indexOf(u) >= 0,
|
|
529
|
+
guard: fe(u)
|
|
530
|
+
};
|
|
531
|
+
});
|
|
532
|
+
}, be = function(e, r) {
|
|
533
|
+
e && ("focus" in e && e.focus(r), "contentWindow" in e && e.contentWindow && e.contentWindow.focus());
|
|
534
|
+
}, re = 0, te = !1, Qe = function(e, r, t) {
|
|
535
|
+
t === void 0 && (t = {});
|
|
536
|
+
var n = gt(e, r);
|
|
537
|
+
if (!te && n) {
|
|
538
|
+
if (re > 2) {
|
|
539
|
+
console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), te = !0, setTimeout(function() {
|
|
540
|
+
te = !1;
|
|
541
|
+
}, 1);
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
re++, be(n.node, t.focusOptions), re--;
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
function k(e) {
|
|
548
|
+
if (!e) return null;
|
|
549
|
+
if (typeof WeakRef > "u") return function() {
|
|
550
|
+
return e || null;
|
|
551
|
+
};
|
|
552
|
+
var r = e ? new WeakRef(e) : null;
|
|
553
|
+
return function() {
|
|
554
|
+
return r?.deref() || null;
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
var Et = function(e) {
|
|
558
|
+
if (!e) return null;
|
|
559
|
+
for (var r = [], t = e; t && t !== document.body; )
|
|
560
|
+
r.push({
|
|
561
|
+
current: k(t),
|
|
562
|
+
parent: k(t.parentElement),
|
|
563
|
+
left: k(t.previousElementSibling),
|
|
564
|
+
right: k(t.nextElementSibling)
|
|
565
|
+
}), t = t.parentElement;
|
|
566
|
+
return {
|
|
567
|
+
element: k(e),
|
|
568
|
+
stack: r,
|
|
569
|
+
ownerDocument: e.ownerDocument
|
|
570
|
+
};
|
|
571
|
+
}, Ot = function(e) {
|
|
572
|
+
var r, t, n, o, u;
|
|
573
|
+
if (e)
|
|
574
|
+
for (var a = e.stack, f = e.ownerDocument, v = /* @__PURE__ */ new Map(), c = 0, m = a; c < m.length; c++) {
|
|
575
|
+
var s = m[c], i = (r = s.parent) === null || r === void 0 ? void 0 : r.call(s);
|
|
576
|
+
if (i && f.contains(i)) {
|
|
577
|
+
for (var l = (t = s.left) === null || t === void 0 ? void 0 : t.call(s), p = s.current(), h = i.contains(p) ? p : void 0, F = (n = s.right) === null || n === void 0 ? void 0 : n.call(s), x = ve([i], v), b = (u = (o = h ?? l?.nextElementSibling) !== null && o !== void 0 ? o : F) !== null && u !== void 0 ? u : l; b; ) {
|
|
578
|
+
for (var y = 0, E = x; y < E.length; y++) {
|
|
579
|
+
var S = E[y];
|
|
580
|
+
if (b?.contains(S.node)) return S.node;
|
|
581
|
+
}
|
|
582
|
+
b = b.nextElementSibling;
|
|
583
|
+
}
|
|
584
|
+
if (x.length) return x[0].node;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}, Xe = function(e) {
|
|
588
|
+
var r = Et(e);
|
|
589
|
+
return function() {
|
|
590
|
+
return Ot(r);
|
|
591
|
+
};
|
|
592
|
+
}, xt = function(e, r, t) {
|
|
593
|
+
if (!e || !r)
|
|
594
|
+
return console.error("no element or scope given"), {};
|
|
595
|
+
var n = P(r);
|
|
596
|
+
if (n.every(function(a) {
|
|
597
|
+
return !T(a, e);
|
|
598
|
+
}))
|
|
599
|
+
return console.error("Active element is not contained in the scope"), {};
|
|
600
|
+
var o = t ? ve(n, /* @__PURE__ */ new Map()) : B(n, /* @__PURE__ */ new Map()), u = o.findIndex(function(a) {
|
|
601
|
+
return a.node === e;
|
|
602
|
+
});
|
|
603
|
+
if (u !== -1)
|
|
604
|
+
return {
|
|
605
|
+
prev: o[u - 1],
|
|
606
|
+
next: o[u + 1],
|
|
607
|
+
first: o[0],
|
|
608
|
+
last: o[o.length - 1]
|
|
609
|
+
};
|
|
610
|
+
}, wt = function(e, r) {
|
|
611
|
+
var t = r ? ve(P(e), /* @__PURE__ */ new Map()) : B(P(e), /* @__PURE__ */ new Map());
|
|
612
|
+
return {
|
|
613
|
+
first: t[0],
|
|
614
|
+
last: t[t.length - 1]
|
|
615
|
+
};
|
|
616
|
+
}, It = function(e) {
|
|
617
|
+
return Object.assign({
|
|
618
|
+
scope: document.body,
|
|
619
|
+
cycle: !0,
|
|
620
|
+
onlyTabbable: !0
|
|
621
|
+
}, e);
|
|
622
|
+
}, Ze = function(e, r, t) {
|
|
623
|
+
r === void 0 && (r = {});
|
|
624
|
+
var n = It(r), o = xt(e, n.scope, n.onlyTabbable);
|
|
625
|
+
if (o) {
|
|
626
|
+
var u = t(o, n.cycle);
|
|
627
|
+
u && be(u.node, n.focusOptions);
|
|
628
|
+
}
|
|
629
|
+
}, St = function(e, r) {
|
|
630
|
+
r === void 0 && (r = {}), Ze(e, r, function(t, n) {
|
|
631
|
+
var o = t.next, u = t.first;
|
|
632
|
+
return o || n && u;
|
|
633
|
+
});
|
|
634
|
+
}, Nt = function(e, r) {
|
|
635
|
+
r === void 0 && (r = {}), Ze(e, r, function(t, n) {
|
|
636
|
+
var o = t.prev, u = t.last;
|
|
637
|
+
return o || n && u;
|
|
638
|
+
});
|
|
639
|
+
}, er = function(e, r, t) {
|
|
640
|
+
var n, o = wt(e, (n = r.onlyTabbable) !== null && n !== void 0 ? n : !0)[t];
|
|
641
|
+
o && be(o.node, r.focusOptions);
|
|
642
|
+
}, Tt = function(e, r) {
|
|
643
|
+
r === void 0 && (r = {}), er(e, r, "first");
|
|
644
|
+
}, Pt = function(e, r) {
|
|
645
|
+
r === void 0 && (r = {}), er(e, r, "last");
|
|
646
|
+
};
|
|
647
|
+
function he(e) {
|
|
648
|
+
setTimeout(e, 1);
|
|
649
|
+
}
|
|
650
|
+
var _t = function(r) {
|
|
651
|
+
return r && "current" in r ? r.current : r;
|
|
652
|
+
}, rr = function() {
|
|
653
|
+
return document && document.activeElement === document.body;
|
|
654
|
+
}, At = function() {
|
|
655
|
+
return rr() || vt();
|
|
656
|
+
}, D = null, g = null, De = function() {
|
|
657
|
+
return null;
|
|
658
|
+
}, M = null, j = !1, ye = !1, Dt = function() {
|
|
659
|
+
return !0;
|
|
660
|
+
}, Mt = function(r) {
|
|
661
|
+
return (D.whiteList || Dt)(r);
|
|
662
|
+
}, Ct = function(r, t) {
|
|
663
|
+
M = {
|
|
664
|
+
observerNode: r,
|
|
665
|
+
portaledElement: t
|
|
666
|
+
};
|
|
667
|
+
}, Lt = function(r) {
|
|
668
|
+
return M && M.portaledElement === r;
|
|
669
|
+
};
|
|
670
|
+
function Me(e, r, t, n) {
|
|
671
|
+
var o = null, u = e;
|
|
672
|
+
do {
|
|
673
|
+
var a = n[u];
|
|
674
|
+
if (a.guard)
|
|
675
|
+
a.node.dataset.focusAutoGuard && (o = a);
|
|
676
|
+
else if (a.lockItem) {
|
|
677
|
+
if (u !== e) return;
|
|
678
|
+
o = null;
|
|
679
|
+
} else break;
|
|
680
|
+
} while ((u += t) !== r);
|
|
681
|
+
o && (o.node.tabIndex = 0);
|
|
682
|
+
}
|
|
683
|
+
var kt = function(r) {
|
|
684
|
+
return r ? !!j : j === "meanwhile";
|
|
685
|
+
}, Rt = function e(r, t, n) {
|
|
686
|
+
return t && (t.host === r && (!t.activeElement || n.contains(t.activeElement)) || t.parentNode && e(r, t.parentNode, n));
|
|
687
|
+
}, Wt = function(r, t) {
|
|
688
|
+
return t.some(function(n) {
|
|
689
|
+
return Rt(r, n, n);
|
|
690
|
+
});
|
|
691
|
+
}, tr = function(r) {
|
|
692
|
+
return B(r, /* @__PURE__ */ new Map());
|
|
693
|
+
}, Ut = function(r) {
|
|
694
|
+
return !tr([r.parentNode]).some(function(t) {
|
|
695
|
+
return t.node === r;
|
|
696
|
+
});
|
|
697
|
+
}, $ = function() {
|
|
698
|
+
var r = !1;
|
|
699
|
+
if (D) {
|
|
700
|
+
var t = D, n = t.observed, o = t.persistentFocus, u = t.autoFocus, a = t.shards, f = t.crossFrame, v = t.focusOptions, c = t.noFocusGuards, m = n || M && M.portaledElement;
|
|
701
|
+
if (rr() && g && g !== document.body && (!document.body.contains(g) || Ut(g))) {
|
|
702
|
+
var s = De();
|
|
703
|
+
s && s.focus();
|
|
704
|
+
}
|
|
705
|
+
var i = document && document.activeElement;
|
|
706
|
+
if (m) {
|
|
707
|
+
var l = [m].concat(a.map(_t).filter(Boolean)), p = function() {
|
|
708
|
+
if (!kt(f) || !c || !g || ye) return !1;
|
|
709
|
+
var y = tr(l), E = y.findIndex(function(S) {
|
|
710
|
+
return S.node === g;
|
|
711
|
+
});
|
|
712
|
+
return E === 0 || E === y.length - 1;
|
|
713
|
+
};
|
|
714
|
+
if ((!i || Mt(i)) && (o || p() || !At() || !g && u) && (m && !(ze(l) || i && Wt(i, l) || Lt(i, m)) && (document && !g && i && !u ? (i.blur && i.blur(), document.body.focus()) : (r = Qe(l, g, { focusOptions: v }), M = {})), g = document && document.activeElement, g !== document.body && (De = Xe(g)), j = !1), document && i !== document.activeElement && document.querySelector("[data-focus-auto-guard]")) {
|
|
715
|
+
var h = document && document.activeElement, F = Ft(l), x = F.map(function(b) {
|
|
716
|
+
return b.node;
|
|
717
|
+
}).indexOf(h);
|
|
718
|
+
x > -1 && (F.filter(function(b) {
|
|
719
|
+
var y = b.guard, E = b.node;
|
|
720
|
+
return y && E.dataset.focusAutoGuard;
|
|
721
|
+
}).forEach(function(b) {
|
|
722
|
+
return b.node.removeAttribute("tabIndex");
|
|
723
|
+
}), Me(x, F.length, 1, F), Me(x, -1, -1, F));
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return r;
|
|
728
|
+
}, nr = function(r) {
|
|
729
|
+
$() && r && (r.stopPropagation(), r.preventDefault());
|
|
730
|
+
}, K = function() {
|
|
731
|
+
return he($);
|
|
732
|
+
}, or = function(r) {
|
|
733
|
+
var t = r.target, n = r.currentTarget;
|
|
734
|
+
n.contains(t) || Ct(n, t);
|
|
735
|
+
}, Bt = function() {
|
|
736
|
+
return null;
|
|
737
|
+
}, Gt = function(r) {
|
|
738
|
+
var t = r.children;
|
|
739
|
+
return /* @__PURE__ */ O.createElement("div", {
|
|
740
|
+
onBlur: K,
|
|
741
|
+
onFocus: or
|
|
742
|
+
}, t);
|
|
743
|
+
};
|
|
744
|
+
Gt.propTypes = process.env.NODE_ENV !== "production" ? { children: d.default.node.isRequired } : {};
|
|
745
|
+
var ur = function() {
|
|
746
|
+
ye = !0;
|
|
747
|
+
}, ar = function() {
|
|
748
|
+
ye = !1, j = "just", he(function() {
|
|
749
|
+
j = "meanwhile";
|
|
750
|
+
});
|
|
751
|
+
}, jt = function() {
|
|
752
|
+
document.addEventListener("focusin", nr), document.addEventListener("focusout", K), window.addEventListener("focus", ur), window.addEventListener("blur", ar);
|
|
753
|
+
}, Ht = function() {
|
|
754
|
+
document.removeEventListener("focusin", nr), document.removeEventListener("focusout", K), window.removeEventListener("focus", ur), window.removeEventListener("blur", ar);
|
|
755
|
+
};
|
|
756
|
+
function Vt(e) {
|
|
757
|
+
return e.filter(function(r) {
|
|
758
|
+
return !r.disabled;
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
var ir = {
|
|
762
|
+
moveFocusInside: Qe,
|
|
763
|
+
focusInside: ze,
|
|
764
|
+
focusNextElement: St,
|
|
765
|
+
focusPrevElement: Nt,
|
|
766
|
+
focusFirstElement: Tt,
|
|
767
|
+
focusLastElement: Pt,
|
|
768
|
+
captureFocusRestore: Xe
|
|
769
|
+
};
|
|
770
|
+
function qt(e) {
|
|
771
|
+
var r = e.slice(-1)[0];
|
|
772
|
+
r && !D && jt();
|
|
773
|
+
var t = D, n = t && r && r.id === t.id;
|
|
774
|
+
D = r, t && !n && (t.onDeactivation(), e.filter(function(o) {
|
|
775
|
+
return o.id === t.id;
|
|
776
|
+
}).length || t.returnFocus(!r)), r ? (g = null, (!n || t.observed !== r.observed) && r.onActivation(ir), $(!0), he($)) : (Ht(), g = null);
|
|
777
|
+
}
|
|
778
|
+
Re.assignSyncMedium(or);
|
|
779
|
+
We.assignMedium(K);
|
|
780
|
+
Ur.assignMedium(function(e) {
|
|
781
|
+
return e(ir);
|
|
782
|
+
});
|
|
783
|
+
var $t = Kr(Vt, qt)(Bt), cr = /* @__PURE__ */ Le(function(r, t) {
|
|
784
|
+
return /* @__PURE__ */ O.createElement(ce, W({
|
|
785
|
+
sideCar: $t,
|
|
786
|
+
ref: t
|
|
787
|
+
}, r));
|
|
788
|
+
}), fr = ce.propTypes || {};
|
|
789
|
+
fr.sideCar;
|
|
790
|
+
var Kt = Cr(fr, ["sideCar"]);
|
|
791
|
+
cr.propTypes = process.env.NODE_ENV !== "production" ? Kt : {};
|
|
792
|
+
var Xt = cr;
|
|
793
|
+
export {
|
|
794
|
+
Xt as t
|
|
795
|
+
};
|