@ac-design/design-system 2.2.0 → 2.2.1
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/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +89 -88
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +74 -73
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +151 -150
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +373 -372
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +56 -55
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +39 -38
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +90 -89
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +146 -145
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +156 -155
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +73 -72
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +132 -131
- package/dist/lib/components/fixedFrame.d.ts +11 -0
- package/dist/lib/components/fixedFrame.js +24 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import e from "./AcButton.js";
|
|
2
|
-
import {
|
|
2
|
+
import { fixedFrame as t } from "./fixedFrame.js";
|
|
3
|
+
import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeModels as ee, mergeProps as te, nextTick as p, normalizeClass as m, normalizeStyle as ne, onBeforeUnmount as re, onMounted as ie, openBlock as h, reactive as ae, ref as g, renderList as _, resolveDynamicComponent as oe, toDisplayString as v, unref as y, useAttrs as se, useId as ce, useModel as le, watch as ue, withCtx as de } from "vue";
|
|
3
4
|
import { Calendar as fe, CalendarRange as pe, ChevronLeft as me, ChevronRight as he, Clock as ge, Timer as _e, X as ve } from "@lucide/vue";
|
|
4
5
|
//#region src/lib/components/AcDatePicker.vue?vue&type=script&setup=true&lang.ts
|
|
5
6
|
var ye = ["for"], be = {
|
|
@@ -93,10 +94,10 @@ var ye = ["for"], be = {
|
|
|
93
94
|
key: 1,
|
|
94
95
|
class: "basis-full text-xs text-danger-strong",
|
|
95
96
|
role: "alert"
|
|
96
|
-
},
|
|
97
|
+
}, b = /*@__PURE__*/ f({
|
|
97
98
|
inheritAttrs: !1,
|
|
98
99
|
__name: "AcDatePicker",
|
|
99
|
-
props: /*@__PURE__*/
|
|
100
|
+
props: /*@__PURE__*/ ee({
|
|
100
101
|
label: { default: "" },
|
|
101
102
|
placeholder: { default: "" },
|
|
102
103
|
mode: { default: "date" },
|
|
@@ -144,8 +145,8 @@ var ye = ["for"], be = {
|
|
|
144
145
|
openModifiers: {}
|
|
145
146
|
}),
|
|
146
147
|
emits: ["update:modelValue", "update:open"],
|
|
147
|
-
setup(
|
|
148
|
-
let
|
|
148
|
+
setup(f, { expose: ee }) {
|
|
149
|
+
let b = f, st = le(f, "modelValue"), x = le(f, "open"), ct = /^\d{4}-\d{2}-\d{2}$/, lt = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/, ut = {
|
|
149
150
|
w: 604800,
|
|
150
151
|
d: 86400,
|
|
151
152
|
h: 3600,
|
|
@@ -167,61 +168,61 @@ var ye = ["for"], be = {
|
|
|
167
168
|
key: "time",
|
|
168
169
|
label: "Time",
|
|
169
170
|
icon: ge
|
|
170
|
-
}],
|
|
171
|
+
}], S = ce(), mt = se(), ht = a(() => ({
|
|
171
172
|
class: mt.class,
|
|
172
173
|
style: mt.style
|
|
173
|
-
})), gt =
|
|
174
|
+
})), gt = a(() => {
|
|
174
175
|
let { class: e, style: t, ...n } = mt;
|
|
175
176
|
return n;
|
|
176
|
-
}), _t = `${
|
|
177
|
+
}), _t = `${S}-label`, vt = `${S}-value`, yt = `${S}-month`, bt = `${S}-msg`, xt = `${S}-hint`, St = /* @__PURE__ */ new Map(), Ct = g(null), wt = g(null), C = g(null), w = g({
|
|
177
178
|
left: 0,
|
|
178
179
|
maxHeight: 480,
|
|
179
180
|
minWidth: 0
|
|
180
|
-
}),
|
|
181
|
+
}), T = g("2026-01-01"), E = g("days"), D = g(2020), O = g(0), k = g("date"), A = g("2026-01-01"), j = g(null), M = g(null), N = g(null), P = ae({
|
|
181
182
|
h: 0,
|
|
182
183
|
m: 0,
|
|
183
184
|
s: 0
|
|
184
|
-
}),
|
|
185
|
+
}), F = ae({
|
|
185
186
|
h: 23,
|
|
186
187
|
m: 59,
|
|
187
188
|
s: 59
|
|
188
|
-
}),
|
|
189
|
+
}), I = ae({
|
|
189
190
|
d: 0,
|
|
190
191
|
h: 0,
|
|
191
192
|
m: 0
|
|
192
|
-
}),
|
|
193
|
+
}), L = a(() => b.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone), R = a(() => b.range && b.mode !== "duration"), z = a(() => b.mode === "datetime"), Tt = a(() => b.weekStartsOn ?? un()), Et = a(() => new Intl.DateTimeFormat(b.locale, {
|
|
193
194
|
year: "numeric",
|
|
194
195
|
month: "short",
|
|
195
196
|
day: "numeric",
|
|
196
197
|
timeZone: "UTC"
|
|
197
|
-
})), Dt =
|
|
198
|
+
})), Dt = a(() => new Intl.DateTimeFormat(b.locale, {
|
|
198
199
|
year: "numeric",
|
|
199
200
|
month: "short",
|
|
200
201
|
day: "numeric",
|
|
201
202
|
hour: "2-digit",
|
|
202
203
|
minute: "2-digit",
|
|
203
|
-
second:
|
|
204
|
+
second: b.showSeconds ? "2-digit" : void 0,
|
|
204
205
|
hourCycle: "h23",
|
|
205
|
-
timeZone:
|
|
206
|
+
timeZone: L.value,
|
|
206
207
|
timeZoneName: "short"
|
|
207
|
-
})), Ot =
|
|
208
|
+
})), Ot = a(() => new Intl.DateTimeFormat(b.locale, {
|
|
208
209
|
month: "long",
|
|
209
210
|
year: "numeric",
|
|
210
211
|
timeZone: "UTC"
|
|
211
|
-
})), kt =
|
|
212
|
+
})), kt = a(() => new Intl.DateTimeFormat(b.locale, {
|
|
212
213
|
weekday: "long",
|
|
213
214
|
year: "numeric",
|
|
214
215
|
month: "long",
|
|
215
216
|
day: "numeric",
|
|
216
217
|
timeZone: "UTC"
|
|
217
|
-
})), At =
|
|
218
|
+
})), At = a(() => new Intl.DateTimeFormat(b.locale, {
|
|
218
219
|
day: "numeric",
|
|
219
220
|
timeZone: "UTC"
|
|
220
|
-
})), jt =
|
|
221
|
-
let e = new Intl.DateTimeFormat(
|
|
221
|
+
})), jt = a(() => {
|
|
222
|
+
let e = new Intl.DateTimeFormat(b.locale, {
|
|
222
223
|
weekday: "short",
|
|
223
224
|
timeZone: "UTC"
|
|
224
|
-
}), t = new Intl.DateTimeFormat(
|
|
225
|
+
}), t = new Intl.DateTimeFormat(b.locale, {
|
|
225
226
|
weekday: "long",
|
|
226
227
|
timeZone: "UTC"
|
|
227
228
|
});
|
|
@@ -232,99 +233,99 @@ var ye = ["for"], be = {
|
|
|
232
233
|
long: t.format(i)
|
|
233
234
|
};
|
|
234
235
|
});
|
|
235
|
-
}), Mt =
|
|
236
|
-
timeZone:
|
|
236
|
+
}), Mt = a(() => new Intl.DateTimeFormat(b.locale, {
|
|
237
|
+
timeZone: L.value,
|
|
237
238
|
timeZoneName: "short"
|
|
238
|
-
}).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ??
|
|
239
|
+
}).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ?? L.value), Nt = a(() => Z(Date.now()).day), B = a(() => b.minDate ? pn(b.minDate) : null), V = a(() => b.maxDate ? pn(b.maxDate) : null), Pt = a(() => b.minDate ? Q(b.minDate) : null), Ft = a(() => b.maxDate ? ct.test(b.maxDate) ? fn(Y(b.maxDate, 1), 0, 0, 0) - 1e3 : Q(b.maxDate) : null), H = a(() => {
|
|
239
240
|
let e = st.value;
|
|
240
|
-
return
|
|
241
|
-
}), It =
|
|
242
|
-
let [e, t] =
|
|
241
|
+
return R.value ? Array.isArray(e) ? [e[0] || null, e[1] || null] : [null, null] : [typeof e == "string" && e ? e : null];
|
|
242
|
+
}), It = a(() => H.value.some(Boolean)), Lt = a(() => {
|
|
243
|
+
let [e, t] = H.value;
|
|
243
244
|
if (!e) return "";
|
|
244
|
-
if (
|
|
245
|
-
let t =
|
|
246
|
-
return t === null ? e :
|
|
245
|
+
if (b.mode === "duration") {
|
|
246
|
+
let t = hn(e);
|
|
247
|
+
return t === null ? e : _n(t);
|
|
247
248
|
}
|
|
248
|
-
if (
|
|
249
|
-
let n =
|
|
250
|
-
return n ?
|
|
249
|
+
if (b.mode === "date") {
|
|
250
|
+
let n = pn(e), r = t ? pn(t) : null;
|
|
251
|
+
return n ? R.value ? r ? Et.value.formatRange(J(n), J(r)) : `${Et.value.format(J(n))} –` : Et.value.format(J(n)) : e;
|
|
251
252
|
}
|
|
252
|
-
let n =
|
|
253
|
-
return n === null ? e :
|
|
254
|
-
}), Rt =
|
|
255
|
-
let e = (ln(
|
|
256
|
-
return Array.from({ length: n }, (e, n) => Array.from({ length: 7 }, (e, r) =>
|
|
257
|
-
}),
|
|
258
|
-
let e = new Intl.DateTimeFormat(
|
|
253
|
+
let n = Q(e), r = t ? Q(t) : null;
|
|
254
|
+
return n === null ? e : R.value ? r === null ? `${Dt.value.format(n)} –` : Dt.value.formatRange(n, r) : Dt.value.format(n);
|
|
255
|
+
}), Rt = a(() => H.value.filter(Boolean).join("/")), zt = a(() => {
|
|
256
|
+
let e = (ln(T.value) - Tt.value + 7) % 7, t = Y(T.value, -e), n = Math.ceil((e + cn(T.value)) / 7);
|
|
257
|
+
return Array.from({ length: n }, (e, n) => Array.from({ length: 7 }, (e, r) => Y(t, n * 7 + r)));
|
|
258
|
+
}), U = a(() => q(T.value).y), Bt = a(() => q(T.value).m - 1), Vt = a(() => {
|
|
259
|
+
let e = new Intl.DateTimeFormat(b.locale, {
|
|
259
260
|
month: "short",
|
|
260
261
|
timeZone: "UTC"
|
|
261
|
-
}), t = new Intl.DateTimeFormat(
|
|
262
|
+
}), t = new Intl.DateTimeFormat(b.locale, {
|
|
262
263
|
month: "long",
|
|
263
264
|
year: "numeric",
|
|
264
265
|
timeZone: "UTC"
|
|
265
266
|
});
|
|
266
267
|
return Array.from({ length: 12 }, (n, r) => {
|
|
267
|
-
let i =
|
|
268
|
+
let i = K(U.value, r + 1, 1);
|
|
268
269
|
return {
|
|
269
270
|
value: r,
|
|
270
|
-
text: e.format(
|
|
271
|
-
label: t.format(
|
|
272
|
-
disabled:
|
|
271
|
+
text: e.format(J(i)),
|
|
272
|
+
label: t.format(J(i)),
|
|
273
|
+
disabled: yn(i, K(U.value, r + 2, 0)),
|
|
273
274
|
selected: r === Bt.value
|
|
274
275
|
};
|
|
275
276
|
});
|
|
276
|
-
}), Ht =
|
|
277
|
-
let n =
|
|
277
|
+
}), Ht = a(() => Array.from({ length: 12 }, (e, t) => {
|
|
278
|
+
let n = D.value + t;
|
|
278
279
|
return {
|
|
279
280
|
value: n,
|
|
280
281
|
text: String(n),
|
|
281
282
|
label: String(n),
|
|
282
|
-
disabled:
|
|
283
|
-
selected: n ===
|
|
283
|
+
disabled: yn(K(n, 1, 1), K(n, 12, 31)),
|
|
284
|
+
selected: n === U.value
|
|
284
285
|
};
|
|
285
|
-
})), Ut =
|
|
286
|
+
})), Ut = a(() => E.value === "months" ? Vt.value : Ht.value), Wt = a(() => [
|
|
286
287
|
0,
|
|
287
288
|
4,
|
|
288
289
|
8
|
|
289
|
-
].map((e) => Ut.value.slice(e, e + 4))), Gt =
|
|
290
|
-
if (!
|
|
291
|
-
let e =
|
|
290
|
+
].map((e) => Ut.value.slice(e, e + 4))), Gt = a(() => Ut.value.some((e) => e.value === O.value) ? O.value : Ut.value[0].value), W = a(() => E.value === "days" ? Ot.value.format(J(T.value)) : E.value === "months" ? String(U.value) : `${D.value}–${D.value + 9}`), Kt = a(() => E.value === "days" ? ["Previous month", "Next month"] : E.value === "months" ? ["Previous year", "Next year"] : ["Previous years", "Next years"]), qt = a(() => !R.value || !M.value ? null : N.value ?? j.value ?? null), G = a(() => M.value ? fn(M.value, P.h, P.m, P.s) : null), Jt = a(() => N.value ? fn(N.value, F.h, F.m, F.s) : null), Yt = a(() => {
|
|
291
|
+
if (!z.value) return "";
|
|
292
|
+
let e = R.value ? [G.value, Jt.value] : [G.value];
|
|
292
293
|
for (let t of e) if (t !== null) {
|
|
293
294
|
if (Pt.value !== null && t < Pt.value) return `Choose a time from ${Dt.value.format(Pt.value)}`;
|
|
294
295
|
if (Ft.value !== null && t > Ft.value) return `Choose a time up to ${Dt.value.format(Ft.value)}`;
|
|
295
296
|
}
|
|
296
|
-
return
|
|
297
|
-
}), Xt =
|
|
297
|
+
return R.value && G.value !== null && Jt.value !== null && Jt.value < G.value ? "The end must be after the start" : "";
|
|
298
|
+
}), Xt = a(() => b.mode === "duration" ? !0 : !M.value || R.value && !N.value ? !1 : !Yt.value), Zt = a(() => I.d * 86400 + I.h * 3600 + I.m * 60), Qt = a(() => {
|
|
298
299
|
let e = [{
|
|
299
300
|
key: "start",
|
|
300
|
-
label:
|
|
301
|
-
clock:
|
|
301
|
+
label: R.value ? "Start" : "Time",
|
|
302
|
+
clock: P
|
|
302
303
|
}];
|
|
303
|
-
return
|
|
304
|
+
return R.value && e.push({
|
|
304
305
|
key: "end",
|
|
305
306
|
label: "End",
|
|
306
|
-
clock:
|
|
307
|
+
clock: F
|
|
307
308
|
}), e.map((e) => ({
|
|
308
309
|
...e,
|
|
309
|
-
spinners:
|
|
310
|
+
spinners: wn(e.clock, e.label)
|
|
310
311
|
}));
|
|
311
|
-
}), $t =
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
]), en =
|
|
316
|
-
if (
|
|
317
|
-
let e =
|
|
318
|
-
return
|
|
319
|
-
}), an =
|
|
312
|
+
}), $t = a(() => [
|
|
313
|
+
Cn("d", "Days", 0, 999, !1, !1, () => I.d, (e) => I.d = e),
|
|
314
|
+
Cn("h", "Hours", 0, 23, !1, !1, () => I.h, (e) => I.h = e),
|
|
315
|
+
Cn("m", "Minutes", 0, 59, !1, !1, () => I.m, (e) => I.m = e)
|
|
316
|
+
]), en = g(!1), tn = a(() => x.value || en.value), nn = a(() => [b.hint && xt, b.errorMsg && bt].filter(Boolean).join(" ") || void 0), rn = a(() => {
|
|
317
|
+
if (b.mode === "duration") return b.label || "Choose duration";
|
|
318
|
+
let e = R.value ? "date range" : z.value ? "date and time" : "date";
|
|
319
|
+
return b.label ? `${b.label}: choose ${e}` : `Choose ${e}`;
|
|
320
|
+
}), an = a(() => b.mode === "duration" ? _e : R.value ? pe : fe);
|
|
320
321
|
function on(e) {
|
|
321
322
|
return String(e).padStart(2, "0");
|
|
322
323
|
}
|
|
323
|
-
function
|
|
324
|
+
function K(e, t, n) {
|
|
324
325
|
let r = new Date(Date.UTC(e, t - 1, n));
|
|
325
326
|
return `${r.getUTCFullYear()}-${on(r.getUTCMonth() + 1)}-${on(r.getUTCDate())}`;
|
|
326
327
|
}
|
|
327
|
-
function
|
|
328
|
+
function q(e) {
|
|
328
329
|
let [t, n, r] = e.split("-").map(Number);
|
|
329
330
|
return {
|
|
330
331
|
y: t,
|
|
@@ -332,39 +333,39 @@ var ye = ["for"], be = {
|
|
|
332
333
|
d: r
|
|
333
334
|
};
|
|
334
335
|
}
|
|
335
|
-
function
|
|
336
|
-
let { y: t, m: n, d: r } =
|
|
336
|
+
function J(e) {
|
|
337
|
+
let { y: t, m: n, d: r } = q(e);
|
|
337
338
|
return new Date(Date.UTC(t, n - 1, r));
|
|
338
339
|
}
|
|
339
|
-
function
|
|
340
|
-
let { y: n, m: r, d: i } =
|
|
341
|
-
return
|
|
340
|
+
function Y(e, t) {
|
|
341
|
+
let { y: n, m: r, d: i } = q(e);
|
|
342
|
+
return K(n, r, i + t);
|
|
342
343
|
}
|
|
343
344
|
function sn(e, t) {
|
|
344
|
-
let { y: n, m: r, d: i } =
|
|
345
|
-
return
|
|
345
|
+
let { y: n, m: r, d: i } = q(e), a = new Date(Date.UTC(n, r - 1 + t + 1, 0)).getUTCDate();
|
|
346
|
+
return K(n, r + t, Math.min(i, a));
|
|
346
347
|
}
|
|
347
|
-
function
|
|
348
|
+
function X(e) {
|
|
348
349
|
return `${e.slice(0, 7)}-01`;
|
|
349
350
|
}
|
|
350
351
|
function cn(e) {
|
|
351
|
-
let { y: t, m: n } =
|
|
352
|
+
let { y: t, m: n } = q(e);
|
|
352
353
|
return new Date(Date.UTC(t, n, 0)).getUTCDate();
|
|
353
354
|
}
|
|
354
355
|
function ln(e) {
|
|
355
|
-
return
|
|
356
|
+
return J(e).getUTCDay();
|
|
356
357
|
}
|
|
357
358
|
function un() {
|
|
358
359
|
try {
|
|
359
|
-
let e = new Intl.Locale(
|
|
360
|
+
let e = new Intl.Locale(b.locale ?? navigator.language), t = (e.getWeekInfo?.() ?? e.weekInfo)?.firstDay;
|
|
360
361
|
if (t) return t % 7;
|
|
361
362
|
} catch {}
|
|
362
363
|
return 0;
|
|
363
364
|
}
|
|
364
|
-
function
|
|
365
|
-
let t = St.get(
|
|
365
|
+
function Z(e) {
|
|
366
|
+
let t = St.get(L.value);
|
|
366
367
|
t || (t = new Intl.DateTimeFormat("en-US", {
|
|
367
|
-
timeZone:
|
|
368
|
+
timeZone: L.value,
|
|
368
369
|
hourCycle: "h23",
|
|
369
370
|
year: "numeric",
|
|
370
371
|
month: "2-digit",
|
|
@@ -372,40 +373,40 @@ var ye = ["for"], be = {
|
|
|
372
373
|
hour: "2-digit",
|
|
373
374
|
minute: "2-digit",
|
|
374
375
|
second: "2-digit"
|
|
375
|
-
}), St.set(
|
|
376
|
+
}), St.set(L.value, t));
|
|
376
377
|
let n = {};
|
|
377
378
|
for (let { type: r, value: i } of t.formatToParts(e)) r !== "literal" && (n[r] = Number(i));
|
|
378
379
|
return {
|
|
379
|
-
day:
|
|
380
|
+
day: K(n.year, n.month, n.day),
|
|
380
381
|
h: n.hour % 24,
|
|
381
382
|
m: n.minute,
|
|
382
383
|
s: n.second
|
|
383
384
|
};
|
|
384
385
|
}
|
|
385
386
|
function dn(e) {
|
|
386
|
-
let t =
|
|
387
|
+
let t = Z(e), { y: n, m: r, d: i } = q(t.day);
|
|
387
388
|
return Date.UTC(n, r - 1, i, t.h, t.m, t.s) - Math.floor(e / 1e3) * 1e3;
|
|
388
389
|
}
|
|
389
390
|
function fn(e, t, n, r) {
|
|
390
|
-
let { y: i, m: a, d: o } =
|
|
391
|
-
return
|
|
391
|
+
let { y: i, m: a, d: o } = q(e), s = Date.UTC(i, a - 1, o, t, n, r), c = dn(s), l = s - c, u = dn(l);
|
|
392
|
+
return u === c ? l : s - u;
|
|
392
393
|
}
|
|
393
|
-
function
|
|
394
|
+
function Q(e) {
|
|
394
395
|
let t = lt.exec(e);
|
|
395
396
|
if (t) return fn(t[1], Number(t[2]), Number(t[3]), Number(t[4] ?? 0));
|
|
396
397
|
if (ct.test(e)) return fn(e, 0, 0, 0);
|
|
397
398
|
let n = Date.parse(e);
|
|
398
399
|
return Number.isNaN(n) ? null : n;
|
|
399
400
|
}
|
|
400
|
-
function
|
|
401
|
+
function pn(e) {
|
|
401
402
|
if (ct.test(e)) return e;
|
|
402
|
-
let t =
|
|
403
|
-
return t === null ? null :
|
|
403
|
+
let t = Q(e);
|
|
404
|
+
return t === null ? null : Z(t).day;
|
|
404
405
|
}
|
|
405
|
-
function
|
|
406
|
+
function mn(e) {
|
|
406
407
|
return new Date(e).toISOString().replace(/\.000Z$/, "Z");
|
|
407
408
|
}
|
|
408
|
-
function
|
|
409
|
+
function hn(e) {
|
|
409
410
|
let t = e.replace(/\s+/g, "");
|
|
410
411
|
if (!t) return null;
|
|
411
412
|
if (t === "0") return 0;
|
|
@@ -413,12 +414,12 @@ var ye = ["for"], be = {
|
|
|
413
414
|
for (; a = n.exec(t);) r += Number(a[1]) * ut[a[2]], i = n.lastIndex;
|
|
414
415
|
return i === t.length ? r : null;
|
|
415
416
|
}
|
|
416
|
-
function
|
|
417
|
+
function gn(e) {
|
|
417
418
|
if (e <= 0) return null;
|
|
418
419
|
let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.round(e % 60);
|
|
419
420
|
return `${t ? `${t}h` : ""}${n ? `${n}m` : ""}${r ? `${r}s` : ""}` || null;
|
|
420
421
|
}
|
|
421
|
-
function
|
|
422
|
+
function _n(e) {
|
|
422
423
|
let t = Math.floor(e / 86400), n = Math.floor(e % 86400 / 3600), r = Math.floor(e % 3600 / 60), i = Math.round(e % 60);
|
|
423
424
|
return [
|
|
424
425
|
t && `${t}d`,
|
|
@@ -427,26 +428,26 @@ var ye = ["for"], be = {
|
|
|
427
428
|
i && `${i}s`
|
|
428
429
|
].filter(Boolean).join(" ") || "0m";
|
|
429
430
|
}
|
|
430
|
-
function
|
|
431
|
-
return
|
|
432
|
-
}
|
|
433
|
-
function vn(e, t) {
|
|
434
|
-
return !!z.value && t < z.value || !!B.value && e > B.value;
|
|
431
|
+
function vn(e) {
|
|
432
|
+
return B.value && e < B.value || V.value && e > V.value ? !0 : b.isDateDisabled?.(e) ?? !1;
|
|
435
433
|
}
|
|
436
|
-
function yn(e) {
|
|
437
|
-
return
|
|
434
|
+
function yn(e, t) {
|
|
435
|
+
return !!B.value && t < B.value || !!V.value && e > V.value;
|
|
438
436
|
}
|
|
439
437
|
function bn(e) {
|
|
440
|
-
|
|
438
|
+
return e === M.value || R.value && e === (N.value ?? qt.value);
|
|
439
|
+
}
|
|
440
|
+
function xn(e) {
|
|
441
|
+
let t = M.value, n = qt.value;
|
|
441
442
|
if (!t || !n) return !1;
|
|
442
443
|
let [r, i] = t <= n ? [t, n] : [n, t];
|
|
443
444
|
return e >= r && e <= i;
|
|
444
445
|
}
|
|
445
|
-
function
|
|
446
|
-
let t =
|
|
446
|
+
function Sn(e) {
|
|
447
|
+
let t = M.value, n = qt.value, [r, i] = t <= n ? [t, n] : [n, t];
|
|
447
448
|
return [e === r && "rounded-l-8", e === i && "rounded-r-8"];
|
|
448
449
|
}
|
|
449
|
-
function
|
|
450
|
+
function Cn(e, t, n, r, i, a, o, s) {
|
|
450
451
|
return {
|
|
451
452
|
key: e,
|
|
452
453
|
label: t,
|
|
@@ -458,190 +459,190 @@ var ye = ["for"], be = {
|
|
|
458
459
|
set: s
|
|
459
460
|
};
|
|
460
461
|
}
|
|
461
|
-
function
|
|
462
|
-
let n = [
|
|
463
|
-
return
|
|
462
|
+
function wn(e, t) {
|
|
463
|
+
let n = [Cn("h", `${t} hours`, 0, 23, !0, !0, () => e.h, (t) => e.h = t), Cn("m", `${t} minutes`, 0, 59, !0, !0, () => e.m, (t) => e.m = t)];
|
|
464
|
+
return b.showSeconds && n.push(Cn("s", `${t} seconds`, 0, 59, !0, !0, () => e.s, (t) => e.s = t)), n;
|
|
464
465
|
}
|
|
465
|
-
function
|
|
466
|
+
function Tn(e) {
|
|
466
467
|
return e.padded ? on(e.get()) : String(e.get());
|
|
467
468
|
}
|
|
468
|
-
function
|
|
469
|
+
function En(e, t) {
|
|
469
470
|
let n = t.get(), r = t.max - t.min + 1, i = null;
|
|
470
|
-
e.key === "ArrowUp" ? i = n + 1 : e.key === "ArrowDown" ? i = n - 1 : e.key === "PageUp" ? i = n + 10 : e.key === "PageDown" ? i = n - 10 : e.key === "Home" ? i = t.min : e.key === "End" && (i = t.max), i !== null && (e.preventDefault(), i = t.wrap ? ((i - t.min) % r + r) % r + t.min : Math.min(t.max, Math.max(t.min, i)), t.set(i), e.target.value =
|
|
471
|
+
e.key === "ArrowUp" ? i = n + 1 : e.key === "ArrowDown" ? i = n - 1 : e.key === "PageUp" ? i = n + 10 : e.key === "PageDown" ? i = n - 10 : e.key === "Home" ? i = t.min : e.key === "End" && (i = t.max), i !== null && (e.preventDefault(), i = t.wrap ? ((i - t.min) % r + r) % r + t.min : Math.min(t.max, Math.max(t.min, i)), t.set(i), e.target.value = Tn(t));
|
|
471
472
|
}
|
|
472
|
-
function
|
|
473
|
+
function Dn(e, t) {
|
|
473
474
|
let n = e.target, r = n.value.replace(/\D/g, "").slice(0, String(t.max).length);
|
|
474
475
|
if (n.value = r, !r) return;
|
|
475
476
|
let i = Number(r);
|
|
476
477
|
i > t.max && (i = Number(r.slice(-1))), t.set(Math.max(t.min, i));
|
|
477
478
|
}
|
|
478
|
-
function
|
|
479
|
-
e.target.value =
|
|
479
|
+
function On(e, t) {
|
|
480
|
+
e.target.value = Tn(t);
|
|
480
481
|
}
|
|
481
|
-
function
|
|
482
|
-
if (
|
|
483
|
-
let e =
|
|
484
|
-
|
|
482
|
+
function kn() {
|
|
483
|
+
if (j.value = null, E.value = "days", k.value = "date", b.mode === "duration") {
|
|
484
|
+
let e = H.value[0] ? hn(H.value[0]) ?? 0 : 0;
|
|
485
|
+
I.d = Math.floor(e / 86400), I.h = Math.floor(e % 86400 / 3600), I.m = Math.floor(e % 3600 / 60);
|
|
485
486
|
return;
|
|
486
487
|
}
|
|
487
|
-
let [e, t] =
|
|
488
|
-
if (
|
|
488
|
+
let [e, t] = H.value;
|
|
489
|
+
if (M.value = null, N.value = null, Object.assign(P, {
|
|
489
490
|
h: 0,
|
|
490
491
|
m: 0,
|
|
491
492
|
s: 0
|
|
492
|
-
}), Object.assign(
|
|
493
|
+
}), Object.assign(F, {
|
|
493
494
|
h: 23,
|
|
494
495
|
m: 59,
|
|
495
|
-
s:
|
|
496
|
-
}),
|
|
497
|
-
let n = e ?
|
|
496
|
+
s: b.showSeconds ? 59 : 0
|
|
497
|
+
}), z.value) {
|
|
498
|
+
let n = e ? Q(e) : null, r = t ? Q(t) : null;
|
|
498
499
|
if (n !== null) {
|
|
499
|
-
let e =
|
|
500
|
-
|
|
500
|
+
let e = Z(n);
|
|
501
|
+
M.value = e.day, Object.assign(P, {
|
|
501
502
|
h: e.h,
|
|
502
503
|
m: e.m,
|
|
503
504
|
s: e.s
|
|
504
505
|
});
|
|
505
506
|
}
|
|
506
507
|
if (r !== null) {
|
|
507
|
-
let e =
|
|
508
|
-
|
|
508
|
+
let e = Z(r);
|
|
509
|
+
N.value = e.day, Object.assign(F, {
|
|
509
510
|
h: e.h,
|
|
510
511
|
m: e.m,
|
|
511
512
|
s: e.s
|
|
512
513
|
});
|
|
513
514
|
}
|
|
514
|
-
} else
|
|
515
|
-
let n =
|
|
516
|
-
!
|
|
515
|
+
} else M.value = e ? pn(e) : null, N.value = t ? pn(t) : null;
|
|
516
|
+
let n = M.value ?? Nt.value;
|
|
517
|
+
!M.value && B.value && n < B.value && (n = B.value), !M.value && V.value && n > V.value && (n = V.value), A.value = n, T.value = X(n);
|
|
517
518
|
}
|
|
518
|
-
function
|
|
519
|
+
function An() {
|
|
519
520
|
let e = wt.value;
|
|
520
521
|
if (!e) return;
|
|
521
|
-
let
|
|
522
|
-
|
|
523
|
-
bottom:
|
|
524
|
-
left:
|
|
525
|
-
maxHeight: Math.max(200,
|
|
526
|
-
minWidth:
|
|
522
|
+
let n = e.getBoundingClientRect(), r = t(), i = C.value?.offsetWidth ?? 300, a = C.value?.offsetHeight ?? 380, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = Math.max(8, Math.min(n.left - r.left, r.width - i - 8)), u = Math.min(n.width, 448);
|
|
523
|
+
w.value = c ? {
|
|
524
|
+
bottom: r.bottom - n.top + 6,
|
|
525
|
+
left: l,
|
|
526
|
+
maxHeight: Math.max(200, s),
|
|
527
|
+
minWidth: u
|
|
527
528
|
} : {
|
|
528
|
-
top:
|
|
529
|
-
left:
|
|
530
|
-
maxHeight: Math.max(200,
|
|
531
|
-
minWidth:
|
|
529
|
+
top: n.bottom + 6 - r.top,
|
|
530
|
+
left: l,
|
|
531
|
+
maxHeight: Math.max(200, o),
|
|
532
|
+
minWidth: u
|
|
532
533
|
};
|
|
533
534
|
}
|
|
534
|
-
function
|
|
535
|
-
|
|
535
|
+
function jn() {
|
|
536
|
+
b.disabled || x.value || (x.value = !0);
|
|
536
537
|
}
|
|
537
|
-
function
|
|
538
|
-
|
|
538
|
+
function Mn(e = !0) {
|
|
539
|
+
x.value && (x.value = !1, e && wt.value?.focus());
|
|
539
540
|
}
|
|
540
|
-
async function
|
|
541
|
-
|
|
541
|
+
async function Nn() {
|
|
542
|
+
kn(), An(), or(), await p(), An(), b.mode === "duration" ? C.value?.querySelector("input")?.focus() : Pn();
|
|
542
543
|
}
|
|
543
|
-
function
|
|
544
|
-
|
|
544
|
+
function Pn() {
|
|
545
|
+
p(() => C.value?.querySelector(`[data-day="${A.value}"]`)?.focus());
|
|
545
546
|
}
|
|
546
547
|
function $(e) {
|
|
547
|
-
st.value = e,
|
|
548
|
+
st.value = e, Mn();
|
|
548
549
|
}
|
|
549
|
-
function
|
|
550
|
-
if (!
|
|
551
|
-
if (
|
|
552
|
-
|
|
550
|
+
function Fn(e) {
|
|
551
|
+
if (!vn(e)) {
|
|
552
|
+
if (A.value = e, X(e) !== T.value && (T.value = X(e), Pn()), !R.value) {
|
|
553
|
+
M.value = e, z.value || $(e);
|
|
553
554
|
return;
|
|
554
555
|
}
|
|
555
|
-
if (!
|
|
556
|
-
|
|
556
|
+
if (!M.value || N.value) {
|
|
557
|
+
M.value = e, N.value = null;
|
|
557
558
|
return;
|
|
558
559
|
}
|
|
559
|
-
e <
|
|
560
|
+
e < M.value ? (N.value = M.value, M.value = e) : N.value = e, j.value = null, z.value || $([M.value, N.value]);
|
|
560
561
|
}
|
|
561
562
|
}
|
|
562
|
-
function
|
|
563
|
+
function In() {
|
|
563
564
|
if (Xt.value) {
|
|
564
|
-
if (
|
|
565
|
-
if (!
|
|
566
|
-
$(
|
|
565
|
+
if (b.mode === "duration") return $(gn(Zt.value));
|
|
566
|
+
if (!z.value) return $(R.value ? [M.value, N.value] : M.value);
|
|
567
|
+
$(R.value ? [mn(G.value), mn(Jt.value)] : mn(G.value));
|
|
567
568
|
}
|
|
568
569
|
}
|
|
569
|
-
function
|
|
570
|
-
let e =
|
|
571
|
-
|
|
570
|
+
function Ln() {
|
|
571
|
+
let e = Z(Date.now());
|
|
572
|
+
M.value = e.day, Object.assign(P, {
|
|
572
573
|
h: e.h,
|
|
573
574
|
m: e.m,
|
|
574
|
-
s:
|
|
575
|
-
}),
|
|
575
|
+
s: b.showSeconds ? e.s : 0
|
|
576
|
+
}), A.value = e.day, T.value = X(e.day), E.value = "days", k.value === "time" && p(() => Zn("smooth"));
|
|
576
577
|
}
|
|
577
|
-
function
|
|
578
|
-
|
|
578
|
+
function Rn() {
|
|
579
|
+
Fn(Nt.value);
|
|
579
580
|
}
|
|
580
|
-
function
|
|
581
|
+
function zn(e) {
|
|
581
582
|
if (e.value) return $(e.value());
|
|
582
583
|
if (!e.duration) return;
|
|
583
|
-
if (
|
|
584
|
-
let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (
|
|
585
|
-
if (
|
|
586
|
-
$(
|
|
584
|
+
if (b.mode === "duration") return $(gn(hn(e.duration) ?? 0));
|
|
585
|
+
let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (hn(e.duration) ?? 0) * 1e3;
|
|
586
|
+
if (b.mode === "date") return $(R.value ? [Z(n).day, Z(t).day] : Z(n).day);
|
|
587
|
+
$(R.value ? [mn(n), mn(t)] : mn(n));
|
|
587
588
|
}
|
|
588
|
-
function
|
|
589
|
+
function Bn() {
|
|
589
590
|
st.value = null, wt.value?.focus();
|
|
590
591
|
}
|
|
591
|
-
function Bn(e) {
|
|
592
|
-
w.value = sn(w.value, e), k.value = sn(k.value, e);
|
|
593
|
-
}
|
|
594
592
|
function Vn(e) {
|
|
595
|
-
T.value
|
|
593
|
+
T.value = sn(T.value, e), A.value = sn(A.value, e);
|
|
596
594
|
}
|
|
597
|
-
function Hn() {
|
|
598
|
-
|
|
595
|
+
function Hn(e) {
|
|
596
|
+
E.value === "days" ? Vn(e) : E.value === "months" ? T.value = sn(T.value, 12 * e) : D.value += 10 * e;
|
|
599
597
|
}
|
|
600
598
|
function Un() {
|
|
601
|
-
|
|
599
|
+
E.value = "months", O.value = Bt.value, Gn();
|
|
602
600
|
}
|
|
603
601
|
function Wn() {
|
|
604
|
-
|
|
602
|
+
E.value = "years", D.value = Math.floor(U.value / 10) * 10, O.value = U.value, Gn();
|
|
605
603
|
}
|
|
606
|
-
function Gn(
|
|
604
|
+
function Gn() {
|
|
605
|
+
p(() => C.value?.querySelector(`[data-pick="${Gt.value}"]`)?.focus());
|
|
606
|
+
}
|
|
607
|
+
function Kn(e) {
|
|
607
608
|
if (!e.disabled) {
|
|
608
|
-
if (
|
|
609
|
-
|
|
609
|
+
if (E.value === "years") {
|
|
610
|
+
T.value = K(e.value, Bt.value + 1, 1), Un();
|
|
610
611
|
return;
|
|
611
612
|
}
|
|
612
|
-
|
|
613
|
+
T.value = K(U.value, e.value + 1, 1), A.value = K(U.value, e.value + 1, Math.min(q(A.value).d, cn(T.value))), E.value = "days", Pn();
|
|
613
614
|
}
|
|
614
615
|
}
|
|
615
|
-
function
|
|
616
|
+
function qn(e) {
|
|
616
617
|
if (e.key === "Escape") {
|
|
617
|
-
e.preventDefault(), e.stopPropagation(),
|
|
618
|
+
e.preventDefault(), e.stopPropagation(), E.value === "years" ? Un() : (E.value = "days", Pn());
|
|
618
619
|
return;
|
|
619
620
|
}
|
|
620
621
|
if (e.key === "Enter" || e.key === " ") {
|
|
621
622
|
e.preventDefault();
|
|
622
|
-
let t = Ut.value.find((e) => e.value ===
|
|
623
|
-
t &&
|
|
623
|
+
let t = Ut.value.find((e) => e.value === O.value);
|
|
624
|
+
t && Kn(t);
|
|
624
625
|
return;
|
|
625
626
|
}
|
|
626
|
-
let t =
|
|
627
|
+
let t = E.value === "years", n = t ? D.value : 0, r = {
|
|
627
628
|
ArrowLeft: -1,
|
|
628
629
|
ArrowRight: 1,
|
|
629
630
|
ArrowUp: -4,
|
|
630
631
|
ArrowDown: 4
|
|
631
632
|
}, i;
|
|
632
|
-
if (e.key in r) i =
|
|
633
|
+
if (e.key in r) i = O.value + r[e.key];
|
|
633
634
|
else if (e.key === "Home") i = n;
|
|
634
635
|
else if (e.key === "End") i = n + 11;
|
|
635
636
|
else if (e.key === "PageUp" || e.key === "PageDown") {
|
|
636
|
-
e.preventDefault(),
|
|
637
|
+
e.preventDefault(), Hn(e.key === "PageUp" ? -1 : 1), t && (O.value += e.key === "PageUp" ? -10 : 10), Gn();
|
|
637
638
|
return;
|
|
638
639
|
} else return;
|
|
639
|
-
e.preventDefault(), t ? i <
|
|
640
|
-
}
|
|
641
|
-
function qn(e) {
|
|
642
|
-
O.value = e, e === "time" && f(() => Xn("instant"));
|
|
640
|
+
e.preventDefault(), t ? i < D.value ? D.value -= 10 : i > D.value + 11 && (D.value += 10) : i = Math.max(0, Math.min(11, i)), O.value = i, Gn();
|
|
643
641
|
}
|
|
644
642
|
function Jn(e) {
|
|
643
|
+
k.value = e, e === "time" && p(() => Zn("instant"));
|
|
644
|
+
}
|
|
645
|
+
function Yn(e) {
|
|
645
646
|
if (![
|
|
646
647
|
"ArrowLeft",
|
|
647
648
|
"ArrowRight",
|
|
@@ -649,15 +650,15 @@ var ye = ["for"], be = {
|
|
|
649
650
|
"End"
|
|
650
651
|
].includes(e.key)) return;
|
|
651
652
|
e.preventDefault();
|
|
652
|
-
let t = e.key === "Home" ? "date" : e.key === "End" ||
|
|
653
|
-
|
|
653
|
+
let t = e.key === "Home" ? "date" : e.key === "End" || k.value === "date" ? "time" : "date";
|
|
654
|
+
Jn(t), p(() => C.value?.querySelector(`[data-tab="${t}"]`)?.focus());
|
|
654
655
|
}
|
|
655
|
-
function
|
|
656
|
+
function Xn(e) {
|
|
656
657
|
return Array.from({ length: e.max - e.min + 1 }, (t, n) => e.min + n);
|
|
657
658
|
}
|
|
658
|
-
function
|
|
659
|
+
function Zn(e) {
|
|
659
660
|
let t = e === "smooth" && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
660
|
-
|
|
661
|
+
C.value?.querySelectorAll("[data-time-list]").forEach((e) => {
|
|
661
662
|
let n = e.querySelector("[aria-selected=true]");
|
|
662
663
|
n && e.scrollTo({
|
|
663
664
|
top: n.offsetTop - (e.clientHeight - n.offsetHeight) / 2,
|
|
@@ -665,19 +666,19 @@ var ye = ["for"], be = {
|
|
|
665
666
|
});
|
|
666
667
|
});
|
|
667
668
|
}
|
|
668
|
-
function
|
|
669
|
-
|
|
669
|
+
function Qn(e) {
|
|
670
|
+
C.value?.querySelector(`[data-time-list="${e}"] [aria-selected=true]`)?.focus({ preventScroll: !0 });
|
|
670
671
|
}
|
|
671
|
-
function
|
|
672
|
-
e.set(t),
|
|
673
|
-
|
|
672
|
+
function $n(e, t, n) {
|
|
673
|
+
e.set(t), p(() => {
|
|
674
|
+
Zn("smooth"), Qn(n);
|
|
674
675
|
});
|
|
675
676
|
}
|
|
676
|
-
function
|
|
677
|
+
function er(e, t, n) {
|
|
677
678
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
678
679
|
e.preventDefault();
|
|
679
|
-
let t = [...
|
|
680
|
-
r &&
|
|
680
|
+
let t = [...C.value?.querySelectorAll("[data-time-list]") ?? []].map((e) => e.dataset.timeList), r = t[t.indexOf(n) + (e.key === "ArrowRight" ? 1 : -1)];
|
|
681
|
+
r && Qn(r);
|
|
681
682
|
return;
|
|
682
683
|
}
|
|
683
684
|
let r = t.get(), i = {
|
|
@@ -688,269 +689,269 @@ var ye = ["for"], be = {
|
|
|
688
689
|
Home: t.min,
|
|
689
690
|
End: t.max
|
|
690
691
|
};
|
|
691
|
-
e.key in i && (e.preventDefault(),
|
|
692
|
-
}
|
|
693
|
-
function
|
|
694
|
-
let t =
|
|
695
|
-
ArrowLeft: () =>
|
|
696
|
-
ArrowRight: () =>
|
|
697
|
-
ArrowUp: () =>
|
|
698
|
-
ArrowDown: () =>
|
|
699
|
-
Home: () =>
|
|
700
|
-
End: () =>
|
|
692
|
+
e.key in i && (e.preventDefault(), $n(t, Math.min(t.max, Math.max(t.min, i[e.key])), n));
|
|
693
|
+
}
|
|
694
|
+
function tr(e) {
|
|
695
|
+
let t = A.value, n = (ln(t) - Tt.value + 7) % 7, r = {
|
|
696
|
+
ArrowLeft: () => Y(t, -1),
|
|
697
|
+
ArrowRight: () => Y(t, 1),
|
|
698
|
+
ArrowUp: () => Y(t, -7),
|
|
699
|
+
ArrowDown: () => Y(t, 7),
|
|
700
|
+
Home: () => Y(t, -n),
|
|
701
|
+
End: () => Y(t, 6 - n),
|
|
701
702
|
PageUp: () => sn(t, e.shiftKey ? -12 : -1),
|
|
702
703
|
PageDown: () => sn(t, e.shiftKey ? 12 : 1)
|
|
703
704
|
};
|
|
704
705
|
if (e.key === "Enter" || e.key === " ") {
|
|
705
|
-
e.preventDefault(),
|
|
706
|
+
e.preventDefault(), Fn(t);
|
|
706
707
|
return;
|
|
707
708
|
}
|
|
708
709
|
let i = r[e.key];
|
|
709
|
-
i && (e.preventDefault(),
|
|
710
|
+
i && (e.preventDefault(), A.value = i(), T.value = X(A.value), R.value && M.value && !N.value && (j.value = A.value), Pn());
|
|
710
711
|
}
|
|
711
|
-
function
|
|
712
|
+
function nr(e) {
|
|
712
713
|
if (e.key === "Escape") {
|
|
713
|
-
e.preventDefault(), e.stopPropagation(),
|
|
714
|
+
e.preventDefault(), e.stopPropagation(), Mn();
|
|
714
715
|
return;
|
|
715
716
|
}
|
|
716
|
-
if (e.key !== "Tab" || !
|
|
717
|
-
let t = [...
|
|
717
|
+
if (e.key !== "Tab" || !C.value) return;
|
|
718
|
+
let t = [...C.value.querySelectorAll("button:not([disabled]), input:not([disabled])")].filter((e) => e.tabIndex >= 0);
|
|
718
719
|
if (!t.length) return;
|
|
719
720
|
let n = t[0], r = t[t.length - 1];
|
|
720
721
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
721
722
|
}
|
|
722
|
-
function nr(e) {
|
|
723
|
-
(e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), An());
|
|
724
|
-
}
|
|
725
723
|
function rr(e) {
|
|
726
|
-
|
|
727
|
-
Ct.value?.contains(t) || S.value?.contains(t) || jn(!1);
|
|
724
|
+
(e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), jn());
|
|
728
725
|
}
|
|
729
726
|
function ir(e) {
|
|
730
|
-
|
|
727
|
+
let t = e.target;
|
|
728
|
+
Ct.value?.contains(t) || C.value?.contains(t) || Mn(!1);
|
|
731
729
|
}
|
|
732
|
-
function ar() {
|
|
733
|
-
|
|
730
|
+
function ar(e) {
|
|
731
|
+
e?.target instanceof Node && C.value?.contains(e.target) || An();
|
|
734
732
|
}
|
|
735
733
|
function or() {
|
|
736
|
-
document.
|
|
734
|
+
document.addEventListener("pointerdown", ir, !0), window.addEventListener("scroll", ar, !0), window.addEventListener("resize", ar);
|
|
735
|
+
}
|
|
736
|
+
function sr() {
|
|
737
|
+
document.removeEventListener("pointerdown", ir, !0), window.removeEventListener("scroll", ar, !0), window.removeEventListener("resize", ar);
|
|
737
738
|
}
|
|
738
|
-
return ue(
|
|
739
|
-
|
|
740
|
-
}), re(
|
|
739
|
+
return ue(x, (e) => e ? Nn() : sr()), ie(() => {
|
|
740
|
+
x.value && Nn();
|
|
741
|
+
}), re(sr), ee({ focus: () => wt.value?.focus() }), (t, a) => (h(), c("div", te({
|
|
741
742
|
ref_key: "root",
|
|
742
743
|
ref: Ct
|
|
743
744
|
}, ht.value, {
|
|
744
|
-
class: ["w-full",
|
|
745
|
+
class: ["w-full", f.disabled && "opacity-50"],
|
|
745
746
|
"data-ac-ds": "",
|
|
746
747
|
"data-testid": "ac-date-picker"
|
|
747
748
|
}), [
|
|
748
|
-
|
|
749
|
+
f.label ? (h(), c("label", {
|
|
749
750
|
key: 0,
|
|
750
751
|
id: _t,
|
|
751
|
-
for: `${
|
|
752
|
+
for: `${y(S)}-trigger`,
|
|
752
753
|
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
753
|
-
}, [
|
|
754
|
-
|
|
754
|
+
}, [l("span", null, v(f.label), 1), f.required ? (h(), c("span", be, "*")) : s("", !0)], 8, ye)) : s("", !0),
|
|
755
|
+
f.hint ? (h(), c("p", {
|
|
755
756
|
key: 1,
|
|
756
757
|
id: xt,
|
|
757
758
|
class: "mb-2 text-base text-muted"
|
|
758
|
-
},
|
|
759
|
-
|
|
760
|
-
id: `${
|
|
759
|
+
}, v(f.hint), 1)) : s("", !0),
|
|
760
|
+
l("div", xe, [l("button", te({
|
|
761
|
+
id: `${y(S)}-trigger`,
|
|
761
762
|
ref_key: "trigger",
|
|
762
763
|
ref: wt
|
|
763
764
|
}, gt.value, {
|
|
764
765
|
type: "button",
|
|
765
|
-
disabled:
|
|
766
|
+
disabled: f.disabled,
|
|
766
767
|
"aria-haspopup": "dialog",
|
|
767
|
-
"aria-expanded":
|
|
768
|
-
"aria-labelledby":
|
|
768
|
+
"aria-expanded": x.value,
|
|
769
|
+
"aria-labelledby": f.label ? `${_t} ${vt}` : vt,
|
|
769
770
|
"aria-describedby": nn.value,
|
|
770
|
-
"aria-invalid": !!
|
|
771
|
-
"aria-required":
|
|
771
|
+
"aria-invalid": !!f.errorMsg || void 0,
|
|
772
|
+
"aria-required": f.required || void 0,
|
|
772
773
|
class: ["flex w-full items-center rounded-10 border bg-background text-left text-base font-normal text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none disabled:cursor-not-allowed", [
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
774
|
+
f.size === "small" ? "h-9 pl-3" : "h-10.5 pl-4",
|
|
775
|
+
f.clearable && It.value && !f.disabled ? "pr-20" : "pr-10",
|
|
776
|
+
f.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
|
|
777
|
+
f.errorMsg ? ["border-danger/60", tn.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : tn.value ? "focus-ring" : ["border-border", !f.disabled && "hover:border-accent-active"]
|
|
777
778
|
]],
|
|
778
|
-
onClick:
|
|
779
|
-
onKeydown:
|
|
780
|
-
onFocus:
|
|
781
|
-
onBlur:
|
|
782
|
-
}), [
|
|
779
|
+
onClick: a[0] ||= (e) => x.value ? Mn() : jn(),
|
|
780
|
+
onKeydown: rr,
|
|
781
|
+
onFocus: a[1] ||= (e) => en.value = !0,
|
|
782
|
+
onBlur: a[2] ||= (e) => en.value = !1
|
|
783
|
+
}), [l("span", {
|
|
783
784
|
id: vt,
|
|
784
|
-
class:
|
|
785
|
-
},
|
|
785
|
+
class: m(["truncate tabular-nums", !Lt.value && "text-muted/80"])
|
|
786
|
+
}, v(Lt.value || f.placeholder || (f.mode === "duration" ? "Choose duration" : "Choose date")), 3)], 16, Se), l("span", { class: m(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", f.size === "small" ? "right-3" : "right-4"]) }, [f.clearable && It.value && !f.disabled ? (h(), c("button", {
|
|
786
787
|
key: 0,
|
|
787
788
|
type: "button",
|
|
788
789
|
class: "pointer-events-auto inline-flex cursor-pointer items-center justify-center rounded-full p-1 transition-colors duration-200 hover:bg-accent-hover hover:text-primary active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
789
|
-
"aria-label":
|
|
790
|
-
onClick:
|
|
791
|
-
}, [
|
|
790
|
+
"aria-label": f.label ? `Clear ${f.label}` : "Clear",
|
|
791
|
+
onClick: Bn
|
|
792
|
+
}, [d(y(ve), {
|
|
792
793
|
class: "size-4",
|
|
793
794
|
"aria-hidden": "true"
|
|
794
|
-
})], 8, Ce)) :
|
|
795
|
-
class:
|
|
795
|
+
})], 8, Ce)) : s("", !0), (h(), o(oe(an.value), {
|
|
796
|
+
class: m(["size-4", x.value && "text-heading"]),
|
|
796
797
|
"aria-hidden": "true"
|
|
797
798
|
}, null, 8, ["class"]))], 2)]),
|
|
798
|
-
|
|
799
|
+
f.errorMsg ? (h(), c("p", {
|
|
799
800
|
key: 2,
|
|
800
801
|
id: bt,
|
|
801
802
|
class: "mt-1 text-base text-danger-strong",
|
|
802
803
|
role: "alert"
|
|
803
|
-
},
|
|
804
|
-
|
|
804
|
+
}, v(f.errorMsg), 1)) : s("", !0),
|
|
805
|
+
f.name ? (h(), c("input", {
|
|
805
806
|
key: 3,
|
|
806
807
|
type: "hidden",
|
|
807
|
-
name:
|
|
808
|
+
name: f.name,
|
|
808
809
|
value: Rt.value
|
|
809
|
-
}, null, 8, we)) :
|
|
810
|
-
(
|
|
810
|
+
}, null, 8, we)) : s("", !0),
|
|
811
|
+
(h(), o(r, { to: "body" }, [d(i, {
|
|
811
812
|
"enter-active-class": "transition duration-150 ease-out motion-reduce:transition-opacity",
|
|
812
813
|
"enter-from-class": "opacity-0 scale-95",
|
|
813
814
|
"leave-active-class": "transition duration-100 ease-in",
|
|
814
815
|
"leave-to-class": "opacity-0"
|
|
815
816
|
}, {
|
|
816
|
-
default: de(() => [
|
|
817
|
+
default: de(() => [x.value ? (h(), c("div", {
|
|
817
818
|
key: 0,
|
|
818
819
|
ref_key: "panel",
|
|
819
|
-
ref:
|
|
820
|
+
ref: C,
|
|
820
821
|
role: "dialog",
|
|
821
822
|
"aria-modal": "true",
|
|
822
823
|
"aria-label": rn.value,
|
|
823
824
|
class: "ac-scrollbar fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col rounded-10 border border-border bg-surface shadow-sm sm:flex-row",
|
|
824
825
|
style: ne({
|
|
825
|
-
top:
|
|
826
|
-
bottom:
|
|
827
|
-
left: `${
|
|
828
|
-
maxHeight: `${
|
|
829
|
-
minWidth: `${
|
|
826
|
+
top: w.value.top === void 0 ? void 0 : `${w.value.top}px`,
|
|
827
|
+
bottom: w.value.bottom === void 0 ? void 0 : `${w.value.bottom}px`,
|
|
828
|
+
left: `${w.value.left}px`,
|
|
829
|
+
maxHeight: `${w.value.maxHeight}px`,
|
|
830
|
+
minWidth: `${w.value.minWidth}px`
|
|
830
831
|
}),
|
|
831
832
|
"data-ac-ds": "",
|
|
832
833
|
"data-testid": "ac-date-picker-panel",
|
|
833
|
-
onKeydown:
|
|
834
|
-
}, [
|
|
834
|
+
onKeydown: nr
|
|
835
|
+
}, [f.presets.length ? (h(), c("div", Ee, [(h(!0), c(n, null, _(f.presets, (e) => (h(), c("button", {
|
|
835
836
|
key: e.label,
|
|
836
837
|
type: "button",
|
|
837
838
|
class: "cursor-pointer rounded-8 px-3 py-2 text-left text-base text-heading transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset max-sm:rounded-full max-sm:border max-sm:border-border max-sm:px-2.5 max-sm:py-1 max-sm:text-xs",
|
|
838
|
-
onClick: (t) =>
|
|
839
|
-
},
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
839
|
+
onClick: (t) => zn(e)
|
|
840
|
+
}, v(e.label), 9, De))), 128))])) : s("", !0), l("div", { class: m(["max-w-full min-w-0 flex-auto max-sm:w-auto", f.mode === "duration" ? "w-72" : "w-[calc(328px*var(--ac-scale))]"]) }, [f.mode === "duration" ? (h(), c("div", Oe, [
|
|
841
|
+
l("p", ke, v(f.label || "Duration"), 1),
|
|
842
|
+
l("p", Ae, v(_n(Zt.value)), 1),
|
|
843
|
+
l("div", je, [(h(!0), c(n, null, _($t.value, (e) => (h(), c("label", {
|
|
843
844
|
key: e.key,
|
|
844
845
|
class: "block"
|
|
845
|
-
}, [
|
|
846
|
+
}, [l("span", Me, v(e.label), 1), l("input", {
|
|
846
847
|
type: "text",
|
|
847
848
|
inputmode: "numeric",
|
|
848
849
|
role: "spinbutton",
|
|
849
850
|
autocomplete: "off",
|
|
850
|
-
value:
|
|
851
|
+
value: Tn(e),
|
|
851
852
|
"aria-valuenow": e.get(),
|
|
852
853
|
"aria-valuemin": e.min,
|
|
853
854
|
"aria-valuemax": e.max,
|
|
854
855
|
class: "h-10 w-full rounded-10 border border-border bg-background px-2.5 text-center text-base text-heading tabular-nums transition-[border-color,box-shadow] duration-200 outline-none hover:border-accent-active focus:focus-ring",
|
|
855
|
-
onKeydown: (t) =>
|
|
856
|
-
onInput: (t) =>
|
|
857
|
-
onBlur: (t) =>
|
|
858
|
-
onFocus:
|
|
856
|
+
onKeydown: (t) => En(t, e),
|
|
857
|
+
onInput: (t) => Dn(t, e),
|
|
858
|
+
onBlur: (t) => On(t, e),
|
|
859
|
+
onFocus: a[3] ||= (e) => e.target.select()
|
|
859
860
|
}, null, 40, Ne)]))), 128))]),
|
|
860
|
-
|
|
861
|
-
])) : (
|
|
861
|
+
a[10] ||= l("p", { class: "mt-2 text-xs text-muted" }, "↑ ↓ to adjust, or type a number.", -1)
|
|
862
|
+
])) : (h(), c(n, { key: 1 }, [z.value ? (h(), c("div", {
|
|
862
863
|
key: 0,
|
|
863
864
|
role: "tablist",
|
|
864
865
|
"aria-label": "Date or time",
|
|
865
866
|
class: "flex border-b border-border",
|
|
866
|
-
onKeydown:
|
|
867
|
-
}, [(
|
|
868
|
-
id: `${
|
|
867
|
+
onKeydown: Yn
|
|
868
|
+
}, [(h(), c(n, null, _(pt, (e) => l("button", {
|
|
869
|
+
id: `${y(S)}-tab-${e.key}`,
|
|
869
870
|
key: e.key,
|
|
870
871
|
type: "button",
|
|
871
872
|
role: "tab",
|
|
872
873
|
"data-tab": e.key,
|
|
873
|
-
"aria-selected":
|
|
874
|
-
"aria-controls": `${
|
|
875
|
-
tabindex:
|
|
876
|
-
class:
|
|
877
|
-
onClick: (t) =>
|
|
878
|
-
}, [(
|
|
874
|
+
"aria-selected": k.value === e.key,
|
|
875
|
+
"aria-controls": `${y(S)}-tabpanel`,
|
|
876
|
+
tabindex: k.value === e.key ? 0 : -1,
|
|
877
|
+
class: m(["flex flex-1 cursor-pointer items-center justify-center gap-2 px-4 py-2 text-base font-medium transition-colors duration-200 focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset", k.value === e.key ? "bg-primary text-white focus-visible:ring-white/70" : "text-heading hover:bg-accent-hover focus-visible:ring-ring active:bg-accent-active"]),
|
|
878
|
+
onClick: (t) => Jn(e.key)
|
|
879
|
+
}, [(h(), o(oe(e.icon), {
|
|
879
880
|
class: "size-4",
|
|
880
881
|
"aria-hidden": "true"
|
|
881
|
-
})),
|
|
882
|
-
id: `${
|
|
882
|
+
})), u(" " + v(e.label), 1)], 10, Pe)), 64))], 32)) : s("", !0), l("div", {
|
|
883
|
+
id: `${y(S)}-tabpanel`,
|
|
883
884
|
class: "p-3",
|
|
884
|
-
role:
|
|
885
|
-
"aria-labelledby":
|
|
886
|
-
}, [
|
|
887
|
-
|
|
885
|
+
role: z.value ? "tabpanel" : void 0,
|
|
886
|
+
"aria-labelledby": z.value ? `${y(S)}-tab-${k.value}` : void 0
|
|
887
|
+
}, [k.value === "date" ? (h(), c(n, { key: 0 }, [l("div", Ie, [
|
|
888
|
+
l("button", {
|
|
888
889
|
type: "button",
|
|
889
890
|
class: "inline-flex cursor-pointer items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
890
891
|
"aria-label": Kt.value[0],
|
|
891
|
-
onClick:
|
|
892
|
-
}, [
|
|
892
|
+
onClick: a[4] ||= (e) => Hn(-1)
|
|
893
|
+
}, [d(y(me), {
|
|
893
894
|
class: "size-4",
|
|
894
895
|
"aria-hidden": "true"
|
|
895
896
|
})], 8, Le),
|
|
896
|
-
|
|
897
|
+
l("span", {
|
|
897
898
|
id: yt,
|
|
898
899
|
class: "sr-only",
|
|
899
900
|
"aria-live": "polite"
|
|
900
|
-
},
|
|
901
|
-
|
|
901
|
+
}, v(W.value), 1),
|
|
902
|
+
E.value === "years" ? (h(), c("span", ze, v(W.value), 1)) : (h(), c("button", {
|
|
902
903
|
key: 0,
|
|
903
904
|
type: "button",
|
|
904
905
|
class: "cursor-pointer rounded-10 bg-accent px-4 py-2 text-base font-semibold text-heading tabular-nums transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
905
|
-
"aria-label":
|
|
906
|
-
onClick:
|
|
907
|
-
},
|
|
908
|
-
|
|
906
|
+
"aria-label": E.value === "days" ? `${W.value}, choose month` : `${W.value}, choose year`,
|
|
907
|
+
onClick: a[5] ||= (e) => E.value === "days" ? Un() : Wn()
|
|
908
|
+
}, v(W.value), 9, Re)),
|
|
909
|
+
l("button", {
|
|
909
910
|
type: "button",
|
|
910
911
|
class: "inline-flex cursor-pointer items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
911
912
|
"aria-label": Kt.value[1],
|
|
912
|
-
onClick:
|
|
913
|
-
}, [
|
|
913
|
+
onClick: a[6] ||= (e) => Hn(1)
|
|
914
|
+
}, [d(y(he), {
|
|
914
915
|
class: "size-4",
|
|
915
916
|
"aria-hidden": "true"
|
|
916
917
|
})], 8, Be)
|
|
917
|
-
]),
|
|
918
|
+
]), E.value === "days" ? (h(), c("table", {
|
|
918
919
|
key: 0,
|
|
919
920
|
role: "grid",
|
|
920
921
|
"aria-labelledby": yt,
|
|
921
922
|
class: "w-full table-fixed border-collapse",
|
|
922
|
-
onKeydown:
|
|
923
|
-
}, [
|
|
923
|
+
onKeydown: tr
|
|
924
|
+
}, [l("thead", null, [l("tr", null, [(h(!0), c(n, null, _(jt.value, (e) => (h(), c("th", {
|
|
924
925
|
key: e.long,
|
|
925
926
|
scope: "col",
|
|
926
927
|
abbr: e.long,
|
|
927
928
|
class: "pt-2 pb-2 text-center text-xs font-medium text-heading"
|
|
928
|
-
},
|
|
929
|
+
}, v(e.short.slice(0, 2)), 9, Ve))), 128))])]), l("tbody", { onMouseleave: a[7] ||= (e) => j.value = null }, [(h(!0), c(n, null, _(zt.value, (e, t) => (h(), c("tr", { key: t }, [(h(!0), c(n, null, _(e, (e) => (h(), c("td", {
|
|
929
930
|
key: e,
|
|
930
931
|
role: "gridcell",
|
|
931
|
-
"aria-selected":
|
|
932
|
+
"aria-selected": bn(e) || xn(e),
|
|
932
933
|
class: "p-0 py-0.5"
|
|
933
|
-
}, [
|
|
934
|
+
}, [l("div", { class: m(["px-0.5", xn(e) && X(e) === T.value && ["bg-primary/10", ...Sn(e)]]) }, [l("button", {
|
|
934
935
|
type: "button",
|
|
935
936
|
"data-day": e,
|
|
936
|
-
tabindex: e ===
|
|
937
|
-
"aria-label": kt.value.format(
|
|
938
|
-
"aria-disabled":
|
|
937
|
+
tabindex: e === A.value ? 0 : -1,
|
|
938
|
+
"aria-label": kt.value.format(J(e)),
|
|
939
|
+
"aria-disabled": vn(e) || void 0,
|
|
939
940
|
"aria-current": e === Nt.value ? "date" : void 0,
|
|
940
|
-
class:
|
|
941
|
-
onClick: (t) =>
|
|
942
|
-
onMouseenter: (t) =>
|
|
943
|
-
},
|
|
941
|
+
class: m(["relative flex aspect-square w-full items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", [X(e) !== T.value && "invisible", vn(e) ? "cursor-not-allowed text-muted/50 line-through" : bn(e) ? "cursor-pointer bg-primary font-semibold text-white" : e === Nt.value ? "cursor-pointer bg-accent font-medium text-heading hover:bg-accent-hover active:bg-accent-active" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]]),
|
|
942
|
+
onClick: (t) => Fn(e),
|
|
943
|
+
onMouseenter: (t) => R.value && M.value && !N.value && (j.value = e)
|
|
944
|
+
}, v(At.value.format(J(e))), 43, Ue)], 2)], 8, He))), 128))]))), 128))], 32)], 32)) : (h(), c("div", {
|
|
944
945
|
key: 1,
|
|
945
946
|
role: "grid",
|
|
946
|
-
"aria-label":
|
|
947
|
+
"aria-label": E.value === "months" ? `Months of ${W.value}` : `Years ${W.value}`,
|
|
947
948
|
class: "grid gap-2",
|
|
948
|
-
onKeydown:
|
|
949
|
-
}, [(
|
|
950
|
-
key:
|
|
949
|
+
onKeydown: qn
|
|
950
|
+
}, [(h(!0), c(n, null, _(Wt.value, (e, t) => (h(), c("div", {
|
|
951
|
+
key: t,
|
|
951
952
|
role: "row",
|
|
952
953
|
class: "grid grid-cols-4 gap-2"
|
|
953
|
-
}, [(
|
|
954
|
+
}, [(h(!0), c(n, null, _(e, (e) => (h(), c("button", {
|
|
954
955
|
key: e.value,
|
|
955
956
|
type: "button",
|
|
956
957
|
role: "gridcell",
|
|
@@ -959,53 +960,53 @@ var ye = ["for"], be = {
|
|
|
959
960
|
"aria-label": e.label,
|
|
960
961
|
"aria-selected": e.selected,
|
|
961
962
|
"aria-disabled": e.disabled || void 0,
|
|
962
|
-
class:
|
|
963
|
-
onClick: (t) =>
|
|
964
|
-
onFocus: (t) =>
|
|
965
|
-
},
|
|
963
|
+
class: m(["rounded-8 px-4 py-3 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", e.disabled ? "cursor-not-allowed text-muted/50 line-through" : e.selected ? "cursor-pointer bg-primary font-semibold text-white" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]),
|
|
964
|
+
onClick: (t) => Kn(e),
|
|
965
|
+
onFocus: (t) => O.value = e.value
|
|
966
|
+
}, v(e.text), 43, Ge))), 128))]))), 128))], 40, We))], 64)) : (h(), c(n, { key: 1 }, [l("div", Ke, [(h(!0), c(n, null, _(Qt.value, (e, t) => (h(), c(n, { key: e.key }, [t > 0 ? (h(), c("span", qe)) : s("", !0), l("div", {
|
|
966
967
|
class: "flex min-w-0 flex-1 flex-col",
|
|
967
968
|
role: "group",
|
|
968
969
|
"aria-label": `${e.label} time`
|
|
969
|
-
}, [
|
|
970
|
+
}, [R.value ? (h(), c("p", Ye, v(e.label), 1)) : s("", !0), l("div", Xe, [(h(!0), c(n, null, _(e.spinners, (t, r) => (h(), c(n, { key: t.key }, [r > 0 ? (h(), c("span", Ze, ":")) : s("", !0), l("div", Qe, [l("span", $e, v(ft[t.key]), 1), l("div", {
|
|
970
971
|
role: "listbox",
|
|
971
|
-
"aria-label":
|
|
972
|
-
"data-time-list": `${e.key}-${
|
|
972
|
+
"aria-label": t.label,
|
|
973
|
+
"data-time-list": `${e.key}-${t.key}`,
|
|
973
974
|
class: "relative min-h-0 w-full flex-1 scroll-smooth overflow-x-hidden overflow-y-auto [scrollbar-width:none] motion-reduce:scroll-auto [&::-webkit-scrollbar]:hidden",
|
|
974
|
-
onKeydown: (
|
|
975
|
-
}, [
|
|
976
|
-
key:
|
|
975
|
+
onKeydown: (n) => er(n, t, `${e.key}-${t.key}`)
|
|
976
|
+
}, [l("div", tt, [(h(!0), c(n, null, _(Xn(t), (n) => (h(), c("button", {
|
|
977
|
+
key: n,
|
|
977
978
|
type: "button",
|
|
978
979
|
role: "option",
|
|
979
|
-
tabindex:
|
|
980
|
-
"aria-selected":
|
|
981
|
-
class:
|
|
982
|
-
onClick: (r) =>
|
|
983
|
-
},
|
|
984
|
-
|
|
980
|
+
tabindex: n === t.get() ? 0 : -1,
|
|
981
|
+
"aria-selected": n === t.get(),
|
|
982
|
+
class: m(["inline-flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset motion-reduce:transition-none", n === t.get() ? "scale-110 bg-primary font-bold text-white" : "text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]),
|
|
983
|
+
onClick: (r) => $n(t, n, `${e.key}-${t.key}`)
|
|
984
|
+
}, v(on(n)), 11, nt))), 128))])], 40, et)])], 64))), 128))])], 8, Je)], 64))), 128))]), l("p", rt, [u("Times in " + v(Mt.value), 1), Mt.value === L.value ? s("", !0) : (h(), c(n, { key: 0 }, [u(" (" + v(L.value) + ")", 1)], 64))])], 64))], 8, Fe)], 64)), z.value || f.mode === "duration" || !R.value ? (h(), c("div", it, [
|
|
985
|
+
f.mode !== "duration" && !R.value ? (h(), c("button", {
|
|
985
986
|
key: 0,
|
|
986
987
|
type: "button",
|
|
987
988
|
class: "cursor-pointer rounded-8 bg-accent px-3 py-1.5 text-xs font-medium text-heading transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
988
|
-
disabled:
|
|
989
|
-
onClick:
|
|
990
|
-
},
|
|
991
|
-
Yt.value ? (
|
|
992
|
-
|
|
993
|
-
|
|
989
|
+
disabled: vn(Nt.value),
|
|
990
|
+
onClick: a[8] ||= (e) => z.value ? Ln() : Rn()
|
|
991
|
+
}, v(z.value ? "Now" : "Today"), 9, at)) : s("", !0),
|
|
992
|
+
Yt.value ? (h(), c("p", ot, v(Yt.value), 1)) : s("", !0),
|
|
993
|
+
a[11] ||= l("span", { class: "flex-1" }, null, -1),
|
|
994
|
+
z.value || f.mode === "duration" ? (h(), c(n, { key: 2 }, [d(e, {
|
|
994
995
|
title: "Cancel",
|
|
995
996
|
color: "white",
|
|
996
997
|
size: "small",
|
|
997
|
-
onClick:
|
|
998
|
-
}),
|
|
998
|
+
onClick: a[9] ||= (e) => Mn()
|
|
999
|
+
}), d(e, {
|
|
999
1000
|
title: "Apply",
|
|
1000
1001
|
size: "small",
|
|
1001
1002
|
disabled: !Xt.value,
|
|
1002
|
-
onClick:
|
|
1003
|
-
}, null, 8, ["disabled"])], 64)) :
|
|
1004
|
-
])) :
|
|
1003
|
+
onClick: In
|
|
1004
|
+
}, null, 8, ["disabled"])], 64)) : s("", !0)
|
|
1005
|
+
])) : s("", !0)], 2)], 44, Te)) : s("", !0)]),
|
|
1005
1006
|
_: 1
|
|
1006
1007
|
})]))
|
|
1007
1008
|
], 16));
|
|
1008
1009
|
}
|
|
1009
1010
|
});
|
|
1010
1011
|
//#endregion
|
|
1011
|
-
export {
|
|
1012
|
+
export { b as default };
|