hys-ui 0.1.0 → 0.2.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/CHANGELOG.md +137 -1
- package/README.md +18 -6
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAlert/HysAlert.vue.js +14 -14
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
- package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -26
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +29 -28
- package/dist/components/HysCalendar/HysCalendar.vue.js +5 -84
- package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
- package/dist/components/HysCard/HysCard.vue.js +1 -1
- package/dist/components/HysCard/HysCard2.vue.js +177 -44
- package/dist/components/HysCascader/HysCascader.vue.js +5 -182
- package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
- package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
- package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +5 -39
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +200 -2
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +397 -390
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
- package/dist/components/HysDivider/HysDivider.vue.js +2 -2
- package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +55 -54
- package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
- package/dist/components/HysFileManager/HysFileManager2.vue.js +86 -2
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +580 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -69
- package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
- package/dist/components/HysGantt/HysGantt.vue.js +5 -264
- package/dist/components/HysGantt/HysGantt2.vue.js +1399 -2
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +468 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +89 -88
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +35 -35
- package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -70
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +41 -36
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +93 -91
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +101 -2
- package/dist/components/HysRadio/HysRadio.vue.js +7 -0
- package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +5 -40
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +205 -2
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +87 -67
- package/dist/components/HysSearch/HysSearch.vue.js +50 -38
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -58
- package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
- package/dist/components/HysSelect/HysSelect.vue.js +3 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +859 -164
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +48 -42
- package/dist/components/HysSteps/HysSteps.vue.js +2 -2
- package/dist/components/HysSteps/HysSteps2.vue.js +111 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +235 -42
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1471 -82
- package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
- package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
- package/dist/components/HysTabs/HysTabs.vue.js +2 -2
- package/dist/components/HysTabs/HysTabs2.vue.js +262 -66
- package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
- package/dist/components/HysTextarea/HysTextarea.vue.js +137 -66
- package/dist/components/HysToast/HysToast.vue.js +2 -2
- package/dist/components/HysToast/HysToast2.vue.js +121 -38
- package/dist/components/HysTour/HysTour.vue.js +47 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -207
- package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +641 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -129
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
- package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
- package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +97 -78
- package/dist/composables/autocomplete.js +50 -0
- package/dist/composables/avatar.js +57 -0
- package/dist/composables/calendar.js +96 -0
- package/dist/composables/cascader.js +79 -0
- package/dist/composables/choice.js +38 -0
- package/dist/composables/choiceModel.js +67 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/formContext.js +94 -3
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/rating.js +16 -0
- package/dist/composables/selectOptions.js +54 -0
- package/dist/composables/table.js +150 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/toastEscape.js +16 -0
- package/dist/composables/transfer.js +63 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useDialog.js +16 -16
- package/dist/composables/useFloating.js +98 -52
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysToast.js +148 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/config.js +18 -15
- package/dist/index.js +149 -136
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -29
- package/dist/types/components/HysCard/HysCard.vue.d.ts +57 -5
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +55 -27
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +8 -4
- package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +88 -4
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -33
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +4 -1
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +62 -17
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -14
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +65 -9
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
- package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
- package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
- package/dist/types/components/HysTour/HysTour.vue.d.ts +5 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -30
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
- package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
- package/dist/types/composables/autocomplete.d.ts +106 -0
- package/dist/types/composables/avatar.d.ts +70 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +192 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/datePicker.d.ts +247 -0
- package/dist/types/composables/formContext.d.ts +138 -8
- package/dist/types/composables/formLayout.d.ts +11 -0
- package/dist/types/composables/formValidation.d.ts +13 -0
- package/dist/types/composables/gantt.d.ts +68 -0
- package/dist/types/composables/ganttConflicts.d.ts +30 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/rating.d.ts +18 -0
- package/dist/types/composables/segmented.d.ts +15 -0
- package/dist/types/composables/selectOptions.d.ts +44 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +309 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/toastEscape.d.ts +1 -0
- package/dist/types/composables/transfer.d.ts +180 -0
- package/dist/types/composables/tree.d.ts +237 -0
- package/dist/types/composables/treeSelect.d.ts +167 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useFloating.d.ts +8 -5
- package/dist/types/composables/useGanttDependencies.d.ts +83 -0
- package/dist/types/composables/useGanttHistory.d.ts +42 -0
- package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
- package/dist/types/composables/useHysToast.d.ts +50 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/index.d.ts +38 -7
- package/package.json +47 -11
|
@@ -0,0 +1,807 @@
|
|
|
1
|
+
import { defineComponent as ua, useSlots as da, computed as p, useAttrs as ca, ref as K, useId as va, provide as fa, watch as Q, nextTick as L, onMounted as ya, onUpdated as pa, onActivated as ma, onDeactivated as ha, onBeforeUnmount as ba, openBlock as u, createElementBlock as c, mergeProps as j, unref as a, withModifiers as Ne, normalizeClass as We, Fragment as $, renderSlot as S, createCommentVNode as m, renderList as M, createTextVNode as V, toDisplayString as h, createElementVNode as P, createVNode as me, createBlock as z, resolveDynamicComponent as ka, Teleport as wa, createSlots as ga, withCtx as A, withDirectives as Ba, vShow as Ca, mergeDefaults as Sa } from "vue";
|
|
2
|
+
import { X as Pa, Clock3 as qe, CalendarDays as $a } from "lucide-vue-next";
|
|
3
|
+
import Y from "../HysButton/HysButton.vue.js";
|
|
4
|
+
import Da from "../HysSelect/HysSelect.vue.js";
|
|
5
|
+
import Ea from "./HysDatePickerPanel.vue.js";
|
|
6
|
+
import { useHysRootAttrs as Fa } from "../../config.js";
|
|
7
|
+
import { useHysFormItemContext as Ma, useHysControlState as Va, fieldKey as Ta } from "../../composables/formContext.js";
|
|
8
|
+
import { useFloating as za } from "../../composables/useFloating.js";
|
|
9
|
+
import { useChoiceNativeReset as Aa } from "../../composables/choiceModel.js";
|
|
10
|
+
import { useDatePicker as Na } from "../../composables/useDatePicker.js";
|
|
11
|
+
import { dateNative as Wa, datePickerDefaults as qa } from "../../composables/datePicker.js";
|
|
12
|
+
const Oa = ["data-status", "id", "role", "data-hys-ui-field-managed", "tabindex", "aria-label", "aria-required", "aria-invalid", "aria-disabled", "aria-describedby"], ja = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "hys-ui-date-prefix"
|
|
15
|
+
}, Ra = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "hys-ui-date-separator"
|
|
18
|
+
}, Ha = ["id", "value", "aria-label", "aria-expanded", "aria-controls", "aria-invalid", "aria-required", "aria-describedby", "disabled", "readonly", "placeholder", "onInput", "onKeydown", "onBlur"], Ia = ["id", "disabled", "aria-label", "aria-expanded", "aria-controls", "aria-invalid", "aria-required", "aria-disabled", "aria-describedby", "aria-readonly"], Ka = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "hys-ui-date-prefix"
|
|
21
|
+
}, La = { class: "hys-ui-date-icons" }, Ua = ["aria-label"], Xa = {
|
|
22
|
+
class: "hys-ui-date-suffix",
|
|
23
|
+
"aria-hidden": "true"
|
|
24
|
+
}, Ga = ["name", "value", "form", "disabled"], Ja = ["id"], Qa = ["id", "role", "aria-label"], Ya = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "hys-ui-date-popup-header"
|
|
27
|
+
}, Za = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "hys-ui-date-shortcuts"
|
|
30
|
+
}, xa = ["disabled", "onClick"], _a = {
|
|
31
|
+
key: 2,
|
|
32
|
+
class: "hys-ui-date-range-status"
|
|
33
|
+
}, et = ["disabled", "aria-pressed", "onClick"], at = {
|
|
34
|
+
class: "hys-ui-date-range-instruction",
|
|
35
|
+
role: "status"
|
|
36
|
+
}, tt = { class: "hys-ui-date-panels" }, lt = {
|
|
37
|
+
key: 3,
|
|
38
|
+
class: "hys-ui-date-time-area",
|
|
39
|
+
"data-hys-ui-form-internal": ""
|
|
40
|
+
}, ot = {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: "hys-ui-date-time-colon"
|
|
43
|
+
}, it = {
|
|
44
|
+
key: 4,
|
|
45
|
+
class: "hys-ui-date-partial"
|
|
46
|
+
}, nt = ["disabled", "onClick"], st = ["id"], rt = {
|
|
47
|
+
key: 6,
|
|
48
|
+
class: "hys-ui-date-footer"
|
|
49
|
+
}, ut = { class: "hys-ui-date-footer-shortcuts" }, dt = { class: "hys-ui-date-footer-actions" }, Bt = /* @__PURE__ */ ua({
|
|
50
|
+
inheritAttrs: !1,
|
|
51
|
+
__name: "HysDatePickerControl",
|
|
52
|
+
props: /* @__PURE__ */ Sa({
|
|
53
|
+
modelValue: {},
|
|
54
|
+
defaultValue: {},
|
|
55
|
+
clearValue: {},
|
|
56
|
+
type: {},
|
|
57
|
+
valueType: {},
|
|
58
|
+
valueFormat: {},
|
|
59
|
+
format: {},
|
|
60
|
+
inputFormats: {},
|
|
61
|
+
disabled: { type: [Boolean, Array] },
|
|
62
|
+
readonly: { type: Boolean },
|
|
63
|
+
size: {},
|
|
64
|
+
status: {},
|
|
65
|
+
bordered: { type: Boolean },
|
|
66
|
+
placeholder: {},
|
|
67
|
+
label: {},
|
|
68
|
+
ariaLabel: {},
|
|
69
|
+
name: {},
|
|
70
|
+
form: {},
|
|
71
|
+
autofocus: { type: Boolean },
|
|
72
|
+
min: {},
|
|
73
|
+
max: {},
|
|
74
|
+
disabledDate: { type: Function },
|
|
75
|
+
disabledTime: { type: Function },
|
|
76
|
+
firstDayOfWeek: {},
|
|
77
|
+
firstWeekContainsDate: {},
|
|
78
|
+
weekNumberFormatter: { type: Function },
|
|
79
|
+
disabledWeek: { type: Function },
|
|
80
|
+
weekValidation: {},
|
|
81
|
+
locale: {},
|
|
82
|
+
messages: {},
|
|
83
|
+
showWeekNumbers: { type: Boolean },
|
|
84
|
+
showAdjacentDays: { type: Boolean },
|
|
85
|
+
defaultPickerValue: {},
|
|
86
|
+
panelValue: {},
|
|
87
|
+
mode: {},
|
|
88
|
+
defaultMode: {},
|
|
89
|
+
shortcuts: {},
|
|
90
|
+
clearable: { type: Boolean },
|
|
91
|
+
editable: { type: Boolean },
|
|
92
|
+
inputReadonly: { type: Boolean },
|
|
93
|
+
showOnFocus: { type: Boolean },
|
|
94
|
+
showToday: { type: Boolean },
|
|
95
|
+
showNow: { type: Boolean },
|
|
96
|
+
showFooter: { type: Boolean },
|
|
97
|
+
showConfirm: { type: Boolean },
|
|
98
|
+
showTime: { type: Boolean },
|
|
99
|
+
defaultTime: {},
|
|
100
|
+
hourStep: {},
|
|
101
|
+
minuteStep: {},
|
|
102
|
+
secondStep: {},
|
|
103
|
+
showSeconds: { type: Boolean },
|
|
104
|
+
rangeSeparator: {},
|
|
105
|
+
startPlaceholder: {},
|
|
106
|
+
endPlaceholder: {},
|
|
107
|
+
allowEmpty: {},
|
|
108
|
+
singlePanel: { type: Boolean },
|
|
109
|
+
unlinkPanels: { type: Boolean },
|
|
110
|
+
minRangeDays: {},
|
|
111
|
+
maxRangeDays: {},
|
|
112
|
+
rangeValidation: {},
|
|
113
|
+
maxDates: {},
|
|
114
|
+
open: { type: Boolean },
|
|
115
|
+
defaultOpen: { type: Boolean },
|
|
116
|
+
inline: { type: Boolean },
|
|
117
|
+
placement: {},
|
|
118
|
+
appendTo: { type: [String, Boolean] },
|
|
119
|
+
popupWidth: {},
|
|
120
|
+
popupClass: {},
|
|
121
|
+
popupStyle: {},
|
|
122
|
+
validateEvent: { type: Boolean },
|
|
123
|
+
cellClassName: { type: Function },
|
|
124
|
+
range: { type: Boolean }
|
|
125
|
+
}, qa),
|
|
126
|
+
emits: [
|
|
127
|
+
"update:modelValue",
|
|
128
|
+
"change",
|
|
129
|
+
"value-change",
|
|
130
|
+
"update:open",
|
|
131
|
+
"visible-change",
|
|
132
|
+
"update:panelValue",
|
|
133
|
+
"update:mode",
|
|
134
|
+
"panelChange",
|
|
135
|
+
"calendarChange",
|
|
136
|
+
"clear",
|
|
137
|
+
"ok",
|
|
138
|
+
"invalid",
|
|
139
|
+
"focus",
|
|
140
|
+
"blur"
|
|
141
|
+
],
|
|
142
|
+
setup(s, { expose: Oe, emit: je }) {
|
|
143
|
+
const i = s, Re = da(), He = p(
|
|
144
|
+
() => ["prev-month", "next-month", "prev-year", "next-year"].filter(
|
|
145
|
+
(e) => !!Re[e]
|
|
146
|
+
)
|
|
147
|
+
), R = je, oe = ca(), he = Fa(), w = Ma(), B = Va({
|
|
148
|
+
get disabled() {
|
|
149
|
+
var e;
|
|
150
|
+
return typeof i.disabled == "boolean" ? i.disabled : !!((e = i.disabled) != null && e.every(Boolean));
|
|
151
|
+
},
|
|
152
|
+
get size() {
|
|
153
|
+
return i.size;
|
|
154
|
+
}
|
|
155
|
+
}), C = K(), Z = K(), U = K(), ie = /* @__PURE__ */ new Map(), N = K(!0), v = p(() => !!i.range), b = p(
|
|
156
|
+
() => !N.value || B.disabled.value || !!i.readonly
|
|
157
|
+
), T = va(), X = K(!1), H = K([]);
|
|
158
|
+
fa(Ta, void 0);
|
|
159
|
+
const o = Na(
|
|
160
|
+
i,
|
|
161
|
+
v,
|
|
162
|
+
b,
|
|
163
|
+
(e, ...t) => R(e, ...t),
|
|
164
|
+
() => {
|
|
165
|
+
i.validateEvent && w.validate("change");
|
|
166
|
+
}
|
|
167
|
+
), {
|
|
168
|
+
draft: k,
|
|
169
|
+
words: d,
|
|
170
|
+
current: ne,
|
|
171
|
+
selected: Ie,
|
|
172
|
+
view: se,
|
|
173
|
+
panels: be,
|
|
174
|
+
error: I,
|
|
175
|
+
time: x,
|
|
176
|
+
needsConfirm: W
|
|
177
|
+
} = o;
|
|
178
|
+
o.begin();
|
|
179
|
+
const re = p(
|
|
180
|
+
() => N.value && (i.inline || f.open.value)
|
|
181
|
+
), Ke = p(
|
|
182
|
+
() => C.value ? {
|
|
183
|
+
getBoundingClientRect: () => C.value.getBoundingClientRect(),
|
|
184
|
+
contains: (e) => C.value.contains(e),
|
|
185
|
+
focus: fe,
|
|
186
|
+
get isConnected() {
|
|
187
|
+
var e;
|
|
188
|
+
return !!((e = C.value) != null && e.isConnected);
|
|
189
|
+
}
|
|
190
|
+
} : void 0
|
|
191
|
+
);
|
|
192
|
+
let ue = !1, q = 0;
|
|
193
|
+
const f = za(Ke, U, {
|
|
194
|
+
get placement() {
|
|
195
|
+
return i.placement;
|
|
196
|
+
},
|
|
197
|
+
width: () => i.popupWidth,
|
|
198
|
+
requestOpen: (e, t) => (e || (ue = !!t), R("update:open", e), i.open === void 0 ? void 0 : !1)
|
|
199
|
+
}), ke = p(() => i.inline || f.open.value), de = p(
|
|
200
|
+
() => i.placeholder || (v.value ? `${i.startPlaceholder ?? d.value.start}${i.rangeSeparator}${i.endPlaceholder ?? d.value.end}` : d.value.empty)
|
|
201
|
+
), we = p(() => {
|
|
202
|
+
const e = o.describe();
|
|
203
|
+
return v.value ? e.some(Boolean) ? [
|
|
204
|
+
e[0] || i.startPlaceholder || d.value.start,
|
|
205
|
+
e[1] || i.endPlaceholder || d.value.end
|
|
206
|
+
].join(i.rangeSeparator) : "" : e.filter(Boolean).join("、");
|
|
207
|
+
}), ge = p(() => o.valid(k.value)), Le = p(
|
|
208
|
+
() => W.value && (v.value ? k.value.every(Boolean) : k.value.length) && !ge.value ? d.value.invalid : ""
|
|
209
|
+
), Be = p(() => I.value || Le.value), Ce = p(
|
|
210
|
+
() => i.clearable && !b.value && Ie.value.some((e, t) => e && !o.locked(t))
|
|
211
|
+
), G = p(() => String(oe.id ?? w.id.value ?? T)), J = p(
|
|
212
|
+
() => i.ariaLabel || i.label || w.label.value || de.value
|
|
213
|
+
), _ = p(
|
|
214
|
+
() => i.status ?? (w.error.value || I.value ? "error" : w.status.value)
|
|
215
|
+
), Ue = p(
|
|
216
|
+
() => i.inline ? {
|
|
217
|
+
...i.popupStyle,
|
|
218
|
+
position: "static",
|
|
219
|
+
width: "100%",
|
|
220
|
+
maxWidth: "100%",
|
|
221
|
+
boxShadow: "none"
|
|
222
|
+
} : {
|
|
223
|
+
...i.popupStyle,
|
|
224
|
+
...f.style.value,
|
|
225
|
+
width: i.popupWidth ?? (v.value && !i.singlePanel ? "576px" : "304px"),
|
|
226
|
+
maxWidth: "calc(100vw - 20px)",
|
|
227
|
+
maxHeight: "min(80dvh,calc(100dvh - 20px))"
|
|
228
|
+
}
|
|
229
|
+
), Se = p(() => v.value && !i.singlePanel ? 2 : 1), ce = /* @__PURE__ */ new Map(), ve = p(
|
|
230
|
+
() => k.value.map((e) => e ? Wa(e) : null)
|
|
231
|
+
), Xe = p(
|
|
232
|
+
() => v.value && o.stage.value === "end" ? o.preview.value : void 0
|
|
233
|
+
), Ge = () => Object.fromEntries(
|
|
234
|
+
Object.entries(oe).filter(
|
|
235
|
+
([e]) => e !== "id" && !e.startsWith("aria-")
|
|
236
|
+
)
|
|
237
|
+
), Pe = () => Object.fromEntries(
|
|
238
|
+
Object.entries(oe).filter(([e]) => e.startsWith("aria-"))
|
|
239
|
+
);
|
|
240
|
+
function Je(e, t) {
|
|
241
|
+
t instanceof HTMLInputElement ? ie.set(e, t) : ie.delete(e);
|
|
242
|
+
}
|
|
243
|
+
function g() {
|
|
244
|
+
if (H.value = o.describe(), v.value) for (; H.value.length < 2; ) H.value.push("");
|
|
245
|
+
}
|
|
246
|
+
function fe() {
|
|
247
|
+
var e;
|
|
248
|
+
B.disabled.value || (e = !i.inline && i.editable && !o.multiple.value ? ie.get(0) : Z.value ?? C.value) == null || e.focus();
|
|
249
|
+
}
|
|
250
|
+
async function $e() {
|
|
251
|
+
var e;
|
|
252
|
+
await L(), await ((e = ce.get(0)) == null ? void 0 : e.focus());
|
|
253
|
+
}
|
|
254
|
+
async function D(e = !0, t = !1) {
|
|
255
|
+
if (b.value) return !1;
|
|
256
|
+
const r = q, y = f.open.value;
|
|
257
|
+
return i.inline || await f.show(t), await L(), !re.value || r !== q ? !1 : (y || (o.begin(), g()), await L(), f.update(), e && await $e(), re.value);
|
|
258
|
+
}
|
|
259
|
+
function E(e = !1) {
|
|
260
|
+
i.inline || f.close(e);
|
|
261
|
+
}
|
|
262
|
+
function ee() {
|
|
263
|
+
o.begin(), g(), E(!0);
|
|
264
|
+
}
|
|
265
|
+
async function ae() {
|
|
266
|
+
const e = await o.clear();
|
|
267
|
+
return e && (g(), E(!0)), e;
|
|
268
|
+
}
|
|
269
|
+
async function te() {
|
|
270
|
+
const e = await o.confirm();
|
|
271
|
+
return e && (g(), E(!0)), e;
|
|
272
|
+
}
|
|
273
|
+
async function De(e) {
|
|
274
|
+
const t = q, r = await o.choose(e);
|
|
275
|
+
!N.value || t !== q || r && !W.value && !o.multiple.value && !i.inline && (g(), E(!0));
|
|
276
|
+
}
|
|
277
|
+
async function Qe(e) {
|
|
278
|
+
var t;
|
|
279
|
+
if (o.pickShortcut(e))
|
|
280
|
+
if (!W.value)
|
|
281
|
+
await o.request(o.encode(k.value), "shortcut") && (g(), E(!0));
|
|
282
|
+
else {
|
|
283
|
+
const r = (t = k.value.find(Boolean)) == null ? void 0 : t.day;
|
|
284
|
+
r !== void 0 && o.setPanel(r);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
async function Ee(e) {
|
|
288
|
+
if (i.inputReadonly || b.value) return !1;
|
|
289
|
+
const t = await o.input(H.value[e] ?? "", e);
|
|
290
|
+
return t && g(), t;
|
|
291
|
+
}
|
|
292
|
+
function ye(e, t = 0) {
|
|
293
|
+
e.isComposing || e.keyCode === 229 || (e.key === "ArrowDown" && !e.altKey ? (e.preventDefault(), D()) : e.key === "Enter" && i.editable ? (e.preventDefault(), Ee(t)) : e.key === "Escape" && ee());
|
|
294
|
+
}
|
|
295
|
+
function Fe(e) {
|
|
296
|
+
X.value || (X.value = !0, R("focus", e)), i.showOnFocus && !f.restoringFocus.value && !f.open.value && D(!1);
|
|
297
|
+
}
|
|
298
|
+
async function pe(e) {
|
|
299
|
+
var t, r;
|
|
300
|
+
await L(), !(!N.value || f.open.value || (t = C.value) != null && t.contains(document.activeElement) || (r = U.value) != null && r.contains(document.activeElement)) && X.value && (X.value = !1, R("blur", e), i.validateEvent && w.validate("blur"));
|
|
301
|
+
}
|
|
302
|
+
function Ye(e, t) {
|
|
303
|
+
var y, n;
|
|
304
|
+
const r = e.relatedTarget;
|
|
305
|
+
!((y = U.value) != null && y.contains(r)) && !((n = C.value) != null && n.contains(r)) && Ee(t), pe(e);
|
|
306
|
+
}
|
|
307
|
+
function Ze(e, t) {
|
|
308
|
+
b.value || o.setPanel(e, t);
|
|
309
|
+
}
|
|
310
|
+
async function xe(e) {
|
|
311
|
+
const t = o.boundary(e);
|
|
312
|
+
if (!t || !await D(!1)) return !1;
|
|
313
|
+
const r = o.setPanel(t.day);
|
|
314
|
+
return await L(), f.update(), r;
|
|
315
|
+
}
|
|
316
|
+
async function _e(e) {
|
|
317
|
+
const t = await o.setValue(e);
|
|
318
|
+
return t && (o.begin(), g()), t;
|
|
319
|
+
}
|
|
320
|
+
function Me(e = !1) {
|
|
321
|
+
const t = o.today.value;
|
|
322
|
+
if (e && x.value) {
|
|
323
|
+
if (k.value = [{ ...t }], v.value) return;
|
|
324
|
+
te();
|
|
325
|
+
} else De(t.day);
|
|
326
|
+
}
|
|
327
|
+
function ea(e) {
|
|
328
|
+
o.locked(e) || (o.stage.value = e ? "end" : "start");
|
|
329
|
+
}
|
|
330
|
+
function aa(e) {
|
|
331
|
+
var t;
|
|
332
|
+
!((t = i.allowEmpty) != null && t[e]) || o.locked(e) || b.value || (k.value = k.value.map((r, y) => y === e ? null : r), o.error.value = "");
|
|
333
|
+
}
|
|
334
|
+
function ta(e, t) {
|
|
335
|
+
const r = k.value[e];
|
|
336
|
+
if (!r) return [];
|
|
337
|
+
const y = Math.floor(r.second / 3600), n = Math.floor(r.second / 60) % 60, l = o.timeDisabled(r, e), O = t === "hour" ? i.hourStep : t === "minute" ? i.minuteStep : i.secondStep, Te = t === "hour" ? 24 : 60, sa = Math.max(
|
|
338
|
+
1,
|
|
339
|
+
Math.min(Te, Number.isFinite(O) ? Math.floor(O) : 1)
|
|
340
|
+
), ra = t === "hour" ? y : t === "minute" ? n : r.second % 60;
|
|
341
|
+
return Array.from({ length: Te }, (F, le) => le).filter((F) => F % sa === 0 || F === ra).map((F) => {
|
|
342
|
+
var le, ze, Ae;
|
|
343
|
+
return {
|
|
344
|
+
label: String(F).padStart(2, "0"),
|
|
345
|
+
value: F,
|
|
346
|
+
disabled: t === "hour" ? (le = l.hours) == null ? void 0 : le.includes(F) : t === "minute" ? (ze = l.minutes) == null ? void 0 : ze.call(l, y).includes(F) : (Ae = l.seconds) == null ? void 0 : Ae.call(l, y, n).includes(F)
|
|
347
|
+
};
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
function la(e, t) {
|
|
351
|
+
var y;
|
|
352
|
+
const r = ((y = k.value[e]) == null ? void 0 : y.second) ?? 0;
|
|
353
|
+
return t === 0 ? Math.floor(r / 3600) : t === 1 ? Math.floor(r / 60) % 60 : r % 60;
|
|
354
|
+
}
|
|
355
|
+
function oa(e, t, r) {
|
|
356
|
+
var l;
|
|
357
|
+
if (typeof r != "number") return;
|
|
358
|
+
const y = ((l = k.value[e]) == null ? void 0 : l.second) ?? 0, n = t === 0 ? r * 3600 + y % 3600 : t === 1 ? Math.floor(y / 3600) * 3600 + r * 60 + y % 60 : Math.floor(y / 60) * 60 + r;
|
|
359
|
+
o.setTime(e, n) && !W.value && o.request(o.encode(k.value), "time");
|
|
360
|
+
}
|
|
361
|
+
function ia(e) {
|
|
362
|
+
return e instanceof Date ? e.toISOString() : e == null ? "" : String(e);
|
|
363
|
+
}
|
|
364
|
+
const na = p(() => {
|
|
365
|
+
const e = ne.value;
|
|
366
|
+
return (Array.isArray(e) ? e : [e]).map((t, r) => ({
|
|
367
|
+
value: ia(t),
|
|
368
|
+
name: Array.isArray(i.name) ? i.name[r] : i.name
|
|
369
|
+
})).filter((t) => !!t.name);
|
|
370
|
+
});
|
|
371
|
+
Q(
|
|
372
|
+
() => i.open,
|
|
373
|
+
(e) => {
|
|
374
|
+
if (!(!N.value || i.inline))
|
|
375
|
+
if (e) D(!1, !0);
|
|
376
|
+
else {
|
|
377
|
+
const t = ue;
|
|
378
|
+
ue = !1, f.close(t, !0);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
), Q(f.open, (e) => {
|
|
382
|
+
R("visible-change", e), e || (q++, o.begin(), g());
|
|
383
|
+
}), Q(b, (e) => {
|
|
384
|
+
e && (q++, o.model.invalidate(), f.close(!1, !0), i.open && R("update:open", !1));
|
|
385
|
+
}), Q(
|
|
386
|
+
ne,
|
|
387
|
+
() => {
|
|
388
|
+
o.begin(), g();
|
|
389
|
+
},
|
|
390
|
+
{ deep: !0 }
|
|
391
|
+
), Q(
|
|
392
|
+
[be, se, () => i.singlePanel, () => i.popupWidth],
|
|
393
|
+
() => void L(() => f.update())
|
|
394
|
+
), Aa(
|
|
395
|
+
C,
|
|
396
|
+
() => {
|
|
397
|
+
o.model.reset(), o.begin(), g(), E();
|
|
398
|
+
},
|
|
399
|
+
g,
|
|
400
|
+
() => i.form
|
|
401
|
+
), g(), ya(() => {
|
|
402
|
+
(i.open ?? i.defaultOpen) && D(!1, !0), i.autofocus && fe();
|
|
403
|
+
}), pa(() => {
|
|
404
|
+
!i.editable && w.id.value && Z.value && (Z.value.id = G.value);
|
|
405
|
+
}), ma(() => {
|
|
406
|
+
N.value = !0, i.open && !i.inline && D(!1, !0);
|
|
407
|
+
});
|
|
408
|
+
function Ve() {
|
|
409
|
+
N.value = !1, q++, X.value = !1, f.close(!1, !0), o.error.value = "";
|
|
410
|
+
}
|
|
411
|
+
return ha(Ve), ba(Ve), Oe({
|
|
412
|
+
element: C,
|
|
413
|
+
open: re,
|
|
414
|
+
value: ne,
|
|
415
|
+
draft: ve,
|
|
416
|
+
focus: fe,
|
|
417
|
+
blur: () => {
|
|
418
|
+
var e, t, r;
|
|
419
|
+
E(), ((e = C.value) != null && e.contains(document.activeElement) || (t = U.value) != null && t.contains(document.activeElement)) && ((r = document.activeElement) == null || r.blur());
|
|
420
|
+
},
|
|
421
|
+
show: () => D(),
|
|
422
|
+
hide: E,
|
|
423
|
+
handleOpen: () => D(),
|
|
424
|
+
handleClose: E,
|
|
425
|
+
clear: ae,
|
|
426
|
+
setValue: _e,
|
|
427
|
+
confirm: te,
|
|
428
|
+
cancel: ee,
|
|
429
|
+
showMonth: xe,
|
|
430
|
+
setMode: (e) => !b.value && o.setMode(e)
|
|
431
|
+
}), (e, t) => {
|
|
432
|
+
var r, y;
|
|
433
|
+
return u(), c("div", j({
|
|
434
|
+
ref_key: "root",
|
|
435
|
+
ref: C
|
|
436
|
+
}, { ...a(he), ...Ge() }, {
|
|
437
|
+
class: ["hys-ui-pf-date-picker hys-ui-date-picker", [
|
|
438
|
+
"hys-ui-date-picker-" + a(B).size.value,
|
|
439
|
+
{
|
|
440
|
+
"hys-ui-date-picker-disabled": a(B).disabled.value,
|
|
441
|
+
"hys-ui-date-picker-readonly": s.readonly,
|
|
442
|
+
"hys-ui-date-picker-borderless": !s.bordered
|
|
443
|
+
}
|
|
444
|
+
]],
|
|
445
|
+
"data-status": _.value,
|
|
446
|
+
id: s.inline ? G.value : void 0,
|
|
447
|
+
role: s.inline ? "group" : void 0,
|
|
448
|
+
"data-hys-ui-field-managed": s.inline ? "" : void 0,
|
|
449
|
+
tabindex: s.inline ? a(B).disabled.value ? -1 : 0 : void 0,
|
|
450
|
+
"aria-label": s.inline ? J.value : void 0,
|
|
451
|
+
"aria-required": s.inline && a(w).required.value || void 0,
|
|
452
|
+
"aria-invalid": s.inline && _.value === "error" || void 0,
|
|
453
|
+
"aria-disabled": s.inline && a(B).disabled.value || void 0,
|
|
454
|
+
"aria-describedby": s.inline ? a(w).describedBy.value : void 0,
|
|
455
|
+
onFocus: t[6] || (t[6] = Ne((n) => s.inline && $e(), ["self"])),
|
|
456
|
+
onKeydown: t[7] || (t[7] = (n) => s.inline && n.target === C.value && ye(n)),
|
|
457
|
+
onFocusin: Fe,
|
|
458
|
+
onFocusout: pe
|
|
459
|
+
}), [
|
|
460
|
+
s.inline ? m("", !0) : (u(), c("div", {
|
|
461
|
+
key: 0,
|
|
462
|
+
class: We(["hys-ui-date-control", {
|
|
463
|
+
"hys-ui-date-control-open": a(f).open.value,
|
|
464
|
+
"hys-ui-date-control-editable": s.editable && !a(o).multiple.value
|
|
465
|
+
}])
|
|
466
|
+
}, [
|
|
467
|
+
s.editable && !a(o).multiple.value ? (u(), c($, { key: 0 }, [
|
|
468
|
+
e.$slots.prefix ? (u(), c("span", ja, [
|
|
469
|
+
S(e.$slots, "prefix", {}, void 0, !0)
|
|
470
|
+
])) : m("", !0),
|
|
471
|
+
(u(!0), c($, null, M(v.value ? 2 : 1, (n) => (u(), c($, { key: n }, [
|
|
472
|
+
n === 2 ? (u(), c("span", Ra, [
|
|
473
|
+
S(e.$slots, "range-separator", {}, () => [
|
|
474
|
+
V(h(s.rangeSeparator), 1)
|
|
475
|
+
], !0)
|
|
476
|
+
])) : m("", !0),
|
|
477
|
+
P("input", j({
|
|
478
|
+
ref_for: !0,
|
|
479
|
+
ref: (l) => Je(n - 1, l)
|
|
480
|
+
}, { ref_for: !0 }, Pe(), {
|
|
481
|
+
id: n === 1 ? G.value : G.value + "-end",
|
|
482
|
+
"data-hys-ui-field-managed": "",
|
|
483
|
+
class: "hys-ui-date-input",
|
|
484
|
+
type: "text",
|
|
485
|
+
autocomplete: "off",
|
|
486
|
+
value: H.value[n - 1] ?? "",
|
|
487
|
+
"aria-label": v.value ? J.value + " " + (n === 1 ? a(d).start : a(d).end) : J.value,
|
|
488
|
+
"aria-haspopup": "dialog",
|
|
489
|
+
"aria-expanded": a(f).open.value,
|
|
490
|
+
"aria-controls": a(f).open.value ? a(T) + "-panel" : void 0,
|
|
491
|
+
"aria-invalid": _.value === "error" || void 0,
|
|
492
|
+
"aria-required": a(w).required.value || void 0,
|
|
493
|
+
"aria-describedby": [a(w).describedBy.value, a(I) ? a(T) + "-error" : void 0].filter(Boolean).join(" ") || void 0,
|
|
494
|
+
disabled: a(B).disabled.value || a(o).locked(n - 1),
|
|
495
|
+
readonly: s.readonly || s.inputReadonly,
|
|
496
|
+
placeholder: v.value ? n === 1 ? s.startPlaceholder ?? a(d).start : s.endPlaceholder ?? a(d).end : de.value,
|
|
497
|
+
onInput: (l) => H.value[n - 1] = l.target.value,
|
|
498
|
+
onClick: t[0] || (t[0] = (l) => D(!1)),
|
|
499
|
+
onKeydown: (l) => ye(l, n - 1),
|
|
500
|
+
onBlur: (l) => Ye(l, n - 1)
|
|
501
|
+
}), null, 16, Ha)
|
|
502
|
+
], 64))), 128))
|
|
503
|
+
], 64)) : (u(), c("button", j({
|
|
504
|
+
key: 1,
|
|
505
|
+
ref_key: "button",
|
|
506
|
+
ref: Z
|
|
507
|
+
}, Pe(), {
|
|
508
|
+
id: G.value,
|
|
509
|
+
type: "button",
|
|
510
|
+
"data-hys-ui-field-managed": "",
|
|
511
|
+
role: "combobox",
|
|
512
|
+
class: "hys-ui-date-trigger",
|
|
513
|
+
disabled: a(B).disabled.value,
|
|
514
|
+
"aria-label": J.value,
|
|
515
|
+
"aria-haspopup": "dialog",
|
|
516
|
+
"aria-expanded": a(f).open.value,
|
|
517
|
+
"aria-controls": a(f).open.value ? a(T) + "-panel" : void 0,
|
|
518
|
+
"aria-invalid": _.value === "error" || void 0,
|
|
519
|
+
"aria-required": a(w).required.value || void 0,
|
|
520
|
+
"aria-disabled": a(B).disabled.value || void 0,
|
|
521
|
+
"aria-describedby": [a(w).describedBy.value, a(I) ? a(T) + "-error" : void 0].filter(Boolean).join(" ") || void 0,
|
|
522
|
+
"aria-readonly": s.readonly || void 0,
|
|
523
|
+
onClick: t[1] || (t[1] = (n) => a(f).open.value ? E() : D()),
|
|
524
|
+
onKeydown: ye
|
|
525
|
+
}), [
|
|
526
|
+
e.$slots.prefix ? (u(), c("span", Ka, [
|
|
527
|
+
S(e.$slots, "prefix", {}, void 0, !0)
|
|
528
|
+
])) : m("", !0),
|
|
529
|
+
P("span", {
|
|
530
|
+
class: We(["hys-ui-date-display", { "hys-ui-pf-placeholder": !we.value }])
|
|
531
|
+
}, h(we.value || de.value), 3)
|
|
532
|
+
], 16, Ia)),
|
|
533
|
+
P("span", La, [
|
|
534
|
+
Ce.value ? (u(), c("button", {
|
|
535
|
+
key: 0,
|
|
536
|
+
type: "button",
|
|
537
|
+
class: "hys-ui-date-clear",
|
|
538
|
+
"aria-label": a(d).clear,
|
|
539
|
+
onMousedown: t[2] || (t[2] = Ne(() => {
|
|
540
|
+
}, ["prevent"])),
|
|
541
|
+
onClick: ae
|
|
542
|
+
}, [
|
|
543
|
+
S(e.$slots, "clear-icon", {}, () => [
|
|
544
|
+
me(a(Pa), { size: 14 })
|
|
545
|
+
], !0)
|
|
546
|
+
], 40, Ua)) : m("", !0),
|
|
547
|
+
P("span", Xa, [
|
|
548
|
+
S(e.$slots, "suffix", {}, () => [
|
|
549
|
+
(u(), z(ka(a(x) ? a(qe) : a($a)), { size: 16 }))
|
|
550
|
+
], !0)
|
|
551
|
+
])
|
|
552
|
+
])
|
|
553
|
+
], 2)),
|
|
554
|
+
(u(!0), c($, null, M(na.value, (n, l) => (u(), c("input", {
|
|
555
|
+
key: l,
|
|
556
|
+
type: "hidden",
|
|
557
|
+
name: n.name,
|
|
558
|
+
value: n.value,
|
|
559
|
+
form: s.form,
|
|
560
|
+
disabled: a(B).disabled.value
|
|
561
|
+
}, null, 8, Ga))), 128)),
|
|
562
|
+
a(I) && !ke.value ? (u(), c("p", {
|
|
563
|
+
key: 1,
|
|
564
|
+
id: a(T) + "-error",
|
|
565
|
+
class: "hys-ui-date-error",
|
|
566
|
+
role: "alert"
|
|
567
|
+
}, h(a(I)), 9, Ja)) : m("", !0),
|
|
568
|
+
(u(), z(wa, {
|
|
569
|
+
to: s.appendTo || "body",
|
|
570
|
+
disabled: s.inline || s.appendTo === !1
|
|
571
|
+
}, [
|
|
572
|
+
ke.value ? (u(), c("div", j({
|
|
573
|
+
key: 0,
|
|
574
|
+
id: a(T) + "-panel",
|
|
575
|
+
ref_key: "panel",
|
|
576
|
+
ref: U
|
|
577
|
+
}, a(he), {
|
|
578
|
+
class: ["hys-ui-date-popup", [
|
|
579
|
+
s.popupClass,
|
|
580
|
+
"hys-ui-date-popup-" + a(B).size.value,
|
|
581
|
+
{
|
|
582
|
+
"hys-ui-date-inline": s.inline,
|
|
583
|
+
"hys-ui-date-dual": Se.value === 2
|
|
584
|
+
}
|
|
585
|
+
]],
|
|
586
|
+
style: Ue.value,
|
|
587
|
+
role: s.inline ? "group" : "dialog",
|
|
588
|
+
"aria-label": J.value,
|
|
589
|
+
onFocusin: Fe,
|
|
590
|
+
onFocusout: pe
|
|
591
|
+
}), [
|
|
592
|
+
e.$slots.header ? (u(), c("header", Ya, [
|
|
593
|
+
S(e.$slots, "header", {
|
|
594
|
+
dates: ve.value,
|
|
595
|
+
view: a(se)
|
|
596
|
+
}, void 0, !0)
|
|
597
|
+
])) : m("", !0),
|
|
598
|
+
(r = s.shortcuts) != null && r.length ? (u(), c("div", Za, [
|
|
599
|
+
(u(!0), c($, null, M(s.shortcuts, (n, l) => (u(), c("button", {
|
|
600
|
+
key: l,
|
|
601
|
+
type: "button",
|
|
602
|
+
disabled: b.value || n.disabled,
|
|
603
|
+
onClick: (O) => Qe(l)
|
|
604
|
+
}, [
|
|
605
|
+
S(e.$slots, "shortcut", {
|
|
606
|
+
shortcut: n,
|
|
607
|
+
index: l
|
|
608
|
+
}, () => [
|
|
609
|
+
V(h(n.label), 1)
|
|
610
|
+
], !0)
|
|
611
|
+
], 8, xa))), 128))
|
|
612
|
+
])) : m("", !0),
|
|
613
|
+
v.value ? (u(), c("div", _a, [
|
|
614
|
+
(u(!0), c($, null, M([a(d).start, a(d).end], (n, l) => (u(), c("button", {
|
|
615
|
+
key: l,
|
|
616
|
+
type: "button",
|
|
617
|
+
disabled: b.value || a(o).locked(l),
|
|
618
|
+
"aria-pressed": a(o).stage.value === (l ? "end" : "start"),
|
|
619
|
+
onClick: (O) => ea(l)
|
|
620
|
+
}, [
|
|
621
|
+
P("span", null, h(n), 1),
|
|
622
|
+
P("strong", null, h(a(o).describe(a(k))[l] || "—"), 1)
|
|
623
|
+
], 8, et))), 128)),
|
|
624
|
+
P("span", at, h(a(o).stage.value === "end" ? a(d).chooseEnd : a(d).chooseStart), 1)
|
|
625
|
+
])) : m("", !0),
|
|
626
|
+
P("div", tt, [
|
|
627
|
+
(u(!0), c($, null, M(Se.value, (n) => (u(), z(Ea, {
|
|
628
|
+
key: n,
|
|
629
|
+
ref_for: !0,
|
|
630
|
+
ref: (l) => {
|
|
631
|
+
l ? a(ce).set(n - 1, l) : a(ce).delete(n - 1);
|
|
632
|
+
},
|
|
633
|
+
month: a(be)[n - 1],
|
|
634
|
+
view: n === 1 ? a(se) : a(o).rightView.value,
|
|
635
|
+
unit: a(o).unit.value,
|
|
636
|
+
selected: a(k),
|
|
637
|
+
range: v.value,
|
|
638
|
+
preview: Xe.value,
|
|
639
|
+
first: a(o).first.value,
|
|
640
|
+
"week-contains": a(o).weekContains.value,
|
|
641
|
+
"week-number-formatter": s.weekNumberFormatter,
|
|
642
|
+
locale: s.locale,
|
|
643
|
+
words: a(d),
|
|
644
|
+
"week-numbers": !!s.showWeekNumbers || a(o).unit.value === "week",
|
|
645
|
+
adjacent: s.showAdjacentDays,
|
|
646
|
+
disabled: b.value,
|
|
647
|
+
available: (l) => a(o).available(
|
|
648
|
+
l,
|
|
649
|
+
v.value && a(o).stage.value === "end" ? 1 : 0
|
|
650
|
+
),
|
|
651
|
+
"period-available": a(o).periodAvailable,
|
|
652
|
+
"cell-class-name": s.cellClassName,
|
|
653
|
+
onBrowse: (l) => Ze(l, n - 1),
|
|
654
|
+
onMode: (l) => a(o).setMode(l, n - 1),
|
|
655
|
+
onPick: De,
|
|
656
|
+
onPreview: t[3] || (t[3] = (l) => a(o).preview.value = l)
|
|
657
|
+
}, ga({
|
|
658
|
+
cell: A((l) => [
|
|
659
|
+
S(e.$slots, "cell", j({ ref_for: !0 }, l), () => [
|
|
660
|
+
S(e.$slots, "default", j({ ref_for: !0 }, l), () => [
|
|
661
|
+
V(h(l.text), 1)
|
|
662
|
+
], !0)
|
|
663
|
+
], !0)
|
|
664
|
+
]),
|
|
665
|
+
_: 2
|
|
666
|
+
}, [
|
|
667
|
+
e.$slots["week-number"] ? {
|
|
668
|
+
name: "week-number",
|
|
669
|
+
fn: A((l) => [
|
|
670
|
+
S(e.$slots, "week-number", j({ ref_for: !0 }, l), void 0, !0)
|
|
671
|
+
]),
|
|
672
|
+
key: "0"
|
|
673
|
+
} : void 0,
|
|
674
|
+
M(He.value, (l) => ({
|
|
675
|
+
name: l,
|
|
676
|
+
fn: A(() => [
|
|
677
|
+
S(e.$slots, l, {}, void 0, !0)
|
|
678
|
+
])
|
|
679
|
+
}))
|
|
680
|
+
]), 1032, ["month", "view", "unit", "selected", "range", "preview", "first", "week-contains", "week-number-formatter", "locale", "words", "week-numbers", "adjacent", "disabled", "available", "period-available", "cell-class-name", "onBrowse", "onMode"]))), 128))
|
|
681
|
+
]),
|
|
682
|
+
a(x) ? (u(), c("div", lt, [
|
|
683
|
+
(u(!0), c($, null, M(v.value ? 2 : 1, (n) => (u(), c("div", {
|
|
684
|
+
key: n,
|
|
685
|
+
class: "hys-ui-date-time-row"
|
|
686
|
+
}, [
|
|
687
|
+
P("span", null, [
|
|
688
|
+
V(h(v.value ? n === 1 ? a(d).start : a(d).end : ""), 1),
|
|
689
|
+
v.value ? m("", !0) : (u(), z(a(qe), {
|
|
690
|
+
key: 0,
|
|
691
|
+
size: 14
|
|
692
|
+
}))
|
|
693
|
+
]),
|
|
694
|
+
(u(!0), c($, null, M(s.showSeconds ? 3 : 2, (l) => (u(), c($, { key: l }, [
|
|
695
|
+
l > 1 ? (u(), c("span", ot, ":")) : m("", !0),
|
|
696
|
+
me(Da, {
|
|
697
|
+
"model-value": la(n - 1, l - 1),
|
|
698
|
+
options: ta(
|
|
699
|
+
n - 1,
|
|
700
|
+
l === 1 ? "hour" : l === 2 ? "minute" : "second"
|
|
701
|
+
),
|
|
702
|
+
disabled: b.value || a(o).locked(n - 1) || !a(k)[n - 1],
|
|
703
|
+
size: a(B).size.value,
|
|
704
|
+
"aria-label": (v.value ? (n === 1 ? a(d).start : a(d).end) + " " : "") + (l === 1 ? a(d).hour : l === 2 ? a(d).minute : a(d).second),
|
|
705
|
+
"popup-match-width": !1,
|
|
706
|
+
"onUpdate:modelValue": (O) => oa(n - 1, l - 1, O)
|
|
707
|
+
}, null, 8, ["model-value", "options", "disabled", "size", "aria-label", "onUpdate:modelValue"])
|
|
708
|
+
], 64))), 128))
|
|
709
|
+
]))), 128))
|
|
710
|
+
])) : m("", !0),
|
|
711
|
+
v.value && ((y = s.allowEmpty) != null && y.some(Boolean)) ? (u(), c("div", it, [
|
|
712
|
+
(u(), c($, null, M(2, (n) => {
|
|
713
|
+
var l;
|
|
714
|
+
return Ba(P("button", {
|
|
715
|
+
key: n,
|
|
716
|
+
type: "button",
|
|
717
|
+
disabled: b.value || a(o).locked(n - 1),
|
|
718
|
+
onClick: (O) => aa(n - 1)
|
|
719
|
+
}, h(a(d).clear) + " " + h(n === 1 ? a(d).start : a(d).end), 9, nt), [
|
|
720
|
+
[Ca, (l = s.allowEmpty) == null ? void 0 : l[n - 1]]
|
|
721
|
+
]);
|
|
722
|
+
}), 64))
|
|
723
|
+
])) : m("", !0),
|
|
724
|
+
Be.value ? (u(), c("p", {
|
|
725
|
+
key: 5,
|
|
726
|
+
id: a(T) + "-error",
|
|
727
|
+
class: "hys-ui-date-error hys-ui-date-popup-error",
|
|
728
|
+
role: "alert"
|
|
729
|
+
}, h(Be.value), 9, st)) : m("", !0),
|
|
730
|
+
e.$slots.footer || s.showFooter || a(W) ? (u(), c("footer", rt, [
|
|
731
|
+
S(e.$slots, "footer", {
|
|
732
|
+
dates: ve.value,
|
|
733
|
+
confirm: te,
|
|
734
|
+
cancel: ee,
|
|
735
|
+
clear: ae
|
|
736
|
+
}, () => [
|
|
737
|
+
P("div", ut, [
|
|
738
|
+
s.showToday && !v.value ? (u(), z(Y, {
|
|
739
|
+
key: 0,
|
|
740
|
+
size: "sm",
|
|
741
|
+
variant: "ghost",
|
|
742
|
+
disabled: b.value || !a(o).available(a(o).today.value.day),
|
|
743
|
+
onClick: t[4] || (t[4] = (n) => Me(!1))
|
|
744
|
+
}, {
|
|
745
|
+
default: A(() => [
|
|
746
|
+
V(h(a(d).today), 1)
|
|
747
|
+
]),
|
|
748
|
+
_: 1
|
|
749
|
+
}, 8, ["disabled"])) : m("", !0),
|
|
750
|
+
a(x) && s.showNow && !v.value ? (u(), z(Y, {
|
|
751
|
+
key: 1,
|
|
752
|
+
size: "sm",
|
|
753
|
+
variant: "ghost",
|
|
754
|
+
disabled: b.value,
|
|
755
|
+
onClick: t[5] || (t[5] = (n) => Me(!0))
|
|
756
|
+
}, {
|
|
757
|
+
default: A(() => [
|
|
758
|
+
V(h(a(d).now), 1)
|
|
759
|
+
]),
|
|
760
|
+
_: 1
|
|
761
|
+
}, 8, ["disabled"])) : m("", !0),
|
|
762
|
+
Ce.value ? (u(), z(Y, {
|
|
763
|
+
key: 2,
|
|
764
|
+
size: "sm",
|
|
765
|
+
variant: "ghost",
|
|
766
|
+
onClick: ae
|
|
767
|
+
}, {
|
|
768
|
+
default: A(() => [
|
|
769
|
+
V(h(a(d).clear), 1)
|
|
770
|
+
]),
|
|
771
|
+
_: 1
|
|
772
|
+
})) : m("", !0)
|
|
773
|
+
]),
|
|
774
|
+
P("div", dt, [
|
|
775
|
+
me(Y, {
|
|
776
|
+
size: "sm",
|
|
777
|
+
variant: "ghost",
|
|
778
|
+
onClick: ee
|
|
779
|
+
}, {
|
|
780
|
+
default: A(() => [
|
|
781
|
+
V(h(a(W) || v.value ? a(d).cancel : a(d).close), 1)
|
|
782
|
+
]),
|
|
783
|
+
_: 1
|
|
784
|
+
}),
|
|
785
|
+
a(W) ? (u(), z(Y, {
|
|
786
|
+
key: 0,
|
|
787
|
+
size: "sm",
|
|
788
|
+
disabled: b.value || !ge.value,
|
|
789
|
+
onClick: te
|
|
790
|
+
}, {
|
|
791
|
+
default: A(() => [
|
|
792
|
+
V(h(a(d).confirm), 1)
|
|
793
|
+
]),
|
|
794
|
+
_: 1
|
|
795
|
+
}, 8, ["disabled"])) : m("", !0)
|
|
796
|
+
])
|
|
797
|
+
], !0)
|
|
798
|
+
])) : m("", !0)
|
|
799
|
+
], 16, Qa)) : m("", !0)
|
|
800
|
+
], 8, ["to", "disabled"]))
|
|
801
|
+
], 16, Oa);
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
export {
|
|
806
|
+
Bt as default
|
|
807
|
+
};
|