@mci-ui/mci-ui 0.0.74 → 0.0.76
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
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 be, Star2 as We, AltArrowDown as Fe, EyeClosed as Qe, Eye as Oe, Calendar as et, AltArrowLeft as ke, DoubleAltArrowLeft as tt, DoubleAltArrowRight as rt, ConfoundedSquare as nt, SortVertical as lt, SortFromTopToBottom as at, SortFromBottomToTop as st, Upload as ot, File as Te, FileText as Se, MusicNote as it, VideoFramePlayHorizontal as ct, Gallery as dt, MenuDots as ut, Refresh as mt, InfoCircle as ht, DangerCircle as ft, CloseCircle as pt, CheckCircle as gt, Phone as bt, TransferVertical as xt } from "@solar-icons/react";
|
|
3
3
|
import { clsx as wt } from "clsx";
|
|
4
4
|
import { twMerge as vt } from "tailwind-merge";
|
|
@@ -23,14 +23,14 @@ function qt({
|
|
|
23
23
|
variant: a = "blue",
|
|
24
24
|
className: r
|
|
25
25
|
}) {
|
|
26
|
-
const l = a === "blue",
|
|
27
|
-
return /* @__PURE__ */ e("nav", { className: n("flex items-center", r), "aria-label": "Breadcrumb", children: t.map((s,
|
|
28
|
-
const C =
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
C ? /* @__PURE__ */
|
|
26
|
+
const l = a === "blue", p = l ? "hover:text-blue-600" : "hover:text-yellow-500", i = l ? "text-blue-600" : "text-yellow-500";
|
|
27
|
+
return /* @__PURE__ */ e("nav", { className: n("flex items-center", r), "aria-label": "Breadcrumb", children: t.map((s, d) => {
|
|
28
|
+
const C = d === t.length - 1;
|
|
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", i), 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 ?? "#",
|
|
@@ -39,7 +39,7 @@ function qt({
|
|
|
39
39
|
},
|
|
40
40
|
className: n(
|
|
41
41
|
"flex items-center gap-x-2 transition-all text-sm font-normal text-slate-500",
|
|
42
|
-
|
|
42
|
+
p
|
|
43
43
|
),
|
|
44
44
|
children: [
|
|
45
45
|
s.icon,
|
|
@@ -48,7 +48,7 @@ function qt({
|
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
50
|
!C && /* @__PURE__ */ e("span", { className: "mx-2 flex items-center", children: /* @__PURE__ */ e(be, { weight: "Linear", size: 20, className: "text-slate-500" }) })
|
|
51
|
-
] },
|
|
51
|
+
] }, d);
|
|
52
52
|
}) });
|
|
53
53
|
}
|
|
54
54
|
function Kt({
|
|
@@ -56,20 +56,20 @@ function Kt({
|
|
|
56
56
|
text: a,
|
|
57
57
|
icon: r,
|
|
58
58
|
iconPosition: l = "left",
|
|
59
|
-
size:
|
|
60
|
-
variant:
|
|
59
|
+
size: p = "base",
|
|
60
|
+
variant: i = "primary",
|
|
61
61
|
color: s = "yellow",
|
|
62
|
-
loading:
|
|
62
|
+
loading: d = !1,
|
|
63
63
|
disabled: C = !1,
|
|
64
64
|
onClick: k,
|
|
65
|
-
className:
|
|
66
|
-
type:
|
|
65
|
+
className: M,
|
|
66
|
+
type: D = "button"
|
|
67
67
|
}) {
|
|
68
|
-
const
|
|
68
|
+
const A = t ?? a, E = {
|
|
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
|
+
}, m = i === "primary" || i === "secondary" || i === "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,29 +80,29 @@ function Kt({
|
|
|
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][i] : {
|
|
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
|
+
}[i], b = C || d, w = b ? i === "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: D,
|
|
91
91
|
onClick: k,
|
|
92
92
|
disabled: b,
|
|
93
93
|
className: n(
|
|
94
94
|
"inline-flex items-center justify-center font-medium transition-all duration-200 cursor-pointer",
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
!b &&
|
|
95
|
+
E[p],
|
|
96
|
+
m,
|
|
97
|
+
!b && m,
|
|
98
98
|
w,
|
|
99
|
-
|
|
99
|
+
M
|
|
100
100
|
),
|
|
101
101
|
children: [
|
|
102
|
-
r && l === "left" && !
|
|
103
|
-
|
|
104
|
-
r && l === "right" && !
|
|
105
|
-
|
|
102
|
+
r && l === "left" && !d && /* @__PURE__ */ e("span", { className: "flex items-center", children: r }),
|
|
103
|
+
A && /* @__PURE__ */ e("span", { children: A }),
|
|
104
|
+
r && l === "right" && !d && /* @__PURE__ */ e("span", { className: "flex items-center", children: r }),
|
|
105
|
+
d && /* @__PURE__ */ e(We, { weight: "Linear", size: 20, className: "animate-spin" })
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
);
|
|
@@ -124,51 +124,51 @@ const kt = (t) => /* @__PURE__ */ re.createElement("svg", { xmlns: "http://www.w
|
|
|
124
124
|
type: a = "checkbox",
|
|
125
125
|
label: r,
|
|
126
126
|
supportText: l,
|
|
127
|
-
checked:
|
|
128
|
-
onChange:
|
|
127
|
+
checked: p,
|
|
128
|
+
onChange: i,
|
|
129
129
|
error: s,
|
|
130
|
-
disabled:
|
|
130
|
+
disabled: d = !1,
|
|
131
131
|
required: C = !1,
|
|
132
132
|
className: k,
|
|
133
|
-
variant:
|
|
134
|
-
name:
|
|
135
|
-
value:
|
|
133
|
+
variant: M = "yellow",
|
|
134
|
+
name: D,
|
|
135
|
+
value: A
|
|
136
136
|
}) {
|
|
137
|
-
const [
|
|
138
|
-
() =>
|
|
139
|
-
[
|
|
137
|
+
const [E, v] = _(!1), u = a === "radio", m = Z(
|
|
138
|
+
() => p ?? E,
|
|
139
|
+
[p, E]
|
|
140
140
|
), b = R(
|
|
141
141
|
(y) => {
|
|
142
|
-
|
|
142
|
+
d || (p === void 0 && v(y.target.checked), i?.(y));
|
|
143
143
|
},
|
|
144
|
-
[
|
|
144
|
+
[p, i, d]
|
|
145
145
|
), w = Z(() => {
|
|
146
|
-
if (
|
|
147
|
-
const
|
|
148
|
-
return
|
|
149
|
-
container:
|
|
150
|
-
dot:
|
|
146
|
+
if (d) {
|
|
147
|
+
const L = "border-slate-200 bg-slate-100";
|
|
148
|
+
return u ? {
|
|
149
|
+
container: L,
|
|
150
|
+
dot: m ? "bg-slate-300" : "bg-transparent",
|
|
151
151
|
check: "text-slate-400"
|
|
152
152
|
} : {
|
|
153
|
-
container:
|
|
153
|
+
container: L,
|
|
154
154
|
dot: "",
|
|
155
|
-
check:
|
|
155
|
+
check: m ? "text-slate-400" : "text-transparent"
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
const y = Ct[
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
158
|
+
const y = Ct[M];
|
|
159
|
+
if (u) {
|
|
160
|
+
const L = n(
|
|
161
161
|
"border transition-all duration-200",
|
|
162
|
-
|
|
163
|
-
!
|
|
162
|
+
m ? y.border : "border-slate-400",
|
|
163
|
+
!m && y.hover,
|
|
164
164
|
y.focus,
|
|
165
|
-
|
|
165
|
+
m && ""
|
|
166
166
|
), j = n(
|
|
167
167
|
"transition-all duration-200 rounded-full",
|
|
168
|
-
|
|
168
|
+
m ? y.bg : "bg-transparent"
|
|
169
169
|
);
|
|
170
170
|
return {
|
|
171
|
-
container:
|
|
171
|
+
container: L,
|
|
172
172
|
dot: j,
|
|
173
173
|
check: ""
|
|
174
174
|
};
|
|
@@ -176,21 +176,21 @@ const kt = (t) => /* @__PURE__ */ re.createElement("svg", { xmlns: "http://www.w
|
|
|
176
176
|
return {
|
|
177
177
|
container: n(
|
|
178
178
|
"border transition-all duration-200",
|
|
179
|
-
|
|
180
|
-
!
|
|
179
|
+
m ? n(y.bg, y.border) : "border-slate-400",
|
|
180
|
+
!m && y.hover,
|
|
181
181
|
y.focus
|
|
182
182
|
),
|
|
183
183
|
dot: "",
|
|
184
|
-
check:
|
|
184
|
+
check: m ? "text-white" : "text-transparent"
|
|
185
185
|
};
|
|
186
|
-
}, [
|
|
187
|
-
r && /* @__PURE__ */
|
|
186
|
+
}, [u, m, d, M]), h = Z(() => !r && !l ? null : /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
|
|
187
|
+
r && /* @__PURE__ */ c(
|
|
188
188
|
"span",
|
|
189
189
|
{
|
|
190
190
|
className: n(
|
|
191
191
|
"text-base font-medium text-slate-700",
|
|
192
192
|
s && "text-red-600",
|
|
193
|
-
|
|
193
|
+
d && "text-slate-400"
|
|
194
194
|
),
|
|
195
195
|
children: [
|
|
196
196
|
r,
|
|
@@ -203,34 +203,34 @@ const kt = (t) => /* @__PURE__ */ re.createElement("svg", { xmlns: "http://www.w
|
|
|
203
203
|
{
|
|
204
204
|
className: n(
|
|
205
205
|
"text-slate-500 text-base font-normal",
|
|
206
|
-
|
|
206
|
+
d && "text-slate-400"
|
|
207
207
|
),
|
|
208
208
|
children: l
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
|
-
] }), [r, l, s,
|
|
212
|
-
return /* @__PURE__ */
|
|
213
|
-
/* @__PURE__ */
|
|
211
|
+
] }), [r, l, s, d, C]);
|
|
212
|
+
return /* @__PURE__ */ c("div", { className: n("flex items-start", k), children: [
|
|
213
|
+
/* @__PURE__ */ c(
|
|
214
214
|
"label",
|
|
215
215
|
{
|
|
216
216
|
className: n(
|
|
217
217
|
"flex items-start gap-2 select-none",
|
|
218
|
-
|
|
218
|
+
d ? "cursor-not-allowed" : "cursor-pointer"
|
|
219
219
|
),
|
|
220
220
|
children: [
|
|
221
221
|
/* @__PURE__ */ e(
|
|
222
222
|
"input",
|
|
223
223
|
{
|
|
224
224
|
type: a,
|
|
225
|
-
checked:
|
|
225
|
+
checked: m,
|
|
226
226
|
onChange: b,
|
|
227
|
-
disabled:
|
|
227
|
+
disabled: d,
|
|
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 ? `${D}-error` : void 0,
|
|
232
|
+
name: D,
|
|
233
|
+
value: A
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
236
|
/* @__PURE__ */ e(
|
|
@@ -238,16 +238,16 @@ const kt = (t) => /* @__PURE__ */ re.createElement("svg", { xmlns: "http://www.w
|
|
|
238
238
|
{
|
|
239
239
|
className: n(
|
|
240
240
|
"relative flex items-center justify-center",
|
|
241
|
-
|
|
241
|
+
u ? "w-5 h-5 rounded-full" : "w-5 h-5 rounded",
|
|
242
242
|
w.container
|
|
243
243
|
),
|
|
244
|
-
children:
|
|
244
|
+
children: u ? /* @__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
|
w.dot,
|
|
250
|
-
|
|
250
|
+
m ? "opacity-100 scale-100" : "opacity-0 scale-50"
|
|
251
251
|
)
|
|
252
252
|
}
|
|
253
253
|
) }) : /* @__PURE__ */ e(
|
|
@@ -256,17 +256,17 @@ const kt = (t) => /* @__PURE__ */ re.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
|
w.check,
|
|
259
|
-
|
|
259
|
+
m ? "opacity-100" : "opacity-0"
|
|
260
260
|
)
|
|
261
261
|
}
|
|
262
262
|
)
|
|
263
263
|
}
|
|
264
264
|
),
|
|
265
|
-
|
|
265
|
+
h
|
|
266
266
|
]
|
|
267
267
|
}
|
|
268
268
|
),
|
|
269
|
-
s && /* @__PURE__ */ e("p", { id: `${
|
|
269
|
+
s && /* @__PURE__ */ e("p", { id: `${D}-error`, className: "mt-1 text-extra-small text-red-600", children: s })
|
|
270
270
|
] });
|
|
271
271
|
});
|
|
272
272
|
Me.displayName = "MciCheck";
|
|
@@ -275,23 +275,23 @@ function Jt({
|
|
|
275
275
|
children: a,
|
|
276
276
|
defaultOpen: r = !1,
|
|
277
277
|
icon: l,
|
|
278
|
-
className:
|
|
279
|
-
contentClassName:
|
|
278
|
+
className: p,
|
|
279
|
+
contentClassName: i
|
|
280
280
|
}) {
|
|
281
|
-
const [s,
|
|
281
|
+
const [s, d] = _(r), [C, k] = _(0), M = le(null);
|
|
282
282
|
return J(() => {
|
|
283
|
-
|
|
284
|
-
}, [s]), /* @__PURE__ */
|
|
285
|
-
/* @__PURE__ */
|
|
283
|
+
M.current && k(s ? M.current.scrollHeight : 0);
|
|
284
|
+
}, [s]), /* @__PURE__ */ c("div", { className: n("overflow-hidden rounded-xl border border-slate-200", p), children: [
|
|
285
|
+
/* @__PURE__ */ c(
|
|
286
286
|
"button",
|
|
287
287
|
{
|
|
288
|
-
onClick: () =>
|
|
288
|
+
onClick: () => d(!s),
|
|
289
289
|
className: n(
|
|
290
290
|
"flex w-full items-center justify-between p-5 transition-all duration-300 hover:cursor-pointer",
|
|
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 Jt({
|
|
|
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", i), children: a })
|
|
322
322
|
}
|
|
323
323
|
)
|
|
324
324
|
] });
|
|
@@ -329,29 +329,30 @@ function Gt({
|
|
|
329
329
|
onClose: a,
|
|
330
330
|
position: r = "right",
|
|
331
331
|
children: l,
|
|
332
|
-
footer:
|
|
333
|
-
title:
|
|
332
|
+
footer: p,
|
|
333
|
+
title: i,
|
|
334
334
|
description: s,
|
|
335
|
-
showCloseButton:
|
|
335
|
+
showCloseButton: d = !0,
|
|
336
336
|
drawerClassName: C,
|
|
337
|
-
|
|
337
|
+
contentClassName: k,
|
|
338
|
+
closeOnOverlayClick: M = !0,
|
|
338
339
|
closeOnEscape: D = !0,
|
|
339
|
-
width:
|
|
340
|
+
width: A = 572
|
|
340
341
|
}) {
|
|
341
|
-
const
|
|
342
|
+
const E = le(null), v = le(null), u = R(() => a(), [a]);
|
|
342
343
|
J(() => {
|
|
343
|
-
t ? (
|
|
344
|
+
t ? (v.current = document.activeElement, E.current?.focus()) : v.current?.focus();
|
|
344
345
|
}, [t]), J(() => (t && (document.body.style.overflow = "hidden"), () => {
|
|
345
346
|
document.body.style.overflow = "unset";
|
|
346
347
|
}), [t]);
|
|
347
348
|
const m = Z(
|
|
348
349
|
() => ({
|
|
349
|
-
"--drawer-w": typeof
|
|
350
|
+
"--drawer-w": typeof A == "number" ? `${A}px` : A,
|
|
350
351
|
transform: t ? "translateX(0)" : r === "right" ? "translateX(calc(100% + 48px))" : "translateX(calc(-100% - 48px))"
|
|
351
352
|
}),
|
|
352
|
-
[t,
|
|
353
|
-
),
|
|
354
|
-
return /* @__PURE__ */
|
|
353
|
+
[t, A, r]
|
|
354
|
+
), b = !!(i || s || d), w = r === "right" ? "top-0 bottom-0 right-0 left-3 rounded-l-3xl rounded-r-none" : "top-0 bottom-0 left-0 right-3 rounded-r-3xl rounded-l-none", h = r === "right" ? "sm:top-6 sm:bottom-6 sm:right-6 sm:left-auto" : "sm:top-6 sm:bottom-6 sm:left-6 sm:right-auto";
|
|
355
|
+
return /* @__PURE__ */ c(he, { children: [
|
|
355
356
|
/* @__PURE__ */ e(
|
|
356
357
|
"div",
|
|
357
358
|
{
|
|
@@ -359,56 +360,65 @@ function Gt({
|
|
|
359
360
|
"fixed inset-0 z-50 bg-black/40 transition-opacity duration-300",
|
|
360
361
|
t ? "opacity-100 visible cursor-pointer" : "opacity-0 invisible pointer-events-none"
|
|
361
362
|
),
|
|
362
|
-
onClick:
|
|
363
|
+
onClick: M ? u : void 0,
|
|
363
364
|
"aria-hidden": "true"
|
|
364
365
|
}
|
|
365
366
|
),
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ c(
|
|
367
368
|
"div",
|
|
368
369
|
{
|
|
369
|
-
ref:
|
|
370
|
+
ref: E,
|
|
370
371
|
tabIndex: -1,
|
|
371
372
|
style: m,
|
|
372
373
|
className: n(
|
|
373
374
|
"fixed z-50 flex flex-col bg-white outline-none min-h-0",
|
|
374
375
|
"transition-transform duration-300 ease-in-out",
|
|
375
376
|
"shadow-2xl",
|
|
376
|
-
|
|
377
|
+
w,
|
|
377
378
|
"h-[100dvh]",
|
|
378
379
|
"pb-[env(safe-area-inset-bottom)]",
|
|
379
|
-
|
|
380
|
+
h,
|
|
380
381
|
"sm:h-auto sm:rounded-2xl sm:pb-0",
|
|
381
382
|
"sm:w-[var(--drawer-w)]",
|
|
382
383
|
C
|
|
383
384
|
),
|
|
384
385
|
role: "dialog",
|
|
385
386
|
"aria-modal": "true",
|
|
386
|
-
"aria-labelledby":
|
|
387
|
+
"aria-labelledby": i ? "drawer-title" : void 0,
|
|
387
388
|
children: [
|
|
388
|
-
|
|
389
|
-
(
|
|
390
|
-
|
|
389
|
+
b && /* @__PURE__ */ c("div", { className: "flex items-start justify-between border-b border-slate-200 shrink-0 px-4 py-4 sm:p-6", children: [
|
|
390
|
+
(i || s) && /* @__PURE__ */ c("div", { className: "block pr-3", children: [
|
|
391
|
+
i && /* @__PURE__ */ e(
|
|
391
392
|
"h2",
|
|
392
393
|
{
|
|
393
394
|
id: "drawer-title",
|
|
394
395
|
className: "font-semibold text-black text-xl leading-tight sm:text-h3",
|
|
395
|
-
children:
|
|
396
|
+
children: i
|
|
396
397
|
}
|
|
397
398
|
),
|
|
398
399
|
s && /* @__PURE__ */ e("p", { className: "text-sm sm:text-base text-slate-base font-normal mt-2", children: s })
|
|
399
400
|
] }),
|
|
400
|
-
|
|
401
|
+
d && /* @__PURE__ */ e(
|
|
401
402
|
"button",
|
|
402
403
|
{
|
|
403
404
|
type: "button",
|
|
404
|
-
onClick:
|
|
405
|
+
onClick: u,
|
|
405
406
|
className: "bg-slate-100 rounded-xl w-11 h-11 sm:w-12 sm:h-12 hover:cursor-pointer text-black transition flex items-center justify-center group active:scale-95",
|
|
406
407
|
children: /* @__PURE__ */ e(pe, { className: "h-5 w-5 sm:h-6 sm:w-6 transition-transform duration-300 group-hover:rotate-180" })
|
|
407
408
|
}
|
|
408
409
|
)
|
|
409
410
|
] }),
|
|
410
|
-
/* @__PURE__ */ e(
|
|
411
|
-
|
|
411
|
+
/* @__PURE__ */ e(
|
|
412
|
+
"div",
|
|
413
|
+
{
|
|
414
|
+
className: n(
|
|
415
|
+
"flex-1 min-h-0 overflow-y-auto scrollbar-thin scrollbar-thumb-slate-200 px-4 py-4 sm:p-6",
|
|
416
|
+
k
|
|
417
|
+
),
|
|
418
|
+
children: l
|
|
419
|
+
}
|
|
420
|
+
),
|
|
421
|
+
p && /* @__PURE__ */ e("div", { className: "shrink-0 flex items-center justify-end border-t border-slate-200 px-4 py-4 sm:p-6 gap-3", children: p })
|
|
412
422
|
]
|
|
413
423
|
}
|
|
414
424
|
)
|
|
@@ -420,33 +430,33 @@ const Le = fe(
|
|
|
420
430
|
placeholder: a,
|
|
421
431
|
type: r = "text",
|
|
422
432
|
icon: l,
|
|
423
|
-
rightIcon:
|
|
424
|
-
iconPosition:
|
|
433
|
+
rightIcon: p,
|
|
434
|
+
iconPosition: i = "left",
|
|
425
435
|
size: s = "base",
|
|
426
|
-
error:
|
|
436
|
+
error: d,
|
|
427
437
|
disabled: C = !1,
|
|
428
438
|
required: k = !1,
|
|
429
|
-
value:
|
|
430
|
-
onChange:
|
|
431
|
-
onFocus:
|
|
432
|
-
onBlur:
|
|
439
|
+
value: M,
|
|
440
|
+
onChange: D,
|
|
441
|
+
onFocus: A,
|
|
442
|
+
onBlur: E,
|
|
433
443
|
className: v,
|
|
434
|
-
name:
|
|
435
|
-
maxLength:
|
|
444
|
+
name: u,
|
|
445
|
+
maxLength: m = 250,
|
|
436
446
|
onClear: b,
|
|
437
447
|
showClearButton: w = !1,
|
|
438
|
-
step:
|
|
448
|
+
step: h,
|
|
439
449
|
autoComplete: y = "off"
|
|
440
450
|
}, $) => {
|
|
441
|
-
const [
|
|
442
|
-
j(!0),
|
|
451
|
+
const [L, j] = _(!1), [o, N] = _(""), [T, Y] = _(!1), q = M ?? o, B = r === "password", P = w && !!q && !C, W = l && i === "left", Q = l && i === "right" || p || B, ne = Q || P, K = () => {
|
|
452
|
+
j(!0), A?.();
|
|
443
453
|
}, ae = () => {
|
|
444
|
-
j(!1),
|
|
454
|
+
j(!1), E?.();
|
|
445
455
|
}, ce = (g) => {
|
|
446
456
|
let I = g.target.value;
|
|
447
|
-
r === "number" &&
|
|
457
|
+
r === "number" && m && I.length > m && (I = I.slice(0, m), g.target.value = I), M === void 0 && N(I), D?.(g);
|
|
448
458
|
}, ee = () => Y((g) => !g), de = () => {
|
|
449
|
-
|
|
459
|
+
M === void 0 && N(""), b?.();
|
|
450
460
|
}, z = Z(
|
|
451
461
|
() => ({
|
|
452
462
|
sm: {
|
|
@@ -478,15 +488,15 @@ const Le = fe(
|
|
|
478
488
|
}
|
|
479
489
|
}),
|
|
480
490
|
[W, Q]
|
|
481
|
-
), G = Z(() =>
|
|
482
|
-
return /* @__PURE__ */
|
|
483
|
-
t && /* @__PURE__ */
|
|
491
|
+
), G = Z(() => 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]), oe = Z(() => C ? "text-slate-400" : d ? "text-red-600" : L ? "text-black" : "text-slate-400", [d, L, C]);
|
|
492
|
+
return /* @__PURE__ */ c("div", { className: n("w-full", v), children: [
|
|
493
|
+
t && /* @__PURE__ */ c(
|
|
484
494
|
"label",
|
|
485
495
|
{
|
|
486
|
-
htmlFor:
|
|
496
|
+
htmlFor: u,
|
|
487
497
|
className: n(
|
|
488
498
|
"mb-2 block text-base font-medium",
|
|
489
|
-
|
|
499
|
+
d ? "text-red-600" : "text-slate-700",
|
|
490
500
|
z[s].labelFont
|
|
491
501
|
),
|
|
492
502
|
children: [
|
|
@@ -495,12 +505,12 @@ const Le = fe(
|
|
|
495
505
|
]
|
|
496
506
|
}
|
|
497
507
|
),
|
|
498
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ c("div", { className: "relative flex items-center", children: [
|
|
499
509
|
/* @__PURE__ */ e(
|
|
500
510
|
"input",
|
|
501
511
|
{
|
|
502
512
|
ref: $,
|
|
503
|
-
name:
|
|
513
|
+
name: u,
|
|
504
514
|
type: B && T ? "text" : r,
|
|
505
515
|
value: q,
|
|
506
516
|
onChange: ce,
|
|
@@ -510,7 +520,7 @@ const Le = fe(
|
|
|
510
520
|
required: k,
|
|
511
521
|
autoComplete: y,
|
|
512
522
|
placeholder: a,
|
|
513
|
-
step:
|
|
523
|
+
step: h,
|
|
514
524
|
className: n(
|
|
515
525
|
"w-full border bg-white font-normal transition-all duration-300 ease-in-out outline-none",
|
|
516
526
|
s === "base" ? "rounded-xl" : "rounded-lg",
|
|
@@ -520,7 +530,7 @@ const Le = fe(
|
|
|
520
530
|
z[s].padding,
|
|
521
531
|
G
|
|
522
532
|
),
|
|
523
|
-
maxLength:
|
|
533
|
+
maxLength: m
|
|
524
534
|
}
|
|
525
535
|
),
|
|
526
536
|
W && /* @__PURE__ */ e(
|
|
@@ -541,7 +551,7 @@ const Le = fe(
|
|
|
541
551
|
)
|
|
542
552
|
}
|
|
543
553
|
),
|
|
544
|
-
ne && /* @__PURE__ */
|
|
554
|
+
ne && /* @__PURE__ */ c(
|
|
545
555
|
"div",
|
|
546
556
|
{
|
|
547
557
|
className: n(
|
|
@@ -564,7 +574,7 @@ const Le = fe(
|
|
|
564
574
|
children: /* @__PURE__ */ e("span", { className: n("flex items-center justify-center", z[s].icon), children: /* @__PURE__ */ e(pe, { className: n("h-full w-full") }) })
|
|
565
575
|
}
|
|
566
576
|
),
|
|
567
|
-
|
|
577
|
+
p && !B && /* @__PURE__ */ e(
|
|
568
578
|
"div",
|
|
569
579
|
{
|
|
570
580
|
className: n("flex items-center justify-center", z[s].iconWrapper),
|
|
@@ -576,13 +586,13 @@ const Le = fe(
|
|
|
576
586
|
z[s].icon,
|
|
577
587
|
oe
|
|
578
588
|
),
|
|
579
|
-
children:
|
|
589
|
+
children: p
|
|
580
590
|
}
|
|
581
591
|
)
|
|
582
592
|
}
|
|
583
593
|
),
|
|
584
|
-
B && /* @__PURE__ */
|
|
585
|
-
|
|
594
|
+
B && /* @__PURE__ */ c(he, { children: [
|
|
595
|
+
p && /* @__PURE__ */ e(
|
|
586
596
|
"div",
|
|
587
597
|
{
|
|
588
598
|
className: n(
|
|
@@ -597,7 +607,7 @@ const Le = fe(
|
|
|
597
607
|
z[s].icon,
|
|
598
608
|
oe
|
|
599
609
|
),
|
|
600
|
-
children:
|
|
610
|
+
children: p
|
|
601
611
|
}
|
|
602
612
|
)
|
|
603
613
|
}
|
|
@@ -622,7 +632,7 @@ const Le = fe(
|
|
|
622
632
|
}
|
|
623
633
|
)
|
|
624
634
|
] }),
|
|
625
|
-
l &&
|
|
635
|
+
l && i === "right" && !B && /* @__PURE__ */ e(
|
|
626
636
|
"div",
|
|
627
637
|
{
|
|
628
638
|
className: n("flex items-center justify-center", z[s].iconWrapper),
|
|
@@ -643,7 +653,7 @@ const Le = fe(
|
|
|
643
653
|
}
|
|
644
654
|
)
|
|
645
655
|
] }),
|
|
646
|
-
|
|
656
|
+
d && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: d })
|
|
647
657
|
] });
|
|
648
658
|
}
|
|
649
659
|
);
|
|
@@ -751,162 +761,162 @@ const Mt = {
|
|
|
751
761
|
value: a,
|
|
752
762
|
onChange: r,
|
|
753
763
|
placeholder: l,
|
|
754
|
-
label:
|
|
755
|
-
disabled:
|
|
764
|
+
label: p,
|
|
765
|
+
disabled: i = !1,
|
|
756
766
|
required: s = !1,
|
|
757
|
-
className:
|
|
767
|
+
className: d,
|
|
758
768
|
format: C = "DD.MM.YYYY",
|
|
759
769
|
minDate: k,
|
|
760
|
-
maxDate:
|
|
761
|
-
error:
|
|
762
|
-
showClear:
|
|
763
|
-
allowManualInput:
|
|
770
|
+
maxDate: M,
|
|
771
|
+
error: D,
|
|
772
|
+
showClear: A = !0,
|
|
773
|
+
allowManualInput: E = !0,
|
|
764
774
|
locale: v = "uz",
|
|
765
|
-
startView:
|
|
766
|
-
iconPosition:
|
|
775
|
+
startView: u = "day",
|
|
776
|
+
iconPosition: m = "left",
|
|
767
777
|
align: b = "auto"
|
|
768
778
|
}, w) => {
|
|
769
|
-
const [
|
|
779
|
+
const [h, y] = _(!1), [$, L] = _(
|
|
770
780
|
t === "range" ? [null, null] : null
|
|
771
|
-
), [j, o] = _([null, null]), N = R((
|
|
772
|
-
if (!
|
|
773
|
-
const x = new Date(
|
|
781
|
+
), [j, o] = _([null, null]), N = R((f) => {
|
|
782
|
+
if (!f) return null;
|
|
783
|
+
const x = new Date(f);
|
|
774
784
|
return isNaN(x.getTime()) ? null : x;
|
|
775
|
-
}, []), [T, Y] = _(/* @__PURE__ */ new Date()), [q, B] = _(
|
|
776
|
-
const
|
|
777
|
-
if (t === "date") return N(
|
|
778
|
-
const x =
|
|
785
|
+
}, []), [T, Y] = _(/* @__PURE__ */ new Date()), [q, B] = _(u), [P, W] = _(0), [Q, ne] = _(""), [K, ae] = _(b), ce = le(null), ee = Z(() => {
|
|
786
|
+
const f = a !== void 0 ? a : $;
|
|
787
|
+
if (t === "date") return N(f);
|
|
788
|
+
const x = f;
|
|
779
789
|
return [N(x[0]), N(x[1])];
|
|
780
|
-
}, [a, $, t, N]), de = Mt[v], z = R((
|
|
781
|
-
(
|
|
782
|
-
if (!
|
|
783
|
-
const x =
|
|
790
|
+
}, [a, $, t, N]), de = Mt[v], z = R((f) => new Date(f.getFullYear(), f.getMonth(), f.getDate()), []), G = R(
|
|
791
|
+
(f) => {
|
|
792
|
+
if (!f) return "";
|
|
793
|
+
const x = f.getDate().toString().padStart(2, "0"), S = (f.getMonth() + 1).toString().padStart(2, "0"), H = f.getFullYear();
|
|
784
794
|
return C.replace("DD", x).replace("MM", S).replace("YYYY", H.toString());
|
|
785
795
|
},
|
|
786
796
|
[C]
|
|
787
|
-
), oe = R((
|
|
788
|
-
if (!
|
|
789
|
-
const x =
|
|
797
|
+
), oe = R((f) => {
|
|
798
|
+
if (!f || f.length !== 10) return null;
|
|
799
|
+
const x = f.replace(/\D/g, "");
|
|
790
800
|
if (x.length !== 8) return null;
|
|
791
801
|
const S = parseInt(x.slice(0, 2), 10), H = parseInt(x.slice(2, 4), 10), V = parseInt(x.slice(4, 8), 10);
|
|
792
802
|
if (V < 1e3 || H < 1 || H > 12 || S < 1 || S > 31) return null;
|
|
793
803
|
const te = new Date(V, H - 1, S);
|
|
794
804
|
return te.getFullYear() !== V || te.getMonth() !== H - 1 || te.getDate() !== S ? null : te;
|
|
795
805
|
}, []), g = R(
|
|
796
|
-
(
|
|
797
|
-
const x = z(
|
|
798
|
-
return !!(k && x < z(k) ||
|
|
806
|
+
(f) => {
|
|
807
|
+
const x = z(f);
|
|
808
|
+
return !!(k && x < z(k) || M && x > z(M));
|
|
799
809
|
},
|
|
800
|
-
[k,
|
|
810
|
+
[k, M, z]
|
|
801
811
|
), I = Z(() => {
|
|
802
812
|
if (t === "date") return G(ee);
|
|
803
|
-
const [
|
|
804
|
-
return !
|
|
813
|
+
const [f, x] = ee;
|
|
814
|
+
return !f && !x ? "" : f && x ? `${G(f)} - ${G(x)}` : f ? `${G(f)} - ...` : "...";
|
|
805
815
|
}, [t, ee, G]);
|
|
806
816
|
J(() => {
|
|
807
|
-
|
|
808
|
-
}, [I,
|
|
809
|
-
if (
|
|
817
|
+
h ? Q === "" && I !== "" && ne(I) : ne(I);
|
|
818
|
+
}, [I, h]), J(() => {
|
|
819
|
+
if (h)
|
|
810
820
|
if (t === "range") {
|
|
811
|
-
const
|
|
812
|
-
o(
|
|
821
|
+
const f = ee;
|
|
822
|
+
o(f), f[0] ? Y(f[0]) : f[1] ? Y(f[1]) : Y(/* @__PURE__ */ new Date());
|
|
813
823
|
} else {
|
|
814
|
-
const
|
|
815
|
-
Y(
|
|
824
|
+
const f = ee;
|
|
825
|
+
Y(f || /* @__PURE__ */ new Date());
|
|
816
826
|
}
|
|
817
|
-
}, [
|
|
818
|
-
if (
|
|
819
|
-
const
|
|
827
|
+
}, [h]), J(() => {
|
|
828
|
+
if (h && b === "auto" && ce.current) {
|
|
829
|
+
const f = ce.current.getBoundingClientRect(), x = window.innerWidth - f.right, S = f.left;
|
|
820
830
|
x < 300 && S > 300 ? ae("right") : ae("left");
|
|
821
831
|
}
|
|
822
|
-
}, [
|
|
832
|
+
}, [h, b]);
|
|
823
833
|
const O = R(() => {
|
|
824
|
-
y(!1), B(
|
|
825
|
-
}, [
|
|
826
|
-
|
|
827
|
-
}, [
|
|
834
|
+
y(!1), B(u), W(0), ne(I);
|
|
835
|
+
}, [u, I]), U = R((f) => {
|
|
836
|
+
i || (f.preventDefault(), f.stopPropagation(), y((x) => !x));
|
|
837
|
+
}, [i]), { handleClick: F } = De(ce, O), { handleEscape: X } = Ee(O);
|
|
828
838
|
J(() => {
|
|
829
|
-
if (
|
|
830
|
-
return document.addEventListener("mousedown",
|
|
831
|
-
document.removeEventListener("mousedown",
|
|
839
|
+
if (h)
|
|
840
|
+
return document.addEventListener("mousedown", F), document.addEventListener("keydown", X), () => {
|
|
841
|
+
document.removeEventListener("mousedown", F), document.removeEventListener("keydown", X);
|
|
832
842
|
};
|
|
833
|
-
}, [
|
|
843
|
+
}, [h, F, X]);
|
|
834
844
|
const me = () => {
|
|
835
|
-
|
|
836
|
-
}, xe = (
|
|
845
|
+
i || h || (t === "range" || !E) && (y(!0), B(u));
|
|
846
|
+
}, xe = (f) => {
|
|
837
847
|
if (t !== "date") return;
|
|
838
|
-
let S =
|
|
848
|
+
let S = f.target.value.replace(/\D/g, "");
|
|
839
849
|
S.length > 8 && (S = S.slice(0, 8));
|
|
840
850
|
let H = "";
|
|
841
851
|
if (S.length > 4 ? H = `${S.slice(0, 2)}.${S.slice(2, 4)}.${S.slice(4)}` : S.length > 2 ? H = `${S.slice(0, 2)}.${S.slice(2)}` : H = S, ne(H), H.length === 10) {
|
|
842
852
|
const V = oe(H);
|
|
843
|
-
V && !g(V) && (
|
|
844
|
-
} else H === "" && (
|
|
853
|
+
V && !g(V) && (L(V), r?.(V), Y(V));
|
|
854
|
+
} else H === "" && (L(null), r?.(null));
|
|
845
855
|
}, Ye = R(() => {
|
|
846
|
-
const
|
|
847
|
-
|
|
856
|
+
const f = t === "range" ? [null, null] : null;
|
|
857
|
+
L(f), o([null, null]), r?.(f), ne("");
|
|
848
858
|
}, [t, r]), Ue = R(
|
|
849
|
-
(
|
|
850
|
-
if (g(
|
|
851
|
-
const x = z(
|
|
859
|
+
(f) => {
|
|
860
|
+
if (g(f)) return;
|
|
861
|
+
const x = z(f);
|
|
852
862
|
if (t === "date")
|
|
853
|
-
|
|
863
|
+
L(x), r?.(x), ne(G(x)), O();
|
|
854
864
|
else {
|
|
855
865
|
const [S, H] = j;
|
|
856
866
|
if (!S && !H || S && H)
|
|
857
867
|
o([x, null]), ne(`${G(x)} - ...`);
|
|
858
868
|
else if (S && !H) {
|
|
859
869
|
const V = x < S ? [x, S] : [S, x];
|
|
860
|
-
o(V),
|
|
870
|
+
o(V), L(V), r?.(V);
|
|
861
871
|
const [te, ue] = V;
|
|
862
872
|
ne(`${G(te)} - ${G(ue)}`), O();
|
|
863
873
|
}
|
|
864
874
|
}
|
|
865
875
|
},
|
|
866
876
|
[t, j, g, z, r, O, G]
|
|
867
|
-
), _e = R((
|
|
868
|
-
const x = new Date(T.getFullYear(),
|
|
869
|
-
Y(x),
|
|
870
|
-
}, [T,
|
|
871
|
-
const x = new Date(
|
|
872
|
-
Y(x),
|
|
873
|
-
}, [T,
|
|
874
|
-
Y((x) => new Date(x.getFullYear(), x.getMonth() +
|
|
875
|
-
}, we = (
|
|
876
|
-
Y((x) => new Date(x.getFullYear() +
|
|
877
|
-
}, Ve = R((
|
|
878
|
-
const x =
|
|
877
|
+
), _e = R((f) => {
|
|
878
|
+
const x = new Date(T.getFullYear(), f, 1);
|
|
879
|
+
Y(x), u === "month" && t === "date" ? (L(x), r?.(x), ne(G(x)), O()) : B("day");
|
|
880
|
+
}, [T, u, r, O, t, G]), He = R((f) => {
|
|
881
|
+
const x = new Date(f, T.getMonth(), 1);
|
|
882
|
+
Y(x), u === "year" && t === "date" ? (L(x), r?.(x), ne(G(x)), O()) : B("month");
|
|
883
|
+
}, [T, u, r, O, t, G]), je = (f) => {
|
|
884
|
+
Y((x) => new Date(x.getFullYear(), x.getMonth() + f, 1));
|
|
885
|
+
}, we = (f) => {
|
|
886
|
+
Y((x) => new Date(x.getFullYear() + f, x.getMonth(), 1));
|
|
887
|
+
}, Ve = R((f) => {
|
|
888
|
+
const x = f.getFullYear(), S = f.getMonth(), H = new Date(x, S, 1).getDay(), V = new Date(x, S + 1, 0).getDate(), te = [];
|
|
879
889
|
for (let se = H; se > 0; se--) te.push({ date: new Date(x, S, 1 - se), isCurrentMonth: !1 });
|
|
880
890
|
for (let se = 1; se <= V; se++) te.push({ date: new Date(x, S, se), isCurrentMonth: !0 });
|
|
881
891
|
const ue = 42 - te.length;
|
|
882
892
|
for (let se = 1; se <= ue; se++) te.push({ date: new Date(x, S + 1, se), isCurrentMonth: !1 });
|
|
883
893
|
return te;
|
|
884
|
-
}, []), ve = R((
|
|
885
|
-
const x = z(
|
|
894
|
+
}, []), ve = R((f, x) => z(f).getTime() === z(x).getTime(), [z]), Ze = (f) => {
|
|
895
|
+
const x = z(f);
|
|
886
896
|
if (t === "date") return ee && ve(x, ee);
|
|
887
897
|
const [S] = j[0] ? j : ee;
|
|
888
898
|
return N(S) && ve(x, N(S));
|
|
889
|
-
}, qe = (
|
|
899
|
+
}, qe = (f) => {
|
|
890
900
|
if (t !== "range") return !1;
|
|
891
|
-
const x = z(
|
|
901
|
+
const x = z(f), [, S] = j[1] ? j : ee;
|
|
892
902
|
return N(S) && ve(x, N(S));
|
|
893
|
-
}, Ke = (
|
|
903
|
+
}, Ke = (f) => {
|
|
894
904
|
if (t !== "range") return !1;
|
|
895
|
-
const x = z(
|
|
905
|
+
const x = z(f), [S, H] = j[0] ? j : ee, V = N(S), te = N(H);
|
|
896
906
|
return V && !te ? !1 : V && te && x > z(V) && x < z(te);
|
|
897
|
-
}, Ie = (
|
|
898
|
-
const H = Ve(
|
|
899
|
-
return /* @__PURE__ */
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
-
/* @__PURE__ */ e("div", { className: "flex gap-2 w-16", children: x && /* @__PURE__ */
|
|
907
|
+
}, Ie = (f, x, S) => {
|
|
908
|
+
const H = Ve(f);
|
|
909
|
+
return /* @__PURE__ */ c("div", { className: "w-[300px] p-2 select-none", children: [
|
|
910
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4 py-1", children: [
|
|
911
|
+
/* @__PURE__ */ e("div", { className: "flex gap-2 w-16", children: x && /* @__PURE__ */ c(he, { children: [
|
|
902
912
|
/* @__PURE__ */ e("button", { onClick: () => we(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(tt, { size: 18 }) }),
|
|
903
913
|
/* @__PURE__ */ e("button", { onClick: () => je(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(ke, { size: 18 }) })
|
|
904
914
|
] }) }),
|
|
905
|
-
/* @__PURE__ */
|
|
906
|
-
/* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => B("month"), children: de.months[
|
|
907
|
-
/* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => B("year"), children:
|
|
915
|
+
/* @__PURE__ */ c("div", { className: "flex gap-1 font-semibold text-slate-700 text-sm whitespace-nowrap", children: [
|
|
916
|
+
/* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => B("month"), children: de.months[f.getMonth()] }),
|
|
917
|
+
/* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => B("year"), children: f.getFullYear() })
|
|
908
918
|
] }),
|
|
909
|
-
/* @__PURE__ */ e("div", { className: "flex gap-2 w-16 justify-end", children: S && /* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ e("div", { className: "flex gap-2 w-16 justify-end", children: S && /* @__PURE__ */ c(he, { children: [
|
|
910
920
|
/* @__PURE__ */ e("button", { onClick: () => je(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(be, { size: 18 }) }),
|
|
911
921
|
/* @__PURE__ */ e("button", { onClick: () => we(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(rt, { size: 18 }) })
|
|
912
922
|
] }) })
|
|
@@ -917,19 +927,19 @@ const Mt = {
|
|
|
917
927
|
return /* @__PURE__ */ e("div", { className: n("h-10 flex items-center justify-center relative", Xe && "bg-blue-50", ye && t === "range" && Ne ? "bg-blue-50 rounded-full" : ye && t === "range" ? "bg-gradient-to-r from-transparent to-blue-50 rounded-l-full" : "", Ne && t === "range" ? "bg-gradient-to-l from-transparent to-blue-50 rounded-r-full" : ""), children: /* @__PURE__ */ e("button", { type: "button", onClick: () => Ue(ue), disabled: se, 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", se && "opacity-20 cursor-not-allowed", ye || Ne ? "bg-blue-600 text-white shadow-md shadow-blue-200 hover:bg-blue-700" : "hover:bg-blue-50", ve(ue, /* @__PURE__ */ new Date()) && !ye && !Ne && "text-blue-600 border border-blue-600"), children: ue.getDate() }) }, te);
|
|
918
928
|
}) })
|
|
919
929
|
] });
|
|
920
|
-
}, Je = () => /* @__PURE__ */
|
|
921
|
-
/* @__PURE__ */
|
|
930
|
+
}, Je = () => /* @__PURE__ */ c("div", { className: "w-[300px] p-3", children: [
|
|
931
|
+
/* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
922
932
|
/* @__PURE__ */ e("button", { type: "button", onClick: () => we(-1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(ke, { size: 20 }) }),
|
|
923
933
|
/* @__PURE__ */ e("span", { className: "font-bold text-slate-800", children: T.getFullYear() }),
|
|
924
934
|
/* @__PURE__ */ e("button", { type: "button", onClick: () => we(1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(be, { size: 20 }) })
|
|
925
935
|
] }),
|
|
926
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: de.monthsShort.map((
|
|
936
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: de.monthsShort.map((f, x) => /* @__PURE__ */ e("button", { type: "button", onClick: () => _e(x), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", T.getMonth() === x ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: f }, f)) })
|
|
927
937
|
] }), Ge = () => {
|
|
928
|
-
const
|
|
929
|
-
return /* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
938
|
+
const f = Math.floor(T.getFullYear() / 12) * 12 + P * 12, x = Array.from({ length: 12 }, (S, H) => f + H);
|
|
939
|
+
return /* @__PURE__ */ c("div", { className: "w-[300px] p-3", children: [
|
|
940
|
+
/* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
931
941
|
/* @__PURE__ */ e("button", { type: "button", onClick: () => W((S) => S - 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(ke, { size: 20 }) }),
|
|
932
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ c("span", { className: "font-bold text-slate-800", children: [
|
|
933
943
|
x[0],
|
|
934
944
|
" - ",
|
|
935
945
|
x[11]
|
|
@@ -944,32 +954,32 @@ const Mt = {
|
|
|
944
954
|
onClick: U,
|
|
945
955
|
className: n(
|
|
946
956
|
"cursor-pointer flex items-center justify-center p-1 rounded-md transition-colors",
|
|
947
|
-
|
|
957
|
+
i ? "pointer-events-none opacity-50" : "hover:bg-slate-100 active:bg-slate-200"
|
|
948
958
|
),
|
|
949
959
|
children: /* @__PURE__ */ e(et, { weight: "Linear", size: 20, className: "text-slate-400" })
|
|
950
960
|
}
|
|
951
961
|
);
|
|
952
|
-
return /* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ c("div", { ref: ce, className: n("relative w-full group", d), children: [
|
|
953
963
|
/* @__PURE__ */ e("div", { ref: w, children: /* @__PURE__ */ e(
|
|
954
964
|
Le,
|
|
955
965
|
{
|
|
956
|
-
label:
|
|
966
|
+
label: p,
|
|
957
967
|
placeholder: Array.isArray(l) ? l[0] : l,
|
|
958
968
|
value: Q,
|
|
959
969
|
onChange: xe,
|
|
960
|
-
icon:
|
|
961
|
-
rightIcon:
|
|
962
|
-
disabled:
|
|
970
|
+
icon: m === "left" ? Re : void 0,
|
|
971
|
+
rightIcon: m === "right" ? Re : void 0,
|
|
972
|
+
disabled: i,
|
|
963
973
|
required: s,
|
|
964
|
-
error:
|
|
974
|
+
error: D,
|
|
965
975
|
maxLength: t === "date" ? 10 : void 0,
|
|
966
976
|
onFocus: me,
|
|
967
|
-
readOnly: !
|
|
968
|
-
showClearButton:
|
|
977
|
+
readOnly: !E || t === "range",
|
|
978
|
+
showClearButton: A,
|
|
969
979
|
onClear: Ye
|
|
970
980
|
}
|
|
971
981
|
) }),
|
|
972
|
-
|
|
982
|
+
h && /* @__PURE__ */ e(
|
|
973
983
|
"div",
|
|
974
984
|
{
|
|
975
985
|
className: n(
|
|
@@ -980,8 +990,8 @@ const Mt = {
|
|
|
980
990
|
K === "center" && "left-1/2 -translate-x-1/2 origin-top"
|
|
981
991
|
),
|
|
982
992
|
style: { width: "max-content" },
|
|
983
|
-
onMouseDown: (
|
|
984
|
-
children: q === "day" ? /* @__PURE__ */
|
|
993
|
+
onMouseDown: (f) => f.stopPropagation(),
|
|
994
|
+
children: q === "day" ? /* @__PURE__ */ c(he, { children: [
|
|
985
995
|
Ie(T, !0, t !== "range"),
|
|
986
996
|
t === "range" && /* @__PURE__ */ e("div", { className: "hidden md:block border-l border-slate-100", children: Ie(new Date(T.getFullYear(), T.getMonth() + 1, 1), !1, !0) })
|
|
987
997
|
] }) : q === "month" ? Je() : Ge()
|
|
@@ -1031,84 +1041,84 @@ const St = {
|
|
|
1031
1041
|
placeholder: a = "Выберите...",
|
|
1032
1042
|
options: r = [],
|
|
1033
1043
|
icon: l,
|
|
1034
|
-
iconPosition:
|
|
1035
|
-
size:
|
|
1044
|
+
iconPosition: p = "left",
|
|
1045
|
+
size: i = "base",
|
|
1036
1046
|
error: s,
|
|
1037
|
-
disabled:
|
|
1047
|
+
disabled: d = !1,
|
|
1038
1048
|
required: C = !1,
|
|
1039
1049
|
value: k,
|
|
1040
|
-
onChange:
|
|
1041
|
-
onFocus:
|
|
1042
|
-
onBlur:
|
|
1043
|
-
className:
|
|
1050
|
+
onChange: M,
|
|
1051
|
+
onFocus: D,
|
|
1052
|
+
onBlur: A,
|
|
1053
|
+
className: E,
|
|
1044
1054
|
clearable: v = !1,
|
|
1045
|
-
searchable:
|
|
1046
|
-
onSearch:
|
|
1055
|
+
searchable: u = !1,
|
|
1056
|
+
onSearch: m,
|
|
1047
1057
|
name: b
|
|
1048
1058
|
}, w) => {
|
|
1049
|
-
const [
|
|
1050
|
-
if (!
|
|
1051
|
-
const
|
|
1059
|
+
const [h, y] = _(!1), [$, L] = _(!1), [j, o] = _(""), [N, T] = _(""), [Y, q] = _(-1), B = le(null), P = le(null), W = k !== void 0 ? k : j, Q = r.find((F) => F.value === W), ne = W !== "" && W !== void 0, K = St[i], ae = Z(() => {
|
|
1060
|
+
if (!u || m) return r;
|
|
1061
|
+
const F = N.toLowerCase();
|
|
1052
1062
|
return r.filter(
|
|
1053
|
-
(X) => X.label.toLowerCase().includes(
|
|
1063
|
+
(X) => X.label.toLowerCase().includes(F)
|
|
1054
1064
|
);
|
|
1055
|
-
}, [r, N,
|
|
1056
|
-
y(!1),
|
|
1057
|
-
}, [
|
|
1065
|
+
}, [r, N, u, m]), ce = R(() => {
|
|
1066
|
+
y(!1), L(!1), T(""), q(-1), A?.();
|
|
1067
|
+
}, [A]), { handleClick: ee } = De(B, ce), { handleEscape: de } = Ee(ce);
|
|
1058
1068
|
J(() => {
|
|
1059
|
-
if (
|
|
1069
|
+
if (h)
|
|
1060
1070
|
return document.addEventListener("mousedown", ee), document.addEventListener("keydown", de), () => {
|
|
1061
1071
|
document.removeEventListener("mousedown", ee), document.removeEventListener("keydown", de);
|
|
1062
1072
|
};
|
|
1063
|
-
}, [
|
|
1064
|
-
|
|
1065
|
-
}, [
|
|
1073
|
+
}, [h, ee, de]), J(() => {
|
|
1074
|
+
h && u && P.current && P.current.focus();
|
|
1075
|
+
}, [h, u]);
|
|
1066
1076
|
const z = R(
|
|
1067
|
-
(
|
|
1068
|
-
if (!
|
|
1069
|
-
if (!
|
|
1070
|
-
|
|
1077
|
+
(F) => {
|
|
1078
|
+
if (!d) {
|
|
1079
|
+
if (!h && (F.key === "ArrowDown" || F.key === "ArrowUp" || F.key === "Enter")) {
|
|
1080
|
+
F.preventDefault(), y(!0);
|
|
1071
1081
|
return;
|
|
1072
1082
|
}
|
|
1073
|
-
if (
|
|
1074
|
-
switch (
|
|
1083
|
+
if (h)
|
|
1084
|
+
switch (F.key) {
|
|
1075
1085
|
case "ArrowDown":
|
|
1076
|
-
|
|
1086
|
+
F.preventDefault(), q(
|
|
1077
1087
|
(X) => X < ae.length - 1 ? X + 1 : 0
|
|
1078
1088
|
);
|
|
1079
1089
|
break;
|
|
1080
1090
|
case "ArrowUp":
|
|
1081
|
-
|
|
1091
|
+
F.preventDefault(), q(
|
|
1082
1092
|
(X) => X > 0 ? X - 1 : ae.length - 1
|
|
1083
1093
|
);
|
|
1084
1094
|
break;
|
|
1085
1095
|
case "Enter":
|
|
1086
|
-
|
|
1096
|
+
F.preventDefault(), Y >= 0 && ae[Y] && oe(ae[Y].value);
|
|
1087
1097
|
break;
|
|
1088
1098
|
}
|
|
1089
1099
|
}
|
|
1090
1100
|
},
|
|
1091
|
-
[
|
|
1101
|
+
[h, ae, Y, d]
|
|
1092
1102
|
), G = R(() => {
|
|
1093
|
-
|
|
1094
|
-
}, [
|
|
1095
|
-
(
|
|
1096
|
-
k === void 0 && o(
|
|
1103
|
+
d || (y((F) => !F), h ? (T(""), q(-1)) : (L(!0), D?.()));
|
|
1104
|
+
}, [d, h, D]), oe = R(
|
|
1105
|
+
(F) => {
|
|
1106
|
+
k === void 0 && o(F), M?.(F), y(!1), L(!1), T(""), q(-1), A?.();
|
|
1097
1107
|
},
|
|
1098
|
-
[k,
|
|
1108
|
+
[k, M, A]
|
|
1099
1109
|
), g = R(
|
|
1100
|
-
(
|
|
1101
|
-
|
|
1110
|
+
(F) => {
|
|
1111
|
+
F.stopPropagation(), !d && (k === void 0 && o(""), M?.(""), T(""), q(-1));
|
|
1102
1112
|
},
|
|
1103
|
-
[k,
|
|
1113
|
+
[k, M, d]
|
|
1104
1114
|
), I = R(
|
|
1105
|
-
(
|
|
1106
|
-
T(
|
|
1115
|
+
(F) => {
|
|
1116
|
+
T(F), m?.(F), q(0);
|
|
1107
1117
|
},
|
|
1108
|
-
[
|
|
1109
|
-
), O = Z(() =>
|
|
1110
|
-
return /* @__PURE__ */
|
|
1111
|
-
t && /* @__PURE__ */
|
|
1118
|
+
[m]
|
|
1119
|
+
), O = Z(() => d ? "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, d]), U = Z(() => d ? "text-slate-400" : s ? "text-red-600" : h || $ ? "text-black" : "text-slate-400", [d, s, h, $]);
|
|
1120
|
+
return /* @__PURE__ */ c("div", { className: n("w-full", E), ref: w, children: [
|
|
1121
|
+
t && /* @__PURE__ */ c(
|
|
1112
1122
|
"label",
|
|
1113
1123
|
{
|
|
1114
1124
|
htmlFor: b,
|
|
@@ -1123,30 +1133,30 @@ const St = {
|
|
|
1123
1133
|
]
|
|
1124
1134
|
}
|
|
1125
1135
|
),
|
|
1126
|
-
/* @__PURE__ */
|
|
1136
|
+
/* @__PURE__ */ c(
|
|
1127
1137
|
"div",
|
|
1128
1138
|
{
|
|
1129
1139
|
ref: B,
|
|
1130
1140
|
className: "relative",
|
|
1131
1141
|
onKeyDown: z,
|
|
1132
1142
|
children: [
|
|
1133
|
-
/* @__PURE__ */
|
|
1143
|
+
/* @__PURE__ */ c(
|
|
1134
1144
|
"div",
|
|
1135
1145
|
{
|
|
1136
1146
|
role: "combobox",
|
|
1137
|
-
"aria-expanded":
|
|
1147
|
+
"aria-expanded": h,
|
|
1138
1148
|
"aria-haspopup": "listbox",
|
|
1139
1149
|
"aria-controls": `${b}-listbox`,
|
|
1140
|
-
"aria-disabled":
|
|
1141
|
-
tabIndex:
|
|
1150
|
+
"aria-disabled": d,
|
|
1151
|
+
tabIndex: d ? -1 : 0,
|
|
1142
1152
|
onClick: G,
|
|
1143
1153
|
className: n(
|
|
1144
1154
|
"flex w-full items-center border font-normal transition-all duration-300 ease-in-out",
|
|
1145
|
-
|
|
1155
|
+
i === "base" ? "rounded-xl" : "rounded-lg",
|
|
1146
1156
|
K.container,
|
|
1147
|
-
l ?
|
|
1157
|
+
l ? p === "left" ? K.iconPaddingLeft : K.iconPaddingRight : K.padding,
|
|
1148
1158
|
O,
|
|
1149
|
-
!
|
|
1159
|
+
!d && $ && "shadow-blue border-blue-600"
|
|
1150
1160
|
),
|
|
1151
1161
|
children: [
|
|
1152
1162
|
l && /* @__PURE__ */ e(
|
|
@@ -1154,41 +1164,41 @@ const St = {
|
|
|
1154
1164
|
{
|
|
1155
1165
|
className: n(
|
|
1156
1166
|
"absolute top-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-300",
|
|
1157
|
-
|
|
1167
|
+
p === "left" ? K.iconWrapper : K.rightIconWrapper,
|
|
1158
1168
|
U
|
|
1159
1169
|
),
|
|
1160
1170
|
children: l
|
|
1161
1171
|
}
|
|
1162
1172
|
),
|
|
1163
|
-
|
|
1173
|
+
u && h ? /* @__PURE__ */ e(
|
|
1164
1174
|
"input",
|
|
1165
1175
|
{
|
|
1166
1176
|
ref: P,
|
|
1167
1177
|
type: "text",
|
|
1168
1178
|
value: N,
|
|
1169
|
-
onChange: (
|
|
1179
|
+
onChange: (F) => I(F.target.value),
|
|
1170
1180
|
placeholder: a,
|
|
1171
1181
|
className: "w-full bg-transparent outline-none",
|
|
1172
|
-
onClick: (
|
|
1182
|
+
onClick: (F) => F.stopPropagation()
|
|
1173
1183
|
}
|
|
1174
1184
|
) : /* @__PURE__ */ e(
|
|
1175
1185
|
"span",
|
|
1176
1186
|
{
|
|
1177
1187
|
className: n(
|
|
1178
1188
|
"block truncate select-none",
|
|
1179
|
-
!ne && !
|
|
1189
|
+
!ne && !d && "text-slate-400"
|
|
1180
1190
|
),
|
|
1181
1191
|
children: Q?.label || a
|
|
1182
1192
|
}
|
|
1183
1193
|
),
|
|
1184
|
-
v && ne && !
|
|
1194
|
+
v && ne && !d && /* @__PURE__ */ e(
|
|
1185
1195
|
"button",
|
|
1186
1196
|
{
|
|
1187
1197
|
type: "button",
|
|
1188
1198
|
onClick: g,
|
|
1189
1199
|
className: n(
|
|
1190
1200
|
"absolute top-1/2 -translate-y-1/2 text-slate-400 hover:text-black transition-colors cursor-pointer",
|
|
1191
|
-
l &&
|
|
1201
|
+
l && p === "left" ? "right-8" : "right-10"
|
|
1192
1202
|
),
|
|
1193
1203
|
"aria-label": "Очистить",
|
|
1194
1204
|
children: /* @__PURE__ */ e(pe, { className: K.iconSize })
|
|
@@ -1199,7 +1209,7 @@ const St = {
|
|
|
1199
1209
|
{
|
|
1200
1210
|
className: n(
|
|
1201
1211
|
"absolute top-1/2 right-3 -translate-y-1/2 pointer-events-none transition-all duration-300",
|
|
1202
|
-
|
|
1212
|
+
h && "rotate-180",
|
|
1203
1213
|
U
|
|
1204
1214
|
),
|
|
1205
1215
|
children: /* @__PURE__ */ e(Fe, { className: K.iconSize })
|
|
@@ -1208,7 +1218,7 @@ const St = {
|
|
|
1208
1218
|
]
|
|
1209
1219
|
}
|
|
1210
1220
|
),
|
|
1211
|
-
|
|
1221
|
+
h && !d && /* @__PURE__ */ e(
|
|
1212
1222
|
"div",
|
|
1213
1223
|
{
|
|
1214
1224
|
id: `${b}-listbox`,
|
|
@@ -1217,19 +1227,19 @@ const St = {
|
|
|
1217
1227
|
"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",
|
|
1218
1228
|
K.dropdown
|
|
1219
1229
|
),
|
|
1220
|
-
children: ae.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-center text-base font-normal text-slate-500", children: "Ничего не найдено" }) : ae.map((
|
|
1230
|
+
children: ae.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-center text-base font-normal text-slate-500", children: "Ничего не найдено" }) : ae.map((F) => /* @__PURE__ */ e(
|
|
1221
1231
|
"div",
|
|
1222
1232
|
{
|
|
1223
1233
|
role: "option",
|
|
1224
|
-
"aria-selected": W ===
|
|
1225
|
-
onClick: () => oe(
|
|
1234
|
+
"aria-selected": W === F.value,
|
|
1235
|
+
onClick: () => oe(F.value),
|
|
1226
1236
|
className: n(
|
|
1227
1237
|
"cursor-pointer px-3 py-2 font-normal transition-colors hover:bg-slate-100 rounded-sm",
|
|
1228
|
-
W ===
|
|
1238
|
+
W === F.value ? "bg-slate-100" : ""
|
|
1229
1239
|
),
|
|
1230
|
-
children:
|
|
1240
|
+
children: F.label
|
|
1231
1241
|
},
|
|
1232
|
-
|
|
1242
|
+
F.value
|
|
1233
1243
|
))
|
|
1234
1244
|
}
|
|
1235
1245
|
)
|
|
@@ -1253,51 +1263,51 @@ function Xt({
|
|
|
1253
1263
|
data: a = [],
|
|
1254
1264
|
loading: r = !1,
|
|
1255
1265
|
skeletonRows: l = 5,
|
|
1256
|
-
noDataText:
|
|
1257
|
-
sort:
|
|
1266
|
+
noDataText: p = "",
|
|
1267
|
+
sort: i,
|
|
1258
1268
|
onSortChange: s,
|
|
1259
|
-
className:
|
|
1269
|
+
className: d,
|
|
1260
1270
|
headerClassName: C,
|
|
1261
1271
|
bodyClassName: k,
|
|
1262
|
-
rowKey:
|
|
1263
|
-
rowSelection:
|
|
1272
|
+
rowKey: M = "id",
|
|
1273
|
+
rowSelection: D
|
|
1264
1274
|
}) {
|
|
1265
|
-
const [
|
|
1275
|
+
const [A, E] = _(
|
|
1266
1276
|
null
|
|
1267
|
-
), v =
|
|
1277
|
+
), v = i ?? A, u = Z(() => Array.isArray(a) ? a : [], [a]), m = Z(() => !v || i ? u : [...u].sort((o, N) => {
|
|
1268
1278
|
const T = o[v.key], Y = N[v.key];
|
|
1269
1279
|
return T == null ? 1 : Y == null ? -1 : T < Y ? v.direction === "asc" ? -1 : 1 : T > Y ? v.direction === "asc" ? 1 : -1 : 0;
|
|
1270
|
-
}), [
|
|
1280
|
+
}), [u, v, i]);
|
|
1271
1281
|
J(() => {
|
|
1272
|
-
|
|
1273
|
-
}, [
|
|
1274
|
-
const b = r ? [] :
|
|
1282
|
+
i !== void 0 && E(null);
|
|
1283
|
+
}, [i]);
|
|
1284
|
+
const b = r ? [] : i ? u : m, w = R(
|
|
1275
1285
|
(o) => {
|
|
1276
1286
|
if (!o.sortable) return;
|
|
1277
1287
|
let N = null;
|
|
1278
|
-
v?.key !== o.key ? N = { key: o.key, direction: "asc" } : v.direction === "asc" && (N = { key: o.key, direction: "desc" }),
|
|
1288
|
+
v?.key !== o.key ? N = { key: o.key, direction: "asc" } : v.direction === "asc" && (N = { key: o.key, direction: "desc" }), i !== void 0 ? s?.(N) : E(N);
|
|
1279
1289
|
},
|
|
1280
|
-
[v,
|
|
1281
|
-
),
|
|
1282
|
-
if (!
|
|
1283
|
-
const { onChange: N, getCheckboxProps: T } =
|
|
1290
|
+
[v, i, s]
|
|
1291
|
+
), h = (o) => {
|
|
1292
|
+
if (!D) return;
|
|
1293
|
+
const { onChange: N, getCheckboxProps: T } = D;
|
|
1284
1294
|
if (o.target.checked) {
|
|
1285
|
-
const B = b.filter((P) => !T?.(P)?.disabled).map((P) => P[
|
|
1295
|
+
const B = b.filter((P) => !T?.(P)?.disabled).map((P) => P[M]);
|
|
1286
1296
|
N(B);
|
|
1287
1297
|
} else
|
|
1288
1298
|
N([]);
|
|
1289
1299
|
}, y = (o, N) => {
|
|
1290
|
-
if (!
|
|
1291
|
-
const { selectedRowKeys: T, onChange: Y } =
|
|
1300
|
+
if (!D) return;
|
|
1301
|
+
const { selectedRowKeys: T, onChange: Y } = D, q = o[M], B = N ? [...T, q] : T.filter((P) => P !== q);
|
|
1292
1302
|
Y(B);
|
|
1293
1303
|
}, $ = Z(() => {
|
|
1294
|
-
if (!
|
|
1295
|
-
const o = b.filter((N) => !
|
|
1304
|
+
if (!D || b.length === 0) return !1;
|
|
1305
|
+
const o = b.filter((N) => !D.getCheckboxProps?.(N)?.disabled);
|
|
1296
1306
|
return o.length === 0 ? !1 : o.every(
|
|
1297
|
-
(N) =>
|
|
1307
|
+
(N) => D.selectedRowKeys.includes(N[M])
|
|
1298
1308
|
);
|
|
1299
|
-
}, [
|
|
1300
|
-
|
|
1309
|
+
}, [D, b, M]), L = (o) => o.sortable ? !v || v.key !== o.key ? /* @__PURE__ */ e(lt, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : v.direction === "asc" ? /* @__PURE__ */ e(at, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : /* @__PURE__ */ e(st, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : null, j = () => /* @__PURE__ */ c("colgroup", { children: [
|
|
1310
|
+
D && /* @__PURE__ */ e("col", { style: { width: 48 } }),
|
|
1301
1311
|
t.map((o) => /* @__PURE__ */ e("col", { style: { width: Ft(o.width) ?? "auto" } }, o.key))
|
|
1302
1312
|
] });
|
|
1303
1313
|
return /* @__PURE__ */ e(
|
|
@@ -1310,17 +1320,17 @@ function Xt({
|
|
|
1310
1320
|
"[&::-webkit-scrollbar-thumb]:bg-slate-200",
|
|
1311
1321
|
"[&::-webkit-scrollbar-thumb]:rounded-full",
|
|
1312
1322
|
"hover:[&::-webkit-scrollbar-thumb]:bg-slate-300",
|
|
1313
|
-
|
|
1323
|
+
d
|
|
1314
1324
|
),
|
|
1315
|
-
children: /* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-slate-100", children: /* @__PURE__ */
|
|
1325
|
+
children: /* @__PURE__ */ c("div", { className: "inline-block min-w-full align-middle", children: [
|
|
1326
|
+
/* @__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: [
|
|
1317
1327
|
j(),
|
|
1318
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
1319
|
-
|
|
1328
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
1329
|
+
D && /* @__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(
|
|
1320
1330
|
Me,
|
|
1321
1331
|
{
|
|
1322
1332
|
checked: $,
|
|
1323
|
-
onChange:
|
|
1333
|
+
onChange: h,
|
|
1324
1334
|
variant: "yellow",
|
|
1325
1335
|
disabled: r || b.length === 0
|
|
1326
1336
|
}
|
|
@@ -1337,27 +1347,27 @@ function Xt({
|
|
|
1337
1347
|
o.sortable && "cursor-pointer hover:bg-slate-200",
|
|
1338
1348
|
C
|
|
1339
1349
|
),
|
|
1340
|
-
children: /* @__PURE__ */
|
|
1350
|
+
children: /* @__PURE__ */ c("div", { className: n("flex items-center gap-2 min-w-0", o.align === "right" && "justify-end"), children: [
|
|
1341
1351
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", title: o.title, children: o.title }),
|
|
1342
|
-
|
|
1352
|
+
L(o)
|
|
1343
1353
|
] })
|
|
1344
1354
|
},
|
|
1345
1355
|
o.key
|
|
1346
1356
|
))
|
|
1347
1357
|
] }) })
|
|
1348
1358
|
] }) }),
|
|
1349
|
-
/* @__PURE__ */ e("div", { className: "rounded-xl border border-t-0 border-slate-200 bg-white overflow-hidden", children: /* @__PURE__ */
|
|
1359
|
+
/* @__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: [
|
|
1350
1360
|
j(),
|
|
1351
|
-
/* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-200", children: r ? Array.from({ length: l }).map((o, N) => /* @__PURE__ */
|
|
1352
|
-
|
|
1361
|
+
/* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-200", children: r ? Array.from({ length: l }).map((o, N) => /* @__PURE__ */ c("tr", { children: [
|
|
1362
|
+
D && /* @__PURE__ */ e("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ e($e, { height: 20, width: 20, variant: "rounded" }) }),
|
|
1353
1363
|
t.map((T) => /* @__PURE__ */ e("td", { className: "px-4 py-3", children: /* @__PURE__ */ e($e, { height: 30, variant: "rounded" }) }, T.key))
|
|
1354
|
-
] }, N)) : b.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length + (
|
|
1364
|
+
] }, N)) : b.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length + (D ? 1 : 0), className: "py-20", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center", children: [
|
|
1355
1365
|
/* @__PURE__ */ e("div", { className: "relative mb-4", children: /* @__PURE__ */ e(nt, { weight: "Bold", size: 64, className: "animate-float text-slate-400" }) }),
|
|
1356
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-slate-400", children:
|
|
1366
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-slate-400", children: p })
|
|
1357
1367
|
] }) }) }) : b.map((o, N) => {
|
|
1358
|
-
const T = o[
|
|
1359
|
-
return /* @__PURE__ */
|
|
1360
|
-
|
|
1368
|
+
const T = o[M], Y = D?.selectedRowKeys.includes(T), q = D?.getCheckboxProps?.(o)?.disabled;
|
|
1369
|
+
return /* @__PURE__ */ c("tr", { className: "group transition-colors hover:bg-slate-50", children: [
|
|
1370
|
+
D && /* @__PURE__ */ e("td", { className: n("w-12 px-4 py-3 align-top", k), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center pt-1", children: /* @__PURE__ */ e(
|
|
1361
1371
|
Me,
|
|
1362
1372
|
{
|
|
1363
1373
|
checked: Y,
|
|
@@ -1469,20 +1479,20 @@ const Lt = {
|
|
|
1469
1479
|
accept: a = "*/*",
|
|
1470
1480
|
maxSize: r = 10,
|
|
1471
1481
|
maxFiles: l = 5,
|
|
1472
|
-
disabled:
|
|
1473
|
-
label:
|
|
1482
|
+
disabled: p = !1,
|
|
1483
|
+
label: i,
|
|
1474
1484
|
required: s = !1,
|
|
1475
|
-
error:
|
|
1485
|
+
error: d,
|
|
1476
1486
|
className: C,
|
|
1477
1487
|
onFilesChange: k,
|
|
1478
|
-
onUpload:
|
|
1479
|
-
showPreview:
|
|
1480
|
-
locale:
|
|
1481
|
-
showFileTypeIcon:
|
|
1488
|
+
onUpload: M,
|
|
1489
|
+
showPreview: D = !0,
|
|
1490
|
+
locale: A = "uz",
|
|
1491
|
+
showFileTypeIcon: E = !0,
|
|
1482
1492
|
variant: v = "yellow",
|
|
1483
|
-
customValidator:
|
|
1493
|
+
customValidator: u
|
|
1484
1494
|
}) => {
|
|
1485
|
-
const [
|
|
1495
|
+
const [m, b] = _([]), [w, h] = _(!1), [y, $] = _(!1), L = le(null), j = Lt[A], o = v === "blue" ? {
|
|
1486
1496
|
dropBorder: "border-blue-200 hover:border-blue-300",
|
|
1487
1497
|
dropBg: "bg-blue-50/40 hover:bg-blue-50/60",
|
|
1488
1498
|
dropActive: "border-blue-600 bg-blue-50",
|
|
@@ -1550,7 +1560,7 @@ const Lt = {
|
|
|
1550
1560
|
async (g) => {
|
|
1551
1561
|
const I = Array.from(g), O = [];
|
|
1552
1562
|
for (const U of I) {
|
|
1553
|
-
if (
|
|
1563
|
+
if (m.length + O.length >= l) {
|
|
1554
1564
|
alert(j.maxFilesError(l));
|
|
1555
1565
|
break;
|
|
1556
1566
|
}
|
|
@@ -1562,44 +1572,44 @@ const Lt = {
|
|
|
1562
1572
|
alert(j.fileTypeError(U.name));
|
|
1563
1573
|
continue;
|
|
1564
1574
|
}
|
|
1565
|
-
if (
|
|
1566
|
-
const xe =
|
|
1575
|
+
if (u) {
|
|
1576
|
+
const xe = u(U);
|
|
1567
1577
|
if (xe) {
|
|
1568
1578
|
alert(xe);
|
|
1569
1579
|
continue;
|
|
1570
1580
|
}
|
|
1571
1581
|
}
|
|
1572
|
-
const
|
|
1582
|
+
const F = await B(U), X = M ? "uploading" : "success", me = M ? 0 : 100;
|
|
1573
1583
|
O.push({
|
|
1574
1584
|
id: Math.random().toString(36).substr(2, 9),
|
|
1575
1585
|
file: U,
|
|
1576
|
-
preview:
|
|
1586
|
+
preview: F,
|
|
1577
1587
|
progress: me,
|
|
1578
1588
|
status: X
|
|
1579
1589
|
});
|
|
1580
1590
|
}
|
|
1581
1591
|
if (O.length > 0) {
|
|
1582
|
-
const U = t ? [...
|
|
1583
|
-
if (b(U), k?.(U.map((
|
|
1592
|
+
const U = t ? [...m, ...O] : O;
|
|
1593
|
+
if (b(U), k?.(U.map((F) => F.file)), M) {
|
|
1584
1594
|
$(!0);
|
|
1585
1595
|
try {
|
|
1586
|
-
const
|
|
1596
|
+
const F = U.map((X, me) => ({
|
|
1587
1597
|
...X,
|
|
1588
1598
|
progress: Math.min(100, (me + 1) / U.length * 100)
|
|
1589
1599
|
}));
|
|
1590
|
-
b(
|
|
1600
|
+
b(F), await M(F), b(
|
|
1591
1601
|
(X) => X.map((me) => ({
|
|
1592
1602
|
...me,
|
|
1593
1603
|
status: "success",
|
|
1594
1604
|
progress: 100
|
|
1595
1605
|
}))
|
|
1596
1606
|
);
|
|
1597
|
-
} catch (
|
|
1607
|
+
} catch (F) {
|
|
1598
1608
|
b(
|
|
1599
1609
|
(X) => X.map((me) => ({
|
|
1600
1610
|
...me,
|
|
1601
1611
|
status: "error",
|
|
1602
|
-
error:
|
|
1612
|
+
error: F instanceof Error ? F.message : j.uploadFailed
|
|
1603
1613
|
}))
|
|
1604
1614
|
);
|
|
1605
1615
|
} finally {
|
|
@@ -1609,35 +1619,35 @@ const Lt = {
|
|
|
1609
1619
|
}
|
|
1610
1620
|
},
|
|
1611
1621
|
[
|
|
1612
|
-
|
|
1622
|
+
m,
|
|
1613
1623
|
l,
|
|
1614
1624
|
Y,
|
|
1615
1625
|
q,
|
|
1616
|
-
|
|
1626
|
+
u,
|
|
1617
1627
|
j,
|
|
1618
1628
|
r,
|
|
1619
1629
|
t,
|
|
1620
1630
|
k,
|
|
1621
|
-
|
|
1631
|
+
M
|
|
1622
1632
|
]
|
|
1623
1633
|
), ae = R(
|
|
1624
1634
|
(g) => {
|
|
1625
|
-
g.preventDefault(),
|
|
1635
|
+
g.preventDefault(), p || h(!0);
|
|
1626
1636
|
},
|
|
1627
|
-
[
|
|
1637
|
+
[p]
|
|
1628
1638
|
), ce = R((g) => {
|
|
1629
|
-
g.preventDefault(),
|
|
1639
|
+
g.preventDefault(), h(!1);
|
|
1630
1640
|
}, []), ee = R(
|
|
1631
1641
|
(g) => {
|
|
1632
|
-
if (g.preventDefault(),
|
|
1642
|
+
if (g.preventDefault(), h(!1), p) return;
|
|
1633
1643
|
const I = g.dataTransfer.files;
|
|
1634
1644
|
I.length > 0 && K(I);
|
|
1635
1645
|
},
|
|
1636
|
-
[
|
|
1646
|
+
[p, K]
|
|
1637
1647
|
), de = R(
|
|
1638
1648
|
(g) => {
|
|
1639
1649
|
const I = g.target.files;
|
|
1640
|
-
I && I.length > 0 && (K(I),
|
|
1650
|
+
I && I.length > 0 && (K(I), L.current && (L.current.value = ""));
|
|
1641
1651
|
},
|
|
1642
1652
|
[K]
|
|
1643
1653
|
), z = R(
|
|
@@ -1651,23 +1661,23 @@ const Lt = {
|
|
|
1651
1661
|
), G = R(() => {
|
|
1652
1662
|
Q(), b([]), k?.([]);
|
|
1653
1663
|
}, [k, Q]), oe = R(() => {
|
|
1654
|
-
|
|
1664
|
+
L.current?.click();
|
|
1655
1665
|
}, []);
|
|
1656
|
-
return /* @__PURE__ */
|
|
1657
|
-
|
|
1666
|
+
return /* @__PURE__ */ c("div", { className: n("w-full", C), children: [
|
|
1667
|
+
i && /* @__PURE__ */ c(
|
|
1658
1668
|
"label",
|
|
1659
1669
|
{
|
|
1660
1670
|
className: n(
|
|
1661
1671
|
"mb-2 block text-base font-medium",
|
|
1662
|
-
|
|
1672
|
+
d ? "text-red-600" : "text-slate-700"
|
|
1663
1673
|
),
|
|
1664
1674
|
children: [
|
|
1665
|
-
|
|
1675
|
+
i,
|
|
1666
1676
|
s && /* @__PURE__ */ e("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
|
|
1667
1677
|
]
|
|
1668
1678
|
}
|
|
1669
1679
|
),
|
|
1670
|
-
/* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ c(
|
|
1671
1681
|
"div",
|
|
1672
1682
|
{
|
|
1673
1683
|
className: n(
|
|
@@ -1675,8 +1685,8 @@ const Lt = {
|
|
|
1675
1685
|
o.dropBorder,
|
|
1676
1686
|
o.dropBg,
|
|
1677
1687
|
w && o.dropActive,
|
|
1678
|
-
|
|
1679
|
-
|
|
1688
|
+
p && "cursor-not-allowed opacity-60",
|
|
1689
|
+
d && "border-red-600 bg-red-50/30"
|
|
1680
1690
|
),
|
|
1681
1691
|
onDragOver: ae,
|
|
1682
1692
|
onDragLeave: ce,
|
|
@@ -1686,16 +1696,16 @@ const Lt = {
|
|
|
1686
1696
|
/* @__PURE__ */ e(
|
|
1687
1697
|
"input",
|
|
1688
1698
|
{
|
|
1689
|
-
ref:
|
|
1699
|
+
ref: L,
|
|
1690
1700
|
type: "file",
|
|
1691
1701
|
multiple: t,
|
|
1692
1702
|
accept: a,
|
|
1693
1703
|
onChange: de,
|
|
1694
|
-
disabled:
|
|
1704
|
+
disabled: p,
|
|
1695
1705
|
className: "hidden"
|
|
1696
1706
|
}
|
|
1697
1707
|
),
|
|
1698
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-3", children: [
|
|
1699
1709
|
/* @__PURE__ */ e("div", { className: n("flex h-12 w-12 items-center justify-center rounded-xl", o.iconWrap), children: /* @__PURE__ */ e(ot, { size: 20 }) }),
|
|
1700
1710
|
/* @__PURE__ */ e("p", { className: n("text-base font-medium", o.title), children: j.dropHereTitle }),
|
|
1701
1711
|
/* @__PURE__ */ e("p", { className: n("text-sm font-normal", o.hint), children: j.fileRequirements(t, l, r, a) })
|
|
@@ -1703,28 +1713,28 @@ const Lt = {
|
|
|
1703
1713
|
]
|
|
1704
1714
|
}
|
|
1705
1715
|
),
|
|
1706
|
-
|
|
1707
|
-
/* @__PURE__ */
|
|
1708
|
-
/* @__PURE__ */
|
|
1716
|
+
m.length > 0 && /* @__PURE__ */ c("div", { className: "mt-4 space-y-3", children: [
|
|
1717
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
|
|
1718
|
+
/* @__PURE__ */ c("span", { className: "text-sm font-medium text-slate-700", children: [
|
|
1709
1719
|
j.selectedFiles,
|
|
1710
1720
|
" (",
|
|
1711
|
-
|
|
1721
|
+
m.length,
|
|
1712
1722
|
")"
|
|
1713
1723
|
] }),
|
|
1714
|
-
|
|
1724
|
+
m.length > 1 && /* @__PURE__ */ e(
|
|
1715
1725
|
"button",
|
|
1716
1726
|
{
|
|
1717
1727
|
type: "button",
|
|
1718
1728
|
onClick: G,
|
|
1719
|
-
disabled:
|
|
1729
|
+
disabled: p || y,
|
|
1720
1730
|
className: "text-sm font-medium text-red-600 disabled:opacity-50",
|
|
1721
1731
|
children: j.clearAll
|
|
1722
1732
|
}
|
|
1723
1733
|
)
|
|
1724
1734
|
] }),
|
|
1725
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
1726
|
-
const O = !!g.preview ? o.fileIconImg : o.fileIconDoc, U =
|
|
1727
|
-
return /* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: m.map((g) => {
|
|
1736
|
+
const O = !!g.preview ? o.fileIconImg : o.fileIconDoc, U = p || y || g.status === "uploading";
|
|
1737
|
+
return /* @__PURE__ */ c(
|
|
1728
1738
|
"div",
|
|
1729
1739
|
{
|
|
1730
1740
|
className: n(
|
|
@@ -1732,7 +1742,7 @@ const Lt = {
|
|
|
1732
1742
|
g.status === "error" && "border-red-600"
|
|
1733
1743
|
),
|
|
1734
1744
|
children: [
|
|
1735
|
-
/* @__PURE__ */
|
|
1745
|
+
/* @__PURE__ */ c("div", { className: "flex min-w-0 items-center gap-4", children: [
|
|
1736
1746
|
/* @__PURE__ */ e(
|
|
1737
1747
|
"div",
|
|
1738
1748
|
{
|
|
@@ -1740,28 +1750,28 @@ const Lt = {
|
|
|
1740
1750
|
"flex h-14 w-14 items-center justify-center rounded-2xl",
|
|
1741
1751
|
O
|
|
1742
1752
|
),
|
|
1743
|
-
children:
|
|
1753
|
+
children: D && g.preview ? /* @__PURE__ */ e(
|
|
1744
1754
|
"img",
|
|
1745
1755
|
{
|
|
1746
1756
|
src: g.preview,
|
|
1747
1757
|
alt: g.file.name,
|
|
1748
1758
|
className: "h-10 w-10 rounded-xl object-cover"
|
|
1749
1759
|
}
|
|
1750
|
-
) :
|
|
1760
|
+
) : E ? N(g.file) : /* @__PURE__ */ e(Te, { className: "h-6 w-6 text-slate-500" })
|
|
1751
1761
|
}
|
|
1752
1762
|
),
|
|
1753
|
-
/* @__PURE__ */
|
|
1763
|
+
/* @__PURE__ */ c("div", { className: "min-w-0", children: [
|
|
1754
1764
|
/* @__PURE__ */ e("p", { className: "truncate text-lg font-semibold text-primary", children: g.file.name }),
|
|
1755
|
-
/* @__PURE__ */
|
|
1765
|
+
/* @__PURE__ */ c("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-sm text-slate-500", children: [
|
|
1756
1766
|
/* @__PURE__ */ e("span", { children: T(g.file.size) }),
|
|
1757
|
-
g.status === "uploading" && /* @__PURE__ */
|
|
1767
|
+
g.status === "uploading" && /* @__PURE__ */ c(he, { children: [
|
|
1758
1768
|
/* @__PURE__ */ e("span", { children: "•" }),
|
|
1759
|
-
/* @__PURE__ */
|
|
1769
|
+
/* @__PURE__ */ c("span", { className: "inline-flex items-center", children: [
|
|
1760
1770
|
/* @__PURE__ */ e(We, { className: "mr-1 h-5 w-5 animate-spin" }),
|
|
1761
1771
|
j.uploading
|
|
1762
1772
|
] })
|
|
1763
1773
|
] }),
|
|
1764
|
-
g.status === "success" && /* @__PURE__ */
|
|
1774
|
+
g.status === "success" && /* @__PURE__ */ c(he, { children: [
|
|
1765
1775
|
/* @__PURE__ */ e("span", { children: "•" }),
|
|
1766
1776
|
/* @__PURE__ */ e("span", { className: "font-normal text-green-600", children: j.success })
|
|
1767
1777
|
] })
|
|
@@ -1779,13 +1789,13 @@ const Lt = {
|
|
|
1779
1789
|
g.status === "error" && g.error && /* @__PURE__ */ e("p", { className: "mt-2 text-sm font-normal text-red-600", children: g.error })
|
|
1780
1790
|
] })
|
|
1781
1791
|
] }),
|
|
1782
|
-
/* @__PURE__ */
|
|
1792
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1783
1793
|
/* @__PURE__ */ e(
|
|
1784
1794
|
"button",
|
|
1785
1795
|
{
|
|
1786
1796
|
type: "button",
|
|
1787
|
-
onClick: (
|
|
1788
|
-
|
|
1797
|
+
onClick: (F) => {
|
|
1798
|
+
F.stopPropagation(), U || ne(g);
|
|
1789
1799
|
},
|
|
1790
1800
|
disabled: U,
|
|
1791
1801
|
className: "rounded-xl p-2 hover:bg-slate-100 hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
|
|
@@ -1797,10 +1807,10 @@ const Lt = {
|
|
|
1797
1807
|
"button",
|
|
1798
1808
|
{
|
|
1799
1809
|
type: "button",
|
|
1800
|
-
onClick: (
|
|
1801
|
-
|
|
1810
|
+
onClick: (F) => {
|
|
1811
|
+
F.stopPropagation(), z(g.id);
|
|
1802
1812
|
},
|
|
1803
|
-
disabled:
|
|
1813
|
+
disabled: p || y,
|
|
1804
1814
|
className: "rounded-xl p-2 text-slate-base hover:bg-slate-100 disabled:opacity-50 hover:cursor-pointer",
|
|
1805
1815
|
title: j.remove,
|
|
1806
1816
|
children: /* @__PURE__ */ e(pe, { className: "h-6 w-6" })
|
|
@@ -1813,7 +1823,7 @@ const Lt = {
|
|
|
1813
1823
|
);
|
|
1814
1824
|
}) })
|
|
1815
1825
|
] }),
|
|
1816
|
-
|
|
1826
|
+
d && /* @__PURE__ */ e("p", { className: "mt-2 text-sm font-normal text-red-600", children: d })
|
|
1817
1827
|
] });
|
|
1818
1828
|
};
|
|
1819
1829
|
function er({
|
|
@@ -1821,24 +1831,24 @@ function er({
|
|
|
1821
1831
|
setShow: a,
|
|
1822
1832
|
title: r,
|
|
1823
1833
|
description: l,
|
|
1824
|
-
Header:
|
|
1825
|
-
Body:
|
|
1834
|
+
Header: p,
|
|
1835
|
+
Body: i,
|
|
1826
1836
|
footer: s,
|
|
1827
|
-
handleClickOutside:
|
|
1837
|
+
handleClickOutside: d = !1,
|
|
1828
1838
|
showCloseIcon: C = !0,
|
|
1829
1839
|
showHeader: k = !0,
|
|
1830
|
-
overlayClassName:
|
|
1831
|
-
containerClassName:
|
|
1832
|
-
bodyClassName:
|
|
1833
|
-
footerClassName:
|
|
1840
|
+
overlayClassName: M,
|
|
1841
|
+
containerClassName: D,
|
|
1842
|
+
bodyClassName: A,
|
|
1843
|
+
footerClassName: E
|
|
1834
1844
|
}) {
|
|
1835
|
-
const v = le(null), { handleEscape:
|
|
1836
|
-
J(() => (t ? (document.addEventListener("keydown",
|
|
1837
|
-
const { handleClick:
|
|
1838
|
-
|
|
1845
|
+
const v = le(null), { handleEscape: u } = Ee(() => a(!1));
|
|
1846
|
+
J(() => (t ? (document.addEventListener("keydown", u), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => document.removeEventListener("keydown", u)), [t, u]);
|
|
1847
|
+
const { handleClick: m } = De(v, () => {
|
|
1848
|
+
d && a(!1);
|
|
1839
1849
|
});
|
|
1840
|
-
J(() => (t &&
|
|
1841
|
-
const w = k && !!(
|
|
1850
|
+
J(() => (t && d && document.addEventListener("mousedown", m), () => document.removeEventListener("mousedown", m)), [t, m, d]);
|
|
1851
|
+
const w = k && !!(p || r || l);
|
|
1842
1852
|
return /* @__PURE__ */ e(
|
|
1843
1853
|
"div",
|
|
1844
1854
|
{
|
|
@@ -1846,9 +1856,9 @@ function er({
|
|
|
1846
1856
|
"bg-black/40 fixed inset-0 z-50 flex justify-center transition-all duration-500 ease-in-out",
|
|
1847
1857
|
"items-end sm:items-center",
|
|
1848
1858
|
t ? "opacity-100" : "pointer-events-none opacity-0",
|
|
1849
|
-
|
|
1859
|
+
M
|
|
1850
1860
|
),
|
|
1851
|
-
children: /* @__PURE__ */
|
|
1861
|
+
children: /* @__PURE__ */ c(
|
|
1852
1862
|
"div",
|
|
1853
1863
|
{
|
|
1854
1864
|
ref: v,
|
|
@@ -1858,11 +1868,11 @@ function er({
|
|
|
1858
1868
|
"rounded-t-2xl sm:rounded-2xl",
|
|
1859
1869
|
"transition-all duration-500 ease-out",
|
|
1860
1870
|
t ? "scale-100 opacity-100" : "scale-95 opacity-0",
|
|
1861
|
-
|
|
1871
|
+
D
|
|
1862
1872
|
),
|
|
1863
1873
|
children: [
|
|
1864
|
-
w && /* @__PURE__ */
|
|
1865
|
-
|
|
1874
|
+
w && /* @__PURE__ */ c("div", { className: "border-b border-slate-200 flex items-start justify-between p-4 sm:p-6 mb-4", children: [
|
|
1875
|
+
p || /* @__PURE__ */ c("div", { className: "block", children: [
|
|
1866
1876
|
/* @__PURE__ */ e("h2", { className: "text-h3 font-semibold text-black", children: r }),
|
|
1867
1877
|
l && /* @__PURE__ */ e("p", { className: "text-base text-slate-base font-normal mt-2", children: l })
|
|
1868
1878
|
] }),
|
|
@@ -1877,16 +1887,16 @@ function er({
|
|
|
1877
1887
|
}
|
|
1878
1888
|
)
|
|
1879
1889
|
] }),
|
|
1880
|
-
|
|
1890
|
+
i && /* @__PURE__ */ e(
|
|
1881
1891
|
"div",
|
|
1882
1892
|
{
|
|
1883
1893
|
className: n(
|
|
1884
1894
|
"scrollbar-thin scrollbar-thumb-slate-200 overflow-y-auto",
|
|
1885
1895
|
"max-h-[70dvh] sm:max-h-96",
|
|
1886
1896
|
"px-4 sm:px-6 mb-2",
|
|
1887
|
-
|
|
1897
|
+
A
|
|
1888
1898
|
),
|
|
1889
|
-
children:
|
|
1899
|
+
children: i
|
|
1890
1900
|
}
|
|
1891
1901
|
),
|
|
1892
1902
|
s && /* @__PURE__ */ e(
|
|
@@ -1895,7 +1905,7 @@ function er({
|
|
|
1895
1905
|
className: n(
|
|
1896
1906
|
"flex items-center justify-end gap-3 border-t border-slate-200",
|
|
1897
1907
|
"p-4 sm:p-6",
|
|
1898
|
-
|
|
1908
|
+
E
|
|
1899
1909
|
),
|
|
1900
1910
|
children: s
|
|
1901
1911
|
}
|
|
@@ -1911,24 +1921,24 @@ function tr({
|
|
|
1911
1921
|
currentPage: a,
|
|
1912
1922
|
perPage: r,
|
|
1913
1923
|
onPageChange: l,
|
|
1914
|
-
onPerPageChange:
|
|
1915
|
-
siblingCount:
|
|
1924
|
+
onPerPageChange: p,
|
|
1925
|
+
siblingCount: i = 1,
|
|
1916
1926
|
perPageOptions: s = [10, 30, 50, 100],
|
|
1917
|
-
showPerPage:
|
|
1927
|
+
showPerPage: d = !0,
|
|
1918
1928
|
variant: C = "yellow",
|
|
1919
1929
|
size: k = "large",
|
|
1920
|
-
paginationClassName:
|
|
1930
|
+
paginationClassName: M
|
|
1921
1931
|
}) {
|
|
1922
|
-
const
|
|
1923
|
-
if (v <= 1 ||
|
|
1924
|
-
const
|
|
1925
|
-
const
|
|
1932
|
+
const D = Number.isFinite(t) && t > 0 ? t : 0, A = Number.isFinite(r) && r > 0 ? r : 10, E = Math.max(1, Number.isFinite(a) ? a : 1), v = Math.ceil(D / A);
|
|
1933
|
+
if (v <= 1 || D === 0) return null;
|
|
1934
|
+
const m = (() => {
|
|
1935
|
+
const h = [], y = i * 2 + 5;
|
|
1926
1936
|
if (v <= y)
|
|
1927
1937
|
return Array.from({ length: v }, (j, o) => o + 1);
|
|
1928
|
-
const $ = Math.max(
|
|
1929
|
-
|
|
1930
|
-
for (let j = $; j <=
|
|
1931
|
-
return
|
|
1938
|
+
const $ = Math.max(E - i, 2), L = Math.min(E + i, v - 1);
|
|
1939
|
+
h.push(1), $ > 2 && h.push("...");
|
|
1940
|
+
for (let j = $; j <= L; j++) h.push(j);
|
|
1941
|
+
return L < v - 1 && h.push("..."), v > 1 && h.push(v), h;
|
|
1932
1942
|
})(), b = {
|
|
1933
1943
|
medium: "h-9 text-sm",
|
|
1934
1944
|
large: "h-10 text-base"
|
|
@@ -1946,11 +1956,11 @@ function tr({
|
|
|
1946
1956
|
arrow: "text-black"
|
|
1947
1957
|
}
|
|
1948
1958
|
}[C ?? "yellow"];
|
|
1949
|
-
return /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ c("div", { className: n(
|
|
1950
1960
|
"flex items-center justify-between gap-4 w-full",
|
|
1951
|
-
|
|
1961
|
+
M
|
|
1952
1962
|
), children: [
|
|
1953
|
-
|
|
1963
|
+
d && p && /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1954
1964
|
/* @__PURE__ */ e(
|
|
1955
1965
|
"span",
|
|
1956
1966
|
{
|
|
@@ -1958,18 +1968,18 @@ function tr({
|
|
|
1958
1968
|
children: "Строк на странице:"
|
|
1959
1969
|
}
|
|
1960
1970
|
),
|
|
1961
|
-
/* @__PURE__ */
|
|
1971
|
+
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
1962
1972
|
/* @__PURE__ */ e(
|
|
1963
1973
|
"select",
|
|
1964
1974
|
{
|
|
1965
|
-
value:
|
|
1966
|
-
onChange: (
|
|
1975
|
+
value: A,
|
|
1976
|
+
onChange: (h) => p(Number(h.target.value)),
|
|
1967
1977
|
className: n(
|
|
1968
1978
|
"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",
|
|
1969
1979
|
k === "large" ? "h-10" : "h-9"
|
|
1970
1980
|
),
|
|
1971
1981
|
"aria-label": "Количество строк на странице",
|
|
1972
|
-
children: s.map((
|
|
1982
|
+
children: s.map((h) => /* @__PURE__ */ e("option", { value: h, children: h }, h))
|
|
1973
1983
|
}
|
|
1974
1984
|
),
|
|
1975
1985
|
/* @__PURE__ */ e(
|
|
@@ -1982,23 +1992,23 @@ function tr({
|
|
|
1982
1992
|
)
|
|
1983
1993
|
] })
|
|
1984
1994
|
] }),
|
|
1985
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ c("nav", { "aria-label": "Пагинация", className: "flex items-center gap-1 shrink-0 whitespace-nowrap", children: [
|
|
1986
1996
|
/* @__PURE__ */ e(
|
|
1987
1997
|
"button",
|
|
1988
1998
|
{
|
|
1989
|
-
onClick: () => l(
|
|
1990
|
-
disabled:
|
|
1999
|
+
onClick: () => l(E - 1),
|
|
2000
|
+
disabled: E === 1,
|
|
1991
2001
|
"aria-label": "Предыдущая страница",
|
|
1992
2002
|
className: n(
|
|
1993
2003
|
"flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
|
|
1994
2004
|
b,
|
|
1995
|
-
|
|
2005
|
+
E === 1 ? n("cursor-not-allowed opacity-50", w.disabled) : n("hover:cursor-pointer", w.arrow, "border-slate-200")
|
|
1996
2006
|
),
|
|
1997
2007
|
children: /* @__PURE__ */ e(ke, { weight: "Linear", size: 20 })
|
|
1998
2008
|
}
|
|
1999
2009
|
),
|
|
2000
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children:
|
|
2001
|
-
if (
|
|
2010
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: m.map((h, y) => {
|
|
2011
|
+
if (h === "...")
|
|
2002
2012
|
return /* @__PURE__ */ e(
|
|
2003
2013
|
"span",
|
|
2004
2014
|
{
|
|
@@ -2008,19 +2018,19 @@ function tr({
|
|
|
2008
2018
|
},
|
|
2009
2019
|
y
|
|
2010
2020
|
);
|
|
2011
|
-
const $ =
|
|
2021
|
+
const $ = h === E;
|
|
2012
2022
|
return /* @__PURE__ */ e(
|
|
2013
2023
|
"button",
|
|
2014
2024
|
{
|
|
2015
|
-
onClick: () => l(
|
|
2016
|
-
"aria-label": `Страница ${
|
|
2025
|
+
onClick: () => l(h),
|
|
2026
|
+
"aria-label": `Страница ${h}${$ ? ", текущая" : ""}`,
|
|
2017
2027
|
"aria-current": $ ? "page" : void 0,
|
|
2018
2028
|
className: n(
|
|
2019
2029
|
"flex items-center justify-center rounded-lg border font-medium transition-all hover:cursor-pointer min-w-10 px-2",
|
|
2020
2030
|
b,
|
|
2021
2031
|
$ ? w.active : w.inactive
|
|
2022
2032
|
),
|
|
2023
|
-
children:
|
|
2033
|
+
children: h
|
|
2024
2034
|
},
|
|
2025
2035
|
y
|
|
2026
2036
|
);
|
|
@@ -2028,13 +2038,13 @@ function tr({
|
|
|
2028
2038
|
/* @__PURE__ */ e(
|
|
2029
2039
|
"button",
|
|
2030
2040
|
{
|
|
2031
|
-
onClick: () => l(
|
|
2032
|
-
disabled:
|
|
2041
|
+
onClick: () => l(E + 1),
|
|
2042
|
+
disabled: E === v,
|
|
2033
2043
|
"aria-label": "Следующая страница",
|
|
2034
2044
|
className: n(
|
|
2035
2045
|
"flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
|
|
2036
2046
|
b,
|
|
2037
|
-
|
|
2047
|
+
E === v ? n("cursor-not-allowed opacity-50", w.disabled) : n("hover:cursor-pointer", w.arrow, "border-slate-200")
|
|
2038
2048
|
),
|
|
2039
2049
|
children: /* @__PURE__ */ e(be, { size: 20, weight: "Linear" })
|
|
2040
2050
|
}
|
|
@@ -2071,35 +2081,35 @@ function rr({
|
|
|
2071
2081
|
defaultTab: a,
|
|
2072
2082
|
position: r = "top",
|
|
2073
2083
|
className: l,
|
|
2074
|
-
tabListClassName:
|
|
2075
|
-
contentClassName:
|
|
2084
|
+
tabListClassName: p,
|
|
2085
|
+
contentClassName: i,
|
|
2076
2086
|
extra: s,
|
|
2077
|
-
onChange:
|
|
2087
|
+
onChange: d
|
|
2078
2088
|
}) {
|
|
2079
|
-
const [C, k] = _(a || t[0]?.id), [
|
|
2089
|
+
const [C, k] = _(a || t[0]?.id), [M, D] = _({}), A = le([]), E = () => {
|
|
2080
2090
|
requestAnimationFrame(() => {
|
|
2081
|
-
const w = t.findIndex((y) => y?.id === C),
|
|
2082
|
-
if (
|
|
2083
|
-
const { offsetLeft: y, offsetTop: $, offsetWidth:
|
|
2084
|
-
|
|
2091
|
+
const w = t.findIndex((y) => y?.id === C), h = A.current[w];
|
|
2092
|
+
if (h) {
|
|
2093
|
+
const { offsetLeft: y, offsetTop: $, offsetWidth: L, offsetHeight: j } = h;
|
|
2094
|
+
D({
|
|
2085
2095
|
left: `${y}px`,
|
|
2086
2096
|
top: `${$}px`,
|
|
2087
|
-
width: `${
|
|
2097
|
+
width: `${L}px`,
|
|
2088
2098
|
height: `${j}px`,
|
|
2089
2099
|
transition: "all 0.35s cubic-bezier(0.25, 1, 0.5, 1)"
|
|
2090
2100
|
});
|
|
2091
2101
|
}
|
|
2092
2102
|
});
|
|
2093
2103
|
};
|
|
2094
|
-
J(() => (
|
|
2095
|
-
|
|
2104
|
+
J(() => (E(), window.addEventListener("resize", E), "fonts" in document && document.fonts.ready.then(E), () => window.removeEventListener("resize", E)), [C, r, t]), J(() => {
|
|
2105
|
+
A.current = A.current.slice(0, t.length);
|
|
2096
2106
|
}, [t]);
|
|
2097
|
-
const v = r === "left" || r === "right",
|
|
2107
|
+
const v = r === "left" || r === "right", u = {
|
|
2098
2108
|
top: "flex-col",
|
|
2099
2109
|
bottom: "flex-col-reverse",
|
|
2100
2110
|
left: "flex-row",
|
|
2101
2111
|
right: "flex-row-reverse"
|
|
2102
|
-
},
|
|
2112
|
+
}, m = {
|
|
2103
2113
|
top: "flex-row",
|
|
2104
2114
|
bottom: "flex-row",
|
|
2105
2115
|
left: "flex-col",
|
|
@@ -2110,8 +2120,8 @@ function rr({
|
|
|
2110
2120
|
left: "ml-4",
|
|
2111
2121
|
right: "mr-4"
|
|
2112
2122
|
};
|
|
2113
|
-
return /* @__PURE__ */
|
|
2114
|
-
/* @__PURE__ */
|
|
2123
|
+
return /* @__PURE__ */ c("div", { className: n("flex w-full", u[r], l), children: [
|
|
2124
|
+
/* @__PURE__ */ c(
|
|
2115
2125
|
"div",
|
|
2116
2126
|
{
|
|
2117
2127
|
className: n(
|
|
@@ -2126,34 +2136,34 @@ function rr({
|
|
|
2126
2136
|
"flex-1",
|
|
2127
2137
|
v ? "w-full" : "min-w-[520px]"
|
|
2128
2138
|
),
|
|
2129
|
-
children: /* @__PURE__ */
|
|
2139
|
+
children: /* @__PURE__ */ c(
|
|
2130
2140
|
"div",
|
|
2131
2141
|
{
|
|
2132
2142
|
className: n(
|
|
2133
2143
|
"relative flex rounded-xl bg-slate-100 p-1",
|
|
2134
|
-
|
|
2144
|
+
m[r],
|
|
2135
2145
|
!v && "w-full overflow-hidden",
|
|
2136
2146
|
v ? "min-w-48" : "",
|
|
2137
|
-
|
|
2147
|
+
p
|
|
2138
2148
|
),
|
|
2139
2149
|
children: [
|
|
2140
2150
|
/* @__PURE__ */ e(
|
|
2141
2151
|
"div",
|
|
2142
2152
|
{
|
|
2143
2153
|
className: n("absolute rounded-lg bg-white", v ? "w-full" : "h-full"),
|
|
2144
|
-
style:
|
|
2154
|
+
style: M
|
|
2145
2155
|
}
|
|
2146
2156
|
),
|
|
2147
|
-
t?.map((w,
|
|
2157
|
+
t?.map((w, h) => {
|
|
2148
2158
|
const y = C === w.id;
|
|
2149
|
-
return /* @__PURE__ */
|
|
2159
|
+
return /* @__PURE__ */ c(
|
|
2150
2160
|
"button",
|
|
2151
2161
|
{
|
|
2152
2162
|
ref: ($) => {
|
|
2153
|
-
|
|
2163
|
+
A.current[h] = $;
|
|
2154
2164
|
},
|
|
2155
2165
|
onClick: () => {
|
|
2156
|
-
w?.disabled || (k(w?.id),
|
|
2166
|
+
w?.disabled || (k(w?.id), d?.(w?.id));
|
|
2157
2167
|
},
|
|
2158
2168
|
disabled: w?.disabled,
|
|
2159
2169
|
className: n(
|
|
@@ -2187,7 +2197,7 @@ function rr({
|
|
|
2187
2197
|
]
|
|
2188
2198
|
}
|
|
2189
2199
|
),
|
|
2190
|
-
/* @__PURE__ */ e("div", { className: n("w-full flex-1 overflow-hidden", b[r],
|
|
2200
|
+
/* @__PURE__ */ e("div", { className: n("w-full flex-1 overflow-hidden", b[r], i), children: /* @__PURE__ */ e("div", { className: "animate-fade-in w-full", style: { animationDuration: "0.35s" }, children: t?.find((w) => w.id === C)?.content }, C) })
|
|
2191
2201
|
] });
|
|
2192
2202
|
}
|
|
2193
2203
|
const jt = {
|
|
@@ -2210,10 +2220,10 @@ function nr({
|
|
|
2210
2220
|
variant: a = "success",
|
|
2211
2221
|
size: r = "lg",
|
|
2212
2222
|
icon: l,
|
|
2213
|
-
iconPosition:
|
|
2214
|
-
className:
|
|
2223
|
+
iconPosition: p = "left",
|
|
2224
|
+
className: i
|
|
2215
2225
|
}) {
|
|
2216
|
-
return /* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ c(
|
|
2217
2227
|
"span",
|
|
2218
2228
|
{
|
|
2219
2229
|
className: n(
|
|
@@ -2221,12 +2231,12 @@ function nr({
|
|
|
2221
2231
|
jt[r],
|
|
2222
2232
|
It[a],
|
|
2223
2233
|
l && "gap-[2px]",
|
|
2224
|
-
|
|
2234
|
+
i
|
|
2225
2235
|
),
|
|
2226
2236
|
children: [
|
|
2227
|
-
l &&
|
|
2237
|
+
l && p === "left" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(Be[r])}`, children: l }),
|
|
2228
2238
|
/* @__PURE__ */ e("span", { children: t }),
|
|
2229
|
-
l &&
|
|
2239
|
+
l && p === "right" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(Be[r])}`, children: l })
|
|
2230
2240
|
]
|
|
2231
2241
|
}
|
|
2232
2242
|
);
|
|
@@ -2237,16 +2247,16 @@ const Rt = fe(
|
|
|
2237
2247
|
placeholder: a,
|
|
2238
2248
|
value: r = "",
|
|
2239
2249
|
onChange: l,
|
|
2240
|
-
required:
|
|
2241
|
-
disabled:
|
|
2250
|
+
required: p = !1,
|
|
2251
|
+
disabled: i = !1,
|
|
2242
2252
|
error: s,
|
|
2243
|
-
className:
|
|
2253
|
+
className: d,
|
|
2244
2254
|
rows: C = 4,
|
|
2245
2255
|
name: k
|
|
2246
|
-
},
|
|
2247
|
-
const
|
|
2248
|
-
return /* @__PURE__ */
|
|
2249
|
-
t && /* @__PURE__ */
|
|
2256
|
+
}, M) => {
|
|
2257
|
+
const D = Z(() => 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]);
|
|
2258
|
+
return /* @__PURE__ */ c("div", { className: n("relative w-full", d), children: [
|
|
2259
|
+
t && /* @__PURE__ */ c(
|
|
2250
2260
|
"label",
|
|
2251
2261
|
{
|
|
2252
2262
|
className: n(
|
|
@@ -2255,24 +2265,24 @@ const Rt = fe(
|
|
|
2255
2265
|
),
|
|
2256
2266
|
children: [
|
|
2257
2267
|
t,
|
|
2258
|
-
|
|
2268
|
+
p && /* @__PURE__ */ e("span", { className: "ml-1 text-red-600", children: "*" })
|
|
2259
2269
|
]
|
|
2260
2270
|
}
|
|
2261
2271
|
),
|
|
2262
2272
|
/* @__PURE__ */ e(
|
|
2263
2273
|
"textarea",
|
|
2264
2274
|
{
|
|
2265
|
-
ref:
|
|
2275
|
+
ref: M,
|
|
2266
2276
|
name: k,
|
|
2267
2277
|
rows: C,
|
|
2268
2278
|
value: r,
|
|
2269
|
-
onChange: (
|
|
2270
|
-
disabled:
|
|
2279
|
+
onChange: (A) => l?.(A.target.value),
|
|
2280
|
+
disabled: i,
|
|
2271
2281
|
placeholder: a,
|
|
2272
2282
|
className: n(
|
|
2273
2283
|
"w-full resize-none rounded-xl border bg-white text-base font-normal transition-all duration-300 ease-in-out outline-none",
|
|
2274
2284
|
"p-3 disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
|
|
2275
|
-
|
|
2285
|
+
D
|
|
2276
2286
|
)
|
|
2277
2287
|
}
|
|
2278
2288
|
),
|
|
@@ -2296,23 +2306,23 @@ function Bt({
|
|
|
2296
2306
|
description: a,
|
|
2297
2307
|
type: r = "info",
|
|
2298
2308
|
duration: l = 3e3,
|
|
2299
|
-
action:
|
|
2300
|
-
onClose:
|
|
2309
|
+
action: p,
|
|
2310
|
+
onClose: i
|
|
2301
2311
|
}) {
|
|
2302
|
-
const [s,
|
|
2312
|
+
const [s, d] = _(100);
|
|
2303
2313
|
J(() => {
|
|
2304
2314
|
if (l === 1 / 0) {
|
|
2305
|
-
|
|
2315
|
+
d(100);
|
|
2306
2316
|
return;
|
|
2307
2317
|
}
|
|
2308
|
-
let
|
|
2309
|
-
const
|
|
2310
|
-
|
|
2311
|
-
const v =
|
|
2312
|
-
|
|
2313
|
-
},
|
|
2314
|
-
return () => cancelAnimationFrame(
|
|
2315
|
-
}, [l,
|
|
2318
|
+
let M = null;
|
|
2319
|
+
const D = (E) => {
|
|
2320
|
+
M || (M = E);
|
|
2321
|
+
const v = E - M, u = Math.max(0, (l - v) / l * 100);
|
|
2322
|
+
d(u), u > 0 ? requestAnimationFrame(D) : i?.();
|
|
2323
|
+
}, A = requestAnimationFrame(D);
|
|
2324
|
+
return () => cancelAnimationFrame(A);
|
|
2325
|
+
}, [l, i]);
|
|
2316
2326
|
const C = {
|
|
2317
2327
|
success: /* @__PURE__ */ e(gt, { weight: "Bold", className: "w-5 h-5" }),
|
|
2318
2328
|
error: /* @__PURE__ */ e(pt, { weight: "Bold", className: "w-5 h-5" }),
|
|
@@ -2349,7 +2359,7 @@ function Bt({
|
|
|
2349
2359
|
loading: "text-slate-600"
|
|
2350
2360
|
}
|
|
2351
2361
|
};
|
|
2352
|
-
return /* @__PURE__ */
|
|
2362
|
+
return /* @__PURE__ */ c(
|
|
2353
2363
|
"div",
|
|
2354
2364
|
{
|
|
2355
2365
|
className: n(
|
|
@@ -2368,17 +2378,17 @@ function Bt({
|
|
|
2368
2378
|
}
|
|
2369
2379
|
}
|
|
2370
2380
|
),
|
|
2371
|
-
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */
|
|
2381
|
+
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
|
|
2372
2382
|
/* @__PURE__ */ e("div", { className: n("flex-shrink-0", k.text[r]), children: C[r] }),
|
|
2373
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
2374
2384
|
/* @__PURE__ */ e("h4", { className: "text-base font-medium mb-1", children: t }),
|
|
2375
2385
|
a && /* @__PURE__ */ e("p", { className: "text-sm text-[#82828C]", children: a }),
|
|
2376
|
-
|
|
2386
|
+
p && /* @__PURE__ */ e("div", { className: "mt-3", children: /* @__PURE__ */ e("div", { className: n("underline font-medium text-sm", k.action[r]), children: p }) })
|
|
2377
2387
|
] }),
|
|
2378
2388
|
/* @__PURE__ */ e(
|
|
2379
2389
|
"button",
|
|
2380
2390
|
{
|
|
2381
|
-
onClick:
|
|
2391
|
+
onClick: i,
|
|
2382
2392
|
className: "flex-shrink-0 rounded-full transition cursor-pointer active:animate-spin",
|
|
2383
2393
|
children: /* @__PURE__ */ e(pe, { className: "w-6 h-6 text-slate-base" })
|
|
2384
2394
|
}
|
|
@@ -2390,8 +2400,8 @@ function Bt({
|
|
|
2390
2400
|
}
|
|
2391
2401
|
const ge = (t) => {
|
|
2392
2402
|
const a = $t++, r = () => {
|
|
2393
|
-
const
|
|
2394
|
-
|
|
2403
|
+
const p = Ce.findIndex((i) => i?.id === a);
|
|
2404
|
+
p !== -1 && (Ce.splice(p, 1), ze());
|
|
2395
2405
|
}, l = /* @__PURE__ */ e(Bt, { ...t, onClose: r });
|
|
2396
2406
|
return Ce.push({ id: a, element: l }), ze(), t.duration !== 1 / 0 && setTimeout(r, (t.duration || 3e3) + 300), { close: r };
|
|
2397
2407
|
}, lr = {
|
|
@@ -2423,9 +2433,9 @@ function ar({
|
|
|
2423
2433
|
children: a,
|
|
2424
2434
|
position: r = "top",
|
|
2425
2435
|
delay: l = 200,
|
|
2426
|
-
className:
|
|
2436
|
+
className: p
|
|
2427
2437
|
}) {
|
|
2428
|
-
const
|
|
2438
|
+
const i = {
|
|
2429
2439
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
2430
2440
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
2431
2441
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
@@ -2436,17 +2446,17 @@ function ar({
|
|
|
2436
2446
|
left: "top-1/2 -translate-y-1/2 left-full",
|
|
2437
2447
|
right: "top-1/2 -translate-y-1/2 right-full"
|
|
2438
2448
|
};
|
|
2439
|
-
return /* @__PURE__ */
|
|
2449
|
+
return /* @__PURE__ */ c("div", { className: "group relative inline-block", children: [
|
|
2440
2450
|
a,
|
|
2441
|
-
/* @__PURE__ */
|
|
2451
|
+
/* @__PURE__ */ c(
|
|
2442
2452
|
"div",
|
|
2443
2453
|
{
|
|
2444
2454
|
className: n(
|
|
2445
2455
|
"absolute z-50 rounded-md bg-slate-400 px-2 py-1 text-xs whitespace-nowrap text-white shadow-md",
|
|
2446
2456
|
"scale-95 opacity-0 transition-all group-hover:scale-100 group-hover:opacity-100",
|
|
2447
2457
|
"duration-200 ease-out group-hover:delay-200",
|
|
2448
|
-
|
|
2449
|
-
|
|
2458
|
+
i[r],
|
|
2459
|
+
p
|
|
2450
2460
|
),
|
|
2451
2461
|
style: { transitionDelay: `${l}ms` },
|
|
2452
2462
|
children: [
|
|
@@ -2470,11 +2480,11 @@ function sr({
|
|
|
2470
2480
|
onChange: a,
|
|
2471
2481
|
disabled: r = !1,
|
|
2472
2482
|
variant: l = "yellow",
|
|
2473
|
-
label:
|
|
2474
|
-
supportText:
|
|
2483
|
+
label: p,
|
|
2484
|
+
supportText: i,
|
|
2475
2485
|
className: s
|
|
2476
2486
|
}) {
|
|
2477
|
-
const
|
|
2487
|
+
const d = () => {
|
|
2478
2488
|
r || a?.(!t);
|
|
2479
2489
|
}, C = {
|
|
2480
2490
|
blue: {
|
|
@@ -2488,7 +2498,7 @@ function sr({
|
|
|
2488
2498
|
focus: "focus:ring-2 focus:ring-yellow-200"
|
|
2489
2499
|
}
|
|
2490
2500
|
};
|
|
2491
|
-
return /* @__PURE__ */
|
|
2501
|
+
return /* @__PURE__ */ c(
|
|
2492
2502
|
"div",
|
|
2493
2503
|
{
|
|
2494
2504
|
className: n(
|
|
@@ -2508,7 +2518,7 @@ function sr({
|
|
|
2508
2518
|
!r && C[l].focus,
|
|
2509
2519
|
r && "bg-slate-100 cursor-not-allowed"
|
|
2510
2520
|
),
|
|
2511
|
-
onClick:
|
|
2521
|
+
onClick: d,
|
|
2512
2522
|
children: /* @__PURE__ */ e(
|
|
2513
2523
|
"span",
|
|
2514
2524
|
{
|
|
@@ -2520,17 +2530,17 @@ function sr({
|
|
|
2520
2530
|
)
|
|
2521
2531
|
}
|
|
2522
2532
|
),
|
|
2523
|
-
(
|
|
2524
|
-
|
|
2533
|
+
(p || i) && /* @__PURE__ */ c("div", { className: "flex flex-col leading-tight", children: [
|
|
2534
|
+
p && /* @__PURE__ */ e(
|
|
2525
2535
|
"span",
|
|
2526
2536
|
{
|
|
2527
2537
|
className: n(
|
|
2528
2538
|
"text-base font-medium text-black"
|
|
2529
2539
|
),
|
|
2530
|
-
children:
|
|
2540
|
+
children: p
|
|
2531
2541
|
}
|
|
2532
2542
|
),
|
|
2533
|
-
|
|
2543
|
+
i && /* @__PURE__ */ e("span", { className: "text-sm font-normal text-slate-500", children: i })
|
|
2534
2544
|
] })
|
|
2535
2545
|
]
|
|
2536
2546
|
}
|
|
@@ -2542,14 +2552,15 @@ function or({
|
|
|
2542
2552
|
size: a = 150,
|
|
2543
2553
|
iconClassName: r,
|
|
2544
2554
|
isLoading: l = !1,
|
|
2545
|
-
isFullPage:
|
|
2555
|
+
isFullPage: p = !0,
|
|
2556
|
+
variant: i = "yellow"
|
|
2546
2557
|
}) {
|
|
2547
2558
|
return l ? /* @__PURE__ */ e(
|
|
2548
2559
|
"div",
|
|
2549
2560
|
{
|
|
2550
2561
|
className: n(
|
|
2551
2562
|
"z-[99px] flex flex-col items-center justify-center transition-all duration-300",
|
|
2552
|
-
|
|
2563
|
+
p ? "fixed inset-0 backdrop-blur-[2px]" : "absolute inset-0 w-full h-full rounded-[inherit]",
|
|
2553
2564
|
t
|
|
2554
2565
|
),
|
|
2555
2566
|
children: /* @__PURE__ */ e(
|
|
@@ -2559,7 +2570,7 @@ function or({
|
|
|
2559
2570
|
height: a,
|
|
2560
2571
|
className: n(
|
|
2561
2572
|
"animate-spin",
|
|
2562
|
-
!r && "text-yellow-500",
|
|
2573
|
+
!r && (i === "blue" ? "text-blue-600" : "text-yellow-500"),
|
|
2563
2574
|
r
|
|
2564
2575
|
),
|
|
2565
2576
|
style: { fill: "currentColor", stroke: "currentColor" }
|
|
@@ -2574,17 +2585,17 @@ const Pt = fe(
|
|
|
2574
2585
|
placeholder: a = "+998 (__) ___ __ __",
|
|
2575
2586
|
size: r = "base",
|
|
2576
2587
|
error: l,
|
|
2577
|
-
disabled:
|
|
2578
|
-
required:
|
|
2588
|
+
disabled: p = !1,
|
|
2589
|
+
required: i = !1,
|
|
2579
2590
|
value: s = "",
|
|
2580
|
-
onChange:
|
|
2591
|
+
onChange: d,
|
|
2581
2592
|
onFocus: C,
|
|
2582
2593
|
onBlur: k,
|
|
2583
|
-
className:
|
|
2584
|
-
name:
|
|
2585
|
-
showIcon:
|
|
2586
|
-
},
|
|
2587
|
-
const [v,
|
|
2594
|
+
className: M,
|
|
2595
|
+
name: D,
|
|
2596
|
+
showIcon: A = !1
|
|
2597
|
+
}, E) => {
|
|
2598
|
+
const [v, u] = _(!1), m = R((j) => {
|
|
2588
2599
|
let o = j.replace(/\D/g, "");
|
|
2589
2600
|
o.startsWith("998") || (o = "998" + o), o = o.substring(0, 12);
|
|
2590
2601
|
let N = "+998";
|
|
@@ -2592,19 +2603,19 @@ const Pt = fe(
|
|
|
2592
2603
|
}, []), b = (j) => {
|
|
2593
2604
|
const o = j.target.value;
|
|
2594
2605
|
if (o.length < 5) {
|
|
2595
|
-
|
|
2606
|
+
d?.("+998");
|
|
2596
2607
|
return;
|
|
2597
2608
|
}
|
|
2598
|
-
const N =
|
|
2599
|
-
|
|
2609
|
+
const N = m(o);
|
|
2610
|
+
d?.(N);
|
|
2600
2611
|
}, w = () => {
|
|
2601
|
-
|
|
2602
|
-
},
|
|
2603
|
-
|
|
2612
|
+
u(!0), (!s || s === "") && d?.("+998"), C?.();
|
|
2613
|
+
}, h = () => {
|
|
2614
|
+
u(!1), k?.();
|
|
2604
2615
|
}, y = Z(() => ({
|
|
2605
2616
|
sm: {
|
|
2606
2617
|
input: "h-9 text-sm",
|
|
2607
|
-
padding:
|
|
2618
|
+
padding: A ? "pl-8 pr-2" : "px-2",
|
|
2608
2619
|
iconSize: "w-4 h-4",
|
|
2609
2620
|
iconLeft: "left-2",
|
|
2610
2621
|
labelFont: "text-sm",
|
|
@@ -2612,7 +2623,7 @@ const Pt = fe(
|
|
|
2612
2623
|
},
|
|
2613
2624
|
md: {
|
|
2614
2625
|
input: "h-10 text-sm",
|
|
2615
|
-
padding:
|
|
2626
|
+
padding: A ? "pl-10 pr-4" : "px-4",
|
|
2616
2627
|
iconSize: "w-4 h-4",
|
|
2617
2628
|
iconLeft: "left-3",
|
|
2618
2629
|
labelFont: "text-base",
|
|
@@ -2620,39 +2631,39 @@ const Pt = fe(
|
|
|
2620
2631
|
},
|
|
2621
2632
|
base: {
|
|
2622
2633
|
input: "h-12 text-base",
|
|
2623
|
-
padding:
|
|
2634
|
+
padding: A ? "pl-11 pr-4" : "px-4",
|
|
2624
2635
|
iconSize: "w-5 h-5",
|
|
2625
2636
|
iconLeft: "left-3",
|
|
2626
2637
|
labelFont: "text-base",
|
|
2627
2638
|
iconWrapper: "h-5"
|
|
2628
2639
|
}
|
|
2629
|
-
}), [
|
|
2630
|
-
return /* @__PURE__ */
|
|
2631
|
-
t && /* @__PURE__ */
|
|
2640
|
+
}), [A]), $ = Z(() => 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]), L = Z(() => p ? "text-slate-400" : l ? "text-red-600" : v ? "text-black" : "text-slate-400", [l, v, p]);
|
|
2641
|
+
return /* @__PURE__ */ c("div", { className: n("w-full", M), children: [
|
|
2642
|
+
t && /* @__PURE__ */ c("label", { className: n(
|
|
2632
2643
|
"mb-2 block font-medium transition-colors duration-200",
|
|
2633
2644
|
l ? "text-red-600" : v ? "text-blue-600" : "text-slate-700",
|
|
2634
2645
|
y[r].labelFont
|
|
2635
2646
|
), children: [
|
|
2636
2647
|
t,
|
|
2637
|
-
|
|
2648
|
+
i && /* @__PURE__ */ e("span", { className: "text-red-600 ml-1", children: "*" })
|
|
2638
2649
|
] }),
|
|
2639
|
-
/* @__PURE__ */
|
|
2640
|
-
|
|
2650
|
+
/* @__PURE__ */ c("div", { className: "relative flex items-center", children: [
|
|
2651
|
+
A && /* @__PURE__ */ e("div", { className: n(
|
|
2641
2652
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center transition-all duration-300",
|
|
2642
2653
|
y[r].iconLeft,
|
|
2643
|
-
|
|
2654
|
+
L
|
|
2644
2655
|
), children: /* @__PURE__ */ e("div", { className: n("flex items-center justify-center", y[r].iconWrapper), children: /* @__PURE__ */ e(bt, { className: n(y[r].iconSize), weight: "Linear" }) }) }),
|
|
2645
2656
|
/* @__PURE__ */ e(
|
|
2646
2657
|
"input",
|
|
2647
2658
|
{
|
|
2648
|
-
ref:
|
|
2649
|
-
name:
|
|
2659
|
+
ref: E,
|
|
2660
|
+
name: D,
|
|
2650
2661
|
type: "tel",
|
|
2651
2662
|
value: s,
|
|
2652
2663
|
onChange: b,
|
|
2653
2664
|
onFocus: w,
|
|
2654
|
-
onBlur:
|
|
2655
|
-
disabled:
|
|
2665
|
+
onBlur: h,
|
|
2666
|
+
disabled: p,
|
|
2656
2667
|
placeholder: a,
|
|
2657
2668
|
className: n(
|
|
2658
2669
|
"w-full border bg-white font-normal transition-all duration-300 outline-none",
|
|
@@ -2671,23 +2682,23 @@ const Pt = fe(
|
|
|
2671
2682
|
);
|
|
2672
2683
|
Pt.displayName = "MciPhone";
|
|
2673
2684
|
const Wt = fe(
|
|
2674
|
-
({ mode: t, onChange: a, value: r, ...l },
|
|
2675
|
-
const [
|
|
2676
|
-
const
|
|
2677
|
-
let
|
|
2678
|
-
for (let b = 0; b <
|
|
2679
|
-
const w =
|
|
2680
|
-
if (
|
|
2685
|
+
({ mode: t, onChange: a, value: r, ...l }, p) => {
|
|
2686
|
+
const [i, s] = _(""), d = r !== void 0 ? r : i, C = (v) => {
|
|
2687
|
+
const u = v.replace(/\s/g, "").toUpperCase();
|
|
2688
|
+
let m = "";
|
|
2689
|
+
for (let b = 0; b < u.length; b++) {
|
|
2690
|
+
const w = u[b];
|
|
2691
|
+
if (m.length < 2 ? /[A-Z]/.test(w) && (m += w) : /[0-9]/.test(w) && (m += w), m.length >= 9) break;
|
|
2681
2692
|
}
|
|
2682
|
-
return
|
|
2683
|
-
}, k = (v) => v.replace(/\D/g, "").slice(0, 14),
|
|
2693
|
+
return m.length > 2 ? m.slice(0, 2) + " " + m.slice(2) : m;
|
|
2694
|
+
}, k = (v) => v.replace(/\D/g, "").slice(0, 14), M = (v) => v.toUpperCase().replace(/[^A-Z0-9\-\s]/g, "").replace(/\s+/g, " ").slice(0, 15), D = R(
|
|
2684
2695
|
(v) => {
|
|
2685
|
-
const
|
|
2686
|
-
let
|
|
2687
|
-
t === "passport" ?
|
|
2696
|
+
const u = v.target.value;
|
|
2697
|
+
let m = "";
|
|
2698
|
+
t === "passport" ? m = C(u) : t === "pinfl" ? m = k(u) : t === "metirka" && (m = M(u)), r === void 0 && s(m), v.target.value = m, a?.(m, v);
|
|
2688
2699
|
},
|
|
2689
2700
|
[t, a, r]
|
|
2690
|
-
),
|
|
2701
|
+
), A = () => {
|
|
2691
2702
|
if (l.placeholder) return l.placeholder;
|
|
2692
2703
|
switch (t) {
|
|
2693
2704
|
case "passport":
|
|
@@ -2703,10 +2714,10 @@ const Wt = fe(
|
|
|
2703
2714
|
return /* @__PURE__ */ e(
|
|
2704
2715
|
Le,
|
|
2705
2716
|
{
|
|
2706
|
-
ref:
|
|
2717
|
+
ref: p,
|
|
2707
2718
|
...l,
|
|
2708
|
-
value:
|
|
2709
|
-
onChange:
|
|
2719
|
+
value: d,
|
|
2720
|
+
onChange: D,
|
|
2710
2721
|
maxLength: (() => {
|
|
2711
2722
|
if (l.maxLength) return l.maxLength;
|
|
2712
2723
|
switch (t) {
|
|
@@ -2720,7 +2731,7 @@ const Wt = fe(
|
|
|
2720
2731
|
return 255;
|
|
2721
2732
|
}
|
|
2722
2733
|
})(),
|
|
2723
|
-
placeholder:
|
|
2734
|
+
placeholder: A()
|
|
2724
2735
|
}
|
|
2725
2736
|
);
|
|
2726
2737
|
}
|
|
@@ -2731,22 +2742,22 @@ function ir({
|
|
|
2731
2742
|
onClose: a,
|
|
2732
2743
|
columns: r,
|
|
2733
2744
|
hidden: l,
|
|
2734
|
-
onToggle:
|
|
2735
|
-
onMove:
|
|
2745
|
+
onToggle: p,
|
|
2746
|
+
onMove: i,
|
|
2736
2747
|
minVisible: s = 5
|
|
2737
2748
|
}) {
|
|
2738
|
-
const
|
|
2749
|
+
const d = le(null), { handleClick: C } = De(d, a);
|
|
2739
2750
|
J(() => {
|
|
2740
2751
|
if (t)
|
|
2741
2752
|
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
2742
2753
|
}, [t, C]);
|
|
2743
|
-
const k = Z(() => new Set(l), [l]),
|
|
2754
|
+
const k = Z(() => new Set(l), [l]), M = Z(() => {
|
|
2744
2755
|
let o = 0;
|
|
2745
2756
|
for (const N of r) k.has(N.key) || o++;
|
|
2746
2757
|
return o;
|
|
2747
|
-
}, [r, k]),
|
|
2748
|
-
|
|
2749
|
-
w.current = null,
|
|
2758
|
+
}, [r, k]), D = le(null), A = le(null), E = le(!1), [v, u] = _(null), [m, b] = _(null), w = le(null), h = R((o) => {
|
|
2759
|
+
A.current = o, w.current == null && (w.current = requestAnimationFrame(() => {
|
|
2760
|
+
w.current = null, u(A.current);
|
|
2750
2761
|
}));
|
|
2751
2762
|
}, []);
|
|
2752
2763
|
J(() => () => {
|
|
@@ -2754,35 +2765,35 @@ function ir({
|
|
|
2754
2765
|
}, []);
|
|
2755
2766
|
const y = R(
|
|
2756
2767
|
(o) => {
|
|
2757
|
-
|
|
2768
|
+
E.current = !0, D.current = o, b(r[o]?.key ?? null);
|
|
2758
2769
|
},
|
|
2759
2770
|
[r]
|
|
2760
2771
|
), $ = R(() => {
|
|
2761
|
-
|
|
2772
|
+
E.current = !1;
|
|
2762
2773
|
}, []);
|
|
2763
2774
|
J(() => {
|
|
2764
2775
|
if (t)
|
|
2765
2776
|
return document.addEventListener("mouseup", $), () => document.removeEventListener("mouseup", $);
|
|
2766
2777
|
}, [t, $]);
|
|
2767
|
-
const
|
|
2768
|
-
|
|
2769
|
-
}, [
|
|
2778
|
+
const L = R(() => {
|
|
2779
|
+
D.current = null, E.current = !1, b(null), h(null);
|
|
2780
|
+
}, [h]), j = R(
|
|
2770
2781
|
(o, N) => {
|
|
2771
|
-
N ||
|
|
2782
|
+
N || p(o);
|
|
2772
2783
|
},
|
|
2773
|
-
[
|
|
2784
|
+
[p]
|
|
2774
2785
|
);
|
|
2775
|
-
return t ? /* @__PURE__ */
|
|
2786
|
+
return t ? /* @__PURE__ */ c(
|
|
2776
2787
|
"div",
|
|
2777
2788
|
{
|
|
2778
|
-
ref:
|
|
2789
|
+
ref: d,
|
|
2779
2790
|
className: n(
|
|
2780
2791
|
"absolute right-0 top-full z-50 mt-2 w-[320px]",
|
|
2781
2792
|
"rounded-2xl p-4 bg-white",
|
|
2782
2793
|
"border border-slate-200"
|
|
2783
2794
|
),
|
|
2784
2795
|
children: [
|
|
2785
|
-
/* @__PURE__ */
|
|
2796
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-4", children: [
|
|
2786
2797
|
/* @__PURE__ */ e("h4", { className: "text-slate-600 text-large font-normal", children: "Settings" }),
|
|
2787
2798
|
/* @__PURE__ */ e(
|
|
2788
2799
|
"button",
|
|
@@ -2808,33 +2819,33 @@ function ir({
|
|
|
2808
2819
|
"hover:[&::-webkit-scrollbar-thumb]:bg-slate-300"
|
|
2809
2820
|
),
|
|
2810
2821
|
children: r.map((o, N) => {
|
|
2811
|
-
const T = !k.has(o.key), Y = T &&
|
|
2812
|
-
return /* @__PURE__ */
|
|
2813
|
-
/* @__PURE__ */
|
|
2822
|
+
const T = !k.has(o.key), Y = T && M <= s, q = v === N, B = m === o.key;
|
|
2823
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
2824
|
+
/* @__PURE__ */ c(
|
|
2814
2825
|
"div",
|
|
2815
2826
|
{
|
|
2816
2827
|
draggable: !0,
|
|
2817
2828
|
onDragStart: (P) => {
|
|
2818
|
-
if (!
|
|
2829
|
+
if (!E.current) {
|
|
2819
2830
|
P.preventDefault();
|
|
2820
2831
|
return;
|
|
2821
2832
|
}
|
|
2822
|
-
P.dataTransfer.setData("text/plain", String(N)), P.dataTransfer.effectAllowed = "move", b(o.key),
|
|
2833
|
+
P.dataTransfer.setData("text/plain", String(N)), P.dataTransfer.effectAllowed = "move", b(o.key), h(null);
|
|
2823
2834
|
const W = new Image();
|
|
2824
2835
|
W.src = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", P.dataTransfer.setDragImage(W, 0, 0);
|
|
2825
2836
|
},
|
|
2826
2837
|
onDragOver: (P) => {
|
|
2827
|
-
|
|
2838
|
+
D.current != null && (P.preventDefault(), P.dataTransfer.dropEffect = "move", h(N));
|
|
2828
2839
|
},
|
|
2829
2840
|
onDragLeave: () => {
|
|
2830
|
-
|
|
2841
|
+
A.current === N && h(null);
|
|
2831
2842
|
},
|
|
2832
2843
|
onDrop: (P) => {
|
|
2833
2844
|
P.preventDefault();
|
|
2834
|
-
const W =
|
|
2835
|
-
Number.isFinite(W) && W !== N &&
|
|
2845
|
+
const W = D.current ?? Number(P.dataTransfer.getData("text/plain"));
|
|
2846
|
+
Number.isFinite(W) && W !== N && i(W, N), L();
|
|
2836
2847
|
},
|
|
2837
|
-
onDragEnd:
|
|
2848
|
+
onDragEnd: L,
|
|
2838
2849
|
className: n(
|
|
2839
2850
|
"group flex items-center py-2 px-1 gap-4",
|
|
2840
2851
|
"rounded-md box-border overflow-visible",
|
|
@@ -2868,9 +2879,9 @@ function ir({
|
|
|
2868
2879
|
variant: "blue"
|
|
2869
2880
|
}
|
|
2870
2881
|
) }),
|
|
2871
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
|
|
2872
2883
|
/* @__PURE__ */ e("h4", { className: "truncate text-slate-700 text-base font-medium", title: o.title, children: o.title }),
|
|
2873
|
-
Y && /* @__PURE__ */
|
|
2884
|
+
Y && /* @__PURE__ */ c("p", { className: "text-xs text-slate-400 mt-0.5", children: [
|
|
2874
2885
|
"Минимум ",
|
|
2875
2886
|
s,
|
|
2876
2887
|
" колонок"
|
|
@@ -2905,66 +2916,66 @@ const Pe = (t) => Array.isArray(t) && t.every((a) => typeof a == "string"), Ot =
|
|
|
2905
2916
|
return r;
|
|
2906
2917
|
};
|
|
2907
2918
|
function cr(t) {
|
|
2908
|
-
const { storageKey: a, columns: r, defaultVisibleKeys: l, defaultOrder:
|
|
2919
|
+
const { storageKey: a, columns: r, defaultVisibleKeys: l, defaultOrder: p } = t, i = Z(() => r.map((u) => String(u.key)), [r]), s = Z(() => new Set(i), [i]), [d, C] = _(() => {
|
|
2909
2920
|
if (typeof window > "u") {
|
|
2910
|
-
const
|
|
2911
|
-
return { order: ie(
|
|
2921
|
+
const L = p?.map(String) ?? i, j = l && l.length ? i.filter((o) => !new Set(l.map(String)).has(o)) : [];
|
|
2922
|
+
return { order: ie(L), hidden: ie(j) };
|
|
2912
2923
|
}
|
|
2913
|
-
const
|
|
2924
|
+
const u = Ot(window.localStorage.getItem(a)), m = p?.map(String) ?? i, b = ie(m), w = ie((u?.order ?? []).filter((L) => s.has(L))), h = ie([
|
|
2914
2925
|
...w,
|
|
2915
|
-
...b.filter((
|
|
2916
|
-
...
|
|
2917
|
-
]), y = ie((
|
|
2918
|
-
return { order:
|
|
2926
|
+
...b.filter((L) => !w.includes(L)),
|
|
2927
|
+
...i.filter((L) => !w.includes(L) && !b.includes(L))
|
|
2928
|
+
]), y = ie((u?.hidden ?? []).filter((L) => s.has(L))), $ = y.length === 0 && l && l.length ? i.filter((L) => !new Set(l.map(String)).has(L)) : y;
|
|
2929
|
+
return { order: h, hidden: ie($) };
|
|
2919
2930
|
});
|
|
2920
2931
|
J(() => {
|
|
2921
2932
|
if (!(typeof window > "u"))
|
|
2922
2933
|
try {
|
|
2923
|
-
window.localStorage.setItem(a, JSON.stringify(
|
|
2934
|
+
window.localStorage.setItem(a, JSON.stringify(d));
|
|
2924
2935
|
} catch {
|
|
2925
2936
|
}
|
|
2926
|
-
}, [a,
|
|
2927
|
-
C((
|
|
2928
|
-
const
|
|
2929
|
-
...
|
|
2930
|
-
...
|
|
2931
|
-
]), b = ie(
|
|
2932
|
-
return w &&
|
|
2937
|
+
}, [a, d]), J(() => {
|
|
2938
|
+
C((u) => {
|
|
2939
|
+
const m = ie([
|
|
2940
|
+
...u.order.filter((y) => s.has(y)),
|
|
2941
|
+
...i.filter((y) => !u.order.includes(y))
|
|
2942
|
+
]), b = ie(u.hidden.filter((y) => s.has(y))), w = m.length === u.order.length && m.every((y, $) => y === u.order[$]), h = b.length === u.hidden.length && b.every((y, $) => y === u.hidden[$]);
|
|
2943
|
+
return w && h ? u : { order: m, hidden: b };
|
|
2933
2944
|
});
|
|
2934
|
-
}, [
|
|
2935
|
-
const k = Z(() => new Set(
|
|
2936
|
-
const
|
|
2937
|
-
return
|
|
2938
|
-
const
|
|
2939
|
-
return
|
|
2945
|
+
}, [i, s]);
|
|
2946
|
+
const k = Z(() => new Set(d.hidden), [d.hidden]), M = Z(() => {
|
|
2947
|
+
const u = /* @__PURE__ */ new Map();
|
|
2948
|
+
return d.order.forEach((b, w) => u.set(b, w)), [...r.filter((b) => !k.has(String(b.key)))].sort((b, w) => {
|
|
2949
|
+
const h = u.get(String(b.key)) ?? Number.MAX_SAFE_INTEGER, y = u.get(String(w.key)) ?? Number.MAX_SAFE_INTEGER;
|
|
2950
|
+
return h - y;
|
|
2940
2951
|
});
|
|
2941
|
-
}, [r, k,
|
|
2942
|
-
() =>
|
|
2943
|
-
[
|
|
2944
|
-
),
|
|
2945
|
-
const
|
|
2952
|
+
}, [r, k, d.order]), D = Z(
|
|
2953
|
+
() => d.hidden.filter((u) => s.has(u)),
|
|
2954
|
+
[d.hidden, s]
|
|
2955
|
+
), A = R((u) => {
|
|
2956
|
+
const m = String(u);
|
|
2946
2957
|
C((b) => {
|
|
2947
|
-
const
|
|
2948
|
-
return { ...b, hidden: ie(
|
|
2958
|
+
const h = b.hidden.includes(m) ? b.hidden.filter((y) => y !== m) : [...b.hidden, m];
|
|
2959
|
+
return { ...b, hidden: ie(h) };
|
|
2949
2960
|
});
|
|
2950
|
-
}, []),
|
|
2961
|
+
}, []), E = R((u, m) => {
|
|
2951
2962
|
C((b) => {
|
|
2952
2963
|
const w = b.order.slice();
|
|
2953
|
-
if (
|
|
2954
|
-
const [
|
|
2955
|
-
return w.splice(
|
|
2964
|
+
if (u < 0 || m < 0 || u >= w.length || m >= w.length) return b;
|
|
2965
|
+
const [h] = w.splice(u, 1);
|
|
2966
|
+
return w.splice(m, 0, h), { ...b, order: w };
|
|
2956
2967
|
});
|
|
2957
2968
|
}, []), v = R(() => {
|
|
2958
2969
|
C(() => {
|
|
2959
|
-
const
|
|
2960
|
-
return { order:
|
|
2970
|
+
const u = ie(p?.map(String) ?? i), m = l && l.length ? ie(i.filter((b) => !new Set(l.map(String)).has(b))) : [];
|
|
2971
|
+
return { order: u, hidden: m };
|
|
2961
2972
|
});
|
|
2962
|
-
}, [
|
|
2973
|
+
}, [p, l, i]);
|
|
2963
2974
|
return {
|
|
2964
|
-
orderedColumns:
|
|
2965
|
-
hiddenKeys:
|
|
2966
|
-
toggleColumn:
|
|
2967
|
-
moveColumn:
|
|
2975
|
+
orderedColumns: M,
|
|
2976
|
+
hiddenKeys: D,
|
|
2977
|
+
toggleColumn: A,
|
|
2978
|
+
moveColumn: E,
|
|
2968
2979
|
reset: v
|
|
2969
2980
|
};
|
|
2970
2981
|
}
|