@overdoser/react-toolkit 0.0.5 → 0.0.6
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/index.js +495 -484
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef as W, createElement as Ie, useState as X, useCallback as L, useMemo as ee, useEffect as F, useRef as O, useId as ne, createContext as fe, useContext as ae, cloneElement as $e } from "react";
|
|
2
2
|
import { jsxs as I, jsx as c } from "react/jsx-runtime";
|
|
3
|
-
import { FormProvider as Ce, useFormContext as
|
|
3
|
+
import { FormProvider as Ce, useFormContext as De, useController as Re } from "react-hook-form";
|
|
4
4
|
import { createPortal as Ee } from "react-dom";
|
|
5
5
|
function ge(e) {
|
|
6
6
|
var r, t, n = "";
|
|
@@ -15,7 +15,7 @@ function l() {
|
|
|
15
15
|
for (var e, r, t = 0, n = "", o = arguments.length; t < o; t++) (e = arguments[t]) && (r = ge(e)) && (n && (n += " "), n += r);
|
|
16
16
|
return n;
|
|
17
17
|
}
|
|
18
|
-
const Le = "crk-root-8RX49", Be = "crk-loading-QfItr", Te = "crk-primary-st6yY", Ae = "crk-secondary-j-3rj", Oe = "crk-danger-Hxs5n", Pe = "crk-ghost-kQ0A8", Me = "crk-sm-RXFPY", We = "crk-md-nDnOD", He = "crk-lg-qD-Qh", qe = "crk-fullWidth-AHpSl", Fe = "crk-content-PpYVU", je = "crk-shimmer-8iQSU", ze = "crk-loadingShimmer-BVvFw",
|
|
18
|
+
const Le = "crk-root-8RX49", Be = "crk-loading-QfItr", Te = "crk-primary-st6yY", Ae = "crk-secondary-j-3rj", Oe = "crk-danger-Hxs5n", Pe = "crk-ghost-kQ0A8", Me = "crk-sm-RXFPY", We = "crk-md-nDnOD", He = "crk-lg-qD-Qh", qe = "crk-fullWidth-AHpSl", Fe = "crk-content-PpYVU", je = "crk-shimmer-8iQSU", ze = "crk-loadingShimmer-BVvFw", Ue = "crk-shimmerSweep-uiZ01", Ke = "crk-dots-U8wss", Ve = "crk-loadingDots-eKv64", Ge = "crk-dot-Owuk1", Qe = "crk-dotBounce-FwdcC", Xe = "crk-loadingBorder-9ULFw", Ye = "crk-borderSpin-EJ2gW", H = {
|
|
19
19
|
root: Le,
|
|
20
20
|
loading: Be,
|
|
21
21
|
primary: Te,
|
|
@@ -29,10 +29,10 @@ const Le = "crk-root-8RX49", Be = "crk-loading-QfItr", Te = "crk-primary-st6yY",
|
|
|
29
29
|
content: Fe,
|
|
30
30
|
shimmer: je,
|
|
31
31
|
loadingShimmer: ze,
|
|
32
|
-
shimmerSweep:
|
|
33
|
-
dots:
|
|
34
|
-
loadingDots:
|
|
35
|
-
dot:
|
|
32
|
+
shimmerSweep: Ue,
|
|
33
|
+
dots: Ke,
|
|
34
|
+
loadingDots: Ve,
|
|
35
|
+
dot: Ge,
|
|
36
36
|
dotBounce: Qe,
|
|
37
37
|
loadingBorder: Xe,
|
|
38
38
|
borderSpin: Ye
|
|
@@ -48,15 +48,15 @@ const Le = "crk-root-8RX49", Be = "crk-loading-QfItr", Te = "crk-primary-st6yY",
|
|
|
48
48
|
loadingStyle: n = "dots",
|
|
49
49
|
fullWidth: o = !1,
|
|
50
50
|
disabled: m,
|
|
51
|
-
classes:
|
|
51
|
+
classes: i,
|
|
52
52
|
className: h,
|
|
53
|
-
style:
|
|
54
|
-
children:
|
|
53
|
+
style: a,
|
|
54
|
+
children: v,
|
|
55
55
|
...u
|
|
56
|
-
},
|
|
56
|
+
}, f) => /* @__PURE__ */ I(
|
|
57
57
|
"button",
|
|
58
58
|
{
|
|
59
|
-
ref:
|
|
59
|
+
ref: f,
|
|
60
60
|
className: l(
|
|
61
61
|
H.root,
|
|
62
62
|
H[e],
|
|
@@ -64,20 +64,20 @@ const Le = "crk-root-8RX49", Be = "crk-loading-QfItr", Te = "crk-primary-st6yY",
|
|
|
64
64
|
o && H.fullWidth,
|
|
65
65
|
t && H.loading,
|
|
66
66
|
t && Je[n],
|
|
67
|
-
|
|
67
|
+
i?.root,
|
|
68
68
|
h
|
|
69
69
|
),
|
|
70
|
-
style:
|
|
70
|
+
style: a,
|
|
71
71
|
disabled: m || t,
|
|
72
72
|
"aria-busy": t || void 0,
|
|
73
73
|
...u,
|
|
74
74
|
children: [
|
|
75
|
-
/* @__PURE__ */ c("div", { className: l(H.shimmer,
|
|
76
|
-
/* @__PURE__ */ c("span", { className: l(H.content,
|
|
77
|
-
/* @__PURE__ */ I("span", { className: l(H.dots,
|
|
78
|
-
/* @__PURE__ */ c("span", { className: l(H.dot,
|
|
79
|
-
/* @__PURE__ */ c("span", { className: l(H.dot,
|
|
80
|
-
/* @__PURE__ */ c("span", { className: l(H.dot,
|
|
75
|
+
/* @__PURE__ */ c("div", { className: l(H.shimmer, i?.shimmer) }),
|
|
76
|
+
/* @__PURE__ */ c("span", { className: l(H.content, i?.content), children: v }),
|
|
77
|
+
/* @__PURE__ */ I("span", { className: l(H.dots, i?.dots), "aria-hidden": "true", children: [
|
|
78
|
+
/* @__PURE__ */ c("span", { className: l(H.dot, i?.dot) }),
|
|
79
|
+
/* @__PURE__ */ c("span", { className: l(H.dot, i?.dot) }),
|
|
80
|
+
/* @__PURE__ */ c("span", { className: l(H.dot, i?.dot) })
|
|
81
81
|
] })
|
|
82
82
|
]
|
|
83
83
|
}
|
|
@@ -98,10 +98,10 @@ const _e = "crk-root-2j4Vp", er = "crk-muted-vReNc", rr = "crk-danger-ugf9r", tr
|
|
|
98
98
|
style: n,
|
|
99
99
|
children: o,
|
|
100
100
|
...m
|
|
101
|
-
},
|
|
101
|
+
}, i) => /* @__PURE__ */ I(
|
|
102
102
|
"a",
|
|
103
103
|
{
|
|
104
|
-
ref:
|
|
104
|
+
ref: i,
|
|
105
105
|
className: l(me.root, me[e], t),
|
|
106
106
|
style: n,
|
|
107
107
|
...r && {
|
|
@@ -117,7 +117,7 @@ const _e = "crk-root-2j4Vp", er = "crk-muted-vReNc", rr = "crk-danger-ugf9r", tr
|
|
|
117
117
|
)
|
|
118
118
|
);
|
|
119
119
|
nr.displayName = "Link";
|
|
120
|
-
const or = "crk-root-U-oiq", cr = "crk-h1-Aivwz", lr = "crk-h2-CV8Oo", sr = "crk-h3-lrbrK", ar = "crk-h4--jkC1", ir = "crk-h5-GnQvD", dr = "crk-h6-MKlIN", ur = "crk-p-FzRtm", mr = "crk-span-NZvLx", hr = "crk-label-Cwi6a", pr = "crk-normal-7AeZz", fr = "crk-medium-36OXr", gr = "crk-semibold-oQixc", br = "crk-bold-bk4b4", kr = "crk-muted-itOSW",
|
|
120
|
+
const or = "crk-root-U-oiq", cr = "crk-h1-Aivwz", lr = "crk-h2-CV8Oo", sr = "crk-h3-lrbrK", ar = "crk-h4--jkC1", ir = "crk-h5-GnQvD", dr = "crk-h6-MKlIN", ur = "crk-p-FzRtm", mr = "crk-span-NZvLx", hr = "crk-label-Cwi6a", pr = "crk-normal-7AeZz", fr = "crk-medium-36OXr", gr = "crk-semibold-oQixc", br = "crk-bold-bk4b4", kr = "crk-muted-itOSW", yr = "crk-primary-rp36t", vr = "crk-danger-SyOy-", Nr = "crk-success-w8PpD", wr = "crk-align-left-3AGYw", xr = "crk-align-center-h-x--", Sr = "crk-align-right-IXFhK", Ir = "crk-truncate-eqr85", _ = {
|
|
121
121
|
root: or,
|
|
122
122
|
h1: cr,
|
|
123
123
|
h2: lr,
|
|
@@ -134,8 +134,8 @@ const or = "crk-root-U-oiq", cr = "crk-h1-Aivwz", lr = "crk-h2-CV8Oo", sr = "crk
|
|
|
134
134
|
bold: br,
|
|
135
135
|
default: "crk-default-79lKR",
|
|
136
136
|
muted: kr,
|
|
137
|
-
primary:
|
|
138
|
-
danger:
|
|
137
|
+
primary: yr,
|
|
138
|
+
danger: vr,
|
|
139
139
|
success: Nr,
|
|
140
140
|
alignLeft: wr,
|
|
141
141
|
alignCenter: xr,
|
|
@@ -149,13 +149,13 @@ const or = "crk-root-U-oiq", cr = "crk-h1-Aivwz", lr = "crk-h2-CV8Oo", sr = "crk
|
|
|
149
149
|
align: n,
|
|
150
150
|
truncate: o = !1,
|
|
151
151
|
className: m,
|
|
152
|
-
style:
|
|
152
|
+
style: i,
|
|
153
153
|
children: h,
|
|
154
|
-
...
|
|
155
|
-
},
|
|
154
|
+
...a
|
|
155
|
+
}, v) => Ie(
|
|
156
156
|
e,
|
|
157
157
|
{
|
|
158
|
-
ref:
|
|
158
|
+
ref: v,
|
|
159
159
|
className: l(
|
|
160
160
|
_.root,
|
|
161
161
|
_[e],
|
|
@@ -165,17 +165,17 @@ const or = "crk-root-U-oiq", cr = "crk-h1-Aivwz", lr = "crk-h2-CV8Oo", sr = "crk
|
|
|
165
165
|
o && _.truncate,
|
|
166
166
|
m
|
|
167
167
|
),
|
|
168
|
-
style:
|
|
169
|
-
...
|
|
168
|
+
style: i,
|
|
169
|
+
...a
|
|
170
170
|
},
|
|
171
171
|
h
|
|
172
172
|
)
|
|
173
173
|
);
|
|
174
174
|
$r.displayName = "Typography";
|
|
175
|
-
const Cr = "crk-root-PVrgx",
|
|
175
|
+
const Cr = "crk-root-PVrgx", Dr = "crk-unordered-FhCWT", Rr = "crk-item-TfW82", Er = "crk-ordered-8x4YC", Lr = "crk-none-f03Kx", Br = "crk-sm-Rg4Mv", Tr = "crk-md-X4Icb", Ar = "crk-lg-JjNKZ", le = {
|
|
176
176
|
root: Cr,
|
|
177
|
-
unordered:
|
|
178
|
-
item:
|
|
177
|
+
unordered: Dr,
|
|
178
|
+
item: Rr,
|
|
179
179
|
ordered: Er,
|
|
180
180
|
none: Lr,
|
|
181
181
|
sm: Br,
|
|
@@ -189,10 +189,10 @@ const Cr = "crk-root-PVrgx", Rr = "crk-unordered-FhCWT", Dr = "crk-item-TfW82",
|
|
|
189
189
|
style: n,
|
|
190
190
|
children: o,
|
|
191
191
|
...m
|
|
192
|
-
},
|
|
192
|
+
}, i) => /* @__PURE__ */ c(
|
|
193
193
|
e === "ordered" ? "ol" : "ul",
|
|
194
194
|
{
|
|
195
|
-
ref:
|
|
195
|
+
ref: i,
|
|
196
196
|
className: l(
|
|
197
197
|
le.root,
|
|
198
198
|
le[e],
|
|
@@ -219,7 +219,7 @@ const Pr = W(
|
|
|
219
219
|
)
|
|
220
220
|
);
|
|
221
221
|
Pr.displayName = "ListItem";
|
|
222
|
-
const Mr = "crk-wrapper-zxjMt", Wr = "crk-root-Gf85-", Hr = "crk-headerCell-ePPZW", qr = "crk-headerCellSortable-NMybk", Fr = "crk-sortIndicator-WGD2S", jr = "crk-sortArrow-1-ok4", zr = "crk-sortArrowActive-yhWrO",
|
|
222
|
+
const Mr = "crk-wrapper-zxjMt", Wr = "crk-root-Gf85-", Hr = "crk-headerCell-ePPZW", qr = "crk-headerCellSortable-NMybk", Fr = "crk-sortIndicator-WGD2S", jr = "crk-sortArrow-1-ok4", zr = "crk-sortArrowActive-yhWrO", Ur = "crk-sortIndex-HGoca", Kr = "crk-row-H0wL1", Vr = "crk-cell-ZfnbG", Gr = "crk-emptyRow-AoPfj", Qr = "crk-emptyCell-99-7C", Xr = "crk-striped-6Qckq", Yr = "crk-hoverable-ljU9B", Jr = "crk-compact-2-UWr", Zr = "crk-paginator-UlYIY", _r = "crk-paginatorInfo-BVca4", et = "crk-paginatorText-sqWS0", rt = "crk-pageSizeSelect-yhqJQ", tt = "crk-paginatorNav-MDSui", nt = "crk-pageButton-1PX-g", ot = "crk-pageButtonActive--D7Q7", ct = "crk-pageEllipsis-en59J", R = {
|
|
223
223
|
wrapper: Mr,
|
|
224
224
|
root: Wr,
|
|
225
225
|
headerCell: Hr,
|
|
@@ -227,10 +227,10 @@ const Mr = "crk-wrapper-zxjMt", Wr = "crk-root-Gf85-", Hr = "crk-headerCell-ePPZ
|
|
|
227
227
|
sortIndicator: Fr,
|
|
228
228
|
sortArrow: jr,
|
|
229
229
|
sortArrowActive: zr,
|
|
230
|
-
sortIndex:
|
|
231
|
-
row:
|
|
232
|
-
cell:
|
|
233
|
-
emptyRow:
|
|
230
|
+
sortIndex: Ur,
|
|
231
|
+
row: Kr,
|
|
232
|
+
cell: Vr,
|
|
233
|
+
emptyRow: Gr,
|
|
234
234
|
emptyCell: Qr,
|
|
235
235
|
striped: Xr,
|
|
236
236
|
hoverable: Yr,
|
|
@@ -248,39 +248,39 @@ function lt(e, r) {
|
|
|
248
248
|
return e == null && r == null ? 0 : e == null ? -1 : r == null ? 1 : typeof e == "number" && typeof r == "number" ? e - r : String(e).localeCompare(String(r));
|
|
249
249
|
}
|
|
250
250
|
function st(e, r = []) {
|
|
251
|
-
const [t, n] = X(r), o = L((
|
|
252
|
-
n((
|
|
253
|
-
const u =
|
|
254
|
-
return u ? u.direction === "asc" ? [{ key:
|
|
251
|
+
const [t, n] = X(r), o = L((a) => {
|
|
252
|
+
n((v) => {
|
|
253
|
+
const u = v.find((f) => f.key === a);
|
|
254
|
+
return u ? u.direction === "asc" ? [{ key: a, direction: "desc" }] : [] : [{ key: a, direction: "asc" }];
|
|
255
255
|
});
|
|
256
|
-
}, []), m = L((
|
|
257
|
-
n((
|
|
258
|
-
const u =
|
|
256
|
+
}, []), m = L((a) => {
|
|
257
|
+
n((v) => {
|
|
258
|
+
const u = v.findIndex((y) => y.key === a);
|
|
259
259
|
if (u === -1)
|
|
260
|
-
return [...
|
|
261
|
-
if (
|
|
262
|
-
const
|
|
263
|
-
return
|
|
260
|
+
return [...v, { key: a, direction: "asc" }];
|
|
261
|
+
if (v[u].direction === "asc") {
|
|
262
|
+
const y = [...v];
|
|
263
|
+
return y[u] = { key: a, direction: "desc" }, y;
|
|
264
264
|
}
|
|
265
|
-
return
|
|
265
|
+
return v.filter((y, b) => b !== u);
|
|
266
266
|
});
|
|
267
|
-
}, []),
|
|
267
|
+
}, []), i = L(() => {
|
|
268
268
|
n([]);
|
|
269
269
|
}, []);
|
|
270
|
-
return { sortedData: ee(() => t.length === 0 ? e : [...e].sort((
|
|
271
|
-
for (const { key: u, direction:
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
return
|
|
270
|
+
return { sortedData: ee(() => t.length === 0 ? e : [...e].sort((a, v) => {
|
|
271
|
+
for (const { key: u, direction: f } of t) {
|
|
272
|
+
const y = lt(a[u], v[u]);
|
|
273
|
+
if (y !== 0)
|
|
274
|
+
return f === "asc" ? y : -y;
|
|
275
275
|
}
|
|
276
276
|
return 0;
|
|
277
|
-
}), [e, t]), sortConfig: t, requestSort: o, requestMultiSort: m, resetSort:
|
|
277
|
+
}), [e, t]), sortConfig: t, requestSort: o, requestMultiSort: m, resetSort: i };
|
|
278
278
|
}
|
|
279
279
|
function at({ direction: e, sortIndex: r }) {
|
|
280
|
-
return /* @__PURE__ */ I("span", { className:
|
|
281
|
-
/* @__PURE__ */ c("span", { className: l(
|
|
282
|
-
/* @__PURE__ */ c("span", { className: l(
|
|
283
|
-
r !== void 0 && r >= 0 && /* @__PURE__ */ c("span", { className:
|
|
280
|
+
return /* @__PURE__ */ I("span", { className: R.sortIndicator, "aria-hidden": "true", children: [
|
|
281
|
+
/* @__PURE__ */ c("span", { className: l(R.sortArrow, e === "asc" && R.sortArrowActive), children: "▲" }),
|
|
282
|
+
/* @__PURE__ */ c("span", { className: l(R.sortArrow, e === "desc" && R.sortArrowActive), children: "▼" }),
|
|
283
|
+
r !== void 0 && r >= 0 && /* @__PURE__ */ c("span", { className: R.sortIndex, children: r + 1 })
|
|
284
284
|
] });
|
|
285
285
|
}
|
|
286
286
|
function it({
|
|
@@ -291,25 +291,25 @@ function it({
|
|
|
291
291
|
onPageChange: o,
|
|
292
292
|
paginatorClasses: m
|
|
293
293
|
}) {
|
|
294
|
-
const
|
|
294
|
+
const i = Math.max(1, Math.ceil(t / r)), h = (e - 1) * r + 1, a = Math.min(e * r, t), v = ee(() => {
|
|
295
295
|
const u = [];
|
|
296
|
-
if (
|
|
297
|
-
for (let
|
|
296
|
+
if (i <= 7)
|
|
297
|
+
for (let f = 1; f <= i; f++) u.push(f);
|
|
298
298
|
else {
|
|
299
299
|
u.push(1), e > 3 && u.push("ellipsis");
|
|
300
|
-
for (let
|
|
301
|
-
u.push(
|
|
302
|
-
e <
|
|
300
|
+
for (let f = Math.max(2, e - 1); f <= Math.min(i - 1, e + 1); f++)
|
|
301
|
+
u.push(f);
|
|
302
|
+
e < i - 2 && u.push("ellipsis"), u.push(i);
|
|
303
303
|
}
|
|
304
304
|
return u;
|
|
305
|
-
}, [e,
|
|
306
|
-
return /* @__PURE__ */ I("nav", { className: l(
|
|
307
|
-
/* @__PURE__ */ I("div", { className:
|
|
308
|
-
/* @__PURE__ */ c("span", { className:
|
|
305
|
+
}, [e, i]);
|
|
306
|
+
return /* @__PURE__ */ I("nav", { className: l(R.paginator, m?.paginator), "aria-label": "Table pagination", children: [
|
|
307
|
+
/* @__PURE__ */ I("div", { className: R.paginatorInfo, children: [
|
|
308
|
+
/* @__PURE__ */ c("span", { className: R.paginatorText, children: t > 0 ? `${h}–${a} of ${t}` : "No results" }),
|
|
309
309
|
n.length > 1 && /* @__PURE__ */ c(
|
|
310
310
|
"select",
|
|
311
311
|
{
|
|
312
|
-
className:
|
|
312
|
+
className: R.pageSizeSelect,
|
|
313
313
|
value: r,
|
|
314
314
|
onChange: (u) => o(1, Number(u.target.value)),
|
|
315
315
|
"aria-label": "Rows per page",
|
|
@@ -320,24 +320,24 @@ function it({
|
|
|
320
320
|
}
|
|
321
321
|
)
|
|
322
322
|
] }),
|
|
323
|
-
/* @__PURE__ */ I("div", { className:
|
|
323
|
+
/* @__PURE__ */ I("div", { className: R.paginatorNav, children: [
|
|
324
324
|
/* @__PURE__ */ c(
|
|
325
325
|
"button",
|
|
326
326
|
{
|
|
327
327
|
type: "button",
|
|
328
|
-
className: l(
|
|
328
|
+
className: l(R.pageButton, m?.pageButton),
|
|
329
329
|
disabled: e <= 1,
|
|
330
330
|
onClick: () => o(e - 1, r),
|
|
331
331
|
"aria-label": "Previous page",
|
|
332
332
|
children: "‹"
|
|
333
333
|
}
|
|
334
334
|
),
|
|
335
|
-
|
|
336
|
-
(u,
|
|
335
|
+
v.map(
|
|
336
|
+
(u, f) => u === "ellipsis" ? /* @__PURE__ */ c("span", { className: R.pageEllipsis, children: "…" }, `ellipsis-${f}`) : /* @__PURE__ */ c(
|
|
337
337
|
"button",
|
|
338
338
|
{
|
|
339
339
|
type: "button",
|
|
340
|
-
className: l(
|
|
340
|
+
className: l(R.pageButton, u === e && R.pageButtonActive, m?.pageButton),
|
|
341
341
|
onClick: () => o(u, r),
|
|
342
342
|
"aria-label": `Page ${u}`,
|
|
343
343
|
"aria-current": u === e ? "page" : void 0,
|
|
@@ -350,8 +350,8 @@ function it({
|
|
|
350
350
|
"button",
|
|
351
351
|
{
|
|
352
352
|
type: "button",
|
|
353
|
-
className: l(
|
|
354
|
-
disabled: e >=
|
|
353
|
+
className: l(R.pageButton, m?.pageButton),
|
|
354
|
+
disabled: e >= i,
|
|
355
355
|
onClick: () => o(e + 1, r),
|
|
356
356
|
"aria-label": "Next page",
|
|
357
357
|
children: "›"
|
|
@@ -367,81 +367,81 @@ function dt({
|
|
|
367
367
|
onSort: n,
|
|
368
368
|
multiSort: o = !0,
|
|
369
369
|
striped: m = !1,
|
|
370
|
-
hoverable:
|
|
370
|
+
hoverable: i = !1,
|
|
371
371
|
compact: h = !1,
|
|
372
|
-
className:
|
|
373
|
-
style:
|
|
372
|
+
className: a,
|
|
373
|
+
style: v,
|
|
374
374
|
rowKey: u,
|
|
375
|
-
emptyMessage:
|
|
376
|
-
pagination:
|
|
375
|
+
emptyMessage: f = "No data",
|
|
376
|
+
pagination: y,
|
|
377
377
|
classes: b
|
|
378
378
|
}) {
|
|
379
|
-
const
|
|
379
|
+
const g = n !== void 0, {
|
|
380
380
|
sortedData: $,
|
|
381
381
|
sortConfig: w,
|
|
382
|
-
requestSort:
|
|
382
|
+
requestSort: C,
|
|
383
383
|
requestMultiSort: D
|
|
384
|
-
} = st(e, t),
|
|
385
|
-
if (!
|
|
386
|
-
const k = (
|
|
387
|
-
return E.slice(k, k +
|
|
388
|
-
}, [E,
|
|
384
|
+
} = st(e, t), x = g ? t ?? [] : w, E = g ? e : $, U = ee(() => {
|
|
385
|
+
if (!y || g) return E;
|
|
386
|
+
const k = (y.page - 1) * y.pageSize;
|
|
387
|
+
return E.slice(k, k + y.pageSize);
|
|
388
|
+
}, [E, y, g]), q = y?.totalRows ?? E.length, G = L(
|
|
389
389
|
(k, P) => {
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
392
|
-
if (
|
|
393
|
-
const B =
|
|
390
|
+
const S = o && (P.ctrlKey || P.metaKey);
|
|
391
|
+
if (g)
|
|
392
|
+
if (S) {
|
|
393
|
+
const B = x.findIndex((A) => A.key === k);
|
|
394
394
|
let z;
|
|
395
|
-
B === -1 ? z = [...
|
|
395
|
+
B === -1 ? z = [...x, { key: k, direction: "asc" }] : x[B].direction === "asc" ? z = x.map(
|
|
396
396
|
(A, Z) => Z === B ? { key: k, direction: "desc" } : A
|
|
397
|
-
) : z =
|
|
397
|
+
) : z = x.filter((A, Z) => Z !== B), n(z);
|
|
398
398
|
} else {
|
|
399
|
-
const B =
|
|
399
|
+
const B = x.find((z) => z.key === k);
|
|
400
400
|
B ? B.direction === "asc" ? n([{ key: k, direction: "desc" }]) : n([]) : n([{ key: k, direction: "asc" }]);
|
|
401
401
|
}
|
|
402
402
|
else
|
|
403
|
-
|
|
403
|
+
S ? D(k) : C(k);
|
|
404
404
|
},
|
|
405
405
|
[
|
|
406
|
-
|
|
406
|
+
g,
|
|
407
407
|
o,
|
|
408
|
-
|
|
408
|
+
x,
|
|
409
409
|
n,
|
|
410
|
-
|
|
410
|
+
C,
|
|
411
411
|
D
|
|
412
412
|
]
|
|
413
|
-
), j = (k) =>
|
|
414
|
-
if (
|
|
415
|
-
const P =
|
|
413
|
+
), j = (k) => x.find((S) => S.key === k)?.direction, Y = (k) => {
|
|
414
|
+
if (x.length <= 1) return;
|
|
415
|
+
const P = x.findIndex((S) => S.key === k);
|
|
416
416
|
return P >= 0 ? P : void 0;
|
|
417
417
|
};
|
|
418
|
-
return /* @__PURE__ */ I("div", { className: l(
|
|
418
|
+
return /* @__PURE__ */ I("div", { className: l(R.wrapper, b?.wrapper), children: [
|
|
419
419
|
/* @__PURE__ */ I(
|
|
420
420
|
"table",
|
|
421
421
|
{
|
|
422
422
|
className: l(
|
|
423
|
-
|
|
424
|
-
m &&
|
|
425
|
-
|
|
426
|
-
h &&
|
|
423
|
+
R.root,
|
|
424
|
+
m && R.striped,
|
|
425
|
+
i && R.hoverable,
|
|
426
|
+
h && R.compact,
|
|
427
427
|
b?.root,
|
|
428
|
-
|
|
428
|
+
a
|
|
429
429
|
),
|
|
430
|
-
style:
|
|
430
|
+
style: v,
|
|
431
431
|
children: [
|
|
432
432
|
/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: r.map((k) => /* @__PURE__ */ I(
|
|
433
433
|
"th",
|
|
434
434
|
{
|
|
435
435
|
className: l(
|
|
436
|
-
|
|
437
|
-
k.sortable &&
|
|
436
|
+
R.headerCell,
|
|
437
|
+
k.sortable && R.headerCellSortable,
|
|
438
438
|
b?.headerCell
|
|
439
439
|
),
|
|
440
440
|
style: {
|
|
441
441
|
width: k.width,
|
|
442
442
|
textAlign: k.align
|
|
443
443
|
},
|
|
444
|
-
onClick: k.sortable ? (P) =>
|
|
444
|
+
onClick: k.sortable ? (P) => G(k.key, P) : void 0,
|
|
445
445
|
"aria-sort": k.sortable ? j(k.key) === "asc" ? "ascending" : j(k.key) === "desc" ? "descending" : "none" : void 0,
|
|
446
446
|
children: [
|
|
447
447
|
k.header,
|
|
@@ -456,32 +456,32 @@ function dt({
|
|
|
456
456
|
},
|
|
457
457
|
k.key
|
|
458
458
|
)) }) }),
|
|
459
|
-
/* @__PURE__ */ c("tbody", { children:
|
|
460
|
-
const
|
|
461
|
-
return /* @__PURE__ */ c("tr", { className: l(
|
|
459
|
+
/* @__PURE__ */ c("tbody", { children: U.length === 0 ? /* @__PURE__ */ c("tr", { className: R.emptyRow, children: /* @__PURE__ */ c("td", { className: l(R.emptyCell, b?.emptyCell), colSpan: r.length, children: f }) }) : U.map((k, P) => {
|
|
460
|
+
const S = u ? String(k[u]) : P;
|
|
461
|
+
return /* @__PURE__ */ c("tr", { className: l(R.row, b?.row), children: r.map((B) => /* @__PURE__ */ c(
|
|
462
462
|
"td",
|
|
463
463
|
{
|
|
464
|
-
className: l(
|
|
464
|
+
className: l(R.cell, b?.cell),
|
|
465
465
|
style: { textAlign: B.align },
|
|
466
466
|
children: B.render ? B.render(k[B.key], k, P) : k[B.key]
|
|
467
467
|
},
|
|
468
468
|
B.key
|
|
469
|
-
)) },
|
|
469
|
+
)) }, S);
|
|
470
470
|
}) })
|
|
471
471
|
]
|
|
472
472
|
}
|
|
473
473
|
),
|
|
474
|
-
|
|
474
|
+
y && /* @__PURE__ */ c(
|
|
475
475
|
it,
|
|
476
476
|
{
|
|
477
|
-
...
|
|
477
|
+
...y,
|
|
478
478
|
totalRows: q,
|
|
479
479
|
paginatorClasses: { paginator: b?.paginator, pageButton: b?.pageButton }
|
|
480
480
|
}
|
|
481
481
|
)
|
|
482
482
|
] });
|
|
483
483
|
}
|
|
484
|
-
const
|
|
484
|
+
const Co = dt, ut = "crk-root-an8Cf", mt = "crk-fullWidth-S-uVk", ht = "crk-trigger-LwPaD", pt = "crk-triggerOpen-U4pa9", ft = "crk-triggerLabel-QLITs", gt = "crk-triggerError-3jlu1", bt = "crk-placeholder-fWdch", kt = "crk-chevron-jmDNe", yt = "crk-menu-fxnKL", vt = "crk-menuOpen-HF-Y1", Nt = "crk-alignLeft-buCDJ", wt = "crk-alignRight-05P9w", xt = "crk-item-f-Rhh", St = "crk-itemDisabled-L-d6i", It = "crk-itemSelected-Fwmuo", M = {
|
|
485
485
|
root: ut,
|
|
486
486
|
fullWidth: mt,
|
|
487
487
|
trigger: ht,
|
|
@@ -490,8 +490,8 @@ const $o = dt, ut = "crk-root-an8Cf", mt = "crk-fullWidth-S-uVk", ht = "crk-trig
|
|
|
490
490
|
triggerError: gt,
|
|
491
491
|
placeholder: bt,
|
|
492
492
|
chevron: kt,
|
|
493
|
-
menu:
|
|
494
|
-
menuOpen:
|
|
493
|
+
menu: yt,
|
|
494
|
+
menuOpen: vt,
|
|
495
495
|
alignLeft: Nt,
|
|
496
496
|
alignRight: wt,
|
|
497
497
|
item: xt,
|
|
@@ -532,32 +532,32 @@ const $t = W(
|
|
|
532
532
|
className: n,
|
|
533
533
|
style: o,
|
|
534
534
|
id: m,
|
|
535
|
-
onOpen:
|
|
535
|
+
onOpen: i,
|
|
536
536
|
onClose: h,
|
|
537
|
-
options:
|
|
538
|
-
placeholder:
|
|
537
|
+
options: a,
|
|
538
|
+
placeholder: v = "Select...",
|
|
539
539
|
value: u,
|
|
540
|
-
onChange:
|
|
541
|
-
error:
|
|
540
|
+
onChange: f,
|
|
541
|
+
error: y = !1,
|
|
542
542
|
fullWidth: b = !0,
|
|
543
|
-
classes:
|
|
543
|
+
classes: g
|
|
544
544
|
}, $) => {
|
|
545
|
-
const [w,
|
|
545
|
+
const [w, C] = X(!1), D = O(null), x = O(null), E = O(null), U = ne();
|
|
546
546
|
F(() => {
|
|
547
|
-
w &&
|
|
547
|
+
w && x.current && x.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
|
|
548
548
|
}, [w]);
|
|
549
549
|
const q = L(() => {
|
|
550
|
-
|
|
551
|
-
}, [h]),
|
|
552
|
-
|
|
553
|
-
const B = !
|
|
554
|
-
return B ?
|
|
550
|
+
C(!1), h?.(), E.current?.focus();
|
|
551
|
+
}, [h]), G = L(() => {
|
|
552
|
+
C((S) => {
|
|
553
|
+
const B = !S;
|
|
554
|
+
return B ? i?.() : h?.(), B;
|
|
555
555
|
});
|
|
556
|
-
}, [
|
|
557
|
-
(
|
|
558
|
-
|
|
556
|
+
}, [i, h]), j = L(
|
|
557
|
+
(S) => {
|
|
558
|
+
f?.(S), q();
|
|
559
559
|
},
|
|
560
|
-
[
|
|
560
|
+
[f, q]
|
|
561
561
|
);
|
|
562
562
|
ie(D, q, w), he(
|
|
563
563
|
{
|
|
@@ -565,12 +565,12 @@ const $t = W(
|
|
|
565
565
|
},
|
|
566
566
|
w
|
|
567
567
|
);
|
|
568
|
-
const Y =
|
|
568
|
+
const Y = a?.find((S) => S.value === u)?.label, k = a ? Y || v : e, P = a && !Y;
|
|
569
569
|
return /* @__PURE__ */ c(
|
|
570
570
|
"div",
|
|
571
571
|
{
|
|
572
572
|
ref: $,
|
|
573
|
-
className: l(M.root, b && M.fullWidth,
|
|
573
|
+
className: l(M.root, b && M.fullWidth, g?.root, n),
|
|
574
574
|
style: o,
|
|
575
575
|
children: /* @__PURE__ */ I("div", { ref: D, style: b ? { width: "100%" } : void 0, children: [
|
|
576
576
|
/* @__PURE__ */ I(
|
|
@@ -582,49 +582,49 @@ const $t = W(
|
|
|
582
582
|
className: l(
|
|
583
583
|
M.trigger,
|
|
584
584
|
w && M.triggerOpen,
|
|
585
|
-
|
|
585
|
+
y && M.triggerError,
|
|
586
586
|
b && M.fullWidth,
|
|
587
|
-
|
|
587
|
+
g?.trigger
|
|
588
588
|
),
|
|
589
|
-
onClick:
|
|
589
|
+
onClick: G,
|
|
590
590
|
"aria-expanded": w,
|
|
591
591
|
"aria-haspopup": "menu",
|
|
592
|
-
"aria-controls": w ?
|
|
592
|
+
"aria-controls": w ? U : void 0,
|
|
593
593
|
children: [
|
|
594
|
-
/* @__PURE__ */ c("span", { className: l(M.triggerLabel, P && M.placeholder,
|
|
595
|
-
/* @__PURE__ */ c("span", { className: l(M.chevron,
|
|
594
|
+
/* @__PURE__ */ c("span", { className: l(M.triggerLabel, P && M.placeholder, g?.triggerLabel), children: k }),
|
|
595
|
+
/* @__PURE__ */ c("span", { className: l(M.chevron, g?.chevron), "aria-hidden": "true" })
|
|
596
596
|
]
|
|
597
597
|
}
|
|
598
598
|
),
|
|
599
599
|
/* @__PURE__ */ c(
|
|
600
600
|
"div",
|
|
601
601
|
{
|
|
602
|
-
ref:
|
|
603
|
-
id:
|
|
602
|
+
ref: x,
|
|
603
|
+
id: U,
|
|
604
604
|
className: l(
|
|
605
605
|
M.menu,
|
|
606
606
|
w && M.menuOpen,
|
|
607
607
|
t === "left" ? M.alignLeft : M.alignRight,
|
|
608
608
|
b && M.fullWidth,
|
|
609
|
-
|
|
609
|
+
g?.menu
|
|
610
610
|
),
|
|
611
611
|
role: "menu",
|
|
612
|
-
children:
|
|
612
|
+
children: a ? a.map((S) => /* @__PURE__ */ c(
|
|
613
613
|
"button",
|
|
614
614
|
{
|
|
615
615
|
type: "button",
|
|
616
616
|
role: "menuitem",
|
|
617
617
|
className: l(
|
|
618
618
|
M.item,
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
619
|
+
S.disabled && M.itemDisabled,
|
|
620
|
+
S.value === u && M.itemSelected,
|
|
621
|
+
g?.item
|
|
622
622
|
),
|
|
623
|
-
disabled:
|
|
624
|
-
onClick: () => j(
|
|
625
|
-
children:
|
|
623
|
+
disabled: S.disabled,
|
|
624
|
+
onClick: () => j(S.value),
|
|
625
|
+
children: S.label
|
|
626
626
|
},
|
|
627
|
-
|
|
627
|
+
S.value
|
|
628
628
|
)) : r
|
|
629
629
|
}
|
|
630
630
|
)
|
|
@@ -658,9 +658,9 @@ const Ct = W(
|
|
|
658
658
|
)
|
|
659
659
|
);
|
|
660
660
|
Ct.displayName = "DropdownItem";
|
|
661
|
-
const
|
|
662
|
-
root:
|
|
663
|
-
trigger:
|
|
661
|
+
const Dt = "crk-root-8H-L9", Rt = "crk-trigger-Zn1nQ", Et = "crk-popover-rvS3X", Lt = "crk-popoverFade-hj41M", Bt = "crk-bottom-lawQw", Tt = "crk-top-rqvC6", At = "crk-left-J6exv", Ot = "crk-right-3y20l", oe = {
|
|
662
|
+
root: Dt,
|
|
663
|
+
trigger: Rt,
|
|
664
664
|
popover: Et,
|
|
665
665
|
popoverFade: Lt,
|
|
666
666
|
bottom: Bt,
|
|
@@ -675,56 +675,56 @@ const Rt = "crk-root-8H-L9", Dt = "crk-trigger-Zn1nQ", Et = "crk-popover-rvS3X",
|
|
|
675
675
|
open: n,
|
|
676
676
|
onOpenChange: o,
|
|
677
677
|
classes: m,
|
|
678
|
-
className:
|
|
678
|
+
className: i,
|
|
679
679
|
style: h
|
|
680
|
-
},
|
|
681
|
-
const [
|
|
680
|
+
}, a) => {
|
|
681
|
+
const [v, u] = X(!1), f = O(null), y = O(null), b = O(null), g = ne(), $ = n !== void 0, w = $ ? n : v, C = L(
|
|
682
682
|
(E) => {
|
|
683
683
|
$ || u(E), o?.(E);
|
|
684
684
|
},
|
|
685
685
|
[$, o]
|
|
686
686
|
), D = L(() => {
|
|
687
|
-
|
|
688
|
-
}, [
|
|
689
|
-
|
|
690
|
-
}, [w,
|
|
691
|
-
return ie(
|
|
687
|
+
C(!1), b.current?.focus();
|
|
688
|
+
}, [C]), x = L(() => {
|
|
689
|
+
C(!w);
|
|
690
|
+
}, [w, C]);
|
|
691
|
+
return ie(f, D, w), he(
|
|
692
692
|
{
|
|
693
693
|
Escape: () => D()
|
|
694
694
|
},
|
|
695
695
|
w
|
|
696
696
|
), F(() => {
|
|
697
|
-
if (w &&
|
|
698
|
-
const E =
|
|
697
|
+
if (w && y.current) {
|
|
698
|
+
const E = y.current.querySelector(
|
|
699
699
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
700
700
|
);
|
|
701
|
-
E ? E.focus() :
|
|
701
|
+
E ? E.focus() : y.current.focus();
|
|
702
702
|
}
|
|
703
703
|
}, [w]), /* @__PURE__ */ c(
|
|
704
704
|
"div",
|
|
705
705
|
{
|
|
706
|
-
ref:
|
|
707
|
-
className: l(oe.root, m?.root,
|
|
706
|
+
ref: a,
|
|
707
|
+
className: l(oe.root, m?.root, i),
|
|
708
708
|
style: h,
|
|
709
|
-
children: /* @__PURE__ */ I("div", { ref:
|
|
709
|
+
children: /* @__PURE__ */ I("div", { ref: f, children: [
|
|
710
710
|
/* @__PURE__ */ c(
|
|
711
711
|
"button",
|
|
712
712
|
{
|
|
713
713
|
ref: b,
|
|
714
714
|
type: "button",
|
|
715
715
|
className: l(oe.trigger, m?.trigger),
|
|
716
|
-
onClick:
|
|
716
|
+
onClick: x,
|
|
717
717
|
"aria-expanded": w,
|
|
718
718
|
"aria-haspopup": "dialog",
|
|
719
|
-
"aria-controls": w ?
|
|
719
|
+
"aria-controls": w ? g : void 0,
|
|
720
720
|
children: e
|
|
721
721
|
}
|
|
722
722
|
),
|
|
723
723
|
w && /* @__PURE__ */ c(
|
|
724
724
|
"div",
|
|
725
725
|
{
|
|
726
|
-
ref:
|
|
727
|
-
id:
|
|
726
|
+
ref: y,
|
|
727
|
+
id: g,
|
|
728
728
|
role: "dialog",
|
|
729
729
|
tabIndex: -1,
|
|
730
730
|
className: l(oe.popover, oe[t], m?.popover),
|
|
@@ -757,8 +757,8 @@ function Mt(e, r) {
|
|
|
757
757
|
o.preventDefault();
|
|
758
758
|
return;
|
|
759
759
|
}
|
|
760
|
-
const
|
|
761
|
-
o.shiftKey ? document.activeElement ===
|
|
760
|
+
const i = m[0], h = m[m.length - 1];
|
|
761
|
+
o.shiftKey ? document.activeElement === i && (o.preventDefault(), h.focus()) : document.activeElement === h && (o.preventDefault(), i.focus());
|
|
762
762
|
},
|
|
763
763
|
[e]
|
|
764
764
|
);
|
|
@@ -772,17 +772,17 @@ function Mt(e, r) {
|
|
|
772
772
|
};
|
|
773
773
|
}, [r, e, n]);
|
|
774
774
|
}
|
|
775
|
-
const Wt = "crk-backdrop-jYpTA", Ht = "crk-backdropIn-x5Z-A", qt = "crk-modal-yNG-7", Ft = "crk-modalIn-xFUwm", jt = "crk-sm--xyY9", zt = "crk-md-ETTfh",
|
|
775
|
+
const Wt = "crk-backdrop-jYpTA", Ht = "crk-backdropIn-x5Z-A", qt = "crk-modal-yNG-7", Ft = "crk-modalIn-xFUwm", jt = "crk-sm--xyY9", zt = "crk-md-ETTfh", Ut = "crk-lg-5DBb7", Kt = "crk-fullscreen-b4jQ-", Vt = "crk-header-NS30G", Gt = "crk-headerWithClose-4davm", Qt = "crk-closeButton-JX-aq", Xt = "crk-body-3zIj9", Yt = "crk-footer-Oyz-R", J = {
|
|
776
776
|
backdrop: Wt,
|
|
777
777
|
backdropIn: Ht,
|
|
778
778
|
modal: qt,
|
|
779
779
|
modalIn: Ft,
|
|
780
780
|
sm: jt,
|
|
781
781
|
md: zt,
|
|
782
|
-
lg:
|
|
783
|
-
fullscreen:
|
|
784
|
-
header:
|
|
785
|
-
headerWithClose:
|
|
782
|
+
lg: Ut,
|
|
783
|
+
fullscreen: Kt,
|
|
784
|
+
header: Vt,
|
|
785
|
+
headerWithClose: Gt,
|
|
786
786
|
closeButton: Qt,
|
|
787
787
|
body: Xt,
|
|
788
788
|
footer: Yt
|
|
@@ -816,11 +816,11 @@ const ke = ({ children: e, className: r, style: t }) => {
|
|
|
816
816
|
return /* @__PURE__ */ c("div", { className: l(J.body, n.body, r), style: t, children: e });
|
|
817
817
|
};
|
|
818
818
|
ke.displayName = "Modal.Body";
|
|
819
|
-
const
|
|
819
|
+
const ye = ({ children: e, className: r, style: t }) => {
|
|
820
820
|
const { classes: n } = ae(de);
|
|
821
821
|
return /* @__PURE__ */ c("div", { className: l(J.footer, n.footer, r), style: t, children: e });
|
|
822
822
|
};
|
|
823
|
-
|
|
823
|
+
ye.displayName = "Modal.Footer";
|
|
824
824
|
const ue = W(
|
|
825
825
|
({
|
|
826
826
|
open: e,
|
|
@@ -829,13 +829,13 @@ const ue = W(
|
|
|
829
829
|
closeOnEscape: n = !0,
|
|
830
830
|
size: o = "md",
|
|
831
831
|
classes: m,
|
|
832
|
-
className:
|
|
832
|
+
className: i,
|
|
833
833
|
style: h,
|
|
834
|
-
children:
|
|
835
|
-
"aria-label":
|
|
834
|
+
children: a,
|
|
835
|
+
"aria-label": v,
|
|
836
836
|
"aria-labelledby": u
|
|
837
|
-
},
|
|
838
|
-
const
|
|
837
|
+
}, f) => {
|
|
838
|
+
const y = O(null), b = f ?? y, g = ne(), $ = u ?? `${g}-title`;
|
|
839
839
|
Mt(b, e);
|
|
840
840
|
const w = ee(
|
|
841
841
|
() => ({
|
|
@@ -852,7 +852,7 @@ const ue = W(
|
|
|
852
852
|
document.body.style.overflow = D;
|
|
853
853
|
};
|
|
854
854
|
}, [e]);
|
|
855
|
-
const
|
|
855
|
+
const C = (D) => {
|
|
856
856
|
t && D.target === D.currentTarget && r();
|
|
857
857
|
};
|
|
858
858
|
return e ? Ee(
|
|
@@ -860,19 +860,19 @@ const ue = W(
|
|
|
860
860
|
"div",
|
|
861
861
|
{
|
|
862
862
|
className: l(J.backdrop, m?.backdrop),
|
|
863
|
-
onClick:
|
|
863
|
+
onClick: C,
|
|
864
864
|
role: "presentation",
|
|
865
865
|
children: /* @__PURE__ */ c(
|
|
866
866
|
"div",
|
|
867
867
|
{
|
|
868
868
|
ref: b,
|
|
869
|
-
className: l(J.modal, J[o], m?.modal,
|
|
869
|
+
className: l(J.modal, J[o], m?.modal, i),
|
|
870
870
|
style: h,
|
|
871
871
|
role: "dialog",
|
|
872
872
|
"aria-modal": "true",
|
|
873
|
-
"aria-label":
|
|
874
|
-
"aria-labelledby":
|
|
875
|
-
children: /* @__PURE__ */ c(de.Provider, { value: { classes: m ?? {}, titleId: $ }, children:
|
|
873
|
+
"aria-label": v,
|
|
874
|
+
"aria-labelledby": v ? void 0 : $,
|
|
875
|
+
children: /* @__PURE__ */ c(de.Provider, { value: { classes: m ?? {}, titleId: $ }, children: a })
|
|
876
876
|
}
|
|
877
877
|
)
|
|
878
878
|
}
|
|
@@ -884,8 +884,8 @@ const ue = W(
|
|
|
884
884
|
ue.displayName = "Modal";
|
|
885
885
|
ue.Header = be;
|
|
886
886
|
ue.Body = ke;
|
|
887
|
-
ue.Footer =
|
|
888
|
-
const Jt = "crk-root-jHIIP", Zt = "crk-formErrors-eh-OP", _t = "crk-formError-XEuWv", en = "crk-field-OUlYz", rn = "crk-label-udkR7", tn = "crk-labelError-LOgKi", nn = "crk-required-IYiA2", on = "crk-error-yFZXm", cn = "crk-helperText-Dm-rb", ln = "crk-row-nNbx-",
|
|
887
|
+
ue.Footer = ye;
|
|
888
|
+
const Jt = "crk-root-jHIIP", Zt = "crk-formErrors-eh-OP", _t = "crk-formError-XEuWv", en = "crk-field-OUlYz", rn = "crk-label-udkR7", tn = "crk-labelError-LOgKi", nn = "crk-required-IYiA2", on = "crk-error-yFZXm", cn = "crk-helperText-Dm-rb", ln = "crk-row-nNbx-", V = {
|
|
889
889
|
root: Jt,
|
|
890
890
|
formErrors: Zt,
|
|
891
891
|
formError: _t,
|
|
@@ -897,7 +897,7 @@ const Jt = "crk-root-jHIIP", Zt = "crk-formErrors-eh-OP", _t = "crk-formError-XE
|
|
|
897
897
|
helperText: cn,
|
|
898
898
|
row: ln
|
|
899
899
|
};
|
|
900
|
-
function
|
|
900
|
+
function Do({
|
|
901
901
|
form: e,
|
|
902
902
|
onSubmit: r,
|
|
903
903
|
errors: t,
|
|
@@ -905,20 +905,27 @@ function Co({
|
|
|
905
905
|
style: o,
|
|
906
906
|
children: m
|
|
907
907
|
}) {
|
|
908
|
-
const
|
|
908
|
+
const i = t && t.length > 0;
|
|
909
909
|
return /* @__PURE__ */ c(Ce, { ...e, children: /* @__PURE__ */ I(
|
|
910
910
|
"form",
|
|
911
911
|
{
|
|
912
912
|
onSubmit: e.handleSubmit(r),
|
|
913
|
-
className: l(
|
|
913
|
+
className: l(V.root, n),
|
|
914
914
|
style: o,
|
|
915
915
|
children: [
|
|
916
|
-
|
|
916
|
+
i && /* @__PURE__ */ c("ul", { className: V.formErrors, role: "alert", children: t.map((h, a) => /* @__PURE__ */ c("li", { className: V.formError, children: h }, a)) }),
|
|
917
917
|
m
|
|
918
918
|
]
|
|
919
919
|
}
|
|
920
920
|
) });
|
|
921
921
|
}
|
|
922
|
+
const sn = /* @__PURE__ */ new Set([
|
|
923
|
+
"Select",
|
|
924
|
+
"NativeSelect",
|
|
925
|
+
"SearchableSelect",
|
|
926
|
+
"MultiSelect",
|
|
927
|
+
"Dropdown"
|
|
928
|
+
]);
|
|
922
929
|
function Ro({
|
|
923
930
|
name: e,
|
|
924
931
|
label: r,
|
|
@@ -926,59 +933,63 @@ function Ro({
|
|
|
926
933
|
required: n,
|
|
927
934
|
rules: o,
|
|
928
935
|
classes: m,
|
|
929
|
-
className:
|
|
936
|
+
className: i,
|
|
930
937
|
style: h,
|
|
931
|
-
children:
|
|
938
|
+
children: a
|
|
932
939
|
}) {
|
|
933
|
-
const { control:
|
|
934
|
-
|
|
935
|
-
const
|
|
936
|
-
(
|
|
937
|
-
if (
|
|
938
|
-
const
|
|
939
|
-
|
|
940
|
+
const { control: v } = De(), { field: u, fieldState: f } = Re({ name: e, control: v, rules: o }), y = a.type, b = typeof y == "string" ? "" : y?.displayName ?? y?.name ?? "", g = sn.has(b), { ref: $, ...w } = u, C = O($);
|
|
941
|
+
C.current = $;
|
|
942
|
+
const D = L(
|
|
943
|
+
(x) => {
|
|
944
|
+
if (x) {
|
|
945
|
+
const E = x.matches("input, select, textarea, button, [tabindex]") ? x : x.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
|
|
946
|
+
C.current(E ?? x);
|
|
940
947
|
} else
|
|
941
|
-
|
|
948
|
+
C.current(null);
|
|
942
949
|
},
|
|
943
950
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
944
951
|
[]
|
|
945
952
|
);
|
|
946
|
-
return /* @__PURE__ */ I("div", { className: l(
|
|
947
|
-
r && /* @__PURE__ */ I("label", { className: l(
|
|
953
|
+
return /* @__PURE__ */ I("div", { className: l(V.field, m?.field, i), style: h, children: [
|
|
954
|
+
r && /* @__PURE__ */ I("label", { className: l(V.label, f.error && V.labelError, m?.label), htmlFor: e, children: [
|
|
948
955
|
r,
|
|
949
|
-
n && /* @__PURE__ */ c("span", { className:
|
|
956
|
+
n && /* @__PURE__ */ c("span", { className: V.required, children: "*" })
|
|
950
957
|
] }),
|
|
951
|
-
$e(
|
|
952
|
-
...
|
|
953
|
-
ref:
|
|
958
|
+
$e(a, {
|
|
959
|
+
...w,
|
|
960
|
+
ref: D,
|
|
954
961
|
id: e,
|
|
955
|
-
error: !!
|
|
956
|
-
"aria-invalid":
|
|
957
|
-
"aria-describedby":
|
|
958
|
-
// Bridge for custom components that use onValueChange/onValuesChange
|
|
959
|
-
|
|
960
|
-
|
|
962
|
+
error: !!f.error,
|
|
963
|
+
"aria-invalid": f.error ? !0 : void 0,
|
|
964
|
+
"aria-describedby": f.error?.message ? `${e}-error` : t ? `${e}-helper` : void 0,
|
|
965
|
+
// Bridge for custom components that use onValueChange/onValuesChange (Select, Dropdown).
|
|
966
|
+
// Skip for native-input wrappers (Input, Textarea, Checkbox, Radio) so the unknown
|
|
967
|
+
// handler doesn't leak onto the DOM and trip React's "Unknown event handler" warning.
|
|
968
|
+
...g && {
|
|
969
|
+
onValueChange: w.onChange,
|
|
970
|
+
onValuesChange: w.onChange
|
|
971
|
+
},
|
|
961
972
|
// Bridge for Checkbox (expects checked, not value)
|
|
962
|
-
checked: typeof
|
|
973
|
+
checked: typeof w.value == "boolean" ? w.value : void 0
|
|
963
974
|
}),
|
|
964
|
-
|
|
975
|
+
f.error?.message ? /* @__PURE__ */ c("span", { id: `${e}-error`, className: l(V.error, m?.error), role: "alert", children: f.error.message }) : t ? /* @__PURE__ */ c("span", { id: `${e}-helper`, className: l(V.helperText, m?.helperText), children: t }) : null
|
|
965
976
|
] });
|
|
966
977
|
}
|
|
967
|
-
function
|
|
968
|
-
return /* @__PURE__ */ c("div", { className: l(
|
|
978
|
+
function Eo({ children: e, className: r, style: t }) {
|
|
979
|
+
return /* @__PURE__ */ c("div", { className: l(V.row, r), style: t, children: e });
|
|
969
980
|
}
|
|
970
|
-
const
|
|
971
|
-
root:
|
|
972
|
-
wrapper:
|
|
973
|
-
sm:
|
|
974
|
-
md:
|
|
975
|
-
lg:
|
|
976
|
-
error:
|
|
977
|
-
prefix:
|
|
978
|
-
suffix:
|
|
979
|
-
hasPrefix:
|
|
980
|
-
hasSuffix:
|
|
981
|
-
},
|
|
981
|
+
const an = "crk-root-rSgdy", dn = "crk-wrapper-GHy8V", un = "crk-sm-DptM5", mn = "crk-md-F4B0G", hn = "crk-lg-pBxwX", pn = "crk-error-fucxe", fn = "crk-prefix-w53Md", gn = "crk-suffix-fcNgR", bn = "crk-hasPrefix--bqPD", kn = "crk-hasSuffix-zO0nX", K = {
|
|
982
|
+
root: an,
|
|
983
|
+
wrapper: dn,
|
|
984
|
+
sm: un,
|
|
985
|
+
md: mn,
|
|
986
|
+
lg: hn,
|
|
987
|
+
error: pn,
|
|
988
|
+
prefix: fn,
|
|
989
|
+
suffix: gn,
|
|
990
|
+
hasPrefix: bn,
|
|
991
|
+
hasSuffix: kn
|
|
992
|
+
}, yn = W(
|
|
982
993
|
({
|
|
983
994
|
inputSize: e = "md",
|
|
984
995
|
error: r = !1,
|
|
@@ -986,75 +997,75 @@ const sn = "crk-root-rSgdy", an = "crk-wrapper-GHy8V", dn = "crk-sm-DptM5", un =
|
|
|
986
997
|
suffix: n,
|
|
987
998
|
classes: o,
|
|
988
999
|
className: m,
|
|
989
|
-
style:
|
|
1000
|
+
style: i,
|
|
990
1001
|
...h
|
|
991
|
-
},
|
|
992
|
-
const
|
|
1002
|
+
}, a) => {
|
|
1003
|
+
const v = /* @__PURE__ */ c(
|
|
993
1004
|
"input",
|
|
994
1005
|
{
|
|
995
|
-
ref:
|
|
1006
|
+
ref: a,
|
|
996
1007
|
className: l(
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
r &&
|
|
1000
|
-
t &&
|
|
1001
|
-
n &&
|
|
1008
|
+
K.root,
|
|
1009
|
+
K[e],
|
|
1010
|
+
r && K.error,
|
|
1011
|
+
t && K.hasPrefix,
|
|
1012
|
+
n && K.hasSuffix,
|
|
1002
1013
|
o?.root,
|
|
1003
1014
|
!t && !n && m
|
|
1004
1015
|
),
|
|
1005
|
-
style: !t && !n ?
|
|
1016
|
+
style: !t && !n ? i : void 0,
|
|
1006
1017
|
...h
|
|
1007
1018
|
}
|
|
1008
1019
|
);
|
|
1009
1020
|
return t || n ? /* @__PURE__ */ I(
|
|
1010
1021
|
"div",
|
|
1011
1022
|
{
|
|
1012
|
-
className: l(
|
|
1013
|
-
style:
|
|
1023
|
+
className: l(K.wrapper, K[e], r && K.error, o?.wrapper, m),
|
|
1024
|
+
style: i,
|
|
1014
1025
|
children: [
|
|
1015
|
-
t && /* @__PURE__ */ c("span", { className: l(
|
|
1016
|
-
|
|
1017
|
-
n && /* @__PURE__ */ c("span", { className: l(
|
|
1026
|
+
t && /* @__PURE__ */ c("span", { className: l(K.prefix, o?.prefix), children: t }),
|
|
1027
|
+
v,
|
|
1028
|
+
n && /* @__PURE__ */ c("span", { className: l(K.suffix, o?.suffix), children: n })
|
|
1018
1029
|
]
|
|
1019
1030
|
}
|
|
1020
|
-
) :
|
|
1031
|
+
) : v;
|
|
1021
1032
|
}
|
|
1022
1033
|
);
|
|
1023
|
-
|
|
1024
|
-
const vn = "crk-wrapper-SP2JE",
|
|
1034
|
+
yn.displayName = "Input";
|
|
1035
|
+
const vn = "crk-wrapper-SP2JE", Nn = "crk-sm-DqshL", wn = "crk-md-j4AKI", xn = "crk-lg-24Xd3", Sn = "crk-root-Uu9Ah", In = "crk-error-9oRU6", $n = "crk-arrow-WU8ZW", Cn = "crk-searchableWrapper-7AL4l", Dn = "crk-hiddenSelect-s3DEx", Rn = "crk-searchableTrigger-m-GWV", En = "crk-triggerOpen-Lo8-j", Ln = "crk-triggerLabel-5rETZ", Bn = "crk-placeholder-teBBh", Tn = "crk-arrowInline-m-roG", An = "crk-disabled-pcSeq", On = "crk-visuallyHidden-2tTD5", Pn = "crk-menu--i-je", Mn = "crk-menuEnter-vJjLV", Wn = "crk-menuItems-VrZnE", Hn = "crk-item-fU3XI", qn = "crk-itemHighlighted-MvR41", Fn = "crk-itemDisabled-KTUO8", jn = "crk-itemSelected-42-BG", zn = "crk-noResults-uicSW", Un = "crk-multiTrigger-Pd3wJ", Kn = "crk-multiTriggerDisabled-9ajge", Vn = "crk-chip-TuYUB", Gn = "crk-chipLabel-H4JWu", Qn = "crk-chipRemove-Lfk0R", Xn = "crk-multiSearch-OrVeS", Yn = "crk-arrowMulti-Nh9Hr", Jn = "crk-itemCheck-DPB5A", d = {
|
|
1025
1036
|
wrapper: vn,
|
|
1026
|
-
sm:
|
|
1027
|
-
md:
|
|
1028
|
-
lg:
|
|
1029
|
-
root:
|
|
1030
|
-
error:
|
|
1031
|
-
arrow:
|
|
1032
|
-
searchableWrapper:
|
|
1033
|
-
hiddenSelect:
|
|
1037
|
+
sm: Nn,
|
|
1038
|
+
md: wn,
|
|
1039
|
+
lg: xn,
|
|
1040
|
+
root: Sn,
|
|
1041
|
+
error: In,
|
|
1042
|
+
arrow: $n,
|
|
1043
|
+
searchableWrapper: Cn,
|
|
1044
|
+
hiddenSelect: Dn,
|
|
1034
1045
|
searchableTrigger: Rn,
|
|
1035
|
-
triggerOpen:
|
|
1036
|
-
triggerLabel:
|
|
1037
|
-
placeholder:
|
|
1038
|
-
arrowInline:
|
|
1039
|
-
disabled:
|
|
1040
|
-
visuallyHidden:
|
|
1041
|
-
menu:
|
|
1042
|
-
menuEnter:
|
|
1043
|
-
menuItems:
|
|
1044
|
-
item:
|
|
1045
|
-
itemHighlighted:
|
|
1046
|
-
itemDisabled:
|
|
1047
|
-
itemSelected:
|
|
1048
|
-
noResults:
|
|
1049
|
-
multiTrigger:
|
|
1046
|
+
triggerOpen: En,
|
|
1047
|
+
triggerLabel: Ln,
|
|
1048
|
+
placeholder: Bn,
|
|
1049
|
+
arrowInline: Tn,
|
|
1050
|
+
disabled: An,
|
|
1051
|
+
visuallyHidden: On,
|
|
1052
|
+
menu: Pn,
|
|
1053
|
+
menuEnter: Mn,
|
|
1054
|
+
menuItems: Wn,
|
|
1055
|
+
item: Hn,
|
|
1056
|
+
itemHighlighted: qn,
|
|
1057
|
+
itemDisabled: Fn,
|
|
1058
|
+
itemSelected: jn,
|
|
1059
|
+
noResults: zn,
|
|
1060
|
+
multiTrigger: Un,
|
|
1050
1061
|
multiTriggerDisabled: Kn,
|
|
1051
|
-
chip:
|
|
1062
|
+
chip: Vn,
|
|
1052
1063
|
chipLabel: Gn,
|
|
1053
|
-
chipRemove:
|
|
1054
|
-
multiSearch:
|
|
1055
|
-
arrowMulti:
|
|
1056
|
-
itemCheck:
|
|
1057
|
-
},
|
|
1064
|
+
chipRemove: Qn,
|
|
1065
|
+
multiSearch: Xn,
|
|
1066
|
+
arrowMulti: Yn,
|
|
1067
|
+
itemCheck: Jn
|
|
1068
|
+
}, ve = W(
|
|
1058
1069
|
({
|
|
1059
1070
|
inputSize: e = "md",
|
|
1060
1071
|
error: r = !1,
|
|
@@ -1062,19 +1073,19 @@ const vn = "crk-wrapper-SP2JE", yn = "crk-sm-DqshL", Nn = "crk-md-j4AKI", wn = "
|
|
|
1062
1073
|
placeholder: n,
|
|
1063
1074
|
classes: o,
|
|
1064
1075
|
className: m,
|
|
1065
|
-
style:
|
|
1076
|
+
style: i,
|
|
1066
1077
|
children: h,
|
|
1067
|
-
searchable:
|
|
1068
|
-
searchPlaceholder:
|
|
1078
|
+
searchable: a,
|
|
1079
|
+
searchPlaceholder: v,
|
|
1069
1080
|
onValueChange: u,
|
|
1070
|
-
...
|
|
1071
|
-
},
|
|
1081
|
+
...f
|
|
1082
|
+
}, y) => /* @__PURE__ */ I("div", { className: l(d.wrapper, d[e], r && d.error, o?.wrapper, m), style: i, children: [
|
|
1072
1083
|
/* @__PURE__ */ I(
|
|
1073
1084
|
"select",
|
|
1074
1085
|
{
|
|
1075
|
-
ref:
|
|
1086
|
+
ref: y,
|
|
1076
1087
|
className: l(d.root, d[e], r && d.error, o?.root),
|
|
1077
|
-
...
|
|
1088
|
+
...f,
|
|
1078
1089
|
children: [
|
|
1079
1090
|
n && /* @__PURE__ */ c("option", { value: "", disabled: !0, children: n }),
|
|
1080
1091
|
t ? t.map((b) => /* @__PURE__ */ c("option", { value: b.value, disabled: b.disabled, children: b.label }, b.value)) : h
|
|
@@ -1084,7 +1095,7 @@ const vn = "crk-wrapper-SP2JE", yn = "crk-sm-DqshL", Nn = "crk-md-j4AKI", wn = "
|
|
|
1084
1095
|
/* @__PURE__ */ c("span", { className: l(d.arrow, o?.arrow) })
|
|
1085
1096
|
] })
|
|
1086
1097
|
);
|
|
1087
|
-
|
|
1098
|
+
ve.displayName = "NativeSelect";
|
|
1088
1099
|
const Ne = W(
|
|
1089
1100
|
({
|
|
1090
1101
|
inputSize: e = "md",
|
|
@@ -1093,35 +1104,35 @@ const Ne = W(
|
|
|
1093
1104
|
placeholder: n = "Select...",
|
|
1094
1105
|
classes: o,
|
|
1095
1106
|
className: m,
|
|
1096
|
-
style:
|
|
1107
|
+
style: i,
|
|
1097
1108
|
value: h,
|
|
1098
|
-
disabled:
|
|
1099
|
-
id:
|
|
1109
|
+
disabled: a,
|
|
1110
|
+
id: v,
|
|
1100
1111
|
searchPlaceholder: u = "Search...",
|
|
1101
|
-
onChange:
|
|
1102
|
-
onValueChange:
|
|
1112
|
+
onChange: f,
|
|
1113
|
+
onValueChange: y
|
|
1103
1114
|
}, b) => {
|
|
1104
|
-
const [
|
|
1115
|
+
const [g, $] = X(!1), [w, C] = X(""), [D, x] = X(0), E = O(null), U = O(null), q = O(null), G = O(null), j = ne(), Y = O(null), k = b ?? Y, P = O(!1);
|
|
1105
1116
|
F(() => {
|
|
1106
|
-
P.current && !
|
|
1107
|
-
}, [
|
|
1108
|
-
const
|
|
1109
|
-
$(!1),
|
|
1117
|
+
P.current && !g && q.current?.focus(), P.current = g;
|
|
1118
|
+
}, [g]);
|
|
1119
|
+
const S = L(() => {
|
|
1120
|
+
$(!1), C(""), x(0);
|
|
1110
1121
|
}, []), B = L(() => {
|
|
1111
|
-
|
|
1112
|
-
}, [
|
|
1122
|
+
a || ($(!0), C(""), x(0), setTimeout(() => U.current?.focus(), 0));
|
|
1123
|
+
}, [a]), z = L(
|
|
1113
1124
|
(s) => {
|
|
1114
|
-
if (
|
|
1125
|
+
if (y?.(s), k.current) {
|
|
1115
1126
|
Object.getOwnPropertyDescriptor(
|
|
1116
1127
|
HTMLSelectElement.prototype,
|
|
1117
1128
|
"value"
|
|
1118
1129
|
)?.set?.call(k.current, s);
|
|
1119
1130
|
const T = new Event("change", { bubbles: !0 });
|
|
1120
|
-
k.current.dispatchEvent(T),
|
|
1131
|
+
k.current.dispatchEvent(T), f?.(T);
|
|
1121
1132
|
}
|
|
1122
|
-
|
|
1133
|
+
S();
|
|
1123
1134
|
},
|
|
1124
|
-
[
|
|
1135
|
+
[y, f, k, S]
|
|
1125
1136
|
), A = ee(() => {
|
|
1126
1137
|
if (!w) return t;
|
|
1127
1138
|
const s = w.toLowerCase();
|
|
@@ -1129,24 +1140,24 @@ const Ne = W(
|
|
|
1129
1140
|
}, [t, w]);
|
|
1130
1141
|
F(() => {
|
|
1131
1142
|
const s = A.findIndex((N) => !N.disabled);
|
|
1132
|
-
|
|
1143
|
+
x(s >= 0 ? s : 0);
|
|
1133
1144
|
}, [A]), F(() => {
|
|
1134
|
-
if (!
|
|
1135
|
-
const s =
|
|
1145
|
+
if (!g) return;
|
|
1146
|
+
const s = G.current;
|
|
1136
1147
|
if (!s) return;
|
|
1137
1148
|
s.querySelectorAll('[role="option"]')[D]?.scrollIntoView?.({ block: "nearest" });
|
|
1138
|
-
}, [D,
|
|
1149
|
+
}, [D, g]);
|
|
1139
1150
|
const Z = L(
|
|
1140
1151
|
(s) => {
|
|
1141
1152
|
const N = A.map((T, Q) => T.disabled ? -1 : Q).filter((T) => T >= 0);
|
|
1142
1153
|
if (N.length !== 0)
|
|
1143
1154
|
if (s.key === "ArrowDown")
|
|
1144
|
-
s.preventDefault(),
|
|
1155
|
+
s.preventDefault(), x((T) => {
|
|
1145
1156
|
const Q = N.indexOf(T);
|
|
1146
1157
|
return Q < N.length - 1 ? N[Q + 1] : N[0];
|
|
1147
1158
|
});
|
|
1148
1159
|
else if (s.key === "ArrowUp")
|
|
1149
|
-
s.preventDefault(),
|
|
1160
|
+
s.preventDefault(), x((T) => {
|
|
1150
1161
|
const Q = N.indexOf(T);
|
|
1151
1162
|
return Q > 0 ? N[Q - 1] : N[N.length - 1];
|
|
1152
1163
|
});
|
|
@@ -1154,12 +1165,12 @@ const Ne = W(
|
|
|
1154
1165
|
s.preventDefault();
|
|
1155
1166
|
const T = A[D];
|
|
1156
1167
|
T && !T.disabled && z(T.value);
|
|
1157
|
-
} else s.key === "Escape" && (s.preventDefault(),
|
|
1168
|
+
} else s.key === "Escape" && (s.preventDefault(), S());
|
|
1158
1169
|
},
|
|
1159
|
-
[A, D, z,
|
|
1170
|
+
[A, D, z, S]
|
|
1160
1171
|
);
|
|
1161
|
-
ie(E,
|
|
1162
|
-
const re = t.find((s) => s.value === h)?.label,
|
|
1172
|
+
ie(E, S, g);
|
|
1173
|
+
const re = t.find((s) => s.value === h)?.label, p = A.filter((s) => !s.disabled);
|
|
1163
1174
|
return /* @__PURE__ */ I(
|
|
1164
1175
|
"div",
|
|
1165
1176
|
{
|
|
@@ -1169,11 +1180,11 @@ const Ne = W(
|
|
|
1169
1180
|
d.searchableWrapper,
|
|
1170
1181
|
d[e],
|
|
1171
1182
|
r && d.error,
|
|
1172
|
-
|
|
1183
|
+
a && d.disabled,
|
|
1173
1184
|
o?.wrapper,
|
|
1174
1185
|
m
|
|
1175
1186
|
),
|
|
1176
|
-
style:
|
|
1187
|
+
style: i,
|
|
1177
1188
|
children: [
|
|
1178
1189
|
/* @__PURE__ */ c(
|
|
1179
1190
|
"select",
|
|
@@ -1181,7 +1192,7 @@ const Ne = W(
|
|
|
1181
1192
|
ref: k,
|
|
1182
1193
|
className: d.hiddenSelect,
|
|
1183
1194
|
value: h ?? "",
|
|
1184
|
-
disabled:
|
|
1195
|
+
disabled: a,
|
|
1185
1196
|
tabIndex: -1,
|
|
1186
1197
|
"aria-hidden": "true",
|
|
1187
1198
|
onChange: () => {
|
|
@@ -1193,32 +1204,32 @@ const Ne = W(
|
|
|
1193
1204
|
"button",
|
|
1194
1205
|
{
|
|
1195
1206
|
ref: q,
|
|
1196
|
-
id:
|
|
1207
|
+
id: v,
|
|
1197
1208
|
type: "button",
|
|
1198
1209
|
className: l(
|
|
1199
1210
|
d.root,
|
|
1200
1211
|
d.searchableTrigger,
|
|
1201
1212
|
d[e],
|
|
1202
|
-
|
|
1213
|
+
g && d.triggerOpen,
|
|
1203
1214
|
r && d.error,
|
|
1204
|
-
|
|
1215
|
+
g && d.visuallyHidden,
|
|
1205
1216
|
o?.root
|
|
1206
1217
|
),
|
|
1207
1218
|
onClick: B,
|
|
1208
|
-
disabled:
|
|
1209
|
-
"aria-expanded":
|
|
1219
|
+
disabled: a,
|
|
1220
|
+
"aria-expanded": g,
|
|
1210
1221
|
"aria-haspopup": "listbox",
|
|
1211
|
-
"aria-controls":
|
|
1222
|
+
"aria-controls": g ? j : void 0,
|
|
1212
1223
|
children: [
|
|
1213
1224
|
/* @__PURE__ */ c("span", { className: l(d.triggerLabel, !re && d.placeholder), children: re || n }),
|
|
1214
1225
|
/* @__PURE__ */ c("span", { className: l(d.arrow, d.arrowInline, o?.arrow) })
|
|
1215
1226
|
]
|
|
1216
1227
|
}
|
|
1217
1228
|
),
|
|
1218
|
-
|
|
1229
|
+
g && /* @__PURE__ */ c(
|
|
1219
1230
|
"input",
|
|
1220
1231
|
{
|
|
1221
|
-
ref:
|
|
1232
|
+
ref: U,
|
|
1222
1233
|
type: "text",
|
|
1223
1234
|
role: "combobox",
|
|
1224
1235
|
className: l(
|
|
@@ -1232,15 +1243,15 @@ const Ne = W(
|
|
|
1232
1243
|
),
|
|
1233
1244
|
placeholder: re || n,
|
|
1234
1245
|
value: w,
|
|
1235
|
-
onChange: (s) =>
|
|
1246
|
+
onChange: (s) => C(s.target.value),
|
|
1236
1247
|
onKeyDown: Z,
|
|
1237
1248
|
"aria-expanded": !0,
|
|
1238
1249
|
"aria-haspopup": "listbox",
|
|
1239
1250
|
"aria-controls": j,
|
|
1240
|
-
"aria-activedescendant":
|
|
1251
|
+
"aria-activedescendant": p.length > 0 ? `select-option-${A[D]?.value}` : void 0
|
|
1241
1252
|
}
|
|
1242
1253
|
),
|
|
1243
|
-
|
|
1254
|
+
g && /* @__PURE__ */ c("div", { id: j, className: l(d.menu, o?.menu), role: "listbox", children: /* @__PURE__ */ c("div", { className: d.menuItems, ref: G, children: A.length === 0 ? /* @__PURE__ */ c("div", { className: d.noResults, children: "No results" }) : A.map((s, N) => /* @__PURE__ */ c(
|
|
1244
1255
|
"button",
|
|
1245
1256
|
{
|
|
1246
1257
|
id: `select-option-${s.value}`,
|
|
@@ -1256,7 +1267,7 @@ const Ne = W(
|
|
|
1256
1267
|
),
|
|
1257
1268
|
disabled: s.disabled,
|
|
1258
1269
|
onClick: () => z(s.value),
|
|
1259
|
-
onMouseEnter: () =>
|
|
1270
|
+
onMouseEnter: () => x(N),
|
|
1260
1271
|
children: s.content ?? s.label
|
|
1261
1272
|
},
|
|
1262
1273
|
s.value
|
|
@@ -1275,89 +1286,89 @@ const we = W(
|
|
|
1275
1286
|
placeholder: n = "Select...",
|
|
1276
1287
|
classes: o,
|
|
1277
1288
|
className: m,
|
|
1278
|
-
style:
|
|
1289
|
+
style: i,
|
|
1279
1290
|
value: h,
|
|
1280
|
-
disabled:
|
|
1281
|
-
id:
|
|
1291
|
+
disabled: a,
|
|
1292
|
+
id: v,
|
|
1282
1293
|
searchPlaceholder: u,
|
|
1283
|
-
onValuesChange:
|
|
1284
|
-
clearSearchOnSelect:
|
|
1294
|
+
onValuesChange: f,
|
|
1295
|
+
clearSearchOnSelect: y = !0
|
|
1285
1296
|
}, b) => {
|
|
1286
|
-
const
|
|
1297
|
+
const g = Array.isArray(h) ? h : h ? [h] : [], [$, w] = X(!1), [C, D] = X(""), [x, E] = X(0), U = O(null), q = O(null), G = O(null), j = ne(), Y = O(null), k = b ?? Y, P = L(() => {
|
|
1287
1298
|
w(!1), D(""), E(0);
|
|
1288
|
-
}, []),
|
|
1289
|
-
|
|
1290
|
-
}, [
|
|
1291
|
-
(
|
|
1292
|
-
const s =
|
|
1293
|
-
|
|
1299
|
+
}, []), S = L(() => {
|
|
1300
|
+
a || (w(!0), D(""), E(0), setTimeout(() => q.current?.focus(), 0));
|
|
1301
|
+
}, [a]), B = L(
|
|
1302
|
+
(p) => {
|
|
1303
|
+
const s = g.includes(p) ? g.filter((N) => N !== p) : [...g, p];
|
|
1304
|
+
f?.(s), y && D("");
|
|
1294
1305
|
},
|
|
1295
|
-
[
|
|
1306
|
+
[g, f, y]
|
|
1296
1307
|
), z = L(
|
|
1297
|
-
(
|
|
1298
|
-
s.stopPropagation(),
|
|
1308
|
+
(p, s) => {
|
|
1309
|
+
s.stopPropagation(), f?.(g.filter((N) => N !== p));
|
|
1299
1310
|
},
|
|
1300
|
-
[
|
|
1311
|
+
[g, f]
|
|
1301
1312
|
), A = ee(() => {
|
|
1302
|
-
if (!
|
|
1303
|
-
const
|
|
1304
|
-
return t.filter((s) => s.label.toLowerCase().includes(
|
|
1305
|
-
}, [t,
|
|
1313
|
+
if (!C) return t;
|
|
1314
|
+
const p = C.toLowerCase();
|
|
1315
|
+
return t.filter((s) => s.label.toLowerCase().includes(p));
|
|
1316
|
+
}, [t, C]);
|
|
1306
1317
|
F(() => {
|
|
1307
|
-
const
|
|
1308
|
-
E(
|
|
1318
|
+
const p = A.findIndex((s) => !s.disabled);
|
|
1319
|
+
E(p >= 0 ? p : 0);
|
|
1309
1320
|
}, [A]), F(() => {
|
|
1310
1321
|
if (!$) return;
|
|
1311
|
-
const
|
|
1312
|
-
if (!
|
|
1313
|
-
|
|
1314
|
-
}, [
|
|
1322
|
+
const p = G.current;
|
|
1323
|
+
if (!p) return;
|
|
1324
|
+
p.querySelectorAll('[role="option"]')[x]?.scrollIntoView?.({ block: "nearest" });
|
|
1325
|
+
}, [x, $]);
|
|
1315
1326
|
const Z = L(
|
|
1316
|
-
(
|
|
1327
|
+
(p) => {
|
|
1317
1328
|
const s = A.map((N, T) => N.disabled ? -1 : T).filter((N) => N >= 0);
|
|
1318
|
-
if (
|
|
1319
|
-
|
|
1329
|
+
if (p.key === "Backspace" && C === "" && g.length > 0) {
|
|
1330
|
+
p.preventDefault(), f?.(g.slice(0, -1));
|
|
1320
1331
|
return;
|
|
1321
1332
|
}
|
|
1322
1333
|
if (s.length !== 0)
|
|
1323
|
-
if (
|
|
1324
|
-
if (
|
|
1325
|
-
|
|
1334
|
+
if (p.key === "ArrowDown") {
|
|
1335
|
+
if (p.preventDefault(), !$) {
|
|
1336
|
+
S();
|
|
1326
1337
|
return;
|
|
1327
1338
|
}
|
|
1328
1339
|
E((N) => {
|
|
1329
1340
|
const T = s.indexOf(N);
|
|
1330
1341
|
return T < s.length - 1 ? s[T + 1] : s[0];
|
|
1331
1342
|
});
|
|
1332
|
-
} else if (
|
|
1333
|
-
|
|
1343
|
+
} else if (p.key === "ArrowUp")
|
|
1344
|
+
p.preventDefault(), E((N) => {
|
|
1334
1345
|
const T = s.indexOf(N);
|
|
1335
1346
|
return T > 0 ? s[T - 1] : s[s.length - 1];
|
|
1336
1347
|
});
|
|
1337
|
-
else if (
|
|
1338
|
-
|
|
1339
|
-
const N = A[
|
|
1348
|
+
else if (p.key === "Enter") {
|
|
1349
|
+
p.preventDefault();
|
|
1350
|
+
const N = A[x];
|
|
1340
1351
|
N && !N.disabled && B(N.value);
|
|
1341
|
-
} else
|
|
1352
|
+
} else p.key === "Escape" && (p.preventDefault(), P());
|
|
1342
1353
|
},
|
|
1343
|
-
[A,
|
|
1354
|
+
[A, x, B, P, C, g, f, $, S]
|
|
1344
1355
|
);
|
|
1345
|
-
ie(
|
|
1346
|
-
const re =
|
|
1356
|
+
ie(U, P, $);
|
|
1357
|
+
const re = g.map((p) => t.find((s) => s.value === p)).filter((p) => !!p);
|
|
1347
1358
|
return /* @__PURE__ */ I(
|
|
1348
1359
|
"div",
|
|
1349
1360
|
{
|
|
1350
|
-
ref:
|
|
1361
|
+
ref: U,
|
|
1351
1362
|
className: l(
|
|
1352
1363
|
d.wrapper,
|
|
1353
1364
|
d.searchableWrapper,
|
|
1354
1365
|
d[e],
|
|
1355
1366
|
r && d.error,
|
|
1356
|
-
|
|
1367
|
+
a && d.disabled,
|
|
1357
1368
|
o?.wrapper,
|
|
1358
1369
|
m
|
|
1359
1370
|
),
|
|
1360
|
-
style:
|
|
1371
|
+
style: i,
|
|
1361
1372
|
children: [
|
|
1362
1373
|
/* @__PURE__ */ c(
|
|
1363
1374
|
"select",
|
|
@@ -1365,13 +1376,13 @@ const we = W(
|
|
|
1365
1376
|
ref: k,
|
|
1366
1377
|
className: d.hiddenSelect,
|
|
1367
1378
|
multiple: !0,
|
|
1368
|
-
value:
|
|
1369
|
-
disabled:
|
|
1379
|
+
value: g,
|
|
1380
|
+
disabled: a,
|
|
1370
1381
|
tabIndex: -1,
|
|
1371
1382
|
"aria-hidden": "true",
|
|
1372
1383
|
onChange: () => {
|
|
1373
1384
|
},
|
|
1374
|
-
children: t.map((
|
|
1385
|
+
children: t.map((p) => /* @__PURE__ */ c("option", { value: p.value, children: p.label }, p.value))
|
|
1375
1386
|
}
|
|
1376
1387
|
),
|
|
1377
1388
|
/* @__PURE__ */ I(
|
|
@@ -1382,45 +1393,45 @@ const we = W(
|
|
|
1382
1393
|
d[e],
|
|
1383
1394
|
$ && d.triggerOpen,
|
|
1384
1395
|
r && d.error,
|
|
1385
|
-
|
|
1396
|
+
a && d.multiTriggerDisabled,
|
|
1386
1397
|
o?.root
|
|
1387
1398
|
),
|
|
1388
1399
|
onClick: () => {
|
|
1389
|
-
$ ? q.current?.focus() :
|
|
1400
|
+
$ ? q.current?.focus() : S();
|
|
1390
1401
|
},
|
|
1391
1402
|
role: "combobox",
|
|
1392
1403
|
"aria-expanded": $,
|
|
1393
1404
|
"aria-haspopup": "listbox",
|
|
1394
1405
|
"aria-controls": $ ? j : void 0,
|
|
1395
1406
|
children: [
|
|
1396
|
-
re.map((
|
|
1397
|
-
/* @__PURE__ */ c("span", { className: d.chipLabel, children:
|
|
1407
|
+
re.map((p) => /* @__PURE__ */ I("span", { className: l(d.chip, o?.chip), children: [
|
|
1408
|
+
/* @__PURE__ */ c("span", { className: d.chipLabel, children: p.content ?? p.label }),
|
|
1398
1409
|
/* @__PURE__ */ c(
|
|
1399
1410
|
"button",
|
|
1400
1411
|
{
|
|
1401
1412
|
type: "button",
|
|
1402
1413
|
className: l(d.chipRemove, o?.chipRemove),
|
|
1403
|
-
onClick: (s) => z(
|
|
1404
|
-
"aria-label": `Remove ${
|
|
1414
|
+
onClick: (s) => z(p.value, s),
|
|
1415
|
+
"aria-label": `Remove ${p.label}`,
|
|
1405
1416
|
tabIndex: -1,
|
|
1406
1417
|
children: "×"
|
|
1407
1418
|
}
|
|
1408
1419
|
)
|
|
1409
|
-
] },
|
|
1420
|
+
] }, p.value)),
|
|
1410
1421
|
/* @__PURE__ */ c(
|
|
1411
1422
|
"input",
|
|
1412
1423
|
{
|
|
1413
1424
|
ref: q,
|
|
1414
|
-
id:
|
|
1425
|
+
id: v,
|
|
1415
1426
|
type: "text",
|
|
1416
1427
|
className: d.multiSearch,
|
|
1417
|
-
placeholder:
|
|
1418
|
-
value:
|
|
1419
|
-
onChange: (
|
|
1420
|
-
D(
|
|
1428
|
+
placeholder: g.length === 0 ? n : "",
|
|
1429
|
+
value: C,
|
|
1430
|
+
onChange: (p) => {
|
|
1431
|
+
D(p.target.value), $ || S();
|
|
1421
1432
|
},
|
|
1422
1433
|
onKeyDown: Z,
|
|
1423
|
-
disabled:
|
|
1434
|
+
disabled: a,
|
|
1424
1435
|
"aria-label": "Search options"
|
|
1425
1436
|
}
|
|
1426
1437
|
),
|
|
@@ -1428,31 +1439,31 @@ const we = W(
|
|
|
1428
1439
|
]
|
|
1429
1440
|
}
|
|
1430
1441
|
),
|
|
1431
|
-
$ && /* @__PURE__ */ c("div", { id: j, className: l(d.menu, o?.menu), role: "listbox", "aria-multiselectable": "true", children: /* @__PURE__ */ c("div", { className: d.menuItems, ref:
|
|
1432
|
-
const N =
|
|
1442
|
+
$ && /* @__PURE__ */ c("div", { id: j, className: l(d.menu, o?.menu), role: "listbox", "aria-multiselectable": "true", children: /* @__PURE__ */ c("div", { className: d.menuItems, ref: G, children: A.length === 0 ? /* @__PURE__ */ c("div", { className: d.noResults, children: "No results" }) : A.map((p, s) => {
|
|
1443
|
+
const N = g.includes(p.value);
|
|
1433
1444
|
return /* @__PURE__ */ I(
|
|
1434
1445
|
"button",
|
|
1435
1446
|
{
|
|
1436
|
-
id: `select-option-${
|
|
1447
|
+
id: `select-option-${p.value}`,
|
|
1437
1448
|
type: "button",
|
|
1438
1449
|
role: "option",
|
|
1439
1450
|
"aria-selected": N,
|
|
1440
1451
|
className: l(
|
|
1441
1452
|
d.item,
|
|
1442
|
-
|
|
1453
|
+
p.disabled && d.itemDisabled,
|
|
1443
1454
|
N && d.itemSelected,
|
|
1444
|
-
s ===
|
|
1455
|
+
s === x && d.itemHighlighted,
|
|
1445
1456
|
o?.item
|
|
1446
1457
|
),
|
|
1447
|
-
disabled:
|
|
1448
|
-
onClick: () => B(
|
|
1458
|
+
disabled: p.disabled,
|
|
1459
|
+
onClick: () => B(p.value),
|
|
1449
1460
|
onMouseEnter: () => E(s),
|
|
1450
1461
|
children: [
|
|
1451
1462
|
N && /* @__PURE__ */ c("span", { className: d.itemCheck, "aria-hidden": "true" }),
|
|
1452
|
-
|
|
1463
|
+
p.content ?? p.label
|
|
1453
1464
|
]
|
|
1454
1465
|
},
|
|
1455
|
-
|
|
1466
|
+
p.value
|
|
1456
1467
|
);
|
|
1457
1468
|
}) }) })
|
|
1458
1469
|
]
|
|
@@ -1461,16 +1472,16 @@ const we = W(
|
|
|
1461
1472
|
}
|
|
1462
1473
|
);
|
|
1463
1474
|
we.displayName = "MultiSelect";
|
|
1464
|
-
const
|
|
1465
|
-
(e, r) => e.multiple ? /* @__PURE__ */ c(we, { ref: r, ...e }) : e.searchable ? /* @__PURE__ */ c(Ne, { ref: r, ...e }) : /* @__PURE__ */ c(
|
|
1475
|
+
const Zn = W(
|
|
1476
|
+
(e, r) => e.multiple ? /* @__PURE__ */ c(we, { ref: r, ...e }) : e.searchable ? /* @__PURE__ */ c(Ne, { ref: r, ...e }) : /* @__PURE__ */ c(ve, { ref: r, ...e })
|
|
1466
1477
|
);
|
|
1467
|
-
|
|
1468
|
-
const
|
|
1469
|
-
root:
|
|
1470
|
-
input:
|
|
1471
|
-
label:
|
|
1472
|
-
indeterminate:
|
|
1473
|
-
},
|
|
1478
|
+
Zn.displayName = "Select";
|
|
1479
|
+
const _n = "crk-root-61cKD", eo = "crk-input-bAjPU", ro = "crk-label-W9IeS", to = "crk-indeterminate-mLarv", ce = {
|
|
1480
|
+
root: _n,
|
|
1481
|
+
input: eo,
|
|
1482
|
+
label: ro,
|
|
1483
|
+
indeterminate: to
|
|
1484
|
+
}, no = W(
|
|
1474
1485
|
({
|
|
1475
1486
|
label: e,
|
|
1476
1487
|
indeterminate: r = !1,
|
|
@@ -1478,7 +1489,7 @@ const Zn = "crk-root-61cKD", _n = "crk-input-bAjPU", eo = "crk-label-W9IeS", ro
|
|
|
1478
1489
|
className: n,
|
|
1479
1490
|
style: o,
|
|
1480
1491
|
...m
|
|
1481
|
-
},
|
|
1492
|
+
}, i) => {
|
|
1482
1493
|
const h = O(null);
|
|
1483
1494
|
return F(() => {
|
|
1484
1495
|
h.current && (h.current.indeterminate = r);
|
|
@@ -1491,8 +1502,8 @@ const Zn = "crk-root-61cKD", _n = "crk-input-bAjPU", eo = "crk-label-W9IeS", ro
|
|
|
1491
1502
|
/* @__PURE__ */ c(
|
|
1492
1503
|
"input",
|
|
1493
1504
|
{
|
|
1494
|
-
ref: (
|
|
1495
|
-
h.current =
|
|
1505
|
+
ref: (a) => {
|
|
1506
|
+
h.current = a, typeof i == "function" ? i(a) : i && (i.current = a);
|
|
1496
1507
|
},
|
|
1497
1508
|
type: "checkbox",
|
|
1498
1509
|
className: l(ce.input, t?.input),
|
|
@@ -1505,39 +1516,39 @@ const Zn = "crk-root-61cKD", _n = "crk-input-bAjPU", eo = "crk-label-W9IeS", ro
|
|
|
1505
1516
|
);
|
|
1506
1517
|
}
|
|
1507
1518
|
);
|
|
1508
|
-
|
|
1509
|
-
const
|
|
1510
|
-
group:
|
|
1511
|
-
root:
|
|
1512
|
-
input:
|
|
1513
|
-
label:
|
|
1514
|
-
}, xe = fe(null),
|
|
1519
|
+
no.displayName = "Checkbox";
|
|
1520
|
+
const oo = "crk-group-NNwCD", co = "crk-root-7fGik", lo = "crk-input-43PQW", so = "crk-label-aW30x", se = {
|
|
1521
|
+
group: oo,
|
|
1522
|
+
root: co,
|
|
1523
|
+
input: lo,
|
|
1524
|
+
label: so
|
|
1525
|
+
}, xe = fe(null), ao = ({
|
|
1515
1526
|
name: e,
|
|
1516
1527
|
value: r,
|
|
1517
1528
|
onChange: t,
|
|
1518
1529
|
className: n,
|
|
1519
1530
|
style: o,
|
|
1520
1531
|
children: m,
|
|
1521
|
-
id:
|
|
1532
|
+
id: i,
|
|
1522
1533
|
"aria-label": h,
|
|
1523
|
-
"aria-labelledby":
|
|
1524
|
-
required:
|
|
1534
|
+
"aria-labelledby": a,
|
|
1535
|
+
required: v
|
|
1525
1536
|
}) => /* @__PURE__ */ c(xe.Provider, { value: { name: e, value: r, onChange: t }, children: /* @__PURE__ */ c(
|
|
1526
1537
|
"div",
|
|
1527
1538
|
{
|
|
1528
|
-
id:
|
|
1539
|
+
id: i,
|
|
1529
1540
|
className: l(se.group, n),
|
|
1530
1541
|
style: o,
|
|
1531
1542
|
role: "radiogroup",
|
|
1532
1543
|
tabIndex: -1,
|
|
1533
1544
|
"aria-label": h,
|
|
1534
|
-
"aria-labelledby":
|
|
1535
|
-
"aria-required":
|
|
1545
|
+
"aria-labelledby": a,
|
|
1546
|
+
"aria-required": v || void 0,
|
|
1536
1547
|
children: m
|
|
1537
1548
|
}
|
|
1538
1549
|
) });
|
|
1539
|
-
|
|
1540
|
-
const
|
|
1550
|
+
ao.displayName = "RadioGroup";
|
|
1551
|
+
const io = W(
|
|
1541
1552
|
({
|
|
1542
1553
|
label: e,
|
|
1543
1554
|
value: r,
|
|
@@ -1545,49 +1556,49 @@ const ao = W(
|
|
|
1545
1556
|
className: n,
|
|
1546
1557
|
style: o,
|
|
1547
1558
|
onChange: m,
|
|
1548
|
-
checked:
|
|
1559
|
+
checked: i,
|
|
1549
1560
|
name: h,
|
|
1550
|
-
...
|
|
1551
|
-
},
|
|
1552
|
-
const u = ae(xe),
|
|
1553
|
-
u?.onChange?.(r), m?.(
|
|
1561
|
+
...a
|
|
1562
|
+
}, v) => {
|
|
1563
|
+
const u = ae(xe), f = u?.name ?? h, y = u ? u.value === r : i, b = (g) => {
|
|
1564
|
+
u?.onChange?.(r), m?.(g);
|
|
1554
1565
|
};
|
|
1555
1566
|
return /* @__PURE__ */ I("label", { className: l(se.root, t?.root, n), style: o, children: [
|
|
1556
1567
|
/* @__PURE__ */ c(
|
|
1557
1568
|
"input",
|
|
1558
1569
|
{
|
|
1559
|
-
ref:
|
|
1570
|
+
ref: v,
|
|
1560
1571
|
type: "radio",
|
|
1561
1572
|
className: l(se.input, t?.input),
|
|
1562
|
-
name:
|
|
1573
|
+
name: f,
|
|
1563
1574
|
value: r,
|
|
1564
|
-
checked:
|
|
1575
|
+
checked: y,
|
|
1565
1576
|
onChange: b,
|
|
1566
|
-
...
|
|
1577
|
+
...a
|
|
1567
1578
|
}
|
|
1568
1579
|
),
|
|
1569
1580
|
e && /* @__PURE__ */ c("span", { className: l(se.label, t?.label), children: e })
|
|
1570
1581
|
] });
|
|
1571
1582
|
}
|
|
1572
1583
|
);
|
|
1573
|
-
|
|
1574
|
-
const
|
|
1575
|
-
root:
|
|
1576
|
-
sm:
|
|
1577
|
-
md:
|
|
1578
|
-
lg:
|
|
1579
|
-
error:
|
|
1580
|
-
resizeNone:
|
|
1581
|
-
resizeVertical:
|
|
1582
|
-
resizeHorizontal:
|
|
1583
|
-
resizeBoth:
|
|
1584
|
+
io.displayName = "Radio";
|
|
1585
|
+
const uo = "crk-root-IGgdn", mo = "crk-sm-N-5I2", ho = "crk-md-bbyFl", po = "crk-lg-Pd-Iq", fo = "crk-error-fyu3i", go = "crk-resizeNone-SmNT4", bo = "crk-resizeVertical-oi8vP", ko = "crk-resizeHorizontal-riMLL", yo = "crk-resizeBoth-NYSh4", vo = "crk-autoExpand-JWone", te = {
|
|
1586
|
+
root: uo,
|
|
1587
|
+
sm: mo,
|
|
1588
|
+
md: ho,
|
|
1589
|
+
lg: po,
|
|
1590
|
+
error: fo,
|
|
1591
|
+
resizeNone: go,
|
|
1592
|
+
resizeVertical: bo,
|
|
1593
|
+
resizeHorizontal: ko,
|
|
1594
|
+
resizeBoth: yo,
|
|
1584
1595
|
autoExpand: vo
|
|
1585
|
-
},
|
|
1596
|
+
}, No = {
|
|
1586
1597
|
none: "resizeNone",
|
|
1587
1598
|
vertical: "resizeVertical",
|
|
1588
1599
|
horizontal: "resizeHorizontal",
|
|
1589
1600
|
both: "resizeBoth"
|
|
1590
|
-
},
|
|
1601
|
+
}, wo = W(
|
|
1591
1602
|
({
|
|
1592
1603
|
inputSize: e = "md",
|
|
1593
1604
|
error: r = !1,
|
|
@@ -1595,63 +1606,63 @@ const io = "crk-root-IGgdn", uo = "crk-sm-N-5I2", mo = "crk-md-bbyFl", ho = "crk
|
|
|
1595
1606
|
autoExpand: n = !0,
|
|
1596
1607
|
className: o,
|
|
1597
1608
|
style: m,
|
|
1598
|
-
onChange:
|
|
1609
|
+
onChange: i,
|
|
1599
1610
|
...h
|
|
1600
|
-
},
|
|
1601
|
-
const
|
|
1602
|
-
const b =
|
|
1611
|
+
}, a) => {
|
|
1612
|
+
const v = O(null), u = L(() => {
|
|
1613
|
+
const b = v.current;
|
|
1603
1614
|
b && (b.style.height = "auto", b.style.height = `${b.scrollHeight}px`);
|
|
1604
|
-
}, []),
|
|
1615
|
+
}, []), f = h.value ?? "";
|
|
1605
1616
|
F(() => {
|
|
1606
1617
|
n && u();
|
|
1607
|
-
}, [n, u,
|
|
1608
|
-
const
|
|
1618
|
+
}, [n, u, f]);
|
|
1619
|
+
const y = L(
|
|
1609
1620
|
(b) => {
|
|
1610
|
-
n && u(),
|
|
1621
|
+
n && u(), i?.(b);
|
|
1611
1622
|
},
|
|
1612
|
-
[n, u,
|
|
1623
|
+
[n, u, i]
|
|
1613
1624
|
);
|
|
1614
1625
|
return /* @__PURE__ */ c(
|
|
1615
1626
|
"textarea",
|
|
1616
1627
|
{
|
|
1617
1628
|
ref: (b) => {
|
|
1618
|
-
|
|
1629
|
+
v.current = b, typeof a == "function" ? a(b) : a && (a.current = b);
|
|
1619
1630
|
},
|
|
1620
1631
|
className: l(
|
|
1621
1632
|
te.root,
|
|
1622
1633
|
te[e],
|
|
1623
1634
|
r && te.error,
|
|
1624
|
-
n ? te.autoExpand : te[
|
|
1635
|
+
n ? te.autoExpand : te[No[t]],
|
|
1625
1636
|
o
|
|
1626
1637
|
),
|
|
1627
1638
|
style: m,
|
|
1628
|
-
onChange:
|
|
1639
|
+
onChange: y,
|
|
1629
1640
|
rows: h.rows ?? 1,
|
|
1630
1641
|
...h
|
|
1631
1642
|
}
|
|
1632
1643
|
);
|
|
1633
1644
|
}
|
|
1634
1645
|
);
|
|
1635
|
-
|
|
1646
|
+
wo.displayName = "Textarea";
|
|
1636
1647
|
export {
|
|
1637
1648
|
Ze as Button,
|
|
1638
|
-
|
|
1649
|
+
no as Checkbox,
|
|
1639
1650
|
$t as Dropdown,
|
|
1640
1651
|
Ct as DropdownItem,
|
|
1641
|
-
|
|
1652
|
+
Do as Form,
|
|
1642
1653
|
Ro as FormField,
|
|
1643
|
-
|
|
1644
|
-
|
|
1654
|
+
Eo as FormRow,
|
|
1655
|
+
yn as Input,
|
|
1645
1656
|
nr as Link,
|
|
1646
1657
|
Or as List,
|
|
1647
1658
|
Pr as ListItem,
|
|
1648
1659
|
ue as Modal,
|
|
1649
1660
|
Pt as Popover,
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1661
|
+
io as Radio,
|
|
1662
|
+
ao as RadioGroup,
|
|
1663
|
+
Zn as Select,
|
|
1664
|
+
Co as Table,
|
|
1665
|
+
wo as Textarea,
|
|
1655
1666
|
$r as Typography,
|
|
1656
1667
|
ie as useClickOutside,
|
|
1657
1668
|
Mt as useFocusTrap,
|