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,146 +1,481 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as Z, useAttrs as _, computed as P, ref as U, onMounted as ee, onUpdated as ae, watch as te, openBlock as r, createElementBlock as n, mergeProps as T, unref as a, createElementVNode as d, normalizeClass as D, renderSlot as h, normalizeProps as B, guardReactiveProps as $, createBlock as i, toDisplayString as v, createCommentVNode as u, Fragment as R, createTextVNode as x, withCtx as g, createVNode as z, normalizeStyle as le, renderList as se, nextTick as re } from "vue";
|
|
2
|
+
import { LoaderCircle as M, CloudUpload as oe, ImageOff as ie, FileText as ue, CheckCircle2 as de, AlertCircle as ne, Eye as ve, Download as ye, Pause as ce, RotateCw as pe, X as me } from "lucide-vue-next";
|
|
3
|
+
import f from "../HysButton/HysButton.vue.js";
|
|
4
|
+
import he from "../HysProgress/HysProgress.vue.js";
|
|
5
|
+
import ge from "../HysModal/HysModal.vue.js";
|
|
6
|
+
import { useHysRootAttrs as be } from "../../config.js";
|
|
7
|
+
import { useUpload as we } from "../../composables/useUpload.js";
|
|
8
|
+
import { uploadStatus as b, uploadSize as fe, uploadPercent as ke } from "../../composables/upload.js";
|
|
9
|
+
const ze = ["aria-label", "aria-busy", "aria-invalid", "aria-describedby"], Ce = ["role", "aria-disabled", "tabindex", "aria-label"], qe = ["id", "form", "accept", "multiple", "webkitdirectory", "disabled"], Be = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "hys-ui-upload-tip"
|
|
12
|
+
}, $e = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "hys-ui-upload-error",
|
|
15
|
+
role: "alert"
|
|
16
|
+
}, xe = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "hys-ui-upload-toolbar"
|
|
19
|
+
}, Fe = { class: "hys-ui-upload-count" }, Ee = { class: "hys-ui-upload-actions" }, He = ["aria-label"], Te = ["data-upload-uid", "tabindex", "onKeydown"], De = ["src", "alt", "onError"], Le = { class: "hys-ui-upload-file-content" }, Se = ["title"], Pe = { class: "hys-ui-upload-meta" }, Re = { key: 0 }, Me = { class: "hys-ui-upload-status" }, Ae = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "hys-ui-upload-file-error",
|
|
22
|
+
role: "status"
|
|
23
|
+
}, Ke = { class: "hys-ui-upload-row-actions" }, Oe = {
|
|
24
|
+
key: 2,
|
|
25
|
+
class: "hys-ui-upload-empty"
|
|
26
|
+
}, Ue = ["src", "alt"], We = /* @__PURE__ */ Z({
|
|
27
|
+
inheritAttrs: !1,
|
|
5
28
|
__name: "HysUpload",
|
|
6
29
|
props: {
|
|
30
|
+
fileList: {},
|
|
31
|
+
modelValue: {},
|
|
32
|
+
defaultFileList: {},
|
|
33
|
+
defaultValue: {},
|
|
7
34
|
accept: {},
|
|
8
35
|
multiple: { type: Boolean, default: !0 },
|
|
9
36
|
disabled: { type: Boolean },
|
|
37
|
+
readonly: { type: Boolean },
|
|
38
|
+
loading: { type: Boolean },
|
|
10
39
|
limit: {},
|
|
11
40
|
maxSize: {},
|
|
12
41
|
drag: { type: Boolean, default: !0 },
|
|
42
|
+
paste: { type: Boolean },
|
|
43
|
+
directory: { type: Boolean },
|
|
13
44
|
showFileList: { type: Boolean, default: !0 },
|
|
14
|
-
|
|
45
|
+
listType: { default: "text" },
|
|
46
|
+
listHeight: { default: 320 },
|
|
47
|
+
size: {},
|
|
48
|
+
showToolbar: { type: Boolean, default: !0 },
|
|
49
|
+
showPreview: { type: Boolean, default: !0 },
|
|
50
|
+
showDownload: { type: Boolean, default: !0 },
|
|
51
|
+
showRemove: { type: Boolean, default: !0 },
|
|
52
|
+
showRetry: { type: Boolean, default: !0 },
|
|
53
|
+
openFileDialogOnClick: { type: Boolean, default: !0 },
|
|
54
|
+
autoUpload: { type: Boolean, default: !0 },
|
|
55
|
+
concurrency: { default: 2 },
|
|
56
|
+
action: {},
|
|
57
|
+
method: { default: "POST" },
|
|
58
|
+
name: { default: "file" },
|
|
59
|
+
headers: {},
|
|
60
|
+
data: {},
|
|
61
|
+
withCredentials: { type: Boolean },
|
|
62
|
+
timeout: {},
|
|
63
|
+
customRequest: {},
|
|
64
|
+
beforeUpload: {},
|
|
65
|
+
beforeRemove: {},
|
|
66
|
+
createFile: {},
|
|
67
|
+
previewFile: {},
|
|
68
|
+
downloadFile: {},
|
|
69
|
+
locale: {},
|
|
70
|
+
ariaLabel: {},
|
|
71
|
+
triggerLabel: {},
|
|
72
|
+
error: {},
|
|
73
|
+
validateEvent: { type: Boolean, default: !0 },
|
|
74
|
+
listStyle: {}
|
|
15
75
|
},
|
|
16
|
-
emits: ["change", "remove", "exceed", "error", "select"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
76
|
+
emits: ["update:fileList", "update:modelValue", "change", "fileChange", "remove", "exceed", "error", "select", "invalid", "start", "progress", "success", "uploadError", "removeError", "abort", "preview", "download", "drop", "paste"],
|
|
77
|
+
setup(o, { expose: V, emit: N }) {
|
|
78
|
+
const k = o, I = N, j = be(), L = _(), e = we(k, (l, ...s) => I(l, ...s)), X = P(
|
|
79
|
+
() => Object.fromEntries(
|
|
80
|
+
Object.entries(L).filter(([l]) => !["id", "form"].includes(l))
|
|
81
|
+
)
|
|
82
|
+
), S = U(!1);
|
|
83
|
+
function A() {
|
|
84
|
+
var l;
|
|
85
|
+
S.value = !!((l = e.zone.value) != null && l.querySelector(
|
|
86
|
+
'button,a[href],input,select,textarea,[tabindex="0"]'
|
|
87
|
+
));
|
|
21
88
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
89
|
+
ee(A), ae(A);
|
|
90
|
+
const w = (l) => e.context(l), F = (l) => e.requests.activeKeys.value.has(l.uid), y = P(() => e.available.value), E = /* @__PURE__ */ new Map(), H = U(/* @__PURE__ */ new Map());
|
|
91
|
+
te(
|
|
92
|
+
() => e.files.value.map((l) => l.uid),
|
|
93
|
+
(l) => {
|
|
94
|
+
const s = new Set(l);
|
|
95
|
+
for (const c of H.value.keys())
|
|
96
|
+
s.has(c) || H.value.delete(c);
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
async function K(l) {
|
|
100
|
+
var c;
|
|
101
|
+
const s = e.files.value.findIndex((p) => p.uid === l.uid);
|
|
102
|
+
if (await e.remove(l)) {
|
|
103
|
+
await re();
|
|
104
|
+
const p = e.files.value[Math.min(s, e.files.value.length - 1)];
|
|
105
|
+
p ? (c = E.get(p.uid)) == null || c.focus({ preventScroll: !0 }) : e.focus();
|
|
106
|
+
}
|
|
25
107
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
s = !1, c();
|
|
32
|
-
});
|
|
33
|
-
async function z(i) {
|
|
34
|
-
if (!s || l.disabled || u.value) return;
|
|
35
|
-
if (l.multiple || (i = i.slice(0, 1)), l.limit && (l.multiple ? o.value.length : 0) + i.length > l.limit) {
|
|
36
|
-
r("exceed", i);
|
|
108
|
+
function G(l, s) {
|
|
109
|
+
var p, q;
|
|
110
|
+
if (l.target.closest(
|
|
111
|
+
'input,textarea,select,[contenteditable="true"]'
|
|
112
|
+
))
|
|
37
113
|
return;
|
|
114
|
+
const c = e.files.value.findIndex((C) => C.uid === s.uid);
|
|
115
|
+
if (l.key === "Delete" && y.value && k.showRemove)
|
|
116
|
+
l.preventDefault(), K(s);
|
|
117
|
+
else if (l.target === l.currentTarget && ["ArrowDown", "ArrowUp", "Home", "End"].includes(l.key)) {
|
|
118
|
+
l.preventDefault();
|
|
119
|
+
const C = l.key === "Home" ? 0 : l.key === "End" ? e.files.value.length - 1 : Math.max(
|
|
120
|
+
0,
|
|
121
|
+
Math.min(
|
|
122
|
+
e.files.value.length - 1,
|
|
123
|
+
c + (l.key === "ArrowDown" ? 1 : -1)
|
|
124
|
+
)
|
|
125
|
+
);
|
|
126
|
+
(q = E.get((p = e.files.value[C]) == null ? void 0 : p.uid)) == null || q.focus();
|
|
38
127
|
}
|
|
39
|
-
const e = ++f;
|
|
40
|
-
u.value = !0;
|
|
41
|
-
const a = [];
|
|
42
|
-
try {
|
|
43
|
-
for (const t of i) {
|
|
44
|
-
if (!s || e !== f || l.disabled) return;
|
|
45
|
-
try {
|
|
46
|
-
if (!A(t)) {
|
|
47
|
-
r("error", "文件类型不符合要求:" + t.name);
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
if (l.maxSize && t.size > l.maxSize) {
|
|
51
|
-
r("error", "文件超过大小限制:" + t.name);
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
if (l.beforeUpload && await l.beforeUpload(t) === !1) continue;
|
|
55
|
-
if (!s || e !== f || l.disabled) return;
|
|
56
|
-
a.push({ uid: crypto.randomUUID(), name: t.name, size: t.size, raw: t });
|
|
57
|
-
} catch (w) {
|
|
58
|
-
s && e === f && r("error", w instanceof Error ? w.message : "文件检查失败");
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (!s || e !== f || l.disabled || !a.length) return;
|
|
62
|
-
o.value = l.multiple ? [...o.value, ...a] : a, a.length && (r("select", a.map((t) => t.raw)), r("change", [...o.value]));
|
|
63
|
-
} finally {
|
|
64
|
-
e === f && (u.value = !1, d.value && (d.value.value = ""));
|
|
65
|
-
}
|
|
66
128
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
129
|
+
function J(l, s) {
|
|
130
|
+
s instanceof HTMLElement ? E.set(l, s) : E.delete(l);
|
|
131
|
+
}
|
|
132
|
+
function Q(l) {
|
|
133
|
+
return e.removing.value.has(l.uid) ? e.words.value.removing : e.requests.queuedKeys.value.has(l.uid) ? e.words.value.queued : F(l) && b(l) === "ready" ? e.words.value.checking : e.words.value[b(l)];
|
|
69
134
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
135
|
+
const W = P(() => ({
|
|
136
|
+
...k.listStyle,
|
|
137
|
+
maxHeight: typeof k.listHeight == "number" ? (Number.isFinite(k.listHeight) ? Math.max(80, k.listHeight) : 320) + "px" : k.listHeight
|
|
138
|
+
}));
|
|
139
|
+
return V({
|
|
140
|
+
element: e.element,
|
|
141
|
+
input: e.input,
|
|
142
|
+
files: e.files,
|
|
143
|
+
busy: e.checking,
|
|
144
|
+
uploading: e.requests.uploading,
|
|
145
|
+
queued: e.requests.queued,
|
|
146
|
+
open: e.open,
|
|
147
|
+
focus: e.focus,
|
|
148
|
+
addFiles: e.addFiles,
|
|
149
|
+
getFiles: () => [...e.files.value],
|
|
150
|
+
clearFiles: e.clearFiles,
|
|
151
|
+
remove: e.remove,
|
|
152
|
+
submit: (l) => e.requests.submit(typeof l == "string" ? l : l == null ? void 0 : l.uid),
|
|
153
|
+
retry: (l) => e.requests.retry(typeof l == "string" ? l : l.uid),
|
|
154
|
+
abort: (l) => e.requests.abort(typeof l == "string" ? l : l == null ? void 0 : l.uid),
|
|
155
|
+
preview: e.previewFile,
|
|
156
|
+
download: e.download
|
|
157
|
+
}), (l, s) => {
|
|
158
|
+
var c, p, q, C, O;
|
|
159
|
+
return r(), n("div", T({
|
|
160
|
+
ref: (t) => a(e).element.value = t
|
|
161
|
+
}, { ...a(j), ...X.value }, {
|
|
162
|
+
class: ["hys-ui-upload", [
|
|
163
|
+
"hys-ui-upload-" + a(e).size.value,
|
|
164
|
+
{
|
|
165
|
+
"hys-ui-upload-disabled": a(e).disabled.value,
|
|
166
|
+
"hys-ui-upload-readonly": o.readonly
|
|
167
|
+
}
|
|
168
|
+
]],
|
|
169
|
+
role: "group",
|
|
170
|
+
"aria-label": o.ariaLabel || a(e).label.value || "文件上传",
|
|
171
|
+
"aria-busy": a(e).checking.value || a(e).requests.uploading.value > 0 || void 0,
|
|
172
|
+
"aria-invalid": !!(o.error || (p = (c = a(e).field) == null ? void 0 : c.invalid) != null && p.value) || void 0,
|
|
173
|
+
"aria-describedby": (q = a(e).field) == null ? void 0 : q.describedBy.value,
|
|
174
|
+
onPaste: s[10] || (s[10] = //@ts-ignore
|
|
175
|
+
(...t) => a(e).paste && a(e).paste(...t)),
|
|
176
|
+
onFocusout: s[11] || (s[11] = //@ts-ignore
|
|
177
|
+
(...t) => a(e).blur && a(e).blur(...t))
|
|
178
|
+
}), [
|
|
179
|
+
d("div", {
|
|
180
|
+
ref: (t) => a(e).zone.value = t,
|
|
181
|
+
class: D(["hys-ui-upload-zone", {
|
|
182
|
+
"hys-ui-upload-dragging": a(e).dragging.value,
|
|
183
|
+
"hys-ui-upload-click": !o.drag
|
|
184
|
+
}]),
|
|
185
|
+
role: S.value ? void 0 : "button",
|
|
186
|
+
"aria-disabled": !y.value || a(e).checking.value,
|
|
187
|
+
tabindex: S.value || !y.value ? -1 : 0,
|
|
188
|
+
"aria-label": o.triggerLabel || a(e).label.value || "选择上传文件",
|
|
189
|
+
onClick: s[0] || (s[0] = //@ts-ignore
|
|
190
|
+
(...t) => a(e).click && a(e).click(...t)),
|
|
191
|
+
onKeydown: s[1] || (s[1] = //@ts-ignore
|
|
192
|
+
(...t) => a(e).keys && a(e).keys(...t)),
|
|
193
|
+
onDragenter: s[2] || (s[2] = //@ts-ignore
|
|
194
|
+
(...t) => a(e).dragEnter && a(e).dragEnter(...t)),
|
|
195
|
+
onDragover: s[3] || (s[3] = //@ts-ignore
|
|
196
|
+
(...t) => a(e).dragOver && a(e).dragOver(...t)),
|
|
197
|
+
onDragleave: s[4] || (s[4] = //@ts-ignore
|
|
198
|
+
(...t) => a(e).dragLeave && a(e).dragLeave(...t)),
|
|
199
|
+
onDrop: s[5] || (s[5] = //@ts-ignore
|
|
200
|
+
(...t) => a(e).drop && a(e).drop(...t))
|
|
126
201
|
}, [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
202
|
+
h(l.$slots, "trigger", B($(a(e).scope.value)), () => [
|
|
203
|
+
h(l.$slots, "default", B($(a(e).scope.value)), () => [
|
|
204
|
+
a(e).checking.value ? (r(), i(a(M), {
|
|
205
|
+
key: 0,
|
|
206
|
+
class: "hys-ui-upload-spinner",
|
|
207
|
+
size: 28,
|
|
208
|
+
"aria-hidden": "true"
|
|
209
|
+
})) : (r(), i(a(oe), {
|
|
210
|
+
key: 1,
|
|
211
|
+
size: 28,
|
|
212
|
+
"aria-hidden": "true"
|
|
213
|
+
})),
|
|
214
|
+
d("strong", null, v(a(e).checking.value ? a(e).words.value.checking : o.drag ? a(e).words.value.drag : a(e).words.value.choose), 1),
|
|
215
|
+
d("span", null, v(a(e).requests.configured.value ? a(e).words.value.uploadHint : a(e).words.value.localHint), 1)
|
|
216
|
+
], !0)
|
|
217
|
+
], !0)
|
|
218
|
+
], 42, Ce),
|
|
219
|
+
d("input", {
|
|
220
|
+
ref: (t) => a(e).input.value = t,
|
|
221
|
+
id: a(L).id || ((C = a(e).field) == null ? void 0 : C.id.value),
|
|
222
|
+
form: a(L).form,
|
|
223
|
+
hidden: "",
|
|
224
|
+
type: "file",
|
|
225
|
+
accept: o.accept,
|
|
226
|
+
multiple: o.multiple,
|
|
227
|
+
webkitdirectory: o.directory || void 0,
|
|
228
|
+
disabled: !y.value || a(e).checking.value,
|
|
229
|
+
onChange: s[6] || (s[6] = (t) => a(e).addFiles(
|
|
230
|
+
Array.from(t.target.files || [])
|
|
231
|
+
))
|
|
232
|
+
}, null, 40, qe),
|
|
233
|
+
l.$slots.tip ? (r(), n("div", Be, [
|
|
234
|
+
h(l.$slots, "tip", B($(a(e).scope.value)), void 0, !0)
|
|
235
|
+
])) : u("", !0),
|
|
236
|
+
o.error || a(e).lastError.value ? (r(), n("p", $e, v(o.error || a(e).lastError.value), 1)) : u("", !0),
|
|
237
|
+
o.showFileList ? (r(), n(R, { key: 2 }, [
|
|
238
|
+
a(e).files.value.length && o.showToolbar ? (r(), n("div", xe, [
|
|
239
|
+
h(l.$slots, "toolbar", B($(a(e).scope.value)), () => [
|
|
240
|
+
d("span", Fe, [
|
|
241
|
+
x(v(a(e).words.value.files) + " ", 1),
|
|
242
|
+
d("strong", null, v(a(e).files.value.length), 1)
|
|
243
|
+
]),
|
|
244
|
+
d("div", Ee, [
|
|
245
|
+
a(e).requests.configured.value ? (r(), i(f, {
|
|
246
|
+
key: 0,
|
|
247
|
+
variant: "ghost",
|
|
248
|
+
size: "sm",
|
|
249
|
+
disabled: !y.value || !a(e).files.value.some(
|
|
250
|
+
(t) => t.raw && ["ready", "error"].includes(a(b)(t))
|
|
251
|
+
),
|
|
252
|
+
onClick: s[7] || (s[7] = (t) => a(e).requests.submit())
|
|
253
|
+
}, {
|
|
254
|
+
default: g(() => [
|
|
255
|
+
x(v(a(e).words.value.submit), 1)
|
|
256
|
+
]),
|
|
257
|
+
_: 1
|
|
258
|
+
}, 8, ["disabled"])) : u("", !0),
|
|
259
|
+
a(e).requests.uploading.value || a(e).requests.queued.value ? (r(), i(f, {
|
|
260
|
+
key: 1,
|
|
261
|
+
variant: "ghost",
|
|
262
|
+
size: "sm",
|
|
263
|
+
disabled: !y.value,
|
|
264
|
+
onClick: s[8] || (s[8] = (t) => a(e).requests.abort())
|
|
265
|
+
}, {
|
|
266
|
+
default: g(() => [
|
|
267
|
+
x(v(a(e).words.value.abort), 1)
|
|
268
|
+
]),
|
|
269
|
+
_: 1
|
|
270
|
+
}, 8, ["disabled"])) : u("", !0),
|
|
271
|
+
z(f, {
|
|
272
|
+
variant: "ghost",
|
|
273
|
+
size: "sm",
|
|
274
|
+
disabled: !y.value,
|
|
275
|
+
onClick: s[9] || (s[9] = (t) => a(e).clearFiles())
|
|
276
|
+
}, {
|
|
277
|
+
default: g(() => [
|
|
278
|
+
x(v(a(e).words.value.clear), 1)
|
|
279
|
+
]),
|
|
280
|
+
_: 1
|
|
281
|
+
}, 8, ["disabled"])
|
|
282
|
+
])
|
|
283
|
+
], !0)
|
|
284
|
+
])) : u("", !0),
|
|
285
|
+
a(e).files.value.length ? (r(), n("ul", {
|
|
286
|
+
key: 1,
|
|
287
|
+
class: D(["hys-ui-upload-list", "hys-ui-upload-list-" + o.listType]),
|
|
288
|
+
style: le(W.value),
|
|
289
|
+
"aria-label": a(e).words.value.files
|
|
136
290
|
}, [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
291
|
+
(r(!0), n(R, null, se(a(e).files.value, (t, Y) => (r(), n("li", {
|
|
292
|
+
key: t.uid,
|
|
293
|
+
ref_for: !0,
|
|
294
|
+
ref: (m) => J(t.uid, m),
|
|
295
|
+
class: D(["hys-ui-upload-file", [
|
|
296
|
+
"hys-ui-upload-file-" + a(b)(t),
|
|
297
|
+
{ "hys-ui-upload-file-busy": F(t) }
|
|
298
|
+
]]),
|
|
299
|
+
"data-upload-uid": t.uid,
|
|
300
|
+
tabindex: Y === 0 ? 0 : -1,
|
|
301
|
+
onKeydown: (m) => G(m, t)
|
|
302
|
+
}, [
|
|
303
|
+
l.$slots.item ? h(l.$slots, "item", T({ ref_for: !0 }, w(t)), void 0, !0, 0) : (r(), n(R, { key: 1 }, [
|
|
304
|
+
d("div", {
|
|
305
|
+
class: D(["hys-ui-upload-thumbnail", { "hys-ui-upload-thumbnail-image": o.listType !== "text" }])
|
|
306
|
+
}, [
|
|
307
|
+
o.listType !== "text" && w(t).thumbnail && H.value.get(t.uid) !== w(t).thumbnail ? (r(), n("img", {
|
|
308
|
+
key: 0,
|
|
309
|
+
src: w(t).thumbnail,
|
|
310
|
+
alt: t.name,
|
|
311
|
+
loading: "lazy",
|
|
312
|
+
onError: (m) => H.value.set(t.uid, w(t).thumbnail)
|
|
313
|
+
}, null, 40, De)) : o.listType !== "text" && w(t).thumbnail ? (r(), i(a(ie), {
|
|
314
|
+
key: 1,
|
|
315
|
+
size: 28,
|
|
316
|
+
"aria-hidden": "true"
|
|
317
|
+
})) : (r(), i(a(ue), {
|
|
318
|
+
key: 2,
|
|
319
|
+
size: o.listType === "text" ? 20 : 28,
|
|
320
|
+
"aria-hidden": "true"
|
|
321
|
+
}, null, 8, ["size"]))
|
|
322
|
+
], 2),
|
|
323
|
+
d("div", Le, [
|
|
324
|
+
h(l.$slots, "file", T({ ref_for: !0 }, w(t)), () => [
|
|
325
|
+
d("span", {
|
|
326
|
+
class: "hys-ui-upload-name",
|
|
327
|
+
title: t.name
|
|
328
|
+
}, v(t.name), 9, Se)
|
|
329
|
+
], !0),
|
|
330
|
+
d("div", Pe, [
|
|
331
|
+
t.size !== void 0 ? (r(), n("span", Re, v(a(fe)(t.size)), 1)) : u("", !0),
|
|
332
|
+
d("span", Me, [
|
|
333
|
+
F(t) || a(e).removing.value.has(t.uid) ? (r(), i(a(M), {
|
|
334
|
+
key: 0,
|
|
335
|
+
class: "hys-ui-upload-spinner",
|
|
336
|
+
size: 12,
|
|
337
|
+
"aria-hidden": "true"
|
|
338
|
+
})) : a(b)(t) === "success" ? (r(), i(a(de), {
|
|
339
|
+
key: 1,
|
|
340
|
+
size: 12,
|
|
341
|
+
"aria-hidden": "true"
|
|
342
|
+
})) : a(b)(t) === "error" ? (r(), i(a(ne), {
|
|
343
|
+
key: 2,
|
|
344
|
+
size: 12,
|
|
345
|
+
"aria-hidden": "true"
|
|
346
|
+
})) : u("", !0),
|
|
347
|
+
x(v(Q(t)), 1)
|
|
348
|
+
])
|
|
349
|
+
]),
|
|
350
|
+
a(b)(t) === "uploading" ? h(l.$slots, "progress", T({ ref_for: !0 }, w(t)), () => [
|
|
351
|
+
z(he, {
|
|
352
|
+
value: a(ke)(t),
|
|
353
|
+
"stroke-width": 3,
|
|
354
|
+
"show-label": !1,
|
|
355
|
+
"aria-label": t.name + " 上传进度"
|
|
356
|
+
}, null, 8, ["value", "aria-label"])
|
|
357
|
+
], !0, 0) : u("", !0),
|
|
358
|
+
t.error && a(b)(t) === "error" ? (r(), n("span", Ae, v(t.error.message), 1)) : u("", !0)
|
|
359
|
+
]),
|
|
360
|
+
d("div", Ke, [
|
|
361
|
+
a(e).canPreview(t) ? (r(), i(f, {
|
|
362
|
+
key: 0,
|
|
363
|
+
variant: "ghost",
|
|
364
|
+
size: "sm",
|
|
365
|
+
disabled: a(e).disabled.value || o.loading,
|
|
366
|
+
"aria-label": a(e).words.value.preview + t.name,
|
|
367
|
+
onClick: (m) => a(e).previewFile(t)
|
|
368
|
+
}, {
|
|
369
|
+
default: g(() => [
|
|
370
|
+
z(a(ve), {
|
|
371
|
+
size: 15,
|
|
372
|
+
"aria-hidden": "true"
|
|
373
|
+
})
|
|
374
|
+
]),
|
|
375
|
+
_: 1
|
|
376
|
+
}, 8, ["disabled", "aria-label", "onClick"])) : u("", !0),
|
|
377
|
+
a(e).canDownload(t) ? (r(), i(f, {
|
|
378
|
+
key: 1,
|
|
379
|
+
variant: "ghost",
|
|
380
|
+
size: "sm",
|
|
381
|
+
disabled: a(e).disabled.value || o.loading,
|
|
382
|
+
"aria-label": a(e).words.value.download + t.name,
|
|
383
|
+
onClick: (m) => a(e).download(t)
|
|
384
|
+
}, {
|
|
385
|
+
default: g(() => [
|
|
386
|
+
z(a(ye), {
|
|
387
|
+
size: 15,
|
|
388
|
+
"aria-hidden": "true"
|
|
389
|
+
})
|
|
390
|
+
]),
|
|
391
|
+
_: 1
|
|
392
|
+
}, 8, ["disabled", "aria-label", "onClick"])) : u("", !0),
|
|
393
|
+
F(t) || a(e).requests.queuedKeys.value.has(t.uid) ? (r(), i(f, {
|
|
394
|
+
key: 2,
|
|
395
|
+
variant: "ghost",
|
|
396
|
+
size: "sm",
|
|
397
|
+
disabled: !y.value,
|
|
398
|
+
"aria-label": a(e).words.value.abort + t.name,
|
|
399
|
+
onClick: (m) => a(e).requests.abort(t.uid)
|
|
400
|
+
}, {
|
|
401
|
+
default: g(() => [
|
|
402
|
+
z(a(ce), {
|
|
403
|
+
size: 15,
|
|
404
|
+
"aria-hidden": "true"
|
|
405
|
+
})
|
|
406
|
+
]),
|
|
407
|
+
_: 1
|
|
408
|
+
}, 8, ["disabled", "aria-label", "onClick"])) : o.showRetry && t.raw && a(b)(t) === "error" && a(e).requests.configured.value ? (r(), i(f, {
|
|
409
|
+
key: 3,
|
|
410
|
+
variant: "ghost",
|
|
411
|
+
size: "sm",
|
|
412
|
+
disabled: !y.value,
|
|
413
|
+
"aria-label": a(e).words.value.retry + t.name,
|
|
414
|
+
onClick: (m) => a(e).requests.retry(t.uid)
|
|
415
|
+
}, {
|
|
416
|
+
default: g(() => [
|
|
417
|
+
z(a(pe), {
|
|
418
|
+
size: 15,
|
|
419
|
+
"aria-hidden": "true"
|
|
420
|
+
})
|
|
421
|
+
]),
|
|
422
|
+
_: 1
|
|
423
|
+
}, 8, ["disabled", "aria-label", "onClick"])) : u("", !0),
|
|
424
|
+
o.showRemove ? (r(), i(f, {
|
|
425
|
+
key: 4,
|
|
426
|
+
variant: "ghost",
|
|
427
|
+
size: "sm",
|
|
428
|
+
disabled: !y.value || a(e).removing.value.has(t.uid),
|
|
429
|
+
"aria-label": a(e).words.value.remove + t.name,
|
|
430
|
+
onClick: (m) => K(t)
|
|
431
|
+
}, {
|
|
432
|
+
default: g(() => [
|
|
433
|
+
a(e).removing.value.has(t.uid) ? (r(), i(a(M), {
|
|
434
|
+
key: 0,
|
|
435
|
+
class: "hys-ui-upload-spinner",
|
|
436
|
+
size: 15,
|
|
437
|
+
"aria-hidden": "true"
|
|
438
|
+
})) : (r(), i(a(me), {
|
|
439
|
+
key: 1,
|
|
440
|
+
size: 15,
|
|
441
|
+
"aria-hidden": "true"
|
|
442
|
+
}))
|
|
443
|
+
]),
|
|
444
|
+
_: 2
|
|
445
|
+
}, 1032, ["disabled", "aria-label", "onClick"])) : u("", !0)
|
|
446
|
+
])
|
|
447
|
+
], 64))
|
|
448
|
+
], 42, Te))), 128))
|
|
449
|
+
], 14, He)) : l.$slots.empty ? (r(), n("div", Oe, [
|
|
450
|
+
h(l.$slots, "empty", B($(a(e).scope.value)), void 0, !0)
|
|
451
|
+
])) : u("", !0)
|
|
452
|
+
], 64)) : u("", !0),
|
|
453
|
+
z(ge, {
|
|
454
|
+
open: !!a(e).preview.value,
|
|
455
|
+
title: ((O = a(e).preview.value) == null ? void 0 : O.file.name) || a(e).words.value.preview,
|
|
456
|
+
footer: !1,
|
|
457
|
+
size: "lg",
|
|
458
|
+
onClose: a(e).closePreview
|
|
459
|
+
}, {
|
|
460
|
+
default: g(() => [
|
|
461
|
+
a(e).preview.value ? h(l.$slots, "preview", {
|
|
462
|
+
file: a(e).preview.value.file,
|
|
463
|
+
url: a(e).preview.value.url,
|
|
464
|
+
close: a(e).closePreview
|
|
465
|
+
}, () => [
|
|
466
|
+
d("img", {
|
|
467
|
+
class: "hys-ui-upload-preview-image",
|
|
468
|
+
src: a(e).preview.value.url,
|
|
469
|
+
alt: a(e).preview.value.file.name
|
|
470
|
+
}, null, 8, Ue)
|
|
471
|
+
], !0, 0) : u("", !0)
|
|
472
|
+
]),
|
|
473
|
+
_: 3
|
|
474
|
+
}, 8, ["open", "title", "onClose"])
|
|
475
|
+
], 16, ze);
|
|
476
|
+
};
|
|
142
477
|
}
|
|
143
478
|
});
|
|
144
479
|
export {
|
|
145
|
-
|
|
480
|
+
We as default
|
|
146
481
|
};
|