hys-ui 0.1.1 → 0.3.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 +149 -0
- package/README.md +17 -1
- 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 +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +639 -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 +256 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -27
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +288 -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 -92
- package/dist/components/HysCalendar/HysCalendar2.vue.js +815 -2
- package/dist/components/HysCard/HysCard.vue.js +2 -2
- package/dist/components/HysCard/HysCard2.vue.js +175 -42
- package/dist/components/HysCascader/HysCascader.vue.js +5 -194
- package/dist/components/HysCascader/HysCascader2.vue.js +773 -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 +3 -3
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +1 -1
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -216
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
- package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
- package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
- package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1019 -563
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +270 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +820 -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 +270 -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 +434 -84
- package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
- package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
- package/dist/components/HysFileManager/HysFileManager.vue.js +3 -3
- package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +578 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
- package/dist/components/HysFormItem/HysFormItem2.vue.js +528 -2
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +1380 -268
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +467 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +122 -109
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +490 -85
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
- package/dist/components/HysPagination/HysPagination.vue.js +1 -1
- package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
- package/dist/components/HysPopover/HysPopover.vue.js +5 -91
- package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
- package/dist/components/HysProgress/HysProgress.vue.js +2 -2
- package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
- 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 +2 -2
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
- package/dist/components/HysSearch/HysSearch.vue.js +37 -36
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
- 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 +999 -189
- 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 +1 -1
- package/dist/components/HysSlider/HysSlider2.vue.js +536 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +170 -0
- package/dist/components/HysSteps/HysSteps.vue.js +1 -1
- package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1494 -88
- 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 -68
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -81
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
- package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
- package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
- package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
- package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
- package/dist/components/HysTour/HysTour.vue.js +46 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
- package/dist/components/HysTransfer/HysTransfer2.vue.js +446 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +503 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +651 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +570 -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 +459 -124
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- 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/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/formContext.js +92 -7
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -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/tagInput.js +16 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +65 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useColorPicker.js +402 -0
- package/dist/composables/useContextMenu.js +514 -0
- package/dist/composables/useDataGridRemote.js +67 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +136 -56
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useModal.js +295 -0
- package/dist/composables/useModalInteraction.js +394 -0
- package/dist/composables/usePopupSurface.js +458 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTransferMotion.js +185 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/composables/useUpload.js +472 -0
- package/dist/composables/useUploadModel.js +65 -0
- package/dist/composables/useUploadRequests.js +266 -0
- package/dist/composables/useVirtualTableLayout.js +277 -0
- package/dist/composables/virtualTable.js +43 -0
- package/dist/index.js +152 -139
- package/dist/internal/PopupReference.js +39 -0
- package/dist/internal/PopupSurfacePanel.vue.js +7 -0
- package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
- package/dist/motion/PopupMotion.js +105 -0
- package/dist/motion/popup.js +10 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -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 +104 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +71 -20
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +120 -31
- package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
- 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 +50 -39
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
- package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
- 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 +92 -35
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
- 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 +84 -5
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +4 -3
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -35
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +34 -12
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- 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 +131 -22
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +69 -11
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +24 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +3 -3
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -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 +50 -28
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysToast/HysToast.vue.d.ts +3 -3
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +4 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +107 -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/components/HysUpload/HysUpload.vue.d.ts +55 -67
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
- package/dist/types/composables/autocomplete.d.ts +109 -0
- package/dist/types/composables/avatar.d.ts +73 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +195 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/color.d.ts +97 -0
- package/dist/types/composables/dataGrid.d.ts +100 -0
- package/dist/types/composables/datePicker.d.ts +250 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/formContext.d.ts +135 -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/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +183 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/overlayManager.d.ts +7 -3
- package/dist/types/composables/popupSurface.d.ts +83 -0
- package/dist/types/composables/progress.d.ts +92 -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 +46 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +312 -0
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/transfer.d.ts +187 -0
- package/dist/types/composables/tree.d.ts +240 -0
- package/dist/types/composables/treeSelect.d.ts +170 -0
- package/dist/types/composables/upload.d.ts +202 -0
- package/dist/types/composables/uploadRequest.d.ts +3 -0
- package/dist/types/composables/useAlert.d.ts +21 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useColorPicker.d.ts +101 -0
- package/dist/types/composables/useContextMenu.d.ts +81 -0
- package/dist/types/composables/useDataGridRemote.d.ts +15 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useDialog.d.ts +16 -3
- package/dist/types/composables/useDrawerPush.d.ts +6 -0
- package/dist/types/composables/useDrawerResize.d.ts +27 -0
- package/dist/types/composables/useFloating.d.ts +28 -6
- 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/useHysModal.d.ts +44 -0
- package/dist/types/composables/useModal.d.ts +62 -0
- package/dist/types/composables/useModalInteraction.d.ts +27 -0
- package/dist/types/composables/usePopupSurface.d.ts +3341 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/composables/useUpload.d.ts +94 -0
- package/dist/types/composables/useUploadModel.d.ts +14 -0
- package/dist/types/composables/useUploadRequests.d.ts +38 -0
- package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
- package/dist/types/composables/virtualTable.d.ts +126 -0
- package/dist/types/index.d.ts +50 -9
- package/dist/types/internal/PopupReference.d.ts +18 -0
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
- package/dist/types/motion/PopupMotion.d.ts +59 -0
- package/dist/types/motion/popup.d.ts +12 -0
- package/package.json +2 -1
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import { ref as P, computed as c, shallowRef as Be, watch as Me } from "vue";
|
|
2
|
+
import { useChoiceModel as Ge } from "./choiceModel.js";
|
|
3
|
+
import { civilDay as Ie, calendarParts as Ve, calendarISO as qe } from "./calendar.js";
|
|
4
|
+
import { dateUnit as ge, dateMultiple as Oe, datePattern as be, datePickerEnglish as _e, datePickerWords as ze, dateEqual as E, dateClone as U, datePoint as N, DATE_MIN as ee, DATE_MAX as ae, dateShift as j, dateNative as A, datePeriod as B, dateWeek as re, dateFormat as Pe, dateTimeSeconds as He } from "./datePicker.js";
|
|
5
|
+
function Ke(u, f, G, o, Te) {
|
|
6
|
+
const ve = P("string"), T = c(
|
|
7
|
+
() => u.type === "datetime" || !!u.showTime && ge(u.type) === "date"
|
|
8
|
+
), s = c(() => ge(u.type)), w = c(() => !f.value && Oe(u.type)), m = c(
|
|
9
|
+
() => Number.isFinite(u.firstDayOfWeek) ? (Math.trunc(u.firstDayOfWeek) % 7 + 7) % 7 : 1
|
|
10
|
+
), g = c(
|
|
11
|
+
() => Number.isFinite(u.firstWeekContainsDate) ? Math.max(1, Math.min(7, Math.trunc(u.firstWeekContainsDate))) : 4
|
|
12
|
+
), I = c(
|
|
13
|
+
() => u.valueFormat ?? be(u.type, T.value)
|
|
14
|
+
), ue = c(
|
|
15
|
+
() => u.format ?? (s.value === "week" ? "GGGG-[W]WW" : be(u.type, T.value))
|
|
16
|
+
), le = c(() => {
|
|
17
|
+
var e;
|
|
18
|
+
return {
|
|
19
|
+
...ze,
|
|
20
|
+
...(e = u.locale) != null && e.startsWith("en") ? _e : {},
|
|
21
|
+
...u.messages
|
|
22
|
+
};
|
|
23
|
+
}), J = Ge(
|
|
24
|
+
u,
|
|
25
|
+
() => U(
|
|
26
|
+
u.defaultValue ?? (f.value ? ["", ""] : w.value ? [] : "")
|
|
27
|
+
),
|
|
28
|
+
E
|
|
29
|
+
), y = J.current, x = c(
|
|
30
|
+
() => u.valueType ?? (y.value instanceof Date || Array.isArray(y.value) && y.value.some((e) => e instanceof Date) ? "date" : typeof y.value == "number" || Array.isArray(y.value) && y.value.some((e) => typeof e == "number") ? "timestamp" : ve.value)
|
|
31
|
+
), v = Be([]), W = P("start"), K = P(), S = P(""), q = P(
|
|
32
|
+
u.defaultMode ?? (s.value === "week" ? "date" : s.value)
|
|
33
|
+
), L = P(q.value), O = P(0), Q = P(0), fe = c(() => N(/* @__PURE__ */ new Date())), de = c(() => {
|
|
34
|
+
var e;
|
|
35
|
+
return [
|
|
36
|
+
u.panelValue === void 0 ? O.value : ((e = _(u.panelValue)) == null ? void 0 : e.day) ?? O.value,
|
|
37
|
+
Q.value
|
|
38
|
+
];
|
|
39
|
+
}), te = c(() => u.mode ?? q.value), se = c(
|
|
40
|
+
() => {
|
|
41
|
+
var e;
|
|
42
|
+
return u.showConfirm ?? (T.value || w.value || f.value && !!((e = u.allowEmpty) != null && e.some(Boolean)));
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
function R(e) {
|
|
46
|
+
return N(e, I.value, m.value, g.value);
|
|
47
|
+
}
|
|
48
|
+
function _(e) {
|
|
49
|
+
return R(e) ?? N(e, "YYYY-MM-DD") ?? N(e, "YYYY-MM-DD HH:mm:ss");
|
|
50
|
+
}
|
|
51
|
+
function F(e) {
|
|
52
|
+
return {
|
|
53
|
+
day: B(e.day, s.value, m.value)[0],
|
|
54
|
+
second: T.value ? e.second : 0
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function M(e = y.value) {
|
|
58
|
+
if (e == null || e === "" || u.clearValue !== void 0 && E(e, u.clearValue))
|
|
59
|
+
return f.value ? [null, null] : [];
|
|
60
|
+
if (f.value)
|
|
61
|
+
return Array.from({ length: 2 }, (l, n) => {
|
|
62
|
+
const t = Array.isArray(e) ? R(e[n]) : void 0;
|
|
63
|
+
return t ? F(t) : null;
|
|
64
|
+
});
|
|
65
|
+
if (w.value) {
|
|
66
|
+
const l = /* @__PURE__ */ new Set();
|
|
67
|
+
return (Array.isArray(e) ? e : []).flatMap((n) => {
|
|
68
|
+
const t = R(n);
|
|
69
|
+
if (!t) return [];
|
|
70
|
+
const r = F(t);
|
|
71
|
+
return s.value === "week" && l.has(r.day) ? [] : (l.add(r.day), [r]);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const a = R(e);
|
|
75
|
+
return a ? [F(a)] : [];
|
|
76
|
+
}
|
|
77
|
+
const z = c(() => M()), H = c(() => _(u.min)), X = c(() => _(u.max));
|
|
78
|
+
function ce(e, a) {
|
|
79
|
+
return {
|
|
80
|
+
range: a ? "end" : "start",
|
|
81
|
+
from: v.value[0] ? new Date(v.value[0].day * 864e5) : null,
|
|
82
|
+
iso: qe(e)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function h(e) {
|
|
86
|
+
return Array.isArray(u.disabled) && !!u.disabled[e];
|
|
87
|
+
}
|
|
88
|
+
function Y(e, a = 0, l = !0) {
|
|
89
|
+
var n;
|
|
90
|
+
if (!Number.isFinite(e) || e < ee || e > ae || H.value && e < H.value.day || X.value && e > X.value.day || (n = u.disabledDate) != null && n.call(u, new Date(e * 864e5), ce(e, a)))
|
|
91
|
+
return !1;
|
|
92
|
+
if (f.value && l && a === 1 && v.value[0]) {
|
|
93
|
+
const t = s.value === "week" ? Math.abs(
|
|
94
|
+
B(e, "week", m.value)[0] - B(v.value[0].day, "week", m.value)[0]
|
|
95
|
+
) + 7 : Math.abs(e - v.value[0].day) + 1;
|
|
96
|
+
if (u.minRangeDays && t < u.minRangeDays || u.maxRangeDays && t > u.maxRangeDays)
|
|
97
|
+
return !1;
|
|
98
|
+
}
|
|
99
|
+
return !0;
|
|
100
|
+
}
|
|
101
|
+
function ne(e, a, l = W.value === "end" ? 1 : 0, n = !0) {
|
|
102
|
+
var i, d, b;
|
|
103
|
+
if (s.value === "week" && a - e <= 6) {
|
|
104
|
+
if ((i = u.disabledWeek) != null && i.call(u, re(e, m.value, g.value)))
|
|
105
|
+
return !1;
|
|
106
|
+
if (u.weekValidation === "full") {
|
|
107
|
+
if (a - e !== 6) return !1;
|
|
108
|
+
for (let V = e; V <= a; V++)
|
|
109
|
+
if (!Y(V, l, n)) return !1;
|
|
110
|
+
return !0;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const t = Math.max(e, ((d = H.value) == null ? void 0 : d.day) ?? ee), r = Math.min(a, ((b = X.value) == null ? void 0 : b.day) ?? ae);
|
|
114
|
+
for (let V = t; V <= r; V++)
|
|
115
|
+
if (Y(V, l, n)) return !0;
|
|
116
|
+
return !1;
|
|
117
|
+
}
|
|
118
|
+
function oe(e, a) {
|
|
119
|
+
var l;
|
|
120
|
+
return ((l = u.disabledTime) == null ? void 0 : l.call(u, A(e), ce(e.day, a))) ?? {};
|
|
121
|
+
}
|
|
122
|
+
function me(e, a) {
|
|
123
|
+
var De, ke, Ae;
|
|
124
|
+
const l = oe(e, a), n = Math.floor(e.second / 3600), t = Math.floor(e.second / 60) % 60, r = e.second % 60;
|
|
125
|
+
if ((De = l.hours) != null && De.includes(n) || (ke = l.minutes) != null && ke.call(l, n).includes(t) || (Ae = l.seconds) != null && Ae.call(l, n, t).includes(r))
|
|
126
|
+
return !1;
|
|
127
|
+
const i = e.day * 86400 + e.second, d = H.value, b = X.value, V = typeof u.max == "string" && !/[T :]/.test(u.max) ? 86399 : (b == null ? void 0 : b.second) ?? 0;
|
|
128
|
+
return !(d && i < d.day * 86400 + d.second || b && i > b.day * 86400 + V);
|
|
129
|
+
}
|
|
130
|
+
function Z(e, a = !0) {
|
|
131
|
+
var l;
|
|
132
|
+
if (f.value) {
|
|
133
|
+
if (e.length !== 2 || e.some((r, i) => {
|
|
134
|
+
var d;
|
|
135
|
+
return !r && !((d = u.allowEmpty) != null && d[i]);
|
|
136
|
+
})) return !1;
|
|
137
|
+
const [n, t] = e;
|
|
138
|
+
if (n && t && n.day * 86400 + n.second > t.day * 86400 + t.second)
|
|
139
|
+
return !1;
|
|
140
|
+
if (n && t) {
|
|
141
|
+
const r = s.value === "week" ? B(t.day, "week", m.value)[1] : t.day, i = r - n.day + 1;
|
|
142
|
+
if (u.minRangeDays && i < u.minRangeDays || u.maxRangeDays && i > u.maxRangeDays)
|
|
143
|
+
return !1;
|
|
144
|
+
if (u.rangeValidation === "continuous") {
|
|
145
|
+
if (t.day > j(n.day, 1200)) return !1;
|
|
146
|
+
for (let d = n.day; d <= r; d++)
|
|
147
|
+
if (!Y(d, d === n.day ? 0 : 1, !1) || s.value === "week" && (d - n.day) % 7 === 0 && ((l = u.disabledWeek) != null && l.call(
|
|
148
|
+
u,
|
|
149
|
+
re(d, m.value, g.value)
|
|
150
|
+
)))
|
|
151
|
+
return !1;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (a && e.some((r, i) => h(i) && !we(r, z.value[i])))
|
|
155
|
+
return !1;
|
|
156
|
+
} else if (!e.length || !w.value && e.length !== 1 || u.maxDates && e.length > u.maxDates)
|
|
157
|
+
return !1;
|
|
158
|
+
return e.every(
|
|
159
|
+
(n, t) => !n || (s.value === "date" ? Y(n.day, f.value ? t : 0, !1) : ne(
|
|
160
|
+
...B(n.day, s.value, m.value),
|
|
161
|
+
f.value ? t : 0,
|
|
162
|
+
!1
|
|
163
|
+
)) && (!T.value || me(n, f.value ? t : 0))
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function $(e) {
|
|
167
|
+
const a = A(e);
|
|
168
|
+
return x.value === "date" ? a : x.value === "timestamp" ? a.getTime() : I.value === "x" ? String(a.getTime()) : I.value === "X" ? String(Math.floor(a.getTime() / 1e3)) : Pe(e, I.value, m.value, g.value);
|
|
169
|
+
}
|
|
170
|
+
function D(e) {
|
|
171
|
+
return f.value || w.value ? e.map(
|
|
172
|
+
(a) => a ? $(a) : x.value === "string" ? "" : null
|
|
173
|
+
) : e[0] ? $(e[0]) : p();
|
|
174
|
+
}
|
|
175
|
+
function p() {
|
|
176
|
+
return u.clearValue !== void 0 ? U(u.clearValue) : f.value ? x.value === "string" ? ["", ""] : [null, null] : w.value ? [] : x.value === "string" ? "" : null;
|
|
177
|
+
}
|
|
178
|
+
function ye(e = z.value) {
|
|
179
|
+
return e.map(
|
|
180
|
+
(a) => a ? Pe(
|
|
181
|
+
a,
|
|
182
|
+
ue.value,
|
|
183
|
+
m.value,
|
|
184
|
+
g.value
|
|
185
|
+
) : ""
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
function k(e) {
|
|
189
|
+
return S.value = e === "limit" ? le.value.limit.replace("{count}", String(u.maxDates)) : le.value.invalid, o("invalid", {
|
|
190
|
+
reason: e,
|
|
191
|
+
dates: v.value.map((a) => a ? A(a) : null)
|
|
192
|
+
}), !1;
|
|
193
|
+
}
|
|
194
|
+
async function C(e, a, l = !1) {
|
|
195
|
+
if (G.value || !J.isLive()) return !1;
|
|
196
|
+
if (!l) {
|
|
197
|
+
if ((f.value || w.value) && (!Array.isArray(e) || f.value && e.length !== 2))
|
|
198
|
+
return k("shape");
|
|
199
|
+
if ((Array.isArray(e) ? e : [e]).some((d) => d !== null && d !== "" && !R(d)))
|
|
200
|
+
return k("format");
|
|
201
|
+
}
|
|
202
|
+
const n = M(e);
|
|
203
|
+
if (!l && !Z(n)) return k("date");
|
|
204
|
+
if (!l && x.value !== "string" && n.some((i) => i && !we(N(A(i)), i)))
|
|
205
|
+
return k("time");
|
|
206
|
+
S.value = "";
|
|
207
|
+
const t = {
|
|
208
|
+
source: a,
|
|
209
|
+
dates: n.map((i) => i ? A(i) : null),
|
|
210
|
+
formatted: ye(n),
|
|
211
|
+
...s.value === "week" ? {
|
|
212
|
+
weeks: n.map(
|
|
213
|
+
(i) => i ? re(i.day, m.value, g.value) : null
|
|
214
|
+
)
|
|
215
|
+
} : {}
|
|
216
|
+
}, r = await J.commit(
|
|
217
|
+
U(s.value === "week" && !l ? D(n) : e),
|
|
218
|
+
(i) => o("update:modelValue", i),
|
|
219
|
+
(i) => o("change", i, t),
|
|
220
|
+
!0
|
|
221
|
+
);
|
|
222
|
+
return r && (o("value-change", U(y.value), t), Te()), r;
|
|
223
|
+
}
|
|
224
|
+
function he() {
|
|
225
|
+
var a, l, n, t;
|
|
226
|
+
S.value = "", v.value = M(), f.value && v.value.length !== 2 && (v.value = [null, null]), W.value = f.value && h(0) && !h(1) ? "end" : "start", K.value = void 0;
|
|
227
|
+
let e = ((a = z.value.find(Boolean)) == null ? void 0 : a.day) ?? ((l = _(u.defaultPickerValue)) == null ? void 0 : l.day) ?? fe.value.day;
|
|
228
|
+
e = Math.max(
|
|
229
|
+
((n = H.value) == null ? void 0 : n.day) ?? ee,
|
|
230
|
+
Math.min(((t = X.value) == null ? void 0 : t.day) ?? ae, e)
|
|
231
|
+
), O.value = e, Q.value = j(e, 1), q.value = u.defaultMode ?? (s.value === "week" ? "date" : s.value), L.value = q.value;
|
|
232
|
+
}
|
|
233
|
+
function xe(e, a = 0) {
|
|
234
|
+
if (!Number.isFinite(e) || e < ee || e > ae) return !1;
|
|
235
|
+
const l = Ie(
|
|
236
|
+
Ve(e).year,
|
|
237
|
+
Ve(e).month,
|
|
238
|
+
1
|
|
239
|
+
);
|
|
240
|
+
return a === 0 ? (u.panelValue === void 0 && (O.value = l), o("update:panelValue", $({ day: l, second: 0 })), f.value && !u.unlinkPanels && (Q.value = j(l, 1))) : (Q.value = l, u.unlinkPanels || (u.panelValue === void 0 && (O.value = j(l, -1)), o(
|
|
241
|
+
"update:panelValue",
|
|
242
|
+
$({ day: j(l, -1), second: 0 })
|
|
243
|
+
))), o(
|
|
244
|
+
"panelChange",
|
|
245
|
+
A({ day: l, second: 0 }),
|
|
246
|
+
a ? L.value : te.value,
|
|
247
|
+
{ index: a }
|
|
248
|
+
), !0;
|
|
249
|
+
}
|
|
250
|
+
function We(e, a = 0) {
|
|
251
|
+
return ["date", "month", "quarter", "year"].includes(e) ? (a ? L.value = e : (u.mode === void 0 && (q.value = e), o("update:mode", e)), o(
|
|
252
|
+
"panelChange",
|
|
253
|
+
A({ day: de.value[a], second: 0 }),
|
|
254
|
+
e,
|
|
255
|
+
{ index: a }
|
|
256
|
+
), a ? !0 : te.value === e) : !1;
|
|
257
|
+
}
|
|
258
|
+
function Se(e) {
|
|
259
|
+
const a = Array.isArray(u.defaultTime) ? u.defaultTime[e] : u.defaultTime;
|
|
260
|
+
return He(a);
|
|
261
|
+
}
|
|
262
|
+
async function Ce(e) {
|
|
263
|
+
var n;
|
|
264
|
+
if (G.value) return !1;
|
|
265
|
+
const a = f.value && W.value === "end" ? 1 : 0;
|
|
266
|
+
if (h(a) || !(s.value === "date" ? Y(e, a) : ne(
|
|
267
|
+
...B(e, s.value, m.value),
|
|
268
|
+
a
|
|
269
|
+
)))
|
|
270
|
+
return !1;
|
|
271
|
+
const l = F({
|
|
272
|
+
day: e,
|
|
273
|
+
second: T.value ? ((n = v.value[a]) == null ? void 0 : n.second) ?? Se(a) : 0
|
|
274
|
+
});
|
|
275
|
+
if (w.value) {
|
|
276
|
+
const t = v.value.filter((i) => !!i), r = t.findIndex((i) => i.day === l.day);
|
|
277
|
+
if (r >= 0) t.splice(r, 1);
|
|
278
|
+
else {
|
|
279
|
+
if (u.maxDates && t.length >= u.maxDates)
|
|
280
|
+
return k("limit");
|
|
281
|
+
t.push(l);
|
|
282
|
+
}
|
|
283
|
+
v.value = t.sort((i, d) => i.day - d.day);
|
|
284
|
+
} else if (f.value) {
|
|
285
|
+
if (a === 0)
|
|
286
|
+
v.value = [l, h(1) ? z.value[1] ?? null : null], W.value = h(1) ? "start" : "end";
|
|
287
|
+
else {
|
|
288
|
+
let t = v.value[0], r = l;
|
|
289
|
+
if (t && t.day > r.day) {
|
|
290
|
+
if (h(0)) return k("order");
|
|
291
|
+
[t, r] = [r, t];
|
|
292
|
+
}
|
|
293
|
+
v.value = [t ?? null, r], W.value = h(0) ? "end" : "start";
|
|
294
|
+
}
|
|
295
|
+
K.value = void 0;
|
|
296
|
+
} else v.value = [l];
|
|
297
|
+
if (S.value = "", o("calendarChange", D(v.value), {
|
|
298
|
+
range: a ? "end" : "start",
|
|
299
|
+
dates: v.value.map((t) => t ? A(t) : null)
|
|
300
|
+
}), !se.value && (!f.value || v.value.every(Boolean))) {
|
|
301
|
+
const t = D(v.value);
|
|
302
|
+
return await C(t, "date") || E(t, y.value);
|
|
303
|
+
}
|
|
304
|
+
return !1;
|
|
305
|
+
}
|
|
306
|
+
async function ie() {
|
|
307
|
+
const e = M(), a = f.value ? e.map((t, r) => h(r) ? t : null) : [], l = f.value && a.some(Boolean) ? D(a) : p(), n = await C(l, "clear", !0);
|
|
308
|
+
return n && (v.value = M(), S.value = "", o("clear")), n;
|
|
309
|
+
}
|
|
310
|
+
async function Re() {
|
|
311
|
+
if (!Z(v.value)) return k("draft");
|
|
312
|
+
const e = D(v.value);
|
|
313
|
+
return await C(e, "confirm") || E(e, y.value) ? (o("ok", U(y.value)), !0) : !1;
|
|
314
|
+
}
|
|
315
|
+
async function Fe(e) {
|
|
316
|
+
return e == null || e === "" || Array.isArray(e) && e.every((l) => l == null || l === "") || E(e, p()) ? ie() : C(e, "api");
|
|
317
|
+
}
|
|
318
|
+
function Ye(e, a) {
|
|
319
|
+
return G.value || h(e) || !v.value[e] || !Number.isInteger(a) || a < 0 || a > 86399 ? !1 : (v.value = v.value.map(
|
|
320
|
+
(l, n) => n === e && l ? { ...l, second: a } : l
|
|
321
|
+
), S.value = "", o("calendarChange", D(v.value), {
|
|
322
|
+
range: e ? "end" : "start",
|
|
323
|
+
dates: v.value.map((l) => l ? A(l) : null)
|
|
324
|
+
}), !0);
|
|
325
|
+
}
|
|
326
|
+
async function Ee(e, a = 0) {
|
|
327
|
+
var r;
|
|
328
|
+
if (G.value || h(a)) return !1;
|
|
329
|
+
if (!e.trim()) {
|
|
330
|
+
if (f.value && ((r = u.allowEmpty) != null && r[a])) {
|
|
331
|
+
const i = M();
|
|
332
|
+
return i[a] = null, v.value = i, C(D(i), "input");
|
|
333
|
+
}
|
|
334
|
+
return ie();
|
|
335
|
+
}
|
|
336
|
+
const l = [ue.value, ...u.inputFormats ?? []], n = l.map((i) => N(e, i, m.value, g.value)).find(Boolean);
|
|
337
|
+
if (!n) return k("format");
|
|
338
|
+
const t = f.value ? M() : [];
|
|
339
|
+
if (f.value) t[a] = F(n);
|
|
340
|
+
else {
|
|
341
|
+
if (w.value) return k("multiple-input");
|
|
342
|
+
t.push(F(n));
|
|
343
|
+
}
|
|
344
|
+
return v.value = t, C(D(t), "input");
|
|
345
|
+
}
|
|
346
|
+
function Ne(e) {
|
|
347
|
+
var l;
|
|
348
|
+
if (G.value) return !1;
|
|
349
|
+
const a = (l = u.shortcuts) == null ? void 0 : l[e];
|
|
350
|
+
if (!a || a.disabled) return !1;
|
|
351
|
+
try {
|
|
352
|
+
const n = typeof a.value == "function" ? a.value() : a.value, t = M(n);
|
|
353
|
+
return Z(t) ? (v.value = t, W.value = "start", K.value = void 0, o("calendarChange", D(t), {
|
|
354
|
+
range: "start",
|
|
355
|
+
dates: t.map((r) => r ? A(r) : null)
|
|
356
|
+
}), !0) : k("shortcut");
|
|
357
|
+
} catch (n) {
|
|
358
|
+
return o("invalid", { reason: "shortcut", error: n }), !1;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function we(e, a) {
|
|
362
|
+
return !e && !a || !!e && !!a && e.day === a.day && e.second === a.second;
|
|
363
|
+
}
|
|
364
|
+
return Me(
|
|
365
|
+
[() => u.type, () => u.showTime, () => u.valueFormat],
|
|
366
|
+
he
|
|
367
|
+
), Me(
|
|
368
|
+
y,
|
|
369
|
+
(e) => {
|
|
370
|
+
if (u.clearValue !== void 0 && E(e, u.clearValue))
|
|
371
|
+
return;
|
|
372
|
+
const a = Array.isArray(e) ? e : [e], l = a.find((n) => n != null && n !== "");
|
|
373
|
+
l !== void 0 && (ve.value = l instanceof Date ? "date" : typeof l == "number" ? "timestamp" : "string");
|
|
374
|
+
},
|
|
375
|
+
{ immediate: !0, flush: "sync" }
|
|
376
|
+
), {
|
|
377
|
+
current: y,
|
|
378
|
+
selected: z,
|
|
379
|
+
draft: v,
|
|
380
|
+
stage: W,
|
|
381
|
+
preview: K,
|
|
382
|
+
error: S,
|
|
383
|
+
view: te,
|
|
384
|
+
rightView: L,
|
|
385
|
+
panels: de,
|
|
386
|
+
first: m,
|
|
387
|
+
weekContains: g,
|
|
388
|
+
time: T,
|
|
389
|
+
unit: s,
|
|
390
|
+
multiple: w,
|
|
391
|
+
pattern: I,
|
|
392
|
+
displayPattern: ue,
|
|
393
|
+
words: le,
|
|
394
|
+
needsConfirm: se,
|
|
395
|
+
today: fe,
|
|
396
|
+
model: J,
|
|
397
|
+
outputType: x,
|
|
398
|
+
parse: R,
|
|
399
|
+
boundary: _,
|
|
400
|
+
points: M,
|
|
401
|
+
available: Y,
|
|
402
|
+
periodAvailable: ne,
|
|
403
|
+
validTime: me,
|
|
404
|
+
valid: Z,
|
|
405
|
+
timeDisabled: oe,
|
|
406
|
+
encode: D,
|
|
407
|
+
describe: ye,
|
|
408
|
+
empty: p,
|
|
409
|
+
request: C,
|
|
410
|
+
begin: he,
|
|
411
|
+
setPanel: xe,
|
|
412
|
+
setMode: We,
|
|
413
|
+
choose: Ce,
|
|
414
|
+
clear: ie,
|
|
415
|
+
confirm: Re,
|
|
416
|
+
setValue: Fe,
|
|
417
|
+
setTime: Ye,
|
|
418
|
+
input: Ee,
|
|
419
|
+
pickShortcut: Ne,
|
|
420
|
+
locked: h
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
export {
|
|
424
|
+
Ke as useDatePicker
|
|
425
|
+
};
|
|
@@ -1,56 +1,99 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { ref as O, inject as P, computed as b, provide as R, shallowRef as g, watch as L, nextTick as w, onActivated as B, onDeactivated as H, onBeforeUnmount as M } from "vue";
|
|
2
|
+
import { overlayOwnerKey as D, registerOverlay as j, lockBodyScroll as N } from "./overlayManager.js";
|
|
3
|
+
const U = 'a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
4
|
+
function J(A, a, x, t = {}) {
|
|
5
|
+
const m = O(!0), h = P(D, void 0), o = b(() => m.value && (h == null ? void 0 : h.value) !== !1), i = b(() => A.value && o.value);
|
|
6
|
+
R(
|
|
7
|
+
D,
|
|
8
|
+
b(() => {
|
|
9
|
+
var e;
|
|
10
|
+
return i.value && ((e = t.childVisible) == null ? void 0 : e.call(t)) !== !1;
|
|
11
|
+
})
|
|
12
|
+
);
|
|
13
|
+
const d = g(), z = b(
|
|
14
|
+
() => {
|
|
15
|
+
var e, u;
|
|
16
|
+
return ((e = d.value) == null ? void 0 : e.zIndex.value) ?? ((u = t.zIndex) == null ? void 0 : u.call(t)) ?? 100;
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
let E = null, r, s = 0;
|
|
20
|
+
function S() {
|
|
21
|
+
var e;
|
|
22
|
+
return Array.from(
|
|
23
|
+
((e = a.value) == null ? void 0 : e.querySelectorAll(U)) ?? []
|
|
24
|
+
).filter(
|
|
25
|
+
(u) => u.tabIndex >= 0 && u.getClientRects().length > 0 && getComputedStyle(u).visibility !== "hidden" && !u.closest('[inert],[aria-hidden="true"]')
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function T() {
|
|
13
29
|
var e;
|
|
14
|
-
|
|
30
|
+
(e = S()[0] ?? a.value) == null || e.focus({ preventScroll: !0 });
|
|
15
31
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
32
|
+
function k(e) {
|
|
33
|
+
var n, f;
|
|
34
|
+
if (!i.value || !((n = d.value) != null && n.isTop()) || !a.value) return;
|
|
18
35
|
if (e.key === "Escape") {
|
|
19
|
-
e.preventDefault(), e.stopImmediatePropagation(),
|
|
36
|
+
e.preventDefault(), e.stopImmediatePropagation(), x();
|
|
20
37
|
return;
|
|
21
38
|
}
|
|
22
|
-
if (e.key !== "Tab") return;
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
e.preventDefault(),
|
|
39
|
+
if (e.key !== "Tab" || ((f = t.trapFocus) == null ? void 0 : f.call(t)) === !1) return;
|
|
40
|
+
const u = S();
|
|
41
|
+
if (!u.length) {
|
|
42
|
+
e.preventDefault(), a.value.focus({ preventScroll: !0 });
|
|
26
43
|
return;
|
|
27
44
|
}
|
|
28
|
-
const l =
|
|
29
|
-
e.shiftKey && (document.activeElement === l || document.activeElement ===
|
|
45
|
+
const l = u[0], c = u[u.length - 1];
|
|
46
|
+
e.shiftKey && (document.activeElement === l || document.activeElement === a.value || !a.value.contains(document.activeElement)) ? (e.preventDefault(), c.focus({ preventScroll: !0 })) : !e.shiftKey && (document.activeElement === c || !a.value.contains(document.activeElement)) && (e.preventDefault(), l.focus({ preventScroll: !0 }));
|
|
47
|
+
}
|
|
48
|
+
function C(e) {
|
|
49
|
+
var u, l, c;
|
|
50
|
+
i.value && ((u = d.value) != null && u.isTop()) && ((l = t.trapFocus) == null ? void 0 : l.call(t)) !== !1 && e.target instanceof Node && !((c = a.value) != null && c.contains(e.target)) && T();
|
|
30
51
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
52
|
+
function F() {
|
|
53
|
+
var e;
|
|
54
|
+
i.value && ((e = t.lockScroll) == null ? void 0 : e.call(t)) !== !1 ? r ?? (r = N()) : (r == null || r(), r = void 0);
|
|
33
55
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
56
|
+
function y() {
|
|
57
|
+
var u, l;
|
|
58
|
+
const e = ((u = d.value) == null ? void 0 : u.isTop()) ?? !1;
|
|
59
|
+
return (l = d.value) == null || l.unregister(), d.value = void 0, r == null || r(), r = void 0, document.removeEventListener("keydown", k, !0), document.removeEventListener("focusin", C, !0), e;
|
|
36
60
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
function q(e, u, l) {
|
|
62
|
+
w(() => {
|
|
63
|
+
var n, f;
|
|
64
|
+
if (u !== s || !o.value || !l || ((n = t.restoreFocus) == null ? void 0 : n.call(t)) === !1)
|
|
65
|
+
return;
|
|
66
|
+
const c = new Event("hys-ui-close-auto-focus", { cancelable: !0 });
|
|
67
|
+
(f = t.onCloseAutoFocus) == null || f.call(t, c), !c.defaultPrevented && (e != null && e.isConnected) && e.focus({ preventScroll: !0 });
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return L(
|
|
71
|
+
i,
|
|
72
|
+
async (e) => {
|
|
73
|
+
var l, c, n, f;
|
|
74
|
+
const u = ++s;
|
|
75
|
+
if (e) {
|
|
76
|
+
if (y(), E = document.activeElement instanceof HTMLElement ? document.activeElement : null, d.value = j("dialog", x, t.zIndex), F(), document.addEventListener("keydown", k, !0), document.addEventListener("focusin", C, !0), await w(), u !== s || !i.value) return;
|
|
77
|
+
const I = new Event("hys-ui-open-auto-focus", { cancelable: !0 });
|
|
78
|
+
(l = t.onOpenAutoFocus) == null || l.call(t, I);
|
|
79
|
+
const v = (c = t.initialFocus) == null ? void 0 : c.call(t), K = v instanceof HTMLElement && v.isConnected && v.getClientRects().length > 0 && getComputedStyle(v).visibility !== "hidden" && !v.closest('[inert],[aria-hidden="true"]') && !v.disabled ? v : void 0;
|
|
80
|
+
!I.defaultPrevented && v !== !1 && ((f = K ?? ((n = a.value) == null ? void 0 : n.querySelector("[autofocus]")) ?? S()[0] ?? a.value) == null || f.focus({ preventScroll: !0 }));
|
|
81
|
+
} else q(E, u, y());
|
|
82
|
+
},
|
|
83
|
+
{ immediate: !0, flush: "post" }
|
|
84
|
+
), L(() => {
|
|
85
|
+
var e;
|
|
86
|
+
return (e = t.lockScroll) == null ? void 0 : e.call(t);
|
|
87
|
+
}, F), B(() => m.value = !0), H(() => {
|
|
88
|
+
m.value = !1, s++, y();
|
|
89
|
+
}), M(() => {
|
|
90
|
+
var c;
|
|
91
|
+
const e = E, u = y(), l = o.value && ((c = t.restoreFocus) == null ? void 0 : c.call(t)) !== !1;
|
|
92
|
+
m.value = !1, s++, l && u && w(() => {
|
|
93
|
+
e != null && e.isConnected && e.focus({ preventScroll: !0 });
|
|
94
|
+
});
|
|
95
|
+
}), { active: o, zIndex: z, focus: T };
|
|
53
96
|
}
|
|
54
97
|
export {
|
|
55
|
-
|
|
98
|
+
J as useDialog
|
|
56
99
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { inject as y, shallowRef as f, provide as w, onMounted as b, onActivated as g, onDeactivated as M, onBeforeUnmount as j, computed as v } from "vue";
|
|
2
|
+
const p = Symbol("hys-ui-drawer-parent");
|
|
3
|
+
function S(t, r, m) {
|
|
4
|
+
const c = y(p, void 0), a = f(/* @__PURE__ */ new Map()), h = Symbol("drawer-child");
|
|
5
|
+
w(p, {
|
|
6
|
+
register(e, l) {
|
|
7
|
+
return a.value = new Map(a.value).set(e, l), () => {
|
|
8
|
+
const u = new Map(a.value);
|
|
9
|
+
u.delete(e), a.value = u;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
let n;
|
|
14
|
+
const i = () => {
|
|
15
|
+
n ?? (n = c == null ? void 0 : c.register(h, r));
|
|
16
|
+
}, s = () => {
|
|
17
|
+
n == null || n(), n = void 0;
|
|
18
|
+
};
|
|
19
|
+
b(i), g(i), M(s), j(s);
|
|
20
|
+
const o = v(
|
|
21
|
+
() => !!t.push && r.value && !m.value && [...a.value.values()].some((e) => e.value)
|
|
22
|
+
), x = v(() => {
|
|
23
|
+
const e = typeof t.push == "object" ? t.push.distance : 160, l = typeof e == "number" ? Number.isFinite(e) ? Math.max(0, e) + "px" : "160px" : e || "160px", u = o.value ? l : "0px", d = o.value ? `calc(-1 * ${l})` : "0px";
|
|
24
|
+
return {
|
|
25
|
+
"--hys-ui-drawer-push-x": t.placement === "left" ? u : t.placement === "right" ? d : "0px",
|
|
26
|
+
"--hys-ui-drawer-push-y": t.placement === "top" ? u : t.placement === "bottom" ? d : "0px"
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return { pushed: o, style: x };
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
S as useDrawerPush
|
|
33
|
+
};
|