@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,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fixedFrame as e } from "./fixedFrame.js";
|
|
2
|
+
import { Fragment as t, Teleport as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeModels as d, mergeProps as f, nextTick as p, normalizeClass as m, normalizeStyle as ee, onBeforeUnmount as te, onMounted as ne, openBlock as h, ref as g, renderList as _, toDisplayString as v, unref as y, useAttrs as re, useId as ie, useModel as b, watch as ae, withCtx as oe } from "vue";
|
|
2
3
|
import { Clock as se, X as ce } from "@lucide/vue";
|
|
3
4
|
//#region src/lib/components/AcTimePicker.vue?vue&type=script&setup=true&lang.ts
|
|
4
5
|
var le = ["for"], ue = {
|
|
@@ -30,10 +31,10 @@ var le = ["for"], ue = {
|
|
|
30
31
|
"aria-selected",
|
|
31
32
|
"aria-disabled",
|
|
32
33
|
"onClick"
|
|
33
|
-
], we = { class: "mt-4 flex shrink-0 justify-center gap-2 border-t border-border pt-4" }, Te = ["disabled"],
|
|
34
|
+
], we = { class: "mt-4 flex shrink-0 justify-center gap-2 border-t border-border pt-4" }, Te = ["disabled"], x = 86399, S = /*@__PURE__*/ u({
|
|
34
35
|
inheritAttrs: !1,
|
|
35
36
|
__name: "AcTimePicker",
|
|
36
|
-
props: /*@__PURE__*/
|
|
37
|
+
props: /*@__PURE__*/ d({
|
|
37
38
|
label: { default: "" },
|
|
38
39
|
placeholder: { default: "Choose time" },
|
|
39
40
|
hourCycle: { default: 24 },
|
|
@@ -70,19 +71,19 @@ var le = ["for"], ue = {
|
|
|
70
71
|
openModifiers: {}
|
|
71
72
|
}),
|
|
72
73
|
emits: ["update:modelValue", "update:open"],
|
|
73
|
-
setup(
|
|
74
|
-
let
|
|
75
|
-
class:
|
|
76
|
-
style:
|
|
77
|
-
})), Oe =
|
|
78
|
-
let { class: e, style: t, ...n } =
|
|
74
|
+
setup(u, { expose: d }) {
|
|
75
|
+
let S = u, C = b(u, "modelValue"), w = b(u, "open"), Ee = /^(\d{1,2}):(\d{2})(?::(\d{2}))?$/, T = ie(), E = re(), De = i(() => ({
|
|
76
|
+
class: E.class,
|
|
77
|
+
style: E.style
|
|
78
|
+
})), Oe = i(() => {
|
|
79
|
+
let { class: e, style: t, ...n } = E;
|
|
79
80
|
return n;
|
|
80
|
-
}),
|
|
81
|
+
}), D = `${T}-label`, O = `${T}-value`, k = `${T}-msg`, A = `${T}-hint`, j = g(null), M = g(null), N = g(null), P = g({
|
|
81
82
|
left: 0,
|
|
82
83
|
maxHeight: 400,
|
|
83
84
|
minWidth: 0
|
|
84
|
-
}),
|
|
85
|
-
let e =
|
|
85
|
+
}), F = g(!1), I = i(() => w.value || F.value), L = i(() => G(C.value)), R = i(() => G(S.min) ?? 0), z = i(() => G(S.max) ?? x), B = i(() => L.value === null ? null : K(L.value)), V = i(() => S.hourCycle === 12), H = i(() => L.value === null ? "" : Pe(L.value)), ke = i(() => [S.hint && A, S.errorMsg && k].filter(Boolean).join(" ") || void 0), Ae = i(() => S.label ? `${S.label}: choose time` : "Choose time"), je = i(() => q(Ie())), Me = i(() => {
|
|
86
|
+
let e = B.value, t = e?.h ?? null, n = e?.m ?? null, r = t === null ? 0 : t >= 12 ? 12 : 0, i = [], a = V.value ? [
|
|
86
87
|
0,
|
|
87
88
|
1,
|
|
88
89
|
2,
|
|
@@ -103,25 +104,25 @@ var le = ["for"], ue = {
|
|
|
103
104
|
selected: t,
|
|
104
105
|
cells: a.map((e) => ({
|
|
105
106
|
value: e,
|
|
106
|
-
text: U(
|
|
107
|
+
text: U(V.value ? e % 12 || 12 : e),
|
|
107
108
|
disabled: !J(e * 3600, e * 3600 + 3599)
|
|
108
109
|
}))
|
|
109
110
|
});
|
|
110
|
-
let o = t ??
|
|
111
|
+
let o = t ?? Fe();
|
|
111
112
|
if (i.push({
|
|
112
113
|
unit: "m",
|
|
113
114
|
heading: "Min",
|
|
114
115
|
name: "Minutes",
|
|
115
116
|
selected: n,
|
|
116
|
-
cells: W(0, 59, Math.max(1,
|
|
117
|
+
cells: W(0, 59, Math.max(1, S.minuteStep)).map((e) => {
|
|
117
118
|
let t = o * 3600 + e * 60;
|
|
118
119
|
return {
|
|
119
120
|
value: e,
|
|
120
121
|
text: U(e),
|
|
121
|
-
disabled: !J(t,
|
|
122
|
+
disabled: !J(t, S.showSeconds ? t + 59 : t)
|
|
122
123
|
};
|
|
123
124
|
})
|
|
124
|
-
}),
|
|
125
|
+
}), S.showSeconds) {
|
|
125
126
|
let t = n ?? 0;
|
|
126
127
|
i.push({
|
|
127
128
|
unit: "s",
|
|
@@ -135,7 +136,7 @@ var le = ["for"], ue = {
|
|
|
135
136
|
}))
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
|
-
return
|
|
139
|
+
return V.value && i.push({
|
|
139
140
|
unit: "p",
|
|
140
141
|
heading: "AM/PM",
|
|
141
142
|
name: "AM or PM",
|
|
@@ -147,7 +148,7 @@ var le = ["for"], ue = {
|
|
|
147
148
|
}, {
|
|
148
149
|
value: 12,
|
|
149
150
|
text: "PM",
|
|
150
|
-
disabled: !J(43200,
|
|
151
|
+
disabled: !J(43200, x)
|
|
151
152
|
}]
|
|
152
153
|
}), i;
|
|
153
154
|
});
|
|
@@ -176,79 +177,79 @@ var le = ["for"], ue = {
|
|
|
176
177
|
s: e % 60
|
|
177
178
|
};
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
+
function Ne(e) {
|
|
180
181
|
let { h: t, m: n, s: r } = K(e);
|
|
181
|
-
return
|
|
182
|
+
return S.showSeconds ? `${U(t)}:${U(n)}:${U(r)}` : `${U(t)}:${U(n)}`;
|
|
182
183
|
}
|
|
183
|
-
function
|
|
184
|
-
let { h: t, m: n, s: r } = K(e), i =
|
|
185
|
-
return
|
|
184
|
+
function Pe(e) {
|
|
185
|
+
let { h: t, m: n, s: r } = K(e), i = S.showSeconds ? `${U(n)}:${U(r)}` : U(n);
|
|
186
|
+
return V.value ? `${U(t % 12 || 12)}:${i} ${t >= 12 ? "PM" : "AM"}` : `${U(t)}:${i}`;
|
|
186
187
|
}
|
|
187
188
|
function q(e) {
|
|
188
|
-
return e >=
|
|
189
|
+
return e >= R.value && e <= z.value;
|
|
189
190
|
}
|
|
190
191
|
function J(e, t) {
|
|
191
|
-
return t >=
|
|
192
|
-
}
|
|
193
|
-
function Pe() {
|
|
194
|
-
return Math.floor(L.value / 3600);
|
|
192
|
+
return t >= R.value && e <= z.value;
|
|
195
193
|
}
|
|
196
194
|
function Fe() {
|
|
197
|
-
|
|
198
|
-
return e.getHours() * 3600 + n * 60 + (x.showSeconds ? e.getSeconds() : 0);
|
|
195
|
+
return Math.floor(R.value / 3600);
|
|
199
196
|
}
|
|
200
|
-
function Ie(
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
197
|
+
function Ie() {
|
|
198
|
+
let e = /* @__PURE__ */ new Date(), t = Math.max(1, S.minuteStep), n = Math.floor(e.getMinutes() / t) * t;
|
|
199
|
+
return e.getHours() * 3600 + n * 60 + (S.showSeconds ? e.getSeconds() : 0);
|
|
200
|
+
}
|
|
201
|
+
function Le(e) {
|
|
202
|
+
if (q(e) && Re(e)) return e;
|
|
203
|
+
let { h: t } = K(e), n = Math.max(1, S.minuteStep) * 60, r = [];
|
|
204
|
+
for (let e = t * 3600; e < (t + 1) * 3600; e += n) if (S.showSeconds) for (let t = 0; t < 60; t++) r.push(e + t);
|
|
204
205
|
else r.push(e);
|
|
205
206
|
let i = r.filter(q);
|
|
206
207
|
return i.length ? i.reduce((t, n) => Math.abs(n - e) < Math.abs(t - e) ? n : t) : null;
|
|
207
208
|
}
|
|
208
|
-
function
|
|
209
|
+
function Re(e) {
|
|
209
210
|
let { m: t, s: n } = K(e);
|
|
210
|
-
return t % Math.max(1,
|
|
211
|
+
return t % Math.max(1, S.minuteStep) === 0 && (S.showSeconds || n === 0);
|
|
211
212
|
}
|
|
212
|
-
function
|
|
213
|
-
let { h: n, m: r, s: i } =
|
|
213
|
+
function ze(e, t) {
|
|
214
|
+
let { h: n, m: r, s: i } = B.value ?? K(Le(R.value) ?? R.value);
|
|
214
215
|
e === "h" ? n = t : e === "m" ? r = t : e === "s" ? i = t : n = n % 12 + t;
|
|
215
|
-
let a =
|
|
216
|
-
a !== null && (
|
|
217
|
-
}
|
|
218
|
-
function ze() {
|
|
219
|
-
S.value = Me(Fe()), f(() => Z("smooth"));
|
|
216
|
+
let a = Le(n * 3600 + r * 60 + (S.showSeconds ? i : 0));
|
|
217
|
+
a !== null && (C.value = Ne(a));
|
|
220
218
|
}
|
|
221
219
|
function Be() {
|
|
222
|
-
|
|
220
|
+
C.value = Ne(Ie()), p(() => Z("smooth"));
|
|
221
|
+
}
|
|
222
|
+
function Ve() {
|
|
223
|
+
C.value = null, M.value?.focus();
|
|
223
224
|
}
|
|
224
225
|
function Y() {
|
|
225
|
-
let
|
|
226
|
-
if (!
|
|
227
|
-
let
|
|
228
|
-
|
|
229
|
-
bottom:
|
|
230
|
-
left:
|
|
231
|
-
maxHeight: Math.max(200,
|
|
232
|
-
minWidth:
|
|
226
|
+
let t = M.value;
|
|
227
|
+
if (!t) return;
|
|
228
|
+
let n = t.getBoundingClientRect(), r = e(), i = N.value?.offsetWidth ?? 240, a = N.value?.offsetHeight ?? 320, 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);
|
|
229
|
+
P.value = c ? {
|
|
230
|
+
bottom: r.bottom - n.top + 6,
|
|
231
|
+
left: l,
|
|
232
|
+
maxHeight: Math.max(200, s),
|
|
233
|
+
minWidth: u
|
|
233
234
|
} : {
|
|
234
|
-
top:
|
|
235
|
-
left:
|
|
236
|
-
maxHeight: Math.max(200,
|
|
237
|
-
minWidth:
|
|
235
|
+
top: n.bottom + 6 - r.top,
|
|
236
|
+
left: l,
|
|
237
|
+
maxHeight: Math.max(200, o),
|
|
238
|
+
minWidth: u
|
|
238
239
|
};
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
-
|
|
241
|
+
function He() {
|
|
242
|
+
S.disabled || w.value || (w.value = !0);
|
|
242
243
|
}
|
|
243
244
|
function X(e = !0) {
|
|
244
|
-
|
|
245
|
+
w.value && (w.value = !1, e && M.value?.focus());
|
|
245
246
|
}
|
|
246
|
-
async function
|
|
247
|
-
Y(),
|
|
247
|
+
async function Ue() {
|
|
248
|
+
Y(), Qe(), await p(), Y(), Z("instant"), Ge(0);
|
|
248
249
|
}
|
|
249
250
|
function Z(e) {
|
|
250
251
|
let t = e === "smooth" && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
251
|
-
|
|
252
|
+
N.value?.querySelectorAll("[role=listbox]").forEach((e) => {
|
|
252
253
|
let n = e.querySelector("[aria-selected=true]") ?? e.querySelector("[aria-disabled=false]");
|
|
253
254
|
n && e.scrollTo({
|
|
254
255
|
top: n.offsetTop - (e.clientHeight - n.offsetHeight) / 2,
|
|
@@ -256,22 +257,22 @@ var le = ["for"], ue = {
|
|
|
256
257
|
});
|
|
257
258
|
});
|
|
258
259
|
}
|
|
259
|
-
function Ue(e) {
|
|
260
|
-
return [...M.value?.querySelectorAll(`[data-col="${e}"] [role=option]`) ?? []];
|
|
261
|
-
}
|
|
262
260
|
function We(e) {
|
|
263
|
-
|
|
261
|
+
return [...N.value?.querySelectorAll(`[data-col="${e}"] [role=option]`) ?? []];
|
|
262
|
+
}
|
|
263
|
+
function Ge(e) {
|
|
264
|
+
let t = We(e);
|
|
264
265
|
(t.find((e) => e.tabIndex === 0) ?? t[0])?.focus({ preventScroll: !0 });
|
|
265
266
|
}
|
|
266
|
-
function
|
|
267
|
+
function Ke(e, t) {
|
|
267
268
|
return (e.cells.find((t) => t.value === e.selected) ?? e.cells.find((e) => !e.disabled)) === t ? 0 : -1;
|
|
268
269
|
}
|
|
269
|
-
function
|
|
270
|
-
n.disabled || (
|
|
271
|
-
Z("smooth"),
|
|
270
|
+
function qe(e, t, n) {
|
|
271
|
+
n.disabled || (ze(t.unit, n.value), p(() => {
|
|
272
|
+
Z("smooth"), We(e).find((e) => e.tabIndex === 0)?.focus({ preventScroll: !0 });
|
|
272
273
|
}));
|
|
273
274
|
}
|
|
274
|
-
function
|
|
275
|
+
function Je(e, t, n) {
|
|
275
276
|
let r = n.cells.filter((e) => !e.disabled);
|
|
276
277
|
if (!r.length) return;
|
|
277
278
|
let i = r.findIndex((e) => e.value === n.selected), a = {
|
|
@@ -285,171 +286,171 @@ var le = ["for"], ue = {
|
|
|
285
286
|
if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
|
|
286
287
|
e.preventDefault();
|
|
287
288
|
let n = t + (e.key === "ArrowRight" ? 1 : -1);
|
|
288
|
-
n >= 0 && n <
|
|
289
|
+
n >= 0 && n < Me.value.length && Ge(n);
|
|
289
290
|
return;
|
|
290
291
|
}
|
|
291
292
|
if (e.key === "Enter") {
|
|
292
293
|
e.preventDefault();
|
|
293
294
|
let t = n.cells.find((t) => String(t.value) === e.target.dataset.value);
|
|
294
|
-
t && !t.disabled &&
|
|
295
|
+
t && !t.disabled && ze(n.unit, t.value), X();
|
|
295
296
|
return;
|
|
296
297
|
}
|
|
297
298
|
if (!(e.key in a)) return;
|
|
298
299
|
e.preventDefault();
|
|
299
300
|
let o = r[Math.max(0, Math.min(r.length - 1, a[e.key]))];
|
|
300
|
-
|
|
301
|
+
qe(t, n, o);
|
|
301
302
|
}
|
|
302
|
-
function
|
|
303
|
+
function Ye(e) {
|
|
303
304
|
if (e.key === "Escape") {
|
|
304
305
|
e.preventDefault(), e.stopPropagation(), X();
|
|
305
306
|
return;
|
|
306
307
|
}
|
|
307
|
-
if (e.key !== "Tab" || !
|
|
308
|
-
let t = [...
|
|
308
|
+
if (e.key !== "Tab" || !N.value) return;
|
|
309
|
+
let t = [...N.value.querySelectorAll("button:not([disabled])")].filter((e) => e.tabIndex >= 0);
|
|
309
310
|
if (!t.length) return;
|
|
310
311
|
let n = t[0], r = t[t.length - 1];
|
|
311
312
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
312
313
|
}
|
|
313
|
-
function Ye(e) {
|
|
314
|
-
(e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), Ve());
|
|
315
|
-
}
|
|
316
314
|
function Xe(e) {
|
|
315
|
+
(e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), He());
|
|
316
|
+
}
|
|
317
|
+
function Ze(e) {
|
|
317
318
|
let t = e.target;
|
|
318
|
-
|
|
319
|
+
j.value?.contains(t) || N.value?.contains(t) || X(!1);
|
|
319
320
|
}
|
|
320
321
|
function Q(e) {
|
|
321
|
-
e?.target instanceof Node &&
|
|
322
|
+
e?.target instanceof Node && N.value?.contains(e.target) || Y();
|
|
322
323
|
}
|
|
323
|
-
function
|
|
324
|
-
document.addEventListener("pointerdown",
|
|
324
|
+
function Qe() {
|
|
325
|
+
document.addEventListener("pointerdown", Ze, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q);
|
|
325
326
|
}
|
|
326
327
|
function $() {
|
|
327
|
-
document.removeEventListener("pointerdown",
|
|
328
|
+
document.removeEventListener("pointerdown", Ze, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
|
|
328
329
|
}
|
|
329
|
-
return ae(
|
|
330
|
-
|
|
331
|
-
}), te($),
|
|
330
|
+
return ae(w, (e) => e ? Ue() : $()), ne(() => {
|
|
331
|
+
w.value && Ue();
|
|
332
|
+
}), te($), d({ focus: () => M.value?.focus() }), (e, i) => (h(), s("div", f({
|
|
332
333
|
ref_key: "root",
|
|
333
|
-
ref:
|
|
334
|
+
ref: j
|
|
334
335
|
}, De.value, {
|
|
335
|
-
class: ["w-full",
|
|
336
|
+
class: ["w-full", u.disabled && "opacity-50"],
|
|
336
337
|
"data-ac-ds": "",
|
|
337
338
|
"data-testid": "ac-time-picker"
|
|
338
339
|
}), [
|
|
339
|
-
|
|
340
|
+
u.label ? (h(), s("label", {
|
|
340
341
|
key: 0,
|
|
341
|
-
id:
|
|
342
|
-
for: `${
|
|
342
|
+
id: D,
|
|
343
|
+
for: `${y(T)}-trigger`,
|
|
343
344
|
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
344
|
-
}, [
|
|
345
|
-
|
|
345
|
+
}, [c("span", null, v(u.label), 1), u.required ? (h(), s("span", ue, "*")) : o("", !0)], 8, le)) : o("", !0),
|
|
346
|
+
u.hint ? (h(), s("p", {
|
|
346
347
|
key: 1,
|
|
347
|
-
id:
|
|
348
|
+
id: A,
|
|
348
349
|
class: "mb-2 text-base text-muted"
|
|
349
|
-
},
|
|
350
|
-
|
|
351
|
-
id: `${
|
|
350
|
+
}, v(u.hint), 1)) : o("", !0),
|
|
351
|
+
c("div", de, [c("button", f({
|
|
352
|
+
id: `${y(T)}-trigger`,
|
|
352
353
|
ref_key: "trigger",
|
|
353
|
-
ref:
|
|
354
|
+
ref: M
|
|
354
355
|
}, Oe.value, {
|
|
355
356
|
type: "button",
|
|
356
|
-
disabled:
|
|
357
|
+
disabled: u.disabled,
|
|
357
358
|
"aria-haspopup": "dialog",
|
|
358
|
-
"aria-expanded":
|
|
359
|
-
"aria-labelledby":
|
|
359
|
+
"aria-expanded": w.value,
|
|
360
|
+
"aria-labelledby": u.label ? `${D} ${O}` : O,
|
|
360
361
|
"aria-describedby": ke.value,
|
|
361
|
-
"aria-invalid": !!
|
|
362
|
-
"aria-required":
|
|
362
|
+
"aria-invalid": !!u.errorMsg || void 0,
|
|
363
|
+
"aria-required": u.required || void 0,
|
|
363
364
|
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", [
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
u.size === "small" ? "h-9 pl-3" : "h-10.5 pl-4",
|
|
366
|
+
u.clearable && C.value ? "pr-20" : "pr-10",
|
|
367
|
+
u.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
|
|
368
|
+
u.errorMsg ? ["border-danger/60", I.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : I.value ? "focus-ring" : ["border-border", !u.disabled && "hover:border-accent-active"]
|
|
368
369
|
]],
|
|
369
|
-
onClick:
|
|
370
|
-
onKeydown:
|
|
371
|
-
onFocus:
|
|
372
|
-
onBlur:
|
|
373
|
-
}), [
|
|
374
|
-
id:
|
|
375
|
-
class:
|
|
376
|
-
},
|
|
370
|
+
onClick: i[0] ||= (e) => w.value ? X() : He(),
|
|
371
|
+
onKeydown: Xe,
|
|
372
|
+
onFocus: i[1] ||= (e) => F.value = !0,
|
|
373
|
+
onBlur: i[2] ||= (e) => F.value = !1
|
|
374
|
+
}), [c("span", {
|
|
375
|
+
id: O,
|
|
376
|
+
class: m(["truncate tabular-nums", !H.value && "text-muted/80"])
|
|
377
|
+
}, v(H.value || C.value || u.placeholder), 3)], 16, fe), c("span", { class: m(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", u.size === "small" ? "right-3" : "right-4"]) }, [u.clearable && C.value && !u.disabled ? (h(), s("button", {
|
|
377
378
|
key: 0,
|
|
378
379
|
type: "button",
|
|
379
380
|
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",
|
|
380
|
-
"aria-label":
|
|
381
|
-
onClick:
|
|
382
|
-
}, [
|
|
381
|
+
"aria-label": u.label ? `Clear ${u.label}` : "Clear",
|
|
382
|
+
onClick: Ve
|
|
383
|
+
}, [l(y(ce), {
|
|
383
384
|
class: "size-4",
|
|
384
385
|
"aria-hidden": "true"
|
|
385
|
-
})], 8, pe)) :
|
|
386
|
-
class:
|
|
386
|
+
})], 8, pe)) : o("", !0), l(y(se), {
|
|
387
|
+
class: m(["size-4", w.value && "text-heading"]),
|
|
387
388
|
"aria-hidden": "true"
|
|
388
389
|
}, null, 8, ["class"])], 2)]),
|
|
389
|
-
|
|
390
|
+
u.errorMsg ? (h(), s("p", {
|
|
390
391
|
key: 2,
|
|
391
|
-
id:
|
|
392
|
+
id: k,
|
|
392
393
|
class: "mt-1 text-base text-danger-strong",
|
|
393
394
|
role: "alert"
|
|
394
|
-
},
|
|
395
|
-
|
|
395
|
+
}, v(u.errorMsg), 1)) : o("", !0),
|
|
396
|
+
u.name ? (h(), s("input", {
|
|
396
397
|
key: 3,
|
|
397
398
|
type: "hidden",
|
|
398
|
-
name:
|
|
399
|
-
value:
|
|
400
|
-
}, null, 8, me)) :
|
|
401
|
-
(
|
|
399
|
+
name: u.name,
|
|
400
|
+
value: C.value ?? ""
|
|
401
|
+
}, null, 8, me)) : o("", !0),
|
|
402
|
+
(h(), a(n, { to: "body" }, [l(r, {
|
|
402
403
|
"enter-active-class": "transition duration-150 ease-out motion-reduce:transition-opacity",
|
|
403
404
|
"enter-from-class": "opacity-0 scale-95",
|
|
404
405
|
"leave-active-class": "transition duration-100 ease-in",
|
|
405
406
|
"leave-to-class": "opacity-0"
|
|
406
407
|
}, {
|
|
407
|
-
default: oe(() => [
|
|
408
|
+
default: oe(() => [w.value ? (h(), s("div", {
|
|
408
409
|
key: 0,
|
|
409
410
|
ref_key: "panel",
|
|
410
|
-
ref:
|
|
411
|
+
ref: N,
|
|
411
412
|
role: "dialog",
|
|
412
413
|
"aria-modal": "true",
|
|
413
414
|
"aria-label": Ae.value,
|
|
414
415
|
class: "fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-10 border border-border bg-surface p-3 shadow-sm",
|
|
415
416
|
style: ee({
|
|
416
|
-
top:
|
|
417
|
-
bottom:
|
|
418
|
-
left: `${
|
|
419
|
-
maxHeight: `${
|
|
420
|
-
minWidth: `${
|
|
417
|
+
top: P.value.top === void 0 ? void 0 : `${P.value.top}px`,
|
|
418
|
+
bottom: P.value.bottom === void 0 ? void 0 : `${P.value.bottom}px`,
|
|
419
|
+
left: `${P.value.left}px`,
|
|
420
|
+
maxHeight: `${P.value.maxHeight}px`,
|
|
421
|
+
minWidth: `${P.value.minWidth}px`
|
|
421
422
|
}),
|
|
422
423
|
"data-ac-ds": "",
|
|
423
424
|
"data-testid": "ac-time-picker-panel",
|
|
424
|
-
onKeydown:
|
|
425
|
-
}, [
|
|
425
|
+
onKeydown: Ye
|
|
426
|
+
}, [c("div", ge, [(h(!0), s(t, null, _(Me.value, (e, n) => (h(), s(t, { key: e.unit }, [e.unit === "p" ? (h(), s("span", _e)) : n > 0 ? (h(), s("span", ve, ":")) : o("", !0), c("div", {
|
|
426
427
|
class: "flex h-full min-w-14 flex-1 flex-col items-center",
|
|
427
428
|
"data-col": n
|
|
428
|
-
}, [
|
|
429
|
+
}, [c("span", be, v(e.heading), 1), c("div", {
|
|
429
430
|
role: "listbox",
|
|
430
|
-
"aria-label":
|
|
431
|
+
"aria-label": e.name,
|
|
431
432
|
class: "relative min-h-0 w-full flex-1 scroll-smooth overflow-y-auto [scrollbar-width:none] motion-reduce:scroll-auto [&::-webkit-scrollbar]:hidden",
|
|
432
|
-
onKeydown: (
|
|
433
|
-
}, [
|
|
434
|
-
key:
|
|
433
|
+
onKeydown: (t) => Je(t, n, e)
|
|
434
|
+
}, [c("div", Se, [(h(!0), s(t, null, _(e.cells, (t) => (h(), s("button", {
|
|
435
|
+
key: t.value,
|
|
435
436
|
type: "button",
|
|
436
|
-
"data-value":
|
|
437
|
+
"data-value": t.value,
|
|
437
438
|
role: "option",
|
|
438
|
-
tabindex:
|
|
439
|
-
"aria-selected":
|
|
440
|
-
"aria-disabled":
|
|
441
|
-
class:
|
|
442
|
-
onClick: (r) =>
|
|
443
|
-
},
|
|
439
|
+
tabindex: Ke(e, t),
|
|
440
|
+
"aria-selected": t.value === e.selected,
|
|
441
|
+
"aria-disabled": t.disabled,
|
|
442
|
+
class: m(["inline-flex h-10 shrink-0 items-center justify-center rounded-8 tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset motion-reduce:transition-none", [e.unit === "p" ? "w-12 text-xs font-bold" : "w-10 text-base", t.disabled ? "cursor-not-allowed text-muted/50 line-through" : t.value === e.selected ? ["cursor-pointer bg-primary text-white", e.unit !== "p" && "scale-110 font-bold"] : "cursor-pointer text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]]),
|
|
443
|
+
onClick: (r) => qe(n, e, t)
|
|
444
|
+
}, v(t.text), 11, Ce))), 128))])], 40, xe)], 8, ye)], 64))), 128))]), c("div", we, [c("button", {
|
|
444
445
|
type: "button",
|
|
445
446
|
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",
|
|
446
447
|
disabled: !je.value,
|
|
447
|
-
onClick:
|
|
448
|
-
}, " Current time ", 8, Te)])], 44, he)) :
|
|
448
|
+
onClick: Be
|
|
449
|
+
}, " Current time ", 8, Te)])], 44, he)) : o("", !0)]),
|
|
449
450
|
_: 1
|
|
450
451
|
})]))
|
|
451
452
|
], 16));
|
|
452
453
|
}
|
|
453
454
|
});
|
|
454
455
|
//#endregion
|
|
455
|
-
export {
|
|
456
|
+
export { S as default };
|