@mci-ui/mci-ui 0.0.94 → 0.0.96
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/mciCheck/MciCheck.js +3 -3
- 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 +103 -90
- 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 +205 -194
- 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 +2 -0
- package/dist/types/shared/types/ui/time-picker.types.d.ts +2 -0
- 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/FilledTabs.d.ts +1 -1
- 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,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, jsxs as k } from "react/jsx-runtime";
|
|
2
2
|
import { ClockCircle as De } from "@solar-icons/react";
|
|
3
|
-
import { forwardRef as Me, useState as
|
|
4
|
-
import { useClickOutside as
|
|
5
|
-
import
|
|
6
|
-
const c = (
|
|
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
7
|
en: {
|
|
8
8
|
day: "Day",
|
|
9
9
|
hour: "Hour",
|
|
@@ -31,7 +31,7 @@ const c = (o) => o.toString().padStart(2, "0"), T = 31, ee = {
|
|
|
31
31
|
durationPlaceholder: "Дни, часы, минуты",
|
|
32
32
|
units: { day: "дн", hour: "ч", minute: "мин" }
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, Le = {
|
|
35
35
|
blue: {
|
|
36
36
|
button: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-[rgba(21,93,252,0.25)]",
|
|
37
37
|
darkButton: "bg-blue-500 text-black hover:bg-blue-400 focus:ring-blue-500/35",
|
|
@@ -53,338 +53,349 @@ const c = (o) => o.toString().padStart(2, "0"), T = 31, ee = {
|
|
|
53
53
|
darkStep: "text-orange-300 hover:bg-orange-500/10",
|
|
54
54
|
input: "focus:border-orange-500 focus:ring-orange-500/20"
|
|
55
55
|
}
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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, "");
|
|
62
64
|
if (i === "duration") {
|
|
63
65
|
if (e.length !== 6) return null;
|
|
64
|
-
const
|
|
65
|
-
return
|
|
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 };
|
|
66
68
|
}
|
|
67
69
|
if (e.length !== 4) return null;
|
|
68
|
-
const
|
|
69
|
-
return
|
|
70
|
-
},
|
|
71
|
-
const r =
|
|
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);
|
|
72
74
|
if (i === "duration") {
|
|
73
|
-
|
|
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];
|
|
74
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;
|
|
75
79
|
}
|
|
76
80
|
return r.length > 2 ? `${r.slice(0, 2)}:${r.slice(2)}` : r;
|
|
77
|
-
},
|
|
81
|
+
}, Ae = Me(
|
|
78
82
|
({
|
|
79
|
-
value:
|
|
83
|
+
value: u,
|
|
80
84
|
onChange: i,
|
|
81
85
|
mode: e = "time",
|
|
86
|
+
durationFormat: o = "text",
|
|
82
87
|
variant: r = "orange",
|
|
83
88
|
locale: s = "en",
|
|
84
|
-
placeholder:
|
|
89
|
+
placeholder: $,
|
|
85
90
|
label: D,
|
|
86
|
-
darkMode:
|
|
87
|
-
disabled:
|
|
88
|
-
required:
|
|
89
|
-
className:
|
|
91
|
+
darkMode: b = !1,
|
|
92
|
+
disabled: O = !1,
|
|
93
|
+
required: ce = !1,
|
|
94
|
+
className: he,
|
|
90
95
|
error: de,
|
|
91
|
-
showClear:
|
|
92
|
-
allowManualInput:
|
|
93
|
-
iconPosition:
|
|
94
|
-
size:
|
|
95
|
-
minuteStep:
|
|
96
|
-
align:
|
|
96
|
+
showClear: me = !0,
|
|
97
|
+
allowManualInput: L = !0,
|
|
98
|
+
iconPosition: ne = "left",
|
|
99
|
+
size: fe = "base",
|
|
100
|
+
minuteStep: ge = 1,
|
|
101
|
+
align: K = "auto"
|
|
97
102
|
}, pe) => {
|
|
98
|
-
const [
|
|
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(
|
|
99
104
|
(n) => {
|
|
100
|
-
|
|
105
|
+
u === void 0 && ye(n), i?.(n);
|
|
101
106
|
},
|
|
102
|
-
[i,
|
|
103
|
-
),
|
|
104
|
-
const n =
|
|
105
|
-
M(c(n?.days ?? 0)), P(c(n?.hours ?? 0)),
|
|
106
|
-
}, [
|
|
107
|
-
|
|
108
|
-
}, [
|
|
109
|
-
|
|
110
|
-
|
|
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(
|
|
111
116
|
e,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
s
|
|
117
|
+
h.days,
|
|
118
|
+
h.hours,
|
|
119
|
+
h.minutes,
|
|
120
|
+
s,
|
|
121
|
+
o
|
|
116
122
|
) : ""
|
|
117
123
|
);
|
|
118
|
-
}, [
|
|
124
|
+
}, [h, o, s, e]), Ne = C(
|
|
119
125
|
(n) => {
|
|
120
|
-
n.preventDefault(), n.stopPropagation(),
|
|
126
|
+
n.preventDefault(), n.stopPropagation(), d ? R() : Y();
|
|
121
127
|
},
|
|
122
|
-
[
|
|
123
|
-
), { handleClick:
|
|
124
|
-
|
|
125
|
-
!
|
|
126
|
-
|
|
128
|
+
[R, d, Y]
|
|
129
|
+
), { handleClick: q } = Te(B, R), { handleEscape: G } = Ee(R);
|
|
130
|
+
F(() => {
|
|
131
|
+
!d && !H && y(
|
|
132
|
+
h ? ee(
|
|
127
133
|
e,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
s
|
|
134
|
+
h.days,
|
|
135
|
+
h.hours,
|
|
136
|
+
h.minutes,
|
|
137
|
+
s,
|
|
138
|
+
o
|
|
132
139
|
) : ""
|
|
133
140
|
);
|
|
134
|
-
}, [
|
|
135
|
-
if (
|
|
136
|
-
const n =
|
|
137
|
-
|
|
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");
|
|
138
145
|
}
|
|
139
|
-
}, [
|
|
140
|
-
if (
|
|
141
|
-
return document.addEventListener("mousedown",
|
|
142
|
-
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);
|
|
143
150
|
};
|
|
144
|
-
}, [
|
|
151
|
+
}, [q, G, d]);
|
|
145
152
|
const ve = () => {
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
if (
|
|
149
|
-
const n =
|
|
153
|
+
se(!0), L || Y();
|
|
154
|
+
}, Ie = () => {
|
|
155
|
+
if (se(!1), !L) return;
|
|
156
|
+
const n = re.trim();
|
|
150
157
|
if (!n) {
|
|
151
158
|
N(null);
|
|
152
159
|
return;
|
|
153
160
|
}
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
const t =
|
|
161
|
+
const a = V(n, e);
|
|
162
|
+
if (a) {
|
|
163
|
+
const t = A(
|
|
157
164
|
e,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
s
|
|
165
|
+
a.days,
|
|
166
|
+
a.hours,
|
|
167
|
+
a.minutes,
|
|
168
|
+
s,
|
|
169
|
+
o
|
|
162
170
|
);
|
|
163
|
-
N(t),
|
|
171
|
+
N(t), y(t ?? "");
|
|
164
172
|
return;
|
|
165
173
|
}
|
|
166
|
-
|
|
167
|
-
|
|
174
|
+
y(
|
|
175
|
+
h ? ee(
|
|
168
176
|
e,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
s
|
|
177
|
+
h.days,
|
|
178
|
+
h.hours,
|
|
179
|
+
h.minutes,
|
|
180
|
+
s,
|
|
181
|
+
o
|
|
173
182
|
) : ""
|
|
174
183
|
);
|
|
175
|
-
},
|
|
176
|
-
if (!
|
|
177
|
-
const
|
|
184
|
+
}, we = (n) => {
|
|
185
|
+
if (!L) return;
|
|
186
|
+
const a = Ve(n.target.value, e, s, o), t = a.replace(/\D/g, "");
|
|
178
187
|
if (e === "duration") {
|
|
179
|
-
if (t.length >= 1 && Number.parseInt(t[0] ?? "0", 10) > 3 || t.length >= 2 && Number.parseInt(t.slice(0, 2), 10) >
|
|
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)
|
|
180
189
|
return;
|
|
181
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;
|
|
182
|
-
|
|
191
|
+
y(a);
|
|
183
192
|
const f = e === "duration" ? 6 : 4;
|
|
184
193
|
if (t.length === f) {
|
|
185
|
-
const m =
|
|
194
|
+
const m = V(a, e);
|
|
186
195
|
if (m) {
|
|
187
|
-
const
|
|
196
|
+
const g = A(
|
|
188
197
|
e,
|
|
189
198
|
m.days,
|
|
190
199
|
m.hours,
|
|
191
200
|
m.minutes,
|
|
192
|
-
s
|
|
201
|
+
s,
|
|
202
|
+
o
|
|
193
203
|
);
|
|
194
|
-
N(
|
|
204
|
+
N(g), y(g ?? "");
|
|
195
205
|
}
|
|
196
|
-
} else
|
|
197
|
-
},
|
|
198
|
-
N(null),
|
|
199
|
-
}, [N]),
|
|
200
|
-
const t =
|
|
201
|
-
n === "days" && t.length === 2 && Number.parseInt(t, 10) >
|
|
202
|
-
},
|
|
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) => {
|
|
203
213
|
if (n === "days") {
|
|
204
|
-
const m = Number.parseInt(
|
|
205
|
-
M(c(
|
|
214
|
+
const m = Number.parseInt(W || "0", 10), g = Math.min(Math.max(m + a, 0), E);
|
|
215
|
+
M(c(g));
|
|
206
216
|
return;
|
|
207
217
|
}
|
|
208
218
|
if (n === "hours") {
|
|
209
|
-
const
|
|
210
|
-
P(c(
|
|
219
|
+
const g = (Number.parseInt(U || "0", 10) + a + 24) % 24;
|
|
220
|
+
P(c(g));
|
|
211
221
|
return;
|
|
212
222
|
}
|
|
213
|
-
const f = (Number.parseInt(
|
|
214
|
-
|
|
215
|
-
},
|
|
216
|
-
const n = Number.parseInt(
|
|
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(
|
|
217
227
|
e,
|
|
218
228
|
f,
|
|
219
229
|
m,
|
|
220
|
-
|
|
221
|
-
s
|
|
230
|
+
g,
|
|
231
|
+
s,
|
|
232
|
+
o
|
|
222
233
|
);
|
|
223
|
-
N(
|
|
224
|
-
},
|
|
234
|
+
N(le), y(le ?? ""), M(c(f)), P(c(m)), S(c(g)), _(!1);
|
|
235
|
+
}, Q = p(
|
|
225
236
|
"mb-1 block text-center text-[11px] font-semibold leading-4",
|
|
226
|
-
|
|
227
|
-
),
|
|
228
|
-
"h-6 w-full rounded-md text-base font-semibold leading-none transition-colors
|
|
229
|
-
|
|
230
|
-
),
|
|
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(
|
|
231
242
|
"h-8 w-full rounded-md border px-1 text-center text-sm font-semibold outline-none transition-colors focus:ring-2",
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
),
|
|
235
|
-
"mt-2 h-8 w-full rounded-md text-sm font-semibold transition-colors
|
|
236
|
-
|
|
237
|
-
),
|
|
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(
|
|
238
249
|
"div",
|
|
239
250
|
{
|
|
240
251
|
onClick: Ne,
|
|
241
|
-
className:
|
|
252
|
+
className: p(
|
|
242
253
|
"flex cursor-pointer items-center justify-center rounded-md p-1 transition-colors",
|
|
243
|
-
|
|
254
|
+
O ? "pointer-events-none opacity-50" : b ? "hover:bg-neutral-300 active:bg-neutral-200" : "hover:bg-slate-100 active:bg-slate-200"
|
|
244
255
|
),
|
|
245
|
-
children: /* @__PURE__ */
|
|
256
|
+
children: /* @__PURE__ */ l(
|
|
246
257
|
De,
|
|
247
258
|
{
|
|
248
259
|
weight: "Linear",
|
|
249
260
|
size: 20,
|
|
250
|
-
className:
|
|
251
|
-
|
|
261
|
+
className: p(
|
|
262
|
+
b ? d || H ? "text-white" : "text-neutral-100" : "text-slate-400"
|
|
252
263
|
)
|
|
253
264
|
}
|
|
254
265
|
)
|
|
255
266
|
}
|
|
256
267
|
);
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
|
|
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,
|
|
260
271
|
{
|
|
261
272
|
label: D,
|
|
262
|
-
placeholder:
|
|
263
|
-
value:
|
|
264
|
-
onChange:
|
|
265
|
-
icon:
|
|
266
|
-
rightIcon:
|
|
267
|
-
disabled:
|
|
268
|
-
required:
|
|
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,
|
|
269
280
|
error: de,
|
|
270
|
-
darkMode:
|
|
271
|
-
size:
|
|
281
|
+
darkMode: b,
|
|
282
|
+
size: fe,
|
|
272
283
|
maxLength: e === "duration" ? 24 : 5,
|
|
273
284
|
onFocus: ve,
|
|
274
|
-
onBlur:
|
|
275
|
-
readOnly: !
|
|
276
|
-
showClearButton:
|
|
277
|
-
onClear:
|
|
285
|
+
onBlur: Ie,
|
|
286
|
+
readOnly: !L,
|
|
287
|
+
showClearButton: me,
|
|
288
|
+
onClear: ke
|
|
278
289
|
}
|
|
279
290
|
) }),
|
|
280
|
-
|
|
291
|
+
d && /* @__PURE__ */ k(
|
|
281
292
|
"div",
|
|
282
293
|
{
|
|
283
|
-
className:
|
|
294
|
+
className: p(
|
|
284
295
|
"absolute top-[calc(100%+4px)] z-100 rounded-lg border p-2.5 shadow-xl",
|
|
285
296
|
"animate-in fade-in zoom-in-95 duration-200",
|
|
286
297
|
e === "duration" ? "w-[300px]" : "w-52",
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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"
|
|
291
302
|
),
|
|
292
303
|
onMouseDown: (n) => n.stopPropagation(),
|
|
293
304
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ k(
|
|
295
306
|
"div",
|
|
296
307
|
{
|
|
297
|
-
className:
|
|
308
|
+
className: p(
|
|
298
309
|
"grid gap-2",
|
|
299
310
|
e === "duration" ? "grid-cols-3" : "grid-cols-2"
|
|
300
311
|
),
|
|
301
312
|
children: [
|
|
302
|
-
e === "duration" && /* @__PURE__ */
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
313
|
+
e === "duration" && /* @__PURE__ */ k("div", { className: "space-y-1", children: [
|
|
314
|
+
/* @__PURE__ */ l("span", { className: Q, children: v.day }),
|
|
315
|
+
/* @__PURE__ */ l(
|
|
305
316
|
"button",
|
|
306
317
|
{
|
|
307
318
|
type: "button",
|
|
308
|
-
onClick: () =>
|
|
309
|
-
className:
|
|
319
|
+
onClick: () => I("days", 1),
|
|
320
|
+
className: w,
|
|
310
321
|
children: "+"
|
|
311
322
|
}
|
|
312
323
|
),
|
|
313
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ l(
|
|
314
325
|
"input",
|
|
315
326
|
{
|
|
316
|
-
value:
|
|
317
|
-
onChange: (n) =>
|
|
318
|
-
className:
|
|
327
|
+
value: W,
|
|
328
|
+
onChange: (n) => J("days", n.target.value),
|
|
329
|
+
className: Z,
|
|
319
330
|
inputMode: "numeric"
|
|
320
331
|
}
|
|
321
332
|
),
|
|
322
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ l(
|
|
323
334
|
"button",
|
|
324
335
|
{
|
|
325
336
|
type: "button",
|
|
326
|
-
onClick: () =>
|
|
327
|
-
className:
|
|
337
|
+
onClick: () => I("days", -1),
|
|
338
|
+
className: w,
|
|
328
339
|
children: "-"
|
|
329
340
|
}
|
|
330
341
|
)
|
|
331
342
|
] }),
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ k("div", { className: "space-y-1", children: [
|
|
344
|
+
/* @__PURE__ */ l("span", { className: Q, children: v.hour }),
|
|
345
|
+
/* @__PURE__ */ l(
|
|
335
346
|
"button",
|
|
336
347
|
{
|
|
337
348
|
type: "button",
|
|
338
|
-
onClick: () =>
|
|
339
|
-
className:
|
|
349
|
+
onClick: () => I("hours", 1),
|
|
350
|
+
className: w,
|
|
340
351
|
children: "+"
|
|
341
352
|
}
|
|
342
353
|
),
|
|
343
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ l(
|
|
344
355
|
"input",
|
|
345
356
|
{
|
|
346
|
-
value:
|
|
347
|
-
onChange: (n) =>
|
|
348
|
-
className:
|
|
357
|
+
value: U,
|
|
358
|
+
onChange: (n) => J("hours", n.target.value),
|
|
359
|
+
className: Z,
|
|
349
360
|
inputMode: "numeric"
|
|
350
361
|
}
|
|
351
362
|
),
|
|
352
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ l(
|
|
353
364
|
"button",
|
|
354
365
|
{
|
|
355
366
|
type: "button",
|
|
356
|
-
onClick: () =>
|
|
357
|
-
className:
|
|
367
|
+
onClick: () => I("hours", -1),
|
|
368
|
+
className: w,
|
|
358
369
|
children: "-"
|
|
359
370
|
}
|
|
360
371
|
)
|
|
361
372
|
] }),
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ k("div", { className: "space-y-1", children: [
|
|
374
|
+
/* @__PURE__ */ l("span", { className: Q, children: v.minute }),
|
|
375
|
+
/* @__PURE__ */ l(
|
|
365
376
|
"button",
|
|
366
377
|
{
|
|
367
378
|
type: "button",
|
|
368
|
-
onClick: () =>
|
|
369
|
-
className:
|
|
379
|
+
onClick: () => I("minutes", ue),
|
|
380
|
+
className: w,
|
|
370
381
|
children: "+"
|
|
371
382
|
}
|
|
372
383
|
),
|
|
373
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ l(
|
|
374
385
|
"input",
|
|
375
386
|
{
|
|
376
|
-
value:
|
|
377
|
-
onChange: (n) =>
|
|
378
|
-
className:
|
|
387
|
+
value: X,
|
|
388
|
+
onChange: (n) => J("minutes", n.target.value),
|
|
389
|
+
className: Z,
|
|
379
390
|
inputMode: "numeric"
|
|
380
391
|
}
|
|
381
392
|
),
|
|
382
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ l(
|
|
383
394
|
"button",
|
|
384
395
|
{
|
|
385
396
|
type: "button",
|
|
386
|
-
onClick: () =>
|
|
387
|
-
className:
|
|
397
|
+
onClick: () => I("minutes", -ue),
|
|
398
|
+
className: w,
|
|
388
399
|
children: "-"
|
|
389
400
|
}
|
|
390
401
|
)
|
|
@@ -392,12 +403,12 @@ const c = (o) => o.toString().padStart(2, "0"), T = 31, ee = {
|
|
|
392
403
|
]
|
|
393
404
|
}
|
|
394
405
|
),
|
|
395
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ l(
|
|
396
407
|
"button",
|
|
397
408
|
{
|
|
398
409
|
type: "button",
|
|
399
|
-
onClick:
|
|
400
|
-
className:
|
|
410
|
+
onClick: Ce,
|
|
411
|
+
className: $e,
|
|
401
412
|
children: v.ok
|
|
402
413
|
}
|
|
403
414
|
)
|
|
@@ -407,7 +418,7 @@ const c = (o) => o.toString().padStart(2, "0"), T = 31, ee = {
|
|
|
407
418
|
] });
|
|
408
419
|
}
|
|
409
420
|
);
|
|
410
|
-
|
|
421
|
+
Ae.displayName = "MciTimePicker";
|
|
411
422
|
export {
|
|
412
|
-
|
|
423
|
+
Ae as default
|
|
413
424
|
};
|