@mci-ui/mci-ui 0.0.81 → 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,61 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { AltArrowRight as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
import * as
|
|
6
|
-
import { memo as
|
|
7
|
-
import { createRoot 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
|
+
import { clsx as It } from "clsx";
|
|
4
|
+
import { twMerge as Ft } from "tailwind-merge";
|
|
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
|
+
import { createRoot as jt } from "react-dom/client";
|
|
8
8
|
function s(...e) {
|
|
9
|
-
return
|
|
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
|
}
|
|
54
|
-
const
|
|
54
|
+
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 It = {
|
|
|
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:
|
|
85
|
-
type:
|
|
82
|
+
disabled: g = !1,
|
|
83
|
+
onClick: x,
|
|
84
|
+
className: y,
|
|
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
|
-
type:
|
|
92
|
-
onClick:
|
|
91
|
+
type: S,
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
!E &&
|
|
96
|
+
Ot[o],
|
|
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 jt = (e) => /* @__PURE__ */ G.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:
|
|
135
|
-
name:
|
|
136
|
-
value:
|
|
132
|
+
required: g = !1,
|
|
133
|
+
className: x,
|
|
134
|
+
variant: y = "yellow",
|
|
135
|
+
name: S,
|
|
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 jt = (e) => /* @__PURE__ */ G.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 jt = (e) => /* @__PURE__ */ G.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 jt = (e) => /* @__PURE__ */ G.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":
|
|
233
|
-
name:
|
|
234
|
-
value:
|
|
231
|
+
"aria-invalid": !!i,
|
|
232
|
+
"aria-describedby": i ? `${S}-error` : void 0,
|
|
233
|
+
name: S,
|
|
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:
|
|
340
|
-
closeOnEscape:
|
|
341
|
-
width:
|
|
337
|
+
drawerClassName: g,
|
|
338
|
+
contentClassName: x,
|
|
339
|
+
closeOnOverlayClick: y = !0,
|
|
340
|
+
closeOnEscape: S = !0,
|
|
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",
|
|
@@ -452,59 +452,68 @@ const Ie = {
|
|
|
452
452
|
iconWrapper: "h-5"
|
|
453
453
|
}
|
|
454
454
|
};
|
|
455
|
-
function
|
|
456
|
-
const
|
|
455
|
+
function Pt(e, t) {
|
|
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
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
|
|
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
|
+
}
|
|
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";
|
|
468
471
|
}
|
|
469
|
-
const
|
|
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
|
-
onChange:
|
|
483
|
-
onFocus:
|
|
484
|
-
onBlur:
|
|
482
|
+
disabled: g = !1,
|
|
483
|
+
required: x = !1,
|
|
484
|
+
value: y,
|
|
485
|
+
onChange: S,
|
|
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 $e = 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:
|
|
533
|
-
onChange:
|
|
534
|
-
onFocus:
|
|
535
|
-
onBlur:
|
|
536
|
-
disabled:
|
|
537
|
-
required:
|
|
540
|
+
type: $ && b ? "text" : n,
|
|
541
|
+
value: F,
|
|
542
|
+
onChange: ie,
|
|
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 $e = 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,275 +783,302 @@ const _t = {
|
|
|
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:
|
|
839
|
-
error:
|
|
840
|
-
showClear:
|
|
841
|
-
allowManualInput:
|
|
846
|
+
format: g = "DD.MM.YYYY",
|
|
847
|
+
minDate: x,
|
|
848
|
+
maxDate: y,
|
|
849
|
+
error: S,
|
|
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
|
-
), B =
|
|
861
|
-
if (e === "date") return
|
|
862
|
-
const [
|
|
863
|
-
return !
|
|
864
|
-
}, [e,
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
}, [B,
|
|
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 H =
|
|
883
|
-
f(!1),
|
|
884
|
-
}, [h, B]),
|
|
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
|
-
},
|
|
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);
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
const N = Ue(p);
|
|
913
|
+
if (N && !q(N)) {
|
|
914
|
+
const _ = se(N);
|
|
915
|
+
v(_), n?.(_), X(C(_)), b(_);
|
|
916
|
+
return;
|
|
917
|
+
}
|
|
918
|
+
X(B);
|
|
919
|
+
}, Y = (p) => {
|
|
896
920
|
if (e !== "date") return;
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
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);
|
|
925
|
+
if (U < 1 || U > 31) return;
|
|
926
|
+
}
|
|
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);
|
|
930
|
+
if (U < 1 || U > 12) return;
|
|
931
|
+
}
|
|
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));
|
|
936
|
+
}
|
|
937
|
+
}
|
|
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);
|
|
909
945
|
if (e === "date")
|
|
910
|
-
|
|
946
|
+
v(N), n?.(N), X(C(N)), H();
|
|
911
947
|
else {
|
|
912
|
-
const [
|
|
913
|
-
if (!
|
|
914
|
-
m([
|
|
915
|
-
else if (
|
|
916
|
-
const
|
|
917
|
-
m(
|
|
918
|
-
const [
|
|
919
|
-
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();
|
|
920
956
|
}
|
|
921
957
|
}
|
|
922
958
|
},
|
|
923
|
-
[e, D,
|
|
924
|
-
),
|
|
925
|
-
const
|
|
926
|
-
|
|
927
|
-
}, [u, h,
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
}, [u, h,
|
|
931
|
-
|
|
932
|
-
},
|
|
933
|
-
|
|
934
|
-
},
|
|
935
|
-
const
|
|
936
|
-
if (e === "date") return
|
|
937
|
-
const [
|
|
938
|
-
return
|
|
939
|
-
},
|
|
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) => {
|
|
940
976
|
if (e !== "range") return !1;
|
|
941
|
-
const
|
|
942
|
-
return
|
|
943
|
-
},
|
|
977
|
+
const N = se(p), [, _] = D[1] ? D : K;
|
|
978
|
+
return ce(_) && Se(N, ce(_));
|
|
979
|
+
}, it = (p) => {
|
|
944
980
|
if (e !== "range") return !1;
|
|
945
|
-
const
|
|
946
|
-
return
|
|
947
|
-
},
|
|
948
|
-
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);
|
|
949
985
|
return /* @__PURE__ */ d("div", { className: "w-[300px] p-2 select-none", children: [
|
|
950
986
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-4 py-1", children: [
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
/* @__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 }) })
|
|
954
990
|
] }) }),
|
|
955
991
|
/* @__PURE__ */ d("div", { className: "flex gap-1 font-semibold text-slate-700 text-sm whitespace-nowrap", children: [
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
/* @__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() })
|
|
958
994
|
] }),
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */
|
|
961
|
-
/* @__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 }) })
|
|
962
998
|
] }) })
|
|
963
999
|
] }),
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
const
|
|
967
|
-
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);
|
|
968
1004
|
}) })
|
|
969
1005
|
] });
|
|
970
|
-
},
|
|
1006
|
+
}, ot = () => /* @__PURE__ */ d("div", { className: "w-[300px] p-3", children: [
|
|
971
1007
|
/* @__PURE__ */ d("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */
|
|
974
|
-
/* @__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 }) })
|
|
975
1011
|
] }),
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
] }),
|
|
978
|
-
const
|
|
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)) })
|
|
1013
|
+
] }), ct = () => {
|
|
1014
|
+
const p = Math.floor(u.getFullYear() / 12) * 12 + $ * 12, N = Array.from({ length: 12 }, (_, Q) => p + Q);
|
|
979
1015
|
return /* @__PURE__ */ d("div", { className: "w-[300px] p-3", children: [
|
|
980
1016
|
/* @__PURE__ */ d("div", { className: "flex justify-between items-center mb-4 px-2", children: [
|
|
981
|
-
/* @__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 }) }),
|
|
982
1018
|
/* @__PURE__ */ d("span", { className: "font-bold text-slate-800", children: [
|
|
983
|
-
|
|
1019
|
+
N[0],
|
|
984
1020
|
" - ",
|
|
985
|
-
|
|
1021
|
+
N[11]
|
|
986
1022
|
] }),
|
|
987
|
-
/* @__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 }) })
|
|
988
1024
|
] }),
|
|
989
|
-
/* @__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: _ }, _)) })
|
|
990
1026
|
] });
|
|
991
|
-
},
|
|
1027
|
+
}, Ve = /* @__PURE__ */ r(
|
|
992
1028
|
"div",
|
|
993
1029
|
{
|
|
994
|
-
onClick:
|
|
1030
|
+
onClick: Z,
|
|
995
1031
|
className: s(
|
|
996
1032
|
"cursor-pointer flex items-center justify-center p-1 rounded-md transition-colors",
|
|
997
|
-
|
|
1033
|
+
a ? "pointer-events-none opacity-50" : "hover:bg-slate-100 active:bg-slate-200"
|
|
998
1034
|
),
|
|
999
|
-
children: /* @__PURE__ */
|
|
1035
|
+
children: /* @__PURE__ */ r(ft, { weight: "Linear", size: 20, className: "text-slate-400" })
|
|
1000
1036
|
}
|
|
1001
1037
|
);
|
|
1002
|
-
return /* @__PURE__ */ d("div", { ref:
|
|
1003
|
-
/* @__PURE__ */
|
|
1004
|
-
|
|
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,
|
|
1005
1041
|
{
|
|
1006
1042
|
label: o,
|
|
1007
1043
|
placeholder: Array.isArray(l) ? l[0] : l,
|
|
1008
|
-
value:
|
|
1009
|
-
onChange:
|
|
1010
|
-
icon:
|
|
1011
|
-
rightIcon:
|
|
1012
|
-
disabled:
|
|
1013
|
-
required:
|
|
1014
|
-
error:
|
|
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,
|
|
1050
|
+
error: S,
|
|
1015
1051
|
maxLength: e === "date" ? 10 : void 0,
|
|
1016
|
-
onFocus:
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1052
|
+
onFocus: pe,
|
|
1053
|
+
onBlur: ke,
|
|
1054
|
+
readOnly: !T || e === "range",
|
|
1055
|
+
showClearButton: I,
|
|
1056
|
+
onClear: ue
|
|
1020
1057
|
}
|
|
1021
1058
|
) }),
|
|
1022
|
-
|
|
1059
|
+
k && /* @__PURE__ */ r(
|
|
1023
1060
|
"div",
|
|
1024
1061
|
{
|
|
1025
1062
|
className: s(
|
|
1026
1063
|
"absolute top-[calc(100%+4px)] z-[100] bg-white rounded-xl shadow-xl border border-slate-200",
|
|
1027
1064
|
"flex flex-col md:flex-row overflow-hidden animate-in fade-in zoom-in-95 duration-200",
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
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"
|
|
1031
1068
|
),
|
|
1032
1069
|
style: { width: "max-content" },
|
|
1033
|
-
onMouseDown: (
|
|
1034
|
-
children:
|
|
1035
|
-
|
|
1036
|
-
e === "range" && /* @__PURE__ */
|
|
1037
|
-
] }) :
|
|
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()
|
|
1038
1075
|
}
|
|
1039
1076
|
)
|
|
1040
1077
|
] });
|
|
1041
1078
|
}
|
|
1042
1079
|
);
|
|
1043
|
-
|
|
1044
|
-
const
|
|
1080
|
+
Jt.displayName = "MciPicker";
|
|
1081
|
+
const Qt = {
|
|
1045
1082
|
sm: {
|
|
1046
1083
|
container: "h-9 text-sm",
|
|
1047
1084
|
padding: "px-2",
|
|
@@ -1068,7 +1105,7 @@ const Kt = {
|
|
|
1068
1105
|
container: "h-12 text-base",
|
|
1069
1106
|
padding: "px-4",
|
|
1070
1107
|
iconPaddingLeft: "pl-10",
|
|
1071
|
-
iconPaddingRight: "
|
|
1108
|
+
iconPaddingRight: "pr-10",
|
|
1072
1109
|
iconSize: "w-5 h-5",
|
|
1073
1110
|
iconWrapper: "left-4",
|
|
1074
1111
|
rightIconWrapper: "right-16",
|
|
@@ -1076,294 +1113,298 @@ const Kt = {
|
|
|
1076
1113
|
dropdown: "text-base"
|
|
1077
1114
|
}
|
|
1078
1115
|
};
|
|
1079
|
-
function
|
|
1080
|
-
if (!
|
|
1116
|
+
function er(e, t, n, l) {
|
|
1117
|
+
if (!n || l) return e;
|
|
1081
1118
|
const o = t.toLowerCase();
|
|
1082
|
-
return e.filter((
|
|
1119
|
+
return e.filter((a) => a.label.toLowerCase().includes(o));
|
|
1083
1120
|
}
|
|
1084
|
-
function
|
|
1121
|
+
function tr(e, t) {
|
|
1085
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";
|
|
1086
1123
|
}
|
|
1087
|
-
function
|
|
1088
|
-
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";
|
|
1089
1126
|
}
|
|
1090
|
-
const
|
|
1127
|
+
const nr = be(
|
|
1091
1128
|
({
|
|
1092
1129
|
label: e,
|
|
1093
1130
|
placeholder: t = "Выберите...",
|
|
1094
|
-
options:
|
|
1131
|
+
options: n = [],
|
|
1095
1132
|
icon: l,
|
|
1096
1133
|
iconPosition: o = "left",
|
|
1097
|
-
size:
|
|
1098
|
-
error:
|
|
1134
|
+
size: a = "base",
|
|
1135
|
+
error: i,
|
|
1099
1136
|
disabled: c = !1,
|
|
1100
|
-
required:
|
|
1101
|
-
value:
|
|
1102
|
-
onChange:
|
|
1103
|
-
onFocus:
|
|
1104
|
-
onBlur:
|
|
1105
|
-
className:
|
|
1137
|
+
required: g = !1,
|
|
1138
|
+
value: x,
|
|
1139
|
+
onChange: y,
|
|
1140
|
+
onFocus: S,
|
|
1141
|
+
onBlur: I,
|
|
1142
|
+
className: T,
|
|
1106
1143
|
clearable: E = !1,
|
|
1107
1144
|
searchable: h = !1,
|
|
1108
|
-
onSearch:
|
|
1109
|
-
name:
|
|
1110
|
-
},
|
|
1111
|
-
const [
|
|
1112
|
-
f(!1),
|
|
1113
|
-
}, [
|
|
1114
|
-
|
|
1115
|
-
if (
|
|
1116
|
-
return document.addEventListener("mousedown",
|
|
1117
|
-
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);
|
|
1118
1155
|
};
|
|
1119
|
-
}, [
|
|
1120
|
-
|
|
1121
|
-
}, [
|
|
1122
|
-
const
|
|
1123
|
-
c || (f((
|
|
1124
|
-
}, [c,
|
|
1125
|
-
(
|
|
1126
|
-
|
|
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?.();
|
|
1127
1164
|
},
|
|
1128
|
-
[
|
|
1129
|
-
),
|
|
1130
|
-
(
|
|
1165
|
+
[x, y, I]
|
|
1166
|
+
), Z = R(
|
|
1167
|
+
(Y) => {
|
|
1131
1168
|
if (!c) {
|
|
1132
|
-
if (!
|
|
1133
|
-
|
|
1169
|
+
if (!k && (Y.key === "ArrowDown" || Y.key === "ArrowUp" || Y.key === "Enter")) {
|
|
1170
|
+
Y.preventDefault(), f(!0);
|
|
1134
1171
|
return;
|
|
1135
1172
|
}
|
|
1136
|
-
if (
|
|
1137
|
-
switch (
|
|
1173
|
+
if (k)
|
|
1174
|
+
switch (Y.key) {
|
|
1138
1175
|
case "ArrowDown":
|
|
1139
|
-
|
|
1140
|
-
(
|
|
1176
|
+
Y.preventDefault(), F(
|
|
1177
|
+
(ue) => ue < K.length - 1 ? ue + 1 : 0
|
|
1141
1178
|
);
|
|
1142
1179
|
break;
|
|
1143
1180
|
case "ArrowUp":
|
|
1144
|
-
|
|
1145
|
-
(
|
|
1181
|
+
Y.preventDefault(), F(
|
|
1182
|
+
(ue) => ue > 0 ? ue - 1 : K.length - 1
|
|
1146
1183
|
);
|
|
1147
1184
|
break;
|
|
1148
1185
|
case "Enter":
|
|
1149
|
-
|
|
1186
|
+
Y.preventDefault(), j >= 0 && K[j] && H(K[j].value);
|
|
1150
1187
|
break;
|
|
1151
1188
|
}
|
|
1152
1189
|
}
|
|
1153
1190
|
},
|
|
1154
|
-
[
|
|
1155
|
-
),
|
|
1156
|
-
(
|
|
1157
|
-
|
|
1191
|
+
[k, K, j, c, H]
|
|
1192
|
+
), G = R(
|
|
1193
|
+
(Y) => {
|
|
1194
|
+
Y.stopPropagation(), !c && (x === void 0 && m(""), y?.(""), b(""), F(-1));
|
|
1158
1195
|
},
|
|
1159
|
-
[
|
|
1160
|
-
),
|
|
1161
|
-
(
|
|
1162
|
-
|
|
1196
|
+
[x, y, c]
|
|
1197
|
+
), de = R(
|
|
1198
|
+
(Y) => {
|
|
1199
|
+
b(Y), w?.(Y), F(0);
|
|
1163
1200
|
},
|
|
1164
|
-
[
|
|
1165
|
-
),
|
|
1166
|
-
() =>
|
|
1167
|
-
[c,
|
|
1201
|
+
[w]
|
|
1202
|
+
), pe = P(() => tr(c, i), [i, c]), ke = P(
|
|
1203
|
+
() => rr(c, i, k, L),
|
|
1204
|
+
[c, i, k, L]
|
|
1168
1205
|
);
|
|
1169
|
-
return /* @__PURE__ */ d("div", { className: s("w-full",
|
|
1206
|
+
return /* @__PURE__ */ d("div", { className: s("w-full", T), ref: O, children: [
|
|
1170
1207
|
e && /* @__PURE__ */ d(
|
|
1171
1208
|
"label",
|
|
1172
1209
|
{
|
|
1173
|
-
htmlFor:
|
|
1210
|
+
htmlFor: M,
|
|
1174
1211
|
className: s(
|
|
1175
1212
|
"mb-2 block text-base font-medium",
|
|
1176
|
-
|
|
1177
|
-
|
|
1213
|
+
i ? "text-red-600" : "text-slate-700",
|
|
1214
|
+
te.label
|
|
1178
1215
|
),
|
|
1179
1216
|
children: [
|
|
1180
1217
|
e,
|
|
1181
|
-
|
|
1218
|
+
g && /* @__PURE__ */ r("span", { className: "ml-1 text-red-600", children: "*" })
|
|
1182
1219
|
]
|
|
1183
1220
|
}
|
|
1184
1221
|
),
|
|
1185
1222
|
/* @__PURE__ */ d(
|
|
1186
1223
|
"div",
|
|
1187
1224
|
{
|
|
1188
|
-
ref:
|
|
1225
|
+
ref: $,
|
|
1189
1226
|
className: "relative",
|
|
1190
|
-
onKeyDown:
|
|
1227
|
+
onKeyDown: Z,
|
|
1191
1228
|
children: [
|
|
1192
1229
|
/* @__PURE__ */ d(
|
|
1193
1230
|
"div",
|
|
1194
1231
|
{
|
|
1195
1232
|
role: "combobox",
|
|
1196
|
-
"aria-expanded":
|
|
1233
|
+
"aria-expanded": k,
|
|
1197
1234
|
"aria-haspopup": "listbox",
|
|
1198
|
-
"aria-controls": `${
|
|
1235
|
+
"aria-controls": `${M}-listbox`,
|
|
1199
1236
|
"aria-disabled": c,
|
|
1200
1237
|
tabIndex: c ? -1 : 0,
|
|
1201
|
-
onClick:
|
|
1238
|
+
onClick: B,
|
|
1202
1239
|
className: s(
|
|
1203
1240
|
"flex w-full items-center border font-normal transition-all duration-300 ease-in-out",
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
l
|
|
1207
|
-
|
|
1208
|
-
|
|
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"
|
|
1209
1247
|
),
|
|
1210
1248
|
children: [
|
|
1211
|
-
l && /* @__PURE__ */
|
|
1249
|
+
l && /* @__PURE__ */ r(
|
|
1212
1250
|
"div",
|
|
1213
1251
|
{
|
|
1214
1252
|
className: s(
|
|
1215
1253
|
"absolute top-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-300",
|
|
1216
|
-
o === "left" ?
|
|
1217
|
-
|
|
1254
|
+
o === "left" ? te.iconWrapper : te.rightIconWrapper,
|
|
1255
|
+
ke
|
|
1218
1256
|
),
|
|
1219
1257
|
children: l
|
|
1220
1258
|
}
|
|
1221
1259
|
),
|
|
1222
|
-
h &&
|
|
1260
|
+
h && k ? /* @__PURE__ */ r(
|
|
1223
1261
|
"input",
|
|
1224
1262
|
{
|
|
1225
|
-
ref:
|
|
1263
|
+
ref: z,
|
|
1226
1264
|
type: "text",
|
|
1227
1265
|
value: u,
|
|
1228
|
-
onChange: (
|
|
1266
|
+
onChange: (Y) => de(Y.target.value),
|
|
1229
1267
|
placeholder: t,
|
|
1230
|
-
className: "w-full bg-transparent outline-none",
|
|
1231
|
-
onClick: (
|
|
1268
|
+
className: "w-full min-w-0 flex-1 bg-transparent outline-none",
|
|
1269
|
+
onClick: (Y) => Y.stopPropagation()
|
|
1232
1270
|
}
|
|
1233
|
-
) : /* @__PURE__ */
|
|
1271
|
+
) : /* @__PURE__ */ r(
|
|
1234
1272
|
"span",
|
|
1235
1273
|
{
|
|
1274
|
+
title: X?.label || t,
|
|
1236
1275
|
className: s(
|
|
1237
|
-
"block truncate select-none",
|
|
1238
|
-
!
|
|
1276
|
+
"block min-w-0 flex-1 truncate select-none",
|
|
1277
|
+
!re && !c && "text-slate-400"
|
|
1239
1278
|
),
|
|
1240
1279
|
children: X?.label || t
|
|
1241
1280
|
}
|
|
1242
1281
|
),
|
|
1243
|
-
|
|
1282
|
+
ne && /* @__PURE__ */ r(
|
|
1244
1283
|
"button",
|
|
1245
1284
|
{
|
|
1246
1285
|
type: "button",
|
|
1247
|
-
onClick:
|
|
1286
|
+
onClick: G,
|
|
1248
1287
|
className: s(
|
|
1249
1288
|
"absolute top-1/2 -translate-y-1/2 text-slate-400 hover:text-black transition-colors cursor-pointer",
|
|
1250
|
-
|
|
1289
|
+
le ? a === "sm" ? "right-8" : a === "md" ? "right-9" : "right-10" : a === "sm" ? "right-7" : a === "md" ? "right-8" : "right-9"
|
|
1251
1290
|
),
|
|
1252
1291
|
"aria-label": "Очистить",
|
|
1253
|
-
children: /* @__PURE__ */
|
|
1292
|
+
children: /* @__PURE__ */ r(ge, { className: te.iconSize })
|
|
1254
1293
|
}
|
|
1255
1294
|
),
|
|
1256
|
-
/* @__PURE__ */
|
|
1295
|
+
/* @__PURE__ */ r(
|
|
1257
1296
|
"div",
|
|
1258
1297
|
{
|
|
1259
1298
|
className: s(
|
|
1260
|
-
"absolute top-1/2
|
|
1261
|
-
|
|
1262
|
-
|
|
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
|
|
1263
1303
|
),
|
|
1264
|
-
children: /* @__PURE__ */
|
|
1304
|
+
children: /* @__PURE__ */ r(Re, { className: te.iconSize })
|
|
1265
1305
|
}
|
|
1266
1306
|
)
|
|
1267
1307
|
]
|
|
1268
1308
|
}
|
|
1269
1309
|
),
|
|
1270
|
-
|
|
1310
|
+
k && !c && /* @__PURE__ */ r(
|
|
1271
1311
|
"div",
|
|
1272
1312
|
{
|
|
1273
|
-
id: `${
|
|
1313
|
+
id: `${M}-listbox`,
|
|
1274
1314
|
role: "listbox",
|
|
1275
1315
|
className: s(
|
|
1276
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",
|
|
1277
|
-
|
|
1317
|
+
te.dropdown
|
|
1278
1318
|
),
|
|
1279
|
-
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(
|
|
1280
1320
|
"div",
|
|
1281
1321
|
{
|
|
1282
1322
|
role: "option",
|
|
1283
|
-
"aria-selected":
|
|
1284
|
-
onClick: () =>
|
|
1323
|
+
"aria-selected": V === Y.value,
|
|
1324
|
+
onClick: () => H(Y.value),
|
|
1325
|
+
title: Y.label,
|
|
1285
1326
|
className: s(
|
|
1286
|
-
"cursor-pointer px-3 py-2 font-normal transition-colors hover:bg-slate-100 rounded-sm",
|
|
1287
|
-
|
|
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" : ""
|
|
1288
1329
|
),
|
|
1289
|
-
children:
|
|
1330
|
+
children: Y.label
|
|
1290
1331
|
},
|
|
1291
|
-
|
|
1332
|
+
Y.value
|
|
1292
1333
|
))
|
|
1293
1334
|
}
|
|
1294
1335
|
)
|
|
1295
1336
|
]
|
|
1296
1337
|
}
|
|
1297
1338
|
),
|
|
1298
|
-
|
|
1339
|
+
i && /* @__PURE__ */ r("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: i })
|
|
1299
1340
|
] });
|
|
1300
1341
|
}
|
|
1301
1342
|
);
|
|
1302
|
-
|
|
1303
|
-
function
|
|
1304
|
-
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 }) });
|
|
1305
1346
|
}
|
|
1306
|
-
function
|
|
1347
|
+
function sr(e) {
|
|
1307
1348
|
if (e != null)
|
|
1308
1349
|
return typeof e == "number" ? `${e}px` : e;
|
|
1309
1350
|
}
|
|
1310
|
-
function
|
|
1311
|
-
return !t ||
|
|
1312
|
-
const
|
|
1313
|
-
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;
|
|
1314
1355
|
});
|
|
1315
1356
|
}
|
|
1316
|
-
function
|
|
1357
|
+
function fn({
|
|
1317
1358
|
columns: e,
|
|
1318
1359
|
data: t = [],
|
|
1319
|
-
loading:
|
|
1360
|
+
loading: n = !1,
|
|
1320
1361
|
skeletonRows: l = 5,
|
|
1321
1362
|
noDataText: o = "",
|
|
1322
|
-
sort:
|
|
1323
|
-
onSortChange:
|
|
1363
|
+
sort: a,
|
|
1364
|
+
onSortChange: i,
|
|
1324
1365
|
className: c,
|
|
1325
|
-
headerClassName:
|
|
1326
|
-
bodyClassName:
|
|
1327
|
-
rowKey:
|
|
1328
|
-
rowSelection:
|
|
1366
|
+
headerClassName: g,
|
|
1367
|
+
bodyClassName: x,
|
|
1368
|
+
rowKey: y = "id",
|
|
1369
|
+
rowSelection: S
|
|
1329
1370
|
}) {
|
|
1330
|
-
const [
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
}, [
|
|
1334
|
-
const
|
|
1335
|
-
() =>
|
|
1336
|
-
[
|
|
1337
|
-
),
|
|
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(
|
|
1338
1379
|
(m) => {
|
|
1339
1380
|
if (!m.sortable) return;
|
|
1340
1381
|
let u = null;
|
|
1341
|
-
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);
|
|
1342
1383
|
},
|
|
1343
|
-
[E,
|
|
1344
|
-
),
|
|
1345
|
-
if (!
|
|
1346
|
-
const { onChange: u, getCheckboxProps:
|
|
1384
|
+
[E, a, i]
|
|
1385
|
+
), k = (m) => {
|
|
1386
|
+
if (!S) return;
|
|
1387
|
+
const { onChange: u, getCheckboxProps: b } = S;
|
|
1347
1388
|
if (m.target.checked) {
|
|
1348
|
-
const
|
|
1349
|
-
u(
|
|
1389
|
+
const $ = M.filter((z) => !b?.(z)?.disabled).map((z) => z[y]);
|
|
1390
|
+
u($);
|
|
1350
1391
|
} else
|
|
1351
1392
|
u([]);
|
|
1352
1393
|
}, f = (m, u) => {
|
|
1353
|
-
if (!
|
|
1354
|
-
const { selectedRowKeys:
|
|
1355
|
-
|
|
1356
|
-
},
|
|
1357
|
-
if (!
|
|
1358
|
-
const m =
|
|
1394
|
+
if (!S) return;
|
|
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);
|
|
1359
1400
|
return m.length === 0 ? !1 : m.every(
|
|
1360
|
-
(u) =>
|
|
1401
|
+
(u) => S.selectedRowKeys.includes(u[y])
|
|
1361
1402
|
);
|
|
1362
|
-
}, [
|
|
1363
|
-
|
|
1364
|
-
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))
|
|
1365
1406
|
] });
|
|
1366
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ r(
|
|
1367
1408
|
"div",
|
|
1368
1409
|
{
|
|
1369
1410
|
className: s(
|
|
@@ -1376,75 +1417,75 @@ function ir({
|
|
|
1376
1417
|
c
|
|
1377
1418
|
),
|
|
1378
1419
|
children: /* @__PURE__ */ d("div", { className: "inline-block min-w-full align-middle", children: [
|
|
1379
|
-
/* @__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: [
|
|
1380
1421
|
D(),
|
|
1381
|
-
/* @__PURE__ */
|
|
1382
|
-
|
|
1383
|
-
|
|
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,
|
|
1384
1425
|
{
|
|
1385
|
-
checked:
|
|
1386
|
-
onChange:
|
|
1426
|
+
checked: L,
|
|
1427
|
+
onChange: k,
|
|
1387
1428
|
variant: "yellow",
|
|
1388
|
-
disabled:
|
|
1429
|
+
disabled: n || M.length === 0
|
|
1389
1430
|
}
|
|
1390
1431
|
) }) }),
|
|
1391
|
-
e.map((m) => /* @__PURE__ */
|
|
1432
|
+
e.map((m) => /* @__PURE__ */ r(
|
|
1392
1433
|
"th",
|
|
1393
1434
|
{
|
|
1394
|
-
onClick: () =>
|
|
1435
|
+
onClick: () => O(m),
|
|
1395
1436
|
className: s(
|
|
1396
1437
|
"px-4 py-3 text-left text-sm font-medium text-slate-700 transition-colors",
|
|
1397
1438
|
"whitespace-nowrap overflow-hidden text-ellipsis",
|
|
1398
1439
|
m.align === "center" && "text-center",
|
|
1399
1440
|
m.align === "right" && "text-right",
|
|
1400
1441
|
m.sortable && "cursor-pointer hover:bg-slate-200",
|
|
1401
|
-
|
|
1442
|
+
g
|
|
1402
1443
|
),
|
|
1403
1444
|
children: /* @__PURE__ */ d("div", { className: s("flex items-center gap-2 min-w-0", m.align === "right" && "justify-end"), children: [
|
|
1404
|
-
/* @__PURE__ */
|
|
1405
|
-
|
|
1445
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate", title: m.title, children: m.title }),
|
|
1446
|
+
v(m)
|
|
1406
1447
|
] })
|
|
1407
1448
|
},
|
|
1408
1449
|
m.key
|
|
1409
1450
|
))
|
|
1410
1451
|
] }) })
|
|
1411
1452
|
] }) }),
|
|
1412
|
-
/* @__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: [
|
|
1413
1454
|
D(),
|
|
1414
|
-
/* @__PURE__ */
|
|
1415
|
-
|
|
1416
|
-
e.map((
|
|
1417
|
-
] }, u)) :
|
|
1418
|
-
/* @__PURE__ */
|
|
1419
|
-
/* @__PURE__ */
|
|
1420
|
-
] }) }) }) :
|
|
1421
|
-
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;
|
|
1422
1463
|
return /* @__PURE__ */ d("tr", { className: "group transition-colors hover:bg-slate-50", children: [
|
|
1423
|
-
|
|
1424
|
-
|
|
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,
|
|
1425
1466
|
{
|
|
1426
|
-
checked:
|
|
1427
|
-
disabled:
|
|
1467
|
+
checked: j,
|
|
1468
|
+
disabled: F,
|
|
1428
1469
|
variant: "yellow",
|
|
1429
|
-
onChange: (
|
|
1470
|
+
onChange: ($) => f(m, $.target.checked)
|
|
1430
1471
|
}
|
|
1431
1472
|
) }) }),
|
|
1432
|
-
e.map((
|
|
1433
|
-
const
|
|
1434
|
-
return /* @__PURE__ */
|
|
1473
|
+
e.map(($) => {
|
|
1474
|
+
const z = m[$.key], V = $.render ? $.render(z, m) : String(z ?? "-");
|
|
1475
|
+
return /* @__PURE__ */ r(
|
|
1435
1476
|
"td",
|
|
1436
1477
|
{
|
|
1437
1478
|
className: s(
|
|
1438
1479
|
"align-top px-4 py-3 text-sm font-normal text-black",
|
|
1439
1480
|
"min-w-0 whitespace-normal",
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1481
|
+
$.align === "center" && "text-center",
|
|
1482
|
+
$.align === "right" && "text-right",
|
|
1483
|
+
x,
|
|
1484
|
+
$.className
|
|
1444
1485
|
),
|
|
1445
|
-
children: /* @__PURE__ */
|
|
1486
|
+
children: /* @__PURE__ */ r(lr, { title: typeof V == "string" ? V : void 0, children: V })
|
|
1446
1487
|
},
|
|
1447
|
-
|
|
1488
|
+
$.key
|
|
1448
1489
|
);
|
|
1449
1490
|
})
|
|
1450
1491
|
] }, u);
|
|
@@ -1454,13 +1495,13 @@ function ir({
|
|
|
1454
1495
|
}
|
|
1455
1496
|
);
|
|
1456
1497
|
}
|
|
1457
|
-
const
|
|
1498
|
+
const ir = {
|
|
1458
1499
|
uz: {
|
|
1459
1500
|
dragAndDrop: "Faylni bu yerga torting",
|
|
1460
1501
|
clickToUpload: "yoki bosib tanlang",
|
|
1461
1502
|
or: "yoki",
|
|
1462
1503
|
dropHereTitle: "Faylni shu yerga yuklang",
|
|
1463
|
-
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"}`,
|
|
1464
1505
|
selectedFiles: "Tanlangan fayllar",
|
|
1465
1506
|
clearAll: "Barchasini o‘chirish",
|
|
1466
1507
|
uploading: "Yuklanmoqda...",
|
|
@@ -1485,7 +1526,7 @@ const rn = {
|
|
|
1485
1526
|
clickToUpload: "или выберите нажатием",
|
|
1486
1527
|
or: "или",
|
|
1487
1528
|
dropHereTitle: "Загрузите свой файл сюда",
|
|
1488
|
-
fileRequirements: (e, t,
|
|
1529
|
+
fileRequirements: (e, t, n, l) => `${e ? `Максимум ${t} файлов` : "1 файл"} • До ${n}MB • ${l !== "*/*" ? `Формат: ${l}` : "Все форматы"}`,
|
|
1489
1530
|
selectedFiles: "Выбранные файлы",
|
|
1490
1531
|
clearAll: "Очистить все",
|
|
1491
1532
|
uploading: "Загружается...",
|
|
@@ -1510,7 +1551,7 @@ const rn = {
|
|
|
1510
1551
|
clickToUpload: "or click to select",
|
|
1511
1552
|
or: "or",
|
|
1512
1553
|
dropHereTitle: "Upload your file here",
|
|
1513
|
-
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"}`,
|
|
1514
1555
|
selectedFiles: "Selected files",
|
|
1515
1556
|
clearAll: "Clear all",
|
|
1516
1557
|
uploading: "Uploading...",
|
|
@@ -1530,7 +1571,7 @@ const rn = {
|
|
|
1530
1571
|
audio: "Audio",
|
|
1531
1572
|
document: "Document"
|
|
1532
1573
|
}
|
|
1533
|
-
},
|
|
1574
|
+
}, Pe = [
|
|
1534
1575
|
"pdf",
|
|
1535
1576
|
"doc",
|
|
1536
1577
|
"docx",
|
|
@@ -1544,7 +1585,7 @@ const rn = {
|
|
|
1544
1585
|
"png",
|
|
1545
1586
|
"bmp",
|
|
1546
1587
|
"tiff"
|
|
1547
|
-
],
|
|
1588
|
+
], or = [
|
|
1548
1589
|
"zip",
|
|
1549
1590
|
"rar",
|
|
1550
1591
|
"7z",
|
|
@@ -1584,10 +1625,10 @@ const rn = {
|
|
|
1584
1625
|
"ksh",
|
|
1585
1626
|
"csh",
|
|
1586
1627
|
"fish"
|
|
1587
|
-
],
|
|
1628
|
+
], ye = new Set(Pe), ve = new Set(or), cr = Pe.map((e) => `.${e}`).join(","), dr = {
|
|
1588
1629
|
"image/*": ["jpg", "jpeg", "png", "bmp", "tiff"],
|
|
1589
1630
|
"text/*": ["txt"]
|
|
1590
|
-
},
|
|
1631
|
+
}, ur = {
|
|
1591
1632
|
"application/pdf": ["pdf"],
|
|
1592
1633
|
"application/msword": ["doc"],
|
|
1593
1634
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"],
|
|
@@ -1601,7 +1642,7 @@ const rn = {
|
|
|
1601
1642
|
"image/png": ["png"],
|
|
1602
1643
|
"image/bmp": ["bmp"],
|
|
1603
1644
|
"image/tiff": ["tiff"]
|
|
1604
|
-
},
|
|
1645
|
+
}, fr = /* @__PURE__ */ new Set([
|
|
1605
1646
|
"application/zip",
|
|
1606
1647
|
"application/x-zip-compressed",
|
|
1607
1648
|
"application/x-rar-compressed",
|
|
@@ -1620,90 +1661,90 @@ const rn = {
|
|
|
1620
1661
|
"text/x-shellscript",
|
|
1621
1662
|
"application/x-powershell"
|
|
1622
1663
|
]);
|
|
1623
|
-
function
|
|
1624
|
-
const t = e.trim().toLowerCase(),
|
|
1625
|
-
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);
|
|
1626
1667
|
}
|
|
1627
|
-
function
|
|
1668
|
+
function hr(e) {
|
|
1628
1669
|
return e.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean);
|
|
1629
1670
|
}
|
|
1630
|
-
function
|
|
1671
|
+
function ze(e) {
|
|
1631
1672
|
if (!e || e === "*/*") return null;
|
|
1632
|
-
const t =
|
|
1673
|
+
const t = hr(e), n = /* @__PURE__ */ new Set();
|
|
1633
1674
|
for (const l of t)
|
|
1634
1675
|
if (l !== "*/*") {
|
|
1635
1676
|
if (l.endsWith("/*")) {
|
|
1636
|
-
const o =
|
|
1677
|
+
const o = dr[l];
|
|
1637
1678
|
if (!o) continue;
|
|
1638
|
-
for (const
|
|
1639
|
-
|
|
1679
|
+
for (const a of o)
|
|
1680
|
+
ye.has(a) && !ve.has(a) && n.add(a);
|
|
1640
1681
|
continue;
|
|
1641
1682
|
}
|
|
1642
1683
|
if (l.startsWith(".")) {
|
|
1643
1684
|
const o = l.slice(1);
|
|
1644
|
-
|
|
1685
|
+
ye.has(o) && !ve.has(o) && n.add(o);
|
|
1645
1686
|
continue;
|
|
1646
1687
|
}
|
|
1647
1688
|
if (l.includes("/")) {
|
|
1648
|
-
const o =
|
|
1689
|
+
const o = ur[l];
|
|
1649
1690
|
if (!o) continue;
|
|
1650
|
-
for (const
|
|
1651
|
-
|
|
1691
|
+
for (const a of o)
|
|
1692
|
+
ye.has(a) && !ve.has(a) && n.add(a);
|
|
1652
1693
|
continue;
|
|
1653
1694
|
}
|
|
1654
|
-
|
|
1695
|
+
ye.has(l) && !ve.has(l) && n.add(l);
|
|
1655
1696
|
}
|
|
1656
|
-
return
|
|
1697
|
+
return n.size > 0 ? n : null;
|
|
1657
1698
|
}
|
|
1658
|
-
function
|
|
1659
|
-
const t =
|
|
1660
|
-
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;
|
|
1661
1702
|
}
|
|
1662
|
-
function
|
|
1663
|
-
const t =
|
|
1664
|
-
return t ? Array.from(t).join(", ") :
|
|
1703
|
+
function br(e) {
|
|
1704
|
+
const t = ze(e);
|
|
1705
|
+
return t ? Array.from(t).join(", ") : Pe.join(", ");
|
|
1665
1706
|
}
|
|
1666
|
-
function
|
|
1707
|
+
function gr(e) {
|
|
1667
1708
|
switch (e.type.split("/")[0]) {
|
|
1668
1709
|
case "image":
|
|
1669
|
-
return /* @__PURE__ */
|
|
1710
|
+
return /* @__PURE__ */ r(vt, { className: "h-5 w-5 text-blue-500" });
|
|
1670
1711
|
case "video":
|
|
1671
|
-
return /* @__PURE__ */
|
|
1712
|
+
return /* @__PURE__ */ r(yt, { className: "h-5 w-5 text-purple-500" });
|
|
1672
1713
|
case "audio":
|
|
1673
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ r(wt, { className: "h-5 w-5 text-green-500" });
|
|
1674
1715
|
default:
|
|
1675
|
-
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" });
|
|
1676
1717
|
}
|
|
1677
1718
|
}
|
|
1678
|
-
function
|
|
1719
|
+
function xr(e) {
|
|
1679
1720
|
if (e === 0) return "0 Bytes";
|
|
1680
|
-
const t = 1024,
|
|
1681
|
-
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];
|
|
1682
1723
|
}
|
|
1683
|
-
function
|
|
1684
|
-
const
|
|
1685
|
-
return e.size <=
|
|
1724
|
+
function wr(e, t) {
|
|
1725
|
+
const n = t * 1024 * 1024;
|
|
1726
|
+
return e.size <= n;
|
|
1686
1727
|
}
|
|
1687
|
-
function
|
|
1688
|
-
const
|
|
1689
|
-
if (l &&
|
|
1728
|
+
function yr(e, t) {
|
|
1729
|
+
const n = mr(e.name), l = e.type.trim().toLowerCase();
|
|
1730
|
+
if (l && fr.has(l))
|
|
1690
1731
|
return { isValid: !1, reason: "blocked" };
|
|
1691
|
-
if (!
|
|
1692
|
-
if (
|
|
1693
|
-
if (!
|
|
1694
|
-
const o =
|
|
1695
|
-
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 };
|
|
1696
1737
|
}
|
|
1697
|
-
function
|
|
1738
|
+
function vr(e) {
|
|
1698
1739
|
return new Promise((t) => {
|
|
1699
1740
|
if (e.type.startsWith("image/")) {
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1741
|
+
const n = new FileReader();
|
|
1742
|
+
n.onload = (l) => t(l.target?.result ?? ""), n.readAsDataURL(e);
|
|
1702
1743
|
} else
|
|
1703
1744
|
t("");
|
|
1704
1745
|
});
|
|
1705
1746
|
}
|
|
1706
|
-
const
|
|
1747
|
+
const Nr = {
|
|
1707
1748
|
blue: {
|
|
1708
1749
|
dropBorder: "border-blue-200 hover:border-blue-300",
|
|
1709
1750
|
dropBg: "bg-blue-50/40 hover:bg-blue-50/60",
|
|
@@ -1728,147 +1769,147 @@ const wn = {
|
|
|
1728
1769
|
fileIconImg: "bg-blue-50 text-blue-600",
|
|
1729
1770
|
fileIconDoc: "bg-green-50 text-green-600"
|
|
1730
1771
|
}
|
|
1731
|
-
},
|
|
1772
|
+
}, mn = ({
|
|
1732
1773
|
multiple: e = !1,
|
|
1733
1774
|
accept: t = "*/*",
|
|
1734
|
-
maxSize:
|
|
1775
|
+
maxSize: n = 10,
|
|
1735
1776
|
maxFiles: l = 5,
|
|
1736
1777
|
disabled: o = !1,
|
|
1737
|
-
label:
|
|
1738
|
-
required:
|
|
1778
|
+
label: a,
|
|
1779
|
+
required: i = !1,
|
|
1739
1780
|
error: c,
|
|
1740
|
-
className:
|
|
1741
|
-
onFilesChange:
|
|
1742
|
-
onUpload:
|
|
1743
|
-
showPreview:
|
|
1744
|
-
locale:
|
|
1745
|
-
showFileTypeIcon:
|
|
1781
|
+
className: g,
|
|
1782
|
+
onFilesChange: x,
|
|
1783
|
+
onUpload: y,
|
|
1784
|
+
showPreview: S = !0,
|
|
1785
|
+
locale: I = "uz",
|
|
1786
|
+
showFileTypeIcon: T = !0,
|
|
1746
1787
|
variant: E = "yellow",
|
|
1747
1788
|
customValidator: h
|
|
1748
1789
|
}) => {
|
|
1749
|
-
const [
|
|
1750
|
-
const
|
|
1751
|
-
|
|
1752
|
-
}, []),
|
|
1753
|
-
for (const
|
|
1754
|
-
URL.revokeObjectURL(
|
|
1755
|
-
|
|
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();
|
|
1756
1797
|
}, []);
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
}, [
|
|
1760
|
-
const
|
|
1761
|
-
let
|
|
1762
|
-
|
|
1763
|
-
}, [
|
|
1764
|
-
async (
|
|
1765
|
-
const
|
|
1766
|
-
for (const
|
|
1767
|
-
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) {
|
|
1768
1809
|
alert(D.maxFilesError(l));
|
|
1769
1810
|
break;
|
|
1770
1811
|
}
|
|
1771
|
-
if (!
|
|
1772
|
-
alert(D.fileSizeError(
|
|
1812
|
+
if (!wr(B, n)) {
|
|
1813
|
+
alert(D.fileSizeError(B.name, n));
|
|
1773
1814
|
continue;
|
|
1774
1815
|
}
|
|
1775
|
-
const
|
|
1776
|
-
if (!
|
|
1777
|
-
|
|
1816
|
+
const H = yr(B, t);
|
|
1817
|
+
if (!H.isValid) {
|
|
1818
|
+
H.reason === "blocked" ? alert(D.blockedFileTypeError(B.name)) : alert(D.fileTypeError(B.name));
|
|
1778
1819
|
continue;
|
|
1779
1820
|
}
|
|
1780
1821
|
if (h) {
|
|
1781
|
-
const
|
|
1782
|
-
if (
|
|
1783
|
-
alert(
|
|
1822
|
+
const pe = h(B);
|
|
1823
|
+
if (pe) {
|
|
1824
|
+
alert(pe);
|
|
1784
1825
|
continue;
|
|
1785
1826
|
}
|
|
1786
1827
|
}
|
|
1787
|
-
const
|
|
1788
|
-
|
|
1828
|
+
const Z = await vr(B), G = y ? "uploading" : "success", de = y ? 0 : 100;
|
|
1829
|
+
q.push({
|
|
1789
1830
|
id: Math.random().toString(36).substr(2, 9),
|
|
1790
|
-
file:
|
|
1791
|
-
preview:
|
|
1792
|
-
progress:
|
|
1793
|
-
status:
|
|
1831
|
+
file: B,
|
|
1832
|
+
preview: Z,
|
|
1833
|
+
progress: de,
|
|
1834
|
+
status: G
|
|
1794
1835
|
});
|
|
1795
1836
|
}
|
|
1796
|
-
if (
|
|
1797
|
-
const
|
|
1798
|
-
if (
|
|
1799
|
-
|
|
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);
|
|
1800
1841
|
try {
|
|
1801
|
-
const
|
|
1802
|
-
...
|
|
1803
|
-
progress: Math.min(100, (
|
|
1842
|
+
const H = B.map((Z, G) => ({
|
|
1843
|
+
...Z,
|
|
1844
|
+
progress: Math.min(100, (G + 1) / B.length * 100)
|
|
1804
1845
|
}));
|
|
1805
|
-
|
|
1806
|
-
(
|
|
1807
|
-
...
|
|
1846
|
+
M(H), await y(H), M(
|
|
1847
|
+
(Z) => Z.map((G) => ({
|
|
1848
|
+
...G,
|
|
1808
1849
|
status: "success",
|
|
1809
1850
|
progress: 100
|
|
1810
1851
|
}))
|
|
1811
1852
|
);
|
|
1812
|
-
} catch (
|
|
1813
|
-
|
|
1814
|
-
(
|
|
1815
|
-
...
|
|
1853
|
+
} catch (H) {
|
|
1854
|
+
M(
|
|
1855
|
+
(Z) => Z.map((G) => ({
|
|
1856
|
+
...G,
|
|
1816
1857
|
status: "error",
|
|
1817
|
-
error:
|
|
1858
|
+
error: H instanceof Error ? H.message : D.uploadFailed
|
|
1818
1859
|
}))
|
|
1819
1860
|
);
|
|
1820
1861
|
} finally {
|
|
1821
|
-
|
|
1862
|
+
L(!1);
|
|
1822
1863
|
}
|
|
1823
1864
|
}
|
|
1824
1865
|
}
|
|
1825
1866
|
},
|
|
1826
1867
|
[
|
|
1827
|
-
|
|
1868
|
+
w,
|
|
1828
1869
|
l,
|
|
1829
1870
|
h,
|
|
1830
1871
|
D,
|
|
1831
1872
|
t,
|
|
1832
|
-
|
|
1873
|
+
n,
|
|
1833
1874
|
e,
|
|
1834
|
-
|
|
1835
|
-
|
|
1875
|
+
x,
|
|
1876
|
+
y
|
|
1836
1877
|
]
|
|
1837
|
-
), X =
|
|
1838
|
-
(
|
|
1839
|
-
|
|
1878
|
+
), X = R(
|
|
1879
|
+
(A) => {
|
|
1880
|
+
A.preventDefault(), o || k(!0);
|
|
1840
1881
|
},
|
|
1841
1882
|
[o]
|
|
1842
|
-
),
|
|
1843
|
-
|
|
1844
|
-
}, []),
|
|
1845
|
-
(
|
|
1846
|
-
if (
|
|
1847
|
-
const
|
|
1848
|
-
|
|
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);
|
|
1849
1890
|
},
|
|
1850
|
-
[o,
|
|
1851
|
-
),
|
|
1852
|
-
(
|
|
1853
|
-
const
|
|
1854
|
-
|
|
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 = ""));
|
|
1855
1896
|
},
|
|
1856
|
-
[
|
|
1857
|
-
),
|
|
1858
|
-
(
|
|
1859
|
-
|
|
1860
|
-
const
|
|
1861
|
-
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;
|
|
1862
1903
|
});
|
|
1863
1904
|
},
|
|
1864
|
-
[
|
|
1865
|
-
),
|
|
1866
|
-
|
|
1867
|
-
}, [
|
|
1868
|
-
|
|
1905
|
+
[x, F]
|
|
1906
|
+
), ie = R(() => {
|
|
1907
|
+
$(), M([]), x?.([]);
|
|
1908
|
+
}, [x, $]), K = R(() => {
|
|
1909
|
+
v.current?.click();
|
|
1869
1910
|
}, []);
|
|
1870
|
-
return /* @__PURE__ */ d("div", { className: s("w-full",
|
|
1871
|
-
|
|
1911
|
+
return /* @__PURE__ */ d("div", { className: s("w-full", g), children: [
|
|
1912
|
+
a && /* @__PURE__ */ d(
|
|
1872
1913
|
"label",
|
|
1873
1914
|
{
|
|
1874
1915
|
className: s(
|
|
@@ -1876,8 +1917,8 @@ const wn = {
|
|
|
1876
1917
|
c ? "text-red-600" : "text-slate-700"
|
|
1877
1918
|
),
|
|
1878
1919
|
children: [
|
|
1879
|
-
|
|
1880
|
-
|
|
1920
|
+
a,
|
|
1921
|
+
i && /* @__PURE__ */ r("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
|
|
1881
1922
|
]
|
|
1882
1923
|
}
|
|
1883
1924
|
),
|
|
@@ -1888,179 +1929,179 @@ const wn = {
|
|
|
1888
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",
|
|
1889
1930
|
m.dropBorder,
|
|
1890
1931
|
m.dropBg,
|
|
1891
|
-
|
|
1932
|
+
O && m.dropActive,
|
|
1892
1933
|
o && "cursor-not-allowed opacity-60",
|
|
1893
1934
|
c && "border-red-600 bg-red-50/30"
|
|
1894
1935
|
),
|
|
1895
1936
|
onDragOver: X,
|
|
1896
|
-
onDragLeave:
|
|
1897
|
-
onDrop:
|
|
1898
|
-
onClick:
|
|
1937
|
+
onDragLeave: re,
|
|
1938
|
+
onDrop: ne,
|
|
1939
|
+
onClick: K,
|
|
1899
1940
|
children: [
|
|
1900
|
-
/* @__PURE__ */
|
|
1941
|
+
/* @__PURE__ */ r(
|
|
1901
1942
|
"input",
|
|
1902
1943
|
{
|
|
1903
|
-
ref:
|
|
1944
|
+
ref: v,
|
|
1904
1945
|
type: "file",
|
|
1905
1946
|
multiple: e,
|
|
1906
1947
|
accept: u,
|
|
1907
|
-
onChange:
|
|
1948
|
+
onChange: le,
|
|
1908
1949
|
disabled: o,
|
|
1909
1950
|
className: "hidden"
|
|
1910
1951
|
}
|
|
1911
1952
|
),
|
|
1912
1953
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-3", children: [
|
|
1913
|
-
/* @__PURE__ */
|
|
1914
|
-
/* @__PURE__ */
|
|
1915
|
-
/* @__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) })
|
|
1916
1957
|
] })
|
|
1917
1958
|
]
|
|
1918
1959
|
}
|
|
1919
1960
|
),
|
|
1920
|
-
|
|
1961
|
+
w.length > 0 && /* @__PURE__ */ d("div", { className: "mt-4 space-y-3", children: [
|
|
1921
1962
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
1922
1963
|
/* @__PURE__ */ d("span", { className: "text-sm font-medium text-slate-700", children: [
|
|
1923
1964
|
D.selectedFiles,
|
|
1924
1965
|
" (",
|
|
1925
|
-
|
|
1966
|
+
w.length,
|
|
1926
1967
|
")"
|
|
1927
1968
|
] }),
|
|
1928
|
-
|
|
1969
|
+
w.length > 1 && /* @__PURE__ */ r(
|
|
1929
1970
|
"button",
|
|
1930
1971
|
{
|
|
1931
1972
|
type: "button",
|
|
1932
|
-
onClick:
|
|
1973
|
+
onClick: ie,
|
|
1933
1974
|
disabled: o || f,
|
|
1934
1975
|
className: "text-sm font-medium text-red-600 disabled:opacity-50",
|
|
1935
1976
|
children: D.clearAll
|
|
1936
1977
|
}
|
|
1937
1978
|
)
|
|
1938
1979
|
] }),
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
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";
|
|
1941
1982
|
return /* @__PURE__ */ d(
|
|
1942
1983
|
"div",
|
|
1943
1984
|
{
|
|
1944
1985
|
className: s(
|
|
1945
1986
|
"flex items-center justify-between rounded-2xl border border-slate-200 p-4",
|
|
1946
|
-
|
|
1987
|
+
A.status === "error" && "border-red-600"
|
|
1947
1988
|
),
|
|
1948
1989
|
children: [
|
|
1949
1990
|
/* @__PURE__ */ d("div", { className: "flex min-w-0 items-center gap-4", children: [
|
|
1950
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ r(
|
|
1951
1992
|
"div",
|
|
1952
1993
|
{
|
|
1953
1994
|
className: s(
|
|
1954
1995
|
"flex h-14 w-14 items-center justify-center rounded-2xl",
|
|
1955
|
-
|
|
1996
|
+
q
|
|
1956
1997
|
),
|
|
1957
|
-
children:
|
|
1998
|
+
children: S && A.preview ? /* @__PURE__ */ r(
|
|
1958
1999
|
"img",
|
|
1959
2000
|
{
|
|
1960
|
-
src:
|
|
1961
|
-
alt:
|
|
2001
|
+
src: A.preview,
|
|
2002
|
+
alt: A.file.name,
|
|
1962
2003
|
className: "h-10 w-10 rounded-xl object-cover"
|
|
1963
2004
|
}
|
|
1964
|
-
) :
|
|
2005
|
+
) : T ? gr(A.file) : /* @__PURE__ */ r(tt, { className: "h-6 w-6 text-slate-500" })
|
|
1965
2006
|
}
|
|
1966
2007
|
),
|
|
1967
2008
|
/* @__PURE__ */ d("div", { className: "min-w-0", children: [
|
|
1968
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ r("p", { className: "truncate text-lg font-semibold text-primary", children: A.file.name }),
|
|
1969
2010
|
/* @__PURE__ */ d("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-sm text-slate-500", children: [
|
|
1970
|
-
/* @__PURE__ */
|
|
1971
|
-
|
|
1972
|
-
/* @__PURE__ */
|
|
2011
|
+
/* @__PURE__ */ r("span", { children: xr(A.file.size) }),
|
|
2012
|
+
A.status === "uploading" && /* @__PURE__ */ d(he, { children: [
|
|
2013
|
+
/* @__PURE__ */ r("span", { children: "•" }),
|
|
1973
2014
|
/* @__PURE__ */ d("span", { className: "inline-flex items-center", children: [
|
|
1974
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ r(Qe, { className: "mr-1 h-5 w-5 animate-spin" }),
|
|
1975
2016
|
D.uploading
|
|
1976
2017
|
] })
|
|
1977
2018
|
] }),
|
|
1978
|
-
|
|
1979
|
-
/* @__PURE__ */
|
|
1980
|
-
/* @__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 })
|
|
1981
2022
|
] })
|
|
1982
2023
|
] }),
|
|
1983
|
-
|
|
2024
|
+
A.status === "uploading" && /* @__PURE__ */ r("div", { className: s("mt-2 h-1.5 w-full rounded-full bg-slate-200"), children: /* @__PURE__ */ r(
|
|
1984
2025
|
"div",
|
|
1985
2026
|
{
|
|
1986
2027
|
className: s(
|
|
1987
2028
|
"h-1.5 rounded-full transition-all duration-300",
|
|
1988
2029
|
m.progressFill
|
|
1989
2030
|
),
|
|
1990
|
-
style: { width: `${
|
|
2031
|
+
style: { width: `${A.progress}%` }
|
|
1991
2032
|
}
|
|
1992
2033
|
) }),
|
|
1993
|
-
|
|
2034
|
+
A.status === "error" && A.error && /* @__PURE__ */ r("p", { className: "mt-2 text-sm font-normal text-red-600", children: A.error })
|
|
1994
2035
|
] })
|
|
1995
2036
|
] }),
|
|
1996
2037
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
1997
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ r(
|
|
1998
2039
|
"button",
|
|
1999
2040
|
{
|
|
2000
2041
|
type: "button",
|
|
2001
|
-
onClick: (
|
|
2002
|
-
|
|
2042
|
+
onClick: (H) => {
|
|
2043
|
+
H.stopPropagation(), B || z(A);
|
|
2003
2044
|
},
|
|
2004
|
-
disabled:
|
|
2045
|
+
disabled: B,
|
|
2005
2046
|
className: "rounded-xl p-2 hover:bg-slate-100 hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2006
2047
|
title: D.preview,
|
|
2007
|
-
children: /* @__PURE__ */
|
|
2048
|
+
children: /* @__PURE__ */ r(et, { size: 20, className: "text-slate-400" })
|
|
2008
2049
|
}
|
|
2009
2050
|
),
|
|
2010
|
-
/* @__PURE__ */
|
|
2051
|
+
/* @__PURE__ */ r(
|
|
2011
2052
|
"button",
|
|
2012
2053
|
{
|
|
2013
2054
|
type: "button",
|
|
2014
|
-
onClick: (
|
|
2015
|
-
|
|
2055
|
+
onClick: (H) => {
|
|
2056
|
+
H.stopPropagation(), te(A.id);
|
|
2016
2057
|
},
|
|
2017
2058
|
disabled: o || f,
|
|
2018
2059
|
className: "rounded-xl p-2 text-slate-base hover:bg-slate-100 disabled:opacity-50 hover:cursor-pointer",
|
|
2019
2060
|
title: D.remove,
|
|
2020
|
-
children: /* @__PURE__ */
|
|
2061
|
+
children: /* @__PURE__ */ r(ge, { className: "h-6 w-6" })
|
|
2021
2062
|
}
|
|
2022
2063
|
)
|
|
2023
2064
|
] })
|
|
2024
2065
|
]
|
|
2025
2066
|
},
|
|
2026
|
-
|
|
2067
|
+
A.id
|
|
2027
2068
|
);
|
|
2028
2069
|
}) })
|
|
2029
2070
|
] }),
|
|
2030
|
-
c && /* @__PURE__ */
|
|
2071
|
+
c && /* @__PURE__ */ r("p", { className: "mt-2 text-sm font-normal text-red-600", children: c })
|
|
2031
2072
|
] });
|
|
2032
2073
|
};
|
|
2033
|
-
function
|
|
2074
|
+
function hn({
|
|
2034
2075
|
show: e,
|
|
2035
2076
|
setShow: t,
|
|
2036
|
-
title:
|
|
2077
|
+
title: n,
|
|
2037
2078
|
description: l,
|
|
2038
2079
|
Header: o,
|
|
2039
|
-
Body:
|
|
2040
|
-
footer:
|
|
2080
|
+
Body: a,
|
|
2081
|
+
footer: i,
|
|
2041
2082
|
handleClickOutside: c = !1,
|
|
2042
|
-
showCloseIcon:
|
|
2043
|
-
showHeader:
|
|
2044
|
-
overlayClassName:
|
|
2045
|
-
containerClassName:
|
|
2046
|
-
bodyClassName:
|
|
2047
|
-
footerClassName:
|
|
2083
|
+
showCloseIcon: g = !0,
|
|
2084
|
+
showHeader: x = !0,
|
|
2085
|
+
overlayClassName: y,
|
|
2086
|
+
containerClassName: S,
|
|
2087
|
+
bodyClassName: I,
|
|
2088
|
+
footerClassName: T
|
|
2048
2089
|
}) {
|
|
2049
|
-
const E =
|
|
2050
|
-
|
|
2051
|
-
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, () => {
|
|
2052
2093
|
c && t(!1);
|
|
2053
2094
|
});
|
|
2054
|
-
|
|
2055
|
-
const
|
|
2056
|
-
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(
|
|
2057
2098
|
"div",
|
|
2058
2099
|
{
|
|
2059
2100
|
className: s(
|
|
2060
2101
|
"bg-black/40 fixed inset-0 z-50 flex justify-center transition-all duration-500 ease-in-out",
|
|
2061
2102
|
"items-end sm:items-center",
|
|
2062
2103
|
e ? "opacity-100" : "pointer-events-none opacity-0",
|
|
2063
|
-
|
|
2104
|
+
y
|
|
2064
2105
|
),
|
|
2065
2106
|
children: /* @__PURE__ */ d(
|
|
2066
2107
|
"div",
|
|
@@ -2072,46 +2113,46 @@ function dr({
|
|
|
2072
2113
|
"rounded-t-2xl sm:rounded-2xl",
|
|
2073
2114
|
"transition-all duration-500 ease-out",
|
|
2074
2115
|
e ? "scale-100 opacity-100" : "scale-95 opacity-0",
|
|
2075
|
-
|
|
2116
|
+
S
|
|
2076
2117
|
),
|
|
2077
2118
|
children: [
|
|
2078
|
-
|
|
2119
|
+
O && /* @__PURE__ */ d("div", { className: "border-b border-slate-200 flex items-start justify-between p-4 sm:p-6 mb-4", children: [
|
|
2079
2120
|
o || /* @__PURE__ */ d("div", { className: "block", children: [
|
|
2080
|
-
/* @__PURE__ */
|
|
2081
|
-
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 })
|
|
2082
2123
|
] }),
|
|
2083
|
-
|
|
2124
|
+
g && /* @__PURE__ */ r(
|
|
2084
2125
|
"button",
|
|
2085
2126
|
{
|
|
2086
2127
|
onClick: () => t(!1),
|
|
2087
2128
|
className: "bg-slate-100 rounded-xl w-12 h-12 hover:cursor-pointer text-black transition flex items-center justify-center group",
|
|
2088
2129
|
"aria-label": "Close modal",
|
|
2089
2130
|
type: "button",
|
|
2090
|
-
children: /* @__PURE__ */
|
|
2131
|
+
children: /* @__PURE__ */ r(ge, { className: "h-6 w-6 transition-transform duration-300 group-hover:rotate-180" })
|
|
2091
2132
|
}
|
|
2092
2133
|
)
|
|
2093
2134
|
] }),
|
|
2094
|
-
|
|
2135
|
+
a && /* @__PURE__ */ r(
|
|
2095
2136
|
"div",
|
|
2096
2137
|
{
|
|
2097
2138
|
className: s(
|
|
2098
2139
|
"scrollbar-thin scrollbar-thumb-slate-200 overflow-y-auto",
|
|
2099
2140
|
"max-h-[70dvh] sm:max-h-96",
|
|
2100
2141
|
"px-4 sm:px-6 mb-2",
|
|
2101
|
-
|
|
2142
|
+
I
|
|
2102
2143
|
),
|
|
2103
|
-
children:
|
|
2144
|
+
children: a
|
|
2104
2145
|
}
|
|
2105
2146
|
),
|
|
2106
|
-
|
|
2147
|
+
i && /* @__PURE__ */ r(
|
|
2107
2148
|
"div",
|
|
2108
2149
|
{
|
|
2109
2150
|
className: s(
|
|
2110
2151
|
"flex items-center justify-end gap-3 border-t border-slate-200",
|
|
2111
2152
|
"p-4 sm:p-6",
|
|
2112
|
-
|
|
2153
|
+
T
|
|
2113
2154
|
),
|
|
2114
|
-
children:
|
|
2155
|
+
children: i
|
|
2115
2156
|
}
|
|
2116
2157
|
)
|
|
2117
2158
|
]
|
|
@@ -2120,19 +2161,19 @@ function dr({
|
|
|
2120
2161
|
}
|
|
2121
2162
|
);
|
|
2122
2163
|
}
|
|
2123
|
-
function
|
|
2164
|
+
function kr(e, t, n) {
|
|
2124
2165
|
const l = [], o = t * 2 + 5;
|
|
2125
|
-
if (
|
|
2126
|
-
return Array.from({ length:
|
|
2127
|
-
const
|
|
2128
|
-
l.push(1),
|
|
2129
|
-
for (let c =
|
|
2130
|
-
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;
|
|
2131
2172
|
}
|
|
2132
|
-
const
|
|
2173
|
+
const Cr = {
|
|
2133
2174
|
medium: "h-9 text-sm",
|
|
2134
2175
|
large: "h-10 text-base"
|
|
2135
|
-
},
|
|
2176
|
+
}, Sr = {
|
|
2136
2177
|
yellow: {
|
|
2137
2178
|
active: "bg-yellow-500 text-white border-yellow-500",
|
|
2138
2179
|
inactive: "bg-slate-100 border-slate-200 text-black hover:bg-slate-200",
|
|
@@ -2146,26 +2187,26 @@ const vn = {
|
|
|
2146
2187
|
arrow: "text-black"
|
|
2147
2188
|
}
|
|
2148
2189
|
};
|
|
2149
|
-
function
|
|
2190
|
+
function pn({
|
|
2150
2191
|
totalItems: e,
|
|
2151
2192
|
currentPage: t,
|
|
2152
|
-
perPage:
|
|
2193
|
+
perPage: n,
|
|
2153
2194
|
onPageChange: l,
|
|
2154
2195
|
onPerPageChange: o,
|
|
2155
|
-
siblingCount:
|
|
2156
|
-
perPageOptions:
|
|
2196
|
+
siblingCount: a = 1,
|
|
2197
|
+
perPageOptions: i = [10, 30, 50, 100],
|
|
2157
2198
|
showPerPage: c = !0,
|
|
2158
|
-
variant:
|
|
2159
|
-
size:
|
|
2160
|
-
paginationClassName:
|
|
2199
|
+
variant: g = "yellow",
|
|
2200
|
+
size: x = "large",
|
|
2201
|
+
paginationClassName: y
|
|
2161
2202
|
}) {
|
|
2162
|
-
const
|
|
2163
|
-
return E <= 1 ||
|
|
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"];
|
|
2204
|
+
return E <= 1 || S === 0 ? null : /* @__PURE__ */ d("div", { className: s(
|
|
2164
2205
|
"flex items-center justify-between gap-4 w-full",
|
|
2165
|
-
|
|
2206
|
+
y
|
|
2166
2207
|
), children: [
|
|
2167
2208
|
c && o && /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
2168
|
-
/* @__PURE__ */
|
|
2209
|
+
/* @__PURE__ */ r(
|
|
2169
2210
|
"span",
|
|
2170
2211
|
{
|
|
2171
2212
|
className: "whitespace-nowrap text-extra-small text-slate-base font-normal",
|
|
@@ -2173,21 +2214,21 @@ function ur({
|
|
|
2173
2214
|
}
|
|
2174
2215
|
),
|
|
2175
2216
|
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
2176
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ r(
|
|
2177
2218
|
"select",
|
|
2178
2219
|
{
|
|
2179
|
-
value:
|
|
2180
|
-
onChange: (
|
|
2220
|
+
value: I,
|
|
2221
|
+
onChange: (O) => o(Number(O.target.value)),
|
|
2181
2222
|
className: s(
|
|
2182
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",
|
|
2183
|
-
|
|
2224
|
+
x === "large" ? "h-10" : "h-9"
|
|
2184
2225
|
),
|
|
2185
2226
|
"aria-label": "Количество строк на странице",
|
|
2186
|
-
children:
|
|
2227
|
+
children: i.map((O) => /* @__PURE__ */ r("option", { value: O, children: O }, O))
|
|
2187
2228
|
}
|
|
2188
2229
|
),
|
|
2189
|
-
/* @__PURE__ */
|
|
2190
|
-
|
|
2230
|
+
/* @__PURE__ */ r(
|
|
2231
|
+
Re,
|
|
2191
2232
|
{
|
|
2192
2233
|
className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-slate-400",
|
|
2193
2234
|
weight: "Linear",
|
|
@@ -2197,72 +2238,72 @@ function ur({
|
|
|
2197
2238
|
] })
|
|
2198
2239
|
] }),
|
|
2199
2240
|
/* @__PURE__ */ d("nav", { "aria-label": "Пагинация", className: "flex items-center gap-1 shrink-0 whitespace-nowrap", children: [
|
|
2200
|
-
/* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ r(
|
|
2201
2242
|
"button",
|
|
2202
2243
|
{
|
|
2203
|
-
onClick: () => l(
|
|
2204
|
-
disabled:
|
|
2244
|
+
onClick: () => l(T - 1),
|
|
2245
|
+
disabled: T === 1,
|
|
2205
2246
|
"aria-label": "Предыдущая страница",
|
|
2206
2247
|
className: s(
|
|
2207
2248
|
"flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
|
|
2208
|
-
|
|
2209
|
-
|
|
2249
|
+
w,
|
|
2250
|
+
T === 1 ? s("cursor-not-allowed opacity-50", M.disabled) : s("hover:cursor-pointer", M.arrow, "border-slate-200")
|
|
2210
2251
|
),
|
|
2211
|
-
children: /* @__PURE__ */
|
|
2252
|
+
children: /* @__PURE__ */ r(Me, { weight: "Linear", size: 20 })
|
|
2212
2253
|
}
|
|
2213
2254
|
),
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
if (
|
|
2216
|
-
return /* @__PURE__ */
|
|
2255
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: h.map((O, k) => {
|
|
2256
|
+
if (O === "...")
|
|
2257
|
+
return /* @__PURE__ */ r(
|
|
2217
2258
|
"span",
|
|
2218
2259
|
{
|
|
2219
|
-
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),
|
|
2220
2261
|
"aria-hidden": "true",
|
|
2221
|
-
children: /* @__PURE__ */
|
|
2262
|
+
children: /* @__PURE__ */ r(kt, { weight: "Bold", size: 20 })
|
|
2222
2263
|
},
|
|
2223
|
-
|
|
2264
|
+
k
|
|
2224
2265
|
);
|
|
2225
|
-
const f =
|
|
2226
|
-
return /* @__PURE__ */
|
|
2266
|
+
const f = O === T;
|
|
2267
|
+
return /* @__PURE__ */ r(
|
|
2227
2268
|
"button",
|
|
2228
2269
|
{
|
|
2229
|
-
onClick: () => l(
|
|
2230
|
-
"aria-label": `Страница ${
|
|
2270
|
+
onClick: () => l(O),
|
|
2271
|
+
"aria-label": `Страница ${O}${f ? ", текущая" : ""}`,
|
|
2231
2272
|
"aria-current": f ? "page" : void 0,
|
|
2232
2273
|
className: s(
|
|
2233
2274
|
"flex items-center justify-center rounded-lg border font-medium transition-all hover:cursor-pointer min-w-10 px-2",
|
|
2234
|
-
|
|
2235
|
-
f ?
|
|
2275
|
+
w,
|
|
2276
|
+
f ? M.active : M.inactive
|
|
2236
2277
|
),
|
|
2237
|
-
children:
|
|
2278
|
+
children: O
|
|
2238
2279
|
},
|
|
2239
|
-
|
|
2280
|
+
k
|
|
2240
2281
|
);
|
|
2241
2282
|
}) }),
|
|
2242
|
-
/* @__PURE__ */
|
|
2283
|
+
/* @__PURE__ */ r(
|
|
2243
2284
|
"button",
|
|
2244
2285
|
{
|
|
2245
|
-
onClick: () => l(
|
|
2246
|
-
disabled:
|
|
2286
|
+
onClick: () => l(T + 1),
|
|
2287
|
+
disabled: T === E,
|
|
2247
2288
|
"aria-label": "Следующая страница",
|
|
2248
2289
|
className: s(
|
|
2249
2290
|
"flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
|
|
2250
|
-
|
|
2251
|
-
|
|
2291
|
+
w,
|
|
2292
|
+
T === E ? s("cursor-not-allowed opacity-50", M.disabled) : s("hover:cursor-pointer", M.arrow, "border-slate-200")
|
|
2252
2293
|
),
|
|
2253
|
-
children: /* @__PURE__ */
|
|
2294
|
+
children: /* @__PURE__ */ r(Ne, { size: 20, weight: "Linear" })
|
|
2254
2295
|
}
|
|
2255
2296
|
)
|
|
2256
2297
|
] })
|
|
2257
2298
|
] });
|
|
2258
2299
|
}
|
|
2259
|
-
function
|
|
2300
|
+
function Ze({
|
|
2260
2301
|
className: e,
|
|
2261
2302
|
variant: t = "default",
|
|
2262
|
-
width:
|
|
2303
|
+
width: n = "100%",
|
|
2263
2304
|
height: l = "1rem"
|
|
2264
2305
|
}) {
|
|
2265
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ r(
|
|
2266
2307
|
"div",
|
|
2267
2308
|
{
|
|
2268
2309
|
className: s(
|
|
@@ -2273,59 +2314,59 @@ function Ye({
|
|
|
2273
2314
|
e
|
|
2274
2315
|
),
|
|
2275
2316
|
style: {
|
|
2276
|
-
width: typeof
|
|
2317
|
+
width: typeof n == "number" ? `${n}px` : n,
|
|
2277
2318
|
height: typeof l == "number" ? `${l}px` : l
|
|
2278
2319
|
},
|
|
2279
|
-
children: /* @__PURE__ */
|
|
2320
|
+
children: /* @__PURE__ */ r("div", { className: "shimmer-mask absolute inset-0" })
|
|
2280
2321
|
}
|
|
2281
2322
|
);
|
|
2282
2323
|
}
|
|
2283
|
-
const
|
|
2324
|
+
const Er = {
|
|
2284
2325
|
top: "flex-col",
|
|
2285
2326
|
bottom: "flex-col-reverse",
|
|
2286
2327
|
left: "flex-row",
|
|
2287
2328
|
right: "flex-row-reverse"
|
|
2288
|
-
},
|
|
2329
|
+
}, Dr = {
|
|
2289
2330
|
top: "flex-row",
|
|
2290
2331
|
bottom: "flex-row",
|
|
2291
2332
|
left: "flex-col",
|
|
2292
2333
|
right: "flex-col"
|
|
2293
|
-
},
|
|
2334
|
+
}, Ar = {
|
|
2294
2335
|
top: "mt-4",
|
|
2295
2336
|
bottom: "mb-4",
|
|
2296
2337
|
left: "ml-4",
|
|
2297
2338
|
right: "mr-4"
|
|
2298
2339
|
};
|
|
2299
|
-
function
|
|
2340
|
+
function bn({
|
|
2300
2341
|
tabs: e,
|
|
2301
2342
|
defaultTab: t,
|
|
2302
|
-
position:
|
|
2343
|
+
position: n = "top",
|
|
2303
2344
|
className: l,
|
|
2304
2345
|
tabListClassName: o,
|
|
2305
|
-
contentClassName:
|
|
2306
|
-
extra:
|
|
2346
|
+
contentClassName: a,
|
|
2347
|
+
extra: i,
|
|
2307
2348
|
onChange: c
|
|
2308
2349
|
}) {
|
|
2309
|
-
const [
|
|
2350
|
+
const [g, x] = W(t || e[0]?.id), [y, S] = W({}), I = ae([]), T = R(() => {
|
|
2310
2351
|
requestAnimationFrame(() => {
|
|
2311
|
-
const h = e.findIndex((
|
|
2312
|
-
if (
|
|
2313
|
-
const { offsetLeft:
|
|
2314
|
-
|
|
2315
|
-
left: `${
|
|
2316
|
-
top: `${
|
|
2317
|
-
width: `${
|
|
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;
|
|
2355
|
+
S({
|
|
2356
|
+
left: `${M}px`,
|
|
2357
|
+
top: `${O}px`,
|
|
2358
|
+
width: `${k}px`,
|
|
2318
2359
|
height: `${f}px`,
|
|
2319
2360
|
transition: "all 0.35s cubic-bezier(0.25, 1, 0.5, 1)"
|
|
2320
2361
|
});
|
|
2321
2362
|
}
|
|
2322
2363
|
});
|
|
2323
|
-
}, [
|
|
2324
|
-
|
|
2325
|
-
|
|
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);
|
|
2326
2367
|
}, [e]);
|
|
2327
|
-
const E =
|
|
2328
|
-
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: [
|
|
2329
2370
|
/* @__PURE__ */ d(
|
|
2330
2371
|
"div",
|
|
2331
2372
|
{
|
|
@@ -2334,7 +2375,7 @@ function fr({
|
|
|
2334
2375
|
E ? "flex-col items-start" : "flex-row flex-wrap items-center"
|
|
2335
2376
|
),
|
|
2336
2377
|
children: [
|
|
2337
|
-
/* @__PURE__ */
|
|
2378
|
+
/* @__PURE__ */ r(
|
|
2338
2379
|
"div",
|
|
2339
2380
|
{
|
|
2340
2381
|
className: s(
|
|
@@ -2346,29 +2387,29 @@ function fr({
|
|
|
2346
2387
|
{
|
|
2347
2388
|
className: s(
|
|
2348
2389
|
"relative flex rounded-xl bg-slate-100 p-1",
|
|
2349
|
-
|
|
2390
|
+
Dr[n],
|
|
2350
2391
|
!E && "w-full overflow-hidden",
|
|
2351
2392
|
E ? "min-w-48" : "",
|
|
2352
2393
|
o
|
|
2353
2394
|
),
|
|
2354
2395
|
children: [
|
|
2355
|
-
/* @__PURE__ */
|
|
2396
|
+
/* @__PURE__ */ r(
|
|
2356
2397
|
"div",
|
|
2357
2398
|
{
|
|
2358
2399
|
className: s("absolute rounded-lg bg-white", E ? "w-full" : "h-full"),
|
|
2359
|
-
style:
|
|
2400
|
+
style: y
|
|
2360
2401
|
}
|
|
2361
2402
|
),
|
|
2362
|
-
e?.map((h,
|
|
2363
|
-
const
|
|
2403
|
+
e?.map((h, w) => {
|
|
2404
|
+
const M = g === h.id;
|
|
2364
2405
|
return /* @__PURE__ */ d(
|
|
2365
2406
|
"button",
|
|
2366
2407
|
{
|
|
2367
|
-
ref: (
|
|
2368
|
-
|
|
2408
|
+
ref: (O) => {
|
|
2409
|
+
I.current[w] = O;
|
|
2369
2410
|
},
|
|
2370
2411
|
onClick: () => {
|
|
2371
|
-
h?.disabled || (
|
|
2412
|
+
h?.disabled || (x(h?.id), c?.(h?.id));
|
|
2372
2413
|
},
|
|
2373
2414
|
disabled: h?.disabled,
|
|
2374
2415
|
className: s(
|
|
@@ -2377,8 +2418,8 @@ function fr({
|
|
|
2377
2418
|
E ? "w-full justify-start" : "flex-1 min-w-0"
|
|
2378
2419
|
),
|
|
2379
2420
|
children: [
|
|
2380
|
-
h?.icon && /* @__PURE__ */
|
|
2381
|
-
/* @__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 })
|
|
2382
2423
|
]
|
|
2383
2424
|
},
|
|
2384
2425
|
h?.id
|
|
@@ -2389,120 +2430,120 @@ function fr({
|
|
|
2389
2430
|
)
|
|
2390
2431
|
}
|
|
2391
2432
|
),
|
|
2392
|
-
|
|
2433
|
+
i && /* @__PURE__ */ r(
|
|
2393
2434
|
"div",
|
|
2394
2435
|
{
|
|
2395
2436
|
className: s(
|
|
2396
2437
|
"shrink-0 ml-auto",
|
|
2397
2438
|
E ? "w-full" : "max-w-full"
|
|
2398
2439
|
),
|
|
2399
|
-
children: /* @__PURE__ */
|
|
2440
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center justify-end gap-2", children: i })
|
|
2400
2441
|
}
|
|
2401
2442
|
)
|
|
2402
2443
|
]
|
|
2403
2444
|
}
|
|
2404
2445
|
),
|
|
2405
|
-
/* @__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) })
|
|
2406
2447
|
] });
|
|
2407
2448
|
}
|
|
2408
|
-
const
|
|
2449
|
+
const Mr = {
|
|
2409
2450
|
sm: "px-2 py-0.5",
|
|
2410
2451
|
md: "px-2 py-1",
|
|
2411
2452
|
lg: "px-3 py-2"
|
|
2412
|
-
},
|
|
2453
|
+
}, Xe = {
|
|
2413
2454
|
sm: "w-3 h-3",
|
|
2414
2455
|
md: "w-3 h-3",
|
|
2415
2456
|
lg: "w-3 h-3"
|
|
2416
|
-
},
|
|
2457
|
+
}, Tr = {
|
|
2417
2458
|
success: "bg-green-50 text-green-600",
|
|
2418
2459
|
warning: "bg-orange-50 text-orange-600",
|
|
2419
2460
|
error: "bg-red-50 text-red-600",
|
|
2420
2461
|
gray: "bg-slate-200 text-slate-700",
|
|
2421
2462
|
blue: "bg-blue-50 text-blue-600"
|
|
2422
2463
|
};
|
|
2423
|
-
function
|
|
2464
|
+
function gn({
|
|
2424
2465
|
children: e,
|
|
2425
2466
|
variant: t = "success",
|
|
2426
|
-
size:
|
|
2467
|
+
size: n = "lg",
|
|
2427
2468
|
icon: l,
|
|
2428
2469
|
iconPosition: o = "left",
|
|
2429
|
-
className:
|
|
2470
|
+
className: a
|
|
2430
2471
|
}) {
|
|
2431
2472
|
return /* @__PURE__ */ d(
|
|
2432
2473
|
"span",
|
|
2433
2474
|
{
|
|
2434
2475
|
className: s(
|
|
2435
2476
|
"inline-flex animate-[fadeIn_0.3s_ease-out] items-center rounded-lg text-extra-small font-medium",
|
|
2436
|
-
|
|
2437
|
-
|
|
2477
|
+
Mr[n],
|
|
2478
|
+
Tr[t],
|
|
2438
2479
|
l && "gap-[2px]",
|
|
2439
|
-
|
|
2480
|
+
a
|
|
2440
2481
|
),
|
|
2441
2482
|
children: [
|
|
2442
|
-
l && o === "left" && /* @__PURE__ */
|
|
2443
|
-
/* @__PURE__ */
|
|
2444
|
-
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 })
|
|
2445
2486
|
]
|
|
2446
2487
|
}
|
|
2447
2488
|
);
|
|
2448
2489
|
}
|
|
2449
|
-
const
|
|
2490
|
+
const Ir = be(
|
|
2450
2491
|
({
|
|
2451
2492
|
label: e,
|
|
2452
2493
|
placeholder: t,
|
|
2453
|
-
value:
|
|
2494
|
+
value: n = "",
|
|
2454
2495
|
onChange: l,
|
|
2455
2496
|
required: o = !1,
|
|
2456
|
-
disabled:
|
|
2457
|
-
error:
|
|
2497
|
+
disabled: a = !1,
|
|
2498
|
+
error: i,
|
|
2458
2499
|
className: c,
|
|
2459
|
-
rows:
|
|
2460
|
-
name:
|
|
2461
|
-
},
|
|
2462
|
-
const
|
|
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]);
|
|
2463
2504
|
return /* @__PURE__ */ d("div", { className: s("relative w-full", c), children: [
|
|
2464
2505
|
e && /* @__PURE__ */ d(
|
|
2465
2506
|
"label",
|
|
2466
2507
|
{
|
|
2467
2508
|
className: s(
|
|
2468
2509
|
"mb-2 block text-base font-medium",
|
|
2469
|
-
|
|
2510
|
+
i ? "text-red-600" : "text-slate-700"
|
|
2470
2511
|
),
|
|
2471
2512
|
children: [
|
|
2472
2513
|
e,
|
|
2473
|
-
o && /* @__PURE__ */
|
|
2514
|
+
o && /* @__PURE__ */ r("span", { className: "ml-1 text-red-600", children: "*" })
|
|
2474
2515
|
]
|
|
2475
2516
|
}
|
|
2476
2517
|
),
|
|
2477
|
-
/* @__PURE__ */
|
|
2518
|
+
/* @__PURE__ */ r(
|
|
2478
2519
|
"textarea",
|
|
2479
2520
|
{
|
|
2480
|
-
ref:
|
|
2481
|
-
name:
|
|
2482
|
-
rows:
|
|
2483
|
-
value:
|
|
2484
|
-
onChange: (
|
|
2485
|
-
disabled:
|
|
2521
|
+
ref: y,
|
|
2522
|
+
name: x,
|
|
2523
|
+
rows: g,
|
|
2524
|
+
value: n,
|
|
2525
|
+
onChange: (I) => l?.(I.target.value),
|
|
2526
|
+
disabled: a,
|
|
2486
2527
|
placeholder: t,
|
|
2487
2528
|
className: s(
|
|
2488
2529
|
"w-full resize-none rounded-xl border bg-white text-base font-normal transition-all duration-300 ease-in-out outline-none",
|
|
2489
2530
|
"p-3 disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
|
|
2490
|
-
|
|
2531
|
+
S
|
|
2491
2532
|
)
|
|
2492
2533
|
}
|
|
2493
2534
|
),
|
|
2494
|
-
|
|
2535
|
+
i && /* @__PURE__ */ r("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: i })
|
|
2495
2536
|
] });
|
|
2496
2537
|
}
|
|
2497
2538
|
);
|
|
2498
|
-
|
|
2499
|
-
const
|
|
2500
|
-
success: /* @__PURE__ */
|
|
2501
|
-
error: /* @__PURE__ */
|
|
2502
|
-
warning: /* @__PURE__ */
|
|
2503
|
-
info: /* @__PURE__ */
|
|
2504
|
-
loading: /* @__PURE__ */
|
|
2505
|
-
},
|
|
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 = {
|
|
2506
2547
|
bg: {
|
|
2507
2548
|
success: "bg-green-50",
|
|
2508
2549
|
error: "bg-red-50",
|
|
@@ -2532,70 +2573,70 @@ const Mn = {
|
|
|
2532
2573
|
loading: "text-slate-600"
|
|
2533
2574
|
}
|
|
2534
2575
|
};
|
|
2535
|
-
function
|
|
2576
|
+
function Lr() {
|
|
2536
2577
|
let e = document.getElementById("mci-toast-container");
|
|
2537
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;
|
|
2538
2579
|
}
|
|
2539
|
-
const
|
|
2540
|
-
let
|
|
2541
|
-
const
|
|
2542
|
-
|
|
2543
|
-
/* @__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)) })
|
|
2544
2585
|
);
|
|
2545
2586
|
};
|
|
2546
|
-
function
|
|
2587
|
+
function $r({
|
|
2547
2588
|
title: e,
|
|
2548
2589
|
description: t,
|
|
2549
|
-
type:
|
|
2590
|
+
type: n = "info",
|
|
2550
2591
|
duration: l = 3e3,
|
|
2551
2592
|
action: o,
|
|
2552
|
-
onClose:
|
|
2593
|
+
onClose: a
|
|
2553
2594
|
}) {
|
|
2554
|
-
const [
|
|
2555
|
-
return
|
|
2595
|
+
const [i, c] = W(100);
|
|
2596
|
+
return J(() => {
|
|
2556
2597
|
if (l === 1 / 0) {
|
|
2557
2598
|
c(100);
|
|
2558
2599
|
return;
|
|
2559
2600
|
}
|
|
2560
|
-
let
|
|
2561
|
-
const
|
|
2562
|
-
|
|
2563
|
-
const
|
|
2564
|
-
c(
|
|
2565
|
-
},
|
|
2566
|
-
return () => cancelAnimationFrame(
|
|
2567
|
-
}, [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(
|
|
2568
2609
|
"div",
|
|
2569
2610
|
{
|
|
2570
2611
|
className: s(
|
|
2571
2612
|
"relative w-[300px] max-w-full overflow-hidden shadow-md rounded-lg",
|
|
2572
2613
|
"animate-in fade-in slide-in-from-top-2 duration-300",
|
|
2573
|
-
|
|
2614
|
+
Ae.bg[n]
|
|
2574
2615
|
),
|
|
2575
2616
|
children: [
|
|
2576
|
-
/* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ r(
|
|
2577
2618
|
"div",
|
|
2578
2619
|
{
|
|
2579
|
-
className: s("absolute bottom-0 left-0 h-1",
|
|
2620
|
+
className: s("absolute bottom-0 left-0 h-1", Ae.line[n]),
|
|
2580
2621
|
style: {
|
|
2581
|
-
width: `${
|
|
2622
|
+
width: `${i}%`,
|
|
2582
2623
|
transition: "none"
|
|
2583
2624
|
}
|
|
2584
2625
|
}
|
|
2585
2626
|
),
|
|
2586
|
-
/* @__PURE__ */
|
|
2587
|
-
/* @__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] }),
|
|
2588
2629
|
/* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: [
|
|
2589
|
-
/* @__PURE__ */
|
|
2590
|
-
t && /* @__PURE__ */
|
|
2591
|
-
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 }) })
|
|
2592
2633
|
] }),
|
|
2593
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ r(
|
|
2594
2635
|
"button",
|
|
2595
2636
|
{
|
|
2596
|
-
onClick:
|
|
2637
|
+
onClick: a,
|
|
2597
2638
|
className: "flex-shrink-0 rounded-full transition cursor-pointer active:animate-spin",
|
|
2598
|
-
children: /* @__PURE__ */
|
|
2639
|
+
children: /* @__PURE__ */ r(ge, { className: "w-6 h-6 text-slate-base" })
|
|
2599
2640
|
}
|
|
2600
2641
|
)
|
|
2601
2642
|
] }) })
|
|
@@ -2603,50 +2644,50 @@ function Ln({
|
|
|
2603
2644
|
}
|
|
2604
2645
|
);
|
|
2605
2646
|
}
|
|
2606
|
-
const
|
|
2607
|
-
const t =
|
|
2608
|
-
const o =
|
|
2609
|
-
o !== -1 && (
|
|
2610
|
-
}, l = /* @__PURE__ */
|
|
2611
|
-
return
|
|
2612
|
-
},
|
|
2613
|
-
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 } : {
|
|
2614
2655
|
...e,
|
|
2615
2656
|
type: "success"
|
|
2616
2657
|
}),
|
|
2617
|
-
error: (e, t,
|
|
2658
|
+
error: (e, t, n) => xe(typeof e == "string" ? { title: e, description: t, type: "error", action: n } : {
|
|
2618
2659
|
...e,
|
|
2619
2660
|
type: "error"
|
|
2620
2661
|
}),
|
|
2621
|
-
warning: (e, t,
|
|
2662
|
+
warning: (e, t, n) => xe(typeof e == "string" ? { title: e, description: t, type: "warning", action: n } : {
|
|
2622
2663
|
...e,
|
|
2623
2664
|
type: "warning"
|
|
2624
2665
|
}),
|
|
2625
|
-
info: (e, t,
|
|
2666
|
+
info: (e, t, n) => xe(typeof e == "string" ? { title: e, description: t, type: "info", action: n } : {
|
|
2626
2667
|
...e,
|
|
2627
2668
|
type: "info"
|
|
2628
2669
|
}),
|
|
2629
|
-
loading: (e, t) =>
|
|
2670
|
+
loading: (e, t) => xe(typeof e == "string" ? {
|
|
2630
2671
|
title: e,
|
|
2631
2672
|
description: t,
|
|
2632
2673
|
type: "loading",
|
|
2633
2674
|
duration: 1 / 0
|
|
2634
2675
|
} : { ...e, type: "loading", duration: 1 / 0 })
|
|
2635
|
-
},
|
|
2676
|
+
}, Rr = {
|
|
2636
2677
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
2637
2678
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
2638
2679
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
2639
2680
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
2640
|
-
},
|
|
2681
|
+
}, _r = {
|
|
2641
2682
|
top: "left-1/2 -translate-x-1/2 top-full",
|
|
2642
2683
|
bottom: "left-1/2 -translate-x-1/2 bottom-full",
|
|
2643
2684
|
left: "top-1/2 -translate-y-1/2 left-full",
|
|
2644
2685
|
right: "top-1/2 -translate-y-1/2 right-full"
|
|
2645
2686
|
};
|
|
2646
|
-
function
|
|
2687
|
+
function wn({
|
|
2647
2688
|
content: e,
|
|
2648
2689
|
children: t,
|
|
2649
|
-
position:
|
|
2690
|
+
position: n = "top",
|
|
2650
2691
|
delay: l = 200,
|
|
2651
2692
|
className: o
|
|
2652
2693
|
}) {
|
|
@@ -2659,18 +2700,18 @@ function pr({
|
|
|
2659
2700
|
"absolute z-50 rounded-md bg-slate-400 px-2 py-1 text-xs whitespace-nowrap text-white shadow-md",
|
|
2660
2701
|
"scale-95 opacity-0 transition-all group-hover:scale-100 group-hover:opacity-100",
|
|
2661
2702
|
"duration-200 ease-out group-hover:delay-200",
|
|
2662
|
-
|
|
2703
|
+
Rr[n],
|
|
2663
2704
|
o
|
|
2664
2705
|
),
|
|
2665
2706
|
style: { transitionDelay: `${l}ms` },
|
|
2666
2707
|
children: [
|
|
2667
2708
|
e,
|
|
2668
|
-
/* @__PURE__ */
|
|
2709
|
+
/* @__PURE__ */ r(
|
|
2669
2710
|
"span",
|
|
2670
2711
|
{
|
|
2671
2712
|
className: s(
|
|
2672
2713
|
"absolute h-2 w-2 rotate-45 bg-slate-400",
|
|
2673
|
-
|
|
2714
|
+
_r[n]
|
|
2674
2715
|
)
|
|
2675
2716
|
}
|
|
2676
2717
|
)
|
|
@@ -2679,7 +2720,7 @@ function pr({
|
|
|
2679
2720
|
)
|
|
2680
2721
|
] });
|
|
2681
2722
|
}
|
|
2682
|
-
const
|
|
2723
|
+
const $e = {
|
|
2683
2724
|
blue: {
|
|
2684
2725
|
active: "bg-blue-600",
|
|
2685
2726
|
hover: "hover:bg-blue-600",
|
|
@@ -2691,40 +2732,40 @@ const Le = {
|
|
|
2691
2732
|
focus: "focus:ring-2 focus:ring-yellow-200"
|
|
2692
2733
|
}
|
|
2693
2734
|
};
|
|
2694
|
-
function
|
|
2735
|
+
function yn({
|
|
2695
2736
|
checked: e = !1,
|
|
2696
2737
|
onChange: t,
|
|
2697
|
-
disabled:
|
|
2738
|
+
disabled: n = !1,
|
|
2698
2739
|
variant: l = "yellow",
|
|
2699
2740
|
label: o,
|
|
2700
|
-
supportText:
|
|
2701
|
-
className:
|
|
2741
|
+
supportText: a,
|
|
2742
|
+
className: i
|
|
2702
2743
|
}) {
|
|
2703
2744
|
const c = () => {
|
|
2704
|
-
|
|
2745
|
+
n || t?.(!e);
|
|
2705
2746
|
};
|
|
2706
2747
|
return /* @__PURE__ */ d(
|
|
2707
2748
|
"div",
|
|
2708
2749
|
{
|
|
2709
2750
|
className: s(
|
|
2710
2751
|
"flex items-start gap-3 select-none",
|
|
2711
|
-
|
|
2752
|
+
i
|
|
2712
2753
|
),
|
|
2713
2754
|
children: [
|
|
2714
|
-
/* @__PURE__ */
|
|
2755
|
+
/* @__PURE__ */ r(
|
|
2715
2756
|
"button",
|
|
2716
2757
|
{
|
|
2717
2758
|
type: "button",
|
|
2718
|
-
disabled:
|
|
2759
|
+
disabled: n,
|
|
2719
2760
|
className: s(
|
|
2720
2761
|
"relative h-6 w-11 rounded-xl transition-all duration-300 outline-none cursor-pointer",
|
|
2721
|
-
e ?
|
|
2722
|
-
!
|
|
2723
|
-
!
|
|
2724
|
-
|
|
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"
|
|
2725
2766
|
),
|
|
2726
2767
|
onClick: c,
|
|
2727
|
-
children: /* @__PURE__ */
|
|
2768
|
+
children: /* @__PURE__ */ r(
|
|
2728
2769
|
"span",
|
|
2729
2770
|
{
|
|
2730
2771
|
className: s(
|
|
@@ -2735,8 +2776,8 @@ function br({
|
|
|
2735
2776
|
)
|
|
2736
2777
|
}
|
|
2737
2778
|
),
|
|
2738
|
-
(o ||
|
|
2739
|
-
o && /* @__PURE__ */
|
|
2779
|
+
(o || a) && /* @__PURE__ */ d("div", { className: "flex flex-col leading-tight", children: [
|
|
2780
|
+
o && /* @__PURE__ */ r(
|
|
2740
2781
|
"span",
|
|
2741
2782
|
{
|
|
2742
2783
|
className: s(
|
|
@@ -2745,22 +2786,22 @@ function br({
|
|
|
2745
2786
|
children: o
|
|
2746
2787
|
}
|
|
2747
2788
|
),
|
|
2748
|
-
|
|
2789
|
+
a && /* @__PURE__ */ r("span", { className: "text-sm font-normal text-slate-500", children: a })
|
|
2749
2790
|
] })
|
|
2750
2791
|
]
|
|
2751
2792
|
}
|
|
2752
2793
|
);
|
|
2753
2794
|
}
|
|
2754
|
-
const
|
|
2755
|
-
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({
|
|
2756
2797
|
className: e,
|
|
2757
2798
|
size: t = 150,
|
|
2758
|
-
iconClassName:
|
|
2799
|
+
iconClassName: n,
|
|
2759
2800
|
isLoading: l = !1,
|
|
2760
2801
|
isFullPage: o = !0,
|
|
2761
|
-
variant:
|
|
2802
|
+
variant: a = "yellow"
|
|
2762
2803
|
}) {
|
|
2763
|
-
return l ? /* @__PURE__ */
|
|
2804
|
+
return l ? /* @__PURE__ */ r(
|
|
2764
2805
|
"div",
|
|
2765
2806
|
{
|
|
2766
2807
|
className: s(
|
|
@@ -2768,15 +2809,15 @@ function gr({
|
|
|
2768
2809
|
o ? "fixed inset-0 backdrop-blur-[2px]" : "absolute inset-0 w-full h-full rounded-[inherit]",
|
|
2769
2810
|
e
|
|
2770
2811
|
),
|
|
2771
|
-
children: /* @__PURE__ */
|
|
2772
|
-
|
|
2812
|
+
children: /* @__PURE__ */ r(
|
|
2813
|
+
Br,
|
|
2773
2814
|
{
|
|
2774
2815
|
width: t,
|
|
2775
2816
|
height: t,
|
|
2776
2817
|
className: s(
|
|
2777
2818
|
"animate-spin",
|
|
2778
|
-
!
|
|
2779
|
-
|
|
2819
|
+
!n && (a === "blue" ? "text-blue-600" : "text-yellow-500"),
|
|
2820
|
+
n
|
|
2780
2821
|
),
|
|
2781
2822
|
style: { fill: "currentColor", stroke: "currentColor" }
|
|
2782
2823
|
}
|
|
@@ -2784,7 +2825,7 @@ function gr({
|
|
|
2784
2825
|
}
|
|
2785
2826
|
) : null;
|
|
2786
2827
|
}
|
|
2787
|
-
const
|
|
2828
|
+
const Pr = {
|
|
2788
2829
|
sm: {
|
|
2789
2830
|
input: "h-9 text-sm",
|
|
2790
2831
|
iconPadding: "pl-8 pr-2",
|
|
@@ -2813,201 +2854,201 @@ const zn = {
|
|
|
2813
2854
|
iconWrapper: "h-5"
|
|
2814
2855
|
}
|
|
2815
2856
|
};
|
|
2816
|
-
function
|
|
2857
|
+
function zr(e) {
|
|
2817
2858
|
let t = e.replace(/\D/g, "");
|
|
2818
2859
|
t.startsWith("998") || (t = `998${t}`), t = t.substring(0, 12);
|
|
2819
|
-
let
|
|
2820
|
-
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;
|
|
2821
2862
|
}
|
|
2822
|
-
function
|
|
2863
|
+
function Wr(e) {
|
|
2823
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";
|
|
2824
2865
|
}
|
|
2825
|
-
function
|
|
2826
|
-
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";
|
|
2827
2868
|
}
|
|
2828
|
-
const
|
|
2869
|
+
const Vr = be(
|
|
2829
2870
|
({
|
|
2830
2871
|
label: e,
|
|
2831
2872
|
placeholder: t = "+998 (__) ___ __ __",
|
|
2832
|
-
size:
|
|
2873
|
+
size: n = "base",
|
|
2833
2874
|
error: l,
|
|
2834
2875
|
disabled: o = !1,
|
|
2835
|
-
required:
|
|
2836
|
-
value:
|
|
2876
|
+
required: a = !1,
|
|
2877
|
+
value: i = "",
|
|
2837
2878
|
onChange: c,
|
|
2838
|
-
onFocus:
|
|
2839
|
-
onBlur:
|
|
2840
|
-
className:
|
|
2841
|
-
name:
|
|
2842
|
-
showIcon:
|
|
2843
|
-
},
|
|
2844
|
-
const [E, h] =
|
|
2879
|
+
onFocus: g,
|
|
2880
|
+
onBlur: x,
|
|
2881
|
+
className: y,
|
|
2882
|
+
name: S,
|
|
2883
|
+
showIcon: I = !1
|
|
2884
|
+
}, T) => {
|
|
2885
|
+
const [E, h] = W(!1), w = (D) => {
|
|
2845
2886
|
const m = D.target.value;
|
|
2846
2887
|
if (m.length < 5) {
|
|
2847
2888
|
c?.("+998");
|
|
2848
2889
|
return;
|
|
2849
2890
|
}
|
|
2850
|
-
const u =
|
|
2891
|
+
const u = zr(m);
|
|
2851
2892
|
c?.(u);
|
|
2852
|
-
},
|
|
2853
|
-
h(!0), (!
|
|
2854
|
-
},
|
|
2855
|
-
h(!1),
|
|
2856
|
-
},
|
|
2857
|
-
() =>
|
|
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),
|
|
2858
2899
|
[l, E, o]
|
|
2859
2900
|
);
|
|
2860
|
-
return /* @__PURE__ */ d("div", { className: s("w-full",
|
|
2901
|
+
return /* @__PURE__ */ d("div", { className: s("w-full", y), children: [
|
|
2861
2902
|
e && /* @__PURE__ */ d("label", { className: s(
|
|
2862
2903
|
"mb-2 block font-medium transition-colors duration-200",
|
|
2863
2904
|
l ? "text-red-600" : E ? "text-blue-600" : "text-slate-700",
|
|
2864
|
-
|
|
2905
|
+
k.labelFont
|
|
2865
2906
|
), children: [
|
|
2866
2907
|
e,
|
|
2867
|
-
|
|
2908
|
+
a && /* @__PURE__ */ r("span", { className: "text-red-600 ml-1", children: "*" })
|
|
2868
2909
|
] }),
|
|
2869
2910
|
/* @__PURE__ */ d("div", { className: "relative flex items-center", children: [
|
|
2870
|
-
|
|
2911
|
+
I && /* @__PURE__ */ r("div", { className: s(
|
|
2871
2912
|
"absolute top-1/2 flex -translate-y-1/2 items-center justify-center transition-all duration-300",
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
), children: /* @__PURE__ */
|
|
2875
|
-
/* @__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(
|
|
2876
2917
|
"input",
|
|
2877
2918
|
{
|
|
2878
|
-
ref:
|
|
2879
|
-
name:
|
|
2919
|
+
ref: T,
|
|
2920
|
+
name: S,
|
|
2880
2921
|
type: "tel",
|
|
2881
|
-
value:
|
|
2882
|
-
onChange:
|
|
2883
|
-
onFocus:
|
|
2884
|
-
onBlur:
|
|
2922
|
+
value: i,
|
|
2923
|
+
onChange: w,
|
|
2924
|
+
onFocus: M,
|
|
2925
|
+
onBlur: O,
|
|
2885
2926
|
disabled: o,
|
|
2886
2927
|
placeholder: t,
|
|
2887
2928
|
className: s(
|
|
2888
2929
|
"w-full border bg-white font-normal transition-all duration-300 outline-none",
|
|
2889
|
-
|
|
2930
|
+
n === "base" ? "rounded-xl" : "rounded-lg",
|
|
2890
2931
|
"disabled:bg-slate-100 disabled:text-slate-400 disabled:cursor-not-allowed",
|
|
2891
|
-
|
|
2932
|
+
k.input,
|
|
2892
2933
|
f,
|
|
2893
|
-
|
|
2934
|
+
L
|
|
2894
2935
|
)
|
|
2895
2936
|
}
|
|
2896
2937
|
)
|
|
2897
2938
|
] }),
|
|
2898
|
-
l && /* @__PURE__ */
|
|
2939
|
+
l && /* @__PURE__ */ r("p", { className: "mt-2 animate-slide-up text-sm font-normal text-red-600", children: l })
|
|
2899
2940
|
] });
|
|
2900
2941
|
}
|
|
2901
2942
|
);
|
|
2902
|
-
|
|
2903
|
-
function
|
|
2943
|
+
Vr.displayName = "MciPhone";
|
|
2944
|
+
function Hr(e) {
|
|
2904
2945
|
const t = e.replace(/\s/g, "").toUpperCase();
|
|
2905
|
-
let
|
|
2946
|
+
let n = "";
|
|
2906
2947
|
for (let l = 0; l < t.length; l += 1) {
|
|
2907
2948
|
const o = t[l];
|
|
2908
|
-
if (
|
|
2949
|
+
if (n.length < 2 ? /[A-Z]/.test(o) && (n += o) : /[0-9]/.test(o) && (n += o), n.length >= 9) break;
|
|
2909
2950
|
}
|
|
2910
|
-
return
|
|
2951
|
+
return n.length > 2 ? `${n.slice(0, 2)} ${n.slice(2)}` : n;
|
|
2911
2952
|
}
|
|
2912
|
-
function
|
|
2953
|
+
function Ur(e) {
|
|
2913
2954
|
return e.replace(/\D/g, "").slice(0, 14);
|
|
2914
2955
|
}
|
|
2915
|
-
function
|
|
2956
|
+
function Zr(e) {
|
|
2916
2957
|
return e.toUpperCase().replace(/[^A-Z0-9\-\s]/g, "").replace(/\s+/g, " ").slice(0, 15);
|
|
2917
2958
|
}
|
|
2918
|
-
function
|
|
2919
|
-
return e === "passport" ?
|
|
2959
|
+
function Xr(e, t) {
|
|
2960
|
+
return e === "passport" ? Hr(t) : e === "pinfl" ? Ur(t) : Zr(t);
|
|
2920
2961
|
}
|
|
2921
|
-
function
|
|
2962
|
+
function Kr(e, t) {
|
|
2922
2963
|
return t || (e === "passport" ? "AA 1234567" : e === "pinfl" ? "12345678901234" : e === "metirka" ? "I-TN 1234567" : "");
|
|
2923
2964
|
}
|
|
2924
|
-
function
|
|
2965
|
+
function qr(e, t) {
|
|
2925
2966
|
return t || (e === "passport" ? 10 : e === "pinfl" ? 14 : e === "metirka" ? 15 : 255);
|
|
2926
2967
|
}
|
|
2927
|
-
const
|
|
2928
|
-
({ mode: e, onChange: t, value:
|
|
2929
|
-
const [
|
|
2930
|
-
(
|
|
2931
|
-
const
|
|
2932
|
-
|
|
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);
|
|
2933
2974
|
},
|
|
2934
|
-
[e, t,
|
|
2975
|
+
[e, t, n]
|
|
2935
2976
|
);
|
|
2936
|
-
return /* @__PURE__ */
|
|
2937
|
-
|
|
2977
|
+
return /* @__PURE__ */ r(
|
|
2978
|
+
Be,
|
|
2938
2979
|
{
|
|
2939
2980
|
ref: o,
|
|
2940
2981
|
...l,
|
|
2941
2982
|
value: c,
|
|
2942
|
-
onChange:
|
|
2943
|
-
maxLength:
|
|
2944
|
-
placeholder:
|
|
2983
|
+
onChange: g,
|
|
2984
|
+
maxLength: qr(e, l.maxLength),
|
|
2985
|
+
placeholder: Kr(e, l.placeholder)
|
|
2945
2986
|
}
|
|
2946
2987
|
);
|
|
2947
2988
|
}
|
|
2948
2989
|
);
|
|
2949
|
-
|
|
2950
|
-
function
|
|
2990
|
+
Gr.displayName = "MciIdentityInput";
|
|
2991
|
+
function Nn({
|
|
2951
2992
|
open: e,
|
|
2952
2993
|
onClose: t,
|
|
2953
|
-
columns:
|
|
2994
|
+
columns: n,
|
|
2954
2995
|
hidden: l,
|
|
2955
2996
|
onToggle: o,
|
|
2956
|
-
onMove:
|
|
2957
|
-
onMoveByKey:
|
|
2997
|
+
onMove: a,
|
|
2998
|
+
onMoveByKey: i,
|
|
2958
2999
|
minVisible: c = 5
|
|
2959
3000
|
}) {
|
|
2960
|
-
const
|
|
2961
|
-
|
|
3001
|
+
const g = ae(null), { handleClick: x } = Fe(g, t);
|
|
3002
|
+
J(() => {
|
|
2962
3003
|
if (e)
|
|
2963
|
-
return document.addEventListener("mousedown",
|
|
2964
|
-
}, [e,
|
|
2965
|
-
const
|
|
3004
|
+
return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
|
|
3005
|
+
}, [e, x]);
|
|
3006
|
+
const y = P(() => new Set(l), [l]), S = P(() => {
|
|
2966
3007
|
let u = 0;
|
|
2967
|
-
for (const
|
|
3008
|
+
for (const b of n) y.has(b.key) || u++;
|
|
2968
3009
|
return u;
|
|
2969
|
-
}, [
|
|
2970
|
-
(u,
|
|
2971
|
-
let
|
|
2972
|
-
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;
|
|
2973
3014
|
},
|
|
2974
3015
|
[]
|
|
2975
|
-
),
|
|
2976
|
-
|
|
2977
|
-
}, []),
|
|
2978
|
-
(u,
|
|
2979
|
-
|
|
2980
|
-
const
|
|
2981
|
-
|
|
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);
|
|
2982
3023
|
},
|
|
2983
3024
|
[]
|
|
2984
|
-
), D =
|
|
2985
|
-
(u,
|
|
3025
|
+
), D = R(
|
|
3026
|
+
(u, b) => {
|
|
2986
3027
|
u.preventDefault();
|
|
2987
|
-
const
|
|
2988
|
-
if (!Number.isFinite(
|
|
2989
|
-
|
|
3028
|
+
const j = I ?? Number.parseInt(u.dataTransfer.getData("text/plain") || "-1", 10);
|
|
3029
|
+
if (!Number.isFinite(j) || j < 0) {
|
|
3030
|
+
L();
|
|
2990
3031
|
return;
|
|
2991
3032
|
}
|
|
2992
|
-
const
|
|
2993
|
-
if (!
|
|
2994
|
-
|
|
3033
|
+
const F = n[j], $ = n[b];
|
|
3034
|
+
if (!F || !$) {
|
|
3035
|
+
L();
|
|
2995
3036
|
return;
|
|
2996
3037
|
}
|
|
2997
|
-
const
|
|
2998
|
-
|
|
3038
|
+
const z = f(j, b, O);
|
|
3039
|
+
z !== j && (i ? i(F.key, $.key, O) : a(j, z)), L();
|
|
2999
3040
|
},
|
|
3000
|
-
[
|
|
3001
|
-
), m =
|
|
3002
|
-
(u,
|
|
3003
|
-
|
|
3041
|
+
[n, f, I, O, a, i, L]
|
|
3042
|
+
), m = R(
|
|
3043
|
+
(u, b) => {
|
|
3044
|
+
b || o(u);
|
|
3004
3045
|
},
|
|
3005
3046
|
[o]
|
|
3006
3047
|
);
|
|
3007
3048
|
return e ? /* @__PURE__ */ d(
|
|
3008
3049
|
"div",
|
|
3009
3050
|
{
|
|
3010
|
-
ref:
|
|
3051
|
+
ref: g,
|
|
3011
3052
|
className: s(
|
|
3012
3053
|
"absolute right-0 top-full z-50 mt-2 w-[320px]",
|
|
3013
3054
|
"rounded-2xl p-4 bg-white",
|
|
@@ -3015,8 +3056,8 @@ function xr({
|
|
|
3015
3056
|
),
|
|
3016
3057
|
children: [
|
|
3017
3058
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between gap-4", children: [
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */
|
|
3059
|
+
/* @__PURE__ */ r("h4", { className: "text-slate-600 text-large font-normal", children: "Settings" }),
|
|
3060
|
+
/* @__PURE__ */ r(
|
|
3020
3061
|
"button",
|
|
3021
3062
|
{
|
|
3022
3063
|
type: "button",
|
|
@@ -3027,14 +3068,14 @@ function xr({
|
|
|
3027
3068
|
}
|
|
3028
3069
|
)
|
|
3029
3070
|
] }),
|
|
3030
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ r("div", { className: "my-4 h-px bg-slate-100" }),
|
|
3031
3072
|
/* @__PURE__ */ d("p", { className: "mb-3 text-xs text-slate-500", children: [
|
|
3032
3073
|
"Active columns: ",
|
|
3033
|
-
|
|
3074
|
+
S,
|
|
3034
3075
|
"/",
|
|
3035
|
-
|
|
3076
|
+
n.length
|
|
3036
3077
|
] }),
|
|
3037
|
-
/* @__PURE__ */
|
|
3078
|
+
/* @__PURE__ */ r(
|
|
3038
3079
|
"div",
|
|
3039
3080
|
{
|
|
3040
3081
|
className: s(
|
|
@@ -3045,15 +3086,15 @@ function xr({
|
|
|
3045
3086
|
"[&::-webkit-scrollbar-thumb]:rounded-full",
|
|
3046
3087
|
"hover:[&::-webkit-scrollbar-thumb]:bg-slate-300"
|
|
3047
3088
|
),
|
|
3048
|
-
children:
|
|
3049
|
-
const
|
|
3089
|
+
children: n.map((u, b) => {
|
|
3090
|
+
const j = !y.has(u.key), F = j && S <= c, $ = E === b, z = w === u.key;
|
|
3050
3091
|
return /* @__PURE__ */ d("div", { className: "relative", children: [
|
|
3051
|
-
|
|
3092
|
+
$ && !z && /* @__PURE__ */ r(
|
|
3052
3093
|
"div",
|
|
3053
3094
|
{
|
|
3054
3095
|
className: s(
|
|
3055
3096
|
"pointer-events-none absolute left-2 right-2 z-10 h-0.5 rounded-full bg-blue-300",
|
|
3056
|
-
|
|
3097
|
+
O === "before" ? "top-0" : "bottom-0"
|
|
3057
3098
|
)
|
|
3058
3099
|
}
|
|
3059
3100
|
),
|
|
@@ -3061,25 +3102,25 @@ function xr({
|
|
|
3061
3102
|
"div",
|
|
3062
3103
|
{
|
|
3063
3104
|
draggable: !0,
|
|
3064
|
-
onDragStart: (
|
|
3065
|
-
onDragOver: (
|
|
3066
|
-
if (
|
|
3067
|
-
|
|
3068
|
-
const X =
|
|
3069
|
-
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);
|
|
3070
3111
|
},
|
|
3071
|
-
onDrop: (
|
|
3072
|
-
onDragEnd:
|
|
3112
|
+
onDrop: (V) => D(V, b),
|
|
3113
|
+
onDragEnd: L,
|
|
3073
3114
|
className: s(
|
|
3074
3115
|
"group flex items-center py-2 px-1 gap-4",
|
|
3075
3116
|
"rounded-md box-border overflow-visible",
|
|
3076
3117
|
"transition-[background,transform] duration-150",
|
|
3077
|
-
!
|
|
3078
|
-
|
|
3079
|
-
|
|
3118
|
+
!z && !$ && "hover:bg-slate-50",
|
|
3119
|
+
$ && !z && "bg-slate-50",
|
|
3120
|
+
z && "bg-slate-50 opacity-100 scale-[0.99] cursor-grabbing"
|
|
3080
3121
|
),
|
|
3081
3122
|
children: [
|
|
3082
|
-
/* @__PURE__ */
|
|
3123
|
+
/* @__PURE__ */ r(
|
|
3083
3124
|
"button",
|
|
3084
3125
|
{
|
|
3085
3126
|
type: "button",
|
|
@@ -3087,24 +3128,24 @@ function xr({
|
|
|
3087
3128
|
"shrink-0 text-slate-400",
|
|
3088
3129
|
"cursor-grab active:cursor-grabbing",
|
|
3089
3130
|
"rounded-lg p-1 hover:bg-slate-100",
|
|
3090
|
-
|
|
3131
|
+
z && "cursor-grabbing"
|
|
3091
3132
|
),
|
|
3092
3133
|
"aria-label": "Drag",
|
|
3093
|
-
children: /* @__PURE__ */
|
|
3134
|
+
children: /* @__PURE__ */ r(Tt, { weight: "Linear", size: 20 })
|
|
3094
3135
|
}
|
|
3095
3136
|
),
|
|
3096
|
-
/* @__PURE__ */
|
|
3097
|
-
|
|
3137
|
+
/* @__PURE__ */ r("div", { className: "shrink-0", children: /* @__PURE__ */ r(
|
|
3138
|
+
Ie,
|
|
3098
3139
|
{
|
|
3099
|
-
checked:
|
|
3100
|
-
disabled:
|
|
3101
|
-
onChange: () => m(u.key,
|
|
3140
|
+
checked: j,
|
|
3141
|
+
disabled: F,
|
|
3142
|
+
onChange: () => m(u.key, F),
|
|
3102
3143
|
variant: "blue"
|
|
3103
3144
|
}
|
|
3104
3145
|
) }),
|
|
3105
3146
|
/* @__PURE__ */ d("div", { className: "min-w-0 flex-1", children: [
|
|
3106
|
-
/* @__PURE__ */
|
|
3107
|
-
|
|
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: [
|
|
3108
3149
|
"Минимум ",
|
|
3109
3150
|
c,
|
|
3110
3151
|
" колонок"
|
|
@@ -3113,7 +3154,7 @@ function xr({
|
|
|
3113
3154
|
]
|
|
3114
3155
|
}
|
|
3115
3156
|
),
|
|
3116
|
-
|
|
3157
|
+
b !== n.length - 1 && /* @__PURE__ */ r("div", { className: "mx-2 h-px bg-slate-100" })
|
|
3117
3158
|
] }, u.key);
|
|
3118
3159
|
})
|
|
3119
3160
|
}
|
|
@@ -3122,157 +3163,157 @@ function xr({
|
|
|
3122
3163
|
}
|
|
3123
3164
|
) : null;
|
|
3124
3165
|
}
|
|
3125
|
-
const
|
|
3166
|
+
const qe = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Jr = (e) => {
|
|
3126
3167
|
if (!e) return null;
|
|
3127
3168
|
try {
|
|
3128
3169
|
const t = JSON.parse(e);
|
|
3129
3170
|
if (typeof t != "object" || t === null) return null;
|
|
3130
|
-
const
|
|
3131
|
-
return !
|
|
3171
|
+
const n = t;
|
|
3172
|
+
return !qe(n.order) || !qe(n.hidden) ? null : { order: n.order, hidden: n.hidden };
|
|
3132
3173
|
} catch {
|
|
3133
3174
|
return null;
|
|
3134
3175
|
}
|
|
3135
|
-
},
|
|
3136
|
-
const t = /* @__PURE__ */ new Set(),
|
|
3176
|
+
}, me = (e) => {
|
|
3177
|
+
const t = /* @__PURE__ */ new Set(), n = [];
|
|
3137
3178
|
for (const l of e)
|
|
3138
|
-
t.has(l) || (t.add(l),
|
|
3139
|
-
return
|
|
3140
|
-
},
|
|
3141
|
-
const
|
|
3142
|
-
return
|
|
3143
|
-
},
|
|
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) => {
|
|
3144
3185
|
if (!t?.length) return [];
|
|
3145
|
-
const
|
|
3146
|
-
return e.filter((l) => !
|
|
3147
|
-
},
|
|
3148
|
-
const l = new Set(t), o =
|
|
3149
|
-
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);
|
|
3150
3191
|
};
|
|
3151
|
-
function
|
|
3152
|
-
const { storageKey: t, columns:
|
|
3153
|
-
() =>
|
|
3154
|
-
[
|
|
3155
|
-
), [
|
|
3156
|
-
const f =
|
|
3157
|
-
|
|
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,
|
|
3158
3199
|
o?.map(String) ?? []
|
|
3159
|
-
),
|
|
3160
|
-
|
|
3200
|
+
), L = Je(
|
|
3201
|
+
i,
|
|
3161
3202
|
l?.map(String) ?? []
|
|
3162
3203
|
);
|
|
3163
3204
|
if (typeof window > "u")
|
|
3164
3205
|
return {
|
|
3165
3206
|
order: f,
|
|
3166
|
-
hidden:
|
|
3207
|
+
hidden: we(L, i, g)
|
|
3167
3208
|
};
|
|
3168
|
-
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)));
|
|
3169
3210
|
return {
|
|
3170
3211
|
order: m,
|
|
3171
|
-
hidden:
|
|
3212
|
+
hidden: we(v ? u : L, i, g)
|
|
3172
3213
|
};
|
|
3173
3214
|
});
|
|
3174
|
-
|
|
3215
|
+
J(() => {
|
|
3175
3216
|
if (!(typeof window > "u"))
|
|
3176
3217
|
try {
|
|
3177
|
-
window.localStorage.setItem(t, JSON.stringify(
|
|
3218
|
+
window.localStorage.setItem(t, JSON.stringify(x));
|
|
3178
3219
|
} catch {
|
|
3179
3220
|
}
|
|
3180
|
-
}, [
|
|
3181
|
-
|
|
3182
|
-
const
|
|
3221
|
+
}, [x, t]), J(() => {
|
|
3222
|
+
y((f) => {
|
|
3223
|
+
const L = me([
|
|
3183
3224
|
...f.order.filter((u) => c.has(u)),
|
|
3184
|
-
...
|
|
3185
|
-
]),
|
|
3186
|
-
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 };
|
|
3187
3228
|
});
|
|
3188
|
-
}, [
|
|
3189
|
-
const
|
|
3229
|
+
}, [i, c, g]);
|
|
3230
|
+
const S = P(() => new Set(x.hidden), [x.hidden]), I = P(() => {
|
|
3190
3231
|
const f = /* @__PURE__ */ new Map();
|
|
3191
|
-
return
|
|
3192
|
-
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;
|
|
3193
3234
|
return D - m;
|
|
3194
3235
|
});
|
|
3195
|
-
}, [
|
|
3196
|
-
() =>
|
|
3197
|
-
[
|
|
3198
|
-
), E =
|
|
3199
|
-
() =>
|
|
3200
|
-
[
|
|
3201
|
-
), h =
|
|
3202
|
-
const
|
|
3203
|
-
|
|
3204
|
-
if (
|
|
3205
|
-
return { ...
|
|
3206
|
-
if (
|
|
3207
|
-
const u =
|
|
3208
|
-
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 };
|
|
3209
3250
|
});
|
|
3210
|
-
}, [
|
|
3211
|
-
|
|
3212
|
-
const D =
|
|
3213
|
-
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;
|
|
3214
3255
|
const [m] = D.splice(f, 1);
|
|
3215
|
-
return D.splice(
|
|
3256
|
+
return D.splice(L, 0, m), { ...v, order: D };
|
|
3216
3257
|
});
|
|
3217
|
-
}, []),
|
|
3218
|
-
const D = String(f), m = String(
|
|
3219
|
-
D !== m &&
|
|
3220
|
-
const
|
|
3221
|
-
if (
|
|
3222
|
-
let
|
|
3223
|
-
if (
|
|
3224
|
-
const [
|
|
3225
|
-
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 };
|
|
3226
3267
|
});
|
|
3227
|
-
}, []),
|
|
3228
|
-
|
|
3229
|
-
const f =
|
|
3230
|
-
|
|
3268
|
+
}, []), k = R(() => {
|
|
3269
|
+
y(() => {
|
|
3270
|
+
const f = Ge(
|
|
3271
|
+
i,
|
|
3231
3272
|
o?.map(String) ?? []
|
|
3232
|
-
),
|
|
3233
|
-
|
|
3273
|
+
), L = Je(
|
|
3274
|
+
i,
|
|
3234
3275
|
l?.map(String) ?? []
|
|
3235
3276
|
);
|
|
3236
3277
|
return {
|
|
3237
3278
|
order: f,
|
|
3238
|
-
hidden:
|
|
3279
|
+
hidden: we(L, i, g)
|
|
3239
3280
|
};
|
|
3240
3281
|
});
|
|
3241
|
-
}, [
|
|
3282
|
+
}, [i, o, l, g]);
|
|
3242
3283
|
return {
|
|
3243
|
-
orderedAllColumns:
|
|
3244
|
-
orderedColumns:
|
|
3284
|
+
orderedAllColumns: I,
|
|
3285
|
+
orderedColumns: T,
|
|
3245
3286
|
hiddenKeys: E,
|
|
3246
3287
|
visibleCount: h,
|
|
3247
|
-
toggleColumn:
|
|
3248
|
-
moveColumn:
|
|
3249
|
-
moveColumnByKey:
|
|
3250
|
-
reset:
|
|
3288
|
+
toggleColumn: w,
|
|
3289
|
+
moveColumn: M,
|
|
3290
|
+
moveColumnByKey: O,
|
|
3291
|
+
reset: k
|
|
3251
3292
|
};
|
|
3252
3293
|
}
|
|
3253
3294
|
export {
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
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
|
|
3278
3319
|
};
|