welcome-ui 8.0.0 → 8.0.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/dist/AXB53BZF-BOEe01VW.mjs +25 -0
- package/dist/Accordion.mjs +17 -17
- package/dist/Alert.mjs +19 -19
- package/dist/{BYC7LY2E-CVjUW1dr.mjs → BYC7LY2E-B1IDizRs.mjs} +298 -295
- package/dist/Badge.mjs +1 -1
- package/dist/Breadcrumb.mjs +27 -26
- package/dist/Button.mjs +2 -2
- package/dist/Checkbox.mjs +1 -1
- package/dist/{CustomInput-D_13Gd_3.mjs → CustomInput-IA_gVoXd.mjs} +2991 -2859
- package/dist/DatePicker.mjs +4 -4
- package/dist/DateTimePicker.mjs +9 -9
- package/dist/DateTimePickerCommon.mjs +1 -1
- package/dist/Drawer.mjs +7 -7
- package/dist/DropdownMenu.mjs +262 -262
- package/dist/Field.mjs +25 -25
- package/dist/FileDrop.mjs +273 -267
- package/dist/FileUpload.mjs +26 -26
- package/dist/Files.mjs +1 -1
- package/dist/Hint.mjs +1 -1
- package/dist/{ITI7HKP4-BONrZ9Pq.mjs → ITI7HKP4-EL9KXYBU.mjs} +150 -150
- package/dist/Icons.mjs +88 -88
- package/dist/IconsFont.mjs +159 -159
- package/dist/InputText.mjs +1 -1
- package/dist/{JC64G2H7-Dey-8h60.mjs → JC64G2H7-BzklVBKM.mjs} +70 -70
- package/dist/KUU7WJ55-CS4NemC6.mjs +61 -0
- package/dist/{LVA2YJMS-qFC9J-lt.mjs → LVA2YJMS-DDEmK0pp.mjs} +491 -488
- package/dist/Label.mjs +2 -2
- package/dist/Link.mjs +3 -3
- package/dist/MTZPJQMC-CMjAwC0N.mjs +15 -0
- package/dist/Modal.mjs +13 -13
- package/dist/NLEBE274-QOMV1l7e.mjs +84 -0
- package/dist/P2CTZE2T-Cl2w7OLV.mjs +300 -0
- package/dist/P4IRICAX-DezbJY4s.mjs +37 -0
- package/dist/Pagination.mjs +22 -22
- package/dist/Picker.mjs +2 -2
- package/dist/Popover.mjs +2 -2
- package/dist/QYJ6MIDR-Bb0O5xUM.mjs +97 -0
- package/dist/Radio.mjs +18 -18
- package/dist/RadioGroup.mjs +15 -15
- package/dist/RadioTab.mjs +9 -9
- package/dist/{SYRFVSLH-cVmYtx36.mjs → SYRFVSLH-jn06-eLy.mjs} +17 -17
- package/dist/Search.mjs +2 -2
- package/dist/Select.mjs +719 -716
- package/dist/Shape.mjs +1 -1
- package/dist/Slider.mjs +1 -1
- package/dist/Swiper.mjs +284 -278
- package/dist/Tabs.mjs +128 -128
- package/dist/Tag.mjs +16 -16
- package/dist/Text.mjs +1 -1
- package/dist/Textarea.mjs +4 -4
- package/dist/TimePicker.mjs +6 -6
- package/dist/Toast.mjs +69 -69
- package/dist/Toggle.mjs +2 -2
- package/dist/Tooltip.mjs +60 -60
- package/dist/UniversalLink.mjs +8 -8
- package/dist/VEVQD5MH-CuegL0m0.mjs +20 -0
- package/dist/{VGCJ63VH-B39w1tBw.mjs → VGCJ63VH-BMzoZtCu.mjs} +31 -33
- package/dist/VariantIcon.mjs +4 -4
- package/dist/WelcomeLoader.mjs +4862 -9223
- package/dist/X5NMLKT6-CvSCix-_.mjs +25 -0
- package/dist/YV4JVR4I-Bh7B7TET.mjs +344 -0
- package/dist/downshift.esm-D0ns_SQs.mjs +1082 -0
- package/dist/{field-styles-DLIhqG_8.mjs → field-styles-CfVLcVQp.mjs} +1 -1
- package/dist/{index-BDeIsk2X.mjs → index-5PUh49rV.mjs} +56 -56
- package/dist/{index-DEJJvyGk.mjs → index-B0gDDiFm.mjs} +7 -7
- package/dist/{index-CExLVjET.mjs → index-B22SHR8h.mjs} +4 -4
- package/dist/index-BhcLigYU.mjs +77 -0
- package/dist/{index-BJAZgeHL.mjs → index-Bkl89twW.mjs} +4 -4
- package/dist/{index-BYdkhqH4.mjs → index-CBBbX29m.mjs} +3652 -3584
- package/dist/{index-BpRjq7lj.mjs → index-CQD9fgf_.mjs} +3 -3
- package/dist/{index-BRDOakbf.mjs → index-CmsWSKKs.mjs} +5 -5
- package/dist/{index-SbQUT2mU.mjs → index-DgSynio4.mjs} +244 -239
- package/dist/{index-BrfXjmHY.mjs → index-wr_b5GSV.mjs} +6 -6
- package/dist/radio-group-RFyDp0KD.mjs +51 -0
- package/dist/theme.mjs +670 -615
- package/dist/{use-viewport-m3glsbna.mjs → use-viewport-CfklieD-.mjs} +5 -5
- package/dist/utils.mjs +29 -91
- package/package.json +13 -13
- package/dist/AXB53BZF-CGoc4K3d.mjs +0 -25
- package/dist/KUU7WJ55-3sP-w1F1.mjs +0 -61
- package/dist/MTZPJQMC-C0Xe_WK4.mjs +0 -13
- package/dist/NLEBE274-C94QU78N.mjs +0 -84
- package/dist/P2CTZE2T-YPes1GXe.mjs +0 -297
- package/dist/P4IRICAX-DzXqUYe-.mjs +0 -37
- package/dist/QYJ6MIDR-BLLqyXdd.mjs +0 -97
- package/dist/VEVQD5MH-ZMnHV8ZJ.mjs +0 -20
- package/dist/X5NMLKT6-uFSu0Lii.mjs +0 -25
- package/dist/YV4JVR4I-BGfUf3Nu.mjs +0 -341
- package/dist/downshift.esm-CEHW4VDy.mjs +0 -1085
- package/dist/radio-group-CGC6DTFJ.mjs +0 -51
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as de, c as X, s as $, i as fe, g as Z, b as B, d as me } from "./YV4JVR4I-
|
|
3
|
-
import { C as F, B as j, Q as
|
|
4
|
-
import { b as De, g as L, s as Ke, i as Q, a as Le, f as Te, c as Me } from "./P2CTZE2T-
|
|
5
|
-
import { useRef as ne, useEffect as
|
|
2
|
+
import { t as de, c as X, s as $, i as fe, g as Z, b as B, d as me } from "./YV4JVR4I-Bh7B7TET.mjs";
|
|
3
|
+
import { C as F, B as j, Q as ve, D as T, R as Ie, I as ge, H as Se, c as pe, _ as se, i as Ee, S as ye, T as we, F as ee, U as O, V as be, W as he, b as H, o as z, u as xe, p as ie, E as _e, t as Fe, d as Pe, e as Ce, g as te, m as Ae, X as ke, f as Be, h as Re } from "./LVA2YJMS-DDEmK0pp.mjs";
|
|
4
|
+
import { b as De, g as L, s as Ke, i as Q, a as Le, f as Te, c as Me } from "./P2CTZE2T-Cl2w7OLV.mjs";
|
|
5
|
+
import { useRef as ne, useEffect as ue, useState as Oe, useCallback as ze } from "react";
|
|
6
6
|
function We(e) {
|
|
7
|
-
var
|
|
7
|
+
var s;
|
|
8
8
|
const n = e.find((c) => !!c.element), t = [...e].reverse().find((c) => !!c.element);
|
|
9
|
-
let
|
|
10
|
-
for (;
|
|
11
|
-
if (t &&
|
|
12
|
-
return
|
|
13
|
-
|
|
9
|
+
let i = (s = n == null ? void 0 : n.element) == null ? void 0 : s.parentElement;
|
|
10
|
+
for (; i && (t != null && t.element); ) {
|
|
11
|
+
if (t && i.contains(t.element))
|
|
12
|
+
return i;
|
|
13
|
+
i = i.parentElement;
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return ge(i).body;
|
|
16
16
|
}
|
|
17
17
|
function Ve(e) {
|
|
18
18
|
return e == null ? void 0 : e.__unstablePrivateStore;
|
|
19
19
|
}
|
|
20
20
|
function He(e = {}) {
|
|
21
|
-
var
|
|
21
|
+
var s;
|
|
22
22
|
de(e, e.store);
|
|
23
|
-
const n = (
|
|
23
|
+
const n = (s = e.store) == null ? void 0 : s.getState(), t = F(
|
|
24
24
|
e.items,
|
|
25
25
|
n == null ? void 0 : n.items,
|
|
26
26
|
e.defaultItems,
|
|
27
27
|
[]
|
|
28
|
-
),
|
|
28
|
+
), i = new Map(t.map((u) => [u.id, u])), c = {
|
|
29
29
|
items: t,
|
|
30
30
|
renderedItems: F(n == null ? void 0 : n.renderedItems, [])
|
|
31
31
|
}, l = Ve(e.store), a = X(
|
|
32
32
|
{ items: t, renderedItems: c.renderedItems },
|
|
33
33
|
l
|
|
34
|
-
), r = X(c, e.store), x = (
|
|
35
|
-
const f =
|
|
34
|
+
), r = X(c, e.store), x = (u) => {
|
|
35
|
+
const f = Ie(u, (m) => m.element);
|
|
36
36
|
a.setState("renderedItems", f), r.setState("renderedItems", f);
|
|
37
37
|
};
|
|
38
|
-
$(r, () => fe(a)), $(a, () => Z(a, ["items"], (
|
|
39
|
-
r.setState("items",
|
|
40
|
-
})), $(a, () => Z(a, ["renderedItems"], (
|
|
38
|
+
$(r, () => fe(a)), $(a, () => Z(a, ["items"], (u) => {
|
|
39
|
+
r.setState("items", u.items);
|
|
40
|
+
})), $(a, () => Z(a, ["renderedItems"], (u) => {
|
|
41
41
|
let f = !0, m = requestAnimationFrame(() => {
|
|
42
42
|
const { renderedItems: S } = r.getState();
|
|
43
|
-
|
|
43
|
+
u.renderedItems !== S && x(u.renderedItems);
|
|
44
44
|
});
|
|
45
45
|
if (typeof IntersectionObserver != "function")
|
|
46
46
|
return () => cancelAnimationFrame(m);
|
|
@@ -49,55 +49,55 @@ function He(e = {}) {
|
|
|
49
49
|
f = !1;
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
cancelAnimationFrame(m), m = requestAnimationFrame(() => x(
|
|
53
|
-
}, D = We(
|
|
54
|
-
for (const S of
|
|
52
|
+
cancelAnimationFrame(m), m = requestAnimationFrame(() => x(u.renderedItems));
|
|
53
|
+
}, D = We(u.renderedItems), g = new IntersectionObserver(w, { root: D });
|
|
54
|
+
for (const S of u.renderedItems)
|
|
55
55
|
S.element && g.observe(S.element);
|
|
56
56
|
return () => {
|
|
57
57
|
cancelAnimationFrame(m), g.disconnect();
|
|
58
58
|
};
|
|
59
59
|
}));
|
|
60
|
-
const v = (
|
|
60
|
+
const v = (u, f, m = !1) => {
|
|
61
61
|
let w;
|
|
62
62
|
return f((g) => {
|
|
63
|
-
const S = g.findIndex(({ id: b }) => b ===
|
|
63
|
+
const S = g.findIndex(({ id: b }) => b === u.id), P = g.slice();
|
|
64
64
|
if (S !== -1) {
|
|
65
65
|
w = g[S];
|
|
66
|
-
const b = T(T({}, w),
|
|
67
|
-
P[S] = b,
|
|
66
|
+
const b = T(T({}, w), u);
|
|
67
|
+
P[S] = b, i.set(u.id, b);
|
|
68
68
|
} else
|
|
69
|
-
P.push(
|
|
69
|
+
P.push(u), i.set(u.id, u);
|
|
70
70
|
return P;
|
|
71
71
|
}), () => {
|
|
72
72
|
f((g) => {
|
|
73
73
|
if (!w)
|
|
74
|
-
return m &&
|
|
75
|
-
const S = g.findIndex(({ id: b }) => b ===
|
|
74
|
+
return m && i.delete(u.id), g.filter(({ id: b }) => b !== u.id);
|
|
75
|
+
const S = g.findIndex(({ id: b }) => b === u.id);
|
|
76
76
|
if (S === -1) return g;
|
|
77
77
|
const P = g.slice();
|
|
78
|
-
return P[S] = w,
|
|
78
|
+
return P[S] = w, i.set(u.id, w), P;
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
-
}, K = (
|
|
82
|
-
|
|
81
|
+
}, K = (u) => v(
|
|
82
|
+
u,
|
|
83
83
|
(f) => a.setState("items", f),
|
|
84
84
|
!0
|
|
85
85
|
);
|
|
86
86
|
return j(T({}, r), {
|
|
87
87
|
registerItem: K,
|
|
88
|
-
renderItem: (
|
|
89
|
-
K(
|
|
88
|
+
renderItem: (u) => ve(
|
|
89
|
+
K(u),
|
|
90
90
|
v(
|
|
91
|
-
|
|
91
|
+
u,
|
|
92
92
|
(f) => a.setState("renderedItems", f)
|
|
93
93
|
)
|
|
94
94
|
),
|
|
95
|
-
item: (
|
|
96
|
-
if (!
|
|
97
|
-
let f =
|
|
95
|
+
item: (u) => {
|
|
96
|
+
if (!u) return null;
|
|
97
|
+
let f = i.get(u);
|
|
98
98
|
if (!f) {
|
|
99
99
|
const { items: m } = a.getState();
|
|
100
|
-
f = m.find((w) => w.id ===
|
|
100
|
+
f = m.find((w) => w.id === u), f && i.set(u, f);
|
|
101
101
|
}
|
|
102
102
|
return f || null;
|
|
103
103
|
},
|
|
@@ -105,30 +105,30 @@ function He(e = {}) {
|
|
|
105
105
|
__unstablePrivateStore: a
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
function Ne(e,
|
|
109
|
-
return Se(
|
|
108
|
+
function Ne(e, s, n) {
|
|
109
|
+
return Se(s, [n.store]), B(e, n, "items", "setItems"), e;
|
|
110
110
|
}
|
|
111
111
|
function ae(e) {
|
|
112
|
-
const
|
|
112
|
+
const s = [];
|
|
113
113
|
for (const n of e)
|
|
114
|
-
|
|
115
|
-
return
|
|
114
|
+
s.push(...n);
|
|
115
|
+
return s;
|
|
116
116
|
}
|
|
117
117
|
function Y(e) {
|
|
118
118
|
return e.slice().reverse();
|
|
119
119
|
}
|
|
120
120
|
var Ue = { id: null };
|
|
121
|
-
function R(e,
|
|
122
|
-
return e.find((n) =>
|
|
121
|
+
function R(e, s) {
|
|
122
|
+
return e.find((n) => s ? !n.disabled && n.id !== s : !n.disabled);
|
|
123
123
|
}
|
|
124
|
-
function $e(e,
|
|
125
|
-
return e.filter((n) =>
|
|
124
|
+
function $e(e, s) {
|
|
125
|
+
return e.filter((n) => s ? !n.disabled && n.id !== s : !n.disabled);
|
|
126
126
|
}
|
|
127
|
-
function re(e,
|
|
128
|
-
return e.filter((n) => n.rowId ===
|
|
127
|
+
function re(e, s) {
|
|
128
|
+
return e.filter((n) => n.rowId === s);
|
|
129
129
|
}
|
|
130
|
-
function je(e,
|
|
131
|
-
const t = e.findIndex((
|
|
130
|
+
function je(e, s, n = !1) {
|
|
131
|
+
const t = e.findIndex((i) => i.id === s);
|
|
132
132
|
return [
|
|
133
133
|
...e.slice(t + 1),
|
|
134
134
|
...n ? [Ue] : [],
|
|
@@ -136,21 +136,21 @@ function je(e, i, n = !1) {
|
|
|
136
136
|
];
|
|
137
137
|
}
|
|
138
138
|
function ce(e) {
|
|
139
|
-
const
|
|
139
|
+
const s = [];
|
|
140
140
|
for (const n of e) {
|
|
141
|
-
const t =
|
|
141
|
+
const t = s.find((i) => {
|
|
142
142
|
var c;
|
|
143
|
-
return ((c =
|
|
143
|
+
return ((c = i[0]) == null ? void 0 : c.rowId) === n.rowId;
|
|
144
144
|
});
|
|
145
|
-
t ? t.push(n) :
|
|
145
|
+
t ? t.push(n) : s.push([n]);
|
|
146
146
|
}
|
|
147
|
-
return
|
|
147
|
+
return s;
|
|
148
148
|
}
|
|
149
149
|
function le(e) {
|
|
150
|
-
let
|
|
150
|
+
let s = 0;
|
|
151
151
|
for (const { length: n } of e)
|
|
152
|
-
n >
|
|
153
|
-
return
|
|
152
|
+
n > s && (s = n);
|
|
153
|
+
return s;
|
|
154
154
|
}
|
|
155
155
|
function qe(e) {
|
|
156
156
|
return {
|
|
@@ -159,37 +159,37 @@ function qe(e) {
|
|
|
159
159
|
rowId: e
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
function Ge(e,
|
|
162
|
+
function Ge(e, s, n) {
|
|
163
163
|
const t = le(e);
|
|
164
|
-
for (const
|
|
164
|
+
for (const i of e)
|
|
165
165
|
for (let c = 0; c < t; c += 1) {
|
|
166
|
-
const l =
|
|
166
|
+
const l = i[c];
|
|
167
167
|
if (!l || n && l.disabled) {
|
|
168
|
-
const r = c === 0 && n ? R(
|
|
169
|
-
|
|
168
|
+
const r = c === 0 && n ? R(i) : i[c - 1];
|
|
169
|
+
i[c] = r && s !== r.id && n ? r : qe(r == null ? void 0 : r.rowId);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
return e;
|
|
173
173
|
}
|
|
174
174
|
function Qe(e) {
|
|
175
|
-
const
|
|
176
|
-
for (let
|
|
177
|
-
for (const c of
|
|
178
|
-
const l = c[
|
|
175
|
+
const s = ce(e), n = le(s), t = [];
|
|
176
|
+
for (let i = 0; i < n; i += 1)
|
|
177
|
+
for (const c of s) {
|
|
178
|
+
const l = c[i];
|
|
179
179
|
l && t.push(j(T({}, l), {
|
|
180
180
|
// If there's no rowId, it means that it's not a grid composite, but
|
|
181
181
|
// a single row instead. So, instead of verticalizing it, that is,
|
|
182
182
|
// assigning a different rowId based on the column index, we keep it
|
|
183
183
|
// undefined so they will be part of the same row. This is useful
|
|
184
184
|
// when using up/down on one-dimensional composites.
|
|
185
|
-
rowId: l.rowId ? `${
|
|
185
|
+
rowId: l.rowId ? `${i}` : void 0
|
|
186
186
|
}));
|
|
187
187
|
}
|
|
188
188
|
return t;
|
|
189
189
|
}
|
|
190
190
|
function lt(e = {}) {
|
|
191
|
-
var
|
|
192
|
-
const n = (
|
|
191
|
+
var s;
|
|
192
|
+
const n = (s = e.store) == null ? void 0 : s.getState(), t = He(e), i = F(
|
|
193
193
|
e.activeId,
|
|
194
194
|
n == null ? void 0 : n.activeId,
|
|
195
195
|
e.defaultActiveId
|
|
@@ -199,12 +199,12 @@ function lt(e = {}) {
|
|
|
199
199
|
n == null ? void 0 : n.id,
|
|
200
200
|
`id-${Math.random().toString(36).slice(2, 8)}`
|
|
201
201
|
),
|
|
202
|
-
activeId:
|
|
202
|
+
activeId: i,
|
|
203
203
|
baseElement: F(n == null ? void 0 : n.baseElement, null),
|
|
204
204
|
includesBaseElement: F(
|
|
205
205
|
e.includesBaseElement,
|
|
206
206
|
n == null ? void 0 : n.includesBaseElement,
|
|
207
|
-
|
|
207
|
+
i === null
|
|
208
208
|
),
|
|
209
209
|
moves: F(n == null ? void 0 : n.moves, 0),
|
|
210
210
|
orientation: F(
|
|
@@ -233,15 +233,15 @@ function lt(e = {}) {
|
|
|
233
233
|
);
|
|
234
234
|
const a = (r = "next", x = {}) => {
|
|
235
235
|
var v, K;
|
|
236
|
-
const
|
|
236
|
+
const u = l.getState(), {
|
|
237
237
|
skip: f = 0,
|
|
238
|
-
activeId: m =
|
|
239
|
-
focusShift: w =
|
|
240
|
-
focusLoop: D =
|
|
241
|
-
focusWrap: g =
|
|
242
|
-
includesBaseElement: S =
|
|
243
|
-
renderedItems: P =
|
|
244
|
-
rtl: b =
|
|
238
|
+
activeId: m = u.activeId,
|
|
239
|
+
focusShift: w = u.focusShift,
|
|
240
|
+
focusLoop: D = u.focusLoop,
|
|
241
|
+
focusWrap: g = u.focusWrap,
|
|
242
|
+
includesBaseElement: S = u.includesBaseElement,
|
|
243
|
+
renderedItems: P = u.renderedItems,
|
|
244
|
+
rtl: b = u.rtl
|
|
245
245
|
} = x, C = r === "up" || r === "down", W = r === "next" || r === "down", q = W ? b && !C : !b || C, N = w && !f;
|
|
246
246
|
let p = C ? ae(
|
|
247
247
|
Ge(ce(P), m, N)
|
|
@@ -251,7 +251,7 @@ function lt(e = {}) {
|
|
|
251
251
|
const M = p.find((I) => I.id === m);
|
|
252
252
|
if (!M)
|
|
253
253
|
return (K = R(p)) == null ? void 0 : K.id;
|
|
254
|
-
const U = p.some((I) => I.rowId), G = p.indexOf(M),
|
|
254
|
+
const U = p.some((I) => I.rowId), G = p.indexOf(M), o = p.slice(G + 1), d = re(o, M.rowId);
|
|
255
255
|
if (f) {
|
|
256
256
|
const I = $e(d, m), h = I.slice(f)[0] || // If we can't find an item, just return the last one.
|
|
257
257
|
I[I.length - 1];
|
|
@@ -270,7 +270,7 @@ function lt(e = {}) {
|
|
|
270
270
|
// the row. So moving next from the last item will focus on the
|
|
271
271
|
// composite container. On grid composites, horizontal navigation never
|
|
272
272
|
// focuses on the composite container, only vertical.
|
|
273
|
-
_ ? d :
|
|
273
|
+
_ ? d : o,
|
|
274
274
|
m
|
|
275
275
|
);
|
|
276
276
|
return _ ? (I == null ? void 0 : I.id) || null : I == null ? void 0 : I.id;
|
|
@@ -298,28 +298,28 @@ function lt(e = {}) {
|
|
|
298
298
|
up: (r) => (r !== void 0 && typeof r == "number" && (r = { skip: r }), a("up", r))
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
function dt(e,
|
|
302
|
-
return e = Ne(e,
|
|
301
|
+
function dt(e, s, n) {
|
|
302
|
+
return e = Ne(e, s, n), B(e, n, "activeId", "setActiveId"), B(e, n, "includesBaseElement"), B(e, n, "virtualFocus"), B(e, n, "orientation"), B(e, n, "rtl"), B(e, n, "focusLoop"), B(e, n, "focusWrap"), B(e, n, "focusShift"), e;
|
|
303
303
|
}
|
|
304
304
|
var Xe = "div";
|
|
305
305
|
function Ye(e) {
|
|
306
|
-
return e.some((
|
|
306
|
+
return e.some((s) => !!s.rowId);
|
|
307
307
|
}
|
|
308
308
|
function Je(e) {
|
|
309
|
-
const
|
|
310
|
-
return
|
|
309
|
+
const s = e.target;
|
|
310
|
+
return s && !ie(s) ? !1 : e.key.length === 1 && !e.ctrlKey && !e.metaKey;
|
|
311
311
|
}
|
|
312
312
|
function Ze(e) {
|
|
313
313
|
return e.key === "Shift" || e.key === "Control" || e.key === "Alt" || e.key === "Meta";
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function oe(e, s, n) {
|
|
316
316
|
return H((t) => {
|
|
317
|
-
var
|
|
318
|
-
if (
|
|
319
|
-
const c = e.getState(), l = (
|
|
317
|
+
var i;
|
|
318
|
+
if (s == null || s(t), t.defaultPrevented || t.isPropagationStopped() || !z(t) || Ze(t) || Je(t)) return;
|
|
319
|
+
const c = e.getState(), l = (i = L(e, c.activeId)) == null ? void 0 : i.element;
|
|
320
320
|
if (!l) return;
|
|
321
|
-
const a = t, r =
|
|
322
|
-
l !==
|
|
321
|
+
const a = t, { view: r } = a, x = se(a, ["view"]), v = n == null ? void 0 : n.current;
|
|
322
|
+
l !== v && l.focus(), ke(l, t.type, x) || t.preventDefault(), t.currentTarget.contains(l) && t.stopPropagation();
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
325
|
function et(e) {
|
|
@@ -328,22 +328,22 @@ function et(e) {
|
|
|
328
328
|
);
|
|
329
329
|
}
|
|
330
330
|
function tt(e) {
|
|
331
|
-
const [
|
|
331
|
+
const [s, n] = Oe(!1), t = ze(() => n(!0), []), i = e.useState(
|
|
332
332
|
(c) => L(e, c.activeId)
|
|
333
333
|
);
|
|
334
|
-
return
|
|
335
|
-
const c =
|
|
336
|
-
|
|
337
|
-
}, [
|
|
334
|
+
return ue(() => {
|
|
335
|
+
const c = i == null ? void 0 : i.element;
|
|
336
|
+
s && c && (n(!1), c.focus({ preventScroll: !0 }));
|
|
337
|
+
}, [i, s]), t;
|
|
338
338
|
}
|
|
339
339
|
var nt = pe(
|
|
340
|
-
function(
|
|
341
|
-
var n =
|
|
340
|
+
function(s) {
|
|
341
|
+
var n = s, {
|
|
342
342
|
store: t,
|
|
343
|
-
composite:
|
|
344
|
-
focusOnMove: c =
|
|
343
|
+
composite: i = !0,
|
|
344
|
+
focusOnMove: c = i,
|
|
345
345
|
moveOnKeyPress: l = !0
|
|
346
|
-
} = n, a =
|
|
346
|
+
} = n, a = se(n, [
|
|
347
347
|
"store",
|
|
348
348
|
"composite",
|
|
349
349
|
"focusOnMove",
|
|
@@ -354,62 +354,62 @@ var nt = pe(
|
|
|
354
354
|
t,
|
|
355
355
|
process.env.NODE_ENV !== "production" && "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
|
|
356
356
|
);
|
|
357
|
-
const x = ne(null), v = ne(null), K = tt(t),
|
|
358
|
-
|
|
357
|
+
const x = ne(null), v = ne(null), K = tt(t), u = t.useState("moves"), [, f] = ye(
|
|
358
|
+
i ? t.setBaseElement : null
|
|
359
359
|
);
|
|
360
|
-
|
|
361
|
-
var
|
|
362
|
-
if (!t || !
|
|
363
|
-
const { activeId: d } = t.getState(), E = (
|
|
360
|
+
ue(() => {
|
|
361
|
+
var o;
|
|
362
|
+
if (!t || !u || !i || !c) return;
|
|
363
|
+
const { activeId: d } = t.getState(), E = (o = L(t, d)) == null ? void 0 : o.element;
|
|
364
364
|
E && we(E);
|
|
365
|
-
}, [t,
|
|
366
|
-
if (!t || !
|
|
367
|
-
const { baseElement:
|
|
368
|
-
if (!(d === null) || !
|
|
365
|
+
}, [t, u, i, c]), ee(() => {
|
|
366
|
+
if (!t || !u || !i) return;
|
|
367
|
+
const { baseElement: o, activeId: d } = t.getState();
|
|
368
|
+
if (!(d === null) || !o) return;
|
|
369
369
|
const y = v.current;
|
|
370
|
-
v.current = null, y && O(y, { relatedTarget:
|
|
371
|
-
}, [t,
|
|
370
|
+
v.current = null, y && O(y, { relatedTarget: o }), be(o) || o.focus();
|
|
371
|
+
}, [t, u, i]);
|
|
372
372
|
const m = t.useState("activeId"), w = t.useState("virtualFocus");
|
|
373
373
|
ee(() => {
|
|
374
|
-
var
|
|
375
|
-
if (!t || !
|
|
374
|
+
var o;
|
|
375
|
+
if (!t || !i || !w) return;
|
|
376
376
|
const d = v.current;
|
|
377
377
|
if (v.current = null, !d) return;
|
|
378
|
-
const y = ((
|
|
378
|
+
const y = ((o = L(t, m)) == null ? void 0 : o.element) || he(d);
|
|
379
379
|
y !== d && O(d, { relatedTarget: y });
|
|
380
|
-
}, [t, m, w,
|
|
381
|
-
const D =
|
|
380
|
+
}, [t, m, w, i]);
|
|
381
|
+
const D = oe(
|
|
382
382
|
t,
|
|
383
383
|
a.onKeyDownCapture,
|
|
384
384
|
v
|
|
385
|
-
), g =
|
|
385
|
+
), g = oe(
|
|
386
386
|
t,
|
|
387
387
|
a.onKeyUpCapture,
|
|
388
388
|
v
|
|
389
|
-
), S = a.onFocusCapture, P = H((
|
|
390
|
-
if (S == null || S(
|
|
389
|
+
), S = a.onFocusCapture, P = H((o) => {
|
|
390
|
+
if (S == null || S(o), o.defaultPrevented || !t) return;
|
|
391
391
|
const { virtualFocus: d } = t.getState();
|
|
392
392
|
if (!d) return;
|
|
393
|
-
const E =
|
|
394
|
-
z(
|
|
395
|
-
}), b = a.onFocus, C = H((
|
|
396
|
-
if (b == null || b(
|
|
397
|
-
const { relatedTarget: d } =
|
|
398
|
-
E ? z(
|
|
399
|
-
}), W = a.onBlurCapture, q = H((
|
|
393
|
+
const E = o.relatedTarget, y = Ke(o.currentTarget);
|
|
394
|
+
z(o) && y && (o.stopPropagation(), v.current = E);
|
|
395
|
+
}), b = a.onFocus, C = H((o) => {
|
|
396
|
+
if (b == null || b(o), o.defaultPrevented || !i || !t) return;
|
|
397
|
+
const { relatedTarget: d } = o, { virtualFocus: E } = t.getState();
|
|
398
|
+
E ? z(o) && !Q(t, d) && queueMicrotask(K) : z(o) && t.setActiveId(null);
|
|
399
|
+
}), W = a.onBlurCapture, q = H((o) => {
|
|
400
400
|
var d;
|
|
401
|
-
if (W == null || W(
|
|
401
|
+
if (W == null || W(o), o.defaultPrevented || !t) return;
|
|
402
402
|
const { virtualFocus: E, activeId: y } = t.getState();
|
|
403
403
|
if (!E) return;
|
|
404
|
-
const _ = (d = L(t, y)) == null ? void 0 : d.element, A =
|
|
405
|
-
v.current = null, z(
|
|
406
|
-
}), N = a.onKeyDown, p = xe(l), M = H((
|
|
404
|
+
const _ = (d = L(t, y)) == null ? void 0 : d.element, A = o.relatedTarget, I = Q(t, A), h = v.current;
|
|
405
|
+
v.current = null, z(o) && I ? (A === _ ? h && h !== A && O(h, o) : _ ? O(_, o) : h && O(h, o), o.stopPropagation()) : !Q(t, o.target) && _ && O(_, o);
|
|
406
|
+
}), N = a.onKeyDown, p = xe(l), M = H((o) => {
|
|
407
407
|
var d;
|
|
408
|
-
if (N == null || N(
|
|
408
|
+
if (N == null || N(o), o.defaultPrevented || !t || !z(o)) return;
|
|
409
409
|
const { orientation: E, renderedItems: y, activeId: _ } = t.getState(), A = L(t, _);
|
|
410
410
|
if ((d = A == null ? void 0 : A.element) != null && d.isConnected) return;
|
|
411
411
|
const I = E !== "horizontal", h = E !== "vertical", k = Ye(y);
|
|
412
|
-
if ((
|
|
412
|
+
if ((o.key === "ArrowLeft" || o.key === "ArrowRight" || o.key === "Home" || o.key === "End") && ie(o.currentTarget)) return;
|
|
413
413
|
const J = {
|
|
414
414
|
ArrowUp: (k || I) && (() => {
|
|
415
415
|
if (k) {
|
|
@@ -425,24 +425,24 @@ var nt = pe(
|
|
|
425
425
|
End: t.last,
|
|
426
426
|
PageUp: t.first,
|
|
427
427
|
PageDown: t.last
|
|
428
|
-
}[
|
|
428
|
+
}[o.key];
|
|
429
429
|
if (J) {
|
|
430
430
|
const V = J();
|
|
431
431
|
if (V !== void 0) {
|
|
432
|
-
if (!p(
|
|
433
|
-
|
|
432
|
+
if (!p(o)) return;
|
|
433
|
+
o.preventDefault(), t.move(V);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
437
|
a = _e(
|
|
438
438
|
a,
|
|
439
|
-
(
|
|
439
|
+
(o) => /* @__PURE__ */ Fe.jsx(Le, { value: t, children: o }),
|
|
440
440
|
[t]
|
|
441
441
|
);
|
|
442
|
-
const U = t.useState((
|
|
442
|
+
const U = t.useState((o) => {
|
|
443
443
|
var d;
|
|
444
|
-
if (t &&
|
|
445
|
-
return (d = L(t,
|
|
444
|
+
if (t && i && o.virtualFocus)
|
|
445
|
+
return (d = L(t, o.activeId)) == null ? void 0 : d.id;
|
|
446
446
|
});
|
|
447
447
|
a = Pe(te({
|
|
448
448
|
"aria-activedescendant": U
|
|
@@ -456,14 +456,14 @@ var nt = pe(
|
|
|
456
456
|
onKeyDown: M
|
|
457
457
|
});
|
|
458
458
|
const G = t.useState(
|
|
459
|
-
(
|
|
459
|
+
(o) => i && (o.virtualFocus || o.activeId === null)
|
|
460
460
|
);
|
|
461
461
|
return a = Ae(te({ focusable: G }, a)), a;
|
|
462
462
|
}
|
|
463
463
|
);
|
|
464
|
-
|
|
465
|
-
const n = nt(
|
|
466
|
-
return
|
|
464
|
+
Be(function(s) {
|
|
465
|
+
const n = nt(s);
|
|
466
|
+
return Re(Xe, n);
|
|
467
467
|
});
|
|
468
468
|
export {
|
|
469
469
|
nt as a,
|