@ariakit/core 0.4.18 → 0.4.19
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 +5 -0
- package/cjs/__chunks/{MJNGPYVQ.cjs → 2RUCRSRF.cjs} +16 -16
- package/cjs/__chunks/{6BYUUR4M.cjs → 4TRESXTO.cjs} +7 -1
- package/cjs/__chunks/{AOXAROPF.cjs → 75F3RDBE.cjs} +14 -14
- package/cjs/__chunks/{SHOLYDNP.cjs → CTEQSOKZ.cjs} +2 -2
- package/cjs/__chunks/{T247D7JS.cjs → CVLMIMPT.cjs} +2 -2
- package/cjs/__chunks/{JNPL5IHP.cjs → G2CSOTWZ.cjs} +7 -7
- package/cjs/__chunks/{4ITB54IT.cjs → I4CBIWTX.cjs} +2 -3
- package/cjs/__chunks/{JNYCP2QO.cjs → LS2SNHDM.cjs} +6 -6
- package/cjs/__chunks/{UROTDZFK.cjs → R37KOEUW.cjs} +10 -10
- package/cjs/__chunks/{OYTZFOIJ.cjs → UGAVMSQJ.cjs} +18 -18
- package/cjs/__chunks/{HGVIF2R4.cjs → VC22SYOD.cjs} +24 -21
- package/cjs/__chunks/{WPBYRKFQ.cjs → WMTGHDLE.cjs} +15 -15
- package/cjs/checkbox/checkbox-store.cjs +5 -5
- package/cjs/checkbox/checkbox-store.d.cts +5 -5
- package/cjs/checkbox/checkbox-store.d.ts +5 -5
- package/cjs/collection/collection-store.cjs +5 -5
- package/cjs/collection/collection-store.d.cts +5 -5
- package/cjs/collection/collection-store.d.ts +5 -5
- package/cjs/combobox/combobox-store.cjs +40 -40
- package/cjs/combobox/combobox-store.d.cts +26 -26
- package/cjs/combobox/combobox-store.d.ts +26 -26
- package/cjs/composite/composite-overflow-store.cjs +6 -6
- package/cjs/composite/composite-store.cjs +6 -6
- package/cjs/composite/composite-store.d.cts +62 -54
- package/cjs/composite/composite-store.d.ts +62 -54
- package/cjs/dialog/dialog-store.cjs +5 -5
- package/cjs/disclosure/disclosure-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.d.cts +22 -22
- package/cjs/disclosure/disclosure-store.d.ts +22 -22
- package/cjs/form/form-store.cjs +41 -37
- package/cjs/form/form-store.d.cts +14 -14
- package/cjs/form/form-store.d.ts +14 -14
- package/cjs/hovercard/hovercard-store.cjs +7 -7
- package/cjs/hovercard/hovercard-store.d.cts +10 -10
- package/cjs/hovercard/hovercard-store.d.ts +10 -10
- package/cjs/menu/menu-bar-store.cjs +7 -7
- package/cjs/menu/menu-store.cjs +27 -27
- package/cjs/menu/menu-store.d.cts +10 -10
- package/cjs/menu/menu-store.d.ts +10 -10
- package/cjs/menubar/menubar-store.cjs +7 -7
- package/cjs/popover/popover-store.cjs +6 -6
- package/cjs/popover/popover-store.d.cts +17 -17
- package/cjs/popover/popover-store.d.ts +17 -17
- package/cjs/radio/radio-store.cjs +9 -9
- package/cjs/radio/radio-store.d.cts +1 -1
- package/cjs/radio/radio-store.d.ts +1 -1
- package/cjs/select/select-store.cjs +32 -32
- package/cjs/select/select-store.d.cts +17 -17
- package/cjs/select/select-store.d.ts +17 -17
- package/cjs/tab/tab-store.cjs +32 -32
- package/cjs/tab/tab-store.d.cts +20 -20
- package/cjs/tab/tab-store.d.ts +20 -20
- package/cjs/tag/tag-store.cjs +16 -16
- package/cjs/tag/tag-store.d.cts +5 -5
- package/cjs/tag/tag-store.d.ts +5 -5
- package/cjs/toolbar/toolbar-store.cjs +8 -8
- package/cjs/tooltip/tooltip-store.cjs +13 -13
- package/cjs/utils/dom.cjs +2 -2
- package/cjs/utils/events.cjs +6 -6
- package/cjs/utils/focus.cjs +12 -13
- package/cjs/utils/misc.cjs +4 -2
- package/cjs/utils/misc.d.cts +4 -0
- package/cjs/utils/misc.d.ts +4 -0
- package/cjs/utils/platform.cjs +3 -3
- package/cjs/utils/store.cjs +3 -3
- package/cjs/utils/store.d.cts +1 -1
- package/cjs/utils/store.d.ts +1 -1
- package/cjs/utils/undo.cjs +2 -2
- package/esm/__chunks/{KMAUV3TY.js → 7KNZCZ55.js} +1 -1
- package/esm/__chunks/{3DNM6L6E.js → G7XPWBXK.js} +1 -2
- package/esm/__chunks/{SNHYQNEZ.js → GMGLSF2B.js} +1 -1
- package/esm/__chunks/{WSDJ6ZRB.js → H7R2CY4Q.js} +3 -3
- package/esm/__chunks/{75BJEVSH.js → IHNLLH3I.js} +2 -2
- package/esm/__chunks/{N5XGANPW.js → KZX46JDB.js} +11 -8
- package/esm/__chunks/{BFGNM53A.js → MJ4ZJEIM.js} +5 -5
- package/esm/__chunks/{TIQDSBWP.js → TEVO2DMI.js} +3 -3
- package/esm/__chunks/{7LM4Q2XB.js → U4NM2NCP.js} +1 -1
- package/esm/__chunks/{RVTIKFRL.js → UNDE2QJS.js} +3 -3
- package/esm/__chunks/{XMCVU3LR.js → UWJK2WK2.js} +6 -0
- package/esm/__chunks/{SXKM4CGU.js → XTZ53NXG.js} +4 -4
- package/esm/checkbox/checkbox-store.d.ts +5 -5
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/collection/collection-store.d.ts +5 -5
- package/esm/collection/collection-store.js +4 -4
- package/esm/combobox/combobox-store.d.ts +26 -26
- package/esm/combobox/combobox-store.js +9 -9
- package/esm/composite/composite-overflow-store.js +5 -5
- package/esm/composite/composite-store.d.ts +62 -54
- package/esm/composite/composite-store.js +5 -5
- package/esm/dialog/dialog-store.js +4 -4
- package/esm/disclosure/disclosure-store.d.ts +22 -22
- package/esm/disclosure/disclosure-store.js +3 -3
- package/esm/form/form-store.d.ts +14 -14
- package/esm/form/form-store.js +19 -15
- package/esm/hovercard/hovercard-store.d.ts +10 -10
- package/esm/hovercard/hovercard-store.js +6 -6
- package/esm/menu/menu-bar-store.js +6 -6
- package/esm/menu/menu-store.d.ts +10 -10
- package/esm/menu/menu-store.js +9 -9
- package/esm/menubar/menubar-store.js +6 -6
- package/esm/popover/popover-store.d.ts +17 -17
- package/esm/popover/popover-store.js +5 -5
- package/esm/radio/radio-store.d.ts +1 -1
- package/esm/radio/radio-store.js +5 -5
- package/esm/select/select-store.d.ts +17 -17
- package/esm/select/select-store.js +8 -8
- package/esm/tab/tab-store.d.ts +20 -20
- package/esm/tab/tab-store.js +5 -5
- package/esm/tag/tag-store.d.ts +5 -5
- package/esm/tag/tag-store.js +7 -7
- package/esm/toolbar/toolbar-store.js +5 -5
- package/esm/tooltip/tooltip-store.js +7 -7
- package/esm/utils/dom.js +1 -1
- package/esm/utils/events.js +4 -4
- package/esm/utils/focus.js +2 -3
- package/esm/utils/misc.d.ts +4 -0
- package/esm/utils/misc.js +3 -1
- package/esm/utils/platform.js +2 -2
- package/esm/utils/store.d.ts +1 -1
- package/esm/utils/store.js +2 -2
- package/esm/utils/undo.js +1 -1
- package/package.json +20 -21
- package/tsconfig.build.json +7 -2
- package/tsconfig.node.json +5 -0
- package/tsconfig.test.json +5 -0
|
@@ -11,13 +11,13 @@ export interface CheckboxStoreState<T extends CheckboxStoreValue = CheckboxStore
|
|
|
11
11
|
* The checked state of the checkbox.
|
|
12
12
|
*
|
|
13
13
|
* Live examples:
|
|
14
|
-
* - [Custom Checkbox](https://ariakit.
|
|
14
|
+
* - [Custom Checkbox](https://ariakit.com/examples/checkbox-custom)
|
|
15
15
|
*/
|
|
16
16
|
value: ToPrimitive<T>;
|
|
17
17
|
}
|
|
18
18
|
export interface CheckboxStoreFunctions<T extends CheckboxStoreValue = CheckboxStoreValue> {
|
|
19
19
|
/**
|
|
20
|
-
* Sets the [`value`](https://ariakit.
|
|
20
|
+
* Sets the [`value`](https://ariakit.com/reference/checkbox-provider#value)
|
|
21
21
|
* state.
|
|
22
22
|
* @example
|
|
23
23
|
* store.setValue(true);
|
|
@@ -28,12 +28,12 @@ export interface CheckboxStoreFunctions<T extends CheckboxStoreValue = CheckboxS
|
|
|
28
28
|
export interface CheckboxStoreOptions<T extends CheckboxStoreValue = CheckboxStoreValue> extends StoreOptions<CheckboxStoreState<T>, "value"> {
|
|
29
29
|
/**
|
|
30
30
|
* The default
|
|
31
|
-
* [`value`](https://ariakit.
|
|
31
|
+
* [`value`](https://ariakit.com/reference/checkbox-provider#value) state of
|
|
32
32
|
* the checkbox.
|
|
33
33
|
*
|
|
34
34
|
* Live examples:
|
|
35
|
-
* - [Custom Checkbox](https://ariakit.
|
|
36
|
-
* - [Checkbox group](https://ariakit.
|
|
35
|
+
* - [Custom Checkbox](https://ariakit.com/examples/checkbox-custom)
|
|
36
|
+
* - [Checkbox group](https://ariakit.com/examples/checkbox-group)
|
|
37
37
|
* @default false
|
|
38
38
|
*/
|
|
39
39
|
defaultValue?: CheckboxStoreState<T>["value"];
|
|
@@ -11,13 +11,13 @@ export interface CheckboxStoreState<T extends CheckboxStoreValue = CheckboxStore
|
|
|
11
11
|
* The checked state of the checkbox.
|
|
12
12
|
*
|
|
13
13
|
* Live examples:
|
|
14
|
-
* - [Custom Checkbox](https://ariakit.
|
|
14
|
+
* - [Custom Checkbox](https://ariakit.com/examples/checkbox-custom)
|
|
15
15
|
*/
|
|
16
16
|
value: ToPrimitive<T>;
|
|
17
17
|
}
|
|
18
18
|
export interface CheckboxStoreFunctions<T extends CheckboxStoreValue = CheckboxStoreValue> {
|
|
19
19
|
/**
|
|
20
|
-
* Sets the [`value`](https://ariakit.
|
|
20
|
+
* Sets the [`value`](https://ariakit.com/reference/checkbox-provider#value)
|
|
21
21
|
* state.
|
|
22
22
|
* @example
|
|
23
23
|
* store.setValue(true);
|
|
@@ -28,12 +28,12 @@ export interface CheckboxStoreFunctions<T extends CheckboxStoreValue = CheckboxS
|
|
|
28
28
|
export interface CheckboxStoreOptions<T extends CheckboxStoreValue = CheckboxStoreValue> extends StoreOptions<CheckboxStoreState<T>, "value"> {
|
|
29
29
|
/**
|
|
30
30
|
* The default
|
|
31
|
-
* [`value`](https://ariakit.
|
|
31
|
+
* [`value`](https://ariakit.com/reference/checkbox-provider#value) state of
|
|
32
32
|
* the checkbox.
|
|
33
33
|
*
|
|
34
34
|
* Live examples:
|
|
35
|
-
* - [Custom Checkbox](https://ariakit.
|
|
36
|
-
* - [Checkbox group](https://ariakit.
|
|
35
|
+
* - [Custom Checkbox](https://ariakit.com/examples/checkbox-custom)
|
|
36
|
+
* - [Checkbox group](https://ariakit.com/examples/checkbox-group)
|
|
37
37
|
* @default false
|
|
38
38
|
*/
|
|
39
39
|
defaultValue?: CheckboxStoreState<T>["value"];
|
|
@@ -1,9 +1,9 @@
|
|
|
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 _VC22SYODcjs = require('../__chunks/VC22SYOD.cjs');
|
|
4
|
+
require('../__chunks/I4CBIWTX.cjs');
|
|
5
|
+
require('../__chunks/WMTGHDLE.cjs');
|
|
6
|
+
require('../__chunks/4TRESXTO.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.createCollectionStore =
|
|
9
|
+
exports.createCollectionStore = _VC22SYODcjs.createCollectionStore;
|
|
@@ -18,19 +18,19 @@ export interface CollectionStoreState<T extends CollectionStoreItem = Collection
|
|
|
18
18
|
/**
|
|
19
19
|
* Lists all items along with their metadata. This state is automatically
|
|
20
20
|
* updated when an item is registered or unregistered using the
|
|
21
|
-
* [`registerItem`](https://ariakit.
|
|
21
|
+
* [`registerItem`](https://ariakit.com/reference/use-collection-store#registeritem)
|
|
22
22
|
* function.
|
|
23
23
|
*
|
|
24
24
|
* Live examples:
|
|
25
25
|
* - [Command Menu with
|
|
26
|
-
* Tabs](https://ariakit.
|
|
26
|
+
* Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
|
|
27
27
|
*/
|
|
28
28
|
items: T[];
|
|
29
29
|
/**
|
|
30
30
|
* Lists all items, along with their metadata, in the exact order they appear in
|
|
31
31
|
* the DOM. This state is automatically updated when an item is rendered or
|
|
32
32
|
* unmounted using the
|
|
33
|
-
* [`renderItem`](https://ariakit.
|
|
33
|
+
* [`renderItem`](https://ariakit.com/reference/use-collection-store#renderitem)
|
|
34
34
|
* function.
|
|
35
35
|
*/
|
|
36
36
|
renderedItems: T[];
|
|
@@ -58,7 +58,7 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
|
|
|
58
58
|
* Gets an item by its id.
|
|
59
59
|
*
|
|
60
60
|
* Live examples:
|
|
61
|
-
* - [Animated TabPanel](https://ariakit.
|
|
61
|
+
* - [Animated TabPanel](https://ariakit.com/examples/tab-panel-animated)
|
|
62
62
|
* @example
|
|
63
63
|
* const item = store.item("item-1");
|
|
64
64
|
*/
|
|
@@ -67,7 +67,7 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
|
|
|
67
67
|
export interface CollectionStoreOptions<T extends CollectionStoreItem = CollectionStoreItem> extends StoreOptions<CollectionStoreState<T>, "items"> {
|
|
68
68
|
/**
|
|
69
69
|
* The defaut value for the
|
|
70
|
-
* [`items`](https://ariakit.
|
|
70
|
+
* [`items`](https://ariakit.com/reference/collection-provider#items) state.
|
|
71
71
|
* @default []
|
|
72
72
|
*/
|
|
73
73
|
defaultItems?: CollectionStoreState<T>["items"];
|
|
@@ -18,19 +18,19 @@ export interface CollectionStoreState<T extends CollectionStoreItem = Collection
|
|
|
18
18
|
/**
|
|
19
19
|
* Lists all items along with their metadata. This state is automatically
|
|
20
20
|
* updated when an item is registered or unregistered using the
|
|
21
|
-
* [`registerItem`](https://ariakit.
|
|
21
|
+
* [`registerItem`](https://ariakit.com/reference/use-collection-store#registeritem)
|
|
22
22
|
* function.
|
|
23
23
|
*
|
|
24
24
|
* Live examples:
|
|
25
25
|
* - [Command Menu with
|
|
26
|
-
* Tabs](https://ariakit.
|
|
26
|
+
* Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
|
|
27
27
|
*/
|
|
28
28
|
items: T[];
|
|
29
29
|
/**
|
|
30
30
|
* Lists all items, along with their metadata, in the exact order they appear in
|
|
31
31
|
* the DOM. This state is automatically updated when an item is rendered or
|
|
32
32
|
* unmounted using the
|
|
33
|
-
* [`renderItem`](https://ariakit.
|
|
33
|
+
* [`renderItem`](https://ariakit.com/reference/use-collection-store#renderitem)
|
|
34
34
|
* function.
|
|
35
35
|
*/
|
|
36
36
|
renderedItems: T[];
|
|
@@ -58,7 +58,7 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
|
|
|
58
58
|
* Gets an item by its id.
|
|
59
59
|
*
|
|
60
60
|
* Live examples:
|
|
61
|
-
* - [Animated TabPanel](https://ariakit.
|
|
61
|
+
* - [Animated TabPanel](https://ariakit.com/examples/tab-panel-animated)
|
|
62
62
|
* @example
|
|
63
63
|
* const item = store.item("item-1");
|
|
64
64
|
*/
|
|
@@ -67,7 +67,7 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
|
|
|
67
67
|
export interface CollectionStoreOptions<T extends CollectionStoreItem = CollectionStoreItem> extends StoreOptions<CollectionStoreState<T>, "items"> {
|
|
68
68
|
/**
|
|
69
69
|
* The defaut value for the
|
|
70
|
-
* [`items`](https://ariakit.
|
|
70
|
+
* [`items`](https://ariakit.com/reference/collection-provider#items) state.
|
|
71
71
|
* @default []
|
|
72
72
|
*/
|
|
73
73
|
defaultItems?: CollectionStoreState<T>["items"];
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _LS2SNHDMcjs = require('../__chunks/LS2SNHDM.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _75F3RDBEcjs = require('../__chunks/75F3RDBE.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _UGAVMSQJcjs = require('../__chunks/UGAVMSQJ.cjs');
|
|
11
11
|
require('../__chunks/GDZQUFNP.cjs');
|
|
12
|
-
require('../__chunks/
|
|
13
|
-
require('../__chunks/
|
|
14
|
-
require('../__chunks/
|
|
15
|
-
require('../__chunks/
|
|
12
|
+
require('../__chunks/CVLMIMPT.cjs');
|
|
13
|
+
require('../__chunks/2RUCRSRF.cjs');
|
|
14
|
+
require('../__chunks/VC22SYOD.cjs');
|
|
15
|
+
require('../__chunks/I4CBIWTX.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -21,64 +21,64 @@ require('../__chunks/4ITB54IT.cjs');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _WMTGHDLEcjs = require('../__chunks/WMTGHDLE.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _4TRESXTOcjs = require('../__chunks/4TRESXTO.cjs');
|
|
29
29
|
|
|
30
30
|
// src/combobox/combobox-store.ts
|
|
31
|
-
var isTouchSafari =
|
|
31
|
+
var isTouchSafari = _LS2SNHDMcjs.isSafari.call(void 0, ) && _LS2SNHDMcjs.isTouchDevice.call(void 0, );
|
|
32
32
|
function createComboboxStore({
|
|
33
33
|
tag,
|
|
34
34
|
...props
|
|
35
35
|
} = {}) {
|
|
36
|
-
const store =
|
|
37
|
-
|
|
36
|
+
const store = _WMTGHDLEcjs.mergeStore.call(void 0, props.store, _WMTGHDLEcjs.pick.call(void 0, tag, ["value", "rtl"]));
|
|
37
|
+
_WMTGHDLEcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
38
38
|
const tagState = tag == null ? void 0 : tag.getState();
|
|
39
39
|
const syncState = store == null ? void 0 : store.getState();
|
|
40
|
-
const activeId =
|
|
40
|
+
const activeId = _4TRESXTOcjs.defaultValue.call(void 0,
|
|
41
41
|
props.activeId,
|
|
42
42
|
syncState == null ? void 0 : syncState.activeId,
|
|
43
43
|
props.defaultActiveId,
|
|
44
44
|
null
|
|
45
45
|
);
|
|
46
|
-
const composite =
|
|
46
|
+
const composite = _UGAVMSQJcjs.createCompositeStore.call(void 0, {
|
|
47
47
|
...props,
|
|
48
48
|
activeId,
|
|
49
|
-
includesBaseElement:
|
|
49
|
+
includesBaseElement: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
50
50
|
props.includesBaseElement,
|
|
51
51
|
syncState == null ? void 0 : syncState.includesBaseElement,
|
|
52
52
|
true
|
|
53
53
|
),
|
|
54
|
-
orientation:
|
|
54
|
+
orientation: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
55
55
|
props.orientation,
|
|
56
56
|
syncState == null ? void 0 : syncState.orientation,
|
|
57
57
|
"vertical"
|
|
58
58
|
),
|
|
59
|
-
focusLoop:
|
|
60
|
-
focusWrap:
|
|
61
|
-
virtualFocus:
|
|
59
|
+
focusLoop: _4TRESXTOcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
|
|
60
|
+
focusWrap: _4TRESXTOcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
|
|
61
|
+
virtualFocus: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
62
62
|
props.virtualFocus,
|
|
63
63
|
syncState == null ? void 0 : syncState.virtualFocus,
|
|
64
64
|
true
|
|
65
65
|
)
|
|
66
66
|
});
|
|
67
|
-
const popover =
|
|
67
|
+
const popover = _75F3RDBEcjs.createPopoverStore.call(void 0, {
|
|
68
68
|
...props,
|
|
69
|
-
placement:
|
|
69
|
+
placement: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
70
70
|
props.placement,
|
|
71
71
|
syncState == null ? void 0 : syncState.placement,
|
|
72
72
|
"bottom-start"
|
|
73
73
|
)
|
|
74
74
|
});
|
|
75
|
-
const value =
|
|
75
|
+
const value = _4TRESXTOcjs.defaultValue.call(void 0,
|
|
76
76
|
props.value,
|
|
77
77
|
syncState == null ? void 0 : syncState.value,
|
|
78
78
|
props.defaultValue,
|
|
79
79
|
""
|
|
80
80
|
);
|
|
81
|
-
const selectedValue =
|
|
81
|
+
const selectedValue = _4TRESXTOcjs.defaultValue.call(void 0,
|
|
82
82
|
props.selectedValue,
|
|
83
83
|
syncState == null ? void 0 : syncState.selectedValue,
|
|
84
84
|
tagState == null ? void 0 : tagState.values,
|
|
@@ -91,66 +91,66 @@ function createComboboxStore({
|
|
|
91
91
|
...popover.getState(),
|
|
92
92
|
value,
|
|
93
93
|
selectedValue,
|
|
94
|
-
resetValueOnSelect:
|
|
94
|
+
resetValueOnSelect: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
95
95
|
props.resetValueOnSelect,
|
|
96
96
|
syncState == null ? void 0 : syncState.resetValueOnSelect,
|
|
97
97
|
multiSelectable
|
|
98
98
|
),
|
|
99
|
-
resetValueOnHide:
|
|
99
|
+
resetValueOnHide: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
100
100
|
props.resetValueOnHide,
|
|
101
101
|
syncState == null ? void 0 : syncState.resetValueOnHide,
|
|
102
102
|
multiSelectable && !tag
|
|
103
103
|
),
|
|
104
104
|
activeValue: syncState == null ? void 0 : syncState.activeValue
|
|
105
105
|
};
|
|
106
|
-
const combobox =
|
|
106
|
+
const combobox = _WMTGHDLEcjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
107
107
|
if (isTouchSafari) {
|
|
108
|
-
|
|
108
|
+
_WMTGHDLEcjs.setup.call(void 0,
|
|
109
109
|
combobox,
|
|
110
|
-
() =>
|
|
110
|
+
() => _WMTGHDLEcjs.sync.call(void 0, combobox, ["virtualFocus"], () => {
|
|
111
111
|
combobox.setState("virtualFocus", false);
|
|
112
112
|
})
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
|
|
115
|
+
_WMTGHDLEcjs.setup.call(void 0, combobox, () => {
|
|
116
116
|
if (!tag) return;
|
|
117
|
-
return
|
|
118
|
-
|
|
117
|
+
return _4TRESXTOcjs.chain.call(void 0,
|
|
118
|
+
_WMTGHDLEcjs.sync.call(void 0, combobox, ["selectedValue"], (state) => {
|
|
119
119
|
if (!Array.isArray(state.selectedValue)) return;
|
|
120
120
|
tag.setValues(state.selectedValue);
|
|
121
121
|
}),
|
|
122
|
-
|
|
122
|
+
_WMTGHDLEcjs.sync.call(void 0, tag, ["values"], (state) => {
|
|
123
123
|
combobox.setState("selectedValue", state.values);
|
|
124
124
|
})
|
|
125
125
|
);
|
|
126
126
|
});
|
|
127
|
-
|
|
127
|
+
_WMTGHDLEcjs.setup.call(void 0,
|
|
128
128
|
combobox,
|
|
129
|
-
() =>
|
|
129
|
+
() => _WMTGHDLEcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
|
|
130
130
|
if (!state.resetValueOnHide) return;
|
|
131
131
|
if (state.mounted) return;
|
|
132
132
|
combobox.setState("value", value);
|
|
133
133
|
})
|
|
134
134
|
);
|
|
135
|
-
|
|
135
|
+
_WMTGHDLEcjs.setup.call(void 0,
|
|
136
136
|
combobox,
|
|
137
|
-
() =>
|
|
137
|
+
() => _WMTGHDLEcjs.sync.call(void 0, combobox, ["open"], (state) => {
|
|
138
138
|
if (state.open) return;
|
|
139
139
|
combobox.setState("activeId", activeId);
|
|
140
140
|
combobox.setState("moves", 0);
|
|
141
141
|
})
|
|
142
142
|
);
|
|
143
|
-
|
|
143
|
+
_WMTGHDLEcjs.setup.call(void 0,
|
|
144
144
|
combobox,
|
|
145
|
-
() =>
|
|
145
|
+
() => _WMTGHDLEcjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
|
|
146
146
|
if (state.moves === prevState.moves) {
|
|
147
147
|
combobox.setState("activeValue", void 0);
|
|
148
148
|
}
|
|
149
149
|
})
|
|
150
150
|
);
|
|
151
|
-
|
|
151
|
+
_WMTGHDLEcjs.setup.call(void 0,
|
|
152
152
|
combobox,
|
|
153
|
-
() =>
|
|
153
|
+
() => _WMTGHDLEcjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
|
|
154
154
|
if (state.moves === prev.moves) return;
|
|
155
155
|
const { activeId: activeId2 } = combobox.getState();
|
|
156
156
|
const activeItem = composite.item(activeId2);
|
|
@@ -29,15 +29,15 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
|
|
|
29
29
|
*
|
|
30
30
|
* Live examples:
|
|
31
31
|
* - [Combobox with integrated
|
|
32
|
-
* filter](https://ariakit.
|
|
33
|
-
* - [Combobox with links](https://ariakit.
|
|
34
|
-
* - [Combobox filtering](https://ariakit.
|
|
32
|
+
* filter](https://ariakit.com/examples/combobox-filtering-integrated)
|
|
33
|
+
* - [Combobox with links](https://ariakit.com/examples/combobox-links)
|
|
34
|
+
* - [Combobox filtering](https://ariakit.com/examples/combobox-filtering)
|
|
35
35
|
* - [Multi-selectable
|
|
36
|
-
* Combobox](https://ariakit.
|
|
36
|
+
* Combobox](https://ariakit.com/examples/combobox-multiple)
|
|
37
37
|
* - [Textarea with inline
|
|
38
|
-
* Combobox](https://ariakit.
|
|
38
|
+
* Combobox](https://ariakit.com/examples/combobox-textarea)
|
|
39
39
|
* - [Command Menu with
|
|
40
|
-
* Tabs](https://ariakit.
|
|
40
|
+
* Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
|
|
41
41
|
*/
|
|
42
42
|
value: string;
|
|
43
43
|
/**
|
|
@@ -49,71 +49,71 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
|
|
|
49
49
|
/**
|
|
50
50
|
* The value(s) of the currently selected item(s). This can be a string or an
|
|
51
51
|
* array of strings. If it's an array, the combobox is considered
|
|
52
|
-
* [multi-selectable](https://ariakit.
|
|
52
|
+
* [multi-selectable](https://ariakit.com/examples/combobox-multiple).
|
|
53
53
|
*
|
|
54
54
|
* Live examples:
|
|
55
55
|
* - [Multi-selectable
|
|
56
|
-
* Combobox](https://ariakit.
|
|
56
|
+
* Combobox](https://ariakit.com/examples/combobox-multiple)
|
|
57
57
|
*/
|
|
58
58
|
selectedValue: MutableValue<T>;
|
|
59
59
|
/**
|
|
60
60
|
* Whether to reset the value when the combobox popover closes. This prop is
|
|
61
61
|
* automatically set to `true` by default if the combobox supports multiple
|
|
62
62
|
* selections. In other words, if the
|
|
63
|
-
* [`selectedValue`](https://ariakit.
|
|
63
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
64
64
|
* or
|
|
65
|
-
* [`defaultSelectedValue`](https://ariakit.
|
|
65
|
+
* [`defaultSelectedValue`](https://ariakit.com/reference/combobox-provider#defaultselectedvalue)
|
|
66
66
|
* props are arrays.
|
|
67
67
|
*
|
|
68
68
|
* Live examples:
|
|
69
69
|
* - [Multi-selectable
|
|
70
|
-
* Combobox](https://ariakit.
|
|
71
|
-
* - [Menu with Combobox](https://ariakit.
|
|
72
|
-
* - [Select with Combobox](https://ariakit.
|
|
70
|
+
* Combobox](https://ariakit.com/examples/combobox-multiple)
|
|
71
|
+
* - [Menu with Combobox](https://ariakit.com/examples/menu-combobox)
|
|
72
|
+
* - [Select with Combobox](https://ariakit.com/examples/select-combobox)
|
|
73
73
|
* - [Submenu with
|
|
74
|
-
* Combobox](https://ariakit.
|
|
74
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
75
75
|
* - [Command Menu with
|
|
76
|
-
* Tabs](https://ariakit.
|
|
76
|
+
* Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
|
|
77
77
|
* - [Select with Combobox and
|
|
78
|
-
* Tabs](https://ariakit.
|
|
78
|
+
* Tabs](https://ariakit.com/examples/select-combobox-tab)
|
|
79
79
|
*/
|
|
80
80
|
resetValueOnHide: boolean;
|
|
81
81
|
/**
|
|
82
82
|
* Whether to reset the value when an item is selected. This prop is
|
|
83
83
|
* automatically set to `true` by default if the combobox supports multiple
|
|
84
84
|
* selections. In other words, if the
|
|
85
|
-
* [`selectedValue`](https://ariakit.
|
|
85
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
86
86
|
* or
|
|
87
|
-
* [`defaultSelectedValue`](https://ariakit.
|
|
87
|
+
* [`defaultSelectedValue`](https://ariakit.com/reference/combobox-provider#defaultselectedvalue)
|
|
88
88
|
* props are arrays.
|
|
89
89
|
* @deprecated Use the
|
|
90
|
-
* [`resetValueOnSelect`](https://ariakit.
|
|
91
|
-
* prop on [`ComboboxItem`](https://ariakit.
|
|
90
|
+
* [`resetValueOnSelect`](https://ariakit.com/reference/combobox-item#resetvalueonselect)
|
|
91
|
+
* prop on [`ComboboxItem`](https://ariakit.com/reference/combobox-item)
|
|
92
92
|
* instead.
|
|
93
93
|
*/
|
|
94
94
|
resetValueOnSelect: boolean;
|
|
95
95
|
}
|
|
96
96
|
export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends Pick<ComboboxStoreOptions<T>, "tag">, CompositeStoreFunctions<ComboboxStoreItem>, PopoverStoreFunctions {
|
|
97
97
|
/**
|
|
98
|
-
* Sets the [`value`](https://ariakit.
|
|
98
|
+
* Sets the [`value`](https://ariakit.com/reference/combobox-provider#value)
|
|
99
99
|
* state.
|
|
100
100
|
*
|
|
101
101
|
* Live examples:
|
|
102
102
|
* - [Textarea with inline
|
|
103
|
-
* Combobox](https://ariakit.
|
|
103
|
+
* Combobox](https://ariakit.com/examples/combobox-textarea)
|
|
104
104
|
* @example
|
|
105
105
|
* store.setValue("Hello world");
|
|
106
106
|
* store.setValue((value) => value + "!");
|
|
107
107
|
*/
|
|
108
108
|
setValue: SetState<ComboboxStoreState<T>["value"]>;
|
|
109
109
|
/**
|
|
110
|
-
* Resets the [`value`](https://ariakit.
|
|
110
|
+
* Resets the [`value`](https://ariakit.com/reference/combobox-provider#value)
|
|
111
111
|
* state to its initial value.
|
|
112
112
|
*/
|
|
113
113
|
resetValue: () => void;
|
|
114
114
|
/**
|
|
115
115
|
* Sets the
|
|
116
|
-
* [`selectedValue`](https://ariakit.
|
|
116
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
117
117
|
* state.
|
|
118
118
|
*/
|
|
119
119
|
setSelectedValue: SetState<ComboboxStoreState<T>["selectedValue"]>;
|
|
@@ -128,10 +128,10 @@ export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = Com
|
|
|
128
128
|
defaultValue?: ComboboxStoreState<T>["value"];
|
|
129
129
|
/**
|
|
130
130
|
* The initial value of the
|
|
131
|
-
* [`selectedValue`](https://ariakit.
|
|
131
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
132
132
|
* state. This can be a string or an array of strings. If it's an array, the
|
|
133
133
|
* combobox is considered
|
|
134
|
-
* [multi-selectable](https://ariakit.
|
|
134
|
+
* [multi-selectable](https://ariakit.com/examples/combobox-multiple).
|
|
135
135
|
* @default ""
|
|
136
136
|
*/
|
|
137
137
|
defaultSelectedValue?: ComboboxStoreState<T>["selectedValue"];
|
|
@@ -29,15 +29,15 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
|
|
|
29
29
|
*
|
|
30
30
|
* Live examples:
|
|
31
31
|
* - [Combobox with integrated
|
|
32
|
-
* filter](https://ariakit.
|
|
33
|
-
* - [Combobox with links](https://ariakit.
|
|
34
|
-
* - [Combobox filtering](https://ariakit.
|
|
32
|
+
* filter](https://ariakit.com/examples/combobox-filtering-integrated)
|
|
33
|
+
* - [Combobox with links](https://ariakit.com/examples/combobox-links)
|
|
34
|
+
* - [Combobox filtering](https://ariakit.com/examples/combobox-filtering)
|
|
35
35
|
* - [Multi-selectable
|
|
36
|
-
* Combobox](https://ariakit.
|
|
36
|
+
* Combobox](https://ariakit.com/examples/combobox-multiple)
|
|
37
37
|
* - [Textarea with inline
|
|
38
|
-
* Combobox](https://ariakit.
|
|
38
|
+
* Combobox](https://ariakit.com/examples/combobox-textarea)
|
|
39
39
|
* - [Command Menu with
|
|
40
|
-
* Tabs](https://ariakit.
|
|
40
|
+
* Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
|
|
41
41
|
*/
|
|
42
42
|
value: string;
|
|
43
43
|
/**
|
|
@@ -49,71 +49,71 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
|
|
|
49
49
|
/**
|
|
50
50
|
* The value(s) of the currently selected item(s). This can be a string or an
|
|
51
51
|
* array of strings. If it's an array, the combobox is considered
|
|
52
|
-
* [multi-selectable](https://ariakit.
|
|
52
|
+
* [multi-selectable](https://ariakit.com/examples/combobox-multiple).
|
|
53
53
|
*
|
|
54
54
|
* Live examples:
|
|
55
55
|
* - [Multi-selectable
|
|
56
|
-
* Combobox](https://ariakit.
|
|
56
|
+
* Combobox](https://ariakit.com/examples/combobox-multiple)
|
|
57
57
|
*/
|
|
58
58
|
selectedValue: MutableValue<T>;
|
|
59
59
|
/**
|
|
60
60
|
* Whether to reset the value when the combobox popover closes. This prop is
|
|
61
61
|
* automatically set to `true` by default if the combobox supports multiple
|
|
62
62
|
* selections. In other words, if the
|
|
63
|
-
* [`selectedValue`](https://ariakit.
|
|
63
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
64
64
|
* or
|
|
65
|
-
* [`defaultSelectedValue`](https://ariakit.
|
|
65
|
+
* [`defaultSelectedValue`](https://ariakit.com/reference/combobox-provider#defaultselectedvalue)
|
|
66
66
|
* props are arrays.
|
|
67
67
|
*
|
|
68
68
|
* Live examples:
|
|
69
69
|
* - [Multi-selectable
|
|
70
|
-
* Combobox](https://ariakit.
|
|
71
|
-
* - [Menu with Combobox](https://ariakit.
|
|
72
|
-
* - [Select with Combobox](https://ariakit.
|
|
70
|
+
* Combobox](https://ariakit.com/examples/combobox-multiple)
|
|
71
|
+
* - [Menu with Combobox](https://ariakit.com/examples/menu-combobox)
|
|
72
|
+
* - [Select with Combobox](https://ariakit.com/examples/select-combobox)
|
|
73
73
|
* - [Submenu with
|
|
74
|
-
* Combobox](https://ariakit.
|
|
74
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
75
75
|
* - [Command Menu with
|
|
76
|
-
* Tabs](https://ariakit.
|
|
76
|
+
* Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
|
|
77
77
|
* - [Select with Combobox and
|
|
78
|
-
* Tabs](https://ariakit.
|
|
78
|
+
* Tabs](https://ariakit.com/examples/select-combobox-tab)
|
|
79
79
|
*/
|
|
80
80
|
resetValueOnHide: boolean;
|
|
81
81
|
/**
|
|
82
82
|
* Whether to reset the value when an item is selected. This prop is
|
|
83
83
|
* automatically set to `true` by default if the combobox supports multiple
|
|
84
84
|
* selections. In other words, if the
|
|
85
|
-
* [`selectedValue`](https://ariakit.
|
|
85
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
86
86
|
* or
|
|
87
|
-
* [`defaultSelectedValue`](https://ariakit.
|
|
87
|
+
* [`defaultSelectedValue`](https://ariakit.com/reference/combobox-provider#defaultselectedvalue)
|
|
88
88
|
* props are arrays.
|
|
89
89
|
* @deprecated Use the
|
|
90
|
-
* [`resetValueOnSelect`](https://ariakit.
|
|
91
|
-
* prop on [`ComboboxItem`](https://ariakit.
|
|
90
|
+
* [`resetValueOnSelect`](https://ariakit.com/reference/combobox-item#resetvalueonselect)
|
|
91
|
+
* prop on [`ComboboxItem`](https://ariakit.com/reference/combobox-item)
|
|
92
92
|
* instead.
|
|
93
93
|
*/
|
|
94
94
|
resetValueOnSelect: boolean;
|
|
95
95
|
}
|
|
96
96
|
export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends Pick<ComboboxStoreOptions<T>, "tag">, CompositeStoreFunctions<ComboboxStoreItem>, PopoverStoreFunctions {
|
|
97
97
|
/**
|
|
98
|
-
* Sets the [`value`](https://ariakit.
|
|
98
|
+
* Sets the [`value`](https://ariakit.com/reference/combobox-provider#value)
|
|
99
99
|
* state.
|
|
100
100
|
*
|
|
101
101
|
* Live examples:
|
|
102
102
|
* - [Textarea with inline
|
|
103
|
-
* Combobox](https://ariakit.
|
|
103
|
+
* Combobox](https://ariakit.com/examples/combobox-textarea)
|
|
104
104
|
* @example
|
|
105
105
|
* store.setValue("Hello world");
|
|
106
106
|
* store.setValue((value) => value + "!");
|
|
107
107
|
*/
|
|
108
108
|
setValue: SetState<ComboboxStoreState<T>["value"]>;
|
|
109
109
|
/**
|
|
110
|
-
* Resets the [`value`](https://ariakit.
|
|
110
|
+
* Resets the [`value`](https://ariakit.com/reference/combobox-provider#value)
|
|
111
111
|
* state to its initial value.
|
|
112
112
|
*/
|
|
113
113
|
resetValue: () => void;
|
|
114
114
|
/**
|
|
115
115
|
* Sets the
|
|
116
|
-
* [`selectedValue`](https://ariakit.
|
|
116
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
117
117
|
* state.
|
|
118
118
|
*/
|
|
119
119
|
setSelectedValue: SetState<ComboboxStoreState<T>["selectedValue"]>;
|
|
@@ -128,10 +128,10 @@ export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = Com
|
|
|
128
128
|
defaultValue?: ComboboxStoreState<T>["value"];
|
|
129
129
|
/**
|
|
130
130
|
* The initial value of the
|
|
131
|
-
* [`selectedValue`](https://ariakit.
|
|
131
|
+
* [`selectedValue`](https://ariakit.com/reference/combobox-provider#selectedvalue)
|
|
132
132
|
* state. This can be a string or an array of strings. If it's an array, the
|
|
133
133
|
* combobox is considered
|
|
134
|
-
* [multi-selectable](https://ariakit.
|
|
134
|
+
* [multi-selectable](https://ariakit.com/examples/combobox-multiple).
|
|
135
135
|
* @default ""
|
|
136
136
|
*/
|
|
137
137
|
defaultSelectedValue?: ComboboxStoreState<T>["selectedValue"];
|
|
@@ -1,14 +1,14 @@
|
|
|
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 _75F3RDBEcjs = require('../__chunks/75F3RDBE.cjs');
|
|
4
|
+
require('../__chunks/CVLMIMPT.cjs');
|
|
5
|
+
require('../__chunks/2RUCRSRF.cjs');
|
|
6
|
+
require('../__chunks/WMTGHDLE.cjs');
|
|
7
|
+
require('../__chunks/4TRESXTO.cjs');
|
|
8
8
|
|
|
9
9
|
// src/composite/composite-overflow-store.ts
|
|
10
10
|
function createCompositeOverflowStore(props = {}) {
|
|
11
|
-
return
|
|
11
|
+
return _75F3RDBEcjs.createPopoverStore.call(void 0, props);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
|