@ariakit/core 0.2.6 → 0.2.8
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 +14 -0
- package/cjs/__chunks/{4Q3ZC7KF.cjs → DPHJ32KR.cjs} +17 -16
- package/cjs/__chunks/{O7U3LRFL.cjs → F5DMXFQ2.cjs} +37 -38
- package/cjs/__chunks/{5LY57557.cjs → FS2K2N7U.cjs} +84 -37
- package/cjs/__chunks/MCCIH6SG.cjs +41 -0
- package/cjs/__chunks/{WUNFMQBI.cjs → OQIG5VE3.cjs} +31 -31
- package/cjs/__chunks/{7JIMFSGQ.cjs → PIEJYPN7.cjs} +2 -2
- package/cjs/__chunks/{M6ZA7XUP.cjs → RCYVACJO.cjs} +2 -2
- package/cjs/__chunks/V7OHZPBO.cjs +76 -0
- package/cjs/checkbox/checkbox-store.cjs +6 -6
- package/cjs/collection/collection-store.cjs +5 -5
- package/cjs/combobox/combobox-store.cjs +67 -70
- package/cjs/combobox/combobox-store.d.ts +1 -1
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-store.cjs +6 -6
- package/cjs/dialog/dialog-store.cjs +6 -6
- package/cjs/disclosure/disclosure-store.cjs +5 -5
- package/cjs/form/form-store.cjs +24 -24
- package/cjs/hovercard/hovercard-store.cjs +8 -8
- package/cjs/index.cjs +1 -1
- package/cjs/menu/menu-bar-store.cjs +8 -8
- package/cjs/menu/menu-store.cjs +35 -34
- package/cjs/popover/popover-store.cjs +7 -7
- package/cjs/radio/radio-store.cjs +12 -12
- package/cjs/select/select-store.cjs +80 -82
- package/cjs/tab/tab-store.cjs +63 -64
- package/cjs/toolbar/toolbar-store.cjs +8 -8
- package/cjs/tooltip/tooltip-store.cjs +15 -15
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/array.cjs +1 -1
- package/cjs/utils/dom.cjs +1 -1
- package/cjs/utils/events.cjs +3 -3
- package/cjs/utils/focus.cjs +2 -2
- package/cjs/utils/misc.cjs +3 -3
- package/cjs/utils/platform.cjs +1 -1
- package/cjs/utils/store.cjs +18 -4
- package/cjs/utils/store.d.ts +19 -59
- package/cjs/utils/types.d.ts +4 -0
- package/esm/__chunks/{QEFBF7I4.js → A7IMXABC.js} +31 -32
- package/esm/__chunks/{TBCDDKVT.js → COUCUJML.js} +4 -4
- package/esm/__chunks/{4F3NSHNZ.js → LNMWV6UV.js} +1 -1
- package/esm/__chunks/{LK6LFO7X.js → OGOHEUXI.js} +73 -26
- package/esm/__chunks/{WFO54Y6U.js → ROY5BBHL.js} +17 -17
- package/esm/__chunks/{U5NFQJHX.js → SOCHV2LZ.js} +8 -7
- package/esm/__chunks/{3HOKSVPG.js → WSKDP2MG.js} +29 -33
- package/esm/__chunks/{NWU4GBZ6.js → WVTCK5PV.js} +1 -1
- package/esm/checkbox/checkbox-store.js +3 -3
- package/esm/collection/collection-store.js +4 -4
- package/esm/combobox/combobox-store.d.ts +1 -1
- package/esm/combobox/combobox-store.js +52 -55
- package/esm/composite/composite-overflow-store.js +6 -6
- package/esm/composite/composite-store.js +5 -5
- package/esm/dialog/dialog-store.js +5 -5
- package/esm/disclosure/disclosure-store.js +4 -4
- package/esm/form/form-store.js +4 -4
- package/esm/hovercard/hovercard-store.js +7 -7
- package/esm/index.js +1 -1
- package/esm/menu/menu-bar-store.js +5 -5
- package/esm/menu/menu-store.js +22 -21
- package/esm/popover/popover-store.js +6 -6
- package/esm/radio/radio-store.js +5 -5
- package/esm/select/select-store.js +64 -66
- package/esm/tab/tab-store.js +55 -56
- package/esm/toolbar/toolbar-store.js +5 -5
- package/esm/tooltip/tooltip-store.js +7 -7
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/array.js +1 -1
- package/esm/utils/dom.js +1 -1
- package/esm/utils/events.js +1 -1
- package/esm/utils/focus.js +1 -1
- package/esm/utils/misc.js +2 -2
- package/esm/utils/platform.js +1 -1
- package/esm/utils/store.d.ts +19 -59
- package/esm/utils/store.js +19 -5
- package/esm/utils/types.d.ts +4 -0
- package/package.json +1 -1
- package/cjs/__chunks/IRBRPEUG.cjs +0 -80
- package/cjs/__chunks/XBF2IZLR.cjs +0 -41
- /package/cjs/__chunks/{6455U47T.cjs → 72I2GWXF.cjs} +0 -0
- /package/esm/__chunks/{4BKCJXBM.js → PNRLI7OV.js} +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _FS2K2N7Ucjs = require('./FS2K2N7U.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
15
|
+
|
|
16
|
+
// src/disclosure/disclosure-store.ts
|
|
17
|
+
function createDisclosureStore(props = {}) {
|
|
18
|
+
const store = _FS2K2N7Ucjs.mergeStore.call(void 0,
|
|
19
|
+
props.store,
|
|
20
|
+
_FS2K2N7Ucjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
|
|
21
|
+
);
|
|
22
|
+
const syncState = store == null ? void 0 : store.getState();
|
|
23
|
+
const open = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
24
|
+
props.open,
|
|
25
|
+
syncState == null ? void 0 : syncState.open,
|
|
26
|
+
props.defaultOpen,
|
|
27
|
+
false
|
|
28
|
+
);
|
|
29
|
+
const animated = _RCYVACJOcjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
|
|
30
|
+
const initialState = {
|
|
31
|
+
open,
|
|
32
|
+
animated,
|
|
33
|
+
animating: !!animated && open,
|
|
34
|
+
mounted: open,
|
|
35
|
+
contentElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
|
|
36
|
+
disclosureElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
|
|
37
|
+
};
|
|
38
|
+
const disclosure = _FS2K2N7Ucjs.createStore.call(void 0, initialState, store);
|
|
39
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
40
|
+
disclosure,
|
|
41
|
+
() => _FS2K2N7Ucjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
|
|
42
|
+
if (state.animated)
|
|
43
|
+
return;
|
|
44
|
+
disclosure.setState("animating", false);
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
48
|
+
disclosure,
|
|
49
|
+
() => _FS2K2N7Ucjs.sync.call(void 0, disclosure, ["open", "animated"], (state, prev) => {
|
|
50
|
+
if (!state.animated)
|
|
51
|
+
return;
|
|
52
|
+
const mounting = state === prev;
|
|
53
|
+
const animating = mounting ? state.open : state.open !== prev.open;
|
|
54
|
+
disclosure.setState("animating", animating);
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
58
|
+
disclosure,
|
|
59
|
+
() => _FS2K2N7Ucjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
|
|
60
|
+
disclosure.setState("mounted", state.open || state.animating);
|
|
61
|
+
})
|
|
62
|
+
);
|
|
63
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, disclosure), {
|
|
64
|
+
setOpen: (value) => disclosure.setState("open", value),
|
|
65
|
+
show: () => disclosure.setState("open", true),
|
|
66
|
+
hide: () => disclosure.setState("open", false),
|
|
67
|
+
toggle: () => disclosure.setState("open", (open2) => !open2),
|
|
68
|
+
stopAnimation: () => disclosure.setState("animating", false),
|
|
69
|
+
setContentElement: (value) => disclosure.setState("contentElement", value),
|
|
70
|
+
setDisclosureElement: (value) => disclosure.setState("disclosureElement", value)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
exports.createDisclosureStore = createDisclosureStore;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _FS2K2N7Ucjs = require('../__chunks/FS2K2N7U.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _72I2GWXFcjs = require('../__chunks/72I2GWXF.cjs');
|
|
11
11
|
|
|
12
12
|
// src/checkbox/checkbox-store.ts
|
|
13
13
|
function createCheckboxStore(props = {}) {
|
|
14
14
|
var _a;
|
|
15
15
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
16
16
|
const initialState = {
|
|
17
|
-
value:
|
|
17
|
+
value: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
18
18
|
props.value,
|
|
19
19
|
syncState == null ? void 0 : syncState.value,
|
|
20
20
|
props.defaultValue,
|
|
21
21
|
false
|
|
22
22
|
)
|
|
23
23
|
};
|
|
24
|
-
const checkbox =
|
|
25
|
-
return
|
|
24
|
+
const checkbox = _FS2K2N7Ucjs.createStore.call(void 0, initialState, props.store);
|
|
25
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, checkbox), {
|
|
26
26
|
setValue: (value) => checkbox.setState("value", value)
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _F5DMXFQ2cjs = require('../__chunks/F5DMXFQ2.cjs');
|
|
4
|
+
require('../__chunks/FS2K2N7U.cjs');
|
|
5
|
+
require('../__chunks/RCYVACJO.cjs');
|
|
6
6
|
require('../__chunks/EXM2AW52.cjs');
|
|
7
|
-
require('../__chunks/
|
|
7
|
+
require('../__chunks/72I2GWXF.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createCollectionStore =
|
|
10
|
+
exports.createCollectionStore = _F5DMXFQ2cjs.createCollectionStore;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _DPHJ32KRcjs = require('../__chunks/DPHJ32KR.cjs');
|
|
4
|
+
require('../__chunks/PIEJYPN7.cjs');
|
|
5
|
+
require('../__chunks/V7OHZPBO.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../__chunks/
|
|
8
|
+
var _OQIG5VE3cjs = require('../__chunks/OQIG5VE3.cjs');
|
|
9
|
+
require('../__chunks/F5DMXFQ2.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var _5LY57557cjs = require('../__chunks/5LY57557.cjs');
|
|
14
13
|
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _FS2K2N7Ucjs = require('../__chunks/FS2K2N7U.cjs');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
|
|
17
21
|
|
|
18
22
|
|
|
19
23
|
|
|
@@ -24,7 +28,7 @@ require('../__chunks/GDZQUFNP.cjs');
|
|
|
24
28
|
|
|
25
29
|
|
|
26
30
|
|
|
27
|
-
var
|
|
31
|
+
var _72I2GWXFcjs = require('../__chunks/72I2GWXF.cjs');
|
|
28
32
|
|
|
29
33
|
// src/combobox/combobox-store.ts
|
|
30
34
|
var isSafariOnMobile = _EIRIJC7Tcjs.isSafari.call(void 0, ) && _EIRIJC7Tcjs.isTouchDevice.call(void 0, );
|
|
@@ -32,21 +36,22 @@ function createComboboxStore(_a = {}) {
|
|
|
32
36
|
var _b = _a, {
|
|
33
37
|
menu,
|
|
34
38
|
select
|
|
35
|
-
} = _b, props =
|
|
39
|
+
} = _b, props = _72I2GWXFcjs.__objRest.call(void 0, _b, [
|
|
36
40
|
"menu",
|
|
37
41
|
"select"
|
|
38
42
|
]);
|
|
39
|
-
const store =
|
|
43
|
+
const store = _FS2K2N7Ucjs.mergeStore.call(void 0,
|
|
40
44
|
props.store,
|
|
41
|
-
|
|
45
|
+
_FS2K2N7Ucjs.omit.call(void 0, menu, [
|
|
42
46
|
"baseElement",
|
|
43
47
|
"arrowElement",
|
|
44
48
|
"anchorElement",
|
|
45
49
|
"contentElement",
|
|
46
50
|
"popoverElement",
|
|
47
|
-
"disclosureElement"
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
"disclosureElement",
|
|
52
|
+
"anchorElement"
|
|
53
|
+
]),
|
|
54
|
+
_FS2K2N7Ucjs.omit.call(void 0, select, [
|
|
50
55
|
"value",
|
|
51
56
|
"items",
|
|
52
57
|
"renderedItems",
|
|
@@ -56,106 +61,98 @@ function createComboboxStore(_a = {}) {
|
|
|
56
61
|
"contentElement",
|
|
57
62
|
"popoverElement",
|
|
58
63
|
"disclosureElement"
|
|
59
|
-
)
|
|
64
|
+
])
|
|
60
65
|
);
|
|
61
66
|
const syncState = store.getState();
|
|
62
|
-
const activeId =
|
|
67
|
+
const activeId = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
63
68
|
props.activeId,
|
|
64
69
|
syncState.activeId,
|
|
65
70
|
props.defaultActiveId,
|
|
66
71
|
null
|
|
67
72
|
);
|
|
68
|
-
const composite =
|
|
73
|
+
const composite = _OQIG5VE3cjs.createCompositeStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
69
74
|
store,
|
|
70
75
|
activeId,
|
|
71
|
-
includesBaseElement:
|
|
76
|
+
includesBaseElement: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
72
77
|
props.includesBaseElement,
|
|
73
78
|
syncState.includesBaseElement,
|
|
74
79
|
true
|
|
75
80
|
),
|
|
76
|
-
orientation:
|
|
81
|
+
orientation: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
77
82
|
props.orientation,
|
|
78
83
|
syncState.orientation,
|
|
79
84
|
"vertical"
|
|
80
85
|
),
|
|
81
|
-
focusLoop:
|
|
82
|
-
focusWrap:
|
|
83
|
-
virtualFocus:
|
|
86
|
+
focusLoop: _RCYVACJOcjs.defaultValue.call(void 0, props.focusLoop, syncState.focusLoop, true),
|
|
87
|
+
focusWrap: _RCYVACJOcjs.defaultValue.call(void 0, props.focusWrap, syncState.focusWrap, true),
|
|
88
|
+
virtualFocus: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
84
89
|
props.virtualFocus,
|
|
85
90
|
syncState == null ? void 0 : syncState.virtualFocus,
|
|
86
91
|
!isSafariOnMobile
|
|
87
92
|
)
|
|
88
93
|
}));
|
|
89
|
-
const popover =
|
|
94
|
+
const popover = _DPHJ32KRcjs.createPopoverStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
90
95
|
store,
|
|
91
|
-
placement:
|
|
96
|
+
placement: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
92
97
|
props.placement,
|
|
93
98
|
syncState.placement,
|
|
94
99
|
"bottom-start"
|
|
95
100
|
)
|
|
96
101
|
}));
|
|
97
|
-
const initialValue =
|
|
102
|
+
const initialValue = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
98
103
|
props.value,
|
|
99
104
|
syncState.value,
|
|
100
105
|
props.defaultValue,
|
|
101
106
|
""
|
|
102
107
|
);
|
|
103
|
-
const initialState =
|
|
108
|
+
const initialState = _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
|
|
104
109
|
value: initialValue,
|
|
105
|
-
resetValueOnHide:
|
|
110
|
+
resetValueOnHide: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
106
111
|
props.resetValueOnHide,
|
|
107
112
|
syncState.resetValueOnHide,
|
|
108
113
|
false
|
|
109
114
|
),
|
|
110
115
|
activeValue: syncState.activeValue
|
|
111
116
|
});
|
|
112
|
-
const combobox =
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
["resetValueOnHide", "mounted"]
|
|
123
|
-
)
|
|
117
|
+
const combobox = _FS2K2N7Ucjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
118
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
119
|
+
combobox,
|
|
120
|
+
() => _FS2K2N7Ucjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
|
|
121
|
+
if (!state.resetValueOnHide)
|
|
122
|
+
return;
|
|
123
|
+
if (state.mounted)
|
|
124
|
+
return;
|
|
125
|
+
combobox.setState("value", initialValue);
|
|
126
|
+
})
|
|
124
127
|
);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
["mounted"]
|
|
134
|
-
)
|
|
128
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
129
|
+
combobox,
|
|
130
|
+
() => _FS2K2N7Ucjs.batch.call(void 0, combobox, ["mounted"], (state) => {
|
|
131
|
+
if (state.mounted)
|
|
132
|
+
return;
|
|
133
|
+
combobox.setState("activeId", activeId);
|
|
134
|
+
combobox.setState("moves", 0);
|
|
135
|
+
})
|
|
135
136
|
);
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
["moves", "activeId"]
|
|
144
|
-
)
|
|
137
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
138
|
+
combobox,
|
|
139
|
+
() => _FS2K2N7Ucjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
|
|
140
|
+
if (state.moves === prevState.moves) {
|
|
141
|
+
combobox.setState("activeValue", void 0);
|
|
142
|
+
}
|
|
143
|
+
})
|
|
145
144
|
);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
["moves", "renderedItems"]
|
|
156
|
-
)
|
|
145
|
+
_FS2K2N7Ucjs.setup.call(void 0,
|
|
146
|
+
combobox,
|
|
147
|
+
() => _FS2K2N7Ucjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
|
|
148
|
+
if (state.moves === prev.moves)
|
|
149
|
+
return;
|
|
150
|
+
const { activeId: activeId2 } = combobox.getState();
|
|
151
|
+
const activeItem = composite.item(activeId2);
|
|
152
|
+
combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
|
|
153
|
+
})
|
|
157
154
|
);
|
|
158
|
-
return
|
|
155
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, popover), composite), combobox), {
|
|
159
156
|
setValue: (value) => combobox.setState("value", value)
|
|
160
157
|
});
|
|
161
158
|
}
|
|
@@ -23,7 +23,7 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
23
23
|
* Live examples:
|
|
24
24
|
* - [ComboboxGroup](https://ariakit.org/examples/combobox-group)
|
|
25
25
|
* - [Combobox with links](https://ariakit.org/examples/combobox-links)
|
|
26
|
-
* - [
|
|
26
|
+
* - [Combobox filtering](https://ariakit.org/examples/combobox-filtering)
|
|
27
27
|
* - [Multi-selectable
|
|
28
28
|
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
29
29
|
* - [Textarea with inline
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
3
|
+
var _DPHJ32KRcjs = require('../__chunks/DPHJ32KR.cjs');
|
|
4
|
+
require('../__chunks/PIEJYPN7.cjs');
|
|
5
|
+
require('../__chunks/V7OHZPBO.cjs');
|
|
6
|
+
require('../__chunks/FS2K2N7U.cjs');
|
|
7
|
+
require('../__chunks/RCYVACJO.cjs');
|
|
8
|
+
require('../__chunks/72I2GWXF.cjs');
|
|
9
9
|
|
|
10
10
|
// src/composite/composite-overflow-store.ts
|
|
11
11
|
function createCompositeOverflowStore(props = {}) {
|
|
12
|
-
return
|
|
12
|
+
return _DPHJ32KRcjs.createPopoverStore.call(void 0, props);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
3
|
+
var _OQIG5VE3cjs = require('../__chunks/OQIG5VE3.cjs');
|
|
4
|
+
require('../__chunks/F5DMXFQ2.cjs');
|
|
5
|
+
require('../__chunks/FS2K2N7U.cjs');
|
|
6
|
+
require('../__chunks/RCYVACJO.cjs');
|
|
7
7
|
require('../__chunks/EXM2AW52.cjs');
|
|
8
8
|
require('../__chunks/GDZQUFNP.cjs');
|
|
9
|
-
require('../__chunks/
|
|
9
|
+
require('../__chunks/72I2GWXF.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createCompositeStore =
|
|
12
|
+
exports.createCompositeStore = _OQIG5VE3cjs.createCompositeStore;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
3
|
+
var _PIEJYPN7cjs = require('../__chunks/PIEJYPN7.cjs');
|
|
4
|
+
require('../__chunks/V7OHZPBO.cjs');
|
|
5
|
+
require('../__chunks/FS2K2N7U.cjs');
|
|
6
|
+
require('../__chunks/RCYVACJO.cjs');
|
|
7
|
+
require('../__chunks/72I2GWXF.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createDialogStore =
|
|
10
|
+
exports.createDialogStore = _PIEJYPN7cjs.createDialogStore;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
3
|
+
var _V7OHZPBOcjs = require('../__chunks/V7OHZPBO.cjs');
|
|
4
|
+
require('../__chunks/FS2K2N7U.cjs');
|
|
5
|
+
require('../__chunks/RCYVACJO.cjs');
|
|
6
|
+
require('../__chunks/72I2GWXF.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.createDisclosureStore =
|
|
9
|
+
exports.createDisclosureStore = _V7OHZPBOcjs.createDisclosureStore;
|
package/cjs/form/form-store.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _F5DMXFQ2cjs = require('../__chunks/F5DMXFQ2.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _FS2K2N7Ucjs = require('../__chunks/FS2K2N7U.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
|
|
13
13
|
require('../__chunks/EXM2AW52.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _72I2GWXFcjs = require('../__chunks/72I2GWXF.cjs');
|
|
18
18
|
|
|
19
19
|
// src/form/form-store.ts
|
|
20
20
|
function nextFrame() {
|
|
@@ -22,7 +22,7 @@ function nextFrame() {
|
|
|
22
22
|
}
|
|
23
23
|
function hasMessages(object) {
|
|
24
24
|
return Object.keys(object).some((key) => {
|
|
25
|
-
if (
|
|
25
|
+
if (_RCYVACJOcjs.isObject.call(void 0, object[key])) {
|
|
26
26
|
return hasMessages(object[key]);
|
|
27
27
|
}
|
|
28
28
|
return !!object[key];
|
|
@@ -44,10 +44,10 @@ function set(values, path, value) {
|
|
|
44
44
|
if (k == null)
|
|
45
45
|
return values;
|
|
46
46
|
const key = k;
|
|
47
|
-
const isIntegerKey =
|
|
47
|
+
const isIntegerKey = _RCYVACJOcjs.isInteger.call(void 0, key);
|
|
48
48
|
const nextValues = isIntegerKey ? values || [] : values || {};
|
|
49
49
|
const nestedValues = nextValues[key];
|
|
50
|
-
const result = rest.length && (Array.isArray(nestedValues) ||
|
|
50
|
+
const result = rest.length && (Array.isArray(nestedValues) || _RCYVACJOcjs.isObject.call(void 0, nestedValues)) ? set(nestedValues, rest, value) : value;
|
|
51
51
|
if (isIntegerKey) {
|
|
52
52
|
const index = Number(key);
|
|
53
53
|
if (values) {
|
|
@@ -61,7 +61,7 @@ function set(values, path, value) {
|
|
|
61
61
|
nextValues2[index] = result;
|
|
62
62
|
return nextValues2;
|
|
63
63
|
}
|
|
64
|
-
return
|
|
64
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, values), { [key]: result });
|
|
65
65
|
}
|
|
66
66
|
function setAll(values, value) {
|
|
67
67
|
const result = {};
|
|
@@ -70,12 +70,12 @@ function setAll(values, value) {
|
|
|
70
70
|
const currentValue = values[key];
|
|
71
71
|
if (Array.isArray(currentValue)) {
|
|
72
72
|
result[key] = currentValue.map((v) => {
|
|
73
|
-
if (
|
|
73
|
+
if (_RCYVACJOcjs.isObject.call(void 0, v)) {
|
|
74
74
|
return setAll(v, value);
|
|
75
75
|
}
|
|
76
76
|
return value;
|
|
77
77
|
});
|
|
78
|
-
} else if (
|
|
78
|
+
} else if (_RCYVACJOcjs.isObject.call(void 0, currentValue)) {
|
|
79
79
|
result[key] = setAll(currentValue, value);
|
|
80
80
|
} else {
|
|
81
81
|
result[key] = value;
|
|
@@ -108,36 +108,36 @@ function createNames() {
|
|
|
108
108
|
function createFormStore(props = {}) {
|
|
109
109
|
var _a;
|
|
110
110
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
111
|
-
const collection =
|
|
112
|
-
const values =
|
|
111
|
+
const collection = _F5DMXFQ2cjs.createCollectionStore.call(void 0, props);
|
|
112
|
+
const values = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
113
113
|
props.values,
|
|
114
114
|
syncState == null ? void 0 : syncState.values,
|
|
115
115
|
props.defaultValues,
|
|
116
116
|
{}
|
|
117
117
|
);
|
|
118
|
-
const errors =
|
|
118
|
+
const errors = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
119
119
|
props.errors,
|
|
120
120
|
syncState == null ? void 0 : syncState.errors,
|
|
121
121
|
props.defaultErrors,
|
|
122
122
|
{}
|
|
123
123
|
);
|
|
124
|
-
const touched =
|
|
124
|
+
const touched = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
125
125
|
props.touched,
|
|
126
126
|
syncState == null ? void 0 : syncState.touched,
|
|
127
127
|
props.defaultTouched,
|
|
128
128
|
{}
|
|
129
129
|
);
|
|
130
|
-
const initialState =
|
|
130
|
+
const initialState = _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, collection.getState()), {
|
|
131
131
|
values,
|
|
132
132
|
errors,
|
|
133
133
|
touched,
|
|
134
|
-
validating:
|
|
135
|
-
submitting:
|
|
136
|
-
submitSucceed:
|
|
137
|
-
submitFailed:
|
|
134
|
+
validating: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.validating, false),
|
|
135
|
+
submitting: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitting, false),
|
|
136
|
+
submitSucceed: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitSucceed, 0),
|
|
137
|
+
submitFailed: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
|
|
138
138
|
valid: !hasMessages(errors)
|
|
139
139
|
});
|
|
140
|
-
const form =
|
|
140
|
+
const form = _FS2K2N7Ucjs.createStore.call(void 0, initialState, collection, props.store);
|
|
141
141
|
const validateCallbacks = /* @__PURE__ */ new Set();
|
|
142
142
|
const submitCallbacks = /* @__PURE__ */ new Set();
|
|
143
143
|
const validate = async () => {
|
|
@@ -153,13 +153,13 @@ function createFormStore(props = {}) {
|
|
|
153
153
|
form.setState("validating", false);
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
|
-
return
|
|
156
|
+
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, collection), form), {
|
|
157
157
|
names: createNames(),
|
|
158
158
|
setValues: (values2) => form.setState("values", values2),
|
|
159
159
|
getValue: (name) => get(form.getState().values, name),
|
|
160
160
|
setValue: (name, value) => form.setState("values", (values2) => {
|
|
161
161
|
const prevValue = get(values2, name);
|
|
162
|
-
const nextValue =
|
|
162
|
+
const nextValue = _RCYVACJOcjs.applyState.call(void 0, value, prevValue);
|
|
163
163
|
if (nextValue === prevValue)
|
|
164
164
|
return values2;
|
|
165
165
|
return set(values2, name, nextValue);
|
|
@@ -180,7 +180,7 @@ function createFormStore(props = {}) {
|
|
|
180
180
|
getError: (name) => get(form.getState().errors, name),
|
|
181
181
|
setError: (name, error) => form.setState("errors", (errors2) => {
|
|
182
182
|
const prevError = get(errors2, name);
|
|
183
|
-
const nextError =
|
|
183
|
+
const nextError = _RCYVACJOcjs.applyState.call(void 0, error, prevError);
|
|
184
184
|
if (nextError === prevError)
|
|
185
185
|
return errors2;
|
|
186
186
|
return set(errors2, name, nextError);
|
|
@@ -189,7 +189,7 @@ function createFormStore(props = {}) {
|
|
|
189
189
|
getFieldTouched: (name) => !!get(form.getState().touched, name),
|
|
190
190
|
setFieldTouched: (name, value) => form.setState("touched", (touched2) => {
|
|
191
191
|
const prevValue = get(touched2, name);
|
|
192
|
-
const nextValue =
|
|
192
|
+
const nextValue = _RCYVACJOcjs.applyState.call(void 0, value, prevValue);
|
|
193
193
|
if (nextValue === prevValue)
|
|
194
194
|
return touched2;
|
|
195
195
|
return set(touched2, name, nextValue);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/
|
|
3
|
+
var _MCCIH6SGcjs = require('../__chunks/MCCIH6SG.cjs');
|
|
4
|
+
require('../__chunks/DPHJ32KR.cjs');
|
|
5
|
+
require('../__chunks/PIEJYPN7.cjs');
|
|
6
|
+
require('../__chunks/V7OHZPBO.cjs');
|
|
7
|
+
require('../__chunks/FS2K2N7U.cjs');
|
|
8
|
+
require('../__chunks/RCYVACJO.cjs');
|
|
9
|
+
require('../__chunks/72I2GWXF.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createHovercardStore =
|
|
12
|
+
exports.createHovercardStore = _MCCIH6SGcjs.createHovercardStore;
|
package/cjs/index.cjs
CHANGED