@aures5g/vue-component-library 3.73.0 → 3.74.0
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.
|
@@ -8334,6 +8334,7 @@ var Am = { class: "text-body-large" }, jm = {
|
|
|
8334
8334
|
key: 1,
|
|
8335
8335
|
class: "flex flex-col gap-[0.5rem] pb-[1.25rem] h-[22.75rem]"
|
|
8336
8336
|
}, Gm = { class: "h-[4rem] flex justify-between items-center pl-[3.5rem] pr-[3.875rem] shrink-0 border-b border-outline/16" }, Km = 1900, qm = 2100, Jm = /* @__PURE__ */ A({
|
|
8337
|
+
inheritAttrs: !1,
|
|
8337
8338
|
__name: "UIDatePicker",
|
|
8338
8339
|
props: /*@__PURE__*/ j({
|
|
8339
8340
|
label: {},
|
|
@@ -8344,97 +8345,96 @@ var Am = { class: "text-body-large" }, jm = {
|
|
|
8344
8345
|
}),
|
|
8345
8346
|
emits: ["update:modelValue"],
|
|
8346
8347
|
setup(e) {
|
|
8347
|
-
let t = B(e, "modelValue"),
|
|
8348
|
-
function o(e) {
|
|
8349
|
-
i.value = i.value.set({ month: e }), a.value = "calendar";
|
|
8350
|
-
}
|
|
8348
|
+
let t = Pe(), n = B(e, "modelValue"), r = $.now().startOf("day"), i = w(() => $.fromISO(n.value)), a = F(i.value.isValid ? i.value.startOf("month") : $.now().startOf("month")), o = F("calendar");
|
|
8351
8349
|
function s(e) {
|
|
8352
|
-
|
|
8350
|
+
a.value = a.value.set({ month: e }), o.value = "calendar";
|
|
8353
8351
|
}
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8352
|
+
function c(e) {
|
|
8353
|
+
a.value = a.value.set({ year: e }), o.value = "calendar";
|
|
8354
|
+
}
|
|
8355
|
+
let l = w(() => ({
|
|
8356
|
+
month: a.value.month,
|
|
8357
|
+
year: a.value.year,
|
|
8358
|
+
interval: Dp.fromDateTimes(a.value.startOf("month").startOf("week"), a.value.endOf("month").endOf("week"))
|
|
8358
8359
|
}));
|
|
8359
|
-
function*
|
|
8360
|
+
function* u(e) {
|
|
8360
8361
|
if (!e.start || !e.end) return;
|
|
8361
8362
|
let t = e.start.startOf("day");
|
|
8362
8363
|
for (; t < e.end;) yield t, t = t.plus({ days: 1 });
|
|
8363
8364
|
}
|
|
8364
|
-
let
|
|
8365
|
+
let d = w(() => {
|
|
8365
8366
|
let e = /* @__PURE__ */ new Map();
|
|
8366
|
-
for (let t of l
|
|
8367
|
+
for (let t of u(l.value.interval)) {
|
|
8367
8368
|
let n = e.getOrInsert(t.weekNumber, []);
|
|
8368
8369
|
n[t.weekday - 1] = t;
|
|
8369
8370
|
}
|
|
8370
8371
|
return [...e.values()];
|
|
8371
|
-
}),
|
|
8372
|
+
}), f = Op.months("short"), p = w(() => {
|
|
8372
8373
|
let e = [];
|
|
8373
8374
|
for (let t = Km; t < qm; t++) e.push(t);
|
|
8374
8375
|
return e;
|
|
8375
|
-
}),
|
|
8376
|
+
}), m = w(() => o.value === "month" ? Op.months().map((e, t) => ({
|
|
8376
8377
|
label: e,
|
|
8377
8378
|
value: t + 1
|
|
8378
|
-
})) :
|
|
8379
|
+
})) : p.value.map((e) => ({
|
|
8379
8380
|
label: `${e}`,
|
|
8380
8381
|
value: e
|
|
8381
|
-
}))),
|
|
8382
|
+
}))), h = w({
|
|
8382
8383
|
get() {
|
|
8383
|
-
return
|
|
8384
|
+
return o.value === "month" ? l.value.month : l.value.year;
|
|
8384
8385
|
},
|
|
8385
8386
|
set(e) {
|
|
8386
|
-
if (
|
|
8387
|
-
|
|
8387
|
+
if (o.value === "month") return s(e);
|
|
8388
|
+
c(e);
|
|
8388
8389
|
}
|
|
8389
|
-
}),
|
|
8390
|
-
function
|
|
8391
|
-
if (
|
|
8392
|
-
|
|
8390
|
+
}), g = Le("pickerDialog"), _ = !1;
|
|
8391
|
+
function v() {
|
|
8392
|
+
if (_) {
|
|
8393
|
+
_ = !1;
|
|
8393
8394
|
return;
|
|
8394
8395
|
}
|
|
8395
|
-
|
|
8396
|
+
g.value?.show();
|
|
8396
8397
|
}
|
|
8397
|
-
function
|
|
8398
|
-
|
|
8399
|
-
|
|
8398
|
+
function y() {
|
|
8399
|
+
_ = !0, g.value?.close(), Promise.resolve().then(() => {
|
|
8400
|
+
_ = !1;
|
|
8400
8401
|
});
|
|
8401
8402
|
}
|
|
8402
|
-
function
|
|
8403
|
-
|
|
8403
|
+
function ee() {
|
|
8404
|
+
g.value?.open && y();
|
|
8404
8405
|
}
|
|
8405
8406
|
bt(document, "keydown", (e) => {
|
|
8406
|
-
e.key === "Escape" &&
|
|
8407
|
+
e.key === "Escape" && ee();
|
|
8407
8408
|
});
|
|
8408
|
-
function
|
|
8409
|
-
|
|
8409
|
+
function b() {
|
|
8410
|
+
g.value?.open && y();
|
|
8410
8411
|
}
|
|
8411
|
-
let
|
|
8412
|
-
ut(
|
|
8413
|
-
|
|
8412
|
+
let x = Le("rootRef");
|
|
8413
|
+
ut(x, () => {
|
|
8414
|
+
g.value?.open && y();
|
|
8414
8415
|
});
|
|
8415
|
-
function
|
|
8416
|
-
|
|
8416
|
+
function te(e) {
|
|
8417
|
+
n.value = e.toISO() || "", y();
|
|
8417
8418
|
}
|
|
8418
|
-
let
|
|
8419
|
-
function
|
|
8420
|
-
let t = e.hasSame(
|
|
8419
|
+
let ne = w(() => i.value.isValid ? i.value.toLocaleString() : "");
|
|
8420
|
+
function re(e) {
|
|
8421
|
+
let t = e.hasSame(r, "day"), n = e.hasSame(i.value, "day"), a = e.month === l.value.month;
|
|
8421
8422
|
return {
|
|
8422
|
-
"text-primary border border-primary hover:bg-primary/8": t && !
|
|
8423
|
-
"bg-primary text-on-primary hover:bg-[color-mix(in_oklab,var(--color-primary),rgba(from_var(--color-on-primary)_r_g_b/8%))]":
|
|
8424
|
-
"hover:bg-on-surface-variant/8": a && !
|
|
8423
|
+
"text-primary border border-primary hover:bg-primary/8": t && !n,
|
|
8424
|
+
"bg-primary text-on-primary hover:bg-[color-mix(in_oklab,var(--color-primary),rgba(from_var(--color-on-primary)_r_g_b/8%))]": n,
|
|
8425
|
+
"hover:bg-on-surface-variant/8": a && !n
|
|
8425
8426
|
};
|
|
8426
8427
|
}
|
|
8427
|
-
return (
|
|
8428
|
+
return (n, r) => (P(), D("div", {
|
|
8428
8429
|
ref_key: "rootRef",
|
|
8429
|
-
ref:
|
|
8430
|
+
ref: x,
|
|
8430
8431
|
class: "relative"
|
|
8431
|
-
}, [k(Ia, {
|
|
8432
|
+
}, [k(Ia, M({
|
|
8432
8433
|
color: e.color,
|
|
8433
8434
|
label: e.label,
|
|
8434
|
-
"model-value":
|
|
8435
|
-
"trailing-icon": z(Dt)
|
|
8436
|
-
|
|
8437
|
-
}, null, 8, [
|
|
8435
|
+
"model-value": ne.value,
|
|
8436
|
+
"trailing-icon": z(Dt)
|
|
8437
|
+
}, z(t), { onFocus: v }), null, 16, [
|
|
8438
8438
|
"color",
|
|
8439
8439
|
"label",
|
|
8440
8440
|
"model-value",
|
|
@@ -8442,51 +8442,51 @@ var Am = { class: "text-body-large" }, jm = {
|
|
|
8442
8442
|
]), O("dialog", {
|
|
8443
8443
|
ref: "pickerDialog",
|
|
8444
8444
|
class: "select-none absolute top-full left-0 bg-surface-container-high rounded-extra-large z-5 w-[22.5rem] min-h-[22.75rem]",
|
|
8445
|
-
onClose:
|
|
8446
|
-
}, [
|
|
8447
|
-
label: z(
|
|
8448
|
-
onMoveLeft:
|
|
8449
|
-
onMoveRight:
|
|
8450
|
-
onOpen:
|
|
8445
|
+
onClose: b
|
|
8446
|
+
}, [o.value === "calendar" ? (P(), D("div", Rm, [O("div", zm, [k(Mm, {
|
|
8447
|
+
label: z(f)[l.value.month - 1] ?? "??",
|
|
8448
|
+
onMoveLeft: r[0] ||= (e) => s(l.value.month - 1),
|
|
8449
|
+
onMoveRight: r[1] ||= (e) => s(l.value.month + 1),
|
|
8450
|
+
onOpen: r[2] ||= (e) => o.value = "month"
|
|
8451
8451
|
}, null, 8, ["label"]), k(Mm, {
|
|
8452
|
-
label: `${
|
|
8453
|
-
onMoveLeft:
|
|
8454
|
-
onMoveRight:
|
|
8455
|
-
onOpen:
|
|
8452
|
+
label: `${l.value.year}`,
|
|
8453
|
+
onMoveLeft: r[3] ||= (e) => c(l.value.year - 1),
|
|
8454
|
+
onMoveRight: r[4] ||= (e) => c(l.value.year + 1),
|
|
8455
|
+
onOpen: r[5] ||= (e) => o.value = "year"
|
|
8456
8456
|
}, null, 8, ["label"])]), O("div", Bm, [O("div", Vm, [(P(!0), D(C, null, I(z(Op).weekdays("short"), (e) => (P(), D("div", {
|
|
8457
8457
|
key: e,
|
|
8458
8458
|
class: "p-[0.25rem] size-[3rem]"
|
|
8459
|
-
}, [O("div", Hm, R(e), 1)]))), 128)), (P(!0), D(C, null, I(
|
|
8459
|
+
}, [O("div", Hm, R(e), 1)]))), 128)), (P(!0), D(C, null, I(d.value, (e, t) => (P(), D(C, { key: t }, [(P(!0), D(C, null, I(e, (e) => (P(), D("div", {
|
|
8460
8460
|
key: `${t}-${e.day}`,
|
|
8461
|
-
class: N(["p-[0.25rem] size-[3rem] cursor-pointer", { "opacity-38 hover:opacity-100": e.month !==
|
|
8461
|
+
class: N(["p-[0.25rem] size-[3rem] cursor-pointer", { "opacity-38 hover:opacity-100": e.month !== l.value.month }])
|
|
8462
8462
|
}, [O("div", {
|
|
8463
|
-
class: N(["size-[2.5rem] inline-flex justify-center items-center rounded-full",
|
|
8464
|
-
onClick: (t) =>
|
|
8465
|
-
}, R(e.day), 11, Um)], 2))), 128))], 64))), 128))])])])) :
|
|
8466
|
-
label: z(
|
|
8463
|
+
class: N(["size-[2.5rem] inline-flex justify-center items-center rounded-full", re(e)]),
|
|
8464
|
+
onClick: (t) => te(e)
|
|
8465
|
+
}, R(e.day), 11, Um)], 2))), 128))], 64))), 128))])])])) : o.value === "month" || o.value === "year" ? (P(), D("div", Wm, [O("div", Gm, [k(Mm, {
|
|
8466
|
+
label: z(f)[l.value.month - 1] ?? "??",
|
|
8467
8467
|
"show-arrows": !1,
|
|
8468
|
-
"show-dropdown":
|
|
8469
|
-
disabled:
|
|
8470
|
-
onOpen:
|
|
8468
|
+
"show-dropdown": o.value === "month",
|
|
8469
|
+
disabled: o.value === "year",
|
|
8470
|
+
onOpen: r[6] ||= (e) => o.value = "calendar"
|
|
8471
8471
|
}, null, 8, [
|
|
8472
8472
|
"label",
|
|
8473
8473
|
"show-dropdown",
|
|
8474
8474
|
"disabled"
|
|
8475
8475
|
]), k(Mm, {
|
|
8476
|
-
label: `${
|
|
8476
|
+
label: `${l.value.year}`,
|
|
8477
8477
|
"show-arrows": !1,
|
|
8478
|
-
"show-dropdown":
|
|
8479
|
-
disabled:
|
|
8480
|
-
onOpen:
|
|
8478
|
+
"show-dropdown": o.value === "year",
|
|
8479
|
+
disabled: o.value === "month",
|
|
8480
|
+
onOpen: r[7] ||= (e) => o.value = "calendar"
|
|
8481
8481
|
}, null, 8, [
|
|
8482
8482
|
"label",
|
|
8483
8483
|
"show-dropdown",
|
|
8484
8484
|
"disabled"
|
|
8485
8485
|
])]), k(Lm, {
|
|
8486
|
-
modelValue:
|
|
8487
|
-
"onUpdate:modelValue":
|
|
8488
|
-
list:
|
|
8489
|
-
"big-row":
|
|
8486
|
+
modelValue: h.value,
|
|
8487
|
+
"onUpdate:modelValue": r[8] ||= (e) => h.value = e,
|
|
8488
|
+
list: m.value,
|
|
8489
|
+
"big-row": o.value === "month"
|
|
8490
8490
|
}, null, 8, [
|
|
8491
8491
|
"modelValue",
|
|
8492
8492
|
"list",
|