@wrdagency/blockout 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2NBKRL7C-DnAMmXv4.js +81 -0
- package/dist/CaretDown.es-eySGHzTJ.js +32 -0
- package/dist/CaretUp.es-Cy8czlHG.js +32 -0
- package/dist/P7GR5CS5-BryEvRCz.js +621 -0
- package/dist/SSRBase.es-BUXS72ra.js +33 -0
- package/dist/T7VMP3TM--1s529fr.js +3544 -0
- package/dist/UQQRIHDV-Bfi_RJby.js +1046 -0
- package/dist/VIIRIBF3-XWA2y8Hu.js +21 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/assets/index.css +1 -0
- package/dist/assets/index10.css +1 -0
- package/dist/assets/index11.css +1 -0
- package/dist/assets/index2.css +1 -0
- package/dist/assets/index3.css +1 -0
- package/dist/assets/index4.css +1 -0
- package/dist/assets/index5.css +1 -0
- package/dist/assets/index6.css +1 -0
- package/dist/assets/index7.css +1 -0
- package/dist/assets/index8.css +1 -0
- package/dist/assets/index9.css +1 -0
- package/dist/components/button/index.d.ts +9 -0
- package/dist/components/button/index.js +28 -0
- package/dist/components/button-group/index.d.ts +6 -0
- package/dist/components/button-group/index.js +6 -0
- package/dist/components/controls/base-control/index.d.ts +3 -0
- package/dist/components/controls/base-control/index.js +26 -0
- package/dist/components/controls/base-control/props.d.ts +23 -0
- package/dist/components/controls/base-control/props.js +21 -0
- package/dist/components/controls/index.d.ts +6 -0
- package/dist/components/controls/index.js +14 -0
- package/dist/components/controls/number-control/index.d.ts +6 -0
- package/dist/components/controls/number-control/index.js +52 -0
- package/dist/components/controls/select-control/index.d.ts +9 -0
- package/dist/components/controls/select-control/index.js +591 -0
- package/dist/components/controls/select-control/options.d.ts +11 -0
- package/dist/components/controls/select-control/options.js +12 -0
- package/dist/components/controls/text-control/index.d.ts +6 -0
- package/dist/components/controls/text-control/index.js +12 -0
- package/dist/components/controls/textarea-control/index.d.ts +6 -0
- package/dist/components/controls/textarea-control/index.js +18 -0
- package/dist/components/controls/toggle-control/index.d.ts +8 -0
- package/dist/components/controls/toggle-control/index.js +46 -0
- package/dist/components/data-table/column.d.ts +4 -0
- package/dist/components/data-table/column.js +874 -0
- package/dist/components/data-table/context.d.ts +7 -0
- package/dist/components/data-table/context.js +36 -0
- package/dist/components/data-table/example.d.ts +1 -0
- package/dist/components/data-table/example.js +5 -0
- package/dist/components/data-table/footer.d.ts +2 -0
- package/dist/components/data-table/footer.js +23 -0
- package/dist/components/data-table/header.d.ts +7 -0
- package/dist/components/data-table/header.js +408 -0
- package/dist/components/data-table/index.d.ts +10 -0
- package/dist/components/data-table/index.js +86 -0
- package/dist/components/data-table/types.d.ts +75 -0
- package/dist/components/data-table/types.js +1 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +23 -0
- package/dist/components/menu/icon.d.ts +4 -0
- package/dist/components/menu/icon.js +6 -0
- package/dist/components/menu/index.d.ts +8 -0
- package/dist/components/menu/index.js +131 -0
- package/dist/components/menu/item.d.ts +7 -0
- package/dist/components/menu/item.js +8 -0
- package/dist/components/menu/items/action.d.ts +7 -0
- package/dist/components/menu/items/action.js +23 -0
- package/dist/components/menu/items/spacer.d.ts +2 -0
- package/dist/components/menu/items/spacer.js +46 -0
- package/dist/components/menu/items/submenu.d.ts +7 -0
- package/dist/components/menu/items/submenu.js +7 -0
- package/dist/components/menu/items/toggle.d.ts +7 -0
- package/dist/components/menu/items/toggle.js +109 -0
- package/dist/components/menu/types.d.ts +28 -0
- package/dist/components/menu/types.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +25 -0
- package/dist/item-CPVd5mKo.js +758 -0
- package/dist/primitives/draggable/index.d.ts +17 -0
- package/dist/primitives/draggable/index.js +52 -0
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.js +4 -0
- package/dist/primitives/resizable/index.d.ts +7 -0
- package/dist/primitives/resizable/index.js +76 -0
- package/dist/types/component.d.ts +4 -0
- package/dist/types/component.js +1 -0
- package/dist/types/math.d.ts +10 -0
- package/dist/types/math.js +1 -0
- package/dist/utils/css.d.ts +1 -0
- package/dist/utils/css.js +6 -0
- package/dist/utils/noop.d.ts +1 -0
- package/dist/utils/noop.js +5 -0
- package/package.json +61 -0
- package/readme.md +3 -0
|
@@ -0,0 +1,1046 @@
|
|
|
1
|
+
import { i as He, U as j, V as gt, W as Et, X as yt, M as Ae, S as ht, y as It, A as Ue, Y as wt, Z as je, v as be, h as B, j as D, e as A, O as _t, $ as he, n as xt, b as ee, _ as U, a0 as Tt, r as qe, s as te, t as ce, f as re, d as ne, a1 as oe, R as ze, a2 as Ct, a3 as Ge, N as De, G as Ie, a4 as $e, a5 as Z, D as ie, H as W, a6 as Ot, a7 as Pt, a8 as We, a9 as At, aa as Dt, ab as Fe, p as Ye, ac as Ft, ad as ve, u as ae, ae as Lt, af as Mt, E as kt, ag as Kt, ah as Rt, m as Xe, L as Vt } from "./P7GR5CS5-BryEvRCz.js";
|
|
2
|
+
import * as $ from "react";
|
|
3
|
+
import Je, { useRef as Y, useEffect as G, createContext as Nt, useState as me, useContext as Ze, useMemo as Qe, useCallback as et } from "react";
|
|
4
|
+
import { g as Bt } from "./_commonjsHelpers-C6fGbg64.js";
|
|
5
|
+
import { jsx as Ht } from "react/jsx-runtime";
|
|
6
|
+
function q(e, t) {
|
|
7
|
+
const r = e.__unstableInternals;
|
|
8
|
+
return He(r, "Invalid store"), r[t];
|
|
9
|
+
}
|
|
10
|
+
function Se(e, ...t) {
|
|
11
|
+
let r = e, n = r, o = Symbol(), s = wt;
|
|
12
|
+
const l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), f = (E) => (p.add(E), () => p.delete(E)), g = () => {
|
|
13
|
+
const E = l.size, I = Symbol();
|
|
14
|
+
l.add(I);
|
|
15
|
+
const C = () => {
|
|
16
|
+
l.delete(I), !l.size && s();
|
|
17
|
+
};
|
|
18
|
+
if (E) return C;
|
|
19
|
+
const F = yt(r).map(
|
|
20
|
+
(O) => Ae(
|
|
21
|
+
...t.map((N) => {
|
|
22
|
+
var a;
|
|
23
|
+
const y = (a = N == null ? void 0 : N.getState) == null ? void 0 : a.call(N);
|
|
24
|
+
if (y && j(y, O))
|
|
25
|
+
return nt(N, [O], (T) => {
|
|
26
|
+
k(
|
|
27
|
+
O,
|
|
28
|
+
T[O],
|
|
29
|
+
// @ts-expect-error - Not public API. This is just to prevent
|
|
30
|
+
// infinite loops.
|
|
31
|
+
!0
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
})
|
|
35
|
+
)
|
|
36
|
+
), L = [];
|
|
37
|
+
for (const O of p)
|
|
38
|
+
L.push(O());
|
|
39
|
+
const V = t.map(tt);
|
|
40
|
+
return s = Ae(...F, ...L, ...V), C;
|
|
41
|
+
}, d = (E, I, C = m) => (C.add(I), v.set(I, E), () => {
|
|
42
|
+
var F;
|
|
43
|
+
(F = i.get(I)) == null || F(), i.delete(I), v.delete(I), C.delete(I);
|
|
44
|
+
}), S = (E, I) => d(E, I), w = (E, I) => (i.set(I, I(r, r)), d(E, I)), P = (E, I) => (i.set(I, I(r, n)), d(E, I, b)), h = (E) => Se(Et(r, E), R), M = (E) => Se(gt(r, E), R), K = () => r, k = (E, I, C = !1) => {
|
|
45
|
+
var F;
|
|
46
|
+
if (!j(r, E)) return;
|
|
47
|
+
const L = ht(I, r[E]);
|
|
48
|
+
if (L === r[E]) return;
|
|
49
|
+
if (!C)
|
|
50
|
+
for (const a of t)
|
|
51
|
+
(F = a == null ? void 0 : a.setState) == null || F.call(a, E, L);
|
|
52
|
+
const V = r;
|
|
53
|
+
r = It(Ue({}, r), { [E]: L });
|
|
54
|
+
const O = Symbol();
|
|
55
|
+
o = O, c.add(E);
|
|
56
|
+
const N = (a, y, T) => {
|
|
57
|
+
var u;
|
|
58
|
+
const _ = v.get(a), x = (z) => T ? T.has(z) : z === E;
|
|
59
|
+
(!_ || _.some(x)) && ((u = i.get(a)) == null || u(), i.set(a, a(r, y)));
|
|
60
|
+
};
|
|
61
|
+
for (const a of m)
|
|
62
|
+
N(a, V);
|
|
63
|
+
queueMicrotask(() => {
|
|
64
|
+
if (o !== O) return;
|
|
65
|
+
const a = r;
|
|
66
|
+
for (const y of b)
|
|
67
|
+
N(y, n, c);
|
|
68
|
+
n = a, c.clear();
|
|
69
|
+
});
|
|
70
|
+
}, R = {
|
|
71
|
+
getState: K,
|
|
72
|
+
setState: k,
|
|
73
|
+
__unstableInternals: {
|
|
74
|
+
setup: f,
|
|
75
|
+
init: g,
|
|
76
|
+
subscribe: S,
|
|
77
|
+
sync: w,
|
|
78
|
+
batch: P,
|
|
79
|
+
pick: h,
|
|
80
|
+
omit: M
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
return R;
|
|
84
|
+
}
|
|
85
|
+
function Mr(e, ...t) {
|
|
86
|
+
if (e)
|
|
87
|
+
return q(e, "setup")(...t);
|
|
88
|
+
}
|
|
89
|
+
function tt(e, ...t) {
|
|
90
|
+
if (e)
|
|
91
|
+
return q(e, "init")(...t);
|
|
92
|
+
}
|
|
93
|
+
function rt(e, ...t) {
|
|
94
|
+
if (e)
|
|
95
|
+
return q(e, "subscribe")(...t);
|
|
96
|
+
}
|
|
97
|
+
function nt(e, ...t) {
|
|
98
|
+
if (e)
|
|
99
|
+
return q(e, "sync")(...t);
|
|
100
|
+
}
|
|
101
|
+
function Ut(e, ...t) {
|
|
102
|
+
if (e)
|
|
103
|
+
return q(e, "batch")(...t);
|
|
104
|
+
}
|
|
105
|
+
function kr(e, ...t) {
|
|
106
|
+
if (e)
|
|
107
|
+
return q(e, "omit")(...t);
|
|
108
|
+
}
|
|
109
|
+
function Kr(e, ...t) {
|
|
110
|
+
if (e)
|
|
111
|
+
return q(e, "pick")(...t);
|
|
112
|
+
}
|
|
113
|
+
function Rr(...e) {
|
|
114
|
+
const t = e.reduce((n, o) => {
|
|
115
|
+
var s;
|
|
116
|
+
const l = (s = o == null ? void 0 : o.getState) == null ? void 0 : s.call(o);
|
|
117
|
+
return l ? Object.assign(n, l) : n;
|
|
118
|
+
}, {}), r = Se(t, ...e);
|
|
119
|
+
return Object.assign({}, ...e, r);
|
|
120
|
+
}
|
|
121
|
+
function Vr(e, t) {
|
|
122
|
+
if (process.env.NODE_ENV === "production" || !t) return;
|
|
123
|
+
const r = Object.entries(e).filter(([s, l]) => s.startsWith("default") && l !== void 0).map(([s]) => {
|
|
124
|
+
var l;
|
|
125
|
+
const c = s.replace("default", "");
|
|
126
|
+
return `${((l = c[0]) == null ? void 0 : l.toLowerCase()) || ""}${c.slice(1)}`;
|
|
127
|
+
});
|
|
128
|
+
if (!r.length) return;
|
|
129
|
+
const n = t.getState();
|
|
130
|
+
if (r.filter(
|
|
131
|
+
(s) => j(n, s)
|
|
132
|
+
).length)
|
|
133
|
+
throw new Error(
|
|
134
|
+
`Passing a store prop in conjunction with a default state is not supported.
|
|
135
|
+
|
|
136
|
+
const store = useSelectStore();
|
|
137
|
+
<SelectProvider store={store} defaultValue="Apple" />
|
|
138
|
+
^ ^
|
|
139
|
+
|
|
140
|
+
Instead, pass the default state to the topmost store:
|
|
141
|
+
|
|
142
|
+
const store = useSelectStore({ defaultValue: "Apple" });
|
|
143
|
+
<SelectProvider store={store} />
|
|
144
|
+
|
|
145
|
+
See https://github.com/ariakit/ariakit/pull/2745 for more details.
|
|
146
|
+
|
|
147
|
+
If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit
|
|
148
|
+
`
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
var ue = { exports: {} }, fe = {};
|
|
152
|
+
/**
|
|
153
|
+
* @license React
|
|
154
|
+
* use-sync-external-store-shim.production.js
|
|
155
|
+
*
|
|
156
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the MIT license found in the
|
|
159
|
+
* LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/
|
|
161
|
+
var Le;
|
|
162
|
+
function jt() {
|
|
163
|
+
if (Le) return fe;
|
|
164
|
+
Le = 1;
|
|
165
|
+
var e = Je;
|
|
166
|
+
function t(i, v) {
|
|
167
|
+
return i === v && (i !== 0 || 1 / i === 1 / v) || i !== i && v !== v;
|
|
168
|
+
}
|
|
169
|
+
var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, s = e.useLayoutEffect, l = e.useDebugValue;
|
|
170
|
+
function c(i, v) {
|
|
171
|
+
var f = v(), g = n({ inst: { value: f, getSnapshot: v } }), d = g[0].inst, S = g[1];
|
|
172
|
+
return s(
|
|
173
|
+
function() {
|
|
174
|
+
d.value = f, d.getSnapshot = v, p(d) && S({ inst: d });
|
|
175
|
+
},
|
|
176
|
+
[i, f, v]
|
|
177
|
+
), o(
|
|
178
|
+
function() {
|
|
179
|
+
return p(d) && S({ inst: d }), i(function() {
|
|
180
|
+
p(d) && S({ inst: d });
|
|
181
|
+
});
|
|
182
|
+
},
|
|
183
|
+
[i]
|
|
184
|
+
), l(f), f;
|
|
185
|
+
}
|
|
186
|
+
function p(i) {
|
|
187
|
+
var v = i.getSnapshot;
|
|
188
|
+
i = i.value;
|
|
189
|
+
try {
|
|
190
|
+
var f = v();
|
|
191
|
+
return !r(i, f);
|
|
192
|
+
} catch {
|
|
193
|
+
return !0;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function m(i, v) {
|
|
197
|
+
return v();
|
|
198
|
+
}
|
|
199
|
+
var b = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? m : c;
|
|
200
|
+
return fe.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : b, fe;
|
|
201
|
+
}
|
|
202
|
+
var de = {};
|
|
203
|
+
/**
|
|
204
|
+
* @license React
|
|
205
|
+
* use-sync-external-store-shim.development.js
|
|
206
|
+
*
|
|
207
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the MIT license found in the
|
|
210
|
+
* LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/
|
|
212
|
+
var Me;
|
|
213
|
+
function qt() {
|
|
214
|
+
return Me || (Me = 1, process.env.NODE_ENV !== "production" && function() {
|
|
215
|
+
function e(f, g) {
|
|
216
|
+
return f === g && (f !== 0 || 1 / f === 1 / g) || f !== f && g !== g;
|
|
217
|
+
}
|
|
218
|
+
function t(f, g) {
|
|
219
|
+
b || o.startTransition === void 0 || (b = !0, console.error(
|
|
220
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
221
|
+
));
|
|
222
|
+
var d = g();
|
|
223
|
+
if (!i) {
|
|
224
|
+
var S = g();
|
|
225
|
+
s(d, S) || (console.error(
|
|
226
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
227
|
+
), i = !0);
|
|
228
|
+
}
|
|
229
|
+
S = l({
|
|
230
|
+
inst: { value: d, getSnapshot: g }
|
|
231
|
+
});
|
|
232
|
+
var w = S[0].inst, P = S[1];
|
|
233
|
+
return p(
|
|
234
|
+
function() {
|
|
235
|
+
w.value = d, w.getSnapshot = g, r(w) && P({ inst: w });
|
|
236
|
+
},
|
|
237
|
+
[f, d, g]
|
|
238
|
+
), c(
|
|
239
|
+
function() {
|
|
240
|
+
return r(w) && P({ inst: w }), f(function() {
|
|
241
|
+
r(w) && P({ inst: w });
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
[f]
|
|
245
|
+
), m(d), d;
|
|
246
|
+
}
|
|
247
|
+
function r(f) {
|
|
248
|
+
var g = f.getSnapshot;
|
|
249
|
+
f = f.value;
|
|
250
|
+
try {
|
|
251
|
+
var d = g();
|
|
252
|
+
return !s(f, d);
|
|
253
|
+
} catch {
|
|
254
|
+
return !0;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function n(f, g) {
|
|
258
|
+
return g();
|
|
259
|
+
}
|
|
260
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
261
|
+
var o = Je, s = typeof Object.is == "function" ? Object.is : e, l = o.useState, c = o.useEffect, p = o.useLayoutEffect, m = o.useDebugValue, b = !1, i = !1, v = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? n : t;
|
|
262
|
+
de.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : v, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
263
|
+
}()), de;
|
|
264
|
+
}
|
|
265
|
+
var ke;
|
|
266
|
+
function zt() {
|
|
267
|
+
return ke || (ke = 1, process.env.NODE_ENV === "production" ? ue.exports = jt() : ue.exports = qt()), ue.exports;
|
|
268
|
+
}
|
|
269
|
+
var Gt = zt();
|
|
270
|
+
const $t = /* @__PURE__ */ Bt(Gt);
|
|
271
|
+
var { useSyncExternalStore: ot } = $t, st = () => () => {
|
|
272
|
+
};
|
|
273
|
+
function Wt(e, t = je) {
|
|
274
|
+
const r = $.useCallback(
|
|
275
|
+
(o) => e ? rt(e, null, o) : st(),
|
|
276
|
+
[e]
|
|
277
|
+
), n = () => {
|
|
278
|
+
const o = typeof t == "string" ? t : null, s = typeof t == "function" ? t : null, l = e == null ? void 0 : e.getState();
|
|
279
|
+
if (s) return s(l);
|
|
280
|
+
if (l && o && j(l, o))
|
|
281
|
+
return l[o];
|
|
282
|
+
};
|
|
283
|
+
return ot(r, n, n);
|
|
284
|
+
}
|
|
285
|
+
function Yt(e, t) {
|
|
286
|
+
const r = $.useRef(
|
|
287
|
+
{}
|
|
288
|
+
), n = $.useCallback(
|
|
289
|
+
(s) => e ? rt(e, null, s) : st(),
|
|
290
|
+
[e]
|
|
291
|
+
), o = () => {
|
|
292
|
+
const s = e == null ? void 0 : e.getState();
|
|
293
|
+
let l = !1;
|
|
294
|
+
const c = r.current;
|
|
295
|
+
for (const p in t) {
|
|
296
|
+
const m = t[p];
|
|
297
|
+
if (typeof m == "function") {
|
|
298
|
+
const b = m(s);
|
|
299
|
+
b !== c[p] && (c[p] = b, l = !0);
|
|
300
|
+
}
|
|
301
|
+
if (typeof m == "string") {
|
|
302
|
+
if (!s || !j(s, m)) continue;
|
|
303
|
+
const b = s[m];
|
|
304
|
+
b !== c[p] && (c[p] = b, l = !0);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return l && (r.current = D({}, c)), r.current;
|
|
308
|
+
};
|
|
309
|
+
return ot(n, o, o);
|
|
310
|
+
}
|
|
311
|
+
function Nr(e, t, r, n) {
|
|
312
|
+
const o = j(t, r) ? t[r] : void 0, s = n ? t[n] : void 0, l = _t({ value: o, setValue: s });
|
|
313
|
+
be(() => nt(e, [r], (c, p) => {
|
|
314
|
+
const { value: m, setValue: b } = l.current;
|
|
315
|
+
b && c[r] !== p[r] && c[r] !== m && b(c[r]);
|
|
316
|
+
}), [e, r]), be(() => {
|
|
317
|
+
if (o !== void 0)
|
|
318
|
+
return e.setState(r, o), Ut(e, [r], () => {
|
|
319
|
+
o !== void 0 && e.setState(r, o);
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
function Br(e, t) {
|
|
324
|
+
const [r, n] = $.useState(() => e(t));
|
|
325
|
+
be(() => tt(r), [r]);
|
|
326
|
+
const o = $.useCallback(
|
|
327
|
+
(c) => Wt(r, c),
|
|
328
|
+
[r]
|
|
329
|
+
), s = $.useMemo(
|
|
330
|
+
() => B(D({}, r), { useState: o }),
|
|
331
|
+
[r, o]
|
|
332
|
+
), l = A(() => {
|
|
333
|
+
n((c) => e(D(D({}, t), c.getState())));
|
|
334
|
+
});
|
|
335
|
+
return [s, l];
|
|
336
|
+
}
|
|
337
|
+
var Xt = { id: null };
|
|
338
|
+
function Hr(e, t, r = !1) {
|
|
339
|
+
const n = e.findIndex((o) => o.id === t);
|
|
340
|
+
return [
|
|
341
|
+
...e.slice(n + 1),
|
|
342
|
+
...r ? [Xt] : [],
|
|
343
|
+
...e.slice(0, n)
|
|
344
|
+
];
|
|
345
|
+
}
|
|
346
|
+
function Ur(e, t) {
|
|
347
|
+
return e.find((r) => !r.disabled);
|
|
348
|
+
}
|
|
349
|
+
function Jt(e, t) {
|
|
350
|
+
return t && e.item(t) || null;
|
|
351
|
+
}
|
|
352
|
+
function jr(e) {
|
|
353
|
+
const t = [];
|
|
354
|
+
for (const r of e) {
|
|
355
|
+
const n = t.find((o) => {
|
|
356
|
+
var s;
|
|
357
|
+
return ((s = o[0]) == null ? void 0 : s.rowId) === r.rowId;
|
|
358
|
+
});
|
|
359
|
+
n ? n.push(r) : t.push([r]);
|
|
360
|
+
}
|
|
361
|
+
return t;
|
|
362
|
+
}
|
|
363
|
+
function Zt(e, t = !1) {
|
|
364
|
+
if (he(e))
|
|
365
|
+
e.setSelectionRange(
|
|
366
|
+
t ? e.value.length : 0,
|
|
367
|
+
e.value.length
|
|
368
|
+
);
|
|
369
|
+
else if (e.isContentEditable) {
|
|
370
|
+
const r = xt(e).getSelection();
|
|
371
|
+
r == null || r.selectAllChildren(e), t && (r == null || r.collapseToEnd());
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
var ge = Symbol("FOCUS_SILENTLY");
|
|
375
|
+
function Qt(e) {
|
|
376
|
+
e[ge] = !0, e.focus({ preventScroll: !0 });
|
|
377
|
+
}
|
|
378
|
+
function qr(e) {
|
|
379
|
+
const t = e[ge];
|
|
380
|
+
return delete e[ge], t;
|
|
381
|
+
}
|
|
382
|
+
function ut(e, t, r) {
|
|
383
|
+
return !(!t || t === r || !e.item(t.id));
|
|
384
|
+
}
|
|
385
|
+
var er = "div", it = ee(
|
|
386
|
+
function(t) {
|
|
387
|
+
var r = t, {
|
|
388
|
+
store: n,
|
|
389
|
+
shouldRegisterItem: o = !0,
|
|
390
|
+
getItem: s = je,
|
|
391
|
+
element: l
|
|
392
|
+
} = r, c = U(r, [
|
|
393
|
+
"store",
|
|
394
|
+
"shouldRegisterItem",
|
|
395
|
+
"getItem",
|
|
396
|
+
// @ts-expect-error This prop may come from a collection renderer.
|
|
397
|
+
"element"
|
|
398
|
+
]);
|
|
399
|
+
const p = Tt();
|
|
400
|
+
n = n || p;
|
|
401
|
+
const m = qe(c.id), b = Y(l);
|
|
402
|
+
return G(() => {
|
|
403
|
+
const i = b.current;
|
|
404
|
+
if (!m || !i || !o) return;
|
|
405
|
+
const v = s({ id: m, element: i });
|
|
406
|
+
return n == null ? void 0 : n.renderItem(v);
|
|
407
|
+
}, [m, o, s, n]), c = B(D({}, c), {
|
|
408
|
+
ref: te(b, c.ref)
|
|
409
|
+
}), ce(c);
|
|
410
|
+
}
|
|
411
|
+
);
|
|
412
|
+
re(function(t) {
|
|
413
|
+
const r = it(t);
|
|
414
|
+
return ne(er, r);
|
|
415
|
+
});
|
|
416
|
+
var tr = Nt(!0), le = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
|
|
417
|
+
function rr(e) {
|
|
418
|
+
return Number.parseInt(e.getAttribute("tabindex") || "0", 10) < 0;
|
|
419
|
+
}
|
|
420
|
+
function X(e) {
|
|
421
|
+
return !(!e.matches(le) || !Ct(e) || e.closest("[inert]"));
|
|
422
|
+
}
|
|
423
|
+
function Q(e) {
|
|
424
|
+
if (!X(e) || rr(e)) return !1;
|
|
425
|
+
if (!("form" in e) || !e.form || e.checked || e.type !== "radio") return !0;
|
|
426
|
+
const t = e.form.elements.namedItem(e.name);
|
|
427
|
+
if (!t || !("length" in t)) return !0;
|
|
428
|
+
const r = oe(e);
|
|
429
|
+
return !r || r === e || !("form" in r) || r.form !== e.form || r.name !== e.name;
|
|
430
|
+
}
|
|
431
|
+
function we(e, t) {
|
|
432
|
+
const r = Array.from(
|
|
433
|
+
e.querySelectorAll(le)
|
|
434
|
+
);
|
|
435
|
+
t && r.unshift(e);
|
|
436
|
+
const n = r.filter(X);
|
|
437
|
+
return n.forEach((o, s) => {
|
|
438
|
+
if (Ge(o) && o.contentDocument) {
|
|
439
|
+
const l = o.contentDocument.body;
|
|
440
|
+
n.splice(s, 1, ...we(l));
|
|
441
|
+
}
|
|
442
|
+
}), n;
|
|
443
|
+
}
|
|
444
|
+
function _e(e, t, r) {
|
|
445
|
+
const n = Array.from(
|
|
446
|
+
e.querySelectorAll(le)
|
|
447
|
+
), o = n.filter(Q);
|
|
448
|
+
return t && Q(e) && o.unshift(e), o.forEach((s, l) => {
|
|
449
|
+
if (Ge(s) && s.contentDocument) {
|
|
450
|
+
const c = s.contentDocument.body, p = _e(
|
|
451
|
+
c,
|
|
452
|
+
!1,
|
|
453
|
+
r
|
|
454
|
+
);
|
|
455
|
+
o.splice(l, 1, ...p);
|
|
456
|
+
}
|
|
457
|
+
}), !o.length && r ? n : o;
|
|
458
|
+
}
|
|
459
|
+
function zr(e, t, r) {
|
|
460
|
+
const [n] = _e(
|
|
461
|
+
e,
|
|
462
|
+
t,
|
|
463
|
+
r
|
|
464
|
+
);
|
|
465
|
+
return n || null;
|
|
466
|
+
}
|
|
467
|
+
function nr(e, t, r, n) {
|
|
468
|
+
const o = oe(e), s = we(e, t), l = s.indexOf(o), c = s.slice(l + 1);
|
|
469
|
+
return c.find(Q) || (r ? s.find(Q) : null) || (n ? c[0] : null) || null;
|
|
470
|
+
}
|
|
471
|
+
function Gr(e, t) {
|
|
472
|
+
return nr(
|
|
473
|
+
document.body,
|
|
474
|
+
!1,
|
|
475
|
+
e,
|
|
476
|
+
t
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
function or(e, t, r, n) {
|
|
480
|
+
const o = oe(e), s = we(e, t).reverse(), l = s.indexOf(o);
|
|
481
|
+
return s.slice(l + 1).find(Q) || null || null || null;
|
|
482
|
+
}
|
|
483
|
+
function $r(e, t) {
|
|
484
|
+
return or(
|
|
485
|
+
document.body,
|
|
486
|
+
!1
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
function sr(e) {
|
|
490
|
+
for (; e && !X(e); )
|
|
491
|
+
e = e.closest(le);
|
|
492
|
+
return e || null;
|
|
493
|
+
}
|
|
494
|
+
function Ee(e) {
|
|
495
|
+
const t = oe(e);
|
|
496
|
+
if (!t) return !1;
|
|
497
|
+
if (t === e) return !0;
|
|
498
|
+
const r = t.getAttribute("aria-activedescendant");
|
|
499
|
+
return r ? r === e.id : !1;
|
|
500
|
+
}
|
|
501
|
+
function at(e) {
|
|
502
|
+
const t = oe(e);
|
|
503
|
+
if (!t) return !1;
|
|
504
|
+
if (ze(e, t)) return !0;
|
|
505
|
+
const r = t.getAttribute("aria-activedescendant");
|
|
506
|
+
return !r || !("id" in e) ? !1 : r === e.id ? !0 : !!e.querySelector(`#${CSS.escape(r)}`);
|
|
507
|
+
}
|
|
508
|
+
function ur(e) {
|
|
509
|
+
!at(e) && X(e) && e.focus();
|
|
510
|
+
}
|
|
511
|
+
function ir(e) {
|
|
512
|
+
var t;
|
|
513
|
+
const r = (t = e.getAttribute("tabindex")) != null ? t : "";
|
|
514
|
+
e.setAttribute("data-tabindex", r), e.setAttribute("tabindex", "-1");
|
|
515
|
+
}
|
|
516
|
+
function Wr(e, t) {
|
|
517
|
+
const r = _e(e, t);
|
|
518
|
+
for (const n of r)
|
|
519
|
+
ir(n);
|
|
520
|
+
}
|
|
521
|
+
function Yr(e) {
|
|
522
|
+
const t = e.querySelectorAll("[data-tabindex]"), r = (n) => {
|
|
523
|
+
const o = n.getAttribute("data-tabindex");
|
|
524
|
+
n.removeAttribute("data-tabindex"), o ? n.setAttribute("tabindex", o) : n.removeAttribute("tabindex");
|
|
525
|
+
};
|
|
526
|
+
e.hasAttribute("data-tabindex") && r(e);
|
|
527
|
+
for (const n of t)
|
|
528
|
+
r(n);
|
|
529
|
+
}
|
|
530
|
+
function Xr(e, t) {
|
|
531
|
+
"scrollIntoView" in e ? (e.focus({ preventScroll: !0 }), e.scrollIntoView(Ue({ block: "nearest", inline: "nearest" }, t))) : e.focus();
|
|
532
|
+
}
|
|
533
|
+
var ar = "div", Ke = We(), cr = [
|
|
534
|
+
"text",
|
|
535
|
+
"search",
|
|
536
|
+
"url",
|
|
537
|
+
"tel",
|
|
538
|
+
"email",
|
|
539
|
+
"password",
|
|
540
|
+
"number",
|
|
541
|
+
"date",
|
|
542
|
+
"month",
|
|
543
|
+
"week",
|
|
544
|
+
"time",
|
|
545
|
+
"datetime",
|
|
546
|
+
"datetime-local"
|
|
547
|
+
], ct = Symbol("safariFocusAncestor");
|
|
548
|
+
function Jr(e) {
|
|
549
|
+
return e ? !!e[ct] : !1;
|
|
550
|
+
}
|
|
551
|
+
function Re(e, t) {
|
|
552
|
+
e && (e[ct] = t);
|
|
553
|
+
}
|
|
554
|
+
function lr(e) {
|
|
555
|
+
const { tagName: t, readOnly: r, type: n } = e;
|
|
556
|
+
return t === "TEXTAREA" && !r || t === "SELECT" && !r ? !0 : t === "INPUT" && !r ? cr.includes(n) : !!(e.isContentEditable || e.getAttribute("role") === "combobox" && e.dataset.name);
|
|
557
|
+
}
|
|
558
|
+
function fr(e) {
|
|
559
|
+
return "labels" in e ? e.labels : null;
|
|
560
|
+
}
|
|
561
|
+
function Ve(e) {
|
|
562
|
+
return e.tagName.toLowerCase() === "input" && e.type ? e.type === "radio" || e.type === "checkbox" : !1;
|
|
563
|
+
}
|
|
564
|
+
function dr(e) {
|
|
565
|
+
return e ? e === "button" || e === "summary" || e === "input" || e === "select" || e === "textarea" || e === "a" : !0;
|
|
566
|
+
}
|
|
567
|
+
function pr(e) {
|
|
568
|
+
return e ? e === "button" || e === "input" || e === "select" || e === "textarea" : !0;
|
|
569
|
+
}
|
|
570
|
+
function br(e, t, r, n, o) {
|
|
571
|
+
return e ? t ? r && !n ? -1 : void 0 : r ? o : o || 0 : o;
|
|
572
|
+
}
|
|
573
|
+
function pe(e, t) {
|
|
574
|
+
return A((r) => {
|
|
575
|
+
e == null || e(r), !r.defaultPrevented && t && (r.stopPropagation(), r.preventDefault());
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
var xe = !0;
|
|
579
|
+
function vr(e) {
|
|
580
|
+
const t = e.target;
|
|
581
|
+
t && "hasAttribute" in t && (t.hasAttribute("data-focus-visible") || (xe = !1));
|
|
582
|
+
}
|
|
583
|
+
function mr(e) {
|
|
584
|
+
e.metaKey || e.ctrlKey || e.altKey || (xe = !0);
|
|
585
|
+
}
|
|
586
|
+
var lt = ee(
|
|
587
|
+
function(t) {
|
|
588
|
+
var r = t, {
|
|
589
|
+
focusable: n = !0,
|
|
590
|
+
accessibleWhenDisabled: o,
|
|
591
|
+
autoFocus: s,
|
|
592
|
+
onFocusVisible: l
|
|
593
|
+
} = r, c = U(r, [
|
|
594
|
+
"focusable",
|
|
595
|
+
"accessibleWhenDisabled",
|
|
596
|
+
"autoFocus",
|
|
597
|
+
"onFocusVisible"
|
|
598
|
+
]);
|
|
599
|
+
const p = Y(null);
|
|
600
|
+
G(() => {
|
|
601
|
+
n && (De("mousedown", vr, !0), De("keydown", mr, !0));
|
|
602
|
+
}, [n]), Ke && G(() => {
|
|
603
|
+
if (!n) return;
|
|
604
|
+
const a = p.current;
|
|
605
|
+
if (!a || !Ve(a)) return;
|
|
606
|
+
const y = fr(a);
|
|
607
|
+
if (!y) return;
|
|
608
|
+
const T = () => queueMicrotask(() => a.focus());
|
|
609
|
+
for (const u of y)
|
|
610
|
+
u.addEventListener("mouseup", T);
|
|
611
|
+
return () => {
|
|
612
|
+
for (const u of y)
|
|
613
|
+
u.removeEventListener("mouseup", T);
|
|
614
|
+
};
|
|
615
|
+
}, [n]);
|
|
616
|
+
const m = n && Ie(c), b = !!m && !o, [i, v] = me(!1);
|
|
617
|
+
G(() => {
|
|
618
|
+
n && b && i && v(!1);
|
|
619
|
+
}, [n, b, i]), G(() => {
|
|
620
|
+
if (!n || !i) return;
|
|
621
|
+
const a = p.current;
|
|
622
|
+
if (!a || typeof IntersectionObserver > "u") return;
|
|
623
|
+
const y = new IntersectionObserver(() => {
|
|
624
|
+
X(a) || v(!1);
|
|
625
|
+
});
|
|
626
|
+
return y.observe(a), () => y.disconnect();
|
|
627
|
+
}, [n, i]);
|
|
628
|
+
const f = pe(
|
|
629
|
+
c.onKeyPressCapture,
|
|
630
|
+
m
|
|
631
|
+
), g = pe(
|
|
632
|
+
c.onMouseDownCapture,
|
|
633
|
+
m
|
|
634
|
+
), d = pe(c.onClickCapture, m), S = c.onMouseDown, w = A((a) => {
|
|
635
|
+
if (S == null || S(a), a.defaultPrevented || !n) return;
|
|
636
|
+
const y = a.currentTarget;
|
|
637
|
+
if (!Ke || $e(a) || !Z(y) && !Ve(y)) return;
|
|
638
|
+
let T = !1;
|
|
639
|
+
const u = () => {
|
|
640
|
+
T = !0;
|
|
641
|
+
}, _ = { capture: !0, once: !0 };
|
|
642
|
+
y.addEventListener("focusin", u, _);
|
|
643
|
+
const x = sr(y.parentElement);
|
|
644
|
+
Re(x, !0), ie(y, "mouseup", () => {
|
|
645
|
+
y.removeEventListener("focusin", u, !0), Re(x, !1), !T && ur(y);
|
|
646
|
+
});
|
|
647
|
+
}), P = (a, y) => {
|
|
648
|
+
if (y && (a.currentTarget = y), !n) return;
|
|
649
|
+
const T = a.currentTarget;
|
|
650
|
+
T && Ee(T) && (l == null || l(a), !a.defaultPrevented && (T.dataset.focusVisible = "true", v(!0)));
|
|
651
|
+
}, h = c.onKeyDownCapture, M = A((a) => {
|
|
652
|
+
if (h == null || h(a), a.defaultPrevented || !n || i || a.metaKey || a.altKey || a.ctrlKey || !W(a)) return;
|
|
653
|
+
const y = a.currentTarget;
|
|
654
|
+
ie(y, "focusout", () => P(a, y));
|
|
655
|
+
}), K = c.onFocusCapture, k = A((a) => {
|
|
656
|
+
if (K == null || K(a), a.defaultPrevented || !n) return;
|
|
657
|
+
if (!W(a)) {
|
|
658
|
+
v(!1);
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
const y = a.currentTarget, T = () => P(a, y);
|
|
662
|
+
xe || lr(a.target) ? ie(a.target, "focusout", T) : v(!1);
|
|
663
|
+
}), R = c.onBlur, E = A((a) => {
|
|
664
|
+
R == null || R(a), n && Ot(a) && (a.currentTarget.removeAttribute("data-focus-visible"), v(!1));
|
|
665
|
+
}), I = Ze(tr), C = A((a) => {
|
|
666
|
+
n && s && a && I && queueMicrotask(() => {
|
|
667
|
+
Ee(a) || X(a) && a.focus();
|
|
668
|
+
});
|
|
669
|
+
}), F = Pt(p), L = n && dr(F), V = n && pr(F), O = c.style, N = Qe(() => b ? D({ pointerEvents: "none" }, O) : O, [b, O]);
|
|
670
|
+
return c = B(D({
|
|
671
|
+
"data-focus-visible": n && i || void 0,
|
|
672
|
+
"data-autofocus": s || void 0,
|
|
673
|
+
"aria-disabled": m || void 0
|
|
674
|
+
}, c), {
|
|
675
|
+
ref: te(p, C, c.ref),
|
|
676
|
+
style: N,
|
|
677
|
+
tabIndex: br(
|
|
678
|
+
n,
|
|
679
|
+
b,
|
|
680
|
+
L,
|
|
681
|
+
V,
|
|
682
|
+
c.tabIndex
|
|
683
|
+
),
|
|
684
|
+
disabled: V && b ? !0 : void 0,
|
|
685
|
+
// TODO: Test Focusable contentEditable.
|
|
686
|
+
contentEditable: m ? void 0 : c.contentEditable,
|
|
687
|
+
onKeyPressCapture: f,
|
|
688
|
+
onClickCapture: d,
|
|
689
|
+
onMouseDownCapture: g,
|
|
690
|
+
onMouseDown: w,
|
|
691
|
+
onKeyDownCapture: M,
|
|
692
|
+
onFocusCapture: k,
|
|
693
|
+
onBlur: E
|
|
694
|
+
}), ce(c);
|
|
695
|
+
}
|
|
696
|
+
);
|
|
697
|
+
re(function(t) {
|
|
698
|
+
const r = lt(t);
|
|
699
|
+
return ne(ar, r);
|
|
700
|
+
});
|
|
701
|
+
var Sr = "button";
|
|
702
|
+
function Ne(e) {
|
|
703
|
+
if (!e.isTrusted) return !1;
|
|
704
|
+
const t = e.currentTarget;
|
|
705
|
+
return e.key === "Enter" ? Z(t) || t.tagName === "SUMMARY" || t.tagName === "A" : e.key === " " ? Z(t) || t.tagName === "SUMMARY" || t.tagName === "INPUT" || t.tagName === "SELECT" : !1;
|
|
706
|
+
}
|
|
707
|
+
var gr = Symbol("command"), ft = ee(
|
|
708
|
+
function(t) {
|
|
709
|
+
var r = t, { clickOnEnter: n = !0, clickOnSpace: o = !0 } = r, s = U(r, ["clickOnEnter", "clickOnSpace"]);
|
|
710
|
+
const l = Y(null), [c, p] = me(!1);
|
|
711
|
+
G(() => {
|
|
712
|
+
l.current && p(Z(l.current));
|
|
713
|
+
}, []);
|
|
714
|
+
const [m, b] = me(!1), i = Y(!1), v = Ie(s), [f, g] = At(s, gr, !0), d = s.onKeyDown, S = A((h) => {
|
|
715
|
+
d == null || d(h);
|
|
716
|
+
const M = h.currentTarget;
|
|
717
|
+
if (h.defaultPrevented || f || v || !W(h) || he(M) || M.isContentEditable) return;
|
|
718
|
+
const K = n && h.key === "Enter", k = o && h.key === " ", R = h.key === "Enter" && !n, E = h.key === " " && !o;
|
|
719
|
+
if (R || E) {
|
|
720
|
+
h.preventDefault();
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
if (K || k) {
|
|
724
|
+
const I = Ne(h);
|
|
725
|
+
if (K) {
|
|
726
|
+
if (!I) {
|
|
727
|
+
h.preventDefault();
|
|
728
|
+
const C = h, { view: F } = C, L = U(C, ["view"]), V = () => Fe(M, L);
|
|
729
|
+
Dt() ? ie(M, "keyup", V) : queueMicrotask(V);
|
|
730
|
+
}
|
|
731
|
+
} else k && (i.current = !0, I || (h.preventDefault(), b(!0)));
|
|
732
|
+
}
|
|
733
|
+
}), w = s.onKeyUp, P = A((h) => {
|
|
734
|
+
if (w == null || w(h), h.defaultPrevented || f || v || h.metaKey) return;
|
|
735
|
+
const M = o && h.key === " ";
|
|
736
|
+
if (i.current && M && (i.current = !1, !Ne(h))) {
|
|
737
|
+
h.preventDefault(), b(!1);
|
|
738
|
+
const K = h.currentTarget, k = h, { view: R } = k, E = U(k, ["view"]);
|
|
739
|
+
queueMicrotask(() => Fe(K, E));
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
return s = B(D(D({
|
|
743
|
+
"data-active": m || void 0,
|
|
744
|
+
type: c ? "button" : void 0
|
|
745
|
+
}, g), s), {
|
|
746
|
+
ref: te(l, s.ref),
|
|
747
|
+
onKeyDown: S,
|
|
748
|
+
onKeyUp: P
|
|
749
|
+
}), s = lt(s), s;
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
re(function(t) {
|
|
753
|
+
const r = ft(t);
|
|
754
|
+
return ne(Sr, r);
|
|
755
|
+
});
|
|
756
|
+
var Er = "button";
|
|
757
|
+
function yr(e) {
|
|
758
|
+
return ve(e) ? !0 : e.tagName === "INPUT" && !Z(e);
|
|
759
|
+
}
|
|
760
|
+
function hr(e, t = !1) {
|
|
761
|
+
const r = e.clientHeight, { top: n } = e.getBoundingClientRect(), o = Math.max(r * 0.875, r - 40) * 1.5, s = t ? r - o + n : o + n;
|
|
762
|
+
return e.tagName === "HTML" ? s + e.scrollTop : s;
|
|
763
|
+
}
|
|
764
|
+
function Ir(e, t = !1) {
|
|
765
|
+
const { top: r } = e.getBoundingClientRect();
|
|
766
|
+
return t ? r + e.clientHeight : r;
|
|
767
|
+
}
|
|
768
|
+
function Be(e, t, r, n = !1) {
|
|
769
|
+
var o;
|
|
770
|
+
if (!t || !r) return;
|
|
771
|
+
const { renderedItems: s } = t.getState(), l = Rt(e);
|
|
772
|
+
if (!l) return;
|
|
773
|
+
const c = hr(l, n);
|
|
774
|
+
let p, m;
|
|
775
|
+
for (let b = 0; b < s.length; b += 1) {
|
|
776
|
+
const i = p;
|
|
777
|
+
if (p = r(b), !p) break;
|
|
778
|
+
if (p === i) continue;
|
|
779
|
+
const v = (o = Jt(t, p)) == null ? void 0 : o.element;
|
|
780
|
+
if (!v) continue;
|
|
781
|
+
const g = Ir(v, n) - c, d = Math.abs(g);
|
|
782
|
+
if (n && g <= 0 || !n && g >= 0) {
|
|
783
|
+
m !== void 0 && m < d && (p = i);
|
|
784
|
+
break;
|
|
785
|
+
}
|
|
786
|
+
m = d;
|
|
787
|
+
}
|
|
788
|
+
return p;
|
|
789
|
+
}
|
|
790
|
+
function wr(e, t) {
|
|
791
|
+
return W(e) ? !1 : ut(t, e.target);
|
|
792
|
+
}
|
|
793
|
+
var _r = ee(
|
|
794
|
+
function(t) {
|
|
795
|
+
var r = t, {
|
|
796
|
+
store: n,
|
|
797
|
+
rowId: o,
|
|
798
|
+
preventScrollOnKeyDown: s = !1,
|
|
799
|
+
moveOnKeyPress: l = !0,
|
|
800
|
+
tabbable: c = !1,
|
|
801
|
+
getItem: p,
|
|
802
|
+
"aria-setsize": m,
|
|
803
|
+
"aria-posinset": b
|
|
804
|
+
} = r, i = U(r, [
|
|
805
|
+
"store",
|
|
806
|
+
"rowId",
|
|
807
|
+
"preventScrollOnKeyDown",
|
|
808
|
+
"moveOnKeyPress",
|
|
809
|
+
"tabbable",
|
|
810
|
+
"getItem",
|
|
811
|
+
"aria-setsize",
|
|
812
|
+
"aria-posinset"
|
|
813
|
+
]);
|
|
814
|
+
const v = Ye();
|
|
815
|
+
n = n || v;
|
|
816
|
+
const f = qe(i.id), g = Y(null), d = Ze(Ft), w = Ie(i) && !i.accessibleWhenDisabled, {
|
|
817
|
+
rowId: P,
|
|
818
|
+
baseElement: h,
|
|
819
|
+
isActiveItem: M,
|
|
820
|
+
ariaSetSize: K,
|
|
821
|
+
ariaPosInSet: k,
|
|
822
|
+
isTabbable: R
|
|
823
|
+
} = Yt(n, {
|
|
824
|
+
rowId(u) {
|
|
825
|
+
if (o) return o;
|
|
826
|
+
if (u && d != null && d.baseElement && d.baseElement === u.baseElement)
|
|
827
|
+
return d.id;
|
|
828
|
+
},
|
|
829
|
+
baseElement(u) {
|
|
830
|
+
return (u == null ? void 0 : u.baseElement) || void 0;
|
|
831
|
+
},
|
|
832
|
+
isActiveItem(u) {
|
|
833
|
+
return !!u && u.activeId === f;
|
|
834
|
+
},
|
|
835
|
+
ariaSetSize(u) {
|
|
836
|
+
if (m != null) return m;
|
|
837
|
+
if (u && d != null && d.ariaSetSize && d.baseElement === u.baseElement)
|
|
838
|
+
return d.ariaSetSize;
|
|
839
|
+
},
|
|
840
|
+
ariaPosInSet(u) {
|
|
841
|
+
if (b != null) return b;
|
|
842
|
+
if (!u || !(d != null && d.ariaPosInSet) || d.baseElement !== u.baseElement) return;
|
|
843
|
+
const _ = u.renderedItems.filter(
|
|
844
|
+
(x) => x.rowId === P
|
|
845
|
+
);
|
|
846
|
+
return d.ariaPosInSet + _.findIndex((x) => x.id === f);
|
|
847
|
+
},
|
|
848
|
+
isTabbable(u) {
|
|
849
|
+
if (!(u != null && u.renderedItems.length)) return !0;
|
|
850
|
+
if (u.virtualFocus) return !1;
|
|
851
|
+
if (c) return !0;
|
|
852
|
+
if (u.activeId === null) return !1;
|
|
853
|
+
const _ = n == null ? void 0 : n.item(u.activeId);
|
|
854
|
+
return _ != null && _.disabled || !(_ != null && _.element) ? !0 : u.activeId === f;
|
|
855
|
+
}
|
|
856
|
+
}), E = et(
|
|
857
|
+
(u) => {
|
|
858
|
+
var _;
|
|
859
|
+
const x = B(D({}, u), {
|
|
860
|
+
id: f || u.id,
|
|
861
|
+
rowId: P,
|
|
862
|
+
disabled: !!w,
|
|
863
|
+
children: (_ = u.element) == null ? void 0 : _.textContent
|
|
864
|
+
});
|
|
865
|
+
return p ? p(x) : x;
|
|
866
|
+
},
|
|
867
|
+
[f, P, w, p]
|
|
868
|
+
), I = i.onFocus, C = Y(!1), F = A((u) => {
|
|
869
|
+
if (I == null || I(u), u.defaultPrevented || $e(u) || !f || !n || wr(u, n)) return;
|
|
870
|
+
const { virtualFocus: _, baseElement: x } = n.getState();
|
|
871
|
+
if (n.setActiveId(f), ve(u.currentTarget) && Zt(u.currentTarget), !_ || !W(u) || yr(u.currentTarget) || !(x != null && x.isConnected)) return;
|
|
872
|
+
We() && u.currentTarget.hasAttribute("data-autofocus") && u.currentTarget.scrollIntoView({
|
|
873
|
+
block: "nearest",
|
|
874
|
+
inline: "nearest"
|
|
875
|
+
}), C.current = !0, u.relatedTarget === x || ut(n, u.relatedTarget) ? Qt(x) : x.focus();
|
|
876
|
+
}), L = i.onBlurCapture, V = A((u) => {
|
|
877
|
+
if (L == null || L(u), u.defaultPrevented) return;
|
|
878
|
+
const _ = n == null ? void 0 : n.getState();
|
|
879
|
+
_ != null && _.virtualFocus && C.current && (C.current = !1, u.preventDefault(), u.stopPropagation());
|
|
880
|
+
}), O = i.onKeyDown, N = ae(s), a = ae(l), y = A((u) => {
|
|
881
|
+
if (O == null || O(u), u.defaultPrevented || !W(u) || !n) return;
|
|
882
|
+
const { currentTarget: _ } = u, x = n.getState(), z = n.item(f), H = !!(z != null && z.rowId), se = x.orientation !== "horizontal", J = x.orientation !== "vertical", Te = () => !!(H || J || !x.baseElement || !he(x.baseElement)), Ce = {
|
|
883
|
+
ArrowUp: (H || se) && n.up,
|
|
884
|
+
ArrowRight: (H || J) && n.next,
|
|
885
|
+
ArrowDown: (H || se) && n.down,
|
|
886
|
+
ArrowLeft: (H || J) && n.previous,
|
|
887
|
+
Home: () => {
|
|
888
|
+
if (Te())
|
|
889
|
+
return !H || u.ctrlKey ? n == null ? void 0 : n.first() : n == null ? void 0 : n.previous(-1);
|
|
890
|
+
},
|
|
891
|
+
End: () => {
|
|
892
|
+
if (Te())
|
|
893
|
+
return !H || u.ctrlKey ? n == null ? void 0 : n.last() : n == null ? void 0 : n.next(-1);
|
|
894
|
+
},
|
|
895
|
+
PageUp: () => Be(_, n, n == null ? void 0 : n.up, !0),
|
|
896
|
+
PageDown: () => Be(_, n, n == null ? void 0 : n.down)
|
|
897
|
+
}[u.key];
|
|
898
|
+
if (Ce) {
|
|
899
|
+
if (ve(_)) {
|
|
900
|
+
const Pe = Lt(_), pt = J && u.key === "ArrowLeft", bt = J && u.key === "ArrowRight", vt = se && u.key === "ArrowUp", mt = se && u.key === "ArrowDown";
|
|
901
|
+
if (bt || mt) {
|
|
902
|
+
const { length: St } = Mt(_);
|
|
903
|
+
if (Pe.end !== St) return;
|
|
904
|
+
} else if ((pt || vt) && Pe.start !== 0) return;
|
|
905
|
+
}
|
|
906
|
+
const Oe = Ce();
|
|
907
|
+
if (N(u) || Oe !== void 0) {
|
|
908
|
+
if (!a(u)) return;
|
|
909
|
+
u.preventDefault(), n.move(Oe);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
}), T = Qe(
|
|
913
|
+
() => ({ id: f, baseElement: h }),
|
|
914
|
+
[f, h]
|
|
915
|
+
);
|
|
916
|
+
return i = kt(
|
|
917
|
+
i,
|
|
918
|
+
(u) => /* @__PURE__ */ Ht(Kt.Provider, { value: T, children: u }),
|
|
919
|
+
[T]
|
|
920
|
+
), i = B(D({
|
|
921
|
+
id: f,
|
|
922
|
+
"data-active-item": M || void 0
|
|
923
|
+
}, i), {
|
|
924
|
+
ref: te(g, i.ref),
|
|
925
|
+
tabIndex: R ? i.tabIndex : -1,
|
|
926
|
+
onFocus: F,
|
|
927
|
+
onBlurCapture: V,
|
|
928
|
+
onKeyDown: y
|
|
929
|
+
}), i = ft(i), i = it(B(D({
|
|
930
|
+
store: n
|
|
931
|
+
}, i), {
|
|
932
|
+
getItem: E,
|
|
933
|
+
shouldRegisterItem: f ? i.shouldRegisterItem : !1
|
|
934
|
+
})), ce(B(D({}, i), {
|
|
935
|
+
"aria-setsize": K,
|
|
936
|
+
"aria-posinset": k
|
|
937
|
+
}));
|
|
938
|
+
}
|
|
939
|
+
);
|
|
940
|
+
Xe(
|
|
941
|
+
re(function(t) {
|
|
942
|
+
const r = _r(t);
|
|
943
|
+
return ne(Er, r);
|
|
944
|
+
})
|
|
945
|
+
);
|
|
946
|
+
var xr = "div";
|
|
947
|
+
function dt(e) {
|
|
948
|
+
const t = e.relatedTarget;
|
|
949
|
+
return (t == null ? void 0 : t.nodeType) === Node.ELEMENT_NODE ? t : null;
|
|
950
|
+
}
|
|
951
|
+
function Tr(e) {
|
|
952
|
+
const t = dt(e);
|
|
953
|
+
return t ? ze(e.currentTarget, t) : !1;
|
|
954
|
+
}
|
|
955
|
+
var ye = Symbol("composite-hover");
|
|
956
|
+
function Cr(e) {
|
|
957
|
+
let t = dt(e);
|
|
958
|
+
if (!t) return !1;
|
|
959
|
+
do {
|
|
960
|
+
if (j(t, ye) && t[ye]) return !0;
|
|
961
|
+
t = t.parentElement;
|
|
962
|
+
} while (t);
|
|
963
|
+
return !1;
|
|
964
|
+
}
|
|
965
|
+
var Or = ee(
|
|
966
|
+
function(t) {
|
|
967
|
+
var r = t, {
|
|
968
|
+
store: n,
|
|
969
|
+
focusOnHover: o = !0,
|
|
970
|
+
blurOnHoverEnd: s = !!o
|
|
971
|
+
} = r, l = U(r, [
|
|
972
|
+
"store",
|
|
973
|
+
"focusOnHover",
|
|
974
|
+
"blurOnHoverEnd"
|
|
975
|
+
]);
|
|
976
|
+
const c = Ye();
|
|
977
|
+
n = n || c, He(
|
|
978
|
+
n,
|
|
979
|
+
process.env.NODE_ENV !== "production" && "CompositeHover must be wrapped in a Composite component."
|
|
980
|
+
);
|
|
981
|
+
const p = Vt(), m = l.onMouseMove, b = ae(o), i = A((S) => {
|
|
982
|
+
if (m == null || m(S), !S.defaultPrevented && p() && b(S)) {
|
|
983
|
+
if (!at(S.currentTarget)) {
|
|
984
|
+
const w = n == null ? void 0 : n.getState().baseElement;
|
|
985
|
+
w && !Ee(w) && w.focus();
|
|
986
|
+
}
|
|
987
|
+
n == null || n.setActiveId(S.currentTarget.id);
|
|
988
|
+
}
|
|
989
|
+
}), v = l.onMouseLeave, f = ae(s), g = A((S) => {
|
|
990
|
+
var w;
|
|
991
|
+
v == null || v(S), !S.defaultPrevented && p() && (Tr(S) || Cr(S) || b(S) && f(S) && (n == null || n.setActiveId(null), (w = n == null ? void 0 : n.getState().baseElement) == null || w.focus()));
|
|
992
|
+
}), d = et((S) => {
|
|
993
|
+
S && (S[ye] = !0);
|
|
994
|
+
}, []);
|
|
995
|
+
return l = B(D({}, l), {
|
|
996
|
+
ref: te(d, l.ref),
|
|
997
|
+
onMouseMove: i,
|
|
998
|
+
onMouseLeave: g
|
|
999
|
+
}), ce(l);
|
|
1000
|
+
}
|
|
1001
|
+
);
|
|
1002
|
+
Xe(
|
|
1003
|
+
re(function(t) {
|
|
1004
|
+
const r = Or(t);
|
|
1005
|
+
return ne(xr, r);
|
|
1006
|
+
})
|
|
1007
|
+
);
|
|
1008
|
+
export {
|
|
1009
|
+
$r as A,
|
|
1010
|
+
Yr as B,
|
|
1011
|
+
Wr as C,
|
|
1012
|
+
Jr as D,
|
|
1013
|
+
_e as E,
|
|
1014
|
+
tr as F,
|
|
1015
|
+
zr as G,
|
|
1016
|
+
X as H,
|
|
1017
|
+
ur as I,
|
|
1018
|
+
ft as J,
|
|
1019
|
+
Hr as K,
|
|
1020
|
+
_r as a,
|
|
1021
|
+
Or as b,
|
|
1022
|
+
Se as c,
|
|
1023
|
+
nt as d,
|
|
1024
|
+
Ut as e,
|
|
1025
|
+
Br as f,
|
|
1026
|
+
Nr as g,
|
|
1027
|
+
at as h,
|
|
1028
|
+
Yt as i,
|
|
1029
|
+
lt as j,
|
|
1030
|
+
tt as k,
|
|
1031
|
+
Jt as l,
|
|
1032
|
+
Rr as m,
|
|
1033
|
+
Xr as n,
|
|
1034
|
+
kr as o,
|
|
1035
|
+
Kr as p,
|
|
1036
|
+
Ee as q,
|
|
1037
|
+
qr as r,
|
|
1038
|
+
Mr as s,
|
|
1039
|
+
Vr as t,
|
|
1040
|
+
Wt as u,
|
|
1041
|
+
ut as v,
|
|
1042
|
+
Ur as w,
|
|
1043
|
+
jr as x,
|
|
1044
|
+
rt as y,
|
|
1045
|
+
Gr as z
|
|
1046
|
+
};
|