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,170 @@
|
|
|
1
|
+
import { defineComponent as K, ref as S, watch as q, onActivated as Q, nextTick as Z, onDeactivated as tt, onBeforeUnmount as et, openBlock as j, createBlock as it, Teleport as ot, createVNode as nt, unref as U, withCtx as lt, createElementBlock as st, mergeProps as at, renderSlot as rt, createCommentVNode as ct } from "vue";
|
|
2
|
+
import dt from "../../motion/PopupMotion.js";
|
|
3
|
+
import { popupSize as pt } from "../../motion/popup.js";
|
|
4
|
+
import { useHysRootAttrs as ut } from "../../config.js";
|
|
5
|
+
const ht = ["id"], yt = /* @__PURE__ */ K({
|
|
6
|
+
__name: "SliderTooltip",
|
|
7
|
+
props: {
|
|
8
|
+
popupTransition: {},
|
|
9
|
+
popupTransitionDuration: {},
|
|
10
|
+
visible: { type: Boolean },
|
|
11
|
+
id: {},
|
|
12
|
+
anchor: {},
|
|
13
|
+
container: {},
|
|
14
|
+
placement: {},
|
|
15
|
+
position: {}
|
|
16
|
+
},
|
|
17
|
+
setup(k) {
|
|
18
|
+
const t = k, A = ut(), w = S(), f = S(!0), C = S({ position: "fixed", visibility: "hidden" }), V = S(t.placement);
|
|
19
|
+
let p, x, L = [], R = {}, z;
|
|
20
|
+
function T() {
|
|
21
|
+
if (L = [], R = {}, !t.anchor) return;
|
|
22
|
+
for (let n = t.anchor.parentElement; n; n = n.parentElement) {
|
|
23
|
+
const e = getComputedStyle(n), l = /hidden|clip|auto|scroll/.test(e.overflowX || e.overflow), c = /hidden|clip|auto|scroll/.test(e.overflowY || e.overflow);
|
|
24
|
+
(l || c) && L.push({ element: n, x: l, y: c });
|
|
25
|
+
}
|
|
26
|
+
const i = getComputedStyle(t.anchor);
|
|
27
|
+
for (const n of [
|
|
28
|
+
"--hys-ui-text",
|
|
29
|
+
"--hys-ui-surface",
|
|
30
|
+
"--hys-ui-theme-text",
|
|
31
|
+
"--hys-ui-theme-surface"
|
|
32
|
+
]) {
|
|
33
|
+
const e = i.getPropertyValue(n).trim();
|
|
34
|
+
e && (R[n] = e);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function N() {
|
|
38
|
+
p = void 0;
|
|
39
|
+
const i = t.anchor, n = w.value;
|
|
40
|
+
if (!t.visible || !f.value || !(i != null && i.isConnected) || !n) return;
|
|
41
|
+
const e = window.visualViewport, l = (e == null ? void 0 : e.offsetLeft) ?? 0, c = (e == null ? void 0 : e.offsetTop) ?? 0, g = (e == null ? void 0 : e.width) ?? (document.documentElement.clientWidth || window.innerWidth), a = (e == null ? void 0 : e.height) ?? (document.documentElement.clientHeight || window.innerHeight), r = l + g, y = c + a, s = 8, u = 8, o = (i.querySelector(".hys-ui-slider-handle") ?? i).getBoundingClientRect();
|
|
42
|
+
let F = l, H = c, O = r, P = y;
|
|
43
|
+
for (const { element: v, x: I, y: J } of L) {
|
|
44
|
+
const b = v.getBoundingClientRect();
|
|
45
|
+
I && (F = Math.max(F, b.left + v.clientLeft), O = Math.min(
|
|
46
|
+
O,
|
|
47
|
+
b.left + v.clientLeft + (v.clientWidth || b.width)
|
|
48
|
+
)), J && (H = Math.max(H, b.top + v.clientTop), P = Math.min(
|
|
49
|
+
P,
|
|
50
|
+
b.top + v.clientTop + (v.clientHeight || b.height)
|
|
51
|
+
));
|
|
52
|
+
}
|
|
53
|
+
if (!o.width && !o.height || o.right <= F || o.left >= O || o.bottom <= H || o.top >= P) {
|
|
54
|
+
C.value = { position: "fixed", visibility: "hidden" };
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
n.style.maxWidth = Math.max(1, g - s * 2) + "px";
|
|
58
|
+
const h = z ?? pt(n), D = {
|
|
59
|
+
top: o.top - c - u - s,
|
|
60
|
+
bottom: y - o.bottom - u - s,
|
|
61
|
+
left: o.left - l - u - s,
|
|
62
|
+
right: r - o.right - u - s
|
|
63
|
+
}, $ = {
|
|
64
|
+
top: "bottom",
|
|
65
|
+
bottom: "top",
|
|
66
|
+
left: "right",
|
|
67
|
+
right: "left"
|
|
68
|
+
};
|
|
69
|
+
let d = t.placement;
|
|
70
|
+
const Y = $[d], G = d === "top" || d === "bottom" ? h.height : h.width;
|
|
71
|
+
D[d] < G && D[Y] > D[d] && (d = Y);
|
|
72
|
+
let M = o.left + (o.width - h.width) / 2, E = o.top + (o.height - h.height) / 2;
|
|
73
|
+
d === "top" ? E = o.top - h.height - u : d === "bottom" ? E = o.bottom + u : d === "left" ? M = o.left - h.width - u : M = o.right + u, M = Math.max(l + s, Math.min(M, r - h.width - s)), E = Math.max(c + s, Math.min(E, y - h.height - s)), V.value = d, C.value = {
|
|
74
|
+
...R,
|
|
75
|
+
position: "fixed",
|
|
76
|
+
left: Math.round(M) + "px",
|
|
77
|
+
top: Math.round(E) + "px",
|
|
78
|
+
maxWidth: Math.max(1, g - s * 2) + "px",
|
|
79
|
+
visibility: "visible"
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function m() {
|
|
83
|
+
t.visible && f.value && p === void 0 && (p = requestAnimationFrame(N));
|
|
84
|
+
}
|
|
85
|
+
function W() {
|
|
86
|
+
p !== void 0 && cancelAnimationFrame(p), p = void 0, N();
|
|
87
|
+
}
|
|
88
|
+
function B() {
|
|
89
|
+
z = void 0, T(), m();
|
|
90
|
+
}
|
|
91
|
+
function _() {
|
|
92
|
+
x == null || x(), x = void 0, p !== void 0 && cancelAnimationFrame(p), p = void 0, z = void 0, L = [];
|
|
93
|
+
}
|
|
94
|
+
function X() {
|
|
95
|
+
var c, g;
|
|
96
|
+
if (_(), !t.visible || !f.value || !t.anchor || !w.value) return;
|
|
97
|
+
T(), window.addEventListener("scroll", m, !0), window.addEventListener("resize", B), (c = window.visualViewport) == null || c.addEventListener("scroll", m), (g = window.visualViewport) == null || g.addEventListener("resize", B);
|
|
98
|
+
const i = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver((a) => {
|
|
99
|
+
var r;
|
|
100
|
+
for (const y of a)
|
|
101
|
+
if (y.target === w.value) {
|
|
102
|
+
const s = (r = y.borderBoxSize) == null ? void 0 : r[0];
|
|
103
|
+
z = s ? { width: s.inlineSize, height: s.blockSize } : void 0;
|
|
104
|
+
}
|
|
105
|
+
W();
|
|
106
|
+
});
|
|
107
|
+
i == null || i.observe(t.anchor), i == null || i.observe(w.value), t.container && (i == null || i.observe(t.container));
|
|
108
|
+
const n = () => {
|
|
109
|
+
var a, r;
|
|
110
|
+
return [
|
|
111
|
+
(a = t.container) == null ? void 0 : a.getAttribute("style"),
|
|
112
|
+
(r = t.container) == null ? void 0 : r.getAttribute("class"),
|
|
113
|
+
A.value["data-hys-theme"]
|
|
114
|
+
].join("|");
|
|
115
|
+
};
|
|
116
|
+
let e = n();
|
|
117
|
+
const l = typeof MutationObserver > "u" ? void 0 : new MutationObserver(() => {
|
|
118
|
+
const a = n();
|
|
119
|
+
a !== e && (e = a, T(), m());
|
|
120
|
+
});
|
|
121
|
+
t.container && (l == null || l.observe(t.container, {
|
|
122
|
+
attributes: !0,
|
|
123
|
+
attributeFilter: ["style", "class", "data-hys-theme"]
|
|
124
|
+
})), x = () => {
|
|
125
|
+
var a, r;
|
|
126
|
+
window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", B), (a = window.visualViewport) == null || a.removeEventListener("scroll", m), (r = window.visualViewport) == null || r.removeEventListener("resize", B), i == null || i.disconnect(), l == null || l.disconnect();
|
|
127
|
+
}, m();
|
|
128
|
+
}
|
|
129
|
+
return q(
|
|
130
|
+
() => [t.anchor, t.container, w.value, f.value, t.visible],
|
|
131
|
+
X,
|
|
132
|
+
{ flush: "post" }
|
|
133
|
+
), q(() => [t.position, t.placement], W, { flush: "post" }), q(
|
|
134
|
+
() => A.value["data-hys-theme"],
|
|
135
|
+
() => {
|
|
136
|
+
T(), W();
|
|
137
|
+
},
|
|
138
|
+
{ flush: "post" }
|
|
139
|
+
), Q(() => {
|
|
140
|
+
f.value = !0, Z(X);
|
|
141
|
+
}), tt(() => {
|
|
142
|
+
f.value = !1, _();
|
|
143
|
+
}), et(_), (i, n) => (j(), it(ot, { to: "body" }, [
|
|
144
|
+
nt(U(dt), {
|
|
145
|
+
"popup-transition": t.popupTransition,
|
|
146
|
+
"popup-transition-duration": t.popupTransitionDuration,
|
|
147
|
+
placement: V.value
|
|
148
|
+
}, {
|
|
149
|
+
default: lt(() => [
|
|
150
|
+
f.value && k.visible ? (j(), st("span", at({
|
|
151
|
+
key: 0,
|
|
152
|
+
id: k.id,
|
|
153
|
+
ref_key: "panel",
|
|
154
|
+
ref: w
|
|
155
|
+
}, U(A), {
|
|
156
|
+
class: ["hys-ui-slider-tooltip", "hys-ui-slider-tooltip-" + V.value],
|
|
157
|
+
role: "tooltip",
|
|
158
|
+
style: C.value
|
|
159
|
+
}), [
|
|
160
|
+
rt(i.$slots, "default", {}, void 0, !0)
|
|
161
|
+
], 16, ht)) : ct("", !0)
|
|
162
|
+
]),
|
|
163
|
+
_: 3
|
|
164
|
+
}, 8, ["popup-transition", "popup-transition-duration", "placement"])
|
|
165
|
+
]));
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
export {
|
|
169
|
+
yt as default
|
|
170
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysSteps2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-aee36fc0"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,54 +1,128 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as H, ref as N, computed as f, openBlock as a, createElementBlock as i, mergeProps as S, unref as m, Fragment as A, renderList as M, normalizeClass as P, createElementVNode as B, renderSlot as y, createBlock as $, createTextVNode as h, toDisplayString as p, createCommentVNode as C } from "vue";
|
|
2
|
+
import { Check as R, CircleAlert as V } from "lucide-vue-next";
|
|
3
|
+
import { useHysRootAttrs as F } from "../../config.js";
|
|
4
|
+
const K = ["aria-label"], U = ["aria-current"], q = {
|
|
5
|
+
class: "hys-ui-step-marker",
|
|
6
|
+
"aria-hidden": "true"
|
|
7
|
+
}, I = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "hys-ui-step-dot"
|
|
10
|
+
}, O = { class: "hys-ui-step-content" }, T = ["data-step-index", "disabled", "tabindex", "onClick", "onKeydown"], j = { key: 1 }, G = {
|
|
11
|
+
key: 2,
|
|
12
|
+
class: "hys-ui-step-subtitle"
|
|
13
|
+
}, J = {
|
|
14
|
+
key: 3,
|
|
15
|
+
class: "hys-ui-step-description"
|
|
16
|
+
}, Y = /* @__PURE__ */ H({
|
|
5
17
|
__name: "HysSteps",
|
|
6
18
|
props: {
|
|
7
19
|
items: {},
|
|
8
|
-
current: {},
|
|
20
|
+
current: { default: 0 },
|
|
9
21
|
vertical: { type: Boolean },
|
|
10
22
|
clickable: { type: Boolean },
|
|
11
23
|
disabled: { type: Boolean },
|
|
12
|
-
status: {}
|
|
24
|
+
status: { default: "process" },
|
|
25
|
+
size: { default: "md" },
|
|
26
|
+
labelPlacement: { default: "right" },
|
|
27
|
+
progressDot: { type: Boolean },
|
|
28
|
+
simple: { type: Boolean },
|
|
29
|
+
responsive: { type: Boolean, default: !0 },
|
|
30
|
+
ariaLabel: {}
|
|
13
31
|
},
|
|
14
32
|
emits: ["update:current", "change"],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
33
|
+
setup(s, { emit: D }) {
|
|
34
|
+
const u = s, v = D, L = F(), k = N(), b = f(() => u.items.map((e) => typeof e == "string" ? { title: e } : e)), c = f(() => Number.isFinite(u.current) ? Math.max(-1, Math.min(u.items.length, Math.trunc(u.current))) : 0), o = f(() => b.value.map((e, n) => !u.disabled && !e.disabled ? n : -1).filter((e) => e >= 0));
|
|
35
|
+
function r(e) {
|
|
36
|
+
var n;
|
|
37
|
+
return ((n = b.value[e]) == null ? void 0 : n.status) ?? (e < c.value ? "finish" : e === c.value ? u.status : "wait");
|
|
38
|
+
}
|
|
39
|
+
function g(e) {
|
|
40
|
+
!u.clickable || !o.value.includes(e) || e === c.value || (v("update:current", e), v("change", e));
|
|
41
|
+
}
|
|
42
|
+
function E(e, n) {
|
|
43
|
+
var z, w;
|
|
44
|
+
if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(e.key) || !o.value.length) return;
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
const l = ["ArrowLeft", "ArrowUp"].includes(e.key) ? -1 : 1, t = o.value.indexOf(n), d = e.key === "Home" ? 0 : e.key === "End" ? o.value.length - 1 : (t + l + o.value.length) % o.value.length;
|
|
47
|
+
(w = (z = k.value) == null ? void 0 : z.querySelector('[data-step-index="' + o.value[d] + '"]')) == null || w.focus(), g(o.value[d]);
|
|
48
|
+
}
|
|
49
|
+
return (e, n) => (a(), i("ol", S({
|
|
50
|
+
ref_key: "root",
|
|
51
|
+
ref: k
|
|
52
|
+
}, m(L), {
|
|
53
|
+
class: ["hys-ui-ex-steps", ["hys-ui-steps-size-" + s.size, { "hys-ui-steps-vertical": s.vertical, "hys-ui-steps-bottom": s.labelPlacement === "bottom", "hys-ui-steps-dots": s.progressDot, "hys-ui-steps-simple": s.simple, "hys-ui-steps-responsive": s.responsive }]],
|
|
54
|
+
"aria-label": s.ariaLabel || "流程进度"
|
|
20
55
|
}), [
|
|
21
|
-
(
|
|
22
|
-
key:
|
|
23
|
-
class:
|
|
24
|
-
"aria-current":
|
|
56
|
+
(a(!0), i(A, null, M(b.value, (l, t) => (a(), i("li", {
|
|
57
|
+
key: t,
|
|
58
|
+
class: P(["hys-ui-step-" + r(t), { "hys-ui-done": r(t) === "finish", "hys-ui-active": r(t) === "process", "hys-ui-step-disabled": s.disabled || l.disabled }]),
|
|
59
|
+
"aria-current": t === c.value ? "step" : void 0
|
|
25
60
|
}, [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
61
|
+
B("span", q, [
|
|
62
|
+
y(e.$slots, "icon", {
|
|
63
|
+
item: l,
|
|
64
|
+
index: t,
|
|
65
|
+
status: r(t)
|
|
66
|
+
}, () => [
|
|
67
|
+
s.progressDot ? (a(), i("i", I)) : r(t) === "finish" ? (a(), $(m(R), {
|
|
68
|
+
key: 1,
|
|
69
|
+
size: s.size === "sm" ? 12 : 15
|
|
70
|
+
}, null, 8, ["size"])) : r(t) === "error" ? (a(), $(m(V), {
|
|
71
|
+
key: 2,
|
|
72
|
+
size: s.size === "sm" ? 12 : 15
|
|
73
|
+
}, null, 8, ["size"])) : (a(), i(A, { key: 3 }, [
|
|
74
|
+
h(p(t + 1), 1)
|
|
75
|
+
], 64))
|
|
76
|
+
], !0)
|
|
36
77
|
]),
|
|
37
|
-
|
|
38
|
-
|
|
78
|
+
B("div", O, [
|
|
79
|
+
s.clickable ? (a(), i("button", {
|
|
39
80
|
key: 0,
|
|
40
81
|
type: "button",
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
82
|
+
"data-step-index": t,
|
|
83
|
+
disabled: s.disabled || l.disabled,
|
|
84
|
+
tabindex: (o.value.includes(c.value) ? c.value : o.value[0]) === t ? 0 : -1,
|
|
85
|
+
onClick: (d) => g(t),
|
|
86
|
+
onKeydown: (d) => E(d, t)
|
|
87
|
+
}, [
|
|
88
|
+
y(e.$slots, "title", {
|
|
89
|
+
item: l,
|
|
90
|
+
index: t,
|
|
91
|
+
status: r(t)
|
|
92
|
+
}, () => [
|
|
93
|
+
h(p(l.title), 1)
|
|
94
|
+
], !0)
|
|
95
|
+
], 40, T)) : (a(), i("strong", j, [
|
|
96
|
+
y(e.$slots, "title", {
|
|
97
|
+
item: l,
|
|
98
|
+
index: t,
|
|
99
|
+
status: r(t)
|
|
100
|
+
}, () => [
|
|
101
|
+
h(p(l.title), 1)
|
|
102
|
+
], !0)
|
|
103
|
+
])),
|
|
104
|
+
l.subtitle || e.$slots.subtitle ? (a(), i("small", G, [
|
|
105
|
+
y(e.$slots, "subtitle", {
|
|
106
|
+
item: l,
|
|
107
|
+
index: t
|
|
108
|
+
}, () => [
|
|
109
|
+
h(p(l.subtitle), 1)
|
|
110
|
+
], !0)
|
|
111
|
+
])) : C("", !0),
|
|
112
|
+
!s.simple && (l.description || e.$slots.description) ? (a(), i("div", J, [
|
|
113
|
+
y(e.$slots, "description", {
|
|
114
|
+
item: l,
|
|
115
|
+
index: t,
|
|
116
|
+
status: r(t)
|
|
117
|
+
}, () => [
|
|
118
|
+
h(p(l.description), 1)
|
|
119
|
+
], !0)
|
|
120
|
+
])) : C("", !0)
|
|
47
121
|
])
|
|
48
|
-
], 10,
|
|
49
|
-
], 16));
|
|
122
|
+
], 10, U))), 128))
|
|
123
|
+
], 16, K));
|
|
50
124
|
}
|
|
51
125
|
});
|
|
52
126
|
export {
|
|
53
|
-
|
|
127
|
+
Y as default
|
|
54
128
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysSwitch2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-89733ae0"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,67 +1,249 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { LoaderCircle as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as Z, useAttrs as p, ref as M, inject as _, useId as ee, computed as g, watch as O, onMounted as ae, openBlock as l, createElementBlock as d, mergeProps as R, unref as i, createElementVNode as A, toDisplayString as y, createCommentVNode as v, renderSlot as k, createBlock as B, resolveDynamicComponent as T, toRaw as z, Fragment as q, createTextVNode as $, createVNode as te } from "vue";
|
|
2
|
+
import { LoaderCircle as ie } from "lucide-vue-next";
|
|
3
|
+
import { fieldKey as ne, useHysControlState as le } from "../../composables/formContext.js";
|
|
4
|
+
import { useChoiceModel as oe, useChoiceNativeReset as ue } from "../../composables/choiceModel.js";
|
|
5
|
+
import { isChoice as K } from "../../composables/choice.js";
|
|
6
|
+
import { useHysRootAttrs as re } from "../../config.js";
|
|
7
|
+
const se = ["id", "data-status", "disabled", "tabindex", "autofocus", "aria-label", "aria-checked", "aria-readonly", "aria-busy", "aria-invalid", "aria-describedby"], ce = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "hys-ui-switch-sizer",
|
|
10
|
+
"aria-hidden": "true"
|
|
11
|
+
}, de = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "hys-ui-switch-prompt",
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
}, ve = {
|
|
16
|
+
class: "hys-ui-switch-thumb",
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}, fe = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "hys-ui-switch-text"
|
|
21
|
+
}, ye = ["name", "form", "value", "disabled"], he = ["id"], xe = /* @__PURE__ */ Z({
|
|
22
|
+
inheritAttrs: !1,
|
|
5
23
|
__name: "HysSwitch",
|
|
6
24
|
props: {
|
|
7
|
-
modelValue: {
|
|
25
|
+
modelValue: { default: void 0 },
|
|
26
|
+
defaultValue: { default: void 0 },
|
|
27
|
+
activeValue: { default: void 0 },
|
|
28
|
+
inactiveValue: { default: void 0 },
|
|
8
29
|
disabled: { type: Boolean },
|
|
30
|
+
readonly: { type: Boolean },
|
|
9
31
|
loading: { type: Boolean },
|
|
32
|
+
size: {},
|
|
33
|
+
width: {},
|
|
34
|
+
round: { type: Boolean, default: !0 },
|
|
35
|
+
activeColor: {},
|
|
36
|
+
inactiveColor: {},
|
|
10
37
|
activeText: {},
|
|
11
38
|
inactiveText: {},
|
|
39
|
+
inlinePrompt: { type: Boolean },
|
|
40
|
+
activeIcon: {},
|
|
41
|
+
inactiveIcon: {},
|
|
42
|
+
activeActionIcon: {},
|
|
43
|
+
inactiveActionIcon: {},
|
|
12
44
|
ariaLabel: {},
|
|
13
|
-
|
|
45
|
+
name: {},
|
|
46
|
+
form: {},
|
|
47
|
+
tabindex: {},
|
|
48
|
+
autofocus: { type: Boolean },
|
|
49
|
+
focusable: { type: Boolean, default: !0 },
|
|
50
|
+
error: {},
|
|
51
|
+
status: {},
|
|
52
|
+
beforeChange: {}
|
|
14
53
|
},
|
|
15
|
-
emits: ["update:modelValue", "change", "error"],
|
|
16
|
-
setup(e, { emit:
|
|
17
|
-
const a = e,
|
|
18
|
-
let
|
|
19
|
-
function
|
|
20
|
-
|
|
54
|
+
emits: ["update:modelValue", "change", "error", "click", "focus", "blur"],
|
|
55
|
+
setup(e, { expose: G, emit: J }) {
|
|
56
|
+
const a = e, h = J, Q = re(), m = p(), I = M(), r = _(ne, void 0), { disabled: s, size: P, label: U } = le(a), x = M(!1), D = ee(), L = M(!1);
|
|
57
|
+
let C = 0, b;
|
|
58
|
+
function E() {
|
|
59
|
+
C++, b == null || b.abort(), b = void 0, x.value = !1;
|
|
21
60
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
61
|
+
const N = g(
|
|
62
|
+
() => K(a.activeValue) ? a.activeValue : !0
|
|
63
|
+
), S = g(
|
|
64
|
+
() => K(a.inactiveValue) ? a.inactiveValue : !1
|
|
65
|
+
), o = oe(
|
|
66
|
+
a,
|
|
67
|
+
() => a.defaultValue ?? S.value,
|
|
68
|
+
Object.is,
|
|
69
|
+
E
|
|
70
|
+
), u = g(() => o.current.value === N.value), f = g(() => a.loading || x.value), j = g(
|
|
71
|
+
() => {
|
|
72
|
+
var t, n;
|
|
73
|
+
return a.error || (t = r == null ? void 0 : r.invalid) != null && t.value || a.status === "error" ? "error" : a.status ?? ((n = r == null ? void 0 : r.status) == null ? void 0 : n.value);
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
O(() => [s.value, a.readonly, a.loading], E, {
|
|
77
|
+
flush: "sync"
|
|
78
|
+
}), O([N, S], o.invalidate, { flush: "sync" });
|
|
79
|
+
async function F() {
|
|
80
|
+
if (!o.isLive() || s.value || a.readonly || f.value)
|
|
81
|
+
return !1;
|
|
82
|
+
const t = u.value ? S.value : N.value;
|
|
83
|
+
if (t === o.current.value) return !1;
|
|
84
|
+
const n = ++C, w = new AbortController();
|
|
85
|
+
b = w, x.value = !!a.beforeChange;
|
|
33
86
|
try {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
87
|
+
return a.beforeChange && await a.beforeChange(t, o.current.value, {
|
|
88
|
+
signal: w.signal
|
|
89
|
+
}) === !1 || !o.isLive() || n !== C || w.signal.aborted || s.value || a.readonly || a.loading ? !1 : await o.commit(
|
|
90
|
+
t,
|
|
91
|
+
(c) => h("update:modelValue", c),
|
|
92
|
+
(c) => h("change", c),
|
|
93
|
+
!0
|
|
94
|
+
);
|
|
95
|
+
} catch (c) {
|
|
96
|
+
return o.isLive() && n === C && h("error", c), !1;
|
|
38
97
|
} finally {
|
|
39
|
-
n ===
|
|
98
|
+
n === C && (x.value = !1, b = void 0);
|
|
40
99
|
}
|
|
41
100
|
}
|
|
42
|
-
|
|
43
|
-
f("
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
101
|
+
function W(t) {
|
|
102
|
+
s.value || a.readonly || f.value || (h("click", o.current.value, t), F());
|
|
103
|
+
}
|
|
104
|
+
function H(t) {
|
|
105
|
+
var n;
|
|
106
|
+
!s.value && !f.value && ((n = I.value) == null || n.focus(t));
|
|
107
|
+
}
|
|
108
|
+
ue(I, o.reset, void 0, () => a.form), ae(() => {
|
|
109
|
+
a.autofocus && H();
|
|
110
|
+
});
|
|
111
|
+
const X = () => Object.fromEntries(
|
|
112
|
+
Object.entries(m).filter(([t]) => t !== "class" && t !== "style")
|
|
113
|
+
), Y = g(() => ({
|
|
114
|
+
width: typeof a.width == "number" && Number.isFinite(a.width) ? Math.max(0, a.width) + "px" : a.width ?? (a.inlinePrompt ? "max-content" : void 0),
|
|
115
|
+
"--hys-ui-switch-on": a.activeColor || "var(--hys-ui-primary,var(--hys-ui-theme-primary))",
|
|
116
|
+
"--hys-ui-switch-off": a.inactiveColor || "var(--hys-ui-border,var(--hys-ui-theme-border))"
|
|
117
|
+
}));
|
|
118
|
+
return G({
|
|
119
|
+
element: I,
|
|
120
|
+
checked: u,
|
|
121
|
+
pending: x,
|
|
122
|
+
focus: H,
|
|
123
|
+
blur: () => {
|
|
124
|
+
var t;
|
|
125
|
+
return (t = I.value) == null ? void 0 : t.blur();
|
|
126
|
+
},
|
|
127
|
+
toggle: F
|
|
128
|
+
}), (t, n) => {
|
|
129
|
+
var w, c;
|
|
130
|
+
return l(), d("span", R(i(Q), {
|
|
131
|
+
class: ["hys-ui-switch-wrap", [
|
|
132
|
+
i(m).class,
|
|
133
|
+
"hys-ui-switch-" + i(P),
|
|
134
|
+
{
|
|
135
|
+
"hys-ui-switch-disabled": i(s),
|
|
136
|
+
"hys-ui-switch-readonly": e.readonly
|
|
137
|
+
}
|
|
138
|
+
]],
|
|
139
|
+
style: i(m).style
|
|
140
|
+
}), [
|
|
141
|
+
A("button", R({
|
|
142
|
+
ref_key: "element",
|
|
143
|
+
ref: I
|
|
144
|
+
}, X(), {
|
|
145
|
+
id: i(m).id || ((w = i(r)) == null ? void 0 : w.id.value),
|
|
146
|
+
"data-hys-ui-field-managed": "",
|
|
147
|
+
type: "button",
|
|
148
|
+
role: "switch",
|
|
149
|
+
class: ["hys-ui-switch", {
|
|
150
|
+
"hys-ui-on": u.value,
|
|
151
|
+
"hys-ui-switch-square": !e.round,
|
|
152
|
+
"hys-ui-switch-inline": e.inlinePrompt,
|
|
153
|
+
"hys-ui-switch-error": j.value === "error"
|
|
154
|
+
}],
|
|
155
|
+
"data-status": j.value,
|
|
156
|
+
style: Y.value,
|
|
157
|
+
disabled: i(s) || f.value,
|
|
158
|
+
tabindex: e.focusable ? e.tabindex : -1,
|
|
159
|
+
autofocus: e.autofocus,
|
|
160
|
+
"aria-label": e.ariaLabel || i(m)["aria-label"] || i(U) || e.activeText || e.inactiveText || "切换",
|
|
161
|
+
"aria-checked": u.value,
|
|
162
|
+
"aria-readonly": e.readonly || void 0,
|
|
163
|
+
"aria-busy": f.value || void 0,
|
|
164
|
+
"aria-invalid": j.value === "error" || void 0,
|
|
165
|
+
"aria-describedby": [i(m)["aria-describedby"], e.error ? i(D) : (c = i(r)) == null ? void 0 : c.describedBy.value].filter(Boolean).join(" ") || void 0,
|
|
166
|
+
onMousedown: n[0] || (n[0] = (V) => !e.focusable && V.preventDefault()),
|
|
167
|
+
onClick: W,
|
|
168
|
+
onFocus: n[1] || (n[1] = (V) => {
|
|
169
|
+
L.value = !0, h("focus", V);
|
|
170
|
+
}),
|
|
171
|
+
onBlur: n[2] || (n[2] = (V) => {
|
|
172
|
+
L.value = !1, h("blur", V);
|
|
173
|
+
})
|
|
174
|
+
}), [
|
|
175
|
+
e.inlinePrompt ? (l(), d("span", ce, [
|
|
176
|
+
A("span", null, y(e.activeText), 1),
|
|
177
|
+
A("span", null, y(e.inactiveText), 1)
|
|
178
|
+
])) : v("", !0),
|
|
179
|
+
e.inlinePrompt ? (l(), d("span", de, [
|
|
180
|
+
u.value ? k(t.$slots, "active", {}, () => [
|
|
181
|
+
e.activeIcon ? (l(), B(T(z(e.activeIcon)), {
|
|
182
|
+
key: 0,
|
|
183
|
+
size: 14
|
|
184
|
+
})) : (l(), d(q, { key: 1 }, [
|
|
185
|
+
$(y(e.activeText), 1)
|
|
186
|
+
], 64))
|
|
187
|
+
], !0, 0) : k(t.$slots, "inactive", {}, () => [
|
|
188
|
+
e.inactiveIcon ? (l(), B(T(z(e.inactiveIcon)), {
|
|
189
|
+
key: 0,
|
|
190
|
+
size: 14
|
|
191
|
+
})) : (l(), d(q, { key: 1 }, [
|
|
192
|
+
$(y(e.inactiveText), 1)
|
|
193
|
+
], 64))
|
|
194
|
+
], !0, 1)
|
|
195
|
+
])) : v("", !0),
|
|
196
|
+
A("span", ve, [
|
|
197
|
+
k(t.$slots, "thumb", {
|
|
198
|
+
checked: u.value,
|
|
199
|
+
loading: f.value,
|
|
200
|
+
focused: L.value
|
|
201
|
+
}, () => [
|
|
202
|
+
f.value ? k(t.$slots, "loading", {}, () => [
|
|
203
|
+
te(i(ie), {
|
|
204
|
+
class: "hys-ui-icon-spin",
|
|
205
|
+
size: i(P) === "lg" ? 14 : 11
|
|
206
|
+
}, null, 8, ["size"])
|
|
207
|
+
], !0, 0) : (u.value ? e.activeActionIcon : e.inactiveActionIcon) ? (l(), B(T(z(u.value ? e.activeActionIcon : e.inactiveActionIcon)), {
|
|
208
|
+
key: 1,
|
|
209
|
+
size: i(P) === "lg" ? 14 : 11
|
|
210
|
+
}, null, 8, ["size"])) : v("", !0)
|
|
211
|
+
], !0)
|
|
212
|
+
])
|
|
213
|
+
], 16, se),
|
|
214
|
+
!e.inlinePrompt && (e.activeText || e.inactiveText || e.activeIcon || e.inactiveIcon || t.$slots.active || t.$slots.inactive) ? (l(), d("span", fe, [
|
|
215
|
+
u.value ? k(t.$slots, "active", {}, () => [
|
|
216
|
+
e.activeIcon ? (l(), B(T(z(e.activeIcon)), {
|
|
217
|
+
key: 0,
|
|
218
|
+
size: 15
|
|
219
|
+
})) : v("", !0),
|
|
220
|
+
$(y(e.activeText), 1)
|
|
221
|
+
], !0, 0) : k(t.$slots, "inactive", {}, () => [
|
|
222
|
+
e.inactiveIcon ? (l(), B(T(z(e.inactiveIcon)), {
|
|
223
|
+
key: 0,
|
|
224
|
+
size: 15
|
|
225
|
+
})) : v("", !0),
|
|
226
|
+
$(y(e.inactiveText), 1)
|
|
227
|
+
], !0, 1)
|
|
228
|
+
])) : v("", !0),
|
|
229
|
+
e.name ? (l(), d("input", {
|
|
230
|
+
key: 1,
|
|
231
|
+
type: "hidden",
|
|
232
|
+
name: e.name,
|
|
233
|
+
form: e.form,
|
|
234
|
+
value: String(i(o).current.value),
|
|
235
|
+
disabled: i(s)
|
|
236
|
+
}, null, 8, ye)) : v("", !0),
|
|
237
|
+
e.error ? (l(), d("small", {
|
|
238
|
+
key: 2,
|
|
239
|
+
id: i(D),
|
|
240
|
+
class: "hys-ui-switch-error-text",
|
|
241
|
+
role: "alert"
|
|
242
|
+
}, y(e.error), 9, he)) : v("", !0)
|
|
243
|
+
], 16);
|
|
244
|
+
};
|
|
63
245
|
}
|
|
64
246
|
});
|
|
65
247
|
export {
|
|
66
|
-
|
|
248
|
+
xe as default
|
|
67
249
|
};
|