@ariakit/core 0.3.1 → 0.3.3
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/{7GWXP6CQ.cjs → A4GDJCZB.cjs} +25 -12
- package/cjs/__chunks/{52LQV3SV.cjs → A7K3KZJL.cjs} +14 -15
- package/cjs/__chunks/{GHET3DES.cjs → DFFIYGBS.cjs} +2 -2
- package/cjs/__chunks/{ZRCUNIY2.cjs → NEBQQIUX.cjs} +4 -4
- package/cjs/__chunks/{4OD4ZFRG.cjs → TTWS4MDC.cjs} +6 -6
- package/cjs/__chunks/{4L3HCXJY.cjs → W5IQT6Z2.cjs} +6 -6
- package/cjs/__chunks/{AIHTEA5D.cjs → ZYIEFAMB.cjs} +7 -7
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/collection/collection-store.cjs +3 -3
- package/cjs/combobox/combobox-store.cjs +18 -18
- package/cjs/composite/composite-overflow-store.cjs +5 -5
- package/cjs/composite/composite-store.cjs +4 -4
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/disclosure/disclosure-store.d.ts +1 -0
- package/cjs/form/form-store.cjs +7 -7
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/menu/menu-bar-store.cjs +4 -4
- package/cjs/menu/menu-store.cjs +18 -18
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/radio/radio-store.cjs +5 -5
- package/cjs/select/select-store.cjs +18 -18
- package/cjs/tab/tab-store.cjs +15 -15
- package/cjs/toolbar/toolbar-store.cjs +4 -4
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/store.cjs +2 -2
- package/cjs/utils/store.d.ts +3 -0
- package/esm/__chunks/{OZ4NH3RO.js → A2MHRHOV.js} +5 -6
- package/esm/__chunks/{STQCKYT6.js → C57Q2UMF.js} +1 -1
- package/esm/__chunks/{BL2LUIIN.js → E6THWJ7N.js} +2 -2
- package/esm/__chunks/{BE4I5ZDQ.js → HN27WCTM.js} +1 -1
- package/esm/__chunks/{LTJQMYBN.js → JLNC5RR2.js} +2 -2
- package/esm/__chunks/{A2JA3CYE.js → L4QLJSLG.js} +2 -2
- package/esm/__chunks/{DEGIJZ7N.js → Y5SJEQQJ.js} +25 -12
- package/esm/checkbox/checkbox-store.js +1 -1
- package/esm/collection/collection-store.js +2 -2
- package/esm/combobox/combobox-store.js +6 -6
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-store.js +3 -3
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/disclosure/disclosure-store.d.ts +1 -0
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-store.js +2 -2
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/menu/menu-bar-store.js +3 -3
- package/esm/menu/menu-store.js +7 -7
- package/esm/popover/popover-store.js +4 -4
- package/esm/radio/radio-store.js +3 -3
- package/esm/select/select-store.js +6 -6
- package/esm/tab/tab-store.js +3 -3
- package/esm/toolbar/toolbar-store.js +3 -3
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/store.d.ts +3 -0
- package/esm/utils/store.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ariakit/core
|
|
2
2
|
|
|
3
|
+
## 0.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`#2909`](https://github.com/ariakit/ariakit/pull/2909) Fixed [Disclosure](https://ariakit.org/components/disclosure) and related components not waiting for the exit animation to complete before hiding the content element.
|
|
8
|
+
|
|
9
|
+
- Improved JSDocs.
|
|
10
|
+
|
|
11
|
+
## 0.3.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Improved JSDocs.
|
|
16
|
+
|
|
3
17
|
## 0.3.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -27,7 +27,7 @@ function createStore(initialState, ...stores) {
|
|
|
27
27
|
const updatedKeys = /* @__PURE__ */ new Set();
|
|
28
28
|
const setups = /* @__PURE__ */ new Set();
|
|
29
29
|
const listeners = /* @__PURE__ */ new Set();
|
|
30
|
-
const
|
|
30
|
+
const batchListeners = /* @__PURE__ */ new Set();
|
|
31
31
|
const disposables = /* @__PURE__ */ new WeakMap();
|
|
32
32
|
const listenerKeys = /* @__PURE__ */ new WeakMap();
|
|
33
33
|
const storeSetup = (callback) => {
|
|
@@ -49,7 +49,17 @@ function createStore(initialState, ...stores) {
|
|
|
49
49
|
return;
|
|
50
50
|
if (!_RCYVACJOcjs.hasOwnProperty.call(void 0, storeState, key))
|
|
51
51
|
return;
|
|
52
|
-
return sync(
|
|
52
|
+
return sync(
|
|
53
|
+
store,
|
|
54
|
+
[key],
|
|
55
|
+
(state2) => setState(
|
|
56
|
+
key,
|
|
57
|
+
state2[key],
|
|
58
|
+
// @ts-expect-error - Not public API. This is just to prevent
|
|
59
|
+
// infinite loops.
|
|
60
|
+
true
|
|
61
|
+
)
|
|
62
|
+
);
|
|
53
63
|
})
|
|
54
64
|
)
|
|
55
65
|
);
|
|
@@ -60,8 +70,7 @@ function createStore(initialState, ...stores) {
|
|
|
60
70
|
initialized = false;
|
|
61
71
|
});
|
|
62
72
|
};
|
|
63
|
-
const sub = (keys, listener,
|
|
64
|
-
const set = batch2 ? listenersBatch : listeners;
|
|
73
|
+
const sub = (keys, listener, set = listeners) => {
|
|
65
74
|
set.add(listener);
|
|
66
75
|
listenerKeys.set(listener, keys);
|
|
67
76
|
return () => {
|
|
@@ -79,21 +88,23 @@ function createStore(initialState, ...stores) {
|
|
|
79
88
|
};
|
|
80
89
|
const storeBatch = (keys, listener) => {
|
|
81
90
|
disposables.set(listener, listener(state, prevStateBatch));
|
|
82
|
-
return sub(keys, listener,
|
|
91
|
+
return sub(keys, listener, batchListeners);
|
|
83
92
|
};
|
|
84
93
|
const storePick = (keys) => createStore(_RCYVACJOcjs.pick.call(void 0, state, keys), finalStore);
|
|
85
94
|
const storeOmit = (keys) => createStore(_RCYVACJOcjs.omit.call(void 0, state, keys), finalStore);
|
|
86
95
|
const getState = () => state;
|
|
87
|
-
const setState = (key, value) => {
|
|
96
|
+
const setState = (key, value, fromStores = false) => {
|
|
88
97
|
if (!_RCYVACJOcjs.hasOwnProperty.call(void 0, state, key))
|
|
89
98
|
return;
|
|
90
99
|
const nextValue = _RCYVACJOcjs.applyState.call(void 0, value, state[key]);
|
|
91
100
|
if (nextValue === state[key])
|
|
92
101
|
return;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
102
|
+
if (!fromStores) {
|
|
103
|
+
stores.forEach((store) => {
|
|
104
|
+
var _a;
|
|
105
|
+
(_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
97
108
|
const prevState = state;
|
|
98
109
|
state = _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, state), { [key]: nextValue });
|
|
99
110
|
const thisUpdate = Symbol();
|
|
@@ -108,12 +119,14 @@ function createStore(initialState, ...stores) {
|
|
|
108
119
|
disposables.set(listener, listener(state, prev));
|
|
109
120
|
}
|
|
110
121
|
};
|
|
111
|
-
listeners.forEach((listener) =>
|
|
122
|
+
listeners.forEach((listener) => {
|
|
123
|
+
run(listener, prevState);
|
|
124
|
+
});
|
|
112
125
|
queueMicrotask(() => {
|
|
113
126
|
if (lastUpdate !== thisUpdate)
|
|
114
127
|
return;
|
|
115
128
|
const snapshot = state;
|
|
116
|
-
|
|
129
|
+
batchListeners.forEach((listener) => {
|
|
117
130
|
run(listener, prevStateBatch, updatedKeys);
|
|
118
131
|
});
|
|
119
132
|
prevStateBatch = snapshot;
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
var _A4GDJCZBcjs = require('./A4GDJCZB.cjs');
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
@@ -16,11 +17,11 @@ var _72I2GWXFcjs = require('./72I2GWXF.cjs');
|
|
|
16
17
|
|
|
17
18
|
// src/disclosure/disclosure-store.ts
|
|
18
19
|
function createDisclosureStore(props = {}) {
|
|
19
|
-
const store =
|
|
20
|
+
const store = _A4GDJCZBcjs.mergeStore.call(void 0,
|
|
20
21
|
props.store,
|
|
21
|
-
|
|
22
|
+
_A4GDJCZBcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
|
|
22
23
|
);
|
|
23
|
-
|
|
24
|
+
_A4GDJCZBcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
24
25
|
const syncState = store == null ? void 0 : store.getState();
|
|
25
26
|
const open = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
26
27
|
props.open,
|
|
@@ -37,28 +38,26 @@ function createDisclosureStore(props = {}) {
|
|
|
37
38
|
contentElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
|
|
38
39
|
disclosureElement: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
|
|
39
40
|
};
|
|
40
|
-
const disclosure =
|
|
41
|
-
|
|
41
|
+
const disclosure = _A4GDJCZBcjs.createStore.call(void 0, initialState, store);
|
|
42
|
+
_A4GDJCZBcjs.setup.call(void 0,
|
|
42
43
|
disclosure,
|
|
43
|
-
() =>
|
|
44
|
+
() => _A4GDJCZBcjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
|
|
44
45
|
if (state.animated)
|
|
45
46
|
return;
|
|
46
47
|
disclosure.setState("animating", false);
|
|
47
48
|
})
|
|
48
49
|
);
|
|
49
|
-
|
|
50
|
+
_A4GDJCZBcjs.setup.call(void 0,
|
|
50
51
|
disclosure,
|
|
51
|
-
() =>
|
|
52
|
-
if (!
|
|
52
|
+
() => _A4GDJCZBcjs.subscribe.call(void 0, disclosure, ["open"], () => {
|
|
53
|
+
if (!disclosure.getState().animated)
|
|
53
54
|
return;
|
|
54
|
-
|
|
55
|
-
const animating = mounting ? state.open : state.open !== prev.open;
|
|
56
|
-
disclosure.setState("animating", animating);
|
|
55
|
+
disclosure.setState("animating", true);
|
|
57
56
|
})
|
|
58
57
|
);
|
|
59
|
-
|
|
58
|
+
_A4GDJCZBcjs.setup.call(void 0,
|
|
60
59
|
disclosure,
|
|
61
|
-
() =>
|
|
60
|
+
() => _A4GDJCZBcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
|
|
62
61
|
disclosure.setState("mounted", state.open || state.animating);
|
|
63
62
|
})
|
|
64
63
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _A7K3KZJLcjs = require('./A7K3KZJL.cjs');
|
|
4
4
|
|
|
5
5
|
// src/dialog/dialog-store.ts
|
|
6
6
|
function createDialogStore(props = {}) {
|
|
7
|
-
return
|
|
7
|
+
return _A7K3KZJLcjs.createDisclosureStore.call(void 0, props);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _ZYIEFAMBcjs = require('./ZYIEFAMB.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _A4GDJCZBcjs = require('./A4GDJCZB.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
@@ -16,7 +16,7 @@ var _72I2GWXFcjs = require('./72I2GWXF.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 = _ZYIEFAMBcjs.createPopoverStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
20
20
|
placement: _RCYVACJOcjs.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: _RCYVACJOcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
|
|
31
31
|
autoFocusOnShow: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
|
|
32
32
|
});
|
|
33
|
-
const hovercard =
|
|
33
|
+
const hovercard = _A4GDJCZBcjs.createStore.call(void 0, initialState, popover, props.store);
|
|
34
34
|
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
|
|
35
35
|
setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
|
|
36
36
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _W5IQT6Z2cjs = require('./W5IQT6Z2.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _A4GDJCZBcjs = require('./A4GDJCZB.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
@@ -123,7 +123,7 @@ function verticalizeItems(items) {
|
|
|
123
123
|
function createCompositeStore(props = {}) {
|
|
124
124
|
var _a;
|
|
125
125
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
126
|
-
const collection =
|
|
126
|
+
const collection = _W5IQT6Z2cjs.createCollectionStore.call(void 0, props);
|
|
127
127
|
const activeId = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
128
128
|
props.activeId,
|
|
129
129
|
syncState == null ? void 0 : syncState.activeId,
|
|
@@ -153,10 +153,10 @@ function createCompositeStore(props = {}) {
|
|
|
153
153
|
focusWrap: _RCYVACJOcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
|
|
154
154
|
focusShift: _RCYVACJOcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
|
|
155
155
|
});
|
|
156
|
-
const composite =
|
|
157
|
-
|
|
156
|
+
const composite = _A4GDJCZBcjs.createStore.call(void 0, initialState, collection, props.store);
|
|
157
|
+
_A4GDJCZBcjs.setup.call(void 0,
|
|
158
158
|
composite,
|
|
159
|
-
() =>
|
|
159
|
+
() => _A4GDJCZBcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
|
|
160
160
|
composite.setState("activeId", (activeId2) => {
|
|
161
161
|
var _a2;
|
|
162
162
|
if (activeId2 !== void 0)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _A4GDJCZBcjs = require('./A4GDJCZB.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -64,7 +64,7 @@ function getCommonParent(items) {
|
|
|
64
64
|
}
|
|
65
65
|
function createCollectionStore(props = {}) {
|
|
66
66
|
var _a;
|
|
67
|
-
|
|
67
|
+
_A4GDJCZBcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
68
68
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
69
69
|
const items = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
70
70
|
props.items,
|
|
@@ -77,18 +77,18 @@ function createCollectionStore(props = {}) {
|
|
|
77
77
|
items,
|
|
78
78
|
renderedItems: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
|
|
79
79
|
};
|
|
80
|
-
const privateStore =
|
|
80
|
+
const privateStore = _A4GDJCZBcjs.createStore.call(void 0, {
|
|
81
81
|
renderedItems: initialState.renderedItems
|
|
82
82
|
});
|
|
83
|
-
const collection =
|
|
83
|
+
const collection = _A4GDJCZBcjs.createStore.call(void 0, initialState, props.store);
|
|
84
84
|
const sortItems = () => {
|
|
85
85
|
const state = privateStore.getState();
|
|
86
86
|
const renderedItems = sortBasedOnDOMPosition(state.renderedItems);
|
|
87
87
|
privateStore.setState("renderedItems", renderedItems);
|
|
88
88
|
collection.setState("renderedItems", renderedItems);
|
|
89
89
|
};
|
|
90
|
-
|
|
91
|
-
return
|
|
90
|
+
_A4GDJCZBcjs.setup.call(void 0, collection, () => {
|
|
91
|
+
return _A4GDJCZBcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
|
|
92
92
|
let firstRun = true;
|
|
93
93
|
let raf = requestAnimationFrame(sortItems);
|
|
94
94
|
if (typeof IntersectionObserver !== "function")
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _DFFIYGBScjs = require('./DFFIYGBS.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _A4GDJCZBcjs = require('./A4GDJCZB.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _RCYVACJOcjs = require('./RCYVACJO.cjs');
|
|
@@ -23,9 +23,9 @@ function createPopoverStore(_a = {}) {
|
|
|
23
23
|
} = _b, props = _72I2GWXFcjs.__objRest.call(void 0, _b, [
|
|
24
24
|
"popover"
|
|
25
25
|
]);
|
|
26
|
-
const store =
|
|
26
|
+
const store = _A4GDJCZBcjs.mergeStore.call(void 0,
|
|
27
27
|
props.store,
|
|
28
|
-
|
|
28
|
+
_A4GDJCZBcjs.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
|
+
_A4GDJCZBcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
37
37
|
const syncState = store == null ? void 0 : store.getState();
|
|
38
|
-
const dialog =
|
|
38
|
+
const dialog = _DFFIYGBScjs.createDialogStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), { store }));
|
|
39
39
|
const placement = _RCYVACJOcjs.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: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
|
|
50
50
|
rendered: Symbol("rendered")
|
|
51
51
|
});
|
|
52
|
-
const popover =
|
|
52
|
+
const popover = _A4GDJCZBcjs.createStore.call(void 0, initialState, dialog, store);
|
|
53
53
|
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, dialog), popover), {
|
|
54
54
|
setAnchorElement: (element) => popover.setState("anchorElement", element),
|
|
55
55
|
setPopoverElement: (element) => popover.setState("popoverElement", element),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _A4GDJCZBcjs = require('../__chunks/A4GDJCZB.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
|
|
@@ -13,7 +13,7 @@ var _72I2GWXFcjs = require('../__chunks/72I2GWXF.cjs');
|
|
|
13
13
|
// src/checkbox/checkbox-store.ts
|
|
14
14
|
function createCheckboxStore(props = {}) {
|
|
15
15
|
var _a;
|
|
16
|
-
|
|
16
|
+
_A4GDJCZBcjs.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: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
@@ -23,7 +23,7 @@ function createCheckboxStore(props = {}) {
|
|
|
23
23
|
false
|
|
24
24
|
)
|
|
25
25
|
};
|
|
26
|
-
const checkbox =
|
|
26
|
+
const checkbox = _A4GDJCZBcjs.createStore.call(void 0, initialState, props.store);
|
|
27
27
|
return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, checkbox), {
|
|
28
28
|
setValue: (value) => checkbox.setState("value", value)
|
|
29
29
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _W5IQT6Z2cjs = require('../__chunks/W5IQT6Z2.cjs');
|
|
4
|
+
require('../__chunks/A4GDJCZB.cjs');
|
|
5
5
|
require('../__chunks/RCYVACJO.cjs');
|
|
6
6
|
require('../__chunks/EXM2AW52.cjs');
|
|
7
7
|
require('../__chunks/72I2GWXF.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createCollectionStore =
|
|
10
|
+
exports.createCollectionStore = _W5IQT6Z2cjs.createCollectionStore;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _ZYIEFAMBcjs = require('../__chunks/ZYIEFAMB.cjs');
|
|
4
|
+
require('../__chunks/DFFIYGBS.cjs');
|
|
5
|
+
require('../__chunks/A7K3KZJL.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../__chunks/
|
|
8
|
+
var _TTWS4MDCcjs = require('../__chunks/TTWS4MDC.cjs');
|
|
9
|
+
require('../__chunks/W5IQT6Z2.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _A4GDJCZBcjs = require('../__chunks/A4GDJCZB.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
|
|
@@ -32,7 +32,7 @@ var _72I2GWXFcjs = require('../__chunks/72I2GWXF.cjs');
|
|
|
32
32
|
var isSafariOnMobile = _EIRIJC7Tcjs.isSafari.call(void 0, ) && _EIRIJC7Tcjs.isTouchDevice.call(void 0, );
|
|
33
33
|
function createComboboxStore(props = {}) {
|
|
34
34
|
var _a;
|
|
35
|
-
|
|
35
|
+
_A4GDJCZBcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
36
36
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
37
37
|
const activeId = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
38
38
|
props.activeId,
|
|
@@ -40,7 +40,7 @@ function createComboboxStore(props = {}) {
|
|
|
40
40
|
props.defaultActiveId,
|
|
41
41
|
null
|
|
42
42
|
);
|
|
43
|
-
const composite =
|
|
43
|
+
const composite = _TTWS4MDCcjs.createCompositeStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
44
44
|
activeId,
|
|
45
45
|
includesBaseElement: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
46
46
|
props.includesBaseElement,
|
|
@@ -60,7 +60,7 @@ function createComboboxStore(props = {}) {
|
|
|
60
60
|
!isSafariOnMobile
|
|
61
61
|
)
|
|
62
62
|
}));
|
|
63
|
-
const popover =
|
|
63
|
+
const popover = _ZYIEFAMBcjs.createPopoverStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
64
64
|
placement: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
65
65
|
props.placement,
|
|
66
66
|
syncState == null ? void 0 : syncState.placement,
|
|
@@ -82,10 +82,10 @@ function createComboboxStore(props = {}) {
|
|
|
82
82
|
),
|
|
83
83
|
activeValue: syncState == null ? void 0 : syncState.activeValue
|
|
84
84
|
});
|
|
85
|
-
const combobox =
|
|
86
|
-
|
|
85
|
+
const combobox = _A4GDJCZBcjs.createStore.call(void 0, initialState, composite, popover, props.store);
|
|
86
|
+
_A4GDJCZBcjs.setup.call(void 0,
|
|
87
87
|
combobox,
|
|
88
|
-
() =>
|
|
88
|
+
() => _A4GDJCZBcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
|
|
89
89
|
if (!state.resetValueOnHide)
|
|
90
90
|
return;
|
|
91
91
|
if (state.mounted)
|
|
@@ -93,26 +93,26 @@ function createComboboxStore(props = {}) {
|
|
|
93
93
|
combobox.setState("value", initialValue);
|
|
94
94
|
})
|
|
95
95
|
);
|
|
96
|
-
|
|
96
|
+
_A4GDJCZBcjs.setup.call(void 0,
|
|
97
97
|
combobox,
|
|
98
|
-
() =>
|
|
98
|
+
() => _A4GDJCZBcjs.batch.call(void 0, combobox, ["mounted"], (state) => {
|
|
99
99
|
if (state.mounted)
|
|
100
100
|
return;
|
|
101
101
|
combobox.setState("activeId", activeId);
|
|
102
102
|
combobox.setState("moves", 0);
|
|
103
103
|
})
|
|
104
104
|
);
|
|
105
|
-
|
|
105
|
+
_A4GDJCZBcjs.setup.call(void 0,
|
|
106
106
|
combobox,
|
|
107
|
-
() =>
|
|
107
|
+
() => _A4GDJCZBcjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
|
|
108
108
|
if (state.moves === prevState.moves) {
|
|
109
109
|
combobox.setState("activeValue", void 0);
|
|
110
110
|
}
|
|
111
111
|
})
|
|
112
112
|
);
|
|
113
|
-
|
|
113
|
+
_A4GDJCZBcjs.setup.call(void 0,
|
|
114
114
|
combobox,
|
|
115
|
-
() =>
|
|
115
|
+
() => _A4GDJCZBcjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
|
|
116
116
|
if (state.moves === prev.moves)
|
|
117
117
|
return;
|
|
118
118
|
const { activeId: activeId2 } = combobox.getState();
|
|
@@ -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/
|
|
3
|
+
var _ZYIEFAMBcjs = require('../__chunks/ZYIEFAMB.cjs');
|
|
4
|
+
require('../__chunks/DFFIYGBS.cjs');
|
|
5
|
+
require('../__chunks/A7K3KZJL.cjs');
|
|
6
|
+
require('../__chunks/A4GDJCZB.cjs');
|
|
7
7
|
require('../__chunks/RCYVACJO.cjs');
|
|
8
8
|
require('../__chunks/72I2GWXF.cjs');
|
|
9
9
|
|
|
10
10
|
// src/composite/composite-overflow-store.ts
|
|
11
11
|
function createCompositeOverflowStore(props = {}) {
|
|
12
|
-
return
|
|
12
|
+
return _ZYIEFAMBcjs.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/
|
|
3
|
+
var _TTWS4MDCcjs = require('../__chunks/TTWS4MDC.cjs');
|
|
4
|
+
require('../__chunks/W5IQT6Z2.cjs');
|
|
5
|
+
require('../__chunks/A4GDJCZB.cjs');
|
|
6
6
|
require('../__chunks/RCYVACJO.cjs');
|
|
7
7
|
require('../__chunks/EXM2AW52.cjs');
|
|
8
8
|
require('../__chunks/GDZQUFNP.cjs');
|
|
9
9
|
require('../__chunks/72I2GWXF.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createCompositeStore =
|
|
12
|
+
exports.createCompositeStore = _TTWS4MDCcjs.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/
|
|
3
|
+
var _DFFIYGBScjs = require('../__chunks/DFFIYGBS.cjs');
|
|
4
|
+
require('../__chunks/A7K3KZJL.cjs');
|
|
5
|
+
require('../__chunks/A4GDJCZB.cjs');
|
|
6
6
|
require('../__chunks/RCYVACJO.cjs');
|
|
7
7
|
require('../__chunks/72I2GWXF.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createDialogStore =
|
|
10
|
+
exports.createDialogStore = _DFFIYGBScjs.createDialogStore;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _A7K3KZJLcjs = require('../__chunks/A7K3KZJL.cjs');
|
|
4
|
+
require('../__chunks/A4GDJCZB.cjs');
|
|
5
5
|
require('../__chunks/RCYVACJO.cjs');
|
|
6
6
|
require('../__chunks/72I2GWXF.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.createDisclosureStore =
|
|
9
|
+
exports.createDisclosureStore = _A7K3KZJLcjs.createDisclosureStore;
|
|
@@ -85,6 +85,7 @@ export interface DisclosureStoreFunctions {
|
|
|
85
85
|
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
86
86
|
* - [Dialog with React
|
|
87
87
|
* Router](https://ariakit.org/examples/dialog-react-router)
|
|
88
|
+
* - [Sliding Menu](https://ariakit.org/examples/menu-slide)
|
|
88
89
|
*/
|
|
89
90
|
hide: () => void;
|
|
90
91
|
/**
|
package/cjs/form/form-store.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _W5IQT6Z2cjs = require('../__chunks/W5IQT6Z2.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _A4GDJCZBcjs = require('../__chunks/A4GDJCZB.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -113,9 +113,9 @@ function createNames() {
|
|
|
113
113
|
}
|
|
114
114
|
function createFormStore(props = {}) {
|
|
115
115
|
var _a;
|
|
116
|
-
|
|
116
|
+
_A4GDJCZBcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
117
117
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
118
|
-
const collection =
|
|
118
|
+
const collection = _W5IQT6Z2cjs.createCollectionStore.call(void 0, props);
|
|
119
119
|
const values = _RCYVACJOcjs.defaultValue.call(void 0,
|
|
120
120
|
props.values,
|
|
121
121
|
syncState == null ? void 0 : syncState.values,
|
|
@@ -144,15 +144,15 @@ function createFormStore(props = {}) {
|
|
|
144
144
|
submitFailed: _RCYVACJOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
|
|
145
145
|
valid: !hasMessages(errors)
|
|
146
146
|
});
|
|
147
|
-
const form =
|
|
147
|
+
const form = _A4GDJCZBcjs.createStore.call(void 0, initialState, collection, props.store);
|
|
148
148
|
const syncCallbacks = getStoreCallbacks(props.store);
|
|
149
149
|
const syncCallbacksState = syncCallbacks == null ? void 0 : syncCallbacks.getState();
|
|
150
150
|
const callbacksInitialState = {
|
|
151
151
|
validate: (syncCallbacksState == null ? void 0 : syncCallbacksState.validate) || [],
|
|
152
152
|
submit: (syncCallbacksState == null ? void 0 : syncCallbacksState.submit) || []
|
|
153
153
|
};
|
|
154
|
-
const callbacks =
|
|
155
|
-
|
|
154
|
+
const callbacks = _A4GDJCZBcjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
|
|
155
|
+
_A4GDJCZBcjs.setup.call(void 0, form, () => _A4GDJCZBcjs.init.call(void 0, callbacks));
|
|
156
156
|
const validate = async () => {
|
|
157
157
|
form.setState("validating", true);
|
|
158
158
|
form.setState("errors", {});
|
|
@@ -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/
|
|
3
|
+
var _NEBQQIUXcjs = require('../__chunks/NEBQQIUX.cjs');
|
|
4
|
+
require('../__chunks/ZYIEFAMB.cjs');
|
|
5
|
+
require('../__chunks/DFFIYGBS.cjs');
|
|
6
|
+
require('../__chunks/A7K3KZJL.cjs');
|
|
7
|
+
require('../__chunks/A4GDJCZB.cjs');
|
|
8
8
|
require('../__chunks/RCYVACJO.cjs');
|
|
9
9
|
require('../__chunks/72I2GWXF.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createHovercardStore =
|
|
12
|
+
exports.createHovercardStore = _NEBQQIUXcjs.createHovercardStore;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _TTWS4MDCcjs = require('../__chunks/TTWS4MDC.cjs');
|
|
4
|
+
require('../__chunks/W5IQT6Z2.cjs');
|
|
5
|
+
require('../__chunks/A4GDJCZB.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
|
|
@@ -17,7 +17,7 @@ var _72I2GWXFcjs = require('../__chunks/72I2GWXF.cjs');
|
|
|
17
17
|
function createMenuBarStore(props = {}) {
|
|
18
18
|
var _a;
|
|
19
19
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
20
|
-
return
|
|
20
|
+
return _TTWS4MDCcjs.createCompositeStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
|
|
21
21
|
orientation: _RCYVACJOcjs.defaultValue.call(void 0,
|
|
22
22
|
props.orientation,
|
|
23
23
|
syncState == null ? void 0 : syncState.orientation,
|