@wssto2/vue-core 0.3.0 → 0.4.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.
Files changed (145) hide show
  1. package/README.md +3 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-DKX3PH2n.js → AccessGate.vue_vue_type_script_setup_true_lang-DcbZBINh.js} +1 -1
  3. package/dist/{AccountMenuItem.vue_vue_type_script_setup_true_lang-DIGqTLwd.js → AccountMenuItem.vue_vue_type_script_setup_true_lang-CPeNxh5K.js} +1 -1
  4. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-B7Lpfkf6.js → ActionRow.vue_vue_type_script_setup_true_lang-LlfIPWsJ.js} +2 -2
  5. package/dist/{Activity-DviO0VQ8.js → Activity-2gGxQn7v.js} +9 -9
  6. package/dist/{AdaptivePageShell.vue_vue_type_script_setup_true_lang-CvAnzdc1.js → AdaptivePageShell.vue_vue_type_script_setup_true_lang-BoinCY93.js} +3 -3
  7. package/dist/{AlertDialog.vue_vue_type_script_setup_true_lang-CJsMUIUg.js → AlertDialog.vue_vue_type_script_setup_true_lang-whA4WLdl.js} +1 -1
  8. package/dist/{AsyncSection.vue_vue_type_script_setup_true_lang-CCtthMRd.js → AsyncSection.vue_vue_type_script_setup_true_lang-Blj6KgCr.js} +4 -4
  9. package/dist/{Banner.vue_vue_type_script_setup_true_lang-Cib_YYpr.js → Banner.vue_vue_type_script_setup_true_lang-DSStj_5z.js} +1 -1
  10. package/dist/{Button.vue_vue_type_script_setup_true_lang-CYil8h9z.js → Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js} +1 -1
  11. package/dist/{Changes-DlT5mN9G.js → Changes-Bm8xvagD.js} +8 -8
  12. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-CXILftEc.js → CollectionPage.vue_vue_type_script_setup_true_lang-DCBVw2Qd.js} +176 -172
  13. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-DSYgS9lC.js → DataTable.vue_vue_type_script_setup_true_lang-UH6f9puS.js} +1 -1
  14. package/dist/DateField.vue_vue_type_script_setup_true_lang-GVasv8ao.js +255 -0
  15. package/dist/DeadLetters-CMRtXn_N.js +104 -0
  16. package/dist/{DiscardChangesModal.vue_vue_type_script_setup_true_lang-Cb3xJI1x.js → DiscardChangesModal.vue_vue_type_script_setup_true_lang-D1arePCZ.js} +1 -1
  17. package/dist/{EmptyState.vue_vue_type_script_setup_true_lang-C2ZYIT9F.js → EmptyState.vue_vue_type_script_setup_true_lang-50p-Mp8I.js} +1 -1
  18. package/dist/{FormErrors.vue_vue_type_script_setup_true_lang-DVgNBQ8p.js → FormErrors.vue_vue_type_script_setup_true_lang-BQb7wLT0.js} +1 -1
  19. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-0mfG8TkU.js → FormGroup.vue_vue_type_script_setup_true_lang-DG2zdG_a.js} +10 -10
  20. package/dist/{FormView.vue_vue_type_script_setup_true_lang-Bz2m3AtF.js → FormView.vue_vue_type_script_setup_true_lang-cr0xNDXP.js} +2 -2
  21. package/dist/{General-BD-Hcz0a.js → General-CTqd0SLK.js} +8 -8
  22. package/dist/HeaderAction.vue_vue_type_script_setup_true_lang-Cgji-Jrr.js +45 -0
  23. package/dist/{Icon.vue_vue_type_script_lang-VvcV2Bzo.js → Icon.vue_vue_type_script_lang-D7oC-d-S.js} +33 -29
  24. package/dist/{IconTile.vue_vue_type_script_setup_true_lang-D7QgnUyN.js → IconTile.vue_vue_type_script_setup_true_lang-BpIjgu5E.js} +1 -1
  25. package/dist/{LeaveGuardRoot.vue_vue_type_script_setup_true_lang-C2udmeEA.js → LeaveGuardRoot.vue_vue_type_script_setup_true_lang-Cv7KlA5y.js} +1 -1
  26. package/dist/{Menu.vue_vue_type_script_setup_true_lang-BNAjx9tj.js → Menu.vue_vue_type_script_setup_true_lang-DTbAcDzL.js} +30 -26
  27. package/dist/{Modal.vue_vue_type_script_setup_true_lang-D7SwVPpL.js → Modal.vue_vue_type_script_setup_true_lang-DpBb8ans.js} +2 -2
  28. package/dist/{NewRolePage-Dla4YnMs.js → NewRolePage-DTOWIxxC.js} +4 -4
  29. package/dist/{NoAccess.vue_vue_type_script_setup_true_lang-8m9cNptR.js → NoAccess.vue_vue_type_script_setup_true_lang-DWxq-MTM.js} +1 -1
  30. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-CYRg7Kfg.js → NumberField.vue_vue_type_script_setup_true_lang-C7N5nq0P.js} +1 -1
  31. package/dist/{PageBar.vue_vue_type_script_setup_true_lang-Cfr5xsJx.js → PageBar.vue_vue_type_script_setup_true_lang-B7qdEeej.js} +1 -1
  32. package/dist/{Panel.vue_vue_type_script_setup_true_lang-BCRxRK4D.js → Panel.vue_vue_type_script_setup_true_lang-BA0u_DtS.js} +1 -1
  33. package/dist/PanelActions.vue_vue_type_script_setup_true_lang-E9VdIGkf.js +46 -0
  34. package/dist/{PhotoViewer.vue_vue_type_script_setup_true_lang-B3Q4dhqJ.js → PhotoViewer.vue_vue_type_script_setup_true_lang-QPCW3Xi6.js} +1 -1
  35. package/dist/ProfilePage-BlpiWH_W.js +654 -0
  36. package/dist/{RecordHeader.vue_vue_type_script_setup_true_lang-DKsaKlAq.js → RecordHeader.vue_vue_type_script_setup_true_lang-C_ymvhHU.js} +2 -2
  37. package/dist/{ResourcePage.vue_vue_type_script_setup_true_lang-CJcKa9SW.js → ResourcePage.vue_vue_type_script_setup_true_lang-CwI_sROp.js} +5 -5
  38. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-DuEPOmjI.js → RoleEditor.vue_vue_type_script_setup_true_lang-CmwvSytD.js} +30 -29
  39. package/dist/{RolePage-bZzv_E4l.js → RolePage-DZk7BZOc.js} +13 -13
  40. package/dist/{RolesPage-BniZv0nB.js → RolesPage-DzGGCMnm.js} +9 -9
  41. package/dist/{SectionList.vue_vue_type_script_setup_true_lang-BKP_bge8.js → SectionList.vue_vue_type_script_setup_true_lang-BFYls8fR.js} +3 -3
  42. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-BgGEGxSI.js → SectionNavigator.vue_vue_type_script_setup_true_lang-DSMXEaCs.js} +5 -5
  43. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-BZ9UdgA1.js → SegmentedField.vue_vue_type_script_setup_true_lang-BMqWlpsL.js} +1 -1
  44. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-BiGaEKBQ.js → SelectField.vue_vue_type_script_setup_true_lang-7O1BAx04.js} +15 -14
  45. package/dist/{SessionList.vue_vue_type_script_setup_true_lang-DUQpr7gb.js → SessionList.vue_vue_type_script_setup_true_lang-D5KRitar.js} +4 -4
  46. package/dist/{Sessions-Co5-xdeb.js → Sessions-CWqjjTr1.js} +6 -6
  47. package/dist/SettingsPage-C4s0IdkW.js +255 -0
  48. package/dist/{Sheet.vue_vue_type_script_setup_true_lang-bHYzx7-J.js → Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js} +48 -45
  49. package/dist/{SignIn-BWwFbxki.js → SignIn-zzKY__df.js} +7 -7
  50. package/dist/{SignInPage-FnLtoi2q.js → SignInPage-Rqnus_s-.js} +6 -6
  51. package/dist/{SignInTable.vue_vue_type_script_setup_true_lang-Dnx3T_42.js → SignInTable.vue_vue_type_script_setup_true_lang-CEbAvZ_C.js} +1 -1
  52. package/dist/{SignIns-3UcI64_h.js → SignIns-Cnf9BVR0.js} +6 -6
  53. package/dist/{SwipeActions.vue_vue_type_script_setup_true_lang-4I8m27ol.js → SwipeActions.vue_vue_type_script_setup_true_lang-BJIA2JfI.js} +1 -1
  54. package/dist/SwitchField.vue_vue_type_script_setup_true_lang-CM8yp9JQ.js +64 -0
  55. package/dist/{Tabs.vue_vue_type_script_setup_true_lang-BeGaydRr.js → Tabs.vue_vue_type_script_setup_true_lang-CcMcE38r.js} +1 -1
  56. package/dist/{TextField.vue_vue_type_script_setup_true_lang-C_FMf3Vc.js → TextField.vue_vue_type_script_setup_true_lang-B9dwVASU.js} +3 -3
  57. package/dist/TextareaField.vue_vue_type_script_setup_true_lang-CqAWfABZ.js +68 -0
  58. package/dist/TimeField.vue_vue_type_script_setup_true_lang-DWfAUlnz.js +164 -0
  59. package/dist/{Timestamp.vue_vue_type_script_setup_true_lang-1RJGKxbD.js → Timestamp.vue_vue_type_script_setup_true_lang-FVRUr-9y.js} +1 -1
  60. package/dist/{UserRecord-Ci8HfwbX.js → UserRecord-DqigxVxH.js} +12 -12
  61. package/dist/{UsersList-vEJ-cgkT.js → UsersList-DNlZsI9J.js} +8 -8
  62. package/dist/{ViewTabs.vue_vue_type_script_setup_true_lang-ByqTU2JT.js → ViewTabs.vue_vue_type_script_setup_true_lang-BJIoZAlH.js} +1 -1
  63. package/dist/access/index.js +1 -1
  64. package/dist/app/index.js +9 -9
  65. package/dist/button/index.js +1 -1
  66. package/dist/client/index.js +11 -19
  67. package/dist/{client-Bw0aM5Gu.js → client-k9euDWF4.js} +19 -19
  68. package/dist/collection/definition.d.ts +3 -0
  69. package/dist/collection/index.js +6 -6
  70. package/dist/collection/useCollection.d.ts +2 -0
  71. package/dist/content/index.js +2 -2
  72. package/dist/{contributions-CDDg3fKp.js → contributions-DsfmDoRD.js} +1 -1
  73. package/dist/control-7EP4tjYy.js +313 -0
  74. package/dist/controls/index.js +4 -4
  75. package/dist/form/index.js +987 -1134
  76. package/dist/{guards-Cd1V28oG.js → guards-Dve61KjR.js} +1 -1
  77. package/dist/{http-DGGSKWvU.js → http-CNcDHSOj.js} +9 -8
  78. package/dist/i18n/index.js +20 -20
  79. package/dist/icon/core.d.ts +4 -0
  80. package/dist/icon/index.js +1 -1
  81. package/dist/identity/index.js +1 -1
  82. package/dist/index-BsJ92eub.js +504 -0
  83. package/dist/{index-BAcl44SC.js → index-CGv-u1Ws.js} +19 -19
  84. package/dist/{index-B2dbYZR9.js → index-GcLnFF-z.js} +15 -15
  85. package/dist/index.d.ts +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/modal/Sheet.vue.d.ts +2 -0
  88. package/dist/modal/index.js +5 -5
  89. package/dist/modules/events/entities.d.ts +16 -0
  90. package/dist/modules/events/routes.d.ts +17 -0
  91. package/dist/modules/events/schemas.d.ts +16 -0
  92. package/dist/modules/notification/entities.d.ts +46 -0
  93. package/dist/modules/notification/routes.d.ts +26 -0
  94. package/dist/modules/notification/schemas.d.ts +25 -0
  95. package/dist/{navigation-BPWa63ge.js → navigation-Cm3iChlR.js} +1 -1
  96. package/dist/{neighbors-D0WRBxXI.js → neighbors-DpaIMQAL.js} +1 -1
  97. package/dist/notifications/InboxPanel.vue.d.ts +16 -0
  98. package/dist/notifications/MarkAllRead.vue.d.ts +7 -0
  99. package/dist/notifications/NotificationBell.vue.d.ts +2 -0
  100. package/dist/notifications/SettingsLink.vue.d.ts +6 -0
  101. package/dist/notifications/context.d.ts +20 -0
  102. package/dist/notifications/deadletters/DeadLetters.vue.d.ts +2 -0
  103. package/dist/notifications/deadletters/access.d.ts +3 -0
  104. package/dist/notifications/deadletters/list.d.ts +3 -0
  105. package/dist/notifications/deadletters/routes.d.ts +13 -0
  106. package/dist/notifications/feature.d.ts +31 -0
  107. package/dist/notifications/inbox.d.ts +62 -0
  108. package/dist/notifications/index.d.ts +13 -0
  109. package/dist/notifications/index.js +8 -0
  110. package/dist/notifications/settings/EmailPanel.vue.d.ts +14 -0
  111. package/dist/notifications/settings/QuietHoursPanel.vue.d.ts +14 -0
  112. package/dist/notifications/settings/SettingsMenuItem.vue.d.ts +2 -0
  113. package/dist/notifications/settings/SettingsPage.vue.d.ts +2 -0
  114. package/dist/notifications/settings/categoryText.d.ts +9 -0
  115. package/dist/notifications/settings/routes.d.ts +13 -0
  116. package/dist/notifications/settings/settings.d.ts +18 -0
  117. package/dist/notifications/settings/state.d.ts +16 -0
  118. package/dist/notifications/state.d.ts +27 -0
  119. package/dist/notifications/stream.d.ts +21 -0
  120. package/dist/options-Ba_0uLWN.js +18 -0
  121. package/dist/overlay/index.js +3 -3
  122. package/dist/page/index.js +7 -7
  123. package/dist/phone/index.js +68 -67
  124. package/dist/platform/index.js +2 -2
  125. package/dist/{platform-hunMqFdB.js → platform-q3cjODLx.js} +1 -1
  126. package/dist/resource/index.js +1 -1
  127. package/dist/route-goWMxDUN.js +13 -0
  128. package/dist/router/index.js +4 -4
  129. package/dist/{rowLayout-BI7a3Kom.js → rowLayout-BqTEhEuy.js} +5 -5
  130. package/dist/{sections-BEqW1dOc.js → sections-CntvUTxn.js} +1 -1
  131. package/dist/shell/index.js +460 -496
  132. package/dist/state/index.js +4 -4
  133. package/dist/{status-C9aXR-Jb.js → status-BuP3ULjH.js} +2 -2
  134. package/dist/styles.css +1 -1
  135. package/dist/{suggestions-BJAqOj4c.js → suggestions-BxMm6MQA.js} +1 -1
  136. package/dist/testing/index.js +1 -1
  137. package/dist/transport-BnP7WC0Y.js +4 -0
  138. package/dist/{useCommand-BgRwnYlV.js → useCommand-BkONMn3X.js} +2 -2
  139. package/dist/{useResourceForm-Bgc9jMcu.js → useResourceForm-D1hIpwW5.js} +1 -1
  140. package/dist/useTypedEntry-aTfPBAhw.js +857 -0
  141. package/package.json +6 -2
  142. package/dist/DateField.vue_vue_type_script_setup_true_lang-DMVjNsaM.js +0 -1099
  143. package/dist/ProfilePage-OJMQ8cr8.js +0 -691
  144. package/dist/TextareaField.vue_vue_type_script_setup_true_lang-CU3KTKIJ.js +0 -127
  145. package/dist/options-BXkMR63B.js +0 -329
@@ -1,1099 +0,0 @@
1
- import { defineComponent as G, ref as I, watch as pe, computed as x, openBlock as f, createElementBlock as p, Fragment as O, createElementVNode as y, normalizeClass as N, unref as c, createVNode as S, createTextVNode as Le, toDisplayString as U, renderList as R, useModel as he, useId as Pe, useTemplateRef as K, createCommentVNode as B, createBlock as se, mergeModels as ye, nextTick as ve, onMounted as Re, onBeforeUnmount as We, normalizeStyle as de, withCtx as X, mergeProps as we, mergeDefaults as He } from "vue";
2
- import { useI18n as W } from "vue-i18n";
3
- import { _ as Ke } from "./DateButton.vue_vue_type_script_setup_true_lang-EcqrfWKz.js";
4
- import { u as xe } from "./format-B8mJm946.js";
5
- import { _ as E } from "./Icon.vue_vue_type_script_lang-VvcV2Bzo.js";
6
- import { a as Qe, u as Ge } from "./mediaQuery-CygcXmFW.js";
7
- import { _ as Ze } from "./Popover.vue_vue_type_script_setup_true_lang-Dx-tDhNE.js";
8
- import { g as Je, _ as Xe, f as et, b as tt } from "./options-BXkMR63B.js";
9
- import { _ as at } from "./Sheet.vue_vue_type_script_setup_true_lang-bHYzx7-J.js";
10
- const nt = /^(\d{4})-(\d{2})-(\d{2})$/, Ye = 864e5, ee = (e, a = 2) => String(e).padStart(a, "0"), lt = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ot = (e) => e % 4 === 0 && e % 100 !== 0 || e % 400 === 0, ge = (e, a) => a === 2 && ot(e) ? 29 : lt[a - 1] ?? 0;
11
- function j(e, a, t) {
12
- return !Number.isInteger(e) || !Number.isInteger(a) || !Number.isInteger(t) || e < 1 || e > 9999 || a < 1 || a > 12 || t < 1 || t > ge(e, a) ? null : `${ee(e, 4)}-${ee(a)}-${ee(t)}`;
13
- }
14
- function te(e) {
15
- const a = e ? nt.exec(e) : null;
16
- if (!a) return null;
17
- const t = { year: Number(a[1]), month: Number(a[2]), day: Number(a[3]) };
18
- return j(t.year, t.month, t.day) ? t : null;
19
- }
20
- const re = (e) => te(e) !== null, Oe = (e) => `${ee(e.year, 4)}-${ee(e.month)}-${ee(e.day)}`;
21
- function Ae(e) {
22
- const a = /* @__PURE__ */ new Date(0);
23
- return a.setUTCFullYear(e.year, e.month - 1, e.day), Math.round(a.getTime() / Ye);
24
- }
25
- function rt(e) {
26
- const a = new Date(e * Ye);
27
- return { year: a.getUTCFullYear(), month: a.getUTCMonth() + 1, day: a.getUTCDate() };
28
- }
29
- const ke = (e) => te(e) ?? { year: 1970, month: 1, day: 1 };
30
- function L(e, a) {
31
- return Oe(rt(Ae(ke(e)) + a));
32
- }
33
- function ae(e, a) {
34
- const t = ke(e), n = t.year * 12 + (t.month - 1) + a, l = Math.floor(n / 12), u = n % 12 + 1;
35
- return j(l, u, Math.min(t.day, ge(l, u))) ?? e;
36
- }
37
- const Te = (e, a) => ae(e, a * 12);
38
- function be(e) {
39
- const a = ke(e);
40
- return Oe({ ...a, day: ge(a.year, a.month) });
41
- }
42
- function $e(e) {
43
- const a = (Ae(ke(e)) + 3) % 7;
44
- return (a < 0 ? a + 7 : a) + 1;
45
- }
46
- function De(e, a) {
47
- return L(e, -(($e(e) - a + 7) % 7));
48
- }
49
- const st = (e, a) => L(De(e, a), 6);
50
- function it(e) {
51
- let a = L(e, 1);
52
- for (; $e(a) >= 6; ) a = L(a, 1);
53
- return a;
54
- }
55
- function Q(e = /* @__PURE__ */ new Date()) {
56
- return j(e.getFullYear(), e.getMonth() + 1, e.getDate()) ?? "1970-01-01";
57
- }
58
- function Ce(e, a) {
59
- if (a.min && e < a.min || a.max && e > a.max) return !0;
60
- const t = a.disabled;
61
- return t ? typeof t == "function" ? t(e) : t.some((n) => typeof n == "string" ? n === e : e >= n.from && e <= n.to) : !1;
62
- }
63
- function ce(e, a) {
64
- return a.min && e < a.min ? a.min : a.max && e > a.max ? a.max : e;
65
- }
66
- function ut(e) {
67
- return Ie(e)?.firstDay ?? 1;
68
- }
69
- function dt(e) {
70
- return Ie(e)?.weekend ?? [6, 7];
71
- }
72
- function Ie(e) {
73
- try {
74
- const a = new Intl.Locale(e);
75
- return a.getWeekInfo?.() ?? a.weekInfo ?? null;
76
- } catch {
77
- return null;
78
- }
79
- }
80
- function ct(e, a, t) {
81
- const n = j(e, a, 1) ?? "1970-01-01", l = be(n), u = [];
82
- for (let o = De(n, t.firstWeekday); o <= l; o = L(o, 7))
83
- u.push(
84
- Array.from({ length: 7 }, (r, s) => {
85
- const d = L(o, s);
86
- return {
87
- day: d,
88
- date: Number(d.slice(8)),
89
- inMonth: d.startsWith(n.slice(0, 7)),
90
- weekend: t.weekend.includes($e(d)),
91
- today: d === t.today,
92
- selected: d === t.selected,
93
- disabled: Ce(d, t.rules)
94
- };
95
- })
96
- );
97
- return u;
98
- }
99
- function mt(e, a, t, n) {
100
- switch (a) {
101
- case "ArrowLeft":
102
- return L(e, -1);
103
- case "ArrowRight":
104
- return L(e, 1);
105
- case "ArrowUp":
106
- return L(e, -7);
107
- case "ArrowDown":
108
- return L(e, 7);
109
- case "PageUp":
110
- return t ? Te(e, -1) : ae(e, -1);
111
- case "PageDown":
112
- return t ? Te(e, 1) : ae(e, 1);
113
- case "Home":
114
- return De(e, n);
115
- case "End":
116
- return st(e, n);
117
- default:
118
- return null;
119
- }
120
- }
121
- const ft = {
122
- class: "flex flex-col gap-2",
123
- "data-test": "month-year-panel"
124
- }, vt = { class: "flex items-center" }, bt = ["disabled", "aria-label"], pt = ["aria-label"], ht = ["disabled", "aria-label"], yt = { class: "grid grid-cols-3 gap-1.5" }, xt = ["aria-pressed", "aria-label", "disabled", "onClick"], gt = { class: "flex items-center" }, kt = ["disabled", "aria-label"], wt = {
125
- class: "grow text-center text-body font-semibold tabular-nums",
126
- "aria-live": "polite"
127
- }, _t = ["disabled", "aria-label"], $t = { class: "grid grid-cols-3 gap-1.5" }, Dt = ["aria-pressed", "disabled", "onClick"], me = "flex size-8 cursor-pointer items-center justify-center rounded-control text-content-link hover:bg-fill disabled:cursor-default disabled:text-content-disabled disabled:hover:bg-transparent focus-visible:outline-2 focus-visible:outline-border-focus", Ne = "min-h-9 cursor-pointer rounded-full px-1 text-subheadline focus-visible:outline-2 focus-visible:outline-border-focus disabled:cursor-default disabled:text-content-disabled disabled:hover:bg-fill", Ct = /* @__PURE__ */ G({
128
- __name: "MonthYearPanel",
129
- props: {
130
- month: { default: null },
131
- year: { default: null },
132
- viewYear: { default: void 0 },
133
- minYear: { default: 1 },
134
- maxYear: { default: 9999 },
135
- monthDisabled: { type: Function, default: void 0 }
136
- },
137
- emits: ["pick"],
138
- setup(e, { emit: a }) {
139
- const t = e, n = a, { t: l } = W(), u = (w) => Math.floor(w / 10) * 10, o = I(d(t.year ?? t.viewYear ?? (/* @__PURE__ */ new Date()).getFullYear())), r = I(!1), s = I(u(o.value));
140
- pe(
141
- () => t.year,
142
- (w) => {
143
- w !== null && (o.value = d(w));
144
- }
145
- );
146
- function d(w) {
147
- return Math.min(t.maxYear, Math.max(t.minYear, w));
148
- }
149
- const v = x(() => Array.from({ length: 12 }, (w, $) => s.value + $)), g = (w, $) => l(`core.form.months.${$}.${w}`), _ = (w) => t.month === w && t.year === o.value;
150
- function D() {
151
- s.value = u(o.value), r.value = !0;
152
- }
153
- function M(w) {
154
- o.value = w, r.value = !1;
155
- }
156
- const Y = (w) => w ? "bg-tint font-semibold text-content-on-tint" : "bg-fill text-content-strong hover:bg-fill-strong";
157
- return (w, $) => (f(), p("div", ft, [
158
- r.value ? (f(), p(O, { key: 1 }, [
159
- y("div", gt, [
160
- y("button", {
161
- type: "button",
162
- disabled: s.value <= t.minYear,
163
- "aria-label": c(l)("core.form.date.previous_years"),
164
- class: N(me),
165
- onClick: $[2] || ($[2] = (h) => s.value -= 12)
166
- }, [
167
- S(c(E), {
168
- name: "arrowLeftSLine",
169
- size: 18
170
- })
171
- ], 8, kt),
172
- y("p", wt, U(v.value[0]) + " – " + U(v.value[11]), 1),
173
- y("button", {
174
- type: "button",
175
- disabled: s.value + 11 >= t.maxYear,
176
- "aria-label": c(l)("core.form.date.next_years"),
177
- class: N(me),
178
- onClick: $[3] || ($[3] = (h) => s.value += 12)
179
- }, [
180
- S(c(E), {
181
- name: "arrowRightSLine",
182
- size: 18
183
- })
184
- ], 8, _t)
185
- ]),
186
- y("div", $t, [
187
- (f(!0), p(O, null, R(v.value, (h) => (f(), p("button", {
188
- key: h,
189
- type: "button",
190
- "aria-pressed": t.year === h,
191
- disabled: h < t.minYear || h > t.maxYear,
192
- class: N([Ne, "tabular-nums", Y(t.year === h || t.year === null && o.value === h)]),
193
- onClick: (i) => M(h)
194
- }, U(h), 11, Dt))), 128))
195
- ])
196
- ], 64)) : (f(), p(O, { key: 0 }, [
197
- y("div", vt, [
198
- y("button", {
199
- type: "button",
200
- disabled: o.value <= t.minYear,
201
- "aria-label": c(l)("core.form.date.previous_year"),
202
- class: N(me),
203
- onClick: $[0] || ($[0] = (h) => o.value = d(o.value - 1))
204
- }, [
205
- S(c(E), {
206
- name: "arrowLeftSLine",
207
- size: 18
208
- })
209
- ], 8, bt),
210
- y("button", {
211
- type: "button",
212
- "aria-label": c(l)("core.form.date.years"),
213
- "aria-expanded": "false",
214
- class: "flex min-h-8 grow cursor-pointer items-center justify-center gap-1 rounded-control text-lg font-semibold tabular-nums hover:bg-fill focus-visible:outline-2 focus-visible:outline-border-focus",
215
- onClick: D
216
- }, [
217
- Le(U(o.value), 1),
218
- S(c(E), {
219
- name: "arrowDownSLine",
220
- size: 14,
221
- class: "text-content-link"
222
- })
223
- ], 8, pt),
224
- y("button", {
225
- type: "button",
226
- disabled: o.value >= t.maxYear,
227
- "aria-label": c(l)("core.form.date.next_year"),
228
- class: N(me),
229
- onClick: $[1] || ($[1] = (h) => o.value = d(o.value + 1))
230
- }, [
231
- S(c(E), {
232
- name: "arrowRightSLine",
233
- size: 18
234
- })
235
- ], 8, ht)
236
- ]),
237
- y("div", yt, [
238
- (f(), p(O, null, R(12, (h) => y("button", {
239
- key: h,
240
- type: "button",
241
- "aria-pressed": _(h),
242
- "aria-label": `${g(h, "long")} ${o.value}`,
243
- disabled: t.monthDisabled?.(o.value, h),
244
- class: N([Ne, Y(_(h))]),
245
- onClick: (i) => n("pick", { month: h, year: o.value })
246
- }, U(g(h, "short")), 11, xt)), 64))
247
- ])
248
- ], 64))
249
- ]));
250
- }
251
- }), Tt = ["aria-expanded", "aria-label"], Nt = ["id"], Mt = ["id"], Vt = ["disabled", "aria-label"], St = ["disabled", "aria-label"], Ut = ["aria-labelledby"], zt = ["aria-selected"], Lt = ["data-day", "aria-label", "aria-current", "aria-disabled", "tabindex", "onClick"], Me = "flex shrink-0 cursor-pointer items-center justify-center rounded-control text-content-link hover:bg-fill disabled:cursor-default disabled:text-content-disabled disabled:hover:bg-transparent focus-visible:outline-2 focus-visible:outline-border-focus", Ee = /* @__PURE__ */ G({
252
- __name: "Calendar",
253
- props: /* @__PURE__ */ ye({
254
- min: { default: null },
255
- max: { default: null },
256
- disabledDates: { type: [Array, Function], default: void 0 },
257
- openOn: { default: null },
258
- size: { default: "regular" },
259
- monthPicker: { type: Boolean, default: !1 }
260
- }, {
261
- modelValue: { default: null },
262
- modelModifiers: {}
263
- }),
264
- emits: ["update:modelValue"],
265
- setup(e, { expose: a }) {
266
- const t = e, n = he(e, "modelValue"), { t: l } = W(), u = xe(), o = Pe(), r = K("grid"), s = x(() => ({ min: t.min, max: t.max, disabled: t.disabledDates })), d = x(() => ut(u.locale));
267
- function v() {
268
- return re(n.value) ? n.value : ce(re(t.openOn) ? t.openOn : Q(), s.value);
269
- }
270
- const g = te(v()), _ = I({ year: g.year, month: g.month }), D = I(v()), M = I(!1);
271
- pe(n, (b) => {
272
- re(b) && Y(b);
273
- });
274
- function Y(b) {
275
- const k = te(b);
276
- _.value = { year: k.year, month: k.month }, D.value = b;
277
- }
278
- const w = x(
279
- () => ct(_.value.year, _.value.month, { firstWeekday: d.value, weekend: dt(u.locale), today: Q(), selected: n.value, rules: s.value })
280
- ), $ = x(() => j(_.value.year, _.value.month, 1) ?? "1970-01-01"), h = x(() => D.value.startsWith($.value.slice(0, 7)) ? D.value : $.value), i = x(() => l("core.form.months.with_year", { month: l(`core.form.months.long.${_.value.month}`), year: _.value.year })), V = x(() => {
281
- const b = new Intl.DateTimeFormat(u.locale, { weekday: "short", timeZone: "UTC" });
282
- return Array.from({ length: 7 }, (k, z) => {
283
- const le = new Date(Date.UTC(2026, 8, 28 + (d.value - 1 + z) % 7)), P = b.format(le).replace(/\.$/, "");
284
- return P.charAt(0).toLocaleUpperCase(u.locale) + P.slice(1, 2);
285
- });
286
- }), m = x(() => {
287
- const b = new Intl.DateTimeFormat(u.locale, { dateStyle: "full", timeZone: "UTC" });
288
- return (k) => {
289
- const z = te(k);
290
- return b.format(new Date(Date.UTC(z.year, z.month - 1, z.day)));
291
- };
292
- }), C = x(() => !t.min || be(ae($.value, -1)) >= t.min), T = x(() => !t.max || ae($.value, 1) <= t.max);
293
- async function F(b, k) {
294
- Y(b), k && (await ve(), ne());
295
- }
296
- function ne() {
297
- r.value?.querySelector(`[data-day="${h.value}"]`)?.focus();
298
- }
299
- function ue(b) {
300
- if (b.altKey || b.ctrlKey || b.metaKey) return;
301
- const k = mt(h.value, b.key, b.shiftKey, d.value);
302
- k && (b.preventDefault(), F(ce(k, s.value), !0));
303
- }
304
- const q = (b) => F(ce(ae(h.value, b), s.value), !1);
305
- function H(b, k) {
306
- D.value = b, k || (n.value = b);
307
- }
308
- function Z(b) {
309
- const k = j(b.year, b.month, Math.min(Number(h.value.slice(8)), ge(b.year, b.month)));
310
- M.value = !1, F(ce(k ?? $.value, s.value), !0);
311
- }
312
- const qe = (b, k) => {
313
- const z = j(b, k, 1) ?? "";
314
- return !!t.max && z > t.max || !!t.min && be(z) < t.min;
315
- };
316
- a({ focus: ne });
317
- const A = x(() => t.size === "touch");
318
- function Be(b) {
319
- if (b.selected) return "bg-tint font-semibold text-content-on-tint";
320
- const k = b.disabled ? "cursor-default text-content-disabled line-through decoration-1" : b.inMonth ? b.weekend ? "text-content-muted" : "text-content-strong" : "text-content-disabled", z = b.today ? "font-bold text-content-link ring-[1.5px] ring-inset ring-tint" : "";
321
- return [k, z, b.disabled ? "" : "hover:bg-fill"].join(" ");
322
- }
323
- return (b, k) => (f(), p("div", {
324
- class: N(["flex flex-col", A.value ? "gap-1" : "gap-2"]),
325
- "data-test": "calendar"
326
- }, [
327
- y("div", {
328
- class: N(["flex items-center gap-1", A.value ? "px-1" : ""])
329
- }, [
330
- t.monthPicker ? (f(), p("button", {
331
- key: 0,
332
- type: "button",
333
- "aria-expanded": M.value,
334
- "aria-label": c(l)("core.form.date.choose_month"),
335
- class: "flex min-h-8 cursor-pointer items-center gap-1 rounded-control px-1.5 py-1 text-lg font-semibold hover:bg-fill focus-visible:outline-2 focus-visible:outline-border-focus",
336
- onClick: k[0] || (k[0] = (z) => M.value = !M.value)
337
- }, [
338
- y("span", {
339
- id: c(o),
340
- "aria-live": "polite"
341
- }, U(i.value), 9, Nt),
342
- S(c(E), {
343
- name: "arrowDownSLine",
344
- size: 14,
345
- class: "text-content-link"
346
- })
347
- ], 8, Tt)) : (f(), p("p", {
348
- key: 1,
349
- id: c(o),
350
- "aria-live": "polite",
351
- class: N(["ml-1.5 font-semibold", A.value ? "text-headline" : "text-lg"])
352
- }, U(i.value), 11, Mt)),
353
- k[3] || (k[3] = y("span", { class: "grow" }, null, -1)),
354
- M.value ? B("", !0) : (f(), p(O, { key: 2 }, [
355
- y("button", {
356
- type: "button",
357
- disabled: !C.value,
358
- "aria-label": c(l)("core.form.date.previous_month"),
359
- class: N([Me, A.value ? "size-11" : "size-8"]),
360
- onClick: k[1] || (k[1] = (z) => q(-1))
361
- }, [
362
- S(c(E), {
363
- name: "arrowLeftSLine",
364
- size: A.value ? 22 : 18
365
- }, null, 8, ["size"])
366
- ], 10, Vt),
367
- y("button", {
368
- type: "button",
369
- disabled: !T.value,
370
- "aria-label": c(l)("core.form.date.next_month"),
371
- class: N([Me, A.value ? "size-11" : "size-8"]),
372
- onClick: k[2] || (k[2] = (z) => q(1))
373
- }, [
374
- S(c(E), {
375
- name: "arrowRightSLine",
376
- size: A.value ? 22 : 18
377
- }, null, 8, ["size"])
378
- ], 10, St)
379
- ], 64))
380
- ], 2),
381
- M.value ? (f(), se(Ct, {
382
- key: 0,
383
- month: _.value.month,
384
- year: _.value.year,
385
- "min-year": t.min ? Number(t.min.slice(0, 4)) : 1,
386
- "max-year": t.max ? Number(t.max.slice(0, 4)) : 9999,
387
- "month-disabled": qe,
388
- onPick: Z
389
- }, null, 8, ["month", "year", "min-year", "max-year"])) : (f(), p("div", {
390
- key: 1,
391
- ref_key: "grid",
392
- ref: r,
393
- role: "grid",
394
- "aria-labelledby": c(o),
395
- class: N(["flex flex-col", A.value ? "gap-y-1" : "gap-0.5"]),
396
- onKeydown: ue
397
- }, [
398
- y("div", {
399
- role: "row",
400
- class: N(["grid grid-cols-7 text-center", A.value ? "" : "gap-0.5"])
401
- }, [
402
- (f(!0), p(O, null, R(V.value, (z, le) => (f(), p("div", {
403
- key: le,
404
- role: "columnheader",
405
- class: N(["py-1 font-semibold text-content-disabled", A.value ? "text-footnote" : "text-caption"])
406
- }, U(z), 3))), 128))
407
- ], 2),
408
- (f(!0), p(O, null, R(w.value, (z, le) => (f(), p("div", {
409
- key: le,
410
- role: "row",
411
- class: N(["grid grid-cols-7", A.value ? "" : "gap-0.5"])
412
- }, [
413
- (f(!0), p(O, null, R(z, (P) => (f(), p("div", {
414
- key: P.day,
415
- role: "gridcell",
416
- "aria-selected": P.selected
417
- }, [
418
- y("button", {
419
- type: "button",
420
- "data-day": P.day,
421
- "aria-label": m.value(P.day),
422
- "aria-current": P.today ? "date" : void 0,
423
- "aria-disabled": P.disabled || void 0,
424
- tabindex: P.day === h.value ? 0 : -1,
425
- class: N(["w-full cursor-pointer rounded-full tabular-nums transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-border-focus", [A.value ? "h-11 text-body" : "h-9 text-body", Be(P)]]),
426
- onClick: (ka) => H(P.day, P.disabled)
427
- }, U(P.date), 11, Lt)
428
- ], 8, zt))), 128))
429
- ], 2))), 128))
430
- ], 42, Ut))
431
- ], 2));
432
- }
433
- }), Pt = ["aria-label"], Yt = ["disabled", "aria-pressed", "onClick"], je = /* @__PURE__ */ G({
434
- __name: "QuickChips",
435
- props: {
436
- items: {},
437
- selected: { default: null },
438
- variant: { default: "popover" }
439
- },
440
- emits: ["pick"],
441
- setup(e, { emit: a }) {
442
- const t = e, n = a, { t: l } = W();
443
- return (u, o) => (f(), p("div", {
444
- role: "group",
445
- "aria-label": c(l)("core.form.date.quick"),
446
- class: "flex flex-wrap gap-1.5",
447
- "data-test": "quick-picks"
448
- }, [
449
- (f(!0), p(O, null, R(t.items, (r) => (f(), p("button", {
450
- key: r.key,
451
- type: "button",
452
- disabled: r.disabled,
453
- "aria-pressed": r.value === t.selected,
454
- class: N(["cursor-pointer whitespace-nowrap rounded-full font-medium transition-colors duration-motion-fast focus-visible:outline-2 focus-visible:outline-border-focus disabled:cursor-default disabled:opacity-45", [
455
- t.variant === "sheet" ? "px-3 py-2 text-subheadline" : "px-2.5 py-1.5 text-footnote",
456
- r.value === t.selected ? t.variant === "sheet" ? "bg-tint text-content-on-tint" : "bg-tint-soft text-content-link" : t.variant === "sheet" ? "bg-surface-cell text-content-strong shadow-group" : "bg-fill text-content-strong hover:bg-fill-strong"
457
- ]]),
458
- onClick: (s) => n("pick", r.value)
459
- }, U(r.label), 11, Yt))), 128))
460
- ], 8, Pt));
461
- }
462
- }), Ot = /^(\d{2}):(\d{2})$/, Ve = (e) => String(e).padStart(2, "0");
463
- function ie(e, a) {
464
- return !Number.isInteger(e) || !Number.isInteger(a) || e < 0 || e > 23 || a < 0 || a > 59 ? null : `${Ve(e)}:${Ve(a)}`;
465
- }
466
- function Fe(e) {
467
- const a = e ? Ot.exec(e) : null;
468
- return a && ie(Number(a[1]), Number(a[2])) ? { hour: Number(a[1]), minute: Number(a[2]) } : null;
469
- }
470
- const Sa = (e) => Fe(e) !== null;
471
- function At(e) {
472
- const a = Number.isInteger(e) && e >= 1 && e <= 30 ? e : 1;
473
- return Array.from({ length: Math.ceil(60 / a) }, (t, n) => n * a);
474
- }
475
- const Se = Array.from({ length: 24 }, (e, a) => a);
476
- function Ue(e = 1, a = /* @__PURE__ */ new Date()) {
477
- const t = Number.isInteger(e) && e >= 1 && e <= 30 ? e : 1;
478
- return ie(a.getHours(), a.getMinutes() - a.getMinutes() % t) ?? "00:00";
479
- }
480
- function Ua(e, a = 1) {
481
- const t = e.trim().toLowerCase();
482
- let n, l;
483
- const u = /^(\d{1,2})\s*[:.,h]\s*(\d{1,2})?$/.exec(t);
484
- if (u)
485
- n = Number(u[1]), l = u[2] === void 0 ? 0 : Number(u[2]);
486
- else if (/^\d{1,2}$/.test(t))
487
- n = Number(t), l = 0;
488
- else if (/^\d{3,4}$/.test(t))
489
- n = Number(t.slice(0, -2)), l = Number(t.slice(-2));
490
- else return { error: "invalid" };
491
- const o = ie(n, l);
492
- return o ? a > 1 && l % a !== 0 ? { error: "step" } : { time: o } : { error: "invalid" };
493
- }
494
- const It = (e, a) => `${e}T${a}`;
495
- function Et(e) {
496
- const a = e ? /^(\d{4}-\d{2}-\d{2})(?:[T ](\d{2}:\d{2}))?/.exec(e) : null;
497
- return { day: a?.[1] ?? null, time: a?.[2] ?? null };
498
- }
499
- const jt = ["aria-label", "aria-activedescendant"], Ft = ["id", "aria-selected", "data-value", "onClick"], qt = ["aria-label", "aria-activedescendant"], Bt = ["id", "aria-selected", "data-value", "onClick"], oe = 30, ze = 150, fe = /* @__PURE__ */ G({
500
- __name: "ValueColumn",
501
- props: /* @__PURE__ */ ye({
502
- values: {},
503
- label: {},
504
- variant: { default: "list" }
505
- }, {
506
- modelValue: { default: null },
507
- modelModifiers: {}
508
- }),
509
- emits: ["update:modelValue"],
510
- setup(e) {
511
- const a = e, t = he(e, "modelValue"), n = (ze - oe) / 2, l = Pe(), u = K("scroller"), o = Qe("(prefers-reduced-motion: reduce)"), r = x(() => t.value === null ? -1 : a.values.indexOf(t.value)), s = I(Math.max(0, r.value));
512
- let d;
513
- const v = (i) => String(i).padStart(2, "0"), g = (i) => `${l}-${i}`;
514
- function _(i) {
515
- i !== void 0 && (t.value = i);
516
- }
517
- function D(i) {
518
- const V = a.values.length - 1, m = r.value, T = {
519
- ArrowDown: m < 0 ? 0 : Math.min(V, m + 1),
520
- ArrowUp: m < 0 ? 0 : Math.max(0, m - 1),
521
- PageDown: m < 0 ? 0 : Math.min(V, m + 5),
522
- PageUp: m < 0 ? 0 : Math.max(0, m - 5),
523
- Home: 0,
524
- End: V
525
- }[i.key];
526
- T !== void 0 && (i.preventDefault(), _(a.values[T]));
527
- }
528
- function M(i) {
529
- _(i);
530
- }
531
- function Y(i, V) {
532
- const m = u.value;
533
- if (!m || i < 0 || typeof m.scrollTo != "function") return;
534
- const C = V || o.value ? "instant" : "smooth";
535
- if (a.variant === "wheel") {
536
- Math.abs(m.scrollTop - i * oe) > 1 && m.scrollTo({ top: i * oe, behavior: C });
537
- return;
538
- }
539
- const T = m.querySelector(`[data-value="${a.values[i]}"]`);
540
- if (!T) return;
541
- const F = T.offsetTop - (m.clientHeight - T.offsetHeight) / 2;
542
- m.scrollTo({ top: Math.max(0, F), behavior: C });
543
- }
544
- function w() {
545
- const i = u.value;
546
- a.variant !== "wheel" || !i || (s.value = Math.min(a.values.length - 1, Math.max(0, Math.round(i.scrollTop / oe))), clearTimeout(d), d = setTimeout(() => {
547
- const V = a.values[s.value];
548
- V !== void 0 && V !== t.value && (t.value = V);
549
- }, 90));
550
- }
551
- Re(() => void ve(() => Y(r.value, !0))), We(() => clearTimeout(d)), pe(r, (i) => {
552
- s.value = Math.max(0, i), Y(i, !1);
553
- });
554
- const $ = (i) => Math.abs(i - s.value), h = (i) => $(i) === 0 ? "text-[22px] font-semibold text-content-strong" : $(i) === 1 ? "text-[19px] text-content-muted" : "text-base text-content-disabled";
555
- return (i, V) => a.variant === "list" ? (f(), p("div", {
556
- key: 0,
557
- ref_key: "scroller",
558
- ref: u,
559
- role: "listbox",
560
- tabindex: "0",
561
- "aria-label": a.label,
562
- "aria-activedescendant": r.value >= 0 ? g(a.values[r.value]) : void 0,
563
- class: "relative flex min-w-0 grow flex-col gap-0.5 overflow-y-auto rounded-control [scrollbar-width:none] focus-visible:outline-2 focus-visible:outline-border-focus [&::-webkit-scrollbar]:hidden",
564
- onKeydown: D
565
- }, [
566
- (f(!0), p(O, null, R(a.values, (m) => (f(), p("div", {
567
- id: g(m),
568
- key: m,
569
- role: "option",
570
- "aria-selected": m === t.value,
571
- "data-value": m,
572
- class: N(["flex min-h-6.5 shrink-0 cursor-pointer items-center justify-center rounded-md text-body tabular-nums transition-colors duration-motion-fast", m === t.value ? "bg-tint font-semibold text-content-on-tint" : "text-content-strong hover:bg-fill"]),
573
- onClick: (C) => M(m)
574
- }, U(v(m)), 11, Ft))), 128))
575
- ], 40, jt)) : (f(), p("div", {
576
- key: 1,
577
- ref_key: "scroller",
578
- ref: u,
579
- role: "listbox",
580
- tabindex: "0",
581
- "aria-label": a.label,
582
- "aria-activedescendant": r.value >= 0 ? g(a.values[r.value]) : void 0,
583
- class: "relative w-16 snap-y snap-mandatory overflow-y-auto overscroll-contain rounded-control [scrollbar-width:none] focus-visible:outline-2 focus-visible:outline-border-focus [&::-webkit-scrollbar]:hidden",
584
- style: de({ height: `${ze}px` }),
585
- onScrollPassive: w,
586
- onKeydown: D
587
- }, [
588
- y("div", {
589
- style: de({ height: `${n}px` }),
590
- "aria-hidden": "true"
591
- }, null, 4),
592
- (f(!0), p(O, null, R(a.values, (m, C) => (f(), p("div", {
593
- id: g(m),
594
- key: m,
595
- role: "option",
596
- "aria-selected": m === t.value,
597
- "data-value": m,
598
- class: N(["flex cursor-pointer snap-center items-center justify-center tabular-nums", h(C)]),
599
- style: de({ height: `${oe}px` }),
600
- onClick: (T) => M(m)
601
- }, U(v(m)), 15, Bt))), 128)),
602
- y("div", {
603
- style: de({ height: `${n}px` }),
604
- "aria-hidden": "true"
605
- }, null, 4)
606
- ], 44, qt));
607
- }
608
- }), Rt = {
609
- key: 0,
610
- class: "flex h-49 gap-1.5",
611
- "data-test": "time-columns"
612
- }, Wt = {
613
- key: 1,
614
- class: "relative flex items-center justify-center gap-1",
615
- "data-test": "time-columns"
616
- }, Ht = /* @__PURE__ */ G({
617
- __name: "TimeColumns",
618
- props: /* @__PURE__ */ ye({
619
- step: { default: 1 },
620
- variant: { default: "list" }
621
- }, {
622
- modelValue: { default: null },
623
- modelModifiers: {}
624
- }),
625
- emits: ["update:modelValue"],
626
- setup(e) {
627
- const a = e, t = he(e, "modelValue"), { t: n } = W(), l = x(() => Fe(t.value)), u = x(() => At(a.step)), o = x({
628
- get: () => l.value?.hour ?? null,
629
- set: (s) => {
630
- s !== null && (t.value = ie(s, l.value?.minute ?? 0));
631
- }
632
- }), r = x({
633
- get: () => l.value?.minute ?? null,
634
- set: (s) => {
635
- s !== null && (t.value = ie(l.value?.hour ?? 0, s));
636
- }
637
- });
638
- return (s, d) => a.variant === "list" ? (f(), p("div", Rt, [
639
- S(fe, {
640
- modelValue: o.value,
641
- "onUpdate:modelValue": d[0] || (d[0] = (v) => o.value = v),
642
- values: c(Se),
643
- label: c(n)("core.form.time.hour")
644
- }, null, 8, ["modelValue", "values", "label"]),
645
- S(fe, {
646
- modelValue: r.value,
647
- "onUpdate:modelValue": d[1] || (d[1] = (v) => r.value = v),
648
- values: u.value,
649
- label: c(n)("core.form.time.minute")
650
- }, null, 8, ["modelValue", "values", "label"])
651
- ])) : (f(), p("div", Wt, [
652
- d[4] || (d[4] = y("div", {
653
- class: "pointer-events-none absolute inset-x-0 h-9 rounded-lg bg-fill",
654
- "aria-hidden": "true"
655
- }, null, -1)),
656
- S(fe, {
657
- modelValue: o.value,
658
- "onUpdate:modelValue": d[2] || (d[2] = (v) => o.value = v),
659
- values: c(Se),
660
- label: c(n)("core.form.time.hour"),
661
- variant: "wheel",
662
- class: "relative"
663
- }, null, 8, ["modelValue", "values", "label"]),
664
- d[5] || (d[5] = y("span", {
665
- class: "relative text-[22px] font-semibold",
666
- "aria-hidden": "true"
667
- }, ":", -1)),
668
- S(fe, {
669
- modelValue: r.value,
670
- "onUpdate:modelValue": d[3] || (d[3] = (v) => r.value = v),
671
- values: u.value,
672
- label: c(n)("core.form.time.minute"),
673
- variant: "wheel",
674
- class: "relative"
675
- }, null, 8, ["modelValue", "values", "label"])
676
- ]));
677
- }
678
- }), Kt = { class: "flex min-h-bar-height items-center gap-2 px-4 pb-1" }, Qt = ["disabled"], Gt = ["id"], Zt = {
679
- class: "flex flex-col gap-3.5",
680
- "data-test": "date-picker-sheet"
681
- }, Jt = {
682
- key: 1,
683
- class: "rounded-group bg-surface-cell p-2.5 shadow-group"
684
- }, Xt = {
685
- key: 2,
686
- class: "flex items-center gap-2 rounded-group bg-surface-cell px-4 py-2 shadow-group"
687
- }, ea = {
688
- key: 0,
689
- class: "w-22 shrink-0 text-body"
690
- }, ta = { class: "flex grow justify-center" }, aa = {
691
- class: "min-h-5 text-center text-subheadline text-content-muted",
692
- "aria-live": "polite"
693
- }, na = /* @__PURE__ */ G({
694
- __name: "DatePickerSheet",
695
- props: {
696
- title: {},
697
- mode: {},
698
- modelValue: { default: null },
699
- min: { default: null },
700
- max: { default: null },
701
- disabledDates: { type: [Array, Function], default: void 0 },
702
- openOn: { default: null },
703
- shortcuts: { default: () => [] },
704
- step: { default: 1 },
705
- clearable: { type: Boolean, default: !0 }
706
- },
707
- emits: ["update:modelValue"],
708
- setup(e, { expose: a, emit: t }) {
709
- const n = e, l = t, { t: u } = W(), o = xe(), r = K("sheet"), s = x(() => n.mode !== "time"), d = x(() => n.mode !== "date"), v = I(null), g = I(null);
710
- function _() {
711
- const i = n.mode === "time" ? { day: null, time: n.modelValue } : n.mode === "date" ? { day: n.modelValue, time: null } : Et(n.modelValue);
712
- v.value = re(i.day) ? i.day : null, g.value = d.value ? i.time ?? Ue(n.step) : null, r.value?.present();
713
- }
714
- function D() {
715
- return n.mode === "time" ? g.value : v.value ? n.mode === "date" ? v.value : It(v.value, g.value ?? Ue(n.step)) : null;
716
- }
717
- function M() {
718
- l("update:modelValue", D()), r.value?.dismiss();
719
- }
720
- function Y() {
721
- l("update:modelValue", null), r.value?.dismiss();
722
- }
723
- function w(i) {
724
- n.mode === "time" ? g.value = i : v.value = i;
725
- }
726
- function $(i) {
727
- g.value = i, s.value && !v.value && (v.value = Q());
728
- }
729
- const h = x(() => {
730
- const i = (V) => {
731
- const m = te(V), C = new Intl.DateTimeFormat(o.locale, { dateStyle: "full", timeZone: "UTC" }).format(new Date(Date.UTC(m.year, m.month - 1, m.day)));
732
- return C.charAt(0).toLocaleUpperCase(o.locale) + C.slice(1);
733
- };
734
- return n.mode === "time" ? g.value ?? "" : v.value ? n.mode === "date" || !g.value ? i(v.value) : u("core.form.time.at", { date: i(v.value), time: g.value }) : "";
735
- });
736
- return a({ present: _, dismiss: () => r.value?.dismiss() }), (i, V) => (f(), se(at, {
737
- ref_key: "sheet",
738
- ref: r,
739
- title: n.title,
740
- grouped: ""
741
- }, {
742
- header: X(({ titleId: m }) => [
743
- y("div", Kt, [
744
- y("button", {
745
- type: "button",
746
- disabled: !n.clearable,
747
- class: "min-w-16 cursor-pointer py-1.5 text-start text-headline text-content-link focus-visible:outline-2 focus-visible:outline-border-focus disabled:cursor-default disabled:text-content-disabled",
748
- onClick: Y
749
- }, U(c(u)("core.form.select.clear")), 9, Qt),
750
- y("h3", {
751
- id: m,
752
- class: "min-w-0 grow truncate text-center text-headline font-semibold"
753
- }, U(n.title), 9, Gt),
754
- y("button", {
755
- type: "button",
756
- class: "min-w-16 cursor-pointer py-1.5 text-end text-headline font-semibold text-content-link focus-visible:outline-2 focus-visible:outline-border-focus",
757
- onClick: M
758
- }, U(c(u)("core.form.select.done")), 1)
759
- ])
760
- ]),
761
- default: X(() => [
762
- y("div", Zt, [
763
- n.shortcuts.length > 0 ? (f(), se(je, {
764
- key: 0,
765
- variant: "sheet",
766
- items: n.shortcuts,
767
- selected: n.mode === "time" ? g.value : v.value,
768
- onPick: w
769
- }, null, 8, ["items", "selected"])) : B("", !0),
770
- s.value ? (f(), p("div", Jt, [
771
- S(Ee, {
772
- modelValue: v.value,
773
- "onUpdate:modelValue": V[0] || (V[0] = (m) => v.value = m),
774
- size: "touch",
775
- min: n.min,
776
- max: n.max,
777
- "disabled-dates": n.disabledDates,
778
- "open-on": n.openOn
779
- }, null, 8, ["modelValue", "min", "max", "disabled-dates", "open-on"])
780
- ])) : B("", !0),
781
- d.value ? (f(), p("div", Xt, [
782
- s.value ? (f(), p("p", ea, U(c(u)("core.form.time.label")), 1)) : B("", !0),
783
- y("div", ta, [
784
- S(Ht, {
785
- "model-value": g.value,
786
- variant: "wheel",
787
- step: n.step,
788
- "onUpdate:modelValue": $
789
- }, null, 8, ["model-value", "step"])
790
- ])
791
- ])) : B("", !0),
792
- y("p", aa, U(h.value), 1)
793
- ])
794
- ]),
795
- _: 1
796
- }, 8, ["title"]));
797
- }
798
- }), la = ["d", "m", "y"];
799
- function oa(e) {
800
- const a = e("2033-11-22"), t = { y: a.indexOf("2033") >= 0 ? a.indexOf("2033") : a.indexOf("33"), m: a.indexOf("11"), d: a.indexOf("22") };
801
- return t.y < 0 || t.m < 0 || t.d < 0 ? la : ["d", "m", "y"].sort((n, l) => t[n] - t[l]);
802
- }
803
- const ra = (e) => e.trim().toLowerCase().replace(/\.+$/, "");
804
- function sa(e, a) {
805
- if (e.length === 4) return Number(e);
806
- if (e.length > 2) return null;
807
- const t = 2e3 + Number(e);
808
- return t > Number(a.slice(0, 4)) + 30 ? t - 100 : t;
809
- }
810
- function J(e, a) {
811
- const t = e.y === void 0 ? Number(a.slice(0, 4)) : sa(e.y, a), n = e.m === void 0 ? Number(a.slice(5, 7)) : Number(e.m);
812
- return t === null || e.d === void 0 ? null : j(t, n, Number(e.d));
813
- }
814
- function ia(e, a) {
815
- const t = a.today ?? Q(), n = ra(e);
816
- if (n === "") return null;
817
- const { words: l } = a;
818
- if (l.today.includes(n)) return t;
819
- if (l.tomorrow.includes(n)) return L(t, 1);
820
- if (l.yesterday.includes(n)) return L(t, -1);
821
- const u = /^([+-])\s*(\d{1,4})$/.exec(n);
822
- if (u) return L(t, Number(u[2]) * (u[1] === "-" ? -1 : 1));
823
- const o = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(n);
824
- if (o) return j(Number(o[1]), Number(o[2]), Number(o[3]));
825
- if (!/^[\d\s./-]+$/.test(n)) return null;
826
- const r = a.order, s = r.filter((v) => v !== "y");
827
- if (/^\d+$/.test(n)) {
828
- if (n.length <= 2) return J({ d: n }, t);
829
- if (n.length === 4) return J(_e(s, [n.slice(0, 2), n.slice(2)]), t);
830
- if (n.length === 6 || n.length === 8) {
831
- const v = r.map((D) => D === "y" ? n.length - 4 : 2);
832
- let g = 0;
833
- const _ = r.map((D, M) => [D, n.slice(g, g += v[M])]);
834
- return J(Object.fromEntries(_), t);
835
- }
836
- return null;
837
- }
838
- const d = n.split(/[^\d]+/).filter(Boolean);
839
- return d.length === 3 ? J(_e(r, d), t) : d.length === 2 ? J(_e(s, d), t) : d.length === 1 ? J({ d: d[0] }, t) : null;
840
- }
841
- function _e(e, a) {
842
- return Object.fromEntries(e.map((t, n) => [t, a[n]]));
843
- }
844
- function za(e) {
845
- const a = e.trim().replace(/^(\d{4}-\d{2}-\d{2})T/, "$1 ").split(/\s+/).filter(Boolean), t = a[a.length - 1];
846
- if (t === void 0) return { date: null, time: null };
847
- if (!(t.includes(":") || a.length > 1 && /^\d{1,2}\.\d{2}$/.test(t))) return { date: a.join(" "), time: null };
848
- const l = a.slice(0, -1).join(" ");
849
- return { date: l === "" ? null : l, time: t };
850
- }
851
- function ua(e, a, t) {
852
- const n = e(t), l = /\D+/.exec(n)?.[0].trim() ?? ".", u = /\D+$/.test(n) ? l : "", o = { d: String(Number(t.slice(8))), m: String(Number(t.slice(5, 7))), y: "" };
853
- return a.filter((r) => r !== "y").map((r) => o[r]).join(l) + u;
854
- }
855
- function da(e) {
856
- const { t: a } = W(), t = xe(), n = (r) => t.date(r), l = x(() => oa(n)), u = x(() => ({
857
- today: [a("core.form.date.words.today").toLowerCase(), "today"],
858
- tomorrow: [a("core.form.date.words.tomorrow").toLowerCase(), "tomorrow"],
859
- yesterday: [a("core.form.date.words.yesterday").toLowerCase(), "yesterday"]
860
- }));
861
- return {
862
- placeholder: x(() => a("core.form.date.placeholder", { example: ua(n, l.value, Q()) })),
863
- /** The day a text means, or null. */
864
- parse: (r) => ia(r, { order: l.value, words: u.value }),
865
- available: (r) => !Ce(r, e()),
866
- invalidMessage: () => a("core.form.date.invalid", { example: n(Q()) }),
867
- unavailableMessage: () => a("core.form.date.unavailable")
868
- };
869
- }
870
- const ca = (e) => e ? ["today", "tomorrow", "next-working-day"] : ["today", "tomorrow", "week", "month-end"], La = ["now", "08:00", "12:00"], ma = {
871
- today: (e) => e,
872
- tomorrow: (e) => L(e, 1),
873
- week: (e) => L(e, 7),
874
- "month-end": (e) => be(e),
875
- "next-working-day": (e) => it(e)
876
- };
877
- function fa(e, a, t) {
878
- return typeof e == "string" ? { key: e, label: a(e), value: ma[e](t) } : { key: e.label, label: e.label, value: e.day(t) };
879
- }
880
- function Pa(e, a, t) {
881
- return e === "now" ? { key: "now", label: a, value: t } : typeof e == "string" ? { key: e, label: `${Number(e.slice(0, 2))}${e.slice(2)}`, value: e } : { key: e.label, label: e.label, value: e.time() };
882
- }
883
- function va(e, a, t) {
884
- const { t: n } = W();
885
- return x(() => {
886
- const l = Q();
887
- return (e() ?? ca(a())).map((u) => {
888
- const o = fa(u, (r) => n(`core.form.date.${r.replace(/-/g, "_")}`), l);
889
- return { ...o, disabled: Ce(o.value, t()) };
890
- });
891
- });
892
- }
893
- function ba(e) {
894
- const a = I(null), t = I(), n = x(() => a.value ?? (e.model.value ? e.display(e.model.value) : "")), l = x(() => {
895
- if (a.value === null || a.value.trim() === "") return null;
896
- const s = e.parse(a.value);
897
- return "value" in s ? s.value : null;
898
- });
899
- function u(s) {
900
- a.value = s, t.value = void 0;
901
- }
902
- function o(s) {
903
- a.value = null, t.value = void 0, e.model.value = s;
904
- }
905
- function r() {
906
- if (a.value === null) return;
907
- if (a.value.trim() === "") return o(null);
908
- const s = e.parse(a.value);
909
- if ("error" in s) {
910
- t.value = s.error, e.model.value !== null && (e.model.value = null);
911
- return;
912
- }
913
- o(s.value);
914
- }
915
- return pe(e.model, (s) => {
916
- s === null && t.value || (a.value = null, t.value = void 0);
917
- }), { text: n, typed: l, message: t, input: u, commit: r, set: o };
918
- }
919
- const pa = ["id", "name", "value", "placeholder", "disabled", "required", "aria-required", "aria-invalid", "aria-describedby"], ha = ["aria-label", "onClick"], ya = { class: "flex flex-col gap-2.5" }, xa = {
920
- key: 0,
921
- class: "border-t border-border-separator pt-2.5"
922
- }, ga = { class: "text-footnote text-content-muted" }, Ya = /* @__PURE__ */ G({
923
- __name: "DateField",
924
- props: /* @__PURE__ */ ye(/* @__PURE__ */ He({
925
- label: {},
926
- hint: {},
927
- error: {},
928
- required: { type: Boolean },
929
- editable: { type: Boolean },
930
- disabled: { type: Boolean },
931
- lockedReason: {},
932
- presentation: {},
933
- name: {},
934
- min: {},
935
- max: {},
936
- disabledDates: { type: [Array, Function] },
937
- openOn: {},
938
- quickPicks: {}
939
- }, { ...tt, min: void 0, max: void 0, disabledDates: void 0, openOn: void 0, quickPicks: void 0 }), {
940
- modelValue: { default: null },
941
- modelModifiers: {}
942
- }),
943
- emits: ["update:modelValue"],
944
- setup(e, { expose: a }) {
945
- const t = e, n = he(e, "modelValue"), { t: l } = W(), u = xe(), o = Ge(), r = K("input"), s = K("popover"), d = K("calendar"), v = K("sheet"), g = x(() => ({ min: t.min, max: t.max, disabled: t.disabledDates })), _ = da(() => g.value), D = ba({
946
- model: n,
947
- display: (C) => u.date(C),
948
- parse: (C) => {
949
- const T = _.parse(C);
950
- return T ? _.available(T) ? { value: T } : { error: _.unavailableMessage() } : { error: _.invalidMessage() };
951
- }
952
- }), M = va(() => t.quickPicks, () => o.value, () => g.value), Y = x(() => t.error || D.message.value), w = x(() => n.value ? u.date(n.value) : null), $ = Je("date", () => Y.value ? "error" : t.disabled ? "locked" : "rest"), h = x(() => D.typed.value ?? (re(n.value) ? n.value : null));
953
- async function i(C) {
954
- t.disabled || (s.value?.present(), C && (await ve(), await ve(), d.value?.focus()));
955
- }
956
- function V(C) {
957
- C.key === "Enter" ? (D.commit(), s.value?.dismiss()) : C.key === "ArrowDown" && (C.preventDefault(), i(!0));
958
- }
959
- function m(C, T) {
960
- D.set(C), T();
961
- }
962
- return a({ focus: () => r.value?.focus() }), (C, T) => (f(), se(Xe, we({ ...c(et)(t), error: Y.value }, {
963
- value: w.value,
964
- "value-style": "numeric"
965
- }), {
966
- default: X(({ id: F, describedby: ne, invalid: ue }) => [
967
- c(o) ? (f(), p(O, { key: 0 }, [
968
- S(Ke, we({ id: F, "aria-describedby": ne }, {
969
- disabled: t.disabled,
970
- invalid: ue,
971
- placeholder: c(l)("core.form.select.choose"),
972
- onClick: T[0] || (T[0] = (q) => v.value?.present())
973
- }), {
974
- default: X(() => [
975
- w.value ? (f(), p(O, { key: 0 }, [
976
- Le(U(w.value), 1)
977
- ], 64)) : B("", !0)
978
- ]),
979
- _: 1
980
- }, 16, ["disabled", "invalid", "placeholder"]),
981
- S(na, {
982
- ref_key: "sheet",
983
- ref: v,
984
- title: t.label ?? c(l)("core.form.date.calendar"),
985
- mode: "date",
986
- "model-value": n.value,
987
- min: t.min,
988
- max: t.max,
989
- "disabled-dates": t.disabledDates,
990
- "open-on": t.openOn,
991
- shortcuts: c(M),
992
- clearable: !t.required,
993
- "onUpdate:modelValue": c(D).set
994
- }, null, 8, ["title", "model-value", "min", "max", "disabled-dates", "open-on", "shortcuts", "clearable", "onUpdate:modelValue"])
995
- ], 64)) : (f(), se(Ze, {
996
- key: 1,
997
- ref_key: "popover",
998
- ref: s,
999
- label: t.label ?? c(l)("core.form.date.calendar"),
1000
- width: "lg",
1001
- placement: "bottom-start",
1002
- arrow: !1,
1003
- autofocus: !1
1004
- }, {
1005
- trigger: X(({ attrs: q, presented: H }) => [
1006
- y("div", {
1007
- class: N(["inline-flex max-w-full items-center gap-2", c($)])
1008
- }, [
1009
- y("input", we({
1010
- id: F,
1011
- ref_key: "input",
1012
- ref: r
1013
- }, q, {
1014
- type: "text",
1015
- role: "combobox",
1016
- autocomplete: "off",
1017
- size: "16",
1018
- name: t.name,
1019
- value: c(D).text.value,
1020
- placeholder: c(_).placeholder.value,
1021
- disabled: t.disabled,
1022
- required: t.required,
1023
- "aria-required": t.required || void 0,
1024
- "aria-invalid": ue || void 0,
1025
- "aria-describedby": ne,
1026
- class: "block min-h-7 min-w-0 border-0 bg-transparent py-1 pl-2.5 text-body tabular-nums text-content-strong placeholder:text-content-disabled focus:outline-none focus:ring-0 disabled:cursor-not-allowed",
1027
- onInput: T[1] || (T[1] = (Z) => c(D).input(Z.target.value)),
1028
- onBlur: T[2] || (T[2] = (Z) => c(D).commit()),
1029
- onKeydown: V,
1030
- onClick: T[3] || (T[3] = (Z) => i(!1))
1031
- }), null, 16, pa),
1032
- t.disabled ? B("", !0) : (f(), p("button", {
1033
- key: 0,
1034
- type: "button",
1035
- tabindex: "-1",
1036
- "aria-label": c(l)("core.form.date.open"),
1037
- class: "mr-2 flex shrink-0 cursor-pointer items-center text-content-link",
1038
- onClick: (Z) => H ? s.value?.dismiss() : i(!0)
1039
- }, [
1040
- S(c(E), {
1041
- name: "calendarLine",
1042
- size: 18
1043
- })
1044
- ], 8, ha))
1045
- ], 2)
1046
- ]),
1047
- default: X(({ dismiss: q }) => [
1048
- y("div", ya, [
1049
- S(Ee, {
1050
- ref_key: "calendar",
1051
- ref: d,
1052
- "model-value": h.value,
1053
- min: t.min,
1054
- max: t.max,
1055
- "disabled-dates": t.disabledDates,
1056
- "open-on": t.openOn,
1057
- "month-picker": "",
1058
- "onUpdate:modelValue": (H) => m(H, q)
1059
- }, null, 8, ["model-value", "min", "max", "disabled-dates", "open-on", "onUpdate:modelValue"]),
1060
- c(M).length > 0 ? (f(), p("div", xa, [
1061
- S(je, {
1062
- items: c(M),
1063
- selected: h.value,
1064
- onPick: (H) => m(H, q)
1065
- }, null, 8, ["items", "selected", "onPick"])
1066
- ])) : B("", !0),
1067
- y("p", ga, U(c(l)("core.form.date.keys")), 1)
1068
- ])
1069
- ]),
1070
- _: 2
1071
- }, 1032, ["label"]))
1072
- ]),
1073
- _: 1
1074
- }, 16, ["value"]));
1075
- }
1076
- });
1077
- export {
1078
- Ya as _,
1079
- ba as a,
1080
- Q as b,
1081
- va as c,
1082
- La as d,
1083
- re as e,
1084
- na as f,
1085
- Ee as g,
1086
- je as h,
1087
- Sa as i,
1088
- It as j,
1089
- Ht as k,
1090
- za as l,
1091
- Ce as m,
1092
- Ct as n,
1093
- Fe as o,
1094
- Ua as p,
1095
- Pa as r,
1096
- Et as s,
1097
- Ue as t,
1098
- da as u
1099
- };