@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @ariakit/core
|
|
2
2
|
|
|
3
|
+
## 0.4.16
|
|
4
|
+
|
|
5
|
+
- Updated `Array` types to `ReadonlyArray` for better compatibility.
|
|
6
|
+
|
|
7
|
+
## 0.4.15
|
|
8
|
+
|
|
9
|
+
- Fixed `valid` state not updating on [Form](https://ariakit.org/components/form).
|
|
10
|
+
|
|
3
11
|
## 0.4.14
|
|
4
12
|
|
|
5
13
|
- Fixed a regression on [Hovercard](https://ariakit.org/components/hovercard) that sometimes prevented it from closing when other popups were opened.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _OGYYHXPPcjs = require('./OGYYHXPP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _EKSEHA55cjs = require('./EKSEHA55.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
|
|
@@ -16,7 +16,7 @@ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
|
|
|
16
16
|
function createHovercardStore(props = {}) {
|
|
17
17
|
var _a;
|
|
18
18
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
19
|
-
const popover =
|
|
19
|
+
const popover = _OGYYHXPPcjs.createPopoverStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
20
20
|
placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
21
21
|
props.placement,
|
|
22
22
|
syncState == null ? void 0 : syncState.placement,
|
|
@@ -30,7 +30,7 @@ function createHovercardStore(props = {}) {
|
|
|
30
30
|
hideTimeout: _MLCPLY2Pcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
|
|
31
31
|
autoFocusOnShow: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
|
|
32
32
|
});
|
|
33
|
-
const hovercard =
|
|
33
|
+
const hovercard = _EKSEHA55cjs.createStore.call(void 0, initialState, popover, props.store);
|
|
34
34
|
return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, popover), hovercard), {
|
|
35
35
|
setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
|
|
36
36
|
});
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _VZPNI7C2cjs = require('./VZPNI7C2.cjs');
|
|
4
4
|
|
|
5
5
|
// src/utils/platform.ts
|
|
6
6
|
function isTouchDevice() {
|
|
7
|
-
return
|
|
7
|
+
return _VZPNI7C2cjs.canUseDOM && !!navigator.maxTouchPoints;
|
|
8
8
|
}
|
|
9
9
|
function isApple() {
|
|
10
|
-
if (!
|
|
10
|
+
if (!_VZPNI7C2cjs.canUseDOM) return false;
|
|
11
11
|
return /mac|iphone|ipad|ipod/i.test(navigator.platform);
|
|
12
12
|
}
|
|
13
13
|
function isSafari() {
|
|
14
|
-
return
|
|
14
|
+
return _VZPNI7C2cjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
|
|
15
15
|
}
|
|
16
16
|
function isFirefox() {
|
|
17
|
-
return
|
|
17
|
+
return _VZPNI7C2cjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
|
|
18
18
|
}
|
|
19
19
|
function isMac() {
|
|
20
|
-
return
|
|
20
|
+
return _VZPNI7C2cjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _BUEPUCQLcjs = require('./BUEPUCQL.cjs');
|
|
4
3
|
|
|
4
|
+
var _GDZQUFNPcjs = require('./GDZQUFNP.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _E5AYFGW2cjs = require('./E5AYFGW2.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _EKSEHA55cjs = require('./EKSEHA55.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
|
|
@@ -116,7 +116,7 @@ function verticalizeItems(items) {
|
|
|
116
116
|
function createCompositeStore(props = {}) {
|
|
117
117
|
var _a;
|
|
118
118
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
119
|
-
const collection =
|
|
119
|
+
const collection = _E5AYFGW2cjs.createCollectionStore.call(void 0, props);
|
|
120
120
|
const activeId = _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
121
121
|
props.activeId,
|
|
122
122
|
syncState == null ? void 0 : syncState.activeId,
|
|
@@ -151,10 +151,10 @@ function createCompositeStore(props = {}) {
|
|
|
151
151
|
focusWrap: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
|
|
152
152
|
focusShift: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
|
|
153
153
|
});
|
|
154
|
-
const composite =
|
|
155
|
-
|
|
154
|
+
const composite = _EKSEHA55cjs.createStore.call(void 0, initialState, collection, props.store);
|
|
155
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
156
156
|
composite,
|
|
157
|
-
() =>
|
|
157
|
+
() => _EKSEHA55cjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
|
|
158
158
|
composite.setState("activeId", (activeId2) => {
|
|
159
159
|
var _a2;
|
|
160
160
|
if (activeId2 !== void 0) return activeId2;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
var _VZPNI7C2cjs = require('./VZPNI7C2.cjs');
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
var _ASR6PAFNcjs = require('./ASR6PAFN.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _EKSEHA55cjs = require('./EKSEHA55.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -31,14 +31,14 @@ function getCommonParent(items) {
|
|
|
31
31
|
}
|
|
32
32
|
parentElement = parentElement.parentElement;
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return _VZPNI7C2cjs.getDocument.call(void 0, parentElement).body;
|
|
35
35
|
}
|
|
36
36
|
function getPrivateStore(store) {
|
|
37
37
|
return store == null ? void 0 : store.__unstablePrivateStore;
|
|
38
38
|
}
|
|
39
39
|
function createCollectionStore(props = {}) {
|
|
40
40
|
var _a;
|
|
41
|
-
|
|
41
|
+
_EKSEHA55cjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
42
42
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
43
43
|
const items = _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
44
44
|
props.items,
|
|
@@ -52,24 +52,24 @@ function createCollectionStore(props = {}) {
|
|
|
52
52
|
renderedItems: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
|
|
53
53
|
};
|
|
54
54
|
const syncPrivateStore = getPrivateStore(props.store);
|
|
55
|
-
const privateStore =
|
|
55
|
+
const privateStore = _EKSEHA55cjs.createStore.call(void 0,
|
|
56
56
|
{ items, renderedItems: initialState.renderedItems },
|
|
57
57
|
syncPrivateStore
|
|
58
58
|
);
|
|
59
|
-
const collection =
|
|
59
|
+
const collection = _EKSEHA55cjs.createStore.call(void 0, initialState, props.store);
|
|
60
60
|
const sortItems = (renderedItems) => {
|
|
61
|
-
const sortedItems =
|
|
61
|
+
const sortedItems = _VZPNI7C2cjs.sortBasedOnDOMPosition.call(void 0, renderedItems, (i) => i.element);
|
|
62
62
|
privateStore.setState("renderedItems", sortedItems);
|
|
63
63
|
collection.setState("renderedItems", sortedItems);
|
|
64
64
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return
|
|
65
|
+
_EKSEHA55cjs.setup.call(void 0, collection, () => _EKSEHA55cjs.init.call(void 0, privateStore));
|
|
66
|
+
_EKSEHA55cjs.setup.call(void 0, privateStore, () => {
|
|
67
|
+
return _EKSEHA55cjs.batch.call(void 0, privateStore, ["items"], (state) => {
|
|
68
68
|
collection.setState("items", state.items);
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
|
-
|
|
72
|
-
return
|
|
71
|
+
_EKSEHA55cjs.setup.call(void 0, privateStore, () => {
|
|
72
|
+
return _EKSEHA55cjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
|
|
73
73
|
let firstRun = true;
|
|
74
74
|
let raf = requestAnimationFrame(() => {
|
|
75
75
|
const { renderedItems } = collection.getState();
|
|
@@ -176,12 +176,14 @@ function pick2(store, ...args) {
|
|
|
176
176
|
return getInternal(store, "pick")(...args);
|
|
177
177
|
}
|
|
178
178
|
function mergeStore(...stores) {
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
var _a;
|
|
180
|
+
const initialState = {};
|
|
181
|
+
for (const store2 of stores) {
|
|
181
182
|
const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
if (nextState) {
|
|
184
|
+
Object.assign(initialState, nextState);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
185
187
|
const store = createStore(initialState, ...stores);
|
|
186
188
|
return Object.assign({}, ...stores, store);
|
|
187
189
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _EKSEHA55cjs = require('./EKSEHA55.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
|
|
@@ -17,11 +17,11 @@ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
|
|
|
17
17
|
|
|
18
18
|
// src/disclosure/disclosure-store.ts
|
|
19
19
|
function createDisclosureStore(props = {}) {
|
|
20
|
-
const store =
|
|
20
|
+
const store = _EKSEHA55cjs.mergeStore.call(void 0,
|
|
21
21
|
props.store,
|
|
22
|
-
|
|
22
|
+
_EKSEHA55cjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
|
|
23
23
|
);
|
|
24
|
-
|
|
24
|
+
_EKSEHA55cjs.throwOnConflictingProps.call(void 0, props, store);
|
|
25
25
|
const syncState = store == null ? void 0 : store.getState();
|
|
26
26
|
const open = _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
27
27
|
props.open,
|
|
@@ -38,24 +38,24 @@ function createDisclosureStore(props = {}) {
|
|
|
38
38
|
contentElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
|
|
39
39
|
disclosureElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
|
|
40
40
|
};
|
|
41
|
-
const disclosure =
|
|
42
|
-
|
|
41
|
+
const disclosure = _EKSEHA55cjs.createStore.call(void 0, initialState, store);
|
|
42
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
43
43
|
disclosure,
|
|
44
|
-
() =>
|
|
44
|
+
() => _EKSEHA55cjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
|
|
45
45
|
if (state.animated) return;
|
|
46
46
|
disclosure.setState("animating", false);
|
|
47
47
|
})
|
|
48
48
|
);
|
|
49
|
-
|
|
49
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
50
50
|
disclosure,
|
|
51
|
-
() =>
|
|
51
|
+
() => _EKSEHA55cjs.subscribe.call(void 0, disclosure, ["open"], () => {
|
|
52
52
|
if (!disclosure.getState().animated) return;
|
|
53
53
|
disclosure.setState("animating", true);
|
|
54
54
|
})
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
57
57
|
disclosure,
|
|
58
|
-
() =>
|
|
58
|
+
() => _EKSEHA55cjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
|
|
59
59
|
disclosure.setState("mounted", state.open || state.animating);
|
|
60
60
|
})
|
|
61
61
|
);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _VR2FVDSUcjs = require('./VR2FVDSU.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _EKSEHA55cjs = require('./EKSEHA55.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
|
|
@@ -23,9 +23,9 @@ function createPopoverStore(_a = {}) {
|
|
|
23
23
|
} = _b, props = _7EQBAZ46cjs.__objRest.call(void 0, _b, [
|
|
24
24
|
"popover"
|
|
25
25
|
]);
|
|
26
|
-
const store =
|
|
26
|
+
const store = _EKSEHA55cjs.mergeStore.call(void 0,
|
|
27
27
|
props.store,
|
|
28
|
-
|
|
28
|
+
_EKSEHA55cjs.omit.call(void 0, otherPopover, [
|
|
29
29
|
"arrowElement",
|
|
30
30
|
"anchorElement",
|
|
31
31
|
"contentElement",
|
|
@@ -33,9 +33,9 @@ function createPopoverStore(_a = {}) {
|
|
|
33
33
|
"disclosureElement"
|
|
34
34
|
])
|
|
35
35
|
);
|
|
36
|
-
|
|
36
|
+
_EKSEHA55cjs.throwOnConflictingProps.call(void 0, props, store);
|
|
37
37
|
const syncState = store == null ? void 0 : store.getState();
|
|
38
|
-
const dialog =
|
|
38
|
+
const dialog = _VR2FVDSUcjs.createDialogStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), { store }));
|
|
39
39
|
const placement = _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
40
40
|
props.placement,
|
|
41
41
|
syncState == null ? void 0 : syncState.placement,
|
|
@@ -49,7 +49,7 @@ function createPopoverStore(_a = {}) {
|
|
|
49
49
|
arrowElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
|
|
50
50
|
rendered: Symbol("rendered")
|
|
51
51
|
});
|
|
52
|
-
const popover =
|
|
52
|
+
const popover = _EKSEHA55cjs.createStore.call(void 0, initialState, dialog, store);
|
|
53
53
|
return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, dialog), popover), {
|
|
54
54
|
setAnchorElement: (element) => popover.setState("anchorElement", element),
|
|
55
55
|
setPopoverElement: (element) => popover.setState("popoverElement", element),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _L5GSFUJUcjs = require('./L5GSFUJU.cjs');
|
|
4
4
|
|
|
5
5
|
// src/dialog/dialog-store.ts
|
|
6
6
|
function createDialogStore(props = {}) {
|
|
7
|
-
return
|
|
7
|
+
return _L5GSFUJUcjs.createDisclosureStore.call(void 0, props);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
|
|
@@ -70,7 +70,7 @@ function isTextField(element) {
|
|
|
70
70
|
const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
|
|
71
71
|
const isTextArea = element.tagName === "TEXTAREA";
|
|
72
72
|
return isTextInput || isTextArea || false;
|
|
73
|
-
} catch (
|
|
73
|
+
} catch (_error) {
|
|
74
74
|
return false;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _7WVAUIMEcjs = require('./7WVAUIME.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _EKSEHA55cjs = require('./EKSEHA55.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
|
|
@@ -16,7 +16,7 @@ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
|
|
|
16
16
|
function createMenubarStore(props = {}) {
|
|
17
17
|
var _a;
|
|
18
18
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
19
|
-
const composite =
|
|
19
|
+
const composite = _7WVAUIMEcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
20
20
|
orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
21
21
|
props.orientation,
|
|
22
22
|
syncState == null ? void 0 : syncState.orientation,
|
|
@@ -25,7 +25,7 @@ function createMenubarStore(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.__spreadValues.call(void 0, {}, composite.getState());
|
|
28
|
-
const menubar =
|
|
28
|
+
const menubar = _EKSEHA55cjs.createStore.call(void 0, initialState, composite, props.store);
|
|
29
29
|
return _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite), menubar);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _EKSEHA55cjs = require('../__chunks/EKSEHA55.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
|
|
@@ -13,7 +13,7 @@ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
|
|
|
13
13
|
// src/checkbox/checkbox-store.ts
|
|
14
14
|
function createCheckboxStore(props = {}) {
|
|
15
15
|
var _a;
|
|
16
|
-
|
|
16
|
+
_EKSEHA55cjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
17
17
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
18
18
|
const initialState = {
|
|
19
19
|
value: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
@@ -23,7 +23,7 @@ function createCheckboxStore(props = {}) {
|
|
|
23
23
|
false
|
|
24
24
|
)
|
|
25
25
|
};
|
|
26
|
-
const checkbox =
|
|
26
|
+
const checkbox = _EKSEHA55cjs.createStore.call(void 0, initialState, props.store);
|
|
27
27
|
return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, checkbox), {
|
|
28
28
|
setValue: (value) => checkbox.setState("value", value)
|
|
29
29
|
});
|
|
@@ -5,7 +5,7 @@ import type { PickRequired, SetState, ToPrimitive } from "../utils/types.ts";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function createCheckboxStore<T extends CheckboxStoreValue = CheckboxStoreValue>(props: PickRequired<CheckboxStoreProps<T>, "value" | "defaultValue">): CheckboxStore<T>;
|
|
7
7
|
export declare function createCheckboxStore(props?: CheckboxStoreProps): CheckboxStore;
|
|
8
|
-
export type CheckboxStoreValue = boolean | string | number |
|
|
8
|
+
export type CheckboxStoreValue = boolean | string | number | ReadonlyArray<string | number>;
|
|
9
9
|
export interface CheckboxStoreState<T extends CheckboxStoreValue = CheckboxStoreValue> {
|
|
10
10
|
/**
|
|
11
11
|
* The checked state of the checkbox.
|
|
@@ -5,7 +5,7 @@ import type { PickRequired, SetState, ToPrimitive } from "../utils/types.ts";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function createCheckboxStore<T extends CheckboxStoreValue = CheckboxStoreValue>(props: PickRequired<CheckboxStoreProps<T>, "value" | "defaultValue">): CheckboxStore<T>;
|
|
7
7
|
export declare function createCheckboxStore(props?: CheckboxStoreProps): CheckboxStore;
|
|
8
|
-
export type CheckboxStoreValue = boolean | string | number |
|
|
8
|
+
export type CheckboxStoreValue = boolean | string | number | ReadonlyArray<string | number>;
|
|
9
9
|
export interface CheckboxStoreState<T extends CheckboxStoreValue = CheckboxStoreValue> {
|
|
10
10
|
/**
|
|
11
11
|
* The checked state of the checkbox.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _E5AYFGW2cjs = require('../__chunks/E5AYFGW2.cjs');
|
|
4
|
+
require('../__chunks/VZPNI7C2.cjs');
|
|
5
|
+
require('../__chunks/EKSEHA55.cjs');
|
|
5
6
|
require('../__chunks/MLCPLY2P.cjs');
|
|
6
|
-
require('../__chunks/726BNPQZ.cjs');
|
|
7
7
|
require('../__chunks/7EQBAZ46.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createCollectionStore =
|
|
10
|
+
exports.createCollectionStore = _E5AYFGW2cjs.createCollectionStore;
|
|
@@ -20,6 +20,10 @@ export interface CollectionStoreState<T extends CollectionStoreItem = Collection
|
|
|
20
20
|
* updated when an item is registered or unregistered using the
|
|
21
21
|
* [`registerItem`](https://ariakit.org/reference/use-collection-store#registeritem)
|
|
22
22
|
* function.
|
|
23
|
+
*
|
|
24
|
+
* Live examples:
|
|
25
|
+
* - [Command Menu with
|
|
26
|
+
* Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
|
|
23
27
|
*/
|
|
24
28
|
items: T[];
|
|
25
29
|
/**
|
|
@@ -20,6 +20,10 @@ export interface CollectionStoreState<T extends CollectionStoreItem = Collection
|
|
|
20
20
|
* updated when an item is registered or unregistered using the
|
|
21
21
|
* [`registerItem`](https://ariakit.org/reference/use-collection-store#registeritem)
|
|
22
22
|
* function.
|
|
23
|
+
*
|
|
24
|
+
* Live examples:
|
|
25
|
+
* - [Command Menu with
|
|
26
|
+
* Tabs](https://ariakit.org/examples/dialog-combobox-tab-command-menu)
|
|
23
27
|
*/
|
|
24
28
|
items: T[];
|
|
25
29
|
/**
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _K7YTZVWCcjs = require('../__chunks/K7YTZVWC.cjs');
|
|
4
|
-
require('../__chunks/BUEPUCQL.cjs');
|
|
5
|
-
require('../__chunks/GDZQUFNP.cjs');
|
|
6
3
|
|
|
4
|
+
var _6REHCF5Tcjs = require('../__chunks/6REHCF5T.cjs');
|
|
7
5
|
|
|
8
|
-
var _BVPEDDW6cjs = require('../__chunks/BVPEDDW6.cjs');
|
|
9
|
-
require('../__chunks/YMCSKJHR.cjs');
|
|
10
|
-
require('../__chunks/V4YF2QA6.cjs');
|
|
11
6
|
|
|
7
|
+
var _OGYYHXPPcjs = require('../__chunks/OGYYHXPP.cjs');
|
|
12
8
|
|
|
13
9
|
|
|
10
|
+
var _7WVAUIMEcjs = require('../__chunks/7WVAUIME.cjs');
|
|
11
|
+
require('../__chunks/GDZQUFNP.cjs');
|
|
12
|
+
require('../__chunks/VR2FVDSU.cjs');
|
|
13
|
+
require('../__chunks/L5GSFUJU.cjs');
|
|
14
|
+
require('../__chunks/E5AYFGW2.cjs');
|
|
15
|
+
require('../__chunks/VZPNI7C2.cjs');
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
|
|
19
|
-
var _ASR6PAFNcjs = require('../__chunks/ASR6PAFN.cjs');
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
var
|
|
24
|
+
var _EKSEHA55cjs = require('../__chunks/EKSEHA55.cjs');
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
|
|
27
|
-
var
|
|
28
|
-
require('../__chunks/726BNPQZ.cjs');
|
|
28
|
+
var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -33,15 +33,15 @@ require('../__chunks/726BNPQZ.cjs');
|
|
|
33
33
|
var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
|
|
34
34
|
|
|
35
35
|
// src/combobox/combobox-store.ts
|
|
36
|
-
var isTouchSafari =
|
|
36
|
+
var isTouchSafari = _6REHCF5Tcjs.isSafari.call(void 0, ) && _6REHCF5Tcjs.isTouchDevice.call(void 0, );
|
|
37
37
|
function createComboboxStore(_a = {}) {
|
|
38
38
|
var _b = _a, {
|
|
39
39
|
tag
|
|
40
40
|
} = _b, props = _7EQBAZ46cjs.__objRest.call(void 0, _b, [
|
|
41
41
|
"tag"
|
|
42
42
|
]);
|
|
43
|
-
const store =
|
|
44
|
-
|
|
43
|
+
const store = _EKSEHA55cjs.mergeStore.call(void 0, props.store, _EKSEHA55cjs.pick.call(void 0, tag, ["value", "rtl"]));
|
|
44
|
+
_EKSEHA55cjs.throwOnConflictingProps.call(void 0, props, store);
|
|
45
45
|
const tagState = tag == null ? void 0 : tag.getState();
|
|
46
46
|
const syncState = store == null ? void 0 : store.getState();
|
|
47
47
|
const activeId = _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
@@ -50,7 +50,7 @@ function createComboboxStore(_a = {}) {
|
|
|
50
50
|
props.defaultActiveId,
|
|
51
51
|
null
|
|
52
52
|
);
|
|
53
|
-
const composite =
|
|
53
|
+
const composite = _7WVAUIMEcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
54
54
|
activeId,
|
|
55
55
|
includesBaseElement: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
56
56
|
props.includesBaseElement,
|
|
@@ -70,7 +70,7 @@ function createComboboxStore(_a = {}) {
|
|
|
70
70
|
true
|
|
71
71
|
)
|
|
72
72
|
}));
|
|
73
|
-
const popover =
|
|
73
|
+
const popover = _OGYYHXPPcjs.createPopoverStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
|
|
74
74
|
placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
|
|
75
75
|
props.placement,
|
|
76
76
|
syncState == null ? void 0 : syncState.placement,
|
|
@@ -106,54 +106,54 @@ function createComboboxStore(_a = {}) {
|
|
|
106
106
|
),
|
|
107
107
|
activeValue: syncState == null ? void 0 : syncState.activeValue
|
|
108
108
|
});
|
|
109
|
-
const combobox =
|
|
109
|
+
const combobox = _EKSEHA55cjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
110
110
|
if (isTouchSafari) {
|
|
111
|
-
|
|
111
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
112
112
|
combobox,
|
|
113
|
-
() =>
|
|
113
|
+
() => _EKSEHA55cjs.sync.call(void 0, combobox, ["virtualFocus"], () => {
|
|
114
114
|
combobox.setState("virtualFocus", false);
|
|
115
115
|
})
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
_EKSEHA55cjs.setup.call(void 0, combobox, () => {
|
|
119
119
|
if (!tag) return;
|
|
120
120
|
return _MLCPLY2Pcjs.chain.call(void 0,
|
|
121
|
-
|
|
121
|
+
_EKSEHA55cjs.sync.call(void 0, combobox, ["selectedValue"], (state) => {
|
|
122
122
|
if (!Array.isArray(state.selectedValue)) return;
|
|
123
123
|
tag.setValues(state.selectedValue);
|
|
124
124
|
}),
|
|
125
|
-
|
|
125
|
+
_EKSEHA55cjs.sync.call(void 0, tag, ["values"], (state) => {
|
|
126
126
|
combobox.setState("selectedValue", state.values);
|
|
127
127
|
})
|
|
128
128
|
);
|
|
129
129
|
});
|
|
130
|
-
|
|
130
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
131
131
|
combobox,
|
|
132
|
-
() =>
|
|
132
|
+
() => _EKSEHA55cjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
|
|
133
133
|
if (!state.resetValueOnHide) return;
|
|
134
134
|
if (state.mounted) return;
|
|
135
135
|
combobox.setState("value", value);
|
|
136
136
|
})
|
|
137
137
|
);
|
|
138
|
-
|
|
138
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
139
139
|
combobox,
|
|
140
|
-
() =>
|
|
140
|
+
() => _EKSEHA55cjs.sync.call(void 0, combobox, ["open"], (state) => {
|
|
141
141
|
if (state.open) return;
|
|
142
142
|
combobox.setState("activeId", activeId);
|
|
143
143
|
combobox.setState("moves", 0);
|
|
144
144
|
})
|
|
145
145
|
);
|
|
146
|
-
|
|
146
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
147
147
|
combobox,
|
|
148
|
-
() =>
|
|
148
|
+
() => _EKSEHA55cjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
|
|
149
149
|
if (state.moves === prevState.moves) {
|
|
150
150
|
combobox.setState("activeValue", void 0);
|
|
151
151
|
}
|
|
152
152
|
})
|
|
153
153
|
);
|
|
154
|
-
|
|
154
|
+
_EKSEHA55cjs.setup.call(void 0,
|
|
155
155
|
combobox,
|
|
156
|
-
() =>
|
|
156
|
+
() => _EKSEHA55cjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
|
|
157
157
|
if (state.moves === prev.moves) return;
|
|
158
158
|
const { activeId: activeId2 } = combobox.getState();
|
|
159
159
|
const activeItem = composite.item(activeId2);
|
|
@@ -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
|
*/
|