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