@mci-ui/mci-ui 0.0.43 → 0.0.44
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 +608 -590
- package/dist/index.umd.js +2 -2
- package/dist/types/shared/ui/mciInput/MciInput.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as ue } from "react/jsx-runtime";
|
|
2
|
-
import { AltArrowRight as me, Star2 as
|
|
2
|
+
import { AltArrowRight as me, Star2 as je, AltArrowDown as Me, EyeClosed as Be, Eye as Pe, Calendar as Ve, AltArrowLeft as pe, DoubleAltArrowLeft as Ue, DoubleAltArrowRight as _e, ConfoundedSquare as qe, SortVertical as Je, SortFromTopToBottom as He, SortFromBottomToTop as Oe, Upload as Ke, FileText as Ne, File as Ge, MusicNote as Xe, VideoFramePlayHorizontal as Ze, Gallery as Qe, MenuDots as et, Refresh as tt, InfoCircle as rt, DangerCircle as at, CloseCircle as lt, CheckCircle as st } from "@solar-icons/react";
|
|
3
3
|
import { clsx as nt } from "clsx";
|
|
4
4
|
import { twMerge as ot } from "tailwind-merge";
|
|
5
5
|
import * as he from "react";
|
|
6
|
-
import { memo as it, useState as
|
|
6
|
+
import { memo as it, useState as z, useMemo as te, useCallback as R, useRef as ne, useEffect as Z, forwardRef as xe } from "react";
|
|
7
7
|
import { createRoot as ct } from "react-dom/client";
|
|
8
8
|
function r(...t) {
|
|
9
9
|
return ot(nt(t));
|
|
@@ -18,54 +18,54 @@ function ve(t, l) {
|
|
|
18
18
|
t.current && !t.current.contains(s.target) && l();
|
|
19
19
|
} };
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function jt({
|
|
22
22
|
items: t,
|
|
23
23
|
variant: l = "blue",
|
|
24
24
|
className: a
|
|
25
25
|
}) {
|
|
26
26
|
const s = l === "blue", m = s ? "hover:text-blue-600" : "hover:text-yellow-500", c = s ? "text-blue-600" : "text-yellow-500";
|
|
27
|
-
return /* @__PURE__ */ e("nav", { className: r("flex items-center", a), "aria-label": "Breadcrumb", children: t.map((
|
|
28
|
-
const
|
|
27
|
+
return /* @__PURE__ */ e("nav", { className: r("flex items-center", a), "aria-label": "Breadcrumb", children: t.map((n, d) => {
|
|
28
|
+
const y = d === t.length - 1;
|
|
29
29
|
return /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */ e("span", { children:
|
|
30
|
+
y ? /* @__PURE__ */ i("span", { className: r("flex items-center gap-x-2 font-medium", c), children: [
|
|
31
|
+
n.icon,
|
|
32
|
+
/* @__PURE__ */ e("span", { children: n.label })
|
|
33
33
|
] }) : /* @__PURE__ */ i(
|
|
34
34
|
"a",
|
|
35
35
|
{
|
|
36
|
-
href:
|
|
36
|
+
href: n.href ?? "#",
|
|
37
37
|
onClick: (u) => {
|
|
38
|
-
|
|
38
|
+
n.onClick && (u.preventDefault(), n.onClick());
|
|
39
39
|
},
|
|
40
40
|
className: r(
|
|
41
41
|
"flex items-center gap-x-2 transition-all text-small font-normal text-slate-500",
|
|
42
42
|
m
|
|
43
43
|
),
|
|
44
44
|
children: [
|
|
45
|
-
|
|
46
|
-
/* @__PURE__ */ e("span", { children:
|
|
45
|
+
n.icon,
|
|
46
|
+
/* @__PURE__ */ e("span", { children: n.label })
|
|
47
47
|
]
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
|
-
!
|
|
50
|
+
!y && /* @__PURE__ */ e("span", { className: "mx-2 flex items-center", children: /* @__PURE__ */ e(me, { weight: "Linear", size: 20, className: "text-slate-500" }) })
|
|
51
51
|
] }, d);
|
|
52
52
|
}) });
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function At({
|
|
55
55
|
children: t,
|
|
56
56
|
text: l,
|
|
57
57
|
icon: a,
|
|
58
58
|
iconPosition: s = "left",
|
|
59
59
|
size: m = "base",
|
|
60
60
|
variant: c = "primary",
|
|
61
|
-
color:
|
|
61
|
+
color: n = "yellow",
|
|
62
62
|
loading: d = !1,
|
|
63
|
-
disabled:
|
|
63
|
+
disabled: y = !1,
|
|
64
64
|
onClick: u,
|
|
65
65
|
className: x,
|
|
66
|
-
type:
|
|
66
|
+
type: E = "button"
|
|
67
67
|
}) {
|
|
68
|
-
const
|
|
68
|
+
const j = t ?? l, S = {
|
|
69
69
|
sm: "h-9 px-2 text-small 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"
|
|
@@ -80,29 +80,29 @@ function jt({
|
|
|
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
|
-
}[
|
|
83
|
+
}[n][c] : {
|
|
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
|
-
}[c],
|
|
86
|
+
}[c], v = y || d, C = v ? c === "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
87
|
return /* @__PURE__ */ i(
|
|
88
88
|
"button",
|
|
89
89
|
{
|
|
90
|
-
type:
|
|
90
|
+
type: E,
|
|
91
91
|
onClick: u,
|
|
92
|
-
disabled:
|
|
92
|
+
disabled: v,
|
|
93
93
|
className: r(
|
|
94
94
|
"inline-flex items-center justify-center font-medium transition-all duration-200 cursor-pointer",
|
|
95
|
-
|
|
95
|
+
S[m],
|
|
96
96
|
f,
|
|
97
|
-
!
|
|
98
|
-
|
|
97
|
+
!v && f,
|
|
98
|
+
C,
|
|
99
99
|
x
|
|
100
100
|
),
|
|
101
101
|
children: [
|
|
102
102
|
a && s === "left" && !d && /* @__PURE__ */ e("span", { className: "flex items-center", children: a }),
|
|
103
|
-
|
|
103
|
+
j && /* @__PURE__ */ e("span", { children: j }),
|
|
104
104
|
a && s === "right" && !d && /* @__PURE__ */ e("span", { className: "flex items-center", children: a }),
|
|
105
|
-
d && /* @__PURE__ */ e(
|
|
105
|
+
d && /* @__PURE__ */ e(je, { weight: "Linear", size: 20, className: "animate-spin" })
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
);
|
|
@@ -126,50 +126,50 @@ const dt = (t) => /* @__PURE__ */ he.createElement("svg", { xmlns: "http://www.w
|
|
|
126
126
|
supportText: s,
|
|
127
127
|
checked: m,
|
|
128
128
|
onChange: c,
|
|
129
|
-
error:
|
|
129
|
+
error: n,
|
|
130
130
|
disabled: d = !1,
|
|
131
|
-
required:
|
|
131
|
+
required: y = !1,
|
|
132
132
|
className: u,
|
|
133
133
|
variant: x = "yellow",
|
|
134
|
-
name:
|
|
135
|
-
value:
|
|
134
|
+
name: E,
|
|
135
|
+
value: j
|
|
136
136
|
}) {
|
|
137
|
-
const [
|
|
138
|
-
() => m ??
|
|
139
|
-
[m,
|
|
140
|
-
),
|
|
137
|
+
const [S, L] = z(!1), o = l === "radio", f = te(
|
|
138
|
+
() => m ?? S,
|
|
139
|
+
[m, S]
|
|
140
|
+
), v = R(
|
|
141
141
|
(D) => {
|
|
142
|
-
d || (m === void 0 &&
|
|
142
|
+
d || (m === void 0 && L(D.target.checked), c?.(D));
|
|
143
143
|
},
|
|
144
144
|
[m, c, d]
|
|
145
|
-
),
|
|
145
|
+
), C = te(() => {
|
|
146
146
|
if (d) {
|
|
147
|
-
const
|
|
148
|
-
return
|
|
149
|
-
container:
|
|
147
|
+
const F = "border-slate-200 bg-slate-100";
|
|
148
|
+
return o ? {
|
|
149
|
+
container: F,
|
|
150
150
|
dot: f ? "bg-slate-300" : "bg-transparent",
|
|
151
151
|
check: "text-slate-400"
|
|
152
152
|
} : {
|
|
153
|
-
container:
|
|
153
|
+
container: F,
|
|
154
154
|
dot: "",
|
|
155
155
|
check: f ? "text-slate-400" : "text-transparent"
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
const D = ut[x];
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
159
|
+
if (o) {
|
|
160
|
+
const F = r(
|
|
161
161
|
"border transition-all duration-200",
|
|
162
162
|
f ? D.border : "border-slate-400",
|
|
163
163
|
!f && D.hover,
|
|
164
164
|
D.focus,
|
|
165
165
|
f && ""
|
|
166
|
-
),
|
|
166
|
+
), I = r(
|
|
167
167
|
"transition-all duration-200 rounded-full",
|
|
168
168
|
f ? D.bg : "bg-transparent"
|
|
169
169
|
);
|
|
170
170
|
return {
|
|
171
|
-
container:
|
|
172
|
-
dot:
|
|
171
|
+
container: F,
|
|
172
|
+
dot: I,
|
|
173
173
|
check: ""
|
|
174
174
|
};
|
|
175
175
|
}
|
|
@@ -183,18 +183,18 @@ const dt = (t) => /* @__PURE__ */ he.createElement("svg", { xmlns: "http://www.w
|
|
|
183
183
|
dot: "",
|
|
184
184
|
check: f ? "text-white" : "text-transparent"
|
|
185
185
|
};
|
|
186
|
-
}, [
|
|
186
|
+
}, [o, f, d, x]), g = te(() => !a && !s ? null : /* @__PURE__ */ i("div", { className: "flex flex-col", children: [
|
|
187
187
|
a && /* @__PURE__ */ i(
|
|
188
188
|
"span",
|
|
189
189
|
{
|
|
190
190
|
className: r(
|
|
191
191
|
"text-base font-medium text-slate-700",
|
|
192
|
-
|
|
192
|
+
n && "text-red-600",
|
|
193
193
|
d && "text-slate-400"
|
|
194
194
|
),
|
|
195
195
|
children: [
|
|
196
196
|
a,
|
|
197
|
-
|
|
197
|
+
y && /* @__PURE__ */ e("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
|
|
198
198
|
]
|
|
199
199
|
}
|
|
200
200
|
),
|
|
@@ -208,7 +208,7 @@ const dt = (t) => /* @__PURE__ */ he.createElement("svg", { xmlns: "http://www.w
|
|
|
208
208
|
children: s
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
|
-
] }), [a, s,
|
|
211
|
+
] }), [a, s, n, d, y]);
|
|
212
212
|
return /* @__PURE__ */ i("div", { className: r("flex items-start", u), children: [
|
|
213
213
|
/* @__PURE__ */ i(
|
|
214
214
|
"label",
|
|
@@ -223,14 +223,14 @@ const dt = (t) => /* @__PURE__ */ he.createElement("svg", { xmlns: "http://www.w
|
|
|
223
223
|
{
|
|
224
224
|
type: l,
|
|
225
225
|
checked: f,
|
|
226
|
-
onChange:
|
|
226
|
+
onChange: v,
|
|
227
227
|
disabled: d,
|
|
228
|
-
required:
|
|
228
|
+
required: y,
|
|
229
229
|
className: "sr-only",
|
|
230
|
-
"aria-invalid": !!
|
|
231
|
-
"aria-describedby":
|
|
232
|
-
name:
|
|
233
|
-
value:
|
|
230
|
+
"aria-invalid": !!n,
|
|
231
|
+
"aria-describedby": n ? `${E}-error` : void 0,
|
|
232
|
+
name: E,
|
|
233
|
+
value: j
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
236
|
/* @__PURE__ */ e(
|
|
@@ -238,15 +238,15 @@ const dt = (t) => /* @__PURE__ */ he.createElement("svg", { xmlns: "http://www.w
|
|
|
238
238
|
{
|
|
239
239
|
className: r(
|
|
240
240
|
"relative flex items-center justify-center",
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
o ? "w-5 h-5 rounded-full" : "w-5 h-5 rounded",
|
|
242
|
+
C.container
|
|
243
243
|
),
|
|
244
|
-
children:
|
|
244
|
+
children: o ? /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
245
245
|
"span",
|
|
246
246
|
{
|
|
247
247
|
className: r(
|
|
248
248
|
"w-3 h-3 rounded-full transition-all duration-200",
|
|
249
|
-
|
|
249
|
+
C.dot,
|
|
250
250
|
f ? "opacity-100 scale-100" : "opacity-0 scale-50"
|
|
251
251
|
)
|
|
252
252
|
}
|
|
@@ -255,18 +255,18 @@ const dt = (t) => /* @__PURE__ */ he.createElement("svg", { xmlns: "http://www.w
|
|
|
255
255
|
{
|
|
256
256
|
className: r(
|
|
257
257
|
"w-4 h-4 stroke-[2.5px] transition-opacity duration-200",
|
|
258
|
-
|
|
258
|
+
C.check,
|
|
259
259
|
f ? "opacity-100" : "opacity-0"
|
|
260
260
|
)
|
|
261
261
|
}
|
|
262
262
|
)
|
|
263
263
|
}
|
|
264
264
|
),
|
|
265
|
-
|
|
265
|
+
g
|
|
266
266
|
]
|
|
267
267
|
}
|
|
268
268
|
),
|
|
269
|
-
|
|
269
|
+
n && /* @__PURE__ */ e("p", { id: `${E}-error`, className: "mt-1 text-extra-small text-red-600", children: n })
|
|
270
270
|
] });
|
|
271
271
|
});
|
|
272
272
|
mt.displayName = "MciCheck";
|
|
@@ -278,17 +278,17 @@ function Tt({
|
|
|
278
278
|
className: m,
|
|
279
279
|
contentClassName: c
|
|
280
280
|
}) {
|
|
281
|
-
const [
|
|
282
|
-
return
|
|
283
|
-
x.current && u(
|
|
284
|
-
}, [
|
|
281
|
+
const [n, d] = z(a), [y, u] = z(0), x = ne(null);
|
|
282
|
+
return Z(() => {
|
|
283
|
+
x.current && u(n ? x.current.scrollHeight : 0);
|
|
284
|
+
}, [n]), /* @__PURE__ */ i("div", { className: r("overflow-hidden rounded-xl border border-slate-200", m), children: [
|
|
285
285
|
/* @__PURE__ */ i(
|
|
286
286
|
"button",
|
|
287
287
|
{
|
|
288
|
-
onClick: () => d(!
|
|
288
|
+
onClick: () => d(!n),
|
|
289
289
|
className: r(
|
|
290
290
|
"flex w-full items-center justify-between p-5 transition-all duration-300 hover:cursor-pointer",
|
|
291
|
-
|
|
291
|
+
n ? "border-b border-slate-200" : "border-b border-transparent"
|
|
292
292
|
),
|
|
293
293
|
children: [
|
|
294
294
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
@@ -302,7 +302,7 @@ function Tt({
|
|
|
302
302
|
size: 20,
|
|
303
303
|
className: r(
|
|
304
304
|
"flex-shrink-0 transition-transform duration-300 text-slate-400",
|
|
305
|
-
|
|
305
|
+
n && "rotate-180"
|
|
306
306
|
)
|
|
307
307
|
}
|
|
308
308
|
)
|
|
@@ -316,7 +316,7 @@ function Tt({
|
|
|
316
316
|
"overflow-hidden transition-all duration-300 ease-out"
|
|
317
317
|
),
|
|
318
318
|
style: {
|
|
319
|
-
height: `${
|
|
319
|
+
height: `${y}px`
|
|
320
320
|
},
|
|
321
321
|
children: /* @__PURE__ */ e("div", { ref: x, className: r("p-5", c), children: l })
|
|
322
322
|
}
|
|
@@ -331,23 +331,23 @@ function $t({
|
|
|
331
331
|
children: s,
|
|
332
332
|
footer: m,
|
|
333
333
|
title: c,
|
|
334
|
-
description:
|
|
334
|
+
description: n,
|
|
335
335
|
showCloseButton: d = !0,
|
|
336
|
-
drawerClassName:
|
|
336
|
+
drawerClassName: y,
|
|
337
337
|
closeOnOverlayClick: u = !0,
|
|
338
338
|
closeOnEscape: x = !0
|
|
339
339
|
}) {
|
|
340
|
-
const
|
|
340
|
+
const E = ne(null), j = ne(null), { handleEscape: S } = we(() => {
|
|
341
341
|
x && t && l();
|
|
342
|
-
}), { handleClick:
|
|
342
|
+
}), { handleClick: L } = ve(E, () => {
|
|
343
343
|
u && t && l();
|
|
344
344
|
});
|
|
345
|
-
|
|
346
|
-
t ? (
|
|
347
|
-
}, [t]),
|
|
348
|
-
document.removeEventListener("keydown",
|
|
349
|
-
}), [t,
|
|
350
|
-
const
|
|
345
|
+
Z(() => {
|
|
346
|
+
t ? (j.current = document.activeElement, E.current?.focus()) : j.current?.focus();
|
|
347
|
+
}, [t]), Z(() => (t && (document.addEventListener("keydown", S), document.addEventListener("mousedown", L), document.body.style.overflow = "hidden"), () => {
|
|
348
|
+
document.removeEventListener("keydown", S), document.removeEventListener("mousedown", L), document.body.style.overflow = "unset";
|
|
349
|
+
}), [t, S, L]);
|
|
350
|
+
const o = {
|
|
351
351
|
left: "top-6 left-6 bottom-6 max-w-[572px]",
|
|
352
352
|
right: "top-6 right-6 bottom-6 max-w-[572px]"
|
|
353
353
|
}, f = {
|
|
@@ -369,19 +369,19 @@ function $t({
|
|
|
369
369
|
/* @__PURE__ */ i(
|
|
370
370
|
"div",
|
|
371
371
|
{
|
|
372
|
-
ref:
|
|
372
|
+
ref: E,
|
|
373
373
|
tabIndex: -1,
|
|
374
374
|
className: r(
|
|
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
|
+
o[a],
|
|
377
377
|
f[a],
|
|
378
|
-
|
|
378
|
+
y
|
|
379
379
|
),
|
|
380
380
|
role: "dialog",
|
|
381
381
|
"aria-modal": "true",
|
|
382
382
|
"aria-labelledby": c ? "mciDrawer-title" : void 0,
|
|
383
383
|
children: [
|
|
384
|
-
(c || d ||
|
|
384
|
+
(c || d || n) && /* @__PURE__ */ i(
|
|
385
385
|
"div",
|
|
386
386
|
{
|
|
387
387
|
className: r(
|
|
@@ -390,7 +390,7 @@ function $t({
|
|
|
390
390
|
children: [
|
|
391
391
|
c && /* @__PURE__ */ i("div", { className: "block", children: [
|
|
392
392
|
/* @__PURE__ */ e("h2", { id: "drawer-title", className: "text-h3 font-semibold text-black", children: c }),
|
|
393
|
-
|
|
393
|
+
n && /* @__PURE__ */ e("p", { className: "text-base text-slate-base font-normal mt-2", children: n })
|
|
394
394
|
] }),
|
|
395
395
|
d && /* @__PURE__ */ e(
|
|
396
396
|
"button",
|
|
@@ -415,7 +415,7 @@ function $t({
|
|
|
415
415
|
)
|
|
416
416
|
] });
|
|
417
417
|
}
|
|
418
|
-
const
|
|
418
|
+
const Ae = xe(
|
|
419
419
|
({
|
|
420
420
|
label: t,
|
|
421
421
|
placeholder: l,
|
|
@@ -423,29 +423,33 @@ const je = xe(
|
|
|
423
423
|
icon: s,
|
|
424
424
|
rightIcon: m,
|
|
425
425
|
iconPosition: c = "left",
|
|
426
|
-
size:
|
|
426
|
+
size: n = "base",
|
|
427
427
|
error: d,
|
|
428
|
-
disabled:
|
|
428
|
+
disabled: y = !1,
|
|
429
429
|
required: u = !1,
|
|
430
430
|
value: x,
|
|
431
|
-
onChange:
|
|
432
|
-
onFocus:
|
|
433
|
-
onBlur:
|
|
434
|
-
className:
|
|
435
|
-
name:
|
|
436
|
-
maxLength: f = 250
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
431
|
+
onChange: E,
|
|
432
|
+
onFocus: j,
|
|
433
|
+
onBlur: S,
|
|
434
|
+
className: L,
|
|
435
|
+
name: o,
|
|
436
|
+
maxLength: f = 250,
|
|
437
|
+
onClear: v,
|
|
438
|
+
showClearButton: C = !1
|
|
439
|
+
}, g) => {
|
|
440
|
+
const [D, A] = z(!1), [F, I] = z(""), [J, Q] = z(!1), U = x ?? F, G = a === "password", B = C && !!U && !y, H = s && c === "left", _ = s && c === "right" || m || G, X = _ || B, P = () => {
|
|
441
|
+
A(!0), j?.();
|
|
440
442
|
}, re = () => {
|
|
441
|
-
|
|
442
|
-
},
|
|
443
|
-
x === void 0 &&
|
|
444
|
-
},
|
|
443
|
+
A(!1), S?.();
|
|
444
|
+
}, T = (W) => {
|
|
445
|
+
x === void 0 && I(W.target.value), E?.(W);
|
|
446
|
+
}, O = () => Q((W) => !W), h = () => {
|
|
447
|
+
x === void 0 && I(""), v?.();
|
|
448
|
+
}, b = te(
|
|
445
449
|
() => ({
|
|
446
450
|
sm: {
|
|
447
451
|
input: "h-9 text-small",
|
|
448
|
-
padding:
|
|
452
|
+
padding: H && _ ? "pl-7 pr-7" : H ? "pl-7 pr-2" : _ ? "pl-2 pr-7" : "px-2",
|
|
449
453
|
icon: "w-4 h-4",
|
|
450
454
|
leftIcon: "left-2",
|
|
451
455
|
rightIcon: "right-2",
|
|
@@ -454,7 +458,7 @@ const je = xe(
|
|
|
454
458
|
},
|
|
455
459
|
md: {
|
|
456
460
|
input: "h-10 text-small",
|
|
457
|
-
padding:
|
|
461
|
+
padding: H && _ ? "pl-8 pr-8" : H ? "pl-8 pr-2" : _ ? "pl-2 pr-8" : "px-4",
|
|
458
462
|
icon: "w-4 h-4",
|
|
459
463
|
leftIcon: "left-2",
|
|
460
464
|
rightIcon: "right-2",
|
|
@@ -463,7 +467,7 @@ const je = xe(
|
|
|
463
467
|
},
|
|
464
468
|
base: {
|
|
465
469
|
input: "h-12 text-base",
|
|
466
|
-
padding:
|
|
470
|
+
padding: H && _ ? "pl-9 pr-9" : H ? "pl-9 pr-3" : _ ? "pl-3 pr-9" : "px-4",
|
|
467
471
|
icon: "w-5 h-5",
|
|
468
472
|
leftIcon: "left-3",
|
|
469
473
|
rightIcon: "right-3",
|
|
@@ -471,17 +475,17 @@ const je = xe(
|
|
|
471
475
|
iconWrapper: "h-5"
|
|
472
476
|
}
|
|
473
477
|
}),
|
|
474
|
-
[
|
|
475
|
-
),
|
|
476
|
-
return /* @__PURE__ */ i("div", { className: r("w-full",
|
|
478
|
+
[H, _]
|
|
479
|
+
), $ = te(() => d ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [d]), k = te(() => y ? "text-slate-400" : d ? "text-red-600" : D ? "text-black" : "text-slate-400", [d, D, y]);
|
|
480
|
+
return /* @__PURE__ */ i("div", { className: r("w-full", L), children: [
|
|
477
481
|
t && /* @__PURE__ */ i(
|
|
478
482
|
"label",
|
|
479
483
|
{
|
|
480
|
-
htmlFor:
|
|
484
|
+
htmlFor: o,
|
|
481
485
|
className: r(
|
|
482
486
|
"mb-2 block text-base font-medium",
|
|
483
487
|
d ? "text-red-600" : "text-slate-700",
|
|
484
|
-
|
|
488
|
+
b[n].labelFont
|
|
485
489
|
),
|
|
486
490
|
children: [
|
|
487
491
|
t,
|
|
@@ -493,87 +497,101 @@ const je = xe(
|
|
|
493
497
|
/* @__PURE__ */ e(
|
|
494
498
|
"input",
|
|
495
499
|
{
|
|
496
|
-
ref:
|
|
497
|
-
name:
|
|
498
|
-
type:
|
|
499
|
-
value:
|
|
500
|
-
onChange:
|
|
500
|
+
ref: g,
|
|
501
|
+
name: o,
|
|
502
|
+
type: G && J ? "text" : a,
|
|
503
|
+
value: U,
|
|
504
|
+
onChange: T,
|
|
501
505
|
onFocus: P,
|
|
502
506
|
onBlur: re,
|
|
503
|
-
disabled:
|
|
507
|
+
disabled: y,
|
|
504
508
|
required: u,
|
|
505
509
|
autoComplete: "on",
|
|
506
510
|
placeholder: l,
|
|
507
511
|
className: r(
|
|
508
512
|
"w-full border bg-white font-normal transition-all duration-300 ease-in-out outline-none",
|
|
509
|
-
|
|
513
|
+
n === "base" ? "rounded-xl" : "rounded-lg",
|
|
510
514
|
"disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
515
|
+
b[n].input,
|
|
516
|
+
b[n].padding,
|
|
517
|
+
$
|
|
514
518
|
),
|
|
515
519
|
maxLength: f
|
|
516
520
|
}
|
|
517
521
|
),
|
|
518
|
-
|
|
522
|
+
H && /* @__PURE__ */ e(
|
|
519
523
|
"div",
|
|
520
524
|
{
|
|
521
525
|
className: r(
|
|
522
526
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center",
|
|
523
527
|
"transition-all duration-300",
|
|
524
|
-
|
|
525
|
-
|
|
528
|
+
b[n].leftIcon,
|
|
529
|
+
k
|
|
526
530
|
),
|
|
527
531
|
children: /* @__PURE__ */ e(
|
|
528
532
|
"div",
|
|
529
533
|
{
|
|
530
|
-
className: r("flex items-center justify-center",
|
|
531
|
-
children: /* @__PURE__ */ e("span", { className: r("flex items-center justify-center",
|
|
534
|
+
className: r("flex items-center justify-center", b[n].iconWrapper),
|
|
535
|
+
children: /* @__PURE__ */ e("span", { className: r("flex items-center justify-center", b[n].icon), children: s })
|
|
532
536
|
}
|
|
533
537
|
)
|
|
534
538
|
}
|
|
535
539
|
),
|
|
536
|
-
/* @__PURE__ */ i(
|
|
540
|
+
X && /* @__PURE__ */ i(
|
|
537
541
|
"div",
|
|
538
542
|
{
|
|
539
543
|
className: r(
|
|
540
544
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center gap-2",
|
|
541
545
|
"transition-all duration-300",
|
|
542
|
-
|
|
546
|
+
b[n].rightIcon
|
|
543
547
|
),
|
|
544
548
|
children: [
|
|
545
|
-
|
|
549
|
+
B && /* @__PURE__ */ e(
|
|
550
|
+
"button",
|
|
551
|
+
{
|
|
552
|
+
type: "button",
|
|
553
|
+
onClick: h,
|
|
554
|
+
className: r(
|
|
555
|
+
"flex items-center justify-center",
|
|
556
|
+
b[n].iconWrapper,
|
|
557
|
+
"text-slate-base hover:text-black"
|
|
558
|
+
),
|
|
559
|
+
style: { cursor: "pointer" },
|
|
560
|
+
children: /* @__PURE__ */ e("span", { className: r("flex items-center justify-center", b[n].icon), children: /* @__PURE__ */ e(ie, { className: r("h-full w-full") }) })
|
|
561
|
+
}
|
|
562
|
+
),
|
|
563
|
+
m && !G && /* @__PURE__ */ e(
|
|
546
564
|
"div",
|
|
547
565
|
{
|
|
548
|
-
className: r("flex items-center justify-center",
|
|
566
|
+
className: r("flex items-center justify-center", b[n].iconWrapper),
|
|
549
567
|
children: /* @__PURE__ */ e(
|
|
550
568
|
"span",
|
|
551
569
|
{
|
|
552
570
|
className: r(
|
|
553
571
|
"flex items-center justify-center",
|
|
554
|
-
|
|
555
|
-
|
|
572
|
+
b[n].icon,
|
|
573
|
+
k
|
|
556
574
|
),
|
|
557
575
|
children: m
|
|
558
576
|
}
|
|
559
577
|
)
|
|
560
578
|
}
|
|
561
579
|
),
|
|
562
|
-
|
|
580
|
+
G && /* @__PURE__ */ i(ue, { children: [
|
|
563
581
|
m && /* @__PURE__ */ e(
|
|
564
582
|
"div",
|
|
565
583
|
{
|
|
566
584
|
className: r(
|
|
567
585
|
"flex items-center justify-center",
|
|
568
|
-
|
|
586
|
+
b[n].iconWrapper
|
|
569
587
|
),
|
|
570
588
|
children: /* @__PURE__ */ e(
|
|
571
589
|
"span",
|
|
572
590
|
{
|
|
573
591
|
className: r(
|
|
574
592
|
"flex items-center justify-center",
|
|
575
|
-
|
|
576
|
-
|
|
593
|
+
b[n].icon,
|
|
594
|
+
k
|
|
577
595
|
),
|
|
578
596
|
children: m
|
|
579
597
|
}
|
|
@@ -584,33 +602,33 @@ const je = xe(
|
|
|
584
602
|
"button",
|
|
585
603
|
{
|
|
586
604
|
type: "button",
|
|
587
|
-
onClick:
|
|
605
|
+
onClick: O,
|
|
588
606
|
className: r(
|
|
589
607
|
"flex items-center justify-center",
|
|
590
|
-
|
|
591
|
-
|
|
608
|
+
b[n].iconWrapper,
|
|
609
|
+
k
|
|
592
610
|
),
|
|
593
611
|
children: /* @__PURE__ */ e(
|
|
594
612
|
"span",
|
|
595
613
|
{
|
|
596
|
-
className: r("flex items-center justify-center cursor-pointer",
|
|
597
|
-
children:
|
|
614
|
+
className: r("flex items-center justify-center cursor-pointer", b[n].icon),
|
|
615
|
+
children: J ? /* @__PURE__ */ e(Be, { weight: "Linear", className: r("h-full w-full") }) : /* @__PURE__ */ e(Pe, { weight: "Linear", className: r("h-full w-full") })
|
|
598
616
|
}
|
|
599
617
|
)
|
|
600
618
|
}
|
|
601
619
|
)
|
|
602
620
|
] }),
|
|
603
|
-
s && c === "right" && !
|
|
621
|
+
s && c === "right" && !G && /* @__PURE__ */ e(
|
|
604
622
|
"div",
|
|
605
623
|
{
|
|
606
|
-
className: r("flex items-center justify-center",
|
|
624
|
+
className: r("flex items-center justify-center", b[n].iconWrapper),
|
|
607
625
|
children: /* @__PURE__ */ e(
|
|
608
626
|
"span",
|
|
609
627
|
{
|
|
610
628
|
className: r(
|
|
611
629
|
"flex items-center justify-center",
|
|
612
|
-
|
|
613
|
-
|
|
630
|
+
b[n].icon,
|
|
631
|
+
k
|
|
614
632
|
),
|
|
615
633
|
children: s
|
|
616
634
|
}
|
|
@@ -625,7 +643,7 @@ const je = xe(
|
|
|
625
643
|
] });
|
|
626
644
|
}
|
|
627
645
|
);
|
|
628
|
-
|
|
646
|
+
Ae.displayName = "MciInput";
|
|
629
647
|
const ht = {
|
|
630
648
|
uz: {
|
|
631
649
|
months: [
|
|
@@ -731,125 +749,125 @@ const ht = {
|
|
|
731
749
|
placeholder: s,
|
|
732
750
|
label: m,
|
|
733
751
|
disabled: c = !1,
|
|
734
|
-
required:
|
|
752
|
+
required: n = !1,
|
|
735
753
|
className: d,
|
|
736
|
-
format:
|
|
754
|
+
format: y = "DD.MM.YYYY",
|
|
737
755
|
minDate: u,
|
|
738
756
|
maxDate: x,
|
|
739
|
-
error:
|
|
740
|
-
showClear:
|
|
741
|
-
allowManualInput:
|
|
742
|
-
locale:
|
|
743
|
-
startView:
|
|
757
|
+
error: E,
|
|
758
|
+
showClear: j = !0,
|
|
759
|
+
allowManualInput: S = !0,
|
|
760
|
+
locale: L = "uz",
|
|
761
|
+
startView: o = "day"
|
|
744
762
|
}, f) => {
|
|
745
|
-
const [
|
|
763
|
+
const [v, C] = z(!1), [g, D] = z(
|
|
746
764
|
t === "range" ? [null, null] : null
|
|
747
|
-
), [
|
|
748
|
-
(p,
|
|
749
|
-
[
|
|
750
|
-
), h =
|
|
765
|
+
), [A, F] = z([null, null]), [I, J] = z(/* @__PURE__ */ new Date()), [Q, U] = z(o), [G, B] = z(0), [H, _] = z(""), X = ne(null), P = l !== void 0 ? l : g, re = ht[L], T = R((p) => new Date(p.getFullYear(), p.getMonth(), p.getDate()), []), O = R(
|
|
766
|
+
(p, w) => T(p).getTime() === T(w).getTime(),
|
|
767
|
+
[T]
|
|
768
|
+
), h = R(
|
|
751
769
|
(p) => {
|
|
752
|
-
const
|
|
753
|
-
return u &&
|
|
770
|
+
const w = T(p);
|
|
771
|
+
return u && w < T(u) ? !0 : !!(x && w > T(x));
|
|
754
772
|
},
|
|
755
|
-
[u, x,
|
|
756
|
-
),
|
|
773
|
+
[u, x, T]
|
|
774
|
+
), b = R(
|
|
757
775
|
(p) => {
|
|
758
776
|
if (!p) return "";
|
|
759
|
-
const
|
|
760
|
-
return
|
|
777
|
+
const w = p.getDate().toString().padStart(2, "0"), N = (p.getMonth() + 1).toString().padStart(2, "0"), Y = p.getFullYear();
|
|
778
|
+
return y.replace("DD", w).replace("MM", N).replace("YYYY", Y.toString());
|
|
761
779
|
},
|
|
762
|
-
[
|
|
763
|
-
),
|
|
780
|
+
[y]
|
|
781
|
+
), $ = te(() => {
|
|
764
782
|
if (t === "date")
|
|
765
|
-
return
|
|
766
|
-
const [p,
|
|
767
|
-
return !p && !
|
|
768
|
-
}, [t,
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
}, [
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
}, [t,
|
|
775
|
-
|
|
776
|
-
if (
|
|
777
|
-
return document.addEventListener("mousedown",
|
|
778
|
-
document.removeEventListener("mousedown",
|
|
783
|
+
return b(P);
|
|
784
|
+
const [p, w] = P;
|
|
785
|
+
return !p && !w ? "" : p && w ? `${b(p)} - ${b(w)}` : p ? `${b(p)} - ...` : "...";
|
|
786
|
+
}, [t, P, b]);
|
|
787
|
+
Z(() => {
|
|
788
|
+
_($);
|
|
789
|
+
}, [$]);
|
|
790
|
+
const k = R(() => {
|
|
791
|
+
C(!1), U(o), B(0), t === "range" && F(P);
|
|
792
|
+
}, [t, P, o]), { handleClick: W } = ve(X, k), { handleEscape: K } = we(k);
|
|
793
|
+
Z(() => {
|
|
794
|
+
if (v)
|
|
795
|
+
return document.addEventListener("mousedown", W), document.addEventListener("keydown", K), () => {
|
|
796
|
+
document.removeEventListener("mousedown", W), document.removeEventListener("keydown", K);
|
|
779
797
|
};
|
|
780
|
-
}, [
|
|
781
|
-
const ae =
|
|
798
|
+
}, [v, W, K]);
|
|
799
|
+
const ae = R(
|
|
782
800
|
(p) => {
|
|
783
801
|
p.stopPropagation();
|
|
784
|
-
const
|
|
785
|
-
D(
|
|
802
|
+
const w = t === "range" ? [null, null] : null;
|
|
803
|
+
D(w), F([null, null]), _(""), a?.(w);
|
|
786
804
|
},
|
|
787
805
|
[t, a]
|
|
788
|
-
), ye =
|
|
806
|
+
), ye = R(
|
|
789
807
|
(p) => {
|
|
790
808
|
if (h(p)) return;
|
|
791
|
-
const
|
|
809
|
+
const w = T(p);
|
|
792
810
|
if (t === "date")
|
|
793
|
-
D(
|
|
811
|
+
D(w), a?.(w), k();
|
|
794
812
|
else {
|
|
795
|
-
const [
|
|
796
|
-
if (!
|
|
797
|
-
|
|
798
|
-
else if (
|
|
799
|
-
let
|
|
800
|
-
|
|
813
|
+
const [N, Y] = A;
|
|
814
|
+
if (!N && !Y || N && Y)
|
|
815
|
+
F([w, null]);
|
|
816
|
+
else if (N && !Y) {
|
|
817
|
+
let V;
|
|
818
|
+
w < N ? V = [w, N] : V = [N, w], F(V), D(V), a?.(V), k();
|
|
801
819
|
}
|
|
802
820
|
}
|
|
803
821
|
},
|
|
804
|
-
[t,
|
|
822
|
+
[t, A, h, T, a, k]
|
|
805
823
|
), fe = (p) => {
|
|
806
|
-
|
|
807
|
-
const
|
|
808
|
-
return
|
|
824
|
+
J((w) => {
|
|
825
|
+
const N = new Date(w);
|
|
826
|
+
return N.setMonth(N.getMonth() + p), N;
|
|
809
827
|
});
|
|
810
|
-
},
|
|
811
|
-
|
|
812
|
-
const
|
|
813
|
-
return
|
|
828
|
+
}, M = (p) => {
|
|
829
|
+
J((w) => {
|
|
830
|
+
const N = new Date(w);
|
|
831
|
+
return N.setFullYear(N.getFullYear() + p), N;
|
|
814
832
|
});
|
|
815
|
-
}, le =
|
|
833
|
+
}, le = R(
|
|
816
834
|
(p) => {
|
|
817
|
-
const
|
|
818
|
-
for (let
|
|
819
|
-
const
|
|
820
|
-
oe.push({ date:
|
|
835
|
+
const w = p.getFullYear(), N = p.getMonth(), Y = new Date(w, N, 1), V = new Date(w, N + 1, 0), oe = [], se = Y.getDay();
|
|
836
|
+
for (let q = se; q > 0; q--) {
|
|
837
|
+
const ee = new Date(w, N, 1 - q);
|
|
838
|
+
oe.push({ date: ee, isCurrentMonth: !1 });
|
|
821
839
|
}
|
|
822
|
-
for (let
|
|
823
|
-
const
|
|
824
|
-
oe.push({ date:
|
|
840
|
+
for (let q = 1; q <= V.getDate(); q++) {
|
|
841
|
+
const ee = new Date(w, N, q);
|
|
842
|
+
oe.push({ date: ee, isCurrentMonth: !0 });
|
|
825
843
|
}
|
|
826
844
|
const ce = 42 - oe.length;
|
|
827
|
-
for (let
|
|
828
|
-
const
|
|
829
|
-
oe.push({ date:
|
|
845
|
+
for (let q = 1; q <= ce; q++) {
|
|
846
|
+
const ee = new Date(w, N + 1, q);
|
|
847
|
+
oe.push({ date: ee, isCurrentMonth: !1 });
|
|
830
848
|
}
|
|
831
849
|
return oe;
|
|
832
850
|
},
|
|
833
851
|
[]
|
|
834
852
|
), Te = (p) => {
|
|
835
|
-
const
|
|
836
|
-
if (t === "date") return
|
|
837
|
-
const [
|
|
838
|
-
return
|
|
853
|
+
const w = T(p);
|
|
854
|
+
if (t === "date") return P && O(w, P);
|
|
855
|
+
const [N] = A[0] ? A : P;
|
|
856
|
+
return N && O(w, N);
|
|
839
857
|
}, $e = (p) => {
|
|
840
858
|
if (t !== "range") return !1;
|
|
841
|
-
const
|
|
842
|
-
return
|
|
859
|
+
const w = T(p), [, N] = A[1] ? A : P;
|
|
860
|
+
return N && O(w, N);
|
|
843
861
|
}, ze = (p) => {
|
|
844
862
|
if (t !== "range") return !1;
|
|
845
|
-
const
|
|
846
|
-
return !
|
|
847
|
-
}, Ie = (p) =>
|
|
848
|
-
const
|
|
863
|
+
const w = T(p), [N, Y] = A[0] ? A : P;
|
|
864
|
+
return !N || !Y ? !1 : w > T(N) && w < T(Y);
|
|
865
|
+
}, Ie = (p) => O(p, /* @__PURE__ */ new Date()), Ce = (p, w, N) => {
|
|
866
|
+
const Y = le(p);
|
|
849
867
|
return /* @__PURE__ */ i("div", { className: "w-[300px] p-2", children: [
|
|
850
868
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4 py-1", children: [
|
|
851
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-3", children:
|
|
852
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
869
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: w ? /* @__PURE__ */ i(ue, { children: [
|
|
870
|
+
/* @__PURE__ */ e("button", { onClick: () => M(-1), className: "hover:cursor-pointer", children: /* @__PURE__ */ e(Ue, { weight: "Linear", size: 20, className: "text-slate-700" }) }),
|
|
853
871
|
/* @__PURE__ */ e("button", { onClick: () => fe(-1), className: "hover:cursor-pointer", children: /* @__PURE__ */ e(pe, { weight: "Linear", size: 20, className: "text-slate-700" }) })
|
|
854
872
|
] }) : /* @__PURE__ */ e("div", { className: "w-[52px]" }) }),
|
|
855
873
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
@@ -858,9 +876,9 @@ const ht = {
|
|
|
858
876
|
{
|
|
859
877
|
className: "font-medium text-small text-slate-700 cursor-pointer hover:text-blue-600 transition-colors",
|
|
860
878
|
onClick: () => {
|
|
861
|
-
|
|
879
|
+
U("month"), J(p);
|
|
862
880
|
},
|
|
863
|
-
children:
|
|
881
|
+
children: re.months[p.getMonth()]
|
|
864
882
|
}
|
|
865
883
|
),
|
|
866
884
|
/* @__PURE__ */ e(
|
|
@@ -868,29 +886,29 @@ const ht = {
|
|
|
868
886
|
{
|
|
869
887
|
className: "font-medium text-small text-slate-700 cursor-pointer hover:text-blue-600 transition-colors",
|
|
870
888
|
onClick: () => {
|
|
871
|
-
|
|
889
|
+
U("year"), J(p);
|
|
872
890
|
},
|
|
873
891
|
children: p.getFullYear()
|
|
874
892
|
}
|
|
875
893
|
)
|
|
876
894
|
] }),
|
|
877
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children:
|
|
895
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: N ? /* @__PURE__ */ i(ue, { children: [
|
|
878
896
|
/* @__PURE__ */ e("button", { onClick: () => fe(1), className: "hover:cursor-pointer", children: /* @__PURE__ */ e(me, { weight: "Linear", size: 20, className: "text-slate-700" }) }),
|
|
879
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
897
|
+
/* @__PURE__ */ e("button", { onClick: () => M(1), className: "hover:cursor-pointer", children: /* @__PURE__ */ e(_e, { weight: "Linear", size: 20, className: "text-slate-700" }) })
|
|
880
898
|
] }) : /* @__PURE__ */ e("div", { className: "w-[52px]" }) })
|
|
881
899
|
] }),
|
|
882
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 mb-1", children:
|
|
900
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 mb-1", children: re.weekdaysShort.map((V) => /* @__PURE__ */ e(
|
|
883
901
|
"div",
|
|
884
902
|
{
|
|
885
903
|
className: "h-4 flex items-center justify-center text-extra-small font-medium text-blue-600",
|
|
886
|
-
children:
|
|
904
|
+
children: V
|
|
887
905
|
},
|
|
888
|
-
|
|
906
|
+
V
|
|
889
907
|
)) }),
|
|
890
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-y-1 relative", children:
|
|
891
|
-
const se =
|
|
908
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-y-1 relative", children: Y.map((V, oe) => {
|
|
909
|
+
const se = V.date, ce = h(se), q = Te(se), ee = $e(se), We = ze(se), Se = V.isCurrentMonth, Le = Ie(se);
|
|
892
910
|
let be = "";
|
|
893
|
-
return
|
|
911
|
+
return We && (be = "bg-blue-50"), q && (A[1] || P?.[1]) && (be = "bg-gradient-to-r from-transparent via-blue-50 to-blue-50 from-50%"), ee && (A[0] || P?.[0]) && (be = "bg-gradient-to-l from-transparent via-blue-50 to-blue-50 from-50%"), /* @__PURE__ */ e(
|
|
894
912
|
"div",
|
|
895
913
|
{
|
|
896
914
|
className: r(
|
|
@@ -906,13 +924,13 @@ const ht = {
|
|
|
906
924
|
"relative z-10 w-9 h-9 rounded-full flex items-center justify-center text-small font-medium transition-all hover:cursor-pointer",
|
|
907
925
|
Se ? "text-slate-700" : "text-slate-base",
|
|
908
926
|
ce && "opacity-30 cursor-not-allowed",
|
|
909
|
-
!ce && !
|
|
910
|
-
(
|
|
911
|
-
Le && !
|
|
927
|
+
!ce && !q && !ee && Se && "hover:bg-blue-50 hover:text-blue-600",
|
|
928
|
+
(q || ee) && "bg-blue-600 text-white hover:bg-blue-600",
|
|
929
|
+
Le && !q && !ee && "text-blue-600 bg-blue-50"
|
|
912
930
|
),
|
|
913
931
|
children: [
|
|
914
932
|
se.getDate(),
|
|
915
|
-
Le && !
|
|
933
|
+
Le && !q && !ee && /* @__PURE__ */ e(
|
|
916
934
|
"span",
|
|
917
935
|
{
|
|
918
936
|
className: "absolute top-1.5 right-1.5 w-1 h-1 bg-blue-600 rounded-full"
|
|
@@ -928,86 +946,86 @@ const ht = {
|
|
|
928
946
|
] });
|
|
929
947
|
}, Re = () => /* @__PURE__ */ i("div", { className: "w-[300px] p-2", children: [
|
|
930
948
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4 py-1", children: [
|
|
931
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
932
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-small text-slate-700", children:
|
|
933
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
949
|
+
/* @__PURE__ */ e("button", { onClick: () => M(-1), className: "hover:cursor-pointer", children: /* @__PURE__ */ e(pe, { weight: "Linear", size: 20, className: "text-slate-700" }) }),
|
|
950
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-small text-slate-700", children: I.getFullYear() }),
|
|
951
|
+
/* @__PURE__ */ e("button", { onClick: () => M(1), className: "hover:cursor-pointer", children: /* @__PURE__ */ e(me, { weight: "Linear", size: 20, className: "text-slate-700" }) })
|
|
934
952
|
] }),
|
|
935
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1", children:
|
|
953
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1", children: re.monthsShort.map((p, w) => /* @__PURE__ */ e(
|
|
936
954
|
"button",
|
|
937
955
|
{
|
|
938
956
|
onClick: () => {
|
|
939
|
-
const
|
|
940
|
-
|
|
957
|
+
const N = new Date(I);
|
|
958
|
+
N.setMonth(w), J(N), U("day");
|
|
941
959
|
},
|
|
942
960
|
className: r(
|
|
943
961
|
"p-1 rounded-sm text-small font-medium hover:bg-blue-50 transition-colors hover:cursor-pointer",
|
|
944
|
-
|
|
962
|
+
I.getMonth() === w && "bg-blue-600 text-white hover:bg-blue-600"
|
|
945
963
|
),
|
|
946
964
|
children: p
|
|
947
965
|
},
|
|
948
966
|
p
|
|
949
967
|
)) })
|
|
950
968
|
] }), Ye = () => {
|
|
951
|
-
const p =
|
|
969
|
+
const p = I.getFullYear(), w = Math.floor(p / 12) * 12 + G * 12, N = Array.from({ length: 12 }, (Y, V) => w + V);
|
|
952
970
|
return /* @__PURE__ */ i("div", { className: "w-[300px] p-2", children: [
|
|
953
971
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4 py-1", children: [
|
|
954
972
|
/* @__PURE__ */ e(
|
|
955
973
|
"button",
|
|
956
974
|
{
|
|
957
|
-
onClick: () =>
|
|
975
|
+
onClick: () => B((Y) => Y - 1),
|
|
958
976
|
className: "hover:cursor-pointer",
|
|
959
977
|
children: /* @__PURE__ */ e(pe, { weight: "Linear", size: 20, className: "text-slate-700" })
|
|
960
978
|
}
|
|
961
979
|
),
|
|
962
980
|
/* @__PURE__ */ i("span", { className: "font-medium text-small text-slate-700", children: [
|
|
963
|
-
|
|
981
|
+
N[0],
|
|
964
982
|
" - ",
|
|
965
|
-
|
|
983
|
+
N[11]
|
|
966
984
|
] }),
|
|
967
985
|
/* @__PURE__ */ e(
|
|
968
986
|
"button",
|
|
969
987
|
{
|
|
970
|
-
onClick: () =>
|
|
988
|
+
onClick: () => B((Y) => Y + 1),
|
|
971
989
|
className: "hover:cursor-pointer",
|
|
972
990
|
children: /* @__PURE__ */ e(me, { weight: "Linear", size: 20, className: "text-slate-700" })
|
|
973
991
|
}
|
|
974
992
|
)
|
|
975
993
|
] }),
|
|
976
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1", children:
|
|
994
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1", children: N.map((Y) => /* @__PURE__ */ e(
|
|
977
995
|
"button",
|
|
978
996
|
{
|
|
979
997
|
onClick: () => {
|
|
980
|
-
const
|
|
981
|
-
|
|
998
|
+
const V = new Date(I);
|
|
999
|
+
V.setFullYear(Y), J(V), U("month");
|
|
982
1000
|
},
|
|
983
1001
|
className: r(
|
|
984
1002
|
"p-1 rounded-sm text-small font-medium hover:bg-blue-50 transition-colors hover:cursor-pointer",
|
|
985
|
-
|
|
1003
|
+
I.getFullYear() === Y && "bg-blue-600 text-white hover:bg-blue-600"
|
|
986
1004
|
),
|
|
987
|
-
children:
|
|
1005
|
+
children: Y
|
|
988
1006
|
},
|
|
989
|
-
|
|
1007
|
+
Y
|
|
990
1008
|
)) })
|
|
991
1009
|
] });
|
|
992
|
-
}, De = new Date(
|
|
993
|
-
return De.setMonth(
|
|
1010
|
+
}, De = new Date(I);
|
|
1011
|
+
return De.setMonth(I.getMonth() + 1), /* @__PURE__ */ i("div", { ref: X, className: r("relative w-full", d), children: [
|
|
994
1012
|
/* @__PURE__ */ e("div", { ref: f, children: /* @__PURE__ */ e(
|
|
995
|
-
|
|
1013
|
+
Ae,
|
|
996
1014
|
{
|
|
997
1015
|
label: m,
|
|
998
1016
|
placeholder: Array.isArray(s) ? s[0] : s,
|
|
999
|
-
value:
|
|
1017
|
+
value: H,
|
|
1000
1018
|
onChange: () => {
|
|
1001
1019
|
},
|
|
1002
1020
|
icon: /* @__PURE__ */ e(Ve, { weight: "Linear", size: 20, className: "text-slate-500" }),
|
|
1003
1021
|
disabled: c,
|
|
1004
|
-
required:
|
|
1005
|
-
error:
|
|
1006
|
-
onFocus: () => !c &&
|
|
1007
|
-
readOnly: !
|
|
1022
|
+
required: n,
|
|
1023
|
+
error: E,
|
|
1024
|
+
onFocus: () => !c && C(!0),
|
|
1025
|
+
readOnly: !S
|
|
1008
1026
|
}
|
|
1009
1027
|
) }),
|
|
1010
|
-
|
|
1028
|
+
j && H && !c && /* @__PURE__ */ e(
|
|
1011
1029
|
"button",
|
|
1012
1030
|
{
|
|
1013
1031
|
type: "button",
|
|
@@ -1016,14 +1034,14 @@ const ht = {
|
|
|
1016
1034
|
children: /* @__PURE__ */ e(ie, { className: "w-5 h-5 text-slate-400" })
|
|
1017
1035
|
}
|
|
1018
1036
|
),
|
|
1019
|
-
|
|
1037
|
+
v && /* @__PURE__ */ e(
|
|
1020
1038
|
"div",
|
|
1021
1039
|
{
|
|
1022
1040
|
className: "absolute top-full left-0 mt-1 z-50 bg-white rounded-lg shadow-md border border-slate-200 flex flex-col md:flex-row overflow-hidden animate-in fade-in zoom-in-95 duration-200",
|
|
1023
|
-
children:
|
|
1024
|
-
Ce(
|
|
1041
|
+
children: Q === "day" ? /* @__PURE__ */ i(ue, { children: [
|
|
1042
|
+
Ce(I, !0, t !== "range"),
|
|
1025
1043
|
t === "range" && /* @__PURE__ */ e("div", { className: "hidden md:block border-l border-slate-200", children: Ce(De, !1, !0) })
|
|
1026
|
-
] }) :
|
|
1044
|
+
] }) : Q === "month" ? Re() : Ye()
|
|
1027
1045
|
}
|
|
1028
1046
|
)
|
|
1029
1047
|
] });
|
|
@@ -1072,118 +1090,118 @@ const bt = {
|
|
|
1072
1090
|
icon: s,
|
|
1073
1091
|
iconPosition: m = "left",
|
|
1074
1092
|
size: c = "base",
|
|
1075
|
-
error:
|
|
1093
|
+
error: n,
|
|
1076
1094
|
disabled: d = !1,
|
|
1077
|
-
required:
|
|
1095
|
+
required: y = !1,
|
|
1078
1096
|
value: u,
|
|
1079
1097
|
onChange: x,
|
|
1080
|
-
onFocus:
|
|
1081
|
-
onBlur:
|
|
1082
|
-
className:
|
|
1083
|
-
clearable:
|
|
1084
|
-
searchable:
|
|
1098
|
+
onFocus: E,
|
|
1099
|
+
onBlur: j,
|
|
1100
|
+
className: S,
|
|
1101
|
+
clearable: L = !1,
|
|
1102
|
+
searchable: o = !1,
|
|
1085
1103
|
onSearch: f,
|
|
1086
|
-
name:
|
|
1087
|
-
},
|
|
1088
|
-
const [
|
|
1089
|
-
if (!
|
|
1090
|
-
const
|
|
1104
|
+
name: v
|
|
1105
|
+
}, C) => {
|
|
1106
|
+
const [g, D] = z(!1), [A, F] = z(!1), [I, J] = z(""), [Q, U] = z(""), [G, B] = z(-1), H = ne(null), _ = ne(null), X = u !== void 0 ? u : I, P = a.find((M) => M.value === X), re = X !== "" && X !== void 0, T = bt[c], O = te(() => {
|
|
1107
|
+
if (!o || f) return a;
|
|
1108
|
+
const M = Q.toLowerCase();
|
|
1091
1109
|
return a.filter(
|
|
1092
|
-
(le) => le.label.toLowerCase().includes(
|
|
1110
|
+
(le) => le.label.toLowerCase().includes(M)
|
|
1093
1111
|
);
|
|
1094
|
-
}, [a,
|
|
1095
|
-
D(!1),
|
|
1096
|
-
}, [
|
|
1097
|
-
|
|
1098
|
-
if (
|
|
1099
|
-
return document.addEventListener("mousedown",
|
|
1100
|
-
document.removeEventListener("mousedown",
|
|
1112
|
+
}, [a, Q, o, f]), h = R(() => {
|
|
1113
|
+
D(!1), F(!1), U(""), B(-1), j?.();
|
|
1114
|
+
}, [j]), { handleClick: b } = ve(H, h), { handleEscape: $ } = we(h);
|
|
1115
|
+
Z(() => {
|
|
1116
|
+
if (g)
|
|
1117
|
+
return document.addEventListener("mousedown", b), document.addEventListener("keydown", $), () => {
|
|
1118
|
+
document.removeEventListener("mousedown", b), document.removeEventListener("keydown", $);
|
|
1101
1119
|
};
|
|
1102
|
-
}, [
|
|
1103
|
-
|
|
1104
|
-
}, [
|
|
1105
|
-
const
|
|
1106
|
-
(
|
|
1107
|
-
if (!
|
|
1108
|
-
|
|
1120
|
+
}, [g, b, $]), Z(() => {
|
|
1121
|
+
g && o && _.current && _.current.focus();
|
|
1122
|
+
}, [g, o]);
|
|
1123
|
+
const k = R(
|
|
1124
|
+
(M) => {
|
|
1125
|
+
if (!g && (M.key === "ArrowDown" || M.key === "ArrowUp" || M.key === "Enter")) {
|
|
1126
|
+
M.preventDefault(), D(!0);
|
|
1109
1127
|
return;
|
|
1110
1128
|
}
|
|
1111
|
-
if (
|
|
1112
|
-
switch (
|
|
1129
|
+
if (g)
|
|
1130
|
+
switch (M.key) {
|
|
1113
1131
|
case "ArrowDown":
|
|
1114
|
-
|
|
1115
|
-
(le) => le <
|
|
1132
|
+
M.preventDefault(), B(
|
|
1133
|
+
(le) => le < O.length - 1 ? le + 1 : 0
|
|
1116
1134
|
);
|
|
1117
1135
|
break;
|
|
1118
1136
|
case "ArrowUp":
|
|
1119
|
-
|
|
1120
|
-
(le) => le > 0 ? le - 1 :
|
|
1137
|
+
M.preventDefault(), B(
|
|
1138
|
+
(le) => le > 0 ? le - 1 : O.length - 1
|
|
1121
1139
|
);
|
|
1122
1140
|
break;
|
|
1123
1141
|
case "Enter":
|
|
1124
|
-
|
|
1142
|
+
M.preventDefault(), G >= 0 && K(O[G].value);
|
|
1125
1143
|
break;
|
|
1126
1144
|
}
|
|
1127
1145
|
},
|
|
1128
|
-
[
|
|
1129
|
-
),
|
|
1130
|
-
d || (D((
|
|
1131
|
-
}, [d,
|
|
1132
|
-
(
|
|
1133
|
-
u === void 0 &&
|
|
1146
|
+
[g, O, G]
|
|
1147
|
+
), W = R(() => {
|
|
1148
|
+
d || (D((M) => !M), g ? (U(""), B(-1)) : (F(!0), E?.()));
|
|
1149
|
+
}, [d, g, E]), K = R(
|
|
1150
|
+
(M) => {
|
|
1151
|
+
u === void 0 && J(M), x?.(M), D(!1), F(!1), U(""), B(-1), j?.();
|
|
1134
1152
|
},
|
|
1135
|
-
[u, x,
|
|
1136
|
-
), ae =
|
|
1137
|
-
(
|
|
1138
|
-
|
|
1153
|
+
[u, x, j]
|
|
1154
|
+
), ae = R(
|
|
1155
|
+
(M) => {
|
|
1156
|
+
M.stopPropagation(), u === void 0 && J(""), x?.(""), U(""), B(-1);
|
|
1139
1157
|
},
|
|
1140
1158
|
[u, x]
|
|
1141
|
-
), ye =
|
|
1142
|
-
(
|
|
1143
|
-
|
|
1159
|
+
), ye = R(
|
|
1160
|
+
(M) => {
|
|
1161
|
+
U(M), f?.(M), B(0);
|
|
1144
1162
|
},
|
|
1145
1163
|
[f]
|
|
1146
|
-
), fe =
|
|
1147
|
-
return /* @__PURE__ */ i("div", { className: r("w-full",
|
|
1164
|
+
), fe = te(() => n ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [n]);
|
|
1165
|
+
return /* @__PURE__ */ i("div", { className: r("w-full", S), ref: C, children: [
|
|
1148
1166
|
t && /* @__PURE__ */ i(
|
|
1149
1167
|
"label",
|
|
1150
1168
|
{
|
|
1151
|
-
htmlFor:
|
|
1169
|
+
htmlFor: v,
|
|
1152
1170
|
className: r(
|
|
1153
1171
|
"mb-2 block text-base font-medium",
|
|
1154
|
-
|
|
1155
|
-
|
|
1172
|
+
n ? "text-red-600" : "text-slate-700",
|
|
1173
|
+
T.label
|
|
1156
1174
|
),
|
|
1157
1175
|
children: [
|
|
1158
1176
|
t,
|
|
1159
|
-
|
|
1177
|
+
y && /* @__PURE__ */ e("span", { className: "ml-1 text-red-600", children: "*" })
|
|
1160
1178
|
]
|
|
1161
1179
|
}
|
|
1162
1180
|
),
|
|
1163
1181
|
/* @__PURE__ */ i(
|
|
1164
1182
|
"div",
|
|
1165
1183
|
{
|
|
1166
|
-
ref:
|
|
1184
|
+
ref: H,
|
|
1167
1185
|
className: "relative",
|
|
1168
|
-
onKeyDown:
|
|
1186
|
+
onKeyDown: k,
|
|
1169
1187
|
children: [
|
|
1170
1188
|
/* @__PURE__ */ i(
|
|
1171
1189
|
"div",
|
|
1172
1190
|
{
|
|
1173
1191
|
role: "combobox",
|
|
1174
|
-
"aria-expanded":
|
|
1192
|
+
"aria-expanded": g,
|
|
1175
1193
|
"aria-haspopup": "listbox",
|
|
1176
|
-
"aria-controls": `${
|
|
1194
|
+
"aria-controls": `${v}-listbox`,
|
|
1177
1195
|
"aria-disabled": d,
|
|
1178
1196
|
tabIndex: d ? -1 : 0,
|
|
1179
|
-
onClick:
|
|
1197
|
+
onClick: W,
|
|
1180
1198
|
className: r(
|
|
1181
1199
|
"flex w-full items-center rounded-xl border bg-white font-normal transition-all cursor-pointer",
|
|
1182
1200
|
d && "disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
|
|
1183
|
-
|
|
1184
|
-
s ? m === "left" ?
|
|
1201
|
+
T.container,
|
|
1202
|
+
s ? m === "left" ? T.iconPaddingLeft : T.iconPaddingRight : T.padding,
|
|
1185
1203
|
fe,
|
|
1186
|
-
|
|
1204
|
+
A && "shadow-blue border-blue-600"
|
|
1187
1205
|
),
|
|
1188
1206
|
children: [
|
|
1189
1207
|
s && /* @__PURE__ */ e(
|
|
@@ -1191,33 +1209,33 @@ const bt = {
|
|
|
1191
1209
|
{
|
|
1192
1210
|
className: r(
|
|
1193
1211
|
"absolute top-1/2 -translate-y-1/2 pointer-events-none text-slate-400",
|
|
1194
|
-
m === "left" ?
|
|
1212
|
+
m === "left" ? T.iconWrapper : T.rightIconWrapper
|
|
1195
1213
|
),
|
|
1196
1214
|
children: s
|
|
1197
1215
|
}
|
|
1198
1216
|
),
|
|
1199
|
-
|
|
1217
|
+
o && g ? /* @__PURE__ */ e(
|
|
1200
1218
|
"input",
|
|
1201
1219
|
{
|
|
1202
|
-
ref:
|
|
1220
|
+
ref: _,
|
|
1203
1221
|
type: "text",
|
|
1204
|
-
value:
|
|
1205
|
-
onChange: (
|
|
1222
|
+
value: Q,
|
|
1223
|
+
onChange: (M) => ye(M.target.value),
|
|
1206
1224
|
placeholder: l,
|
|
1207
1225
|
className: "w-full bg-transparent outline-none",
|
|
1208
|
-
onClick: (
|
|
1226
|
+
onClick: (M) => M.stopPropagation()
|
|
1209
1227
|
}
|
|
1210
1228
|
) : /* @__PURE__ */ e(
|
|
1211
1229
|
"span",
|
|
1212
1230
|
{
|
|
1213
1231
|
className: r(
|
|
1214
1232
|
"block truncate",
|
|
1215
|
-
!
|
|
1233
|
+
!re && "text-slate-400"
|
|
1216
1234
|
),
|
|
1217
|
-
children:
|
|
1235
|
+
children: P?.label || l
|
|
1218
1236
|
}
|
|
1219
1237
|
),
|
|
1220
|
-
|
|
1238
|
+
L && re && !d && /* @__PURE__ */ e(
|
|
1221
1239
|
"button",
|
|
1222
1240
|
{
|
|
1223
1241
|
type: "button",
|
|
@@ -1227,7 +1245,7 @@ const bt = {
|
|
|
1227
1245
|
s && m === "left" ? "right-8" : "right-10"
|
|
1228
1246
|
),
|
|
1229
1247
|
"aria-label": "Очистить",
|
|
1230
|
-
children: /* @__PURE__ */ e(ie, { className:
|
|
1248
|
+
children: /* @__PURE__ */ e(ie, { className: T.iconSize })
|
|
1231
1249
|
}
|
|
1232
1250
|
),
|
|
1233
1251
|
/* @__PURE__ */ e(
|
|
@@ -1235,44 +1253,44 @@ const bt = {
|
|
|
1235
1253
|
{
|
|
1236
1254
|
className: r(
|
|
1237
1255
|
"absolute top-1/2 right-3 -translate-y-1/2 pointer-events-none transition-transform",
|
|
1238
|
-
|
|
1239
|
-
|
|
1256
|
+
g && "rotate-180",
|
|
1257
|
+
n ? "text-red-600" : g || A ? "text-black" : "text-slate-400"
|
|
1240
1258
|
),
|
|
1241
|
-
children: /* @__PURE__ */ e(Me, { className:
|
|
1259
|
+
children: /* @__PURE__ */ e(Me, { className: T.iconSize })
|
|
1242
1260
|
}
|
|
1243
1261
|
)
|
|
1244
1262
|
]
|
|
1245
1263
|
}
|
|
1246
1264
|
),
|
|
1247
|
-
|
|
1265
|
+
g && /* @__PURE__ */ e(
|
|
1248
1266
|
"div",
|
|
1249
1267
|
{
|
|
1250
|
-
id: `${
|
|
1268
|
+
id: `${v}-listbox`,
|
|
1251
1269
|
role: "listbox",
|
|
1252
1270
|
className: r(
|
|
1253
1271
|
"absolute z-50 mt-1 max-h-60 w-full overflow-y-auto rounded-lg border border-slate-200 bg-white shadow-md p-1 text-black",
|
|
1254
|
-
|
|
1272
|
+
T.dropdown
|
|
1255
1273
|
),
|
|
1256
|
-
children:
|
|
1274
|
+
children: O.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-center text-base font-normal", children: "Ничего не найдено" }) : O.map((M) => /* @__PURE__ */ e(
|
|
1257
1275
|
"div",
|
|
1258
1276
|
{
|
|
1259
1277
|
role: "option",
|
|
1260
|
-
"aria-selected":
|
|
1261
|
-
onClick: () => K(
|
|
1278
|
+
"aria-selected": X === M.value,
|
|
1279
|
+
onClick: () => K(M.value),
|
|
1262
1280
|
className: r(
|
|
1263
1281
|
"cursor-pointer px-3 py-2 font-normal transition-colors hover:bg-slate-100 rounded-sm",
|
|
1264
|
-
|
|
1282
|
+
X === M.value ? "bg-slate-100" : ""
|
|
1265
1283
|
),
|
|
1266
|
-
children:
|
|
1284
|
+
children: M.label
|
|
1267
1285
|
},
|
|
1268
|
-
|
|
1286
|
+
M.value
|
|
1269
1287
|
))
|
|
1270
1288
|
}
|
|
1271
1289
|
)
|
|
1272
1290
|
]
|
|
1273
1291
|
}
|
|
1274
1292
|
),
|
|
1275
|
-
|
|
1293
|
+
n && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-small font-normal text-red-600", children: n })
|
|
1276
1294
|
] });
|
|
1277
1295
|
}
|
|
1278
1296
|
);
|
|
@@ -1308,43 +1326,43 @@ function zt({
|
|
|
1308
1326
|
skeletonRows: s = 5,
|
|
1309
1327
|
noDataText: m = "",
|
|
1310
1328
|
sort: c,
|
|
1311
|
-
onSortChange:
|
|
1329
|
+
onSortChange: n
|
|
1312
1330
|
}) {
|
|
1313
|
-
const [d,
|
|
1314
|
-
const
|
|
1315
|
-
return
|
|
1316
|
-
}), [l, u, c]),
|
|
1317
|
-
if (!
|
|
1331
|
+
const [d, y] = z(null), u = c ?? d, x = te(() => !u || c ? l : [...l].sort((o, f) => {
|
|
1332
|
+
const v = o[u.key], C = f[u.key];
|
|
1333
|
+
return v == null ? 1 : C == null ? -1 : v < C ? u.direction === "asc" ? -1 : 1 : v > C ? u.direction === "asc" ? 1 : -1 : 0;
|
|
1334
|
+
}), [l, u, c]), E = (o) => {
|
|
1335
|
+
if (!o.sortable) return;
|
|
1318
1336
|
let f = null;
|
|
1319
|
-
u?.key !==
|
|
1337
|
+
u?.key !== o.key ? f = { key: o.key, direction: "asc" } : u.direction === "asc" && (f = { key: o.key, direction: "desc" }), c !== void 0 ? n?.(f) : y(f);
|
|
1320
1338
|
};
|
|
1321
|
-
|
|
1322
|
-
c !== void 0 &&
|
|
1339
|
+
Z(() => {
|
|
1340
|
+
c !== void 0 && y(null);
|
|
1323
1341
|
}, [c]);
|
|
1324
|
-
const
|
|
1325
|
-
if (
|
|
1326
|
-
return String(
|
|
1342
|
+
const j = (o) => o.sortable ? !u || u.key !== o.key ? /* @__PURE__ */ e(Je, { weight: "Linear", size: 20, className: "text-slate-base" }) : u.direction === "asc" ? /* @__PURE__ */ e(He, { weight: "Linear", size: 20, className: "text-slate-base" }) : /* @__PURE__ */ e(Oe, { weight: "Linear", size: 20, className: "text-slate-base" }) : null, S = a ? [] : c ? l : x, L = (o) => {
|
|
1343
|
+
if (o != null && (typeof o == "string" || typeof o == "number"))
|
|
1344
|
+
return String(o);
|
|
1327
1345
|
};
|
|
1328
1346
|
return /* @__PURE__ */ e("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ i("div", { className: "inline-block min-w-full align-middle", children: [
|
|
1329
|
-
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-slate-100", children: /* @__PURE__ */ e("table", { className: "w-full table-fixed", children: /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: t?.map((
|
|
1347
|
+
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-slate-100", children: /* @__PURE__ */ e("table", { className: "w-full table-fixed", children: /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: t?.map((o, f) => /* @__PURE__ */ e(
|
|
1330
1348
|
"th",
|
|
1331
1349
|
{
|
|
1332
|
-
onClick: () =>
|
|
1350
|
+
onClick: () => E(o),
|
|
1333
1351
|
className: r(
|
|
1334
1352
|
"px-3 py-4 text-left text-small font-medium text-slate-700 transition-colors",
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1353
|
+
o.align === "center" && "text-center",
|
|
1354
|
+
o.align === "right" && "text-right",
|
|
1355
|
+
o.sortable && "cursor-pointer hover:bg-slate-200"
|
|
1338
1356
|
),
|
|
1339
|
-
style: { width:
|
|
1357
|
+
style: { width: o.width || "auto" },
|
|
1340
1358
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1341
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
1342
|
-
|
|
1359
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: o.title }),
|
|
1360
|
+
j(o)
|
|
1343
1361
|
] })
|
|
1344
1362
|
},
|
|
1345
1363
|
f
|
|
1346
1364
|
)) }) }) }) }),
|
|
1347
|
-
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-white", children: /* @__PURE__ */ e("table", { className: "w-full table-fixed", children: /* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-200", children: a ? Array.from({ length: s }).map((
|
|
1365
|
+
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-white", children: /* @__PURE__ */ e("table", { className: "w-full table-fixed", children: /* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-200", children: a ? Array.from({ length: s }).map((o, f) => /* @__PURE__ */ e("tr", { children: t?.map((v, C) => /* @__PURE__ */ e("td", { className: "px-4 py-3", style: { width: v.width }, children: /* @__PURE__ */ e(gt, { height: 30, variant: "rounded" }) }, C)) }, f)) : S?.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length, className: "py-20", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center", children: [
|
|
1348
1366
|
/* @__PURE__ */ e("div", { className: "relative mb-4", children: /* @__PURE__ */ e(
|
|
1349
1367
|
qe,
|
|
1350
1368
|
{
|
|
@@ -1354,21 +1372,21 @@ function zt({
|
|
|
1354
1372
|
}
|
|
1355
1373
|
) }),
|
|
1356
1374
|
/* @__PURE__ */ e("p", { className: "text-small font-medium text-slate-400", children: m })
|
|
1357
|
-
] }) }) }) :
|
|
1375
|
+
] }) }) }) : S?.map((o, f) => /* @__PURE__ */ e(
|
|
1358
1376
|
"tr",
|
|
1359
1377
|
{
|
|
1360
1378
|
className: "group transition-colors hover:bg-slate-50",
|
|
1361
|
-
children: t?.map((
|
|
1362
|
-
const
|
|
1379
|
+
children: t?.map((v, C) => {
|
|
1380
|
+
const g = o[v.key], D = L(g);
|
|
1363
1381
|
return /* @__PURE__ */ e(
|
|
1364
1382
|
"td",
|
|
1365
1383
|
{
|
|
1366
1384
|
className: r(
|
|
1367
1385
|
"px-3 py-4 text-small font-normal text-black align-top",
|
|
1368
|
-
|
|
1369
|
-
|
|
1386
|
+
v.align === "center" && "text-center",
|
|
1387
|
+
v.align === "right" && "text-right"
|
|
1370
1388
|
),
|
|
1371
|
-
style: { width:
|
|
1389
|
+
style: { width: v.width || "auto" },
|
|
1372
1390
|
children: /* @__PURE__ */ e(
|
|
1373
1391
|
"div",
|
|
1374
1392
|
{
|
|
@@ -1377,12 +1395,12 @@ function zt({
|
|
|
1377
1395
|
"whitespace-normal",
|
|
1378
1396
|
"break-all"
|
|
1379
1397
|
),
|
|
1380
|
-
title:
|
|
1381
|
-
children:
|
|
1398
|
+
title: v.render ? void 0 : D,
|
|
1399
|
+
children: v.render ? v.render(g, o) : String(g ?? "-")
|
|
1382
1400
|
}
|
|
1383
1401
|
)
|
|
1384
1402
|
},
|
|
1385
|
-
|
|
1403
|
+
C
|
|
1386
1404
|
);
|
|
1387
1405
|
})
|
|
1388
1406
|
},
|
|
@@ -1458,17 +1476,17 @@ const xt = {
|
|
|
1458
1476
|
maxFiles: s = 5,
|
|
1459
1477
|
disabled: m = !1,
|
|
1460
1478
|
label: c,
|
|
1461
|
-
required:
|
|
1479
|
+
required: n = !1,
|
|
1462
1480
|
error: d,
|
|
1463
|
-
className:
|
|
1481
|
+
className: y,
|
|
1464
1482
|
onFilesChange: u,
|
|
1465
1483
|
onUpload: x,
|
|
1466
|
-
showPreview:
|
|
1467
|
-
locale:
|
|
1468
|
-
showFileTypeIcon:
|
|
1469
|
-
customValidator:
|
|
1484
|
+
showPreview: E = !0,
|
|
1485
|
+
locale: j = "uz",
|
|
1486
|
+
showFileTypeIcon: S = !0,
|
|
1487
|
+
customValidator: L
|
|
1470
1488
|
}) => {
|
|
1471
|
-
const [
|
|
1489
|
+
const [o, f] = z([]), [v, C] = z(!1), [g, D] = z(!1), A = ne(null), F = xt[j], I = (h) => {
|
|
1472
1490
|
switch (h.type.split("/")[0]) {
|
|
1473
1491
|
case "image":
|
|
1474
1492
|
return /* @__PURE__ */ e(Qe, { className: "h-5 w-5 text-blue-500" });
|
|
@@ -1479,79 +1497,79 @@ const xt = {
|
|
|
1479
1497
|
default:
|
|
1480
1498
|
return h.type.includes("pdf") ? /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-red-500" }) : h.type.includes("word") || h.type.includes("document") ? /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-blue-600" }) : h.type.includes("excel") || h.type.includes("spreadsheet") ? /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-green-600" }) : /* @__PURE__ */ e(Ge, { className: "h-5 w-5 text-gray-500" });
|
|
1481
1499
|
}
|
|
1482
|
-
}, q = (h) => {
|
|
1483
|
-
if (h === 0) return "0 Bytes";
|
|
1484
|
-
const E = 1024, z = ["Bytes", "KB", "MB", "GB"], A = Math.floor(Math.log(h) / Math.log(E));
|
|
1485
|
-
return parseFloat((h / Math.pow(E, A)).toFixed(2)) + " " + z[A];
|
|
1486
1500
|
}, J = (h) => {
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1501
|
+
if (h === 0) return "0 Bytes";
|
|
1502
|
+
const b = 1024, $ = ["Bytes", "KB", "MB", "GB"], k = Math.floor(Math.log(h) / Math.log(b));
|
|
1503
|
+
return parseFloat((h / Math.pow(b, k)).toFixed(2)) + " " + $[k];
|
|
1504
|
+
}, Q = (h) => {
|
|
1505
|
+
const b = a * 1024 * 1024;
|
|
1506
|
+
return h.size <= b;
|
|
1507
|
+
}, U = (h) => l === "*/*" ? !0 : l.split(",").map(($) => $.trim()).some(($) => {
|
|
1508
|
+
if ($.endsWith("/*")) {
|
|
1509
|
+
const k = $.replace("/*", "");
|
|
1510
|
+
return h.type.startsWith(k);
|
|
1493
1511
|
}
|
|
1494
|
-
return h.type ===
|
|
1495
|
-
}),
|
|
1512
|
+
return h.type === $ || h.name.toLowerCase().endsWith($.replace("*.", "."));
|
|
1513
|
+
}), G = (h) => new Promise((b) => {
|
|
1496
1514
|
if (h.type.startsWith("image/")) {
|
|
1497
|
-
const
|
|
1498
|
-
|
|
1515
|
+
const $ = new FileReader();
|
|
1516
|
+
$.onload = (k) => b(k.target?.result), $.readAsDataURL(h);
|
|
1499
1517
|
} else
|
|
1500
|
-
|
|
1501
|
-
}),
|
|
1518
|
+
b("");
|
|
1519
|
+
}), B = R(
|
|
1502
1520
|
async (h) => {
|
|
1503
|
-
const
|
|
1504
|
-
for (const
|
|
1505
|
-
if (
|
|
1506
|
-
alert(
|
|
1521
|
+
const b = Array.from(h), $ = [];
|
|
1522
|
+
for (const k of b) {
|
|
1523
|
+
if (o.length + $.length >= s) {
|
|
1524
|
+
alert(F.maxFilesError(s));
|
|
1507
1525
|
break;
|
|
1508
1526
|
}
|
|
1509
|
-
if (!
|
|
1510
|
-
alert(
|
|
1527
|
+
if (!Q(k)) {
|
|
1528
|
+
alert(F.fileSizeError(k.name, a));
|
|
1511
1529
|
continue;
|
|
1512
1530
|
}
|
|
1513
|
-
if (!
|
|
1514
|
-
alert(
|
|
1531
|
+
if (!U(k)) {
|
|
1532
|
+
alert(F.fileTypeError(k.name));
|
|
1515
1533
|
continue;
|
|
1516
1534
|
}
|
|
1517
|
-
if (
|
|
1518
|
-
const K =
|
|
1535
|
+
if (L) {
|
|
1536
|
+
const K = L(k);
|
|
1519
1537
|
if (K) {
|
|
1520
1538
|
alert(K);
|
|
1521
1539
|
continue;
|
|
1522
1540
|
}
|
|
1523
1541
|
}
|
|
1524
|
-
const
|
|
1525
|
-
|
|
1542
|
+
const W = await G(k);
|
|
1543
|
+
$.push({
|
|
1526
1544
|
id: Math.random().toString(36).substr(2, 9),
|
|
1527
|
-
file:
|
|
1528
|
-
preview:
|
|
1545
|
+
file: k,
|
|
1546
|
+
preview: W,
|
|
1529
1547
|
progress: 0,
|
|
1530
1548
|
status: "uploading"
|
|
1531
1549
|
});
|
|
1532
1550
|
}
|
|
1533
|
-
if (
|
|
1534
|
-
const
|
|
1535
|
-
if (f(
|
|
1551
|
+
if ($.length > 0) {
|
|
1552
|
+
const k = t ? [...o, ...$] : $;
|
|
1553
|
+
if (f(k), u?.(k.map((W) => W.file)), x) {
|
|
1536
1554
|
D(!0);
|
|
1537
1555
|
try {
|
|
1538
|
-
const
|
|
1556
|
+
const W = k.map((K, ae) => ({
|
|
1539
1557
|
...K,
|
|
1540
|
-
progress: Math.min(100, (ae + 1) /
|
|
1558
|
+
progress: Math.min(100, (ae + 1) / k.length * 100)
|
|
1541
1559
|
}));
|
|
1542
|
-
f(
|
|
1560
|
+
f(W), await x(W), f(
|
|
1543
1561
|
(K) => K.map((ae) => ({
|
|
1544
1562
|
...ae,
|
|
1545
1563
|
status: "success",
|
|
1546
1564
|
progress: 100
|
|
1547
1565
|
}))
|
|
1548
1566
|
);
|
|
1549
|
-
} catch (
|
|
1567
|
+
} catch (W) {
|
|
1550
1568
|
f(
|
|
1551
1569
|
(K) => K.map((ae) => ({
|
|
1552
1570
|
...ae,
|
|
1553
1571
|
status: "error",
|
|
1554
|
-
error:
|
|
1572
|
+
error: W instanceof Error ? W.message : F.uploadFailed
|
|
1555
1573
|
}))
|
|
1556
1574
|
);
|
|
1557
1575
|
} finally {
|
|
@@ -1561,58 +1579,58 @@ const xt = {
|
|
|
1561
1579
|
}
|
|
1562
1580
|
},
|
|
1563
1581
|
[
|
|
1564
|
-
|
|
1582
|
+
o,
|
|
1565
1583
|
s,
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1584
|
+
Q,
|
|
1585
|
+
U,
|
|
1586
|
+
L,
|
|
1587
|
+
F,
|
|
1570
1588
|
a,
|
|
1571
1589
|
t,
|
|
1572
1590
|
u,
|
|
1573
1591
|
x
|
|
1574
1592
|
]
|
|
1575
|
-
),
|
|
1593
|
+
), H = R(
|
|
1576
1594
|
(h) => {
|
|
1577
|
-
h.preventDefault(), m ||
|
|
1595
|
+
h.preventDefault(), m || C(!0);
|
|
1578
1596
|
},
|
|
1579
1597
|
[m]
|
|
1580
|
-
),
|
|
1581
|
-
h.preventDefault(),
|
|
1582
|
-
}, []),
|
|
1598
|
+
), _ = R((h) => {
|
|
1599
|
+
h.preventDefault(), C(!1);
|
|
1600
|
+
}, []), X = R(
|
|
1583
1601
|
(h) => {
|
|
1584
|
-
if (h.preventDefault(),
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1602
|
+
if (h.preventDefault(), C(!1), m) return;
|
|
1603
|
+
const b = h.dataTransfer.files;
|
|
1604
|
+
b.length > 0 && B(b);
|
|
1587
1605
|
},
|
|
1588
|
-
[m,
|
|
1589
|
-
),
|
|
1606
|
+
[m, B]
|
|
1607
|
+
), P = R(
|
|
1590
1608
|
(h) => {
|
|
1591
|
-
const
|
|
1592
|
-
|
|
1609
|
+
const b = h.target.files;
|
|
1610
|
+
b && b.length > 0 && (B(b), A.current && (A.current.value = ""));
|
|
1593
1611
|
},
|
|
1594
|
-
[
|
|
1595
|
-
),
|
|
1612
|
+
[B]
|
|
1613
|
+
), re = R(
|
|
1596
1614
|
(h) => {
|
|
1597
|
-
f((
|
|
1598
|
-
const
|
|
1599
|
-
return u?.(
|
|
1615
|
+
f((b) => {
|
|
1616
|
+
const $ = b.filter((k) => k.id !== h);
|
|
1617
|
+
return u?.($.map((k) => k.file)), $;
|
|
1600
1618
|
});
|
|
1601
1619
|
},
|
|
1602
1620
|
[u]
|
|
1603
|
-
),
|
|
1621
|
+
), T = R(() => {
|
|
1604
1622
|
f([]), u?.([]);
|
|
1605
|
-
}, [u]),
|
|
1606
|
-
|
|
1623
|
+
}, [u]), O = R(() => {
|
|
1624
|
+
A.current?.click();
|
|
1607
1625
|
}, []);
|
|
1608
|
-
return /* @__PURE__ */ i("div", { className: r("w-full",
|
|
1626
|
+
return /* @__PURE__ */ i("div", { className: r("w-full", y), children: [
|
|
1609
1627
|
c && /* @__PURE__ */ i(
|
|
1610
1628
|
"label",
|
|
1611
1629
|
{
|
|
1612
1630
|
className: r("mb-2 block text-base font-medium text-slate-700", d ? "text-red-600" : "text-slate-700"),
|
|
1613
1631
|
children: [
|
|
1614
1632
|
c,
|
|
1615
|
-
|
|
1633
|
+
n && /* @__PURE__ */ e("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
|
|
1616
1634
|
]
|
|
1617
1635
|
}
|
|
1618
1636
|
),
|
|
@@ -1622,23 +1640,23 @@ const xt = {
|
|
|
1622
1640
|
className: r(
|
|
1623
1641
|
"cursor-pointer border border-dashed rounded-2xl p-6 text-center transition-all duration-300",
|
|
1624
1642
|
"border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600",
|
|
1625
|
-
|
|
1643
|
+
v && "border-solid border-slate-600 bg-slate-100",
|
|
1626
1644
|
"disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
|
|
1627
1645
|
d && "border-red-600 focus:border-red-600 shadow-red"
|
|
1628
1646
|
),
|
|
1629
|
-
onDragOver:
|
|
1630
|
-
onDragLeave:
|
|
1631
|
-
onDrop:
|
|
1632
|
-
onClick:
|
|
1647
|
+
onDragOver: H,
|
|
1648
|
+
onDragLeave: _,
|
|
1649
|
+
onDrop: X,
|
|
1650
|
+
onClick: O,
|
|
1633
1651
|
children: [
|
|
1634
1652
|
/* @__PURE__ */ e(
|
|
1635
1653
|
"input",
|
|
1636
1654
|
{
|
|
1637
|
-
ref:
|
|
1655
|
+
ref: A,
|
|
1638
1656
|
type: "file",
|
|
1639
1657
|
multiple: t,
|
|
1640
1658
|
accept: l,
|
|
1641
|
-
onChange:
|
|
1659
|
+
onChange: P,
|
|
1642
1660
|
disabled: m,
|
|
1643
1661
|
className: "hidden"
|
|
1644
1662
|
}
|
|
@@ -1656,38 +1674,38 @@ const xt = {
|
|
|
1656
1674
|
),
|
|
1657
1675
|
/* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
1658
1676
|
/* @__PURE__ */ i("p", { className: "text-small font-medium text-slate-700", children: [
|
|
1659
|
-
|
|
1677
|
+
F.dragAndDrop,
|
|
1660
1678
|
" ",
|
|
1661
|
-
|
|
1679
|
+
F.or.toLowerCase(),
|
|
1662
1680
|
" ",
|
|
1663
|
-
|
|
1681
|
+
F.clickToUpload
|
|
1664
1682
|
] }),
|
|
1665
|
-
/* @__PURE__ */ e("p", { className: "text-small font-normal text-slate-700", children:
|
|
1683
|
+
/* @__PURE__ */ e("p", { className: "text-small font-normal text-slate-700", children: F.fileRequirements(t, s, a, l) })
|
|
1666
1684
|
] })
|
|
1667
1685
|
] })
|
|
1668
1686
|
]
|
|
1669
1687
|
}
|
|
1670
1688
|
),
|
|
1671
|
-
|
|
1689
|
+
o.length > 0 && /* @__PURE__ */ i("div", { className: "mt-4 space-y-3", children: [
|
|
1672
1690
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1673
1691
|
/* @__PURE__ */ i("span", { className: "text-small font-medium text-slate-700", children: [
|
|
1674
|
-
|
|
1692
|
+
F.selectedFiles,
|
|
1675
1693
|
" (",
|
|
1676
|
-
|
|
1694
|
+
o.length,
|
|
1677
1695
|
")"
|
|
1678
1696
|
] }),
|
|
1679
|
-
|
|
1697
|
+
o.length > 1 && /* @__PURE__ */ e(
|
|
1680
1698
|
"button",
|
|
1681
1699
|
{
|
|
1682
1700
|
type: "button",
|
|
1683
|
-
onClick:
|
|
1684
|
-
disabled: m ||
|
|
1701
|
+
onClick: T,
|
|
1702
|
+
disabled: m || g,
|
|
1685
1703
|
className: "text-small text-red-600 disabled:opacity-50",
|
|
1686
|
-
children:
|
|
1704
|
+
children: F.clearAll
|
|
1687
1705
|
}
|
|
1688
1706
|
)
|
|
1689
1707
|
] }),
|
|
1690
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
1708
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: o.map((h) => /* @__PURE__ */ i(
|
|
1691
1709
|
"div",
|
|
1692
1710
|
{
|
|
1693
1711
|
className: r(
|
|
@@ -1696,27 +1714,27 @@ const xt = {
|
|
|
1696
1714
|
),
|
|
1697
1715
|
children: [
|
|
1698
1716
|
/* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 items-center space-x-3", children: [
|
|
1699
|
-
|
|
1717
|
+
E && h.preview ? /* @__PURE__ */ e(
|
|
1700
1718
|
"img",
|
|
1701
1719
|
{
|
|
1702
1720
|
src: h.preview,
|
|
1703
1721
|
alt: h.file.name,
|
|
1704
1722
|
className: "h-10 w-10 rounded object-cover"
|
|
1705
1723
|
}
|
|
1706
|
-
) :
|
|
1724
|
+
) : S ? /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: I(h.file) }) : null,
|
|
1707
1725
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
1708
1726
|
/* @__PURE__ */ e("p", { className: "truncate text-small font-medium text-slate-700", children: h.file.name }),
|
|
1709
1727
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2 text-small text-slate-400", children: [
|
|
1710
|
-
/* @__PURE__ */ e("span", { children:
|
|
1728
|
+
/* @__PURE__ */ e("span", { children: J(h.file.size) }),
|
|
1711
1729
|
h.status === "uploading" && /* @__PURE__ */ i("span", { className: "flex items-center", children: [
|
|
1712
|
-
/* @__PURE__ */ e(
|
|
1713
|
-
|
|
1730
|
+
/* @__PURE__ */ e(je, { className: "h-5 w-5 mr-1 animate-spin" }),
|
|
1731
|
+
F.uploading
|
|
1714
1732
|
] }),
|
|
1715
1733
|
h.status === "success" && /* @__PURE__ */ e(
|
|
1716
1734
|
"span",
|
|
1717
1735
|
{
|
|
1718
1736
|
className: "flex items-center text-small font-normal text-green-600",
|
|
1719
|
-
children:
|
|
1737
|
+
children: F.success
|
|
1720
1738
|
}
|
|
1721
1739
|
)
|
|
1722
1740
|
] }),
|
|
@@ -1734,10 +1752,10 @@ const xt = {
|
|
|
1734
1752
|
"button",
|
|
1735
1753
|
{
|
|
1736
1754
|
type: "button",
|
|
1737
|
-
onClick: (
|
|
1738
|
-
|
|
1755
|
+
onClick: (b) => {
|
|
1756
|
+
b.stopPropagation(), re(h.id);
|
|
1739
1757
|
},
|
|
1740
|
-
disabled: m ||
|
|
1758
|
+
disabled: m || g,
|
|
1741
1759
|
className: "text-slate-base transition-colors active:rotate-180 hover:cursor-pointer disabled:opacity-50",
|
|
1742
1760
|
children: /* @__PURE__ */ e(ie, { className: "h-6 w-6" })
|
|
1743
1761
|
}
|
|
@@ -1757,15 +1775,15 @@ function Rt({
|
|
|
1757
1775
|
description: s,
|
|
1758
1776
|
Header: m,
|
|
1759
1777
|
Body: c,
|
|
1760
|
-
footer:
|
|
1778
|
+
footer: n,
|
|
1761
1779
|
handleClickOutside: d = !1
|
|
1762
1780
|
}) {
|
|
1763
|
-
const
|
|
1764
|
-
|
|
1765
|
-
const { handleClick: x } = ve(
|
|
1781
|
+
const y = ne(null), { handleEscape: u } = we(() => l(!1));
|
|
1782
|
+
Z(() => (t ? (document.addEventListener("keydown", u), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => document.removeEventListener("keydown", u)), [t, u]);
|
|
1783
|
+
const { handleClick: x } = ve(y, () => {
|
|
1766
1784
|
d && l(!1);
|
|
1767
1785
|
});
|
|
1768
|
-
return
|
|
1786
|
+
return Z(() => (t && d && document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x)), [t, x, d]), /* @__PURE__ */ e(
|
|
1769
1787
|
"div",
|
|
1770
1788
|
{
|
|
1771
1789
|
className: r(
|
|
@@ -1775,7 +1793,7 @@ function Rt({
|
|
|
1775
1793
|
children: /* @__PURE__ */ i(
|
|
1776
1794
|
"div",
|
|
1777
1795
|
{
|
|
1778
|
-
ref:
|
|
1796
|
+
ref: y,
|
|
1779
1797
|
className: r(
|
|
1780
1798
|
"relative bg-white w-full max-w-[720px] rounded-2xl",
|
|
1781
1799
|
"transform transition-all duration-500 ease-out",
|
|
@@ -1797,7 +1815,7 @@ function Rt({
|
|
|
1797
1815
|
)
|
|
1798
1816
|
] }),
|
|
1799
1817
|
c && /* @__PURE__ */ e("div", { className: "scrollbar-thin scrollbar-thumb-slate-200 max-h-96 px-6 overflow-y-auto mb-2", children: c }),
|
|
1800
|
-
|
|
1818
|
+
n && /* @__PURE__ */ e("div", { className: "flex items-center justify-end gap-3 border-t border-slate-200 p-6", children: n })
|
|
1801
1819
|
]
|
|
1802
1820
|
}
|
|
1803
1821
|
)
|
|
@@ -1811,26 +1829,26 @@ function Yt({
|
|
|
1811
1829
|
onPageChange: s,
|
|
1812
1830
|
onPerPageChange: m,
|
|
1813
1831
|
siblingCount: c = 1,
|
|
1814
|
-
perPageOptions:
|
|
1832
|
+
perPageOptions: n = [10, 30, 50, 100],
|
|
1815
1833
|
showPerPage: d = !0,
|
|
1816
|
-
variant:
|
|
1834
|
+
variant: y = "yellow",
|
|
1817
1835
|
size: u = "large",
|
|
1818
1836
|
paginationClassName: x
|
|
1819
1837
|
}) {
|
|
1820
|
-
const
|
|
1821
|
-
if (
|
|
1838
|
+
const E = Number.isFinite(t) && t > 0 ? t : 0, j = Number.isFinite(a) && a > 0 ? a : 10, S = Math.max(1, Number.isFinite(l) ? l : 1), L = Math.ceil(E / j);
|
|
1839
|
+
if (L <= 1 || E === 0) return null;
|
|
1822
1840
|
const f = (() => {
|
|
1823
|
-
const
|
|
1824
|
-
if (
|
|
1825
|
-
return Array.from({ length:
|
|
1826
|
-
const
|
|
1827
|
-
|
|
1828
|
-
for (let
|
|
1829
|
-
return
|
|
1830
|
-
})(),
|
|
1841
|
+
const g = [], D = c * 2 + 5;
|
|
1842
|
+
if (L <= D)
|
|
1843
|
+
return Array.from({ length: L }, (I, J) => J + 1);
|
|
1844
|
+
const A = Math.max(S - c, 2), F = Math.min(S + c, L - 1);
|
|
1845
|
+
g.push(1), A > 2 && g.push("...");
|
|
1846
|
+
for (let I = A; I <= F; I++) g.push(I);
|
|
1847
|
+
return F < L - 1 && g.push("..."), L > 1 && g.push(L), g;
|
|
1848
|
+
})(), v = {
|
|
1831
1849
|
medium: "h-9 text-small",
|
|
1832
1850
|
large: "h-10 text-base"
|
|
1833
|
-
}[u],
|
|
1851
|
+
}[u], C = {
|
|
1834
1852
|
yellow: {
|
|
1835
1853
|
active: "bg-yellow-500 text-white border-yellow-500",
|
|
1836
1854
|
inactive: "bg-slate-100 border-slate-200 text-black hover:bg-slate-200",
|
|
@@ -1843,7 +1861,7 @@ function Yt({
|
|
|
1843
1861
|
disabled: "text-slate-400 border-slate-300",
|
|
1844
1862
|
arrow: "text-black"
|
|
1845
1863
|
}
|
|
1846
|
-
}[
|
|
1864
|
+
}[y ?? "yellow"];
|
|
1847
1865
|
return /* @__PURE__ */ i("div", { className: r(
|
|
1848
1866
|
"flex items-center justify-between gap-4 w-full",
|
|
1849
1867
|
x
|
|
@@ -1860,14 +1878,14 @@ function Yt({
|
|
|
1860
1878
|
/* @__PURE__ */ e(
|
|
1861
1879
|
"select",
|
|
1862
1880
|
{
|
|
1863
|
-
value:
|
|
1864
|
-
onChange: (
|
|
1881
|
+
value: j,
|
|
1882
|
+
onChange: (g) => m(Number(g.target.value)),
|
|
1865
1883
|
className: r(
|
|
1866
1884
|
"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",
|
|
1867
1885
|
u === "large" ? "h-10" : "h-9"
|
|
1868
1886
|
),
|
|
1869
1887
|
"aria-label": "Количество строк на странице",
|
|
1870
|
-
children:
|
|
1888
|
+
children: n.map((g) => /* @__PURE__ */ e("option", { value: g, children: g }, g))
|
|
1871
1889
|
}
|
|
1872
1890
|
),
|
|
1873
1891
|
/* @__PURE__ */ e(
|
|
@@ -1884,41 +1902,41 @@ function Yt({
|
|
|
1884
1902
|
/* @__PURE__ */ e(
|
|
1885
1903
|
"button",
|
|
1886
1904
|
{
|
|
1887
|
-
onClick: () => s(
|
|
1888
|
-
disabled:
|
|
1905
|
+
onClick: () => s(S - 1),
|
|
1906
|
+
disabled: S === 1,
|
|
1889
1907
|
"aria-label": "Предыдущая страница",
|
|
1890
1908
|
className: r(
|
|
1891
1909
|
"flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
|
|
1892
|
-
|
|
1893
|
-
|
|
1910
|
+
v,
|
|
1911
|
+
S === 1 ? r("cursor-not-allowed opacity-50", C.disabled) : r("hover:cursor-pointer", C.arrow, "border-slate-200")
|
|
1894
1912
|
),
|
|
1895
1913
|
children: /* @__PURE__ */ e(pe, { weight: "Linear", size: 20 })
|
|
1896
1914
|
}
|
|
1897
1915
|
),
|
|
1898
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: f.map((
|
|
1899
|
-
if (
|
|
1916
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: f.map((g, D) => {
|
|
1917
|
+
if (g === "...")
|
|
1900
1918
|
return /* @__PURE__ */ e(
|
|
1901
1919
|
"span",
|
|
1902
1920
|
{
|
|
1903
|
-
className: r("flex items-center justify-center text-black font-medium min-w-10",
|
|
1921
|
+
className: r("flex items-center justify-center text-black font-medium min-w-10", v),
|
|
1904
1922
|
"aria-hidden": "true",
|
|
1905
1923
|
children: /* @__PURE__ */ e(et, { weight: "Bold", size: 20 })
|
|
1906
1924
|
},
|
|
1907
1925
|
D
|
|
1908
1926
|
);
|
|
1909
|
-
const
|
|
1927
|
+
const A = g === S;
|
|
1910
1928
|
return /* @__PURE__ */ e(
|
|
1911
1929
|
"button",
|
|
1912
1930
|
{
|
|
1913
|
-
onClick: () => s(
|
|
1914
|
-
"aria-label": `Страница ${
|
|
1915
|
-
"aria-current":
|
|
1931
|
+
onClick: () => s(g),
|
|
1932
|
+
"aria-label": `Страница ${g}${A ? ", текущая" : ""}`,
|
|
1933
|
+
"aria-current": A ? "page" : void 0,
|
|
1916
1934
|
className: r(
|
|
1917
1935
|
"flex items-center justify-center rounded-lg border font-medium transition-all hover:cursor-pointer min-w-10 px-2",
|
|
1918
|
-
|
|
1919
|
-
|
|
1936
|
+
v,
|
|
1937
|
+
A ? C.active : C.inactive
|
|
1920
1938
|
),
|
|
1921
|
-
children:
|
|
1939
|
+
children: g
|
|
1922
1940
|
},
|
|
1923
1941
|
D
|
|
1924
1942
|
);
|
|
@@ -1926,13 +1944,13 @@ function Yt({
|
|
|
1926
1944
|
/* @__PURE__ */ e(
|
|
1927
1945
|
"button",
|
|
1928
1946
|
{
|
|
1929
|
-
onClick: () => s(
|
|
1930
|
-
disabled:
|
|
1947
|
+
onClick: () => s(S + 1),
|
|
1948
|
+
disabled: S === L,
|
|
1931
1949
|
"aria-label": "Следующая страница",
|
|
1932
1950
|
className: r(
|
|
1933
1951
|
"flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
|
|
1934
|
-
|
|
1935
|
-
|
|
1952
|
+
v,
|
|
1953
|
+
S === L ? r("cursor-not-allowed opacity-50", C.disabled) : r("hover:cursor-pointer", C.arrow, "border-slate-200")
|
|
1936
1954
|
),
|
|
1937
1955
|
children: /* @__PURE__ */ e(me, { size: 20, weight: "Linear" })
|
|
1938
1956
|
}
|
|
@@ -1940,51 +1958,51 @@ function Yt({
|
|
|
1940
1958
|
] })
|
|
1941
1959
|
] });
|
|
1942
1960
|
}
|
|
1943
|
-
function
|
|
1961
|
+
function Wt({
|
|
1944
1962
|
tabs: t,
|
|
1945
1963
|
defaultTab: l,
|
|
1946
1964
|
position: a = "top",
|
|
1947
1965
|
className: s,
|
|
1948
1966
|
onChange: m
|
|
1949
1967
|
}) {
|
|
1950
|
-
const [c,
|
|
1951
|
-
const
|
|
1968
|
+
const [c, n] = z(l || t[0]?.id), [d, y] = z({}), u = ne([]), x = () => {
|
|
1969
|
+
const o = t.findIndex((v) => v?.id === c), f = u.current[o];
|
|
1952
1970
|
if (f) {
|
|
1953
|
-
const { offsetLeft:
|
|
1954
|
-
|
|
1955
|
-
left: `${
|
|
1956
|
-
top: `${
|
|
1957
|
-
width: `${
|
|
1971
|
+
const { offsetLeft: v, offsetTop: C, offsetWidth: g, offsetHeight: D } = f;
|
|
1972
|
+
y({
|
|
1973
|
+
left: `${v}px`,
|
|
1974
|
+
top: `${C}px`,
|
|
1975
|
+
width: `${g}px`,
|
|
1958
1976
|
height: `${D}px`,
|
|
1959
1977
|
transition: "all 0.4s cubic-bezier(0.25, 1, 0.5, 1)"
|
|
1960
1978
|
});
|
|
1961
1979
|
}
|
|
1962
1980
|
};
|
|
1963
|
-
|
|
1964
|
-
const
|
|
1981
|
+
Z(() => (x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x)), [c, a, t]);
|
|
1982
|
+
const E = {
|
|
1965
1983
|
top: "flex-col",
|
|
1966
1984
|
bottom: "flex-col-reverse",
|
|
1967
1985
|
left: "flex-row",
|
|
1968
1986
|
right: "flex-row-reverse"
|
|
1969
|
-
},
|
|
1987
|
+
}, j = {
|
|
1970
1988
|
top: "flex-row",
|
|
1971
1989
|
bottom: "flex-row",
|
|
1972
1990
|
left: "flex-col",
|
|
1973
1991
|
right: "flex-col"
|
|
1974
|
-
},
|
|
1992
|
+
}, S = {
|
|
1975
1993
|
top: "mt-6",
|
|
1976
1994
|
bottom: "mb-6",
|
|
1977
1995
|
left: "ml-6",
|
|
1978
1996
|
right: "mr-6"
|
|
1979
|
-
},
|
|
1980
|
-
return /* @__PURE__ */ i("div", { className: r("flex w-full",
|
|
1997
|
+
}, L = a === "left" || a === "right";
|
|
1998
|
+
return /* @__PURE__ */ i("div", { className: r("flex w-full", E[a], s), children: [
|
|
1981
1999
|
/* @__PURE__ */ i(
|
|
1982
2000
|
"div",
|
|
1983
2001
|
{
|
|
1984
2002
|
className: r(
|
|
1985
2003
|
"relative flex rounded-xl bg-slate-100 p-1",
|
|
1986
|
-
|
|
1987
|
-
|
|
2004
|
+
j[a],
|
|
2005
|
+
L ? "min-w-48" : "w-full"
|
|
1988
2006
|
),
|
|
1989
2007
|
children: [
|
|
1990
2008
|
/* @__PURE__ */ e(
|
|
@@ -1992,53 +2010,53 @@ function Bt({
|
|
|
1992
2010
|
{
|
|
1993
2011
|
className: r(
|
|
1994
2012
|
"absolute bg-white rounded-lg",
|
|
1995
|
-
|
|
2013
|
+
L ? "w-full" : "h-full"
|
|
1996
2014
|
),
|
|
1997
2015
|
style: d
|
|
1998
2016
|
}
|
|
1999
2017
|
),
|
|
2000
|
-
t?.map((
|
|
2001
|
-
const
|
|
2018
|
+
t?.map((o, f) => {
|
|
2019
|
+
const v = c === o.id;
|
|
2002
2020
|
return /* @__PURE__ */ i(
|
|
2003
2021
|
"button",
|
|
2004
2022
|
{
|
|
2005
|
-
ref: (
|
|
2006
|
-
u.current[f] =
|
|
2023
|
+
ref: (C) => {
|
|
2024
|
+
u.current[f] = C;
|
|
2007
2025
|
},
|
|
2008
2026
|
onClick: () => {
|
|
2009
|
-
|
|
2027
|
+
o?.disabled || (n(o?.id), m?.(o?.id));
|
|
2010
2028
|
},
|
|
2011
|
-
disabled:
|
|
2029
|
+
disabled: o?.disabled,
|
|
2012
2030
|
className: r(
|
|
2013
2031
|
"relative flex cursor-pointer text-black text-base font-normal items-center justify-center gap-2 px-5 py-2 z-10 whitespace-nowrap transition-colors duration-300",
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2032
|
+
v ? "" : "text-slate-500 hover:text-slate-700",
|
|
2033
|
+
o?.disabled && "opacity-50 cursor-not-allowed",
|
|
2034
|
+
L ? "w-full justify-start" : "flex-1"
|
|
2017
2035
|
),
|
|
2018
2036
|
children: [
|
|
2019
|
-
|
|
2037
|
+
o?.icon && /* @__PURE__ */ e(
|
|
2020
2038
|
"span",
|
|
2021
2039
|
{
|
|
2022
2040
|
className: r(
|
|
2023
2041
|
"flex-shrink-0 transition-transform duration-200",
|
|
2024
|
-
|
|
2042
|
+
v && "scale-110"
|
|
2025
2043
|
),
|
|
2026
|
-
children:
|
|
2044
|
+
children: o?.icon
|
|
2027
2045
|
}
|
|
2028
2046
|
),
|
|
2029
|
-
/* @__PURE__ */ e("span", { className: "relative z-10", children:
|
|
2047
|
+
/* @__PURE__ */ e("span", { className: "relative z-10", children: o?.label })
|
|
2030
2048
|
]
|
|
2031
2049
|
},
|
|
2032
|
-
|
|
2050
|
+
o?.id
|
|
2033
2051
|
);
|
|
2034
2052
|
})
|
|
2035
2053
|
]
|
|
2036
2054
|
}
|
|
2037
2055
|
),
|
|
2038
|
-
/* @__PURE__ */ e("div", { className: r("flex-1 overflow-hidden",
|
|
2056
|
+
/* @__PURE__ */ e("div", { className: r("flex-1 overflow-hidden", S[a]), children: /* @__PURE__ */ e("div", { className: "animate-fade-in", style: { animationDuration: "0.4s" }, children: t?.find((o) => o?.id === c)?.content }, c) })
|
|
2039
2057
|
] });
|
|
2040
2058
|
}
|
|
2041
|
-
function
|
|
2059
|
+
function Bt({ children: t, className: l }) {
|
|
2042
2060
|
return /* @__PURE__ */ e(
|
|
2043
2061
|
"div",
|
|
2044
2062
|
{
|
|
@@ -2099,19 +2117,19 @@ const yt = xe(
|
|
|
2099
2117
|
onChange: s,
|
|
2100
2118
|
required: m = !1,
|
|
2101
2119
|
disabled: c = !1,
|
|
2102
|
-
error:
|
|
2120
|
+
error: n,
|
|
2103
2121
|
className: d,
|
|
2104
|
-
rows:
|
|
2122
|
+
rows: y = 4,
|
|
2105
2123
|
name: u
|
|
2106
2124
|
}, x) => {
|
|
2107
|
-
const
|
|
2125
|
+
const E = te(() => n ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [n]);
|
|
2108
2126
|
return /* @__PURE__ */ i("div", { className: r("relative w-full", d), children: [
|
|
2109
2127
|
t && /* @__PURE__ */ i(
|
|
2110
2128
|
"label",
|
|
2111
2129
|
{
|
|
2112
2130
|
className: r(
|
|
2113
2131
|
"mb-2 block text-base font-medium",
|
|
2114
|
-
|
|
2132
|
+
n ? "text-red-600" : "text-slate-700"
|
|
2115
2133
|
),
|
|
2116
2134
|
children: [
|
|
2117
2135
|
t,
|
|
@@ -2124,19 +2142,19 @@ const yt = xe(
|
|
|
2124
2142
|
{
|
|
2125
2143
|
ref: x,
|
|
2126
2144
|
name: u,
|
|
2127
|
-
rows:
|
|
2145
|
+
rows: y,
|
|
2128
2146
|
value: a,
|
|
2129
|
-
onChange: (
|
|
2147
|
+
onChange: (j) => s?.(j.target.value),
|
|
2130
2148
|
disabled: c,
|
|
2131
2149
|
placeholder: l,
|
|
2132
2150
|
className: r(
|
|
2133
2151
|
"w-full resize-none rounded-xl border bg-white text-base font-normal transition-all duration-300 ease-in-out outline-none",
|
|
2134
2152
|
"p-3 disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
|
|
2135
|
-
|
|
2153
|
+
E
|
|
2136
2154
|
)
|
|
2137
2155
|
}
|
|
2138
2156
|
),
|
|
2139
|
-
|
|
2157
|
+
n && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-small font-normal text-red-600", children: n })
|
|
2140
2158
|
] });
|
|
2141
2159
|
}
|
|
2142
2160
|
);
|
|
@@ -2159,21 +2177,21 @@ function Mt({
|
|
|
2159
2177
|
action: m,
|
|
2160
2178
|
onClose: c
|
|
2161
2179
|
}) {
|
|
2162
|
-
const [
|
|
2163
|
-
|
|
2180
|
+
const [n, d] = z(100);
|
|
2181
|
+
Z(() => {
|
|
2164
2182
|
if (s === 1 / 0) {
|
|
2165
2183
|
d(100);
|
|
2166
2184
|
return;
|
|
2167
2185
|
}
|
|
2168
2186
|
let x = null;
|
|
2169
|
-
const
|
|
2170
|
-
x || (x =
|
|
2171
|
-
const
|
|
2172
|
-
d(
|
|
2173
|
-
},
|
|
2174
|
-
return () => cancelAnimationFrame(
|
|
2187
|
+
const E = (S) => {
|
|
2188
|
+
x || (x = S);
|
|
2189
|
+
const L = S - x, o = Math.max(0, (s - L) / s * 100);
|
|
2190
|
+
d(o), o > 0 ? requestAnimationFrame(E) : c?.();
|
|
2191
|
+
}, j = requestAnimationFrame(E);
|
|
2192
|
+
return () => cancelAnimationFrame(j);
|
|
2175
2193
|
}, [s, c]);
|
|
2176
|
-
const
|
|
2194
|
+
const y = {
|
|
2177
2195
|
success: /* @__PURE__ */ e(st, { weight: "Bold", className: "w-5 h-5" }),
|
|
2178
2196
|
error: /* @__PURE__ */ e(lt, { weight: "Bold", className: "w-5 h-5" }),
|
|
2179
2197
|
warning: /* @__PURE__ */ e(at, { weight: "Bold", className: "w-5 h-5" }),
|
|
@@ -2223,13 +2241,13 @@ function Mt({
|
|
|
2223
2241
|
{
|
|
2224
2242
|
className: r("absolute bottom-0 left-0 h-1", u.line[a]),
|
|
2225
2243
|
style: {
|
|
2226
|
-
width: `${
|
|
2244
|
+
width: `${n}%`,
|
|
2227
2245
|
transition: "none"
|
|
2228
2246
|
}
|
|
2229
2247
|
}
|
|
2230
2248
|
),
|
|
2231
2249
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ i("div", { className: "flex items-start gap-2", children: [
|
|
2232
|
-
/* @__PURE__ */ e("div", { className: r("flex-shrink-0", u.text[a]), children:
|
|
2250
|
+
/* @__PURE__ */ e("div", { className: r("flex-shrink-0", u.text[a]), children: y[a] }),
|
|
2233
2251
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
2234
2252
|
/* @__PURE__ */ e("h4", { className: "text-base font-medium mb-1", children: t }),
|
|
2235
2253
|
l && /* @__PURE__ */ e("p", { className: "text-small text-[#82828C]", children: l }),
|
|
@@ -2290,7 +2308,7 @@ function Ut({
|
|
|
2290
2308
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
2291
2309
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
2292
2310
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
2293
|
-
},
|
|
2311
|
+
}, n = {
|
|
2294
2312
|
top: "left-1/2 -translate-x-1/2 top-full",
|
|
2295
2313
|
bottom: "left-1/2 -translate-x-1/2 bottom-full",
|
|
2296
2314
|
left: "top-1/2 -translate-y-1/2 left-full",
|
|
@@ -2316,7 +2334,7 @@ function Ut({
|
|
|
2316
2334
|
{
|
|
2317
2335
|
className: r(
|
|
2318
2336
|
"absolute h-2 w-2 rotate-45 bg-slate-400",
|
|
2319
|
-
|
|
2337
|
+
n[a]
|
|
2320
2338
|
)
|
|
2321
2339
|
}
|
|
2322
2340
|
)
|
|
@@ -2332,11 +2350,11 @@ function _t({
|
|
|
2332
2350
|
variant: s = "yellow",
|
|
2333
2351
|
label: m,
|
|
2334
2352
|
supportText: c,
|
|
2335
|
-
className:
|
|
2353
|
+
className: n
|
|
2336
2354
|
}) {
|
|
2337
2355
|
const d = () => {
|
|
2338
2356
|
a || l?.(!t);
|
|
2339
|
-
},
|
|
2357
|
+
}, y = {
|
|
2340
2358
|
blue: {
|
|
2341
2359
|
active: "bg-blue-600",
|
|
2342
2360
|
hover: "hover:bg-blue-600",
|
|
@@ -2353,7 +2371,7 @@ function _t({
|
|
|
2353
2371
|
{
|
|
2354
2372
|
className: r(
|
|
2355
2373
|
"flex items-start gap-3 select-none",
|
|
2356
|
-
|
|
2374
|
+
n
|
|
2357
2375
|
),
|
|
2358
2376
|
children: [
|
|
2359
2377
|
/* @__PURE__ */ e(
|
|
@@ -2363,9 +2381,9 @@ function _t({
|
|
|
2363
2381
|
disabled: a,
|
|
2364
2382
|
className: r(
|
|
2365
2383
|
"relative h-6 w-11 rounded-xl transition-all duration-300 outline-none cursor-pointer",
|
|
2366
|
-
t ?
|
|
2367
|
-
!a &&
|
|
2368
|
-
!a &&
|
|
2384
|
+
t ? y[s].active : "bg-slate-200",
|
|
2385
|
+
!a && y[s].hover,
|
|
2386
|
+
!a && y[s].focus,
|
|
2369
2387
|
a && "bg-slate-100 cursor-not-allowed"
|
|
2370
2388
|
),
|
|
2371
2389
|
onClick: d,
|
|
@@ -2397,24 +2415,24 @@ function _t({
|
|
|
2397
2415
|
);
|
|
2398
2416
|
}
|
|
2399
2417
|
export {
|
|
2400
|
-
|
|
2401
|
-
|
|
2418
|
+
jt as MciBreadcrumb,
|
|
2419
|
+
At as MciButton,
|
|
2402
2420
|
mt as MciCheck,
|
|
2403
2421
|
Tt as MciCollapse,
|
|
2404
2422
|
$t as MciDrawer,
|
|
2405
|
-
|
|
2423
|
+
Ae as MciInput,
|
|
2406
2424
|
Rt as MciModal,
|
|
2407
2425
|
Yt as MciPagination,
|
|
2408
2426
|
ft as MciPicker,
|
|
2409
2427
|
pt as MciSelect,
|
|
2410
2428
|
gt as MciSkeleton,
|
|
2411
2429
|
zt as MciTable,
|
|
2412
|
-
|
|
2430
|
+
Wt as MciTabs,
|
|
2413
2431
|
Pt as MciTag,
|
|
2414
2432
|
yt as MciTextarea,
|
|
2415
2433
|
Vt as MciToast,
|
|
2416
2434
|
_t as MciToggle,
|
|
2417
2435
|
Ut as MciTooltip,
|
|
2418
2436
|
It as MciUpload,
|
|
2419
|
-
|
|
2437
|
+
Bt as TabPanel
|
|
2420
2438
|
};
|