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