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