@mci-ui/mci-ui 0.0.93 → 0.0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/png/empty.png.js +4 -0
- package/dist/index.css +1 -1
- package/dist/index.js +54 -50
- package/dist/shared/lib/uploadLanguage.js +6 -3
- package/dist/shared/ui/MciModal/MciModal.js +1 -1
- package/dist/shared/ui/mciAccordion/MciAccordion.js +4 -4
- package/dist/shared/ui/mciButton/MciButton.js +12 -10
- package/dist/shared/ui/mciCollapse/MciCollapse.js +1 -1
- package/dist/shared/ui/mciDrawer/MciDrawer.js +1 -1
- package/dist/shared/ui/mciEmpty/MciEmpty.js +41 -0
- package/dist/shared/ui/mciInput/MciInput.js +32 -32
- package/dist/shared/ui/mciPagination/MciPagination.js +32 -32
- package/dist/shared/ui/mciPhone/MciPhone.js +23 -23
- package/dist/shared/ui/mciPicker/MciPicker.js +2 -2
- package/dist/shared/ui/mciTable/MciTable.js +317 -165
- package/dist/shared/ui/mciTable/MciTableClamp2.js +5 -5
- package/dist/shared/ui/mciTabs/FilledTabs.js +38 -36
- package/dist/shared/ui/mciTabs/OutlinedTabs.js +28 -24
- package/dist/shared/ui/mciTabs/TabCountBadge.js +19 -0
- package/dist/shared/ui/mciTag/MciTag.js +17 -17
- package/dist/shared/ui/mciTextarea/MciTextarea.js +5 -5
- package/dist/shared/ui/mciTimePicker/MciTimePicker.js +368 -217
- package/dist/shared/ui/mciUpload/MciUpload.js +102 -352
- package/dist/shared/ui/mciUpload/MciUploadButton.js +143 -0
- package/dist/shared/ui/mciUpload/MciUploadFileList.js +167 -0
- package/dist/shared/ui/mciUpload/mci-upload.theme.js +103 -0
- package/dist/shared/ui/mciUpload/mci-upload.utils.js +90 -41
- package/dist/shared/ui/mciUpload/useMciUpload.js +183 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/shared/lib/uploadLanguage.d.ts +2 -0
- package/dist/types/shared/types/ui/empty.types.d.ts +11 -0
- package/dist/types/shared/types/ui/index.d.ts +2 -1
- package/dist/types/shared/types/ui/tabs.types.d.ts +1 -0
- package/dist/types/shared/types/ui/time-picker.types.d.ts +7 -1
- package/dist/types/shared/types/ui/upload.types.d.ts +25 -1
- package/dist/types/shared/ui/mciEmpty/MciEmpty.d.ts +2 -0
- package/dist/types/shared/ui/mciTabs/TabCountBadge.d.ts +5 -0
- package/dist/types/shared/ui/mciUpload/MciUploadButton.d.ts +4 -0
- package/dist/types/shared/ui/mciUpload/MciUploadFileList.d.ts +18 -0
- package/dist/types/shared/ui/mciUpload/mci-upload.theme.d.ts +101 -0
- package/dist/types/shared/ui/mciUpload/mci-upload.utils.d.ts +7 -0
- package/dist/types/shared/ui/mciUpload/useMciUpload.d.ts +131 -0
- package/package.json +1 -1
|
@@ -1,264 +1,415 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ClockCircle as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useClickOutside as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as l, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { ClockCircle as De } from "@solar-icons/react";
|
|
3
|
+
import { forwardRef as Me, useState as x, useRef as Pe, useMemo as Se, useCallback as C, useEffect as F } from "react";
|
|
4
|
+
import { useClickOutside as Te, useEscapeKey as Ee, cn as p } from "../../lib/utils.js";
|
|
5
|
+
import Oe from "../mciInput/MciInput.js";
|
|
6
|
+
const c = (u) => u.toString().padStart(2, "0"), E = 31, te = {
|
|
7
|
+
en: {
|
|
8
|
+
day: "Day",
|
|
9
|
+
hour: "Hour",
|
|
10
|
+
minute: "Minute",
|
|
11
|
+
ok: "OK",
|
|
12
|
+
timePlaceholder: "Hour:minute",
|
|
13
|
+
durationPlaceholder: "Days, hours, minutes",
|
|
14
|
+
units: { day: "day", hour: "hr", minute: "min" }
|
|
15
|
+
},
|
|
16
|
+
uz: {
|
|
17
|
+
day: "Kun",
|
|
18
|
+
hour: "Soat",
|
|
19
|
+
minute: "Minut",
|
|
20
|
+
ok: "OK",
|
|
21
|
+
timePlaceholder: "Soat:minut",
|
|
22
|
+
durationPlaceholder: "Kun, soat, minut",
|
|
23
|
+
units: { day: "kunda", hour: "soat", minute: "min" }
|
|
24
|
+
},
|
|
25
|
+
ru: {
|
|
26
|
+
day: "День",
|
|
27
|
+
hour: "Час",
|
|
28
|
+
minute: "Минута",
|
|
29
|
+
ok: "OK",
|
|
30
|
+
timePlaceholder: "Часы:минуты",
|
|
31
|
+
durationPlaceholder: "Дни, часы, минуты",
|
|
32
|
+
units: { day: "дн", hour: "ч", minute: "мин" }
|
|
33
|
+
}
|
|
34
|
+
}, Le = {
|
|
35
|
+
blue: {
|
|
36
|
+
button: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-[rgba(21,93,252,0.25)]",
|
|
37
|
+
darkButton: "bg-blue-500 text-black hover:bg-blue-400 focus:ring-blue-500/35",
|
|
38
|
+
step: "text-blue-600 hover:bg-blue-50",
|
|
39
|
+
darkStep: "text-blue-300 hover:bg-blue-500/10",
|
|
40
|
+
input: "focus:border-blue-500 focus:ring-blue-500/20"
|
|
41
|
+
},
|
|
42
|
+
yellow: {
|
|
43
|
+
button: "bg-yellow-500 text-white hover:bg-yellow-600 focus:ring-yellow-300",
|
|
44
|
+
darkButton: "bg-yellow-400 text-slate-950 hover:bg-yellow-300 focus:ring-yellow-300/40",
|
|
45
|
+
step: "text-yellow-600 hover:bg-yellow-50",
|
|
46
|
+
darkStep: "text-yellow-300 hover:bg-yellow-500/10",
|
|
47
|
+
input: "focus:border-yellow-500 focus:ring-yellow-500/20"
|
|
48
|
+
},
|
|
49
|
+
orange: {
|
|
50
|
+
button: "bg-orange-600 text-white hover:bg-orange-700 focus:ring-[rgba(227,98,12,0.25)]",
|
|
51
|
+
darkButton: "bg-orange-500 text-black hover:bg-orange-400 focus:ring-[rgba(227,98,12,0.25)]",
|
|
52
|
+
step: "text-orange-600 hover:bg-orange-50",
|
|
53
|
+
darkStep: "text-orange-300 hover:bg-orange-500/10",
|
|
54
|
+
input: "focus:border-orange-500 focus:ring-orange-500/20"
|
|
55
|
+
}
|
|
56
|
+
}, Be = (u, i) => `${c(u)}:${c(i)}`, ze = (u, i, e, o, r = "text") => {
|
|
57
|
+
if (r === "dot")
|
|
58
|
+
return `${c(u)}.${c(i)}.${c(e)}`;
|
|
59
|
+
const { units: s } = te[o];
|
|
60
|
+
return `${c(u)} ${s.day} ${c(i)} ${s.hour} ${c(e)} ${s.minute}`;
|
|
61
|
+
}, Re = (u, i, e, o, r, s = "text") => u === "duration" ? ze(i, e, o, r, s) : Be(e, o), A = (u, i, e, o, r, s = "text") => u === "duration" && i === 0 && e === 0 && o === 0 ? null : Re(u, i, e, o, r, s), ee = (u, i, e, o, r, s = "text") => A(u, i, e, o, r, s) ?? "", V = (u, i) => {
|
|
62
|
+
if (!u) return null;
|
|
63
|
+
const e = u.replace(/\D/g, "");
|
|
64
|
+
if (i === "duration") {
|
|
65
|
+
if (e.length !== 6) return null;
|
|
66
|
+
const s = Number.parseInt(e.slice(0, 2), 10), $ = Number.parseInt(e.slice(2, 4), 10), D = Number.parseInt(e.slice(4, 6), 10);
|
|
67
|
+
return s < 0 || s > E || $ < 0 || $ > 23 || D < 0 || D > 59 ? null : { days: s, hours: $, minutes: D };
|
|
13
68
|
}
|
|
14
69
|
if (e.length !== 4) return null;
|
|
15
|
-
const
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
70
|
+
const o = Number.parseInt(e.slice(0, 2), 10), r = Number.parseInt(e.slice(2, 4), 10);
|
|
71
|
+
return o < 0 || o > 23 || r < 0 || r > 59 ? null : { days: 0, hours: o, minutes: r };
|
|
72
|
+
}, Ve = (u, i, e, o = "text") => {
|
|
73
|
+
const r = u.replace(/\D/g, "").slice(0, i === "duration" ? 6 : 4);
|
|
74
|
+
if (i === "duration") {
|
|
75
|
+
if (o === "dot")
|
|
76
|
+
return 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;
|
|
77
|
+
const { units: s } = te[e];
|
|
78
|
+
return r.length > 4 ? `${r.slice(0, 2)} ${s.day} ${r.slice(2, 4)} ${s.hour} ${r.slice(4)}` : r.length > 2 ? `${r.slice(0, 2)} ${s.day} ${r.slice(2)}` : r;
|
|
79
|
+
}
|
|
80
|
+
return r.length > 2 ? `${r.slice(0, 2)}:${r.slice(2)}` : r;
|
|
81
|
+
}, Ae = Me(
|
|
21
82
|
({
|
|
22
|
-
value:
|
|
23
|
-
onChange:
|
|
83
|
+
value: u,
|
|
84
|
+
onChange: i,
|
|
24
85
|
mode: e = "time",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
86
|
+
durationFormat: o = "text",
|
|
87
|
+
variant: r = "orange",
|
|
88
|
+
locale: s = "en",
|
|
89
|
+
placeholder: $,
|
|
90
|
+
label: D,
|
|
91
|
+
darkMode: b = !1,
|
|
92
|
+
disabled: O = !1,
|
|
93
|
+
required: ce = !1,
|
|
94
|
+
className: he,
|
|
95
|
+
error: de,
|
|
96
|
+
showClear: me = !0,
|
|
97
|
+
allowManualInput: L = !0,
|
|
98
|
+
iconPosition: ne = "left",
|
|
99
|
+
size: fe = "base",
|
|
100
|
+
minuteStep: ge = 1,
|
|
101
|
+
align: K = "auto"
|
|
102
|
+
}, pe) => {
|
|
103
|
+
const [d, _] = x(!1), [be, ye] = x(null), [re, y] = x(""), [H, se] = x(!1), [j, oe] = x(K), [W, M] = x("00"), [U, P] = x("00"), [X, S] = x("00"), B = Pe(null), z = u !== void 0 ? u : be, h = Se(() => V(z, e), [z, e]), ue = Math.min(Math.max(Math.floor(ge) || 1, 1), 59), v = te[s], T = Le[r], xe = $ ?? (e === "duration" ? v.durationPlaceholder : v.timePlaceholder), N = C(
|
|
104
|
+
(n) => {
|
|
105
|
+
u === void 0 && ye(n), i?.(n);
|
|
42
106
|
},
|
|
43
|
-
[
|
|
44
|
-
),
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
|
|
51
|
-
|
|
107
|
+
[i, u]
|
|
108
|
+
), ie = C(() => {
|
|
109
|
+
const n = V(z, e);
|
|
110
|
+
M(c(n?.days ?? 0)), P(c(n?.hours ?? 0)), S(c(n?.minutes ?? 0));
|
|
111
|
+
}, [z, e]), Y = C(() => {
|
|
112
|
+
O || (ie(), _(!0));
|
|
113
|
+
}, [O, ie]), R = C(() => {
|
|
114
|
+
_(!1), y(
|
|
115
|
+
h ? ee(
|
|
116
|
+
e,
|
|
117
|
+
h.days,
|
|
118
|
+
h.hours,
|
|
119
|
+
h.minutes,
|
|
120
|
+
s,
|
|
121
|
+
o
|
|
122
|
+
) : ""
|
|
52
123
|
);
|
|
53
|
-
}, [
|
|
54
|
-
(
|
|
55
|
-
|
|
124
|
+
}, [h, o, s, e]), Ne = C(
|
|
125
|
+
(n) => {
|
|
126
|
+
n.preventDefault(), n.stopPropagation(), d ? R() : Y();
|
|
56
127
|
},
|
|
57
|
-
[
|
|
58
|
-
), { handleClick:
|
|
59
|
-
|
|
60
|
-
!
|
|
61
|
-
|
|
128
|
+
[R, d, Y]
|
|
129
|
+
), { handleClick: q } = Te(B, R), { handleEscape: G } = Ee(R);
|
|
130
|
+
F(() => {
|
|
131
|
+
!d && !H && y(
|
|
132
|
+
h ? ee(
|
|
133
|
+
e,
|
|
134
|
+
h.days,
|
|
135
|
+
h.hours,
|
|
136
|
+
h.minutes,
|
|
137
|
+
s,
|
|
138
|
+
o
|
|
139
|
+
) : ""
|
|
62
140
|
);
|
|
63
|
-
}, [
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
|
|
141
|
+
}, [h, o, H, d, s, e]), F(() => {
|
|
142
|
+
if (d && K === "auto" && B.current) {
|
|
143
|
+
const n = B.current.getBoundingClientRect(), a = window.innerWidth - n.right, t = n.left, f = e === "duration" ? 316 : 220;
|
|
144
|
+
a < f && t > f ? oe("right") : oe("left");
|
|
67
145
|
}
|
|
68
|
-
}, [
|
|
69
|
-
if (
|
|
70
|
-
return document.addEventListener("mousedown",
|
|
71
|
-
document.removeEventListener("mousedown",
|
|
146
|
+
}, [K, d, e]), F(() => {
|
|
147
|
+
if (d)
|
|
148
|
+
return document.addEventListener("mousedown", q), document.addEventListener("keydown", G), () => {
|
|
149
|
+
document.removeEventListener("mousedown", q), document.removeEventListener("keydown", G);
|
|
72
150
|
};
|
|
73
|
-
}, [
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
if (!
|
|
80
|
-
|
|
151
|
+
}, [q, G, d]);
|
|
152
|
+
const ve = () => {
|
|
153
|
+
se(!0), L || Y();
|
|
154
|
+
}, Ie = () => {
|
|
155
|
+
if (se(!1), !L) return;
|
|
156
|
+
const n = re.trim();
|
|
157
|
+
if (!n) {
|
|
158
|
+
N(null);
|
|
81
159
|
return;
|
|
82
160
|
}
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
|
|
161
|
+
const a = V(n, e);
|
|
162
|
+
if (a) {
|
|
163
|
+
const t = A(
|
|
164
|
+
e,
|
|
165
|
+
a.days,
|
|
166
|
+
a.hours,
|
|
167
|
+
a.minutes,
|
|
168
|
+
s,
|
|
169
|
+
o
|
|
170
|
+
);
|
|
171
|
+
N(t), y(t ?? "");
|
|
87
172
|
return;
|
|
88
173
|
}
|
|
89
|
-
|
|
90
|
-
|
|
174
|
+
y(
|
|
175
|
+
h ? ee(
|
|
176
|
+
e,
|
|
177
|
+
h.days,
|
|
178
|
+
h.hours,
|
|
179
|
+
h.minutes,
|
|
180
|
+
s,
|
|
181
|
+
o
|
|
182
|
+
) : ""
|
|
91
183
|
);
|
|
92
|
-
},
|
|
93
|
-
if (!
|
|
94
|
-
const
|
|
95
|
-
if (e === "
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
184
|
+
}, we = (n) => {
|
|
185
|
+
if (!L) return;
|
|
186
|
+
const a = Ve(n.target.value, e, s, o), t = a.replace(/\D/g, "");
|
|
187
|
+
if (e === "duration") {
|
|
188
|
+
if (t.length >= 1 && Number.parseInt(t[0] ?? "0", 10) > 3 || t.length >= 2 && Number.parseInt(t.slice(0, 2), 10) > E || t.length >= 3 && Number.parseInt(t[2] ?? "0", 10) > 2 || t.length >= 4 && Number.parseInt(t.slice(2, 4), 10) > 23 || t.length >= 5 && Number.parseInt(t[4] ?? "0", 10) > 5 || t.length >= 6 && Number.parseInt(t.slice(4, 6), 10) > 59)
|
|
189
|
+
return;
|
|
190
|
+
} else if (t.length >= 1 && Number.parseInt(t[0] ?? "0", 10) > 2 || t.length >= 2 && Number.parseInt(t.slice(0, 2), 10) > 23 || t.length >= 3 && Number.parseInt(t[2] ?? "0", 10) > 5 || t.length >= 4 && Number.parseInt(t.slice(2, 4), 10) > 59) return;
|
|
191
|
+
y(a);
|
|
192
|
+
const f = e === "duration" ? 6 : 4;
|
|
193
|
+
if (t.length === f) {
|
|
194
|
+
const m = V(a, e);
|
|
195
|
+
if (m) {
|
|
196
|
+
const g = A(
|
|
197
|
+
e,
|
|
198
|
+
m.days,
|
|
199
|
+
m.hours,
|
|
200
|
+
m.minutes,
|
|
201
|
+
s,
|
|
202
|
+
o
|
|
203
|
+
);
|
|
204
|
+
N(g), y(g ?? "");
|
|
205
|
+
}
|
|
206
|
+
} else a === "" && N(null);
|
|
207
|
+
}, ke = C(() => {
|
|
208
|
+
N(null), y(""), M("00"), P("00"), S("00");
|
|
209
|
+
}, [N]), J = (n, a) => {
|
|
210
|
+
const t = a.replace(/\D/g, "").slice(0, 2);
|
|
211
|
+
n === "days" && t.length === 2 && Number.parseInt(t, 10) > E || n === "hours" && t.length === 2 && Number.parseInt(t, 10) > 23 || n === "minutes" && t.length === 2 && Number.parseInt(t, 10) > 59 || (n === "days" ? M(t) : n === "hours" ? P(t) : S(t));
|
|
212
|
+
}, I = (n, a) => {
|
|
213
|
+
if (n === "days") {
|
|
214
|
+
const m = Number.parseInt(W || "0", 10), g = Math.min(Math.max(m + a, 0), E);
|
|
215
|
+
M(c(g));
|
|
111
216
|
return;
|
|
112
217
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
218
|
+
if (n === "hours") {
|
|
219
|
+
const g = (Number.parseInt(U || "0", 10) + a + 24) % 24;
|
|
220
|
+
P(c(g));
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const f = (Number.parseInt(X || "0", 10) + a + 60) % 60;
|
|
224
|
+
S(c(f));
|
|
225
|
+
}, Ce = () => {
|
|
226
|
+
const n = Number.parseInt(W || "0", 10), a = Number.parseInt(U || "0", 10), t = Number.parseInt(X || "0", 10), f = Math.min(Math.max(n, 0), E), m = Math.min(Math.max(a, 0), 23), g = Math.min(Math.max(t, 0), 59), le = A(
|
|
227
|
+
e,
|
|
228
|
+
f,
|
|
229
|
+
m,
|
|
230
|
+
g,
|
|
231
|
+
s,
|
|
232
|
+
o
|
|
233
|
+
);
|
|
234
|
+
N(le), y(le ?? ""), M(c(f)), P(c(m)), S(c(g)), _(!1);
|
|
235
|
+
}, Q = p(
|
|
236
|
+
"mb-1 block text-center text-[11px] font-semibold leading-4",
|
|
237
|
+
b ? "text-neutral-100" : "text-slate-500"
|
|
238
|
+
), w = p(
|
|
239
|
+
"h-6 w-full cursor-pointer rounded-md text-base font-semibold leading-none transition-colors",
|
|
240
|
+
b ? T.darkStep : T.step
|
|
241
|
+
), Z = p(
|
|
242
|
+
"h-8 w-full rounded-md border px-1 text-center text-sm font-semibold outline-none transition-colors focus:ring-2",
|
|
243
|
+
b ? "border-neutral-300 bg-[#1F2025]" : "border-slate-200 bg-white",
|
|
244
|
+
T.input
|
|
245
|
+
), $e = p(
|
|
246
|
+
"mt-2 h-8 w-full cursor-pointer rounded-md text-sm font-semibold transition-colors focus:ring-2",
|
|
247
|
+
b ? T.darkButton : T.button
|
|
248
|
+
), ae = /* @__PURE__ */ l(
|
|
119
249
|
"div",
|
|
120
250
|
{
|
|
121
|
-
onClick:
|
|
122
|
-
className:
|
|
251
|
+
onClick: Ne,
|
|
252
|
+
className: p(
|
|
123
253
|
"flex cursor-pointer items-center justify-center rounded-md p-1 transition-colors",
|
|
124
|
-
|
|
254
|
+
O ? "pointer-events-none opacity-50" : b ? "hover:bg-neutral-300 active:bg-neutral-200" : "hover:bg-slate-100 active:bg-slate-200"
|
|
125
255
|
),
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
-
|
|
256
|
+
children: /* @__PURE__ */ l(
|
|
257
|
+
De,
|
|
128
258
|
{
|
|
129
259
|
weight: "Linear",
|
|
130
260
|
size: 20,
|
|
131
|
-
className:
|
|
132
|
-
|
|
261
|
+
className: p(
|
|
262
|
+
b ? d || H ? "text-white" : "text-neutral-100" : "text-slate-400"
|
|
133
263
|
)
|
|
134
264
|
}
|
|
135
265
|
)
|
|
136
266
|
}
|
|
137
267
|
);
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
|
|
268
|
+
return /* @__PURE__ */ k("div", { ref: B, className: p("relative w-full group", he), children: [
|
|
269
|
+
/* @__PURE__ */ l("div", { ref: pe, children: /* @__PURE__ */ l(
|
|
270
|
+
Oe,
|
|
141
271
|
{
|
|
142
|
-
label:
|
|
143
|
-
placeholder:
|
|
144
|
-
value:
|
|
145
|
-
onChange:
|
|
146
|
-
icon:
|
|
147
|
-
rightIcon:
|
|
148
|
-
disabled:
|
|
149
|
-
required:
|
|
150
|
-
error:
|
|
151
|
-
darkMode:
|
|
152
|
-
size:
|
|
153
|
-
maxLength: e === "
|
|
154
|
-
onFocus:
|
|
155
|
-
onBlur:
|
|
156
|
-
readOnly: !
|
|
157
|
-
showClearButton:
|
|
158
|
-
onClear:
|
|
272
|
+
label: D,
|
|
273
|
+
placeholder: xe,
|
|
274
|
+
value: re,
|
|
275
|
+
onChange: we,
|
|
276
|
+
icon: ne === "left" ? ae : void 0,
|
|
277
|
+
rightIcon: ne === "right" ? ae : void 0,
|
|
278
|
+
disabled: O,
|
|
279
|
+
required: ce,
|
|
280
|
+
error: de,
|
|
281
|
+
darkMode: b,
|
|
282
|
+
size: fe,
|
|
283
|
+
maxLength: e === "duration" ? 24 : 5,
|
|
284
|
+
onFocus: ve,
|
|
285
|
+
onBlur: Ie,
|
|
286
|
+
readOnly: !L,
|
|
287
|
+
showClearButton: me,
|
|
288
|
+
onClear: ke
|
|
159
289
|
}
|
|
160
290
|
) }),
|
|
161
|
-
|
|
291
|
+
d && /* @__PURE__ */ k(
|
|
162
292
|
"div",
|
|
163
293
|
{
|
|
164
|
-
className:
|
|
165
|
-
"absolute top-[calc(100%+4px)] z-100 rounded-
|
|
294
|
+
className: p(
|
|
295
|
+
"absolute top-[calc(100%+4px)] z-100 rounded-lg border p-2.5 shadow-xl",
|
|
166
296
|
"animate-in fade-in zoom-in-95 duration-200",
|
|
167
|
-
e === "
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
297
|
+
e === "duration" ? "w-[300px]" : "w-52",
|
|
298
|
+
b ? "border-neutral-200 bg-[#1F2025] text-neutral-50" : "border-slate-200 bg-white text-slate-700",
|
|
299
|
+
j === "right" && "right-0 origin-top-right",
|
|
300
|
+
j === "left" && "left-0 origin-top-left",
|
|
301
|
+
j === "center" && "left-1/2 -translate-x-1/2 origin-top"
|
|
172
302
|
),
|
|
173
|
-
onMouseDown: (
|
|
303
|
+
onMouseDown: (n) => n.stopPropagation(),
|
|
174
304
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
"
|
|
180
|
-
|
|
181
|
-
type: "button",
|
|
182
|
-
onClick: () => O("hours", 1),
|
|
183
|
-
className: u(
|
|
184
|
-
"mb-1 h-8 w-full rounded-md text-lg leading-none transition-colors hover:cursor-pointer",
|
|
185
|
-
s ? "hover:bg-neutral-300" : "hover:bg-slate-100"
|
|
186
|
-
),
|
|
187
|
-
children: "+"
|
|
188
|
-
}
|
|
305
|
+
/* @__PURE__ */ k(
|
|
306
|
+
"div",
|
|
307
|
+
{
|
|
308
|
+
className: p(
|
|
309
|
+
"grid gap-2",
|
|
310
|
+
e === "duration" ? "grid-cols-3" : "grid-cols-2"
|
|
189
311
|
),
|
|
190
|
-
|
|
191
|
-
"
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
312
|
+
children: [
|
|
313
|
+
e === "duration" && /* @__PURE__ */ k("div", { className: "space-y-1", children: [
|
|
314
|
+
/* @__PURE__ */ l("span", { className: Q, children: v.day }),
|
|
315
|
+
/* @__PURE__ */ l(
|
|
316
|
+
"button",
|
|
317
|
+
{
|
|
318
|
+
type: "button",
|
|
319
|
+
onClick: () => I("days", 1),
|
|
320
|
+
className: w,
|
|
321
|
+
children: "+"
|
|
322
|
+
}
|
|
198
323
|
),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
className: u(
|
|
208
|
-
"mt-1 h-8 w-full rounded-md text-lg leading-none transition-colors hover:cursor-pointer",
|
|
209
|
-
s ? "hover:bg-neutral-300" : "hover:bg-slate-100"
|
|
324
|
+
/* @__PURE__ */ l(
|
|
325
|
+
"input",
|
|
326
|
+
{
|
|
327
|
+
value: W,
|
|
328
|
+
onChange: (n) => J("days", n.target.value),
|
|
329
|
+
className: Z,
|
|
330
|
+
inputMode: "numeric"
|
|
331
|
+
}
|
|
210
332
|
),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
className:
|
|
223
|
-
|
|
224
|
-
|
|
333
|
+
/* @__PURE__ */ l(
|
|
334
|
+
"button",
|
|
335
|
+
{
|
|
336
|
+
type: "button",
|
|
337
|
+
onClick: () => I("days", -1),
|
|
338
|
+
className: w,
|
|
339
|
+
children: "-"
|
|
340
|
+
}
|
|
341
|
+
)
|
|
342
|
+
] }),
|
|
343
|
+
/* @__PURE__ */ k("div", { className: "space-y-1", children: [
|
|
344
|
+
/* @__PURE__ */ l("span", { className: Q, children: v.hour }),
|
|
345
|
+
/* @__PURE__ */ l(
|
|
346
|
+
"button",
|
|
347
|
+
{
|
|
348
|
+
type: "button",
|
|
349
|
+
onClick: () => I("hours", 1),
|
|
350
|
+
className: w,
|
|
351
|
+
children: "+"
|
|
352
|
+
}
|
|
225
353
|
),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
className: u(
|
|
235
|
-
"h-10 w-full rounded-md border px-2 text-center text-base font-semibold outline-none",
|
|
236
|
-
s ? "border-neutral-300 bg-[#1F2025]" : "border-slate-200 bg-white"
|
|
354
|
+
/* @__PURE__ */ l(
|
|
355
|
+
"input",
|
|
356
|
+
{
|
|
357
|
+
value: U,
|
|
358
|
+
onChange: (n) => J("hours", n.target.value),
|
|
359
|
+
className: Z,
|
|
360
|
+
inputMode: "numeric"
|
|
361
|
+
}
|
|
237
362
|
),
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
363
|
+
/* @__PURE__ */ l(
|
|
364
|
+
"button",
|
|
365
|
+
{
|
|
366
|
+
type: "button",
|
|
367
|
+
onClick: () => I("hours", -1),
|
|
368
|
+
className: w,
|
|
369
|
+
children: "-"
|
|
370
|
+
}
|
|
371
|
+
)
|
|
372
|
+
] }),
|
|
373
|
+
/* @__PURE__ */ k("div", { className: "space-y-1", children: [
|
|
374
|
+
/* @__PURE__ */ l("span", { className: Q, children: v.minute }),
|
|
375
|
+
/* @__PURE__ */ l(
|
|
376
|
+
"button",
|
|
377
|
+
{
|
|
378
|
+
type: "button",
|
|
379
|
+
onClick: () => I("minutes", ue),
|
|
380
|
+
className: w,
|
|
381
|
+
children: "+"
|
|
382
|
+
}
|
|
383
|
+
),
|
|
384
|
+
/* @__PURE__ */ l(
|
|
385
|
+
"input",
|
|
386
|
+
{
|
|
387
|
+
value: X,
|
|
388
|
+
onChange: (n) => J("minutes", n.target.value),
|
|
389
|
+
className: Z,
|
|
390
|
+
inputMode: "numeric"
|
|
391
|
+
}
|
|
249
392
|
),
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
393
|
+
/* @__PURE__ */ l(
|
|
394
|
+
"button",
|
|
395
|
+
{
|
|
396
|
+
type: "button",
|
|
397
|
+
onClick: () => I("minutes", -ue),
|
|
398
|
+
className: w,
|
|
399
|
+
children: "-"
|
|
400
|
+
}
|
|
401
|
+
)
|
|
402
|
+
] })
|
|
403
|
+
]
|
|
404
|
+
}
|
|
405
|
+
),
|
|
406
|
+
/* @__PURE__ */ l(
|
|
256
407
|
"button",
|
|
257
408
|
{
|
|
258
409
|
type: "button",
|
|
259
|
-
onClick:
|
|
260
|
-
className:
|
|
261
|
-
children:
|
|
410
|
+
onClick: Ce,
|
|
411
|
+
className: $e,
|
|
412
|
+
children: v.ok
|
|
262
413
|
}
|
|
263
414
|
)
|
|
264
415
|
]
|
|
@@ -267,7 +418,7 @@ const m = (o) => o.toString().padStart(2, "0"), ve = (o, l) => `${m(o)}:${m(l)}`
|
|
|
267
418
|
] });
|
|
268
419
|
}
|
|
269
420
|
);
|
|
270
|
-
|
|
421
|
+
Ae.displayName = "MciTimePicker";
|
|
271
422
|
export {
|
|
272
|
-
|
|
423
|
+
Ae as default
|
|
273
424
|
};
|