hys-ui 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +149 -0
- package/README.md +17 -1
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +639 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
- package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +256 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -27
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +288 -2
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +29 -28
- package/dist/components/HysCalendar/HysCalendar.vue.js +5 -92
- package/dist/components/HysCalendar/HysCalendar2.vue.js +815 -2
- package/dist/components/HysCard/HysCard.vue.js +2 -2
- package/dist/components/HysCard/HysCard2.vue.js +175 -42
- package/dist/components/HysCascader/HysCascader.vue.js +5 -194
- package/dist/components/HysCascader/HysCascader2.vue.js +773 -2
- package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
- package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +3 -3
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +1 -1
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -216
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
- package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
- package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
- package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1019 -563
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +270 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +820 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +270 -158
- package/dist/components/HysDivider/HysDivider.vue.js +2 -2
- package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
- package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
- package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
- package/dist/components/HysFileManager/HysFileManager.vue.js +3 -3
- package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +578 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
- package/dist/components/HysFormItem/HysFormItem2.vue.js +528 -2
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +1380 -268
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +467 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +122 -109
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +490 -85
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
- package/dist/components/HysPagination/HysPagination.vue.js +1 -1
- package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
- package/dist/components/HysPopover/HysPopover.vue.js +5 -91
- package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
- package/dist/components/HysProgress/HysProgress.vue.js +2 -2
- package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
- package/dist/components/HysRadio/HysRadio.vue.js +7 -0
- package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +2 -2
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
- package/dist/components/HysSearch/HysSearch.vue.js +37 -36
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
- package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
- package/dist/components/HysSelect/HysSelect.vue.js +3 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +999 -189
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
- package/dist/components/HysSlider/HysSlider.vue.js +1 -1
- package/dist/components/HysSlider/HysSlider2.vue.js +536 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +170 -0
- package/dist/components/HysSteps/HysSteps.vue.js +1 -1
- package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1494 -88
- package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
- package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
- package/dist/components/HysTabs/HysTabs.vue.js +2 -2
- package/dist/components/HysTabs/HysTabs2.vue.js +262 -68
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -81
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
- package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
- package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
- package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
- package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
- package/dist/components/HysTour/HysTour.vue.js +46 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
- package/dist/components/HysTransfer/HysTransfer2.vue.js +446 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +503 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +651 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +570 -2
- package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
- package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +459 -124
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- package/dist/composables/autocomplete.js +50 -0
- package/dist/composables/avatar.js +57 -0
- package/dist/composables/calendar.js +96 -0
- package/dist/composables/cascader.js +79 -0
- package/dist/composables/choice.js +38 -0
- package/dist/composables/choiceModel.js +67 -0
- package/dist/composables/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/formContext.js +92 -7
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -0
- package/dist/composables/rating.js +16 -0
- package/dist/composables/selectOptions.js +54 -0
- package/dist/composables/table.js +150 -0
- package/dist/composables/tagInput.js +16 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +65 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useColorPicker.js +402 -0
- package/dist/composables/useContextMenu.js +514 -0
- package/dist/composables/useDataGridRemote.js +67 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +136 -56
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useModal.js +295 -0
- package/dist/composables/useModalInteraction.js +394 -0
- package/dist/composables/usePopupSurface.js +458 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTransferMotion.js +185 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/composables/useUpload.js +472 -0
- package/dist/composables/useUploadModel.js +65 -0
- package/dist/composables/useUploadRequests.js +266 -0
- package/dist/composables/useVirtualTableLayout.js +277 -0
- package/dist/composables/virtualTable.js +43 -0
- package/dist/index.js +152 -139
- package/dist/internal/PopupReference.js +39 -0
- package/dist/internal/PopupSurfacePanel.vue.js +7 -0
- package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
- package/dist/motion/PopupMotion.js +105 -0
- package/dist/motion/popup.js +10 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +104 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +71 -20
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +120 -31
- package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +50 -39
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
- package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
- package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +84 -5
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +4 -3
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -35
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +34 -12
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +131 -22
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +69 -11
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +24 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +3 -3
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -9
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
- package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
- package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +50 -28
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysToast/HysToast.vue.d.ts +3 -3
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +4 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +107 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
- package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
- package/dist/types/composables/autocomplete.d.ts +109 -0
- package/dist/types/composables/avatar.d.ts +73 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +195 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/color.d.ts +97 -0
- package/dist/types/composables/dataGrid.d.ts +100 -0
- package/dist/types/composables/datePicker.d.ts +250 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/formContext.d.ts +135 -8
- package/dist/types/composables/formLayout.d.ts +11 -0
- package/dist/types/composables/formValidation.d.ts +13 -0
- package/dist/types/composables/gantt.d.ts +68 -0
- package/dist/types/composables/ganttConflicts.d.ts +30 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +183 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/overlayManager.d.ts +7 -3
- package/dist/types/composables/popupSurface.d.ts +83 -0
- package/dist/types/composables/progress.d.ts +92 -0
- package/dist/types/composables/rating.d.ts +18 -0
- package/dist/types/composables/segmented.d.ts +15 -0
- package/dist/types/composables/selectOptions.d.ts +46 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +312 -0
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/transfer.d.ts +187 -0
- package/dist/types/composables/tree.d.ts +240 -0
- package/dist/types/composables/treeSelect.d.ts +170 -0
- package/dist/types/composables/upload.d.ts +202 -0
- package/dist/types/composables/uploadRequest.d.ts +3 -0
- package/dist/types/composables/useAlert.d.ts +21 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useColorPicker.d.ts +101 -0
- package/dist/types/composables/useContextMenu.d.ts +81 -0
- package/dist/types/composables/useDataGridRemote.d.ts +15 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useDialog.d.ts +16 -3
- package/dist/types/composables/useDrawerPush.d.ts +6 -0
- package/dist/types/composables/useDrawerResize.d.ts +27 -0
- package/dist/types/composables/useFloating.d.ts +28 -6
- package/dist/types/composables/useGanttDependencies.d.ts +83 -0
- package/dist/types/composables/useGanttHistory.d.ts +42 -0
- package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useModal.d.ts +62 -0
- package/dist/types/composables/useModalInteraction.d.ts +27 -0
- package/dist/types/composables/usePopupSurface.d.ts +3341 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/composables/useUpload.d.ts +94 -0
- package/dist/types/composables/useUploadModel.d.ts +14 -0
- package/dist/types/composables/useUploadRequests.d.ts +38 -0
- package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
- package/dist/types/composables/virtualTable.d.ts +126 -0
- package/dist/types/index.d.ts +50 -9
- package/dist/types/internal/PopupReference.d.ts +18 -0
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
- package/dist/types/motion/PopupMotion.d.ts +59 -0
- package/dist/types/motion/popup.d.ts +12 -0
- package/package.json +2 -1
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { shallowRef as C, computed as p, watch as E } from "vue";
|
|
2
|
+
import { uploadStatus as b, uploadFailure as N } from "./upload.js";
|
|
3
|
+
import { uploadRequest as D } from "./uploadRequest.js";
|
|
4
|
+
function J(t) {
|
|
5
|
+
const { props: c } = t, s = C([]), l = C(/* @__PURE__ */ new Map()), y = p(() => !!(c.action || c.customRequest)), S = p(
|
|
6
|
+
() => Number.isFinite(c.concurrency) ? Math.max(1, Math.min(20, Math.floor(c.concurrency))) : 2
|
|
7
|
+
), v = p(
|
|
8
|
+
() => new Map(t.files.value.map((e) => [e.uid, e]))
|
|
9
|
+
);
|
|
10
|
+
let g = 0, q = !1;
|
|
11
|
+
const h = /* @__PURE__ */ new Map();
|
|
12
|
+
function f(e) {
|
|
13
|
+
var r;
|
|
14
|
+
return t.live() && t.available.value && !e.controller.signal.aborted && l.value.get(e.uid) === e && ((r = v.value.get(e.uid)) == null ? void 0 : r.raw) === e.raw;
|
|
15
|
+
}
|
|
16
|
+
function P(e) {
|
|
17
|
+
h.delete(e), !h.size && g && (cancelAnimationFrame(g), g = 0);
|
|
18
|
+
}
|
|
19
|
+
function O(e, r) {
|
|
20
|
+
if (!f(e) || e.phase !== "running" || !Number.isFinite(r))
|
|
21
|
+
return;
|
|
22
|
+
const n = Math.max(e.percentage, Math.min(100, Math.max(0, r)));
|
|
23
|
+
n !== e.percentage && (e.percentage = n, h.set(e.uid, Math.round(n * 10) / 10), !g && (g = requestAnimationFrame(() => {
|
|
24
|
+
g = 0;
|
|
25
|
+
const a = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
26
|
+
for (const [i, d] of h) {
|
|
27
|
+
const o = l.value.get(i);
|
|
28
|
+
o && f(o) && o.phase === "running" && (a.set(i, { percentage: d }), u.set(i, o));
|
|
29
|
+
}
|
|
30
|
+
h.clear(), a.size && t.patch(
|
|
31
|
+
a,
|
|
32
|
+
"progress",
|
|
33
|
+
(i) => i ? !!u.get(i) && f(u.get(i)) && u.get(i).phase === "running" : [...u.values()].some(
|
|
34
|
+
(d) => f(d) && d.phase === "running"
|
|
35
|
+
)
|
|
36
|
+
).then(() => {
|
|
37
|
+
for (const [i, d] of u)
|
|
38
|
+
if (f(d) && d.phase === "running") {
|
|
39
|
+
const o = v.value.get(i);
|
|
40
|
+
o && t.emit("progress", a.get(i).percentage, {
|
|
41
|
+
...o,
|
|
42
|
+
...a.get(i)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
})));
|
|
47
|
+
}
|
|
48
|
+
function x(e) {
|
|
49
|
+
if (l.value.get(e.uid) !== e) return;
|
|
50
|
+
const r = new Map(l.value);
|
|
51
|
+
r.delete(e.uid), l.value = r, M();
|
|
52
|
+
}
|
|
53
|
+
function m(e, r, n) {
|
|
54
|
+
!f(e) || e.phase === "finishing" || (e.phase = "finishing", P(e.uid), (async () => {
|
|
55
|
+
const a = r === void 0 ? void 0 : N(r), u = a ? { status: "error", error: a } : { status: "success", percentage: 100, response: n, error: void 0 };
|
|
56
|
+
if (await t.patch(
|
|
57
|
+
/* @__PURE__ */ new Map([[e.uid, u]]),
|
|
58
|
+
a ? "error" : "success",
|
|
59
|
+
() => f(e)
|
|
60
|
+
), !f(e)) return;
|
|
61
|
+
const i = { ...v.value.get(e.uid), ...u };
|
|
62
|
+
a ? (t.emit("uploadError", a, i), t.emit("error", a.message)) : t.emit("success", n, i), x(e);
|
|
63
|
+
})().catch((a) => {
|
|
64
|
+
f(e) && (t.emit("error", N(a).message), x(e));
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
function j(e, r) {
|
|
68
|
+
var n, a;
|
|
69
|
+
if (typeof r == "function") e.stop = r;
|
|
70
|
+
else if (r && typeof r.then == "function")
|
|
71
|
+
Promise.resolve(r).then(
|
|
72
|
+
(u) => m(e, void 0, u),
|
|
73
|
+
(u) => m(e, u)
|
|
74
|
+
);
|
|
75
|
+
else if (r) {
|
|
76
|
+
const u = r;
|
|
77
|
+
e.stop = (n = u.abort) == null ? void 0 : n.bind(u), u.promise && u.promise.then(
|
|
78
|
+
(i) => m(e, void 0, i),
|
|
79
|
+
(i) => m(e, i)
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
e.controller.signal.aborted && ((a = e.stop) == null || a.call(e));
|
|
83
|
+
}
|
|
84
|
+
async function K(e) {
|
|
85
|
+
try {
|
|
86
|
+
let r = v.value.get(e.uid);
|
|
87
|
+
if (!r || !f(e)) return;
|
|
88
|
+
const n = await t.prepare(r, e.controller.signal);
|
|
89
|
+
if (!f(e)) return;
|
|
90
|
+
if (!n) {
|
|
91
|
+
x(e);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const a = await t.patch(
|
|
95
|
+
/* @__PURE__ */ new Map([
|
|
96
|
+
[
|
|
97
|
+
e.uid,
|
|
98
|
+
{
|
|
99
|
+
status: "uploading",
|
|
100
|
+
percentage: 0,
|
|
101
|
+
error: void 0,
|
|
102
|
+
response: void 0
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
]),
|
|
106
|
+
"start",
|
|
107
|
+
() => f(e)
|
|
108
|
+
);
|
|
109
|
+
if (!f(e)) return;
|
|
110
|
+
if (!a) {
|
|
111
|
+
F(e.uid, "rejected", !1);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (r = v.value.get(e.uid), e.phase = "running", t.emit("start", r), !f(e)) return;
|
|
115
|
+
const u = {
|
|
116
|
+
signal: e.controller.signal,
|
|
117
|
+
files: t.files.value
|
|
118
|
+
}, [i, d, o] = await Promise.all([
|
|
119
|
+
typeof c.action == "function" ? c.action(r, u) : c.action ?? "",
|
|
120
|
+
typeof c.data == "function" ? c.data(r, u) : c.data ?? {},
|
|
121
|
+
typeof c.headers == "function" ? c.headers(r, u) : c.headers ?? {}
|
|
122
|
+
]);
|
|
123
|
+
if (!f(e)) return;
|
|
124
|
+
const A = {
|
|
125
|
+
...u,
|
|
126
|
+
file: v.value.get(e.uid),
|
|
127
|
+
body: n,
|
|
128
|
+
action: i,
|
|
129
|
+
method: c.method ?? "POST",
|
|
130
|
+
name: c.name ?? "file",
|
|
131
|
+
headers: o,
|
|
132
|
+
data: d,
|
|
133
|
+
withCredentials: !!c.withCredentials,
|
|
134
|
+
timeout: Number.isFinite(c.timeout) ? Math.max(0, c.timeout) : 0,
|
|
135
|
+
onProgress: (w) => O(e, w),
|
|
136
|
+
onSuccess: (w) => m(e, void 0, w),
|
|
137
|
+
onError: (w) => m(e, w)
|
|
138
|
+
};
|
|
139
|
+
if (!c.customRequest && !i)
|
|
140
|
+
throw Object.assign(new Error("请配置有效的上传地址"), {
|
|
141
|
+
kind: "configuration"
|
|
142
|
+
});
|
|
143
|
+
j(
|
|
144
|
+
e,
|
|
145
|
+
c.customRequest ? c.customRequest(A) : D(A)
|
|
146
|
+
);
|
|
147
|
+
} catch (r) {
|
|
148
|
+
m(e, r);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function M() {
|
|
152
|
+
q || (q = !0, queueMicrotask(() => {
|
|
153
|
+
if (q = !1, !(!t.live() || !t.available.value || !y.value))
|
|
154
|
+
for (; l.value.size < S.value && s.value.length; ) {
|
|
155
|
+
const e = s.value[0];
|
|
156
|
+
s.value = s.value.slice(1);
|
|
157
|
+
const r = v.value.get(e);
|
|
158
|
+
if (!(r != null && r.raw) || l.value.has(e)) continue;
|
|
159
|
+
const n = {
|
|
160
|
+
uid: e,
|
|
161
|
+
raw: r.raw,
|
|
162
|
+
controller: new AbortController(),
|
|
163
|
+
phase: "preparing",
|
|
164
|
+
percentage: 0
|
|
165
|
+
};
|
|
166
|
+
l.value = new Map(l.value).set(e, n), K(n);
|
|
167
|
+
}
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
async function z(e) {
|
|
171
|
+
if (!t.live() || !t.available.value || !y.value)
|
|
172
|
+
return 0;
|
|
173
|
+
const r = t.files.value.filter(
|
|
174
|
+
(n) => (e === void 0 || n.uid === e) && n.raw && ["ready", "error"].includes(b(n)) && !l.value.has(n.uid) && !s.value.includes(n.uid)
|
|
175
|
+
);
|
|
176
|
+
for (const n of r)
|
|
177
|
+
b(n) === "error" && t.forget(n.uid);
|
|
178
|
+
return s.value = [...s.value, ...r.map((n) => n.uid)], M(), r.length;
|
|
179
|
+
}
|
|
180
|
+
function F(e, r, n = !0) {
|
|
181
|
+
var d;
|
|
182
|
+
const a = l.value.get(e), u = s.value.includes(e);
|
|
183
|
+
if (!a && !u) return !1;
|
|
184
|
+
if (s.value = s.value.filter((o) => o !== e), P(e), a) {
|
|
185
|
+
const o = new Map(l.value);
|
|
186
|
+
o.delete(e), l.value = o, a.controller.abort();
|
|
187
|
+
try {
|
|
188
|
+
(d = a.stop) == null || d.call(a);
|
|
189
|
+
} catch {
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const i = v.value.get(e);
|
|
193
|
+
return n && i && (t.patch(
|
|
194
|
+
/* @__PURE__ */ new Map([
|
|
195
|
+
[
|
|
196
|
+
e,
|
|
197
|
+
{ status: "ready", percentage: 0, error: void 0 }
|
|
198
|
+
]
|
|
199
|
+
]),
|
|
200
|
+
"abort",
|
|
201
|
+
() => {
|
|
202
|
+
var o;
|
|
203
|
+
return t.live() && ((o = v.value.get(e)) == null ? void 0 : o.raw) === i.raw;
|
|
204
|
+
}
|
|
205
|
+
), t.emit("abort", i, r)), M(), !0;
|
|
206
|
+
}
|
|
207
|
+
function R(e, r = "user", n = !0) {
|
|
208
|
+
const a = e === void 0 ? /* @__PURE__ */ new Set([...s.value, ...l.value.keys()]) : /* @__PURE__ */ new Set([e]);
|
|
209
|
+
let u = 0;
|
|
210
|
+
for (const i of a) F(i, r, n) && u++;
|
|
211
|
+
return u;
|
|
212
|
+
}
|
|
213
|
+
async function T(e) {
|
|
214
|
+
const r = v.value.get(e);
|
|
215
|
+
return !(r != null && r.raw) || !t.available.value || !t.live() || (R(e, "retry", !1), t.forget(e), !(b(r) === "ready" && !r.percentage && !r.error && r.response === void 0 || await t.patch(
|
|
216
|
+
/* @__PURE__ */ new Map([
|
|
217
|
+
[
|
|
218
|
+
e,
|
|
219
|
+
{
|
|
220
|
+
status: "ready",
|
|
221
|
+
percentage: 0,
|
|
222
|
+
error: void 0,
|
|
223
|
+
response: void 0
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
]),
|
|
227
|
+
"retry"
|
|
228
|
+
))) ? !1 : await z(e) > 0;
|
|
229
|
+
}
|
|
230
|
+
function U() {
|
|
231
|
+
for (const [e, r] of l.value) {
|
|
232
|
+
const n = v.value.get(e);
|
|
233
|
+
(!n || n.raw !== r.raw || r.phase === "running" && ["success", "error"].includes(b(n))) && F(e, "model", !1);
|
|
234
|
+
}
|
|
235
|
+
s.value = s.value.filter((e) => {
|
|
236
|
+
var r;
|
|
237
|
+
return !!((r = v.value.get(e)) != null && r.raw);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
E(
|
|
241
|
+
() => t.files.value.map((e) => [e.uid, e.raw, e.status]),
|
|
242
|
+
U,
|
|
243
|
+
{ flush: "sync" }
|
|
244
|
+
), E([t.available, S, y], () => {
|
|
245
|
+
t.available.value && M();
|
|
246
|
+
});
|
|
247
|
+
function B() {
|
|
248
|
+
R(void 0, "cleanup", !1), g && cancelAnimationFrame(g), g = 0, h.clear();
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
configured: y,
|
|
252
|
+
queue: s,
|
|
253
|
+
tasks: l,
|
|
254
|
+
uploading: p(() => l.value.size),
|
|
255
|
+
queued: p(() => s.value.length),
|
|
256
|
+
activeKeys: p(() => new Set(l.value.keys())),
|
|
257
|
+
queuedKeys: p(() => new Set(s.value)),
|
|
258
|
+
submit: z,
|
|
259
|
+
retry: T,
|
|
260
|
+
abort: R,
|
|
261
|
+
cleanup: B
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
export {
|
|
265
|
+
J as useUploadRequests
|
|
266
|
+
};
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { ref as E, computed as s, onMounted as ge, onActivated as we, nextTick as xe, onDeactivated as ye, onBeforeUnmount as Me, watch as X } from "vue";
|
|
2
|
+
import { virtualFinite as f, virtualAligned as ue } from "./virtualTable.js";
|
|
3
|
+
const fe = (l, y) => ({ token: l, width: y, index: -1, offset: 0, gap: !0 });
|
|
4
|
+
function Le(l, y, se, U) {
|
|
5
|
+
const M = E(), c = E(!0), b = s(
|
|
6
|
+
() => f(l.rowHeight, 42, 1, 1e4)
|
|
7
|
+
), Y = s(
|
|
8
|
+
() => l.showHeader ? f(l.headerHeight, 42, 24, 200) : 0
|
|
9
|
+
), F = s(
|
|
10
|
+
() => {
|
|
11
|
+
var e;
|
|
12
|
+
return Y.value + (((e = l.fixedRows) == null ? void 0 : e.length) ?? 0) * b.value;
|
|
13
|
+
}
|
|
14
|
+
), Z = E(0), V = E(0), v = E(0), x = E(0), q = s(
|
|
15
|
+
() => Math.max(
|
|
16
|
+
1,
|
|
17
|
+
V.value ? V.value - F.value : f(l.height, 280, 1)
|
|
18
|
+
)
|
|
19
|
+
), S = s(
|
|
20
|
+
() => Z.value || f(l.width, 600, 1)
|
|
21
|
+
), ce = s(() => ({
|
|
22
|
+
height: typeof l.height == "string" ? "calc(" + l.height + " + " + F.value + "px)" : f(l.height, 280, 1) + F.value + "px"
|
|
23
|
+
})), he = s(() => ({
|
|
24
|
+
width: typeof l.width == "number" ? f(l.width, 600, 1) + "px" : l.width
|
|
25
|
+
})), L = s(() => {
|
|
26
|
+
const e = /* @__PURE__ */ new Set(), a = [], n = [], i = [], h = l.columns.filter(
|
|
27
|
+
(t) => !t.hidden && typeof t.key == "string" && !e.has(t.key) && !!e.add(t.key)
|
|
28
|
+
), m = [
|
|
29
|
+
...h.filter((t) => t.fixed === !0 || t.fixed === "left"),
|
|
30
|
+
...h.filter((t) => !t.fixed),
|
|
31
|
+
...h.filter((t) => t.fixed === "right")
|
|
32
|
+
], w = m.map((t) => {
|
|
33
|
+
const o = f(t.minWidth, 1, 1, 1e4);
|
|
34
|
+
return { min: o, max: f(t.maxWidth, 1e4, o, 1e4) };
|
|
35
|
+
}), d = m.map(
|
|
36
|
+
(t, o) => f(t.width, 160, w[o].min, w[o].max)
|
|
37
|
+
), r = l.selectable ? f(l.selectionWidth, 44, 32, 150) : 0;
|
|
38
|
+
let T = l.fit ? S.value - d.reduce((t, o) => t + o, r) : 0;
|
|
39
|
+
if (T > 0) {
|
|
40
|
+
const t = m.flatMap(
|
|
41
|
+
(o, u) => o.fixed ? [] : [{ index: u, capacity: w[u].max - d[u] }]
|
|
42
|
+
).sort((o, u) => o.capacity - u.capacity);
|
|
43
|
+
t.forEach(({ index: o, capacity: u }, g) => {
|
|
44
|
+
const C = Math.min(
|
|
45
|
+
u,
|
|
46
|
+
T / (t.length - g)
|
|
47
|
+
);
|
|
48
|
+
d[o] += C, T -= C;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
let k = r;
|
|
52
|
+
r && a.push({
|
|
53
|
+
token: "selection",
|
|
54
|
+
index: -1,
|
|
55
|
+
width: r,
|
|
56
|
+
offset: 0,
|
|
57
|
+
left: 0,
|
|
58
|
+
selection: !0
|
|
59
|
+
}), m.forEach((t, o) => {
|
|
60
|
+
const u = d[o], g = {
|
|
61
|
+
token: "column:" + t.key,
|
|
62
|
+
column: t,
|
|
63
|
+
index: o,
|
|
64
|
+
width: u,
|
|
65
|
+
offset: k
|
|
66
|
+
};
|
|
67
|
+
t.fixed === "right" ? i.push(g) : t.fixed ? (g.left = k, a.push(g)) : n.push(g), k += u;
|
|
68
|
+
});
|
|
69
|
+
let H = 0;
|
|
70
|
+
for (let t = i.length - 1; t >= 0; t--)
|
|
71
|
+
i[t].right = H, H += i[t].width;
|
|
72
|
+
return {
|
|
73
|
+
left: a,
|
|
74
|
+
center: n,
|
|
75
|
+
right: i,
|
|
76
|
+
total: k,
|
|
77
|
+
leftWidth: a.reduce((t, o) => t + o.width, 0),
|
|
78
|
+
rightWidth: H
|
|
79
|
+
};
|
|
80
|
+
}), _ = s(() => [
|
|
81
|
+
...L.value.left,
|
|
82
|
+
...L.value.center,
|
|
83
|
+
...L.value.right
|
|
84
|
+
]), $ = s(
|
|
85
|
+
() => new Map(
|
|
86
|
+
_.value.flatMap(
|
|
87
|
+
(e) => e.column ? [[e.column.key, e]] : []
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
), ee = s(
|
|
91
|
+
() => Math.max(L.value.total, S.value)
|
|
92
|
+
), te = s((e) => {
|
|
93
|
+
var o;
|
|
94
|
+
const { left: a, center: n, right: i, total: h, leftWidth: m, rightWidth: w } = L.value;
|
|
95
|
+
let d = 0, r = n.length;
|
|
96
|
+
if (l.virtualColumns) {
|
|
97
|
+
const u = x.value + m, g = x.value + S.value - w, C = Math.floor(f(l.columnOverscan, 1, 0, 20));
|
|
98
|
+
let O = 0, Q = n.length;
|
|
99
|
+
for (; O < Q; ) {
|
|
100
|
+
const N = O + Q >>> 1;
|
|
101
|
+
n[N].offset + n[N].width <= u ? O = N + 1 : Q = N;
|
|
102
|
+
}
|
|
103
|
+
for (d = Math.max(0, O - C), r = O; r < n.length && n[r].offset < g; ) r++;
|
|
104
|
+
r = Math.min(n.length, r + C);
|
|
105
|
+
}
|
|
106
|
+
const T = d ? (((o = n[d]) == null ? void 0 : o.offset) ?? h - w) - m : 0, k = r < n.length ? h - w - n[r].offset : 0, H = ee.value - h, t = [
|
|
107
|
+
...a,
|
|
108
|
+
...T > 0 ? [fe("gap:before", T)] : [],
|
|
109
|
+
...n.slice(d, r),
|
|
110
|
+
...k + H > 0 ? [fe("gap:after", k + H)] : [],
|
|
111
|
+
...i
|
|
112
|
+
];
|
|
113
|
+
return (e == null ? void 0 : e.length) === t.length && t.every(
|
|
114
|
+
(u, g) => u === e[g] || u.gap && e[g].token === u.token && e[g].width === u.width
|
|
115
|
+
) ? e : t;
|
|
116
|
+
}), le = s((e) => {
|
|
117
|
+
const a = y(), n = Math.floor(f(l.overscan, 5, 0, 100)), i = Math.min(
|
|
118
|
+
Math.max(0, a - 1),
|
|
119
|
+
Math.floor(v.value / b.value)
|
|
120
|
+
), h = Math.min(
|
|
121
|
+
a - 1,
|
|
122
|
+
Math.ceil((v.value + q.value) / b.value) - 1
|
|
123
|
+
), m = Math.max(0, i - n), w = Math.min(a - 1, h + n), d = te.value.flatMap(
|
|
124
|
+
(r) => r.column ? [r.column.key] : []
|
|
125
|
+
);
|
|
126
|
+
return e && m === e.start && w === e.end && i === e.visibleStart && h === e.visibleEnd && d.length === e.columnKeys.length && d.every((r, T) => r === e.columnKeys[T]) ? e : { start: m, end: w, visibleStart: i, visibleEnd: h, columnKeys: d };
|
|
127
|
+
}), A = s(
|
|
128
|
+
() => Math.max(0, y() * b.value - q.value)
|
|
129
|
+
), j = s(() => Math.max(0, L.value.total - S.value));
|
|
130
|
+
let R = 0, z = 0, W, G = !1, p = 0, B = 0, ne = 0, ae = 0, I = "";
|
|
131
|
+
function ie() {
|
|
132
|
+
if (!c.value) return;
|
|
133
|
+
const e = v.value, a = x.value;
|
|
134
|
+
v.value = f(p, 0, 0, A.value), x.value = f(B, 0, 0, j.value), (e !== v.value || a !== x.value) && U.scroll({
|
|
135
|
+
scrollTop: v.value,
|
|
136
|
+
scrollLeft: x.value,
|
|
137
|
+
direction: e !== v.value ? v.value > e ? "down" : "up" : x.value > a ? "right" : "left"
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function de() {
|
|
141
|
+
const e = M.value;
|
|
142
|
+
!c.value || !e || (p = e.scrollTop, B = e.scrollLeft, R || (R = requestAnimationFrame(() => {
|
|
143
|
+
R = 0, ie();
|
|
144
|
+
})));
|
|
145
|
+
}
|
|
146
|
+
function K(e) {
|
|
147
|
+
const a = M.value;
|
|
148
|
+
if (!c.value || !a) return;
|
|
149
|
+
const n = f(e.top, a.scrollTop, 0, A.value), i = f(e.left, a.scrollLeft, 0, j.value);
|
|
150
|
+
if (e.behavior === "smooth" && a.scrollTo) {
|
|
151
|
+
a.scrollTo({ top: n, left: i, behavior: "smooth" });
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
a.scrollTop !== n && (a.scrollTop = n), a.scrollLeft !== i && (a.scrollLeft = i), p = n, B = i, ie();
|
|
155
|
+
}
|
|
156
|
+
function ve(e, a = "nearest") {
|
|
157
|
+
var i;
|
|
158
|
+
if (!y() || !Number.isFinite(e)) return;
|
|
159
|
+
const n = Math.min(y() - 1, Math.max(0, Math.floor(e))) * b.value;
|
|
160
|
+
K({
|
|
161
|
+
top: ue(
|
|
162
|
+
n,
|
|
163
|
+
b.value,
|
|
164
|
+
((i = M.value) == null ? void 0 : i.scrollTop) ?? v.value,
|
|
165
|
+
q.value,
|
|
166
|
+
a
|
|
167
|
+
)
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function me(e, a = "nearest") {
|
|
171
|
+
var i;
|
|
172
|
+
if (!c.value) return !1;
|
|
173
|
+
const n = $.value.get(e);
|
|
174
|
+
if (!n) return !1;
|
|
175
|
+
if (n.left === void 0 && n.right === void 0) {
|
|
176
|
+
const { leftWidth: h, rightWidth: m } = L.value;
|
|
177
|
+
K({
|
|
178
|
+
left: ue(
|
|
179
|
+
n.offset - h,
|
|
180
|
+
n.width,
|
|
181
|
+
((i = M.value) == null ? void 0 : i.scrollLeft) ?? x.value,
|
|
182
|
+
Math.max(1, S.value - h - m),
|
|
183
|
+
a
|
|
184
|
+
)
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
return !0;
|
|
188
|
+
}
|
|
189
|
+
function J() {
|
|
190
|
+
const e = M.value;
|
|
191
|
+
!c.value || !e || (e.clientWidth && (Z.value = e.clientWidth), e.clientHeight && (V.value = e.clientHeight), K({ top: e.scrollTop, left: e.scrollLeft }));
|
|
192
|
+
}
|
|
193
|
+
function D() {
|
|
194
|
+
c.value && !z && (z = requestAnimationFrame(() => {
|
|
195
|
+
z = 0, J();
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
function oe() {
|
|
199
|
+
G || !c.value || !M.value || (G = !0, typeof ResizeObserver < "u" ? (W = new ResizeObserver(D), W.observe(M.value)) : window.addEventListener("resize", D), J());
|
|
200
|
+
}
|
|
201
|
+
function re() {
|
|
202
|
+
W == null || W.disconnect(), W = void 0, G = !1, window.removeEventListener("resize", D), cancelAnimationFrame(R), cancelAnimationFrame(z), R = z = 0;
|
|
203
|
+
}
|
|
204
|
+
function P() {
|
|
205
|
+
const e = y();
|
|
206
|
+
if (!c.value || !e || l.loading) return;
|
|
207
|
+
const a = Math.max(0, A.value - v.value);
|
|
208
|
+
if (a > f(l.endReachedThreshold, 42, 0, 1e4)) {
|
|
209
|
+
I = "";
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const n = e + ":" + se();
|
|
213
|
+
n !== I && (I = n, U.end({ distance: a, total: e }));
|
|
214
|
+
}
|
|
215
|
+
return ge(() => {
|
|
216
|
+
oe(), P();
|
|
217
|
+
}), we(() => {
|
|
218
|
+
const e = !c.value;
|
|
219
|
+
c.value = !0, oe(), e && xe(() => {
|
|
220
|
+
K({ top: ne, left: ae }), P();
|
|
221
|
+
});
|
|
222
|
+
}), ye(() => {
|
|
223
|
+
ne = p, ae = B, c.value = !1, re();
|
|
224
|
+
}), Me(() => {
|
|
225
|
+
c.value = !1, re();
|
|
226
|
+
}), X([A, j, F, () => l.height], D, {
|
|
227
|
+
flush: "post"
|
|
228
|
+
}), X(
|
|
229
|
+
le,
|
|
230
|
+
(e) => {
|
|
231
|
+
c.value && U.range({ ...e, columnKeys: [...e.columnKeys] });
|
|
232
|
+
},
|
|
233
|
+
{ flush: "post", immediate: !0 }
|
|
234
|
+
), X(
|
|
235
|
+
[
|
|
236
|
+
v,
|
|
237
|
+
A,
|
|
238
|
+
y,
|
|
239
|
+
() => l.loading,
|
|
240
|
+
() => l.endReachedThreshold
|
|
241
|
+
],
|
|
242
|
+
P,
|
|
243
|
+
{ flush: "post" }
|
|
244
|
+
), {
|
|
245
|
+
viewport: M,
|
|
246
|
+
live: c,
|
|
247
|
+
rowHeight: b,
|
|
248
|
+
headerHeight: Y,
|
|
249
|
+
topHeight: F,
|
|
250
|
+
bodyHeight: q,
|
|
251
|
+
rootStyle: he,
|
|
252
|
+
viewportStyle: ce,
|
|
253
|
+
columns: _,
|
|
254
|
+
columnMap: $,
|
|
255
|
+
renderColumns: te,
|
|
256
|
+
contentWidth: ee,
|
|
257
|
+
scrollTop: v,
|
|
258
|
+
scrollLeft: x,
|
|
259
|
+
range: le,
|
|
260
|
+
scrollTo: K,
|
|
261
|
+
scrollToRow: ve,
|
|
262
|
+
scrollToColumn: me,
|
|
263
|
+
onScroll: de,
|
|
264
|
+
remeasure: J
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function ke(l) {
|
|
268
|
+
return {
|
|
269
|
+
width: l.width + "px",
|
|
270
|
+
flex: "0 0 " + l.width + "px",
|
|
271
|
+
...l.left !== void 0 ? { position: "sticky", left: l.left + "px" } : l.right !== void 0 ? { position: "sticky", right: l.right + "px" } : {}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
export {
|
|
275
|
+
Le as useVirtualTableLayout,
|
|
276
|
+
ke as virtualColumnStyle
|
|
277
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const y = (t, e, r = 0, n = 1e7) => Math.max(
|
|
2
|
+
r,
|
|
3
|
+
Math.min(
|
|
4
|
+
n,
|
|
5
|
+
typeof t == "number" && Number.isFinite(t) ? t : e
|
|
6
|
+
)
|
|
7
|
+
), o = (t) => typeof t == "string" || typeof t == "number" && Number.isFinite(t), c = (t) => typeof t + ":" + String(t);
|
|
8
|
+
function a(t, e, r) {
|
|
9
|
+
if (e.valueGetter) return e.valueGetter(t, r);
|
|
10
|
+
const n = e.dataIndex ?? e.key;
|
|
11
|
+
return typeof n == "string" && Object.prototype.hasOwnProperty.call(t, n) ? t[n] : (typeof n == "string" ? n.split(".") : n).reduce(
|
|
12
|
+
(i, u) => i !== null && typeof i == "object" ? i[u] : void 0,
|
|
13
|
+
t
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function b(t, e) {
|
|
17
|
+
const r = t.map(
|
|
18
|
+
(i, u) => typeof e == "function" ? e(i, u) : i[e || "id"]
|
|
19
|
+
), n = /* @__PURE__ */ new Map();
|
|
20
|
+
for (const i of r)
|
|
21
|
+
o(i) && n.set(i, (n.get(i) ?? 0) + 1);
|
|
22
|
+
return t.map((i, u) => {
|
|
23
|
+
const f = r[u], p = o(f) && n.get(f) === 1;
|
|
24
|
+
return {
|
|
25
|
+
row: i,
|
|
26
|
+
key: p ? f : u,
|
|
27
|
+
token: p ? c(f) : "fallback:" + u,
|
|
28
|
+
sourceIndex: u,
|
|
29
|
+
valid: p
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function d(t, e, r, n, i) {
|
|
34
|
+
return i === "center" ? t - (n - e) / 2 : i === "end" ? t + e - n : i === "nearest" ? e > n && t <= r && t + e >= r + n ? r : t < r ? t : t + e > r + n ? e > n ? t : t + e - n : r : t;
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
d as virtualAligned,
|
|
38
|
+
b as virtualEntries,
|
|
39
|
+
y as virtualFinite,
|
|
40
|
+
o as virtualKey,
|
|
41
|
+
c as virtualToken,
|
|
42
|
+
a as virtualValue
|
|
43
|
+
};
|