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,4 +1,658 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as st, useSlots as ct, ref as dt, useId as vt, computed as h, shallowRef as J, watch as me, openBlock as d, createElementBlock as y, mergeProps as Q, unref as s, withModifiers as yt, createElementVNode as U, normalizeStyle as S, Fragment as W, renderList as X, createBlock as Z, createCommentVNode as H, renderSlot as V, createTextVNode as _, toDisplayString as ee, resolveDynamicComponent as ht, normalizeClass as ft, createVNode as mt, nextTick as te, h as B } from "vue";
|
|
2
|
+
import { ChevronUp as kt, ChevronDown as wt, LoaderCircle as gt } from "lucide-vue-next";
|
|
3
|
+
import Pe from "../HysCheckbox/HysCheckbox.vue.js";
|
|
4
|
+
import bt from "../HysRadio/HysRadio.vue.js";
|
|
5
|
+
import { useHysRootAttrs as pt } from "../../config.js";
|
|
6
|
+
import { useVirtualTableLayout as Ct, virtualColumnStyle as D } from "../../composables/useVirtualTableLayout.js";
|
|
7
|
+
import { virtualEntries as Ue, virtualValue as We, virtualKey as St } from "../../composables/virtualTable.js";
|
|
8
|
+
const Kt = ["role", "tabindex", "aria-label", "aria-rowcount", "aria-colcount", "aria-busy", "aria-disabled", "aria-multiselectable", "aria-activedescendant"], Rt = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "hys-ui-virtual-top",
|
|
11
|
+
role: "rowgroup"
|
|
12
|
+
}, xt = ["aria-colindex", "aria-sort", "data-column-key"], Tt = ["disabled", "onClick"], Mt = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "hys-ui-virtual-header-label"
|
|
15
|
+
}, Ht = {
|
|
16
|
+
key: 2,
|
|
17
|
+
class: "hys-ui-virtual-sort"
|
|
18
|
+
}, Bt = ["disabled", "aria-label", "aria-pressed", "onClick"], It = ["inert"], Nt = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "hys-ui-virtual-footer"
|
|
21
|
+
}, Pt = /* @__PURE__ */ st({
|
|
22
|
+
__name: "HysVirtualTable",
|
|
23
|
+
props: {
|
|
24
|
+
rows: {},
|
|
25
|
+
columns: {},
|
|
26
|
+
rowKey: { type: [String, Function], default: "id" },
|
|
27
|
+
rowHeight: { default: 42 },
|
|
28
|
+
height: { default: 280 },
|
|
29
|
+
width: {},
|
|
30
|
+
headerHeight: { default: 42 },
|
|
31
|
+
showHeader: { type: Boolean, default: !0 },
|
|
32
|
+
fit: { type: Boolean },
|
|
33
|
+
overscan: { default: 5 },
|
|
34
|
+
virtualColumns: { type: Boolean, default: !1 },
|
|
35
|
+
columnOverscan: { default: 1 },
|
|
36
|
+
loading: { type: Boolean },
|
|
37
|
+
loadingMode: { default: "replace" },
|
|
38
|
+
loadingText: {},
|
|
39
|
+
emptyText: {},
|
|
40
|
+
disabled: { type: Boolean },
|
|
41
|
+
fixedRows: {},
|
|
42
|
+
striped: { type: Boolean },
|
|
43
|
+
bordered: { type: Boolean },
|
|
44
|
+
sortState: {},
|
|
45
|
+
defaultSort: {},
|
|
46
|
+
selectable: { type: [Boolean, Function] },
|
|
47
|
+
selectedRowKeys: {},
|
|
48
|
+
defaultSelectedRowKeys: {},
|
|
49
|
+
selectionType: { default: "checkbox" },
|
|
50
|
+
selectionWidth: { default: 44 },
|
|
51
|
+
reserveSelection: { type: Boolean },
|
|
52
|
+
selectOnClick: { type: Boolean },
|
|
53
|
+
currentRowKey: {},
|
|
54
|
+
defaultCurrentRowKey: {},
|
|
55
|
+
highlightCurrentRow: { type: Boolean },
|
|
56
|
+
keyboard: { type: Boolean, default: !1 },
|
|
57
|
+
endReachedThreshold: { default: 42 },
|
|
58
|
+
ariaLabel: {},
|
|
59
|
+
rowClassName: {},
|
|
60
|
+
rowStyle: {},
|
|
61
|
+
cellClassName: {},
|
|
62
|
+
cellStyle: {},
|
|
63
|
+
customRow: {},
|
|
64
|
+
customCell: {},
|
|
65
|
+
customHeaderCell: {}
|
|
66
|
+
},
|
|
67
|
+
emits: ["update:sortState", "sortChange", "update:selectedRowKeys", "selectionChange", "update:currentRowKey", "currentChange", "rowClick", "rowDblclick", "cellClick", "scroll", "rangeChange", "endReached"],
|
|
68
|
+
setup(i, { expose: qe, emit: ze }) {
|
|
69
|
+
const a = i, k = ze, I = ct(), Oe = pt(), le = dt(), ke = vt(), m = h(() => !!a.disabled || !!a.loading), ae = h(
|
|
70
|
+
() => Ue(a.fixedRows ?? [], a.rowKey)
|
|
71
|
+
), we = h(
|
|
72
|
+
() => (a.showHeader ? 1 : 0) + ae.value.length
|
|
73
|
+
), oe = h(() => Ue(a.rows, a.rowKey)), ge = J(
|
|
74
|
+
a.defaultSort ?? null
|
|
75
|
+
), w = h(
|
|
76
|
+
() => a.sortState !== void 0 ? a.sortState : ge.value
|
|
77
|
+
), je = new Intl.Collator(void 0, { numeric: !0 }), v = h(() => {
|
|
78
|
+
const e = w.value, t = a.columns.find((n) => n.key === (e == null ? void 0 : e.key));
|
|
79
|
+
if (!e || !(t != null && t.sortable) || t.sortable === "custom")
|
|
80
|
+
return oe.value;
|
|
81
|
+
const l = e.direction === "desc" ? -1 : 1, o = t.sorter ? [] : oe.value.map((n) => We(n.row, t, n.sourceIndex));
|
|
82
|
+
return [...oe.value].sort((n, u) => {
|
|
83
|
+
const f = o[n.sourceIndex], r = o[u.sourceIndex], c = t.sorter ? t.sorter(n.row, u.row) : typeof f == "number" && typeof r == "number" ? f - r : je.compare(String(f ?? ""), String(r ?? ""));
|
|
84
|
+
return Number.isFinite(c) && c ? c * l : n.sourceIndex - u.sourceIndex;
|
|
85
|
+
});
|
|
86
|
+
}), {
|
|
87
|
+
viewport: be,
|
|
88
|
+
live: p,
|
|
89
|
+
rowHeight: N,
|
|
90
|
+
headerHeight: Ge,
|
|
91
|
+
topHeight: Ye,
|
|
92
|
+
bodyHeight: ne,
|
|
93
|
+
rootStyle: Je,
|
|
94
|
+
viewportStyle: Qe,
|
|
95
|
+
columns: re,
|
|
96
|
+
columnMap: ie,
|
|
97
|
+
renderColumns: q,
|
|
98
|
+
contentWidth: ue,
|
|
99
|
+
scrollTop: Xe,
|
|
100
|
+
scrollLeft: Ze,
|
|
101
|
+
range: K,
|
|
102
|
+
scrollTo: pe,
|
|
103
|
+
scrollToRow: se,
|
|
104
|
+
scrollToColumn: Ce,
|
|
105
|
+
onScroll: Se,
|
|
106
|
+
remeasure: _e
|
|
107
|
+
} = Ct(
|
|
108
|
+
a,
|
|
109
|
+
() => v.value.length,
|
|
110
|
+
() => {
|
|
111
|
+
var e;
|
|
112
|
+
return (e = v.value.at(-1)) == null ? void 0 : e.token;
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
scroll: (e) => k("scroll", e),
|
|
116
|
+
range: (e) => k("rangeChange", e),
|
|
117
|
+
end: (e) => k("endReached", e)
|
|
118
|
+
}
|
|
119
|
+
), Ke = h(
|
|
120
|
+
() => v.value.slice(K.value.start, K.value.end + 1)
|
|
121
|
+
), R = h(() => {
|
|
122
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
123
|
+
return v.value.forEach((l, o) => {
|
|
124
|
+
t.set(l.token, o), l.valid && e.set(l.key, o);
|
|
125
|
+
}), { byKey: e, byToken: t };
|
|
126
|
+
}), Re = (e) => {
|
|
127
|
+
var l;
|
|
128
|
+
const t = R.value.byKey.get(e);
|
|
129
|
+
return t === void 0 || (l = v.value[t]) == null ? void 0 : l.row;
|
|
130
|
+
}, z = J([
|
|
131
|
+
...a.defaultSelectedRowKeys ?? []
|
|
132
|
+
]), $ = J(
|
|
133
|
+
a.defaultCurrentRowKey ?? null
|
|
134
|
+
), E = h(
|
|
135
|
+
() => a.currentRowKey !== void 0 ? a.currentRowKey : $.value
|
|
136
|
+
), g = h(() => {
|
|
137
|
+
const e = [...new Set(a.selectedRowKeys ?? z.value)].filter(
|
|
138
|
+
(t) => St(t) && (a.reserveSelection || R.value.byKey.has(t))
|
|
139
|
+
);
|
|
140
|
+
return a.selectionType === "radio" ? e.slice(0, 1) : e;
|
|
141
|
+
}), O = h(() => new Set(g.value)), A = (e, t) => e.valid && !!a.selectable && (typeof a.selectable != "function" || a.selectable(e.row, t)), L = h(
|
|
142
|
+
() => v.value.filter(A).map((e) => e.key)
|
|
143
|
+
), xe = h(
|
|
144
|
+
() => L.value.length > 0 && L.value.every((e) => O.value.has(e))
|
|
145
|
+
), et = h(
|
|
146
|
+
() => L.value.some((e) => O.value.has(e))
|
|
147
|
+
), b = J(null), ce = h(
|
|
148
|
+
() => b.value ? R.value.byToken.get(b.value.token) ?? -1 : -1
|
|
149
|
+
), Te = (e, t) => ke + "-r" + e + "-c" + t, de = h(() => {
|
|
150
|
+
const e = b.value;
|
|
151
|
+
if (!(!e || a.loading && a.loadingMode === "replace" || !q.value.some((t) => {
|
|
152
|
+
var l;
|
|
153
|
+
return ((l = t.column) == null ? void 0 : l.key) === e.column;
|
|
154
|
+
}) || !Ke.value.some((t) => t.token === e.token)))
|
|
155
|
+
return Te(
|
|
156
|
+
ce.value,
|
|
157
|
+
ie.value.get(e.column).index
|
|
158
|
+
);
|
|
159
|
+
});
|
|
160
|
+
let C = 0, x;
|
|
161
|
+
me(
|
|
162
|
+
p,
|
|
163
|
+
(e) => {
|
|
164
|
+
e || C++;
|
|
165
|
+
},
|
|
166
|
+
{ flush: "sync" }
|
|
167
|
+
), me(
|
|
168
|
+
() => [a.rowKey, a.rows],
|
|
169
|
+
() => {
|
|
170
|
+
x = void 0;
|
|
171
|
+
}
|
|
172
|
+
), me(
|
|
173
|
+
() => R.value.byKey,
|
|
174
|
+
(e) => {
|
|
175
|
+
!a.reserveSelection && a.selectedRowKeys === void 0 && (z.value = z.value.filter((t) => e.has(t))), a.currentRowKey === void 0 && $.value !== null && !e.has($.value) && ($.value = null);
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
function tt(e, t = "nearest") {
|
|
179
|
+
const l = R.value.byKey.get(e);
|
|
180
|
+
return l === void 0 || !p.value ? !1 : (se(l, t), !0);
|
|
181
|
+
}
|
|
182
|
+
async function Me(e, t) {
|
|
183
|
+
var u, f, r;
|
|
184
|
+
if (!p.value || !a.keyboard || m.value || !Number.isFinite(e))
|
|
185
|
+
return !1;
|
|
186
|
+
const l = v.value[Math.floor(e)], o = t === void 0 ? (u = re.value.find((c) => c.column)) == null ? void 0 : u.column : (f = ie.value.get(t)) == null ? void 0 : f.column;
|
|
187
|
+
if (!l || !o) return !1;
|
|
188
|
+
const n = C;
|
|
189
|
+
return b.value = { token: l.token, column: o.key }, se(e), Ce(o.key), await te(), !p.value || n !== C || !de.value ? !1 : ((r = le.value) == null || r.focus({ preventScroll: !0 }), !0);
|
|
190
|
+
}
|
|
191
|
+
const He = (e, t) => (e == null ? void 0 : e.key) === (t == null ? void 0 : t.key) && (e == null ? void 0 : e.direction) === (t == null ? void 0 : t.direction);
|
|
192
|
+
async function ve(e) {
|
|
193
|
+
var o, n;
|
|
194
|
+
if (m.value || !p.value || e && (!((n = (o = ie.value.get(e.key)) == null ? void 0 : o.column) != null && n.sortable) || !["asc", "desc"].includes(e.direction)))
|
|
195
|
+
return !1;
|
|
196
|
+
const t = e ? { ...e } : null, l = C;
|
|
197
|
+
return He(w.value, t) ? !0 : (k("update:sortState", t ? { ...t } : null), a.sortState === void 0 && (ge.value = t), await te(), !p.value || l !== C || !He(w.value, t) ? !1 : (k("sortChange", t ? { ...t } : null), pe({ top: 0 }), !0));
|
|
198
|
+
}
|
|
199
|
+
function lt(e) {
|
|
200
|
+
const t = w.value;
|
|
201
|
+
ve(
|
|
202
|
+
(t == null ? void 0 : t.key) === e.key ? t.direction === "asc" ? { key: e.key, direction: "desc" } : null : { key: e.key, direction: "asc" }
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
const Be = (e, t) => e.length === t.length && e.every((l, o) => l === t[o]);
|
|
206
|
+
async function j(e) {
|
|
207
|
+
if (m.value || !a.selectable || !p.value) return !1;
|
|
208
|
+
const t = [...new Set(e)], l = C;
|
|
209
|
+
return Be(t, g.value) ? !0 : (k("update:selectedRowKeys", [...t]), a.selectedRowKeys === void 0 && (z.value = t), await te(), !p.value || l !== C || !Be(t, g.value) ? !1 : (k(
|
|
210
|
+
"selectionChange",
|
|
211
|
+
[...t],
|
|
212
|
+
t.flatMap((o) => {
|
|
213
|
+
const n = Re(o);
|
|
214
|
+
return n ? [n] : [];
|
|
215
|
+
})
|
|
216
|
+
), !0));
|
|
217
|
+
}
|
|
218
|
+
async function F(e, t) {
|
|
219
|
+
const l = R.value.byKey.get(e), o = l === void 0 ? void 0 : v.value[l];
|
|
220
|
+
if (l === void 0 || !o || !A(o, l)) return !1;
|
|
221
|
+
const n = t ?? !O.value.has(e);
|
|
222
|
+
return j(
|
|
223
|
+
n ? a.selectionType === "radio" ? [e] : [...g.value, e] : g.value.filter((u) => u !== e)
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
const at = () => j([]);
|
|
227
|
+
function Ie(e = !0) {
|
|
228
|
+
if (a.selectionType === "radio") return Promise.resolve(!1);
|
|
229
|
+
const t = new Set(L.value);
|
|
230
|
+
return j(
|
|
231
|
+
e ? [...g.value, ...t] : g.value.filter((l) => !t.has(l))
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
async function ye(e) {
|
|
235
|
+
if (m.value || !p.value || e !== null && !R.value.byKey.has(e))
|
|
236
|
+
return !1;
|
|
237
|
+
if (e === E.value) return !0;
|
|
238
|
+
const t = C;
|
|
239
|
+
return k("update:currentRowKey", e), a.currentRowKey === void 0 && ($.value = e), await te(), !p.value || t !== C || E.value !== e ? !1 : (k("currentChange", e === null ? null : Re(e) ?? null, e), !0);
|
|
240
|
+
}
|
|
241
|
+
function Ne(e) {
|
|
242
|
+
const t = x === void 0 ? e : R.value.byKey.get(x) ?? e, l = Math.min(t, e), o = v.value.slice(l, Math.max(t, e) + 1).filter((n, u) => A(n, l + u)).map((n) => n.key);
|
|
243
|
+
return j([...g.value, ...o]);
|
|
244
|
+
}
|
|
245
|
+
const G = (e) => e.target instanceof Element && !!e.target.closest(
|
|
246
|
+
'button,input,a,textarea,select,[contenteditable]:not([contenteditable="false"])'
|
|
247
|
+
);
|
|
248
|
+
function ot(e, t, l) {
|
|
249
|
+
var o;
|
|
250
|
+
if (!(m.value || G(l))) {
|
|
251
|
+
if (k("rowClick", e.row, t, l), a.highlightCurrentRow && e.valid && ye(E.value === e.key ? null : e.key), a.keyboard) {
|
|
252
|
+
const n = (o = l.target.closest(
|
|
253
|
+
"[data-column-key]"
|
|
254
|
+
)) == null ? void 0 : o.dataset.columnKey;
|
|
255
|
+
n !== void 0 && (b.value = { token: e.token, column: n });
|
|
256
|
+
}
|
|
257
|
+
a.selectOnClick && A(e, t) && (l.shiftKey && a.selectionType !== "radio" ? Ne(t) : (x = e.key, F(e.key)));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function nt() {
|
|
261
|
+
var l;
|
|
262
|
+
if (!a.keyboard || de.value || m.value) return;
|
|
263
|
+
const e = v.value[K.value.visibleStart], t = (l = q.value.find((o) => o.column)) == null ? void 0 : l.column;
|
|
264
|
+
e && t && (b.value = { token: e.token, column: t.key });
|
|
265
|
+
}
|
|
266
|
+
function rt(e) {
|
|
267
|
+
var u, f;
|
|
268
|
+
if (!a.keyboard || m.value || G(e)) return;
|
|
269
|
+
const t = re.value.filter((r) => r.column), l = ce.value < 0 ? K.value.visibleStart : ce.value;
|
|
270
|
+
let o = l, n = Math.max(
|
|
271
|
+
0,
|
|
272
|
+
t.findIndex((r) => {
|
|
273
|
+
var c, T;
|
|
274
|
+
return ((c = r.column) == null ? void 0 : c.key) === ((T = b.value) == null ? void 0 : T.column);
|
|
275
|
+
})
|
|
276
|
+
);
|
|
277
|
+
if (e.key === "ArrowDown") o++;
|
|
278
|
+
else if (e.key === "ArrowUp") o--;
|
|
279
|
+
else if (e.key === "ArrowRight") n++;
|
|
280
|
+
else if (e.key === "ArrowLeft") n--;
|
|
281
|
+
else if (e.key === "PageDown")
|
|
282
|
+
o += Math.max(1, Math.floor(ne.value / N.value));
|
|
283
|
+
else if (e.key === "PageUp")
|
|
284
|
+
o -= Math.max(1, Math.floor(ne.value / N.value));
|
|
285
|
+
else if (e.key === "Home")
|
|
286
|
+
n = 0, (e.ctrlKey || e.metaKey) && (o = 0);
|
|
287
|
+
else if (e.key === "End")
|
|
288
|
+
n = t.length - 1, (e.ctrlKey || e.metaKey) && (o = v.value.length - 1);
|
|
289
|
+
else if (e.key === " " && a.selectable) {
|
|
290
|
+
e.preventDefault();
|
|
291
|
+
const r = v.value[l];
|
|
292
|
+
r && A(r, l) && (e.shiftKey && a.selectionType !== "radio" ? Ne(l) : (x = r.key, F(r.key)));
|
|
293
|
+
return;
|
|
294
|
+
} else if (e.key === "Escape" && (b.value || E.value !== null)) {
|
|
295
|
+
e.preventDefault(), b.value = null, ye(null);
|
|
296
|
+
return;
|
|
297
|
+
} else return;
|
|
298
|
+
!v.value.length || !t.length || (e.preventDefault(), Me(
|
|
299
|
+
Math.min(v.value.length - 1, Math.max(0, o)),
|
|
300
|
+
(f = (u = t[Math.min(t.length - 1, Math.max(0, n))]) == null ? void 0 : u.column) == null ? void 0 : f.key
|
|
301
|
+
));
|
|
302
|
+
}
|
|
303
|
+
const Ae = ({ entry: e, index: t, fixed: l }) => {
|
|
304
|
+
var f;
|
|
305
|
+
const o = e.valid && O.value.has(e.key), n = a.highlightCurrentRow && e.valid && E.value === e.key, u = a.keyboard ? "gridcell" : "cell";
|
|
306
|
+
return B(
|
|
307
|
+
"div",
|
|
308
|
+
Q(
|
|
309
|
+
{ ...(f = a.customRow) == null ? void 0 : f.call(a, e.row, t) },
|
|
310
|
+
{
|
|
311
|
+
class: [
|
|
312
|
+
"hys-ui-v4-table-row",
|
|
313
|
+
"hys-ui-virtual-row",
|
|
314
|
+
{
|
|
315
|
+
"hys-ui-is-selected": !l && o,
|
|
316
|
+
"hys-ui-is-current": !l && n,
|
|
317
|
+
"hys-ui-is-striped": a.striped && t % 2 === 1,
|
|
318
|
+
"hys-ui-virtual-fixed-row": l
|
|
319
|
+
},
|
|
320
|
+
typeof a.rowClassName == "function" ? a.rowClassName(e.row, t) : a.rowClassName
|
|
321
|
+
],
|
|
322
|
+
role: "row",
|
|
323
|
+
"aria-rowindex": l ? (a.showHeader ? 2 : 1) + t : we.value + t + 1,
|
|
324
|
+
"aria-selected": !l && a.keyboard && a.selectable ? o : void 0,
|
|
325
|
+
"data-row-key": e.token,
|
|
326
|
+
style: [
|
|
327
|
+
typeof a.rowStyle == "function" ? a.rowStyle(e.row, t) : a.rowStyle,
|
|
328
|
+
{
|
|
329
|
+
height: N.value + "px",
|
|
330
|
+
minWidth: ue.value + "px"
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
onClick: (r) => !l && ot(e, t, r),
|
|
334
|
+
onDblclick: (r) => {
|
|
335
|
+
!l && !m.value && !G(r) && k("rowDblclick", e.row, t, r);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
),
|
|
339
|
+
q.value.map((r) => {
|
|
340
|
+
var Ve, De, $e, Ee, Le, Fe;
|
|
341
|
+
if (r.gap)
|
|
342
|
+
return B("div", {
|
|
343
|
+
key: r.token,
|
|
344
|
+
"aria-hidden": !0,
|
|
345
|
+
style: D(r),
|
|
346
|
+
class: "hys-ui-virtual-gap"
|
|
347
|
+
});
|
|
348
|
+
if (r.selection) {
|
|
349
|
+
const P = {
|
|
350
|
+
disabled: m.value || !A(e, t),
|
|
351
|
+
ariaLabel: "选择第 " + (t + 1) + " 行",
|
|
352
|
+
onClick: (fe) => fe.stopPropagation()
|
|
353
|
+
}, ut = a.selectionType === "radio" ? B(bt, {
|
|
354
|
+
...P,
|
|
355
|
+
value: e.key,
|
|
356
|
+
modelValue: g.value[0] ?? null,
|
|
357
|
+
name: ke + "-selection",
|
|
358
|
+
"onUpdate:modelValue": () => {
|
|
359
|
+
x = e.key, F(e.key, !0);
|
|
360
|
+
}
|
|
361
|
+
}) : B(Pe, {
|
|
362
|
+
...P,
|
|
363
|
+
modelValue: o,
|
|
364
|
+
"onUpdate:modelValue": (fe) => {
|
|
365
|
+
x = e.key, F(e.key, fe);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
return B(
|
|
369
|
+
"div",
|
|
370
|
+
{
|
|
371
|
+
key: r.token,
|
|
372
|
+
role: u,
|
|
373
|
+
"aria-colindex": 1,
|
|
374
|
+
class: "hys-ui-virtual-cell hys-ui-virtual-pinned hys-ui-virtual-select",
|
|
375
|
+
style: D(r)
|
|
376
|
+
},
|
|
377
|
+
l ? [] : [ut]
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
const c = r.column, T = We(e.row, c, e.sourceIndex), M = {
|
|
381
|
+
row: e.row,
|
|
382
|
+
column: c,
|
|
383
|
+
value: T,
|
|
384
|
+
rowIndex: t,
|
|
385
|
+
columnIndex: r.index
|
|
386
|
+
}, it = !l && ((Ve = b.value) == null ? void 0 : Ve.token) === e.token && ((De = b.value) == null ? void 0 : De.column) === c.key, he = (($e = I[c.key]) == null ? void 0 : $e.call(I, M)) ?? ((Ee = I.cell) == null ? void 0 : Ee.call(I, M)) ?? ((Le = c.formatter) == null ? void 0 : Le.call(c, M)) ?? String(T ?? ""), Y = (Fe = a.customCell) == null ? void 0 : Fe.call(a, M);
|
|
387
|
+
return B(
|
|
388
|
+
"div",
|
|
389
|
+
Q(
|
|
390
|
+
{ ...Y },
|
|
391
|
+
{
|
|
392
|
+
key: r.token,
|
|
393
|
+
id: l ? void 0 : Te(t, r.index),
|
|
394
|
+
role: u,
|
|
395
|
+
"aria-colindex": r.index + 1 + (a.selectable ? 1 : 0),
|
|
396
|
+
"data-column-key": c.key,
|
|
397
|
+
class: [
|
|
398
|
+
"hys-ui-virtual-cell",
|
|
399
|
+
c.className,
|
|
400
|
+
typeof a.cellClassName == "function" ? a.cellClassName(M) : a.cellClassName,
|
|
401
|
+
{
|
|
402
|
+
"hys-ui-virtual-pinned": r.left !== void 0 || r.right !== void 0,
|
|
403
|
+
"hys-ui-virtual-active": it
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
style: [
|
|
407
|
+
typeof a.cellStyle == "function" ? a.cellStyle(M) : a.cellStyle,
|
|
408
|
+
{ textAlign: c.align },
|
|
409
|
+
D(r)
|
|
410
|
+
],
|
|
411
|
+
title: (Y == null ? void 0 : Y.title) ?? (typeof T == "object" ? void 0 : String(T ?? "")),
|
|
412
|
+
onClick: (P) => {
|
|
413
|
+
!l && !m.value && !G(P) && k("cellClick", M, P);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
),
|
|
417
|
+
[
|
|
418
|
+
B(
|
|
419
|
+
"div",
|
|
420
|
+
{ class: "hys-ui-virtual-cell-content" },
|
|
421
|
+
Array.isArray(he) ? he : [he]
|
|
422
|
+
)
|
|
423
|
+
]
|
|
424
|
+
);
|
|
425
|
+
})
|
|
426
|
+
);
|
|
427
|
+
};
|
|
428
|
+
return qe({
|
|
429
|
+
element: le,
|
|
430
|
+
viewport: be,
|
|
431
|
+
scrollTop: Xe,
|
|
432
|
+
scrollLeft: Ze,
|
|
433
|
+
range: K,
|
|
434
|
+
selectedRowKeys: g,
|
|
435
|
+
sortState: w,
|
|
436
|
+
scrollTo: pe,
|
|
437
|
+
scrollToRow: se,
|
|
438
|
+
scrollToKey: tt,
|
|
439
|
+
scrollToColumn: Ce,
|
|
440
|
+
focusCell: Me,
|
|
441
|
+
setSort: ve,
|
|
442
|
+
clearSelection: at,
|
|
443
|
+
toggleRowSelection: F,
|
|
444
|
+
selectAll: Ie,
|
|
445
|
+
setCurrentRow: ye,
|
|
446
|
+
getRow: (e) => {
|
|
447
|
+
var t;
|
|
448
|
+
return (t = v.value[e]) == null ? void 0 : t.row;
|
|
449
|
+
},
|
|
450
|
+
remeasure: _e
|
|
451
|
+
}), (e, t) => (d(), y("div", Q({
|
|
452
|
+
ref_key: "element",
|
|
453
|
+
ref: le
|
|
454
|
+
}, s(Oe), {
|
|
455
|
+
class: ["hys-ui-v4-table hys-ui-virtual-table", {
|
|
456
|
+
"hys-ui-virtual-bordered": i.bordered,
|
|
457
|
+
"hys-ui-is-disabled": i.disabled
|
|
458
|
+
}],
|
|
459
|
+
style: s(Je),
|
|
460
|
+
role: i.keyboard ? "grid" : "table",
|
|
461
|
+
tabindex: i.keyboard && !i.disabled ? 0 : void 0,
|
|
462
|
+
"aria-label": i.ariaLabel || "虚拟表格",
|
|
463
|
+
"aria-rowcount": v.value.length + we.value,
|
|
464
|
+
"aria-colcount": s(re).length,
|
|
465
|
+
"aria-busy": i.loading || void 0,
|
|
466
|
+
"aria-disabled": i.disabled || void 0,
|
|
467
|
+
"aria-multiselectable": i.keyboard && i.selectable ? i.selectionType !== "radio" : void 0,
|
|
468
|
+
"aria-activedescendant": i.keyboard ? de.value : void 0,
|
|
469
|
+
onKeydown: rt,
|
|
470
|
+
onFocus: yt(nt, ["self"])
|
|
471
|
+
}), [
|
|
472
|
+
U("div", {
|
|
473
|
+
ref_key: "viewport",
|
|
474
|
+
ref: be,
|
|
475
|
+
class: "hys-ui-v4-table-viewport",
|
|
476
|
+
style: S(s(Qe)),
|
|
477
|
+
onScrollPassive: t[1] || (t[1] = //@ts-ignore
|
|
478
|
+
(...l) => s(Se) && s(Se)(...l))
|
|
479
|
+
}, [
|
|
480
|
+
U("div", {
|
|
481
|
+
class: "hys-ui-v4-table-content",
|
|
482
|
+
style: S({ minWidth: s(ue) + "px" })
|
|
483
|
+
}, [
|
|
484
|
+
i.showHeader || ae.value.length ? (d(), y("div", Rt, [
|
|
485
|
+
i.showHeader ? (d(), y("div", {
|
|
486
|
+
key: 0,
|
|
487
|
+
role: "row",
|
|
488
|
+
"aria-rowindex": "1",
|
|
489
|
+
class: "hys-ui-v4-table-row hys-ui-v4-table-head hys-ui-virtual-row",
|
|
490
|
+
style: S({
|
|
491
|
+
height: s(Ge) + "px",
|
|
492
|
+
minWidth: s(ue) + "px"
|
|
493
|
+
})
|
|
494
|
+
}, [
|
|
495
|
+
(d(!0), y(W, null, X(s(q), (l) => {
|
|
496
|
+
var o, n;
|
|
497
|
+
return d(), y(W, {
|
|
498
|
+
key: l.token
|
|
499
|
+
}, [
|
|
500
|
+
l.gap ? (d(), y("div", {
|
|
501
|
+
key: 0,
|
|
502
|
+
"aria-hidden": "true",
|
|
503
|
+
class: "hys-ui-virtual-gap",
|
|
504
|
+
style: S(s(D)(l))
|
|
505
|
+
}, null, 4)) : l.selection ? (d(), y("div", {
|
|
506
|
+
key: 1,
|
|
507
|
+
role: "columnheader",
|
|
508
|
+
"aria-colindex": "1",
|
|
509
|
+
class: "hys-ui-virtual-cell hys-ui-virtual-pinned hys-ui-virtual-select",
|
|
510
|
+
style: S(s(D)(l))
|
|
511
|
+
}, [
|
|
512
|
+
i.selectionType !== "radio" ? (d(), Z(Pe, {
|
|
513
|
+
key: 0,
|
|
514
|
+
"model-value": xe.value,
|
|
515
|
+
indeterminate: et.value && !xe.value,
|
|
516
|
+
disabled: m.value || !L.value.length,
|
|
517
|
+
"aria-label": "选择全部行",
|
|
518
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => Ie(!!u))
|
|
519
|
+
}, null, 8, ["model-value", "indeterminate", "disabled"])) : H("", !0)
|
|
520
|
+
], 4)) : (d(), y("div", Q({
|
|
521
|
+
key: 2,
|
|
522
|
+
ref_for: !0
|
|
523
|
+
}, (o = i.customHeaderCell) == null ? void 0 : o.call(i, l.column, l.index), {
|
|
524
|
+
role: "columnheader",
|
|
525
|
+
"aria-colindex": l.index + 1 + (i.selectable ? 1 : 0),
|
|
526
|
+
"aria-sort": l.column.sortable ? ((n = w.value) == null ? void 0 : n.key) === l.column.key ? w.value.direction === "asc" ? "ascending" : "descending" : "none" : void 0,
|
|
527
|
+
"data-column-key": l.column.key,
|
|
528
|
+
class: ["hys-ui-virtual-cell", [
|
|
529
|
+
l.column.headerClassName,
|
|
530
|
+
{
|
|
531
|
+
"hys-ui-virtual-pinned": l.left !== void 0 || l.right !== void 0
|
|
532
|
+
}
|
|
533
|
+
]],
|
|
534
|
+
style: [
|
|
535
|
+
{ textAlign: l.column.headerAlign || l.column.align },
|
|
536
|
+
s(D)(l)
|
|
537
|
+
]
|
|
538
|
+
}), [
|
|
539
|
+
U("div", {
|
|
540
|
+
class: "hys-ui-virtual-header-content",
|
|
541
|
+
style: S({
|
|
542
|
+
justifyContent: (l.column.headerAlign || l.column.align) === "right" ? "flex-end" : (l.column.headerAlign || l.column.align) === "center" ? "center" : void 0
|
|
543
|
+
})
|
|
544
|
+
}, [
|
|
545
|
+
l.column.sortable ? (d(), y("button", {
|
|
546
|
+
key: 0,
|
|
547
|
+
type: "button",
|
|
548
|
+
class: "hys-ui-virtual-sort-label",
|
|
549
|
+
disabled: m.value,
|
|
550
|
+
onClick: (u) => lt(l.column)
|
|
551
|
+
}, [
|
|
552
|
+
V(e.$slots, "header", {
|
|
553
|
+
column: l.column,
|
|
554
|
+
columnIndex: l.index
|
|
555
|
+
}, () => [
|
|
556
|
+
_(ee(l.column.label), 1)
|
|
557
|
+
], !0)
|
|
558
|
+
], 8, Tt)) : (d(), y("span", Mt, [
|
|
559
|
+
V(e.$slots, "header", {
|
|
560
|
+
column: l.column,
|
|
561
|
+
columnIndex: l.index
|
|
562
|
+
}, () => [
|
|
563
|
+
_(ee(l.column.label), 1)
|
|
564
|
+
], !0)
|
|
565
|
+
])),
|
|
566
|
+
l.column.sortable ? (d(), y("span", Ht, [
|
|
567
|
+
(d(), y(W, null, X(["asc", "desc"], (u) => {
|
|
568
|
+
var f;
|
|
569
|
+
return U("button", {
|
|
570
|
+
key: u,
|
|
571
|
+
type: "button",
|
|
572
|
+
disabled: m.value,
|
|
573
|
+
"aria-label": l.column.label + (u === "asc" ? "升序" : "降序"),
|
|
574
|
+
"aria-pressed": ((f = w.value) == null ? void 0 : f.key) === l.column.key && w.value.direction === u,
|
|
575
|
+
onClick: (r) => {
|
|
576
|
+
var c;
|
|
577
|
+
return ve(
|
|
578
|
+
((c = w.value) == null ? void 0 : c.key) === l.column.key && w.value.direction === u ? null : { key: l.column.key, direction: u }
|
|
579
|
+
);
|
|
580
|
+
}
|
|
581
|
+
}, [
|
|
582
|
+
(d(), Z(ht(u === "asc" ? s(kt) : s(wt)), {
|
|
583
|
+
"aria-hidden": "true",
|
|
584
|
+
size: 12
|
|
585
|
+
}))
|
|
586
|
+
], 8, Bt);
|
|
587
|
+
}), 64))
|
|
588
|
+
])) : H("", !0)
|
|
589
|
+
], 4)
|
|
590
|
+
], 16, xt))
|
|
591
|
+
], 64);
|
|
592
|
+
}), 128))
|
|
593
|
+
], 4)) : H("", !0),
|
|
594
|
+
(d(!0), y(W, null, X(ae.value, (l, o) => (d(), Z(Ae, {
|
|
595
|
+
key: "fixed:" + l.token,
|
|
596
|
+
entry: l,
|
|
597
|
+
index: o,
|
|
598
|
+
fixed: !0
|
|
599
|
+
}, null, 8, ["entry", "index"]))), 128))
|
|
600
|
+
])) : H("", !0),
|
|
601
|
+
U("div", {
|
|
602
|
+
role: "rowgroup",
|
|
603
|
+
class: "hys-ui-virtual-space",
|
|
604
|
+
style: S({
|
|
605
|
+
height: Math.max(v.value.length * s(N), v.value.length ? 0 : s(N)) + "px"
|
|
606
|
+
}),
|
|
607
|
+
inert: i.loading || void 0
|
|
608
|
+
}, [
|
|
609
|
+
i.loading && i.loadingMode === "replace" ? H("", !0) : (d(), y("div", {
|
|
610
|
+
key: 0,
|
|
611
|
+
style: S({
|
|
612
|
+
transform: "translateY(" + s(K).start * s(N) + "px)"
|
|
613
|
+
})
|
|
614
|
+
}, [
|
|
615
|
+
(d(!0), y(W, null, X(Ke.value, (l, o) => (d(), Z(Ae, {
|
|
616
|
+
key: l.token,
|
|
617
|
+
entry: l,
|
|
618
|
+
index: s(K).start + o
|
|
619
|
+
}, null, 8, ["entry", "index"]))), 128))
|
|
620
|
+
], 4))
|
|
621
|
+
], 12, It)
|
|
622
|
+
], 4)
|
|
623
|
+
], 36),
|
|
624
|
+
i.loading || !v.value.length ? (d(), y("div", {
|
|
625
|
+
key: 0,
|
|
626
|
+
class: ft(["hys-ui-virtual-status", {
|
|
627
|
+
"hys-ui-virtual-overlay": i.loading && i.loadingMode === "overlay"
|
|
628
|
+
}]),
|
|
629
|
+
style: S({ top: s(Ye) + "px", height: s(ne) + "px" }),
|
|
630
|
+
role: "status",
|
|
631
|
+
"aria-live": "polite"
|
|
632
|
+
}, [
|
|
633
|
+
i.loading ? V(e.$slots, "loading", {}, () => [
|
|
634
|
+
V(e.$slots, "empty", {}, () => [
|
|
635
|
+
mt(s(gt), {
|
|
636
|
+
size: 18,
|
|
637
|
+
"aria-hidden": "true",
|
|
638
|
+
class: "hys-ui-virtual-spinner"
|
|
639
|
+
}),
|
|
640
|
+
_(ee(i.loadingText || "加载中…"), 1)
|
|
641
|
+
], !0)
|
|
642
|
+
], !0, 0) : V(e.$slots, "empty", {}, () => [
|
|
643
|
+
_(ee(i.emptyText || "暂无数据"), 1)
|
|
644
|
+
], !0, 1)
|
|
645
|
+
], 6)) : H("", !0),
|
|
646
|
+
e.$slots.footer ? (d(), y("div", Nt, [
|
|
647
|
+
V(e.$slots, "footer", {
|
|
648
|
+
rows: a.rows,
|
|
649
|
+
range: s(K),
|
|
650
|
+
selectedRowKeys: g.value
|
|
651
|
+
}, void 0, !0)
|
|
652
|
+
])) : H("", !0)
|
|
653
|
+
], 16, Kt));
|
|
654
|
+
}
|
|
655
|
+
});
|
|
2
656
|
export {
|
|
3
|
-
|
|
657
|
+
Pt as default
|
|
4
658
|
};
|