@ariakit/react-core 0.2.14 → 0.2.16
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/CHANGELOG.md +28 -0
- package/cjs/__chunks/{GHDSJPDP.cjs → 2CBM6TG2.cjs} +9 -1
- package/cjs/__chunks/{JQNHOFVL.cjs → 4PH5LF7R.cjs} +4 -4
- package/cjs/__chunks/{IMHF4TCR.cjs → 5SFIKBWF.cjs} +2 -2
- package/cjs/__chunks/{XE2DJMCI.cjs → 6BAHKJ5K.cjs} +14 -20
- package/cjs/__chunks/{G2UVEERG.cjs → AHLK6SVF.cjs} +10 -10
- package/cjs/__chunks/{GICQ7PSP.cjs → BIJBAZHT.cjs} +2 -2
- package/cjs/__chunks/{AMRCH2Z5.cjs → BW4OCE2W.cjs} +4 -4
- package/cjs/__chunks/{ZWMVFMQY.cjs → CHVOMF22.cjs} +4 -4
- package/cjs/__chunks/{FWCSM5BC.cjs → CY7GQARX.cjs} +13 -13
- package/cjs/__chunks/{SIVNE3PR.cjs → ETK4FMZH.cjs} +12 -12
- package/cjs/__chunks/{FNDPLH5R.cjs → EVXAMK7D.cjs} +6 -8
- package/cjs/__chunks/{KD3RAGO6.cjs → EWI7RF64.cjs} +5 -5
- package/cjs/__chunks/{LE4VG2T4.cjs → EYVMZOCS.cjs} +8 -8
- package/cjs/__chunks/{O22LNQHS.cjs → FA3DXDDT.cjs} +2 -2
- package/cjs/__chunks/{JMBF4JHZ.cjs → FNKDTHTN.cjs} +4 -4
- package/cjs/__chunks/{LZV54A37.cjs → FVVV75ZK.cjs} +2 -2
- package/cjs/__chunks/{745H7MDU.cjs → GAQNLEPX.cjs} +6 -6
- package/cjs/__chunks/{FSADYSOP.cjs → HTEAWNBY.cjs} +14 -3
- package/cjs/__chunks/{HSFSIYIQ.cjs → JLC4GR5L.cjs} +2 -2
- package/cjs/__chunks/{HUVFPCMZ.cjs → KJBIRAH5.cjs} +24 -6
- package/cjs/__chunks/{OYXMXGQJ.cjs → KKAG47JR.cjs} +2 -2
- package/cjs/__chunks/{VBRBBWCP.cjs → NH6Q6YSM.cjs} +2 -2
- package/cjs/__chunks/{3MC2XJ5F.cjs → OHBR6IPU.cjs} +45 -33
- package/cjs/__chunks/{PRMEV7L5.cjs → PBJASQI6.cjs} +4 -4
- package/cjs/__chunks/{TFOIZV2V.cjs → PD5YFDLO.cjs} +3 -2
- package/cjs/__chunks/{IQIITEH3.cjs → QCWWP2P4.cjs} +2 -2
- package/cjs/__chunks/QW7NAUIX.cjs +113 -0
- package/cjs/__chunks/{63OBHNVT.cjs → VB7SPR3I.cjs} +7 -7
- package/cjs/__chunks/{LG6XOVBQ.cjs → VGBPLBUZ.cjs} +3 -3
- package/cjs/__chunks/{44MSVBJL.cjs → VKPXIX7D.cjs} +3 -3
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/checkbox/checkbox.cjs +3 -3
- package/cjs/collection/collection-item.cjs +2 -2
- package/cjs/collection/collection-renderer.cjs +3 -3
- package/cjs/collection/collection-store.cjs +3 -3
- package/cjs/combobox/combobox-item.cjs +4 -4
- package/cjs/combobox/combobox-popover.cjs +12 -12
- package/cjs/combobox/combobox-store.cjs +11 -11
- package/cjs/combobox/combobox.cjs +3 -3
- package/cjs/composite/composite-container.cjs +3 -3
- package/cjs/composite/composite-item.cjs +4 -4
- package/cjs/composite/composite-overflow-disclosure.cjs +7 -6
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-overflow.cjs +12 -12
- package/cjs/composite/composite-renderer.cjs +4 -4
- package/cjs/composite/composite-store.cjs +4 -4
- package/cjs/dialog/dialog-backdrop.cjs +6 -6
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/dialog/dialog.cjs +11 -11
- package/cjs/dialog/utils/disable-accessibility-tree-outside.cjs +3 -3
- package/cjs/dialog/utils/disable-tree-outside.cjs +4 -4
- package/cjs/dialog/utils/mark-tree-outside.cjs +3 -3
- package/cjs/dialog/utils/use-hide-on-interact-outside.cjs +4 -4
- package/cjs/dialog/utils/use-hide-on-interact-outside.d.ts +1 -1
- package/cjs/dialog/utils/use-nested-dialogs.cjs +2 -2
- package/cjs/dialog/utils/walk-tree-outside.cjs +2 -2
- package/cjs/dialog/utils/walk-tree-outside.d.ts +1 -1
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/focusable/focusable.d.ts +52 -13
- package/cjs/form/form-checkbox.cjs +8 -8
- package/cjs/form/form-description.cjs +2 -2
- package/cjs/form/form-error.cjs +2 -2
- package/cjs/form/form-field.cjs +3 -3
- package/cjs/form/form-input.cjs +3 -3
- package/cjs/form/form-label.cjs +2 -2
- package/cjs/form/form-push.cjs +2 -2
- package/cjs/form/form-radio.cjs +7 -7
- package/cjs/form/form-store.cjs +8 -8
- package/cjs/hovercard/hovercard-anchor.cjs +2 -2
- package/cjs/hovercard/hovercard-disclosure.cjs +12 -14
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/hovercard/hovercard.cjs +13 -13
- package/cjs/menu/menu-bar-store.cjs +6 -6
- package/cjs/menu/menu-button.cjs +9 -6
- package/cjs/menu/menu-item-checkbox.cjs +9 -9
- package/cjs/menu/menu-item-radio.cjs +7 -7
- package/cjs/menu/menu-item.cjs +5 -5
- package/cjs/menu/menu-list.cjs +3 -3
- package/cjs/menu/menu-store.cjs +13 -13
- package/cjs/menu/menu.cjs +15 -15
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/popover/popover.cjs +12 -12
- package/cjs/radio/radio-store.cjs +7 -7
- package/cjs/radio/radio.cjs +5 -5
- package/cjs/select/select-item.cjs +4 -4
- package/cjs/select/select-popover.cjs +12 -12
- package/cjs/select/select-renderer.cjs +7 -7
- package/cjs/select/select-store.cjs +11 -11
- package/cjs/tab/tab-panel.cjs +5 -5
- package/cjs/tab/tab-store.cjs +9 -9
- package/cjs/tab/tab.cjs +4 -4
- package/cjs/toolbar/toolbar-container.cjs +7 -7
- package/cjs/toolbar/toolbar-input.cjs +5 -5
- package/cjs/toolbar/toolbar-item.cjs +5 -5
- package/cjs/toolbar/toolbar-store.cjs +6 -6
- package/cjs/tooltip/tooltip-anchor.cjs +33 -20
- package/cjs/tooltip/tooltip-store.cjs +10 -10
- package/cjs/tooltip/tooltip.cjs +13 -13
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/store.cjs +2 -2
- package/esm/__chunks/{7J6H5Y2H.js → 432NLB7J.js} +2 -2
- package/esm/__chunks/{FV23EKJL.js → 5M4ITSXL.js} +3 -2
- package/esm/__chunks/{6RR2HJXR.js → 5PDNXTAR.js} +1 -1
- package/esm/__chunks/{QHXLY5NM.js → 5QHNNZNE.js} +1 -1
- package/esm/__chunks/{WEWVELT3.js → 6F6CCCKT.js} +1 -1
- package/esm/__chunks/{DCG3EYDE.js → 7SIWUER2.js} +2 -2
- package/esm/__chunks/{F6KX6FT7.js → CEBWVZJQ.js} +2 -2
- package/esm/__chunks/{DIA4OBYO.js → CU3AKJBN.js} +1 -1
- package/esm/__chunks/{5TTSBUCW.js → CYNFBMYS.js} +1 -1
- package/esm/__chunks/{4XWTU3WN.js → E5XSMSHD.js} +25 -7
- package/esm/__chunks/{6RGH36XF.js → EICJBDBV.js} +2 -2
- package/esm/__chunks/{WVP274TO.js → F6PEGR7W.js} +1 -1
- package/esm/__chunks/{WKNTOKYS.js → FSTINJD5.js} +1 -1
- package/esm/__chunks/{LUUMYNYQ.js → FW5SU7FV.js} +2 -2
- package/esm/__chunks/{CYJJUQU3.js → GDORSOK6.js} +1 -1
- package/esm/__chunks/{HCTED3MY.js → JD3UVZX5.js} +1 -1
- package/esm/__chunks/{HCZMY53N.js → LEBYH5FW.js} +13 -2
- package/esm/__chunks/{AR6DTI3S.js → NHPU54IO.js} +2 -2
- package/esm/__chunks/{RH5PYIJN.js → ORZC42PG.js} +5 -7
- package/esm/__chunks/{OEA63YXU.js → PLOINBVB.js} +14 -20
- package/esm/__chunks/{VKYM5S67.js → Q52PUUUL.js} +1 -1
- package/esm/__chunks/{HWFO52CA.js → QJUX534W.js} +2 -2
- package/esm/__chunks/{OOWNFOTF.js → QPTZ2G2N.js} +51 -28
- package/esm/__chunks/{NCSSU46J.js → R4VIEIUH.js} +1 -1
- package/esm/__chunks/{GADPWICI.js → TG7IDXTX.js} +38 -26
- package/esm/__chunks/{KRFS2JCI.js → TQ5BKSY4.js} +2 -2
- package/esm/__chunks/{C2N5FZMW.js → UKOZA6YP.js} +2 -2
- package/esm/__chunks/{HGFTMLQ7.js → VFNGSUSF.js} +13 -13
- package/esm/__chunks/{5PLAJI33.js → X5CHG5LF.js} +2 -2
- package/esm/__chunks/{I3PXTXPI.js → Y5XLHDDM.js} +9 -1
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/checkbox/checkbox.js +2 -2
- package/esm/collection/collection-item.js +1 -1
- package/esm/collection/collection-renderer.js +2 -2
- package/esm/collection/collection-store.js +2 -2
- package/esm/combobox/combobox-item.js +3 -3
- package/esm/combobox/combobox-popover.js +11 -11
- package/esm/combobox/combobox-store.js +6 -6
- package/esm/combobox/combobox.js +3 -3
- package/esm/composite/composite-container.js +2 -2
- package/esm/composite/composite-item.js +3 -3
- package/esm/composite/composite-overflow-disclosure.js +6 -5
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-overflow.js +11 -11
- package/esm/composite/composite-renderer.js +3 -3
- package/esm/composite/composite-store.js +3 -3
- package/esm/dialog/dialog-backdrop.js +5 -5
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/dialog/dialog.js +10 -10
- package/esm/dialog/utils/disable-accessibility-tree-outside.js +2 -2
- package/esm/dialog/utils/disable-tree-outside.js +3 -3
- package/esm/dialog/utils/mark-tree-outside.js +2 -2
- package/esm/dialog/utils/use-hide-on-interact-outside.d.ts +1 -1
- package/esm/dialog/utils/use-hide-on-interact-outside.js +3 -3
- package/esm/dialog/utils/use-nested-dialogs.js +1 -1
- package/esm/dialog/utils/walk-tree-outside.d.ts +1 -1
- package/esm/dialog/utils/walk-tree-outside.js +1 -1
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/focusable/focusable.d.ts +52 -13
- package/esm/form/form-checkbox.js +5 -5
- package/esm/form/form-description.js +1 -1
- package/esm/form/form-error.js +1 -1
- package/esm/form/form-field.js +2 -2
- package/esm/form/form-input.js +2 -2
- package/esm/form/form-label.js +1 -1
- package/esm/form/form-push.js +1 -1
- package/esm/form/form-radio.js +5 -5
- package/esm/form/form-store.js +2 -2
- package/esm/hovercard/hovercard-anchor.js +1 -1
- package/esm/hovercard/hovercard-disclosure.js +12 -14
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/hovercard/hovercard.js +12 -12
- package/esm/menu/menu-bar-store.js +3 -3
- package/esm/menu/menu-button.js +7 -4
- package/esm/menu/menu-item-checkbox.js +6 -6
- package/esm/menu/menu-item-radio.js +5 -5
- package/esm/menu/menu-item.js +4 -4
- package/esm/menu/menu-list.js +2 -2
- package/esm/menu/menu-store.js +7 -7
- package/esm/menu/menu.js +13 -13
- package/esm/popover/popover-store.js +4 -4
- package/esm/popover/popover.js +11 -11
- package/esm/radio/radio-store.js +3 -3
- package/esm/radio/radio.js +4 -4
- package/esm/select/select-item.js +3 -3
- package/esm/select/select-popover.js +11 -11
- package/esm/select/select-renderer.js +3 -3
- package/esm/select/select-store.js +6 -6
- package/esm/tab/tab-panel.js +3 -3
- package/esm/tab/tab-store.js +3 -3
- package/esm/tab/tab.js +3 -3
- package/esm/toolbar/toolbar-container.js +5 -5
- package/esm/toolbar/toolbar-input.js +4 -4
- package/esm/toolbar/toolbar-item.js +4 -4
- package/esm/toolbar/toolbar-store.js +3 -3
- package/esm/tooltip/tooltip-anchor.js +34 -21
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/tooltip/tooltip.js +12 -12
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/store.js +1 -1
- package/package.json +2 -2
- package/cjs/__chunks/KLWT4P56.cjs +0 -90
|
@@ -6,7 +6,7 @@ var _Z3TLXRS7cjs = require('./Z3TLXRS7.cjs');
|
|
|
6
6
|
var _BWQVQDGCcjs = require('./BWQVQDGC.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _PD5YFDLOcjs = require('./PD5YFDLO.cjs');
|
|
10
10
|
|
|
11
11
|
// src/dialog/utils/mark-tree-outside.ts
|
|
12
12
|
var _misc = require('@ariakit/core/utils/misc');
|
|
@@ -15,12 +15,18 @@ function getPropertyName(id = "", ancestor = false) {
|
|
|
15
15
|
}
|
|
16
16
|
function markElement(element, id = "") {
|
|
17
17
|
return _misc.chain.call(void 0,
|
|
18
|
+
// Debug
|
|
19
|
+
// setAttribute(element, getPropertyName(), "true"),
|
|
20
|
+
// setAttribute(element, getPropertyName(id), "true"),
|
|
18
21
|
_BWQVQDGCcjs.setProperty.call(void 0, element, getPropertyName(), true),
|
|
19
22
|
_BWQVQDGCcjs.setProperty.call(void 0, element, getPropertyName(id), true)
|
|
20
23
|
);
|
|
21
24
|
}
|
|
22
25
|
function markAncestor(element, id = "") {
|
|
23
26
|
return _misc.chain.call(void 0,
|
|
27
|
+
// Debug
|
|
28
|
+
// setAttribute(element, getPropertyName("", true), "true"),
|
|
29
|
+
// setAttribute(element, getPropertyName(id, true), "true"),
|
|
24
30
|
_BWQVQDGCcjs.setProperty.call(void 0, element, getPropertyName("", true), true),
|
|
25
31
|
_BWQVQDGCcjs.setProperty.call(void 0, element, getPropertyName(id, true), true)
|
|
26
32
|
);
|
|
@@ -41,14 +47,19 @@ function isElementMarked(element, id) {
|
|
|
41
47
|
function markTreeOutside(dialogId, ...elements) {
|
|
42
48
|
const cleanups = [];
|
|
43
49
|
const ids = elements.map((el) => el == null ? void 0 : el.id);
|
|
44
|
-
|
|
50
|
+
_PD5YFDLOcjs.walkTreeOutside.call(void 0,
|
|
45
51
|
elements,
|
|
46
52
|
(element) => {
|
|
47
53
|
if (_Z3TLXRS7cjs.isBackdrop.call(void 0, element, ...ids))
|
|
48
54
|
return;
|
|
49
55
|
cleanups.unshift(markElement(element, dialogId));
|
|
50
56
|
},
|
|
51
|
-
(ancestor) =>
|
|
57
|
+
(ancestor, element) => {
|
|
58
|
+
const isAnotherDialogAncestor = element.hasAttribute("data-dialog") && element.id !== dialogId;
|
|
59
|
+
if (isAnotherDialogAncestor)
|
|
60
|
+
return;
|
|
61
|
+
cleanups.unshift(markAncestor(ancestor, dialogId));
|
|
62
|
+
}
|
|
52
63
|
);
|
|
53
64
|
const restoreAccessibilityTree = () => {
|
|
54
65
|
cleanups.forEach((fn) => fn());
|
|
@@ -18,7 +18,7 @@ var _SZTCN3SGcjs = require('./SZTCN3SG.cjs');
|
|
|
18
18
|
var _CWY2PHPRcjs = require('./CWY2PHPR.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _QW7NAUIXcjs = require('./QW7NAUIX.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -71,7 +71,7 @@ var useMenuList = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
71
71
|
(state) => state.orientation === "both" ? void 0 : state.orientation
|
|
72
72
|
);
|
|
73
73
|
const isHorizontal = orientation !== "vertical";
|
|
74
|
-
const isMenuBarHorizontal = !!
|
|
74
|
+
const isMenuBarHorizontal = !!_QW7NAUIXcjs.useStoreState.call(void 0,
|
|
75
75
|
parentMenuBar,
|
|
76
76
|
(state) => state.orientation !== "vertical"
|
|
77
77
|
);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _HTEAWNBYcjs = require('./HTEAWNBY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _X2GXTE3Pcjs = require('./X2GXTE3P.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
|
|
9
10
|
var _5WLTMVVQcjs = require('./5WLTMVVQ.cjs');
|
|
10
11
|
|
|
11
12
|
|
|
@@ -47,10 +48,26 @@ function useEventOutside({
|
|
|
47
48
|
store,
|
|
48
49
|
type,
|
|
49
50
|
listener,
|
|
50
|
-
capture
|
|
51
|
+
capture,
|
|
52
|
+
domReady
|
|
51
53
|
}) {
|
|
52
54
|
const callListener = _5WLTMVVQcjs.useEvent.call(void 0, listener);
|
|
53
55
|
const open = store.useState("open");
|
|
56
|
+
const focusedRef = _react.useRef.call(void 0, false);
|
|
57
|
+
_5WLTMVVQcjs.useSafeLayoutEffect.call(void 0, () => {
|
|
58
|
+
if (!open)
|
|
59
|
+
return;
|
|
60
|
+
if (!domReady)
|
|
61
|
+
return;
|
|
62
|
+
const { contentElement } = store.getState();
|
|
63
|
+
if (!contentElement)
|
|
64
|
+
return;
|
|
65
|
+
const onFocus = () => {
|
|
66
|
+
focusedRef.current = true;
|
|
67
|
+
};
|
|
68
|
+
contentElement.addEventListener("focusin", onFocus, true);
|
|
69
|
+
return () => contentElement.removeEventListener("focusin", onFocus, true);
|
|
70
|
+
}, [store, open, domReady]);
|
|
54
71
|
_react.useEffect.call(void 0, () => {
|
|
55
72
|
if (!open)
|
|
56
73
|
return;
|
|
@@ -71,7 +88,8 @@ function useEventOutside({
|
|
|
71
88
|
return;
|
|
72
89
|
if (isMouseEventOnDialog(event, contentElement))
|
|
73
90
|
return;
|
|
74
|
-
|
|
91
|
+
const focused = focusedRef.current;
|
|
92
|
+
if (focused && !_HTEAWNBYcjs.isElementMarked.call(void 0, target, contentElement.id))
|
|
75
93
|
return;
|
|
76
94
|
callListener(event);
|
|
77
95
|
};
|
|
@@ -84,10 +102,10 @@ function shouldHideOnInteractOutside(hideOnInteractOutside, event) {
|
|
|
84
102
|
}
|
|
85
103
|
return !!hideOnInteractOutside;
|
|
86
104
|
}
|
|
87
|
-
function useHideOnInteractOutside(store, hideOnInteractOutside) {
|
|
105
|
+
function useHideOnInteractOutside(store, hideOnInteractOutside, domReady) {
|
|
88
106
|
const open = store.useState("open");
|
|
89
107
|
const previousMouseDownRef = _X2GXTE3Pcjs.usePreviousMouseDownRef.call(void 0, open);
|
|
90
|
-
const props = { store, capture: true };
|
|
108
|
+
const props = { store, domReady, capture: true };
|
|
91
109
|
useEventOutside(_72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
92
110
|
type: "click",
|
|
93
111
|
listener: (event) => {
|
|
@@ -97,7 +115,7 @@ function useHideOnInteractOutside(store, hideOnInteractOutside) {
|
|
|
97
115
|
return;
|
|
98
116
|
if (!_dom.isVisible.call(void 0, previousMouseDown))
|
|
99
117
|
return;
|
|
100
|
-
if (!
|
|
118
|
+
if (!_HTEAWNBYcjs.isElementMarked.call(void 0, previousMouseDown, contentElement == null ? void 0 : contentElement.id))
|
|
101
119
|
return;
|
|
102
120
|
if (!shouldHideOnInteractOutside(hideOnInteractOutside, event))
|
|
103
121
|
return;
|
|
@@ -11,7 +11,7 @@ var _5VOPA6D3cjs = require('./5VOPA6D3.cjs');
|
|
|
11
11
|
var _CWY2PHPRcjs = require('./CWY2PHPR.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _QW7NAUIXcjs = require('./QW7NAUIX.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -69,7 +69,7 @@ var useCompositeContainer = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
69
69
|
isOpenRef.current = false;
|
|
70
70
|
_focus.disableFocusIn.call(void 0, container);
|
|
71
71
|
};
|
|
72
|
-
const renderedItems =
|
|
72
|
+
const renderedItems = _QW7NAUIXcjs.useStoreState.call(void 0, store, "renderedItems");
|
|
73
73
|
_react.useEffect.call(void 0, () => {
|
|
74
74
|
const container = ref.current;
|
|
75
75
|
if (!container)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _OTRABJ4Ycjs = require('./OTRABJ4Y.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _ETK4FMZHcjs = require('./ETK4FMZH.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -113,7 +113,7 @@ var useFormField = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
113
113
|
ref: _5WLTMVVQcjs.useMergeRefs.call(void 0, ref, props.ref),
|
|
114
114
|
onBlur
|
|
115
115
|
});
|
|
116
|
-
props =
|
|
116
|
+
props = _ETK4FMZHcjs.useCollectionItem.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, { store }, props), { name, getItem }));
|
|
117
117
|
return props;
|
|
118
118
|
}
|
|
119
119
|
);
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _4PH5LF7Rcjs = require('./4PH5LF7R.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _CHVOMF22cjs = require('./CHVOMF22.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _FA3DXDDTcjs = require('./FA3DXDDT.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _F4UT5TWUcjs = require('./F4UT5TWU.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _6BAHKJ5Kcjs = require('./6BAHKJ5K.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _KJBIRAH5cjs = require('./KJBIRAH5.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _HTEAWNBYcjs = require('./HTEAWNBY.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
var _W32FX7DMcjs = require('./W32FX7DM.cjs');
|
|
@@ -151,8 +151,8 @@ var useDialog = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
151
151
|
const contentElement = store.useState("contentElement");
|
|
152
152
|
const hidden = _SZTCN3SGcjs.isHidden.call(void 0, mounted, props.hidden, props.alwaysVisible);
|
|
153
153
|
_F4UT5TWUcjs.usePreventBodyScroll.call(void 0, contentElement, id, preventBodyScroll && !hidden);
|
|
154
|
-
|
|
155
|
-
const { wrapElement, nestedDialogs } =
|
|
154
|
+
_KJBIRAH5cjs.useHideOnInteractOutside.call(void 0, store, hideOnInteractOutside, domReady);
|
|
155
|
+
const { wrapElement, nestedDialogs } = _6BAHKJ5Kcjs.useNestedDialogs.call(void 0, store);
|
|
156
156
|
props = _5WLTMVVQcjs.useWrapElement.call(void 0, props, wrapElement, [wrapElement]);
|
|
157
157
|
_5WLTMVVQcjs.useSafeLayoutEffect.call(void 0, () => {
|
|
158
158
|
if (!open)
|
|
@@ -166,7 +166,7 @@ var useDialog = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
166
166
|
if (dialog && _dom.contains.call(void 0, dialog, activeElement))
|
|
167
167
|
return;
|
|
168
168
|
store.setDisclosureElement(activeElement);
|
|
169
|
-
}, [open]);
|
|
169
|
+
}, [open, store]);
|
|
170
170
|
if (isSafariBrowser) {
|
|
171
171
|
_react.useEffect.call(void 0, () => {
|
|
172
172
|
if (!mounted)
|
|
@@ -194,7 +194,7 @@ var useDialog = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
194
194
|
return () => {
|
|
195
195
|
disclosureElement.removeEventListener("mousedown", onMouseDown);
|
|
196
196
|
};
|
|
197
|
-
}, [mounted]);
|
|
197
|
+
}, [mounted, store]);
|
|
198
198
|
}
|
|
199
199
|
const shouldDisableAccessibilityTree = modal || // Usually, we only want to disable the accessibility tree outside if the
|
|
200
200
|
// dialog is a modal. But the Portal component can't preserve the tab
|
|
@@ -234,17 +234,17 @@ var useDialog = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
234
234
|
...nestedDialogs.map((dialog2) => dialog2.getState().contentElement)
|
|
235
235
|
];
|
|
236
236
|
if (!shouldDisableAccessibilityTree) {
|
|
237
|
-
return
|
|
237
|
+
return _HTEAWNBYcjs.markTreeOutside.call(void 0, id, disclosureElement, ...allElements);
|
|
238
238
|
}
|
|
239
239
|
if (modal) {
|
|
240
240
|
return _misc.chain.call(void 0,
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
_HTEAWNBYcjs.markTreeOutside.call(void 0, id, ...allElements),
|
|
242
|
+
_CHVOMF22cjs.disableTreeOutside.call(void 0, ...allElements)
|
|
243
243
|
);
|
|
244
244
|
}
|
|
245
245
|
return _misc.chain.call(void 0,
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
_HTEAWNBYcjs.markTreeOutside.call(void 0, id, disclosureElement, ...allElements),
|
|
247
|
+
_FA3DXDDTcjs.disableAccessibilityTreeOutside.call(void 0, ...allElements)
|
|
248
248
|
);
|
|
249
249
|
}, [
|
|
250
250
|
domReady,
|
|
@@ -309,16 +309,13 @@ var useDialog = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
309
309
|
setHasOpened(true);
|
|
310
310
|
return () => setHasOpened(false);
|
|
311
311
|
}, [open]);
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const dialog = ref.current;
|
|
318
|
-
const focusOnHide = (retry = true) => {
|
|
312
|
+
const focusOnHide = _react.useCallback.call(void 0,
|
|
313
|
+
(dialog, retry = true) => {
|
|
314
|
+
const { open: open2, disclosureElement } = store.getState();
|
|
315
|
+
if (open2)
|
|
316
|
+
return;
|
|
319
317
|
if (isAlreadyFocusingAnotherElement(dialog))
|
|
320
318
|
return;
|
|
321
|
-
const { disclosureElement } = store.getState();
|
|
322
319
|
let element = getElementFromProp(finalFocus) || disclosureElement;
|
|
323
320
|
if (element == null ? void 0 : element.id) {
|
|
324
321
|
const doc = _dom.getDocument.call(void 0, element);
|
|
@@ -341,7 +338,7 @@ var useDialog = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
341
338
|
}
|
|
342
339
|
const isElementFocusable = element && _focus.isFocusable.call(void 0, element);
|
|
343
340
|
if (!isElementFocusable && retry) {
|
|
344
|
-
requestAnimationFrame(() => focusOnHide(false));
|
|
341
|
+
requestAnimationFrame(() => focusOnHide(dialog, false));
|
|
345
342
|
return;
|
|
346
343
|
}
|
|
347
344
|
if (!autoFocusOnHideProp(isElementFocusable ? element : null))
|
|
@@ -349,12 +346,27 @@ var useDialog = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
349
346
|
if (!isElementFocusable)
|
|
350
347
|
return;
|
|
351
348
|
element == null ? void 0 : element.focus();
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
349
|
+
},
|
|
350
|
+
[store, finalFocus, autoFocusOnHideProp]
|
|
351
|
+
);
|
|
352
|
+
_react.useEffect.call(void 0, () => {
|
|
353
|
+
if (open)
|
|
354
|
+
return;
|
|
355
|
+
if (!hasOpened)
|
|
356
|
+
return;
|
|
357
|
+
if (!mayAutoFocusOnHide)
|
|
358
|
+
return;
|
|
359
|
+
const dialog = ref.current;
|
|
360
|
+
focusOnHide(dialog);
|
|
361
|
+
}, [open, hasOpened, mayAutoFocusOnHide, focusOnHide]);
|
|
362
|
+
_react.useEffect.call(void 0, () => {
|
|
363
|
+
if (!hasOpened)
|
|
364
|
+
return;
|
|
365
|
+
if (!mayAutoFocusOnHide)
|
|
366
|
+
return;
|
|
367
|
+
const dialog = ref.current;
|
|
368
|
+
return () => focusOnHide(dialog);
|
|
369
|
+
}, [hasOpened, mayAutoFocusOnHide, focusOnHide]);
|
|
358
370
|
const hideOnEscapeProp = _5WLTMVVQcjs.useBooleanEvent.call(void 0, hideOnEscape);
|
|
359
371
|
_react.useEffect.call(void 0, () => {
|
|
360
372
|
if (!domReady)
|
|
@@ -369,7 +381,7 @@ var useDialog = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
369
381
|
const dialog = ref.current;
|
|
370
382
|
if (!dialog)
|
|
371
383
|
return;
|
|
372
|
-
if (
|
|
384
|
+
if (_HTEAWNBYcjs.isElementMarked.call(void 0, dialog))
|
|
373
385
|
return;
|
|
374
386
|
const target = event.target;
|
|
375
387
|
if (!target)
|
|
@@ -393,7 +405,7 @@ var useDialog = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
393
405
|
store.hide();
|
|
394
406
|
};
|
|
395
407
|
return _events.addGlobalEventListener.call(void 0, "keydown", onKeyDown);
|
|
396
|
-
}, [mounted, domReady, hideOnEscapeProp]);
|
|
408
|
+
}, [mounted, domReady, store, hideOnEscapeProp]);
|
|
397
409
|
props = _5WLTMVVQcjs.useWrapElement.call(void 0,
|
|
398
410
|
props,
|
|
399
411
|
(element) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _SOPRUU56cjs.HeadingLevel, { level: modal ? 1 : void 0, children: element }),
|
|
@@ -408,7 +420,7 @@ var useDialog = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
408
420
|
return element;
|
|
409
421
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
410
422
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
411
|
-
|
|
423
|
+
_4PH5LF7Rcjs.DialogBackdrop,
|
|
412
424
|
{
|
|
413
425
|
store,
|
|
414
426
|
backdrop,
|
|
@@ -10,7 +10,7 @@ var _MPFAD3UKcjs = require('./MPFAD3UK.cjs');
|
|
|
10
10
|
var _WWIZUBSBcjs = require('./WWIZUBSB.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _AHLK6SVFcjs = require('./AHLK6SVF.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ var _G2UVEERGcjs = require('./G2UVEERG.cjs');
|
|
|
18
18
|
var _CWY2PHPRcjs = require('./CWY2PHPR.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _QW7NAUIXcjs = require('./QW7NAUIX.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -75,7 +75,7 @@ var useMenuItem = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
75
75
|
return;
|
|
76
76
|
hideMenu();
|
|
77
77
|
});
|
|
78
|
-
const contentElement =
|
|
78
|
+
const contentElement = _QW7NAUIXcjs.useStoreState.call(void 0,
|
|
79
79
|
store,
|
|
80
80
|
(state) => "contentElement" in state ? state.contentElement : null
|
|
81
81
|
);
|
|
@@ -85,7 +85,7 @@ var useMenuItem = _CWY2PHPRcjs.createHook.call(void 0,
|
|
|
85
85
|
}, props), {
|
|
86
86
|
onClick
|
|
87
87
|
});
|
|
88
|
-
props =
|
|
88
|
+
props = _AHLK6SVFcjs.useCompositeItem.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, { store, preventScrollOnKeyDown }, props));
|
|
89
89
|
props = _WWIZUBSBcjs.useCompositeHover.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {
|
|
90
90
|
store
|
|
91
91
|
}, props), {
|
|
@@ -20,12 +20,13 @@ function walkTreeOutside(elements, callback, ancestorCallback) {
|
|
|
20
20
|
return maybeAncestor.contains(element);
|
|
21
21
|
});
|
|
22
22
|
const doc = _dom.getDocument.call(void 0, element);
|
|
23
|
+
const originalElement = element;
|
|
23
24
|
while (element.parentElement && element !== doc.body) {
|
|
24
|
-
ancestorCallback == null ? void 0 : ancestorCallback(element.parentElement);
|
|
25
|
+
ancestorCallback == null ? void 0 : ancestorCallback(element.parentElement, originalElement);
|
|
25
26
|
if (!hasAncestorAlready) {
|
|
26
27
|
for (const child of element.parentElement.children) {
|
|
27
28
|
if (isValidElement(child, elements)) {
|
|
28
|
-
callback(child);
|
|
29
|
+
callback(child, originalElement);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _AHLK6SVFcjs = require('./AHLK6SVF.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
|
15
15
|
var useToolbarItem = _CWY2PHPRcjs.createHook.call(void 0,
|
|
16
16
|
(_a) => {
|
|
17
17
|
var _b = _a, { store } = _b, props = _72I2GWXFcjs.__objRest.call(void 0, _b, ["store"]);
|
|
18
|
-
props =
|
|
18
|
+
props = _AHLK6SVFcjs.useCompositeItem.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, { store }, props));
|
|
19
19
|
return props;
|
|
20
20
|
}
|
|
21
21
|
);
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _5WLTMVVQcjs = require('./5WLTMVVQ.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
10
|
+
|
|
11
|
+
// src/utils/store.tsx
|
|
12
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
13
|
+
var _misc = require('@ariakit/core/utils/misc');
|
|
14
|
+
var _store = require('@ariakit/core/utils/store');
|
|
15
|
+
var _reactdom = require('react-dom');
|
|
16
|
+
var _indexjs = require('use-sync-external-store/shim/index.js');
|
|
17
|
+
var noopSubscribe = () => () => {
|
|
18
|
+
};
|
|
19
|
+
var inFlushSyncContext = false;
|
|
20
|
+
function safeFlushSync(fn, canFlushSync = true) {
|
|
21
|
+
if (inFlushSyncContext || !canFlushSync) {
|
|
22
|
+
fn();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
inFlushSyncContext = true;
|
|
26
|
+
const originalError = console.error;
|
|
27
|
+
if (process.env.NODE_ENV !== "production") {
|
|
28
|
+
console.error = (msg) => {
|
|
29
|
+
if (msg.startsWith("Warning: flushSync"))
|
|
30
|
+
return;
|
|
31
|
+
originalError(msg);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
_reactdom.flushSync.call(void 0, fn);
|
|
36
|
+
} finally {
|
|
37
|
+
console.error = originalError;
|
|
38
|
+
inFlushSyncContext = false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function useStoreState(store, keyOrSelector = _misc.identity) {
|
|
42
|
+
const storeSubscribe = React.useCallback(
|
|
43
|
+
(callback) => {
|
|
44
|
+
if (!store)
|
|
45
|
+
return noopSubscribe();
|
|
46
|
+
return _store.subscribe.call(void 0, store, null, callback);
|
|
47
|
+
},
|
|
48
|
+
[store]
|
|
49
|
+
);
|
|
50
|
+
const getSnapshot = () => {
|
|
51
|
+
if (!store)
|
|
52
|
+
return;
|
|
53
|
+
const state = store.getState();
|
|
54
|
+
const selector = typeof keyOrSelector === "function" ? keyOrSelector : null;
|
|
55
|
+
const key = typeof keyOrSelector === "string" ? keyOrSelector : null;
|
|
56
|
+
if (selector)
|
|
57
|
+
return selector(state);
|
|
58
|
+
if (!key)
|
|
59
|
+
return;
|
|
60
|
+
if (!_misc.hasOwnProperty.call(void 0, state, key))
|
|
61
|
+
return;
|
|
62
|
+
return state[key];
|
|
63
|
+
};
|
|
64
|
+
return _indexjs.useSyncExternalStore.call(void 0, storeSubscribe, getSnapshot, getSnapshot);
|
|
65
|
+
}
|
|
66
|
+
function useStoreProps(store, props, key, setKey) {
|
|
67
|
+
const value = _misc.hasOwnProperty.call(void 0, props, key) ? props[key] : void 0;
|
|
68
|
+
const propsRef = _5WLTMVVQcjs.useLiveRef.call(void 0, {
|
|
69
|
+
value,
|
|
70
|
+
setValue: setKey ? props[setKey] : void 0
|
|
71
|
+
});
|
|
72
|
+
_5WLTMVVQcjs.useSafeLayoutEffect.call(void 0, () => {
|
|
73
|
+
let canFlushSync = false;
|
|
74
|
+
queueMicrotask(() => {
|
|
75
|
+
canFlushSync = true;
|
|
76
|
+
});
|
|
77
|
+
return _store.sync.call(void 0, store, [key], (state, prev) => {
|
|
78
|
+
const { value: value2, setValue } = propsRef.current;
|
|
79
|
+
if (!setValue)
|
|
80
|
+
return;
|
|
81
|
+
if (state[key] === prev[key])
|
|
82
|
+
return;
|
|
83
|
+
if (state[key] === value2)
|
|
84
|
+
return;
|
|
85
|
+
safeFlushSync(() => setValue(state[key]), canFlushSync);
|
|
86
|
+
});
|
|
87
|
+
}, [store, key]);
|
|
88
|
+
_5WLTMVVQcjs.useSafeLayoutEffect.call(void 0, () => {
|
|
89
|
+
return _store.batch.call(void 0, store, [key], () => {
|
|
90
|
+
if (value === void 0)
|
|
91
|
+
return;
|
|
92
|
+
store.setState(key, value);
|
|
93
|
+
});
|
|
94
|
+
}, [store, key, value]);
|
|
95
|
+
}
|
|
96
|
+
function useStore(createStore) {
|
|
97
|
+
const store = _5WLTMVVQcjs.useLazyValue.call(void 0, createStore);
|
|
98
|
+
_5WLTMVVQcjs.useSafeLayoutEffect.call(void 0, () => _store.init.call(void 0, store), [store]);
|
|
99
|
+
const useState = React.useCallback(
|
|
100
|
+
(keyOrSelector) => useStoreState(store, keyOrSelector),
|
|
101
|
+
[store]
|
|
102
|
+
);
|
|
103
|
+
return React.useMemo(
|
|
104
|
+
() => _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, store), { useState }),
|
|
105
|
+
[store, useState]
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
exports.useStoreState = useStoreState; exports.useStoreProps = useStoreProps; exports.useStore = useStore;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _5SFIKBWFcjs = require('./5SFIKBWF.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _5VOPA6D3cjs = require('./5VOPA6D3.cjs');
|
|
@@ -11,7 +11,7 @@ var _5VOPA6D3cjs = require('./5VOPA6D3.cjs');
|
|
|
11
11
|
var _CWY2PHPRcjs = require('./CWY2PHPR.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _QW7NAUIXcjs = require('./QW7NAUIX.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
var _5WLTMVVQcjs = require('./5WLTMVVQ.cjs');
|
|
@@ -67,7 +67,7 @@ function findLast(items) {
|
|
|
67
67
|
function findById(items, id, baseId) {
|
|
68
68
|
return items.findIndex((item, index) => {
|
|
69
69
|
var _a;
|
|
70
|
-
const itemId =
|
|
70
|
+
const itemId = _5SFIKBWFcjs.getCollectionRendererItemId.call(void 0, item, index, baseId);
|
|
71
71
|
if (itemId === id)
|
|
72
72
|
return true;
|
|
73
73
|
const object = getItemObject(item);
|
|
@@ -98,11 +98,11 @@ function useCompositeRenderer(_a) {
|
|
|
98
98
|
var _a2;
|
|
99
99
|
const context = _react.useContext.call(void 0, _5VOPA6D3cjs.CompositeContext);
|
|
100
100
|
store = store || context;
|
|
101
|
-
const orientation = (_a2 =
|
|
101
|
+
const orientation = (_a2 = _QW7NAUIXcjs.useStoreState.call(void 0,
|
|
102
102
|
store,
|
|
103
103
|
(state) => (orientationProp != null ? orientationProp : state.orientation === "both") ? "vertical" : state.orientation
|
|
104
104
|
)) != null ? _a2 : orientationProp;
|
|
105
|
-
const items =
|
|
105
|
+
const items = _QW7NAUIXcjs.useStoreState.call(void 0, store, (state) => {
|
|
106
106
|
var _a3;
|
|
107
107
|
if ("mounted" in state && state.mounted)
|
|
108
108
|
return 0;
|
|
@@ -135,7 +135,7 @@ function useCompositeRenderer(_a) {
|
|
|
135
135
|
return -1;
|
|
136
136
|
return findLast(items);
|
|
137
137
|
}, [items]);
|
|
138
|
-
const activeId =
|
|
138
|
+
const activeId = _QW7NAUIXcjs.useStoreState.call(void 0, store, "activeId");
|
|
139
139
|
const activeIndex = _react.useMemo.call(void 0, () => {
|
|
140
140
|
if (!id)
|
|
141
141
|
return -1;
|
|
@@ -158,7 +158,7 @@ function useCompositeRenderer(_a) {
|
|
|
158
158
|
}
|
|
159
159
|
return indices;
|
|
160
160
|
}, [firstIndex, activeIndex, lastIndex, persistentIndicesProp]);
|
|
161
|
-
return
|
|
161
|
+
return _5SFIKBWFcjs.useCollectionRenderer.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {
|
|
162
162
|
id,
|
|
163
163
|
store,
|
|
164
164
|
orientation,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _QW7NAUIXcjs = require('./QW7NAUIX.cjs');
|
|
5
5
|
|
|
6
6
|
// src/checkbox/checkbox-store.ts
|
|
7
7
|
var _checkboxstore = require('@ariakit/core/checkbox/checkbox-store'); var Core = _interopRequireWildcard(_checkboxstore);
|
|
@@ -9,11 +9,11 @@ function useCheckboxStoreOptions(_props) {
|
|
|
9
9
|
return {};
|
|
10
10
|
}
|
|
11
11
|
function useCheckboxStoreProps(store, props) {
|
|
12
|
-
|
|
12
|
+
_QW7NAUIXcjs.useStoreProps.call(void 0, store, props, "value", "setValue");
|
|
13
13
|
return store;
|
|
14
14
|
}
|
|
15
15
|
function useCheckboxStore(props = {}) {
|
|
16
|
-
const store =
|
|
16
|
+
const store = _QW7NAUIXcjs.useStore.call(void 0, () => Core.createCheckboxStore(props));
|
|
17
17
|
return useCheckboxStoreProps(store, props);
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _QW7NAUIXcjs = require('./QW7NAUIX.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
@@ -12,12 +12,12 @@ function useCollectionStoreOptions(_props) {
|
|
|
12
12
|
return {};
|
|
13
13
|
}
|
|
14
14
|
function useCollectionStoreProps(store, props) {
|
|
15
|
-
|
|
15
|
+
_QW7NAUIXcjs.useStoreProps.call(void 0, store, props, "items", "setItems");
|
|
16
16
|
return store;
|
|
17
17
|
}
|
|
18
18
|
function useCollectionStore(props = {}) {
|
|
19
19
|
const options = useCollectionStoreOptions(props);
|
|
20
|
-
const store =
|
|
20
|
+
const store = _QW7NAUIXcjs.useStore.call(void 0,
|
|
21
21
|
() => Core.createCollectionStore(_72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), options))
|
|
22
22
|
);
|
|
23
23
|
return useCollectionStoreProps(store, props);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../__chunks/
|
|
5
|
+
var _VGBPLBUZcjs = require('../__chunks/VGBPLBUZ.cjs');
|
|
6
|
+
require('../__chunks/QW7NAUIX.cjs');
|
|
7
7
|
require('../__chunks/5WLTMVVQ.cjs');
|
|
8
8
|
require('../__chunks/7WUTS26Y.cjs');
|
|
9
9
|
require('../__chunks/72I2GWXF.cjs');
|
|
@@ -11,4 +11,4 @@ require('../__chunks/72I2GWXF.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.useCheckboxStore =
|
|
14
|
+
exports.useCheckboxStore = _VGBPLBUZcjs.useCheckboxStore; exports.useCheckboxStoreOptions = _VGBPLBUZcjs.useCheckboxStoreOptions; exports.useCheckboxStoreProps = _VGBPLBUZcjs.useCheckboxStoreProps;
|