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