@ariakit/core 0.4.14 → 0.4.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 +8 -0
- package/cjs/__chunks/{RL7DKHOF.cjs → 34NK2NPD.cjs} +4 -4
- package/cjs/__chunks/{WOLZY4WC.cjs → 6REHCF5T.cjs} +6 -6
- package/cjs/__chunks/{K7YTZVWC.cjs → 7WVAUIME.cjs} +7 -7
- package/cjs/__chunks/{BUEPUCQL.cjs → E5AYFGW2.cjs} +13 -13
- package/cjs/__chunks/{ASR6PAFN.cjs → EKSEHA55.cjs} +7 -5
- package/cjs/__chunks/{V4YF2QA6.cjs → L5GSFUJU.cjs} +11 -11
- package/cjs/__chunks/{BVPEDDW6.cjs → OGYYHXPP.cjs} +7 -7
- package/cjs/__chunks/{YMCSKJHR.cjs → VR2FVDSU.cjs} +2 -2
- package/cjs/__chunks/{726BNPQZ.cjs → VZPNI7C2.cjs} +1 -1
- package/cjs/__chunks/{TFI7KVZO.cjs → XVG7OFIP.cjs} +4 -4
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/checkbox/checkbox-store.d.cts +1 -1
- package/cjs/checkbox/checkbox-store.d.ts +1 -1
- package/cjs/collection/collection-store.cjs +4 -4
- package/cjs/collection/collection-store.d.cts +4 -0
- package/cjs/collection/collection-store.d.ts +4 -0
- package/cjs/combobox/combobox-store.cjs +29 -29
- package/cjs/combobox/combobox-store.d.cts +5 -2
- package/cjs/combobox/combobox-store.d.ts +5 -2
- package/cjs/composite/composite-overflow-store.cjs +5 -5
- package/cjs/composite/composite-store.cjs +5 -5
- package/cjs/composite/composite-store.d.cts +10 -0
- package/cjs/composite/composite-store.d.ts +10 -0
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/form/form-store.cjs +17 -8
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/menu/menu-bar-store.cjs +6 -6
- package/cjs/menu/menu-store.cjs +19 -19
- package/cjs/menu/menu-store.d.cts +1 -1
- package/cjs/menu/menu-store.d.ts +1 -1
- package/cjs/menubar/menubar-store.cjs +6 -6
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/radio/radio-store.cjs +6 -6
- package/cjs/select/select-store.cjs +22 -22
- package/cjs/select/select-store.d.cts +1 -1
- package/cjs/select/select-store.d.ts +1 -1
- package/cjs/tab/tab-store.cjs +25 -25
- package/cjs/tab/tab-store.d.cts +4 -0
- package/cjs/tab/tab-store.d.ts +4 -0
- package/cjs/tag/tag-store.cjs +10 -10
- package/cjs/toolbar/toolbar-store.cjs +5 -5
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/utils/dom.cjs +2 -2
- package/cjs/utils/events.cjs +5 -5
- package/cjs/utils/focus.cjs +10 -10
- package/cjs/utils/platform.cjs +3 -3
- package/cjs/utils/store.cjs +2 -2
- package/esm/__chunks/{DTR5TSDJ.js → 37JWRFYW.js} +1 -1
- package/esm/__chunks/{RCQ5P4YE.js → 43IPP2F4.js} +1 -1
- package/esm/__chunks/{7HRRFUKQ.js → 76UM5ZLT.js} +2 -2
- package/esm/__chunks/{AJZ4BYF3.js → C34RJTDU.js} +4 -4
- package/esm/__chunks/{BCALMBPZ.js → EWA2WL6G.js} +7 -5
- package/esm/__chunks/{CYQWQL4J.js → K2KIGYQU.js} +5 -5
- package/esm/__chunks/{ME2CUF3F.js → MD3RIO2T.js} +2 -2
- package/esm/__chunks/{QAGXQEUG.js → O6E4ZWCP.js} +1 -1
- package/esm/__chunks/{FZZ2AVHF.js → RZDDWCDV.js} +1 -1
- package/esm/__chunks/{JTLIIJ4U.js → X2ASWIQW.js} +2 -2
- package/esm/checkbox/checkbox-store.d.ts +1 -1
- package/esm/checkbox/checkbox-store.js +1 -1
- package/esm/collection/collection-store.d.ts +4 -0
- package/esm/collection/collection-store.js +3 -3
- package/esm/combobox/combobox-store.d.ts +5 -2
- package/esm/combobox/combobox-store.js +13 -13
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-store.d.ts +10 -0
- package/esm/composite/composite-store.js +4 -4
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-store.js +12 -3
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/menu/menu-bar-store.js +5 -5
- package/esm/menu/menu-store.d.ts +1 -1
- package/esm/menu/menu-store.js +8 -8
- package/esm/menubar/menubar-store.js +5 -5
- package/esm/popover/popover-store.js +4 -4
- package/esm/radio/radio-store.js +4 -4
- package/esm/select/select-store.d.ts +1 -1
- package/esm/select/select-store.js +9 -9
- package/esm/tab/tab-store.d.ts +4 -0
- package/esm/tab/tab-store.js +5 -5
- package/esm/tag/tag-store.js +7 -7
- package/esm/toolbar/toolbar-store.js +4 -4
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/utils/dom.js +1 -1
- package/esm/utils/events.js +2 -2
- package/esm/utils/focus.js +1 -1
- package/esm/utils/platform.js +2 -2
- package/esm/utils/store.js +1 -1
- package/license +1 -1
- package/package.json +113 -113
- package/readme.md +3 -2
|
@@ -9,7 +9,7 @@ type MutableValue<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedVa
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function createComboboxStore<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue>(props: PickRequired<ComboboxStoreProps<T>, "selectedValue" | "defaultSelectedValue">): ComboboxStore<T>;
|
|
11
11
|
export declare function createComboboxStore(props?: ComboboxStoreProps): ComboboxStore;
|
|
12
|
-
export type ComboboxStoreSelectedValue = string | string[];
|
|
12
|
+
export type ComboboxStoreSelectedValue = string | readonly string[];
|
|
13
13
|
export interface ComboboxStoreItem extends CompositeStoreItem {
|
|
14
14
|
value?: string;
|
|
15
15
|
}
|
|
@@ -36,6 +36,8 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
|
|
|
36
36
|
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
37
37
|
* - [Textarea with inline
|
|
38
38
|
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
39
|
+
* - [Command Menu with
|
|
40
|
+
* Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
|
|
39
41
|
*/
|
|
40
42
|
value: string;
|
|
41
43
|
/**
|
|
@@ -70,7 +72,8 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
|
|
|
70
72
|
* - [Select with Combobox](https://ariakit.org/examples/select-combobox)
|
|
71
73
|
* - [Submenu with
|
|
72
74
|
* Combobox](https://ariakit.org/examples/menu-nested-combobox)
|
|
73
|
-
* - [Command Menu
|
|
75
|
+
* - [Command Menu with
|
|
76
|
+
* Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
|
|
74
77
|
* - [Select with Combobox and
|
|
75
78
|
* Tabs](https://ariakit.org/examples/select-combobox-tab)
|
|
76
79
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
3
|
+
var _OGYYHXPPcjs = require('../__chunks/OGYYHXPP.cjs');
|
|
4
|
+
require('../__chunks/VR2FVDSU.cjs');
|
|
5
|
+
require('../__chunks/L5GSFUJU.cjs');
|
|
6
|
+
require('../__chunks/EKSEHA55.cjs');
|
|
7
7
|
require('../__chunks/MLCPLY2P.cjs');
|
|
8
8
|
require('../__chunks/7EQBAZ46.cjs');
|
|
9
9
|
|
|
10
10
|
// src/composite/composite-overflow-store.ts
|
|
11
11
|
function createCompositeOverflowStore(props = {}) {
|
|
12
|
-
return
|
|
12
|
+
return _OGYYHXPPcjs.createPopoverStore.call(void 0, props);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/BUEPUCQL.cjs');
|
|
3
|
+
var _7WVAUIMEcjs = require('../__chunks/7WVAUIME.cjs');
|
|
5
4
|
require('../__chunks/GDZQUFNP.cjs');
|
|
6
|
-
require('../__chunks/
|
|
5
|
+
require('../__chunks/E5AYFGW2.cjs');
|
|
6
|
+
require('../__chunks/VZPNI7C2.cjs');
|
|
7
|
+
require('../__chunks/EKSEHA55.cjs');
|
|
7
8
|
require('../__chunks/MLCPLY2P.cjs');
|
|
8
|
-
require('../__chunks/726BNPQZ.cjs');
|
|
9
9
|
require('../__chunks/7EQBAZ46.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createCompositeStore =
|
|
12
|
+
exports.createCompositeStore = _7WVAUIMEcjs.createCompositeStore;
|
|
@@ -131,6 +131,8 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
|
|
|
131
131
|
*
|
|
132
132
|
* Live examples:
|
|
133
133
|
* - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
|
|
134
|
+
* - [Command Menu with
|
|
135
|
+
* Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
|
|
134
136
|
* @default false
|
|
135
137
|
*/
|
|
136
138
|
focusLoop: boolean | Orientation;
|
|
@@ -147,6 +149,10 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
|
|
|
147
149
|
* matches the value of `focusWrap`, it'll wrap between the last item in the
|
|
148
150
|
* last row or column and the first item in the first row or column and
|
|
149
151
|
* vice-versa.
|
|
152
|
+
*
|
|
153
|
+
* Live examples:
|
|
154
|
+
* - [Command Menu with
|
|
155
|
+
* Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
|
|
150
156
|
* @default false
|
|
151
157
|
*/
|
|
152
158
|
focusWrap: boolean | Orientation;
|
|
@@ -155,6 +161,10 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
|
|
|
155
161
|
*
|
|
156
162
|
* If enabled, moving up or down when there's no next item or when the next
|
|
157
163
|
* item is disabled will shift to the item right before it.
|
|
164
|
+
*
|
|
165
|
+
* Live examples:
|
|
166
|
+
* - [Command Menu with
|
|
167
|
+
* Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
|
|
158
168
|
* @default false
|
|
159
169
|
*/
|
|
160
170
|
focusShift: boolean;
|
|
@@ -131,6 +131,8 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
|
|
|
131
131
|
*
|
|
132
132
|
* Live examples:
|
|
133
133
|
* - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
|
|
134
|
+
* - [Command Menu with
|
|
135
|
+
* Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
|
|
134
136
|
* @default false
|
|
135
137
|
*/
|
|
136
138
|
focusLoop: boolean | Orientation;
|
|
@@ -147,6 +149,10 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
|
|
|
147
149
|
* matches the value of `focusWrap`, it'll wrap between the last item in the
|
|
148
150
|
* last row or column and the first item in the first row or column and
|
|
149
151
|
* vice-versa.
|
|
152
|
+
*
|
|
153
|
+
* Live examples:
|
|
154
|
+
* - [Command Menu with
|
|
155
|
+
* Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
|
|
150
156
|
* @default false
|
|
151
157
|
*/
|
|
152
158
|
focusWrap: boolean | Orientation;
|
|
@@ -155,6 +161,10 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
|
|
|
155
161
|
*
|
|
156
162
|
* If enabled, moving up or down when there's no next item or when the next
|
|
157
163
|
* item is disabled will shift to the item right before it.
|
|
164
|
+
*
|
|
165
|
+
* Live examples:
|
|
166
|
+
* - [Command Menu with
|
|
167
|
+
* Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
|
|
158
168
|
* @default false
|
|
159
169
|
*/
|
|
160
170
|
focusShift: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _VR2FVDSUcjs = require('../__chunks/VR2FVDSU.cjs');
|
|
4
|
+
require('../__chunks/L5GSFUJU.cjs');
|
|
5
|
+
require('../__chunks/EKSEHA55.cjs');
|
|
6
6
|
require('../__chunks/MLCPLY2P.cjs');
|
|
7
7
|
require('../__chunks/7EQBAZ46.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createDialogStore =
|
|
10
|
+
exports.createDialogStore = _VR2FVDSUcjs.createDialogStore;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _L5GSFUJUcjs = require('../__chunks/L5GSFUJU.cjs');
|
|
4
|
+
require('../__chunks/EKSEHA55.cjs');
|
|
5
5
|
require('../__chunks/MLCPLY2P.cjs');
|
|
6
6
|
require('../__chunks/7EQBAZ46.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.createDisclosureStore =
|
|
9
|
+
exports.createDisclosureStore = _L5GSFUJUcjs.createDisclosureStore;
|
package/cjs/form/form-store.cjs
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _E5AYFGW2cjs = require('../__chunks/E5AYFGW2.cjs');
|
|
4
|
+
require('../__chunks/VZPNI7C2.cjs');
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
var _EKSEHA55cjs = require('../__chunks/EKSEHA55.cjs');
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
|
|
15
17
|
var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
|
|
16
|
-
require('../__chunks/726BNPQZ.cjs');
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
@@ -112,9 +113,9 @@ function createNames() {
|
|
|
112
113
|
}
|
|
113
114
|
function createFormStore(props = {}) {
|
|
114
115
|
var _a;
|
|
115
|
-
|
|
116
|
+
_EKSEHA55cjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
116
117
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
117
|
-
const collection =
|
|
118
|
+
const collection = _E5AYFGW2cjs.createCollectionStore.call(void 0, props);
|
|
118
119
|
const values = _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
119
120
|
props.values,
|
|
120
121
|
syncState == null ? void 0 : syncState.values,
|
|
@@ -143,15 +144,22 @@ function createFormStore(props = {}) {
|
|
|
143
144
|
submitFailed: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
|
|
144
145
|
valid: !hasMessages(errors)
|
|
145
146
|
});
|
|
146
|
-
const form =
|
|
147
|
+
const form = _EKSEHA55cjs.createStore.call(void 0, initialState, collection, props.store);
|
|
147
148
|
const syncCallbacks = getStoreCallbacks(props.store);
|
|
148
149
|
const syncCallbacksState = syncCallbacks == null ? void 0 : syncCallbacks.getState();
|
|
149
150
|
const callbacksInitialState = {
|
|
150
151
|
validate: (syncCallbacksState == null ? void 0 : syncCallbacksState.validate) || [],
|
|
151
152
|
submit: (syncCallbacksState == null ? void 0 : syncCallbacksState.submit) || []
|
|
152
153
|
};
|
|
153
|
-
const callbacks =
|
|
154
|
-
|
|
154
|
+
const callbacks = _EKSEHA55cjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
|
|
155
|
+
_EKSEHA55cjs.setup.call(void 0, form, () => _EKSEHA55cjs.init.call(void 0, callbacks));
|
|
156
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
157
|
+
form,
|
|
158
|
+
() => _EKSEHA55cjs.sync.call(void 0, form, ["validating", "errors"], (state) => {
|
|
159
|
+
if (state.validating) return;
|
|
160
|
+
form.setState("valid", !hasMessages(state.errors));
|
|
161
|
+
})
|
|
162
|
+
);
|
|
155
163
|
const validate = async () => {
|
|
156
164
|
form.setState("validating", true);
|
|
157
165
|
form.setState("errors", {});
|
|
@@ -255,6 +263,7 @@ function createFormStore(props = {}) {
|
|
|
255
263
|
form.setState("submitting", false);
|
|
256
264
|
form.setState("submitSucceed", 0);
|
|
257
265
|
form.setState("submitFailed", 0);
|
|
266
|
+
form.setState("valid", !hasMessages(errors));
|
|
258
267
|
},
|
|
259
268
|
// @ts-expect-error Internal
|
|
260
269
|
__unstableCallbacks: callbacks
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
3
|
+
var _34NK2NPDcjs = require('../__chunks/34NK2NPD.cjs');
|
|
4
|
+
require('../__chunks/OGYYHXPP.cjs');
|
|
5
|
+
require('../__chunks/VR2FVDSU.cjs');
|
|
6
|
+
require('../__chunks/L5GSFUJU.cjs');
|
|
7
|
+
require('../__chunks/EKSEHA55.cjs');
|
|
8
8
|
require('../__chunks/MLCPLY2P.cjs');
|
|
9
9
|
require('../__chunks/7EQBAZ46.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createHovercardStore =
|
|
12
|
+
exports.createHovercardStore = _34NK2NPDcjs.createHovercardStore;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/BUEPUCQL.cjs');
|
|
3
|
+
var _XVG7OFIPcjs = require('../__chunks/XVG7OFIP.cjs');
|
|
4
|
+
require('../__chunks/7WVAUIME.cjs');
|
|
6
5
|
require('../__chunks/GDZQUFNP.cjs');
|
|
7
|
-
require('../__chunks/
|
|
6
|
+
require('../__chunks/E5AYFGW2.cjs');
|
|
7
|
+
require('../__chunks/VZPNI7C2.cjs');
|
|
8
|
+
require('../__chunks/EKSEHA55.cjs');
|
|
8
9
|
require('../__chunks/MLCPLY2P.cjs');
|
|
9
|
-
require('../__chunks/726BNPQZ.cjs');
|
|
10
10
|
require('../__chunks/7EQBAZ46.cjs');
|
|
11
11
|
|
|
12
12
|
// src/menu/menu-bar-store.ts
|
|
13
13
|
function createMenuBarStore(props = {}) {
|
|
14
|
-
return
|
|
14
|
+
return _XVG7OFIPcjs.createMenubarStore.call(void 0, props);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
|
package/cjs/menu/menu-store.cjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _34NK2NPDcjs = require('../__chunks/34NK2NPD.cjs');
|
|
4
|
+
require('../__chunks/OGYYHXPP.cjs');
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
var
|
|
7
|
-
require('../__chunks/BUEPUCQL.cjs');
|
|
7
|
+
var _7WVAUIMEcjs = require('../__chunks/7WVAUIME.cjs');
|
|
8
8
|
require('../__chunks/GDZQUFNP.cjs');
|
|
9
|
-
require('../__chunks/
|
|
10
|
-
require('../__chunks/
|
|
11
|
-
require('../__chunks/
|
|
9
|
+
require('../__chunks/VR2FVDSU.cjs');
|
|
10
|
+
require('../__chunks/L5GSFUJU.cjs');
|
|
11
|
+
require('../__chunks/E5AYFGW2.cjs');
|
|
12
|
+
require('../__chunks/VZPNI7C2.cjs');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
@@ -17,12 +18,11 @@ require('../__chunks/V4YF2QA6.cjs');
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
var
|
|
21
|
+
var _EKSEHA55cjs = require('../__chunks/EKSEHA55.cjs');
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
|
|
25
|
-
require('../__chunks/726BNPQZ.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -41,10 +41,10 @@ function createMenuStore(_a = {}) {
|
|
|
41
41
|
"menubar"
|
|
42
42
|
]);
|
|
43
43
|
const parentIsMenubar = !!menubar && !parent;
|
|
44
|
-
const store =
|
|
44
|
+
const store = _EKSEHA55cjs.mergeStore.call(void 0,
|
|
45
45
|
props.store,
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
_EKSEHA55cjs.pick.call(void 0, parent, ["values"]),
|
|
47
|
+
_EKSEHA55cjs.omit.call(void 0, combobox, [
|
|
48
48
|
"arrowElement",
|
|
49
49
|
"anchorElement",
|
|
50
50
|
"contentElement",
|
|
@@ -52,9 +52,9 @@ function createMenuStore(_a = {}) {
|
|
|
52
52
|
"disclosureElement"
|
|
53
53
|
])
|
|
54
54
|
);
|
|
55
|
-
|
|
55
|
+
_EKSEHA55cjs.throwOnConflictingProps.call(void 0, props, store);
|
|
56
56
|
const syncState = store.getState();
|
|
57
|
-
const composite =
|
|
57
|
+
const composite = _7WVAUIMEcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
58
58
|
store,
|
|
59
59
|
orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
60
60
|
props.orientation,
|
|
@@ -62,7 +62,7 @@ function createMenuStore(_a = {}) {
|
|
|
62
62
|
"vertical"
|
|
63
63
|
)
|
|
64
64
|
}));
|
|
65
|
-
const hovercard =
|
|
65
|
+
const hovercard = _34NK2NPDcjs.createHovercardStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
66
66
|
store,
|
|
67
67
|
placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
68
68
|
props.placement,
|
|
@@ -85,17 +85,17 @@ function createMenuStore(_a = {}) {
|
|
|
85
85
|
{}
|
|
86
86
|
)
|
|
87
87
|
});
|
|
88
|
-
const menu =
|
|
89
|
-
|
|
88
|
+
const menu = _EKSEHA55cjs.createStore.call(void 0, initialState, composite, hovercard, store);
|
|
89
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
90
90
|
menu,
|
|
91
|
-
() =>
|
|
91
|
+
() => _EKSEHA55cjs.sync.call(void 0, menu, ["mounted"], (state) => {
|
|
92
92
|
if (state.mounted) return;
|
|
93
93
|
menu.setState("activeId", null);
|
|
94
94
|
})
|
|
95
95
|
);
|
|
96
|
-
|
|
96
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
97
97
|
menu,
|
|
98
|
-
() =>
|
|
98
|
+
() => _EKSEHA55cjs.sync.call(void 0, parent, ["orientation"], (state) => {
|
|
99
99
|
menu.setState(
|
|
100
100
|
"placement",
|
|
101
101
|
state.orientation === "vertical" ? "right-start" : "bottom-start"
|
|
@@ -6,7 +6,7 @@ import type { BivariantCallback, PickRequired, SetState, SetStateAction } from "
|
|
|
6
6
|
import type { MenuBarStore } from "./menu-bar-store.ts";
|
|
7
7
|
export declare function createMenuStore<T extends MenuStoreValues = MenuStoreValues>(props: PickRequired<MenuStoreProps<T>, "values" | "defaultValues">): MenuStore<T>;
|
|
8
8
|
export declare function createMenuStore(props?: MenuStoreProps): MenuStore;
|
|
9
|
-
export type MenuStoreValues = Record<string, string | boolean | number |
|
|
9
|
+
export type MenuStoreValues = Record<string, string | boolean | number | ReadonlyArray<string | number>>;
|
|
10
10
|
export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreState, HovercardStoreState {
|
|
11
11
|
/** @default "vertical" */
|
|
12
12
|
orientation: CompositeStoreState["orientation"];
|
package/cjs/menu/menu-store.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { BivariantCallback, PickRequired, SetState, SetStateAction } from "
|
|
|
6
6
|
import type { MenuBarStore } from "./menu-bar-store.ts";
|
|
7
7
|
export declare function createMenuStore<T extends MenuStoreValues = MenuStoreValues>(props: PickRequired<MenuStoreProps<T>, "values" | "defaultValues">): MenuStore<T>;
|
|
8
8
|
export declare function createMenuStore(props?: MenuStoreProps): MenuStore;
|
|
9
|
-
export type MenuStoreValues = Record<string, string | boolean | number |
|
|
9
|
+
export type MenuStoreValues = Record<string, string | boolean | number | ReadonlyArray<string | number>>;
|
|
10
10
|
export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreState, HovercardStoreState {
|
|
11
11
|
/** @default "vertical" */
|
|
12
12
|
orientation: CompositeStoreState["orientation"];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/BUEPUCQL.cjs');
|
|
3
|
+
var _XVG7OFIPcjs = require('../__chunks/XVG7OFIP.cjs');
|
|
4
|
+
require('../__chunks/7WVAUIME.cjs');
|
|
6
5
|
require('../__chunks/GDZQUFNP.cjs');
|
|
7
|
-
require('../__chunks/
|
|
6
|
+
require('../__chunks/E5AYFGW2.cjs');
|
|
7
|
+
require('../__chunks/VZPNI7C2.cjs');
|
|
8
|
+
require('../__chunks/EKSEHA55.cjs');
|
|
8
9
|
require('../__chunks/MLCPLY2P.cjs');
|
|
9
|
-
require('../__chunks/726BNPQZ.cjs');
|
|
10
10
|
require('../__chunks/7EQBAZ46.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createMenubarStore =
|
|
13
|
+
exports.createMenubarStore = _XVG7OFIPcjs.createMenubarStore;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
3
|
+
var _OGYYHXPPcjs = require('../__chunks/OGYYHXPP.cjs');
|
|
4
|
+
require('../__chunks/VR2FVDSU.cjs');
|
|
5
|
+
require('../__chunks/L5GSFUJU.cjs');
|
|
6
|
+
require('../__chunks/EKSEHA55.cjs');
|
|
7
7
|
require('../__chunks/MLCPLY2P.cjs');
|
|
8
8
|
require('../__chunks/7EQBAZ46.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.createPopoverStore =
|
|
11
|
+
exports.createPopoverStore = _OGYYHXPPcjs.createPopoverStore;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/BUEPUCQL.cjs');
|
|
3
|
+
var _7WVAUIMEcjs = require('../__chunks/7WVAUIME.cjs');
|
|
5
4
|
require('../__chunks/GDZQUFNP.cjs');
|
|
5
|
+
require('../__chunks/E5AYFGW2.cjs');
|
|
6
|
+
require('../__chunks/VZPNI7C2.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
var
|
|
9
|
+
var _EKSEHA55cjs = require('../__chunks/EKSEHA55.cjs');
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
|
|
12
|
-
require('../__chunks/726BNPQZ.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -21,7 +21,7 @@ function createRadioStore(_a = {}) {
|
|
|
21
21
|
var props = _7EQBAZ46cjs.__objRest.call(void 0, _a, []);
|
|
22
22
|
var _a2;
|
|
23
23
|
const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState();
|
|
24
|
-
const composite =
|
|
24
|
+
const composite = _7WVAUIMEcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
25
25
|
focusLoop: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
26
26
|
}));
|
|
27
27
|
const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
@@ -32,7 +32,7 @@ function createRadioStore(_a = {}) {
|
|
|
32
32
|
null
|
|
33
33
|
)
|
|
34
34
|
});
|
|
35
|
-
const radio =
|
|
35
|
+
const radio = _EKSEHA55cjs.createStore.call(void 0, initialState, composite, props.store);
|
|
36
36
|
return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite), radio), {
|
|
37
37
|
setValue: (value) => radio.setState("value", value)
|
|
38
38
|
});
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/BUEPUCQL.cjs');
|
|
3
|
+
var _OGYYHXPPcjs = require('../__chunks/OGYYHXPP.cjs');
|
|
5
4
|
|
|
6
5
|
|
|
7
|
-
var
|
|
6
|
+
var _7WVAUIMEcjs = require('../__chunks/7WVAUIME.cjs');
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
var
|
|
11
|
-
require('../__chunks/
|
|
12
|
-
require('../__chunks/
|
|
9
|
+
var _GDZQUFNPcjs = require('../__chunks/GDZQUFNP.cjs');
|
|
10
|
+
require('../__chunks/VR2FVDSU.cjs');
|
|
11
|
+
require('../__chunks/L5GSFUJU.cjs');
|
|
12
|
+
require('../__chunks/E5AYFGW2.cjs');
|
|
13
|
+
require('../__chunks/VZPNI7C2.cjs');
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
|
|
@@ -18,11 +19,10 @@ require('../__chunks/V4YF2QA6.cjs');
|
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
var
|
|
22
|
+
var _EKSEHA55cjs = require('../__chunks/EKSEHA55.cjs');
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
|
|
25
|
-
require('../__chunks/726BNPQZ.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -36,9 +36,9 @@ function createSelectStore(_a = {}) {
|
|
|
36
36
|
} = _b, props = _7EQBAZ46cjs.__objRest.call(void 0, _b, [
|
|
37
37
|
"combobox"
|
|
38
38
|
]);
|
|
39
|
-
const store =
|
|
39
|
+
const store = _EKSEHA55cjs.mergeStore.call(void 0,
|
|
40
40
|
props.store,
|
|
41
|
-
|
|
41
|
+
_EKSEHA55cjs.omit.call(void 0, combobox, [
|
|
42
42
|
"value",
|
|
43
43
|
"items",
|
|
44
44
|
"renderedItems",
|
|
@@ -50,9 +50,9 @@ function createSelectStore(_a = {}) {
|
|
|
50
50
|
"disclosureElement"
|
|
51
51
|
])
|
|
52
52
|
);
|
|
53
|
-
|
|
53
|
+
_EKSEHA55cjs.throwOnConflictingProps.call(void 0, props, store);
|
|
54
54
|
const syncState = store.getState();
|
|
55
|
-
const composite =
|
|
55
|
+
const composite = _7WVAUIMEcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
56
56
|
store,
|
|
57
57
|
virtualFocus: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
58
58
|
props.virtualFocus,
|
|
@@ -76,7 +76,7 @@ function createSelectStore(_a = {}) {
|
|
|
76
76
|
"vertical"
|
|
77
77
|
)
|
|
78
78
|
}));
|
|
79
|
-
const popover =
|
|
79
|
+
const popover = _OGYYHXPPcjs.createPopoverStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
80
80
|
store,
|
|
81
81
|
placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
82
82
|
props.placement,
|
|
@@ -101,10 +101,10 @@ function createSelectStore(_a = {}) {
|
|
|
101
101
|
selectElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState.selectElement, null),
|
|
102
102
|
listElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState.listElement, null)
|
|
103
103
|
});
|
|
104
|
-
const select =
|
|
105
|
-
|
|
104
|
+
const select = _EKSEHA55cjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
105
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
106
106
|
select,
|
|
107
|
-
() =>
|
|
107
|
+
() => _EKSEHA55cjs.sync.call(void 0, select, ["value", "items"], (state) => {
|
|
108
108
|
if (state.value !== initialValue) return;
|
|
109
109
|
if (!state.items.length) return;
|
|
110
110
|
const item = state.items.find(
|
|
@@ -114,16 +114,16 @@ function createSelectStore(_a = {}) {
|
|
|
114
114
|
select.setState("value", item.value);
|
|
115
115
|
})
|
|
116
116
|
);
|
|
117
|
-
|
|
117
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
118
118
|
select,
|
|
119
|
-
() =>
|
|
119
|
+
() => _EKSEHA55cjs.sync.call(void 0, select, ["mounted"], (state) => {
|
|
120
120
|
if (state.mounted) return;
|
|
121
121
|
select.setState("activeId", initialState.activeId);
|
|
122
122
|
})
|
|
123
123
|
);
|
|
124
|
-
|
|
124
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
125
125
|
select,
|
|
126
|
-
() =>
|
|
126
|
+
() => _EKSEHA55cjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
|
|
127
127
|
if (combobox) return;
|
|
128
128
|
if (state.mounted) return;
|
|
129
129
|
const values = _GDZQUFNPcjs.toArray.call(void 0, state.value);
|
|
@@ -136,9 +136,9 @@ function createSelectStore(_a = {}) {
|
|
|
136
136
|
select.setState("activeId", item.id);
|
|
137
137
|
})
|
|
138
138
|
);
|
|
139
|
-
|
|
139
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
140
140
|
select,
|
|
141
|
-
() =>
|
|
141
|
+
() => _EKSEHA55cjs.batch.call(void 0, select, ["setValueOnMove", "moves"], (state) => {
|
|
142
142
|
const { mounted, value, activeId } = select.getState();
|
|
143
143
|
if (!state.setValueOnMove && mounted) return;
|
|
144
144
|
if (Array.isArray(value)) return;
|
|
@@ -6,7 +6,7 @@ import type { PickRequired, SetState } from "../utils/types.ts";
|
|
|
6
6
|
type MutableValue<T extends SelectStoreValue = SelectStoreValue> = T extends string ? string : T;
|
|
7
7
|
export declare function createSelectStore<T extends SelectStoreValue = SelectStoreValue>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
|
|
8
8
|
export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
|
|
9
|
-
export type SelectStoreValue = string | string[];
|
|
9
|
+
export type SelectStoreValue = string | readonly string[];
|
|
10
10
|
export interface SelectStoreItem extends CompositeStoreItem {
|
|
11
11
|
value?: string;
|
|
12
12
|
}
|
|
@@ -6,7 +6,7 @@ import type { PickRequired, SetState } from "../utils/types.ts";
|
|
|
6
6
|
type MutableValue<T extends SelectStoreValue = SelectStoreValue> = T extends string ? string : T;
|
|
7
7
|
export declare function createSelectStore<T extends SelectStoreValue = SelectStoreValue>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
|
|
8
8
|
export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
|
|
9
|
-
export type SelectStoreValue = string | string[];
|
|
9
|
+
export type SelectStoreValue = string | readonly string[];
|
|
10
10
|
export interface SelectStoreItem extends CompositeStoreItem {
|
|
11
11
|
value?: string;
|
|
12
12
|
}
|