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,74 +1,341 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { defineComponent as ke, useSlots as ge, useAttrs as fe, ref as Q, onActivated as me, onDeactivated as we, useId as be, computed as a, openBlock as r, createElementBlock as l, mergeProps as Y, unref as A, Fragment as S, renderList as T, createCommentVNode as c, createElementVNode as m, withDirectives as xe, normalizeClass as H, vShow as Le, normalizeStyle as w, renderSlot as Z, normalizeProps as _, guardReactiveProps as ee, createBlock as te, resolveDynamicComponent as ae, createVNode as se } from "vue";
|
|
2
|
+
import { CircleX as Ce, AlertTriangle as Ae, CheckCircle2 as Se } from "lucide-vue-next";
|
|
3
|
+
import { useHysRootAttrs as Be } from "../../config.js";
|
|
4
|
+
import { progressId as Me, progressPercent as U, progressNumber as v, progressArc as re, progressPaint as oe, progressStatusColor as le, progressGradientCoordinates as Pe, progressCssPaint as G } from "../../composables/progress.js";
|
|
5
|
+
const Fe = ["data-status", "aria-label", "aria-valuenow", "aria-valuetext"], Ie = {
|
|
4
6
|
key: 0,
|
|
5
7
|
viewBox: "0 0 100 100",
|
|
6
|
-
"aria-hidden": "true"
|
|
7
|
-
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
class: "hys-ui-progress-svg"
|
|
10
|
+
}, Ve = { key: 0 }, ze = ["id"], De = ["offset", "stop-color"], Te = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "hys-ui-progress-ring-steps"
|
|
13
|
+
}, Ge = ["d", "stroke", "stroke-width", "stroke-linecap"], Ne = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-dasharray"], $e = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-dasharray"], Re = { key: 2 }, Ee = ["d", "stroke", "stroke-width", "stroke-linecap"], He = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-dasharray"], Ue = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-dasharray"], We = {
|
|
14
|
+
key: 2,
|
|
15
|
+
class: "hys-ui-progress-label hys-ui-progress-inside-label"
|
|
16
|
+
}, Oe = {
|
|
8
17
|
key: 2,
|
|
9
18
|
class: "hys-ui-progress-label"
|
|
10
|
-
},
|
|
19
|
+
}, Ke = /* @__PURE__ */ ke({
|
|
20
|
+
inheritAttrs: !1,
|
|
11
21
|
__name: "HysProgress",
|
|
12
22
|
props: {
|
|
13
23
|
value: {},
|
|
14
24
|
showLabel: { type: Boolean, default: !0 },
|
|
15
25
|
color: {},
|
|
16
26
|
status: { default: "normal" },
|
|
17
|
-
strokeWidth: {
|
|
27
|
+
strokeWidth: {},
|
|
18
28
|
type: { default: "line" },
|
|
19
|
-
width: {
|
|
29
|
+
width: {},
|
|
20
30
|
format: {},
|
|
21
|
-
indeterminate: { type: Boolean }
|
|
31
|
+
indeterminate: { type: Boolean },
|
|
32
|
+
size: { default: "md" },
|
|
33
|
+
textInside: { type: Boolean },
|
|
34
|
+
textColor: {},
|
|
35
|
+
precision: {},
|
|
36
|
+
showStatusIcon: { type: Boolean, default: !1 },
|
|
37
|
+
trailColor: {},
|
|
38
|
+
strokeLinecap: { default: "round" },
|
|
39
|
+
success: {},
|
|
40
|
+
steps: {},
|
|
41
|
+
stepGap: { default: 3 },
|
|
42
|
+
gapDegree: {},
|
|
43
|
+
gapPosition: { default: "bottom" },
|
|
44
|
+
striped: { type: Boolean },
|
|
45
|
+
stripedFlow: { type: Boolean },
|
|
46
|
+
animated: { type: Boolean, default: !0 },
|
|
47
|
+
duration: { default: 250 },
|
|
48
|
+
flowDuration: { default: 1300 },
|
|
49
|
+
ariaLabel: {},
|
|
50
|
+
ariaValueText: {}
|
|
22
51
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
52
|
+
setup(s, { expose: ie }) {
|
|
53
|
+
const e = s, N = ge(), ue = fe(), W = Be(), O = Q(), $ = Q(!0);
|
|
54
|
+
me(() => $.value = !0), we(() => $.value = !1);
|
|
55
|
+
const B = Me() + "-" + be().replaceAll(":", "-"), i = a(() => U(e.value)), u = a(
|
|
56
|
+
() => {
|
|
57
|
+
var t;
|
|
58
|
+
return Math.min(i.value, U((t = e.success) == null ? void 0 : t.value));
|
|
59
|
+
}
|
|
60
|
+
), k = a(
|
|
61
|
+
() => ["normal", "success", "warning", "error", "active"].includes(e.status) ? e.status : "normal"
|
|
62
|
+
), h = a(
|
|
63
|
+
() => e.type === "circle" || e.type === "dashboard"
|
|
64
|
+
), p = a(
|
|
65
|
+
() => ({
|
|
66
|
+
sm: { stroke: 4, width: 80, font: 11, roundFont: 14 },
|
|
67
|
+
md: { stroke: 7, width: 100, font: 12, roundFont: 16 },
|
|
68
|
+
lg: { stroke: 12, width: 132, font: 14, roundFont: 20 }
|
|
69
|
+
})[e.size] ?? { stroke: 7, width: 100, font: 12, roundFont: 16 }
|
|
70
|
+
), y = a(
|
|
71
|
+
() => v(
|
|
72
|
+
e.strokeWidth,
|
|
73
|
+
e.textInside && !h.value ? Math.max(p.value.stroke, Math.ceil(p.value.font * 1.8)) : p.value.stroke,
|
|
74
|
+
1,
|
|
75
|
+
h.value ? 48 : 100
|
|
76
|
+
)
|
|
77
|
+
), b = a(
|
|
78
|
+
() => typeof e.width == "string" ? e.width : v(e.width, p.value.width, 20, 2e3)
|
|
79
|
+
), M = a(() => Math.min(44, (100 - y.value) / 2 - 1)), x = a(
|
|
80
|
+
() => v(e.gapDegree, e.type === "dashboard" ? 75 : 0, 0, 295)
|
|
81
|
+
), X = a(
|
|
82
|
+
() => x.value ? ({ top: -90, right: 0, bottom: 90, left: 180 }[e.gapPosition] ?? 90) + x.value / 2 : -90
|
|
83
|
+
), R = a(
|
|
84
|
+
() => re(M.value, X.value, 360 - x.value)
|
|
85
|
+
), n = a(
|
|
86
|
+
() => e.indeterminate ? 0 : Math.floor(v(e.steps, 0, 0, 200))
|
|
87
|
+
), j = a(() => v(e.stepGap, 3, 0, 40)), P = a(
|
|
88
|
+
() => e.strokeLinecap === "butt" || !n.value ? y.value : Math.min(
|
|
89
|
+
y.value,
|
|
90
|
+
2 * Math.PI * M.value * (360 - x.value) / 360 / n.value * 0.5
|
|
91
|
+
)
|
|
92
|
+
), E = a(
|
|
93
|
+
() => !!e.textInside && !h.value && y.value >= p.value.font * 1.5
|
|
94
|
+
), g = (t, d) => U((t / 100 * n.value - d) * 100), L = a(
|
|
95
|
+
() => oe(e.color, i.value, le(k.value))
|
|
96
|
+
), f = a(
|
|
97
|
+
() => {
|
|
98
|
+
var t;
|
|
99
|
+
return oe(
|
|
100
|
+
(t = e.success) == null ? void 0 : t.color,
|
|
101
|
+
u.value,
|
|
102
|
+
le("success")
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
), F = (t) => t.gradient ? "url(#" + (t === f.value ? B + "-success" : B + "-main") + ")" : t.color, q = a(
|
|
106
|
+
() => [
|
|
107
|
+
{ id: B + "-main", paint: L.value },
|
|
108
|
+
{ id: B + "-success", paint: f.value }
|
|
109
|
+
].filter((t) => t.paint.gradient).map((t) => ({
|
|
110
|
+
...t,
|
|
111
|
+
coordinates: Pe(t.paint.gradient.angle)
|
|
112
|
+
}))
|
|
113
|
+
), ne = (t) => Array.isArray(e.color) && e.color.length && e.color.every((d) => typeof d == "string") ? e.color[t % e.color.length] : G(L.value), ce = (t) => Array.isArray(e.color) && e.color.length && e.color.every((d) => typeof d == "string") ? e.color[t % e.color.length] : F(L.value), de = a(
|
|
114
|
+
() => Array.from({ length: n.value }, (t, d) => {
|
|
115
|
+
const o = (360 - x.value) / n.value, C = Math.min(
|
|
116
|
+
o * 0.8,
|
|
117
|
+
(j.value + (e.strokeLinecap === "butt" ? 0 : P.value)) / M.value * 180 / Math.PI
|
|
118
|
+
);
|
|
119
|
+
return {
|
|
120
|
+
index: d,
|
|
121
|
+
path: re(
|
|
122
|
+
M.value,
|
|
123
|
+
X.value + d * o + C / 2,
|
|
124
|
+
o - C
|
|
125
|
+
)
|
|
126
|
+
};
|
|
127
|
+
})
|
|
128
|
+
), I = a(() => ({
|
|
129
|
+
value: i.value,
|
|
130
|
+
successValue: u.value,
|
|
131
|
+
status: k.value,
|
|
132
|
+
indeterminate: !!e.indeterminate
|
|
133
|
+
})), V = a(
|
|
134
|
+
() => e.format ? e.format(i.value, u.value) : e.precision === void 0 ? i.value + "%" : i.value.toFixed(
|
|
135
|
+
Math.floor(v(e.precision, 0, 0, 6))
|
|
136
|
+
) + "%"
|
|
137
|
+
), z = a(
|
|
138
|
+
() => ({ success: Se, warning: Ae, error: Ce })[k.value]
|
|
139
|
+
), J = () => {
|
|
140
|
+
var t;
|
|
141
|
+
return ((t = N.default) == null ? void 0 : t.call(N, I.value)) ?? V.value;
|
|
142
|
+
}, ve = a(
|
|
143
|
+
() => typeof e.ariaValueText == "function" ? e.ariaValueText(I.value) : e.ariaValueText ?? (e.indeterminate ? "处理中" : typeof V.value == "string" || typeof V.value == "number" ? String(V.value) : i.value + "%")
|
|
144
|
+
), K = a(
|
|
145
|
+
() => e.animated && $.value && W.value["data-hys-motion"] !== "off"
|
|
146
|
+
), he = a(
|
|
147
|
+
() => K.value && v(e.flowDuration, 1300, 0, 3e4) > 0
|
|
148
|
+
), pe = a(() => ({
|
|
149
|
+
"--hys-ui-progress-duration": (K.value ? v(e.duration, 250, 0, 5e3) : 0) + "ms",
|
|
150
|
+
"--hys-ui-progress-flow-duration": v(e.flowDuration, 1300, 1, 3e4) + "ms",
|
|
151
|
+
"--hys-ui-progress-text": e.textColor || "var(--hys-ui-text,var(--hys-ui-theme-text))",
|
|
152
|
+
"--hys-ui-progress-font": (h.value ? Math.min(
|
|
153
|
+
p.value.roundFont,
|
|
154
|
+
typeof b.value == "number" ? b.value / 4 : p.value.roundFont
|
|
155
|
+
) : p.value.font) + "px",
|
|
156
|
+
"--hys-ui-progress-radius": e.strokeLinecap === "round" ? "999px" : "0px",
|
|
157
|
+
...h.value ? {
|
|
158
|
+
width: typeof b.value == "number" ? b.value + "px" : b.value,
|
|
159
|
+
aspectRatio: "1"
|
|
160
|
+
} : {}
|
|
161
|
+
})), D = a(
|
|
162
|
+
() => e.trailColor || "var(--hys-ui-border,var(--hys-ui-theme-border))"
|
|
163
|
+
);
|
|
164
|
+
return ie({ element: O, value: i, successValue: u, status: k }), (t, d) => (r(), l("div", Y({
|
|
165
|
+
ref_key: "element",
|
|
166
|
+
ref: O
|
|
167
|
+
}, { ...A(W), ...A(ue) }, {
|
|
168
|
+
class: ["hys-ui-progress-line", {
|
|
169
|
+
"hys-ui-progress-circle": h.value,
|
|
170
|
+
"hys-ui-progress-dashboard": s.type === "dashboard",
|
|
171
|
+
"hys-ui-progress-inside": E.value,
|
|
172
|
+
"hys-ui-progress-no-label": !s.showLabel,
|
|
173
|
+
"hys-ui-progress-flow": he.value,
|
|
174
|
+
"hys-ui-progress-striped": s.striped,
|
|
175
|
+
"hys-ui-progress-striped-flow": s.stripedFlow,
|
|
176
|
+
"hys-ui-progress-active": k.value === "active",
|
|
177
|
+
"hys-ui-progress-unknown": s.indeterminate
|
|
178
|
+
}],
|
|
179
|
+
style: pe.value,
|
|
180
|
+
"data-status": k.value,
|
|
27
181
|
role: "progressbar",
|
|
28
|
-
"aria-
|
|
182
|
+
"aria-label": s.ariaLabel,
|
|
183
|
+
"aria-valuenow": s.indeterminate ? void 0 : i.value,
|
|
184
|
+
"aria-valuetext": ve.value,
|
|
29
185
|
"aria-valuemin": "0",
|
|
30
|
-
"aria-valuemax": "100"
|
|
31
|
-
style: e.type === "circle" ? { width: e.width + "px", height: e.width + "px" } : void 0
|
|
186
|
+
"aria-valuemax": "100"
|
|
32
187
|
}), [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
188
|
+
h.value ? (r(), l("svg", Ie, [
|
|
189
|
+
q.value.length ? (r(), l("defs", Ve, [
|
|
190
|
+
(r(!0), l(S, null, T(q.value, (o) => (r(), l("linearGradient", Y({
|
|
191
|
+
id: o.id,
|
|
192
|
+
key: o.id,
|
|
193
|
+
gradientUnits: "userSpaceOnUse"
|
|
194
|
+
}, { ref_for: !0 }, o.coordinates), [
|
|
195
|
+
(r(!0), l(S, null, T(o.paint.gradient.stops, (C, ye) => (r(), l("stop", {
|
|
196
|
+
key: ye,
|
|
197
|
+
offset: C.offset + "%",
|
|
198
|
+
"stop-color": C.color
|
|
199
|
+
}, null, 8, De))), 128))
|
|
200
|
+
], 16, ze))), 128))
|
|
201
|
+
])) : c("", !0),
|
|
202
|
+
n.value ? (r(), l("g", Te, [
|
|
203
|
+
(r(!0), l(S, null, T(de.value, (o) => (r(), l("g", {
|
|
204
|
+
key: o.index
|
|
205
|
+
}, [
|
|
206
|
+
m("path", {
|
|
207
|
+
d: o.path,
|
|
208
|
+
stroke: D.value,
|
|
209
|
+
"stroke-width": P.value,
|
|
210
|
+
"stroke-linecap": s.strokeLinecap,
|
|
211
|
+
fill: "none"
|
|
212
|
+
}, null, 8, Ge),
|
|
213
|
+
g(i.value, o.index) > 0 ? (r(), l("path", {
|
|
214
|
+
key: 0,
|
|
215
|
+
class: "hys-ui-progress-ring-fill",
|
|
216
|
+
d: o.path,
|
|
217
|
+
pathLength: "100",
|
|
218
|
+
stroke: ce(o.index),
|
|
219
|
+
"stroke-width": P.value,
|
|
220
|
+
"stroke-linecap": s.strokeLinecap,
|
|
221
|
+
"stroke-dasharray": g(i.value, o.index) + " 100",
|
|
222
|
+
fill: "none"
|
|
223
|
+
}, null, 8, Ne)) : c("", !0),
|
|
224
|
+
g(u.value, o.index) > 0 ? (r(), l("path", {
|
|
225
|
+
key: 1,
|
|
226
|
+
class: "hys-ui-progress-ring-success",
|
|
227
|
+
d: o.path,
|
|
228
|
+
pathLength: "100",
|
|
229
|
+
stroke: F(f.value),
|
|
230
|
+
"stroke-width": P.value,
|
|
231
|
+
"stroke-linecap": s.strokeLinecap,
|
|
232
|
+
"stroke-dasharray": g(u.value, o.index) + " 100",
|
|
233
|
+
fill: "none"
|
|
234
|
+
}, null, 8, $e)) : c("", !0)
|
|
235
|
+
]))), 128))
|
|
236
|
+
])) : (r(), l("g", Re, [
|
|
237
|
+
m("path", {
|
|
238
|
+
class: "hys-ui-progress-ring-trail",
|
|
239
|
+
d: R.value,
|
|
240
|
+
stroke: D.value,
|
|
241
|
+
"stroke-width": y.value,
|
|
242
|
+
"stroke-linecap": s.strokeLinecap,
|
|
243
|
+
fill: "none"
|
|
244
|
+
}, null, 8, Ee),
|
|
245
|
+
xe(m("path", {
|
|
246
|
+
class: H(["hys-ui-progress-ring-fill", { "hys-ui-progress-ring-indeterminate": s.indeterminate }]),
|
|
247
|
+
d: R.value,
|
|
248
|
+
pathLength: "100",
|
|
249
|
+
stroke: F(L.value),
|
|
250
|
+
"stroke-width": y.value,
|
|
251
|
+
"stroke-linecap": s.strokeLinecap,
|
|
252
|
+
"stroke-dasharray": (s.indeterminate ? 25 : i.value) + " 100",
|
|
253
|
+
fill: "none"
|
|
254
|
+
}, null, 10, He), [
|
|
255
|
+
[Le, s.indeterminate || i.value > 0]
|
|
256
|
+
]),
|
|
257
|
+
u.value > 0 && !s.indeterminate ? (r(), l("path", {
|
|
258
|
+
key: 0,
|
|
259
|
+
class: "hys-ui-progress-ring-success",
|
|
260
|
+
d: R.value,
|
|
261
|
+
pathLength: "100",
|
|
262
|
+
stroke: F(f.value),
|
|
263
|
+
"stroke-width": y.value,
|
|
264
|
+
"stroke-linecap": s.strokeLinecap,
|
|
265
|
+
"stroke-dasharray": u.value + " 100",
|
|
266
|
+
fill: "none"
|
|
267
|
+
}, null, 8, Ue)) : c("", !0)
|
|
268
|
+
]))
|
|
269
|
+
])) : (r(), l("div", {
|
|
55
270
|
key: 1,
|
|
56
|
-
class: "hys-ui-progress-track",
|
|
57
|
-
style:
|
|
271
|
+
class: H(["hys-ui-progress-track", { "hys-ui-progress-steps": n.value }]),
|
|
272
|
+
style: w({
|
|
273
|
+
height: y.value + "px",
|
|
274
|
+
background: n.value ? "transparent" : D.value,
|
|
275
|
+
gap: j.value + "px"
|
|
276
|
+
})
|
|
58
277
|
}, [
|
|
59
|
-
o("
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
278
|
+
n.value ? (r(!0), l(S, { key: 0 }, T(n.value, (o) => (r(), l("span", {
|
|
279
|
+
key: o,
|
|
280
|
+
class: "hys-ui-progress-step",
|
|
281
|
+
style: w({ background: D.value })
|
|
282
|
+
}, [
|
|
283
|
+
m("i", {
|
|
284
|
+
class: "hys-ui-progress-fill",
|
|
285
|
+
style: w({
|
|
286
|
+
width: g(i.value, o - 1) + "%",
|
|
287
|
+
background: ne(o - 1)
|
|
288
|
+
})
|
|
289
|
+
}, null, 4),
|
|
290
|
+
u.value > 0 ? (r(), l("i", {
|
|
291
|
+
key: 0,
|
|
292
|
+
class: "hys-ui-progress-success",
|
|
293
|
+
style: w({
|
|
294
|
+
width: g(u.value, o - 1) + "%",
|
|
295
|
+
background: A(G)(f.value)
|
|
296
|
+
})
|
|
297
|
+
}, null, 4)) : c("", !0)
|
|
298
|
+
], 4))), 128)) : (r(), l(S, { key: 1 }, [
|
|
299
|
+
m("div", {
|
|
300
|
+
class: H(["hys-ui-progress-fill hys-ui-motion-progress", { "hys-ui-progress-indeterminate": s.indeterminate }]),
|
|
301
|
+
style: w({
|
|
302
|
+
width: (s.indeterminate ? 35 : i.value) + "%",
|
|
303
|
+
background: A(G)(L.value)
|
|
304
|
+
})
|
|
305
|
+
}, null, 6),
|
|
306
|
+
u.value > 0 && !s.indeterminate ? (r(), l("div", {
|
|
307
|
+
key: 0,
|
|
308
|
+
class: "hys-ui-progress-success",
|
|
309
|
+
style: w({
|
|
310
|
+
width: u.value + "%",
|
|
311
|
+
background: A(G)(f.value)
|
|
312
|
+
})
|
|
313
|
+
}, null, 4)) : c("", !0)
|
|
314
|
+
], 64)),
|
|
315
|
+
s.showLabel && E.value ? (r(), l("span", We, [
|
|
316
|
+
m("span", null, [
|
|
317
|
+
s.showStatusIcon && (z.value || t.$slots.icon) ? Z(t.$slots, "icon", _(ee(I.value)), () => [
|
|
318
|
+
(r(), te(ae(z.value), {
|
|
319
|
+
size: 14,
|
|
320
|
+
"aria-hidden": "true"
|
|
321
|
+
}))
|
|
322
|
+
], !0, 0) : c("", !0),
|
|
323
|
+
se(J)
|
|
324
|
+
])
|
|
325
|
+
])) : c("", !0)
|
|
326
|
+
], 6)),
|
|
327
|
+
s.showLabel && !E.value ? (r(), l("span", Oe, [
|
|
328
|
+
s.showStatusIcon && (z.value || t.$slots.icon) ? Z(t.$slots, "icon", _(ee(I.value)), () => [
|
|
329
|
+
(r(), te(ae(z.value), {
|
|
330
|
+
size: h.value ? 18 : 14,
|
|
331
|
+
"aria-hidden": "true"
|
|
332
|
+
}, null, 8, ["size"]))
|
|
333
|
+
], !0, 0) : c("", !0),
|
|
334
|
+
se(J)
|
|
335
|
+
])) : c("", !0)
|
|
336
|
+
], 16, Fe));
|
|
70
337
|
}
|
|
71
338
|
});
|
|
72
339
|
export {
|
|
73
|
-
|
|
340
|
+
Ke as default
|
|
74
341
|
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { defineComponent as Y, inject as M, useAttrs as Z, ref as p, useId as g, computed as d, watch as _, onMounted as ee, onActivated as ae, onDeactivated as te, onBeforeUnmount as le, openBlock as O, createElementBlock as R, mergeProps as I, unref as l, createElementVNode as S, renderSlot as $, createTextVNode as oe, toDisplayString as K, createCommentVNode as ie } from "vue";
|
|
2
|
+
import { fieldKey as re, useHysControlState as de } from "../../composables/formContext.js";
|
|
3
|
+
import { radioGroupKey as ue, isChoice as se } from "../../composables/choice.js";
|
|
4
|
+
import { useChoiceModel as ne, useChoiceNativeReset as ve } from "../../composables/choiceModel.js";
|
|
5
|
+
import { useHysRootAttrs as ce } from "../../config.js";
|
|
6
|
+
const fe = ["data-status"], be = ["id", "data-hys-ui-radio-controlled", "name", "form", "value", "checked", "disabled", "required", "aria-readonly", "aria-label", "aria-invalid", "aria-describedby", "tabindex"], me = {
|
|
7
|
+
class: "hys-ui-radio-box",
|
|
8
|
+
"aria-hidden": "true"
|
|
9
|
+
}, ye = { class: "hys-ui-radio-label" }, he = ["id"], Ee = /* @__PURE__ */ Y({
|
|
10
|
+
inheritAttrs: !1,
|
|
11
|
+
__name: "HysRadio",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: { default: void 0 },
|
|
14
|
+
defaultValue: { default: void 0 },
|
|
15
|
+
value: { default: void 0 },
|
|
16
|
+
label: {},
|
|
17
|
+
disabled: { type: Boolean },
|
|
18
|
+
readonly: { type: Boolean },
|
|
19
|
+
size: {},
|
|
20
|
+
button: { type: Boolean, default: void 0 },
|
|
21
|
+
border: { type: Boolean, default: void 0 },
|
|
22
|
+
buttonStyle: {},
|
|
23
|
+
name: {},
|
|
24
|
+
form: {},
|
|
25
|
+
required: { type: Boolean },
|
|
26
|
+
ariaLabel: {},
|
|
27
|
+
tabindex: {},
|
|
28
|
+
focusable: { type: Boolean, default: !0 },
|
|
29
|
+
autofocus: { type: Boolean },
|
|
30
|
+
error: {},
|
|
31
|
+
status: {}
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
34
|
+
setup(i, { expose: T, emit: U }) {
|
|
35
|
+
const t = i, m = U, e = M(ue, void 0), s = M(re, void 0), y = Z(), W = ce(), u = p(), q = g(), A = de(t), x = ne(
|
|
36
|
+
t,
|
|
37
|
+
() => t.defaultValue ?? null
|
|
38
|
+
), n = d(() => se(t.value) ? t.value : "on"), v = d(
|
|
39
|
+
() => (e ? e.value.value : x.current.value) === n.value
|
|
40
|
+
), h = d(() => A.disabled.value || !!(e != null && e.disabled.value)), C = d(() => t.readonly || (e == null ? void 0 : e.readonly.value)), F = d(() => t.size ?? (e == null ? void 0 : e.size.value) ?? A.size.value), G = d(() => t.button ?? (e == null ? void 0 : e.button.value) ?? !1), P = d(() => t.border ?? (e == null ? void 0 : e.border.value) ?? !1), J = d(
|
|
41
|
+
() => t.buttonStyle ? t.buttonStyle === "solid" : (e == null ? void 0 : e.solid.value) ?? !1
|
|
42
|
+
), E = d(
|
|
43
|
+
() => {
|
|
44
|
+
var a, o;
|
|
45
|
+
return t.error || t.status === "error" || !e && ((a = s == null ? void 0 : s.invalid) != null && a.value) ? "error" : t.status ?? (e == null ? void 0 : e.status.value) ?? ((o = s == null ? void 0 : s.status) == null ? void 0 : o.value);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
function c() {
|
|
49
|
+
u.value && (u.value.checked = v.value);
|
|
50
|
+
}
|
|
51
|
+
async function j() {
|
|
52
|
+
var k, V;
|
|
53
|
+
if (!x.isLive() || h.value || C.value || v.value)
|
|
54
|
+
return c(), !1;
|
|
55
|
+
const a = e == null ? void 0 : e.select(n.value);
|
|
56
|
+
e && m("change", n.value);
|
|
57
|
+
const o = a ? await a : await x.commit(
|
|
58
|
+
n.value,
|
|
59
|
+
(r) => m("update:modelValue", r),
|
|
60
|
+
(r) => m("change", r),
|
|
61
|
+
!0
|
|
62
|
+
);
|
|
63
|
+
c();
|
|
64
|
+
const B = (k = u.value) == null ? void 0 : k.name;
|
|
65
|
+
if (!e && B)
|
|
66
|
+
for (const r of document.getElementsByName(B))
|
|
67
|
+
r instanceof HTMLInputElement && r.type === "radio" && r.form === ((V = u.value) == null ? void 0 : V.form) && r.hasAttribute("data-hys-ui-radio-controlled") && r.dispatchEvent(new Event("hys-ui-radio-sync"));
|
|
68
|
+
return o;
|
|
69
|
+
}
|
|
70
|
+
let b;
|
|
71
|
+
function w() {
|
|
72
|
+
e && !b && (b = e.register({
|
|
73
|
+
input: u,
|
|
74
|
+
value: d(() => n.value),
|
|
75
|
+
disabled: d(() => !!t.disabled),
|
|
76
|
+
locked: d(() => !!t.disabled || !!t.readonly)
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
function z() {
|
|
80
|
+
b == null || b(), b = void 0;
|
|
81
|
+
}
|
|
82
|
+
_(v, c, { flush: "post" }), ve(
|
|
83
|
+
u,
|
|
84
|
+
x.reset,
|
|
85
|
+
c,
|
|
86
|
+
() => t.form ?? (e == null ? void 0 : e.form.value)
|
|
87
|
+
), ee(() => {
|
|
88
|
+
var a;
|
|
89
|
+
c(), w(), t.autofocus && !h.value && ((a = u.value) == null || a.focus());
|
|
90
|
+
}), ae(w), te(z), le(z);
|
|
91
|
+
const Q = () => Object.fromEntries(
|
|
92
|
+
Object.entries(y).filter(
|
|
93
|
+
([a]) => a === "id" || a.startsWith("aria-")
|
|
94
|
+
)
|
|
95
|
+
), X = () => Object.fromEntries(
|
|
96
|
+
Object.entries(y).filter(
|
|
97
|
+
([a]) => a !== "id" && !a.startsWith("aria-")
|
|
98
|
+
)
|
|
99
|
+
);
|
|
100
|
+
return T({
|
|
101
|
+
input: u,
|
|
102
|
+
checked: v,
|
|
103
|
+
focus: (a) => {
|
|
104
|
+
var o;
|
|
105
|
+
h.value || (o = u.value) == null || o.focus(a);
|
|
106
|
+
},
|
|
107
|
+
blur: () => {
|
|
108
|
+
var a;
|
|
109
|
+
return (a = u.value) == null ? void 0 : a.blur();
|
|
110
|
+
},
|
|
111
|
+
select: j
|
|
112
|
+
}), (a, o) => {
|
|
113
|
+
var B, k, V, r, H, N, D, L;
|
|
114
|
+
return O(), R("label", I({ ...l(W), ...X() }, {
|
|
115
|
+
class: ["hys-ui-radio-option", [
|
|
116
|
+
"hys-ui-radio-" + F.value,
|
|
117
|
+
{
|
|
118
|
+
"hys-ui-radio-option-disabled": h.value,
|
|
119
|
+
"hys-ui-radio-option-readonly": C.value,
|
|
120
|
+
"hys-ui-radio-bordered": P.value,
|
|
121
|
+
"hys-ui-radio-button": G.value,
|
|
122
|
+
"hys-ui-radio-solid": J.value,
|
|
123
|
+
"hys-ui-radio-selected": v.value,
|
|
124
|
+
"hys-ui-radio-error": E.value === "error"
|
|
125
|
+
}
|
|
126
|
+
]],
|
|
127
|
+
"data-status": E.value,
|
|
128
|
+
onMousedown: o[3] || (o[3] = (f) => !i.focusable && f.preventDefault())
|
|
129
|
+
}), [
|
|
130
|
+
S("input", I({
|
|
131
|
+
ref_key: "input",
|
|
132
|
+
ref: u
|
|
133
|
+
}, Q(), {
|
|
134
|
+
class: "hys-ui-radio-native",
|
|
135
|
+
type: "radio",
|
|
136
|
+
id: l(y).id || (l(e) || (B = l(s)) == null ? void 0 : B.id.value),
|
|
137
|
+
"data-hys-ui-field-managed": "",
|
|
138
|
+
"data-hys-ui-radio-controlled": i.modelValue !== void 0 ? "" : void 0,
|
|
139
|
+
name: ((k = l(e)) == null ? void 0 : k.name.value) || i.name,
|
|
140
|
+
form: i.form || ((V = l(e)) == null ? void 0 : V.form.value),
|
|
141
|
+
value: String(n.value),
|
|
142
|
+
checked: v.value,
|
|
143
|
+
disabled: h.value,
|
|
144
|
+
required: i.required || ((r = l(e)) == null ? void 0 : r.required.value) || !l(e) && ((H = l(s)) == null ? void 0 : H.required.value),
|
|
145
|
+
"aria-readonly": C.value || void 0,
|
|
146
|
+
"aria-label": i.ariaLabel || l(y)["aria-label"] || i.label || (!i.label && !a.$slots.default && !l(e) ? (N = l(s)) == null ? void 0 : N.label.value : void 0),
|
|
147
|
+
"aria-invalid": E.value === "error" || void 0,
|
|
148
|
+
"aria-describedby": [
|
|
149
|
+
l(y)["aria-describedby"],
|
|
150
|
+
i.error ? l(q) : void 0,
|
|
151
|
+
l(e) || (D = l(s)) == null ? void 0 : D.describedBy.value
|
|
152
|
+
].filter(Boolean).join(" ") || void 0,
|
|
153
|
+
tabindex: i.focusable ? i.tabindex ?? ((L = l(e)) == null ? void 0 : L.tabindex(n.value)) : -1,
|
|
154
|
+
onClick: o[0] || (o[0] = (f) => C.value && f.preventDefault()),
|
|
155
|
+
onChange: j,
|
|
156
|
+
onHysUiRadioSync: c,
|
|
157
|
+
onFocus: o[1] || (o[1] = (f) => m("focus", f)),
|
|
158
|
+
onBlur: o[2] || (o[2] = (f) => m("blur", f))
|
|
159
|
+
}), null, 16, be),
|
|
160
|
+
S("span", me, [
|
|
161
|
+
$(a.$slots, "icon", { checked: v.value }, void 0, !0)
|
|
162
|
+
]),
|
|
163
|
+
S("span", ye, [
|
|
164
|
+
$(a.$slots, "default", {}, () => [
|
|
165
|
+
oe(K(i.label), 1)
|
|
166
|
+
], !0)
|
|
167
|
+
]),
|
|
168
|
+
i.error ? (O(), R("small", {
|
|
169
|
+
key: 0,
|
|
170
|
+
id: l(q),
|
|
171
|
+
class: "hys-ui-radio-error-text",
|
|
172
|
+
role: "alert"
|
|
173
|
+
}, K(i.error), 9, he)) : ie("", !0)
|
|
174
|
+
], 16, fe);
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
export {
|
|
179
|
+
Ee as default
|
|
180
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysRadioGroup2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f34c441a"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|