@ariakit/core 0.4.7 → 0.4.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 +5 -0
- package/cjs/__chunks/{M2NNCFIJ.cjs → 3QF3ODTR.cjs} +31 -50
- package/cjs/__chunks/{LPDHSEHU.cjs → 7CES7GVE.cjs} +4 -8
- package/cjs/__chunks/{Q2WCPTYS.cjs → 7WYII4AN.cjs} +6 -12
- package/cjs/__chunks/{EEDWPDM2.cjs → BTUHABP4.cjs} +16 -30
- package/cjs/__chunks/{3COGJMN3.cjs → CCI5VM7E.cjs} +24 -30
- package/cjs/__chunks/{MB5TLEVH.cjs → H6ZQSQQL.cjs} +16 -16
- package/cjs/__chunks/{D7M2PCAQ.cjs → KCEXELK7.cjs} +6 -7
- package/cjs/__chunks/{DIYYVJDK.cjs → N667HVED.cjs} +2 -2
- package/cjs/__chunks/{LBFF2BBK.cjs → PW36G76L.cjs} +25 -29
- package/cjs/__chunks/{LAYUSNGM.cjs → QLWAGBAQ.cjs} +20 -22
- package/cjs/__chunks/{5BQ2XS3R.cjs → VJAE2Y4T.cjs} +10 -10
- package/cjs/__chunks/XIZWLBI2.cjs +42 -0
- package/cjs/checkbox/checkbox-store.cjs +7 -7
- package/cjs/collection/collection-store.cjs +6 -6
- package/cjs/combobox/combobox-store.cjs +50 -56
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-store.cjs +7 -7
- package/cjs/dialog/dialog-store.cjs +6 -6
- package/cjs/disclosure/disclosure-store.cjs +5 -5
- package/cjs/form/form-store.cjs +32 -36
- 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 +37 -42
- package/cjs/menubar/menubar-store.cjs +8 -8
- package/cjs/popover/popover-store.cjs +7 -7
- package/cjs/radio/radio-store.cjs +13 -13
- package/cjs/select/select-store.cjs +49 -62
- package/cjs/tab/tab-store.cjs +49 -61
- package/cjs/tag/tag-store.cjs +23 -27
- package/cjs/toolbar/toolbar-store.cjs +9 -9
- package/cjs/tooltip/tooltip-store.cjs +15 -15
- package/cjs/utils/array.cjs +1 -1
- package/cjs/utils/dom.cjs +3 -3
- package/cjs/utils/events.cjs +22 -36
- package/cjs/utils/focus.cjs +34 -58
- package/cjs/utils/misc.cjs +3 -3
- package/cjs/utils/misc.d.cts +1 -1
- package/cjs/utils/misc.d.ts +1 -1
- package/cjs/utils/platform.cjs +4 -4
- package/cjs/utils/store.cjs +4 -4
- package/cjs/utils/undo.cjs +3 -3
- package/esm/__chunks/{SAZZJI72.js → 3UYWTADI.js} +4 -4
- package/esm/__chunks/{I2WJ7JBQ.js → 6DHTHWXD.js} +10 -16
- package/esm/__chunks/{KDSZSVV5.js → 6E4KKOSB.js} +5 -7
- package/esm/__chunks/{EKIWAN6A.js → 7LM4Q2XB.js} +4 -8
- package/esm/__chunks/{VH2P7HEP.js → D7EIQZAU.js} +8 -12
- package/esm/__chunks/{E4HA32QI.js → EACLTACN.js} +4 -4
- package/esm/__chunks/{KLPDXTDE.js → EQQLU3CG.js} +21 -40
- package/esm/__chunks/{I2NJJ3XW.js → HWOIWM4O.js} +6 -12
- package/esm/__chunks/{22HHDS5F.js → PBFD2E7P.js} +15 -29
- package/esm/__chunks/{RCLYDUHE.js → PIWLWQMB.js} +4 -4
- package/esm/__chunks/{CLSHHUGK.js → US4USQPI.js} +2 -3
- package/esm/__chunks/{NWACXGIN.js → YOHCVXJB.js} +1 -1
- package/esm/checkbox/checkbox-store.js +3 -3
- package/esm/collection/collection-store.js +5 -5
- package/esm/combobox/combobox-store.js +16 -22
- package/esm/composite/composite-overflow-store.js +6 -6
- package/esm/composite/composite-store.js +6 -6
- package/esm/dialog/dialog-store.js +5 -5
- package/esm/disclosure/disclosure-store.js +4 -4
- package/esm/form/form-store.js +9 -13
- package/esm/hovercard/hovercard-store.js +7 -7
- package/esm/index.js +1 -1
- package/esm/menu/menu-bar-store.js +7 -7
- package/esm/menu/menu-store.js +15 -20
- package/esm/menubar/menubar-store.js +7 -7
- package/esm/popover/popover-store.js +6 -6
- package/esm/radio/radio-store.js +6 -6
- package/esm/select/select-store.js +22 -35
- package/esm/tab/tab-store.js +18 -30
- package/esm/tag/tag-store.js +11 -15
- package/esm/toolbar/toolbar-store.js +6 -6
- package/esm/tooltip/tooltip-store.js +7 -7
- package/esm/utils/array.js +1 -1
- package/esm/utils/dom.js +2 -2
- package/esm/utils/events.js +17 -31
- package/esm/utils/focus.js +26 -50
- package/esm/utils/misc.d.ts +1 -1
- package/esm/utils/misc.js +2 -2
- package/esm/utils/platform.js +3 -3
- package/esm/utils/store.js +3 -3
- package/esm/utils/undo.js +2 -2
- package/package.json +1 -1
- package/readme.md +18 -0
- package/cjs/__chunks/XVL5HZ27.cjs +0 -42
- /package/cjs/__chunks/{AV6KTKLE.cjs → 3IVNQNIV.cjs} +0 -0
- /package/esm/__chunks/{4R3V3JGP.js → 3YLGPPWQ.js} +0 -0
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
noop,
|
|
9
9
|
omit,
|
|
10
10
|
pick
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./PBFD2E7P.js";
|
|
12
12
|
import {
|
|
13
13
|
__spreadProps,
|
|
14
14
|
__spreadValues
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./3YLGPPWQ.js";
|
|
16
16
|
|
|
17
17
|
// src/utils/store.ts
|
|
18
18
|
function getInternal(store, key) {
|
|
@@ -42,21 +42,17 @@ function createStore(initialState, ...stores) {
|
|
|
42
42
|
instances.add(instance);
|
|
43
43
|
const maybeDestroy = () => {
|
|
44
44
|
instances.delete(instance);
|
|
45
|
-
if (instances.size)
|
|
46
|
-
return;
|
|
45
|
+
if (instances.size) return;
|
|
47
46
|
destroy();
|
|
48
47
|
};
|
|
49
|
-
if (initialized)
|
|
50
|
-
return maybeDestroy;
|
|
48
|
+
if (initialized) return maybeDestroy;
|
|
51
49
|
const desyncs = getKeys(state).map(
|
|
52
50
|
(key) => chain(
|
|
53
51
|
...stores.map((store) => {
|
|
54
52
|
var _a;
|
|
55
53
|
const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
|
|
56
|
-
if (!storeState)
|
|
57
|
-
|
|
58
|
-
if (!hasOwnProperty(storeState, key))
|
|
59
|
-
return;
|
|
54
|
+
if (!storeState) return;
|
|
55
|
+
if (!hasOwnProperty(storeState, key)) return;
|
|
60
56
|
return sync(store, [key], (state2) => {
|
|
61
57
|
setState(
|
|
62
58
|
key,
|
|
@@ -102,11 +98,9 @@ function createStore(initialState, ...stores) {
|
|
|
102
98
|
const getState = () => state;
|
|
103
99
|
const setState = (key, value, fromStores = false) => {
|
|
104
100
|
var _a;
|
|
105
|
-
if (!hasOwnProperty(state, key))
|
|
106
|
-
return;
|
|
101
|
+
if (!hasOwnProperty(state, key)) return;
|
|
107
102
|
const nextValue = applyState(value, state[key]);
|
|
108
|
-
if (nextValue === state[key])
|
|
109
|
-
return;
|
|
103
|
+
if (nextValue === state[key]) return;
|
|
110
104
|
if (!fromStores) {
|
|
111
105
|
for (const store of stores) {
|
|
112
106
|
(_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue);
|
|
@@ -130,8 +124,7 @@ function createStore(initialState, ...stores) {
|
|
|
130
124
|
run(listener, prevState);
|
|
131
125
|
}
|
|
132
126
|
queueMicrotask(() => {
|
|
133
|
-
if (lastUpdate !== thisUpdate)
|
|
134
|
-
return;
|
|
127
|
+
if (lastUpdate !== thisUpdate) return;
|
|
135
128
|
const snapshot = state;
|
|
136
129
|
for (const listener of batchListeners) {
|
|
137
130
|
run(listener, prevStateBatch, updatedKeys);
|
|
@@ -156,69 +149,57 @@ function createStore(initialState, ...stores) {
|
|
|
156
149
|
return finalStore;
|
|
157
150
|
}
|
|
158
151
|
function setup(store, ...args) {
|
|
159
|
-
if (!store)
|
|
160
|
-
return;
|
|
152
|
+
if (!store) return;
|
|
161
153
|
return getInternal(store, "setup")(...args);
|
|
162
154
|
}
|
|
163
155
|
function init(store, ...args) {
|
|
164
|
-
if (!store)
|
|
165
|
-
return;
|
|
156
|
+
if (!store) return;
|
|
166
157
|
return getInternal(store, "init")(...args);
|
|
167
158
|
}
|
|
168
159
|
function subscribe(store, ...args) {
|
|
169
|
-
if (!store)
|
|
170
|
-
return;
|
|
160
|
+
if (!store) return;
|
|
171
161
|
return getInternal(store, "subscribe")(...args);
|
|
172
162
|
}
|
|
173
163
|
function sync(store, ...args) {
|
|
174
|
-
if (!store)
|
|
175
|
-
return;
|
|
164
|
+
if (!store) return;
|
|
176
165
|
return getInternal(store, "sync")(...args);
|
|
177
166
|
}
|
|
178
167
|
function batch(store, ...args) {
|
|
179
|
-
if (!store)
|
|
180
|
-
return;
|
|
168
|
+
if (!store) return;
|
|
181
169
|
return getInternal(store, "batch")(...args);
|
|
182
170
|
}
|
|
183
171
|
function omit2(store, ...args) {
|
|
184
|
-
if (!store)
|
|
185
|
-
return;
|
|
172
|
+
if (!store) return;
|
|
186
173
|
return getInternal(store, "omit")(...args);
|
|
187
174
|
}
|
|
188
175
|
function pick2(store, ...args) {
|
|
189
|
-
if (!store)
|
|
190
|
-
return;
|
|
176
|
+
if (!store) return;
|
|
191
177
|
return getInternal(store, "pick")(...args);
|
|
192
178
|
}
|
|
193
179
|
function mergeStore(...stores) {
|
|
194
180
|
const initialState = stores.reduce((state, store2) => {
|
|
195
181
|
var _a;
|
|
196
182
|
const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
|
|
197
|
-
if (!nextState)
|
|
198
|
-
return state;
|
|
183
|
+
if (!nextState) return state;
|
|
199
184
|
return Object.assign(state, nextState);
|
|
200
185
|
}, {});
|
|
201
186
|
const store = createStore(initialState, ...stores);
|
|
202
187
|
return store;
|
|
203
188
|
}
|
|
204
189
|
function throwOnConflictingProps(props, store) {
|
|
205
|
-
if (process.env.NODE_ENV === "production")
|
|
206
|
-
|
|
207
|
-
if (!store)
|
|
208
|
-
return;
|
|
190
|
+
if (process.env.NODE_ENV === "production") return;
|
|
191
|
+
if (!store) return;
|
|
209
192
|
const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => {
|
|
210
193
|
var _a;
|
|
211
194
|
const stateKey = key.replace("default", "");
|
|
212
195
|
return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`;
|
|
213
196
|
});
|
|
214
|
-
if (!defaultKeys.length)
|
|
215
|
-
return;
|
|
197
|
+
if (!defaultKeys.length) return;
|
|
216
198
|
const storeState = store.getState();
|
|
217
199
|
const conflictingProps = defaultKeys.filter(
|
|
218
200
|
(key) => hasOwnProperty(storeState, key)
|
|
219
201
|
);
|
|
220
|
-
if (!conflictingProps.length)
|
|
221
|
-
return;
|
|
202
|
+
if (!conflictingProps.length) return;
|
|
222
203
|
throw new Error(
|
|
223
204
|
`Passing a store prop in conjunction with a default state is not supported.
|
|
224
205
|
|
|
@@ -42,8 +42,7 @@ function isFrame(element) {
|
|
|
42
42
|
}
|
|
43
43
|
function isButton(element) {
|
|
44
44
|
const tagName = element.tagName.toLowerCase();
|
|
45
|
-
if (tagName === "button")
|
|
46
|
-
return true;
|
|
45
|
+
if (tagName === "button") return true;
|
|
47
46
|
if (tagName === "input" && element.type) {
|
|
48
47
|
return buttonInputTypes.indexOf(element.type) !== -1;
|
|
49
48
|
}
|
|
@@ -123,8 +122,7 @@ function getPopupItemRole(element, fallback) {
|
|
|
123
122
|
tree: "treeitem"
|
|
124
123
|
};
|
|
125
124
|
const popupRole = getPopupRole(element);
|
|
126
|
-
if (!popupRole)
|
|
127
|
-
return fallback;
|
|
125
|
+
if (!popupRole) return fallback;
|
|
128
126
|
const key = popupRole;
|
|
129
127
|
return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback;
|
|
130
128
|
}
|
|
@@ -134,26 +132,22 @@ function scrollIntoViewIfNeeded(element, arg) {
|
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
134
|
function getScrollingElement(element) {
|
|
137
|
-
if (!element)
|
|
138
|
-
return null;
|
|
135
|
+
if (!element) return null;
|
|
139
136
|
if (element.clientHeight && element.scrollHeight > element.clientHeight) {
|
|
140
137
|
const { overflowY } = getComputedStyle(element);
|
|
141
138
|
const isScrollable = overflowY !== "visible" && overflowY !== "hidden";
|
|
142
|
-
if (isScrollable)
|
|
143
|
-
return element;
|
|
139
|
+
if (isScrollable) return element;
|
|
144
140
|
} else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
|
|
145
141
|
const { overflowX } = getComputedStyle(element);
|
|
146
142
|
const isScrollable = overflowX !== "visible" && overflowX !== "hidden";
|
|
147
|
-
if (isScrollable)
|
|
148
|
-
return element;
|
|
143
|
+
if (isScrollable) return element;
|
|
149
144
|
}
|
|
150
145
|
return getScrollingElement(element.parentElement) || document.scrollingElement || document.body;
|
|
151
146
|
}
|
|
152
147
|
function isPartiallyHidden(element) {
|
|
153
148
|
const elementRect = element.getBoundingClientRect();
|
|
154
149
|
const scroller = getScrollingElement(element);
|
|
155
|
-
if (!scroller)
|
|
156
|
-
return false;
|
|
150
|
+
if (!scroller) return false;
|
|
157
151
|
const scrollerRect = scroller.getBoundingClientRect();
|
|
158
152
|
const isHTML = scroller.tagName === "HTML";
|
|
159
153
|
const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top;
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
__spreadValues
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./3YLGPPWQ.js";
|
|
5
5
|
|
|
6
6
|
// src/utils/misc.ts
|
|
7
7
|
function noop(..._) {
|
|
8
8
|
}
|
|
9
9
|
function shallowEqual(a, b) {
|
|
10
|
-
if (a === b)
|
|
11
|
-
|
|
12
|
-
if (!
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
return false;
|
|
16
|
-
if (typeof a !== "object")
|
|
17
|
-
return false;
|
|
18
|
-
if (typeof b !== "object")
|
|
19
|
-
return false;
|
|
10
|
+
if (a === b) return true;
|
|
11
|
+
if (!a) return false;
|
|
12
|
+
if (!b) return false;
|
|
13
|
+
if (typeof a !== "object") return false;
|
|
14
|
+
if (typeof b !== "object") return false;
|
|
20
15
|
const aKeys = Object.keys(a);
|
|
21
16
|
const bKeys = Object.keys(b);
|
|
22
17
|
const { length } = aKeys;
|
|
23
|
-
if (bKeys.length !== length)
|
|
24
|
-
return false;
|
|
18
|
+
if (bKeys.length !== length) return false;
|
|
25
19
|
for (const key of aKeys) {
|
|
26
20
|
if (a[key] !== b[key]) {
|
|
27
21
|
return false;
|
|
@@ -46,14 +40,10 @@ function isObject(arg) {
|
|
|
46
40
|
return typeof arg === "object" && arg != null;
|
|
47
41
|
}
|
|
48
42
|
function isEmpty(arg) {
|
|
49
|
-
if (Array.isArray(arg))
|
|
50
|
-
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
if (arg == null)
|
|
54
|
-
return true;
|
|
55
|
-
if (arg === "")
|
|
56
|
-
return true;
|
|
43
|
+
if (Array.isArray(arg)) return !arg.length;
|
|
44
|
+
if (isObject(arg)) return !Object.keys(arg).length;
|
|
45
|
+
if (arg == null) return true;
|
|
46
|
+
if (arg === "") return true;
|
|
57
47
|
return false;
|
|
58
48
|
}
|
|
59
49
|
function isInteger(arg) {
|
|
@@ -115,10 +105,8 @@ function afterPaint(cb = noop) {
|
|
|
115
105
|
return () => cancelAnimationFrame(raf);
|
|
116
106
|
}
|
|
117
107
|
function invariant(condition, message) {
|
|
118
|
-
if (condition)
|
|
119
|
-
|
|
120
|
-
if (typeof message !== "string")
|
|
121
|
-
throw new Error("Invariant failed");
|
|
108
|
+
if (condition) return;
|
|
109
|
+
if (typeof message !== "string") throw new Error("Invariant failed");
|
|
122
110
|
throw new Error(message);
|
|
123
111
|
}
|
|
124
112
|
function getKeys(obj) {
|
|
@@ -126,8 +114,7 @@ function getKeys(obj) {
|
|
|
126
114
|
}
|
|
127
115
|
function isFalsyBooleanCallback(booleanOrCallback, ...args) {
|
|
128
116
|
const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback;
|
|
129
|
-
if (result == null)
|
|
130
|
-
return false;
|
|
117
|
+
if (result == null) return false;
|
|
131
118
|
return !result;
|
|
132
119
|
}
|
|
133
120
|
function disabledFromProps(props) {
|
|
@@ -144,8 +131,7 @@ function removeUndefinedValues(obj) {
|
|
|
144
131
|
}
|
|
145
132
|
function defaultValue(...values) {
|
|
146
133
|
for (const value of values) {
|
|
147
|
-
if (value !== void 0)
|
|
148
|
-
return value;
|
|
134
|
+
if (value !== void 0) return value;
|
|
149
135
|
}
|
|
150
136
|
return void 0;
|
|
151
137
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./D7EIQZAU.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./EQQLU3CG.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./PBFD2E7P.js";
|
|
11
11
|
import {
|
|
12
12
|
__spreadProps,
|
|
13
13
|
__spreadValues
|
|
14
|
-
} from "./
|
|
14
|
+
} from "./3YLGPPWQ.js";
|
|
15
15
|
|
|
16
16
|
// src/menubar/menubar-store.ts
|
|
17
17
|
function createMenubarStore(props = {}) {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
canUseDOM
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./HWOIWM4O.js";
|
|
5
5
|
|
|
6
6
|
// src/utils/platform.ts
|
|
7
7
|
function isTouchDevice() {
|
|
8
8
|
return canUseDOM && !!navigator.maxTouchPoints;
|
|
9
9
|
}
|
|
10
10
|
function isApple() {
|
|
11
|
-
if (!canUseDOM)
|
|
12
|
-
return false;
|
|
11
|
+
if (!canUseDOM) return false;
|
|
13
12
|
return /mac|iphone|ipad|ipod/i.test(navigator.platform);
|
|
14
13
|
}
|
|
15
14
|
function isSafari() {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createStore,
|
|
4
4
|
throwOnConflictingProps
|
|
5
|
-
} from "../__chunks/
|
|
5
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
6
6
|
import {
|
|
7
7
|
defaultValue
|
|
8
|
-
} from "../__chunks/
|
|
8
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
9
9
|
import {
|
|
10
10
|
__spreadProps,
|
|
11
11
|
__spreadValues
|
|
12
|
-
} from "../__chunks/
|
|
12
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
13
13
|
|
|
14
14
|
// src/checkbox/checkbox-store.ts
|
|
15
15
|
function createCheckboxStore(props = {}) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/6DHTHWXD.js";
|
|
5
|
+
import "../__chunks/EQQLU3CG.js";
|
|
6
|
+
import "../__chunks/PBFD2E7P.js";
|
|
7
|
+
import "../__chunks/HWOIWM4O.js";
|
|
8
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
9
9
|
export {
|
|
10
10
|
createCollectionStore
|
|
11
11
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/D7EIQZAU.js";
|
|
5
|
+
import "../__chunks/6DHTHWXD.js";
|
|
6
6
|
import "../__chunks/7PRQYBBV.js";
|
|
7
7
|
import {
|
|
8
8
|
createPopoverStore
|
|
9
|
-
} from "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
11
|
-
import "../__chunks/
|
|
9
|
+
} from "../__chunks/3UYWTADI.js";
|
|
10
|
+
import "../__chunks/YOHCVXJB.js";
|
|
11
|
+
import "../__chunks/6E4KKOSB.js";
|
|
12
12
|
import {
|
|
13
13
|
batch,
|
|
14
14
|
createStore,
|
|
@@ -17,21 +17,21 @@ import {
|
|
|
17
17
|
setup,
|
|
18
18
|
sync,
|
|
19
19
|
throwOnConflictingProps
|
|
20
|
-
} from "../__chunks/
|
|
20
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
21
21
|
import {
|
|
22
22
|
chain,
|
|
23
23
|
defaultValue
|
|
24
|
-
} from "../__chunks/
|
|
24
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
25
25
|
import {
|
|
26
26
|
isSafari,
|
|
27
27
|
isTouchDevice
|
|
28
|
-
} from "../__chunks/
|
|
29
|
-
import "../__chunks/
|
|
28
|
+
} from "../__chunks/US4USQPI.js";
|
|
29
|
+
import "../__chunks/HWOIWM4O.js";
|
|
30
30
|
import {
|
|
31
31
|
__objRest,
|
|
32
32
|
__spreadProps,
|
|
33
33
|
__spreadValues
|
|
34
|
-
} from "../__chunks/
|
|
34
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
35
35
|
|
|
36
36
|
// src/combobox/combobox-store.ts
|
|
37
37
|
var isTouchSafari = isSafari() && isTouchDevice();
|
|
@@ -117,12 +117,10 @@ function createComboboxStore(_a = {}) {
|
|
|
117
117
|
);
|
|
118
118
|
}
|
|
119
119
|
setup(combobox, () => {
|
|
120
|
-
if (!tag)
|
|
121
|
-
return;
|
|
120
|
+
if (!tag) return;
|
|
122
121
|
return chain(
|
|
123
122
|
sync(combobox, ["selectedValue"], (state) => {
|
|
124
|
-
if (!Array.isArray(state.selectedValue))
|
|
125
|
-
return;
|
|
123
|
+
if (!Array.isArray(state.selectedValue)) return;
|
|
126
124
|
tag.setValues(state.selectedValue);
|
|
127
125
|
}),
|
|
128
126
|
sync(tag, ["values"], (state) => {
|
|
@@ -133,18 +131,15 @@ function createComboboxStore(_a = {}) {
|
|
|
133
131
|
setup(
|
|
134
132
|
combobox,
|
|
135
133
|
() => sync(combobox, ["resetValueOnHide", "mounted"], (state) => {
|
|
136
|
-
if (!state.resetValueOnHide)
|
|
137
|
-
|
|
138
|
-
if (state.mounted)
|
|
139
|
-
return;
|
|
134
|
+
if (!state.resetValueOnHide) return;
|
|
135
|
+
if (state.mounted) return;
|
|
140
136
|
combobox.setState("value", value);
|
|
141
137
|
})
|
|
142
138
|
);
|
|
143
139
|
setup(
|
|
144
140
|
combobox,
|
|
145
141
|
() => batch(combobox, ["mounted"], (state) => {
|
|
146
|
-
if (state.mounted)
|
|
147
|
-
return;
|
|
142
|
+
if (state.mounted) return;
|
|
148
143
|
combobox.setState("activeId", activeId);
|
|
149
144
|
combobox.setState("moves", 0);
|
|
150
145
|
})
|
|
@@ -160,8 +155,7 @@ function createComboboxStore(_a = {}) {
|
|
|
160
155
|
setup(
|
|
161
156
|
combobox,
|
|
162
157
|
() => batch(combobox, ["moves", "renderedItems"], (state, prev) => {
|
|
163
|
-
if (state.moves === prev.moves)
|
|
164
|
-
return;
|
|
158
|
+
if (state.moves === prev.moves) return;
|
|
165
159
|
const { activeId: activeId2 } = combobox.getState();
|
|
166
160
|
const activeItem = composite.item(activeId2);
|
|
167
161
|
combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/3UYWTADI.js";
|
|
5
|
+
import "../__chunks/YOHCVXJB.js";
|
|
6
|
+
import "../__chunks/6E4KKOSB.js";
|
|
7
|
+
import "../__chunks/EQQLU3CG.js";
|
|
8
|
+
import "../__chunks/PBFD2E7P.js";
|
|
9
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
10
10
|
|
|
11
11
|
// src/composite/composite-overflow-store.ts
|
|
12
12
|
function createCompositeOverflowStore(props = {}) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/D7EIQZAU.js";
|
|
5
|
+
import "../__chunks/6DHTHWXD.js";
|
|
6
6
|
import "../__chunks/7PRQYBBV.js";
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
7
|
+
import "../__chunks/EQQLU3CG.js";
|
|
8
|
+
import "../__chunks/PBFD2E7P.js";
|
|
9
|
+
import "../__chunks/HWOIWM4O.js";
|
|
10
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
11
11
|
export {
|
|
12
12
|
createCompositeStore
|
|
13
13
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDialogStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/YOHCVXJB.js";
|
|
5
|
+
import "../__chunks/6E4KKOSB.js";
|
|
6
|
+
import "../__chunks/EQQLU3CG.js";
|
|
7
|
+
import "../__chunks/PBFD2E7P.js";
|
|
8
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
9
9
|
export {
|
|
10
10
|
createDialogStore
|
|
11
11
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDisclosureStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/6E4KKOSB.js";
|
|
5
|
+
import "../__chunks/EQQLU3CG.js";
|
|
6
|
+
import "../__chunks/PBFD2E7P.js";
|
|
7
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
8
8
|
export {
|
|
9
9
|
createDisclosureStore
|
|
10
10
|
};
|
package/esm/form/form-store.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/6DHTHWXD.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
init,
|
|
8
8
|
setup,
|
|
9
9
|
throwOnConflictingProps
|
|
10
|
-
} from "../__chunks/
|
|
10
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
11
11
|
import {
|
|
12
12
|
applyState,
|
|
13
13
|
defaultValue,
|
|
14
14
|
isInteger,
|
|
15
15
|
isObject
|
|
16
|
-
} from "../__chunks/
|
|
17
|
-
import "../__chunks/
|
|
16
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
17
|
+
import "../__chunks/HWOIWM4O.js";
|
|
18
18
|
import {
|
|
19
19
|
__spreadProps,
|
|
20
20
|
__spreadValues
|
|
21
|
-
} from "../__chunks/
|
|
21
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
22
22
|
|
|
23
23
|
// src/form/form-store.ts
|
|
24
24
|
function nextFrame() {
|
|
@@ -45,8 +45,7 @@ function get(values, path, defaultValue2) {
|
|
|
45
45
|
}
|
|
46
46
|
function set(values, path, value) {
|
|
47
47
|
const [k, ...rest] = Array.isArray(path) ? path : `${path}`.split(".");
|
|
48
|
-
if (k == null)
|
|
49
|
-
return values;
|
|
48
|
+
if (k == null) return values;
|
|
50
49
|
const key = k;
|
|
51
50
|
const isIntegerKey = isInteger(key);
|
|
52
51
|
const nextValues = isIntegerKey ? values || [] : values || {};
|
|
@@ -175,8 +174,7 @@ function createFormStore(props = {}) {
|
|
|
175
174
|
setValue: (name, value) => form.setState("values", (values2) => {
|
|
176
175
|
const prevValue = get(values2, name);
|
|
177
176
|
const nextValue = applyState(value, prevValue);
|
|
178
|
-
if (nextValue === prevValue)
|
|
179
|
-
return values2;
|
|
177
|
+
if (nextValue === prevValue) return values2;
|
|
180
178
|
return set(values2, name, nextValue);
|
|
181
179
|
}),
|
|
182
180
|
pushValue: (name, value) => form.setState("values", (values2) => {
|
|
@@ -196,8 +194,7 @@ function createFormStore(props = {}) {
|
|
|
196
194
|
setError: (name, error) => form.setState("errors", (errors2) => {
|
|
197
195
|
const prevError = get(errors2, name);
|
|
198
196
|
const nextError = applyState(error, prevError);
|
|
199
|
-
if (nextError === prevError)
|
|
200
|
-
return errors2;
|
|
197
|
+
if (nextError === prevError) return errors2;
|
|
201
198
|
return set(errors2, name, nextError);
|
|
202
199
|
}),
|
|
203
200
|
setTouched: (touched2) => form.setState("touched", touched2),
|
|
@@ -205,8 +202,7 @@ function createFormStore(props = {}) {
|
|
|
205
202
|
setFieldTouched: (name, value) => form.setState("touched", (touched2) => {
|
|
206
203
|
const prevValue = get(touched2, name);
|
|
207
204
|
const nextValue = applyState(value, prevValue);
|
|
208
|
-
if (nextValue === prevValue)
|
|
209
|
-
return touched2;
|
|
205
|
+
if (nextValue === prevValue) return touched2;
|
|
210
206
|
return set(touched2, name, nextValue);
|
|
211
207
|
}),
|
|
212
208
|
onValidate: (callback) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createHovercardStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/EACLTACN.js";
|
|
5
|
+
import "../__chunks/3UYWTADI.js";
|
|
6
|
+
import "../__chunks/YOHCVXJB.js";
|
|
7
|
+
import "../__chunks/6E4KKOSB.js";
|
|
8
|
+
import "../__chunks/EQQLU3CG.js";
|
|
9
|
+
import "../__chunks/PBFD2E7P.js";
|
|
10
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
11
11
|
export {
|
|
12
12
|
createHovercardStore
|
|
13
13
|
};
|
package/esm/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createMenubarStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/PIWLWQMB.js";
|
|
5
|
+
import "../__chunks/D7EIQZAU.js";
|
|
6
|
+
import "../__chunks/6DHTHWXD.js";
|
|
7
7
|
import "../__chunks/7PRQYBBV.js";
|
|
8
|
-
import "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
11
|
-
import "../__chunks/
|
|
8
|
+
import "../__chunks/EQQLU3CG.js";
|
|
9
|
+
import "../__chunks/PBFD2E7P.js";
|
|
10
|
+
import "../__chunks/HWOIWM4O.js";
|
|
11
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
12
12
|
|
|
13
13
|
// src/menu/menu-bar-store.ts
|
|
14
14
|
function createMenuBarStore(props = {}) {
|