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
|
@@ -1,98 +1,580 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Minus as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as He, useAttrs as Ke, inject as Se, ref as q, useId as qe, shallowRef as Ge, computed as s, watch as G, onMounted as We, onUpdated as Xe, onActivated as Ye, onDeactivated as Je, onBeforeUnmount as Qe, openBlock as g, createElementBlock as B, mergeProps as De, unref as d, createElementVNode as I, renderSlot as S, createCommentVNode as D, normalizeClass as Ze, createBlock as _e, withModifiers as W, createVNode as X, Fragment as ea, toDisplayString as aa, nextTick as ta } from "vue";
|
|
2
|
+
import { LoaderCircle as na, X as la, Minus as ra, Plus as ua, ChevronUp as ia, ChevronDown as oa } from "lucide-vue-next";
|
|
3
|
+
import { fieldKey as sa, formKey as da, useHysControlState as va } from "../../composables/formContext.js";
|
|
4
|
+
import { decimal as o, normalizeDecimal as Y, decimalCompare as F, decimalText as p, decimalRound as fa, decimalAdd as ie } from "../../composables/numberInput.js";
|
|
5
|
+
import { useHysRootAttrs as ca } from "../../config.js";
|
|
6
|
+
const ma = { class: "hys-ui-number-group" }, pa = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "hys-ui-number-addon"
|
|
9
|
+
}, ba = { class: "hys-ui-number-main" }, ya = ["id", "type", "role", "inputmode", "aria-label", "aria-valuenow", "aria-valuetext", "aria-valuemin", "aria-valuemax", "aria-invalid", "aria-required", "aria-describedby", "value", "min", "max", "step", "disabled", "readonly", "placeholder"], ha = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "hys-ui-number-affix hys-ui-number-prefix"
|
|
12
|
+
}, ka = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "hys-ui-number-affix"
|
|
15
|
+
}, ga = ["disabled"], wa = ["disabled"], Ma = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "hys-ui-number-controls"
|
|
18
|
+
}, Ba = ["disabled"], Ca = ["disabled"], Ea = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "hys-ui-number-addon"
|
|
21
|
+
}, Na = ["name", "value", "disabled"], Sa = ["id"], Oa = /* @__PURE__ */ He({
|
|
22
|
+
inheritAttrs: !1,
|
|
5
23
|
__name: "HysNumberInput",
|
|
6
24
|
props: {
|
|
7
25
|
modelValue: {},
|
|
26
|
+
defaultValue: {},
|
|
8
27
|
min: {},
|
|
9
28
|
max: {},
|
|
10
29
|
step: { default: 1 },
|
|
30
|
+
stepBase: { default: 0 },
|
|
11
31
|
precision: {},
|
|
12
32
|
stepStrictly: { type: Boolean },
|
|
33
|
+
stringMode: { type: Boolean },
|
|
34
|
+
valueOnClear: { default: null },
|
|
35
|
+
clearable: { type: Boolean },
|
|
36
|
+
updateOnInput: { type: Boolean },
|
|
37
|
+
formatter: {},
|
|
38
|
+
parser: {},
|
|
39
|
+
decimalSeparator: { default: "." },
|
|
40
|
+
validator: {},
|
|
41
|
+
allowInput: {},
|
|
13
42
|
disabled: { type: Boolean },
|
|
14
43
|
readonly: { type: Boolean },
|
|
44
|
+
loading: { type: Boolean },
|
|
15
45
|
ariaLabel: {},
|
|
46
|
+
placeholder: {},
|
|
47
|
+
name: {},
|
|
48
|
+
error: {},
|
|
49
|
+
status: {},
|
|
16
50
|
showControls: { type: Boolean, default: !0 },
|
|
51
|
+
controlsPosition: { default: "both" },
|
|
17
52
|
selectOnFocus: { type: Boolean, default: !1 },
|
|
18
|
-
|
|
53
|
+
keyboard: { type: [Boolean, Object], default: !0 },
|
|
54
|
+
wheel: { type: Boolean },
|
|
55
|
+
repeat: { type: Boolean, default: !0 },
|
|
56
|
+
repeatDelay: { default: 450 },
|
|
57
|
+
repeatInterval: { default: 80 },
|
|
58
|
+
size: {},
|
|
59
|
+
bordered: { type: Boolean, default: !0 },
|
|
60
|
+
round: { type: Boolean },
|
|
61
|
+
block: { type: Boolean },
|
|
62
|
+
autofocus: { type: Boolean },
|
|
63
|
+
align: { default: "center" }
|
|
19
64
|
},
|
|
20
|
-
emits: ["update:modelValue", "change", "input", "focus", "blur"],
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
65
|
+
emits: ["update:modelValue", "change", "input", "clear", "focus", "blur", "pressEnter", "step", "invalid"],
|
|
66
|
+
setup(i, { expose: $e, emit: Ie }) {
|
|
67
|
+
const t = i, f = Ie, Pe = ca(), Ae = Ke(), y = Se(sa, void 0), oe = Se(da, void 0), v = q(), me = qe(), {
|
|
68
|
+
disabled: Oe,
|
|
69
|
+
size: ze,
|
|
70
|
+
label: Ve
|
|
71
|
+
} = va(t), pe = Ge(t.defaultValue ?? null), w = s(
|
|
72
|
+
() => t.modelValue !== void 0 ? t.modelValue : pe.value
|
|
73
|
+
), C = s(() => o(w.value)), L = s(() => {
|
|
74
|
+
const e = o(t.step);
|
|
75
|
+
return e && e.units !== 0n ? { ...e, units: e.units < 0n ? -e.units : e.units } : o(1);
|
|
76
|
+
}), be = s(() => o(t.stepBase) ?? o(0)), h = s(
|
|
77
|
+
() => o(t.min) ?? (t.stringMode ? void 0 : o(Number.MIN_SAFE_INTEGER))
|
|
78
|
+
), k = s(
|
|
79
|
+
() => o(t.max) ?? (t.stringMode ? void 0 : o(Number.MAX_SAFE_INTEGER))
|
|
80
|
+
), J = s(
|
|
81
|
+
() => t.precision !== void 0 && Number.isFinite(t.precision) ? Math.min(
|
|
82
|
+
100,
|
|
83
|
+
Math.max(
|
|
84
|
+
0,
|
|
85
|
+
Math.floor(t.precision),
|
|
86
|
+
L.value.scale,
|
|
87
|
+
t.stepStrictly ? be.value.scale : 0
|
|
88
|
+
)
|
|
89
|
+
) : void 0
|
|
90
|
+
), R = s(() => ({
|
|
91
|
+
step: L.value,
|
|
92
|
+
base: be.value,
|
|
93
|
+
min: h.value,
|
|
94
|
+
max: k.value,
|
|
95
|
+
precision: J.value,
|
|
96
|
+
strict: t.stepStrictly
|
|
97
|
+
})), Q = s(
|
|
98
|
+
() => !Y(o(0), R.value)
|
|
99
|
+
), xe = s(
|
|
100
|
+
() => !!C.value && (!!h.value && F(C.value, h.value) < 0 || !!k.value && F(C.value, k.value) > 0)
|
|
101
|
+
), E = s(() => Oe.value || t.loading), $ = s(() => !E.value && !t.readonly), Fe = s(() => t.error || (y == null ? void 0 : y.error.value)), ye = s(
|
|
102
|
+
() => {
|
|
103
|
+
var e;
|
|
104
|
+
return !!Fe.value || !!((e = y == null ? void 0 : y.invalid) != null && e.value) || t.status === "error" || Q.value || xe.value;
|
|
105
|
+
}
|
|
106
|
+
), se = s(
|
|
107
|
+
() => {
|
|
108
|
+
var e;
|
|
109
|
+
return ye.value ? "error" : t.status ?? ((e = y == null ? void 0 : y.status) == null ? void 0 : e.value);
|
|
110
|
+
}
|
|
111
|
+
), T = s(
|
|
112
|
+
() => t.formatter || t.parser || t.allowInput || t.stringMode || t.decimalSeparator !== "." ? "text" : "number"
|
|
113
|
+
), P = q(""), M = q(!1), N = q(!1), he = q(!1);
|
|
114
|
+
let A = !0, Z = 0, _, ee, ae = !1, U, ke = "";
|
|
115
|
+
const de = (e, a) => e === null || a === null ? e === a : !!o(e) && !!o(a) && F(o(e), o(a)) === 0, ge = (e) => e === null ? "null" : o(e) ? p(o(e)) : "invalid", ve = (e) => {
|
|
116
|
+
const a = e ? Number(p(e)) : NaN;
|
|
117
|
+
return Number.isFinite(a) ? a : void 0;
|
|
118
|
+
};
|
|
119
|
+
function O(e) {
|
|
120
|
+
return t.stringMode ? p(e) : Number(p(e));
|
|
121
|
+
}
|
|
122
|
+
function j(e, a = !1, n = "") {
|
|
123
|
+
const r = o(e), u = r ? p(
|
|
124
|
+
J.value === void 0 ? r : fa(r, J.value),
|
|
125
|
+
J.value
|
|
126
|
+
) : "";
|
|
127
|
+
try {
|
|
128
|
+
return t.formatter ? String(t.formatter(e, { userTyping: a, input: n })) : t.decimalSeparator !== "." ? u.replace(".", t.decimalSeparator) : u;
|
|
129
|
+
} catch {
|
|
130
|
+
return u;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function H(e, a = !1) {
|
|
134
|
+
P.value = e, ke = e, v.value && (a || v.value.value !== e) && (v.value.value = e);
|
|
135
|
+
}
|
|
136
|
+
function m() {
|
|
137
|
+
M.value = !1, H(j(w.value), !0);
|
|
138
|
+
}
|
|
139
|
+
function Le() {
|
|
140
|
+
return Object.fromEntries(
|
|
141
|
+
Object.entries(Ae).filter(
|
|
142
|
+
([e]) => !["class", "style", "type"].includes(e)
|
|
143
|
+
)
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
function te(e) {
|
|
147
|
+
if (!e.trim()) return { kind: "empty" };
|
|
148
|
+
try {
|
|
149
|
+
const a = t.parser ? t.parser(e) : t.decimalSeparator !== "." ? e.replace(t.decimalSeparator, ".") : e, n = o(a);
|
|
150
|
+
return n ? { kind: "value", value: n } : { kind: "invalid" };
|
|
151
|
+
} catch {
|
|
152
|
+
return { kind: "invalid" };
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function ne(e, a, n = !0) {
|
|
156
|
+
try {
|
|
157
|
+
if (!t.validator || t.validator(e) === !0) return !0;
|
|
158
|
+
} catch {
|
|
159
|
+
}
|
|
160
|
+
return n && f("invalid", { input: a, reason: "validator" }), !1;
|
|
161
|
+
}
|
|
162
|
+
function le(e, a = !1) {
|
|
163
|
+
const n = ++Z;
|
|
164
|
+
de(w.value, e) || (_ = ge(e), t.modelValue === void 0 && (pe.value = e), f("update:modelValue", e), f("change", e)), a || (M.value = !1, H(j(e), !0)), ta(() => {
|
|
165
|
+
n !== Z || !A || (t.modelValue !== void 0 && !de(w.value, e) ? m() : a || H(j(w.value)), _ = void 0);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function fe() {
|
|
169
|
+
if (t.valueOnClear === "min")
|
|
170
|
+
return h.value ? O(h.value) : null;
|
|
171
|
+
if (t.valueOnClear === "max")
|
|
172
|
+
return k.value ? O(k.value) : null;
|
|
173
|
+
const e = o(t.valueOnClear);
|
|
174
|
+
return e ? O(e) : null;
|
|
175
|
+
}
|
|
176
|
+
function K(e = ((a) => (a = v.value) == null ? void 0 : a.value)() ?? P.value) {
|
|
177
|
+
var l;
|
|
178
|
+
if (!A || !$.value) return !1;
|
|
179
|
+
if (T.value === "number" && ((l = v.value) != null && l.validity.badInput) && e === v.value.value)
|
|
180
|
+
return f("invalid", { input: e, reason: "parse" }), m(), !1;
|
|
181
|
+
const n = te(e);
|
|
182
|
+
if (n.kind === "invalid")
|
|
183
|
+
return f("invalid", { input: e, reason: "parse" }), m(), !1;
|
|
184
|
+
if (Q.value)
|
|
185
|
+
return f("invalid", { input: e, reason: "range" }), m(), !1;
|
|
186
|
+
const r = n.kind === "value" ? Y(n.value, R.value) : void 0;
|
|
187
|
+
if (n.kind === "value" && !r)
|
|
188
|
+
return f("invalid", { input: e, reason: "range" }), m(), !1;
|
|
189
|
+
const u = r ? O(r) : fe();
|
|
190
|
+
return typeof u == "number" && !Number.isFinite(u) ? (f("invalid", { input: e, reason: "range" }), m(), !1) : ne(u, e) ? (le(u), !0) : (m(), !1);
|
|
191
|
+
}
|
|
192
|
+
function we() {
|
|
193
|
+
var a;
|
|
194
|
+
if (!$.value || !A) return;
|
|
195
|
+
const e = fe();
|
|
196
|
+
ne(e, "") && (le(e), f("input", e), f("clear"), (a = v.value) == null || a.focus());
|
|
197
|
+
}
|
|
198
|
+
function Me(e) {
|
|
199
|
+
if (!$.value || !A) return;
|
|
200
|
+
const a = e.target, n = a.value, r = a.selectionStart;
|
|
201
|
+
if (N.value) {
|
|
202
|
+
P.value = n;
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const u = () => {
|
|
206
|
+
const c = ke;
|
|
207
|
+
if (H(c, !0), r !== null) {
|
|
208
|
+
const x = Math.max(0, r - (n.length - c.length));
|
|
209
|
+
try {
|
|
210
|
+
a.setSelectionRange(x, x);
|
|
211
|
+
} catch {
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
try {
|
|
216
|
+
if (t.allowInput && t.allowInput(n) === !1) {
|
|
217
|
+
u();
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
} catch {
|
|
221
|
+
u();
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
M.value = !0;
|
|
225
|
+
const l = T.value === "number" && a.validity.badInput ? { kind: "invalid" } : te(n), V = l.kind === "value" ? O(l.value) : null;
|
|
226
|
+
if (H(
|
|
227
|
+
l.kind === "value" && t.formatter ? j(V, !0, n) : n
|
|
228
|
+
), r !== null && a.value !== n) {
|
|
229
|
+
const c = Math.max(0, a.value.length - (n.length - r));
|
|
230
|
+
try {
|
|
231
|
+
a.setSelectionRange(c, c);
|
|
232
|
+
} catch {
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (f("input", V), t.updateOnInput && l.kind !== "invalid" && !Q.value) {
|
|
236
|
+
const c = l.kind === "value" ? Y(l.value, R.value) : void 0, x = c ? O(c) : fe();
|
|
237
|
+
(typeof x != "number" || Number.isFinite(x)) && ne(x, n) && le(x, !0);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function ce(e) {
|
|
241
|
+
if (!$.value || Q.value) return !1;
|
|
242
|
+
const a = M.value ? te(P.value) : void 0, n = (a == null ? void 0 : a.kind) === "value" ? a.value : C.value;
|
|
243
|
+
if (!n) return !0;
|
|
244
|
+
if (e > 0 && k.value && F(n, k.value) >= 0 || e < 0 && h.value && F(n, h.value) <= 0)
|
|
245
|
+
return !1;
|
|
246
|
+
const r = Y(
|
|
247
|
+
ie(n, L.value, e),
|
|
248
|
+
R.value
|
|
249
|
+
);
|
|
250
|
+
return !r || F(r, n) !== e ? !1 : t.stringMode || Number(p(r)) !== Number(p(n));
|
|
251
|
+
}
|
|
252
|
+
const Be = s(() => !ce(-1)), Ce = s(() => !ce(1));
|
|
253
|
+
function z(e, a = 1, n = "method") {
|
|
254
|
+
if (!A || N.value || !ce(e)) return !1;
|
|
255
|
+
const r = Number.isFinite(a) ? Math.max(1, Math.min(1e6, Math.floor(a))) : 1, u = M.value ? te(P.value) : void 0, l = (u == null ? void 0 : u.kind) === "value" ? u.value : C.value ?? o(0), V = Y(
|
|
256
|
+
ie(l, L.value, e * r),
|
|
257
|
+
R.value
|
|
258
|
+
);
|
|
259
|
+
if (!V) return !1;
|
|
260
|
+
const c = O(V);
|
|
261
|
+
return typeof c == "number" && !Number.isFinite(c) || !ne(c, P.value) || de(w.value, c) && !M.value ? !1 : (le(c), f("step", c, {
|
|
262
|
+
offset: t.stringMode ? p(ie(V, l, -1)) : Number(p(ie(V, l, -1))),
|
|
263
|
+
type: e > 0 ? "up" : "down",
|
|
264
|
+
source: n
|
|
265
|
+
}), !0);
|
|
266
|
+
}
|
|
267
|
+
function b() {
|
|
268
|
+
clearTimeout(ee), ee = void 0, U == null || U(), U = void 0;
|
|
269
|
+
}
|
|
270
|
+
function re(e, a) {
|
|
271
|
+
var u;
|
|
272
|
+
if (a.button !== 0 || !$.value || (a.preventDefault(), b(), (u = v.value) == null || u.focus(), ae = !0, !z(e, 1, "button") || !t.repeat)) return;
|
|
273
|
+
const n = () => {
|
|
274
|
+
if (!z(e, 1, "repeat")) {
|
|
275
|
+
b();
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
ee = setTimeout(n, Math.max(20, t.repeatInterval));
|
|
279
|
+
};
|
|
280
|
+
ee = setTimeout(n, Math.max(0, t.repeatDelay));
|
|
281
|
+
const r = () => b();
|
|
282
|
+
document.addEventListener("pointerup", r, !0), document.addEventListener("pointercancel", r, !0), window.addEventListener("blur", r), U = () => {
|
|
283
|
+
document.removeEventListener("pointerup", r, !0), document.removeEventListener("pointercancel", r, !0), window.removeEventListener("blur", r);
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function ue(e, a) {
|
|
287
|
+
if (a.detail > 0 && ae) {
|
|
288
|
+
ae = !1;
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
ae = !1, z(e, 1, "button");
|
|
292
|
+
}
|
|
293
|
+
function Re(e) {
|
|
294
|
+
if (e.isComposing || N.value || e.keyCode === 229) return;
|
|
295
|
+
if (e.key === "Enter") {
|
|
296
|
+
$.value && (K(), f("pressEnter", e));
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
if (e.key === "Escape") {
|
|
300
|
+
M.value && (e.preventDefault(), m());
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
if (!["ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(
|
|
304
|
+
e.key
|
|
305
|
+
) || !$.value) return;
|
|
306
|
+
if (!(t.keyboard !== !1 && (typeof t.keyboard != "object" || t.keyboard[e.key] !== !1))) {
|
|
307
|
+
(e.key === "ArrowUp" || e.key === "ArrowDown") && e.preventDefault();
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (e.key === "Home" || e.key === "End") {
|
|
311
|
+
const n = e.key === "Home" ? t.min === void 0 ? void 0 : h.value : t.max === void 0 ? void 0 : k.value;
|
|
312
|
+
n && (e.preventDefault(), K(p(n)));
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
e.preventDefault(), z(
|
|
316
|
+
e.key === "ArrowUp" || e.key === "PageUp" ? 1 : -1,
|
|
317
|
+
e.key.startsWith("Page") || e.shiftKey ? 10 : 1,
|
|
318
|
+
"keyboard"
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
function Te(e) {
|
|
322
|
+
if (!(!$.value || document.activeElement !== v.value || !e.deltaY || e.ctrlKey)) {
|
|
323
|
+
if (!t.wheel) {
|
|
324
|
+
T.value === "number" && e.preventDefault();
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
e.preventDefault(), z(e.deltaY < 0 ? 1 : -1, 1, "wheel");
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function Ue(e) {
|
|
331
|
+
var a;
|
|
332
|
+
t.selectOnFocus && ((a = v.value) == null || a.select()), f("focus", e);
|
|
333
|
+
}
|
|
334
|
+
function je(e) {
|
|
335
|
+
b(), M.value && !N.value && K(), f("blur", e);
|
|
336
|
+
}
|
|
337
|
+
function Ee() {
|
|
338
|
+
var e, a;
|
|
339
|
+
he.value = !!((a = (e = v.value) == null ? void 0 : e.labels) != null && a.length);
|
|
340
|
+
}
|
|
341
|
+
G(
|
|
342
|
+
w,
|
|
343
|
+
() => {
|
|
344
|
+
_ === ge(w.value) && M.value && t.updateOnInput || m();
|
|
345
|
+
},
|
|
346
|
+
{ flush: "sync" }
|
|
347
|
+
), G(
|
|
348
|
+
() => oe == null ? void 0 : oe.resetting.value,
|
|
349
|
+
(e) => {
|
|
350
|
+
e && (Z++, _ = void 0, N.value = !1, b(), m());
|
|
351
|
+
},
|
|
352
|
+
{ flush: "sync" }
|
|
353
|
+
), G(
|
|
354
|
+
() => [
|
|
355
|
+
t.formatter,
|
|
356
|
+
t.parser,
|
|
357
|
+
t.decimalSeparator,
|
|
358
|
+
t.precision,
|
|
359
|
+
t.step,
|
|
360
|
+
t.stepStrictly,
|
|
361
|
+
t.stringMode
|
|
362
|
+
],
|
|
363
|
+
() => {
|
|
364
|
+
b(), M.value || m();
|
|
365
|
+
}
|
|
366
|
+
), G(() => [t.min, t.max], b), G(
|
|
367
|
+
() => [
|
|
368
|
+
E.value,
|
|
369
|
+
t.readonly,
|
|
370
|
+
t.showControls,
|
|
371
|
+
t.controlsPosition
|
|
372
|
+
],
|
|
373
|
+
() => {
|
|
374
|
+
b(), (E.value || t.readonly) && (N.value = !1, m());
|
|
375
|
+
}
|
|
376
|
+
);
|
|
377
|
+
function Ne() {
|
|
378
|
+
A = !1, Z++, b(), N.value = !1, m();
|
|
379
|
+
}
|
|
380
|
+
return We(() => {
|
|
381
|
+
var e;
|
|
382
|
+
m(), Ee(), t.autofocus && !E.value && ((e = v.value) == null || e.focus());
|
|
383
|
+
}), Xe(Ee), Ye(() => {
|
|
384
|
+
A = !0;
|
|
385
|
+
}), Je(Ne), Qe(Ne), $e({
|
|
386
|
+
input: v,
|
|
387
|
+
focus: (e) => {
|
|
388
|
+
var a;
|
|
389
|
+
E.value || (a = v.value) == null || a.focus(e);
|
|
390
|
+
},
|
|
391
|
+
blur: () => {
|
|
392
|
+
var e;
|
|
393
|
+
return (e = v.value) == null ? void 0 : e.blur();
|
|
394
|
+
},
|
|
395
|
+
select: () => {
|
|
396
|
+
var e;
|
|
397
|
+
return (e = v.value) == null ? void 0 : e.select();
|
|
398
|
+
},
|
|
399
|
+
clear: we,
|
|
400
|
+
commit: K,
|
|
401
|
+
increase: (e) => z(1, e),
|
|
402
|
+
decrease: (e) => z(-1, e)
|
|
403
|
+
}), (e, a) => {
|
|
404
|
+
var n, r, u;
|
|
405
|
+
return g(), B("div", De(d(Pe), {
|
|
406
|
+
class: ["hys-ui-number-wrap", [
|
|
407
|
+
e.$attrs.class,
|
|
408
|
+
"hys-ui-number-" + d(ze),
|
|
409
|
+
{ "hys-ui-number-block": i.block }
|
|
410
|
+
]],
|
|
411
|
+
style: e.$attrs.style
|
|
412
|
+
}), [
|
|
413
|
+
I("div", ma, [
|
|
414
|
+
e.$slots.prepend ? (g(), B("span", pa, [
|
|
415
|
+
S(e.$slots, "prepend", {}, void 0, !0)
|
|
416
|
+
])) : D("", !0),
|
|
417
|
+
I("div", {
|
|
418
|
+
class: Ze(["hys-ui-ex-number", [
|
|
419
|
+
"hys-ui-number-" + i.controlsPosition,
|
|
420
|
+
{
|
|
421
|
+
"hys-ui-ex-number-disabled": E.value,
|
|
422
|
+
"hys-ui-number-borderless": !i.bordered,
|
|
423
|
+
"hys-ui-number-round": i.round,
|
|
424
|
+
"hys-ui-number-error": se.value === "error",
|
|
425
|
+
"hys-ui-number-warning": se.value === "warning",
|
|
426
|
+
"hys-ui-number-success": se.value === "success"
|
|
427
|
+
}
|
|
428
|
+
]])
|
|
429
|
+
}, [
|
|
430
|
+
I("div", ba, [
|
|
431
|
+
I("input", De({
|
|
432
|
+
ref_key: "input",
|
|
433
|
+
ref: v
|
|
434
|
+
}, Le(), {
|
|
435
|
+
id: e.$attrs.id || ((n = d(y)) == null ? void 0 : n.id.value) || void 0,
|
|
436
|
+
type: T.value,
|
|
437
|
+
role: T.value === "text" ? "spinbutton" : void 0,
|
|
438
|
+
inputmode: e.$attrs.inputmode || "decimal",
|
|
439
|
+
"aria-label": i.ariaLabel || e.$attrs["aria-label"] || d(Ve) || (he.value ? void 0 : "数值"),
|
|
440
|
+
"aria-valuenow": ve(C.value),
|
|
441
|
+
"aria-valuetext": C.value ? j(w.value) : void 0,
|
|
442
|
+
"aria-valuemin": ve(h.value),
|
|
443
|
+
"aria-valuemax": ve(k.value),
|
|
444
|
+
"aria-invalid": ye.value || void 0,
|
|
445
|
+
"aria-required": ((r = d(y)) == null ? void 0 : r.required.value) || void 0,
|
|
446
|
+
"aria-describedby": [
|
|
447
|
+
i.error ? d(me) : (u = d(y)) == null ? void 0 : u.describedBy.value,
|
|
448
|
+
e.$attrs["aria-describedby"]
|
|
449
|
+
].filter(Boolean).join(" ") || void 0,
|
|
450
|
+
"data-hys-ui-field-managed": "",
|
|
451
|
+
value: P.value,
|
|
452
|
+
min: h.value ? d(p)(h.value) : void 0,
|
|
453
|
+
max: k.value ? d(p)(k.value) : void 0,
|
|
454
|
+
step: d(p)(L.value),
|
|
455
|
+
disabled: E.value,
|
|
456
|
+
readonly: i.readonly,
|
|
457
|
+
placeholder: i.placeholder,
|
|
458
|
+
style: { textAlign: i.align },
|
|
459
|
+
onInput: Me,
|
|
460
|
+
onChange: a[0] || (a[0] = (l) => K()),
|
|
461
|
+
onFocus: Ue,
|
|
462
|
+
onBlur: je,
|
|
463
|
+
onKeydown: Re,
|
|
464
|
+
onWheel: Te,
|
|
465
|
+
onCompositionstart: a[1] || (a[1] = (l) => N.value = !0),
|
|
466
|
+
onCompositionend: a[2] || (a[2] = (l) => {
|
|
467
|
+
N.value = !1, Me(l);
|
|
468
|
+
})
|
|
469
|
+
}), null, 16, ya),
|
|
470
|
+
e.$slots.prefix ? (g(), B("span", ha, [
|
|
471
|
+
S(e.$slots, "prefix", {}, void 0, !0)
|
|
472
|
+
])) : D("", !0),
|
|
473
|
+
e.$slots.suffix ? (g(), B("span", ka, [
|
|
474
|
+
S(e.$slots, "suffix", {}, void 0, !0)
|
|
475
|
+
])) : D("", !0),
|
|
476
|
+
i.loading ? (g(), _e(d(na), {
|
|
477
|
+
key: 2,
|
|
478
|
+
size: 15,
|
|
479
|
+
class: "hys-ui-icon-spin hys-ui-number-loading"
|
|
480
|
+
})) : D("", !0),
|
|
481
|
+
i.clearable && w.value !== null && !E.value && !i.readonly ? (g(), B("button", {
|
|
482
|
+
key: 3,
|
|
483
|
+
type: "button",
|
|
484
|
+
class: "hys-ui-number-clear",
|
|
485
|
+
"aria-label": "清空数值",
|
|
486
|
+
onMousedown: a[3] || (a[3] = W(() => {
|
|
487
|
+
}, ["prevent"])),
|
|
488
|
+
onClick: we
|
|
489
|
+
}, [
|
|
490
|
+
S(e.$slots, "clear-icon", {}, () => [
|
|
491
|
+
X(d(la), { size: 13 })
|
|
492
|
+
], !0)
|
|
493
|
+
], 32)) : D("", !0)
|
|
494
|
+
]),
|
|
495
|
+
i.showControls && i.controlsPosition === "both" ? (g(), B(ea, { key: 0 }, [
|
|
496
|
+
I("button", {
|
|
497
|
+
type: "button",
|
|
498
|
+
class: "hys-ui-number-decrease",
|
|
499
|
+
"aria-label": "减少",
|
|
500
|
+
disabled: Be.value,
|
|
501
|
+
onMousedown: a[4] || (a[4] = W(() => {
|
|
502
|
+
}, ["prevent"])),
|
|
503
|
+
onPointerdown: a[5] || (a[5] = (l) => re(-1, l)),
|
|
504
|
+
onPointerleave: b,
|
|
505
|
+
onClick: a[6] || (a[6] = (l) => ue(-1, l))
|
|
506
|
+
}, [
|
|
507
|
+
S(e.$slots, "decrease-icon", {}, () => [
|
|
508
|
+
X(d(ra), { size: 16 })
|
|
509
|
+
], !0)
|
|
510
|
+
], 40, ga),
|
|
511
|
+
I("button", {
|
|
512
|
+
type: "button",
|
|
513
|
+
class: "hys-ui-number-increase",
|
|
514
|
+
"aria-label": "增加",
|
|
515
|
+
disabled: Ce.value,
|
|
516
|
+
onMousedown: a[7] || (a[7] = W(() => {
|
|
517
|
+
}, ["prevent"])),
|
|
518
|
+
onPointerdown: a[8] || (a[8] = (l) => re(1, l)),
|
|
519
|
+
onPointerleave: b,
|
|
520
|
+
onClick: a[9] || (a[9] = (l) => ue(1, l))
|
|
521
|
+
}, [
|
|
522
|
+
S(e.$slots, "increase-icon", {}, () => [
|
|
523
|
+
X(d(ua), { size: 16 })
|
|
524
|
+
], !0)
|
|
525
|
+
], 40, wa)
|
|
526
|
+
], 64)) : i.showControls ? (g(), B("div", Ma, [
|
|
527
|
+
I("button", {
|
|
528
|
+
type: "button",
|
|
529
|
+
"aria-label": "增加",
|
|
530
|
+
disabled: Ce.value,
|
|
531
|
+
onMousedown: a[10] || (a[10] = W(() => {
|
|
532
|
+
}, ["prevent"])),
|
|
533
|
+
onPointerdown: a[11] || (a[11] = (l) => re(1, l)),
|
|
534
|
+
onPointerleave: b,
|
|
535
|
+
onClick: a[12] || (a[12] = (l) => ue(1, l))
|
|
536
|
+
}, [
|
|
537
|
+
S(e.$slots, "increase-icon", {}, () => [
|
|
538
|
+
X(d(ia), { size: 13 })
|
|
539
|
+
], !0)
|
|
540
|
+
], 40, Ba),
|
|
541
|
+
I("button", {
|
|
542
|
+
type: "button",
|
|
543
|
+
"aria-label": "减少",
|
|
544
|
+
disabled: Be.value,
|
|
545
|
+
onMousedown: a[13] || (a[13] = W(() => {
|
|
546
|
+
}, ["prevent"])),
|
|
547
|
+
onPointerdown: a[14] || (a[14] = (l) => re(-1, l)),
|
|
548
|
+
onPointerleave: b,
|
|
549
|
+
onClick: a[15] || (a[15] = (l) => ue(-1, l))
|
|
550
|
+
}, [
|
|
551
|
+
S(e.$slots, "decrease-icon", {}, () => [
|
|
552
|
+
X(d(oa), { size: 13 })
|
|
553
|
+
], !0)
|
|
554
|
+
], 40, Ca)
|
|
555
|
+
])) : D("", !0)
|
|
556
|
+
], 2),
|
|
557
|
+
e.$slots.append ? (g(), B("span", Ea, [
|
|
558
|
+
S(e.$slots, "append", {}, void 0, !0)
|
|
559
|
+
])) : D("", !0)
|
|
560
|
+
]),
|
|
561
|
+
i.name ? (g(), B("input", {
|
|
562
|
+
key: 0,
|
|
563
|
+
type: "hidden",
|
|
564
|
+
name: i.name,
|
|
565
|
+
value: C.value ? d(p)(C.value) : "",
|
|
566
|
+
disabled: E.value
|
|
567
|
+
}, null, 8, Na)) : D("", !0),
|
|
568
|
+
i.error ? (g(), B("small", {
|
|
569
|
+
key: 1,
|
|
570
|
+
id: d(me),
|
|
571
|
+
class: "hys-ui-number-error-text",
|
|
572
|
+
role: "alert"
|
|
573
|
+
}, aa(i.error), 9, Sa)) : D("", !0)
|
|
574
|
+
], 16);
|
|
25
575
|
};
|
|
26
|
-
function h(t) {
|
|
27
|
-
let e = Number.isFinite(t) ? t : 0;
|
|
28
|
-
return a.stepStrictly && (e = Math.round(e / i.value) * i.value), e = Math.min(a.max ?? 1 / 0, Math.max(a.min ?? -1 / 0, e)), Number(e.toFixed(Math.min(12, Math.max(0, a.precision ?? Math.max(s(i.value), s(a.modelValue), s(e))))));
|
|
29
|
-
}
|
|
30
|
-
function o(t) {
|
|
31
|
-
if (a.disabled || a.readonly) return;
|
|
32
|
-
const e = h(t);
|
|
33
|
-
e !== a.modelValue ? (d("update:modelValue", e), d("change", e)) : u.value && (u.value.value = String(e));
|
|
34
|
-
}
|
|
35
|
-
function k(t) {
|
|
36
|
-
if (a.disabled || a.readonly) return;
|
|
37
|
-
const e = t.target;
|
|
38
|
-
d("input", e.value !== "" && Number.isFinite(e.valueAsNumber) ? e.valueAsNumber : null);
|
|
39
|
-
}
|
|
40
|
-
function N(t) {
|
|
41
|
-
t.key === "ArrowUp" || t.key === "ArrowDown" ? (t.preventDefault(), o(a.modelValue + (t.key === "ArrowUp" ? i.value : -i.value))) : t.key === "Home" && a.min !== void 0 ? (t.preventDefault(), o(a.min)) : t.key === "End" && a.max !== void 0 && (t.preventDefault(), o(a.max));
|
|
42
|
-
}
|
|
43
|
-
return v({ focus: () => {
|
|
44
|
-
var t;
|
|
45
|
-
return (t = u.value) == null ? void 0 : t.focus();
|
|
46
|
-
}, blur: () => {
|
|
47
|
-
var t;
|
|
48
|
-
return (t = u.value) == null ? void 0 : t.blur();
|
|
49
|
-
}, select: () => {
|
|
50
|
-
var t;
|
|
51
|
-
return (t = u.value) == null ? void 0 : t.select();
|
|
52
|
-
} }), (t, e) => (m(), r("div", M(b(V), {
|
|
53
|
-
class: ["hys-ui-ex-number", [{ "hys-ui-ex-number-disabled": l.disabled }, "hys-ui-number-" + l.size]]
|
|
54
|
-
}), [
|
|
55
|
-
l.showControls ? (m(), r("button", {
|
|
56
|
-
key: 0,
|
|
57
|
-
type: "button",
|
|
58
|
-
"aria-label": "减少",
|
|
59
|
-
disabled: l.disabled || l.readonly || l.min !== void 0 && l.modelValue <= l.min,
|
|
60
|
-
onClick: e[0] || (e[0] = (n) => o(l.modelValue - i.value))
|
|
61
|
-
}, [
|
|
62
|
-
y(b(A), { size: 16 })
|
|
63
|
-
], 8, z)) : c("", !0),
|
|
64
|
-
B("input", {
|
|
65
|
-
ref_key: "input",
|
|
66
|
-
ref: u,
|
|
67
|
-
type: "number",
|
|
68
|
-
"aria-label": l.ariaLabel || "数值",
|
|
69
|
-
value: l.modelValue,
|
|
70
|
-
min: l.min,
|
|
71
|
-
max: l.max,
|
|
72
|
-
step: i.value,
|
|
73
|
-
disabled: l.disabled,
|
|
74
|
-
readonly: l.readonly,
|
|
75
|
-
onFocus: e[1] || (e[1] = (n) => {
|
|
76
|
-
var f;
|
|
77
|
-
l.selectOnFocus && ((f = u.value) == null || f.select()), d("focus", n);
|
|
78
|
-
}),
|
|
79
|
-
onBlur: e[2] || (e[2] = (n) => d("blur", n)),
|
|
80
|
-
onKeydown: N,
|
|
81
|
-
onInput: k,
|
|
82
|
-
onChange: e[3] || (e[3] = (n) => o(Number(n.target.value)))
|
|
83
|
-
}, null, 40, D),
|
|
84
|
-
l.showControls ? (m(), r("button", {
|
|
85
|
-
key: 1,
|
|
86
|
-
type: "button",
|
|
87
|
-
"aria-label": "增加",
|
|
88
|
-
disabled: l.disabled || l.readonly || l.max !== void 0 && l.modelValue >= l.max,
|
|
89
|
-
onClick: e[4] || (e[4] = (n) => o(l.modelValue + i.value))
|
|
90
|
-
}, [
|
|
91
|
-
y(b(F), { size: 16 })
|
|
92
|
-
], 8, I)) : c("", !0)
|
|
93
|
-
], 16));
|
|
94
576
|
}
|
|
95
577
|
});
|
|
96
578
|
export {
|
|
97
|
-
|
|
579
|
+
Oa as default
|
|
98
580
|
};
|