@ariakit/core 0.3.10 → 0.3.11
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 +10 -0
- package/cjs/__chunks/{ZXCB7MXN.cjs → BFE5R4EZ.cjs} +17 -17
- package/cjs/__chunks/{Y6PHIDP6.cjs → E53JW5BD.cjs} +12 -12
- package/cjs/__chunks/{5CBCKBZ2.cjs → F6HPKLO2.cjs} +12 -12
- package/cjs/__chunks/{MFSCSSBJ.cjs → I3Y4EXEF.cjs} +2 -2
- package/cjs/__chunks/{3UT5FE6K.cjs → KBNYGXWI.cjs} +3 -0
- package/cjs/__chunks/{YLMJBIQM.cjs → MI6NUQYQ.cjs} +22 -13
- package/cjs/__chunks/{CWDUO5EV.cjs → NOFH2BLB.cjs} +7 -7
- package/cjs/__chunks/{MWNFQD55.cjs → OTVLDMN2.cjs} +16 -16
- package/cjs/__chunks/{HMO4CKUP.cjs → TQTGWD5K.cjs} +10 -10
- package/cjs/checkbox/checkbox-store.cjs +5 -5
- package/cjs/collection/collection-store.cjs +4 -4
- package/cjs/combobox/combobox-store.cjs +32 -32
- package/cjs/composite/composite-overflow-store.cjs +6 -6
- package/cjs/composite/composite-store.cjs +5 -5
- package/cjs/dialog/dialog-store.cjs +5 -5
- package/cjs/disclosure/disclosure-store.cjs +4 -4
- package/cjs/form/form-store.cjs +23 -23
- package/cjs/form/form-store.d.cts +1 -1
- package/cjs/form/form-store.d.ts +1 -1
- package/cjs/hovercard/hovercard-store.cjs +7 -7
- package/cjs/hovercard/hovercard-store.d.cts +14 -7
- package/cjs/hovercard/hovercard-store.d.ts +14 -7
- package/cjs/menu/menu-bar-store.cjs +6 -6
- package/cjs/menu/menu-store.cjs +26 -26
- package/cjs/menu/menu-store.d.cts +16 -7
- package/cjs/menu/menu-store.d.ts +16 -7
- package/cjs/menubar/menubar-store.cjs +6 -6
- package/cjs/popover/popover-store.cjs +6 -6
- package/cjs/popover/popover-store.d.cts +31 -6
- package/cjs/popover/popover-store.d.ts +31 -6
- package/cjs/radio/radio-store.cjs +8 -8
- package/cjs/radio/radio-store.d.cts +2 -1
- package/cjs/radio/radio-store.d.ts +2 -1
- package/cjs/select/select-store.cjs +28 -28
- package/cjs/select/select-store.d.cts +2 -1
- package/cjs/select/select-store.d.ts +2 -1
- package/cjs/tab/tab-store.cjs +20 -20
- package/cjs/tab/tab-store.d.cts +5 -11
- package/cjs/tab/tab-store.d.ts +5 -11
- package/cjs/toolbar/toolbar-store.cjs +7 -7
- package/cjs/toolbar/toolbar-store.d.cts +2 -6
- package/cjs/toolbar/toolbar-store.d.ts +2 -6
- package/cjs/tooltip/tooltip-store.cjs +12 -12
- package/cjs/tooltip/tooltip-store.d.cts +6 -4
- package/cjs/tooltip/tooltip-store.d.ts +6 -4
- package/cjs/utils/misc.cjs +2 -2
- package/cjs/utils/store.cjs +3 -3
- package/esm/__chunks/{MYUKSFP5.js → 22K762VQ.js} +13 -4
- package/esm/__chunks/{AKMSZ36N.js → AF6IUUFN.js} +3 -3
- package/esm/__chunks/{K6ELJFXN.js → EAHJFCU4.js} +1 -1
- package/esm/__chunks/{VEUNYQYR.js → IERTEJ3A.js} +3 -3
- package/esm/__chunks/{QJ5CUA32.js → SOLWE6E5.js} +3 -3
- package/esm/__chunks/{25MEC56I.js → SX2XFD6A.js} +1 -1
- package/esm/__chunks/{UUFF4PQ6.js → XU3EOSCU.js} +3 -3
- package/esm/__chunks/{I2VQ3XGR.js → Y3OOHFCN.js} +3 -0
- package/esm/__chunks/{L5RYKTVQ.js → Z5IGYIPT.js} +2 -2
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/collection/collection-store.js +3 -3
- package/esm/combobox/combobox-store.js +7 -7
- package/esm/composite/composite-overflow-store.js +5 -5
- package/esm/composite/composite-store.js +4 -4
- package/esm/dialog/dialog-store.js +4 -4
- package/esm/disclosure/disclosure-store.js +3 -3
- package/esm/form/form-store.d.ts +1 -1
- package/esm/form/form-store.js +3 -3
- package/esm/hovercard/hovercard-store.d.ts +14 -7
- package/esm/hovercard/hovercard-store.js +6 -6
- package/esm/menu/menu-bar-store.js +5 -5
- package/esm/menu/menu-store.d.ts +16 -7
- package/esm/menu/menu-store.js +8 -8
- package/esm/menubar/menubar-store.js +5 -5
- package/esm/popover/popover-store.d.ts +31 -6
- package/esm/popover/popover-store.js +5 -5
- package/esm/radio/radio-store.d.ts +2 -1
- package/esm/radio/radio-store.js +4 -4
- package/esm/select/select-store.d.ts +2 -1
- package/esm/select/select-store.js +7 -7
- package/esm/tab/tab-store.d.ts +5 -11
- package/esm/tab/tab-store.js +4 -4
- package/esm/toolbar/toolbar-store.d.ts +2 -6
- package/esm/toolbar/toolbar-store.js +4 -4
- package/esm/tooltip/tooltip-store.d.ts +6 -4
- package/esm/tooltip/tooltip-store.js +6 -6
- package/esm/utils/misc.js +1 -1
- package/esm/utils/store.js +2 -2
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
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 _E53JW5BDcjs = require('../__chunks/E53JW5BD.cjs');
|
|
5
|
+
require('../__chunks/I3Y4EXEF.cjs');
|
|
6
|
+
require('../__chunks/OTVLDMN2.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../__chunks/
|
|
9
|
+
var _BFE5R4EZcjs = require('../__chunks/BFE5R4EZ.cjs');
|
|
10
|
+
require('../__chunks/MI6NUQYQ.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _F6HPKLO2cjs = require('../__chunks/F6HPKLO2.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _KBNYGXWIcjs = require('../__chunks/KBNYGXWI.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -33,48 +33,48 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
33
33
|
var isSafariOnMobile = _YIUPKKEKcjs.isSafari.call(void 0, ) && _YIUPKKEKcjs.isTouchDevice.call(void 0, );
|
|
34
34
|
function createComboboxStore(props = {}) {
|
|
35
35
|
var _a;
|
|
36
|
-
|
|
36
|
+
_F6HPKLO2cjs.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 = _KBNYGXWIcjs.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 = _BFE5R4EZcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
45
45
|
activeId,
|
|
46
|
-
includesBaseElement:
|
|
46
|
+
includesBaseElement: _KBNYGXWIcjs.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: _KBNYGXWIcjs.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: _KBNYGXWIcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
|
|
57
|
+
focusWrap: _KBNYGXWIcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
|
|
58
|
+
virtualFocus: _KBNYGXWIcjs.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 = _E53JW5BDcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
65
|
+
placement: _KBNYGXWIcjs.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 = _KBNYGXWIcjs.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 = _KBNYGXWIcjs.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: _KBNYGXWIcjs.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: _KBNYGXWIcjs.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 = _F6HPKLO2cjs.createStore.call(void 0, initialState, composite, popover, props.store);
|
|
100
|
+
_F6HPKLO2cjs.setup.call(void 0,
|
|
101
101
|
combobox,
|
|
102
|
-
() =>
|
|
102
|
+
() => _F6HPKLO2cjs.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
|
+
_F6HPKLO2cjs.setup.call(void 0,
|
|
111
111
|
combobox,
|
|
112
|
-
() =>
|
|
112
|
+
() => _F6HPKLO2cjs.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
|
+
_F6HPKLO2cjs.setup.call(void 0,
|
|
119
119
|
combobox,
|
|
120
|
-
() =>
|
|
120
|
+
() => _F6HPKLO2cjs.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
|
+
_F6HPKLO2cjs.setup.call(void 0,
|
|
128
128
|
combobox,
|
|
129
|
-
() =>
|
|
129
|
+
() => _F6HPKLO2cjs.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
|
+
_F6HPKLO2cjs.setup.call(void 0,
|
|
136
136
|
combobox,
|
|
137
|
-
() =>
|
|
137
|
+
() => _F6HPKLO2cjs.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 _E53JW5BDcjs = require('../__chunks/E53JW5BD.cjs');
|
|
5
|
+
require('../__chunks/I3Y4EXEF.cjs');
|
|
6
|
+
require('../__chunks/OTVLDMN2.cjs');
|
|
7
|
+
require('../__chunks/F6HPKLO2.cjs');
|
|
8
|
+
require('../__chunks/KBNYGXWI.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 _E53JW5BDcjs.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/
|
|
4
|
+
var _BFE5R4EZcjs = require('../__chunks/BFE5R4EZ.cjs');
|
|
5
|
+
require('../__chunks/MI6NUQYQ.cjs');
|
|
6
|
+
require('../__chunks/F6HPKLO2.cjs');
|
|
7
|
+
require('../__chunks/KBNYGXWI.cjs');
|
|
8
8
|
require('../__chunks/5F4DVUNS.cjs');
|
|
9
9
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
10
10
|
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createCompositeStore =
|
|
13
|
+
exports.createCompositeStore = _BFE5R4EZcjs.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 _I3Y4EXEFcjs = require('../__chunks/I3Y4EXEF.cjs');
|
|
5
|
+
require('../__chunks/OTVLDMN2.cjs');
|
|
6
|
+
require('../__chunks/F6HPKLO2.cjs');
|
|
7
|
+
require('../__chunks/KBNYGXWI.cjs');
|
|
8
8
|
require('../__chunks/AV6KTKLE.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.createDialogStore =
|
|
11
|
+
exports.createDialogStore = _I3Y4EXEFcjs.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 _OTVLDMN2cjs = require('../__chunks/OTVLDMN2.cjs');
|
|
5
|
+
require('../__chunks/F6HPKLO2.cjs');
|
|
6
|
+
require('../__chunks/KBNYGXWI.cjs');
|
|
7
7
|
require('../__chunks/AV6KTKLE.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createDisclosureStore =
|
|
10
|
+
exports.createDisclosureStore = _OTVLDMN2cjs.createDisclosureStore;
|
package/cjs/form/form-store.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _MI6NUQYQcjs = require('../__chunks/MI6NUQYQ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _F6HPKLO2cjs = require('../__chunks/F6HPKLO2.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _KBNYGXWIcjs = require('../__chunks/KBNYGXWI.cjs');
|
|
17
17
|
require('../__chunks/5F4DVUNS.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
@@ -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 (_KBNYGXWIcjs.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 = _KBNYGXWIcjs.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) || _KBNYGXWIcjs.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 (_KBNYGXWIcjs.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 (_KBNYGXWIcjs.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
|
+
_F6HPKLO2cjs.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 = _MI6NUQYQcjs.createCollectionStore.call(void 0, props);
|
|
120
|
+
const values = _KBNYGXWIcjs.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 = _KBNYGXWIcjs.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 = _KBNYGXWIcjs.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: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.validating, false),
|
|
143
|
+
submitting: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitting, false),
|
|
144
|
+
submitSucceed: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitSucceed, 0),
|
|
145
|
+
submitFailed: _KBNYGXWIcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
|
|
146
146
|
valid: !hasMessages(errors)
|
|
147
147
|
});
|
|
148
|
-
const form =
|
|
148
|
+
const form = _F6HPKLO2cjs.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 = _F6HPKLO2cjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
|
|
156
|
+
_F6HPKLO2cjs.setup.call(void 0, form, () => _F6HPKLO2cjs.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 = _KBNYGXWIcjs.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 = _KBNYGXWIcjs.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 = _KBNYGXWIcjs.applyState.call(void 0, value, prevValue);
|
|
208
208
|
if (nextValue === prevValue)
|
|
209
209
|
return touched2;
|
|
210
210
|
return set(touched2, name, nextValue);
|
|
@@ -61,7 +61,7 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
|
|
|
61
61
|
}
|
|
62
62
|
export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues> extends CollectionStoreFunctions<FormStoreItem> {
|
|
63
63
|
/**
|
|
64
|
-
* An object containing the names of the form fields for type
|
|
64
|
+
* An object containing the names of the form fields for type safety.
|
|
65
65
|
*
|
|
66
66
|
* Live examples:
|
|
67
67
|
* - [FormRadio](https://ariakit.org/examples/form-radio)
|
package/cjs/form/form-store.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
|
|
|
61
61
|
}
|
|
62
62
|
export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues> extends CollectionStoreFunctions<FormStoreItem> {
|
|
63
63
|
/**
|
|
64
|
-
* An object containing the names of the form fields for type
|
|
64
|
+
* An object containing the names of the form fields for type safety.
|
|
65
65
|
*
|
|
66
66
|
* Live examples:
|
|
67
67
|
* - [FormRadio](https://ariakit.org/examples/form-radio)
|
|
@@ -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 _TQTGWD5Kcjs = require('../__chunks/TQTGWD5K.cjs');
|
|
5
|
+
require('../__chunks/E53JW5BD.cjs');
|
|
6
|
+
require('../__chunks/I3Y4EXEF.cjs');
|
|
7
|
+
require('../__chunks/OTVLDMN2.cjs');
|
|
8
|
+
require('../__chunks/F6HPKLO2.cjs');
|
|
9
|
+
require('../__chunks/KBNYGXWI.cjs');
|
|
10
10
|
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createHovercardStore =
|
|
13
|
+
exports.createHovercardStore = _TQTGWD5Kcjs.createHovercardStore;
|
|
@@ -12,14 +12,16 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
12
12
|
placement: PopoverStoreState["placement"];
|
|
13
13
|
/**
|
|
14
14
|
* The amount of time in milliseconds to wait before showing and hiding the
|
|
15
|
-
*
|
|
16
|
-
* `showTimeout`
|
|
15
|
+
* popup. To control the delay for showing and hiding separately, use
|
|
16
|
+
* [`showTimeout`](https://ariakit.org/reference/hovercard-provider#showtimeout)
|
|
17
|
+
* and
|
|
18
|
+
* [`hideTimeout`](https://ariakit.org/reference/hovercard-provider#hidetimeout).
|
|
17
19
|
* @default 500
|
|
18
20
|
*/
|
|
19
21
|
timeout: number;
|
|
20
22
|
/**
|
|
21
|
-
* The amount of time in milliseconds to wait before
|
|
22
|
-
*
|
|
23
|
+
* The amount of time in milliseconds to wait before _showing_ the popup. It
|
|
24
|
+
* defaults to the value passed to
|
|
23
25
|
* [`timeout`](https://ariakit.org/reference/hovercard-provider#timeout).
|
|
24
26
|
*
|
|
25
27
|
* Live examples:
|
|
@@ -29,16 +31,18 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
29
31
|
*/
|
|
30
32
|
showTimeout?: number;
|
|
31
33
|
/**
|
|
32
|
-
* The amount of time in milliseconds to wait before
|
|
33
|
-
*
|
|
34
|
+
* The amount of time in milliseconds to wait before _hiding_ the popup. It
|
|
35
|
+
* defaults to the value passed to
|
|
34
36
|
* [`timeout`](https://ariakit.org/reference/hovercard-provider#timeout).
|
|
35
37
|
*
|
|
36
38
|
* Live examples:
|
|
37
39
|
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
40
|
+
* - [Tooltip with Framer
|
|
41
|
+
* Motion](https://ariakit.org/examples/tooltip-framer-motion)
|
|
38
42
|
*/
|
|
39
43
|
hideTimeout?: number;
|
|
40
44
|
/**
|
|
41
|
-
* Whether the
|
|
45
|
+
* Whether the popup or an element inside it should be focused when it is
|
|
42
46
|
* shown.
|
|
43
47
|
* @default false
|
|
44
48
|
*/
|
|
@@ -47,6 +51,9 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
47
51
|
export interface HovercardStoreFunctions extends PopoverStoreFunctions {
|
|
48
52
|
/**
|
|
49
53
|
* Sets the `autoFocusOnShow` state.
|
|
54
|
+
*
|
|
55
|
+
* Live examples:
|
|
56
|
+
* - [Sliding Menu](https://ariakit.org/examples/menu-slide)
|
|
50
57
|
*/
|
|
51
58
|
setAutoFocusOnShow: SetState<HovercardStoreState["autoFocusOnShow"]>;
|
|
52
59
|
}
|
|
@@ -12,14 +12,16 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
12
12
|
placement: PopoverStoreState["placement"];
|
|
13
13
|
/**
|
|
14
14
|
* The amount of time in milliseconds to wait before showing and hiding the
|
|
15
|
-
*
|
|
16
|
-
* `showTimeout`
|
|
15
|
+
* popup. To control the delay for showing and hiding separately, use
|
|
16
|
+
* [`showTimeout`](https://ariakit.org/reference/hovercard-provider#showtimeout)
|
|
17
|
+
* and
|
|
18
|
+
* [`hideTimeout`](https://ariakit.org/reference/hovercard-provider#hidetimeout).
|
|
17
19
|
* @default 500
|
|
18
20
|
*/
|
|
19
21
|
timeout: number;
|
|
20
22
|
/**
|
|
21
|
-
* The amount of time in milliseconds to wait before
|
|
22
|
-
*
|
|
23
|
+
* The amount of time in milliseconds to wait before _showing_ the popup. It
|
|
24
|
+
* defaults to the value passed to
|
|
23
25
|
* [`timeout`](https://ariakit.org/reference/hovercard-provider#timeout).
|
|
24
26
|
*
|
|
25
27
|
* Live examples:
|
|
@@ -29,16 +31,18 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
29
31
|
*/
|
|
30
32
|
showTimeout?: number;
|
|
31
33
|
/**
|
|
32
|
-
* The amount of time in milliseconds to wait before
|
|
33
|
-
*
|
|
34
|
+
* The amount of time in milliseconds to wait before _hiding_ the popup. It
|
|
35
|
+
* defaults to the value passed to
|
|
34
36
|
* [`timeout`](https://ariakit.org/reference/hovercard-provider#timeout).
|
|
35
37
|
*
|
|
36
38
|
* Live examples:
|
|
37
39
|
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
40
|
+
* - [Tooltip with Framer
|
|
41
|
+
* Motion](https://ariakit.org/examples/tooltip-framer-motion)
|
|
38
42
|
*/
|
|
39
43
|
hideTimeout?: number;
|
|
40
44
|
/**
|
|
41
|
-
* Whether the
|
|
45
|
+
* Whether the popup or an element inside it should be focused when it is
|
|
42
46
|
* shown.
|
|
43
47
|
* @default false
|
|
44
48
|
*/
|
|
@@ -47,6 +51,9 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
47
51
|
export interface HovercardStoreFunctions extends PopoverStoreFunctions {
|
|
48
52
|
/**
|
|
49
53
|
* Sets the `autoFocusOnShow` state.
|
|
54
|
+
*
|
|
55
|
+
* Live examples:
|
|
56
|
+
* - [Sliding Menu](https://ariakit.org/examples/menu-slide)
|
|
50
57
|
*/
|
|
51
58
|
setAutoFocusOnShow: SetState<HovercardStoreState["autoFocusOnShow"]>;
|
|
52
59
|
}
|
|
@@ -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/
|
|
4
|
+
var _NOFH2BLBcjs = require('../__chunks/NOFH2BLB.cjs');
|
|
5
|
+
require('../__chunks/BFE5R4EZ.cjs');
|
|
6
|
+
require('../__chunks/MI6NUQYQ.cjs');
|
|
7
|
+
require('../__chunks/F6HPKLO2.cjs');
|
|
8
|
+
require('../__chunks/KBNYGXWI.cjs');
|
|
9
9
|
require('../__chunks/5F4DVUNS.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 _NOFH2BLBcjs.createMenubarStore.call(void 0, props);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
|