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