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