@ariakit/core 0.3.11 → 0.4.0
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 +50 -0
- package/cjs/__chunks/{E53JW5BD.cjs → 5JEQEZFR.cjs} +12 -12
- package/cjs/__chunks/{YIUPKKEK.cjs → 7DU6YMLQ.cjs} +6 -6
- package/cjs/__chunks/{OTVLDMN2.cjs → AETQC2AR.cjs} +17 -16
- package/cjs/__chunks/{F6HPKLO2.cjs → B4LYZ4EM.cjs} +12 -12
- package/cjs/__chunks/{KBNYGXWI.cjs → EEDWPDM2.cjs} +11 -1
- package/cjs/__chunks/{MI6NUQYQ.cjs → FFZYCAXA.cjs} +15 -15
- package/cjs/__chunks/{I3Y4EXEF.cjs → LTLFSC4X.cjs} +2 -2
- package/cjs/__chunks/{NOFH2BLB.cjs → SU2BSHGB.cjs} +7 -7
- package/cjs/__chunks/{TQTGWD5K.cjs → UEZLSKZ4.cjs} +10 -10
- package/cjs/__chunks/{5F4DVUNS.cjs → UKR6TQI3.cjs} +1 -2
- package/cjs/__chunks/{BFE5R4EZ.cjs → Y7KNI5NS.cjs} +17 -17
- package/cjs/checkbox/checkbox-store.cjs +5 -5
- package/cjs/collection/collection-store.cjs +5 -5
- package/cjs/combobox/combobox-store.cjs +35 -35
- package/cjs/composite/composite-overflow-store.cjs +6 -6
- package/cjs/composite/composite-store.cjs +6 -6
- package/cjs/dialog/dialog-store.cjs +5 -5
- package/cjs/disclosure/disclosure-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.d.cts +6 -2
- package/cjs/disclosure/disclosure-store.d.ts +6 -2
- package/cjs/form/form-store.cjs +24 -24
- package/cjs/hovercard/hovercard-store.cjs +7 -7
- package/cjs/menu/menu-bar-store.cjs +7 -7
- package/cjs/menu/menu-store.cjs +27 -27
- package/cjs/menubar/menubar-store.cjs +7 -7
- package/cjs/popover/popover-store.cjs +6 -6
- package/cjs/radio/radio-store.cjs +9 -9
- package/cjs/select/select-store.cjs +29 -29
- package/cjs/tab/tab-store.cjs +21 -21
- package/cjs/toolbar/toolbar-store.cjs +8 -8
- package/cjs/tooltip/tooltip-store.cjs +21 -12
- package/cjs/utils/dom.cjs +2 -2
- package/cjs/utils/events.cjs +5 -5
- package/cjs/utils/focus.cjs +13 -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/esm/__chunks/{Y3OOHFCN.js → 22HHDS5F.js} +10 -0
- package/esm/__chunks/{IERTEJ3A.js → 2H5K47H4.js} +3 -3
- package/esm/__chunks/{SX2XFD6A.js → 5RJNXXU2.js} +1 -1
- package/esm/__chunks/{SOLWE6E5.js → BRS7GKWU.js} +3 -3
- package/esm/__chunks/{AF6IUUFN.js → MFZZDIHG.js} +3 -3
- package/esm/__chunks/{XU3EOSCU.js → PXYVPXSS.js} +3 -3
- package/esm/__chunks/{EAHJFCU4.js → R676XYVY.js} +1 -1
- package/esm/__chunks/{DLOEKDPY.js → RRSZHCH6.js} +1 -2
- package/esm/__chunks/{22K762VQ.js → URUD7X4C.js} +3 -3
- package/esm/__chunks/{MHPO2BXA.js → VDNATJW2.js} +1 -1
- package/esm/__chunks/{Z5IGYIPT.js → WCKXDMU7.js} +3 -2
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/collection/collection-store.js +4 -4
- package/esm/combobox/combobox-store.js +9 -9
- package/esm/composite/composite-overflow-store.js +5 -5
- package/esm/composite/composite-store.js +5 -5
- package/esm/dialog/dialog-store.js +4 -4
- package/esm/disclosure/disclosure-store.d.ts +6 -2
- package/esm/disclosure/disclosure-store.js +3 -3
- package/esm/form/form-store.js +4 -4
- package/esm/hovercard/hovercard-store.js +6 -6
- package/esm/menu/menu-bar-store.js +6 -6
- package/esm/menu/menu-store.js +9 -9
- package/esm/menubar/menubar-store.js +6 -6
- package/esm/popover/popover-store.js +5 -5
- package/esm/radio/radio-store.js +5 -5
- package/esm/select/select-store.js +8 -8
- package/esm/tab/tab-store.js +5 -5
- package/esm/toolbar/toolbar-store.js +5 -5
- package/esm/tooltip/tooltip-store.js +15 -6
- package/esm/utils/dom.js +1 -1
- package/esm/utils/events.js +2 -2
- package/esm/utils/focus.js +1 -1
- 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.js +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
4
|
+
var _FFZYCAXAcjs = require('../__chunks/FFZYCAXA.cjs');
|
|
5
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
6
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
7
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
8
8
|
require('../__chunks/AV6KTKLE.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.createCollectionStore =
|
|
11
|
+
exports.createCollectionStore = _FFZYCAXAcjs.createCollectionStore;
|
|
@@ -1,28 +1,28 @@
|
|
|
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 _5JEQEZFRcjs = require('../__chunks/5JEQEZFR.cjs');
|
|
5
|
+
require('../__chunks/LTLFSC4X.cjs');
|
|
6
|
+
require('../__chunks/AETQC2AR.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../__chunks/
|
|
9
|
+
var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
|
|
10
|
+
require('../__chunks/FFZYCAXA.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
25
|
-
require('../__chunks/
|
|
24
|
+
var _7DU6YMLQcjs = require('../__chunks/7DU6YMLQ.cjs');
|
|
25
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
26
26
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
@@ -30,51 +30,51 @@ require('../__chunks/ULSPM3Y3.cjs');
|
|
|
30
30
|
var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
31
31
|
|
|
32
32
|
// src/combobox/combobox-store.ts
|
|
33
|
-
var isSafariOnMobile =
|
|
33
|
+
var isSafariOnMobile = _7DU6YMLQcjs.isSafari.call(void 0, ) && _7DU6YMLQcjs.isTouchDevice.call(void 0, );
|
|
34
34
|
function createComboboxStore(props = {}) {
|
|
35
35
|
var _a;
|
|
36
|
-
|
|
36
|
+
_B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
37
37
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
38
|
-
const activeId =
|
|
38
|
+
const activeId = _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
39
39
|
props.activeId,
|
|
40
40
|
syncState == null ? void 0 : syncState.activeId,
|
|
41
41
|
props.defaultActiveId,
|
|
42
42
|
null
|
|
43
43
|
);
|
|
44
|
-
const composite =
|
|
44
|
+
const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
45
45
|
activeId,
|
|
46
|
-
includesBaseElement:
|
|
46
|
+
includesBaseElement: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
47
47
|
props.includesBaseElement,
|
|
48
48
|
syncState == null ? void 0 : syncState.includesBaseElement,
|
|
49
49
|
true
|
|
50
50
|
),
|
|
51
|
-
orientation:
|
|
51
|
+
orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
52
52
|
props.orientation,
|
|
53
53
|
syncState == null ? void 0 : syncState.orientation,
|
|
54
54
|
"vertical"
|
|
55
55
|
),
|
|
56
|
-
focusLoop:
|
|
57
|
-
focusWrap:
|
|
58
|
-
virtualFocus:
|
|
56
|
+
focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
|
|
57
|
+
focusWrap: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
|
|
58
|
+
virtualFocus: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
59
59
|
props.virtualFocus,
|
|
60
60
|
syncState == null ? void 0 : syncState.virtualFocus,
|
|
61
61
|
!isSafariOnMobile
|
|
62
62
|
)
|
|
63
63
|
}));
|
|
64
|
-
const popover =
|
|
65
|
-
placement:
|
|
64
|
+
const popover = _5JEQEZFRcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
65
|
+
placement: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
66
66
|
props.placement,
|
|
67
67
|
syncState == null ? void 0 : syncState.placement,
|
|
68
68
|
"bottom-start"
|
|
69
69
|
)
|
|
70
70
|
}));
|
|
71
|
-
const value =
|
|
71
|
+
const value = _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
72
72
|
props.value,
|
|
73
73
|
syncState == null ? void 0 : syncState.value,
|
|
74
74
|
props.defaultValue,
|
|
75
75
|
""
|
|
76
76
|
);
|
|
77
|
-
const selectedValue =
|
|
77
|
+
const selectedValue = _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
78
78
|
props.selectedValue,
|
|
79
79
|
syncState == null ? void 0 : syncState.selectedValue,
|
|
80
80
|
props.defaultSelectedValue,
|
|
@@ -84,22 +84,22 @@ function createComboboxStore(props = {}) {
|
|
|
84
84
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
|
|
85
85
|
value,
|
|
86
86
|
selectedValue,
|
|
87
|
-
resetValueOnSelect:
|
|
87
|
+
resetValueOnSelect: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
88
88
|
props.resetValueOnSelect,
|
|
89
89
|
syncState == null ? void 0 : syncState.resetValueOnSelect,
|
|
90
90
|
multiSelectable
|
|
91
91
|
),
|
|
92
|
-
resetValueOnHide:
|
|
92
|
+
resetValueOnHide: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
93
93
|
props.resetValueOnHide,
|
|
94
94
|
syncState == null ? void 0 : syncState.resetValueOnHide,
|
|
95
95
|
multiSelectable
|
|
96
96
|
),
|
|
97
97
|
activeValue: syncState == null ? void 0 : syncState.activeValue
|
|
98
98
|
});
|
|
99
|
-
const combobox =
|
|
100
|
-
|
|
99
|
+
const combobox = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, popover, props.store);
|
|
100
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
101
101
|
combobox,
|
|
102
|
-
() =>
|
|
102
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
|
|
103
103
|
if (!state.resetValueOnHide)
|
|
104
104
|
return;
|
|
105
105
|
if (state.mounted)
|
|
@@ -107,34 +107,34 @@ function createComboboxStore(props = {}) {
|
|
|
107
107
|
combobox.setState("value", value);
|
|
108
108
|
})
|
|
109
109
|
);
|
|
110
|
-
|
|
110
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
111
111
|
combobox,
|
|
112
|
-
() =>
|
|
112
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, combobox, ["resetValueOnSelect", "selectedValue"], (state) => {
|
|
113
113
|
if (!state.resetValueOnSelect)
|
|
114
114
|
return;
|
|
115
115
|
combobox.setState("value", value);
|
|
116
116
|
})
|
|
117
117
|
);
|
|
118
|
-
|
|
118
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
119
119
|
combobox,
|
|
120
|
-
() =>
|
|
120
|
+
() => _B4LYZ4EMcjs.batch.call(void 0, combobox, ["mounted"], (state) => {
|
|
121
121
|
if (state.mounted)
|
|
122
122
|
return;
|
|
123
123
|
combobox.setState("activeId", activeId);
|
|
124
124
|
combobox.setState("moves", 0);
|
|
125
125
|
})
|
|
126
126
|
);
|
|
127
|
-
|
|
127
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
128
128
|
combobox,
|
|
129
|
-
() =>
|
|
129
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
|
|
130
130
|
if (state.moves === prevState.moves) {
|
|
131
131
|
combobox.setState("activeValue", void 0);
|
|
132
132
|
}
|
|
133
133
|
})
|
|
134
134
|
);
|
|
135
|
-
|
|
135
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
136
136
|
combobox,
|
|
137
|
-
() =>
|
|
137
|
+
() => _B4LYZ4EMcjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
|
|
138
138
|
if (state.moves === prev.moves)
|
|
139
139
|
return;
|
|
140
140
|
const { activeId: activeId2 } = combobox.getState();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
4
|
+
var _5JEQEZFRcjs = require('../__chunks/5JEQEZFR.cjs');
|
|
5
|
+
require('../__chunks/LTLFSC4X.cjs');
|
|
6
|
+
require('../__chunks/AETQC2AR.cjs');
|
|
7
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
8
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
9
9
|
require('../__chunks/AV6KTKLE.cjs');
|
|
10
10
|
|
|
11
11
|
// src/composite/composite-overflow-store.ts
|
|
12
12
|
function createCompositeOverflowStore(props = {}) {
|
|
13
|
-
return
|
|
13
|
+
return _5JEQEZFRcjs.createPopoverStore.call(void 0, props);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
4
|
+
var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
|
|
5
|
+
require('../__chunks/FFZYCAXA.cjs');
|
|
6
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
7
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
8
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
9
9
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
10
10
|
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createCompositeStore =
|
|
13
|
+
exports.createCompositeStore = _Y7KNI5NScjs.createCompositeStore;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
4
|
+
var _LTLFSC4Xcjs = require('../__chunks/LTLFSC4X.cjs');
|
|
5
|
+
require('../__chunks/AETQC2AR.cjs');
|
|
6
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
7
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
8
8
|
require('../__chunks/AV6KTKLE.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.createDialogStore =
|
|
11
|
+
exports.createDialogStore = _LTLFSC4Xcjs.createDialogStore;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _AETQC2ARcjs = require('../__chunks/AETQC2AR.cjs');
|
|
5
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
6
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
7
7
|
require('../__chunks/AV6KTKLE.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createDisclosureStore =
|
|
10
|
+
exports.createDisclosureStore = _AETQC2ARcjs.createDisclosureStore;
|
|
@@ -38,7 +38,6 @@ export interface DisclosureStoreState {
|
|
|
38
38
|
* - If it's set to a number, the `animating` state will be `true` when the
|
|
39
39
|
* content is shown or hidden and it will wait for the number of
|
|
40
40
|
* milliseconds to pass before becoming `false`.
|
|
41
|
-
* @default false
|
|
42
41
|
*/
|
|
43
42
|
animated: boolean | number;
|
|
44
43
|
/**
|
|
@@ -54,7 +53,7 @@ export interface DisclosureStoreState {
|
|
|
54
53
|
*/
|
|
55
54
|
disclosureElement: HTMLElement | null;
|
|
56
55
|
}
|
|
57
|
-
export interface DisclosureStoreFunctions {
|
|
56
|
+
export interface DisclosureStoreFunctions extends Pick<DisclosureStoreOptions, "disclosure"> {
|
|
58
57
|
/**
|
|
59
58
|
* Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
|
|
60
59
|
* state.
|
|
@@ -115,6 +114,11 @@ export interface DisclosureStoreFunctions {
|
|
|
115
114
|
setDisclosureElement: SetState<DisclosureStoreState["disclosureElement"]>;
|
|
116
115
|
}
|
|
117
116
|
export interface DisclosureStoreOptions extends StoreOptions<DisclosureStoreState, "open" | "animated"> {
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated Manually setting the `animated` prop is no longer necessary.
|
|
119
|
+
* This will be removed in a future release.
|
|
120
|
+
*/
|
|
121
|
+
animated?: DisclosureStoreState["animated"];
|
|
118
122
|
/**
|
|
119
123
|
* Whether the content should be visible by default.
|
|
120
124
|
* @default false
|
|
@@ -38,7 +38,6 @@ export interface DisclosureStoreState {
|
|
|
38
38
|
* - If it's set to a number, the `animating` state will be `true` when the
|
|
39
39
|
* content is shown or hidden and it will wait for the number of
|
|
40
40
|
* milliseconds to pass before becoming `false`.
|
|
41
|
-
* @default false
|
|
42
41
|
*/
|
|
43
42
|
animated: boolean | number;
|
|
44
43
|
/**
|
|
@@ -54,7 +53,7 @@ export interface DisclosureStoreState {
|
|
|
54
53
|
*/
|
|
55
54
|
disclosureElement: HTMLElement | null;
|
|
56
55
|
}
|
|
57
|
-
export interface DisclosureStoreFunctions {
|
|
56
|
+
export interface DisclosureStoreFunctions extends Pick<DisclosureStoreOptions, "disclosure"> {
|
|
58
57
|
/**
|
|
59
58
|
* Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
|
|
60
59
|
* state.
|
|
@@ -115,6 +114,11 @@ export interface DisclosureStoreFunctions {
|
|
|
115
114
|
setDisclosureElement: SetState<DisclosureStoreState["disclosureElement"]>;
|
|
116
115
|
}
|
|
117
116
|
export interface DisclosureStoreOptions extends StoreOptions<DisclosureStoreState, "open" | "animated"> {
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated Manually setting the `animated` prop is no longer necessary.
|
|
119
|
+
* This will be removed in a future release.
|
|
120
|
+
*/
|
|
121
|
+
animated?: DisclosureStoreState["animated"];
|
|
118
122
|
/**
|
|
119
123
|
* Whether the content should be visible by default.
|
|
120
124
|
* @default false
|
package/cjs/form/form-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 _FFZYCAXAcjs = require('../__chunks/FFZYCAXA.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
require('../__chunks/
|
|
16
|
+
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
17
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -26,7 +26,7 @@ function nextFrame() {
|
|
|
26
26
|
}
|
|
27
27
|
function hasMessages(object) {
|
|
28
28
|
return Object.keys(object).some((key) => {
|
|
29
|
-
if (
|
|
29
|
+
if (_EEDWPDM2cjs.isObject.call(void 0, object[key])) {
|
|
30
30
|
return hasMessages(object[key]);
|
|
31
31
|
}
|
|
32
32
|
return !!object[key];
|
|
@@ -48,10 +48,10 @@ function set(values, path, value) {
|
|
|
48
48
|
if (k == null)
|
|
49
49
|
return values;
|
|
50
50
|
const key = k;
|
|
51
|
-
const isIntegerKey =
|
|
51
|
+
const isIntegerKey = _EEDWPDM2cjs.isInteger.call(void 0, key);
|
|
52
52
|
const nextValues = isIntegerKey ? values || [] : values || {};
|
|
53
53
|
const nestedValues = nextValues[key];
|
|
54
|
-
const result = rest.length && (Array.isArray(nestedValues) ||
|
|
54
|
+
const result = rest.length && (Array.isArray(nestedValues) || _EEDWPDM2cjs.isObject.call(void 0, nestedValues)) ? set(nestedValues, rest, value) : value;
|
|
55
55
|
if (isIntegerKey) {
|
|
56
56
|
const index = Number(key);
|
|
57
57
|
if (values && Array.isArray(values)) {
|
|
@@ -74,12 +74,12 @@ function setAll(values, value) {
|
|
|
74
74
|
const currentValue = values[key];
|
|
75
75
|
if (Array.isArray(currentValue)) {
|
|
76
76
|
result[key] = currentValue.map((v) => {
|
|
77
|
-
if (
|
|
77
|
+
if (_EEDWPDM2cjs.isObject.call(void 0, v)) {
|
|
78
78
|
return setAll(v, value);
|
|
79
79
|
}
|
|
80
80
|
return value;
|
|
81
81
|
});
|
|
82
|
-
} else if (
|
|
82
|
+
} else if (_EEDWPDM2cjs.isObject.call(void 0, currentValue)) {
|
|
83
83
|
result[key] = setAll(currentValue, value);
|
|
84
84
|
} else {
|
|
85
85
|
result[key] = value;
|
|
@@ -114,22 +114,22 @@ function createNames() {
|
|
|
114
114
|
}
|
|
115
115
|
function createFormStore(props = {}) {
|
|
116
116
|
var _a;
|
|
117
|
-
|
|
117
|
+
_B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
118
118
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
119
|
-
const collection =
|
|
120
|
-
const values =
|
|
119
|
+
const collection = _FFZYCAXAcjs.createCollectionStore.call(void 0, props);
|
|
120
|
+
const values = _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
121
121
|
props.values,
|
|
122
122
|
syncState == null ? void 0 : syncState.values,
|
|
123
123
|
props.defaultValues,
|
|
124
124
|
{}
|
|
125
125
|
);
|
|
126
|
-
const errors =
|
|
126
|
+
const errors = _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
127
127
|
props.errors,
|
|
128
128
|
syncState == null ? void 0 : syncState.errors,
|
|
129
129
|
props.defaultErrors,
|
|
130
130
|
{}
|
|
131
131
|
);
|
|
132
|
-
const touched =
|
|
132
|
+
const touched = _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
133
133
|
props.touched,
|
|
134
134
|
syncState == null ? void 0 : syncState.touched,
|
|
135
135
|
props.defaultTouched,
|
|
@@ -139,21 +139,21 @@ function createFormStore(props = {}) {
|
|
|
139
139
|
values,
|
|
140
140
|
errors,
|
|
141
141
|
touched,
|
|
142
|
-
validating:
|
|
143
|
-
submitting:
|
|
144
|
-
submitSucceed:
|
|
145
|
-
submitFailed:
|
|
142
|
+
validating: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.validating, false),
|
|
143
|
+
submitting: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitting, false),
|
|
144
|
+
submitSucceed: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitSucceed, 0),
|
|
145
|
+
submitFailed: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
|
|
146
146
|
valid: !hasMessages(errors)
|
|
147
147
|
});
|
|
148
|
-
const form =
|
|
148
|
+
const form = _B4LYZ4EMcjs.createStore.call(void 0, initialState, collection, props.store);
|
|
149
149
|
const syncCallbacks = getStoreCallbacks(props.store);
|
|
150
150
|
const syncCallbacksState = syncCallbacks == null ? void 0 : syncCallbacks.getState();
|
|
151
151
|
const callbacksInitialState = {
|
|
152
152
|
validate: (syncCallbacksState == null ? void 0 : syncCallbacksState.validate) || [],
|
|
153
153
|
submit: (syncCallbacksState == null ? void 0 : syncCallbacksState.submit) || []
|
|
154
154
|
};
|
|
155
|
-
const callbacks =
|
|
156
|
-
|
|
155
|
+
const callbacks = _B4LYZ4EMcjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
|
|
156
|
+
_B4LYZ4EMcjs.setup.call(void 0, form, () => _B4LYZ4EMcjs.init.call(void 0, callbacks));
|
|
157
157
|
const validate = async () => {
|
|
158
158
|
form.setState("validating", true);
|
|
159
159
|
form.setState("errors", {});
|
|
@@ -174,7 +174,7 @@ function createFormStore(props = {}) {
|
|
|
174
174
|
getValue: (name) => get(form.getState().values, name),
|
|
175
175
|
setValue: (name, value) => form.setState("values", (values2) => {
|
|
176
176
|
const prevValue = get(values2, name);
|
|
177
|
-
const nextValue =
|
|
177
|
+
const nextValue = _EEDWPDM2cjs.applyState.call(void 0, value, prevValue);
|
|
178
178
|
if (nextValue === prevValue)
|
|
179
179
|
return values2;
|
|
180
180
|
return set(values2, name, nextValue);
|
|
@@ -195,7 +195,7 @@ function createFormStore(props = {}) {
|
|
|
195
195
|
getError: (name) => get(form.getState().errors, name),
|
|
196
196
|
setError: (name, error) => form.setState("errors", (errors2) => {
|
|
197
197
|
const prevError = get(errors2, name);
|
|
198
|
-
const nextError =
|
|
198
|
+
const nextError = _EEDWPDM2cjs.applyState.call(void 0, error, prevError);
|
|
199
199
|
if (nextError === prevError)
|
|
200
200
|
return errors2;
|
|
201
201
|
return set(errors2, name, nextError);
|
|
@@ -204,7 +204,7 @@ function createFormStore(props = {}) {
|
|
|
204
204
|
getFieldTouched: (name) => !!get(form.getState().touched, name),
|
|
205
205
|
setFieldTouched: (name, value) => form.setState("touched", (touched2) => {
|
|
206
206
|
const prevValue = get(touched2, name);
|
|
207
|
-
const nextValue =
|
|
207
|
+
const nextValue = _EEDWPDM2cjs.applyState.call(void 0, value, prevValue);
|
|
208
208
|
if (nextValue === prevValue)
|
|
209
209
|
return touched2;
|
|
210
210
|
return set(touched2, name, nextValue);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/
|
|
4
|
+
var _UEZLSKZ4cjs = require('../__chunks/UEZLSKZ4.cjs');
|
|
5
|
+
require('../__chunks/5JEQEZFR.cjs');
|
|
6
|
+
require('../__chunks/LTLFSC4X.cjs');
|
|
7
|
+
require('../__chunks/AETQC2AR.cjs');
|
|
8
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
9
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
10
10
|
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createHovercardStore =
|
|
13
|
+
exports.createHovercardStore = _UEZLSKZ4cjs.createHovercardStore;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/
|
|
4
|
+
var _SU2BSHGBcjs = require('../__chunks/SU2BSHGB.cjs');
|
|
5
|
+
require('../__chunks/Y7KNI5NS.cjs');
|
|
6
|
+
require('../__chunks/FFZYCAXA.cjs');
|
|
7
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
8
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
9
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
10
10
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
11
11
|
require('../__chunks/AV6KTKLE.cjs');
|
|
12
12
|
|
|
13
13
|
// src/menu/menu-bar-store.ts
|
|
14
14
|
function createMenuBarStore(props = {}) {
|
|
15
|
-
return
|
|
15
|
+
return _SU2BSHGBcjs.createMenubarStore.call(void 0, props);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
|
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 _UEZLSKZ4cjs = require('../__chunks/UEZLSKZ4.cjs');
|
|
5
|
+
require('../__chunks/5JEQEZFR.cjs');
|
|
6
|
+
require('../__chunks/LTLFSC4X.cjs');
|
|
7
|
+
require('../__chunks/AETQC2AR.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('../__chunks/
|
|
10
|
+
var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
|
|
11
|
+
require('../__chunks/FFZYCAXA.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -17,12 +17,12 @@ require('../__chunks/MI6NUQYQ.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
25
|
-
require('../__chunks/
|
|
24
|
+
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
25
|
+
require('../__chunks/UKR6TQI3.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 = _B4LYZ4EMcjs.mergeStore.call(void 0,
|
|
46
46
|
props.store,
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
_B4LYZ4EMcjs.pick.call(void 0, parent, ["values"]),
|
|
48
|
+
_B4LYZ4EMcjs.omit.call(void 0, combobox, [
|
|
49
49
|
"arrowElement",
|
|
50
50
|
"anchorElement",
|
|
51
51
|
"contentElement",
|
|
@@ -53,51 +53,51 @@ function createMenuStore(_a = {}) {
|
|
|
53
53
|
"disclosureElement"
|
|
54
54
|
])
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
_B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
57
57
|
const syncState = store.getState();
|
|
58
|
-
const composite =
|
|
58
|
+
const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
59
59
|
store,
|
|
60
|
-
orientation:
|
|
60
|
+
orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
61
61
|
props.orientation,
|
|
62
62
|
syncState.orientation,
|
|
63
63
|
"vertical"
|
|
64
64
|
)
|
|
65
65
|
}));
|
|
66
|
-
const hovercard =
|
|
66
|
+
const hovercard = _UEZLSKZ4cjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
67
67
|
store,
|
|
68
|
-
placement:
|
|
68
|
+
placement: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
69
69
|
props.placement,
|
|
70
70
|
syncState.placement,
|
|
71
71
|
"bottom-start"
|
|
72
72
|
),
|
|
73
|
-
timeout:
|
|
73
|
+
timeout: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
74
74
|
props.timeout,
|
|
75
75
|
syncState.timeout,
|
|
76
76
|
parentIsMenubar ? 0 : 150
|
|
77
77
|
),
|
|
78
|
-
hideTimeout:
|
|
78
|
+
hideTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.hideTimeout, syncState.hideTimeout, 0)
|
|
79
79
|
}));
|
|
80
80
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), hovercard.getState()), {
|
|
81
|
-
initialFocus:
|
|
82
|
-
values:
|
|
81
|
+
initialFocus: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.initialFocus, "container"),
|
|
82
|
+
values: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
83
83
|
props.values,
|
|
84
84
|
syncState.values,
|
|
85
85
|
props.defaultValues,
|
|
86
86
|
{}
|
|
87
87
|
)
|
|
88
88
|
});
|
|
89
|
-
const menu =
|
|
90
|
-
|
|
89
|
+
const menu = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, hovercard, store);
|
|
90
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
91
91
|
menu,
|
|
92
|
-
() =>
|
|
92
|
+
() => _B4LYZ4EMcjs.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
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
99
99
|
menu,
|
|
100
|
-
() =>
|
|
100
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, parent, ["orientation"], (state) => {
|
|
101
101
|
menu.setState(
|
|
102
102
|
"placement",
|
|
103
103
|
state.orientation === "vertical" ? "right-start" : "bottom-start"
|
|
@@ -123,7 +123,7 @@ function createMenuStore(_a = {}) {
|
|
|
123
123
|
return;
|
|
124
124
|
menu.setState("values", (values) => {
|
|
125
125
|
const prevValue = values[name];
|
|
126
|
-
const nextValue =
|
|
126
|
+
const nextValue = _EEDWPDM2cjs.applyState.call(void 0, value, prevValue);
|
|
127
127
|
if (nextValue === prevValue)
|
|
128
128
|
return values;
|
|
129
129
|
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, values), {
|