@ariakit/core 0.3.5 → 0.3.7
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 +18 -0
- package/cjs/__chunks/{FJSZTIOU.cjs → 46BH65MC.cjs} +4 -6
- package/cjs/__chunks/{FTB5CXVB.cjs → 5F4DVUNS.cjs} +7 -1
- package/cjs/__chunks/{AR2VJ37F.cjs → 6WBY3ZZM.cjs} +6 -6
- package/cjs/__chunks/{HOEZKRUM.cjs → 7ZUFMSXJ.cjs} +7 -7
- package/cjs/__chunks/{F5YZIIEA.cjs → GXIZMD53.cjs} +8 -2
- package/cjs/__chunks/{MYTMMWXI.cjs → GZDVJEID.cjs} +2 -2
- package/cjs/__chunks/{FFY2GSOG.cjs → JLC5A6WF.cjs} +8 -8
- package/cjs/__chunks/{F6Q5QSXF.cjs → MEHGRTJ3.cjs} +11 -11
- package/cjs/__chunks/{XVR5QRC3.cjs → PD7XZBXC.cjs} +4 -4
- package/cjs/__chunks/{G5EW4WED.cjs → YIUPKKEK.cjs} +6 -6
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/collection/collection-store.cjs +4 -4
- package/cjs/collection/collection-store.d.cts +6 -4
- package/cjs/collection/collection-store.d.ts +6 -4
- package/cjs/combobox/combobox-store.cjs +48 -26
- package/cjs/combobox/combobox-store.d.cts +69 -21
- package/cjs/combobox/combobox-store.d.ts +69 -21
- package/cjs/composite/composite-overflow-store.cjs +5 -5
- package/cjs/composite/composite-store.cjs +5 -5
- package/cjs/composite/composite-store.d.cts +6 -8
- package/cjs/composite/composite-store.d.ts +6 -8
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/disclosure/disclosure-store.d.cts +2 -0
- package/cjs/disclosure/disclosure-store.d.ts +2 -0
- package/cjs/form/form-store.cjs +8 -8
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/hovercard/hovercard-store.d.cts +6 -0
- package/cjs/hovercard/hovercard-store.d.ts +6 -0
- package/cjs/menu/menu-bar-store.cjs +6 -6
- package/cjs/menu/menu-store.cjs +19 -19
- package/cjs/menubar/menubar-store.cjs +6 -6
- package/cjs/menubar/menubar-store.d.cts +12 -6
- package/cjs/menubar/menubar-store.d.ts +12 -6
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/popover/popover-store.d.cts +3 -0
- package/cjs/popover/popover-store.d.ts +3 -0
- package/cjs/radio/radio-store.cjs +6 -6
- package/cjs/select/select-store.cjs +19 -19
- package/cjs/select/select-store.d.cts +28 -18
- package/cjs/select/select-store.d.ts +28 -18
- package/cjs/tab/tab-store.cjs +16 -16
- package/cjs/toolbar/toolbar-store.cjs +5 -5
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/utils/dom.cjs +4 -2
- package/cjs/utils/dom.d.cts +9 -0
- package/cjs/utils/dom.d.ts +9 -0
- package/cjs/utils/events.cjs +5 -5
- package/cjs/utils/focus.cjs +13 -13
- package/cjs/utils/platform.cjs +3 -3
- package/cjs/utils/store.cjs +2 -2
- package/cjs/utils/store.d.cts +3 -0
- package/cjs/utils/store.d.ts +3 -0
- package/esm/__chunks/{6LSGADQM.js → ANO6WJO4.js} +8 -2
- package/esm/__chunks/{EIFVU736.js → BXH3I7ML.js} +2 -2
- package/esm/__chunks/{6EMNXRG3.js → CCU5UHQ2.js} +2 -2
- package/esm/__chunks/{DREIYIMP.js → CL47ZAPY.js} +1 -1
- package/esm/__chunks/{NIF7E7VE.js → DLOEKDPY.js} +7 -1
- package/esm/__chunks/{PCA5ARZU.js → DYD4YNLE.js} +1 -1
- package/esm/__chunks/{HJS6GJT4.js → E7OQVGGY.js} +4 -6
- package/esm/__chunks/{5UJPJ37G.js → MHPO2BXA.js} +1 -1
- package/esm/__chunks/{5BWT4GY2.js → OGMLJYDV.js} +2 -2
- package/esm/__chunks/{MRBDYBGO.js → WY3EMTH6.js} +2 -2
- package/esm/checkbox/checkbox-store.js +1 -1
- package/esm/collection/collection-store.d.ts +6 -4
- package/esm/collection/collection-store.js +3 -3
- package/esm/combobox/combobox-store.d.ts +69 -21
- package/esm/combobox/combobox-store.js +35 -13
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-store.d.ts +6 -8
- package/esm/composite/composite-store.js +4 -4
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/disclosure/disclosure-store.d.ts +2 -0
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-store.js +3 -3
- package/esm/hovercard/hovercard-store.d.ts +6 -0
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/menu/menu-bar-store.js +5 -5
- package/esm/menu/menu-store.js +8 -8
- package/esm/menubar/menubar-store.d.ts +12 -6
- package/esm/menubar/menubar-store.js +5 -5
- package/esm/popover/popover-store.d.ts +3 -0
- package/esm/popover/popover-store.js +4 -4
- package/esm/radio/radio-store.js +4 -4
- package/esm/select/select-store.d.ts +28 -18
- package/esm/select/select-store.js +7 -7
- package/esm/tab/tab-store.js +4 -4
- package/esm/toolbar/toolbar-store.js +4 -4
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/utils/dom.d.ts +9 -0
- package/esm/utils/dom.js +5 -3
- 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.d.ts +3 -0
- package/esm/utils/store.js +1 -1
- package/package.json +1 -1
package/cjs/menu/menu-store.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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 _PD7XZBXCcjs = require('../__chunks/PD7XZBXC.cjs');
|
|
5
|
+
require('../__chunks/7ZUFMSXJ.cjs');
|
|
6
|
+
require('../__chunks/GZDVJEID.cjs');
|
|
7
|
+
require('../__chunks/MEHGRTJ3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('../__chunks/
|
|
10
|
+
var _6WBY3ZZMcjs = require('../__chunks/6WBY3ZZM.cjs');
|
|
11
|
+
require('../__chunks/JLC5A6WF.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -17,12 +17,12 @@ require('../__chunks/FFY2GSOG.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
25
|
-
require('../__chunks/
|
|
25
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
26
26
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
@@ -42,10 +42,10 @@ function createMenuStore(_a = {}) {
|
|
|
42
42
|
"menubar"
|
|
43
43
|
]);
|
|
44
44
|
const parentIsMenubar = !!menubar && !parent;
|
|
45
|
-
const store =
|
|
45
|
+
const store = _46BH65MCcjs.mergeStore.call(void 0,
|
|
46
46
|
props.store,
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
_46BH65MCcjs.pick.call(void 0, parent, ["values"]),
|
|
48
|
+
_46BH65MCcjs.omit.call(void 0, combobox, [
|
|
49
49
|
"arrowElement",
|
|
50
50
|
"anchorElement",
|
|
51
51
|
"contentElement",
|
|
@@ -53,9 +53,9 @@ function createMenuStore(_a = {}) {
|
|
|
53
53
|
"disclosureElement"
|
|
54
54
|
])
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
_46BH65MCcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
57
57
|
const syncState = store.getState();
|
|
58
|
-
const composite =
|
|
58
|
+
const composite = _6WBY3ZZMcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
59
59
|
store,
|
|
60
60
|
orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
61
61
|
props.orientation,
|
|
@@ -63,7 +63,7 @@ function createMenuStore(_a = {}) {
|
|
|
63
63
|
"vertical"
|
|
64
64
|
)
|
|
65
65
|
}));
|
|
66
|
-
const hovercard =
|
|
66
|
+
const hovercard = _PD7XZBXCcjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
67
67
|
store,
|
|
68
68
|
placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
69
69
|
props.placement,
|
|
@@ -86,18 +86,18 @@ function createMenuStore(_a = {}) {
|
|
|
86
86
|
{}
|
|
87
87
|
)
|
|
88
88
|
});
|
|
89
|
-
const menu =
|
|
90
|
-
|
|
89
|
+
const menu = _46BH65MCcjs.createStore.call(void 0, initialState, composite, hovercard, store);
|
|
90
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
91
91
|
menu,
|
|
92
|
-
() =>
|
|
92
|
+
() => _46BH65MCcjs.sync.call(void 0, menu, ["mounted"], (state) => {
|
|
93
93
|
if (state.mounted)
|
|
94
94
|
return;
|
|
95
95
|
menu.setState("activeId", null);
|
|
96
96
|
})
|
|
97
97
|
);
|
|
98
|
-
|
|
98
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
99
99
|
menu,
|
|
100
|
-
() =>
|
|
100
|
+
() => _46BH65MCcjs.sync.call(void 0, parent, ["orientation"], (state) => {
|
|
101
101
|
menu.setState(
|
|
102
102
|
"placement",
|
|
103
103
|
state.orientation === "vertical" ? "right-start" : "bottom-start"
|
|
@@ -1,14 +1,14 @@
|
|
|
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 _GXIZMD53cjs = require('../__chunks/GXIZMD53.cjs');
|
|
5
|
+
require('../__chunks/6WBY3ZZM.cjs');
|
|
6
|
+
require('../__chunks/JLC5A6WF.cjs');
|
|
7
|
+
require('../__chunks/46BH65MC.cjs');
|
|
8
8
|
require('../__chunks/3UT5FE6K.cjs');
|
|
9
|
-
require('../__chunks/
|
|
9
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
10
10
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
11
11
|
require('../__chunks/AV6KTKLE.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.createMenubarStore =
|
|
14
|
+
exports.createMenubarStore = _GXIZMD53cjs.createMenubarStore;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.js";
|
|
2
3
|
/**
|
|
3
4
|
* Creates a menu bar store.
|
|
4
5
|
*/
|
|
5
6
|
export declare function createMenubarStore(props?: MenubarStoreProps): MenubarStore;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
export
|
|
7
|
+
export interface MenubarStoreState extends CompositeStoreState {
|
|
8
|
+
}
|
|
9
|
+
export interface MenubarStoreFunctions extends CompositeStoreFunctions {
|
|
10
|
+
}
|
|
11
|
+
export interface MenubarStoreOptions extends CompositeStoreOptions {
|
|
12
|
+
}
|
|
13
|
+
export interface MenubarStoreProps extends MenubarStoreOptions, StoreProps<MenubarStoreState> {
|
|
14
|
+
}
|
|
15
|
+
export interface MenubarStore extends MenubarStoreFunctions, Store<MenubarStoreState> {
|
|
16
|
+
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.js";
|
|
2
3
|
/**
|
|
3
4
|
* Creates a menu bar store.
|
|
4
5
|
*/
|
|
5
6
|
export declare function createMenubarStore(props?: MenubarStoreProps): MenubarStore;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
export
|
|
7
|
+
export interface MenubarStoreState extends CompositeStoreState {
|
|
8
|
+
}
|
|
9
|
+
export interface MenubarStoreFunctions extends CompositeStoreFunctions {
|
|
10
|
+
}
|
|
11
|
+
export interface MenubarStoreOptions extends CompositeStoreOptions {
|
|
12
|
+
}
|
|
13
|
+
export interface MenubarStoreProps extends MenubarStoreOptions, StoreProps<MenubarStoreState> {
|
|
14
|
+
}
|
|
15
|
+
export interface MenubarStore extends MenubarStoreFunctions, Store<MenubarStoreState> {
|
|
16
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
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 _7ZUFMSXJcjs = require('../__chunks/7ZUFMSXJ.cjs');
|
|
5
|
+
require('../__chunks/GZDVJEID.cjs');
|
|
6
|
+
require('../__chunks/MEHGRTJ3.cjs');
|
|
7
|
+
require('../__chunks/46BH65MC.cjs');
|
|
8
8
|
require('../__chunks/3UT5FE6K.cjs');
|
|
9
9
|
require('../__chunks/AV6KTKLE.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createPopoverStore =
|
|
12
|
+
exports.createPopoverStore = _7ZUFMSXJcjs.createPopoverStore;
|
|
@@ -28,6 +28,9 @@ export interface PopoverStoreState extends DialogStoreState {
|
|
|
28
28
|
currentPlacement: Placement;
|
|
29
29
|
/**
|
|
30
30
|
* The placement of the popover.
|
|
31
|
+
*
|
|
32
|
+
* Live examples:
|
|
33
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
31
34
|
* @default "bottom"
|
|
32
35
|
*/
|
|
33
36
|
placement: Placement;
|
|
@@ -28,6 +28,9 @@ export interface PopoverStoreState extends DialogStoreState {
|
|
|
28
28
|
currentPlacement: Placement;
|
|
29
29
|
/**
|
|
30
30
|
* The placement of the popover.
|
|
31
|
+
*
|
|
32
|
+
* Live examples:
|
|
33
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
31
34
|
* @default "bottom"
|
|
32
35
|
*/
|
|
33
36
|
placement: Placement;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _6WBY3ZZMcjs = require('../__chunks/6WBY3ZZM.cjs');
|
|
5
|
+
require('../__chunks/JLC5A6WF.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
12
|
-
require('../__chunks/
|
|
12
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
13
13
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,7 +22,7 @@ function createRadioStore(_a = {}) {
|
|
|
22
22
|
var props = _AV6KTKLEcjs.__objRest.call(void 0, _a, []);
|
|
23
23
|
var _a2;
|
|
24
24
|
const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState();
|
|
25
|
-
const composite =
|
|
25
|
+
const composite = _6WBY3ZZMcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
26
26
|
focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
27
27
|
}));
|
|
28
28
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
@@ -33,7 +33,7 @@ function createRadioStore(_a = {}) {
|
|
|
33
33
|
null
|
|
34
34
|
)
|
|
35
35
|
});
|
|
36
|
-
const radio =
|
|
36
|
+
const radio = _46BH65MCcjs.createStore.call(void 0, initialState, composite, props.store);
|
|
37
37
|
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), radio), {
|
|
38
38
|
setValue: (value) => radio.setState("value", value)
|
|
39
39
|
});
|
|
@@ -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/
|
|
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
|
|
|
@@ -16,11 +16,11 @@ require('../__chunks/FFY2GSOG.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
23
|
-
require('../__chunks/
|
|
23
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
var _ULSPM3Y3cjs = require('../__chunks/ULSPM3Y3.cjs');
|
|
@@ -37,9 +37,9 @@ function createSelectStore(_a = {}) {
|
|
|
37
37
|
} = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
|
|
38
38
|
"combobox"
|
|
39
39
|
]);
|
|
40
|
-
const store =
|
|
40
|
+
const store = _46BH65MCcjs.mergeStore.call(void 0,
|
|
41
41
|
props.store,
|
|
42
|
-
|
|
42
|
+
_46BH65MCcjs.omit.call(void 0, combobox, [
|
|
43
43
|
"value",
|
|
44
44
|
"items",
|
|
45
45
|
"renderedItems",
|
|
@@ -51,9 +51,9 @@ function createSelectStore(_a = {}) {
|
|
|
51
51
|
"disclosureElement"
|
|
52
52
|
])
|
|
53
53
|
);
|
|
54
|
-
|
|
54
|
+
_46BH65MCcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
55
55
|
const syncState = store.getState();
|
|
56
|
-
const composite =
|
|
56
|
+
const composite = _6WBY3ZZMcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
57
57
|
store,
|
|
58
58
|
virtualFocus: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
59
59
|
props.virtualFocus,
|
|
@@ -77,7 +77,7 @@ function createSelectStore(_a = {}) {
|
|
|
77
77
|
"vertical"
|
|
78
78
|
)
|
|
79
79
|
}));
|
|
80
|
-
const popover =
|
|
80
|
+
const popover = _7ZUFMSXJcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
81
81
|
store,
|
|
82
82
|
placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
83
83
|
props.placement,
|
|
@@ -101,10 +101,10 @@ function createSelectStore(_a = {}) {
|
|
|
101
101
|
selectElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState.selectElement, null),
|
|
102
102
|
labelElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState.labelElement, null)
|
|
103
103
|
});
|
|
104
|
-
const select =
|
|
105
|
-
|
|
104
|
+
const select = _46BH65MCcjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
105
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
106
106
|
select,
|
|
107
|
-
() =>
|
|
107
|
+
() => _46BH65MCcjs.sync.call(void 0, select, ["value", "items"], (state) => {
|
|
108
108
|
if (state.value !== initialValue)
|
|
109
109
|
return;
|
|
110
110
|
if (!state.items.length)
|
|
@@ -117,9 +117,9 @@ function createSelectStore(_a = {}) {
|
|
|
117
117
|
select.setState("value", item.value);
|
|
118
118
|
})
|
|
119
119
|
);
|
|
120
|
-
|
|
120
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
121
121
|
select,
|
|
122
|
-
() =>
|
|
122
|
+
() => _46BH65MCcjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
|
|
123
123
|
if (combobox)
|
|
124
124
|
return;
|
|
125
125
|
if (state.mounted)
|
|
@@ -136,9 +136,9 @@ function createSelectStore(_a = {}) {
|
|
|
136
136
|
select.setState("activeId", item.id);
|
|
137
137
|
})
|
|
138
138
|
);
|
|
139
|
-
|
|
139
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
140
140
|
select,
|
|
141
|
-
() =>
|
|
141
|
+
() => _46BH65MCcjs.batch.call(void 0, select, ["setValueOnMove", "moves"], (state) => {
|
|
142
142
|
const { mounted, value, activeId } = select.getState();
|
|
143
143
|
if (!state.setValueOnMove && mounted)
|
|
144
144
|
return;
|
|
@@ -5,9 +5,9 @@ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
|
5
5
|
import type { PickRequired, SetState } from "../utils/types.js";
|
|
6
6
|
type Value = string | string[];
|
|
7
7
|
type MutableValue<T extends Value = Value> = T extends string ? string : T;
|
|
8
|
-
|
|
8
|
+
interface Item extends CompositeStoreItem {
|
|
9
9
|
value?: string;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
export declare function createSelectStore<T extends Value = Value>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
|
|
12
12
|
export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
|
|
13
13
|
export type SelectStoreItem = Item;
|
|
@@ -27,18 +27,32 @@ export interface SelectStoreState<T extends Value = Value> extends CompositeStor
|
|
|
27
27
|
* The select value.
|
|
28
28
|
*
|
|
29
29
|
* Live examples:
|
|
30
|
-
* - [
|
|
31
|
-
*
|
|
30
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
|
31
|
+
* - [Select Grid](https://ariakit.org/examples/select-grid)
|
|
32
|
+
* - [Select with custom
|
|
33
|
+
* items](https://ariakit.org/examples/select-item-custom)
|
|
34
|
+
* - [Multi-Select](https://ariakit.org/examples/select-multiple)
|
|
35
|
+
* - [Toolbar with Select](https://ariakit.org/examples/toolbar-select)
|
|
32
36
|
*/
|
|
33
37
|
value: MutableValue<T>;
|
|
34
38
|
/**
|
|
35
|
-
* Whether the select
|
|
36
|
-
*
|
|
39
|
+
* Whether the select
|
|
40
|
+
* [`value`](https://ariakit.org/reference/select-provider#value) should be
|
|
41
|
+
* set when the active item changes by moving (which usually happens when
|
|
42
|
+
* moving to an item using the keyboard).
|
|
43
|
+
*
|
|
44
|
+
* Live examples:
|
|
45
|
+
* - [Select Grid](https://ariakit.org/examples/select-grid)
|
|
46
|
+
* - [Select with custom
|
|
47
|
+
* items](https://ariakit.org/examples/select-item-custom)
|
|
37
48
|
* @default false
|
|
38
49
|
*/
|
|
39
50
|
setValueOnMove: boolean;
|
|
40
51
|
/**
|
|
41
52
|
* The select button element.
|
|
53
|
+
*
|
|
54
|
+
* Live examples:
|
|
55
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
|
42
56
|
*/
|
|
43
57
|
selectElement: HTMLElement | null;
|
|
44
58
|
/**
|
|
@@ -49,10 +63,6 @@ export interface SelectStoreState<T extends Value = Value> extends CompositeStor
|
|
|
49
63
|
export interface SelectStoreFunctions<T extends Value = Value> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<Item>, PopoverStoreFunctions {
|
|
50
64
|
/**
|
|
51
65
|
* Sets the `value` state.
|
|
52
|
-
*
|
|
53
|
-
* Live examples:
|
|
54
|
-
* - [Multi-selectable
|
|
55
|
-
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
56
66
|
* @example
|
|
57
67
|
* store.setValue("Apple");
|
|
58
68
|
* store.setValue(["Apple", "Banana"]);
|
|
@@ -73,21 +83,21 @@ export interface SelectStoreOptions<T extends Value = Value> extends StoreOption
|
|
|
73
83
|
* A reference to a combobox store. This is used when combining the combobox
|
|
74
84
|
* with a select (e.g., select with a search input). The stores will share the
|
|
75
85
|
* same state.
|
|
76
|
-
*
|
|
77
|
-
* Live examples:
|
|
78
|
-
* - [Multi-selectable
|
|
79
|
-
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
80
86
|
*/
|
|
81
87
|
combobox?: ComboboxStore | null;
|
|
82
88
|
/**
|
|
83
89
|
* The default value. If not set, the first non-disabled item will be used.
|
|
84
90
|
*
|
|
85
91
|
* Live examples:
|
|
86
|
-
* - [
|
|
87
|
-
*
|
|
92
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
|
93
|
+
* - [Animated Select](https://ariakit.org/examples/select-animated)
|
|
94
|
+
* - [Select with Combobox](https://ariakit.org/examples/select-combobox)
|
|
95
|
+
* - [SelectGroup](https://ariakit.org/examples/select-group)
|
|
88
96
|
*/
|
|
89
97
|
defaultValue?: SelectStoreState<T>["value"];
|
|
90
98
|
}
|
|
91
|
-
export
|
|
92
|
-
|
|
99
|
+
export interface SelectStoreProps<T extends Value = Value> extends SelectStoreOptions<T>, StoreProps<SelectStoreState<T>> {
|
|
100
|
+
}
|
|
101
|
+
export interface SelectStore<T extends Value = Value> extends SelectStoreFunctions<T>, Store<SelectStoreState<T>> {
|
|
102
|
+
}
|
|
93
103
|
export {};
|
|
@@ -5,9 +5,9 @@ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
|
5
5
|
import type { PickRequired, SetState } from "../utils/types.js";
|
|
6
6
|
type Value = string | string[];
|
|
7
7
|
type MutableValue<T extends Value = Value> = T extends string ? string : T;
|
|
8
|
-
|
|
8
|
+
interface Item extends CompositeStoreItem {
|
|
9
9
|
value?: string;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
export declare function createSelectStore<T extends Value = Value>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
|
|
12
12
|
export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
|
|
13
13
|
export type SelectStoreItem = Item;
|
|
@@ -27,18 +27,32 @@ export interface SelectStoreState<T extends Value = Value> extends CompositeStor
|
|
|
27
27
|
* The select value.
|
|
28
28
|
*
|
|
29
29
|
* Live examples:
|
|
30
|
-
* - [
|
|
31
|
-
*
|
|
30
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
|
31
|
+
* - [Select Grid](https://ariakit.org/examples/select-grid)
|
|
32
|
+
* - [Select with custom
|
|
33
|
+
* items](https://ariakit.org/examples/select-item-custom)
|
|
34
|
+
* - [Multi-Select](https://ariakit.org/examples/select-multiple)
|
|
35
|
+
* - [Toolbar with Select](https://ariakit.org/examples/toolbar-select)
|
|
32
36
|
*/
|
|
33
37
|
value: MutableValue<T>;
|
|
34
38
|
/**
|
|
35
|
-
* Whether the select
|
|
36
|
-
*
|
|
39
|
+
* Whether the select
|
|
40
|
+
* [`value`](https://ariakit.org/reference/select-provider#value) should be
|
|
41
|
+
* set when the active item changes by moving (which usually happens when
|
|
42
|
+
* moving to an item using the keyboard).
|
|
43
|
+
*
|
|
44
|
+
* Live examples:
|
|
45
|
+
* - [Select Grid](https://ariakit.org/examples/select-grid)
|
|
46
|
+
* - [Select with custom
|
|
47
|
+
* items](https://ariakit.org/examples/select-item-custom)
|
|
37
48
|
* @default false
|
|
38
49
|
*/
|
|
39
50
|
setValueOnMove: boolean;
|
|
40
51
|
/**
|
|
41
52
|
* The select button element.
|
|
53
|
+
*
|
|
54
|
+
* Live examples:
|
|
55
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
|
42
56
|
*/
|
|
43
57
|
selectElement: HTMLElement | null;
|
|
44
58
|
/**
|
|
@@ -49,10 +63,6 @@ export interface SelectStoreState<T extends Value = Value> extends CompositeStor
|
|
|
49
63
|
export interface SelectStoreFunctions<T extends Value = Value> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<Item>, PopoverStoreFunctions {
|
|
50
64
|
/**
|
|
51
65
|
* Sets the `value` state.
|
|
52
|
-
*
|
|
53
|
-
* Live examples:
|
|
54
|
-
* - [Multi-selectable
|
|
55
|
-
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
56
66
|
* @example
|
|
57
67
|
* store.setValue("Apple");
|
|
58
68
|
* store.setValue(["Apple", "Banana"]);
|
|
@@ -73,21 +83,21 @@ export interface SelectStoreOptions<T extends Value = Value> extends StoreOption
|
|
|
73
83
|
* A reference to a combobox store. This is used when combining the combobox
|
|
74
84
|
* with a select (e.g., select with a search input). The stores will share the
|
|
75
85
|
* same state.
|
|
76
|
-
*
|
|
77
|
-
* Live examples:
|
|
78
|
-
* - [Multi-selectable
|
|
79
|
-
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
80
86
|
*/
|
|
81
87
|
combobox?: ComboboxStore | null;
|
|
82
88
|
/**
|
|
83
89
|
* The default value. If not set, the first non-disabled item will be used.
|
|
84
90
|
*
|
|
85
91
|
* Live examples:
|
|
86
|
-
* - [
|
|
87
|
-
*
|
|
92
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
|
93
|
+
* - [Animated Select](https://ariakit.org/examples/select-animated)
|
|
94
|
+
* - [Select with Combobox](https://ariakit.org/examples/select-combobox)
|
|
95
|
+
* - [SelectGroup](https://ariakit.org/examples/select-group)
|
|
88
96
|
*/
|
|
89
97
|
defaultValue?: SelectStoreState<T>["value"];
|
|
90
98
|
}
|
|
91
|
-
export
|
|
92
|
-
|
|
99
|
+
export interface SelectStoreProps<T extends Value = Value> extends SelectStoreOptions<T>, StoreProps<SelectStoreState<T>> {
|
|
100
|
+
}
|
|
101
|
+
export interface SelectStore<T extends Value = Value> extends SelectStoreFunctions<T>, Store<SelectStoreState<T>> {
|
|
102
|
+
}
|
|
93
103
|
export {};
|
package/cjs/tab/tab-store.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _6WBY3ZZMcjs = require('../__chunks/6WBY3ZZM.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _JLC5A6WFcjs = require('../__chunks/JLC5A6WF.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
17
|
-
require('../__chunks/
|
|
17
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
18
18
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
@@ -25,7 +25,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
25
25
|
function createTabStore(props = {}) {
|
|
26
26
|
var _a;
|
|
27
27
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
28
|
-
const composite =
|
|
28
|
+
const composite = _6WBY3ZZMcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
29
29
|
orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
30
30
|
props.orientation,
|
|
31
31
|
syncState == null ? void 0 : syncState.orientation,
|
|
@@ -33,7 +33,7 @@ function createTabStore(props = {}) {
|
|
|
33
33
|
),
|
|
34
34
|
focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
35
35
|
}));
|
|
36
|
-
const panels =
|
|
36
|
+
const panels = _JLC5A6WFcjs.createCollectionStore.call(void 0, );
|
|
37
37
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
38
38
|
selectedId: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
39
39
|
props.selectedId,
|
|
@@ -47,10 +47,10 @@ function createTabStore(props = {}) {
|
|
|
47
47
|
true
|
|
48
48
|
)
|
|
49
49
|
});
|
|
50
|
-
const tab =
|
|
51
|
-
|
|
50
|
+
const tab = _46BH65MCcjs.createStore.call(void 0, initialState, composite, props.store);
|
|
51
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
52
52
|
tab,
|
|
53
|
-
() =>
|
|
53
|
+
() => _46BH65MCcjs.sync.call(void 0, tab, ["moves"], () => {
|
|
54
54
|
const { activeId, selectOnMove } = tab.getState();
|
|
55
55
|
if (!selectOnMove)
|
|
56
56
|
return;
|
|
@@ -66,17 +66,17 @@ function createTabStore(props = {}) {
|
|
|
66
66
|
tab.setState("selectedId", tabItem.id);
|
|
67
67
|
})
|
|
68
68
|
);
|
|
69
|
-
|
|
69
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
70
70
|
tab,
|
|
71
|
-
() =>
|
|
71
|
+
() => _46BH65MCcjs.batch.call(void 0,
|
|
72
72
|
tab,
|
|
73
73
|
["selectedId"],
|
|
74
74
|
(state) => tab.setState("activeId", state.selectedId)
|
|
75
75
|
)
|
|
76
76
|
);
|
|
77
|
-
|
|
77
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
78
78
|
tab,
|
|
79
|
-
() =>
|
|
79
|
+
() => _46BH65MCcjs.sync.call(void 0, tab, ["selectedId", "renderedItems"], (state) => {
|
|
80
80
|
if (state.selectedId !== void 0)
|
|
81
81
|
return;
|
|
82
82
|
const { activeId, renderedItems } = tab.getState();
|
|
@@ -91,13 +91,13 @@ function createTabStore(props = {}) {
|
|
|
91
91
|
}
|
|
92
92
|
})
|
|
93
93
|
);
|
|
94
|
-
|
|
94
|
+
_46BH65MCcjs.setup.call(void 0,
|
|
95
95
|
tab,
|
|
96
|
-
() =>
|
|
96
|
+
() => _46BH65MCcjs.sync.call(void 0, tab, ["renderedItems"], (state) => {
|
|
97
97
|
const tabs = state.renderedItems;
|
|
98
98
|
if (!tabs.length)
|
|
99
99
|
return;
|
|
100
|
-
return
|
|
100
|
+
return _46BH65MCcjs.sync.call(void 0, panels, ["renderedItems"], (state2) => {
|
|
101
101
|
const items = state2.renderedItems;
|
|
102
102
|
const hasOrphanPanels = items.some((panel) => !panel.tabId);
|
|
103
103
|
if (!hasOrphanPanels)
|
|
@@ -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/
|
|
4
|
+
var _6WBY3ZZMcjs = require('../__chunks/6WBY3ZZM.cjs');
|
|
5
|
+
require('../__chunks/JLC5A6WF.cjs');
|
|
6
|
+
require('../__chunks/46BH65MC.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
10
|
-
require('../__chunks/
|
|
10
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
11
11
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -18,7 +18,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
18
18
|
function createToolbarStore(props = {}) {
|
|
19
19
|
var _a;
|
|
20
20
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
21
|
-
return
|
|
21
|
+
return _6WBY3ZZMcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
22
22
|
orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
23
23
|
props.orientation,
|
|
24
24
|
syncState == null ? void 0 : syncState.orientation,
|