@mci-ui/mci-ui 0.0.67 → 0.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +585 -556
- package/dist/index.umd.js +1 -1
- package/dist/types/shared/ui/MciModal/MciModal.d.ts +7 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as he } from "react/jsx-runtime";
|
|
2
2
|
import { AltArrowRight as ge, Star2 as Be, AltArrowDown as Se, EyeClosed as Qe, Eye as Pe, Calendar as et, AltArrowLeft as ye, DoubleAltArrowLeft as tt, DoubleAltArrowRight as rt, ConfoundedSquare as nt, SortVertical as lt, SortFromTopToBottom as at, SortFromBottomToTop as st, Upload as ot, File as je, Download as it, FileText as Me, MusicNote as ct, VideoFramePlayHorizontal as dt, Gallery as ut, MenuDots as ht, Refresh as ft, InfoCircle as mt, DangerCircle as pt, CloseCircle as gt, CheckCircle as bt, Phone as xt, TransferVertical as wt } from "@solar-icons/react";
|
|
3
3
|
import { clsx as vt } from "clsx";
|
|
4
4
|
import { twMerge as yt } from "tailwind-merge";
|
|
@@ -23,14 +23,14 @@ function Zt({
|
|
|
23
23
|
variant: a = "blue",
|
|
24
24
|
className: r
|
|
25
25
|
}) {
|
|
26
|
-
const l = a === "blue", m = l ? "hover:text-blue-600" : "hover:text-yellow-500",
|
|
26
|
+
const l = a === "blue", m = l ? "hover:text-blue-600" : "hover:text-yellow-500", u = l ? "text-blue-600" : "text-yellow-500";
|
|
27
27
|
return /* @__PURE__ */ e("nav", { className: n("flex items-center", r), "aria-label": "Breadcrumb", children: t.map((s, o) => {
|
|
28
28
|
const C = o === t.length - 1;
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
C ? /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
30
|
+
C ? /* @__PURE__ */ c("span", { className: n("flex items-center gap-x-2 font-medium", u), children: [
|
|
31
31
|
s.icon,
|
|
32
32
|
/* @__PURE__ */ e("span", { children: s.label })
|
|
33
|
-
] }) : /* @__PURE__ */
|
|
33
|
+
] }) : /* @__PURE__ */ c(
|
|
34
34
|
"a",
|
|
35
35
|
{
|
|
36
36
|
href: s.href ?? "#",
|
|
@@ -57,19 +57,19 @@ function qt({
|
|
|
57
57
|
icon: r,
|
|
58
58
|
iconPosition: l = "left",
|
|
59
59
|
size: m = "base",
|
|
60
|
-
variant:
|
|
60
|
+
variant: u = "primary",
|
|
61
61
|
color: s = "yellow",
|
|
62
62
|
loading: o = !1,
|
|
63
63
|
disabled: C = !1,
|
|
64
64
|
onClick: y,
|
|
65
|
-
className:
|
|
66
|
-
type:
|
|
65
|
+
className: M,
|
|
66
|
+
type: k = "button"
|
|
67
67
|
}) {
|
|
68
|
-
const
|
|
68
|
+
const L = t ?? a, I = {
|
|
69
69
|
sm: "h-9 px-2 text-sm gap-1.5 rounded-lg leading-9 min-w-9",
|
|
70
70
|
md: "h-10 px-2 text-base gap-2 rounded-lg leading-10 min-w-10",
|
|
71
71
|
base: "h-12 px-4 text-base gap-2 rounded-xl leading-12 min-w-12"
|
|
72
|
-
},
|
|
72
|
+
}, i = u === "primary" || u === "secondary" || u === "outline" ? {
|
|
73
73
|
blue: {
|
|
74
74
|
primary: "bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 focus:ring-2 focus:ring-[rgba(21,93,252,0.25)]",
|
|
75
75
|
secondary: "bg-blue-100 text-blue-600 hover:bg-blue-200 active:bg-blue-200 active:border active:border-blue-600 focus:ring-2 focus:ring-[rgba(21,93,252,0.25)]",
|
|
@@ -80,27 +80,27 @@ function qt({
|
|
|
80
80
|
secondary: "bg-yellow-50 text-yellow-500 hover:bg-yellow-100 active:bg-yellow-100 active:border active:border-yellow-500 focus:ring-2 focus:ring-yellow-200",
|
|
81
81
|
outline: "border border-yellow-500 text-yellow-500 hover:border-yellow-600 hover:text-yellow-600 active:border-yellow-700 active:text-yellow-700 focus:ring-2 focus:ring-yellow-200"
|
|
82
82
|
}
|
|
83
|
-
}[s][
|
|
83
|
+
}[s][u] : {
|
|
84
84
|
danger: "bg-red-600 text-white hover:bg-red-700 active:bg-red-800 focus:ring-2 focus:shadow-red",
|
|
85
85
|
tertiary: "bg-slate-100 text-black hover:bg-slate-200 active:bg-slate-300 focus:ring-2 focus:shadow-slate"
|
|
86
|
-
}[
|
|
87
|
-
return /* @__PURE__ */
|
|
86
|
+
}[u], x = C || o, b = x ? u === "outline" ? "border-slate-200 bg-white text-slate-400 cursor-not-allowed hover:bg-transparent hover:border-slate-200 hover:text-slate-400 active:border-slate-200 active:text-slate-400 active:bg-transparent focus:bg-transparent focus:ring-0" : "bg-slate-200 text-slate-400 cursor-not-allowed hover:bg-slate-200 active:bg-slate-200 focus:ring-0" : "";
|
|
87
|
+
return /* @__PURE__ */ c(
|
|
88
88
|
"button",
|
|
89
89
|
{
|
|
90
|
-
type:
|
|
90
|
+
type: k,
|
|
91
91
|
onClick: y,
|
|
92
92
|
disabled: x,
|
|
93
93
|
className: n(
|
|
94
94
|
"inline-flex items-center justify-center font-medium transition-all duration-200 cursor-pointer",
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
!x &&
|
|
95
|
+
I[m],
|
|
96
|
+
i,
|
|
97
|
+
!x && i,
|
|
98
98
|
b,
|
|
99
|
-
|
|
99
|
+
M
|
|
100
100
|
),
|
|
101
101
|
children: [
|
|
102
102
|
r && l === "left" && !o && /* @__PURE__ */ e("span", { className: "flex items-center", children: r }),
|
|
103
|
-
|
|
103
|
+
L && /* @__PURE__ */ e("span", { children: L }),
|
|
104
104
|
r && l === "right" && !o && /* @__PURE__ */ e("span", { className: "flex items-center", children: r }),
|
|
105
105
|
o && /* @__PURE__ */ e(Be, { weight: "Linear", size: 20, className: "animate-spin" })
|
|
106
106
|
]
|
|
@@ -125,47 +125,47 @@ const Ct = (t) => /* @__PURE__ */ te.createElement("svg", { xmlns: "http://www.w
|
|
|
125
125
|
label: r,
|
|
126
126
|
supportText: l,
|
|
127
127
|
checked: m,
|
|
128
|
-
onChange:
|
|
128
|
+
onChange: u,
|
|
129
129
|
error: s,
|
|
130
130
|
disabled: o = !1,
|
|
131
131
|
required: C = !1,
|
|
132
132
|
className: y,
|
|
133
|
-
variant:
|
|
134
|
-
name:
|
|
135
|
-
value:
|
|
133
|
+
variant: M = "yellow",
|
|
134
|
+
name: k,
|
|
135
|
+
value: L
|
|
136
136
|
}) {
|
|
137
|
-
const [
|
|
138
|
-
() => m ??
|
|
139
|
-
[m,
|
|
137
|
+
const [I, w] = Y(!1), d = a === "radio", i = _(
|
|
138
|
+
() => m ?? I,
|
|
139
|
+
[m, I]
|
|
140
140
|
), x = z(
|
|
141
|
-
(
|
|
142
|
-
o || (m === void 0 && v
|
|
141
|
+
(v) => {
|
|
142
|
+
o || (m === void 0 && w(v.target.checked), u?.(v));
|
|
143
143
|
},
|
|
144
|
-
[m,
|
|
144
|
+
[m, u, o]
|
|
145
145
|
), b = _(() => {
|
|
146
146
|
if (o) {
|
|
147
147
|
const S = "border-slate-200 bg-slate-100";
|
|
148
|
-
return
|
|
148
|
+
return d ? {
|
|
149
149
|
container: S,
|
|
150
|
-
dot:
|
|
150
|
+
dot: i ? "bg-slate-300" : "bg-transparent",
|
|
151
151
|
check: "text-slate-400"
|
|
152
152
|
} : {
|
|
153
153
|
container: S,
|
|
154
154
|
dot: "",
|
|
155
|
-
check:
|
|
155
|
+
check: i ? "text-slate-400" : "text-transparent"
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
158
|
+
const v = Mt[M];
|
|
159
|
+
if (d) {
|
|
160
160
|
const S = n(
|
|
161
161
|
"border transition-all duration-200",
|
|
162
|
-
|
|
163
|
-
!
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
i ? v.border : "border-slate-400",
|
|
163
|
+
!i && v.hover,
|
|
164
|
+
v.focus,
|
|
165
|
+
i && ""
|
|
166
166
|
), E = n(
|
|
167
167
|
"transition-all duration-200 rounded-full",
|
|
168
|
-
|
|
168
|
+
i ? v.bg : "bg-transparent"
|
|
169
169
|
);
|
|
170
170
|
return {
|
|
171
171
|
container: S,
|
|
@@ -176,15 +176,15 @@ const Ct = (t) => /* @__PURE__ */ te.createElement("svg", { xmlns: "http://www.w
|
|
|
176
176
|
return {
|
|
177
177
|
container: n(
|
|
178
178
|
"border transition-all duration-200",
|
|
179
|
-
|
|
180
|
-
!
|
|
181
|
-
|
|
179
|
+
i ? n(v.bg, v.border) : "border-slate-400",
|
|
180
|
+
!i && v.hover,
|
|
181
|
+
v.focus
|
|
182
182
|
),
|
|
183
183
|
dot: "",
|
|
184
|
-
check:
|
|
184
|
+
check: i ? "text-white" : "text-transparent"
|
|
185
185
|
};
|
|
186
|
-
}, [
|
|
187
|
-
r && /* @__PURE__ */
|
|
186
|
+
}, [d, i, o, M]), p = _(() => !r && !l ? null : /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
|
|
187
|
+
r && /* @__PURE__ */ c(
|
|
188
188
|
"span",
|
|
189
189
|
{
|
|
190
190
|
className: n(
|
|
@@ -209,8 +209,8 @@ const Ct = (t) => /* @__PURE__ */ te.createElement("svg", { xmlns: "http://www.w
|
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
211
|
] }), [r, l, s, o, C]);
|
|
212
|
-
return /* @__PURE__ */
|
|
213
|
-
/* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ c("div", { className: n("flex items-start", y), children: [
|
|
213
|
+
/* @__PURE__ */ c(
|
|
214
214
|
"label",
|
|
215
215
|
{
|
|
216
216
|
className: n(
|
|
@@ -222,15 +222,15 @@ const Ct = (t) => /* @__PURE__ */ te.createElement("svg", { xmlns: "http://www.w
|
|
|
222
222
|
"input",
|
|
223
223
|
{
|
|
224
224
|
type: a,
|
|
225
|
-
checked:
|
|
225
|
+
checked: i,
|
|
226
226
|
onChange: x,
|
|
227
227
|
disabled: o,
|
|
228
228
|
required: C,
|
|
229
229
|
className: "sr-only",
|
|
230
230
|
"aria-invalid": !!s,
|
|
231
|
-
"aria-describedby": s ? `${
|
|
232
|
-
name:
|
|
233
|
-
value:
|
|
231
|
+
"aria-describedby": s ? `${k}-error` : void 0,
|
|
232
|
+
name: k,
|
|
233
|
+
value: L
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
236
|
/* @__PURE__ */ e(
|
|
@@ -238,16 +238,16 @@ const Ct = (t) => /* @__PURE__ */ te.createElement("svg", { xmlns: "http://www.w
|
|
|
238
238
|
{
|
|
239
239
|
className: n(
|
|
240
240
|
"relative flex items-center justify-center",
|
|
241
|
-
|
|
241
|
+
d ? "w-5 h-5 rounded-full" : "w-5 h-5 rounded",
|
|
242
242
|
b.container
|
|
243
243
|
),
|
|
244
|
-
children:
|
|
244
|
+
children: d ? /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
245
245
|
"span",
|
|
246
246
|
{
|
|
247
247
|
className: n(
|
|
248
248
|
"w-3 h-3 rounded-full transition-all duration-200",
|
|
249
249
|
b.dot,
|
|
250
|
-
|
|
250
|
+
i ? "opacity-100 scale-100" : "opacity-0 scale-50"
|
|
251
251
|
)
|
|
252
252
|
}
|
|
253
253
|
) }) : /* @__PURE__ */ e(
|
|
@@ -256,7 +256,7 @@ const Ct = (t) => /* @__PURE__ */ te.createElement("svg", { xmlns: "http://www.w
|
|
|
256
256
|
className: n(
|
|
257
257
|
"w-4 h-4 stroke-[2.5px] transition-opacity duration-200",
|
|
258
258
|
b.check,
|
|
259
|
-
|
|
259
|
+
i ? "opacity-100" : "opacity-0"
|
|
260
260
|
)
|
|
261
261
|
}
|
|
262
262
|
)
|
|
@@ -266,7 +266,7 @@ const Ct = (t) => /* @__PURE__ */ te.createElement("svg", { xmlns: "http://www.w
|
|
|
266
266
|
]
|
|
267
267
|
}
|
|
268
268
|
),
|
|
269
|
-
s && /* @__PURE__ */ e("p", { id: `${
|
|
269
|
+
s && /* @__PURE__ */ e("p", { id: `${k}-error`, className: "mt-1 text-extra-small text-red-600", children: s })
|
|
270
270
|
] });
|
|
271
271
|
});
|
|
272
272
|
ke.displayName = "MciCheck";
|
|
@@ -276,13 +276,13 @@ function Kt({
|
|
|
276
276
|
defaultOpen: r = !1,
|
|
277
277
|
icon: l,
|
|
278
278
|
className: m,
|
|
279
|
-
contentClassName:
|
|
279
|
+
contentClassName: u
|
|
280
280
|
}) {
|
|
281
|
-
const [s, o] = Y(r), [C, y] = Y(0),
|
|
281
|
+
const [s, o] = Y(r), [C, y] = Y(0), M = se(null);
|
|
282
282
|
return J(() => {
|
|
283
|
-
|
|
284
|
-
}, [s]), /* @__PURE__ */
|
|
285
|
-
/* @__PURE__ */
|
|
283
|
+
M.current && y(s ? M.current.scrollHeight : 0);
|
|
284
|
+
}, [s]), /* @__PURE__ */ c("div", { className: n("overflow-hidden rounded-xl border border-slate-200", m), children: [
|
|
285
|
+
/* @__PURE__ */ c(
|
|
286
286
|
"button",
|
|
287
287
|
{
|
|
288
288
|
onClick: () => o(!s),
|
|
@@ -291,7 +291,7 @@ function Kt({
|
|
|
291
291
|
s ? "border-b border-slate-200" : "border-b border-transparent"
|
|
292
292
|
),
|
|
293
293
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
295
295
|
l && /* @__PURE__ */ e("span", { className: "shrink-0", children: l }),
|
|
296
296
|
/* @__PURE__ */ e("div", { className: n("text-base font-medium text-black"), children: t })
|
|
297
297
|
] }),
|
|
@@ -318,7 +318,7 @@ function Kt({
|
|
|
318
318
|
style: {
|
|
319
319
|
height: `${C}px`
|
|
320
320
|
},
|
|
321
|
-
children: /* @__PURE__ */ e("div", { ref:
|
|
321
|
+
children: /* @__PURE__ */ e("div", { ref: M, className: n("p-5", u), children: a })
|
|
322
322
|
}
|
|
323
323
|
)
|
|
324
324
|
] });
|
|
@@ -330,30 +330,30 @@ function Jt({
|
|
|
330
330
|
position: r = "right",
|
|
331
331
|
children: l,
|
|
332
332
|
footer: m,
|
|
333
|
-
title:
|
|
333
|
+
title: u,
|
|
334
334
|
description: s,
|
|
335
335
|
showCloseButton: o = !0,
|
|
336
336
|
drawerClassName: C,
|
|
337
337
|
closeOnOverlayClick: y = !0,
|
|
338
|
-
closeOnEscape:
|
|
339
|
-
width:
|
|
338
|
+
closeOnEscape: M = !0,
|
|
339
|
+
width: k = 572
|
|
340
340
|
}) {
|
|
341
|
-
const
|
|
341
|
+
const L = se(null), I = se(null), w = z(() => {
|
|
342
342
|
a();
|
|
343
343
|
}, [a]);
|
|
344
344
|
J(() => {
|
|
345
|
-
t ? (
|
|
345
|
+
t ? (I.current = document.activeElement, L.current?.focus()) : I.current?.focus();
|
|
346
346
|
}, [t]), J(() => (t && (document.body.style.overflow = "hidden"), () => {
|
|
347
347
|
document.body.style.overflow = "unset";
|
|
348
348
|
}), [t]);
|
|
349
|
-
const
|
|
350
|
-
width: typeof
|
|
349
|
+
const d = _(() => ({
|
|
350
|
+
width: typeof k == "number" ? `${k}px` : k,
|
|
351
351
|
transform: t ? "translateX(0)" : r === "right" ? "translateX(calc(100% + 48px))" : "translateX(calc(-100% - 48px))"
|
|
352
|
-
}), [t,
|
|
352
|
+
}), [t, k, r]), i = {
|
|
353
353
|
left: "top-6 left-6 bottom-6",
|
|
354
354
|
right: "top-6 right-6 bottom-6"
|
|
355
355
|
};
|
|
356
|
-
return /* @__PURE__ */
|
|
356
|
+
return /* @__PURE__ */ c(he, { children: [
|
|
357
357
|
/* @__PURE__ */ e(
|
|
358
358
|
"div",
|
|
359
359
|
{
|
|
@@ -361,35 +361,35 @@ function Jt({
|
|
|
361
361
|
"fixed inset-0 z-50 bg-black/40 transition-opacity duration-300",
|
|
362
362
|
t ? "opacity-100 visible cursor-pointer" : "opacity-0 invisible pointer-events-none"
|
|
363
363
|
),
|
|
364
|
-
onClick: y ?
|
|
364
|
+
onClick: y ? w : void 0,
|
|
365
365
|
"aria-hidden": "true"
|
|
366
366
|
}
|
|
367
367
|
),
|
|
368
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ c(
|
|
369
369
|
"div",
|
|
370
370
|
{
|
|
371
|
-
ref:
|
|
371
|
+
ref: L,
|
|
372
372
|
tabIndex: -1,
|
|
373
|
-
style:
|
|
373
|
+
style: d,
|
|
374
374
|
className: n(
|
|
375
375
|
"fixed flex flex-col z-50 w-full rounded-2xl bg-white transition-transform duration-300 ease-in-out outline-none",
|
|
376
|
-
|
|
376
|
+
i[r],
|
|
377
377
|
C
|
|
378
378
|
),
|
|
379
379
|
role: "dialog",
|
|
380
380
|
"aria-modal": "true",
|
|
381
|
-
"aria-labelledby":
|
|
381
|
+
"aria-labelledby": u ? "drawer-title" : void 0,
|
|
382
382
|
children: [
|
|
383
|
-
(
|
|
384
|
-
|
|
385
|
-
/* @__PURE__ */ e("h2", { id: "drawer-title", className: "text-h3 font-semibold text-black", children:
|
|
383
|
+
(u || o || s) && /* @__PURE__ */ c("div", { className: "flex items-start justify-between border-b border-slate-200 p-6 shrink-0", children: [
|
|
384
|
+
u && /* @__PURE__ */ c("div", { className: "block", children: [
|
|
385
|
+
/* @__PURE__ */ e("h2", { id: "drawer-title", className: "text-h3 font-semibold text-black", children: u }),
|
|
386
386
|
s && /* @__PURE__ */ e("p", { className: "text-base text-slate-base font-normal mt-2", children: s })
|
|
387
387
|
] }),
|
|
388
388
|
o && /* @__PURE__ */ e(
|
|
389
389
|
"button",
|
|
390
390
|
{
|
|
391
391
|
type: "button",
|
|
392
|
-
onClick:
|
|
392
|
+
onClick: w,
|
|
393
393
|
className: "bg-slate-100 rounded-xl w-12 h-12 hover:cursor-pointer text-black transition flex items-center justify-center group active:scale-95",
|
|
394
394
|
children: /* @__PURE__ */ e(me, { className: "h-6 w-6 transition-transform duration-300 group-hover:rotate-180" })
|
|
395
395
|
}
|
|
@@ -409,32 +409,32 @@ const Fe = fe(
|
|
|
409
409
|
type: r = "text",
|
|
410
410
|
icon: l,
|
|
411
411
|
rightIcon: m,
|
|
412
|
-
iconPosition:
|
|
412
|
+
iconPosition: u = "left",
|
|
413
413
|
size: s = "base",
|
|
414
414
|
error: o,
|
|
415
415
|
disabled: C = !1,
|
|
416
416
|
required: y = !1,
|
|
417
|
-
value:
|
|
418
|
-
onChange:
|
|
419
|
-
onFocus:
|
|
420
|
-
onBlur:
|
|
421
|
-
className:
|
|
422
|
-
name:
|
|
423
|
-
maxLength:
|
|
417
|
+
value: M,
|
|
418
|
+
onChange: k,
|
|
419
|
+
onFocus: L,
|
|
420
|
+
onBlur: I,
|
|
421
|
+
className: w,
|
|
422
|
+
name: d,
|
|
423
|
+
maxLength: i = 250,
|
|
424
424
|
onClear: x,
|
|
425
425
|
showClearButton: b = !1,
|
|
426
426
|
step: p,
|
|
427
|
-
autoComplete:
|
|
428
|
-
},
|
|
429
|
-
const [S, E] = Y(!1), [h, F] = Y(""), [
|
|
430
|
-
E(!0),
|
|
427
|
+
autoComplete: v = "off"
|
|
428
|
+
}, j) => {
|
|
429
|
+
const [S, E] = Y(!1), [h, F] = Y(""), [T, B] = Y(!1), H = M ?? h, W = r === "password", U = b && !!H && !C, K = l && u === "left", ne = l && u === "right" || m || W, re = ne || U, X = () => {
|
|
430
|
+
E(!0), L?.();
|
|
431
431
|
}, le = () => {
|
|
432
|
-
E(!1),
|
|
432
|
+
E(!1), I?.();
|
|
433
433
|
}, ie = (Z) => {
|
|
434
434
|
let q = Z.target.value;
|
|
435
|
-
r === "number" &&
|
|
435
|
+
r === "number" && i && q.length > i && (q = q.slice(0, i), Z.target.value = q), M === void 0 && F(q), k?.(Z);
|
|
436
436
|
}, Q = () => B((Z) => !Z), N = () => {
|
|
437
|
-
|
|
437
|
+
M === void 0 && F(""), x?.();
|
|
438
438
|
}, D = _(
|
|
439
439
|
() => ({
|
|
440
440
|
sm: {
|
|
@@ -466,12 +466,12 @@ const Fe = fe(
|
|
|
466
466
|
}
|
|
467
467
|
}),
|
|
468
468
|
[K, ne]
|
|
469
|
-
),
|
|
470
|
-
return /* @__PURE__ */
|
|
471
|
-
t && /* @__PURE__ */
|
|
469
|
+
), R = _(() => o ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [o]), $ = _(() => C ? "text-slate-400" : o ? "text-red-600" : S ? "text-black" : "text-slate-400", [o, S, C]);
|
|
470
|
+
return /* @__PURE__ */ c("div", { className: n("w-full", w), children: [
|
|
471
|
+
t && /* @__PURE__ */ c(
|
|
472
472
|
"label",
|
|
473
473
|
{
|
|
474
|
-
htmlFor:
|
|
474
|
+
htmlFor: d,
|
|
475
475
|
className: n(
|
|
476
476
|
"mb-2 block text-base font-medium",
|
|
477
477
|
o ? "text-red-600" : "text-slate-700",
|
|
@@ -483,20 +483,20 @@ const Fe = fe(
|
|
|
483
483
|
]
|
|
484
484
|
}
|
|
485
485
|
),
|
|
486
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ c("div", { className: "relative flex items-center", children: [
|
|
487
487
|
/* @__PURE__ */ e(
|
|
488
488
|
"input",
|
|
489
489
|
{
|
|
490
|
-
ref:
|
|
491
|
-
name:
|
|
492
|
-
type: W &&
|
|
490
|
+
ref: j,
|
|
491
|
+
name: d,
|
|
492
|
+
type: W && T ? "text" : r,
|
|
493
493
|
value: H,
|
|
494
494
|
onChange: ie,
|
|
495
495
|
onFocus: X,
|
|
496
496
|
onBlur: le,
|
|
497
497
|
disabled: C,
|
|
498
498
|
required: y,
|
|
499
|
-
autoComplete:
|
|
499
|
+
autoComplete: v,
|
|
500
500
|
placeholder: a,
|
|
501
501
|
step: p,
|
|
502
502
|
className: n(
|
|
@@ -506,9 +506,9 @@ const Fe = fe(
|
|
|
506
506
|
"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
507
507
|
D[s].input,
|
|
508
508
|
D[s].padding,
|
|
509
|
-
|
|
509
|
+
R
|
|
510
510
|
),
|
|
511
|
-
maxLength:
|
|
511
|
+
maxLength: i
|
|
512
512
|
}
|
|
513
513
|
),
|
|
514
514
|
K && /* @__PURE__ */ e(
|
|
@@ -518,7 +518,7 @@ const Fe = fe(
|
|
|
518
518
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center",
|
|
519
519
|
"transition-all duration-300",
|
|
520
520
|
D[s].leftIcon,
|
|
521
|
-
|
|
521
|
+
$
|
|
522
522
|
),
|
|
523
523
|
children: /* @__PURE__ */ e(
|
|
524
524
|
"div",
|
|
@@ -529,7 +529,7 @@ const Fe = fe(
|
|
|
529
529
|
)
|
|
530
530
|
}
|
|
531
531
|
),
|
|
532
|
-
re && /* @__PURE__ */
|
|
532
|
+
re && /* @__PURE__ */ c(
|
|
533
533
|
"div",
|
|
534
534
|
{
|
|
535
535
|
className: n(
|
|
@@ -562,14 +562,14 @@ const Fe = fe(
|
|
|
562
562
|
className: n(
|
|
563
563
|
"flex items-center justify-center",
|
|
564
564
|
D[s].icon,
|
|
565
|
-
|
|
565
|
+
$
|
|
566
566
|
),
|
|
567
567
|
children: m
|
|
568
568
|
}
|
|
569
569
|
)
|
|
570
570
|
}
|
|
571
571
|
),
|
|
572
|
-
W && /* @__PURE__ */
|
|
572
|
+
W && /* @__PURE__ */ c(he, { children: [
|
|
573
573
|
m && /* @__PURE__ */ e(
|
|
574
574
|
"div",
|
|
575
575
|
{
|
|
@@ -583,7 +583,7 @@ const Fe = fe(
|
|
|
583
583
|
className: n(
|
|
584
584
|
"flex items-center justify-center",
|
|
585
585
|
D[s].icon,
|
|
586
|
-
|
|
586
|
+
$
|
|
587
587
|
),
|
|
588
588
|
children: m
|
|
589
589
|
}
|
|
@@ -598,19 +598,19 @@ const Fe = fe(
|
|
|
598
598
|
className: n(
|
|
599
599
|
"flex items-center justify-center",
|
|
600
600
|
D[s].iconWrapper,
|
|
601
|
-
|
|
601
|
+
$
|
|
602
602
|
),
|
|
603
603
|
children: /* @__PURE__ */ e(
|
|
604
604
|
"span",
|
|
605
605
|
{
|
|
606
606
|
className: n("flex items-center justify-center cursor-pointer", D[s].icon),
|
|
607
|
-
children:
|
|
607
|
+
children: T ? /* @__PURE__ */ e(Qe, { weight: "Linear", className: n("h-full w-full") }) : /* @__PURE__ */ e(Pe, { weight: "Linear", className: n("h-full w-full") })
|
|
608
608
|
}
|
|
609
609
|
)
|
|
610
610
|
}
|
|
611
611
|
)
|
|
612
612
|
] }),
|
|
613
|
-
l &&
|
|
613
|
+
l && u === "right" && !W && /* @__PURE__ */ e(
|
|
614
614
|
"div",
|
|
615
615
|
{
|
|
616
616
|
className: n("flex items-center justify-center", D[s].iconWrapper),
|
|
@@ -620,7 +620,7 @@ const Fe = fe(
|
|
|
620
620
|
className: n(
|
|
621
621
|
"flex items-center justify-center",
|
|
622
622
|
D[s].icon,
|
|
623
|
-
|
|
623
|
+
$
|
|
624
624
|
),
|
|
625
625
|
children: l
|
|
626
626
|
}
|
|
@@ -740,39 +740,39 @@ const Dt = {
|
|
|
740
740
|
onChange: r,
|
|
741
741
|
placeholder: l,
|
|
742
742
|
label: m,
|
|
743
|
-
disabled:
|
|
743
|
+
disabled: u = !1,
|
|
744
744
|
required: s = !1,
|
|
745
745
|
className: o,
|
|
746
746
|
format: C = "DD.MM.YYYY",
|
|
747
747
|
minDate: y,
|
|
748
|
-
maxDate:
|
|
749
|
-
error:
|
|
750
|
-
showClear:
|
|
751
|
-
allowManualInput:
|
|
752
|
-
locale:
|
|
753
|
-
startView:
|
|
754
|
-
iconPosition:
|
|
748
|
+
maxDate: M,
|
|
749
|
+
error: k,
|
|
750
|
+
showClear: L = !0,
|
|
751
|
+
allowManualInput: I = !0,
|
|
752
|
+
locale: w = "uz",
|
|
753
|
+
startView: d = "day",
|
|
754
|
+
iconPosition: i = "left",
|
|
755
755
|
align: x = "auto"
|
|
756
756
|
}, b) => {
|
|
757
|
-
const [p,
|
|
757
|
+
const [p, v] = Y(!1), [j, S] = Y(
|
|
758
758
|
t === "range" ? [null, null] : null
|
|
759
759
|
), [E, h] = Y([null, null]), F = z((f) => {
|
|
760
760
|
if (!f) return null;
|
|
761
761
|
const g = new Date(f);
|
|
762
762
|
return isNaN(g.getTime()) ? null : g;
|
|
763
|
-
}, []), [
|
|
764
|
-
const f = a !== void 0 ? a :
|
|
763
|
+
}, []), [T, B] = Y(/* @__PURE__ */ new Date()), [H, W] = Y(d), [U, K] = Y(0), [ne, re] = Y(""), [X, le] = Y(x), ie = se(null), Q = _(() => {
|
|
764
|
+
const f = a !== void 0 ? a : j;
|
|
765
765
|
if (t === "date") return F(f);
|
|
766
766
|
const g = f;
|
|
767
767
|
return [F(g[0]), F(g[1])];
|
|
768
|
-
}, [a,
|
|
768
|
+
}, [a, j, t, F]), N = Dt[w], D = z((f) => new Date(f.getFullYear(), f.getMonth(), f.getDate()), []), R = z(
|
|
769
769
|
(f) => {
|
|
770
770
|
if (!f) return "";
|
|
771
771
|
const g = f.getDate().toString().padStart(2, "0"), A = (f.getMonth() + 1).toString().padStart(2, "0"), O = f.getFullYear();
|
|
772
772
|
return C.replace("DD", g).replace("MM", A).replace("YYYY", O.toString());
|
|
773
773
|
},
|
|
774
774
|
[C]
|
|
775
|
-
),
|
|
775
|
+
), $ = z((f) => {
|
|
776
776
|
if (!f || f.length !== 10) return null;
|
|
777
777
|
const g = f.replace(/\D/g, "");
|
|
778
778
|
if (g.length !== 8) return null;
|
|
@@ -783,14 +783,14 @@ const Dt = {
|
|
|
783
783
|
}, []), Z = z(
|
|
784
784
|
(f) => {
|
|
785
785
|
const g = D(f);
|
|
786
|
-
return !!(y && g < D(y) ||
|
|
786
|
+
return !!(y && g < D(y) || M && g > D(M));
|
|
787
787
|
},
|
|
788
|
-
[y,
|
|
788
|
+
[y, M, D]
|
|
789
789
|
), q = _(() => {
|
|
790
|
-
if (t === "date") return
|
|
790
|
+
if (t === "date") return R(Q);
|
|
791
791
|
const [f, g] = Q;
|
|
792
|
-
return !f && !g ? "" : f && g ? `${
|
|
793
|
-
}, [t, Q,
|
|
792
|
+
return !f && !g ? "" : f && g ? `${R(f)} - ${R(g)}` : f ? `${R(f)} - ...` : "...";
|
|
793
|
+
}, [t, Q, R]);
|
|
794
794
|
J(() => {
|
|
795
795
|
p ? ne === "" && q !== "" && re(q) : re(q);
|
|
796
796
|
}, [q, p]), J(() => {
|
|
@@ -809,10 +809,10 @@ const Dt = {
|
|
|
809
809
|
}
|
|
810
810
|
}, [p, x]);
|
|
811
811
|
const G = z(() => {
|
|
812
|
-
|
|
813
|
-
}, [
|
|
814
|
-
|
|
815
|
-
}, [
|
|
812
|
+
v(!1), W(d), K(0), re(q);
|
|
813
|
+
}, [d, q]), ue = z((f) => {
|
|
814
|
+
u || (f.preventDefault(), f.stopPropagation(), v((g) => !g));
|
|
815
|
+
}, [u]), { handleClick: P } = Ce(ie, G), { handleEscape: ce } = Ae(G);
|
|
816
816
|
J(() => {
|
|
817
817
|
if (p)
|
|
818
818
|
return document.addEventListener("mousedown", P), document.addEventListener("keydown", ce), () => {
|
|
@@ -820,14 +820,14 @@ const Dt = {
|
|
|
820
820
|
};
|
|
821
821
|
}, [p, P, ce]);
|
|
822
822
|
const We = () => {
|
|
823
|
-
|
|
823
|
+
u || p || (t === "range" || !I) && (v(!0), W(d));
|
|
824
824
|
}, Ye = (f) => {
|
|
825
825
|
if (t !== "date") return;
|
|
826
826
|
let A = f.target.value.replace(/\D/g, "");
|
|
827
827
|
A.length > 8 && (A = A.slice(0, 8));
|
|
828
828
|
let O = "";
|
|
829
829
|
if (A.length > 4 ? O = `${A.slice(0, 2)}.${A.slice(2, 4)}.${A.slice(4)}` : A.length > 2 ? O = `${A.slice(0, 2)}.${A.slice(2)}` : O = A, re(O), O.length === 10) {
|
|
830
|
-
const V =
|
|
830
|
+
const V = $(O);
|
|
831
831
|
V && !Z(V) && (S(V), r?.(V), B(V));
|
|
832
832
|
} else O === "" && (S(null), r?.(null));
|
|
833
833
|
}, Oe = z(() => {
|
|
@@ -838,27 +838,27 @@ const Dt = {
|
|
|
838
838
|
if (Z(f)) return;
|
|
839
839
|
const g = D(f);
|
|
840
840
|
if (t === "date")
|
|
841
|
-
S(g), r?.(g), re(
|
|
841
|
+
S(g), r?.(g), re(R(g)), G();
|
|
842
842
|
else {
|
|
843
843
|
const [A, O] = E;
|
|
844
844
|
if (!A && !O || A && O)
|
|
845
|
-
h([g, null]), re(`${
|
|
845
|
+
h([g, null]), re(`${R(g)} - ...`);
|
|
846
846
|
else if (A && !O) {
|
|
847
847
|
const V = g < A ? [g, A] : [A, g];
|
|
848
848
|
h(V), S(V), r?.(V);
|
|
849
849
|
const [ee, de] = V;
|
|
850
|
-
re(`${
|
|
850
|
+
re(`${R(ee)} - ${R(de)}`), G();
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
853
|
},
|
|
854
|
-
[t, E, Z, D, r, G,
|
|
854
|
+
[t, E, Z, D, r, G, R]
|
|
855
855
|
), _e = z((f) => {
|
|
856
|
-
const g = new Date(
|
|
857
|
-
B(g),
|
|
858
|
-
}, [
|
|
859
|
-
const g = new Date(f,
|
|
860
|
-
B(g),
|
|
861
|
-
}, [
|
|
856
|
+
const g = new Date(T.getFullYear(), f, 1);
|
|
857
|
+
B(g), d === "month" && t === "date" ? (S(g), r?.(g), re(R(g)), G()) : W("day");
|
|
858
|
+
}, [T, d, r, G, t, R]), He = z((f) => {
|
|
859
|
+
const g = new Date(f, T.getMonth(), 1);
|
|
860
|
+
B(g), d === "year" && t === "date" ? (S(g), r?.(g), re(R(g)), G()) : W("month");
|
|
861
|
+
}, [T, d, r, G, t, R]), Ee = (f) => {
|
|
862
862
|
B((g) => new Date(g.getFullYear(), g.getMonth() + f, 1));
|
|
863
863
|
}, be = (f) => {
|
|
864
864
|
B((g) => new Date(g.getFullYear() + f, g.getMonth(), 1));
|
|
@@ -884,17 +884,17 @@ const Dt = {
|
|
|
884
884
|
return V && !ee ? !1 : V && ee && g > D(V) && g < D(ee);
|
|
885
885
|
}, Le = (f, g, A) => {
|
|
886
886
|
const O = Ue(f);
|
|
887
|
-
return /* @__PURE__ */
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
/* @__PURE__ */ e("div", { className: "flex gap-2 w-16", children: g && /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ c("div", { className: "w-[300px] p-2 select-none", children: [
|
|
888
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4 py-1", children: [
|
|
889
|
+
/* @__PURE__ */ e("div", { className: "flex gap-2 w-16", children: g && /* @__PURE__ */ c(he, { children: [
|
|
890
890
|
/* @__PURE__ */ e("button", { onClick: () => be(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(tt, { size: 18 }) }),
|
|
891
891
|
/* @__PURE__ */ e("button", { onClick: () => Ee(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(ye, { size: 18 }) })
|
|
892
892
|
] }) }),
|
|
893
|
-
/* @__PURE__ */
|
|
893
|
+
/* @__PURE__ */ c("div", { className: "flex gap-1 font-semibold text-slate-700 text-sm whitespace-nowrap", children: [
|
|
894
894
|
/* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => W("month"), children: N.months[f.getMonth()] }),
|
|
895
895
|
/* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => W("year"), children: f.getFullYear() })
|
|
896
896
|
] }),
|
|
897
|
-
/* @__PURE__ */ e("div", { className: "flex gap-2 w-16 justify-end", children: A && /* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ e("div", { className: "flex gap-2 w-16 justify-end", children: A && /* @__PURE__ */ c(he, { children: [
|
|
898
898
|
/* @__PURE__ */ e("button", { onClick: () => Ee(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(ge, { size: 18 }) }),
|
|
899
899
|
/* @__PURE__ */ e("button", { onClick: () => be(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(rt, { size: 18 }) })
|
|
900
900
|
] }) })
|
|
@@ -905,26 +905,26 @@ const Dt = {
|
|
|
905
905
|
return /* @__PURE__ */ e("div", { className: n("h-10 flex items-center justify-center relative", Xe && "bg-blue-50", we && t === "range" && ve ? "bg-blue-50 rounded-full" : we && t === "range" ? "bg-gradient-to-r from-transparent to-blue-50 rounded-l-full" : "", ve && t === "range" ? "bg-gradient-to-l from-transparent to-blue-50 rounded-r-full" : ""), children: /* @__PURE__ */ e("button", { type: "button", onClick: () => Ve(de), disabled: ae, className: n("w-9 h-9 cursor-pointer rounded-full flex items-center justify-center text-sm font-medium transition-all z-10", V.isCurrentMonth ? "text-slate-700" : "text-slate-300", ae && "opacity-20 cursor-not-allowed", we || ve ? "bg-blue-600 text-white shadow-md shadow-blue-200 hover:bg-blue-700" : "hover:bg-blue-50", xe(de, /* @__PURE__ */ new Date()) && !we && !ve && "text-blue-600 border border-blue-600"), children: de.getDate() }) }, ee);
|
|
906
906
|
}) })
|
|
907
907
|
] });
|
|
908
|
-
}, Je = () => /* @__PURE__ */
|
|
909
|
-
/* @__PURE__ */
|
|
908
|
+
}, Je = () => /* @__PURE__ */ c("div", { className: "w-[300px] p-3", children: [
|
|
909
|
+
/* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
910
910
|
/* @__PURE__ */ e("button", { type: "button", onClick: () => be(-1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(ye, { size: 20 }) }),
|
|
911
|
-
/* @__PURE__ */ e("span", { className: "font-bold text-slate-800", children:
|
|
911
|
+
/* @__PURE__ */ e("span", { className: "font-bold text-slate-800", children: T.getFullYear() }),
|
|
912
912
|
/* @__PURE__ */ e("button", { type: "button", onClick: () => be(1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(ge, { size: 20 }) })
|
|
913
913
|
] }),
|
|
914
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: N.monthsShort.map((f, g) => /* @__PURE__ */ e("button", { type: "button", onClick: () => _e(g), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors",
|
|
914
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: N.monthsShort.map((f, g) => /* @__PURE__ */ e("button", { type: "button", onClick: () => _e(g), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", T.getMonth() === g ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: f }, f)) })
|
|
915
915
|
] }), Ge = () => {
|
|
916
|
-
const f = Math.floor(
|
|
917
|
-
return /* @__PURE__ */
|
|
918
|
-
/* @__PURE__ */
|
|
916
|
+
const f = Math.floor(T.getFullYear() / 12) * 12 + U * 12, g = Array.from({ length: 12 }, (A, O) => f + O);
|
|
917
|
+
return /* @__PURE__ */ c("div", { className: "w-[300px] p-3", children: [
|
|
918
|
+
/* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
919
919
|
/* @__PURE__ */ e("button", { type: "button", onClick: () => K((A) => A - 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(ye, { size: 20 }) }),
|
|
920
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ c("span", { className: "font-bold text-slate-800", children: [
|
|
921
921
|
g[0],
|
|
922
922
|
" - ",
|
|
923
923
|
g[11]
|
|
924
924
|
] }),
|
|
925
925
|
/* @__PURE__ */ e("button", { type: "button", onClick: () => K((A) => A + 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(ge, { size: 20 }) })
|
|
926
926
|
] }),
|
|
927
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: g.map((A) => /* @__PURE__ */ e("button", { type: "button", onClick: () => He(A), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors",
|
|
927
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: g.map((A) => /* @__PURE__ */ e("button", { type: "button", onClick: () => He(A), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", T.getFullYear() === A ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: A }, A)) })
|
|
928
928
|
] });
|
|
929
929
|
}, Ie = /* @__PURE__ */ e(
|
|
930
930
|
"div",
|
|
@@ -932,12 +932,12 @@ const Dt = {
|
|
|
932
932
|
onClick: ue,
|
|
933
933
|
className: n(
|
|
934
934
|
"cursor-pointer flex items-center justify-center p-1 rounded-md transition-colors",
|
|
935
|
-
|
|
935
|
+
u ? "pointer-events-none opacity-50" : "hover:bg-slate-100 active:bg-slate-200"
|
|
936
936
|
),
|
|
937
937
|
children: /* @__PURE__ */ e(et, { weight: "Linear", size: 20, className: "text-slate-400" })
|
|
938
938
|
}
|
|
939
939
|
);
|
|
940
|
-
return /* @__PURE__ */
|
|
940
|
+
return /* @__PURE__ */ c("div", { ref: ie, className: n("relative w-full group", o), children: [
|
|
941
941
|
/* @__PURE__ */ e("div", { ref: b, children: /* @__PURE__ */ e(
|
|
942
942
|
Fe,
|
|
943
943
|
{
|
|
@@ -945,15 +945,15 @@ const Dt = {
|
|
|
945
945
|
placeholder: Array.isArray(l) ? l[0] : l,
|
|
946
946
|
value: ne,
|
|
947
947
|
onChange: Ye,
|
|
948
|
-
icon:
|
|
949
|
-
rightIcon:
|
|
950
|
-
disabled:
|
|
948
|
+
icon: i === "left" ? Ie : void 0,
|
|
949
|
+
rightIcon: i === "right" ? Ie : void 0,
|
|
950
|
+
disabled: u,
|
|
951
951
|
required: s,
|
|
952
|
-
error:
|
|
952
|
+
error: k,
|
|
953
953
|
maxLength: t === "date" ? 10 : void 0,
|
|
954
954
|
onFocus: We,
|
|
955
|
-
readOnly: !
|
|
956
|
-
showClearButton:
|
|
955
|
+
readOnly: !I || t === "range",
|
|
956
|
+
showClearButton: L,
|
|
957
957
|
onClear: Oe
|
|
958
958
|
}
|
|
959
959
|
) }),
|
|
@@ -969,9 +969,9 @@ const Dt = {
|
|
|
969
969
|
),
|
|
970
970
|
style: { width: "max-content" },
|
|
971
971
|
onMouseDown: (f) => f.stopPropagation(),
|
|
972
|
-
children: H === "day" ? /* @__PURE__ */
|
|
973
|
-
Le(
|
|
974
|
-
t === "range" && /* @__PURE__ */ e("div", { className: "hidden md:block border-l border-slate-100", children: Le(new Date(
|
|
972
|
+
children: H === "day" ? /* @__PURE__ */ c(he, { children: [
|
|
973
|
+
Le(T, !0, t !== "range"),
|
|
974
|
+
t === "range" && /* @__PURE__ */ e("div", { className: "hidden md:block border-l border-slate-100", children: Le(new Date(T.getFullYear(), T.getMonth() + 1, 1), !1, !0) })
|
|
975
975
|
] }) : H === "month" ? Je() : Ge()
|
|
976
976
|
}
|
|
977
977
|
)
|
|
@@ -1020,42 +1020,42 @@ const At = {
|
|
|
1020
1020
|
options: r = [],
|
|
1021
1021
|
icon: l,
|
|
1022
1022
|
iconPosition: m = "left",
|
|
1023
|
-
size:
|
|
1023
|
+
size: u = "base",
|
|
1024
1024
|
error: s,
|
|
1025
1025
|
disabled: o = !1,
|
|
1026
1026
|
required: C = !1,
|
|
1027
1027
|
value: y,
|
|
1028
|
-
onChange:
|
|
1029
|
-
onFocus:
|
|
1030
|
-
onBlur:
|
|
1031
|
-
className:
|
|
1032
|
-
clearable:
|
|
1033
|
-
searchable:
|
|
1034
|
-
onSearch:
|
|
1028
|
+
onChange: M,
|
|
1029
|
+
onFocus: k,
|
|
1030
|
+
onBlur: L,
|
|
1031
|
+
className: I,
|
|
1032
|
+
clearable: w = !1,
|
|
1033
|
+
searchable: d = !1,
|
|
1034
|
+
onSearch: i,
|
|
1035
1035
|
name: x
|
|
1036
1036
|
}, b) => {
|
|
1037
|
-
const [p,
|
|
1038
|
-
if (!
|
|
1037
|
+
const [p, v] = Y(!1), [j, S] = Y(!1), [E, h] = Y(""), [F, T] = Y(""), [B, H] = Y(-1), W = se(null), U = se(null), K = y !== void 0 ? y : E, ne = r.find((P) => P.value === K), re = K !== "" && K !== void 0, X = At[u], le = _(() => {
|
|
1038
|
+
if (!d || i) return r;
|
|
1039
1039
|
const P = F.toLowerCase();
|
|
1040
1040
|
return r.filter(
|
|
1041
1041
|
(ce) => ce.label.toLowerCase().includes(P)
|
|
1042
1042
|
);
|
|
1043
|
-
}, [r, F,
|
|
1044
|
-
|
|
1045
|
-
}, [
|
|
1043
|
+
}, [r, F, d, i]), ie = z(() => {
|
|
1044
|
+
v(!1), S(!1), T(""), H(-1), L?.();
|
|
1045
|
+
}, [L]), { handleClick: Q } = Ce(W, ie), { handleEscape: N } = Ae(ie);
|
|
1046
1046
|
J(() => {
|
|
1047
1047
|
if (p)
|
|
1048
1048
|
return document.addEventListener("mousedown", Q), document.addEventListener("keydown", N), () => {
|
|
1049
1049
|
document.removeEventListener("mousedown", Q), document.removeEventListener("keydown", N);
|
|
1050
1050
|
};
|
|
1051
1051
|
}, [p, Q, N]), J(() => {
|
|
1052
|
-
p &&
|
|
1053
|
-
}, [p,
|
|
1052
|
+
p && d && U.current && U.current.focus();
|
|
1053
|
+
}, [p, d]);
|
|
1054
1054
|
const D = z(
|
|
1055
1055
|
(P) => {
|
|
1056
1056
|
if (!o) {
|
|
1057
1057
|
if (!p && (P.key === "ArrowDown" || P.key === "ArrowUp" || P.key === "Enter")) {
|
|
1058
|
-
P.preventDefault(),
|
|
1058
|
+
P.preventDefault(), v(!0);
|
|
1059
1059
|
return;
|
|
1060
1060
|
}
|
|
1061
1061
|
if (p)
|
|
@@ -1071,32 +1071,32 @@ const At = {
|
|
|
1071
1071
|
);
|
|
1072
1072
|
break;
|
|
1073
1073
|
case "Enter":
|
|
1074
|
-
P.preventDefault(), B >= 0 && le[B] &&
|
|
1074
|
+
P.preventDefault(), B >= 0 && le[B] && $(le[B].value);
|
|
1075
1075
|
break;
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
1078
|
},
|
|
1079
1079
|
[p, le, B, o]
|
|
1080
|
-
),
|
|
1081
|
-
o || (
|
|
1082
|
-
}, [o, p,
|
|
1080
|
+
), R = z(() => {
|
|
1081
|
+
o || (v((P) => !P), p ? (T(""), H(-1)) : (S(!0), k?.()));
|
|
1082
|
+
}, [o, p, k]), $ = z(
|
|
1083
1083
|
(P) => {
|
|
1084
|
-
y === void 0 && h(P),
|
|
1084
|
+
y === void 0 && h(P), M?.(P), v(!1), S(!1), T(""), H(-1), L?.();
|
|
1085
1085
|
},
|
|
1086
|
-
[y,
|
|
1086
|
+
[y, M, L]
|
|
1087
1087
|
), Z = z(
|
|
1088
1088
|
(P) => {
|
|
1089
|
-
P.stopPropagation(), !o && (y === void 0 && h(""),
|
|
1089
|
+
P.stopPropagation(), !o && (y === void 0 && h(""), M?.(""), T(""), H(-1));
|
|
1090
1090
|
},
|
|
1091
|
-
[y,
|
|
1091
|
+
[y, M, o]
|
|
1092
1092
|
), q = z(
|
|
1093
1093
|
(P) => {
|
|
1094
|
-
|
|
1094
|
+
T(P), i?.(P), H(0);
|
|
1095
1095
|
},
|
|
1096
|
-
[
|
|
1097
|
-
), G = _(() => o ? "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" : s ? "border-red-600 focus:border-red-600 shadow-red bg-white" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600 bg-white", [s, o]), ue = _(() => o ? "text-slate-400" : s ? "text-red-600" : p ||
|
|
1098
|
-
return /* @__PURE__ */
|
|
1099
|
-
t && /* @__PURE__ */
|
|
1096
|
+
[i]
|
|
1097
|
+
), G = _(() => o ? "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" : s ? "border-red-600 focus:border-red-600 shadow-red bg-white" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600 bg-white", [s, o]), ue = _(() => o ? "text-slate-400" : s ? "text-red-600" : p || j ? "text-black" : "text-slate-400", [o, s, p, j]);
|
|
1098
|
+
return /* @__PURE__ */ c("div", { className: n("w-full", I), ref: b, children: [
|
|
1099
|
+
t && /* @__PURE__ */ c(
|
|
1100
1100
|
"label",
|
|
1101
1101
|
{
|
|
1102
1102
|
htmlFor: x,
|
|
@@ -1111,14 +1111,14 @@ const At = {
|
|
|
1111
1111
|
]
|
|
1112
1112
|
}
|
|
1113
1113
|
),
|
|
1114
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ c(
|
|
1115
1115
|
"div",
|
|
1116
1116
|
{
|
|
1117
1117
|
ref: W,
|
|
1118
1118
|
className: "relative",
|
|
1119
1119
|
onKeyDown: D,
|
|
1120
1120
|
children: [
|
|
1121
|
-
/* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ c(
|
|
1122
1122
|
"div",
|
|
1123
1123
|
{
|
|
1124
1124
|
role: "combobox",
|
|
@@ -1127,14 +1127,14 @@ const At = {
|
|
|
1127
1127
|
"aria-controls": `${x}-listbox`,
|
|
1128
1128
|
"aria-disabled": o,
|
|
1129
1129
|
tabIndex: o ? -1 : 0,
|
|
1130
|
-
onClick:
|
|
1130
|
+
onClick: R,
|
|
1131
1131
|
className: n(
|
|
1132
1132
|
"flex w-full items-center border font-normal transition-all duration-300 ease-in-out",
|
|
1133
|
-
|
|
1133
|
+
u === "base" ? "rounded-xl" : "rounded-lg",
|
|
1134
1134
|
X.container,
|
|
1135
1135
|
l ? m === "left" ? X.iconPaddingLeft : X.iconPaddingRight : X.padding,
|
|
1136
1136
|
G,
|
|
1137
|
-
!o &&
|
|
1137
|
+
!o && j && "shadow-blue border-blue-600"
|
|
1138
1138
|
),
|
|
1139
1139
|
children: [
|
|
1140
1140
|
l && /* @__PURE__ */ e(
|
|
@@ -1148,7 +1148,7 @@ const At = {
|
|
|
1148
1148
|
children: l
|
|
1149
1149
|
}
|
|
1150
1150
|
),
|
|
1151
|
-
|
|
1151
|
+
d && p ? /* @__PURE__ */ e(
|
|
1152
1152
|
"input",
|
|
1153
1153
|
{
|
|
1154
1154
|
ref: U,
|
|
@@ -1169,7 +1169,7 @@ const At = {
|
|
|
1169
1169
|
children: ne?.label || a
|
|
1170
1170
|
}
|
|
1171
1171
|
),
|
|
1172
|
-
|
|
1172
|
+
w && re && !o && /* @__PURE__ */ e(
|
|
1173
1173
|
"button",
|
|
1174
1174
|
{
|
|
1175
1175
|
type: "button",
|
|
@@ -1210,7 +1210,7 @@ const At = {
|
|
|
1210
1210
|
{
|
|
1211
1211
|
role: "option",
|
|
1212
1212
|
"aria-selected": K === P.value,
|
|
1213
|
-
onClick: () =>
|
|
1213
|
+
onClick: () => $(P.value),
|
|
1214
1214
|
className: n(
|
|
1215
1215
|
"cursor-pointer px-3 py-2 font-normal transition-colors hover:bg-slate-100 rounded-sm",
|
|
1216
1216
|
K === P.value ? "bg-slate-100" : ""
|
|
@@ -1235,49 +1235,49 @@ function Gt({
|
|
|
1235
1235
|
loading: r = !1,
|
|
1236
1236
|
skeletonRows: l = 5,
|
|
1237
1237
|
noDataText: m = "",
|
|
1238
|
-
sort:
|
|
1238
|
+
sort: u,
|
|
1239
1239
|
onSortChange: s,
|
|
1240
1240
|
className: o,
|
|
1241
1241
|
headerClassName: C,
|
|
1242
1242
|
bodyClassName: y,
|
|
1243
|
-
rowKey:
|
|
1244
|
-
rowSelection:
|
|
1243
|
+
rowKey: M = "id",
|
|
1244
|
+
rowSelection: k
|
|
1245
1245
|
}) {
|
|
1246
|
-
const [
|
|
1246
|
+
const [L, I] = Y(
|
|
1247
1247
|
null
|
|
1248
|
-
),
|
|
1249
|
-
const
|
|
1250
|
-
return
|
|
1251
|
-
}), [
|
|
1248
|
+
), w = u ?? L, d = _(() => Array.isArray(a) ? a : [], [a]), i = _(() => !w || u ? d : [...d].sort((h, F) => {
|
|
1249
|
+
const T = h[w.key], B = F[w.key];
|
|
1250
|
+
return T == null ? 1 : B == null ? -1 : T < B ? w.direction === "asc" ? -1 : 1 : T > B ? w.direction === "asc" ? 1 : -1 : 0;
|
|
1251
|
+
}), [d, w, u]), x = (h) => {
|
|
1252
1252
|
if (!h.sortable) return;
|
|
1253
1253
|
let F = null;
|
|
1254
|
-
|
|
1254
|
+
w?.key !== h.key ? F = { key: h.key, direction: "asc" } : w.direction === "asc" && (F = { key: h.key, direction: "desc" }), u !== void 0 ? s?.(F) : I(F);
|
|
1255
1255
|
};
|
|
1256
1256
|
J(() => {
|
|
1257
|
-
|
|
1258
|
-
}, [
|
|
1259
|
-
const b = r ? [] :
|
|
1260
|
-
if (!
|
|
1261
|
-
const { onChange: F, getCheckboxProps:
|
|
1257
|
+
u !== void 0 && I(null);
|
|
1258
|
+
}, [u]);
|
|
1259
|
+
const b = r ? [] : u ? d : i, p = (h) => {
|
|
1260
|
+
if (!k) return;
|
|
1261
|
+
const { onChange: F, getCheckboxProps: T } = k;
|
|
1262
1262
|
if (h.target.checked) {
|
|
1263
|
-
const W = b.filter((U) => !
|
|
1263
|
+
const W = b.filter((U) => !T?.(U)?.disabled).map((U) => U[M]);
|
|
1264
1264
|
F(W);
|
|
1265
1265
|
} else
|
|
1266
1266
|
F([]);
|
|
1267
|
-
},
|
|
1268
|
-
if (!
|
|
1269
|
-
const { selectedRowKeys:
|
|
1267
|
+
}, v = (h, F) => {
|
|
1268
|
+
if (!k) return;
|
|
1269
|
+
const { selectedRowKeys: T, onChange: B } = k, H = h[M], W = F ? [...T, H] : T.filter((U) => U !== H);
|
|
1270
1270
|
B(W);
|
|
1271
|
-
},
|
|
1272
|
-
if (!
|
|
1271
|
+
}, j = _(() => {
|
|
1272
|
+
if (!k || b.length === 0) return !1;
|
|
1273
1273
|
const h = b.filter(
|
|
1274
|
-
(F) => !
|
|
1274
|
+
(F) => !k.getCheckboxProps?.(F)?.disabled
|
|
1275
1275
|
);
|
|
1276
1276
|
return h.length === 0 ? !1 : h.every(
|
|
1277
|
-
(F) =>
|
|
1277
|
+
(F) => k.selectedRowKeys.includes(F[M])
|
|
1278
1278
|
);
|
|
1279
|
-
}, [
|
|
1280
|
-
|
|
1279
|
+
}, [k, b, M]), S = (h) => h.sortable ? !w || w.key !== h.key ? /* @__PURE__ */ e(lt, { weight: "Linear", size: 20, className: "text-slate-base" }) : w.direction === "asc" ? /* @__PURE__ */ e(at, { weight: "Linear", size: 20, className: "text-slate-base" }) : /* @__PURE__ */ e(st, { weight: "Linear", size: 20, className: "text-slate-base" }) : null, E = () => /* @__PURE__ */ c("colgroup", { children: [
|
|
1280
|
+
k && /* @__PURE__ */ e("col", { style: { width: 48 } }),
|
|
1281
1281
|
t.map((h) => /* @__PURE__ */ e("col", { style: { width: h.width || "auto" } }, h.key))
|
|
1282
1282
|
] });
|
|
1283
1283
|
return /* @__PURE__ */ e(
|
|
@@ -1296,14 +1296,14 @@ function Gt({
|
|
|
1296
1296
|
"hover:[&::-webkit-scrollbar-thumb]:bg-slate-300",
|
|
1297
1297
|
o
|
|
1298
1298
|
),
|
|
1299
|
-
children: /* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-slate-100", children: /* @__PURE__ */
|
|
1299
|
+
children: /* @__PURE__ */ c("div", { className: "inline-block min-w-full align-middle", children: [
|
|
1300
|
+
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-slate-100", children: /* @__PURE__ */ c("table", { className: "w-full table-fixed", children: [
|
|
1301
1301
|
E(),
|
|
1302
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
1303
|
-
|
|
1302
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
1303
|
+
k && /* @__PURE__ */ e("th", { className: n("w-12 px-4 py-3", C), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
1304
1304
|
ke,
|
|
1305
1305
|
{
|
|
1306
|
-
checked:
|
|
1306
|
+
checked: j,
|
|
1307
1307
|
onChange: p,
|
|
1308
1308
|
variant: "yellow",
|
|
1309
1309
|
disabled: r || b.length === 0
|
|
@@ -1320,7 +1320,7 @@ function Gt({
|
|
|
1320
1320
|
h.sortable && "cursor-pointer hover:bg-slate-200",
|
|
1321
1321
|
C
|
|
1322
1322
|
),
|
|
1323
|
-
children: /* @__PURE__ */
|
|
1323
|
+
children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1324
1324
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", title: h.title, children: h.title }),
|
|
1325
1325
|
S(h)
|
|
1326
1326
|
] })
|
|
@@ -1329,12 +1329,12 @@ function Gt({
|
|
|
1329
1329
|
))
|
|
1330
1330
|
] }) })
|
|
1331
1331
|
] }) }),
|
|
1332
|
-
/* @__PURE__ */ e("div", { className: "rounded-xl border border-t-0 border-slate-200 bg-white overflow-hidden", children: /* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ e("div", { className: "rounded-xl border border-t-0 border-slate-200 bg-white overflow-hidden", children: /* @__PURE__ */ c("table", { className: "w-full table-fixed", children: [
|
|
1333
1333
|
E(),
|
|
1334
|
-
/* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-200", children: r ? Array.from({ length: l }).map((h, F) => /* @__PURE__ */
|
|
1335
|
-
|
|
1336
|
-
t.map((
|
|
1337
|
-
] }, F)) : b.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length + (
|
|
1334
|
+
/* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-200", children: r ? Array.from({ length: l }).map((h, F) => /* @__PURE__ */ c("tr", { children: [
|
|
1335
|
+
k && /* @__PURE__ */ e("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ e(Te, { height: 20, width: 20, variant: "rounded" }) }),
|
|
1336
|
+
t.map((T) => /* @__PURE__ */ e("td", { className: "px-4 py-3", children: /* @__PURE__ */ e(Te, { height: 30, variant: "rounded" }) }, T.key))
|
|
1337
|
+
] }, F)) : b.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length + (k ? 1 : 0), className: "py-20", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center", children: [
|
|
1338
1338
|
/* @__PURE__ */ e("div", { className: "relative mb-4", children: /* @__PURE__ */ e(
|
|
1339
1339
|
nt,
|
|
1340
1340
|
{
|
|
@@ -1345,15 +1345,15 @@ function Gt({
|
|
|
1345
1345
|
) }),
|
|
1346
1346
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-slate-400", children: m })
|
|
1347
1347
|
] }) }) }) : b.map((h, F) => {
|
|
1348
|
-
const
|
|
1349
|
-
return /* @__PURE__ */
|
|
1350
|
-
|
|
1348
|
+
const T = h[M], B = k?.selectedRowKeys.includes(T), H = k?.getCheckboxProps?.(h)?.disabled;
|
|
1349
|
+
return /* @__PURE__ */ c("tr", { className: n("group transition-colors hover:bg-slate-50"), children: [
|
|
1350
|
+
k && /* @__PURE__ */ e("td", { className: n("w-12 px-4 py-3 align-top", y), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center pt-1", children: /* @__PURE__ */ e(
|
|
1351
1351
|
ke,
|
|
1352
1352
|
{
|
|
1353
1353
|
checked: B,
|
|
1354
1354
|
disabled: H,
|
|
1355
1355
|
variant: "yellow",
|
|
1356
|
-
onChange: (W) =>
|
|
1356
|
+
onChange: (W) => v(h, W.target.checked)
|
|
1357
1357
|
}
|
|
1358
1358
|
) }) }),
|
|
1359
1359
|
t.map((W) => {
|
|
@@ -1466,19 +1466,19 @@ const Et = {
|
|
|
1466
1466
|
maxSize: r = 10,
|
|
1467
1467
|
maxFiles: l = 5,
|
|
1468
1468
|
disabled: m = !1,
|
|
1469
|
-
label:
|
|
1469
|
+
label: u,
|
|
1470
1470
|
required: s = !1,
|
|
1471
1471
|
error: o,
|
|
1472
1472
|
className: C,
|
|
1473
1473
|
onFilesChange: y,
|
|
1474
|
-
onUpload:
|
|
1475
|
-
showPreview:
|
|
1476
|
-
locale:
|
|
1477
|
-
showFileTypeIcon:
|
|
1478
|
-
variant:
|
|
1479
|
-
customValidator:
|
|
1474
|
+
onUpload: M,
|
|
1475
|
+
showPreview: k = !0,
|
|
1476
|
+
locale: L = "uz",
|
|
1477
|
+
showFileTypeIcon: I = !0,
|
|
1478
|
+
variant: w = "yellow",
|
|
1479
|
+
customValidator: d
|
|
1480
1480
|
}) => {
|
|
1481
|
-
const [
|
|
1481
|
+
const [i, x] = Y([]), [b, p] = Y(!1), [v, j] = Y(!1), S = se(null), E = Et[L], h = w === "blue" ? {
|
|
1482
1482
|
dropBorder: "border-blue-200 hover:border-blue-300",
|
|
1483
1483
|
dropBg: "bg-blue-50/40 hover:bg-blue-50/60",
|
|
1484
1484
|
dropActive: "border-blue-600 bg-blue-50",
|
|
@@ -1509,67 +1509,67 @@ const Et = {
|
|
|
1509
1509
|
default:
|
|
1510
1510
|
return N.type.includes("pdf") ? /* @__PURE__ */ e(Me, { className: "h-5 w-5 text-red-500" }) : N.type.includes("word") || N.type.includes("document") ? /* @__PURE__ */ e(Me, { className: "h-5 w-5 text-blue-600" }) : N.type.includes("excel") || N.type.includes("spreadsheet") ? /* @__PURE__ */ e(Me, { className: "h-5 w-5 text-green-600" }) : /* @__PURE__ */ e(je, { className: "h-5 w-5 text-gray-500" });
|
|
1511
1511
|
}
|
|
1512
|
-
},
|
|
1512
|
+
}, T = (N) => {
|
|
1513
1513
|
if (N === 0) return "0 Bytes";
|
|
1514
|
-
const D = 1024,
|
|
1515
|
-
return parseFloat((N / Math.pow(D,
|
|
1514
|
+
const D = 1024, R = ["Bytes", "KB", "MB", "GB"], $ = Math.floor(Math.log(N) / Math.log(D));
|
|
1515
|
+
return parseFloat((N / Math.pow(D, $)).toFixed(2)) + " " + R[$];
|
|
1516
1516
|
}, B = (N) => {
|
|
1517
1517
|
const D = r * 1024 * 1024;
|
|
1518
1518
|
return N.size <= D;
|
|
1519
|
-
}, H = (N) => a === "*/*" ? !0 : a.split(",").map((
|
|
1520
|
-
if (
|
|
1521
|
-
const
|
|
1522
|
-
return N.type.startsWith(
|
|
1519
|
+
}, H = (N) => a === "*/*" ? !0 : a.split(",").map((R) => R.trim()).some((R) => {
|
|
1520
|
+
if (R.endsWith("/*")) {
|
|
1521
|
+
const $ = R.replace("/*", "");
|
|
1522
|
+
return N.type.startsWith($);
|
|
1523
1523
|
}
|
|
1524
|
-
return N.type ===
|
|
1524
|
+
return N.type === R || N.name.toLowerCase().endsWith(R.replace("*.", "."));
|
|
1525
1525
|
}), W = (N) => new Promise((D) => {
|
|
1526
1526
|
if (N.type.startsWith("image/")) {
|
|
1527
|
-
const
|
|
1528
|
-
|
|
1527
|
+
const R = new FileReader();
|
|
1528
|
+
R.onload = ($) => D($.target?.result), R.readAsDataURL(N);
|
|
1529
1529
|
} else
|
|
1530
1530
|
D("");
|
|
1531
1531
|
}), U = z(
|
|
1532
1532
|
async (N) => {
|
|
1533
|
-
const D = Array.from(N),
|
|
1534
|
-
for (const
|
|
1535
|
-
if (
|
|
1533
|
+
const D = Array.from(N), R = [];
|
|
1534
|
+
for (const $ of D) {
|
|
1535
|
+
if (i.length + R.length >= l) {
|
|
1536
1536
|
alert(E.maxFilesError(l));
|
|
1537
1537
|
break;
|
|
1538
1538
|
}
|
|
1539
|
-
if (!B(
|
|
1540
|
-
alert(E.fileSizeError(
|
|
1539
|
+
if (!B($)) {
|
|
1540
|
+
alert(E.fileSizeError($.name, r));
|
|
1541
1541
|
continue;
|
|
1542
1542
|
}
|
|
1543
|
-
if (!H(
|
|
1544
|
-
alert(E.fileTypeError(
|
|
1543
|
+
if (!H($)) {
|
|
1544
|
+
alert(E.fileTypeError($.name));
|
|
1545
1545
|
continue;
|
|
1546
1546
|
}
|
|
1547
|
-
if (
|
|
1548
|
-
const ue =
|
|
1547
|
+
if (d) {
|
|
1548
|
+
const ue = d($);
|
|
1549
1549
|
if (ue) {
|
|
1550
1550
|
alert(ue);
|
|
1551
1551
|
continue;
|
|
1552
1552
|
}
|
|
1553
1553
|
}
|
|
1554
|
-
const Z = await W(
|
|
1555
|
-
|
|
1554
|
+
const Z = await W($), q = M ? "uploading" : "success", G = M ? 0 : 100;
|
|
1555
|
+
R.push({
|
|
1556
1556
|
id: Math.random().toString(36).substr(2, 9),
|
|
1557
|
-
file:
|
|
1557
|
+
file: $,
|
|
1558
1558
|
preview: Z,
|
|
1559
1559
|
progress: G,
|
|
1560
1560
|
status: q
|
|
1561
1561
|
});
|
|
1562
1562
|
}
|
|
1563
|
-
if (
|
|
1564
|
-
const
|
|
1565
|
-
if (x(
|
|
1566
|
-
|
|
1563
|
+
if (R.length > 0) {
|
|
1564
|
+
const $ = t ? [...i, ...R] : R;
|
|
1565
|
+
if (x($), y?.($.map((Z) => Z.file)), M) {
|
|
1566
|
+
j(!0);
|
|
1567
1567
|
try {
|
|
1568
|
-
const Z =
|
|
1568
|
+
const Z = $.map((q, G) => ({
|
|
1569
1569
|
...q,
|
|
1570
|
-
progress: Math.min(100, (G + 1) /
|
|
1570
|
+
progress: Math.min(100, (G + 1) / $.length * 100)
|
|
1571
1571
|
}));
|
|
1572
|
-
x(Z), await
|
|
1572
|
+
x(Z), await M(Z), x(
|
|
1573
1573
|
(q) => q.map((G) => ({
|
|
1574
1574
|
...G,
|
|
1575
1575
|
status: "success",
|
|
@@ -1585,22 +1585,22 @@ const Et = {
|
|
|
1585
1585
|
}))
|
|
1586
1586
|
);
|
|
1587
1587
|
} finally {
|
|
1588
|
-
|
|
1588
|
+
j(!1);
|
|
1589
1589
|
}
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
1592
|
},
|
|
1593
1593
|
[
|
|
1594
|
-
|
|
1594
|
+
i,
|
|
1595
1595
|
l,
|
|
1596
1596
|
B,
|
|
1597
1597
|
H,
|
|
1598
|
-
|
|
1598
|
+
d,
|
|
1599
1599
|
E,
|
|
1600
1600
|
r,
|
|
1601
1601
|
t,
|
|
1602
1602
|
y,
|
|
1603
|
-
|
|
1603
|
+
M
|
|
1604
1604
|
]
|
|
1605
1605
|
), K = z(
|
|
1606
1606
|
(N) => {
|
|
@@ -1625,8 +1625,8 @@ const Et = {
|
|
|
1625
1625
|
), le = z(
|
|
1626
1626
|
(N) => {
|
|
1627
1627
|
x((D) => {
|
|
1628
|
-
const
|
|
1629
|
-
return y?.(
|
|
1628
|
+
const R = D.filter(($) => $.id !== N);
|
|
1629
|
+
return y?.(R.map(($) => $.file)), R;
|
|
1630
1630
|
});
|
|
1631
1631
|
},
|
|
1632
1632
|
[y]
|
|
@@ -1635,8 +1635,8 @@ const Et = {
|
|
|
1635
1635
|
}, [y]), Q = z(() => {
|
|
1636
1636
|
S.current?.click();
|
|
1637
1637
|
}, []);
|
|
1638
|
-
return /* @__PURE__ */
|
|
1639
|
-
|
|
1638
|
+
return /* @__PURE__ */ c("div", { className: n("w-full", C), children: [
|
|
1639
|
+
u && /* @__PURE__ */ c(
|
|
1640
1640
|
"label",
|
|
1641
1641
|
{
|
|
1642
1642
|
className: n(
|
|
@@ -1644,12 +1644,12 @@ const Et = {
|
|
|
1644
1644
|
o ? "text-red-600" : "text-slate-700"
|
|
1645
1645
|
),
|
|
1646
1646
|
children: [
|
|
1647
|
-
|
|
1647
|
+
u,
|
|
1648
1648
|
s && /* @__PURE__ */ e("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
|
|
1649
1649
|
]
|
|
1650
1650
|
}
|
|
1651
1651
|
),
|
|
1652
|
-
/* @__PURE__ */
|
|
1652
|
+
/* @__PURE__ */ c(
|
|
1653
1653
|
"div",
|
|
1654
1654
|
{
|
|
1655
1655
|
className: n(
|
|
@@ -1677,7 +1677,7 @@ const Et = {
|
|
|
1677
1677
|
className: "hidden"
|
|
1678
1678
|
}
|
|
1679
1679
|
),
|
|
1680
|
-
/* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-3", children: [
|
|
1681
1681
|
/* @__PURE__ */ e("div", { className: n("flex h-12 w-12 items-center justify-center rounded-xl", h.iconWrap), children: /* @__PURE__ */ e(ot, { size: 20 }) }),
|
|
1682
1682
|
/* @__PURE__ */ e("p", { className: n("text-base font-medium", h.title), children: E.dropHereTitle }),
|
|
1683
1683
|
/* @__PURE__ */ e("p", { className: n("text-sm font-normal", h.hint), children: E.fileRequirements(t, l, r, a) })
|
|
@@ -1685,28 +1685,28 @@ const Et = {
|
|
|
1685
1685
|
]
|
|
1686
1686
|
}
|
|
1687
1687
|
),
|
|
1688
|
-
|
|
1689
|
-
/* @__PURE__ */
|
|
1690
|
-
/* @__PURE__ */
|
|
1688
|
+
i.length > 0 && /* @__PURE__ */ c("div", { className: "mt-4 space-y-3", children: [
|
|
1689
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
|
|
1690
|
+
/* @__PURE__ */ c("span", { className: "text-sm font-medium text-slate-700", children: [
|
|
1691
1691
|
E.selectedFiles,
|
|
1692
1692
|
" (",
|
|
1693
|
-
|
|
1693
|
+
i.length,
|
|
1694
1694
|
")"
|
|
1695
1695
|
] }),
|
|
1696
|
-
|
|
1696
|
+
i.length > 1 && /* @__PURE__ */ e(
|
|
1697
1697
|
"button",
|
|
1698
1698
|
{
|
|
1699
1699
|
type: "button",
|
|
1700
1700
|
onClick: ie,
|
|
1701
|
-
disabled: m ||
|
|
1701
|
+
disabled: m || v,
|
|
1702
1702
|
className: "text-sm font-medium text-red-600 disabled:opacity-50",
|
|
1703
1703
|
children: E.clearAll
|
|
1704
1704
|
}
|
|
1705
1705
|
)
|
|
1706
1706
|
] }),
|
|
1707
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
1708
|
-
const
|
|
1709
|
-
return /* @__PURE__ */
|
|
1707
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: i.map((N) => {
|
|
1708
|
+
const R = !!N.preview ? h.fileIconImg : h.fileIconDoc;
|
|
1709
|
+
return /* @__PURE__ */ c(
|
|
1710
1710
|
"div",
|
|
1711
1711
|
{
|
|
1712
1712
|
className: n(
|
|
@@ -1714,27 +1714,27 @@ const Et = {
|
|
|
1714
1714
|
N.status === "error" && "border-red-600"
|
|
1715
1715
|
),
|
|
1716
1716
|
children: [
|
|
1717
|
-
/* @__PURE__ */
|
|
1718
|
-
/* @__PURE__ */ e("div", { className: n("flex h-14 w-14 items-center justify-center rounded-2xl",
|
|
1717
|
+
/* @__PURE__ */ c("div", { className: "flex min-w-0 items-center gap-4", children: [
|
|
1718
|
+
/* @__PURE__ */ e("div", { className: n("flex h-14 w-14 items-center justify-center rounded-2xl", R), children: k && N.preview ? /* @__PURE__ */ e(
|
|
1719
1719
|
"img",
|
|
1720
1720
|
{
|
|
1721
1721
|
src: N.preview,
|
|
1722
1722
|
alt: N.file.name,
|
|
1723
1723
|
className: "h-10 w-10 rounded-xl object-cover"
|
|
1724
1724
|
}
|
|
1725
|
-
) :
|
|
1726
|
-
/* @__PURE__ */
|
|
1725
|
+
) : I ? F(N.file) : /* @__PURE__ */ e(je, { className: "h-6 w-6 text-slate-500" }) }),
|
|
1726
|
+
/* @__PURE__ */ c("div", { className: "min-w-0", children: [
|
|
1727
1727
|
/* @__PURE__ */ e("p", { className: "truncate text-lg font-semibold text-primary", children: N.file.name }),
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
/* @__PURE__ */ e("span", { children:
|
|
1730
|
-
N.status === "uploading" && /* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ c("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-sm text-slate-500", children: [
|
|
1729
|
+
/* @__PURE__ */ e("span", { children: T(N.file.size) }),
|
|
1730
|
+
N.status === "uploading" && /* @__PURE__ */ c(he, { children: [
|
|
1731
1731
|
/* @__PURE__ */ e("span", { children: "•" }),
|
|
1732
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ c("span", { className: "inline-flex items-center", children: [
|
|
1733
1733
|
/* @__PURE__ */ e(Be, { className: "mr-1 h-5 w-5 animate-spin" }),
|
|
1734
1734
|
E.uploading
|
|
1735
1735
|
] })
|
|
1736
1736
|
] }),
|
|
1737
|
-
N.status === "success" && /* @__PURE__ */
|
|
1737
|
+
N.status === "success" && /* @__PURE__ */ c(he, { children: [
|
|
1738
1738
|
/* @__PURE__ */ e("span", { children: "•" }),
|
|
1739
1739
|
/* @__PURE__ */ e("span", { className: "font-normal text-green-600", children: E.success })
|
|
1740
1740
|
] })
|
|
@@ -1749,12 +1749,12 @@ const Et = {
|
|
|
1749
1749
|
N.status === "error" && N.error && /* @__PURE__ */ e("p", { className: "mt-2 text-sm font-normal text-red-600", children: N.error })
|
|
1750
1750
|
] })
|
|
1751
1751
|
] }),
|
|
1752
|
-
/* @__PURE__ */
|
|
1752
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1753
1753
|
/* @__PURE__ */ e(
|
|
1754
1754
|
"button",
|
|
1755
1755
|
{
|
|
1756
1756
|
type: "button",
|
|
1757
|
-
onClick: (
|
|
1757
|
+
onClick: ($) => $.stopPropagation(),
|
|
1758
1758
|
className: "rounded-xl p-2 hover:bg-slate-100 hover:cursor-pointer",
|
|
1759
1759
|
title: E.preview,
|
|
1760
1760
|
children: /* @__PURE__ */ e(Pe, { size: 20, className: "text-slate-400" })
|
|
@@ -1764,7 +1764,7 @@ const Et = {
|
|
|
1764
1764
|
"button",
|
|
1765
1765
|
{
|
|
1766
1766
|
type: "button",
|
|
1767
|
-
onClick: (
|
|
1767
|
+
onClick: ($) => $.stopPropagation(),
|
|
1768
1768
|
className: "rounded-xl p-2 hover:bg-slate-100 hover:cursor-pointer",
|
|
1769
1769
|
title: E.download,
|
|
1770
1770
|
children: /* @__PURE__ */ e(it, { size: 20, className: "text-slate-400" })
|
|
@@ -1774,10 +1774,10 @@ const Et = {
|
|
|
1774
1774
|
"button",
|
|
1775
1775
|
{
|
|
1776
1776
|
type: "button",
|
|
1777
|
-
onClick: (
|
|
1778
|
-
|
|
1777
|
+
onClick: ($) => {
|
|
1778
|
+
$.stopPropagation(), le(N.id);
|
|
1779
1779
|
},
|
|
1780
|
-
disabled: m ||
|
|
1780
|
+
disabled: m || v,
|
|
1781
1781
|
className: "rounded-xl p-2 text-slate-base hover:bg-slate-100 disabled:opacity-50 hover:cursor-pointer",
|
|
1782
1782
|
title: E.remove,
|
|
1783
1783
|
children: /* @__PURE__ */ e(me, { className: "h-6 w-6" })
|
|
@@ -1799,48 +1799,78 @@ function Qt({
|
|
|
1799
1799
|
title: r,
|
|
1800
1800
|
description: l,
|
|
1801
1801
|
Header: m,
|
|
1802
|
-
Body:
|
|
1802
|
+
Body: u,
|
|
1803
1803
|
footer: s,
|
|
1804
|
-
handleClickOutside: o = !1
|
|
1804
|
+
handleClickOutside: o = !1,
|
|
1805
|
+
showCloseIcon: C = !0,
|
|
1806
|
+
showHeader: y = !0,
|
|
1807
|
+
overlayClassName: M,
|
|
1808
|
+
containerClassName: k,
|
|
1809
|
+
bodyClassName: L,
|
|
1810
|
+
footerClassName: I
|
|
1805
1811
|
}) {
|
|
1806
|
-
const
|
|
1807
|
-
J(() => (t ? (document.addEventListener("keydown",
|
|
1808
|
-
const { handleClick:
|
|
1812
|
+
const w = se(null), { handleEscape: d } = Ae(() => a(!1));
|
|
1813
|
+
J(() => (t ? (document.addEventListener("keydown", d), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => document.removeEventListener("keydown", d)), [t, d]);
|
|
1814
|
+
const { handleClick: i } = Ce(w, () => {
|
|
1809
1815
|
o && a(!1);
|
|
1810
1816
|
});
|
|
1811
|
-
|
|
1817
|
+
J(() => (t && o && document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i)), [t, i, o]);
|
|
1818
|
+
const b = y && !!(m || r || l);
|
|
1819
|
+
return /* @__PURE__ */ e(
|
|
1812
1820
|
"div",
|
|
1813
1821
|
{
|
|
1814
1822
|
className: n(
|
|
1815
1823
|
"bg-black/40 fixed inset-0 z-50 flex items-center justify-center transition-all duration-500 ease-in-out",
|
|
1816
|
-
t ? "opacity-100" : "pointer-events-none opacity-0"
|
|
1824
|
+
t ? "opacity-100" : "pointer-events-none opacity-0",
|
|
1825
|
+
M
|
|
1817
1826
|
),
|
|
1818
|
-
children: /* @__PURE__ */
|
|
1827
|
+
children: /* @__PURE__ */ c(
|
|
1819
1828
|
"div",
|
|
1820
1829
|
{
|
|
1821
|
-
ref:
|
|
1830
|
+
ref: w,
|
|
1822
1831
|
className: n(
|
|
1823
1832
|
"relative bg-white w-full max-w-[720px] rounded-2xl",
|
|
1824
1833
|
"transform transition-all duration-500 ease-out",
|
|
1825
|
-
t ? "scale-100 opacity-100" : "scale-90 opacity-0"
|
|
1834
|
+
t ? "scale-100 opacity-100" : "scale-90 opacity-0",
|
|
1835
|
+
k
|
|
1826
1836
|
),
|
|
1827
1837
|
children: [
|
|
1828
|
-
|
|
1829
|
-
m || /* @__PURE__ */
|
|
1838
|
+
b && /* @__PURE__ */ c("div", { className: "border-b border-slate-200 flex items-start justify-between p-6 mb-4", children: [
|
|
1839
|
+
m || /* @__PURE__ */ c("div", { className: "block", children: [
|
|
1830
1840
|
/* @__PURE__ */ e("h2", { className: "text-h3 font-semibold text-black", children: r }),
|
|
1831
1841
|
l && /* @__PURE__ */ e("p", { className: "text-base text-slate-base font-normal mt-2", children: l })
|
|
1832
1842
|
] }),
|
|
1833
|
-
/* @__PURE__ */ e(
|
|
1843
|
+
C && /* @__PURE__ */ e(
|
|
1834
1844
|
"button",
|
|
1835
1845
|
{
|
|
1836
1846
|
onClick: () => a(!1),
|
|
1837
1847
|
className: "bg-slate-100 rounded-xl w-12 h-12 hover:cursor-pointer text-black transition flex items-center justify-center group",
|
|
1848
|
+
"aria-label": "Close modal",
|
|
1849
|
+
type: "button",
|
|
1838
1850
|
children: /* @__PURE__ */ e(me, { className: "h-6 w-6 transition-transform duration-300 group-hover:rotate-180" })
|
|
1839
1851
|
}
|
|
1840
1852
|
)
|
|
1841
1853
|
] }),
|
|
1842
|
-
|
|
1843
|
-
|
|
1854
|
+
u && /* @__PURE__ */ e(
|
|
1855
|
+
"div",
|
|
1856
|
+
{
|
|
1857
|
+
className: n(
|
|
1858
|
+
"scrollbar-thin scrollbar-thumb-slate-200 max-h-96 px-6 overflow-y-auto mb-2",
|
|
1859
|
+
L
|
|
1860
|
+
),
|
|
1861
|
+
children: u
|
|
1862
|
+
}
|
|
1863
|
+
),
|
|
1864
|
+
s && /* @__PURE__ */ e(
|
|
1865
|
+
"div",
|
|
1866
|
+
{
|
|
1867
|
+
className: n(
|
|
1868
|
+
"flex items-center justify-end gap-3 border-t border-slate-200 p-6",
|
|
1869
|
+
I
|
|
1870
|
+
),
|
|
1871
|
+
children: s
|
|
1872
|
+
}
|
|
1873
|
+
)
|
|
1844
1874
|
]
|
|
1845
1875
|
}
|
|
1846
1876
|
)
|
|
@@ -1853,23 +1883,23 @@ function er({
|
|
|
1853
1883
|
perPage: r,
|
|
1854
1884
|
onPageChange: l,
|
|
1855
1885
|
onPerPageChange: m,
|
|
1856
|
-
siblingCount:
|
|
1886
|
+
siblingCount: u = 1,
|
|
1857
1887
|
perPageOptions: s = [10, 30, 50, 100],
|
|
1858
1888
|
showPerPage: o = !0,
|
|
1859
1889
|
variant: C = "yellow",
|
|
1860
1890
|
size: y = "large",
|
|
1861
|
-
paginationClassName:
|
|
1891
|
+
paginationClassName: M
|
|
1862
1892
|
}) {
|
|
1863
|
-
const
|
|
1864
|
-
if (
|
|
1865
|
-
const
|
|
1866
|
-
const p = [],
|
|
1867
|
-
if (
|
|
1868
|
-
return Array.from({ length:
|
|
1869
|
-
const
|
|
1870
|
-
p.push(1),
|
|
1871
|
-
for (let E =
|
|
1872
|
-
return S <
|
|
1893
|
+
const k = Number.isFinite(t) && t > 0 ? t : 0, L = Number.isFinite(r) && r > 0 ? r : 10, I = Math.max(1, Number.isFinite(a) ? a : 1), w = Math.ceil(k / L);
|
|
1894
|
+
if (w <= 1 || k === 0) return null;
|
|
1895
|
+
const i = (() => {
|
|
1896
|
+
const p = [], v = u * 2 + 5;
|
|
1897
|
+
if (w <= v)
|
|
1898
|
+
return Array.from({ length: w }, (E, h) => h + 1);
|
|
1899
|
+
const j = Math.max(I - u, 2), S = Math.min(I + u, w - 1);
|
|
1900
|
+
p.push(1), j > 2 && p.push("...");
|
|
1901
|
+
for (let E = j; E <= S; E++) p.push(E);
|
|
1902
|
+
return S < w - 1 && p.push("..."), w > 1 && p.push(w), p;
|
|
1873
1903
|
})(), x = {
|
|
1874
1904
|
medium: "h-9 text-sm",
|
|
1875
1905
|
large: "h-10 text-base"
|
|
@@ -1887,11 +1917,11 @@ function er({
|
|
|
1887
1917
|
arrow: "text-black"
|
|
1888
1918
|
}
|
|
1889
1919
|
}[C ?? "yellow"];
|
|
1890
|
-
return /* @__PURE__ */
|
|
1920
|
+
return /* @__PURE__ */ c("div", { className: n(
|
|
1891
1921
|
"flex items-center justify-between gap-4 w-full",
|
|
1892
|
-
|
|
1922
|
+
M
|
|
1893
1923
|
), children: [
|
|
1894
|
-
o && m && /* @__PURE__ */
|
|
1924
|
+
o && m && /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1895
1925
|
/* @__PURE__ */ e(
|
|
1896
1926
|
"span",
|
|
1897
1927
|
{
|
|
@@ -1899,11 +1929,11 @@ function er({
|
|
|
1899
1929
|
children: "Строк на странице:"
|
|
1900
1930
|
}
|
|
1901
1931
|
),
|
|
1902
|
-
/* @__PURE__ */
|
|
1932
|
+
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
1903
1933
|
/* @__PURE__ */ e(
|
|
1904
1934
|
"select",
|
|
1905
1935
|
{
|
|
1906
|
-
value:
|
|
1936
|
+
value: L,
|
|
1907
1937
|
onChange: (p) => m(Number(p.target.value)),
|
|
1908
1938
|
className: n(
|
|
1909
1939
|
"appearance-none bg-white border border-slate-200 rounded-lg pl-3 pr-8 text-base text-black font-medium focus:outline-none cursor-pointer",
|
|
@@ -1923,22 +1953,22 @@ function er({
|
|
|
1923
1953
|
)
|
|
1924
1954
|
] })
|
|
1925
1955
|
] }),
|
|
1926
|
-
/* @__PURE__ */
|
|
1956
|
+
/* @__PURE__ */ c("nav", { "aria-label": "Пагинация", className: "flex items-center gap-1 shrink-0 whitespace-nowrap", children: [
|
|
1927
1957
|
/* @__PURE__ */ e(
|
|
1928
1958
|
"button",
|
|
1929
1959
|
{
|
|
1930
|
-
onClick: () => l(
|
|
1931
|
-
disabled:
|
|
1960
|
+
onClick: () => l(I - 1),
|
|
1961
|
+
disabled: I === 1,
|
|
1932
1962
|
"aria-label": "Предыдущая страница",
|
|
1933
1963
|
className: n(
|
|
1934
1964
|
"flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
|
|
1935
1965
|
x,
|
|
1936
|
-
|
|
1966
|
+
I === 1 ? n("cursor-not-allowed opacity-50", b.disabled) : n("hover:cursor-pointer", b.arrow, "border-slate-200")
|
|
1937
1967
|
),
|
|
1938
1968
|
children: /* @__PURE__ */ e(ye, { weight: "Linear", size: 20 })
|
|
1939
1969
|
}
|
|
1940
1970
|
),
|
|
1941
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children:
|
|
1971
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: i.map((p, v) => {
|
|
1942
1972
|
if (p === "...")
|
|
1943
1973
|
return /* @__PURE__ */ e(
|
|
1944
1974
|
"span",
|
|
@@ -1947,35 +1977,35 @@ function er({
|
|
|
1947
1977
|
"aria-hidden": "true",
|
|
1948
1978
|
children: /* @__PURE__ */ e(ht, { weight: "Bold", size: 20 })
|
|
1949
1979
|
},
|
|
1950
|
-
|
|
1980
|
+
v
|
|
1951
1981
|
);
|
|
1952
|
-
const
|
|
1982
|
+
const j = p === I;
|
|
1953
1983
|
return /* @__PURE__ */ e(
|
|
1954
1984
|
"button",
|
|
1955
1985
|
{
|
|
1956
1986
|
onClick: () => l(p),
|
|
1957
|
-
"aria-label": `Страница ${p}${
|
|
1958
|
-
"aria-current":
|
|
1987
|
+
"aria-label": `Страница ${p}${j ? ", текущая" : ""}`,
|
|
1988
|
+
"aria-current": j ? "page" : void 0,
|
|
1959
1989
|
className: n(
|
|
1960
1990
|
"flex items-center justify-center rounded-lg border font-medium transition-all hover:cursor-pointer min-w-10 px-2",
|
|
1961
1991
|
x,
|
|
1962
|
-
|
|
1992
|
+
j ? b.active : b.inactive
|
|
1963
1993
|
),
|
|
1964
1994
|
children: p
|
|
1965
1995
|
},
|
|
1966
|
-
|
|
1996
|
+
v
|
|
1967
1997
|
);
|
|
1968
1998
|
}) }),
|
|
1969
1999
|
/* @__PURE__ */ e(
|
|
1970
2000
|
"button",
|
|
1971
2001
|
{
|
|
1972
|
-
onClick: () => l(
|
|
1973
|
-
disabled:
|
|
2002
|
+
onClick: () => l(I + 1),
|
|
2003
|
+
disabled: I === w,
|
|
1974
2004
|
"aria-label": "Следующая страница",
|
|
1975
2005
|
className: n(
|
|
1976
2006
|
"flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
|
|
1977
2007
|
x,
|
|
1978
|
-
|
|
2008
|
+
I === w ? n("cursor-not-allowed opacity-50", b.disabled) : n("hover:cursor-pointer", b.arrow, "border-slate-200")
|
|
1979
2009
|
),
|
|
1980
2010
|
children: /* @__PURE__ */ e(ge, { size: 20, weight: "Linear" })
|
|
1981
2011
|
}
|
|
@@ -2013,18 +2043,18 @@ function tr({
|
|
|
2013
2043
|
position: r = "top",
|
|
2014
2044
|
className: l,
|
|
2015
2045
|
tabListClassName: m,
|
|
2016
|
-
contentClassName:
|
|
2046
|
+
contentClassName: u,
|
|
2017
2047
|
extra: s,
|
|
2018
2048
|
onChange: o
|
|
2019
2049
|
}) {
|
|
2020
|
-
const [C, y] = Y(a || t[0]?.id), [
|
|
2050
|
+
const [C, y] = Y(a || t[0]?.id), [M, k] = Y({}), L = se([]), I = () => {
|
|
2021
2051
|
requestAnimationFrame(() => {
|
|
2022
|
-
const b = t.findIndex((
|
|
2052
|
+
const b = t.findIndex((v) => v?.id === C), p = L.current[b];
|
|
2023
2053
|
if (p) {
|
|
2024
|
-
const { offsetLeft:
|
|
2025
|
-
|
|
2026
|
-
left: `${
|
|
2027
|
-
top: `${
|
|
2054
|
+
const { offsetLeft: v, offsetTop: j, offsetWidth: S, offsetHeight: E } = p;
|
|
2055
|
+
k({
|
|
2056
|
+
left: `${v}px`,
|
|
2057
|
+
top: `${j}px`,
|
|
2028
2058
|
width: `${S}px`,
|
|
2029
2059
|
height: `${E}px`,
|
|
2030
2060
|
transition: "all 0.35s cubic-bezier(0.25, 1, 0.5, 1)"
|
|
@@ -2032,15 +2062,15 @@ function tr({
|
|
|
2032
2062
|
}
|
|
2033
2063
|
});
|
|
2034
2064
|
};
|
|
2035
|
-
J(() => (
|
|
2036
|
-
|
|
2065
|
+
J(() => (I(), window.addEventListener("resize", I), "fonts" in document && document.fonts.ready.then(I), () => window.removeEventListener("resize", I)), [C, r, t]), J(() => {
|
|
2066
|
+
L.current = L.current.slice(0, t.length);
|
|
2037
2067
|
}, [t]);
|
|
2038
|
-
const
|
|
2068
|
+
const w = r === "left" || r === "right", d = {
|
|
2039
2069
|
top: "flex-col",
|
|
2040
2070
|
bottom: "flex-col-reverse",
|
|
2041
2071
|
left: "flex-row",
|
|
2042
2072
|
right: "flex-row-reverse"
|
|
2043
|
-
},
|
|
2073
|
+
}, i = {
|
|
2044
2074
|
top: "flex-row",
|
|
2045
2075
|
bottom: "flex-row",
|
|
2046
2076
|
left: "flex-col",
|
|
@@ -2051,13 +2081,13 @@ function tr({
|
|
|
2051
2081
|
left: "ml-4",
|
|
2052
2082
|
right: "mr-4"
|
|
2053
2083
|
};
|
|
2054
|
-
return /* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
2084
|
+
return /* @__PURE__ */ c("div", { className: n("flex w-full", d[r], l), children: [
|
|
2085
|
+
/* @__PURE__ */ c(
|
|
2056
2086
|
"div",
|
|
2057
2087
|
{
|
|
2058
2088
|
className: n(
|
|
2059
2089
|
"flex w-full gap-4",
|
|
2060
|
-
|
|
2090
|
+
w ? "flex-col items-start" : "flex-row flex-wrap items-center"
|
|
2061
2091
|
),
|
|
2062
2092
|
children: [
|
|
2063
2093
|
/* @__PURE__ */ e(
|
|
@@ -2065,46 +2095,45 @@ function tr({
|
|
|
2065
2095
|
{
|
|
2066
2096
|
className: n(
|
|
2067
2097
|
"flex-1",
|
|
2068
|
-
|
|
2098
|
+
w ? "w-full" : "min-w-[520px]"
|
|
2069
2099
|
),
|
|
2070
|
-
children: /* @__PURE__ */
|
|
2100
|
+
children: /* @__PURE__ */ c(
|
|
2071
2101
|
"div",
|
|
2072
2102
|
{
|
|
2073
2103
|
className: n(
|
|
2074
2104
|
"relative flex rounded-xl bg-slate-100 p-1",
|
|
2075
|
-
|
|
2076
|
-
!
|
|
2077
|
-
|
|
2105
|
+
i[r],
|
|
2106
|
+
!w && "w-full overflow-hidden",
|
|
2107
|
+
w ? "min-w-48" : "",
|
|
2078
2108
|
m
|
|
2079
2109
|
),
|
|
2080
2110
|
children: [
|
|
2081
2111
|
/* @__PURE__ */ e(
|
|
2082
2112
|
"div",
|
|
2083
2113
|
{
|
|
2084
|
-
className: n("absolute rounded-lg bg-white",
|
|
2085
|
-
style:
|
|
2114
|
+
className: n("absolute rounded-lg bg-white", w ? "w-full" : "h-full"),
|
|
2115
|
+
style: M
|
|
2086
2116
|
}
|
|
2087
2117
|
),
|
|
2088
2118
|
t?.map((b, p) => {
|
|
2089
|
-
const
|
|
2090
|
-
return /* @__PURE__ */
|
|
2119
|
+
const v = C === b.id;
|
|
2120
|
+
return /* @__PURE__ */ c(
|
|
2091
2121
|
"button",
|
|
2092
2122
|
{
|
|
2093
|
-
ref: (
|
|
2094
|
-
|
|
2123
|
+
ref: (j) => {
|
|
2124
|
+
L.current[p] = j;
|
|
2095
2125
|
},
|
|
2096
2126
|
onClick: () => {
|
|
2097
2127
|
b?.disabled || (y(b?.id), o?.(b?.id));
|
|
2098
2128
|
},
|
|
2099
2129
|
disabled: b?.disabled,
|
|
2100
2130
|
className: n(
|
|
2101
|
-
"relative z-10 flex items-center justify-center whitespace-nowrap px-3 py-2 text-base font-normal text-black transition-colors duration-300",
|
|
2131
|
+
"relative z-10 flex items-center justify-center whitespace-nowrap px-3 py-2 text-base font-normal text-black transition-colors duration-300 hover:cursor-pointer",
|
|
2102
2132
|
b?.disabled && "cursor-not-allowed opacity-50",
|
|
2103
|
-
|
|
2104
|
-
// ✅
|
|
2133
|
+
w ? "w-full justify-start" : "flex-1 min-w-0"
|
|
2105
2134
|
),
|
|
2106
2135
|
children: [
|
|
2107
|
-
b?.icon && /* @__PURE__ */ e("span", { className: n("shrink-0 transition-transform duration-200",
|
|
2136
|
+
b?.icon && /* @__PURE__ */ e("span", { className: n("shrink-0 transition-transform duration-200", v && "scale-110"), children: b?.icon }),
|
|
2108
2137
|
/* @__PURE__ */ e("span", { className: "relative z-10 truncate", title: b?.label, children: b?.label })
|
|
2109
2138
|
]
|
|
2110
2139
|
},
|
|
@@ -2121,7 +2150,7 @@ function tr({
|
|
|
2121
2150
|
{
|
|
2122
2151
|
className: n(
|
|
2123
2152
|
"shrink-0 ml-auto",
|
|
2124
|
-
|
|
2153
|
+
w ? "w-full" : "max-w-full"
|
|
2125
2154
|
),
|
|
2126
2155
|
children: /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center justify-end gap-2", children: s })
|
|
2127
2156
|
}
|
|
@@ -2129,14 +2158,14 @@ function tr({
|
|
|
2129
2158
|
]
|
|
2130
2159
|
}
|
|
2131
2160
|
),
|
|
2132
|
-
/* @__PURE__ */ e("div", { className: n("w-full flex-1 overflow-hidden", x[r],
|
|
2161
|
+
/* @__PURE__ */ e("div", { className: n("w-full flex-1 overflow-hidden", x[r], u), children: /* @__PURE__ */ e("div", { className: "animate-fade-in w-full", style: { animationDuration: "0.35s" }, children: t?.find((b) => b.id === C)?.content }, C) })
|
|
2133
2162
|
] });
|
|
2134
2163
|
}
|
|
2135
2164
|
const Lt = {
|
|
2136
2165
|
sm: "px-2 py-0.5",
|
|
2137
2166
|
md: "px-2 py-1",
|
|
2138
2167
|
lg: "px-3 py-2"
|
|
2139
|
-
},
|
|
2168
|
+
}, Re = {
|
|
2140
2169
|
sm: "w-3 h-3",
|
|
2141
2170
|
md: "w-3 h-3",
|
|
2142
2171
|
lg: "w-3 h-3"
|
|
@@ -2153,9 +2182,9 @@ function rr({
|
|
|
2153
2182
|
size: r = "lg",
|
|
2154
2183
|
icon: l,
|
|
2155
2184
|
iconPosition: m = "left",
|
|
2156
|
-
className:
|
|
2185
|
+
className: u
|
|
2157
2186
|
}) {
|
|
2158
|
-
return /* @__PURE__ */
|
|
2187
|
+
return /* @__PURE__ */ c(
|
|
2159
2188
|
"span",
|
|
2160
2189
|
{
|
|
2161
2190
|
className: n(
|
|
@@ -2163,12 +2192,12 @@ function rr({
|
|
|
2163
2192
|
Lt[r],
|
|
2164
2193
|
It[a],
|
|
2165
2194
|
l && "gap-[2px]",
|
|
2166
|
-
|
|
2195
|
+
u
|
|
2167
2196
|
),
|
|
2168
2197
|
children: [
|
|
2169
|
-
l && m === "left" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(
|
|
2198
|
+
l && m === "left" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(Re[r])}`, children: l }),
|
|
2170
2199
|
/* @__PURE__ */ e("span", { children: t }),
|
|
2171
|
-
l && m === "right" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(
|
|
2200
|
+
l && m === "right" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(Re[r])}`, children: l })
|
|
2172
2201
|
]
|
|
2173
2202
|
}
|
|
2174
2203
|
);
|
|
@@ -2180,15 +2209,15 @@ const jt = fe(
|
|
|
2180
2209
|
value: r = "",
|
|
2181
2210
|
onChange: l,
|
|
2182
2211
|
required: m = !1,
|
|
2183
|
-
disabled:
|
|
2212
|
+
disabled: u = !1,
|
|
2184
2213
|
error: s,
|
|
2185
2214
|
className: o,
|
|
2186
2215
|
rows: C = 4,
|
|
2187
2216
|
name: y
|
|
2188
|
-
},
|
|
2189
|
-
const
|
|
2190
|
-
return /* @__PURE__ */
|
|
2191
|
-
t && /* @__PURE__ */
|
|
2217
|
+
}, M) => {
|
|
2218
|
+
const k = _(() => s ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [s]);
|
|
2219
|
+
return /* @__PURE__ */ c("div", { className: n("relative w-full", o), children: [
|
|
2220
|
+
t && /* @__PURE__ */ c(
|
|
2192
2221
|
"label",
|
|
2193
2222
|
{
|
|
2194
2223
|
className: n(
|
|
@@ -2204,17 +2233,17 @@ const jt = fe(
|
|
|
2204
2233
|
/* @__PURE__ */ e(
|
|
2205
2234
|
"textarea",
|
|
2206
2235
|
{
|
|
2207
|
-
ref:
|
|
2236
|
+
ref: M,
|
|
2208
2237
|
name: y,
|
|
2209
2238
|
rows: C,
|
|
2210
2239
|
value: r,
|
|
2211
|
-
onChange: (
|
|
2212
|
-
disabled:
|
|
2240
|
+
onChange: (L) => l?.(L.target.value),
|
|
2241
|
+
disabled: u,
|
|
2213
2242
|
placeholder: a,
|
|
2214
2243
|
className: n(
|
|
2215
2244
|
"w-full resize-none rounded-xl border bg-white text-base font-normal transition-all duration-300 ease-in-out outline-none",
|
|
2216
2245
|
"p-3 disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
|
|
2217
|
-
|
|
2246
|
+
k
|
|
2218
2247
|
)
|
|
2219
2248
|
}
|
|
2220
2249
|
),
|
|
@@ -2227,19 +2256,19 @@ const Tt = (() => {
|
|
|
2227
2256
|
let t = document.getElementById("mci-toast-container");
|
|
2228
2257
|
return t || (t = document.createElement("div"), t.id = "mci-toast-container", t.className = "fixed top-4 right-4 z-[9999] flex flex-col gap-3 pointer-events-none", document.body.appendChild(t)), t;
|
|
2229
2258
|
})();
|
|
2230
|
-
let De = null,
|
|
2231
|
-
const Ne = [],
|
|
2259
|
+
let De = null, Rt = 0;
|
|
2260
|
+
const Ne = [], $e = () => {
|
|
2232
2261
|
De || (De = kt(Tt)), De.render(
|
|
2233
2262
|
/* @__PURE__ */ e("div", { className: "flex flex-col gap-3", children: Ne.map(({ id: t, element: a }) => /* @__PURE__ */ e("div", { className: "pointer-events-auto", children: a }, t)) })
|
|
2234
2263
|
);
|
|
2235
2264
|
};
|
|
2236
|
-
function
|
|
2265
|
+
function $t({
|
|
2237
2266
|
title: t,
|
|
2238
2267
|
description: a,
|
|
2239
2268
|
type: r = "info",
|
|
2240
2269
|
duration: l = 3e3,
|
|
2241
2270
|
action: m,
|
|
2242
|
-
onClose:
|
|
2271
|
+
onClose: u
|
|
2243
2272
|
}) {
|
|
2244
2273
|
const [s, o] = Y(100);
|
|
2245
2274
|
J(() => {
|
|
@@ -2247,14 +2276,14 @@ function Rt({
|
|
|
2247
2276
|
o(100);
|
|
2248
2277
|
return;
|
|
2249
2278
|
}
|
|
2250
|
-
let
|
|
2251
|
-
const
|
|
2252
|
-
|
|
2253
|
-
const
|
|
2254
|
-
o(
|
|
2255
|
-
},
|
|
2256
|
-
return () => cancelAnimationFrame(
|
|
2257
|
-
}, [l,
|
|
2279
|
+
let M = null;
|
|
2280
|
+
const k = (I) => {
|
|
2281
|
+
M || (M = I);
|
|
2282
|
+
const w = I - M, d = Math.max(0, (l - w) / l * 100);
|
|
2283
|
+
o(d), d > 0 ? requestAnimationFrame(k) : u?.();
|
|
2284
|
+
}, L = requestAnimationFrame(k);
|
|
2285
|
+
return () => cancelAnimationFrame(L);
|
|
2286
|
+
}, [l, u]);
|
|
2258
2287
|
const C = {
|
|
2259
2288
|
success: /* @__PURE__ */ e(bt, { weight: "Bold", className: "w-5 h-5" }),
|
|
2260
2289
|
error: /* @__PURE__ */ e(gt, { weight: "Bold", className: "w-5 h-5" }),
|
|
@@ -2291,7 +2320,7 @@ function Rt({
|
|
|
2291
2320
|
loading: "text-slate-600"
|
|
2292
2321
|
}
|
|
2293
2322
|
};
|
|
2294
|
-
return /* @__PURE__ */
|
|
2323
|
+
return /* @__PURE__ */ c(
|
|
2295
2324
|
"div",
|
|
2296
2325
|
{
|
|
2297
2326
|
className: n(
|
|
@@ -2310,9 +2339,9 @@ function Rt({
|
|
|
2310
2339
|
}
|
|
2311
2340
|
}
|
|
2312
2341
|
),
|
|
2313
|
-
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */
|
|
2342
|
+
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
|
|
2314
2343
|
/* @__PURE__ */ e("div", { className: n("flex-shrink-0", y.text[r]), children: C[r] }),
|
|
2315
|
-
/* @__PURE__ */
|
|
2344
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
2316
2345
|
/* @__PURE__ */ e("h4", { className: "text-base font-medium mb-1", children: t }),
|
|
2317
2346
|
a && /* @__PURE__ */ e("p", { className: "text-sm text-[#82828C]", children: a }),
|
|
2318
2347
|
m && /* @__PURE__ */ e("div", { className: "mt-3", children: /* @__PURE__ */ e("div", { className: n("underline font-medium text-sm", y.action[r]), children: m }) })
|
|
@@ -2320,7 +2349,7 @@ function Rt({
|
|
|
2320
2349
|
/* @__PURE__ */ e(
|
|
2321
2350
|
"button",
|
|
2322
2351
|
{
|
|
2323
|
-
onClick:
|
|
2352
|
+
onClick: u,
|
|
2324
2353
|
className: "flex-shrink-0 rounded-full transition cursor-pointer active:animate-spin",
|
|
2325
2354
|
children: /* @__PURE__ */ e(me, { className: "w-6 h-6 text-slate-base" })
|
|
2326
2355
|
}
|
|
@@ -2331,11 +2360,11 @@ function Rt({
|
|
|
2331
2360
|
);
|
|
2332
2361
|
}
|
|
2333
2362
|
const pe = (t) => {
|
|
2334
|
-
const a =
|
|
2335
|
-
const m = Ne.findIndex((
|
|
2336
|
-
m !== -1 && (Ne.splice(m, 1),
|
|
2337
|
-
}, l = /* @__PURE__ */ e(
|
|
2338
|
-
return Ne.push({ id: a, element: l }),
|
|
2363
|
+
const a = Rt++, r = () => {
|
|
2364
|
+
const m = Ne.findIndex((u) => u?.id === a);
|
|
2365
|
+
m !== -1 && (Ne.splice(m, 1), $e());
|
|
2366
|
+
}, l = /* @__PURE__ */ e($t, { ...t, onClose: r });
|
|
2367
|
+
return Ne.push({ id: a, element: l }), $e(), t.duration !== 1 / 0 && setTimeout(r, (t.duration || 3e3) + 300), { close: r };
|
|
2339
2368
|
}, nr = {
|
|
2340
2369
|
success: (t, a, r) => pe(typeof t == "string" ? { title: t, description: a, type: "success", action: r } : {
|
|
2341
2370
|
...t,
|
|
@@ -2367,7 +2396,7 @@ function lr({
|
|
|
2367
2396
|
delay: l = 200,
|
|
2368
2397
|
className: m
|
|
2369
2398
|
}) {
|
|
2370
|
-
const
|
|
2399
|
+
const u = {
|
|
2371
2400
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
2372
2401
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
2373
2402
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
@@ -2378,16 +2407,16 @@ function lr({
|
|
|
2378
2407
|
left: "top-1/2 -translate-y-1/2 left-full",
|
|
2379
2408
|
right: "top-1/2 -translate-y-1/2 right-full"
|
|
2380
2409
|
};
|
|
2381
|
-
return /* @__PURE__ */
|
|
2410
|
+
return /* @__PURE__ */ c("div", { className: "group relative inline-block", children: [
|
|
2382
2411
|
a,
|
|
2383
|
-
/* @__PURE__ */
|
|
2412
|
+
/* @__PURE__ */ c(
|
|
2384
2413
|
"div",
|
|
2385
2414
|
{
|
|
2386
2415
|
className: n(
|
|
2387
2416
|
"absolute z-50 rounded-md bg-slate-400 px-2 py-1 text-xs whitespace-nowrap text-white shadow-md",
|
|
2388
2417
|
"scale-95 opacity-0 transition-all group-hover:scale-100 group-hover:opacity-100",
|
|
2389
2418
|
"duration-200 ease-out group-hover:delay-200",
|
|
2390
|
-
|
|
2419
|
+
u[r],
|
|
2391
2420
|
m
|
|
2392
2421
|
),
|
|
2393
2422
|
style: { transitionDelay: `${l}ms` },
|
|
@@ -2413,7 +2442,7 @@ function ar({
|
|
|
2413
2442
|
disabled: r = !1,
|
|
2414
2443
|
variant: l = "yellow",
|
|
2415
2444
|
label: m,
|
|
2416
|
-
supportText:
|
|
2445
|
+
supportText: u,
|
|
2417
2446
|
className: s
|
|
2418
2447
|
}) {
|
|
2419
2448
|
const o = () => {
|
|
@@ -2430,7 +2459,7 @@ function ar({
|
|
|
2430
2459
|
focus: "focus:ring-2 focus:ring-yellow-200"
|
|
2431
2460
|
}
|
|
2432
2461
|
};
|
|
2433
|
-
return /* @__PURE__ */
|
|
2462
|
+
return /* @__PURE__ */ c(
|
|
2434
2463
|
"div",
|
|
2435
2464
|
{
|
|
2436
2465
|
className: n(
|
|
@@ -2462,7 +2491,7 @@ function ar({
|
|
|
2462
2491
|
)
|
|
2463
2492
|
}
|
|
2464
2493
|
),
|
|
2465
|
-
(m ||
|
|
2494
|
+
(m || u) && /* @__PURE__ */ c("div", { className: "flex flex-col leading-tight", children: [
|
|
2466
2495
|
m && /* @__PURE__ */ e(
|
|
2467
2496
|
"span",
|
|
2468
2497
|
{
|
|
@@ -2472,7 +2501,7 @@ function ar({
|
|
|
2472
2501
|
children: m
|
|
2473
2502
|
}
|
|
2474
2503
|
),
|
|
2475
|
-
|
|
2504
|
+
u && /* @__PURE__ */ e("span", { className: "text-sm font-normal text-slate-500", children: u })
|
|
2476
2505
|
] })
|
|
2477
2506
|
]
|
|
2478
2507
|
}
|
|
@@ -2517,16 +2546,16 @@ const Bt = fe(
|
|
|
2517
2546
|
size: r = "base",
|
|
2518
2547
|
error: l,
|
|
2519
2548
|
disabled: m = !1,
|
|
2520
|
-
required:
|
|
2549
|
+
required: u = !1,
|
|
2521
2550
|
value: s = "",
|
|
2522
2551
|
onChange: o,
|
|
2523
2552
|
onFocus: C,
|
|
2524
2553
|
onBlur: y,
|
|
2525
|
-
className:
|
|
2526
|
-
name:
|
|
2527
|
-
showIcon:
|
|
2528
|
-
},
|
|
2529
|
-
const [
|
|
2554
|
+
className: M,
|
|
2555
|
+
name: k,
|
|
2556
|
+
showIcon: L = !1
|
|
2557
|
+
}, I) => {
|
|
2558
|
+
const [w, d] = Y(!1), i = z((E) => {
|
|
2530
2559
|
let h = E.replace(/\D/g, "");
|
|
2531
2560
|
h.startsWith("998") || (h = "998" + h), h = h.substring(0, 12);
|
|
2532
2561
|
let F = "+998";
|
|
@@ -2537,16 +2566,16 @@ const Bt = fe(
|
|
|
2537
2566
|
o?.("+998");
|
|
2538
2567
|
return;
|
|
2539
2568
|
}
|
|
2540
|
-
const F =
|
|
2569
|
+
const F = i(h);
|
|
2541
2570
|
o?.(F);
|
|
2542
2571
|
}, b = () => {
|
|
2543
|
-
|
|
2572
|
+
d(!0), (!s || s === "") && o?.("+998"), C?.();
|
|
2544
2573
|
}, p = () => {
|
|
2545
|
-
|
|
2546
|
-
},
|
|
2574
|
+
d(!1), y?.();
|
|
2575
|
+
}, v = _(() => ({
|
|
2547
2576
|
sm: {
|
|
2548
2577
|
input: "h-9 text-sm",
|
|
2549
|
-
padding:
|
|
2578
|
+
padding: L ? "pl-8 pr-2" : "px-2",
|
|
2550
2579
|
iconSize: "w-4 h-4",
|
|
2551
2580
|
iconLeft: "left-2",
|
|
2552
2581
|
labelFont: "text-sm",
|
|
@@ -2554,7 +2583,7 @@ const Bt = fe(
|
|
|
2554
2583
|
},
|
|
2555
2584
|
md: {
|
|
2556
2585
|
input: "h-10 text-sm",
|
|
2557
|
-
padding:
|
|
2586
|
+
padding: L ? "pl-10 pr-4" : "px-4",
|
|
2558
2587
|
iconSize: "w-4 h-4",
|
|
2559
2588
|
iconLeft: "left-3",
|
|
2560
2589
|
labelFont: "text-base",
|
|
@@ -2562,33 +2591,33 @@ const Bt = fe(
|
|
|
2562
2591
|
},
|
|
2563
2592
|
base: {
|
|
2564
2593
|
input: "h-12 text-base",
|
|
2565
|
-
padding:
|
|
2594
|
+
padding: L ? "pl-11 pr-4" : "px-4",
|
|
2566
2595
|
iconSize: "w-5 h-5",
|
|
2567
2596
|
iconLeft: "left-3",
|
|
2568
2597
|
labelFont: "text-base",
|
|
2569
2598
|
iconWrapper: "h-5"
|
|
2570
2599
|
}
|
|
2571
|
-
}), [
|
|
2572
|
-
return /* @__PURE__ */
|
|
2573
|
-
t && /* @__PURE__ */
|
|
2600
|
+
}), [L]), j = _(() => l ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [l]), S = _(() => m ? "text-slate-400" : l ? "text-red-600" : w ? "text-black" : "text-slate-400", [l, w, m]);
|
|
2601
|
+
return /* @__PURE__ */ c("div", { className: n("w-full", M), children: [
|
|
2602
|
+
t && /* @__PURE__ */ c("label", { className: n(
|
|
2574
2603
|
"mb-2 block font-medium transition-colors duration-200",
|
|
2575
|
-
l ? "text-red-600" :
|
|
2576
|
-
|
|
2604
|
+
l ? "text-red-600" : w ? "text-blue-600" : "text-slate-700",
|
|
2605
|
+
v[r].labelFont
|
|
2577
2606
|
), children: [
|
|
2578
2607
|
t,
|
|
2579
|
-
|
|
2608
|
+
u && /* @__PURE__ */ e("span", { className: "text-red-600 ml-1", children: "*" })
|
|
2580
2609
|
] }),
|
|
2581
|
-
/* @__PURE__ */
|
|
2582
|
-
|
|
2610
|
+
/* @__PURE__ */ c("div", { className: "relative flex items-center", children: [
|
|
2611
|
+
L && /* @__PURE__ */ e("div", { className: n(
|
|
2583
2612
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center transition-all duration-300",
|
|
2584
|
-
|
|
2613
|
+
v[r].iconLeft,
|
|
2585
2614
|
S
|
|
2586
|
-
), children: /* @__PURE__ */ e("div", { className: n("flex items-center justify-center",
|
|
2615
|
+
), children: /* @__PURE__ */ e("div", { className: n("flex items-center justify-center", v[r].iconWrapper), children: /* @__PURE__ */ e(xt, { className: n(v[r].iconSize), weight: "Linear" }) }) }),
|
|
2587
2616
|
/* @__PURE__ */ e(
|
|
2588
2617
|
"input",
|
|
2589
2618
|
{
|
|
2590
|
-
ref:
|
|
2591
|
-
name:
|
|
2619
|
+
ref: I,
|
|
2620
|
+
name: k,
|
|
2592
2621
|
type: "tel",
|
|
2593
2622
|
value: s,
|
|
2594
2623
|
onChange: x,
|
|
@@ -2600,9 +2629,9 @@ const Bt = fe(
|
|
|
2600
2629
|
"w-full border bg-white font-normal transition-all duration-300 outline-none",
|
|
2601
2630
|
r === "base" ? "rounded-xl" : "rounded-lg",
|
|
2602
2631
|
"disabled:bg-slate-100 disabled:text-slate-400 disabled:cursor-not-allowed",
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2632
|
+
v[r].input,
|
|
2633
|
+
v[r].padding,
|
|
2634
|
+
j
|
|
2606
2635
|
)
|
|
2607
2636
|
}
|
|
2608
2637
|
)
|
|
@@ -2614,22 +2643,22 @@ const Bt = fe(
|
|
|
2614
2643
|
Bt.displayName = "MciPhone";
|
|
2615
2644
|
const Pt = fe(
|
|
2616
2645
|
({ mode: t, onChange: a, value: r, ...l }, m) => {
|
|
2617
|
-
const [
|
|
2618
|
-
const
|
|
2619
|
-
let
|
|
2620
|
-
for (let x = 0; x <
|
|
2621
|
-
const b =
|
|
2622
|
-
if (
|
|
2646
|
+
const [u, s] = Y(""), o = r !== void 0 ? r : u, C = (w) => {
|
|
2647
|
+
const d = w.replace(/\s/g, "").toUpperCase();
|
|
2648
|
+
let i = "";
|
|
2649
|
+
for (let x = 0; x < d.length; x++) {
|
|
2650
|
+
const b = d[x];
|
|
2651
|
+
if (i.length < 2 ? /[A-Z]/.test(b) && (i += b) : /[0-9]/.test(b) && (i += b), i.length >= 9) break;
|
|
2623
2652
|
}
|
|
2624
|
-
return
|
|
2625
|
-
}, y = (
|
|
2626
|
-
(
|
|
2627
|
-
const
|
|
2628
|
-
let
|
|
2629
|
-
t === "passport" ?
|
|
2653
|
+
return i.length > 2 ? i.slice(0, 2) + " " + i.slice(2) : i;
|
|
2654
|
+
}, y = (w) => w.replace(/\D/g, "").slice(0, 14), M = (w) => w.toUpperCase().replace(/[^A-Z0-9\-\s]/g, "").replace(/\s+/g, " ").slice(0, 15), k = z(
|
|
2655
|
+
(w) => {
|
|
2656
|
+
const d = w.target.value;
|
|
2657
|
+
let i = "";
|
|
2658
|
+
t === "passport" ? i = C(d) : t === "pinfl" ? i = y(d) : t === "metirka" && (i = M(d)), r === void 0 && s(i), w.target.value = i, a?.(i, w);
|
|
2630
2659
|
},
|
|
2631
2660
|
[t, a, r]
|
|
2632
|
-
),
|
|
2661
|
+
), L = () => {
|
|
2633
2662
|
if (l.placeholder) return l.placeholder;
|
|
2634
2663
|
switch (t) {
|
|
2635
2664
|
case "passport":
|
|
@@ -2648,7 +2677,7 @@ const Pt = fe(
|
|
|
2648
2677
|
ref: m,
|
|
2649
2678
|
...l,
|
|
2650
2679
|
value: o,
|
|
2651
|
-
onChange:
|
|
2680
|
+
onChange: k,
|
|
2652
2681
|
maxLength: (() => {
|
|
2653
2682
|
if (l.maxLength) return l.maxLength;
|
|
2654
2683
|
switch (t) {
|
|
@@ -2662,7 +2691,7 @@ const Pt = fe(
|
|
|
2662
2691
|
return 255;
|
|
2663
2692
|
}
|
|
2664
2693
|
})(),
|
|
2665
|
-
placeholder:
|
|
2694
|
+
placeholder: L()
|
|
2666
2695
|
}
|
|
2667
2696
|
);
|
|
2668
2697
|
}
|
|
@@ -2674,37 +2703,37 @@ function or({
|
|
|
2674
2703
|
columns: r,
|
|
2675
2704
|
hidden: l,
|
|
2676
2705
|
onToggle: m,
|
|
2677
|
-
onMove:
|
|
2706
|
+
onMove: u
|
|
2678
2707
|
}) {
|
|
2679
2708
|
const s = se(null), { handleClick: o } = Ce(s, a);
|
|
2680
2709
|
J(() => {
|
|
2681
2710
|
if (t)
|
|
2682
2711
|
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
2683
2712
|
}, [t, o]);
|
|
2684
|
-
const C = _(() => new Set(l), [l]), y = se(null),
|
|
2685
|
-
|
|
2686
|
-
|
|
2713
|
+
const C = _(() => new Set(l), [l]), y = se(null), M = se(null), k = se(!1), [L, I] = Y(null), [w, d] = Y(null), i = se(null), x = z((j) => {
|
|
2714
|
+
M.current = j, i.current == null && (i.current = requestAnimationFrame(() => {
|
|
2715
|
+
i.current = null, I(M.current);
|
|
2687
2716
|
}));
|
|
2688
2717
|
}, []);
|
|
2689
2718
|
J(() => () => {
|
|
2690
|
-
|
|
2719
|
+
i.current != null && cancelAnimationFrame(i.current);
|
|
2691
2720
|
}, []);
|
|
2692
2721
|
const b = z(
|
|
2693
|
-
(
|
|
2694
|
-
|
|
2722
|
+
(j) => {
|
|
2723
|
+
k.current = !0, y.current = j, d(r[j]?.key ?? null);
|
|
2695
2724
|
},
|
|
2696
2725
|
[r]
|
|
2697
2726
|
), p = z(() => {
|
|
2698
|
-
|
|
2727
|
+
k.current = !1;
|
|
2699
2728
|
}, []);
|
|
2700
2729
|
J(() => {
|
|
2701
2730
|
if (t)
|
|
2702
2731
|
return document.addEventListener("mouseup", p), () => document.removeEventListener("mouseup", p);
|
|
2703
2732
|
}, [t, p]);
|
|
2704
|
-
const
|
|
2705
|
-
y.current = null,
|
|
2733
|
+
const v = z(() => {
|
|
2734
|
+
y.current = null, k.current = !1, d(null), x(null);
|
|
2706
2735
|
}, [x]);
|
|
2707
|
-
return t ? /* @__PURE__ */
|
|
2736
|
+
return t ? /* @__PURE__ */ c(
|
|
2708
2737
|
"div",
|
|
2709
2738
|
{
|
|
2710
2739
|
ref: s,
|
|
@@ -2714,7 +2743,7 @@ function or({
|
|
|
2714
2743
|
"border border-slate-200"
|
|
2715
2744
|
),
|
|
2716
2745
|
children: [
|
|
2717
|
-
/* @__PURE__ */
|
|
2746
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-4", children: [
|
|
2718
2747
|
/* @__PURE__ */ e("h4", { className: "text-slate-600 text-large font-normal", children: "Settings" }),
|
|
2719
2748
|
/* @__PURE__ */ e(
|
|
2720
2749
|
"button",
|
|
@@ -2739,34 +2768,34 @@ function or({
|
|
|
2739
2768
|
"[&::-webkit-scrollbar-thumb]:rounded-full",
|
|
2740
2769
|
"hover:[&::-webkit-scrollbar-thumb]:bg-slate-300"
|
|
2741
2770
|
),
|
|
2742
|
-
children: r.map((
|
|
2743
|
-
const E = !C.has(
|
|
2744
|
-
return /* @__PURE__ */
|
|
2745
|
-
/* @__PURE__ */
|
|
2771
|
+
children: r.map((j, S) => {
|
|
2772
|
+
const E = !C.has(j.key), h = L === S, F = w === j.key;
|
|
2773
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
2774
|
+
/* @__PURE__ */ c(
|
|
2746
2775
|
"div",
|
|
2747
2776
|
{
|
|
2748
2777
|
draggable: !0,
|
|
2749
|
-
onDragStart: (
|
|
2750
|
-
if (!
|
|
2751
|
-
|
|
2778
|
+
onDragStart: (T) => {
|
|
2779
|
+
if (!k.current) {
|
|
2780
|
+
T.preventDefault();
|
|
2752
2781
|
return;
|
|
2753
2782
|
}
|
|
2754
|
-
|
|
2783
|
+
T.dataTransfer.setData("text/plain", String(S)), T.dataTransfer.effectAllowed = "move", d(j.key), x(null);
|
|
2755
2784
|
const B = new Image();
|
|
2756
|
-
B.src = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",
|
|
2785
|
+
B.src = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", T.dataTransfer.setDragImage(B, 0, 0);
|
|
2757
2786
|
},
|
|
2758
|
-
onDragOver: (
|
|
2759
|
-
y.current != null && (
|
|
2787
|
+
onDragOver: (T) => {
|
|
2788
|
+
y.current != null && (T.preventDefault(), T.dataTransfer.dropEffect = "move", x(S));
|
|
2760
2789
|
},
|
|
2761
2790
|
onDragLeave: () => {
|
|
2762
|
-
|
|
2791
|
+
M.current === S && x(null);
|
|
2763
2792
|
},
|
|
2764
|
-
onDrop: (
|
|
2765
|
-
|
|
2766
|
-
const B = y.current ?? Number(
|
|
2767
|
-
Number.isFinite(B) && B !== S &&
|
|
2793
|
+
onDrop: (T) => {
|
|
2794
|
+
T.preventDefault();
|
|
2795
|
+
const B = y.current ?? Number(T.dataTransfer.getData("text/plain"));
|
|
2796
|
+
Number.isFinite(B) && B !== S && u(B, S), v();
|
|
2768
2797
|
},
|
|
2769
|
-
onDragEnd:
|
|
2798
|
+
onDragEnd: v,
|
|
2770
2799
|
className: n(
|
|
2771
2800
|
"group flex items-center py-2 px-1 gap-4",
|
|
2772
2801
|
"rounded-md box-border overflow-visible",
|
|
@@ -2791,13 +2820,13 @@ function or({
|
|
|
2791
2820
|
children: /* @__PURE__ */ e(wt, { weight: "Linear", size: 20 })
|
|
2792
2821
|
}
|
|
2793
2822
|
),
|
|
2794
|
-
/* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(ke, { checked: E, onChange: () => m(
|
|
2795
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("h4", { className: "truncate text-slate-700 text-base font-medium", title:
|
|
2823
|
+
/* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(ke, { checked: E, onChange: () => m(j.key), variant: "blue" }) }),
|
|
2824
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("h4", { className: "truncate text-slate-700 text-base font-medium", title: j.title, children: j.title }) })
|
|
2796
2825
|
]
|
|
2797
2826
|
}
|
|
2798
2827
|
),
|
|
2799
2828
|
S !== r.length - 1 && /* @__PURE__ */ e("div", { className: "mx-2 h-px bg-slate-100" })
|
|
2800
|
-
] },
|
|
2829
|
+
] }, j.key);
|
|
2801
2830
|
})
|
|
2802
2831
|
}
|
|
2803
2832
|
)
|
|
@@ -2822,17 +2851,17 @@ const ze = (t) => Array.isArray(t) && t.every((a) => typeof a == "string"), Wt =
|
|
|
2822
2851
|
return r;
|
|
2823
2852
|
};
|
|
2824
2853
|
function ir(t) {
|
|
2825
|
-
const { storageKey: a, columns: r, defaultVisibleKeys: l, defaultOrder: m } = t,
|
|
2854
|
+
const { storageKey: a, columns: r, defaultVisibleKeys: l, defaultOrder: m } = t, u = _(() => r.map((d) => String(d.key)), [r]), s = _(() => new Set(u), [u]), [o, C] = Y(() => {
|
|
2826
2855
|
if (typeof window > "u") {
|
|
2827
|
-
const S = m?.map(String) ??
|
|
2856
|
+
const S = m?.map(String) ?? u, E = l && l.length ? u.filter((h) => !new Set(l.map(String)).has(h)) : [];
|
|
2828
2857
|
return { order: oe(S), hidden: oe(E) };
|
|
2829
2858
|
}
|
|
2830
|
-
const
|
|
2859
|
+
const d = Wt(window.localStorage.getItem(a)), i = m?.map(String) ?? u, x = oe(i), b = oe((d?.order ?? []).filter((S) => s.has(S))), p = oe([
|
|
2831
2860
|
...b,
|
|
2832
2861
|
...x.filter((S) => !b.includes(S)),
|
|
2833
|
-
...
|
|
2834
|
-
]),
|
|
2835
|
-
return { order: p, hidden: oe(
|
|
2862
|
+
...u.filter((S) => !b.includes(S) && !x.includes(S))
|
|
2863
|
+
]), v = oe((d?.hidden ?? []).filter((S) => s.has(S))), j = v.length === 0 && l && l.length ? u.filter((S) => !new Set(l.map(String)).has(S)) : v;
|
|
2864
|
+
return { order: p, hidden: oe(j) };
|
|
2836
2865
|
});
|
|
2837
2866
|
J(() => {
|
|
2838
2867
|
if (!(typeof window > "u"))
|
|
@@ -2841,48 +2870,48 @@ function ir(t) {
|
|
|
2841
2870
|
} catch {
|
|
2842
2871
|
}
|
|
2843
2872
|
}, [a, o]), J(() => {
|
|
2844
|
-
C((
|
|
2845
|
-
const
|
|
2846
|
-
...
|
|
2847
|
-
...
|
|
2848
|
-
]), x = oe(
|
|
2849
|
-
return b && p ?
|
|
2873
|
+
C((d) => {
|
|
2874
|
+
const i = oe([
|
|
2875
|
+
...d.order.filter((v) => s.has(v)),
|
|
2876
|
+
...u.filter((v) => !d.order.includes(v))
|
|
2877
|
+
]), x = oe(d.hidden.filter((v) => s.has(v))), b = i.length === d.order.length && i.every((v, j) => v === d.order[j]), p = x.length === d.hidden.length && x.every((v, j) => v === d.hidden[j]);
|
|
2878
|
+
return b && p ? d : { order: i, hidden: x };
|
|
2850
2879
|
});
|
|
2851
|
-
}, [
|
|
2852
|
-
const y = _(() => new Set(o.hidden), [o.hidden]),
|
|
2853
|
-
const
|
|
2854
|
-
return o.order.forEach((x, b) =>
|
|
2855
|
-
const p =
|
|
2856
|
-
return p -
|
|
2880
|
+
}, [u, s]);
|
|
2881
|
+
const y = _(() => new Set(o.hidden), [o.hidden]), M = _(() => {
|
|
2882
|
+
const d = /* @__PURE__ */ new Map();
|
|
2883
|
+
return o.order.forEach((x, b) => d.set(x, b)), [...r.filter((x) => !y.has(String(x.key)))].sort((x, b) => {
|
|
2884
|
+
const p = d.get(String(x.key)) ?? Number.MAX_SAFE_INTEGER, v = d.get(String(b.key)) ?? Number.MAX_SAFE_INTEGER;
|
|
2885
|
+
return p - v;
|
|
2857
2886
|
});
|
|
2858
|
-
}, [r, y, o.order]),
|
|
2859
|
-
() => o.hidden.filter((
|
|
2887
|
+
}, [r, y, o.order]), k = _(
|
|
2888
|
+
() => o.hidden.filter((d) => s.has(d)),
|
|
2860
2889
|
[o.hidden, s]
|
|
2861
|
-
),
|
|
2862
|
-
const
|
|
2890
|
+
), L = z((d) => {
|
|
2891
|
+
const i = String(d);
|
|
2863
2892
|
C((x) => {
|
|
2864
|
-
const p = x.hidden.includes(
|
|
2893
|
+
const p = x.hidden.includes(i) ? x.hidden.filter((v) => v !== i) : [...x.hidden, i];
|
|
2865
2894
|
return { ...x, hidden: oe(p) };
|
|
2866
2895
|
});
|
|
2867
|
-
}, []),
|
|
2896
|
+
}, []), I = z((d, i) => {
|
|
2868
2897
|
C((x) => {
|
|
2869
2898
|
const b = x.order.slice();
|
|
2870
|
-
if (
|
|
2871
|
-
const [p] = b.splice(
|
|
2872
|
-
return b.splice(
|
|
2899
|
+
if (d < 0 || i < 0 || d >= b.length || i >= b.length) return x;
|
|
2900
|
+
const [p] = b.splice(d, 1);
|
|
2901
|
+
return b.splice(i, 0, p), { ...x, order: b };
|
|
2873
2902
|
});
|
|
2874
|
-
}, []),
|
|
2903
|
+
}, []), w = z(() => {
|
|
2875
2904
|
C(() => {
|
|
2876
|
-
const
|
|
2877
|
-
return { order:
|
|
2905
|
+
const d = oe(m?.map(String) ?? u), i = l && l.length ? oe(u.filter((x) => !new Set(l.map(String)).has(x))) : [];
|
|
2906
|
+
return { order: d, hidden: i };
|
|
2878
2907
|
});
|
|
2879
|
-
}, [m, l,
|
|
2908
|
+
}, [m, l, u]);
|
|
2880
2909
|
return {
|
|
2881
|
-
orderedColumns:
|
|
2882
|
-
hiddenKeys:
|
|
2883
|
-
toggleColumn:
|
|
2884
|
-
moveColumn:
|
|
2885
|
-
reset:
|
|
2910
|
+
orderedColumns: M,
|
|
2911
|
+
hiddenKeys: k,
|
|
2912
|
+
toggleColumn: L,
|
|
2913
|
+
moveColumn: I,
|
|
2914
|
+
reset: w
|
|
2886
2915
|
};
|
|
2887
2916
|
}
|
|
2888
2917
|
export {
|