@ariakit/core 0.3.4 → 0.3.6
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 +8 -0
- package/cjs/__chunks/{LMT335NJ.cjs → 3UT5FE6K.cjs} +2 -2
- package/cjs/__chunks/{OASSVCYR.cjs → 46BH65MC.cjs} +20 -22
- package/cjs/__chunks/{FTB5CXVB.cjs → 5F4DVUNS.cjs} +7 -1
- package/cjs/__chunks/{M44E4T5A.cjs → 6WBY3ZZM.cjs} +21 -21
- package/cjs/__chunks/{ROX3MRGO.cjs → 7ZUFMSXJ.cjs} +16 -16
- package/cjs/__chunks/GXIZMD53.cjs +35 -0
- package/cjs/__chunks/{MLPOXRDT.cjs → GZDVJEID.cjs} +2 -2
- package/cjs/__chunks/{25WWT2VO.cjs → JLC5A6WF.cjs} +15 -15
- package/cjs/__chunks/{YXSGST3H.cjs → MEHGRTJ3.cjs} +18 -18
- package/cjs/__chunks/PD7XZBXC.cjs +42 -0
- package/cjs/__chunks/{G5EW4WED.cjs → YIUPKKEK.cjs} +6 -6
- package/cjs/checkbox/checkbox-store.cjs +7 -7
- package/cjs/collection/collection-store.cjs +6 -6
- package/cjs/combobox/combobox-store.cjs +34 -34
- package/cjs/combobox/combobox-store.d.cts +4 -1
- package/cjs/combobox/combobox-store.d.ts +4 -1
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-store.cjs +7 -7
- package/cjs/dialog/dialog-store.cjs +6 -6
- package/cjs/disclosure/disclosure-store.cjs +5 -5
- package/cjs/form/form-store.cjs +28 -28
- package/cjs/hovercard/hovercard-store.cjs +8 -8
- package/cjs/index.cjs +1 -1
- package/cjs/menu/menu-bar-store.cjs +8 -21
- package/cjs/menu/menu-bar-store.d.cts +6 -6
- package/cjs/menu/menu-bar-store.d.ts +6 -6
- package/cjs/menu/menu-store.cjs +32 -32
- package/cjs/menubar/menubar-store.cjs +14 -0
- package/cjs/menubar/menubar-store.d.cts +16 -0
- package/cjs/menubar/menubar-store.d.ts +16 -0
- package/cjs/popover/popover-store.cjs +7 -7
- package/cjs/radio/radio-store.cjs +13 -13
- package/cjs/select/select-store.cjs +33 -33
- package/cjs/tab/tab-store.cjs +25 -25
- package/cjs/toolbar/toolbar-store.cjs +9 -9
- package/cjs/tooltip/tooltip-store.cjs +15 -15
- package/cjs/utils/array.cjs +1 -1
- package/cjs/utils/dom.cjs +5 -3
- package/cjs/utils/dom.d.cts +9 -0
- package/cjs/utils/dom.d.ts +9 -0
- package/cjs/utils/events.cjs +8 -8
- package/cjs/utils/focus.cjs +15 -15
- package/cjs/utils/misc.cjs +3 -3
- package/cjs/utils/platform.cjs +4 -4
- package/cjs/utils/store.cjs +4 -4
- package/esm/__chunks/ANO6WJO4.js +35 -0
- package/esm/__chunks/{LWQU4J4N.js → BXH3I7ML.js} +4 -4
- package/esm/__chunks/{Q332EHXG.js → CCU5UHQ2.js} +4 -4
- package/esm/__chunks/{I7YGHQ4Z.js → CL47ZAPY.js} +1 -1
- package/esm/__chunks/{NIF7E7VE.js → DLOEKDPY.js} +7 -1
- package/esm/__chunks/{TEJLMP2M.js → DYD4YNLE.js} +3 -3
- package/esm/__chunks/{GME4NYXR.js → E7OQVGGY.js} +6 -8
- package/esm/__chunks/{D23ES3Z4.js → I2VQ3XGR.js} +1 -1
- package/esm/__chunks/{5UJPJ37G.js → MHPO2BXA.js} +1 -1
- package/esm/__chunks/{FGW7QUD2.js → OGMLJYDV.js} +4 -4
- package/esm/__chunks/{VEWADM34.js → WY3EMTH6.js} +4 -4
- package/esm/checkbox/checkbox-store.js +3 -3
- package/esm/collection/collection-store.js +5 -5
- package/esm/combobox/combobox-store.d.ts +4 -1
- package/esm/combobox/combobox-store.js +10 -10
- package/esm/composite/composite-overflow-store.js +6 -6
- package/esm/composite/composite-store.js +6 -6
- package/esm/dialog/dialog-store.js +5 -5
- package/esm/disclosure/disclosure-store.js +4 -4
- package/esm/form/form-store.js +5 -5
- package/esm/hovercard/hovercard-store.js +7 -7
- package/esm/index.js +1 -1
- package/esm/menu/menu-bar-store.d.ts +6 -6
- package/esm/menu/menu-bar-store.js +9 -22
- package/esm/menu/menu-store.js +10 -10
- package/esm/menubar/menubar-store.d.ts +16 -0
- package/esm/menubar/menubar-store.js +14 -0
- package/esm/popover/popover-store.js +6 -6
- package/esm/radio/radio-store.js +6 -6
- package/esm/select/select-store.js +9 -9
- package/esm/tab/tab-store.js +6 -6
- package/esm/toolbar/toolbar-store.js +6 -6
- package/esm/tooltip/tooltip-store.js +7 -7
- package/esm/utils/array.js +1 -1
- package/esm/utils/dom.d.ts +9 -0
- package/esm/utils/dom.js +6 -4
- package/esm/utils/events.js +3 -3
- package/esm/utils/focus.js +2 -2
- package/esm/utils/misc.js +2 -2
- package/esm/utils/platform.js +3 -3
- package/esm/utils/store.js +3 -3
- package/menubar/menubar-store/package.json +8 -0
- package/package.json +8 -1
- package/cjs/__chunks/LUOEAZGU.cjs +0 -42
- /package/cjs/__chunks/{WYXAWBLE.cjs → AV6KTKLE.cjs} +0 -0
- /package/esm/__chunks/{2SMRF6AD.js → 4R3V3JGP.js} +0 -0
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
13
13
|
|
|
14
14
|
// src/checkbox/checkbox-store.ts
|
|
15
15
|
function createCheckboxStore(props = {}) {
|
|
16
16
|
var _a;
|
|
17
|
-
|
|
17
|
+
_46BH65MCcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
18
18
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
19
19
|
const initialState = {
|
|
20
|
-
value:
|
|
20
|
+
value: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
21
21
|
props.value,
|
|
22
22
|
syncState == null ? void 0 : syncState.value,
|
|
23
23
|
props.defaultValue,
|
|
24
24
|
false
|
|
25
25
|
)
|
|
26
26
|
};
|
|
27
|
-
const checkbox =
|
|
28
|
-
return
|
|
27
|
+
const checkbox = _46BH65MCcjs.createStore.call(void 0, initialState, props.store);
|
|
28
|
+
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, checkbox), {
|
|
29
29
|
setValue: (value) => checkbox.setState("value", value)
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
4
|
+
var _JLC5A6WFcjs = require('../__chunks/JLC5A6WF.cjs');
|
|
5
|
+
require('../__chunks/46BH65MC.cjs');
|
|
6
|
+
require('../__chunks/3UT5FE6K.cjs');
|
|
7
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
8
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.createCollectionStore =
|
|
11
|
+
exports.createCollectionStore = _JLC5A6WFcjs.createCollectionStore;
|
|
@@ -1,92 +1,92 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _7ZUFMSXJcjs = require('../__chunks/7ZUFMSXJ.cjs');
|
|
5
|
+
require('../__chunks/GZDVJEID.cjs');
|
|
6
|
+
require('../__chunks/MEHGRTJ3.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../__chunks/
|
|
9
|
+
var _6WBY3ZZMcjs = require('../__chunks/6WBY3ZZM.cjs');
|
|
10
|
+
require('../__chunks/JLC5A6WF.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
25
|
-
require('../__chunks/
|
|
24
|
+
var _YIUPKKEKcjs = require('../__chunks/YIUPKKEK.cjs');
|
|
25
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
26
26
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
31
31
|
|
|
32
32
|
// src/combobox/combobox-store.ts
|
|
33
|
-
var isSafariOnMobile =
|
|
33
|
+
var isSafariOnMobile = _YIUPKKEKcjs.isSafari.call(void 0, ) && _YIUPKKEKcjs.isTouchDevice.call(void 0, );
|
|
34
34
|
function createComboboxStore(props = {}) {
|
|
35
35
|
var _a;
|
|
36
|
-
|
|
36
|
+
_46BH65MCcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
37
37
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
38
|
-
const activeId =
|
|
38
|
+
const activeId = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
39
39
|
props.activeId,
|
|
40
40
|
syncState == null ? void 0 : syncState.activeId,
|
|
41
41
|
props.defaultActiveId,
|
|
42
42
|
null
|
|
43
43
|
);
|
|
44
|
-
const composite =
|
|
44
|
+
const composite = _6WBY3ZZMcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
45
45
|
activeId,
|
|
46
|
-
includesBaseElement:
|
|
46
|
+
includesBaseElement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
47
47
|
props.includesBaseElement,
|
|
48
48
|
syncState == null ? void 0 : syncState.includesBaseElement,
|
|
49
49
|
true
|
|
50
50
|
),
|
|
51
|
-
orientation:
|
|
51
|
+
orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
52
52
|
props.orientation,
|
|
53
53
|
syncState == null ? void 0 : syncState.orientation,
|
|
54
54
|
"vertical"
|
|
55
55
|
),
|
|
56
|
-
focusLoop:
|
|
57
|
-
focusWrap:
|
|
58
|
-
virtualFocus:
|
|
56
|
+
focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
|
|
57
|
+
focusWrap: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
|
|
58
|
+
virtualFocus: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
59
59
|
props.virtualFocus,
|
|
60
60
|
syncState == null ? void 0 : syncState.virtualFocus,
|
|
61
61
|
!isSafariOnMobile
|
|
62
62
|
)
|
|
63
63
|
}));
|
|
64
|
-
const popover =
|
|
65
|
-
placement:
|
|
64
|
+
const popover = _7ZUFMSXJcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
65
|
+
placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
66
66
|
props.placement,
|
|
67
67
|
syncState == null ? void 0 : syncState.placement,
|
|
68
68
|
"bottom-start"
|
|
69
69
|
)
|
|
70
70
|
}));
|
|
71
|
-
const initialValue =
|
|
71
|
+
const initialValue = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
72
72
|
props.value,
|
|
73
73
|
syncState == null ? void 0 : syncState.value,
|
|
74
74
|
props.defaultValue,
|
|
75
75
|
""
|
|
76
76
|
);
|
|
77
|
-
const initialState =
|
|
77
|
+
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
|
|
78
78
|
value: initialValue,
|
|
79
|
-
resetValueOnHide:
|
|
79
|
+
resetValueOnHide: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
80
80
|
props.resetValueOnHide,
|
|
81
81
|
syncState == null ? void 0 : syncState.resetValueOnHide,
|
|
82
82
|
false
|
|
83
83
|
),
|
|
84
84
|
activeValue: syncState == null ? void 0 : syncState.activeValue
|
|
85
85
|
});
|
|
86
|
-
const combobox =
|
|
87
|
-
|
|
86
|
+
const combobox = _46BH65MCcjs.createStore.call(void 0, initialState, composite, popover, props.store);
|
|
87
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
88
88
|
combobox,
|
|
89
|
-
() =>
|
|
89
|
+
() => _46BH65MCcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
|
|
90
90
|
if (!state.resetValueOnHide)
|
|
91
91
|
return;
|
|
92
92
|
if (state.mounted)
|
|
@@ -94,26 +94,26 @@ function createComboboxStore(props = {}) {
|
|
|
94
94
|
combobox.setState("value", initialValue);
|
|
95
95
|
})
|
|
96
96
|
);
|
|
97
|
-
|
|
97
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
98
98
|
combobox,
|
|
99
|
-
() =>
|
|
99
|
+
() => _46BH65MCcjs.batch.call(void 0, combobox, ["mounted"], (state) => {
|
|
100
100
|
if (state.mounted)
|
|
101
101
|
return;
|
|
102
102
|
combobox.setState("activeId", activeId);
|
|
103
103
|
combobox.setState("moves", 0);
|
|
104
104
|
})
|
|
105
105
|
);
|
|
106
|
-
|
|
106
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
107
107
|
combobox,
|
|
108
|
-
() =>
|
|
108
|
+
() => _46BH65MCcjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
|
|
109
109
|
if (state.moves === prevState.moves) {
|
|
110
110
|
combobox.setState("activeValue", void 0);
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
113
|
);
|
|
114
|
-
|
|
114
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
115
115
|
combobox,
|
|
116
|
-
() =>
|
|
116
|
+
() => _46BH65MCcjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
|
|
117
117
|
if (state.moves === prev.moves)
|
|
118
118
|
return;
|
|
119
119
|
const { activeId: activeId2 } = combobox.getState();
|
|
@@ -121,7 +121,7 @@ function createComboboxStore(props = {}) {
|
|
|
121
121
|
combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
|
|
122
122
|
})
|
|
123
123
|
);
|
|
124
|
-
return
|
|
124
|
+
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover), composite), combobox), {
|
|
125
125
|
setValue: (value) => combobox.setState("value", value)
|
|
126
126
|
});
|
|
127
127
|
}
|
|
@@ -19,7 +19,8 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
19
19
|
* The input value.
|
|
20
20
|
*
|
|
21
21
|
* Live examples:
|
|
22
|
-
* - [
|
|
22
|
+
* - [Combobox with integrated
|
|
23
|
+
* filter](https://ariakit.org/examples/combobox-filtering-integrated)
|
|
23
24
|
* - [Combobox with links](https://ariakit.org/examples/combobox-links)
|
|
24
25
|
* - [Combobox filtering](https://ariakit.org/examples/combobox-filtering)
|
|
25
26
|
* - [Multi-selectable
|
|
@@ -38,6 +39,8 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
38
39
|
* Live examples:
|
|
39
40
|
* - [Multi-selectable
|
|
40
41
|
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
42
|
+
* - [Menu with Combobox](https://ariakit.org/examples/menu-combobox)
|
|
43
|
+
* - [Select with Combobox](https://ariakit.org/examples/select-combobox)
|
|
41
44
|
* @default false
|
|
42
45
|
*/
|
|
43
46
|
resetValueOnHide: boolean;
|
|
@@ -19,7 +19,8 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
19
19
|
* The input value.
|
|
20
20
|
*
|
|
21
21
|
* Live examples:
|
|
22
|
-
* - [
|
|
22
|
+
* - [Combobox with integrated
|
|
23
|
+
* filter](https://ariakit.org/examples/combobox-filtering-integrated)
|
|
23
24
|
* - [Combobox with links](https://ariakit.org/examples/combobox-links)
|
|
24
25
|
* - [Combobox filtering](https://ariakit.org/examples/combobox-filtering)
|
|
25
26
|
* - [Multi-selectable
|
|
@@ -38,6 +39,8 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
38
39
|
* Live examples:
|
|
39
40
|
* - [Multi-selectable
|
|
40
41
|
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
42
|
+
* - [Menu with Combobox](https://ariakit.org/examples/menu-combobox)
|
|
43
|
+
* - [Select with Combobox](https://ariakit.org/examples/select-combobox)
|
|
41
44
|
* @default false
|
|
42
45
|
*/
|
|
43
46
|
resetValueOnHide: boolean;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/
|
|
4
|
+
var _7ZUFMSXJcjs = require('../__chunks/7ZUFMSXJ.cjs');
|
|
5
|
+
require('../__chunks/GZDVJEID.cjs');
|
|
6
|
+
require('../__chunks/MEHGRTJ3.cjs');
|
|
7
|
+
require('../__chunks/46BH65MC.cjs');
|
|
8
|
+
require('../__chunks/3UT5FE6K.cjs');
|
|
9
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
10
10
|
|
|
11
11
|
// src/composite/composite-overflow-store.ts
|
|
12
12
|
function createCompositeOverflowStore(props = {}) {
|
|
13
|
-
return
|
|
13
|
+
return _7ZUFMSXJcjs.createPopoverStore.call(void 0, props);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
4
|
+
var _6WBY3ZZMcjs = require('../__chunks/6WBY3ZZM.cjs');
|
|
5
|
+
require('../__chunks/JLC5A6WF.cjs');
|
|
6
|
+
require('../__chunks/46BH65MC.cjs');
|
|
7
|
+
require('../__chunks/3UT5FE6K.cjs');
|
|
8
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
9
9
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
10
|
-
require('../__chunks/
|
|
10
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createCompositeStore =
|
|
13
|
+
exports.createCompositeStore = _6WBY3ZZMcjs.createCompositeStore;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
4
|
+
var _GZDVJEIDcjs = require('../__chunks/GZDVJEID.cjs');
|
|
5
|
+
require('../__chunks/MEHGRTJ3.cjs');
|
|
6
|
+
require('../__chunks/46BH65MC.cjs');
|
|
7
|
+
require('../__chunks/3UT5FE6K.cjs');
|
|
8
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.createDialogStore =
|
|
11
|
+
exports.createDialogStore = _GZDVJEIDcjs.createDialogStore;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
4
|
+
var _MEHGRTJ3cjs = require('../__chunks/MEHGRTJ3.cjs');
|
|
5
|
+
require('../__chunks/46BH65MC.cjs');
|
|
6
|
+
require('../__chunks/3UT5FE6K.cjs');
|
|
7
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createDisclosureStore =
|
|
10
|
+
exports.createDisclosureStore = _MEHGRTJ3cjs.createDisclosureStore;
|
package/cjs/form/form-store.cjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _JLC5A6WFcjs = require('../__chunks/JLC5A6WF.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
require('../__chunks/
|
|
16
|
+
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
17
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
22
22
|
|
|
23
23
|
// src/form/form-store.ts
|
|
24
24
|
function nextFrame() {
|
|
@@ -26,7 +26,7 @@ function nextFrame() {
|
|
|
26
26
|
}
|
|
27
27
|
function hasMessages(object) {
|
|
28
28
|
return Object.keys(object).some((key) => {
|
|
29
|
-
if (
|
|
29
|
+
if (_3UT5FE6Kcjs.isObject.call(void 0, object[key])) {
|
|
30
30
|
return hasMessages(object[key]);
|
|
31
31
|
}
|
|
32
32
|
return !!object[key];
|
|
@@ -48,10 +48,10 @@ function set(values, path, value) {
|
|
|
48
48
|
if (k == null)
|
|
49
49
|
return values;
|
|
50
50
|
const key = k;
|
|
51
|
-
const isIntegerKey =
|
|
51
|
+
const isIntegerKey = _3UT5FE6Kcjs.isInteger.call(void 0, key);
|
|
52
52
|
const nextValues = isIntegerKey ? values || [] : values || {};
|
|
53
53
|
const nestedValues = nextValues[key];
|
|
54
|
-
const result = rest.length && (Array.isArray(nestedValues) ||
|
|
54
|
+
const result = rest.length && (Array.isArray(nestedValues) || _3UT5FE6Kcjs.isObject.call(void 0, nestedValues)) ? set(nestedValues, rest, value) : value;
|
|
55
55
|
if (isIntegerKey) {
|
|
56
56
|
const index = Number(key);
|
|
57
57
|
if (values && Array.isArray(values)) {
|
|
@@ -65,7 +65,7 @@ function set(values, path, value) {
|
|
|
65
65
|
nextValues2[index] = result;
|
|
66
66
|
return nextValues2;
|
|
67
67
|
}
|
|
68
|
-
return
|
|
68
|
+
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, values), { [key]: result });
|
|
69
69
|
}
|
|
70
70
|
function setAll(values, value) {
|
|
71
71
|
const result = {};
|
|
@@ -74,12 +74,12 @@ function setAll(values, value) {
|
|
|
74
74
|
const currentValue = values[key];
|
|
75
75
|
if (Array.isArray(currentValue)) {
|
|
76
76
|
result[key] = currentValue.map((v) => {
|
|
77
|
-
if (
|
|
77
|
+
if (_3UT5FE6Kcjs.isObject.call(void 0, v)) {
|
|
78
78
|
return setAll(v, value);
|
|
79
79
|
}
|
|
80
80
|
return value;
|
|
81
81
|
});
|
|
82
|
-
} else if (
|
|
82
|
+
} else if (_3UT5FE6Kcjs.isObject.call(void 0, currentValue)) {
|
|
83
83
|
result[key] = setAll(currentValue, value);
|
|
84
84
|
} else {
|
|
85
85
|
result[key] = value;
|
|
@@ -114,46 +114,46 @@ function createNames() {
|
|
|
114
114
|
}
|
|
115
115
|
function createFormStore(props = {}) {
|
|
116
116
|
var _a;
|
|
117
|
-
|
|
117
|
+
_46BH65MCcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
118
118
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
119
|
-
const collection =
|
|
120
|
-
const values =
|
|
119
|
+
const collection = _JLC5A6WFcjs.createCollectionStore.call(void 0, props);
|
|
120
|
+
const values = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
121
121
|
props.values,
|
|
122
122
|
syncState == null ? void 0 : syncState.values,
|
|
123
123
|
props.defaultValues,
|
|
124
124
|
{}
|
|
125
125
|
);
|
|
126
|
-
const errors =
|
|
126
|
+
const errors = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
127
127
|
props.errors,
|
|
128
128
|
syncState == null ? void 0 : syncState.errors,
|
|
129
129
|
props.defaultErrors,
|
|
130
130
|
{}
|
|
131
131
|
);
|
|
132
|
-
const touched =
|
|
132
|
+
const touched = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
133
133
|
props.touched,
|
|
134
134
|
syncState == null ? void 0 : syncState.touched,
|
|
135
135
|
props.defaultTouched,
|
|
136
136
|
{}
|
|
137
137
|
);
|
|
138
|
-
const initialState =
|
|
138
|
+
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, collection.getState()), {
|
|
139
139
|
values,
|
|
140
140
|
errors,
|
|
141
141
|
touched,
|
|
142
|
-
validating:
|
|
143
|
-
submitting:
|
|
144
|
-
submitSucceed:
|
|
145
|
-
submitFailed:
|
|
142
|
+
validating: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.validating, false),
|
|
143
|
+
submitting: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitting, false),
|
|
144
|
+
submitSucceed: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitSucceed, 0),
|
|
145
|
+
submitFailed: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
|
|
146
146
|
valid: !hasMessages(errors)
|
|
147
147
|
});
|
|
148
|
-
const form =
|
|
148
|
+
const form = _46BH65MCcjs.createStore.call(void 0, initialState, collection, props.store);
|
|
149
149
|
const syncCallbacks = getStoreCallbacks(props.store);
|
|
150
150
|
const syncCallbacksState = syncCallbacks == null ? void 0 : syncCallbacks.getState();
|
|
151
151
|
const callbacksInitialState = {
|
|
152
152
|
validate: (syncCallbacksState == null ? void 0 : syncCallbacksState.validate) || [],
|
|
153
153
|
submit: (syncCallbacksState == null ? void 0 : syncCallbacksState.submit) || []
|
|
154
154
|
};
|
|
155
|
-
const callbacks =
|
|
156
|
-
|
|
155
|
+
const callbacks = _46BH65MCcjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
|
|
156
|
+
_46BH65MCcjs.setup.call(void 0, form, () => _46BH65MCcjs.init.call(void 0, callbacks));
|
|
157
157
|
const validate = async () => {
|
|
158
158
|
form.setState("validating", true);
|
|
159
159
|
form.setState("errors", {});
|
|
@@ -168,13 +168,13 @@ function createFormStore(props = {}) {
|
|
|
168
168
|
form.setState("validating", false);
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
|
-
return
|
|
171
|
+
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, collection), form), {
|
|
172
172
|
names: createNames(),
|
|
173
173
|
setValues: (values2) => form.setState("values", values2),
|
|
174
174
|
getValue: (name) => get(form.getState().values, name),
|
|
175
175
|
setValue: (name, value) => form.setState("values", (values2) => {
|
|
176
176
|
const prevValue = get(values2, name);
|
|
177
|
-
const nextValue =
|
|
177
|
+
const nextValue = _3UT5FE6Kcjs.applyState.call(void 0, value, prevValue);
|
|
178
178
|
if (nextValue === prevValue)
|
|
179
179
|
return values2;
|
|
180
180
|
return set(values2, name, nextValue);
|
|
@@ -195,7 +195,7 @@ function createFormStore(props = {}) {
|
|
|
195
195
|
getError: (name) => get(form.getState().errors, name),
|
|
196
196
|
setError: (name, error) => form.setState("errors", (errors2) => {
|
|
197
197
|
const prevError = get(errors2, name);
|
|
198
|
-
const nextError =
|
|
198
|
+
const nextError = _3UT5FE6Kcjs.applyState.call(void 0, error, prevError);
|
|
199
199
|
if (nextError === prevError)
|
|
200
200
|
return errors2;
|
|
201
201
|
return set(errors2, name, nextError);
|
|
@@ -204,7 +204,7 @@ function createFormStore(props = {}) {
|
|
|
204
204
|
getFieldTouched: (name) => !!get(form.getState().touched, name),
|
|
205
205
|
setFieldTouched: (name, value) => form.setState("touched", (touched2) => {
|
|
206
206
|
const prevValue = get(touched2, name);
|
|
207
|
-
const nextValue =
|
|
207
|
+
const nextValue = _3UT5FE6Kcjs.applyState.call(void 0, value, prevValue);
|
|
208
208
|
if (nextValue === prevValue)
|
|
209
209
|
return touched2;
|
|
210
210
|
return set(touched2, name, nextValue);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/
|
|
10
|
-
require('../__chunks/
|
|
4
|
+
var _PD7XZBXCcjs = require('../__chunks/PD7XZBXC.cjs');
|
|
5
|
+
require('../__chunks/7ZUFMSXJ.cjs');
|
|
6
|
+
require('../__chunks/GZDVJEID.cjs');
|
|
7
|
+
require('../__chunks/MEHGRTJ3.cjs');
|
|
8
|
+
require('../__chunks/46BH65MC.cjs');
|
|
9
|
+
require('../__chunks/3UT5FE6K.cjs');
|
|
10
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createHovercardStore =
|
|
13
|
+
exports.createHovercardStore = _PD7XZBXCcjs.createHovercardStore;
|
package/cjs/index.cjs
CHANGED
|
@@ -1,31 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
require('../__chunks/FTB5CXVB.cjs');
|
|
4
|
+
var _GXIZMD53cjs = require('../__chunks/GXIZMD53.cjs');
|
|
5
|
+
require('../__chunks/6WBY3ZZM.cjs');
|
|
6
|
+
require('../__chunks/JLC5A6WF.cjs');
|
|
7
|
+
require('../__chunks/46BH65MC.cjs');
|
|
8
|
+
require('../__chunks/3UT5FE6K.cjs');
|
|
9
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
11
10
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _WYXAWBLEcjs = require('../__chunks/WYXAWBLE.cjs');
|
|
11
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
16
12
|
|
|
17
13
|
// src/menu/menu-bar-store.ts
|
|
18
14
|
function createMenuBarStore(props = {}) {
|
|
19
|
-
|
|
20
|
-
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
21
|
-
return _M44E4T5Acjs.createCompositeStore.call(void 0, _WYXAWBLEcjs.__spreadProps.call(void 0, _WYXAWBLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
22
|
-
orientation: _LMT335NJcjs.defaultValue.call(void 0,
|
|
23
|
-
props.orientation,
|
|
24
|
-
syncState == null ? void 0 : syncState.orientation,
|
|
25
|
-
"horizontal"
|
|
26
|
-
),
|
|
27
|
-
focusLoop: _LMT335NJcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
28
|
-
}));
|
|
15
|
+
return _GXIZMD53cjs.createMenubarStore.call(void 0, props);
|
|
29
16
|
}
|
|
30
17
|
|
|
31
18
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MenubarStore, MenubarStoreFunctions, MenubarStoreOptions, MenubarStoreProps, MenubarStoreState } from "../menubar/menubar-store.js";
|
|
2
2
|
/**
|
|
3
3
|
* Creates a menu bar store.
|
|
4
4
|
*/
|
|
5
5
|
export declare function createMenuBarStore(props?: MenuBarStoreProps): MenuBarStore;
|
|
6
|
-
export type MenuBarStoreState =
|
|
7
|
-
export type MenuBarStoreFunctions =
|
|
8
|
-
export type MenuBarStoreOptions =
|
|
9
|
-
export type MenuBarStoreProps =
|
|
10
|
-
export type MenuBarStore =
|
|
6
|
+
export type MenuBarStoreState = MenubarStoreState;
|
|
7
|
+
export type MenuBarStoreFunctions = MenubarStoreFunctions;
|
|
8
|
+
export type MenuBarStoreOptions = MenubarStoreOptions;
|
|
9
|
+
export type MenuBarStoreProps = MenubarStoreProps;
|
|
10
|
+
export type MenuBarStore = MenubarStore;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MenubarStore, MenubarStoreFunctions, MenubarStoreOptions, MenubarStoreProps, MenubarStoreState } from "../menubar/menubar-store.js";
|
|
2
2
|
/**
|
|
3
3
|
* Creates a menu bar store.
|
|
4
4
|
*/
|
|
5
5
|
export declare function createMenuBarStore(props?: MenuBarStoreProps): MenuBarStore;
|
|
6
|
-
export type MenuBarStoreState =
|
|
7
|
-
export type MenuBarStoreFunctions =
|
|
8
|
-
export type MenuBarStoreOptions =
|
|
9
|
-
export type MenuBarStoreProps =
|
|
10
|
-
export type MenuBarStore =
|
|
6
|
+
export type MenuBarStoreState = MenubarStoreState;
|
|
7
|
+
export type MenuBarStoreFunctions = MenubarStoreFunctions;
|
|
8
|
+
export type MenuBarStoreOptions = MenubarStoreOptions;
|
|
9
|
+
export type MenuBarStoreProps = MenubarStoreProps;
|
|
10
|
+
export type MenuBarStore = MenubarStore;
|