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