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