@mci-ui/mci-ui 0.0.82 → 0.0.83
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,53 +1,53 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { AltArrowRight as
|
|
1
|
+
import { jsx as r, jsxs as d, Fragment as he } from "react/jsx-runtime";
|
|
2
|
+
import { AltArrowRight as Ne, Star2 as Qe, AltArrowDown as Re, EyeClosed as ut, Eye as et, Calendar as ft, AltArrowLeft as Me, DoubleAltArrowLeft as mt, DoubleAltArrowRight as ht, ConfoundedSquare as pt, SortVertical as bt, SortFromTopToBottom as gt, SortFromBottomToTop as xt, FileText as Le, File as tt, MusicNote as wt, VideoFramePlayHorizontal as yt, Gallery as vt, Upload as Nt, MenuDots as kt, Refresh as Ct, InfoCircle as St, DangerCircle as Et, CloseCircle as Dt, CheckCircle as At, Phone as Mt, TransferVertical as Tt } from "@solar-icons/react";
|
|
3
3
|
import { clsx as It } from "clsx";
|
|
4
4
|
import { twMerge as Ft } from "tailwind-merge";
|
|
5
|
-
import * as
|
|
6
|
-
import { memo as Lt, useState as
|
|
5
|
+
import * as ee from "react";
|
|
6
|
+
import { memo as Lt, useState as W, useMemo as P, useCallback as R, useRef as ae, useEffect as J, forwardRef as be } from "react";
|
|
7
7
|
import { createRoot as jt } from "react-dom/client";
|
|
8
8
|
function s(...e) {
|
|
9
9
|
return Ft(It(e));
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return { handleEscape: (
|
|
13
|
-
|
|
11
|
+
function _e(e) {
|
|
12
|
+
return { handleEscape: (n) => {
|
|
13
|
+
n.key === "Escape" && e();
|
|
14
14
|
} };
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function Fe(e, t) {
|
|
17
17
|
return { handleClick: (l) => {
|
|
18
18
|
e.current && !e.current.contains(l.target) && t();
|
|
19
19
|
} };
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function on({
|
|
22
22
|
items: e,
|
|
23
23
|
variant: t = "blue",
|
|
24
|
-
className:
|
|
24
|
+
className: n
|
|
25
25
|
}) {
|
|
26
|
-
const l = t === "blue", o = l ? "hover:text-blue-600" : "hover:text-yellow-500",
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
const
|
|
26
|
+
const l = t === "blue", o = l ? "hover:text-blue-600" : "hover:text-yellow-500", a = l ? "text-blue-600" : "text-yellow-500";
|
|
27
|
+
return /* @__PURE__ */ r("nav", { className: s("flex items-center", n), "aria-label": "Breadcrumb", children: e.map((i, c) => {
|
|
28
|
+
const g = c === e.length - 1;
|
|
29
29
|
return /* @__PURE__ */ d("div", { className: "flex items-center", children: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */
|
|
30
|
+
g ? /* @__PURE__ */ d("span", { className: s("flex items-center gap-x-2 font-medium", a), children: [
|
|
31
|
+
i.icon,
|
|
32
|
+
/* @__PURE__ */ r("span", { children: i.label })
|
|
33
33
|
] }) : /* @__PURE__ */ d(
|
|
34
34
|
"a",
|
|
35
35
|
{
|
|
36
|
-
href:
|
|
37
|
-
onClick: (
|
|
38
|
-
|
|
36
|
+
href: i.href ?? "#",
|
|
37
|
+
onClick: (x) => {
|
|
38
|
+
i.onClick && (x.preventDefault(), i.onClick());
|
|
39
39
|
},
|
|
40
40
|
className: s(
|
|
41
41
|
"flex items-center gap-x-2 transition-all text-sm font-normal text-slate-500",
|
|
42
42
|
o
|
|
43
43
|
),
|
|
44
44
|
children: [
|
|
45
|
-
|
|
46
|
-
/* @__PURE__ */
|
|
45
|
+
i.icon,
|
|
46
|
+
/* @__PURE__ */ r("span", { children: i.label })
|
|
47
47
|
]
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
|
-
!
|
|
50
|
+
!g && /* @__PURE__ */ r("span", { className: "mx-2 flex items-center", children: /* @__PURE__ */ r(Ne, { weight: "Linear", size: 20, className: "text-slate-500" }) })
|
|
51
51
|
] }, c);
|
|
52
52
|
}) });
|
|
53
53
|
}
|
|
@@ -55,7 +55,7 @@ const Ot = {
|
|
|
55
55
|
sm: "h-9 px-2 text-sm gap-1.5 rounded-lg leading-9 min-w-9",
|
|
56
56
|
md: "h-10 px-2 text-base gap-2 rounded-lg leading-10 min-w-10",
|
|
57
57
|
base: "h-12 px-4 text-base gap-2 rounded-xl leading-12 min-w-12"
|
|
58
|
-
},
|
|
58
|
+
}, $t = {
|
|
59
59
|
blue: {
|
|
60
60
|
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)]",
|
|
61
61
|
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)]",
|
|
@@ -66,49 +66,49 @@ const Ot = {
|
|
|
66
66
|
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",
|
|
67
67
|
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"
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, Rt = {
|
|
70
70
|
danger: "bg-red-600 text-white hover:bg-red-700 active:bg-red-800 focus:ring-2 focus:shadow-red",
|
|
71
71
|
tertiary: "bg-slate-100 text-black hover:bg-slate-200 active:bg-slate-300 focus:ring-2 focus:shadow-slate"
|
|
72
72
|
};
|
|
73
|
-
function
|
|
73
|
+
function cn({
|
|
74
74
|
children: e,
|
|
75
75
|
text: t,
|
|
76
|
-
icon:
|
|
76
|
+
icon: n,
|
|
77
77
|
iconPosition: l = "left",
|
|
78
78
|
size: o = "base",
|
|
79
|
-
variant:
|
|
80
|
-
color:
|
|
79
|
+
variant: a = "primary",
|
|
80
|
+
color: i = "yellow",
|
|
81
81
|
loading: c = !1,
|
|
82
|
-
disabled:
|
|
83
|
-
onClick:
|
|
84
|
-
className:
|
|
82
|
+
disabled: g = !1,
|
|
83
|
+
onClick: x,
|
|
84
|
+
className: y,
|
|
85
85
|
type: S = "button"
|
|
86
86
|
}) {
|
|
87
|
-
const
|
|
87
|
+
const I = e ?? t, T = a === "primary" || a === "secondary" || a === "outline" ? $t[i][a] : Rt[a], E = g || c, h = E ? a === "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" : "";
|
|
88
88
|
return /* @__PURE__ */ d(
|
|
89
89
|
"button",
|
|
90
90
|
{
|
|
91
91
|
type: S,
|
|
92
|
-
onClick:
|
|
92
|
+
onClick: x,
|
|
93
93
|
disabled: E,
|
|
94
94
|
className: s(
|
|
95
95
|
"inline-flex w-fit shrink-0 items-center justify-center whitespace-nowrap text-center font-medium transition-all duration-200 cursor-pointer",
|
|
96
96
|
Ot[o],
|
|
97
|
-
|
|
98
|
-
!E &&
|
|
97
|
+
T,
|
|
98
|
+
!E && T,
|
|
99
99
|
h,
|
|
100
|
-
|
|
100
|
+
y
|
|
101
101
|
),
|
|
102
102
|
children: [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
c && /* @__PURE__ */
|
|
103
|
+
n && l === "left" && !c && /* @__PURE__ */ r("span", { className: "flex items-center", children: n }),
|
|
104
|
+
I && /* @__PURE__ */ r("span", { className: "whitespace-nowrap", children: I }),
|
|
105
|
+
n && l === "right" && !c && /* @__PURE__ */ r("span", { className: "flex items-center", children: n }),
|
|
106
|
+
c && /* @__PURE__ */ r(Qe, { weight: "Linear", size: 20, className: "animate-spin" })
|
|
107
107
|
]
|
|
108
108
|
}
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const _t = (e) => /* @__PURE__ */ ee.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 11, height: 8, viewBox: "0 0 11 8", fill: "none", ...e }, /* @__PURE__ */ ee.createElement("path", { d: "M0.625 3.76944L3.76944 6.91389L10.0694 0.625", stroke: "currentColor", strokeWidth: 1.25, strokeLinecap: "round", strokeLinejoin: "round" })), Bt = {
|
|
112
112
|
blue: {
|
|
113
113
|
border: "border-blue-600",
|
|
114
114
|
bg: "bg-blue-600",
|
|
@@ -121,55 +121,55 @@ const Rt = (e) => /* @__PURE__ */ J.createElement("svg", { xmlns: "http://www.w3
|
|
|
121
121
|
hover: "hover:border-yellow-500 hover:bg-yello-100",
|
|
122
122
|
focus: "focus:ring-2 focus:ring-yellow-300"
|
|
123
123
|
}
|
|
124
|
-
},
|
|
124
|
+
}, Ie = Lt(function({
|
|
125
125
|
type: t = "checkbox",
|
|
126
|
-
label:
|
|
126
|
+
label: n,
|
|
127
127
|
supportText: l,
|
|
128
128
|
checked: o,
|
|
129
|
-
onChange:
|
|
130
|
-
error:
|
|
129
|
+
onChange: a,
|
|
130
|
+
error: i,
|
|
131
131
|
disabled: c = !1,
|
|
132
|
-
required:
|
|
133
|
-
className:
|
|
134
|
-
variant:
|
|
132
|
+
required: g = !1,
|
|
133
|
+
className: x,
|
|
134
|
+
variant: y = "yellow",
|
|
135
135
|
name: S,
|
|
136
|
-
value:
|
|
136
|
+
value: I
|
|
137
137
|
}) {
|
|
138
|
-
const [
|
|
139
|
-
() => o ??
|
|
140
|
-
[o,
|
|
141
|
-
),
|
|
138
|
+
const [T, E] = W(!1), h = t === "radio", w = P(
|
|
139
|
+
() => o ?? T,
|
|
140
|
+
[o, T]
|
|
141
|
+
), M = R(
|
|
142
142
|
(f) => {
|
|
143
|
-
c || (o === void 0 && E(f.target.checked),
|
|
143
|
+
c || (o === void 0 && E(f.target.checked), a?.(f));
|
|
144
144
|
},
|
|
145
|
-
[o,
|
|
146
|
-
),
|
|
145
|
+
[o, a, c]
|
|
146
|
+
), O = P(() => {
|
|
147
147
|
if (c) {
|
|
148
|
-
const
|
|
148
|
+
const v = "border-slate-200 bg-slate-100";
|
|
149
149
|
return h ? {
|
|
150
|
-
container:
|
|
151
|
-
dot:
|
|
150
|
+
container: v,
|
|
151
|
+
dot: w ? "bg-slate-300" : "bg-transparent",
|
|
152
152
|
check: "text-slate-400"
|
|
153
153
|
} : {
|
|
154
|
-
container:
|
|
154
|
+
container: v,
|
|
155
155
|
dot: "",
|
|
156
|
-
check:
|
|
156
|
+
check: w ? "text-slate-400" : "text-transparent"
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
const f =
|
|
159
|
+
const f = Bt[y];
|
|
160
160
|
if (h) {
|
|
161
|
-
const
|
|
161
|
+
const v = s(
|
|
162
162
|
"border transition-all duration-200",
|
|
163
|
-
|
|
164
|
-
!
|
|
163
|
+
w ? f.border : "border-slate-400",
|
|
164
|
+
!w && f.hover,
|
|
165
165
|
f.focus,
|
|
166
|
-
|
|
166
|
+
w && ""
|
|
167
167
|
), D = s(
|
|
168
168
|
"transition-all duration-200 rounded-full",
|
|
169
|
-
|
|
169
|
+
w ? f.bg : "bg-transparent"
|
|
170
170
|
);
|
|
171
171
|
return {
|
|
172
|
-
container:
|
|
172
|
+
container: v,
|
|
173
173
|
dot: D,
|
|
174
174
|
check: ""
|
|
175
175
|
};
|
|
@@ -177,29 +177,29 @@ const Rt = (e) => /* @__PURE__ */ J.createElement("svg", { xmlns: "http://www.w3
|
|
|
177
177
|
return {
|
|
178
178
|
container: s(
|
|
179
179
|
"border transition-all duration-200",
|
|
180
|
-
|
|
181
|
-
!
|
|
180
|
+
w ? s(f.bg, f.border) : "border-slate-400",
|
|
181
|
+
!w && f.hover,
|
|
182
182
|
f.focus
|
|
183
183
|
),
|
|
184
184
|
dot: "",
|
|
185
|
-
check:
|
|
185
|
+
check: w ? "text-white" : "text-transparent"
|
|
186
186
|
};
|
|
187
|
-
}, [h,
|
|
188
|
-
|
|
187
|
+
}, [h, w, c, y]), k = P(() => !n && !l ? null : /* @__PURE__ */ d("div", { className: "flex flex-col", children: [
|
|
188
|
+
n && /* @__PURE__ */ d(
|
|
189
189
|
"span",
|
|
190
190
|
{
|
|
191
191
|
className: s(
|
|
192
192
|
"text-base font-medium text-slate-700",
|
|
193
|
-
|
|
193
|
+
i && "text-red-600",
|
|
194
194
|
c && "text-slate-400"
|
|
195
195
|
),
|
|
196
196
|
children: [
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
n,
|
|
198
|
+
g && /* @__PURE__ */ r("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
|
|
199
199
|
]
|
|
200
200
|
}
|
|
201
201
|
),
|
|
202
|
-
l && /* @__PURE__ */
|
|
202
|
+
l && /* @__PURE__ */ r(
|
|
203
203
|
"span",
|
|
204
204
|
{
|
|
205
205
|
className: s(
|
|
@@ -209,8 +209,8 @@ const Rt = (e) => /* @__PURE__ */ J.createElement("svg", { xmlns: "http://www.w3
|
|
|
209
209
|
children: l
|
|
210
210
|
}
|
|
211
211
|
)
|
|
212
|
-
] }), [
|
|
213
|
-
return /* @__PURE__ */ d("div", { className: s("flex items-start",
|
|
212
|
+
] }), [n, l, i, c, g]);
|
|
213
|
+
return /* @__PURE__ */ d("div", { className: s("flex items-start", x), children: [
|
|
214
214
|
/* @__PURE__ */ d(
|
|
215
215
|
"label",
|
|
216
216
|
{
|
|
@@ -219,214 +219,214 @@ const Rt = (e) => /* @__PURE__ */ J.createElement("svg", { xmlns: "http://www.w3
|
|
|
219
219
|
c ? "cursor-not-allowed" : "cursor-pointer"
|
|
220
220
|
),
|
|
221
221
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ r(
|
|
223
223
|
"input",
|
|
224
224
|
{
|
|
225
225
|
type: t,
|
|
226
|
-
checked:
|
|
227
|
-
onChange:
|
|
226
|
+
checked: w,
|
|
227
|
+
onChange: M,
|
|
228
228
|
disabled: c,
|
|
229
|
-
required:
|
|
229
|
+
required: g,
|
|
230
230
|
className: "sr-only",
|
|
231
|
-
"aria-invalid": !!
|
|
232
|
-
"aria-describedby":
|
|
231
|
+
"aria-invalid": !!i,
|
|
232
|
+
"aria-describedby": i ? `${S}-error` : void 0,
|
|
233
233
|
name: S,
|
|
234
|
-
value:
|
|
234
|
+
value: I
|
|
235
235
|
}
|
|
236
236
|
),
|
|
237
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ r(
|
|
238
238
|
"div",
|
|
239
239
|
{
|
|
240
240
|
className: s(
|
|
241
241
|
"relative flex items-center justify-center",
|
|
242
242
|
h ? "w-5 h-5 rounded-full" : "w-5 h-5 rounded",
|
|
243
|
-
|
|
243
|
+
O.container
|
|
244
244
|
),
|
|
245
|
-
children: h ? /* @__PURE__ */
|
|
245
|
+
children: h ? /* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ r(
|
|
246
246
|
"span",
|
|
247
247
|
{
|
|
248
248
|
className: s(
|
|
249
249
|
"w-3 h-3 rounded-full transition-all duration-200",
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
O.dot,
|
|
251
|
+
w ? "opacity-100 scale-100" : "opacity-0 scale-50"
|
|
252
252
|
)
|
|
253
253
|
}
|
|
254
|
-
) }) : /* @__PURE__ */
|
|
255
|
-
|
|
254
|
+
) }) : /* @__PURE__ */ r(
|
|
255
|
+
_t,
|
|
256
256
|
{
|
|
257
257
|
className: s(
|
|
258
258
|
"w-4 h-4 stroke-[2.5px] transition-opacity duration-200",
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
O.check,
|
|
260
|
+
w ? "opacity-100" : "opacity-0"
|
|
261
261
|
)
|
|
262
262
|
}
|
|
263
263
|
)
|
|
264
264
|
}
|
|
265
265
|
),
|
|
266
|
-
|
|
266
|
+
k
|
|
267
267
|
]
|
|
268
268
|
}
|
|
269
269
|
),
|
|
270
|
-
|
|
270
|
+
i && /* @__PURE__ */ r("p", { id: `${S}-error`, className: "mt-1 text-extra-small text-red-600", children: i })
|
|
271
271
|
] });
|
|
272
272
|
});
|
|
273
|
-
|
|
274
|
-
function
|
|
273
|
+
Ie.displayName = "MciCheck";
|
|
274
|
+
function dn({
|
|
275
275
|
title: e,
|
|
276
276
|
children: t,
|
|
277
|
-
defaultOpen:
|
|
277
|
+
defaultOpen: n = !1,
|
|
278
278
|
icon: l,
|
|
279
279
|
className: o,
|
|
280
|
-
contentClassName:
|
|
280
|
+
contentClassName: a
|
|
281
281
|
}) {
|
|
282
|
-
const [
|
|
283
|
-
return
|
|
284
|
-
|
|
285
|
-
}, [
|
|
282
|
+
const [i, c] = W(n), [g, x] = W(0), y = ae(null);
|
|
283
|
+
return J(() => {
|
|
284
|
+
y.current && x(i ? y.current.scrollHeight : 0);
|
|
285
|
+
}, [i]), /* @__PURE__ */ d("div", { className: s("overflow-hidden rounded-xl border border-slate-200", o), children: [
|
|
286
286
|
/* @__PURE__ */ d(
|
|
287
287
|
"button",
|
|
288
288
|
{
|
|
289
|
-
onClick: () => c(!
|
|
289
|
+
onClick: () => c(!i),
|
|
290
290
|
className: s(
|
|
291
291
|
"flex w-full items-center justify-between p-5 transition-all duration-300 hover:cursor-pointer",
|
|
292
|
-
|
|
292
|
+
i ? "border-b border-slate-200" : "border-b border-transparent"
|
|
293
293
|
),
|
|
294
294
|
children: [
|
|
295
295
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
296
|
-
l && /* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
296
|
+
l && /* @__PURE__ */ r("span", { className: "shrink-0", children: l }),
|
|
297
|
+
/* @__PURE__ */ r("div", { className: s("text-base font-medium text-black"), children: e })
|
|
298
298
|
] }),
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
|
|
299
|
+
/* @__PURE__ */ r(
|
|
300
|
+
Re,
|
|
301
301
|
{
|
|
302
302
|
weight: "Linear",
|
|
303
303
|
size: 20,
|
|
304
304
|
className: s(
|
|
305
305
|
"shrink-0 transition-transform duration-300 text-slate-400",
|
|
306
|
-
|
|
306
|
+
i && "rotate-180"
|
|
307
307
|
)
|
|
308
308
|
}
|
|
309
309
|
)
|
|
310
310
|
]
|
|
311
311
|
}
|
|
312
312
|
),
|
|
313
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ r(
|
|
314
314
|
"div",
|
|
315
315
|
{
|
|
316
316
|
className: s(
|
|
317
317
|
"overflow-hidden transition-all duration-300 ease-out"
|
|
318
318
|
),
|
|
319
319
|
style: {
|
|
320
|
-
height: `${
|
|
320
|
+
height: `${g}px`
|
|
321
321
|
},
|
|
322
|
-
children: /* @__PURE__ */
|
|
322
|
+
children: /* @__PURE__ */ r("div", { ref: y, className: s("p-5", a), children: t })
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
] });
|
|
326
326
|
}
|
|
327
|
-
const
|
|
328
|
-
function
|
|
327
|
+
const ge = (e) => /* @__PURE__ */ ee.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...e }, /* @__PURE__ */ ee.createElement("path", { d: "M7.75739 7.75735L16.2427 16.2426", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ ee.createElement("path", { d: "M7.75733 16.2426L16.2426 7.75735", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
328
|
+
function un({
|
|
329
329
|
isOpen: e,
|
|
330
330
|
onClose: t,
|
|
331
|
-
position:
|
|
331
|
+
position: n = "right",
|
|
332
332
|
children: l,
|
|
333
333
|
footer: o,
|
|
334
|
-
title:
|
|
335
|
-
description:
|
|
334
|
+
title: a,
|
|
335
|
+
description: i,
|
|
336
336
|
showCloseButton: c = !0,
|
|
337
|
-
drawerClassName:
|
|
338
|
-
contentClassName:
|
|
339
|
-
closeOnOverlayClick:
|
|
337
|
+
drawerClassName: g,
|
|
338
|
+
contentClassName: x,
|
|
339
|
+
closeOnOverlayClick: y = !0,
|
|
340
340
|
closeOnEscape: S = !0,
|
|
341
|
-
width:
|
|
341
|
+
width: I = 572
|
|
342
342
|
}) {
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
e ? (E.current = document.activeElement,
|
|
346
|
-
}, [e]),
|
|
343
|
+
const T = ae(null), E = ae(null), h = R(() => t(), [t]);
|
|
344
|
+
J(() => {
|
|
345
|
+
e ? (E.current = document.activeElement, T.current?.focus()) : E.current?.focus();
|
|
346
|
+
}, [e]), J(() => (e && (document.body.style.overflow = "hidden"), () => {
|
|
347
347
|
document.body.style.overflow = "unset";
|
|
348
348
|
}), [e]);
|
|
349
|
-
const
|
|
349
|
+
const w = P(
|
|
350
350
|
() => ({
|
|
351
|
-
"--drawer-w": typeof
|
|
352
|
-
transform: e ? "translateX(0)" :
|
|
351
|
+
"--drawer-w": typeof I == "number" ? `${I}px` : I,
|
|
352
|
+
transform: e ? "translateX(0)" : n === "right" ? "translateX(calc(100% + 48px))" : "translateX(calc(-100% - 48px))"
|
|
353
353
|
}),
|
|
354
|
-
[e,
|
|
355
|
-
),
|
|
356
|
-
return /* @__PURE__ */ d(
|
|
357
|
-
/* @__PURE__ */
|
|
354
|
+
[e, I, n]
|
|
355
|
+
), M = !!(a || i || c), O = n === "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", k = n === "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";
|
|
356
|
+
return /* @__PURE__ */ d(he, { children: [
|
|
357
|
+
/* @__PURE__ */ r(
|
|
358
358
|
"div",
|
|
359
359
|
{
|
|
360
360
|
className: s(
|
|
361
361
|
"fixed inset-0 z-50 bg-black/40 transition-opacity duration-300",
|
|
362
362
|
e ? "opacity-100 visible cursor-pointer" : "opacity-0 invisible pointer-events-none"
|
|
363
363
|
),
|
|
364
|
-
onClick:
|
|
364
|
+
onClick: y ? h : void 0,
|
|
365
365
|
"aria-hidden": "true"
|
|
366
366
|
}
|
|
367
367
|
),
|
|
368
368
|
/* @__PURE__ */ d(
|
|
369
369
|
"div",
|
|
370
370
|
{
|
|
371
|
-
ref:
|
|
371
|
+
ref: T,
|
|
372
372
|
tabIndex: -1,
|
|
373
|
-
style:
|
|
373
|
+
style: w,
|
|
374
374
|
className: s(
|
|
375
375
|
"fixed z-50 flex flex-col bg-white outline-none min-h-0",
|
|
376
376
|
"transition-[transform,opacity,visibility] duration-300 ease-in-out",
|
|
377
377
|
e ? "opacity-100 visible pointer-events-auto shadow-2xl" : "opacity-0 invisible pointer-events-none shadow-none",
|
|
378
|
-
|
|
378
|
+
O,
|
|
379
379
|
"h-[100dvh]",
|
|
380
380
|
"pb-[env(safe-area-inset-bottom)]",
|
|
381
|
-
|
|
381
|
+
k,
|
|
382
382
|
"sm:h-auto sm:rounded-2xl sm:pb-0",
|
|
383
383
|
"sm:w-[var(--drawer-w)]",
|
|
384
|
-
|
|
384
|
+
g
|
|
385
385
|
),
|
|
386
386
|
role: "dialog",
|
|
387
387
|
"aria-modal": "true",
|
|
388
388
|
"aria-hidden": !e,
|
|
389
|
-
"aria-labelledby":
|
|
389
|
+
"aria-labelledby": a ? "drawer-title" : void 0,
|
|
390
390
|
children: [
|
|
391
|
-
|
|
392
|
-
(
|
|
393
|
-
|
|
391
|
+
M && /* @__PURE__ */ d("div", { className: "flex items-start justify-between border-b border-slate-200 shrink-0 px-4 py-4 sm:p-6", children: [
|
|
392
|
+
(a || i) && /* @__PURE__ */ d("div", { className: "block pr-3", children: [
|
|
393
|
+
a && /* @__PURE__ */ r(
|
|
394
394
|
"h2",
|
|
395
395
|
{
|
|
396
396
|
id: "drawer-title",
|
|
397
397
|
className: "font-semibold text-black text-xl leading-tight sm:text-h3",
|
|
398
|
-
children:
|
|
398
|
+
children: a
|
|
399
399
|
}
|
|
400
400
|
),
|
|
401
|
-
|
|
401
|
+
i && /* @__PURE__ */ r("p", { className: "text-sm sm:text-base text-slate-base font-normal mt-2", children: i })
|
|
402
402
|
] }),
|
|
403
|
-
c && /* @__PURE__ */
|
|
403
|
+
c && /* @__PURE__ */ r(
|
|
404
404
|
"button",
|
|
405
405
|
{
|
|
406
406
|
type: "button",
|
|
407
407
|
onClick: h,
|
|
408
408
|
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",
|
|
409
|
-
children: /* @__PURE__ */
|
|
409
|
+
children: /* @__PURE__ */ r(ge, { className: "h-5 w-5 sm:h-6 sm:w-6 transition-transform duration-300 group-hover:rotate-180" })
|
|
410
410
|
}
|
|
411
411
|
)
|
|
412
412
|
] }),
|
|
413
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ r(
|
|
414
414
|
"div",
|
|
415
415
|
{
|
|
416
416
|
className: s(
|
|
417
417
|
"flex-1 min-h-0 overflow-y-auto scrollbar-thin scrollbar-thumb-slate-200 px-4 py-4 sm:p-6",
|
|
418
|
-
|
|
418
|
+
x
|
|
419
419
|
),
|
|
420
420
|
children: l
|
|
421
421
|
}
|
|
422
422
|
),
|
|
423
|
-
o && /* @__PURE__ */
|
|
423
|
+
o && /* @__PURE__ */ r("div", { className: "shrink-0 flex items-center justify-end border-t border-slate-200 px-4 py-4 sm:p-6 gap-3 [&>*]:w-fit [&>*]:shrink-0 [&>*]:whitespace-nowrap", children: o })
|
|
424
424
|
]
|
|
425
425
|
}
|
|
426
426
|
)
|
|
427
427
|
] });
|
|
428
428
|
}
|
|
429
|
-
const
|
|
429
|
+
const je = {
|
|
430
430
|
sm: {
|
|
431
431
|
input: "h-9 text-sm",
|
|
432
432
|
icon: "w-4 h-4",
|
|
@@ -453,58 +453,67 @@ const Ie = {
|
|
|
453
453
|
}
|
|
454
454
|
};
|
|
455
455
|
function Pt(e, t) {
|
|
456
|
-
const
|
|
456
|
+
const n = (l) => l === "sm" ? e && t ? "pl-7 pr-7" : e ? "pl-7 pr-2" : t ? "pl-2 pr-7" : "px-2" : l === "md" ? e && t ? "pl-8 pr-8" : e ? "pl-8 pr-2" : t ? "pl-2 pr-8" : "px-4" : e && t ? "pl-9 pr-9" : e ? "pl-9 pr-3" : t ? "pl-3 pr-9" : "px-4";
|
|
457
457
|
return {
|
|
458
|
-
sm: { ...
|
|
459
|
-
md: { ...
|
|
460
|
-
base: { ...
|
|
458
|
+
sm: { ...je.sm, padding: n("sm") },
|
|
459
|
+
md: { ...je.md, padding: n("md") },
|
|
460
|
+
base: { ...je.base, padding: n("base") }
|
|
461
461
|
};
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function zt(e) {
|
|
464
464
|
return e ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600";
|
|
465
465
|
}
|
|
466
|
-
function Wt(e, t,
|
|
467
|
-
return e ? "text-slate-400" : t ? "text-red-600" :
|
|
466
|
+
function Wt(e, t, n) {
|
|
467
|
+
return e ? "text-slate-400" : t ? "text-red-600" : n ? "text-black" : "text-slate-400";
|
|
468
468
|
}
|
|
469
|
-
|
|
469
|
+
function Yt(e, t) {
|
|
470
|
+
return t <= 0 ? "" : e === "sm" ? t >= 3 ? "pr-14" : t === 2 ? "pr-11" : "pr-7" : e === "md" ? t >= 3 ? "pr-16" : t === 2 ? "pr-12" : "pr-8" : t >= 3 ? "pr-20" : t === 2 ? "pr-16" : "pr-10";
|
|
471
|
+
}
|
|
472
|
+
const Be = be(
|
|
470
473
|
({
|
|
471
474
|
label: e,
|
|
472
475
|
placeholder: t,
|
|
473
|
-
type:
|
|
476
|
+
type: n = "text",
|
|
474
477
|
icon: l,
|
|
475
478
|
rightIcon: o,
|
|
476
|
-
iconPosition:
|
|
477
|
-
size:
|
|
479
|
+
iconPosition: a = "left",
|
|
480
|
+
size: i = "base",
|
|
478
481
|
error: c,
|
|
479
|
-
disabled:
|
|
480
|
-
required:
|
|
481
|
-
value:
|
|
482
|
+
disabled: g = !1,
|
|
483
|
+
required: x = !1,
|
|
484
|
+
value: y,
|
|
482
485
|
onChange: S,
|
|
483
|
-
onFocus:
|
|
484
|
-
onBlur:
|
|
486
|
+
onFocus: I,
|
|
487
|
+
onBlur: T,
|
|
485
488
|
className: E,
|
|
486
489
|
name: h,
|
|
487
|
-
maxLength:
|
|
488
|
-
onClear:
|
|
489
|
-
showClearButton:
|
|
490
|
-
step:
|
|
490
|
+
maxLength: w = 250,
|
|
491
|
+
onClear: M,
|
|
492
|
+
showClearButton: O = !1,
|
|
493
|
+
step: k,
|
|
491
494
|
autoComplete: f = "off"
|
|
492
|
-
},
|
|
493
|
-
const [
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
},
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
() =>
|
|
507
|
-
[
|
|
495
|
+
}, L) => {
|
|
496
|
+
const [v, D] = W(!1), [m, u] = W(""), [b, j] = W(!1), F = y ?? m, $ = n === "password", z = O && !!F && !g, V = l && a === "left", X = l && a === "right" || o || $, re = X || z, ne = P(() => {
|
|
497
|
+
let Z = 0;
|
|
498
|
+
return z && (Z += 1), $ ? (Z += 1, o && (Z += 1), Z) : (o && (Z += 1), l && a === "right" && (Z += 1), Z);
|
|
499
|
+
}, [z, $, o, l, a]), le = () => {
|
|
500
|
+
D(!0), I?.();
|
|
501
|
+
}, te = () => {
|
|
502
|
+
D(!1), T?.();
|
|
503
|
+
}, ie = (Z) => {
|
|
504
|
+
let G = Z.target.value;
|
|
505
|
+
n === "number" && w && G.length > w && (G = G.slice(0, w), Z.target.value = G), y === void 0 && u(G), S?.(Z);
|
|
506
|
+
}, K = () => j((Z) => !Z), A = () => {
|
|
507
|
+
y === void 0 && u(""), M?.();
|
|
508
|
+
}, C = P(
|
|
509
|
+
() => Pt(!!V, !!X),
|
|
510
|
+
[V, X]
|
|
511
|
+
), q = P(() => zt(c), [c]), B = P(
|
|
512
|
+
() => Wt(g, c, v),
|
|
513
|
+
[c, v, g]
|
|
514
|
+
), H = P(
|
|
515
|
+
() => Yt(i, ne),
|
|
516
|
+
[i, ne]
|
|
508
517
|
);
|
|
509
518
|
return /* @__PURE__ */ d("div", { className: s("w-full", E), children: [
|
|
510
519
|
e && /* @__PURE__ */ d(
|
|
@@ -514,152 +523,153 @@ const ze = he(
|
|
|
514
523
|
className: s(
|
|
515
524
|
"mb-2 block text-base font-medium",
|
|
516
525
|
c ? "text-red-600" : "text-slate-700",
|
|
517
|
-
|
|
526
|
+
C[i].labelFont
|
|
518
527
|
),
|
|
519
528
|
children: [
|
|
520
529
|
e,
|
|
521
|
-
|
|
530
|
+
x && /* @__PURE__ */ r("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
|
|
522
531
|
]
|
|
523
532
|
}
|
|
524
533
|
),
|
|
525
534
|
/* @__PURE__ */ d("div", { className: "relative flex items-center", children: [
|
|
526
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ r(
|
|
527
536
|
"input",
|
|
528
537
|
{
|
|
529
|
-
ref:
|
|
538
|
+
ref: L,
|
|
530
539
|
name: h,
|
|
531
|
-
type:
|
|
532
|
-
value:
|
|
540
|
+
type: $ && b ? "text" : n,
|
|
541
|
+
value: F,
|
|
533
542
|
onChange: ie,
|
|
534
|
-
onFocus:
|
|
535
|
-
onBlur:
|
|
536
|
-
disabled:
|
|
537
|
-
required:
|
|
543
|
+
onFocus: le,
|
|
544
|
+
onBlur: te,
|
|
545
|
+
disabled: g,
|
|
546
|
+
required: x,
|
|
538
547
|
autoComplete: f,
|
|
539
548
|
placeholder: t,
|
|
540
|
-
step:
|
|
549
|
+
step: k,
|
|
541
550
|
className: s(
|
|
542
551
|
"w-full border bg-white font-normal transition-all duration-300 ease-in-out outline-none",
|
|
543
|
-
|
|
552
|
+
i === "base" ? "rounded-xl" : "rounded-lg",
|
|
544
553
|
"disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
|
|
545
554
|
"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
555
|
+
C[i].input,
|
|
556
|
+
C[i].padding,
|
|
557
|
+
H,
|
|
558
|
+
q
|
|
549
559
|
),
|
|
550
|
-
maxLength:
|
|
560
|
+
maxLength: w
|
|
551
561
|
}
|
|
552
562
|
),
|
|
553
|
-
|
|
563
|
+
V && /* @__PURE__ */ r(
|
|
554
564
|
"div",
|
|
555
565
|
{
|
|
556
566
|
className: s(
|
|
557
567
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center",
|
|
558
568
|
"transition-all duration-300",
|
|
559
|
-
|
|
560
|
-
|
|
569
|
+
C[i].leftIcon,
|
|
570
|
+
B
|
|
561
571
|
),
|
|
562
|
-
children: /* @__PURE__ */
|
|
572
|
+
children: /* @__PURE__ */ r(
|
|
563
573
|
"div",
|
|
564
574
|
{
|
|
565
|
-
className: s("flex items-center justify-center",
|
|
566
|
-
children: /* @__PURE__ */
|
|
575
|
+
className: s("flex items-center justify-center", C[i].iconWrapper),
|
|
576
|
+
children: /* @__PURE__ */ r("span", { className: s("flex items-center justify-center", C[i].icon), children: l })
|
|
567
577
|
}
|
|
568
578
|
)
|
|
569
579
|
}
|
|
570
580
|
),
|
|
571
|
-
|
|
581
|
+
re && /* @__PURE__ */ d(
|
|
572
582
|
"div",
|
|
573
583
|
{
|
|
574
584
|
className: s(
|
|
575
585
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center gap-2",
|
|
576
586
|
"transition-all duration-300",
|
|
577
|
-
|
|
587
|
+
C[i].rightIcon
|
|
578
588
|
),
|
|
579
589
|
children: [
|
|
580
|
-
|
|
590
|
+
z && /* @__PURE__ */ r(
|
|
581
591
|
"button",
|
|
582
592
|
{
|
|
583
593
|
type: "button",
|
|
584
|
-
onClick:
|
|
594
|
+
onClick: A,
|
|
585
595
|
className: s(
|
|
586
596
|
"flex items-center justify-center",
|
|
587
|
-
|
|
597
|
+
C[i].iconWrapper,
|
|
588
598
|
"text-slate-base hover:text-black"
|
|
589
599
|
),
|
|
590
600
|
style: { cursor: "pointer" },
|
|
591
|
-
children: /* @__PURE__ */
|
|
601
|
+
children: /* @__PURE__ */ r("span", { className: s("flex items-center justify-center", C[i].icon), children: /* @__PURE__ */ r(ge, { className: s("h-full w-full") }) })
|
|
592
602
|
}
|
|
593
603
|
),
|
|
594
|
-
o &&
|
|
604
|
+
o && !$ && /* @__PURE__ */ r(
|
|
595
605
|
"div",
|
|
596
606
|
{
|
|
597
|
-
className: s("flex items-center justify-center",
|
|
598
|
-
children: /* @__PURE__ */
|
|
607
|
+
className: s("flex items-center justify-center", C[i].iconWrapper),
|
|
608
|
+
children: /* @__PURE__ */ r(
|
|
599
609
|
"span",
|
|
600
610
|
{
|
|
601
611
|
className: s(
|
|
602
612
|
"flex items-center justify-center",
|
|
603
|
-
|
|
604
|
-
|
|
613
|
+
C[i].icon,
|
|
614
|
+
B
|
|
605
615
|
),
|
|
606
616
|
children: o
|
|
607
617
|
}
|
|
608
618
|
)
|
|
609
619
|
}
|
|
610
620
|
),
|
|
611
|
-
|
|
612
|
-
o && /* @__PURE__ */
|
|
621
|
+
$ && /* @__PURE__ */ d(he, { children: [
|
|
622
|
+
o && /* @__PURE__ */ r(
|
|
613
623
|
"div",
|
|
614
624
|
{
|
|
615
625
|
className: s(
|
|
616
626
|
"flex items-center justify-center",
|
|
617
|
-
|
|
627
|
+
C[i].iconWrapper
|
|
618
628
|
),
|
|
619
|
-
children: /* @__PURE__ */
|
|
629
|
+
children: /* @__PURE__ */ r(
|
|
620
630
|
"span",
|
|
621
631
|
{
|
|
622
632
|
className: s(
|
|
623
633
|
"flex items-center justify-center",
|
|
624
|
-
|
|
625
|
-
|
|
634
|
+
C[i].icon,
|
|
635
|
+
B
|
|
626
636
|
),
|
|
627
637
|
children: o
|
|
628
638
|
}
|
|
629
639
|
)
|
|
630
640
|
}
|
|
631
641
|
),
|
|
632
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ r(
|
|
633
643
|
"button",
|
|
634
644
|
{
|
|
635
645
|
type: "button",
|
|
636
|
-
onClick:
|
|
646
|
+
onClick: K,
|
|
637
647
|
className: s(
|
|
638
648
|
"flex items-center justify-center",
|
|
639
|
-
|
|
640
|
-
|
|
649
|
+
C[i].iconWrapper,
|
|
650
|
+
B
|
|
641
651
|
),
|
|
642
|
-
children: /* @__PURE__ */
|
|
652
|
+
children: /* @__PURE__ */ r(
|
|
643
653
|
"span",
|
|
644
654
|
{
|
|
645
|
-
className: s("flex items-center justify-center cursor-pointer",
|
|
646
|
-
children:
|
|
655
|
+
className: s("flex items-center justify-center cursor-pointer", C[i].icon),
|
|
656
|
+
children: b ? /* @__PURE__ */ r(ut, { weight: "Linear", className: s("h-full w-full") }) : /* @__PURE__ */ r(et, { weight: "Linear", className: s("h-full w-full") })
|
|
647
657
|
}
|
|
648
658
|
)
|
|
649
659
|
}
|
|
650
660
|
)
|
|
651
661
|
] }),
|
|
652
|
-
l &&
|
|
662
|
+
l && a === "right" && !$ && /* @__PURE__ */ r(
|
|
653
663
|
"div",
|
|
654
664
|
{
|
|
655
|
-
className: s("flex items-center justify-center",
|
|
656
|
-
children: /* @__PURE__ */
|
|
665
|
+
className: s("flex items-center justify-center", C[i].iconWrapper),
|
|
666
|
+
children: /* @__PURE__ */ r(
|
|
657
667
|
"span",
|
|
658
668
|
{
|
|
659
669
|
className: s(
|
|
660
670
|
"flex items-center justify-center",
|
|
661
|
-
|
|
662
|
-
|
|
671
|
+
C[i].icon,
|
|
672
|
+
B
|
|
663
673
|
),
|
|
664
674
|
children: l
|
|
665
675
|
}
|
|
@@ -670,12 +680,12 @@ const ze = he(
|
|
|
670
680
|
}
|
|
671
681
|
)
|
|
672
682
|
] }),
|
|
673
|
-
c && /* @__PURE__ */
|
|
683
|
+
c && /* @__PURE__ */ r("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: c })
|
|
674
684
|
] });
|
|
675
685
|
}
|
|
676
686
|
);
|
|
677
|
-
|
|
678
|
-
const
|
|
687
|
+
Be.displayName = "MciInput";
|
|
688
|
+
const Vt = {
|
|
679
689
|
uz: {
|
|
680
690
|
months: [
|
|
681
691
|
"Yanvar",
|
|
@@ -773,302 +783,302 @@ const Yt = {
|
|
|
773
783
|
weekdaysShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
|
|
774
784
|
}
|
|
775
785
|
};
|
|
776
|
-
function
|
|
786
|
+
function ce(e) {
|
|
777
787
|
if (!e) return null;
|
|
778
788
|
const t = new Date(e);
|
|
779
789
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
780
790
|
}
|
|
781
|
-
function
|
|
791
|
+
function se(e) {
|
|
782
792
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
783
793
|
}
|
|
784
|
-
function
|
|
794
|
+
function Ht(e, t) {
|
|
785
795
|
if (!e) return "";
|
|
786
|
-
const
|
|
787
|
-
return t.replace("DD",
|
|
796
|
+
const n = e.getDate().toString().padStart(2, "0"), l = (e.getMonth() + 1).toString().padStart(2, "0"), o = e.getFullYear().toString();
|
|
797
|
+
return t.replace("DD", n).replace("MM", l).replace("YYYY", o);
|
|
788
798
|
}
|
|
789
|
-
function
|
|
799
|
+
function Ue(e) {
|
|
790
800
|
if (!e || e.length !== 10) return null;
|
|
791
801
|
const t = e.replace(/\D/g, "");
|
|
792
802
|
if (t.length !== 8) return null;
|
|
793
|
-
const
|
|
794
|
-
if (o < 1e3 || l < 1 || l > 12 ||
|
|
795
|
-
const
|
|
796
|
-
return
|
|
803
|
+
const n = parseInt(t.slice(0, 2), 10), l = parseInt(t.slice(2, 4), 10), o = parseInt(t.slice(4, 8), 10);
|
|
804
|
+
if (o < 1e3 || l < 1 || l > 12 || n < 1 || n > 31) return null;
|
|
805
|
+
const a = new Date(o, l - 1, n);
|
|
806
|
+
return a.getFullYear() !== o || a.getMonth() !== l - 1 || a.getDate() !== n ? null : a;
|
|
797
807
|
}
|
|
798
|
-
function
|
|
808
|
+
function Ut(e) {
|
|
799
809
|
let t = e.replace(/\D/g, "");
|
|
800
810
|
return t.length > 8 && (t = t.slice(0, 8)), t.length > 4 ? `${t.slice(0, 2)}.${t.slice(2, 4)}.${t.slice(4)}` : t.length > 2 ? `${t.slice(0, 2)}.${t.slice(2)}` : t;
|
|
801
811
|
}
|
|
802
|
-
function
|
|
803
|
-
const l =
|
|
804
|
-
return !!(t && l <
|
|
812
|
+
function Zt(e, t, n) {
|
|
813
|
+
const l = se(e);
|
|
814
|
+
return !!(t && l < se(t) || n && l > se(n));
|
|
805
815
|
}
|
|
806
|
-
function
|
|
816
|
+
function Xt(e, t) {
|
|
807
817
|
return new Date(e.getFullYear(), e.getMonth() + t, 1);
|
|
808
818
|
}
|
|
809
|
-
function
|
|
819
|
+
function Kt(e, t) {
|
|
810
820
|
return new Date(e.getFullYear() + t, e.getMonth(), 1);
|
|
811
821
|
}
|
|
812
|
-
function
|
|
813
|
-
const t = e.getFullYear(),
|
|
822
|
+
function qt(e) {
|
|
823
|
+
const t = e.getFullYear(), n = e.getMonth(), l = new Date(t, n, 1).getDay(), o = new Date(t, n + 1, 0).getDate(), a = [];
|
|
814
824
|
for (let c = l; c > 0; c -= 1)
|
|
815
|
-
|
|
825
|
+
a.push({ date: new Date(t, n, 1 - c), isCurrentMonth: !1 });
|
|
816
826
|
for (let c = 1; c <= o; c += 1)
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
for (let c = 1; c <=
|
|
820
|
-
|
|
821
|
-
return
|
|
827
|
+
a.push({ date: new Date(t, n, c), isCurrentMonth: !0 });
|
|
828
|
+
const i = 42 - a.length;
|
|
829
|
+
for (let c = 1; c <= i; c += 1)
|
|
830
|
+
a.push({ date: new Date(t, n + 1, c), isCurrentMonth: !1 });
|
|
831
|
+
return a;
|
|
822
832
|
}
|
|
823
|
-
function
|
|
824
|
-
return
|
|
833
|
+
function Gt(e, t) {
|
|
834
|
+
return se(e).getTime() === se(t).getTime();
|
|
825
835
|
}
|
|
826
|
-
const
|
|
836
|
+
const Jt = be(
|
|
827
837
|
({
|
|
828
838
|
type: e = "date",
|
|
829
839
|
value: t,
|
|
830
|
-
onChange:
|
|
840
|
+
onChange: n,
|
|
831
841
|
placeholder: l,
|
|
832
842
|
label: o,
|
|
833
|
-
disabled:
|
|
834
|
-
required:
|
|
843
|
+
disabled: a = !1,
|
|
844
|
+
required: i = !1,
|
|
835
845
|
className: c,
|
|
836
|
-
format:
|
|
837
|
-
minDate:
|
|
838
|
-
maxDate:
|
|
846
|
+
format: g = "DD.MM.YYYY",
|
|
847
|
+
minDate: x,
|
|
848
|
+
maxDate: y,
|
|
839
849
|
error: S,
|
|
840
|
-
showClear:
|
|
841
|
-
allowManualInput:
|
|
850
|
+
showClear: I = !0,
|
|
851
|
+
allowManualInput: T = !0,
|
|
842
852
|
locale: E = "uz",
|
|
843
853
|
startView: h = "day",
|
|
844
|
-
iconPosition:
|
|
845
|
-
align:
|
|
846
|
-
},
|
|
847
|
-
const [
|
|
854
|
+
iconPosition: w = "left",
|
|
855
|
+
align: M = "auto"
|
|
856
|
+
}, O) => {
|
|
857
|
+
const [k, f] = W(!1), [L, v] = W(
|
|
848
858
|
e === "range" ? [null, null] : null
|
|
849
|
-
), [D, m] =
|
|
850
|
-
const
|
|
851
|
-
if (e === "date") return
|
|
852
|
-
const
|
|
853
|
-
return [
|
|
854
|
-
}, [t,
|
|
855
|
-
(
|
|
856
|
-
[
|
|
857
|
-
),
|
|
858
|
-
(
|
|
859
|
-
[
|
|
860
|
-
),
|
|
861
|
-
if (e === "date") return
|
|
862
|
-
const [
|
|
863
|
-
return !
|
|
864
|
-
}, [e, K,
|
|
865
|
-
|
|
866
|
-
(!
|
|
867
|
-
}, [
|
|
868
|
-
if (
|
|
859
|
+
), [D, m] = W([null, null]), [u, b] = W(/* @__PURE__ */ new Date()), [j, F] = W(h), [$, z] = W(0), [V, X] = W(""), [re, ne] = W(!1), [le, te] = W(M), ie = ae(null), K = P(() => {
|
|
860
|
+
const p = t !== void 0 ? t : L;
|
|
861
|
+
if (e === "date") return ce(p);
|
|
862
|
+
const N = p;
|
|
863
|
+
return [ce(N[0]), ce(N[1])];
|
|
864
|
+
}, [t, L, e]), A = Vt[E], C = R(
|
|
865
|
+
(p) => Ht(p, g),
|
|
866
|
+
[g]
|
|
867
|
+
), q = R(
|
|
868
|
+
(p) => Zt(p, x, y),
|
|
869
|
+
[x, y]
|
|
870
|
+
), B = P(() => {
|
|
871
|
+
if (e === "date") return C(K);
|
|
872
|
+
const [p, N] = K;
|
|
873
|
+
return !p && !N ? "" : p && N ? `${C(p)} - ${C(N)}` : p ? `${C(p)} - ...` : "...";
|
|
874
|
+
}, [e, K, C]);
|
|
875
|
+
J(() => {
|
|
876
|
+
(!k && !re || V === "" && B !== "") && X(B);
|
|
877
|
+
}, [B, k, V, re]), J(() => {
|
|
878
|
+
if (k)
|
|
869
879
|
if (e === "range") {
|
|
870
|
-
const
|
|
871
|
-
m(
|
|
880
|
+
const p = K;
|
|
881
|
+
m(p), p[0] ? b(p[0]) : p[1] ? b(p[1]) : b(/* @__PURE__ */ new Date());
|
|
872
882
|
} else {
|
|
873
|
-
const
|
|
874
|
-
|
|
883
|
+
const p = K;
|
|
884
|
+
b(p || /* @__PURE__ */ new Date());
|
|
875
885
|
}
|
|
876
|
-
}, [
|
|
877
|
-
if (
|
|
878
|
-
const
|
|
879
|
-
|
|
886
|
+
}, [k, e, K]), J(() => {
|
|
887
|
+
if (k && M === "auto" && ie.current) {
|
|
888
|
+
const p = ie.current.getBoundingClientRect(), N = window.innerWidth - p.right, _ = p.left;
|
|
889
|
+
N < 300 && _ > 300 ? te("right") : te("left");
|
|
880
890
|
}
|
|
881
|
-
}, [
|
|
882
|
-
const
|
|
883
|
-
f(!1),
|
|
884
|
-
}, [h,
|
|
885
|
-
|
|
886
|
-
}, [
|
|
887
|
-
|
|
888
|
-
if (
|
|
889
|
-
return document.addEventListener("mousedown",
|
|
890
|
-
document.removeEventListener("mousedown",
|
|
891
|
+
}, [k, M]);
|
|
892
|
+
const H = R(() => {
|
|
893
|
+
f(!1), F(h), z(0), X(B);
|
|
894
|
+
}, [h, B]), Z = R((p) => {
|
|
895
|
+
a || (p.preventDefault(), p.stopPropagation(), f((N) => !N));
|
|
896
|
+
}, [a]), { handleClick: G } = Fe(ie, H), { handleEscape: de } = _e(H);
|
|
897
|
+
J(() => {
|
|
898
|
+
if (k)
|
|
899
|
+
return document.addEventListener("mousedown", G), document.addEventListener("keydown", de), () => {
|
|
900
|
+
document.removeEventListener("mousedown", G), document.removeEventListener("keydown", de);
|
|
891
901
|
};
|
|
892
|
-
}, [
|
|
893
|
-
const
|
|
894
|
-
|
|
895
|
-
},
|
|
896
|
-
if (
|
|
897
|
-
const
|
|
898
|
-
if (!
|
|
899
|
-
|
|
902
|
+
}, [k, G, de]);
|
|
903
|
+
const pe = () => {
|
|
904
|
+
ne(!0), !(a || k) && (e === "range" || !T) && (f(!0), F(h));
|
|
905
|
+
}, ke = () => {
|
|
906
|
+
if (ne(!1), e !== "date") return;
|
|
907
|
+
const p = V.trim();
|
|
908
|
+
if (!p) {
|
|
909
|
+
v(null), n?.(null);
|
|
900
910
|
return;
|
|
901
911
|
}
|
|
902
|
-
const
|
|
903
|
-
if (
|
|
904
|
-
const
|
|
905
|
-
|
|
912
|
+
const N = Ue(p);
|
|
913
|
+
if (N && !q(N)) {
|
|
914
|
+
const _ = se(N);
|
|
915
|
+
v(_), n?.(_), X(C(_)), b(_);
|
|
906
916
|
return;
|
|
907
917
|
}
|
|
908
|
-
X(
|
|
909
|
-
},
|
|
918
|
+
X(B);
|
|
919
|
+
}, Y = (p) => {
|
|
910
920
|
if (e !== "date") return;
|
|
911
|
-
const
|
|
912
|
-
if (!(
|
|
913
|
-
if (
|
|
914
|
-
const U = Number.parseInt(
|
|
921
|
+
const N = p.target.value, _ = Ut(N), Q = _.replace(/\D/g, "");
|
|
922
|
+
if (!(Q.length >= 1 && Number.parseInt(Q[0] ?? "0", 10) > 3)) {
|
|
923
|
+
if (Q.length >= 2) {
|
|
924
|
+
const U = Number.parseInt(Q.slice(0, 2), 10);
|
|
915
925
|
if (U < 1 || U > 31) return;
|
|
916
926
|
}
|
|
917
|
-
if (!(
|
|
918
|
-
if (
|
|
919
|
-
const U = Number.parseInt(
|
|
927
|
+
if (!(Q.length >= 3 && Number.parseInt(Q[2] ?? "0", 10) > 1)) {
|
|
928
|
+
if (Q.length >= 4) {
|
|
929
|
+
const U = Number.parseInt(Q.slice(2, 4), 10);
|
|
920
930
|
if (U < 1 || U > 12) return;
|
|
921
931
|
}
|
|
922
|
-
if (X(
|
|
923
|
-
const U =
|
|
924
|
-
U && !
|
|
925
|
-
} else
|
|
932
|
+
if (X(_), _.length === 10) {
|
|
933
|
+
const U = Ue(_);
|
|
934
|
+
U && !q(U) && (v(U), n?.(U), b(U));
|
|
935
|
+
} else _ === "" && (v(null), n?.(null));
|
|
926
936
|
}
|
|
927
937
|
}
|
|
928
|
-
},
|
|
929
|
-
const
|
|
930
|
-
|
|
931
|
-
}, [e,
|
|
932
|
-
(
|
|
933
|
-
if (
|
|
934
|
-
const
|
|
938
|
+
}, ue = R(() => {
|
|
939
|
+
const p = e === "range" ? [null, null] : null;
|
|
940
|
+
v(p), m([null, null]), n?.(p), X("");
|
|
941
|
+
}, [e, n]), rt = R(
|
|
942
|
+
(p) => {
|
|
943
|
+
if (q(p)) return;
|
|
944
|
+
const N = se(p);
|
|
935
945
|
if (e === "date")
|
|
936
|
-
N
|
|
946
|
+
v(N), n?.(N), X(C(N)), H();
|
|
937
947
|
else {
|
|
938
|
-
const [
|
|
939
|
-
if (!
|
|
940
|
-
m([
|
|
941
|
-
else if (
|
|
942
|
-
const U =
|
|
943
|
-
m(U),
|
|
944
|
-
const [
|
|
945
|
-
X(`${
|
|
948
|
+
const [_, Q] = D;
|
|
949
|
+
if (!_ && !Q || _ && Q)
|
|
950
|
+
m([N, null]), X(`${C(N)} - ...`);
|
|
951
|
+
else if (_ && !Q) {
|
|
952
|
+
const U = N < _ ? [N, _] : [_, N];
|
|
953
|
+
m(U), v(U), n?.(U);
|
|
954
|
+
const [fe, oe] = U;
|
|
955
|
+
X(`${C(fe)} - ${C(oe)}`), H();
|
|
946
956
|
}
|
|
947
957
|
}
|
|
948
958
|
},
|
|
949
|
-
[e, D,
|
|
950
|
-
),
|
|
951
|
-
const
|
|
952
|
-
|
|
953
|
-
}, [u, h,
|
|
954
|
-
const
|
|
955
|
-
|
|
956
|
-
}, [u, h,
|
|
957
|
-
|
|
958
|
-
},
|
|
959
|
-
|
|
960
|
-
},
|
|
961
|
-
const
|
|
962
|
-
if (e === "date") return K &&
|
|
963
|
-
const [
|
|
964
|
-
return
|
|
965
|
-
}, at = (
|
|
959
|
+
[e, D, q, n, H, C]
|
|
960
|
+
), nt = R((p) => {
|
|
961
|
+
const N = new Date(u.getFullYear(), p, 1);
|
|
962
|
+
b(N), h === "month" && e === "date" ? (v(N), n?.(N), X(C(N)), H()) : F("day");
|
|
963
|
+
}, [u, h, n, H, e, C]), lt = R((p) => {
|
|
964
|
+
const N = new Date(p, u.getMonth(), 1);
|
|
965
|
+
b(N), h === "year" && e === "date" ? (v(N), n?.(N), X(C(N)), H()) : F("month");
|
|
966
|
+
}, [u, h, n, H, e, C]), We = (p) => {
|
|
967
|
+
b((N) => Xt(N, p));
|
|
968
|
+
}, Ce = (p) => {
|
|
969
|
+
b((N) => Kt(N, p));
|
|
970
|
+
}, Se = R((p, N) => Gt(p, N), []), st = (p) => {
|
|
971
|
+
const N = se(p);
|
|
972
|
+
if (e === "date") return K && Se(N, K);
|
|
973
|
+
const [_] = D[0] ? D : K;
|
|
974
|
+
return ce(_) && Se(N, ce(_));
|
|
975
|
+
}, at = (p) => {
|
|
966
976
|
if (e !== "range") return !1;
|
|
967
|
-
const
|
|
968
|
-
return
|
|
969
|
-
},
|
|
977
|
+
const N = se(p), [, _] = D[1] ? D : K;
|
|
978
|
+
return ce(_) && Se(N, ce(_));
|
|
979
|
+
}, it = (p) => {
|
|
970
980
|
if (e !== "range") return !1;
|
|
971
|
-
const
|
|
972
|
-
return U && !
|
|
973
|
-
},
|
|
974
|
-
const
|
|
981
|
+
const N = se(p), [_, Q] = D[0] ? D : K, U = ce(_), fe = ce(Q);
|
|
982
|
+
return U && !fe ? !1 : U && fe && N > se(U) && N < se(fe);
|
|
983
|
+
}, Ye = (p, N, _) => {
|
|
984
|
+
const Q = qt(p);
|
|
975
985
|
return /* @__PURE__ */ d("div", { className: "w-[300px] p-2 select-none", children: [
|
|
976
986
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-4 py-1", children: [
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ r("div", { className: "flex gap-2 w-16", children: N && /* @__PURE__ */ d(he, { children: [
|
|
988
|
+
/* @__PURE__ */ r("button", { onClick: () => Ce(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ r(mt, { size: 18 }) }),
|
|
989
|
+
/* @__PURE__ */ r("button", { onClick: () => We(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ r(Me, { size: 18 }) })
|
|
980
990
|
] }) }),
|
|
981
991
|
/* @__PURE__ */ d("div", { className: "flex gap-1 font-semibold text-slate-700 text-sm whitespace-nowrap", children: [
|
|
982
|
-
/* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ r("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => F("month"), children: A.months[p.getMonth()] }),
|
|
993
|
+
/* @__PURE__ */ r("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => F("year"), children: p.getFullYear() })
|
|
984
994
|
] }),
|
|
985
|
-
/* @__PURE__ */
|
|
986
|
-
/* @__PURE__ */
|
|
987
|
-
/* @__PURE__ */
|
|
995
|
+
/* @__PURE__ */ r("div", { className: "flex gap-2 w-16 justify-end", children: _ && /* @__PURE__ */ d(he, { children: [
|
|
996
|
+
/* @__PURE__ */ r("button", { onClick: () => We(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ r(Ne, { size: 18 }) }),
|
|
997
|
+
/* @__PURE__ */ r("button", { onClick: () => Ce(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ r(ht, { size: 18 }) })
|
|
988
998
|
] }) })
|
|
989
999
|
] }),
|
|
990
|
-
/* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
const
|
|
993
|
-
return /* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-7 mb-1 text-center text-[11px] font-bold text-blue-600 uppercase", children: A.weekdaysShort.map((U) => /* @__PURE__ */ r("div", { className: "py-1", children: U }, U)) }),
|
|
1001
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-7 gap-y-1 relative", children: Q.map((U, fe) => {
|
|
1002
|
+
const oe = U.date, He = q(oe), Ee = st(oe), De = at(oe), dt = it(oe);
|
|
1003
|
+
return /* @__PURE__ */ r("div", { className: s("h-10 flex items-center justify-center relative", dt && "bg-blue-50", Ee && e === "range" && De ? "bg-blue-50 rounded-full" : Ee && e === "range" ? "bg-gradient-to-r from-transparent to-blue-50 rounded-l-full" : "", De && e === "range" ? "bg-gradient-to-l from-transparent to-blue-50 rounded-r-full" : ""), children: /* @__PURE__ */ r("button", { type: "button", onClick: () => rt(oe), disabled: He, className: s("w-9 h-9 cursor-pointer rounded-full flex items-center justify-center text-sm font-medium transition-all z-10", U.isCurrentMonth ? "text-slate-700" : "text-slate-300", He && "opacity-20 cursor-not-allowed", Ee || De ? "bg-blue-600 text-white shadow-md shadow-blue-200 hover:bg-blue-700" : "hover:bg-blue-50", Se(oe, /* @__PURE__ */ new Date()) && !Ee && !De && "text-blue-600 border border-blue-600"), children: oe.getDate() }) }, fe);
|
|
994
1004
|
}) })
|
|
995
1005
|
] });
|
|
996
|
-
},
|
|
1006
|
+
}, ot = () => /* @__PURE__ */ d("div", { className: "w-[300px] p-3", children: [
|
|
997
1007
|
/* @__PURE__ */ d("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
998
|
-
/* @__PURE__ */
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
1008
|
+
/* @__PURE__ */ r("button", { type: "button", onClick: () => Ce(-1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ r(Me, { size: 20 }) }),
|
|
1009
|
+
/* @__PURE__ */ r("span", { className: "font-bold text-slate-800", children: u.getFullYear() }),
|
|
1010
|
+
/* @__PURE__ */ r("button", { type: "button", onClick: () => Ce(1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ r(Ne, { size: 20 }) })
|
|
1001
1011
|
] }),
|
|
1002
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-2", children: A.monthsShort.map((p, N) => /* @__PURE__ */ r("button", { type: "button", onClick: () => nt(N), className: s("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", u.getMonth() === N ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: p }, p)) })
|
|
1003
1013
|
] }), ct = () => {
|
|
1004
|
-
const
|
|
1014
|
+
const p = Math.floor(u.getFullYear() / 12) * 12 + $ * 12, N = Array.from({ length: 12 }, (_, Q) => p + Q);
|
|
1005
1015
|
return /* @__PURE__ */ d("div", { className: "w-[300px] p-3", children: [
|
|
1006
1016
|
/* @__PURE__ */ d("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
1007
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ r("button", { type: "button", onClick: () => z((_) => _ - 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ r(Me, { size: 20 }) }),
|
|
1008
1018
|
/* @__PURE__ */ d("span", { className: "font-bold text-slate-800", children: [
|
|
1009
|
-
|
|
1019
|
+
N[0],
|
|
1010
1020
|
" - ",
|
|
1011
|
-
|
|
1021
|
+
N[11]
|
|
1012
1022
|
] }),
|
|
1013
|
-
/* @__PURE__ */
|
|
1023
|
+
/* @__PURE__ */ r("button", { type: "button", onClick: () => z((_) => _ + 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ r(Ne, { size: 20 }) })
|
|
1014
1024
|
] }),
|
|
1015
|
-
/* @__PURE__ */
|
|
1025
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-2", children: N.map((_) => /* @__PURE__ */ r("button", { type: "button", onClick: () => lt(_), className: s("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", u.getFullYear() === _ ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: _ }, _)) })
|
|
1016
1026
|
] });
|
|
1017
|
-
},
|
|
1027
|
+
}, Ve = /* @__PURE__ */ r(
|
|
1018
1028
|
"div",
|
|
1019
1029
|
{
|
|
1020
|
-
onClick:
|
|
1030
|
+
onClick: Z,
|
|
1021
1031
|
className: s(
|
|
1022
1032
|
"cursor-pointer flex items-center justify-center p-1 rounded-md transition-colors",
|
|
1023
|
-
|
|
1033
|
+
a ? "pointer-events-none opacity-50" : "hover:bg-slate-100 active:bg-slate-200"
|
|
1024
1034
|
),
|
|
1025
|
-
children: /* @__PURE__ */
|
|
1035
|
+
children: /* @__PURE__ */ r(ft, { weight: "Linear", size: 20, className: "text-slate-400" })
|
|
1026
1036
|
}
|
|
1027
1037
|
);
|
|
1028
|
-
return /* @__PURE__ */ d("div", { ref:
|
|
1029
|
-
/* @__PURE__ */
|
|
1030
|
-
|
|
1038
|
+
return /* @__PURE__ */ d("div", { ref: ie, className: s("relative w-full group", c), children: [
|
|
1039
|
+
/* @__PURE__ */ r("div", { ref: O, children: /* @__PURE__ */ r(
|
|
1040
|
+
Be,
|
|
1031
1041
|
{
|
|
1032
1042
|
label: o,
|
|
1033
1043
|
placeholder: Array.isArray(l) ? l[0] : l,
|
|
1034
|
-
value:
|
|
1035
|
-
onChange:
|
|
1036
|
-
icon:
|
|
1037
|
-
rightIcon:
|
|
1038
|
-
disabled:
|
|
1039
|
-
required:
|
|
1044
|
+
value: V,
|
|
1045
|
+
onChange: Y,
|
|
1046
|
+
icon: w === "left" ? Ve : void 0,
|
|
1047
|
+
rightIcon: w === "right" ? Ve : void 0,
|
|
1048
|
+
disabled: a,
|
|
1049
|
+
required: i,
|
|
1040
1050
|
error: S,
|
|
1041
1051
|
maxLength: e === "date" ? 10 : void 0,
|
|
1042
|
-
onFocus:
|
|
1043
|
-
onBlur:
|
|
1044
|
-
readOnly: !
|
|
1045
|
-
showClearButton:
|
|
1046
|
-
onClear:
|
|
1052
|
+
onFocus: pe,
|
|
1053
|
+
onBlur: ke,
|
|
1054
|
+
readOnly: !T || e === "range",
|
|
1055
|
+
showClearButton: I,
|
|
1056
|
+
onClear: ue
|
|
1047
1057
|
}
|
|
1048
1058
|
) }),
|
|
1049
|
-
|
|
1059
|
+
k && /* @__PURE__ */ r(
|
|
1050
1060
|
"div",
|
|
1051
1061
|
{
|
|
1052
1062
|
className: s(
|
|
1053
1063
|
"absolute top-[calc(100%+4px)] z-[100] bg-white rounded-xl shadow-xl border border-slate-200",
|
|
1054
1064
|
"flex flex-col md:flex-row overflow-hidden animate-in fade-in zoom-in-95 duration-200",
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1065
|
+
le === "right" && "right-0 origin-top-right",
|
|
1066
|
+
le === "left" && "left-0 origin-top-left",
|
|
1067
|
+
le === "center" && "left-1/2 -translate-x-1/2 origin-top"
|
|
1058
1068
|
),
|
|
1059
1069
|
style: { width: "max-content" },
|
|
1060
|
-
onMouseDown: (
|
|
1061
|
-
children:
|
|
1062
|
-
|
|
1063
|
-
e === "range" && /* @__PURE__ */
|
|
1064
|
-
] }) :
|
|
1070
|
+
onMouseDown: (p) => p.stopPropagation(),
|
|
1071
|
+
children: j === "day" ? /* @__PURE__ */ d(he, { children: [
|
|
1072
|
+
Ye(u, !0, e !== "range"),
|
|
1073
|
+
e === "range" && /* @__PURE__ */ r("div", { className: "hidden md:block border-l border-slate-100", children: Ye(new Date(u.getFullYear(), u.getMonth() + 1, 1), !1, !0) })
|
|
1074
|
+
] }) : j === "month" ? ot() : ct()
|
|
1065
1075
|
}
|
|
1066
1076
|
)
|
|
1067
1077
|
] });
|
|
1068
1078
|
}
|
|
1069
1079
|
);
|
|
1070
|
-
|
|
1071
|
-
const
|
|
1080
|
+
Jt.displayName = "MciPicker";
|
|
1081
|
+
const Qt = {
|
|
1072
1082
|
sm: {
|
|
1073
1083
|
container: "h-9 text-sm",
|
|
1074
1084
|
padding: "px-2",
|
|
@@ -1095,7 +1105,7 @@ const Jt = {
|
|
|
1095
1105
|
container: "h-12 text-base",
|
|
1096
1106
|
padding: "px-4",
|
|
1097
1107
|
iconPaddingLeft: "pl-10",
|
|
1098
|
-
iconPaddingRight: "
|
|
1108
|
+
iconPaddingRight: "pr-10",
|
|
1099
1109
|
iconSize: "w-5 h-5",
|
|
1100
1110
|
iconWrapper: "left-4",
|
|
1101
1111
|
rightIconWrapper: "right-16",
|
|
@@ -1103,116 +1113,116 @@ const Jt = {
|
|
|
1103
1113
|
dropdown: "text-base"
|
|
1104
1114
|
}
|
|
1105
1115
|
};
|
|
1106
|
-
function
|
|
1107
|
-
if (!
|
|
1116
|
+
function er(e, t, n, l) {
|
|
1117
|
+
if (!n || l) return e;
|
|
1108
1118
|
const o = t.toLowerCase();
|
|
1109
|
-
return e.filter((
|
|
1119
|
+
return e.filter((a) => a.label.toLowerCase().includes(o));
|
|
1110
1120
|
}
|
|
1111
|
-
function
|
|
1121
|
+
function tr(e, t) {
|
|
1112
1122
|
return e ? "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" : t ? "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";
|
|
1113
1123
|
}
|
|
1114
|
-
function
|
|
1115
|
-
return e ? "text-slate-400" : t ? "text-red-600" :
|
|
1124
|
+
function rr(e, t, n, l) {
|
|
1125
|
+
return e ? "text-slate-400" : t ? "text-red-600" : n || l ? "text-black" : "text-slate-400";
|
|
1116
1126
|
}
|
|
1117
|
-
const
|
|
1127
|
+
const nr = be(
|
|
1118
1128
|
({
|
|
1119
1129
|
label: e,
|
|
1120
1130
|
placeholder: t = "Выберите...",
|
|
1121
|
-
options:
|
|
1131
|
+
options: n = [],
|
|
1122
1132
|
icon: l,
|
|
1123
1133
|
iconPosition: o = "left",
|
|
1124
|
-
size:
|
|
1125
|
-
error:
|
|
1134
|
+
size: a = "base",
|
|
1135
|
+
error: i,
|
|
1126
1136
|
disabled: c = !1,
|
|
1127
|
-
required:
|
|
1128
|
-
value:
|
|
1129
|
-
onChange:
|
|
1137
|
+
required: g = !1,
|
|
1138
|
+
value: x,
|
|
1139
|
+
onChange: y,
|
|
1130
1140
|
onFocus: S,
|
|
1131
|
-
onBlur:
|
|
1132
|
-
className:
|
|
1141
|
+
onBlur: I,
|
|
1142
|
+
className: T,
|
|
1133
1143
|
clearable: E = !1,
|
|
1134
1144
|
searchable: h = !1,
|
|
1135
|
-
onSearch:
|
|
1136
|
-
name:
|
|
1137
|
-
},
|
|
1138
|
-
const [
|
|
1139
|
-
f(!1),
|
|
1140
|
-
}, [
|
|
1141
|
-
|
|
1142
|
-
if (
|
|
1143
|
-
return document.addEventListener("mousedown",
|
|
1144
|
-
document.removeEventListener("mousedown",
|
|
1145
|
+
onSearch: w,
|
|
1146
|
+
name: M
|
|
1147
|
+
}, O) => {
|
|
1148
|
+
const [k, f] = W(!1), [L, v] = W(!1), [D, m] = W(""), [u, b] = W(""), [j, F] = W(-1), $ = ae(null), z = ae(null), V = x !== void 0 ? x : D, X = n.find((Y) => Y.value === V), re = V !== "" && V !== void 0, ne = E && re && !c, le = !!(l && o === "right"), te = Qt[a], ie = P(() => le && ne ? a === "sm" || a === "md" ? "pr-16" : "pr-20" : le || ne ? a === "sm" ? "pr-11" : a === "md" ? "pr-12" : "pr-14" : a === "sm" ? "pr-8" : a === "md" ? "pr-9" : "pr-10", [le, ne, a]), K = P(() => er(n, u, h, !!w), [n, u, h, w]), A = R(() => {
|
|
1149
|
+
f(!1), v(!1), b(""), F(-1), I?.();
|
|
1150
|
+
}, [I]), { handleClick: C } = Fe($, A), { handleEscape: q } = _e(A);
|
|
1151
|
+
J(() => {
|
|
1152
|
+
if (k)
|
|
1153
|
+
return document.addEventListener("mousedown", C), document.addEventListener("keydown", q), () => {
|
|
1154
|
+
document.removeEventListener("mousedown", C), document.removeEventListener("keydown", q);
|
|
1145
1155
|
};
|
|
1146
|
-
}, [
|
|
1147
|
-
|
|
1148
|
-
}, [
|
|
1149
|
-
const
|
|
1150
|
-
c || (f((
|
|
1151
|
-
}, [c,
|
|
1152
|
-
(
|
|
1153
|
-
|
|
1156
|
+
}, [k, C, q]), J(() => {
|
|
1157
|
+
k && h && z.current && z.current.focus();
|
|
1158
|
+
}, [k, h]);
|
|
1159
|
+
const B = R(() => {
|
|
1160
|
+
c || (f((Y) => !Y), k ? (b(""), F(-1)) : (v(!0), S?.()));
|
|
1161
|
+
}, [c, k, S]), H = R(
|
|
1162
|
+
(Y) => {
|
|
1163
|
+
x === void 0 && m(Y), y?.(Y), f(!1), v(!1), b(""), F(-1), I?.();
|
|
1154
1164
|
},
|
|
1155
|
-
[
|
|
1156
|
-
), Z =
|
|
1157
|
-
(
|
|
1165
|
+
[x, y, I]
|
|
1166
|
+
), Z = R(
|
|
1167
|
+
(Y) => {
|
|
1158
1168
|
if (!c) {
|
|
1159
|
-
if (!
|
|
1160
|
-
|
|
1169
|
+
if (!k && (Y.key === "ArrowDown" || Y.key === "ArrowUp" || Y.key === "Enter")) {
|
|
1170
|
+
Y.preventDefault(), f(!0);
|
|
1161
1171
|
return;
|
|
1162
1172
|
}
|
|
1163
|
-
if (
|
|
1164
|
-
switch (
|
|
1173
|
+
if (k)
|
|
1174
|
+
switch (Y.key) {
|
|
1165
1175
|
case "ArrowDown":
|
|
1166
|
-
|
|
1167
|
-
(
|
|
1176
|
+
Y.preventDefault(), F(
|
|
1177
|
+
(ue) => ue < K.length - 1 ? ue + 1 : 0
|
|
1168
1178
|
);
|
|
1169
1179
|
break;
|
|
1170
1180
|
case "ArrowUp":
|
|
1171
|
-
|
|
1172
|
-
(
|
|
1181
|
+
Y.preventDefault(), F(
|
|
1182
|
+
(ue) => ue > 0 ? ue - 1 : K.length - 1
|
|
1173
1183
|
);
|
|
1174
1184
|
break;
|
|
1175
1185
|
case "Enter":
|
|
1176
|
-
|
|
1186
|
+
Y.preventDefault(), j >= 0 && K[j] && H(K[j].value);
|
|
1177
1187
|
break;
|
|
1178
1188
|
}
|
|
1179
1189
|
}
|
|
1180
1190
|
},
|
|
1181
|
-
[
|
|
1182
|
-
),
|
|
1183
|
-
(
|
|
1184
|
-
|
|
1191
|
+
[k, K, j, c, H]
|
|
1192
|
+
), G = R(
|
|
1193
|
+
(Y) => {
|
|
1194
|
+
Y.stopPropagation(), !c && (x === void 0 && m(""), y?.(""), b(""), F(-1));
|
|
1185
1195
|
},
|
|
1186
|
-
[
|
|
1187
|
-
),
|
|
1188
|
-
(
|
|
1189
|
-
|
|
1196
|
+
[x, y, c]
|
|
1197
|
+
), de = R(
|
|
1198
|
+
(Y) => {
|
|
1199
|
+
b(Y), w?.(Y), F(0);
|
|
1190
1200
|
},
|
|
1191
|
-
[
|
|
1192
|
-
),
|
|
1193
|
-
() =>
|
|
1194
|
-
[c,
|
|
1201
|
+
[w]
|
|
1202
|
+
), pe = P(() => tr(c, i), [i, c]), ke = P(
|
|
1203
|
+
() => rr(c, i, k, L),
|
|
1204
|
+
[c, i, k, L]
|
|
1195
1205
|
);
|
|
1196
|
-
return /* @__PURE__ */ d("div", { className: s("w-full",
|
|
1206
|
+
return /* @__PURE__ */ d("div", { className: s("w-full", T), ref: O, children: [
|
|
1197
1207
|
e && /* @__PURE__ */ d(
|
|
1198
1208
|
"label",
|
|
1199
1209
|
{
|
|
1200
|
-
htmlFor:
|
|
1210
|
+
htmlFor: M,
|
|
1201
1211
|
className: s(
|
|
1202
1212
|
"mb-2 block text-base font-medium",
|
|
1203
|
-
|
|
1204
|
-
|
|
1213
|
+
i ? "text-red-600" : "text-slate-700",
|
|
1214
|
+
te.label
|
|
1205
1215
|
),
|
|
1206
1216
|
children: [
|
|
1207
1217
|
e,
|
|
1208
|
-
|
|
1218
|
+
g && /* @__PURE__ */ r("span", { className: "ml-1 text-red-600", children: "*" })
|
|
1209
1219
|
]
|
|
1210
1220
|
}
|
|
1211
1221
|
),
|
|
1212
1222
|
/* @__PURE__ */ d(
|
|
1213
1223
|
"div",
|
|
1214
1224
|
{
|
|
1215
|
-
ref:
|
|
1225
|
+
ref: $,
|
|
1216
1226
|
className: "relative",
|
|
1217
1227
|
onKeyDown: Z,
|
|
1218
1228
|
children: [
|
|
@@ -1220,177 +1230,181 @@ const nn = he(
|
|
|
1220
1230
|
"div",
|
|
1221
1231
|
{
|
|
1222
1232
|
role: "combobox",
|
|
1223
|
-
"aria-expanded":
|
|
1233
|
+
"aria-expanded": k,
|
|
1224
1234
|
"aria-haspopup": "listbox",
|
|
1225
|
-
"aria-controls": `${
|
|
1235
|
+
"aria-controls": `${M}-listbox`,
|
|
1226
1236
|
"aria-disabled": c,
|
|
1227
1237
|
tabIndex: c ? -1 : 0,
|
|
1228
|
-
onClick:
|
|
1238
|
+
onClick: B,
|
|
1229
1239
|
className: s(
|
|
1230
1240
|
"flex w-full items-center border font-normal transition-all duration-300 ease-in-out",
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
l
|
|
1234
|
-
|
|
1235
|
-
|
|
1241
|
+
a === "base" ? "rounded-xl" : "rounded-lg",
|
|
1242
|
+
te.container,
|
|
1243
|
+
l && o === "left" ? te.iconPaddingLeft : te.padding,
|
|
1244
|
+
ie,
|
|
1245
|
+
pe,
|
|
1246
|
+
!c && L && "shadow-blue border-blue-600"
|
|
1236
1247
|
),
|
|
1237
1248
|
children: [
|
|
1238
|
-
l && /* @__PURE__ */
|
|
1249
|
+
l && /* @__PURE__ */ r(
|
|
1239
1250
|
"div",
|
|
1240
1251
|
{
|
|
1241
1252
|
className: s(
|
|
1242
1253
|
"absolute top-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-300",
|
|
1243
|
-
o === "left" ?
|
|
1244
|
-
|
|
1254
|
+
o === "left" ? te.iconWrapper : te.rightIconWrapper,
|
|
1255
|
+
ke
|
|
1245
1256
|
),
|
|
1246
1257
|
children: l
|
|
1247
1258
|
}
|
|
1248
1259
|
),
|
|
1249
|
-
h &&
|
|
1260
|
+
h && k ? /* @__PURE__ */ r(
|
|
1250
1261
|
"input",
|
|
1251
1262
|
{
|
|
1252
|
-
ref:
|
|
1263
|
+
ref: z,
|
|
1253
1264
|
type: "text",
|
|
1254
1265
|
value: u,
|
|
1255
|
-
onChange: (
|
|
1266
|
+
onChange: (Y) => de(Y.target.value),
|
|
1256
1267
|
placeholder: t,
|
|
1257
|
-
className: "w-full bg-transparent outline-none",
|
|
1258
|
-
onClick: (
|
|
1268
|
+
className: "w-full min-w-0 flex-1 bg-transparent outline-none",
|
|
1269
|
+
onClick: (Y) => Y.stopPropagation()
|
|
1259
1270
|
}
|
|
1260
|
-
) : /* @__PURE__ */
|
|
1271
|
+
) : /* @__PURE__ */ r(
|
|
1261
1272
|
"span",
|
|
1262
1273
|
{
|
|
1274
|
+
title: X?.label || t,
|
|
1263
1275
|
className: s(
|
|
1264
|
-
"block truncate select-none",
|
|
1265
|
-
!
|
|
1276
|
+
"block min-w-0 flex-1 truncate select-none",
|
|
1277
|
+
!re && !c && "text-slate-400"
|
|
1266
1278
|
),
|
|
1267
1279
|
children: X?.label || t
|
|
1268
1280
|
}
|
|
1269
1281
|
),
|
|
1270
|
-
|
|
1282
|
+
ne && /* @__PURE__ */ r(
|
|
1271
1283
|
"button",
|
|
1272
1284
|
{
|
|
1273
1285
|
type: "button",
|
|
1274
|
-
onClick:
|
|
1286
|
+
onClick: G,
|
|
1275
1287
|
className: s(
|
|
1276
1288
|
"absolute top-1/2 -translate-y-1/2 text-slate-400 hover:text-black transition-colors cursor-pointer",
|
|
1277
|
-
|
|
1289
|
+
le ? a === "sm" ? "right-8" : a === "md" ? "right-9" : "right-10" : a === "sm" ? "right-7" : a === "md" ? "right-8" : "right-9"
|
|
1278
1290
|
),
|
|
1279
1291
|
"aria-label": "Очистить",
|
|
1280
|
-
children: /* @__PURE__ */
|
|
1292
|
+
children: /* @__PURE__ */ r(ge, { className: te.iconSize })
|
|
1281
1293
|
}
|
|
1282
1294
|
),
|
|
1283
|
-
/* @__PURE__ */
|
|
1295
|
+
/* @__PURE__ */ r(
|
|
1284
1296
|
"div",
|
|
1285
1297
|
{
|
|
1286
1298
|
className: s(
|
|
1287
|
-
"absolute top-1/2
|
|
1288
|
-
|
|
1289
|
-
|
|
1299
|
+
"absolute top-1/2 -translate-y-1/2 pointer-events-none transition-all duration-300",
|
|
1300
|
+
a === "sm" ? "right-2" : "right-3",
|
|
1301
|
+
k && "rotate-180",
|
|
1302
|
+
ke
|
|
1290
1303
|
),
|
|
1291
|
-
children: /* @__PURE__ */
|
|
1304
|
+
children: /* @__PURE__ */ r(Re, { className: te.iconSize })
|
|
1292
1305
|
}
|
|
1293
1306
|
)
|
|
1294
1307
|
]
|
|
1295
1308
|
}
|
|
1296
1309
|
),
|
|
1297
|
-
|
|
1310
|
+
k && !c && /* @__PURE__ */ r(
|
|
1298
1311
|
"div",
|
|
1299
1312
|
{
|
|
1300
|
-
id: `${
|
|
1313
|
+
id: `${M}-listbox`,
|
|
1301
1314
|
role: "listbox",
|
|
1302
1315
|
className: s(
|
|
1303
1316
|
"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",
|
|
1304
|
-
|
|
1317
|
+
te.dropdown
|
|
1305
1318
|
),
|
|
1306
|
-
children:
|
|
1319
|
+
children: K.length === 0 ? /* @__PURE__ */ r("div", { className: "px-3 py-2 text-center text-base font-normal text-slate-500", children: "Ничего не найдено" }) : K.map((Y) => /* @__PURE__ */ r(
|
|
1307
1320
|
"div",
|
|
1308
1321
|
{
|
|
1309
1322
|
role: "option",
|
|
1310
|
-
"aria-selected":
|
|
1311
|
-
onClick: () =>
|
|
1323
|
+
"aria-selected": V === Y.value,
|
|
1324
|
+
onClick: () => H(Y.value),
|
|
1325
|
+
title: Y.label,
|
|
1312
1326
|
className: s(
|
|
1313
|
-
"cursor-pointer px-3 py-2 font-normal transition-colors hover:bg-slate-100 rounded-sm",
|
|
1314
|
-
|
|
1327
|
+
"cursor-pointer truncate px-3 py-2 font-normal transition-colors hover:bg-slate-100 rounded-sm",
|
|
1328
|
+
V === Y.value ? "bg-slate-100" : ""
|
|
1315
1329
|
),
|
|
1316
|
-
children:
|
|
1330
|
+
children: Y.label
|
|
1317
1331
|
},
|
|
1318
|
-
|
|
1332
|
+
Y.value
|
|
1319
1333
|
))
|
|
1320
1334
|
}
|
|
1321
1335
|
)
|
|
1322
1336
|
]
|
|
1323
1337
|
}
|
|
1324
1338
|
),
|
|
1325
|
-
|
|
1339
|
+
i && /* @__PURE__ */ r("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: i })
|
|
1326
1340
|
] });
|
|
1327
1341
|
}
|
|
1328
1342
|
);
|
|
1329
|
-
|
|
1330
|
-
function
|
|
1331
|
-
return /* @__PURE__ */
|
|
1343
|
+
nr.displayName = "MciSelect";
|
|
1344
|
+
function lr({ children: e, title: t }) {
|
|
1345
|
+
return /* @__PURE__ */ r("div", { className: "min-w-0", children: /* @__PURE__ */ r("div", { className: "clamp-2 break-words", title: t ?? (typeof e == "string" ? e : void 0), children: e }) });
|
|
1332
1346
|
}
|
|
1333
|
-
function
|
|
1347
|
+
function sr(e) {
|
|
1334
1348
|
if (e != null)
|
|
1335
1349
|
return typeof e == "number" ? `${e}px` : e;
|
|
1336
1350
|
}
|
|
1337
|
-
function
|
|
1338
|
-
return !t ||
|
|
1339
|
-
const
|
|
1340
|
-
return
|
|
1351
|
+
function ar(e, t, n) {
|
|
1352
|
+
return !t || n ? e : [...e].sort((l, o) => {
|
|
1353
|
+
const a = l[t.key], i = o[t.key];
|
|
1354
|
+
return a == null ? 1 : i == null ? -1 : a < i ? t.direction === "asc" ? -1 : 1 : a > i ? t.direction === "asc" ? 1 : -1 : 0;
|
|
1341
1355
|
});
|
|
1342
1356
|
}
|
|
1343
|
-
function
|
|
1357
|
+
function fn({
|
|
1344
1358
|
columns: e,
|
|
1345
1359
|
data: t = [],
|
|
1346
|
-
loading:
|
|
1360
|
+
loading: n = !1,
|
|
1347
1361
|
skeletonRows: l = 5,
|
|
1348
1362
|
noDataText: o = "",
|
|
1349
|
-
sort:
|
|
1350
|
-
onSortChange:
|
|
1363
|
+
sort: a,
|
|
1364
|
+
onSortChange: i,
|
|
1351
1365
|
className: c,
|
|
1352
|
-
headerClassName:
|
|
1353
|
-
bodyClassName:
|
|
1354
|
-
rowKey:
|
|
1366
|
+
headerClassName: g,
|
|
1367
|
+
bodyClassName: x,
|
|
1368
|
+
rowKey: y = "id",
|
|
1355
1369
|
rowSelection: S
|
|
1356
1370
|
}) {
|
|
1357
|
-
const [
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
}, [
|
|
1361
|
-
const
|
|
1362
|
-
() =>
|
|
1363
|
-
[
|
|
1364
|
-
),
|
|
1371
|
+
const [I, T] = W(null), E = a ?? I, h = P(() => Array.isArray(t) ? t : [], [t]), w = P(() => ar(h, E, !!a), [h, E, a]);
|
|
1372
|
+
J(() => {
|
|
1373
|
+
a !== void 0 && T(null);
|
|
1374
|
+
}, [a]);
|
|
1375
|
+
const M = P(
|
|
1376
|
+
() => n ? [] : a ? h : w,
|
|
1377
|
+
[n, a, h, w]
|
|
1378
|
+
), O = R(
|
|
1365
1379
|
(m) => {
|
|
1366
1380
|
if (!m.sortable) return;
|
|
1367
1381
|
let u = null;
|
|
1368
|
-
E?.key !== m.key ? u = { key: m.key, direction: "asc" } : E.direction === "asc" && (u = { key: m.key, direction: "desc" }),
|
|
1382
|
+
E?.key !== m.key ? u = { key: m.key, direction: "asc" } : E.direction === "asc" && (u = { key: m.key, direction: "desc" }), a !== void 0 ? i?.(u) : T(u);
|
|
1369
1383
|
},
|
|
1370
|
-
[E,
|
|
1371
|
-
),
|
|
1384
|
+
[E, a, i]
|
|
1385
|
+
), k = (m) => {
|
|
1372
1386
|
if (!S) return;
|
|
1373
|
-
const { onChange: u, getCheckboxProps:
|
|
1387
|
+
const { onChange: u, getCheckboxProps: b } = S;
|
|
1374
1388
|
if (m.target.checked) {
|
|
1375
|
-
const
|
|
1376
|
-
u(
|
|
1389
|
+
const $ = M.filter((z) => !b?.(z)?.disabled).map((z) => z[y]);
|
|
1390
|
+
u($);
|
|
1377
1391
|
} else
|
|
1378
1392
|
u([]);
|
|
1379
1393
|
}, f = (m, u) => {
|
|
1380
1394
|
if (!S) return;
|
|
1381
|
-
const { selectedRowKeys:
|
|
1382
|
-
|
|
1383
|
-
},
|
|
1384
|
-
if (!S ||
|
|
1385
|
-
const m =
|
|
1395
|
+
const { selectedRowKeys: b, onChange: j } = S, F = m[y], $ = u ? [...b, F] : b.filter((z) => z !== F);
|
|
1396
|
+
j($);
|
|
1397
|
+
}, L = P(() => {
|
|
1398
|
+
if (!S || M.length === 0) return !1;
|
|
1399
|
+
const m = M.filter((u) => !S.getCheckboxProps?.(u)?.disabled);
|
|
1386
1400
|
return m.length === 0 ? !1 : m.every(
|
|
1387
|
-
(u) => S.selectedRowKeys.includes(u[
|
|
1401
|
+
(u) => S.selectedRowKeys.includes(u[y])
|
|
1388
1402
|
);
|
|
1389
|
-
}, [S,
|
|
1390
|
-
S && /* @__PURE__ */
|
|
1391
|
-
e.map((m) => /* @__PURE__ */
|
|
1403
|
+
}, [S, M, y]), v = (m) => m.sortable ? !E || E.key !== m.key ? /* @__PURE__ */ r(bt, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : E.direction === "asc" ? /* @__PURE__ */ r(gt, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : /* @__PURE__ */ r(xt, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : null, D = () => /* @__PURE__ */ d("colgroup", { children: [
|
|
1404
|
+
S && /* @__PURE__ */ r("col", { style: { width: 48 } }),
|
|
1405
|
+
e.map((m) => /* @__PURE__ */ r("col", { style: { width: sr(m.width) ?? "auto" } }, m.key))
|
|
1392
1406
|
] });
|
|
1393
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ r(
|
|
1394
1408
|
"div",
|
|
1395
1409
|
{
|
|
1396
1410
|
className: s(
|
|
@@ -1403,75 +1417,75 @@ function ur({
|
|
|
1403
1417
|
c
|
|
1404
1418
|
),
|
|
1405
1419
|
children: /* @__PURE__ */ d("div", { className: "inline-block min-w-full align-middle", children: [
|
|
1406
|
-
/* @__PURE__ */
|
|
1420
|
+
/* @__PURE__ */ r("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-slate-100", children: /* @__PURE__ */ d("table", { className: "w-full table-fixed", children: [
|
|
1407
1421
|
D(),
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
S && /* @__PURE__ */
|
|
1410
|
-
|
|
1422
|
+
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ d("tr", { children: [
|
|
1423
|
+
S && /* @__PURE__ */ r("th", { className: s("w-12 px-4 py-3", g), children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ r(
|
|
1424
|
+
Ie,
|
|
1411
1425
|
{
|
|
1412
|
-
checked:
|
|
1413
|
-
onChange:
|
|
1426
|
+
checked: L,
|
|
1427
|
+
onChange: k,
|
|
1414
1428
|
variant: "yellow",
|
|
1415
|
-
disabled:
|
|
1429
|
+
disabled: n || M.length === 0
|
|
1416
1430
|
}
|
|
1417
1431
|
) }) }),
|
|
1418
|
-
e.map((m) => /* @__PURE__ */
|
|
1432
|
+
e.map((m) => /* @__PURE__ */ r(
|
|
1419
1433
|
"th",
|
|
1420
1434
|
{
|
|
1421
|
-
onClick: () =>
|
|
1435
|
+
onClick: () => O(m),
|
|
1422
1436
|
className: s(
|
|
1423
1437
|
"px-4 py-3 text-left text-sm font-medium text-slate-700 transition-colors",
|
|
1424
1438
|
"whitespace-nowrap overflow-hidden text-ellipsis",
|
|
1425
1439
|
m.align === "center" && "text-center",
|
|
1426
1440
|
m.align === "right" && "text-right",
|
|
1427
1441
|
m.sortable && "cursor-pointer hover:bg-slate-200",
|
|
1428
|
-
|
|
1442
|
+
g
|
|
1429
1443
|
),
|
|
1430
1444
|
children: /* @__PURE__ */ d("div", { className: s("flex items-center gap-2 min-w-0", m.align === "right" && "justify-end"), children: [
|
|
1431
|
-
/* @__PURE__ */
|
|
1432
|
-
|
|
1445
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate", title: m.title, children: m.title }),
|
|
1446
|
+
v(m)
|
|
1433
1447
|
] })
|
|
1434
1448
|
},
|
|
1435
1449
|
m.key
|
|
1436
1450
|
))
|
|
1437
1451
|
] }) })
|
|
1438
1452
|
] }) }),
|
|
1439
|
-
/* @__PURE__ */
|
|
1453
|
+
/* @__PURE__ */ r("div", { className: "rounded-xl border border-t-0 border-slate-200 bg-white overflow-hidden", children: /* @__PURE__ */ d("table", { className: "w-full table-fixed", children: [
|
|
1440
1454
|
D(),
|
|
1441
|
-
/* @__PURE__ */
|
|
1442
|
-
S && /* @__PURE__ */
|
|
1443
|
-
e.map((
|
|
1444
|
-
] }, u)) :
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
/* @__PURE__ */
|
|
1447
|
-
] }) }) }) :
|
|
1448
|
-
const
|
|
1455
|
+
/* @__PURE__ */ r("tbody", { className: "divide-y divide-slate-200", children: n ? Array.from({ length: l }).map((m, u) => /* @__PURE__ */ d("tr", { children: [
|
|
1456
|
+
S && /* @__PURE__ */ r("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ r(Ze, { height: 20, width: 20, variant: "rounded" }) }),
|
|
1457
|
+
e.map((b) => /* @__PURE__ */ r("td", { className: "px-4 py-3", children: /* @__PURE__ */ r(Ze, { height: 30, variant: "rounded" }) }, b.key))
|
|
1458
|
+
] }, u)) : M.length === 0 ? /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: e.length + (S ? 1 : 0), className: "py-20", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center", children: [
|
|
1459
|
+
/* @__PURE__ */ r("div", { className: "relative mb-4", children: /* @__PURE__ */ r(pt, { weight: "Bold", size: 64, className: "animate-float text-slate-400" }) }),
|
|
1460
|
+
/* @__PURE__ */ r("p", { className: "text-sm font-medium text-slate-400", children: o })
|
|
1461
|
+
] }) }) }) : M.map((m, u) => {
|
|
1462
|
+
const b = m[y], j = S?.selectedRowKeys.includes(b), F = S?.getCheckboxProps?.(m)?.disabled;
|
|
1449
1463
|
return /* @__PURE__ */ d("tr", { className: "group transition-colors hover:bg-slate-50", children: [
|
|
1450
|
-
S && /* @__PURE__ */
|
|
1451
|
-
|
|
1464
|
+
S && /* @__PURE__ */ r("td", { className: s("w-12 px-4 py-3 align-top", x), children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center pt-1", children: /* @__PURE__ */ r(
|
|
1465
|
+
Ie,
|
|
1452
1466
|
{
|
|
1453
|
-
checked:
|
|
1454
|
-
disabled:
|
|
1467
|
+
checked: j,
|
|
1468
|
+
disabled: F,
|
|
1455
1469
|
variant: "yellow",
|
|
1456
|
-
onChange: (
|
|
1470
|
+
onChange: ($) => f(m, $.target.checked)
|
|
1457
1471
|
}
|
|
1458
1472
|
) }) }),
|
|
1459
|
-
e.map((
|
|
1460
|
-
const
|
|
1461
|
-
return /* @__PURE__ */
|
|
1473
|
+
e.map(($) => {
|
|
1474
|
+
const z = m[$.key], V = $.render ? $.render(z, m) : String(z ?? "-");
|
|
1475
|
+
return /* @__PURE__ */ r(
|
|
1462
1476
|
"td",
|
|
1463
1477
|
{
|
|
1464
1478
|
className: s(
|
|
1465
1479
|
"align-top px-4 py-3 text-sm font-normal text-black",
|
|
1466
1480
|
"min-w-0 whitespace-normal",
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1481
|
+
$.align === "center" && "text-center",
|
|
1482
|
+
$.align === "right" && "text-right",
|
|
1483
|
+
x,
|
|
1484
|
+
$.className
|
|
1471
1485
|
),
|
|
1472
|
-
children: /* @__PURE__ */
|
|
1486
|
+
children: /* @__PURE__ */ r(lr, { title: typeof V == "string" ? V : void 0, children: V })
|
|
1473
1487
|
},
|
|
1474
|
-
|
|
1488
|
+
$.key
|
|
1475
1489
|
);
|
|
1476
1490
|
})
|
|
1477
1491
|
] }, u);
|
|
@@ -1481,13 +1495,13 @@ function ur({
|
|
|
1481
1495
|
}
|
|
1482
1496
|
);
|
|
1483
1497
|
}
|
|
1484
|
-
const
|
|
1498
|
+
const ir = {
|
|
1485
1499
|
uz: {
|
|
1486
1500
|
dragAndDrop: "Faylni bu yerga torting",
|
|
1487
1501
|
clickToUpload: "yoki bosib tanlang",
|
|
1488
1502
|
or: "yoki",
|
|
1489
1503
|
dropHereTitle: "Faylni shu yerga yuklang",
|
|
1490
|
-
fileRequirements: (e, t,
|
|
1504
|
+
fileRequirements: (e, t, n, l) => `${e ? `Maksimum ${t} ta fayl` : "1 ta fayl"} • ${n}MB gacha • ${l !== "*/*" ? `Format: ${l}` : "Barcha formatlar"}`,
|
|
1491
1505
|
selectedFiles: "Tanlangan fayllar",
|
|
1492
1506
|
clearAll: "Barchasini o‘chirish",
|
|
1493
1507
|
uploading: "Yuklanmoqda...",
|
|
@@ -1512,7 +1526,7 @@ const an = {
|
|
|
1512
1526
|
clickToUpload: "или выберите нажатием",
|
|
1513
1527
|
or: "или",
|
|
1514
1528
|
dropHereTitle: "Загрузите свой файл сюда",
|
|
1515
|
-
fileRequirements: (e, t,
|
|
1529
|
+
fileRequirements: (e, t, n, l) => `${e ? `Максимум ${t} файлов` : "1 файл"} • До ${n}MB • ${l !== "*/*" ? `Формат: ${l}` : "Все форматы"}`,
|
|
1516
1530
|
selectedFiles: "Выбранные файлы",
|
|
1517
1531
|
clearAll: "Очистить все",
|
|
1518
1532
|
uploading: "Загружается...",
|
|
@@ -1537,7 +1551,7 @@ const an = {
|
|
|
1537
1551
|
clickToUpload: "or click to select",
|
|
1538
1552
|
or: "or",
|
|
1539
1553
|
dropHereTitle: "Upload your file here",
|
|
1540
|
-
fileRequirements: (e, t,
|
|
1554
|
+
fileRequirements: (e, t, n, l) => `${e ? `Up to ${t} files` : "1 file"} • Up to ${n}MB • ${l !== "*/*" ? `Format: ${l}` : "All formats"}`,
|
|
1541
1555
|
selectedFiles: "Selected files",
|
|
1542
1556
|
clearAll: "Clear all",
|
|
1543
1557
|
uploading: "Uploading...",
|
|
@@ -1557,7 +1571,7 @@ const an = {
|
|
|
1557
1571
|
audio: "Audio",
|
|
1558
1572
|
document: "Document"
|
|
1559
1573
|
}
|
|
1560
|
-
},
|
|
1574
|
+
}, Pe = [
|
|
1561
1575
|
"pdf",
|
|
1562
1576
|
"doc",
|
|
1563
1577
|
"docx",
|
|
@@ -1571,7 +1585,7 @@ const an = {
|
|
|
1571
1585
|
"png",
|
|
1572
1586
|
"bmp",
|
|
1573
1587
|
"tiff"
|
|
1574
|
-
],
|
|
1588
|
+
], or = [
|
|
1575
1589
|
"zip",
|
|
1576
1590
|
"rar",
|
|
1577
1591
|
"7z",
|
|
@@ -1611,10 +1625,10 @@ const an = {
|
|
|
1611
1625
|
"ksh",
|
|
1612
1626
|
"csh",
|
|
1613
1627
|
"fish"
|
|
1614
|
-
],
|
|
1628
|
+
], ye = new Set(Pe), ve = new Set(or), cr = Pe.map((e) => `.${e}`).join(","), dr = {
|
|
1615
1629
|
"image/*": ["jpg", "jpeg", "png", "bmp", "tiff"],
|
|
1616
1630
|
"text/*": ["txt"]
|
|
1617
|
-
},
|
|
1631
|
+
}, ur = {
|
|
1618
1632
|
"application/pdf": ["pdf"],
|
|
1619
1633
|
"application/msword": ["doc"],
|
|
1620
1634
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"],
|
|
@@ -1628,7 +1642,7 @@ const an = {
|
|
|
1628
1642
|
"image/png": ["png"],
|
|
1629
1643
|
"image/bmp": ["bmp"],
|
|
1630
1644
|
"image/tiff": ["tiff"]
|
|
1631
|
-
},
|
|
1645
|
+
}, fr = /* @__PURE__ */ new Set([
|
|
1632
1646
|
"application/zip",
|
|
1633
1647
|
"application/x-zip-compressed",
|
|
1634
1648
|
"application/x-rar-compressed",
|
|
@@ -1647,90 +1661,90 @@ const an = {
|
|
|
1647
1661
|
"text/x-shellscript",
|
|
1648
1662
|
"application/x-powershell"
|
|
1649
1663
|
]);
|
|
1650
|
-
function
|
|
1651
|
-
const t = e.trim().toLowerCase(),
|
|
1652
|
-
return
|
|
1664
|
+
function mr(e) {
|
|
1665
|
+
const t = e.trim().toLowerCase(), n = t.lastIndexOf(".");
|
|
1666
|
+
return n <= 0 || n === t.length - 1 ? "" : t.slice(n + 1);
|
|
1653
1667
|
}
|
|
1654
|
-
function
|
|
1668
|
+
function hr(e) {
|
|
1655
1669
|
return e.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean);
|
|
1656
1670
|
}
|
|
1657
|
-
function
|
|
1671
|
+
function ze(e) {
|
|
1658
1672
|
if (!e || e === "*/*") return null;
|
|
1659
|
-
const t =
|
|
1673
|
+
const t = hr(e), n = /* @__PURE__ */ new Set();
|
|
1660
1674
|
for (const l of t)
|
|
1661
1675
|
if (l !== "*/*") {
|
|
1662
1676
|
if (l.endsWith("/*")) {
|
|
1663
|
-
const o =
|
|
1677
|
+
const o = dr[l];
|
|
1664
1678
|
if (!o) continue;
|
|
1665
|
-
for (const
|
|
1666
|
-
|
|
1679
|
+
for (const a of o)
|
|
1680
|
+
ye.has(a) && !ve.has(a) && n.add(a);
|
|
1667
1681
|
continue;
|
|
1668
1682
|
}
|
|
1669
1683
|
if (l.startsWith(".")) {
|
|
1670
1684
|
const o = l.slice(1);
|
|
1671
|
-
|
|
1685
|
+
ye.has(o) && !ve.has(o) && n.add(o);
|
|
1672
1686
|
continue;
|
|
1673
1687
|
}
|
|
1674
1688
|
if (l.includes("/")) {
|
|
1675
|
-
const o =
|
|
1689
|
+
const o = ur[l];
|
|
1676
1690
|
if (!o) continue;
|
|
1677
|
-
for (const
|
|
1678
|
-
|
|
1691
|
+
for (const a of o)
|
|
1692
|
+
ye.has(a) && !ve.has(a) && n.add(a);
|
|
1679
1693
|
continue;
|
|
1680
1694
|
}
|
|
1681
|
-
|
|
1695
|
+
ye.has(l) && !ve.has(l) && n.add(l);
|
|
1682
1696
|
}
|
|
1683
|
-
return
|
|
1697
|
+
return n.size > 0 ? n : null;
|
|
1684
1698
|
}
|
|
1685
|
-
function
|
|
1686
|
-
const t =
|
|
1687
|
-
return t ? Array.from(t).map((
|
|
1699
|
+
function pr(e) {
|
|
1700
|
+
const t = ze(e);
|
|
1701
|
+
return t ? Array.from(t).map((n) => `.${n}`).join(",") : cr;
|
|
1688
1702
|
}
|
|
1689
|
-
function
|
|
1690
|
-
const t =
|
|
1691
|
-
return t ? Array.from(t).join(", ") :
|
|
1703
|
+
function br(e) {
|
|
1704
|
+
const t = ze(e);
|
|
1705
|
+
return t ? Array.from(t).join(", ") : Pe.join(", ");
|
|
1692
1706
|
}
|
|
1693
|
-
function
|
|
1707
|
+
function gr(e) {
|
|
1694
1708
|
switch (e.type.split("/")[0]) {
|
|
1695
1709
|
case "image":
|
|
1696
|
-
return /* @__PURE__ */
|
|
1710
|
+
return /* @__PURE__ */ r(vt, { className: "h-5 w-5 text-blue-500" });
|
|
1697
1711
|
case "video":
|
|
1698
|
-
return /* @__PURE__ */
|
|
1712
|
+
return /* @__PURE__ */ r(yt, { className: "h-5 w-5 text-purple-500" });
|
|
1699
1713
|
case "audio":
|
|
1700
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ r(wt, { className: "h-5 w-5 text-green-500" });
|
|
1701
1715
|
default:
|
|
1702
|
-
return e.type.includes("pdf") ? /* @__PURE__ */
|
|
1716
|
+
return e.type.includes("pdf") ? /* @__PURE__ */ r(Le, { className: "h-5 w-5 text-red-500" }) : e.type.includes("word") || e.type.includes("document") ? /* @__PURE__ */ r(Le, { className: "h-5 w-5 text-blue-600" }) : e.type.includes("excel") || e.type.includes("spreadsheet") ? /* @__PURE__ */ r(Le, { className: "h-5 w-5 text-green-600" }) : /* @__PURE__ */ r(tt, { className: "h-5 w-5 text-gray-500" });
|
|
1703
1717
|
}
|
|
1704
1718
|
}
|
|
1705
|
-
function
|
|
1719
|
+
function xr(e) {
|
|
1706
1720
|
if (e === 0) return "0 Bytes";
|
|
1707
|
-
const t = 1024,
|
|
1708
|
-
return parseFloat((e / Math.pow(t, l)).toFixed(2)) + " " +
|
|
1721
|
+
const t = 1024, n = ["Bytes", "KB", "MB", "GB"], l = Math.floor(Math.log(e) / Math.log(t));
|
|
1722
|
+
return parseFloat((e / Math.pow(t, l)).toFixed(2)) + " " + n[l];
|
|
1709
1723
|
}
|
|
1710
|
-
function
|
|
1711
|
-
const
|
|
1712
|
-
return e.size <=
|
|
1724
|
+
function wr(e, t) {
|
|
1725
|
+
const n = t * 1024 * 1024;
|
|
1726
|
+
return e.size <= n;
|
|
1713
1727
|
}
|
|
1714
|
-
function
|
|
1715
|
-
const
|
|
1716
|
-
if (l &&
|
|
1728
|
+
function yr(e, t) {
|
|
1729
|
+
const n = mr(e.name), l = e.type.trim().toLowerCase();
|
|
1730
|
+
if (l && fr.has(l))
|
|
1717
1731
|
return { isValid: !1, reason: "blocked" };
|
|
1718
|
-
if (!
|
|
1719
|
-
if (
|
|
1720
|
-
if (!
|
|
1721
|
-
const o =
|
|
1722
|
-
return o && !o.has(
|
|
1732
|
+
if (!n) return { isValid: !1, reason: "not-allowed" };
|
|
1733
|
+
if (ve.has(n)) return { isValid: !1, reason: "blocked" };
|
|
1734
|
+
if (!ye.has(n)) return { isValid: !1, reason: "not-allowed" };
|
|
1735
|
+
const o = ze(t);
|
|
1736
|
+
return o && !o.has(n) ? { isValid: !1, reason: "not-allowed" } : { isValid: !0 };
|
|
1723
1737
|
}
|
|
1724
|
-
function
|
|
1738
|
+
function vr(e) {
|
|
1725
1739
|
return new Promise((t) => {
|
|
1726
1740
|
if (e.type.startsWith("image/")) {
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1741
|
+
const n = new FileReader();
|
|
1742
|
+
n.onload = (l) => t(l.target?.result ?? ""), n.readAsDataURL(e);
|
|
1729
1743
|
} else
|
|
1730
1744
|
t("");
|
|
1731
1745
|
});
|
|
1732
1746
|
}
|
|
1733
|
-
const
|
|
1747
|
+
const Nr = {
|
|
1734
1748
|
blue: {
|
|
1735
1749
|
dropBorder: "border-blue-200 hover:border-blue-300",
|
|
1736
1750
|
dropBg: "bg-blue-50/40 hover:bg-blue-50/60",
|
|
@@ -1755,147 +1769,147 @@ const Nn = {
|
|
|
1755
1769
|
fileIconImg: "bg-blue-50 text-blue-600",
|
|
1756
1770
|
fileIconDoc: "bg-green-50 text-green-600"
|
|
1757
1771
|
}
|
|
1758
|
-
},
|
|
1772
|
+
}, mn = ({
|
|
1759
1773
|
multiple: e = !1,
|
|
1760
1774
|
accept: t = "*/*",
|
|
1761
|
-
maxSize:
|
|
1775
|
+
maxSize: n = 10,
|
|
1762
1776
|
maxFiles: l = 5,
|
|
1763
1777
|
disabled: o = !1,
|
|
1764
|
-
label:
|
|
1765
|
-
required:
|
|
1778
|
+
label: a,
|
|
1779
|
+
required: i = !1,
|
|
1766
1780
|
error: c,
|
|
1767
|
-
className:
|
|
1768
|
-
onFilesChange:
|
|
1769
|
-
onUpload:
|
|
1781
|
+
className: g,
|
|
1782
|
+
onFilesChange: x,
|
|
1783
|
+
onUpload: y,
|
|
1770
1784
|
showPreview: S = !0,
|
|
1771
|
-
locale:
|
|
1772
|
-
showFileTypeIcon:
|
|
1785
|
+
locale: I = "uz",
|
|
1786
|
+
showFileTypeIcon: T = !0,
|
|
1773
1787
|
variant: E = "yellow",
|
|
1774
1788
|
customValidator: h
|
|
1775
1789
|
}) => {
|
|
1776
|
-
const [
|
|
1777
|
-
const
|
|
1778
|
-
|
|
1779
|
-
}, []),
|
|
1780
|
-
for (const
|
|
1781
|
-
URL.revokeObjectURL(
|
|
1782
|
-
|
|
1790
|
+
const [w, M] = W([]), [O, k] = W(!1), [f, L] = W(!1), v = ae(null), D = ir[I], m = P(() => Nr[E], [E]), u = P(() => pr(t), [t]), b = P(() => br(t), [t]), j = ae(/* @__PURE__ */ new Map()), F = R((A) => {
|
|
1791
|
+
const C = j.current.get(A);
|
|
1792
|
+
C && (URL.revokeObjectURL(C), j.current.delete(A));
|
|
1793
|
+
}, []), $ = R(() => {
|
|
1794
|
+
for (const A of j.current.values())
|
|
1795
|
+
URL.revokeObjectURL(A);
|
|
1796
|
+
j.current.clear();
|
|
1783
1797
|
}, []);
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
}, [
|
|
1787
|
-
const
|
|
1788
|
-
let
|
|
1789
|
-
|
|
1790
|
-
}, [
|
|
1791
|
-
async (
|
|
1792
|
-
const
|
|
1793
|
-
for (const
|
|
1794
|
-
if (
|
|
1798
|
+
J(() => () => {
|
|
1799
|
+
$();
|
|
1800
|
+
}, [$]);
|
|
1801
|
+
const z = R((A) => {
|
|
1802
|
+
let C = j.current.get(A.id);
|
|
1803
|
+
C || (C = URL.createObjectURL(A.file), j.current.set(A.id, C), setTimeout(() => F(A.id), 5 * 6e4)), window.open(C, "_blank", "noopener,noreferrer");
|
|
1804
|
+
}, [F]), V = R(
|
|
1805
|
+
async (A) => {
|
|
1806
|
+
const C = Array.from(A), q = [];
|
|
1807
|
+
for (const B of C) {
|
|
1808
|
+
if (w.length + q.length >= l) {
|
|
1795
1809
|
alert(D.maxFilesError(l));
|
|
1796
1810
|
break;
|
|
1797
1811
|
}
|
|
1798
|
-
if (!
|
|
1799
|
-
alert(D.fileSizeError(
|
|
1812
|
+
if (!wr(B, n)) {
|
|
1813
|
+
alert(D.fileSizeError(B.name, n));
|
|
1800
1814
|
continue;
|
|
1801
1815
|
}
|
|
1802
|
-
const
|
|
1803
|
-
if (!
|
|
1804
|
-
|
|
1816
|
+
const H = yr(B, t);
|
|
1817
|
+
if (!H.isValid) {
|
|
1818
|
+
H.reason === "blocked" ? alert(D.blockedFileTypeError(B.name)) : alert(D.fileTypeError(B.name));
|
|
1805
1819
|
continue;
|
|
1806
1820
|
}
|
|
1807
1821
|
if (h) {
|
|
1808
|
-
const
|
|
1809
|
-
if (
|
|
1810
|
-
alert(
|
|
1822
|
+
const pe = h(B);
|
|
1823
|
+
if (pe) {
|
|
1824
|
+
alert(pe);
|
|
1811
1825
|
continue;
|
|
1812
1826
|
}
|
|
1813
1827
|
}
|
|
1814
|
-
const
|
|
1815
|
-
|
|
1828
|
+
const Z = await vr(B), G = y ? "uploading" : "success", de = y ? 0 : 100;
|
|
1829
|
+
q.push({
|
|
1816
1830
|
id: Math.random().toString(36).substr(2, 9),
|
|
1817
|
-
file:
|
|
1818
|
-
preview:
|
|
1819
|
-
progress:
|
|
1820
|
-
status:
|
|
1831
|
+
file: B,
|
|
1832
|
+
preview: Z,
|
|
1833
|
+
progress: de,
|
|
1834
|
+
status: G
|
|
1821
1835
|
});
|
|
1822
1836
|
}
|
|
1823
|
-
if (
|
|
1824
|
-
const
|
|
1825
|
-
if (
|
|
1826
|
-
|
|
1837
|
+
if (q.length > 0) {
|
|
1838
|
+
const B = e ? [...w, ...q] : q;
|
|
1839
|
+
if (M(B), x?.(B.map((H) => H.file)), y) {
|
|
1840
|
+
L(!0);
|
|
1827
1841
|
try {
|
|
1828
|
-
const
|
|
1829
|
-
...
|
|
1830
|
-
progress: Math.min(100, (
|
|
1842
|
+
const H = B.map((Z, G) => ({
|
|
1843
|
+
...Z,
|
|
1844
|
+
progress: Math.min(100, (G + 1) / B.length * 100)
|
|
1831
1845
|
}));
|
|
1832
|
-
|
|
1833
|
-
(
|
|
1834
|
-
...
|
|
1846
|
+
M(H), await y(H), M(
|
|
1847
|
+
(Z) => Z.map((G) => ({
|
|
1848
|
+
...G,
|
|
1835
1849
|
status: "success",
|
|
1836
1850
|
progress: 100
|
|
1837
1851
|
}))
|
|
1838
1852
|
);
|
|
1839
|
-
} catch (
|
|
1840
|
-
|
|
1841
|
-
(
|
|
1842
|
-
...
|
|
1853
|
+
} catch (H) {
|
|
1854
|
+
M(
|
|
1855
|
+
(Z) => Z.map((G) => ({
|
|
1856
|
+
...G,
|
|
1843
1857
|
status: "error",
|
|
1844
|
-
error:
|
|
1858
|
+
error: H instanceof Error ? H.message : D.uploadFailed
|
|
1845
1859
|
}))
|
|
1846
1860
|
);
|
|
1847
1861
|
} finally {
|
|
1848
|
-
|
|
1862
|
+
L(!1);
|
|
1849
1863
|
}
|
|
1850
1864
|
}
|
|
1851
1865
|
}
|
|
1852
1866
|
},
|
|
1853
1867
|
[
|
|
1854
|
-
|
|
1868
|
+
w,
|
|
1855
1869
|
l,
|
|
1856
1870
|
h,
|
|
1857
1871
|
D,
|
|
1858
1872
|
t,
|
|
1859
|
-
|
|
1873
|
+
n,
|
|
1860
1874
|
e,
|
|
1861
|
-
|
|
1862
|
-
|
|
1875
|
+
x,
|
|
1876
|
+
y
|
|
1863
1877
|
]
|
|
1864
|
-
), X =
|
|
1865
|
-
(
|
|
1866
|
-
|
|
1878
|
+
), X = R(
|
|
1879
|
+
(A) => {
|
|
1880
|
+
A.preventDefault(), o || k(!0);
|
|
1867
1881
|
},
|
|
1868
1882
|
[o]
|
|
1869
|
-
),
|
|
1870
|
-
|
|
1871
|
-
}, []),
|
|
1872
|
-
(
|
|
1873
|
-
if (
|
|
1874
|
-
const
|
|
1875
|
-
|
|
1883
|
+
), re = R((A) => {
|
|
1884
|
+
A.preventDefault(), k(!1);
|
|
1885
|
+
}, []), ne = R(
|
|
1886
|
+
(A) => {
|
|
1887
|
+
if (A.preventDefault(), k(!1), o) return;
|
|
1888
|
+
const C = A.dataTransfer.files;
|
|
1889
|
+
C.length > 0 && V(C);
|
|
1876
1890
|
},
|
|
1877
|
-
[o,
|
|
1878
|
-
),
|
|
1879
|
-
(
|
|
1880
|
-
const
|
|
1881
|
-
|
|
1891
|
+
[o, V]
|
|
1892
|
+
), le = R(
|
|
1893
|
+
(A) => {
|
|
1894
|
+
const C = A.target.files;
|
|
1895
|
+
C && C.length > 0 && (V(C), v.current && (v.current.value = ""));
|
|
1882
1896
|
},
|
|
1883
|
-
[
|
|
1884
|
-
),
|
|
1885
|
-
(
|
|
1886
|
-
|
|
1887
|
-
const
|
|
1888
|
-
return
|
|
1897
|
+
[V]
|
|
1898
|
+
), te = R(
|
|
1899
|
+
(A) => {
|
|
1900
|
+
F(A), M((C) => {
|
|
1901
|
+
const q = C.filter((B) => B.id !== A);
|
|
1902
|
+
return x?.(q.map((B) => B.file)), q;
|
|
1889
1903
|
});
|
|
1890
1904
|
},
|
|
1891
|
-
[
|
|
1892
|
-
),
|
|
1893
|
-
|
|
1894
|
-
}, [
|
|
1895
|
-
|
|
1905
|
+
[x, F]
|
|
1906
|
+
), ie = R(() => {
|
|
1907
|
+
$(), M([]), x?.([]);
|
|
1908
|
+
}, [x, $]), K = R(() => {
|
|
1909
|
+
v.current?.click();
|
|
1896
1910
|
}, []);
|
|
1897
|
-
return /* @__PURE__ */ d("div", { className: s("w-full",
|
|
1898
|
-
|
|
1911
|
+
return /* @__PURE__ */ d("div", { className: s("w-full", g), children: [
|
|
1912
|
+
a && /* @__PURE__ */ d(
|
|
1899
1913
|
"label",
|
|
1900
1914
|
{
|
|
1901
1915
|
className: s(
|
|
@@ -1903,8 +1917,8 @@ const Nn = {
|
|
|
1903
1917
|
c ? "text-red-600" : "text-slate-700"
|
|
1904
1918
|
),
|
|
1905
1919
|
children: [
|
|
1906
|
-
|
|
1907
|
-
|
|
1920
|
+
a,
|
|
1921
|
+
i && /* @__PURE__ */ r("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
|
|
1908
1922
|
]
|
|
1909
1923
|
}
|
|
1910
1924
|
),
|
|
@@ -1915,179 +1929,179 @@ const Nn = {
|
|
|
1915
1929
|
"group relative flex min-h-[180px] w-full cursor-pointer items-center justify-center rounded-2xl border border-dashed p-6 text-center transition-all duration-300",
|
|
1916
1930
|
m.dropBorder,
|
|
1917
1931
|
m.dropBg,
|
|
1918
|
-
|
|
1932
|
+
O && m.dropActive,
|
|
1919
1933
|
o && "cursor-not-allowed opacity-60",
|
|
1920
1934
|
c && "border-red-600 bg-red-50/30"
|
|
1921
1935
|
),
|
|
1922
1936
|
onDragOver: X,
|
|
1923
|
-
onDragLeave:
|
|
1924
|
-
onDrop:
|
|
1937
|
+
onDragLeave: re,
|
|
1938
|
+
onDrop: ne,
|
|
1925
1939
|
onClick: K,
|
|
1926
1940
|
children: [
|
|
1927
|
-
/* @__PURE__ */
|
|
1941
|
+
/* @__PURE__ */ r(
|
|
1928
1942
|
"input",
|
|
1929
1943
|
{
|
|
1930
|
-
ref:
|
|
1944
|
+
ref: v,
|
|
1931
1945
|
type: "file",
|
|
1932
1946
|
multiple: e,
|
|
1933
1947
|
accept: u,
|
|
1934
|
-
onChange:
|
|
1948
|
+
onChange: le,
|
|
1935
1949
|
disabled: o,
|
|
1936
1950
|
className: "hidden"
|
|
1937
1951
|
}
|
|
1938
1952
|
),
|
|
1939
1953
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-3", children: [
|
|
1940
|
-
/* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
1942
|
-
/* @__PURE__ */
|
|
1954
|
+
/* @__PURE__ */ r("div", { className: s("flex h-12 w-12 items-center justify-center rounded-xl", m.iconWrap), children: /* @__PURE__ */ r(Nt, { size: 20 }) }),
|
|
1955
|
+
/* @__PURE__ */ r("p", { className: s("text-base font-medium", m.title), children: D.dropHereTitle }),
|
|
1956
|
+
/* @__PURE__ */ r("p", { className: s("text-sm font-normal", m.hint), children: D.fileRequirements(e, l, n, b) })
|
|
1943
1957
|
] })
|
|
1944
1958
|
]
|
|
1945
1959
|
}
|
|
1946
1960
|
),
|
|
1947
|
-
|
|
1961
|
+
w.length > 0 && /* @__PURE__ */ d("div", { className: "mt-4 space-y-3", children: [
|
|
1948
1962
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
1949
1963
|
/* @__PURE__ */ d("span", { className: "text-sm font-medium text-slate-700", children: [
|
|
1950
1964
|
D.selectedFiles,
|
|
1951
1965
|
" (",
|
|
1952
|
-
|
|
1966
|
+
w.length,
|
|
1953
1967
|
")"
|
|
1954
1968
|
] }),
|
|
1955
|
-
|
|
1969
|
+
w.length > 1 && /* @__PURE__ */ r(
|
|
1956
1970
|
"button",
|
|
1957
1971
|
{
|
|
1958
1972
|
type: "button",
|
|
1959
|
-
onClick:
|
|
1973
|
+
onClick: ie,
|
|
1960
1974
|
disabled: o || f,
|
|
1961
1975
|
className: "text-sm font-medium text-red-600 disabled:opacity-50",
|
|
1962
1976
|
children: D.clearAll
|
|
1963
1977
|
}
|
|
1964
1978
|
)
|
|
1965
1979
|
] }),
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
const
|
|
1980
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: w.map((A) => {
|
|
1981
|
+
const q = !!A.preview ? m.fileIconImg : m.fileIconDoc, B = o || f || A.status === "uploading";
|
|
1968
1982
|
return /* @__PURE__ */ d(
|
|
1969
1983
|
"div",
|
|
1970
1984
|
{
|
|
1971
1985
|
className: s(
|
|
1972
1986
|
"flex items-center justify-between rounded-2xl border border-slate-200 p-4",
|
|
1973
|
-
|
|
1987
|
+
A.status === "error" && "border-red-600"
|
|
1974
1988
|
),
|
|
1975
1989
|
children: [
|
|
1976
1990
|
/* @__PURE__ */ d("div", { className: "flex min-w-0 items-center gap-4", children: [
|
|
1977
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ r(
|
|
1978
1992
|
"div",
|
|
1979
1993
|
{
|
|
1980
1994
|
className: s(
|
|
1981
1995
|
"flex h-14 w-14 items-center justify-center rounded-2xl",
|
|
1982
|
-
|
|
1996
|
+
q
|
|
1983
1997
|
),
|
|
1984
|
-
children: S &&
|
|
1998
|
+
children: S && A.preview ? /* @__PURE__ */ r(
|
|
1985
1999
|
"img",
|
|
1986
2000
|
{
|
|
1987
|
-
src:
|
|
1988
|
-
alt:
|
|
2001
|
+
src: A.preview,
|
|
2002
|
+
alt: A.file.name,
|
|
1989
2003
|
className: "h-10 w-10 rounded-xl object-cover"
|
|
1990
2004
|
}
|
|
1991
|
-
) :
|
|
2005
|
+
) : T ? gr(A.file) : /* @__PURE__ */ r(tt, { className: "h-6 w-6 text-slate-500" })
|
|
1992
2006
|
}
|
|
1993
2007
|
),
|
|
1994
2008
|
/* @__PURE__ */ d("div", { className: "min-w-0", children: [
|
|
1995
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ r("p", { className: "truncate text-lg font-semibold text-primary", children: A.file.name }),
|
|
1996
2010
|
/* @__PURE__ */ d("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-sm text-slate-500", children: [
|
|
1997
|
-
/* @__PURE__ */
|
|
1998
|
-
|
|
1999
|
-
/* @__PURE__ */
|
|
2011
|
+
/* @__PURE__ */ r("span", { children: xr(A.file.size) }),
|
|
2012
|
+
A.status === "uploading" && /* @__PURE__ */ d(he, { children: [
|
|
2013
|
+
/* @__PURE__ */ r("span", { children: "•" }),
|
|
2000
2014
|
/* @__PURE__ */ d("span", { className: "inline-flex items-center", children: [
|
|
2001
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ r(Qe, { className: "mr-1 h-5 w-5 animate-spin" }),
|
|
2002
2016
|
D.uploading
|
|
2003
2017
|
] })
|
|
2004
2018
|
] }),
|
|
2005
|
-
|
|
2006
|
-
/* @__PURE__ */
|
|
2007
|
-
/* @__PURE__ */
|
|
2019
|
+
A.status === "success" && /* @__PURE__ */ d(he, { children: [
|
|
2020
|
+
/* @__PURE__ */ r("span", { children: "•" }),
|
|
2021
|
+
/* @__PURE__ */ r("span", { className: "font-normal text-green-600", children: D.success })
|
|
2008
2022
|
] })
|
|
2009
2023
|
] }),
|
|
2010
|
-
|
|
2024
|
+
A.status === "uploading" && /* @__PURE__ */ r("div", { className: s("mt-2 h-1.5 w-full rounded-full bg-slate-200"), children: /* @__PURE__ */ r(
|
|
2011
2025
|
"div",
|
|
2012
2026
|
{
|
|
2013
2027
|
className: s(
|
|
2014
2028
|
"h-1.5 rounded-full transition-all duration-300",
|
|
2015
2029
|
m.progressFill
|
|
2016
2030
|
),
|
|
2017
|
-
style: { width: `${
|
|
2031
|
+
style: { width: `${A.progress}%` }
|
|
2018
2032
|
}
|
|
2019
2033
|
) }),
|
|
2020
|
-
|
|
2034
|
+
A.status === "error" && A.error && /* @__PURE__ */ r("p", { className: "mt-2 text-sm font-normal text-red-600", children: A.error })
|
|
2021
2035
|
] })
|
|
2022
2036
|
] }),
|
|
2023
2037
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
2024
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ r(
|
|
2025
2039
|
"button",
|
|
2026
2040
|
{
|
|
2027
2041
|
type: "button",
|
|
2028
|
-
onClick: (
|
|
2029
|
-
|
|
2042
|
+
onClick: (H) => {
|
|
2043
|
+
H.stopPropagation(), B || z(A);
|
|
2030
2044
|
},
|
|
2031
|
-
disabled:
|
|
2045
|
+
disabled: B,
|
|
2032
2046
|
className: "rounded-xl p-2 hover:bg-slate-100 hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2033
2047
|
title: D.preview,
|
|
2034
|
-
children: /* @__PURE__ */
|
|
2048
|
+
children: /* @__PURE__ */ r(et, { size: 20, className: "text-slate-400" })
|
|
2035
2049
|
}
|
|
2036
2050
|
),
|
|
2037
|
-
/* @__PURE__ */
|
|
2051
|
+
/* @__PURE__ */ r(
|
|
2038
2052
|
"button",
|
|
2039
2053
|
{
|
|
2040
2054
|
type: "button",
|
|
2041
|
-
onClick: (
|
|
2042
|
-
|
|
2055
|
+
onClick: (H) => {
|
|
2056
|
+
H.stopPropagation(), te(A.id);
|
|
2043
2057
|
},
|
|
2044
2058
|
disabled: o || f,
|
|
2045
2059
|
className: "rounded-xl p-2 text-slate-base hover:bg-slate-100 disabled:opacity-50 hover:cursor-pointer",
|
|
2046
2060
|
title: D.remove,
|
|
2047
|
-
children: /* @__PURE__ */
|
|
2061
|
+
children: /* @__PURE__ */ r(ge, { className: "h-6 w-6" })
|
|
2048
2062
|
}
|
|
2049
2063
|
)
|
|
2050
2064
|
] })
|
|
2051
2065
|
]
|
|
2052
2066
|
},
|
|
2053
|
-
|
|
2067
|
+
A.id
|
|
2054
2068
|
);
|
|
2055
2069
|
}) })
|
|
2056
2070
|
] }),
|
|
2057
|
-
c && /* @__PURE__ */
|
|
2071
|
+
c && /* @__PURE__ */ r("p", { className: "mt-2 text-sm font-normal text-red-600", children: c })
|
|
2058
2072
|
] });
|
|
2059
2073
|
};
|
|
2060
|
-
function
|
|
2074
|
+
function hn({
|
|
2061
2075
|
show: e,
|
|
2062
2076
|
setShow: t,
|
|
2063
|
-
title:
|
|
2077
|
+
title: n,
|
|
2064
2078
|
description: l,
|
|
2065
2079
|
Header: o,
|
|
2066
|
-
Body:
|
|
2067
|
-
footer:
|
|
2080
|
+
Body: a,
|
|
2081
|
+
footer: i,
|
|
2068
2082
|
handleClickOutside: c = !1,
|
|
2069
|
-
showCloseIcon:
|
|
2070
|
-
showHeader:
|
|
2071
|
-
overlayClassName:
|
|
2083
|
+
showCloseIcon: g = !0,
|
|
2084
|
+
showHeader: x = !0,
|
|
2085
|
+
overlayClassName: y,
|
|
2072
2086
|
containerClassName: S,
|
|
2073
|
-
bodyClassName:
|
|
2074
|
-
footerClassName:
|
|
2087
|
+
bodyClassName: I,
|
|
2088
|
+
footerClassName: T
|
|
2075
2089
|
}) {
|
|
2076
|
-
const E = ae(null), { handleEscape: h } =
|
|
2077
|
-
|
|
2078
|
-
const { handleClick:
|
|
2090
|
+
const E = ae(null), { handleEscape: h } = _e(() => t(!1));
|
|
2091
|
+
J(() => (e ? (document.addEventListener("keydown", h), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => document.removeEventListener("keydown", h)), [e, h]);
|
|
2092
|
+
const { handleClick: w } = Fe(E, () => {
|
|
2079
2093
|
c && t(!1);
|
|
2080
2094
|
});
|
|
2081
|
-
|
|
2082
|
-
const
|
|
2083
|
-
return /* @__PURE__ */
|
|
2095
|
+
J(() => (e && c && document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w)), [e, w, c]);
|
|
2096
|
+
const O = x && !!(o || n || l);
|
|
2097
|
+
return /* @__PURE__ */ r(
|
|
2084
2098
|
"div",
|
|
2085
2099
|
{
|
|
2086
2100
|
className: s(
|
|
2087
2101
|
"bg-black/40 fixed inset-0 z-50 flex justify-center transition-all duration-500 ease-in-out",
|
|
2088
2102
|
"items-end sm:items-center",
|
|
2089
2103
|
e ? "opacity-100" : "pointer-events-none opacity-0",
|
|
2090
|
-
|
|
2104
|
+
y
|
|
2091
2105
|
),
|
|
2092
2106
|
children: /* @__PURE__ */ d(
|
|
2093
2107
|
"div",
|
|
@@ -2102,43 +2116,43 @@ function mr({
|
|
|
2102
2116
|
S
|
|
2103
2117
|
),
|
|
2104
2118
|
children: [
|
|
2105
|
-
|
|
2119
|
+
O && /* @__PURE__ */ d("div", { className: "border-b border-slate-200 flex items-start justify-between p-4 sm:p-6 mb-4", children: [
|
|
2106
2120
|
o || /* @__PURE__ */ d("div", { className: "block", children: [
|
|
2107
|
-
/* @__PURE__ */
|
|
2108
|
-
l && /* @__PURE__ */
|
|
2121
|
+
/* @__PURE__ */ r("h2", { className: "text-h3 font-semibold text-black", children: n }),
|
|
2122
|
+
l && /* @__PURE__ */ r("p", { className: "text-base text-slate-base font-normal mt-2", children: l })
|
|
2109
2123
|
] }),
|
|
2110
|
-
|
|
2124
|
+
g && /* @__PURE__ */ r(
|
|
2111
2125
|
"button",
|
|
2112
2126
|
{
|
|
2113
2127
|
onClick: () => t(!1),
|
|
2114
2128
|
className: "bg-slate-100 rounded-xl w-12 h-12 hover:cursor-pointer text-black transition flex items-center justify-center group",
|
|
2115
2129
|
"aria-label": "Close modal",
|
|
2116
2130
|
type: "button",
|
|
2117
|
-
children: /* @__PURE__ */
|
|
2131
|
+
children: /* @__PURE__ */ r(ge, { className: "h-6 w-6 transition-transform duration-300 group-hover:rotate-180" })
|
|
2118
2132
|
}
|
|
2119
2133
|
)
|
|
2120
2134
|
] }),
|
|
2121
|
-
|
|
2135
|
+
a && /* @__PURE__ */ r(
|
|
2122
2136
|
"div",
|
|
2123
2137
|
{
|
|
2124
2138
|
className: s(
|
|
2125
2139
|
"scrollbar-thin scrollbar-thumb-slate-200 overflow-y-auto",
|
|
2126
2140
|
"max-h-[70dvh] sm:max-h-96",
|
|
2127
2141
|
"px-4 sm:px-6 mb-2",
|
|
2128
|
-
|
|
2142
|
+
I
|
|
2129
2143
|
),
|
|
2130
|
-
children:
|
|
2144
|
+
children: a
|
|
2131
2145
|
}
|
|
2132
2146
|
),
|
|
2133
|
-
|
|
2147
|
+
i && /* @__PURE__ */ r(
|
|
2134
2148
|
"div",
|
|
2135
2149
|
{
|
|
2136
2150
|
className: s(
|
|
2137
2151
|
"flex items-center justify-end gap-3 border-t border-slate-200",
|
|
2138
2152
|
"p-4 sm:p-6",
|
|
2139
|
-
|
|
2153
|
+
T
|
|
2140
2154
|
),
|
|
2141
|
-
children:
|
|
2155
|
+
children: i
|
|
2142
2156
|
}
|
|
2143
2157
|
)
|
|
2144
2158
|
]
|
|
@@ -2147,19 +2161,19 @@ function mr({
|
|
|
2147
2161
|
}
|
|
2148
2162
|
);
|
|
2149
2163
|
}
|
|
2150
|
-
function
|
|
2164
|
+
function kr(e, t, n) {
|
|
2151
2165
|
const l = [], o = t * 2 + 5;
|
|
2152
|
-
if (
|
|
2153
|
-
return Array.from({ length:
|
|
2154
|
-
const
|
|
2155
|
-
l.push(1),
|
|
2156
|
-
for (let c =
|
|
2157
|
-
return
|
|
2166
|
+
if (n <= o)
|
|
2167
|
+
return Array.from({ length: n }, (c, g) => g + 1);
|
|
2168
|
+
const a = Math.max(e - t, 2), i = Math.min(e + t, n - 1);
|
|
2169
|
+
l.push(1), a > 2 && l.push("...");
|
|
2170
|
+
for (let c = a; c <= i; c += 1) l.push(c);
|
|
2171
|
+
return i < n - 1 && l.push("..."), n > 1 && l.push(n), l;
|
|
2158
2172
|
}
|
|
2159
|
-
const
|
|
2173
|
+
const Cr = {
|
|
2160
2174
|
medium: "h-9 text-sm",
|
|
2161
2175
|
large: "h-10 text-base"
|
|
2162
|
-
},
|
|
2176
|
+
}, Sr = {
|
|
2163
2177
|
yellow: {
|
|
2164
2178
|
active: "bg-yellow-500 text-white border-yellow-500",
|
|
2165
2179
|
inactive: "bg-slate-100 border-slate-200 text-black hover:bg-slate-200",
|
|
@@ -2173,26 +2187,26 @@ const Cn = {
|
|
|
2173
2187
|
arrow: "text-black"
|
|
2174
2188
|
}
|
|
2175
2189
|
};
|
|
2176
|
-
function
|
|
2190
|
+
function pn({
|
|
2177
2191
|
totalItems: e,
|
|
2178
2192
|
currentPage: t,
|
|
2179
|
-
perPage:
|
|
2193
|
+
perPage: n,
|
|
2180
2194
|
onPageChange: l,
|
|
2181
2195
|
onPerPageChange: o,
|
|
2182
|
-
siblingCount:
|
|
2183
|
-
perPageOptions:
|
|
2196
|
+
siblingCount: a = 1,
|
|
2197
|
+
perPageOptions: i = [10, 30, 50, 100],
|
|
2184
2198
|
showPerPage: c = !0,
|
|
2185
|
-
variant:
|
|
2186
|
-
size:
|
|
2187
|
-
paginationClassName:
|
|
2199
|
+
variant: g = "yellow",
|
|
2200
|
+
size: x = "large",
|
|
2201
|
+
paginationClassName: y
|
|
2188
2202
|
}) {
|
|
2189
|
-
const S = Number.isFinite(e) && e > 0 ? e : 0,
|
|
2203
|
+
const S = Number.isFinite(e) && e > 0 ? e : 0, I = Number.isFinite(n) && n > 0 ? n : 10, T = Math.max(1, Number.isFinite(t) ? t : 1), E = Math.ceil(S / I), h = P(() => kr(T, a, E), [T, a, E]), w = Cr[x], M = Sr[g ?? "yellow"];
|
|
2190
2204
|
return E <= 1 || S === 0 ? null : /* @__PURE__ */ d("div", { className: s(
|
|
2191
2205
|
"flex items-center justify-between gap-4 w-full",
|
|
2192
|
-
|
|
2206
|
+
y
|
|
2193
2207
|
), children: [
|
|
2194
2208
|
c && o && /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
2195
|
-
/* @__PURE__ */
|
|
2209
|
+
/* @__PURE__ */ r(
|
|
2196
2210
|
"span",
|
|
2197
2211
|
{
|
|
2198
2212
|
className: "whitespace-nowrap text-extra-small text-slate-base font-normal",
|
|
@@ -2200,21 +2214,21 @@ function hr({
|
|
|
2200
2214
|
}
|
|
2201
2215
|
),
|
|
2202
2216
|
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
2203
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ r(
|
|
2204
2218
|
"select",
|
|
2205
2219
|
{
|
|
2206
|
-
value:
|
|
2207
|
-
onChange: (
|
|
2220
|
+
value: I,
|
|
2221
|
+
onChange: (O) => o(Number(O.target.value)),
|
|
2208
2222
|
className: s(
|
|
2209
2223
|
"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",
|
|
2210
|
-
|
|
2224
|
+
x === "large" ? "h-10" : "h-9"
|
|
2211
2225
|
),
|
|
2212
2226
|
"aria-label": "Количество строк на странице",
|
|
2213
|
-
children:
|
|
2227
|
+
children: i.map((O) => /* @__PURE__ */ r("option", { value: O, children: O }, O))
|
|
2214
2228
|
}
|
|
2215
2229
|
),
|
|
2216
|
-
/* @__PURE__ */
|
|
2217
|
-
|
|
2230
|
+
/* @__PURE__ */ r(
|
|
2231
|
+
Re,
|
|
2218
2232
|
{
|
|
2219
2233
|
className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-slate-400",
|
|
2220
2234
|
weight: "Linear",
|
|
@@ -2224,72 +2238,72 @@ function hr({
|
|
|
2224
2238
|
] })
|
|
2225
2239
|
] }),
|
|
2226
2240
|
/* @__PURE__ */ d("nav", { "aria-label": "Пагинация", className: "flex items-center gap-1 shrink-0 whitespace-nowrap", children: [
|
|
2227
|
-
/* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ r(
|
|
2228
2242
|
"button",
|
|
2229
2243
|
{
|
|
2230
|
-
onClick: () => l(
|
|
2231
|
-
disabled:
|
|
2244
|
+
onClick: () => l(T - 1),
|
|
2245
|
+
disabled: T === 1,
|
|
2232
2246
|
"aria-label": "Предыдущая страница",
|
|
2233
2247
|
className: s(
|
|
2234
2248
|
"flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
|
|
2235
|
-
|
|
2236
|
-
|
|
2249
|
+
w,
|
|
2250
|
+
T === 1 ? s("cursor-not-allowed opacity-50", M.disabled) : s("hover:cursor-pointer", M.arrow, "border-slate-200")
|
|
2237
2251
|
),
|
|
2238
|
-
children: /* @__PURE__ */
|
|
2252
|
+
children: /* @__PURE__ */ r(Me, { weight: "Linear", size: 20 })
|
|
2239
2253
|
}
|
|
2240
2254
|
),
|
|
2241
|
-
/* @__PURE__ */
|
|
2242
|
-
if (
|
|
2243
|
-
return /* @__PURE__ */
|
|
2255
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: h.map((O, k) => {
|
|
2256
|
+
if (O === "...")
|
|
2257
|
+
return /* @__PURE__ */ r(
|
|
2244
2258
|
"span",
|
|
2245
2259
|
{
|
|
2246
|
-
className: s("flex items-center justify-center text-black font-medium min-w-10",
|
|
2260
|
+
className: s("flex items-center justify-center text-black font-medium min-w-10", w),
|
|
2247
2261
|
"aria-hidden": "true",
|
|
2248
|
-
children: /* @__PURE__ */
|
|
2262
|
+
children: /* @__PURE__ */ r(kt, { weight: "Bold", size: 20 })
|
|
2249
2263
|
},
|
|
2250
|
-
|
|
2264
|
+
k
|
|
2251
2265
|
);
|
|
2252
|
-
const f =
|
|
2253
|
-
return /* @__PURE__ */
|
|
2266
|
+
const f = O === T;
|
|
2267
|
+
return /* @__PURE__ */ r(
|
|
2254
2268
|
"button",
|
|
2255
2269
|
{
|
|
2256
|
-
onClick: () => l(
|
|
2257
|
-
"aria-label": `Страница ${
|
|
2270
|
+
onClick: () => l(O),
|
|
2271
|
+
"aria-label": `Страница ${O}${f ? ", текущая" : ""}`,
|
|
2258
2272
|
"aria-current": f ? "page" : void 0,
|
|
2259
2273
|
className: s(
|
|
2260
2274
|
"flex items-center justify-center rounded-lg border font-medium transition-all hover:cursor-pointer min-w-10 px-2",
|
|
2261
|
-
|
|
2262
|
-
f ?
|
|
2275
|
+
w,
|
|
2276
|
+
f ? M.active : M.inactive
|
|
2263
2277
|
),
|
|
2264
|
-
children:
|
|
2278
|
+
children: O
|
|
2265
2279
|
},
|
|
2266
|
-
|
|
2280
|
+
k
|
|
2267
2281
|
);
|
|
2268
2282
|
}) }),
|
|
2269
|
-
/* @__PURE__ */
|
|
2283
|
+
/* @__PURE__ */ r(
|
|
2270
2284
|
"button",
|
|
2271
2285
|
{
|
|
2272
|
-
onClick: () => l(
|
|
2273
|
-
disabled:
|
|
2286
|
+
onClick: () => l(T + 1),
|
|
2287
|
+
disabled: T === E,
|
|
2274
2288
|
"aria-label": "Следующая страница",
|
|
2275
2289
|
className: s(
|
|
2276
2290
|
"flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
|
|
2277
|
-
|
|
2278
|
-
|
|
2291
|
+
w,
|
|
2292
|
+
T === E ? s("cursor-not-allowed opacity-50", M.disabled) : s("hover:cursor-pointer", M.arrow, "border-slate-200")
|
|
2279
2293
|
),
|
|
2280
|
-
children: /* @__PURE__ */
|
|
2294
|
+
children: /* @__PURE__ */ r(Ne, { size: 20, weight: "Linear" })
|
|
2281
2295
|
}
|
|
2282
2296
|
)
|
|
2283
2297
|
] })
|
|
2284
2298
|
] });
|
|
2285
2299
|
}
|
|
2286
|
-
function
|
|
2300
|
+
function Ze({
|
|
2287
2301
|
className: e,
|
|
2288
2302
|
variant: t = "default",
|
|
2289
|
-
width:
|
|
2303
|
+
width: n = "100%",
|
|
2290
2304
|
height: l = "1rem"
|
|
2291
2305
|
}) {
|
|
2292
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ r(
|
|
2293
2307
|
"div",
|
|
2294
2308
|
{
|
|
2295
2309
|
className: s(
|
|
@@ -2300,59 +2314,59 @@ function Ve({
|
|
|
2300
2314
|
e
|
|
2301
2315
|
),
|
|
2302
2316
|
style: {
|
|
2303
|
-
width: typeof
|
|
2317
|
+
width: typeof n == "number" ? `${n}px` : n,
|
|
2304
2318
|
height: typeof l == "number" ? `${l}px` : l
|
|
2305
2319
|
},
|
|
2306
|
-
children: /* @__PURE__ */
|
|
2320
|
+
children: /* @__PURE__ */ r("div", { className: "shimmer-mask absolute inset-0" })
|
|
2307
2321
|
}
|
|
2308
2322
|
);
|
|
2309
2323
|
}
|
|
2310
|
-
const
|
|
2324
|
+
const Er = {
|
|
2311
2325
|
top: "flex-col",
|
|
2312
2326
|
bottom: "flex-col-reverse",
|
|
2313
2327
|
left: "flex-row",
|
|
2314
2328
|
right: "flex-row-reverse"
|
|
2315
|
-
},
|
|
2329
|
+
}, Dr = {
|
|
2316
2330
|
top: "flex-row",
|
|
2317
2331
|
bottom: "flex-row",
|
|
2318
2332
|
left: "flex-col",
|
|
2319
2333
|
right: "flex-col"
|
|
2320
|
-
},
|
|
2334
|
+
}, Ar = {
|
|
2321
2335
|
top: "mt-4",
|
|
2322
2336
|
bottom: "mb-4",
|
|
2323
2337
|
left: "ml-4",
|
|
2324
2338
|
right: "mr-4"
|
|
2325
2339
|
};
|
|
2326
|
-
function
|
|
2340
|
+
function bn({
|
|
2327
2341
|
tabs: e,
|
|
2328
2342
|
defaultTab: t,
|
|
2329
|
-
position:
|
|
2343
|
+
position: n = "top",
|
|
2330
2344
|
className: l,
|
|
2331
2345
|
tabListClassName: o,
|
|
2332
|
-
contentClassName:
|
|
2333
|
-
extra:
|
|
2346
|
+
contentClassName: a,
|
|
2347
|
+
extra: i,
|
|
2334
2348
|
onChange: c
|
|
2335
2349
|
}) {
|
|
2336
|
-
const [
|
|
2350
|
+
const [g, x] = W(t || e[0]?.id), [y, S] = W({}), I = ae([]), T = R(() => {
|
|
2337
2351
|
requestAnimationFrame(() => {
|
|
2338
|
-
const h = e.findIndex((
|
|
2339
|
-
if (
|
|
2340
|
-
const { offsetLeft:
|
|
2352
|
+
const h = e.findIndex((M) => M?.id === g), w = I.current[h];
|
|
2353
|
+
if (w) {
|
|
2354
|
+
const { offsetLeft: M, offsetTop: O, offsetWidth: k, offsetHeight: f } = w;
|
|
2341
2355
|
S({
|
|
2342
|
-
left: `${
|
|
2343
|
-
top: `${
|
|
2344
|
-
width: `${
|
|
2356
|
+
left: `${M}px`,
|
|
2357
|
+
top: `${O}px`,
|
|
2358
|
+
width: `${k}px`,
|
|
2345
2359
|
height: `${f}px`,
|
|
2346
2360
|
transition: "all 0.35s cubic-bezier(0.25, 1, 0.5, 1)"
|
|
2347
2361
|
});
|
|
2348
2362
|
}
|
|
2349
2363
|
});
|
|
2350
|
-
}, [
|
|
2351
|
-
|
|
2352
|
-
|
|
2364
|
+
}, [g, e]);
|
|
2365
|
+
J(() => (T(), window.addEventListener("resize", T), "fonts" in document && document.fonts.ready.then(T), () => window.removeEventListener("resize", T)), [n, T]), J(() => {
|
|
2366
|
+
I.current = I.current.slice(0, e.length);
|
|
2353
2367
|
}, [e]);
|
|
2354
|
-
const E =
|
|
2355
|
-
return /* @__PURE__ */ d("div", { className: s("flex w-full",
|
|
2368
|
+
const E = n === "left" || n === "right";
|
|
2369
|
+
return /* @__PURE__ */ d("div", { className: s("flex w-full", Er[n], l), children: [
|
|
2356
2370
|
/* @__PURE__ */ d(
|
|
2357
2371
|
"div",
|
|
2358
2372
|
{
|
|
@@ -2361,7 +2375,7 @@ function pr({
|
|
|
2361
2375
|
E ? "flex-col items-start" : "flex-row flex-wrap items-center"
|
|
2362
2376
|
),
|
|
2363
2377
|
children: [
|
|
2364
|
-
/* @__PURE__ */
|
|
2378
|
+
/* @__PURE__ */ r(
|
|
2365
2379
|
"div",
|
|
2366
2380
|
{
|
|
2367
2381
|
className: s(
|
|
@@ -2373,29 +2387,29 @@ function pr({
|
|
|
2373
2387
|
{
|
|
2374
2388
|
className: s(
|
|
2375
2389
|
"relative flex rounded-xl bg-slate-100 p-1",
|
|
2376
|
-
|
|
2390
|
+
Dr[n],
|
|
2377
2391
|
!E && "w-full overflow-hidden",
|
|
2378
2392
|
E ? "min-w-48" : "",
|
|
2379
2393
|
o
|
|
2380
2394
|
),
|
|
2381
2395
|
children: [
|
|
2382
|
-
/* @__PURE__ */
|
|
2396
|
+
/* @__PURE__ */ r(
|
|
2383
2397
|
"div",
|
|
2384
2398
|
{
|
|
2385
2399
|
className: s("absolute rounded-lg bg-white", E ? "w-full" : "h-full"),
|
|
2386
|
-
style:
|
|
2400
|
+
style: y
|
|
2387
2401
|
}
|
|
2388
2402
|
),
|
|
2389
|
-
e?.map((h,
|
|
2390
|
-
const
|
|
2403
|
+
e?.map((h, w) => {
|
|
2404
|
+
const M = g === h.id;
|
|
2391
2405
|
return /* @__PURE__ */ d(
|
|
2392
2406
|
"button",
|
|
2393
2407
|
{
|
|
2394
|
-
ref: (
|
|
2395
|
-
|
|
2408
|
+
ref: (O) => {
|
|
2409
|
+
I.current[w] = O;
|
|
2396
2410
|
},
|
|
2397
2411
|
onClick: () => {
|
|
2398
|
-
h?.disabled || (
|
|
2412
|
+
h?.disabled || (x(h?.id), c?.(h?.id));
|
|
2399
2413
|
},
|
|
2400
2414
|
disabled: h?.disabled,
|
|
2401
2415
|
className: s(
|
|
@@ -2404,8 +2418,8 @@ function pr({
|
|
|
2404
2418
|
E ? "w-full justify-start" : "flex-1 min-w-0"
|
|
2405
2419
|
),
|
|
2406
2420
|
children: [
|
|
2407
|
-
h?.icon && /* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
2421
|
+
h?.icon && /* @__PURE__ */ r("span", { className: s("shrink-0 transition-transform duration-200", M && "scale-110"), children: h?.icon }),
|
|
2422
|
+
/* @__PURE__ */ r("span", { className: "relative z-10 truncate", title: h?.label, children: h?.label })
|
|
2409
2423
|
]
|
|
2410
2424
|
},
|
|
2411
2425
|
h?.id
|
|
@@ -2416,100 +2430,100 @@ function pr({
|
|
|
2416
2430
|
)
|
|
2417
2431
|
}
|
|
2418
2432
|
),
|
|
2419
|
-
|
|
2433
|
+
i && /* @__PURE__ */ r(
|
|
2420
2434
|
"div",
|
|
2421
2435
|
{
|
|
2422
2436
|
className: s(
|
|
2423
2437
|
"shrink-0 ml-auto",
|
|
2424
2438
|
E ? "w-full" : "max-w-full"
|
|
2425
2439
|
),
|
|
2426
|
-
children: /* @__PURE__ */
|
|
2440
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center justify-end gap-2", children: i })
|
|
2427
2441
|
}
|
|
2428
2442
|
)
|
|
2429
2443
|
]
|
|
2430
2444
|
}
|
|
2431
2445
|
),
|
|
2432
|
-
/* @__PURE__ */
|
|
2446
|
+
/* @__PURE__ */ r("div", { className: s("w-full flex-1 overflow-hidden", Ar[n], a), children: /* @__PURE__ */ r("div", { className: "animate-fade-in w-full", style: { animationDuration: "0.35s" }, children: e?.find((h) => h.id === g)?.content }, g) })
|
|
2433
2447
|
] });
|
|
2434
2448
|
}
|
|
2435
|
-
const
|
|
2449
|
+
const Mr = {
|
|
2436
2450
|
sm: "px-2 py-0.5",
|
|
2437
2451
|
md: "px-2 py-1",
|
|
2438
2452
|
lg: "px-3 py-2"
|
|
2439
|
-
},
|
|
2453
|
+
}, Xe = {
|
|
2440
2454
|
sm: "w-3 h-3",
|
|
2441
2455
|
md: "w-3 h-3",
|
|
2442
2456
|
lg: "w-3 h-3"
|
|
2443
|
-
},
|
|
2457
|
+
}, Tr = {
|
|
2444
2458
|
success: "bg-green-50 text-green-600",
|
|
2445
2459
|
warning: "bg-orange-50 text-orange-600",
|
|
2446
2460
|
error: "bg-red-50 text-red-600",
|
|
2447
2461
|
gray: "bg-slate-200 text-slate-700",
|
|
2448
2462
|
blue: "bg-blue-50 text-blue-600"
|
|
2449
2463
|
};
|
|
2450
|
-
function
|
|
2464
|
+
function gn({
|
|
2451
2465
|
children: e,
|
|
2452
2466
|
variant: t = "success",
|
|
2453
|
-
size:
|
|
2467
|
+
size: n = "lg",
|
|
2454
2468
|
icon: l,
|
|
2455
2469
|
iconPosition: o = "left",
|
|
2456
|
-
className:
|
|
2470
|
+
className: a
|
|
2457
2471
|
}) {
|
|
2458
2472
|
return /* @__PURE__ */ d(
|
|
2459
2473
|
"span",
|
|
2460
2474
|
{
|
|
2461
2475
|
className: s(
|
|
2462
2476
|
"inline-flex animate-[fadeIn_0.3s_ease-out] items-center rounded-lg text-extra-small font-medium",
|
|
2463
|
-
|
|
2464
|
-
|
|
2477
|
+
Mr[n],
|
|
2478
|
+
Tr[t],
|
|
2465
2479
|
l && "gap-[2px]",
|
|
2466
|
-
|
|
2480
|
+
a
|
|
2467
2481
|
),
|
|
2468
2482
|
children: [
|
|
2469
|
-
l && o === "left" && /* @__PURE__ */
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
l && o === "right" && /* @__PURE__ */
|
|
2483
|
+
l && o === "left" && /* @__PURE__ */ r("span", { className: `flex items-center ${s(Xe[n])}`, children: l }),
|
|
2484
|
+
/* @__PURE__ */ r("span", { children: e }),
|
|
2485
|
+
l && o === "right" && /* @__PURE__ */ r("span", { className: `flex items-center ${s(Xe[n])}`, children: l })
|
|
2472
2486
|
]
|
|
2473
2487
|
}
|
|
2474
2488
|
);
|
|
2475
2489
|
}
|
|
2476
|
-
const
|
|
2490
|
+
const Ir = be(
|
|
2477
2491
|
({
|
|
2478
2492
|
label: e,
|
|
2479
2493
|
placeholder: t,
|
|
2480
|
-
value:
|
|
2494
|
+
value: n = "",
|
|
2481
2495
|
onChange: l,
|
|
2482
2496
|
required: o = !1,
|
|
2483
|
-
disabled:
|
|
2484
|
-
error:
|
|
2497
|
+
disabled: a = !1,
|
|
2498
|
+
error: i,
|
|
2485
2499
|
className: c,
|
|
2486
|
-
rows:
|
|
2487
|
-
name:
|
|
2488
|
-
},
|
|
2489
|
-
const S =
|
|
2500
|
+
rows: g = 4,
|
|
2501
|
+
name: x
|
|
2502
|
+
}, y) => {
|
|
2503
|
+
const S = P(() => i ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [i]);
|
|
2490
2504
|
return /* @__PURE__ */ d("div", { className: s("relative w-full", c), children: [
|
|
2491
2505
|
e && /* @__PURE__ */ d(
|
|
2492
2506
|
"label",
|
|
2493
2507
|
{
|
|
2494
2508
|
className: s(
|
|
2495
2509
|
"mb-2 block text-base font-medium",
|
|
2496
|
-
|
|
2510
|
+
i ? "text-red-600" : "text-slate-700"
|
|
2497
2511
|
),
|
|
2498
2512
|
children: [
|
|
2499
2513
|
e,
|
|
2500
|
-
o && /* @__PURE__ */
|
|
2514
|
+
o && /* @__PURE__ */ r("span", { className: "ml-1 text-red-600", children: "*" })
|
|
2501
2515
|
]
|
|
2502
2516
|
}
|
|
2503
2517
|
),
|
|
2504
|
-
/* @__PURE__ */
|
|
2518
|
+
/* @__PURE__ */ r(
|
|
2505
2519
|
"textarea",
|
|
2506
2520
|
{
|
|
2507
|
-
ref:
|
|
2508
|
-
name:
|
|
2509
|
-
rows:
|
|
2510
|
-
value:
|
|
2511
|
-
onChange: (
|
|
2512
|
-
disabled:
|
|
2521
|
+
ref: y,
|
|
2522
|
+
name: x,
|
|
2523
|
+
rows: g,
|
|
2524
|
+
value: n,
|
|
2525
|
+
onChange: (I) => l?.(I.target.value),
|
|
2526
|
+
disabled: a,
|
|
2513
2527
|
placeholder: t,
|
|
2514
2528
|
className: s(
|
|
2515
2529
|
"w-full resize-none rounded-xl border bg-white text-base font-normal transition-all duration-300 ease-in-out outline-none",
|
|
@@ -2518,18 +2532,18 @@ const In = he(
|
|
|
2518
2532
|
)
|
|
2519
2533
|
}
|
|
2520
2534
|
),
|
|
2521
|
-
|
|
2535
|
+
i && /* @__PURE__ */ r("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: i })
|
|
2522
2536
|
] });
|
|
2523
2537
|
}
|
|
2524
2538
|
);
|
|
2525
|
-
|
|
2526
|
-
const
|
|
2527
|
-
success: /* @__PURE__ */
|
|
2528
|
-
error: /* @__PURE__ */
|
|
2529
|
-
warning: /* @__PURE__ */
|
|
2530
|
-
info: /* @__PURE__ */
|
|
2531
|
-
loading: /* @__PURE__ */
|
|
2532
|
-
},
|
|
2539
|
+
Ir.displayName = "MciTextarea";
|
|
2540
|
+
const Fr = {
|
|
2541
|
+
success: /* @__PURE__ */ r(At, { weight: "Bold", className: "w-5 h-5" }),
|
|
2542
|
+
error: /* @__PURE__ */ r(Dt, { weight: "Bold", className: "w-5 h-5" }),
|
|
2543
|
+
warning: /* @__PURE__ */ r(Et, { weight: "Bold", className: "w-5 h-5" }),
|
|
2544
|
+
info: /* @__PURE__ */ r(St, { weight: "Bold", className: "w-5 h-5" }),
|
|
2545
|
+
loading: /* @__PURE__ */ r(Ct, { weight: "Bold", className: "w-5 h-5 animate-spin" })
|
|
2546
|
+
}, Ae = {
|
|
2533
2547
|
bg: {
|
|
2534
2548
|
success: "bg-green-50",
|
|
2535
2549
|
error: "bg-red-50",
|
|
@@ -2559,70 +2573,70 @@ const Fn = {
|
|
|
2559
2573
|
loading: "text-slate-600"
|
|
2560
2574
|
}
|
|
2561
2575
|
};
|
|
2562
|
-
function
|
|
2576
|
+
function Lr() {
|
|
2563
2577
|
let e = document.getElementById("mci-toast-container");
|
|
2564
2578
|
return e || (e = document.createElement("div"), e.id = "mci-toast-container", e.className = "fixed top-4 right-4 z-[9999] flex flex-col gap-3 pointer-events-none", document.body.appendChild(e)), e;
|
|
2565
2579
|
}
|
|
2566
|
-
const
|
|
2567
|
-
let
|
|
2568
|
-
const
|
|
2569
|
-
|
|
2570
|
-
/* @__PURE__ */
|
|
2580
|
+
const jr = Lr();
|
|
2581
|
+
let Oe = null, Or = 0;
|
|
2582
|
+
const Te = [], Ke = () => {
|
|
2583
|
+
Oe || (Oe = jt(jr)), Oe.render(
|
|
2584
|
+
/* @__PURE__ */ r("div", { className: "flex flex-col gap-3", children: Te.map(({ id: e, element: t }) => /* @__PURE__ */ r("div", { className: "pointer-events-auto", children: t }, e)) })
|
|
2571
2585
|
);
|
|
2572
2586
|
};
|
|
2573
|
-
function
|
|
2587
|
+
function $r({
|
|
2574
2588
|
title: e,
|
|
2575
2589
|
description: t,
|
|
2576
|
-
type:
|
|
2590
|
+
type: n = "info",
|
|
2577
2591
|
duration: l = 3e3,
|
|
2578
2592
|
action: o,
|
|
2579
|
-
onClose:
|
|
2593
|
+
onClose: a
|
|
2580
2594
|
}) {
|
|
2581
|
-
const [
|
|
2582
|
-
return
|
|
2595
|
+
const [i, c] = W(100);
|
|
2596
|
+
return J(() => {
|
|
2583
2597
|
if (l === 1 / 0) {
|
|
2584
2598
|
c(100);
|
|
2585
2599
|
return;
|
|
2586
2600
|
}
|
|
2587
|
-
let
|
|
2588
|
-
const
|
|
2589
|
-
|
|
2590
|
-
const
|
|
2591
|
-
c(
|
|
2592
|
-
},
|
|
2593
|
-
return () => cancelAnimationFrame(
|
|
2594
|
-
}, [l,
|
|
2601
|
+
let g = null;
|
|
2602
|
+
const x = (S) => {
|
|
2603
|
+
g || (g = S);
|
|
2604
|
+
const I = S - g, T = Math.max(0, (l - I) / l * 100);
|
|
2605
|
+
c(T), T > 0 ? requestAnimationFrame(x) : a?.();
|
|
2606
|
+
}, y = requestAnimationFrame(x);
|
|
2607
|
+
return () => cancelAnimationFrame(y);
|
|
2608
|
+
}, [l, a]), /* @__PURE__ */ d(
|
|
2595
2609
|
"div",
|
|
2596
2610
|
{
|
|
2597
2611
|
className: s(
|
|
2598
2612
|
"relative w-[300px] max-w-full overflow-hidden shadow-md rounded-lg",
|
|
2599
2613
|
"animate-in fade-in slide-in-from-top-2 duration-300",
|
|
2600
|
-
|
|
2614
|
+
Ae.bg[n]
|
|
2601
2615
|
),
|
|
2602
2616
|
children: [
|
|
2603
|
-
/* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ r(
|
|
2604
2618
|
"div",
|
|
2605
2619
|
{
|
|
2606
|
-
className: s("absolute bottom-0 left-0 h-1",
|
|
2620
|
+
className: s("absolute bottom-0 left-0 h-1", Ae.line[n]),
|
|
2607
2621
|
style: {
|
|
2608
|
-
width: `${
|
|
2622
|
+
width: `${i}%`,
|
|
2609
2623
|
transition: "none"
|
|
2610
2624
|
}
|
|
2611
2625
|
}
|
|
2612
2626
|
),
|
|
2613
|
-
/* @__PURE__ */
|
|
2614
|
-
/* @__PURE__ */
|
|
2627
|
+
/* @__PURE__ */ r("div", { className: "p-4", children: /* @__PURE__ */ d("div", { className: "flex items-start gap-2", children: [
|
|
2628
|
+
/* @__PURE__ */ r("div", { className: s("flex-shrink-0", Ae.text[n]), children: Fr[n] }),
|
|
2615
2629
|
/* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: [
|
|
2616
|
-
/* @__PURE__ */
|
|
2617
|
-
t && /* @__PURE__ */
|
|
2618
|
-
o && /* @__PURE__ */
|
|
2630
|
+
/* @__PURE__ */ r("h4", { className: "text-base font-medium mb-1", children: e }),
|
|
2631
|
+
t && /* @__PURE__ */ r("p", { className: "text-sm text-[#82828C]", children: t }),
|
|
2632
|
+
o && /* @__PURE__ */ r("div", { className: "mt-3", children: /* @__PURE__ */ r("div", { className: s("underline font-medium text-sm", Ae.action[n]), children: o }) })
|
|
2619
2633
|
] }),
|
|
2620
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ r(
|
|
2621
2635
|
"button",
|
|
2622
2636
|
{
|
|
2623
|
-
onClick:
|
|
2637
|
+
onClick: a,
|
|
2624
2638
|
className: "flex-shrink-0 rounded-full transition cursor-pointer active:animate-spin",
|
|
2625
|
-
children: /* @__PURE__ */
|
|
2639
|
+
children: /* @__PURE__ */ r(ge, { className: "w-6 h-6 text-slate-base" })
|
|
2626
2640
|
}
|
|
2627
2641
|
)
|
|
2628
2642
|
] }) })
|
|
@@ -2630,50 +2644,50 @@ function zn({
|
|
|
2630
2644
|
}
|
|
2631
2645
|
);
|
|
2632
2646
|
}
|
|
2633
|
-
const
|
|
2634
|
-
const t =
|
|
2635
|
-
const o =
|
|
2636
|
-
o !== -1 && (
|
|
2637
|
-
}, l = /* @__PURE__ */
|
|
2638
|
-
return
|
|
2639
|
-
},
|
|
2640
|
-
success: (e, t,
|
|
2647
|
+
const xe = (e) => {
|
|
2648
|
+
const t = Or++, n = () => {
|
|
2649
|
+
const o = Te.findIndex((a) => a?.id === t);
|
|
2650
|
+
o !== -1 && (Te.splice(o, 1), Ke());
|
|
2651
|
+
}, l = /* @__PURE__ */ r($r, { ...e, onClose: n });
|
|
2652
|
+
return Te.push({ id: t, element: l }), Ke(), e.duration !== 1 / 0 && setTimeout(n, (e.duration || 3e3) + 300), { close: n };
|
|
2653
|
+
}, xn = {
|
|
2654
|
+
success: (e, t, n) => xe(typeof e == "string" ? { title: e, description: t, type: "success", action: n } : {
|
|
2641
2655
|
...e,
|
|
2642
2656
|
type: "success"
|
|
2643
2657
|
}),
|
|
2644
|
-
error: (e, t,
|
|
2658
|
+
error: (e, t, n) => xe(typeof e == "string" ? { title: e, description: t, type: "error", action: n } : {
|
|
2645
2659
|
...e,
|
|
2646
2660
|
type: "error"
|
|
2647
2661
|
}),
|
|
2648
|
-
warning: (e, t,
|
|
2662
|
+
warning: (e, t, n) => xe(typeof e == "string" ? { title: e, description: t, type: "warning", action: n } : {
|
|
2649
2663
|
...e,
|
|
2650
2664
|
type: "warning"
|
|
2651
2665
|
}),
|
|
2652
|
-
info: (e, t,
|
|
2666
|
+
info: (e, t, n) => xe(typeof e == "string" ? { title: e, description: t, type: "info", action: n } : {
|
|
2653
2667
|
...e,
|
|
2654
2668
|
type: "info"
|
|
2655
2669
|
}),
|
|
2656
|
-
loading: (e, t) =>
|
|
2670
|
+
loading: (e, t) => xe(typeof e == "string" ? {
|
|
2657
2671
|
title: e,
|
|
2658
2672
|
description: t,
|
|
2659
2673
|
type: "loading",
|
|
2660
2674
|
duration: 1 / 0
|
|
2661
2675
|
} : { ...e, type: "loading", duration: 1 / 0 })
|
|
2662
|
-
},
|
|
2676
|
+
}, Rr = {
|
|
2663
2677
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
2664
2678
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
2665
2679
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
2666
2680
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
2667
|
-
},
|
|
2681
|
+
}, _r = {
|
|
2668
2682
|
top: "left-1/2 -translate-x-1/2 top-full",
|
|
2669
2683
|
bottom: "left-1/2 -translate-x-1/2 bottom-full",
|
|
2670
2684
|
left: "top-1/2 -translate-y-1/2 left-full",
|
|
2671
2685
|
right: "top-1/2 -translate-y-1/2 right-full"
|
|
2672
2686
|
};
|
|
2673
|
-
function
|
|
2687
|
+
function wn({
|
|
2674
2688
|
content: e,
|
|
2675
2689
|
children: t,
|
|
2676
|
-
position:
|
|
2690
|
+
position: n = "top",
|
|
2677
2691
|
delay: l = 200,
|
|
2678
2692
|
className: o
|
|
2679
2693
|
}) {
|
|
@@ -2686,18 +2700,18 @@ function xr({
|
|
|
2686
2700
|
"absolute z-50 rounded-md bg-slate-400 px-2 py-1 text-xs whitespace-nowrap text-white shadow-md",
|
|
2687
2701
|
"scale-95 opacity-0 transition-all group-hover:scale-100 group-hover:opacity-100",
|
|
2688
2702
|
"duration-200 ease-out group-hover:delay-200",
|
|
2689
|
-
|
|
2703
|
+
Rr[n],
|
|
2690
2704
|
o
|
|
2691
2705
|
),
|
|
2692
2706
|
style: { transitionDelay: `${l}ms` },
|
|
2693
2707
|
children: [
|
|
2694
2708
|
e,
|
|
2695
|
-
/* @__PURE__ */
|
|
2709
|
+
/* @__PURE__ */ r(
|
|
2696
2710
|
"span",
|
|
2697
2711
|
{
|
|
2698
2712
|
className: s(
|
|
2699
2713
|
"absolute h-2 w-2 rotate-45 bg-slate-400",
|
|
2700
|
-
|
|
2714
|
+
_r[n]
|
|
2701
2715
|
)
|
|
2702
2716
|
}
|
|
2703
2717
|
)
|
|
@@ -2706,7 +2720,7 @@ function xr({
|
|
|
2706
2720
|
)
|
|
2707
2721
|
] });
|
|
2708
2722
|
}
|
|
2709
|
-
const
|
|
2723
|
+
const $e = {
|
|
2710
2724
|
blue: {
|
|
2711
2725
|
active: "bg-blue-600",
|
|
2712
2726
|
hover: "hover:bg-blue-600",
|
|
@@ -2718,40 +2732,40 @@ const Le = {
|
|
|
2718
2732
|
focus: "focus:ring-2 focus:ring-yellow-200"
|
|
2719
2733
|
}
|
|
2720
2734
|
};
|
|
2721
|
-
function
|
|
2735
|
+
function yn({
|
|
2722
2736
|
checked: e = !1,
|
|
2723
2737
|
onChange: t,
|
|
2724
|
-
disabled:
|
|
2738
|
+
disabled: n = !1,
|
|
2725
2739
|
variant: l = "yellow",
|
|
2726
2740
|
label: o,
|
|
2727
|
-
supportText:
|
|
2728
|
-
className:
|
|
2741
|
+
supportText: a,
|
|
2742
|
+
className: i
|
|
2729
2743
|
}) {
|
|
2730
2744
|
const c = () => {
|
|
2731
|
-
|
|
2745
|
+
n || t?.(!e);
|
|
2732
2746
|
};
|
|
2733
2747
|
return /* @__PURE__ */ d(
|
|
2734
2748
|
"div",
|
|
2735
2749
|
{
|
|
2736
2750
|
className: s(
|
|
2737
2751
|
"flex items-start gap-3 select-none",
|
|
2738
|
-
|
|
2752
|
+
i
|
|
2739
2753
|
),
|
|
2740
2754
|
children: [
|
|
2741
|
-
/* @__PURE__ */
|
|
2755
|
+
/* @__PURE__ */ r(
|
|
2742
2756
|
"button",
|
|
2743
2757
|
{
|
|
2744
2758
|
type: "button",
|
|
2745
|
-
disabled:
|
|
2759
|
+
disabled: n,
|
|
2746
2760
|
className: s(
|
|
2747
2761
|
"relative h-6 w-11 rounded-xl transition-all duration-300 outline-none cursor-pointer",
|
|
2748
|
-
e ?
|
|
2749
|
-
!
|
|
2750
|
-
!
|
|
2751
|
-
|
|
2762
|
+
e ? $e[l].active : "bg-slate-200",
|
|
2763
|
+
!n && $e[l].hover,
|
|
2764
|
+
!n && $e[l].focus,
|
|
2765
|
+
n && "bg-slate-100 cursor-not-allowed"
|
|
2752
2766
|
),
|
|
2753
2767
|
onClick: c,
|
|
2754
|
-
children: /* @__PURE__ */
|
|
2768
|
+
children: /* @__PURE__ */ r(
|
|
2755
2769
|
"span",
|
|
2756
2770
|
{
|
|
2757
2771
|
className: s(
|
|
@@ -2762,8 +2776,8 @@ function wr({
|
|
|
2762
2776
|
)
|
|
2763
2777
|
}
|
|
2764
2778
|
),
|
|
2765
|
-
(o ||
|
|
2766
|
-
o && /* @__PURE__ */
|
|
2779
|
+
(o || a) && /* @__PURE__ */ d("div", { className: "flex flex-col leading-tight", children: [
|
|
2780
|
+
o && /* @__PURE__ */ r(
|
|
2767
2781
|
"span",
|
|
2768
2782
|
{
|
|
2769
2783
|
className: s(
|
|
@@ -2772,22 +2786,22 @@ function wr({
|
|
|
2772
2786
|
children: o
|
|
2773
2787
|
}
|
|
2774
2788
|
),
|
|
2775
|
-
|
|
2789
|
+
a && /* @__PURE__ */ r("span", { className: "text-sm font-normal text-slate-500", children: a })
|
|
2776
2790
|
] })
|
|
2777
2791
|
]
|
|
2778
2792
|
}
|
|
2779
2793
|
);
|
|
2780
2794
|
}
|
|
2781
|
-
const
|
|
2782
|
-
function
|
|
2795
|
+
const Br = (e) => /* @__PURE__ */ ee.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 177 177", fill: "none", ...e }, /* @__PURE__ */ ee.createElement("path", { opacity: 0.083334, d: "M94.5 48.5C94.5 41.8726 91.8137 36.5 88.5 36.5C85.1863 36.5 82.5 41.8726 82.5 48.5C82.5 55.1274 85.1863 60.5 88.5 60.5C91.8137 60.5 94.5 55.1274 94.5 48.5Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { opacity: 0.166667, d: "M113.697 56.8591C117.011 51.1196 117.371 45.1237 114.501 43.4668C111.631 41.8099 106.618 45.1196 103.305 50.8591C99.991 56.5986 99.6311 62.5946 102.501 64.2514C105.371 65.9083 110.383 62.5986 113.697 56.8591Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { opacity: 0.25, d: "M126.141 73.696C131.88 70.3823 135.19 65.3696 133.533 62.4999C131.876 59.6301 125.88 59.99 120.141 63.3037C114.401 66.6174 111.092 71.6301 112.749 74.4999C114.405 77.3696 120.401 77.0097 126.141 73.696Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { opacity: 0.333334, d: "M128.5 94.5C135.127 94.5 140.5 91.8137 140.5 88.5C140.5 85.1863 135.127 82.5 128.5 82.5C121.873 82.5 116.5 85.1863 116.5 88.5C116.5 91.8137 121.873 94.5 128.5 94.5Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { opacity: 0.416667, d: "M120.141 113.696C125.88 117.01 131.876 117.37 133.533 114.5C135.19 111.63 131.88 106.617 126.141 103.304C120.401 99.99 114.405 99.6301 112.749 102.5C111.092 105.37 114.401 110.382 120.141 113.696Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { opacity: 0.5, d: "M103.303 126.141C106.617 131.88 111.629 135.19 114.499 133.533C117.369 131.876 117.009 125.88 113.695 120.141C110.382 114.401 105.369 111.092 102.499 112.749C99.6294 114.405 99.9893 120.401 103.303 126.141Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { opacity: 0.583334, d: "M82.5 128.5C82.5 135.127 85.1863 140.5 88.5 140.5C91.8137 140.5 94.5 135.127 94.5 128.5C94.5 121.873 91.8137 116.5 88.5 116.5C85.1863 116.5 82.5 121.873 82.5 128.5Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { opacity: 0.666667, d: "M63.303 120.141C59.9893 125.88 59.6294 131.876 62.4992 133.533C65.3689 135.19 70.3816 131.88 73.6953 126.141C77.009 120.401 77.3689 114.405 74.4992 112.749C71.6294 111.092 66.6167 114.401 63.303 120.141Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { opacity: 0.75, d: "M50.8591 103.304C45.1196 106.618 41.8099 111.63 43.4668 114.5C45.1237 117.37 51.1196 117.01 56.8591 113.696C62.5986 110.383 65.9083 105.37 64.2514 102.5C62.5946 99.6304 56.5986 99.9903 50.8591 103.304Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { opacity: 0.833334, d: "M48.5 82.5C41.8726 82.5 36.5 85.1863 36.5 88.5C36.5 91.8137 41.8726 94.5 48.5 94.5C55.1274 94.5 60.5 91.8137 60.5 88.5C60.5 85.1863 55.1274 82.5 48.5 82.5Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { opacity: 0.916667, d: "M56.8591 63.304C51.1196 59.9903 45.1237 59.6304 43.4668 62.5001C41.8099 65.3699 45.1196 70.3826 50.8591 73.6963C56.5986 77.01 62.5946 77.3699 64.2514 74.5001C65.9083 71.6304 62.5986 66.6177 56.8591 63.304Z", fill: "currentColor" }), /* @__PURE__ */ ee.createElement("path", { d: "M73.697 50.8591C70.3833 45.1196 65.3706 41.8099 62.5008 43.4668C59.6311 45.1237 59.991 51.1196 63.3047 56.8591C66.6184 62.5986 71.6311 65.9083 74.5008 64.2514C77.3706 62.5946 77.0107 56.5986 73.697 50.8591Z", fill: "currentColor" }));
|
|
2796
|
+
function vn({
|
|
2783
2797
|
className: e,
|
|
2784
2798
|
size: t = 150,
|
|
2785
|
-
iconClassName:
|
|
2799
|
+
iconClassName: n,
|
|
2786
2800
|
isLoading: l = !1,
|
|
2787
2801
|
isFullPage: o = !0,
|
|
2788
|
-
variant:
|
|
2802
|
+
variant: a = "yellow"
|
|
2789
2803
|
}) {
|
|
2790
|
-
return l ? /* @__PURE__ */
|
|
2804
|
+
return l ? /* @__PURE__ */ r(
|
|
2791
2805
|
"div",
|
|
2792
2806
|
{
|
|
2793
2807
|
className: s(
|
|
@@ -2795,15 +2809,15 @@ function yr({
|
|
|
2795
2809
|
o ? "fixed inset-0 backdrop-blur-[2px]" : "absolute inset-0 w-full h-full rounded-[inherit]",
|
|
2796
2810
|
e
|
|
2797
2811
|
),
|
|
2798
|
-
children: /* @__PURE__ */
|
|
2799
|
-
|
|
2812
|
+
children: /* @__PURE__ */ r(
|
|
2813
|
+
Br,
|
|
2800
2814
|
{
|
|
2801
2815
|
width: t,
|
|
2802
2816
|
height: t,
|
|
2803
2817
|
className: s(
|
|
2804
2818
|
"animate-spin",
|
|
2805
|
-
!
|
|
2806
|
-
|
|
2819
|
+
!n && (a === "blue" ? "text-blue-600" : "text-yellow-500"),
|
|
2820
|
+
n
|
|
2807
2821
|
),
|
|
2808
2822
|
style: { fill: "currentColor", stroke: "currentColor" }
|
|
2809
2823
|
}
|
|
@@ -2811,7 +2825,7 @@ function yr({
|
|
|
2811
2825
|
}
|
|
2812
2826
|
) : null;
|
|
2813
2827
|
}
|
|
2814
|
-
const
|
|
2828
|
+
const Pr = {
|
|
2815
2829
|
sm: {
|
|
2816
2830
|
input: "h-9 text-sm",
|
|
2817
2831
|
iconPadding: "pl-8 pr-2",
|
|
@@ -2840,201 +2854,201 @@ const Pn = {
|
|
|
2840
2854
|
iconWrapper: "h-5"
|
|
2841
2855
|
}
|
|
2842
2856
|
};
|
|
2843
|
-
function
|
|
2857
|
+
function zr(e) {
|
|
2844
2858
|
let t = e.replace(/\D/g, "");
|
|
2845
2859
|
t.startsWith("998") || (t = `998${t}`), t = t.substring(0, 12);
|
|
2846
|
-
let
|
|
2847
|
-
return t.length > 3 && (
|
|
2860
|
+
let n = "+998";
|
|
2861
|
+
return t.length > 3 && (n += ` (${t.substring(3, 5)}`), t.length > 5 && (n += `) ${t.substring(5, 8)}`), t.length > 8 && (n += ` ${t.substring(8, 10)}`), t.length > 10 && (n += ` ${t.substring(10, 12)}`), n;
|
|
2848
2862
|
}
|
|
2849
|
-
function
|
|
2863
|
+
function Wr(e) {
|
|
2850
2864
|
return e ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600";
|
|
2851
2865
|
}
|
|
2852
|
-
function
|
|
2853
|
-
return e ? "text-slate-400" : t ? "text-red-600" :
|
|
2866
|
+
function Yr(e, t, n) {
|
|
2867
|
+
return e ? "text-slate-400" : t ? "text-red-600" : n ? "text-black" : "text-slate-400";
|
|
2854
2868
|
}
|
|
2855
|
-
const
|
|
2869
|
+
const Vr = be(
|
|
2856
2870
|
({
|
|
2857
2871
|
label: e,
|
|
2858
2872
|
placeholder: t = "+998 (__) ___ __ __",
|
|
2859
|
-
size:
|
|
2873
|
+
size: n = "base",
|
|
2860
2874
|
error: l,
|
|
2861
2875
|
disabled: o = !1,
|
|
2862
|
-
required:
|
|
2863
|
-
value:
|
|
2876
|
+
required: a = !1,
|
|
2877
|
+
value: i = "",
|
|
2864
2878
|
onChange: c,
|
|
2865
|
-
onFocus:
|
|
2866
|
-
onBlur:
|
|
2867
|
-
className:
|
|
2879
|
+
onFocus: g,
|
|
2880
|
+
onBlur: x,
|
|
2881
|
+
className: y,
|
|
2868
2882
|
name: S,
|
|
2869
|
-
showIcon:
|
|
2870
|
-
},
|
|
2871
|
-
const [E, h] =
|
|
2883
|
+
showIcon: I = !1
|
|
2884
|
+
}, T) => {
|
|
2885
|
+
const [E, h] = W(!1), w = (D) => {
|
|
2872
2886
|
const m = D.target.value;
|
|
2873
2887
|
if (m.length < 5) {
|
|
2874
2888
|
c?.("+998");
|
|
2875
2889
|
return;
|
|
2876
2890
|
}
|
|
2877
|
-
const u =
|
|
2891
|
+
const u = zr(m);
|
|
2878
2892
|
c?.(u);
|
|
2879
|
-
},
|
|
2880
|
-
h(!0), (!
|
|
2881
|
-
},
|
|
2882
|
-
h(!1),
|
|
2883
|
-
},
|
|
2884
|
-
() =>
|
|
2893
|
+
}, M = () => {
|
|
2894
|
+
h(!0), (!i || i === "") && c?.("+998"), g?.();
|
|
2895
|
+
}, O = () => {
|
|
2896
|
+
h(!1), x?.();
|
|
2897
|
+
}, k = Pr[n], f = I ? k.iconPadding : k.defaultPadding, L = P(() => Wr(l), [l]), v = P(
|
|
2898
|
+
() => Yr(o, l, E),
|
|
2885
2899
|
[l, E, o]
|
|
2886
2900
|
);
|
|
2887
|
-
return /* @__PURE__ */ d("div", { className: s("w-full",
|
|
2901
|
+
return /* @__PURE__ */ d("div", { className: s("w-full", y), children: [
|
|
2888
2902
|
e && /* @__PURE__ */ d("label", { className: s(
|
|
2889
2903
|
"mb-2 block font-medium transition-colors duration-200",
|
|
2890
2904
|
l ? "text-red-600" : E ? "text-blue-600" : "text-slate-700",
|
|
2891
|
-
|
|
2905
|
+
k.labelFont
|
|
2892
2906
|
), children: [
|
|
2893
2907
|
e,
|
|
2894
|
-
|
|
2908
|
+
a && /* @__PURE__ */ r("span", { className: "text-red-600 ml-1", children: "*" })
|
|
2895
2909
|
] }),
|
|
2896
2910
|
/* @__PURE__ */ d("div", { className: "relative flex items-center", children: [
|
|
2897
|
-
|
|
2911
|
+
I && /* @__PURE__ */ r("div", { className: s(
|
|
2898
2912
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center transition-all duration-300",
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
), children: /* @__PURE__ */
|
|
2902
|
-
/* @__PURE__ */
|
|
2913
|
+
k.iconLeft,
|
|
2914
|
+
v
|
|
2915
|
+
), children: /* @__PURE__ */ r("div", { className: s("flex items-center justify-center", k.iconWrapper), children: /* @__PURE__ */ r(Mt, { className: s(k.iconSize), weight: "Linear" }) }) }),
|
|
2916
|
+
/* @__PURE__ */ r(
|
|
2903
2917
|
"input",
|
|
2904
2918
|
{
|
|
2905
|
-
ref:
|
|
2919
|
+
ref: T,
|
|
2906
2920
|
name: S,
|
|
2907
2921
|
type: "tel",
|
|
2908
|
-
value:
|
|
2909
|
-
onChange:
|
|
2910
|
-
onFocus:
|
|
2911
|
-
onBlur:
|
|
2922
|
+
value: i,
|
|
2923
|
+
onChange: w,
|
|
2924
|
+
onFocus: M,
|
|
2925
|
+
onBlur: O,
|
|
2912
2926
|
disabled: o,
|
|
2913
2927
|
placeholder: t,
|
|
2914
2928
|
className: s(
|
|
2915
2929
|
"w-full border bg-white font-normal transition-all duration-300 outline-none",
|
|
2916
|
-
|
|
2930
|
+
n === "base" ? "rounded-xl" : "rounded-lg",
|
|
2917
2931
|
"disabled:bg-slate-100 disabled:text-slate-400 disabled:cursor-not-allowed",
|
|
2918
|
-
|
|
2932
|
+
k.input,
|
|
2919
2933
|
f,
|
|
2920
|
-
|
|
2934
|
+
L
|
|
2921
2935
|
)
|
|
2922
2936
|
}
|
|
2923
2937
|
)
|
|
2924
2938
|
] }),
|
|
2925
|
-
l && /* @__PURE__ */
|
|
2939
|
+
l && /* @__PURE__ */ r("p", { className: "mt-2 animate-slide-up text-sm font-normal text-red-600", children: l })
|
|
2926
2940
|
] });
|
|
2927
2941
|
}
|
|
2928
2942
|
);
|
|
2929
|
-
|
|
2930
|
-
function
|
|
2943
|
+
Vr.displayName = "MciPhone";
|
|
2944
|
+
function Hr(e) {
|
|
2931
2945
|
const t = e.replace(/\s/g, "").toUpperCase();
|
|
2932
|
-
let
|
|
2946
|
+
let n = "";
|
|
2933
2947
|
for (let l = 0; l < t.length; l += 1) {
|
|
2934
2948
|
const o = t[l];
|
|
2935
|
-
if (
|
|
2949
|
+
if (n.length < 2 ? /[A-Z]/.test(o) && (n += o) : /[0-9]/.test(o) && (n += o), n.length >= 9) break;
|
|
2936
2950
|
}
|
|
2937
|
-
return
|
|
2951
|
+
return n.length > 2 ? `${n.slice(0, 2)} ${n.slice(2)}` : n;
|
|
2938
2952
|
}
|
|
2939
|
-
function
|
|
2953
|
+
function Ur(e) {
|
|
2940
2954
|
return e.replace(/\D/g, "").slice(0, 14);
|
|
2941
2955
|
}
|
|
2942
|
-
function
|
|
2956
|
+
function Zr(e) {
|
|
2943
2957
|
return e.toUpperCase().replace(/[^A-Z0-9\-\s]/g, "").replace(/\s+/g, " ").slice(0, 15);
|
|
2944
2958
|
}
|
|
2945
|
-
function
|
|
2946
|
-
return e === "passport" ?
|
|
2959
|
+
function Xr(e, t) {
|
|
2960
|
+
return e === "passport" ? Hr(t) : e === "pinfl" ? Ur(t) : Zr(t);
|
|
2947
2961
|
}
|
|
2948
|
-
function
|
|
2962
|
+
function Kr(e, t) {
|
|
2949
2963
|
return t || (e === "passport" ? "AA 1234567" : e === "pinfl" ? "12345678901234" : e === "metirka" ? "I-TN 1234567" : "");
|
|
2950
2964
|
}
|
|
2951
|
-
function
|
|
2965
|
+
function qr(e, t) {
|
|
2952
2966
|
return t || (e === "passport" ? 10 : e === "pinfl" ? 14 : e === "metirka" ? 15 : 255);
|
|
2953
2967
|
}
|
|
2954
|
-
const
|
|
2955
|
-
({ mode: e, onChange: t, value:
|
|
2956
|
-
const [
|
|
2957
|
-
(
|
|
2958
|
-
const
|
|
2959
|
-
|
|
2968
|
+
const Gr = be(
|
|
2969
|
+
({ mode: e, onChange: t, value: n, ...l }, o) => {
|
|
2970
|
+
const [a, i] = W(""), c = n !== void 0 ? n : a, g = R(
|
|
2971
|
+
(x) => {
|
|
2972
|
+
const y = x.target.value, S = Xr(e, y);
|
|
2973
|
+
n === void 0 && i(S), x.target.value = S, t?.(S, x);
|
|
2960
2974
|
},
|
|
2961
|
-
[e, t,
|
|
2975
|
+
[e, t, n]
|
|
2962
2976
|
);
|
|
2963
|
-
return /* @__PURE__ */
|
|
2964
|
-
|
|
2977
|
+
return /* @__PURE__ */ r(
|
|
2978
|
+
Be,
|
|
2965
2979
|
{
|
|
2966
2980
|
ref: o,
|
|
2967
2981
|
...l,
|
|
2968
2982
|
value: c,
|
|
2969
|
-
onChange:
|
|
2970
|
-
maxLength:
|
|
2971
|
-
placeholder:
|
|
2983
|
+
onChange: g,
|
|
2984
|
+
maxLength: qr(e, l.maxLength),
|
|
2985
|
+
placeholder: Kr(e, l.placeholder)
|
|
2972
2986
|
}
|
|
2973
2987
|
);
|
|
2974
2988
|
}
|
|
2975
2989
|
);
|
|
2976
|
-
|
|
2977
|
-
function
|
|
2990
|
+
Gr.displayName = "MciIdentityInput";
|
|
2991
|
+
function Nn({
|
|
2978
2992
|
open: e,
|
|
2979
2993
|
onClose: t,
|
|
2980
|
-
columns:
|
|
2994
|
+
columns: n,
|
|
2981
2995
|
hidden: l,
|
|
2982
2996
|
onToggle: o,
|
|
2983
|
-
onMove:
|
|
2984
|
-
onMoveByKey:
|
|
2997
|
+
onMove: a,
|
|
2998
|
+
onMoveByKey: i,
|
|
2985
2999
|
minVisible: c = 5
|
|
2986
3000
|
}) {
|
|
2987
|
-
const
|
|
2988
|
-
|
|
3001
|
+
const g = ae(null), { handleClick: x } = Fe(g, t);
|
|
3002
|
+
J(() => {
|
|
2989
3003
|
if (e)
|
|
2990
|
-
return document.addEventListener("mousedown",
|
|
2991
|
-
}, [e,
|
|
2992
|
-
const
|
|
3004
|
+
return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
|
|
3005
|
+
}, [e, x]);
|
|
3006
|
+
const y = P(() => new Set(l), [l]), S = P(() => {
|
|
2993
3007
|
let u = 0;
|
|
2994
|
-
for (const
|
|
3008
|
+
for (const b of n) y.has(b.key) || u++;
|
|
2995
3009
|
return u;
|
|
2996
|
-
}, [
|
|
2997
|
-
(u,
|
|
2998
|
-
let
|
|
2999
|
-
return u <
|
|
3010
|
+
}, [n, y]), [I, T] = W(null), [E, h] = W(null), [w, M] = W(null), [O, k] = W("before"), f = R(
|
|
3011
|
+
(u, b, j) => {
|
|
3012
|
+
let F = j === "after" ? b + 1 : b;
|
|
3013
|
+
return u < F && (F -= 1), F;
|
|
3000
3014
|
},
|
|
3001
3015
|
[]
|
|
3002
|
-
),
|
|
3003
|
-
|
|
3004
|
-
}, []),
|
|
3005
|
-
(u,
|
|
3006
|
-
|
|
3007
|
-
const
|
|
3008
|
-
|
|
3016
|
+
), L = R(() => {
|
|
3017
|
+
T(null), M(null), h(null), k("before");
|
|
3018
|
+
}, []), v = R(
|
|
3019
|
+
(u, b, j) => {
|
|
3020
|
+
T(b), M(String(j)), h(null), k("before"), u.dataTransfer.effectAllowed = "move", u.dataTransfer.setData("text/plain", String(b));
|
|
3021
|
+
const F = new Image();
|
|
3022
|
+
F.src = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", u.dataTransfer.setDragImage(F, 0, 0);
|
|
3009
3023
|
},
|
|
3010
3024
|
[]
|
|
3011
|
-
), D =
|
|
3012
|
-
(u,
|
|
3025
|
+
), D = R(
|
|
3026
|
+
(u, b) => {
|
|
3013
3027
|
u.preventDefault();
|
|
3014
|
-
const
|
|
3015
|
-
if (!Number.isFinite(
|
|
3016
|
-
|
|
3028
|
+
const j = I ?? Number.parseInt(u.dataTransfer.getData("text/plain") || "-1", 10);
|
|
3029
|
+
if (!Number.isFinite(j) || j < 0) {
|
|
3030
|
+
L();
|
|
3017
3031
|
return;
|
|
3018
3032
|
}
|
|
3019
|
-
const
|
|
3020
|
-
if (!
|
|
3021
|
-
|
|
3033
|
+
const F = n[j], $ = n[b];
|
|
3034
|
+
if (!F || !$) {
|
|
3035
|
+
L();
|
|
3022
3036
|
return;
|
|
3023
3037
|
}
|
|
3024
|
-
const
|
|
3025
|
-
|
|
3038
|
+
const z = f(j, b, O);
|
|
3039
|
+
z !== j && (i ? i(F.key, $.key, O) : a(j, z)), L();
|
|
3026
3040
|
},
|
|
3027
|
-
[
|
|
3028
|
-
), m =
|
|
3029
|
-
(u,
|
|
3030
|
-
|
|
3041
|
+
[n, f, I, O, a, i, L]
|
|
3042
|
+
), m = R(
|
|
3043
|
+
(u, b) => {
|
|
3044
|
+
b || o(u);
|
|
3031
3045
|
},
|
|
3032
3046
|
[o]
|
|
3033
3047
|
);
|
|
3034
3048
|
return e ? /* @__PURE__ */ d(
|
|
3035
3049
|
"div",
|
|
3036
3050
|
{
|
|
3037
|
-
ref:
|
|
3051
|
+
ref: g,
|
|
3038
3052
|
className: s(
|
|
3039
3053
|
"absolute right-0 top-full z-50 mt-2 w-[320px]",
|
|
3040
3054
|
"rounded-2xl p-4 bg-white",
|
|
@@ -3042,8 +3056,8 @@ function vr({
|
|
|
3042
3056
|
),
|
|
3043
3057
|
children: [
|
|
3044
3058
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-4", children: [
|
|
3045
|
-
/* @__PURE__ */
|
|
3046
|
-
/* @__PURE__ */
|
|
3059
|
+
/* @__PURE__ */ r("h4", { className: "text-slate-600 text-large font-normal", children: "Settings" }),
|
|
3060
|
+
/* @__PURE__ */ r(
|
|
3047
3061
|
"button",
|
|
3048
3062
|
{
|
|
3049
3063
|
type: "button",
|
|
@@ -3054,14 +3068,14 @@ function vr({
|
|
|
3054
3068
|
}
|
|
3055
3069
|
)
|
|
3056
3070
|
] }),
|
|
3057
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ r("div", { className: "my-4 h-px bg-slate-100" }),
|
|
3058
3072
|
/* @__PURE__ */ d("p", { className: "mb-3 text-xs text-slate-500", children: [
|
|
3059
3073
|
"Active columns: ",
|
|
3060
3074
|
S,
|
|
3061
3075
|
"/",
|
|
3062
|
-
|
|
3076
|
+
n.length
|
|
3063
3077
|
] }),
|
|
3064
|
-
/* @__PURE__ */
|
|
3078
|
+
/* @__PURE__ */ r(
|
|
3065
3079
|
"div",
|
|
3066
3080
|
{
|
|
3067
3081
|
className: s(
|
|
@@ -3072,15 +3086,15 @@ function vr({
|
|
|
3072
3086
|
"[&::-webkit-scrollbar-thumb]:rounded-full",
|
|
3073
3087
|
"hover:[&::-webkit-scrollbar-thumb]:bg-slate-300"
|
|
3074
3088
|
),
|
|
3075
|
-
children:
|
|
3076
|
-
const
|
|
3089
|
+
children: n.map((u, b) => {
|
|
3090
|
+
const j = !y.has(u.key), F = j && S <= c, $ = E === b, z = w === u.key;
|
|
3077
3091
|
return /* @__PURE__ */ d("div", { className: "relative", children: [
|
|
3078
|
-
|
|
3092
|
+
$ && !z && /* @__PURE__ */ r(
|
|
3079
3093
|
"div",
|
|
3080
3094
|
{
|
|
3081
3095
|
className: s(
|
|
3082
3096
|
"pointer-events-none absolute left-2 right-2 z-10 h-0.5 rounded-full bg-blue-300",
|
|
3083
|
-
|
|
3097
|
+
O === "before" ? "top-0" : "bottom-0"
|
|
3084
3098
|
)
|
|
3085
3099
|
}
|
|
3086
3100
|
),
|
|
@@ -3088,25 +3102,25 @@ function vr({
|
|
|
3088
3102
|
"div",
|
|
3089
3103
|
{
|
|
3090
3104
|
draggable: !0,
|
|
3091
|
-
onDragStart: (
|
|
3092
|
-
onDragOver: (
|
|
3093
|
-
if (
|
|
3094
|
-
|
|
3095
|
-
const X =
|
|
3096
|
-
E !==
|
|
3105
|
+
onDragStart: (V) => v(V, b, u.key),
|
|
3106
|
+
onDragOver: (V) => {
|
|
3107
|
+
if (I == null) return;
|
|
3108
|
+
V.preventDefault(), V.dataTransfer.dropEffect = "move";
|
|
3109
|
+
const X = V.currentTarget.getBoundingClientRect(), re = V.clientY - X.top > X.height / 2 ? "after" : "before";
|
|
3110
|
+
E !== b && h(b), O !== re && k(re);
|
|
3097
3111
|
},
|
|
3098
|
-
onDrop: (
|
|
3099
|
-
onDragEnd:
|
|
3112
|
+
onDrop: (V) => D(V, b),
|
|
3113
|
+
onDragEnd: L,
|
|
3100
3114
|
className: s(
|
|
3101
3115
|
"group flex items-center py-2 px-1 gap-4",
|
|
3102
3116
|
"rounded-md box-border overflow-visible",
|
|
3103
3117
|
"transition-[background,transform] duration-150",
|
|
3104
|
-
!
|
|
3105
|
-
|
|
3106
|
-
|
|
3118
|
+
!z && !$ && "hover:bg-slate-50",
|
|
3119
|
+
$ && !z && "bg-slate-50",
|
|
3120
|
+
z && "bg-slate-50 opacity-100 scale-[0.99] cursor-grabbing"
|
|
3107
3121
|
),
|
|
3108
3122
|
children: [
|
|
3109
|
-
/* @__PURE__ */
|
|
3123
|
+
/* @__PURE__ */ r(
|
|
3110
3124
|
"button",
|
|
3111
3125
|
{
|
|
3112
3126
|
type: "button",
|
|
@@ -3114,24 +3128,24 @@ function vr({
|
|
|
3114
3128
|
"shrink-0 text-slate-400",
|
|
3115
3129
|
"cursor-grab active:cursor-grabbing",
|
|
3116
3130
|
"rounded-lg p-1 hover:bg-slate-100",
|
|
3117
|
-
|
|
3131
|
+
z && "cursor-grabbing"
|
|
3118
3132
|
),
|
|
3119
3133
|
"aria-label": "Drag",
|
|
3120
|
-
children: /* @__PURE__ */
|
|
3134
|
+
children: /* @__PURE__ */ r(Tt, { weight: "Linear", size: 20 })
|
|
3121
3135
|
}
|
|
3122
3136
|
),
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
|
|
3137
|
+
/* @__PURE__ */ r("div", { className: "shrink-0", children: /* @__PURE__ */ r(
|
|
3138
|
+
Ie,
|
|
3125
3139
|
{
|
|
3126
|
-
checked:
|
|
3127
|
-
disabled:
|
|
3128
|
-
onChange: () => m(u.key,
|
|
3140
|
+
checked: j,
|
|
3141
|
+
disabled: F,
|
|
3142
|
+
onChange: () => m(u.key, F),
|
|
3129
3143
|
variant: "blue"
|
|
3130
3144
|
}
|
|
3131
3145
|
) }),
|
|
3132
3146
|
/* @__PURE__ */ d("div", { className: "min-w-0 flex-1", children: [
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
|
|
3147
|
+
/* @__PURE__ */ r("h4", { className: "truncate text-slate-700 text-base font-medium", title: u.title, children: u.title }),
|
|
3148
|
+
F && /* @__PURE__ */ d("p", { className: "text-xs text-slate-400 mt-0.5", children: [
|
|
3135
3149
|
"Минимум ",
|
|
3136
3150
|
c,
|
|
3137
3151
|
" колонок"
|
|
@@ -3140,7 +3154,7 @@ function vr({
|
|
|
3140
3154
|
]
|
|
3141
3155
|
}
|
|
3142
3156
|
),
|
|
3143
|
-
|
|
3157
|
+
b !== n.length - 1 && /* @__PURE__ */ r("div", { className: "mx-2 h-px bg-slate-100" })
|
|
3144
3158
|
] }, u.key);
|
|
3145
3159
|
})
|
|
3146
3160
|
}
|
|
@@ -3149,157 +3163,157 @@ function vr({
|
|
|
3149
3163
|
}
|
|
3150
3164
|
) : null;
|
|
3151
3165
|
}
|
|
3152
|
-
const
|
|
3166
|
+
const qe = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Jr = (e) => {
|
|
3153
3167
|
if (!e) return null;
|
|
3154
3168
|
try {
|
|
3155
3169
|
const t = JSON.parse(e);
|
|
3156
3170
|
if (typeof t != "object" || t === null) return null;
|
|
3157
|
-
const
|
|
3158
|
-
return !
|
|
3171
|
+
const n = t;
|
|
3172
|
+
return !qe(n.order) || !qe(n.hidden) ? null : { order: n.order, hidden: n.hidden };
|
|
3159
3173
|
} catch {
|
|
3160
3174
|
return null;
|
|
3161
3175
|
}
|
|
3162
|
-
},
|
|
3163
|
-
const t = /* @__PURE__ */ new Set(),
|
|
3176
|
+
}, me = (e) => {
|
|
3177
|
+
const t = /* @__PURE__ */ new Set(), n = [];
|
|
3164
3178
|
for (const l of e)
|
|
3165
|
-
t.has(l) || (t.add(l),
|
|
3166
|
-
return
|
|
3167
|
-
},
|
|
3168
|
-
const
|
|
3169
|
-
return
|
|
3170
|
-
},
|
|
3179
|
+
t.has(l) || (t.add(l), n.push(l));
|
|
3180
|
+
return n;
|
|
3181
|
+
}, Qr = (e) => new Set((e ?? []).map(String)), Ge = (e, t) => {
|
|
3182
|
+
const n = t ? me(t.filter((l) => e.includes(l))) : [];
|
|
3183
|
+
return me([...n, ...e]);
|
|
3184
|
+
}, Je = (e, t) => {
|
|
3171
3185
|
if (!t?.length) return [];
|
|
3172
|
-
const
|
|
3173
|
-
return e.filter((l) => !
|
|
3174
|
-
},
|
|
3175
|
-
const l = new Set(t), o =
|
|
3176
|
-
return o.slice(0,
|
|
3186
|
+
const n = Qr(t);
|
|
3187
|
+
return e.filter((l) => !n.has(l));
|
|
3188
|
+
}, en = (e, t) => Math.max(0, Math.min(e, t)), we = (e, t, n) => {
|
|
3189
|
+
const l = new Set(t), o = me(e.filter((i) => l.has(i))), a = Math.max(0, t.length - n);
|
|
3190
|
+
return o.slice(0, a);
|
|
3177
3191
|
};
|
|
3178
|
-
function
|
|
3179
|
-
const { storageKey: t, columns:
|
|
3180
|
-
() =>
|
|
3181
|
-
[
|
|
3182
|
-
), [
|
|
3183
|
-
const f =
|
|
3184
|
-
|
|
3192
|
+
function kn(e) {
|
|
3193
|
+
const { storageKey: t, columns: n, defaultVisibleKeys: l, defaultOrder: o, minVisible: a = 5 } = e, i = P(() => n.map((f) => String(f.key)), [n]), c = P(() => new Set(i), [i]), g = P(
|
|
3194
|
+
() => en(a, i.length),
|
|
3195
|
+
[i.length, a]
|
|
3196
|
+
), [x, y] = W(() => {
|
|
3197
|
+
const f = Ge(
|
|
3198
|
+
i,
|
|
3185
3199
|
o?.map(String) ?? []
|
|
3186
|
-
),
|
|
3187
|
-
|
|
3200
|
+
), L = Je(
|
|
3201
|
+
i,
|
|
3188
3202
|
l?.map(String) ?? []
|
|
3189
3203
|
);
|
|
3190
3204
|
if (typeof window > "u")
|
|
3191
3205
|
return {
|
|
3192
3206
|
order: f,
|
|
3193
|
-
hidden:
|
|
3207
|
+
hidden: we(L, i, g)
|
|
3194
3208
|
};
|
|
3195
|
-
const
|
|
3209
|
+
const v = Jr(window.localStorage.getItem(t)), D = me((v?.order ?? []).filter((j) => c.has(j))), m = me([...D, ...f, ...i]), u = me((v?.hidden ?? []).filter((j) => c.has(j)));
|
|
3196
3210
|
return {
|
|
3197
3211
|
order: m,
|
|
3198
|
-
hidden:
|
|
3212
|
+
hidden: we(v ? u : L, i, g)
|
|
3199
3213
|
};
|
|
3200
3214
|
});
|
|
3201
|
-
|
|
3215
|
+
J(() => {
|
|
3202
3216
|
if (!(typeof window > "u"))
|
|
3203
3217
|
try {
|
|
3204
|
-
window.localStorage.setItem(t, JSON.stringify(
|
|
3218
|
+
window.localStorage.setItem(t, JSON.stringify(x));
|
|
3205
3219
|
} catch {
|
|
3206
3220
|
}
|
|
3207
|
-
}, [
|
|
3208
|
-
|
|
3209
|
-
const
|
|
3221
|
+
}, [x, t]), J(() => {
|
|
3222
|
+
y((f) => {
|
|
3223
|
+
const L = me([
|
|
3210
3224
|
...f.order.filter((u) => c.has(u)),
|
|
3211
|
-
...
|
|
3212
|
-
]),
|
|
3213
|
-
return D && m ? f : { order:
|
|
3225
|
+
...i.filter((u) => !f.order.includes(u))
|
|
3226
|
+
]), v = we(f.hidden, i, g), D = L.length === f.order.length && L.every((u, b) => u === f.order[b]), m = v.length === f.hidden.length && v.every((u, b) => u === f.hidden[b]);
|
|
3227
|
+
return D && m ? f : { order: L, hidden: v };
|
|
3214
3228
|
});
|
|
3215
|
-
}, [
|
|
3216
|
-
const S =
|
|
3229
|
+
}, [i, c, g]);
|
|
3230
|
+
const S = P(() => new Set(x.hidden), [x.hidden]), I = P(() => {
|
|
3217
3231
|
const f = /* @__PURE__ */ new Map();
|
|
3218
|
-
return
|
|
3219
|
-
const D = f.get(String(
|
|
3232
|
+
return x.order.forEach((L, v) => f.set(L, v)), [...n].sort((L, v) => {
|
|
3233
|
+
const D = f.get(String(L.key)) ?? Number.MAX_SAFE_INTEGER, m = f.get(String(v.key)) ?? Number.MAX_SAFE_INTEGER;
|
|
3220
3234
|
return D - m;
|
|
3221
3235
|
});
|
|
3222
|
-
}, [
|
|
3223
|
-
() =>
|
|
3224
|
-
[
|
|
3225
|
-
), E =
|
|
3226
|
-
() =>
|
|
3227
|
-
[
|
|
3228
|
-
), h =
|
|
3229
|
-
const
|
|
3230
|
-
|
|
3231
|
-
if (
|
|
3232
|
-
return { ...
|
|
3233
|
-
if (
|
|
3234
|
-
const u =
|
|
3235
|
-
return { ...
|
|
3236
|
+
}, [n, x.order]), T = P(
|
|
3237
|
+
() => I.filter((f) => !S.has(String(f.key))),
|
|
3238
|
+
[I, S]
|
|
3239
|
+
), E = P(
|
|
3240
|
+
() => x.hidden.filter((f) => c.has(f)),
|
|
3241
|
+
[x.hidden, c]
|
|
3242
|
+
), h = i.length - E.length, w = R((f) => {
|
|
3243
|
+
const L = String(f);
|
|
3244
|
+
y((v) => {
|
|
3245
|
+
if (v.hidden.includes(L))
|
|
3246
|
+
return { ...v, hidden: v.hidden.filter((b) => b !== L) };
|
|
3247
|
+
if (i.length - v.hidden.length <= g) return v;
|
|
3248
|
+
const u = we([...v.hidden, L], i, g);
|
|
3249
|
+
return { ...v, hidden: u };
|
|
3236
3250
|
});
|
|
3237
|
-
}, [
|
|
3238
|
-
|
|
3239
|
-
const D =
|
|
3240
|
-
if (f < 0 ||
|
|
3251
|
+
}, [i, g]), M = R((f, L) => {
|
|
3252
|
+
y((v) => {
|
|
3253
|
+
const D = v.order.slice();
|
|
3254
|
+
if (f < 0 || L < 0 || f >= D.length || L >= D.length) return v;
|
|
3241
3255
|
const [m] = D.splice(f, 1);
|
|
3242
|
-
return D.splice(
|
|
3256
|
+
return D.splice(L, 0, m), { ...v, order: D };
|
|
3243
3257
|
});
|
|
3244
|
-
}, []),
|
|
3245
|
-
const D = String(f), m = String(
|
|
3246
|
-
D !== m &&
|
|
3247
|
-
const
|
|
3248
|
-
if (
|
|
3249
|
-
let
|
|
3250
|
-
if (
|
|
3251
|
-
const [
|
|
3252
|
-
return
|
|
3258
|
+
}, []), O = R((f, L, v = "before") => {
|
|
3259
|
+
const D = String(f), m = String(L);
|
|
3260
|
+
D !== m && y((u) => {
|
|
3261
|
+
const b = u.order.slice(), j = b.indexOf(D), F = b.indexOf(m);
|
|
3262
|
+
if (j < 0 || F < 0 || j === F) return u;
|
|
3263
|
+
let $ = v === "after" ? F + 1 : F;
|
|
3264
|
+
if (j < $ && ($ -= 1), $ === j) return u;
|
|
3265
|
+
const [z] = b.splice(j, 1);
|
|
3266
|
+
return b.splice($, 0, z), { ...u, order: b };
|
|
3253
3267
|
});
|
|
3254
|
-
}, []),
|
|
3255
|
-
|
|
3256
|
-
const f =
|
|
3257
|
-
|
|
3268
|
+
}, []), k = R(() => {
|
|
3269
|
+
y(() => {
|
|
3270
|
+
const f = Ge(
|
|
3271
|
+
i,
|
|
3258
3272
|
o?.map(String) ?? []
|
|
3259
|
-
),
|
|
3260
|
-
|
|
3273
|
+
), L = Je(
|
|
3274
|
+
i,
|
|
3261
3275
|
l?.map(String) ?? []
|
|
3262
3276
|
);
|
|
3263
3277
|
return {
|
|
3264
3278
|
order: f,
|
|
3265
|
-
hidden:
|
|
3279
|
+
hidden: we(L, i, g)
|
|
3266
3280
|
};
|
|
3267
3281
|
});
|
|
3268
|
-
}, [
|
|
3282
|
+
}, [i, o, l, g]);
|
|
3269
3283
|
return {
|
|
3270
|
-
orderedAllColumns:
|
|
3271
|
-
orderedColumns:
|
|
3284
|
+
orderedAllColumns: I,
|
|
3285
|
+
orderedColumns: T,
|
|
3272
3286
|
hiddenKeys: E,
|
|
3273
3287
|
visibleCount: h,
|
|
3274
|
-
toggleColumn:
|
|
3275
|
-
moveColumn:
|
|
3276
|
-
moveColumnByKey:
|
|
3277
|
-
reset:
|
|
3288
|
+
toggleColumn: w,
|
|
3289
|
+
moveColumn: M,
|
|
3290
|
+
moveColumnByKey: O,
|
|
3291
|
+
reset: k
|
|
3278
3292
|
};
|
|
3279
3293
|
}
|
|
3280
3294
|
export {
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3295
|
+
on as MciBreadcrumb,
|
|
3296
|
+
cn as MciButton,
|
|
3297
|
+
Ie as MciCheck,
|
|
3298
|
+
dn as MciCollapse,
|
|
3299
|
+
un as MciDrawer,
|
|
3300
|
+
Gr as MciIdentityInput,
|
|
3301
|
+
Be as MciInput,
|
|
3302
|
+
vn as MciLoader,
|
|
3303
|
+
hn as MciModal,
|
|
3304
|
+
pn as MciPagination,
|
|
3305
|
+
Vr as MciPhone,
|
|
3306
|
+
Jt as MciPicker,
|
|
3307
|
+
nr as MciSelect,
|
|
3308
|
+
Ze as MciSkeleton,
|
|
3309
|
+
fn as MciTable,
|
|
3310
|
+
Nn as MciTableColumnsPanel,
|
|
3311
|
+
bn as MciTabs,
|
|
3312
|
+
gn as MciTag,
|
|
3313
|
+
Ir as MciTextarea,
|
|
3314
|
+
xn as MciToast,
|
|
3315
|
+
yn as MciToggle,
|
|
3316
|
+
wn as MciTooltip,
|
|
3317
|
+
mn as MciUpload,
|
|
3318
|
+
kn as useTableColumnSettings
|
|
3305
3319
|
};
|