@ac-design/design-system 1.0.3 → 2.1.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.
- package/README.md +27 -18
- package/dist/lib/charts/ChartFrame.js +5 -0
- package/dist/lib/charts/ChartFrame.vue.d.ts +71 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +173 -0
- 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 +11 -0
- package/dist/lib/charts/index.js +7 -0
- package/dist/lib/charts/shared.d.ts +53 -0
- package/dist/lib/charts/shared.js +96 -0
- package/dist/lib/charts/xy.d.ts +69 -0
- package/dist/lib/charts/xy.js +73 -0
- package/dist/lib/compat.css +2770 -1061
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcAlert.vue.d.ts +10 -1
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +139 -45
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/lib/components/AcAreaChart.js +5 -0
- package/dist/lib/components/AcAreaChart.vue.d.ts +47 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +205 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +66 -61
- package/dist/lib/components/AcBadge.vue.d.ts +20 -7
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +67 -44
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/lib/components/AcBarChart.js +5 -0
- package/dist/lib/components/AcBarChart.vue.d.ts +46 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +213 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +36 -34
- package/dist/lib/components/AcBulkActionBar.js +5 -0
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +45 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/lib/components/AcButton.vue.d.ts +13 -7
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +93 -47
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +42 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +175 -14
- package/dist/lib/components/AcCellValue.vue.d.ts +6 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +219 -178
- package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +113 -30
- 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 +102 -26
- package/dist/lib/components/AcCircularProgress.js +5 -0
- package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcColorInput.js +5 -0
- package/dist/lib/components/AcColorInput.vue.d.ts +57 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +217 -0
- 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.js +5 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCopyButton.js +5 -0
- package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
- 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 +8 -8
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +634 -417
- package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +57 -60
- package/dist/lib/components/AcDonutChart.js +5 -0
- package/dist/lib/components/AcDonutChart.vue.d.ts +83 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +237 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +91 -78
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +2 -2
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +18 -18
- package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
- 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 +139 -116
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFooter.js +5 -0
- package/dist/lib/components/AcFooter.vue.d.ts +37 -0
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/lib/components/AcForm.vue.d.ts +3 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
- package/dist/lib/components/AcFormFooter.vue.d.ts +3 -3
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFormSection.vue.d.ts +8 -1
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
- 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 -5
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +82 -28
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
- package/dist/lib/components/AcInput.vue.d.ts +4 -4
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +99 -91
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcKeyValueInput.js +5 -0
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +336 -0
- package/dist/lib/components/AcLineChart.js +5 -0
- package/dist/lib/components/AcLineChart.vue.d.ts +44 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +175 -0
- 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.js +5 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +48 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +111 -0
- 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 +88 -64
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +29 -21
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +23 -24
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +139 -174
- package/dist/lib/components/AcNumberInput.js +5 -0
- package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +241 -0
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcPagination.vue.d.ts +22 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +87 -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 +19 -4
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +85 -31
- package/dist/lib/components/AcResourceCard.vue.d.ts +3 -3
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +14 -9
- package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSelect.vue.d.ts +6 -6
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +246 -254
- 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 +32 -32
- package/dist/lib/components/AcSideTabs.vue.d.ts +2 -2
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/lib/components/AcSidebar.vue.d.ts +6 -3
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +67 -57
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +46 -45
- 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/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
- package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
- package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +31 -19
- package/dist/lib/components/AcSwitchCard.js +5 -0
- package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +97 -97
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +43 -28
- package/dist/lib/components/AcTag.vue.d.ts +2 -2
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcTagInput.js +5 -0
- package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +289 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +4 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +85 -63
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +56 -24
- package/dist/lib/components/AcTimePicker.js +5 -0
- package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +455 -0
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +115 -82
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +203 -79
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +166 -115
- package/dist/lib/components/index.d.ts +21 -2
- package/dist/lib/components/status.d.ts +28 -0
- package/dist/lib/components/status.js +125 -0
- package/dist/lib/composables/copyText.d.ts +2 -1
- package/dist/lib/composables/copyText.js +2 -2
- package/dist/lib/composables/useApiPagination.d.ts +55 -0
- package/dist/lib/composables/useApiPagination.js +58 -0
- package/dist/lib/composables/useBulkSelection.d.ts +44 -0
- package/dist/lib/composables/useBulkSelection.js +41 -0
- package/dist/lib/composables/useFormValidation.d.ts +65 -0
- package/dist/lib/composables/useFormValidation.js +148 -0
- package/dist/lib/composables/useTablePagination.d.ts +49 -0
- package/dist/lib/composables/useTablePagination.js +41 -0
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/editor/theme.js +65 -62
- package/dist/lib/index.d.ts +21 -3
- package/dist/lib/index.js +99 -75
- package/dist/lib/theme.css +377 -273
- package/package.json +20 -4
|
@@ -1,8 +1,12 @@
|
|
|
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
|
-
var ye =
|
|
5
|
+
var ye = ["for"], be = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "text-danger",
|
|
8
|
+
"aria-hidden": "true"
|
|
9
|
+
}, xe = { class: "relative" }, Se = [
|
|
6
10
|
"id",
|
|
7
11
|
"disabled",
|
|
8
12
|
"aria-expanded",
|
|
@@ -10,22 +14,18 @@ var ye = { class: "relative" }, be = [
|
|
|
10
14
|
"aria-describedby",
|
|
11
15
|
"aria-invalid",
|
|
12
16
|
"aria-required"
|
|
13
|
-
],
|
|
17
|
+
], Ce = ["aria-label"], we = ["name", "value"], Te = ["aria-label"], Ee = {
|
|
14
18
|
key: 0,
|
|
15
|
-
class: "
|
|
16
|
-
"aria-hidden": "true"
|
|
17
|
-
}, Ce = { class: "pointer-events-none absolute inset-y-0 right-2 flex items-center gap-0.5 text-muted" }, we = ["aria-label"], Te = ["name", "value"], Ee = ["aria-label"], De = {
|
|
18
|
-
key: 0,
|
|
19
|
-
class: "flex shrink-0 flex-wrap gap-1 border-b border-border-light p-2 sm:w-40 sm:flex-col sm:flex-nowrap sm:border-r sm:border-b-0",
|
|
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 = { class: "relative" }, 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,37 +56,47 @@ var ye = { class: "relative" }, 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 = {
|
|
48
68
|
key: 0,
|
|
49
|
-
class: "
|
|
69
|
+
class: "mt-6 h-32 w-px shrink-0 self-center bg-border",
|
|
50
70
|
"aria-hidden": "true"
|
|
51
|
-
},
|
|
71
|
+
}, Je = ["aria-label"], Ye = {
|
|
52
72
|
key: 0,
|
|
53
|
-
class: "
|
|
54
|
-
},
|
|
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 = {
|
|
55
75
|
key: 0,
|
|
56
|
-
class: "text-
|
|
76
|
+
class: "mt-6 self-center font-bold text-heading/50",
|
|
57
77
|
"aria-hidden": "true"
|
|
58
|
-
},
|
|
59
|
-
"
|
|
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 = [
|
|
60
82
|
"aria-label",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
],
|
|
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 = {
|
|
68
90
|
key: 2,
|
|
69
|
-
class: "flex flex-wrap items-center gap-2 border-t border-border
|
|
70
|
-
},
|
|
91
|
+
class: "flex flex-wrap items-center gap-2 border-t border-border px-3 py-3"
|
|
92
|
+
}, at = ["disabled"], ot = {
|
|
71
93
|
key: 1,
|
|
72
|
-
class: "basis-full text-xs text-
|
|
94
|
+
class: "basis-full text-xs text-danger-strong",
|
|
73
95
|
role: "alert"
|
|
74
|
-
}, y = /*@__PURE__*/
|
|
96
|
+
}, y = /*@__PURE__*/ u({
|
|
75
97
|
inheritAttrs: !1,
|
|
76
98
|
__name: "AcDatePicker",
|
|
77
|
-
props: /*@__PURE__*/
|
|
99
|
+
props: /*@__PURE__*/ d({
|
|
78
100
|
label: { default: "" },
|
|
79
101
|
placeholder: { default: "" },
|
|
80
102
|
mode: { default: "date" },
|
|
@@ -110,7 +132,7 @@ var ye = { class: "relative" }, be = [
|
|
|
110
132
|
},
|
|
111
133
|
errorMsg: { default: "" },
|
|
112
134
|
hint: { default: "" },
|
|
113
|
-
size: { default: "
|
|
135
|
+
size: { default: "normal" },
|
|
114
136
|
name: { default: "" }
|
|
115
137
|
}, {
|
|
116
138
|
modelValue: { default: null },
|
|
@@ -122,8 +144,8 @@ var ye = { class: "relative" }, be = [
|
|
|
122
144
|
openModifiers: {}
|
|
123
145
|
}),
|
|
124
146
|
emits: ["update:modelValue", "update:open"],
|
|
125
|
-
setup(
|
|
126
|
-
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 = {
|
|
127
149
|
w: 604800,
|
|
128
150
|
d: 86400,
|
|
129
151
|
h: 3600,
|
|
@@ -133,33 +155,46 @@ var ye = { class: "relative" }, be = [
|
|
|
133
155
|
us: 1e-6,
|
|
134
156
|
µs: 1e-6,
|
|
135
157
|
ns: 1e-9
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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;
|
|
141
175
|
return n;
|
|
142
|
-
}),
|
|
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({
|
|
143
177
|
left: 0,
|
|
144
|
-
maxHeight: 480
|
|
145
|
-
|
|
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({
|
|
146
181
|
h: 0,
|
|
147
182
|
m: 0,
|
|
148
183
|
s: 0
|
|
149
|
-
}),
|
|
184
|
+
}), P = ae({
|
|
150
185
|
h: 23,
|
|
151
186
|
m: 59,
|
|
152
187
|
s: 59
|
|
153
|
-
}),
|
|
188
|
+
}), F = ae({
|
|
154
189
|
d: 0,
|
|
155
190
|
h: 0,
|
|
156
191
|
m: 0
|
|
157
|
-
}),
|
|
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, {
|
|
158
193
|
year: "numeric",
|
|
159
194
|
month: "short",
|
|
160
195
|
day: "numeric",
|
|
161
196
|
timeZone: "UTC"
|
|
162
|
-
})),
|
|
197
|
+
})), Dt = i(() => new Intl.DateTimeFormat(y.locale, {
|
|
163
198
|
year: "numeric",
|
|
164
199
|
month: "short",
|
|
165
200
|
day: "numeric",
|
|
@@ -167,22 +202,22 @@ var ye = { class: "relative" }, be = [
|
|
|
167
202
|
minute: "2-digit",
|
|
168
203
|
second: y.showSeconds ? "2-digit" : void 0,
|
|
169
204
|
hourCycle: "h23",
|
|
170
|
-
timeZone:
|
|
205
|
+
timeZone: I.value,
|
|
171
206
|
timeZoneName: "short"
|
|
172
|
-
})),
|
|
207
|
+
})), Ot = i(() => new Intl.DateTimeFormat(y.locale, {
|
|
173
208
|
month: "long",
|
|
174
209
|
year: "numeric",
|
|
175
210
|
timeZone: "UTC"
|
|
176
|
-
})),
|
|
211
|
+
})), kt = i(() => new Intl.DateTimeFormat(y.locale, {
|
|
177
212
|
weekday: "long",
|
|
178
213
|
year: "numeric",
|
|
179
214
|
month: "long",
|
|
180
215
|
day: "numeric",
|
|
181
216
|
timeZone: "UTC"
|
|
182
|
-
})),
|
|
217
|
+
})), At = i(() => new Intl.DateTimeFormat(y.locale, {
|
|
183
218
|
day: "numeric",
|
|
184
219
|
timeZone: "UTC"
|
|
185
|
-
})),
|
|
220
|
+
})), jt = i(() => {
|
|
186
221
|
let e = new Intl.DateTimeFormat(y.locale, {
|
|
187
222
|
weekday: "short",
|
|
188
223
|
timeZone: "UTC"
|
|
@@ -191,73 +226,105 @@ var ye = { class: "relative" }, be = [
|
|
|
191
226
|
timeZone: "UTC"
|
|
192
227
|
});
|
|
193
228
|
return Array.from({ length: 7 }, (n, r) => {
|
|
194
|
-
let i = new Date(
|
|
229
|
+
let i = new Date(dt + (Tt.value + r) % 7 * 864e5);
|
|
195
230
|
return {
|
|
196
231
|
short: e.format(i),
|
|
197
232
|
long: t.format(i)
|
|
198
233
|
};
|
|
199
234
|
});
|
|
200
|
-
}),
|
|
201
|
-
timeZone:
|
|
235
|
+
}), Mt = i(() => new Intl.DateTimeFormat(y.locale, {
|
|
236
|
+
timeZone: I.value,
|
|
202
237
|
timeZoneName: "short"
|
|
203
|
-
}).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ??
|
|
204
|
-
let e =
|
|
205
|
-
return
|
|
206
|
-
}),
|
|
207
|
-
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;
|
|
208
243
|
if (!e) return "";
|
|
209
244
|
if (y.mode === "duration") {
|
|
210
|
-
let t =
|
|
211
|
-
return t === null ? e :
|
|
245
|
+
let t = mn(e);
|
|
246
|
+
return t === null ? e : gn(t);
|
|
212
247
|
}
|
|
213
248
|
if (y.mode === "date") {
|
|
214
|
-
let n =
|
|
215
|
-
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;
|
|
216
251
|
}
|
|
217
|
-
let n =
|
|
218
|
-
return n === null ? e :
|
|
219
|
-
}),
|
|
220
|
-
let e = (
|
|
221
|
-
return Array.from({ length:
|
|
222
|
-
}),
|
|
223
|
-
|
|
224
|
-
|
|
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];
|
|
225
292
|
for (let t of e) if (t !== null) {
|
|
226
|
-
if (
|
|
227
|
-
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)}`;
|
|
228
295
|
}
|
|
229
|
-
return
|
|
230
|
-
}),
|
|
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(() => {
|
|
231
298
|
let e = [{
|
|
232
299
|
key: "start",
|
|
233
|
-
label:
|
|
234
|
-
clock:
|
|
300
|
+
label: L.value ? "Start" : "Time",
|
|
301
|
+
clock: N
|
|
235
302
|
}];
|
|
236
|
-
return
|
|
303
|
+
return L.value && e.push({
|
|
237
304
|
key: "end",
|
|
238
305
|
label: "End",
|
|
239
|
-
clock:
|
|
306
|
+
clock: P
|
|
240
307
|
}), e.map((e) => ({
|
|
241
308
|
...e,
|
|
242
|
-
spinners:
|
|
309
|
+
spinners: Cn(e.clock, e.label)
|
|
243
310
|
}));
|
|
244
|
-
}),
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
]),
|
|
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(() => {
|
|
249
316
|
if (y.mode === "duration") return y.label || "Choose duration";
|
|
250
|
-
let e =
|
|
317
|
+
let e = L.value ? "date range" : R.value ? "date and time" : "date";
|
|
251
318
|
return y.label ? `${y.label}: choose ${e}` : `Choose ${e}`;
|
|
252
|
-
}),
|
|
253
|
-
function
|
|
319
|
+
}), an = i(() => y.mode === "duration" ? _e : L.value ? pe : fe);
|
|
320
|
+
function on(e) {
|
|
254
321
|
return String(e).padStart(2, "0");
|
|
255
322
|
}
|
|
256
|
-
function
|
|
323
|
+
function G(e, t, n) {
|
|
257
324
|
let r = new Date(Date.UTC(e, t - 1, n));
|
|
258
|
-
return `${r.getUTCFullYear()}-${
|
|
325
|
+
return `${r.getUTCFullYear()}-${on(r.getUTCMonth() + 1)}-${on(r.getUTCDate())}`;
|
|
259
326
|
}
|
|
260
|
-
function
|
|
327
|
+
function K(e) {
|
|
261
328
|
let [t, n, r] = e.split("-").map(Number);
|
|
262
329
|
return {
|
|
263
330
|
y: t,
|
|
@@ -265,35 +332,39 @@ var ye = { class: "relative" }, be = [
|
|
|
265
332
|
d: r
|
|
266
333
|
};
|
|
267
334
|
}
|
|
268
|
-
function
|
|
269
|
-
let { y: t, m: n, d: r } =
|
|
335
|
+
function q(e) {
|
|
336
|
+
let { y: t, m: n, d: r } = K(e);
|
|
270
337
|
return new Date(Date.UTC(t, n - 1, r));
|
|
271
338
|
}
|
|
272
|
-
function
|
|
273
|
-
let { y: n, m: r, d: i } =
|
|
274
|
-
return
|
|
339
|
+
function J(e, t) {
|
|
340
|
+
let { y: n, m: r, d: i } = K(e);
|
|
341
|
+
return G(n, r, i + t);
|
|
275
342
|
}
|
|
276
|
-
function
|
|
277
|
-
let { y: n, m: r, d: i } =
|
|
278
|
-
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));
|
|
279
346
|
}
|
|
280
|
-
function
|
|
347
|
+
function Y(e) {
|
|
281
348
|
return `${e.slice(0, 7)}-01`;
|
|
282
349
|
}
|
|
283
|
-
function
|
|
284
|
-
|
|
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();
|
|
285
356
|
}
|
|
286
|
-
function
|
|
357
|
+
function un() {
|
|
287
358
|
try {
|
|
288
359
|
let e = new Intl.Locale(y.locale ?? navigator.language), t = (e.getWeekInfo?.() ?? e.weekInfo)?.firstDay;
|
|
289
360
|
if (t) return t % 7;
|
|
290
361
|
} catch {}
|
|
291
362
|
return 0;
|
|
292
363
|
}
|
|
293
|
-
function
|
|
294
|
-
let t =
|
|
364
|
+
function X(e) {
|
|
365
|
+
let t = St.get(I.value);
|
|
295
366
|
t || (t = new Intl.DateTimeFormat("en-US", {
|
|
296
|
-
timeZone:
|
|
367
|
+
timeZone: I.value,
|
|
297
368
|
hourCycle: "h23",
|
|
298
369
|
year: "numeric",
|
|
299
370
|
month: "2-digit",
|
|
@@ -301,53 +372,53 @@ var ye = { class: "relative" }, be = [
|
|
|
301
372
|
hour: "2-digit",
|
|
302
373
|
minute: "2-digit",
|
|
303
374
|
second: "2-digit"
|
|
304
|
-
}),
|
|
375
|
+
}), St.set(I.value, t));
|
|
305
376
|
let n = {};
|
|
306
377
|
for (let { type: r, value: i } of t.formatToParts(e)) r !== "literal" && (n[r] = Number(i));
|
|
307
378
|
return {
|
|
308
|
-
day:
|
|
379
|
+
day: G(n.year, n.month, n.day),
|
|
309
380
|
h: n.hour % 24,
|
|
310
381
|
m: n.minute,
|
|
311
382
|
s: n.second
|
|
312
383
|
};
|
|
313
384
|
}
|
|
314
|
-
function
|
|
315
|
-
let t =
|
|
385
|
+
function dn(e) {
|
|
386
|
+
let t = X(e), { y: n, m: r, d: i } = K(t.day);
|
|
316
387
|
return Date.UTC(n, r - 1, i, t.h, t.m, t.s) - Math.floor(e / 1e3) * 1e3;
|
|
317
388
|
}
|
|
318
|
-
function
|
|
319
|
-
let { y: i, m: a, d: o } =
|
|
320
|
-
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;
|
|
321
392
|
}
|
|
322
|
-
function
|
|
323
|
-
let t =
|
|
324
|
-
if (t) return
|
|
325
|
-
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);
|
|
326
397
|
let n = Date.parse(e);
|
|
327
398
|
return Number.isNaN(n) ? null : n;
|
|
328
399
|
}
|
|
329
|
-
function
|
|
330
|
-
if (
|
|
331
|
-
let t =
|
|
332
|
-
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;
|
|
333
404
|
}
|
|
334
|
-
function
|
|
405
|
+
function pn(e) {
|
|
335
406
|
return new Date(e).toISOString().replace(/\.000Z$/, "Z");
|
|
336
407
|
}
|
|
337
|
-
function
|
|
408
|
+
function mn(e) {
|
|
338
409
|
let t = e.replace(/\s+/g, "");
|
|
339
410
|
if (!t) return null;
|
|
340
411
|
if (t === "0") return 0;
|
|
341
412
|
let n = /(\d+(?:\.\d+)?)(ns|us|µs|ms|w|d|h|m|s)/y, r = 0, i = 0, a;
|
|
342
|
-
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;
|
|
343
414
|
return i === t.length ? r : null;
|
|
344
415
|
}
|
|
345
|
-
function
|
|
416
|
+
function hn(e) {
|
|
346
417
|
if (e <= 0) return null;
|
|
347
418
|
let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.round(e % 60);
|
|
348
419
|
return `${t ? `${t}h` : ""}${n ? `${n}m` : ""}${r ? `${r}s` : ""}` || null;
|
|
349
420
|
}
|
|
350
|
-
function
|
|
421
|
+
function gn(e) {
|
|
351
422
|
let t = Math.floor(e / 86400), n = Math.floor(e % 86400 / 3600), r = Math.floor(e % 3600 / 60), i = Math.round(e % 60);
|
|
352
423
|
return [
|
|
353
424
|
t && `${t}d`,
|
|
@@ -356,23 +427,26 @@ var ye = { class: "relative" }, be = [
|
|
|
356
427
|
i && `${i}s`
|
|
357
428
|
].filter(Boolean).join(" ") || "0m";
|
|
358
429
|
}
|
|
359
|
-
function
|
|
360
|
-
return
|
|
430
|
+
function _n(e) {
|
|
431
|
+
return z.value && e < z.value || B.value && e > B.value ? !0 : y.isDateDisabled?.(e) ?? !1;
|
|
432
|
+
}
|
|
433
|
+
function vn(e, t) {
|
|
434
|
+
return !!z.value && t < z.value || !!B.value && e > B.value;
|
|
361
435
|
}
|
|
362
|
-
function
|
|
363
|
-
return e ===
|
|
436
|
+
function yn(e) {
|
|
437
|
+
return e === j.value || L.value && e === (M.value ?? qt.value);
|
|
364
438
|
}
|
|
365
|
-
function
|
|
366
|
-
let t =
|
|
439
|
+
function bn(e) {
|
|
440
|
+
let t = j.value, n = qt.value;
|
|
367
441
|
if (!t || !n) return !1;
|
|
368
442
|
let [r, i] = t <= n ? [t, n] : [n, t];
|
|
369
443
|
return e >= r && e <= i;
|
|
370
444
|
}
|
|
371
|
-
function
|
|
372
|
-
let t =
|
|
373
|
-
return [e === r && "rounded-l-
|
|
445
|
+
function xn(e) {
|
|
446
|
+
let t = j.value, n = qt.value, [r, i] = t <= n ? [t, n] : [n, t];
|
|
447
|
+
return [e === r && "rounded-l-8", e === i && "rounded-r-8"];
|
|
374
448
|
}
|
|
375
|
-
function
|
|
449
|
+
function Sn(e, t, n, r, i, a, o, s) {
|
|
376
450
|
return {
|
|
377
451
|
key: e,
|
|
378
452
|
label: t,
|
|
@@ -384,407 +458,550 @@ var ye = { class: "relative" }, be = [
|
|
|
384
458
|
set: s
|
|
385
459
|
};
|
|
386
460
|
}
|
|
387
|
-
function
|
|
388
|
-
let n = [
|
|
389
|
-
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;
|
|
390
464
|
}
|
|
391
|
-
function
|
|
392
|
-
return e.padded ?
|
|
465
|
+
function wn(e) {
|
|
466
|
+
return e.padded ? on(e.get()) : String(e.get());
|
|
393
467
|
}
|
|
394
|
-
function
|
|
468
|
+
function Tn(e, t) {
|
|
395
469
|
let n = t.get(), r = t.max - t.min + 1, i = null;
|
|
396
|
-
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));
|
|
397
471
|
}
|
|
398
|
-
function
|
|
472
|
+
function En(e, t) {
|
|
399
473
|
let n = e.target, r = n.value.replace(/\D/g, "").slice(0, String(t.max).length);
|
|
400
474
|
if (n.value = r, !r) return;
|
|
401
475
|
let i = Number(r);
|
|
402
476
|
i > t.max && (i = Number(r.slice(-1))), t.set(Math.max(t.min, i));
|
|
403
477
|
}
|
|
404
|
-
function
|
|
405
|
-
e.target.value =
|
|
478
|
+
function Dn(e, t) {
|
|
479
|
+
e.target.value = wn(t);
|
|
406
480
|
}
|
|
407
|
-
function
|
|
408
|
-
if (
|
|
409
|
-
let e =
|
|
410
|
-
|
|
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);
|
|
411
485
|
return;
|
|
412
486
|
}
|
|
413
|
-
let [e, t] =
|
|
414
|
-
if (
|
|
487
|
+
let [e, t] = V.value;
|
|
488
|
+
if (j.value = null, M.value = null, Object.assign(N, {
|
|
415
489
|
h: 0,
|
|
416
490
|
m: 0,
|
|
417
491
|
s: 0
|
|
418
|
-
}), Object.assign(
|
|
492
|
+
}), Object.assign(P, {
|
|
419
493
|
h: 23,
|
|
420
494
|
m: 59,
|
|
421
495
|
s: y.showSeconds ? 59 : 0
|
|
422
|
-
}),
|
|
423
|
-
let n = e ?
|
|
496
|
+
}), R.value) {
|
|
497
|
+
let n = e ? Z(e) : null, r = t ? Z(t) : null;
|
|
424
498
|
if (n !== null) {
|
|
425
|
-
let e =
|
|
426
|
-
|
|
499
|
+
let e = X(n);
|
|
500
|
+
j.value = e.day, Object.assign(N, {
|
|
427
501
|
h: e.h,
|
|
428
502
|
m: e.m,
|
|
429
503
|
s: e.s
|
|
430
504
|
});
|
|
431
505
|
}
|
|
432
506
|
if (r !== null) {
|
|
433
|
-
let e =
|
|
434
|
-
|
|
507
|
+
let e = X(r);
|
|
508
|
+
M.value = e.day, Object.assign(P, {
|
|
435
509
|
h: e.h,
|
|
436
510
|
m: e.m,
|
|
437
511
|
s: e.s
|
|
438
512
|
});
|
|
439
513
|
}
|
|
440
|
-
} else
|
|
441
|
-
let n =
|
|
442
|
-
!
|
|
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);
|
|
443
517
|
}
|
|
444
|
-
function
|
|
445
|
-
let e =
|
|
518
|
+
function kn() {
|
|
519
|
+
let e = wt.value;
|
|
446
520
|
if (!e) return;
|
|
447
|
-
let t = e.getBoundingClientRect(), n =
|
|
448
|
-
|
|
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 ? {
|
|
449
523
|
bottom: window.innerHeight - t.top + 6,
|
|
450
524
|
left: s,
|
|
451
|
-
maxHeight: Math.max(200, a)
|
|
525
|
+
maxHeight: Math.max(200, a),
|
|
526
|
+
minWidth: c
|
|
452
527
|
} : {
|
|
453
528
|
top: t.bottom + 6,
|
|
454
529
|
left: s,
|
|
455
|
-
maxHeight: Math.max(200, i)
|
|
530
|
+
maxHeight: Math.max(200, i),
|
|
531
|
+
minWidth: c
|
|
456
532
|
};
|
|
457
533
|
}
|
|
458
|
-
function
|
|
534
|
+
function An() {
|
|
459
535
|
y.disabled || b.value || (b.value = !0);
|
|
460
536
|
}
|
|
461
|
-
function
|
|
462
|
-
b.value && (b.value = !1, e &&
|
|
537
|
+
function jn(e = !0) {
|
|
538
|
+
b.value && (b.value = !1, e && wt.value?.focus());
|
|
463
539
|
}
|
|
464
|
-
async function
|
|
465
|
-
|
|
540
|
+
async function Mn() {
|
|
541
|
+
On(), kn(), ar(), await f(), kn(), y.mode === "duration" ? S.value?.querySelector("input")?.focus() : Nn();
|
|
466
542
|
}
|
|
467
|
-
function
|
|
468
|
-
|
|
543
|
+
function Nn() {
|
|
544
|
+
f(() => S.value?.querySelector(`[data-day="${k.value}"]`)?.focus());
|
|
469
545
|
}
|
|
470
546
|
function $(e) {
|
|
471
|
-
|
|
547
|
+
st.value = e, jn();
|
|
472
548
|
}
|
|
473
|
-
function
|
|
474
|
-
if (!
|
|
475
|
-
if (
|
|
476
|
-
|
|
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);
|
|
477
553
|
return;
|
|
478
554
|
}
|
|
479
|
-
if (!
|
|
480
|
-
|
|
555
|
+
if (!j.value || M.value) {
|
|
556
|
+
j.value = e, M.value = null;
|
|
481
557
|
return;
|
|
482
558
|
}
|
|
483
|
-
e <
|
|
559
|
+
e < j.value ? (M.value = j.value, j.value = e) : M.value = e, A.value = null, R.value || $([j.value, M.value]);
|
|
484
560
|
}
|
|
485
561
|
}
|
|
486
|
-
function
|
|
487
|
-
if (
|
|
488
|
-
if (y.mode === "duration") return $(
|
|
489
|
-
if (!
|
|
490
|
-
$(
|
|
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));
|
|
491
567
|
}
|
|
492
568
|
}
|
|
493
|
-
function
|
|
494
|
-
let e =
|
|
495
|
-
|
|
569
|
+
function In() {
|
|
570
|
+
let e = X(Date.now());
|
|
571
|
+
j.value = e.day, Object.assign(N, {
|
|
496
572
|
h: e.h,
|
|
497
573
|
m: e.m,
|
|
498
574
|
s: y.showSeconds ? e.s : 0
|
|
499
|
-
}),
|
|
575
|
+
}), k.value = e.day, w.value = Y(e.day), T.value = "days", O.value === "time" && f(() => Xn("smooth"));
|
|
500
576
|
}
|
|
501
|
-
function
|
|
502
|
-
|
|
577
|
+
function Ln() {
|
|
578
|
+
Pn(Nt.value);
|
|
503
579
|
}
|
|
504
|
-
function
|
|
580
|
+
function Rn(e) {
|
|
505
581
|
if (e.value) return $(e.value());
|
|
506
582
|
if (!e.duration) return;
|
|
507
|
-
if (y.mode === "duration") return $(
|
|
508
|
-
let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (
|
|
509
|
-
if (y.mode === "date") return $(
|
|
510
|
-
$(
|
|
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));
|
|
511
587
|
}
|
|
512
|
-
function
|
|
513
|
-
|
|
588
|
+
function zn() {
|
|
589
|
+
st.value = null, wt.value?.focus();
|
|
514
590
|
}
|
|
515
|
-
function
|
|
516
|
-
|
|
591
|
+
function Bn(e) {
|
|
592
|
+
w.value = sn(w.value, e), k.value = sn(k.value, e);
|
|
517
593
|
}
|
|
518
|
-
function
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
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)
|
|
528
703
|
};
|
|
529
704
|
if (e.key === "Enter" || e.key === " ") {
|
|
530
|
-
e.preventDefault(),
|
|
705
|
+
e.preventDefault(), Pn(t);
|
|
531
706
|
return;
|
|
532
707
|
}
|
|
533
708
|
let i = r[e.key];
|
|
534
|
-
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());
|
|
535
710
|
}
|
|
536
|
-
function
|
|
711
|
+
function tr(e) {
|
|
537
712
|
if (e.key === "Escape") {
|
|
538
|
-
e.preventDefault(), e.stopPropagation(),
|
|
713
|
+
e.preventDefault(), e.stopPropagation(), jn();
|
|
539
714
|
return;
|
|
540
715
|
}
|
|
541
|
-
if (e.key !== "Tab" || !
|
|
542
|
-
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);
|
|
543
718
|
if (!t.length) return;
|
|
544
719
|
let n = t[0], r = t[t.length - 1];
|
|
545
720
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
546
721
|
}
|
|
547
|
-
function
|
|
548
|
-
(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());
|
|
549
724
|
}
|
|
550
|
-
function
|
|
725
|
+
function rr(e) {
|
|
551
726
|
let t = e.target;
|
|
552
|
-
|
|
727
|
+
Ct.value?.contains(t) || S.value?.contains(t) || jn(!1);
|
|
553
728
|
}
|
|
554
|
-
function
|
|
555
|
-
e &&
|
|
729
|
+
function ir(e) {
|
|
730
|
+
e?.target instanceof Node && S.value?.contains(e.target) || kn();
|
|
556
731
|
}
|
|
557
|
-
function
|
|
558
|
-
document.addEventListener("pointerdown",
|
|
732
|
+
function ar() {
|
|
733
|
+
document.addEventListener("pointerdown", rr, !0), window.addEventListener("scroll", ir, !0), window.addEventListener("resize", ir);
|
|
559
734
|
}
|
|
560
|
-
function
|
|
561
|
-
document.removeEventListener("pointerdown",
|
|
735
|
+
function or() {
|
|
736
|
+
document.removeEventListener("pointerdown", rr, !0), window.removeEventListener("scroll", ir, !0), window.removeEventListener("resize", ir);
|
|
562
737
|
}
|
|
563
|
-
return ue(b, (e) => e ?
|
|
564
|
-
b.value &&
|
|
565
|
-
}), 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({
|
|
566
741
|
ref_key: "root",
|
|
567
|
-
ref:
|
|
568
|
-
},
|
|
569
|
-
class: ["w-full",
|
|
742
|
+
ref: Ct
|
|
743
|
+
}, ht.value, {
|
|
744
|
+
class: ["w-full", u.disabled && "opacity-50"],
|
|
570
745
|
"data-ac-ds": "",
|
|
571
746
|
"data-testid": "ac-date-picker"
|
|
572
747
|
}), [
|
|
573
|
-
|
|
574
|
-
c("button", ee({
|
|
575
|
-
id: `${v(x)}-trigger`,
|
|
576
|
-
ref_key: "trigger",
|
|
577
|
-
ref: S
|
|
578
|
-
}, it.value, {
|
|
579
|
-
type: "button",
|
|
580
|
-
disabled: d.disabled,
|
|
581
|
-
"aria-haspopup": "dialog",
|
|
582
|
-
"aria-expanded": b.value,
|
|
583
|
-
"aria-labelledby": d.label ? `${at} ${ot}` : ot,
|
|
584
|
-
"aria-describedby": Pt.value,
|
|
585
|
-
"aria-invalid": !!d.errorMsg || void 0,
|
|
586
|
-
"aria-required": d.required || void 0,
|
|
587
|
-
class: ["flex w-full items-center rounded-6 border bg-surface pr-16 pl-3 text-left text-base text-heading shadow-xs transition-[border-color,box-shadow] duration-150 outline-none disabled:cursor-not-allowed disabled:bg-surface-muted", [
|
|
588
|
-
d.size === "small" ? "h-9" : "h-10",
|
|
589
|
-
d.disabled ? "" : "cursor-pointer",
|
|
590
|
-
d.errorMsg ? ["border-red-60", Mt.value && "border-danger shadow-[0_0_0_3px_var(--color-red-90)]"] : Mt.value ? "focus-ring" : "border-border hover:border-border-dark"
|
|
591
|
-
]],
|
|
592
|
-
onClick: f[0] ||= (e) => b.value ? Q() : rn(),
|
|
593
|
-
onKeydown: gn,
|
|
594
|
-
onFocus: f[1] ||= (e) => jt.value = !0,
|
|
595
|
-
onBlur: f[2] ||= (e) => jt.value = !1
|
|
596
|
-
}), [c("span", {
|
|
597
|
-
id: ot,
|
|
598
|
-
class: p(["truncate tabular-nums", !xt.value && "text-muted"])
|
|
599
|
-
}, _(xt.value || (d.label ? "" : d.placeholder || (d.mode === "duration" ? "Choose duration" : "Choose date"))), 3)], 16, be),
|
|
600
|
-
d.label ? (m(), s("label", {
|
|
601
|
-
key: 0,
|
|
602
|
-
id: at,
|
|
603
|
-
for: `${v(x)}-trigger`,
|
|
604
|
-
class: p(["pointer-events-none absolute left-2.5 rounded-2 px-1 transition-all duration-150 ease-out", [
|
|
605
|
-
d.disabled ? "bg-linear-to-b from-surface from-50% to-surface-muted to-50%" : "bg-surface",
|
|
606
|
-
Nt.value ? "top-0 -translate-y-1/2 text-xs font-medium" : "top-1/2 -translate-y-1/2 text-base text-muted",
|
|
607
|
-
Nt.value && (d.errorMsg ? "text-red-30" : Mt.value ? "text-primary-20" : "text-label")
|
|
608
|
-
]])
|
|
609
|
-
}, [l(_(d.label), 1), d.required ? (m(), s("span", Se, " *")) : o("", !0)], 10, xe)) : o("", !0),
|
|
610
|
-
c("span", Ce, [d.clearable && bt.value && !d.disabled ? (m(), s("button", {
|
|
611
|
-
key: 0,
|
|
612
|
-
type: "button",
|
|
613
|
-
class: "pointer-events-auto inline-flex size-6 cursor-pointer items-center justify-center rounded-4 transition hover:bg-surface-sunken hover:text-heading focus-visible:ring-[3px] focus-visible:ring-ring focus-visible:outline-none",
|
|
614
|
-
"aria-label": d.label ? `Clear ${d.label}` : "Clear",
|
|
615
|
-
onClick: fn
|
|
616
|
-
}, [u(v(ve), {
|
|
617
|
-
class: "size-3.5",
|
|
618
|
-
"aria-hidden": "true"
|
|
619
|
-
})], 8, we)) : o("", !0), (m(), a(oe(It.value), {
|
|
620
|
-
class: p(["mx-1 size-4", b.value && "text-heading"]),
|
|
621
|
-
"aria-hidden": "true"
|
|
622
|
-
}, null, 8, ["class"]))])
|
|
623
|
-
]),
|
|
624
|
-
d.errorMsg ? (m(), s("p", {
|
|
748
|
+
u.label ? (m(), s("label", {
|
|
625
749
|
key: 0,
|
|
626
|
-
id:
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
}), l(" " + _(d.errorMsg), 1)])) : d.hint ? (m(), s("p", {
|
|
750
|
+
id: _t,
|
|
751
|
+
for: `${v(x)}-trigger`,
|
|
752
|
+
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
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", {
|
|
632
755
|
key: 1,
|
|
633
|
-
id:
|
|
634
|
-
class: "
|
|
635
|
-
}, _(
|
|
636
|
-
|
|
756
|
+
id: xt,
|
|
757
|
+
class: "mb-2 text-base text-muted"
|
|
758
|
+
}, _(u.hint), 1)) : o("", !0),
|
|
759
|
+
c("div", xe, [c("button", te({
|
|
760
|
+
id: `${v(x)}-trigger`,
|
|
761
|
+
ref_key: "trigger",
|
|
762
|
+
ref: wt
|
|
763
|
+
}, gt.value, {
|
|
764
|
+
type: "button",
|
|
765
|
+
disabled: u.disabled,
|
|
766
|
+
"aria-haspopup": "dialog",
|
|
767
|
+
"aria-expanded": b.value,
|
|
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"]
|
|
777
|
+
]],
|
|
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
|
|
782
|
+
}), [c("span", {
|
|
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", {
|
|
786
|
+
key: 0,
|
|
787
|
+
type: "button",
|
|
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), {
|
|
792
|
+
class: "size-4",
|
|
793
|
+
"aria-hidden": "true"
|
|
794
|
+
})], 8, Ce)) : o("", !0), (m(), a(oe(an.value), {
|
|
795
|
+
class: p(["size-4", b.value && "text-heading"]),
|
|
796
|
+
"aria-hidden": "true"
|
|
797
|
+
}, null, 8, ["class"]))], 2)]),
|
|
798
|
+
u.errorMsg ? (m(), s("p", {
|
|
637
799
|
key: 2,
|
|
800
|
+
id: bt,
|
|
801
|
+
class: "mt-1 text-base text-danger-strong",
|
|
802
|
+
role: "alert"
|
|
803
|
+
}, _(u.errorMsg), 1)) : o("", !0),
|
|
804
|
+
u.name ? (m(), s("input", {
|
|
805
|
+
key: 3,
|
|
638
806
|
type: "hidden",
|
|
639
|
-
name:
|
|
640
|
-
value:
|
|
641
|
-
}, null, 8,
|
|
642
|
-
(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, {
|
|
643
811
|
"enter-active-class": "transition duration-150 ease-out motion-reduce:transition-opacity",
|
|
644
|
-
"enter-from-class": "opacity-0
|
|
812
|
+
"enter-from-class": "opacity-0 scale-95",
|
|
645
813
|
"leave-active-class": "transition duration-100 ease-in",
|
|
646
814
|
"leave-to-class": "opacity-0"
|
|
647
815
|
}, {
|
|
648
816
|
default: de(() => [b.value ? (m(), s("div", {
|
|
649
817
|
key: 0,
|
|
650
818
|
ref_key: "panel",
|
|
651
|
-
ref:
|
|
819
|
+
ref: S,
|
|
652
820
|
role: "dialog",
|
|
653
821
|
"aria-modal": "true",
|
|
654
|
-
"aria-label":
|
|
655
|
-
class: "ac-scrollbar fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col rounded-10 border border-border bg-surface shadow-
|
|
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",
|
|
656
824
|
style: ne({
|
|
657
|
-
top:
|
|
658
|
-
bottom:
|
|
659
|
-
left: `${
|
|
660
|
-
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`
|
|
661
830
|
}),
|
|
662
831
|
"data-ac-ds": "",
|
|
663
832
|
"data-testid": "ac-date-picker-panel",
|
|
664
|
-
onKeydown:
|
|
665
|
-
}, [
|
|
833
|
+
onKeydown: tr
|
|
834
|
+
}, [u.presets.length ? (m(), s("div", Ee, [(m(!0), s(t, null, g(u.presets, (e) => (m(), s("button", {
|
|
666
835
|
key: e.label,
|
|
667
836
|
type: "button",
|
|
668
|
-
class: "cursor-pointer rounded-
|
|
669
|
-
onClick: (t) =>
|
|
670
|
-
}, _(e.label), 9,
|
|
671
|
-
c("p",
|
|
672
|
-
c("p",
|
|
673
|
-
c("div",
|
|
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",
|
|
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", {
|
|
674
843
|
key: e.key,
|
|
675
844
|
class: "block"
|
|
676
|
-
}, [c("span",
|
|
845
|
+
}, [c("span", Me, _(e.label), 1), c("input", {
|
|
677
846
|
type: "text",
|
|
678
847
|
inputmode: "numeric",
|
|
679
848
|
role: "spinbutton",
|
|
680
849
|
autocomplete: "off",
|
|
681
|
-
value:
|
|
850
|
+
value: wn(e),
|
|
682
851
|
"aria-valuenow": e.get(),
|
|
683
852
|
"aria-valuemin": e.min,
|
|
684
853
|
"aria-valuemax": e.max,
|
|
685
|
-
class: "h-
|
|
686
|
-
onKeydown: (t) =>
|
|
687
|
-
onInput: (t) =>
|
|
688
|
-
onBlur: (t) =>
|
|
689
|
-
onFocus:
|
|
690
|
-
}, null, 40,
|
|
691
|
-
|
|
692
|
-
])) : (m(), s("div",
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
c("
|
|
719
|
-
role: "grid",
|
|
720
|
-
"aria-labelledby": st,
|
|
721
|
-
class: "border-collapse",
|
|
722
|
-
onKeydown: mn
|
|
723
|
-
}, [c("thead", null, [c("tr", null, [(m(!0), s(t, null, g(gt.value, (e) => (m(), s("th", {
|
|
724
|
-
key: e.long,
|
|
725
|
-
scope: "col",
|
|
726
|
-
abbr: e.long,
|
|
727
|
-
class: "h-8 w-9 text-center text-xs font-medium text-muted"
|
|
728
|
-
}, _(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", {
|
|
729
|
-
key: e,
|
|
730
|
-
role: "gridcell",
|
|
731
|
-
"aria-selected": qt(e) || Jt(e),
|
|
732
|
-
class: "p-0 py-0.5"
|
|
733
|
-
}, [c("div", { class: p(Jt(e) && ["bg-primary-95", ...Yt(e)]) }, [c("button", {
|
|
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",
|
|
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", {
|
|
734
888
|
type: "button",
|
|
735
|
-
"
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
"
|
|
757
|
-
"aria-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
class: "
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
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", {
|
|
768
985
|
key: 0,
|
|
769
986
|
type: "button",
|
|
770
|
-
class: "cursor-pointer rounded-
|
|
771
|
-
disabled:
|
|
772
|
-
onClick:
|
|
773
|
-
}, _(
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
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, {
|
|
777
994
|
title: "Cancel",
|
|
778
995
|
color: "white",
|
|
779
996
|
size: "small",
|
|
780
|
-
onClick:
|
|
781
|
-
}),
|
|
997
|
+
onClick: d[9] ||= (e) => jn()
|
|
998
|
+
}), l(e, {
|
|
782
999
|
title: "Apply",
|
|
783
1000
|
size: "small",
|
|
784
|
-
disabled: !
|
|
785
|
-
onClick:
|
|
1001
|
+
disabled: !Xt.value,
|
|
1002
|
+
onClick: Fn
|
|
786
1003
|
}, null, 8, ["disabled"])], 64)) : o("", !0)
|
|
787
|
-
])) : o("", !0)], 2)], 44,
|
|
1004
|
+
])) : o("", !0)], 2)], 44, Te)) : o("", !0)]),
|
|
788
1005
|
_: 1
|
|
789
1006
|
})]))
|
|
790
1007
|
], 16));
|