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,800 +1,1256 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
1
|
+
import { defineComponent as xa, ref as w, useId as Vt, computed as c, shallowRef as Me, watch as L, onMounted as za, onDeactivated as Ra, onBeforeUnmount as Ma, openBlock as s, createElementBlock as u, mergeProps as Ta, unref as m, createElementVNode as y, createVNode as g, createTextVNode as V, createCommentVNode as h, withCtx as z, toDisplayString as O, createBlock as D, normalizeStyle as $, normalizeClass as ve, Fragment as N, renderList as ye, withModifiers as q, withKeys as nt, renderSlot as $e, resolveDynamicComponent as Dt, nextTick as pe } from "vue";
|
|
2
|
+
import { Settings2 as Ea, ChevronUp as Ka, ChevronDown as it, Search as Aa, ChevronRight as Ft } from "lucide-vue-next";
|
|
3
|
+
import { useHysRootAttrs as Va } from "../../config.js";
|
|
4
|
+
import Da from "../../motion/PopupMotion.js";
|
|
5
|
+
import { useMotion as Fa } from "../../motion/useMotion.js";
|
|
6
|
+
import { gridRows as La, gridValue as me, gridTree as Oa, gridToken as st, positiveInteger as Te, gridKey as Na } from "../../composables/dataGrid.js";
|
|
7
|
+
import { useDataGridRemote as qa } from "../../composables/useDataGridRemote.js";
|
|
8
|
+
import Ba from "../HysSortableList/HysSortableList.vue.js";
|
|
9
|
+
import Lt from "../HysSelect/HysSelect.vue.js";
|
|
10
|
+
import Ie from "../HysInput/HysInput.vue.js";
|
|
11
|
+
import rt from "../HysCheckbox/HysCheckbox.vue.js";
|
|
12
|
+
import Ha from "../HysRadio/HysRadio.vue.js";
|
|
13
|
+
import T from "../HysButton/HysButton.vue.js";
|
|
14
|
+
import Ua from "../HysPagination/HysPagination.vue.js";
|
|
15
|
+
const $a = ["aria-busy"], Ia = { class: "hys-ui-pf-grid-toolbar" }, ja = { class: "hys-ui-pf-grid-search" }, Pa = {
|
|
12
16
|
key: 0,
|
|
13
17
|
class: "hys-ui-pf-grid-group-label"
|
|
14
|
-
},
|
|
18
|
+
}, Qa = {
|
|
15
19
|
key: 1,
|
|
16
20
|
class: "hys-ui-pf-grid-batch"
|
|
17
|
-
},
|
|
21
|
+
}, Wa = { class: "hys-ui-pf-grid-count" }, Ja = {
|
|
18
22
|
key: 0,
|
|
19
23
|
class: "hys-ui-pf-grid-panel"
|
|
20
|
-
},
|
|
24
|
+
}, Xa = {
|
|
21
25
|
key: 0,
|
|
22
26
|
style: { width: "44px" }
|
|
23
|
-
},
|
|
27
|
+
}, Ga = {
|
|
24
28
|
key: 0,
|
|
25
29
|
scope: "col",
|
|
26
30
|
class: "hys-ui-pf-grid-select-col"
|
|
27
|
-
},
|
|
31
|
+
}, Ya = { key: 1 }, Za = ["data-column-key", "data-drop-position", "draggable", "onDragstart", "onDragover", "onDrop", "aria-sort"], _a = { class: "hys-ui-pf-grid-head" }, el = { class: "hys-ui-pf-grid-sort-group" }, tl = { class: "hys-ui-pf-grid-sort-label" }, al = ["aria-label"], ll = ["aria-label", "onPointerdown", "aria-valuemin", "aria-valuemax", "aria-valuenow", "onKeydown"], ol = ["id"], nl = {
|
|
28
32
|
key: 0,
|
|
29
33
|
class: "hys-ui-pf-grid-select-col"
|
|
30
|
-
},
|
|
34
|
+
}, il = ["data-filter-key", "data-column-key"], sl = { key: 0 }, rl = ["colspan"], ul = { role: "status" }, dl = { key: 1 }, cl = ["colspan"], fl = {
|
|
31
35
|
key: 0,
|
|
32
36
|
class: "hys-ui-pf-grid-group-row"
|
|
33
|
-
},
|
|
37
|
+
}, vl = ["colspan"], yl = ["data-grid-row", "onClick"], pl = {
|
|
34
38
|
key: 0,
|
|
35
39
|
class: "hys-ui-pf-grid-select-col"
|
|
36
|
-
},
|
|
40
|
+
}, ml = ["data-column-key", "title"], gl = ["onDblclick"], hl = { key: 0 }, kl = ["colspan"], bl = { key: 0 }, wl = { class: "hys-ui-pf-grid-summary-row" }, Sl = {
|
|
37
41
|
key: 0,
|
|
38
42
|
class: "hys-ui-pf-grid-select-col"
|
|
39
|
-
},
|
|
43
|
+
}, Cl = ["data-column-key"], xl = { class: "hys-ui-pf-grid-footer" }, Bl = /* @__PURE__ */ xa({
|
|
40
44
|
__name: "HysDataGrid",
|
|
41
45
|
props: {
|
|
42
46
|
columns: {},
|
|
43
47
|
rows: {},
|
|
44
|
-
rowKey: { default: "id" },
|
|
45
|
-
|
|
48
|
+
rowKey: { type: [String, Function], default: "id" },
|
|
49
|
+
page: {},
|
|
50
|
+
pageSize: {},
|
|
51
|
+
query: {},
|
|
52
|
+
defaultQuery: {},
|
|
53
|
+
immediateQuery: { type: Boolean },
|
|
54
|
+
serverMode: { type: Boolean },
|
|
55
|
+
loadRows: {},
|
|
56
|
+
totalRows: {},
|
|
46
57
|
storageKey: {},
|
|
47
58
|
selectable: { type: Boolean, default: !0 },
|
|
48
|
-
|
|
59
|
+
rowSelectable: {},
|
|
60
|
+
selectedRowKeys: {},
|
|
61
|
+
defaultSelectedRowKeys: {},
|
|
62
|
+
reserveSelection: { type: Boolean, default: void 0 },
|
|
63
|
+
selectionType: { default: "checkbox" },
|
|
64
|
+
loading: { type: Boolean },
|
|
49
65
|
emptyText: { default: "暂无数据" },
|
|
50
66
|
density: { default: "normal" },
|
|
51
|
-
serverMode: { type: Boolean },
|
|
52
|
-
totalRows: {},
|
|
53
|
-
page: {},
|
|
54
67
|
multiSort: { type: Boolean },
|
|
55
68
|
stickyHeader: { type: Boolean },
|
|
69
|
+
maxHeight: {},
|
|
70
|
+
scrollToTopOnQuery: { type: Boolean },
|
|
56
71
|
groupable: { type: Boolean },
|
|
57
72
|
showSummary: { type: Boolean },
|
|
73
|
+
summaryMethod: {},
|
|
58
74
|
treeMode: { type: Boolean },
|
|
59
75
|
parentKey: { default: "parentId" },
|
|
60
|
-
editable: { type: Boolean }
|
|
76
|
+
editable: { type: Boolean },
|
|
77
|
+
popupTransition: {},
|
|
78
|
+
popupTransitionDuration: {}
|
|
61
79
|
},
|
|
62
|
-
emits: ["rowClick", "selectionChange", "columnsChange", "sortChange", "pageChange", "queryChange", "
|
|
63
|
-
setup(
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
80
|
+
emits: ["rowClick", "selectionChange", "update:selectedRowKeys", "columnsChange", "sortChange", "pageChange", "pageSizeChange", "update:query", "queryChange", "loadError", "cellEdit", "batchEdit"],
|
|
81
|
+
setup(v, { expose: Ot, emit: Nt }) {
|
|
82
|
+
const i = v, x = Nt, qt = Va(), te = w(null), ge = w(null), je = w(null), I = w(!1), j = w(!1), ae = w(), ut = Vt(), Bt = Vt(), F = c(
|
|
83
|
+
() => new Map(i.columns.map((e) => [e.key, e]))
|
|
84
|
+
);
|
|
85
|
+
function le(e) {
|
|
86
|
+
const a = [], t = /* @__PURE__ */ new Set();
|
|
87
|
+
for (const o of e.sort ?? []) {
|
|
88
|
+
const n = F.value.get(o.key);
|
|
89
|
+
if (!(!n || n.sortable === !1 || t.has(o.key)) && !(o.direction !== "asc" && o.direction !== "desc") && (t.add(o.key), a.push({ key: o.key, direction: o.direction }), !i.multiSort))
|
|
90
|
+
break;
|
|
71
91
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
} catch {
|
|
86
|
-
}
|
|
92
|
+
const l = Object.fromEntries(
|
|
93
|
+
Object.entries(e.filters ?? {}).filter(([o, n]) => {
|
|
94
|
+
const r = F.value.get(o);
|
|
95
|
+
return r && r.filterable !== !1 && typeof n == "string" && n !== "";
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
return {
|
|
99
|
+
page: Te(e.page, 1),
|
|
100
|
+
pageSize: Te(e.pageSize, 10),
|
|
101
|
+
sort: a,
|
|
102
|
+
search: e.search ?? "",
|
|
103
|
+
filters: l
|
|
104
|
+
};
|
|
87
105
|
}
|
|
88
|
-
|
|
89
|
-
Le(), V("columnsChange", R.value.map((t) => t.key));
|
|
90
|
-
}, { deep: !0 });
|
|
91
|
-
const R = b(() => {
|
|
92
|
-
const l = [.../* @__PURE__ */ new Set([...D.value, ...o.columns.map((e) => e.key)])].filter((e) => !w.value.includes(e)).map((e) => o.columns.find((a) => a.key === e)).filter((e) => !!e);
|
|
93
|
-
return l.length ? l : o.columns;
|
|
94
|
-
});
|
|
95
|
-
Ge({ resetColumns: je });
|
|
96
|
-
const L = b(() => [...R.value.filter((t) => t.pinned === "left"), ...R.value.filter((t) => !t.pinned), ...R.value.filter((t) => t.pinned === "right")]), ae = v(!1);
|
|
97
|
-
async function et(t) {
|
|
106
|
+
const dt = () => {
|
|
98
107
|
var e, a;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
108
|
+
return le({
|
|
109
|
+
...i.defaultQuery,
|
|
110
|
+
page: i.page ?? ((e = i.defaultQuery) == null ? void 0 : e.page),
|
|
111
|
+
pageSize: i.pageSize ?? ((a = i.defaultQuery) == null ? void 0 : a.pageSize)
|
|
112
|
+
});
|
|
113
|
+
}, P = Me(dt()), oe = c(
|
|
114
|
+
() => le(i.query ?? P.value)
|
|
115
|
+
), S = c(() => oe.value.sort), Pe = c({
|
|
116
|
+
get: () => oe.value.search,
|
|
117
|
+
set: (e) => J({ search: e, page: 1 })
|
|
118
|
+
}), Ee = c(() => oe.value.filters), ct = (e) => Object.hasOwn(Ee.value, e) ? Ee.value[e] : "", Q = c(() => oe.value.pageSize), ne = c(() => i.serverMode || !!i.loadRows), he = w(""), ie = Me(/* @__PURE__ */ new Set()), se = Me(/* @__PURE__ */ new Set()), W = w(null), Ke = w(""), ke = w(""), Ae = w(""), Ht = new Intl.Collator("zh-CN", { numeric: !0 }), ee = c(() => ({
|
|
119
|
+
...oe.value,
|
|
120
|
+
page: Math.min(oe.value.page, Je.value)
|
|
121
|
+
})), {
|
|
122
|
+
pending: Ut,
|
|
123
|
+
failure: Ve,
|
|
124
|
+
reload: $t,
|
|
125
|
+
sourceRows: ft,
|
|
126
|
+
remoteTotal: De
|
|
127
|
+
} = qa(i, ee, (e) => x("loadError", e)), Fe = c(() => i.loading || Ut.value), vt = c(
|
|
128
|
+
() => La(
|
|
129
|
+
ft.value,
|
|
130
|
+
i.rowKey,
|
|
131
|
+
ne.value ? (ee.value.page - 1) * Q.value : 0
|
|
132
|
+
)
|
|
133
|
+
), re = (e, a) => String(me(e, a) ?? ""), be = c(() => {
|
|
134
|
+
const e = vt.value;
|
|
135
|
+
if (ne.value) return e;
|
|
136
|
+
const a = Pe.value.trim().toLocaleLowerCase(), t = Object.entries(Ee.value).flatMap(
|
|
137
|
+
([o, n]) => {
|
|
138
|
+
const r = F.value.get(o);
|
|
139
|
+
return r ? [{ column: r, value: n, term: n.toLocaleLowerCase() }] : [];
|
|
140
|
+
}
|
|
141
|
+
), l = e.filter(
|
|
142
|
+
({ row: o }) => (!a || i.columns.some(
|
|
143
|
+
(n) => re(o, n).toLocaleLowerCase().includes(a)
|
|
144
|
+
)) && t.every(
|
|
145
|
+
(n) => n.column.filterMethod ? n.column.filterMethod(n.value, o) : re(o, n.column).toLocaleLowerCase().includes(n.term)
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
return S.value.length ? l.sort((o, n) => {
|
|
149
|
+
for (const { key: r, direction: f } of S.value) {
|
|
150
|
+
const k = F.value.get(r), _ = me(o.row, k), d = me(n.row, k), M = k.sortMethod ? k.sortMethod(o.row, n.row) : typeof _ == "number" && typeof d == "number" ? _ - d : Ht.compare(String(_ ?? ""), String(d ?? ""));
|
|
151
|
+
if (M) return f === "asc" ? M : -M;
|
|
127
152
|
}
|
|
128
153
|
return 0;
|
|
129
|
-
})
|
|
130
|
-
}),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
154
|
+
}) : l;
|
|
155
|
+
}), Qe = c(
|
|
156
|
+
() => i.treeMode ? Oa(be.value, i.parentKey, ie.value) : be.value.map((e) => ({ ...e, depth: 0, hasChildren: !1 }))
|
|
157
|
+
), We = c(
|
|
158
|
+
() => ne.value ? Math.max(
|
|
159
|
+
0,
|
|
160
|
+
Math.floor(
|
|
161
|
+
Number.isFinite(De.value) ? De.value : ft.value.length
|
|
162
|
+
)
|
|
163
|
+
) : Qe.value.length
|
|
164
|
+
), Je = c(
|
|
165
|
+
() => i.loadRows && De.value === void 0 ? Number.MAX_SAFE_INTEGER : Math.max(1, Math.ceil(We.value / Q.value))
|
|
166
|
+
), ue = c(() => ee.value.page), Xe = c(
|
|
167
|
+
() => ne.value ? Qe.value : Qe.value.slice(
|
|
168
|
+
(ue.value - 1) * Q.value,
|
|
169
|
+
ue.value * Q.value
|
|
170
|
+
)
|
|
171
|
+
), It = c(() => be.value.map((e) => e.row)), we = () => le(ee.value);
|
|
172
|
+
function J(e) {
|
|
173
|
+
const a = le({ ...ee.value, ...e });
|
|
174
|
+
JSON.stringify(a) !== JSON.stringify(ee.value) && (i.query === void 0 && (P.value = a), x("update:query", le(a)));
|
|
175
|
+
}
|
|
176
|
+
function jt() {
|
|
177
|
+
J(dt());
|
|
178
|
+
}
|
|
179
|
+
function Ge() {
|
|
180
|
+
i.loadRows ? $t() : x("queryChange", we());
|
|
181
|
+
}
|
|
182
|
+
function Pt(e, a) {
|
|
183
|
+
J({ filters: { ...Ee.value, [e]: a }, page: 1 });
|
|
184
|
+
}
|
|
185
|
+
L(
|
|
186
|
+
[() => i.page, () => i.pageSize],
|
|
187
|
+
([e, a], [t, l]) => {
|
|
188
|
+
const o = P.value;
|
|
189
|
+
P.value = le({
|
|
190
|
+
...o,
|
|
191
|
+
page: e !== t ? e : a !== l ? 1 : o.page,
|
|
192
|
+
pageSize: a !== l ? a : o.pageSize
|
|
193
|
+
});
|
|
161
194
|
}
|
|
195
|
+
), L([Je, () => P.value.page], ([e]) => {
|
|
196
|
+
i.query === void 0 && P.value.page > e && (P.value = { ...P.value, page: e });
|
|
197
|
+
}), L(
|
|
198
|
+
() => JSON.stringify(ee.value),
|
|
199
|
+
() => {
|
|
200
|
+
W.value = null, i.scrollToTopOnQuery && ge.value && (ge.value.scrollTop = 0), x("queryChange", we());
|
|
201
|
+
},
|
|
202
|
+
{ flush: "post" }
|
|
203
|
+
), za(() => {
|
|
204
|
+
i.immediateQuery && x("queryChange", we());
|
|
162
205
|
});
|
|
163
|
-
|
|
164
|
-
|
|
206
|
+
let Ye = !1;
|
|
207
|
+
async function Qt(e) {
|
|
208
|
+
if (Ye) return;
|
|
209
|
+
const a = ue.value;
|
|
210
|
+
J({ page: Math.min(e, Je.value) }), await pe(), ue.value !== a && x("pageChange", ue.value);
|
|
211
|
+
}
|
|
212
|
+
async function Wt(e) {
|
|
213
|
+
const a = Q.value;
|
|
214
|
+
Ye = !0, J({ pageSize: e, page: 1 }), await pe(), Ye = !1, Q.value !== a && x("pageSizeChange", Q.value);
|
|
215
|
+
}
|
|
216
|
+
async function yt(e, a) {
|
|
217
|
+
if (e.sortable === !1) return;
|
|
218
|
+
const t = JSON.stringify(S.value), l = i.multiSort ? S.value.filter((o) => o.key !== e.key) : [];
|
|
219
|
+
a && l.push({ key: e.key, direction: a }), J({ sort: l, page: 1 }), await pe(), JSON.stringify(S.value) !== t && x("sortChange", S.value[0] ?? null);
|
|
220
|
+
}
|
|
221
|
+
function Jt(e) {
|
|
222
|
+
var t;
|
|
223
|
+
const a = (t = S.value.find(
|
|
224
|
+
(l) => l.key === e.key
|
|
225
|
+
)) == null ? void 0 : t.direction;
|
|
226
|
+
yt(
|
|
227
|
+
e,
|
|
228
|
+
a === "asc" ? "desc" : a === "desc" ? null : "asc"
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
function pt(e, a) {
|
|
232
|
+
var l;
|
|
233
|
+
const t = (l = S.value.find(
|
|
234
|
+
(o) => o.key === e.key
|
|
235
|
+
)) == null ? void 0 : l.direction;
|
|
236
|
+
yt(e, t === a ? null : a);
|
|
237
|
+
}
|
|
238
|
+
const Xt = c(
|
|
239
|
+
() => i.columns.filter((e) => e.key !== i.rowKey)
|
|
240
|
+
);
|
|
241
|
+
function Gt(e, a) {
|
|
242
|
+
try {
|
|
243
|
+
return "group:" + JSON.stringify(e ?? null);
|
|
244
|
+
} catch {
|
|
245
|
+
return "group:" + typeof e + ":" + a;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const Yt = c(() => {
|
|
249
|
+
const e = Xe.value.map((o, n) => ({
|
|
250
|
+
kind: "row",
|
|
251
|
+
key: "row:" + st(o.id),
|
|
252
|
+
item: o,
|
|
253
|
+
pageIndex: n
|
|
254
|
+
})), a = F.value.get(he.value);
|
|
255
|
+
if (!a) return e;
|
|
165
256
|
const t = /* @__PURE__ */ new Map();
|
|
166
|
-
|
|
167
|
-
const n =
|
|
168
|
-
|
|
169
|
-
}
|
|
257
|
+
for (const o of e) {
|
|
258
|
+
const n = me(o.item.row, a), r = n == null || n === "" ? "(空)" : String(n), f = Gt(n, r), k = t.get(f);
|
|
259
|
+
k ? k.rows.push(o) : t.set(f, { label: r, rows: [o] });
|
|
260
|
+
}
|
|
170
261
|
const l = [];
|
|
171
|
-
for (const [
|
|
172
|
-
|
|
262
|
+
for (const [o, n] of t)
|
|
263
|
+
l.push({
|
|
264
|
+
kind: "group",
|
|
265
|
+
key: o,
|
|
266
|
+
label: n.label,
|
|
267
|
+
count: n.rows.length
|
|
268
|
+
}), se.value.has(o) || l.push(...n.rows);
|
|
173
269
|
return l;
|
|
174
270
|
});
|
|
175
|
-
function
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
K(G, () => j.value = []);
|
|
191
|
-
const ct = (t) => {
|
|
192
|
-
if (!t.summary) return "";
|
|
193
|
-
const l = q.value.map((n) => n[t.key]).filter((n) => n != null && n !== "");
|
|
194
|
-
if (t.summary === "count") return String(l.length);
|
|
195
|
-
const e = l.map(Number).filter(Number.isFinite);
|
|
196
|
-
if (!e.length) return "—";
|
|
197
|
-
const a = t.summary === "sum" ? e.reduce((n, d) => n + d, 0) : t.summary === "avg" ? e.reduce((n, d) => n + d, 0) / e.length : t.summary === "min" ? Math.min(...e) : Math.max(...e);
|
|
198
|
-
return new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 2 }).format(a);
|
|
199
|
-
}, we = b(() => be.value.map((t, l) => Z(t, l))), $e = b(() => we.value.length > 0 && we.value.every((t) => h.value.includes(t))), ft = b(() => we.value.some((t) => h.value.includes(t)));
|
|
200
|
-
function yt(t, l) {
|
|
201
|
-
h.value = l ? [.../* @__PURE__ */ new Set([...h.value, t])] : h.value.filter((e) => e !== t), V("selectionChange", h.value);
|
|
202
|
-
}
|
|
203
|
-
function vt(t) {
|
|
204
|
-
const l = new Set(we.value);
|
|
205
|
-
h.value = t ? [.../* @__PURE__ */ new Set([...h.value, ...l])] : h.value.filter((e) => !l.has(e)), V("selectionChange", h.value);
|
|
206
|
-
}
|
|
207
|
-
function Fe(t, l) {
|
|
208
|
-
if (t.sortable === !1) return;
|
|
209
|
-
const e = l ? { key: t.key, direction: l } : null;
|
|
210
|
-
o.multiSort ? (O.value = O.value.filter((a) => a.key !== t.key), e && (O.value = [...O.value, e]), te.value = O.value[0] ?? null) : (te.value = e, O.value = e ? [e] : []), V("sortChange", te.value);
|
|
211
|
-
}
|
|
212
|
-
function mt(t) {
|
|
213
|
-
var e;
|
|
214
|
-
const l = (e = x.value.find((a) => a.key === t.key)) == null ? void 0 : e.direction;
|
|
215
|
-
Fe(t, l === "asc" ? "desc" : l === "desc" ? null : "asc");
|
|
271
|
+
function mt(e, a) {
|
|
272
|
+
const t = new Set(e);
|
|
273
|
+
return t.has(a) ? t.delete(a) : t.add(a), t;
|
|
274
|
+
}
|
|
275
|
+
function Zt(e) {
|
|
276
|
+
ie.value = mt(ie.value, e);
|
|
277
|
+
}
|
|
278
|
+
function _t(e) {
|
|
279
|
+
se.value = mt(se.value, e);
|
|
280
|
+
}
|
|
281
|
+
L(he, () => {
|
|
282
|
+
se.value = /* @__PURE__ */ new Set();
|
|
283
|
+
});
|
|
284
|
+
function ea(e, a) {
|
|
285
|
+
!i.editable || !a.editable || (W.value = { id: e.id, key: a.key }, Ke.value = re(e.row, a));
|
|
216
286
|
}
|
|
217
|
-
function
|
|
287
|
+
function gt(e, a) {
|
|
288
|
+
var t, l;
|
|
289
|
+
((t = W.value) == null ? void 0 : t.id) !== e.id || ((l = W.value) == null ? void 0 : l.key) !== a.key || (W.value = null, x("cellEdit", {
|
|
290
|
+
row: e.row,
|
|
291
|
+
rowKey: e.id,
|
|
292
|
+
column: a.key,
|
|
293
|
+
value: Ke.value
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
296
|
+
function ta() {
|
|
297
|
+
!ke.value || !b.value.length || (x("batchEdit", {
|
|
298
|
+
keys: [...b.value],
|
|
299
|
+
column: ke.value,
|
|
300
|
+
value: Ae.value
|
|
301
|
+
}), Ae.value = "");
|
|
302
|
+
}
|
|
303
|
+
const aa = new Intl.NumberFormat("zh-CN", {
|
|
304
|
+
maximumFractionDigits: 2
|
|
305
|
+
});
|
|
306
|
+
function la(e) {
|
|
307
|
+
const a = It.value;
|
|
308
|
+
if (i.summaryMethod) return i.summaryMethod(e, a);
|
|
309
|
+
if (!e.summary) return "";
|
|
310
|
+
const t = a.map((r) => me(r, e)).filter((r) => r != null && r !== "");
|
|
311
|
+
if (e.summary === "count") return String(t.length);
|
|
312
|
+
const l = t.map(Number).filter(Number.isFinite);
|
|
313
|
+
if (!l.length) return "—";
|
|
314
|
+
const o = l.reduce((r, f) => r + f, 0), n = e.summary === "sum" ? o : e.summary === "avg" ? o / l.length : l.reduce(
|
|
315
|
+
(r, f) => e.summary === "min" ? Math.min(r, f) : Math.max(r, f)
|
|
316
|
+
);
|
|
317
|
+
return aa.format(n);
|
|
318
|
+
}
|
|
319
|
+
function Ze(e) {
|
|
320
|
+
const a = [...new Set(e.filter(Na))];
|
|
321
|
+
return i.selectionType === "radio" ? a.slice(0, 1) : a;
|
|
322
|
+
}
|
|
323
|
+
const ht = Me(
|
|
324
|
+
Ze(i.defaultSelectedRowKeys ?? [])
|
|
325
|
+
), b = c(
|
|
326
|
+
() => Ze(i.selectedRowKeys ?? ht.value)
|
|
327
|
+
), Le = c(() => new Set(b.value)), _e = c(
|
|
328
|
+
() => new Map(vt.value.map((e) => [e.id, e]))
|
|
329
|
+
), Oe = (e) => {
|
|
218
330
|
var a;
|
|
219
|
-
|
|
220
|
-
|
|
331
|
+
return ((a = i.rowSelectable) == null ? void 0 : a.call(i, e.row, e.index)) !== !1;
|
|
332
|
+
}, Se = c(
|
|
333
|
+
() => Xe.value.filter(Oe).map((e) => e.id)
|
|
334
|
+
), kt = c(
|
|
335
|
+
() => Se.value.length > 0 && Se.value.every((e) => Le.value.has(e))
|
|
336
|
+
), oa = c(
|
|
337
|
+
() => Se.value.some((e) => Le.value.has(e))
|
|
338
|
+
), bt = () => [...b.value];
|
|
339
|
+
function Ce(e) {
|
|
340
|
+
const a = Ze(e);
|
|
341
|
+
a.length === b.value.length && a.every((t, l) => t === b.value[l]) || (i.selectedRowKeys === void 0 && (ht.value = a), x("update:selectedRowKeys", [...a]));
|
|
342
|
+
}
|
|
343
|
+
L(
|
|
344
|
+
() => JSON.stringify(b.value),
|
|
345
|
+
() => x("selectionChange", bt())
|
|
346
|
+
), L([_e, () => i.reserveSelection, ne], () => {
|
|
347
|
+
i.selectedRowKeys === void 0 && !(i.reserveSelection ?? ne.value) && Ce(b.value.filter((e) => _e.value.has(e)));
|
|
348
|
+
});
|
|
349
|
+
function et(e, a = !Le.value.has(e)) {
|
|
350
|
+
const t = _e.value.get(e);
|
|
351
|
+
!i.selectable || !t || !Oe(t) || Ce(
|
|
352
|
+
a ? i.selectionType === "radio" ? [e] : [...b.value, e] : b.value.filter((l) => l !== e)
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
function na() {
|
|
356
|
+
Ce([]);
|
|
357
|
+
}
|
|
358
|
+
function ia(e) {
|
|
359
|
+
if (i.selectionType === "radio") return;
|
|
360
|
+
const a = new Set(Se.value);
|
|
361
|
+
Ce(
|
|
362
|
+
e ? [...b.value, ...a] : b.value.filter((t) => !a.has(t))
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
function sa() {
|
|
366
|
+
if (!i.storageKey || typeof localStorage > "u") return {};
|
|
367
|
+
try {
|
|
368
|
+
const e = JSON.parse(
|
|
369
|
+
localStorage.getItem("hys-ui-grid:" + i.storageKey) || "{}"
|
|
370
|
+
);
|
|
371
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
372
|
+
} catch {
|
|
373
|
+
return {};
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
const X = sa(), E = w(
|
|
377
|
+
Array.isArray(X.order) ? X.order.filter((e) => typeof e == "string") : []
|
|
378
|
+
), C = w(
|
|
379
|
+
Array.isArray(X.hidden) ? X.hidden.filter((e) => typeof e == "string") : []
|
|
380
|
+
), K = w(
|
|
381
|
+
X.widths && typeof X.widths == "object" && !Array.isArray(X.widths) ? Object.fromEntries(
|
|
382
|
+
Object.entries(X.widths).filter(
|
|
383
|
+
([, e]) => typeof e == "number" && Number.isFinite(e)
|
|
384
|
+
)
|
|
385
|
+
) : {}
|
|
386
|
+
), Ne = (e) => Te(e.minWidth, 80), tt = (e) => Math.max(Ne(e), Te(e.maxWidth, 800)), qe = (e, a) => Math.max(Ne(e), Math.min(tt(e), a)), Be = Me(), B = (e) => {
|
|
387
|
+
var a;
|
|
388
|
+
return ((a = Be.value) == null ? void 0 : a.key) === e.key ? Be.value.width : Object.hasOwn(K.value, e.key) ? K.value[e.key] : Te(e.width, 160);
|
|
389
|
+
};
|
|
390
|
+
L(
|
|
391
|
+
() => i.columns.map((e) => [
|
|
392
|
+
e.key,
|
|
393
|
+
e.hideable,
|
|
394
|
+
e.minWidth,
|
|
395
|
+
e.maxWidth
|
|
396
|
+
]),
|
|
397
|
+
(e, a) => {
|
|
398
|
+
a && Y();
|
|
399
|
+
const t = F.value, l = [...t.keys()];
|
|
400
|
+
E.value = [
|
|
401
|
+
.../* @__PURE__ */ new Set([...E.value.filter((o) => t.has(o)), ...l])
|
|
402
|
+
], C.value = [
|
|
403
|
+
...new Set(
|
|
404
|
+
C.value.filter(
|
|
405
|
+
(o) => {
|
|
406
|
+
var n;
|
|
407
|
+
return t.has(o) && ((n = t.get(o)) == null ? void 0 : n.hideable) !== !1;
|
|
408
|
+
}
|
|
409
|
+
)
|
|
410
|
+
)
|
|
411
|
+
], l.every((o) => C.value.includes(o)) && (C.value = []), K.value = Object.fromEntries(
|
|
412
|
+
Object.entries(K.value).flatMap(([o, n]) => {
|
|
413
|
+
const r = t.get(o);
|
|
414
|
+
return r ? [[o, qe(r, n)]] : [];
|
|
415
|
+
})
|
|
416
|
+
);
|
|
417
|
+
},
|
|
418
|
+
{ immediate: !0 }
|
|
419
|
+
);
|
|
420
|
+
const A = c(
|
|
421
|
+
() => E.value.flatMap((e) => {
|
|
422
|
+
const a = F.value.get(e);
|
|
423
|
+
return a && !C.value.includes(e) ? [a] : [];
|
|
424
|
+
})
|
|
425
|
+
), G = c(() => [
|
|
426
|
+
...A.value.filter((e) => e.pinned === "left"),
|
|
427
|
+
...A.value.filter((e) => !e.pinned),
|
|
428
|
+
...A.value.filter((e) => e.pinned === "right")
|
|
429
|
+
]), ra = c(
|
|
430
|
+
() => E.value.flatMap((e) => {
|
|
431
|
+
const a = F.value.get(e);
|
|
432
|
+
return a ? [{ id: e, label: a.label }] : [];
|
|
433
|
+
})
|
|
434
|
+
);
|
|
435
|
+
L([E, C, K], () => {
|
|
436
|
+
if (i.storageKey && typeof localStorage < "u")
|
|
437
|
+
try {
|
|
438
|
+
localStorage.setItem(
|
|
439
|
+
"hys-ui-grid:" + i.storageKey,
|
|
440
|
+
JSON.stringify({
|
|
441
|
+
order: E.value,
|
|
442
|
+
hidden: C.value,
|
|
443
|
+
widths: K.value
|
|
444
|
+
})
|
|
445
|
+
);
|
|
446
|
+
} catch {
|
|
447
|
+
}
|
|
448
|
+
x(
|
|
449
|
+
"columnsChange",
|
|
450
|
+
A.value.map((e) => e.key)
|
|
451
|
+
);
|
|
452
|
+
});
|
|
453
|
+
function ua(e) {
|
|
454
|
+
e.hideable !== !1 && (C.value.includes(e.key) ? C.value = C.value.filter((a) => a !== e.key) : A.value.length > 1 && (C.value = [...C.value, e.key]));
|
|
455
|
+
}
|
|
456
|
+
const da = c(
|
|
457
|
+
() => G.value.reduce(
|
|
458
|
+
(e, a) => e + B(a),
|
|
459
|
+
i.selectable ? 44 : 0
|
|
460
|
+
)
|
|
461
|
+
), ca = c(() => {
|
|
462
|
+
const e = /* @__PURE__ */ new Map();
|
|
463
|
+
let a = i.selectable ? 44 : 0;
|
|
464
|
+
for (const l of G.value)
|
|
465
|
+
l.pinned === "left" && (e.set(l.key, { left: a + "px" }), a += B(l));
|
|
466
|
+
let t = 0;
|
|
467
|
+
for (const l of [...G.value].reverse())
|
|
468
|
+
l.pinned === "right" && (e.set(l.key, { right: t + "px" }), t += B(l));
|
|
469
|
+
return e;
|
|
470
|
+
}), He = (e, a = !1) => e.pinned ? {
|
|
471
|
+
position: "sticky",
|
|
472
|
+
...ca.value.get(e.key),
|
|
473
|
+
zIndex: a ? 5 : 2
|
|
474
|
+
} : {};
|
|
475
|
+
async function wt(e = !0) {
|
|
476
|
+
var o, n;
|
|
477
|
+
if (j.value = !1, !e) return;
|
|
478
|
+
await pe();
|
|
479
|
+
const t = [
|
|
480
|
+
...((o = te.value) == null ? void 0 : o.querySelectorAll(
|
|
481
|
+
"thead th[data-column-key]"
|
|
482
|
+
)) ?? []
|
|
483
|
+
].find(
|
|
484
|
+
(r) => r.dataset.columnKey === ae.value
|
|
485
|
+
), l = (t == null ? void 0 : t.querySelector(".hys-ui-pf-grid-filter")) ?? ((n = te.value) == null ? void 0 : n.querySelector(".hys-ui-pf-grid-filter"));
|
|
486
|
+
l == null || l.focus({ preventScroll: !0 });
|
|
487
|
+
}
|
|
488
|
+
async function fa(e) {
|
|
489
|
+
var t, l, o;
|
|
490
|
+
if (j.value && ae.value === e.key) {
|
|
491
|
+
await wt(!1);
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
ae.value = e.key, j.value = !0, await pe(), (o = (l = [
|
|
495
|
+
...((t = te.value) == null ? void 0 : t.querySelectorAll("[data-filter-key]")) ?? []
|
|
496
|
+
].find((n) => n.dataset.filterKey === e.key)) == null ? void 0 : l.querySelector("input")) == null || o.focus({ preventScroll: !0 });
|
|
221
497
|
}
|
|
222
|
-
|
|
223
|
-
|
|
498
|
+
let p, xe = 0, St = 0;
|
|
499
|
+
function Ct(e) {
|
|
500
|
+
!p || e.pointerId !== p.pointer || (St = qe(
|
|
501
|
+
p.column,
|
|
502
|
+
p.width + e.clientX - p.start
|
|
503
|
+
), !xe && (xe = requestAnimationFrame(() => {
|
|
504
|
+
xe = 0, p && (Be.value = { key: p.column.key, width: St });
|
|
505
|
+
})));
|
|
224
506
|
}
|
|
225
|
-
function
|
|
226
|
-
|
|
507
|
+
function Y() {
|
|
508
|
+
p && (cancelAnimationFrame(xe), xe = 0, Be.value = void 0, document.body.style.cursor === "col-resize" && (document.body.style.cursor = p.cursor), p = void 0, window.removeEventListener("pointermove", Ct), window.removeEventListener("pointerup", Rt), window.removeEventListener("pointercancel", xt), window.removeEventListener("blur", Y), window.removeEventListener("keydown", zt, !0));
|
|
227
509
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
t.hideable !== !1 && (w.value.includes(t.key) ? w.value = w.value.filter((l) => l !== t.key) : R.value.length > 1 && (w.value = [...w.value, t.key]));
|
|
510
|
+
function xt(e) {
|
|
511
|
+
e.pointerId === (p == null ? void 0 : p.pointer) && Y();
|
|
231
512
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
T && (p.value = { ...p.value, [T.key]: Math.max(T.min, Math.min(T.max, T.width + t.clientX - T.start)) });
|
|
513
|
+
function zt(e) {
|
|
514
|
+
e.key === "Escape" && p && (e.preventDefault(), e.stopPropagation(), Y());
|
|
235
515
|
}
|
|
236
|
-
function
|
|
237
|
-
|
|
516
|
+
function Rt(e) {
|
|
517
|
+
if (!p || e.pointerId !== p.pointer) return;
|
|
518
|
+
const { column: a, start: t, width: l } = p, o = e.clientX - t, n = o === 0 ? l : qe(a, l + o);
|
|
519
|
+
Y(), n !== l && (K.value = { ...K.value, [a.key]: n });
|
|
238
520
|
}
|
|
239
|
-
function
|
|
240
|
-
|
|
521
|
+
function va(e, a) {
|
|
522
|
+
a.resizable === !1 || e.button !== 0 || p || (e.preventDefault(), e.stopPropagation(), p = {
|
|
523
|
+
column: a,
|
|
524
|
+
pointer: e.pointerId,
|
|
525
|
+
start: e.clientX,
|
|
526
|
+
width: B(a),
|
|
527
|
+
cursor: document.body.style.cursor
|
|
528
|
+
}, document.body.style.cursor = "col-resize", window.addEventListener("pointermove", Ct), window.addEventListener("pointerup", Rt), window.addEventListener("pointercancel", xt), window.addEventListener("blur", Y), window.addEventListener("keydown", zt, !0));
|
|
241
529
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
ye.clear();
|
|
530
|
+
function ya(e, a) {
|
|
531
|
+
const t = e.shiftKey ? 40 : 10, l = B(a), o = e.key === "ArrowLeft" ? l - t : e.key === "ArrowRight" ? l + t : e.key === "Home" ? Ne(a) : e.key === "End" ? tt(a) : void 0;
|
|
532
|
+
if (o === void 0) return;
|
|
533
|
+
e.preventDefault();
|
|
534
|
+
const n = qe(a, o);
|
|
535
|
+
n !== l && (K.value = { ...K.value, [a.key]: n });
|
|
249
536
|
}
|
|
250
|
-
|
|
251
|
-
|
|
537
|
+
const { effectiveMotion: Ue } = Fa(), de = w(null), Z = w(null);
|
|
538
|
+
let H = 0, ce = null, at = 0;
|
|
539
|
+
const ze = /* @__PURE__ */ new Set(), Mt = 160;
|
|
540
|
+
function Re() {
|
|
541
|
+
at++;
|
|
542
|
+
for (const e of ze) e.cancel();
|
|
543
|
+
ze.clear();
|
|
544
|
+
}
|
|
545
|
+
L(Ue, (e) => {
|
|
546
|
+
e === "off" && Re();
|
|
252
547
|
});
|
|
253
|
-
function
|
|
254
|
-
cancelAnimationFrame(
|
|
548
|
+
function fe() {
|
|
549
|
+
cancelAnimationFrame(H), H = 0, ce = null, de.value = null, Z.value = null;
|
|
255
550
|
}
|
|
256
|
-
function
|
|
257
|
-
if (
|
|
258
|
-
|
|
551
|
+
function pa(e, a) {
|
|
552
|
+
if (p || a.reorderable === !1 || !e.dataTransfer) {
|
|
553
|
+
e.preventDefault();
|
|
259
554
|
return;
|
|
260
555
|
}
|
|
261
|
-
|
|
556
|
+
Re(), de.value = a.key, e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", a.key);
|
|
262
557
|
}
|
|
263
|
-
function
|
|
264
|
-
const
|
|
265
|
-
return !!
|
|
558
|
+
function lt(e) {
|
|
559
|
+
const a = i.columns.find((t) => t.key === de.value);
|
|
560
|
+
return !!a && a.key !== e.key && a.reorderable !== !1 && e.reorderable !== !1 && a.pinned === e.pinned;
|
|
266
561
|
}
|
|
267
|
-
function
|
|
268
|
-
const
|
|
269
|
-
return {
|
|
562
|
+
function Tt(e, a, t) {
|
|
563
|
+
const l = t.getBoundingClientRect();
|
|
564
|
+
return {
|
|
565
|
+
key: e.key,
|
|
566
|
+
position: a < l.left + l.width / 2 ? "before" : "after"
|
|
567
|
+
};
|
|
270
568
|
}
|
|
271
|
-
function
|
|
272
|
-
if (!
|
|
273
|
-
cancelAnimationFrame(
|
|
569
|
+
function ma(e, a) {
|
|
570
|
+
if (!lt(a)) {
|
|
571
|
+
cancelAnimationFrame(H), H = 0, ce = null, Z.value = null;
|
|
274
572
|
return;
|
|
275
573
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
574
|
+
e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), ce = {
|
|
575
|
+
element: e.currentTarget,
|
|
576
|
+
column: a,
|
|
577
|
+
x: e.clientX
|
|
578
|
+
}, !H && (H = requestAnimationFrame(() => {
|
|
579
|
+
var o;
|
|
580
|
+
H = 0;
|
|
581
|
+
const t = ce;
|
|
582
|
+
if (ce = null, !t || !lt(t.column)) return;
|
|
583
|
+
const l = Tt(t.column, t.x, t.element);
|
|
584
|
+
(((o = Z.value) == null ? void 0 : o.key) !== l.key || Z.value.position !== l.position) && (Z.value = l);
|
|
283
585
|
}));
|
|
284
586
|
}
|
|
285
|
-
function
|
|
286
|
-
|
|
587
|
+
function ga(e) {
|
|
588
|
+
e.relatedTarget instanceof Element && e.relatedTarget.closest("th[data-column-key]") && e.currentTarget.contains(e.relatedTarget) || (cancelAnimationFrame(H), H = 0, ce = null, Z.value = null);
|
|
287
589
|
}
|
|
288
|
-
function
|
|
289
|
-
var
|
|
290
|
-
return new Map(
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
if (
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
590
|
+
function Et() {
|
|
591
|
+
var e;
|
|
592
|
+
return new Map(
|
|
593
|
+
Array.from(
|
|
594
|
+
((e = te.value) == null ? void 0 : e.querySelectorAll("th[data-column-key]")) || []
|
|
595
|
+
).map((a) => [
|
|
596
|
+
a.dataset.columnKey,
|
|
597
|
+
a.getBoundingClientRect()
|
|
598
|
+
])
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
function ha(e) {
|
|
602
|
+
var d;
|
|
603
|
+
if (Ue.value === "off") return;
|
|
604
|
+
const a = (d = te.value) == null ? void 0 : d.querySelector(
|
|
605
|
+
".hys-ui-pf-grid-scroll"
|
|
606
|
+
);
|
|
607
|
+
if (!a) return;
|
|
608
|
+
const t = a.getBoundingClientRect(), l = Math.max(0, t.top), o = Math.min(window.innerHeight, t.bottom), n = Math.max(0, t.left), r = Math.min(window.innerWidth, t.right);
|
|
609
|
+
if (l >= o || n >= r) return;
|
|
610
|
+
const f = /* @__PURE__ */ new Map();
|
|
611
|
+
for (const [M, U] of Et()) {
|
|
612
|
+
const R = e.get(M);
|
|
613
|
+
R && U.right > n && U.left < r && Math.abs(R.left - U.left) > 0.5 && f.set(M, R.left - U.left);
|
|
306
614
|
}
|
|
307
|
-
const
|
|
308
|
-
for (const
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
615
|
+
const k = [];
|
|
616
|
+
for (const M of Array.from(
|
|
617
|
+
a.querySelectorAll("thead tr,tbody tr,tfoot tr")
|
|
618
|
+
)) {
|
|
619
|
+
const U = M.getBoundingClientRect();
|
|
620
|
+
if (U.top >= o) break;
|
|
621
|
+
if (!(U.bottom <= l)) {
|
|
622
|
+
for (const R of Array.from(M.children))
|
|
623
|
+
if (R instanceof HTMLElement && f.has(R.dataset.columnKey || "") && k.push(R), k.length >= Mt) break;
|
|
624
|
+
if (k.length >= Mt) break;
|
|
315
625
|
}
|
|
316
626
|
}
|
|
317
|
-
const
|
|
318
|
-
for (const
|
|
319
|
-
const
|
|
320
|
-
|
|
627
|
+
const _ = Ue.value === "full" ? 280 : 180;
|
|
628
|
+
for (const M of k) {
|
|
629
|
+
const U = f.get(M.dataset.columnKey), R = M.animate(
|
|
630
|
+
[
|
|
631
|
+
{ transform: "translateX(" + U + "px)" },
|
|
632
|
+
{ transform: "translateX(0)" }
|
|
633
|
+
],
|
|
634
|
+
{ duration: _, easing: "cubic-bezier(.2,.8,.2,1)" }
|
|
635
|
+
);
|
|
636
|
+
ze.add(R), R.onfinish = () => ze.delete(R), R.oncancel = () => ze.delete(R);
|
|
321
637
|
}
|
|
322
638
|
}
|
|
323
|
-
async function
|
|
324
|
-
if (!
|
|
325
|
-
|
|
639
|
+
async function ka(e, a) {
|
|
640
|
+
if (!lt(a)) {
|
|
641
|
+
fe();
|
|
326
642
|
return;
|
|
327
643
|
}
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
644
|
+
e.preventDefault();
|
|
645
|
+
const t = Tt(
|
|
646
|
+
a,
|
|
647
|
+
e.clientX,
|
|
648
|
+
e.currentTarget
|
|
649
|
+
), l = E.value.filter((f) => f !== de.value), o = l.indexOf(t.key);
|
|
650
|
+
if (o < 0) {
|
|
651
|
+
fe();
|
|
332
652
|
return;
|
|
333
653
|
}
|
|
334
|
-
if (
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
654
|
+
if (l.splice(
|
|
655
|
+
o + (t.position === "after" ? 1 : 0),
|
|
656
|
+
0,
|
|
657
|
+
de.value
|
|
658
|
+
), fe(), l.every((f, k) => f === E.value[k])) return;
|
|
659
|
+
Re();
|
|
660
|
+
const n = at, r = Ue.value === "off" ? /* @__PURE__ */ new Map() : Et();
|
|
661
|
+
E.value = l, await pe(), n === at && ha(r);
|
|
662
|
+
}
|
|
663
|
+
function Kt() {
|
|
664
|
+
Y(), fe(), Re(), E.value = [...F.value.keys()], C.value = [], K.value = {};
|
|
665
|
+
}
|
|
666
|
+
function ba() {
|
|
667
|
+
const e = A.value, a = (n) => '"' + n.replace(/"/g, '""') + '"', t = [
|
|
668
|
+
e.map((n) => a(n.label)).join(","),
|
|
669
|
+
...be.value.map(
|
|
670
|
+
({ row: n }) => e.map((r) => a(re(n, r))).join(",")
|
|
671
|
+
)
|
|
672
|
+
], l = URL.createObjectURL(
|
|
673
|
+
new Blob(["\uFEFF" + t.join(`\r
|
|
674
|
+
`)], {
|
|
675
|
+
type: "text/csv;charset=utf-8"
|
|
676
|
+
})
|
|
677
|
+
), o = document.createElement("a");
|
|
678
|
+
o.href = l, o.download = "projectflow-table.csv", o.click(), setTimeout(() => URL.revokeObjectURL(l), 1e3);
|
|
679
|
+
}
|
|
680
|
+
const wa = c(
|
|
681
|
+
() => typeof i.maxHeight == "number" ? i.maxHeight > 0 && Number.isFinite(i.maxHeight) ? i.maxHeight + "px" : void 0 : i.maxHeight
|
|
682
|
+
);
|
|
683
|
+
function Sa(e) {
|
|
684
|
+
var a;
|
|
685
|
+
(a = ge.value) == null || a.scrollTo(e);
|
|
686
|
+
}
|
|
687
|
+
function Ca(e) {
|
|
688
|
+
var t;
|
|
689
|
+
const a = [
|
|
690
|
+
...((t = ge.value) == null ? void 0 : t.querySelectorAll("[data-grid-row]")) ?? []
|
|
691
|
+
].find((l) => l.dataset.gridRow === st(e));
|
|
692
|
+
return a == null || a.scrollIntoView({ block: "nearest", inline: "nearest" }), !!a;
|
|
693
|
+
}
|
|
694
|
+
Ot({
|
|
695
|
+
resetColumns: Kt,
|
|
696
|
+
getQuery: we,
|
|
697
|
+
setQuery: J,
|
|
698
|
+
resetQuery: jt,
|
|
699
|
+
reload: Ge,
|
|
700
|
+
getSelection: bt,
|
|
701
|
+
clearSelection: na,
|
|
702
|
+
toggleRowSelection: et,
|
|
703
|
+
scrollTo: Sa,
|
|
704
|
+
scrollToRow: Ca
|
|
705
|
+
});
|
|
706
|
+
function ot(e) {
|
|
707
|
+
je.value && !je.value.contains(e.target) && (I.value = !1);
|
|
708
|
+
}
|
|
709
|
+
L(I, (e) => {
|
|
710
|
+
e ? document.addEventListener("pointerdown", ot) : document.removeEventListener("pointerdown", ot);
|
|
711
|
+
});
|
|
712
|
+
function At() {
|
|
713
|
+
fe(), Re(), Y(), I.value = !1, document.removeEventListener("pointerdown", ot);
|
|
714
|
+
}
|
|
715
|
+
return Ra(At), Ma(At), (e, a) => (s(), u("section", Ta(m(qt), {
|
|
716
|
+
class: ["hys-ui-pf-grid", "hys-ui-pf-grid--" + v.density],
|
|
358
717
|
"aria-label": "数据表格",
|
|
359
718
|
ref_key: "tableRef",
|
|
360
|
-
ref:
|
|
719
|
+
ref: te,
|
|
720
|
+
"aria-busy": Fe.value || void 0
|
|
361
721
|
}), [
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
722
|
+
y("div", Ia, [
|
|
723
|
+
y("label", ja, [
|
|
724
|
+
a[14] || (a[14] = y("span", null, "搜索", -1)),
|
|
725
|
+
g(Ie, {
|
|
726
|
+
size: "sm",
|
|
727
|
+
modelValue: Pe.value,
|
|
728
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => Pe.value = t),
|
|
368
729
|
type: "search",
|
|
369
730
|
placeholder: "搜索全部列…",
|
|
370
731
|
"aria-label": "搜索表格",
|
|
371
732
|
clearable: ""
|
|
372
733
|
}, null, 8, ["modelValue"])
|
|
373
734
|
]),
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
735
|
+
v.groupable ? (s(), u("label", Pa, [
|
|
736
|
+
a[15] || (a[15] = V("分组 ", -1)),
|
|
737
|
+
g(Lt, {
|
|
738
|
+
size: "sm",
|
|
739
|
+
modelValue: he.value,
|
|
740
|
+
"onUpdate:modelValue": a[1] || (a[1] = (t) => he.value = t),
|
|
379
741
|
"aria-label": "按列分组",
|
|
380
|
-
options: [
|
|
742
|
+
options: [
|
|
743
|
+
{ label: "不分组", value: "" },
|
|
744
|
+
...Xt.value.map((t) => ({ label: t.label, value: t.key }))
|
|
745
|
+
]
|
|
381
746
|
}, null, 8, ["modelValue", "options"])
|
|
382
|
-
])) :
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
747
|
+
])) : h("", !0),
|
|
748
|
+
v.editable && b.value.length ? (s(), u("div", Qa, [
|
|
749
|
+
g(Lt, {
|
|
750
|
+
size: "sm",
|
|
751
|
+
modelValue: ke.value,
|
|
752
|
+
"onUpdate:modelValue": a[2] || (a[2] = (t) => ke.value = t),
|
|
387
753
|
"aria-label": "批量编辑字段",
|
|
388
|
-
options: [
|
|
754
|
+
options: [
|
|
755
|
+
{ label: "选择编辑列", value: "" },
|
|
756
|
+
...v.columns.filter((t) => t.editable).map((t) => ({ label: t.label, value: t.key }))
|
|
757
|
+
]
|
|
389
758
|
}, null, 8, ["modelValue", "options"]),
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
759
|
+
g(Ie, {
|
|
760
|
+
size: "sm",
|
|
761
|
+
modelValue: Ae.value,
|
|
762
|
+
"onUpdate:modelValue": a[3] || (a[3] = (t) => Ae.value = t),
|
|
393
763
|
"aria-label": "批量编辑值",
|
|
394
764
|
placeholder: "新值"
|
|
395
765
|
}, null, 8, ["modelValue"]),
|
|
396
|
-
|
|
766
|
+
g(T, {
|
|
397
767
|
variant: "ghost",
|
|
398
768
|
size: "sm",
|
|
399
769
|
type: "button",
|
|
400
|
-
disabled: !
|
|
401
|
-
onClick:
|
|
770
|
+
disabled: !ke.value,
|
|
771
|
+
onClick: ta
|
|
402
772
|
}, {
|
|
403
773
|
default: z(() => [
|
|
404
|
-
|
|
774
|
+
V("应用到 " + O(b.value.length) + " 行", 1)
|
|
405
775
|
]),
|
|
406
776
|
_: 1
|
|
407
777
|
}, 8, ["disabled"])
|
|
408
|
-
])) :
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
size: "sm",
|
|
424
|
-
type: "button",
|
|
425
|
-
onClick: l[5] || (l[5] = (e) => ae.value = !1)
|
|
426
|
-
}, {
|
|
427
|
-
default: z(() => [...l[16] || (l[16] = [
|
|
428
|
-
H("收起筛选", -1)
|
|
429
|
-
])]),
|
|
430
|
-
_: 1
|
|
431
|
-
})
|
|
432
|
-
], 64)) : k("", !0),
|
|
433
|
-
g("span", Pt, E(r.serverMode ? r.totalRows ?? r.rows.length : q.value.length) + " 条记录 · 已选 " + E(h.value.length), 1),
|
|
434
|
-
g("div", {
|
|
778
|
+
])) : h("", !0),
|
|
779
|
+
j.value ? (s(), D(T, {
|
|
780
|
+
key: 2,
|
|
781
|
+
variant: "ghost",
|
|
782
|
+
size: "sm",
|
|
783
|
+
type: "button",
|
|
784
|
+
onClick: a[4] || (a[4] = (t) => J({ filters: {}, page: 1 }))
|
|
785
|
+
}, {
|
|
786
|
+
default: z(() => [...a[16] || (a[16] = [
|
|
787
|
+
V("清空筛选", -1)
|
|
788
|
+
])]),
|
|
789
|
+
_: 1
|
|
790
|
+
})) : h("", !0),
|
|
791
|
+
y("span", Wa, O(We.value) + " 条记录 · 已选 " + O(b.value.length), 1),
|
|
792
|
+
y("div", {
|
|
435
793
|
class: "hys-ui-pf-grid-menu",
|
|
436
794
|
ref_key: "menuRef",
|
|
437
|
-
ref:
|
|
795
|
+
ref: je
|
|
438
796
|
}, [
|
|
439
|
-
|
|
797
|
+
g(T, {
|
|
440
798
|
variant: "ghost",
|
|
441
799
|
size: "sm",
|
|
442
800
|
type: "button",
|
|
443
|
-
onClick:
|
|
444
|
-
"aria-expanded":
|
|
801
|
+
onClick: a[5] || (a[5] = (t) => I.value = !I.value),
|
|
802
|
+
"aria-expanded": I.value,
|
|
445
803
|
"aria-label": "配置显示列"
|
|
446
804
|
}, {
|
|
447
805
|
default: z(() => [
|
|
448
|
-
m(
|
|
806
|
+
g(m(Ea), {
|
|
449
807
|
size: 16,
|
|
450
808
|
"aria-hidden": "true"
|
|
451
809
|
}),
|
|
452
|
-
|
|
810
|
+
a[17] || (a[17] = V(" 列设置", -1))
|
|
453
811
|
]),
|
|
454
812
|
_: 1
|
|
455
813
|
}, 8, ["aria-expanded"]),
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
814
|
+
g(m(Da), {
|
|
815
|
+
"popup-transition": i.popupTransition,
|
|
816
|
+
"popup-transition-duration": i.popupTransitionDuration,
|
|
817
|
+
onInactive: a[7] || (a[7] = (t) => I.value = !1)
|
|
818
|
+
}, {
|
|
819
|
+
default: z(() => [
|
|
820
|
+
I.value ? (s(), u("div", Ja, [
|
|
821
|
+
a[19] || (a[19] = y("strong", null, "显示列与排序", -1)),
|
|
822
|
+
g(Ba, {
|
|
823
|
+
class: "hys-ui-pf-grid-settings-list",
|
|
824
|
+
"model-value": ra.value,
|
|
825
|
+
"onUpdate:modelValue": a[6] || (a[6] = (t) => E.value = t.map((l) => l.id))
|
|
826
|
+
}, {
|
|
827
|
+
item: z(({ item: t }) => {
|
|
828
|
+
var l;
|
|
829
|
+
return [
|
|
830
|
+
g(rt, {
|
|
831
|
+
"model-value": !C.value.includes(t.id),
|
|
832
|
+
label: t.label,
|
|
833
|
+
disabled: ((l = v.columns.find((o) => o.key === t.id)) == null ? void 0 : l.hideable) === !1 || !C.value.includes(t.id) && A.value.length === 1,
|
|
834
|
+
"onUpdate:modelValue": (o) => ua(
|
|
835
|
+
v.columns.find((n) => n.key === t.id)
|
|
836
|
+
)
|
|
837
|
+
}, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])
|
|
838
|
+
];
|
|
839
|
+
}),
|
|
840
|
+
_: 1
|
|
841
|
+
}, 8, ["model-value"]),
|
|
842
|
+
g(T, {
|
|
843
|
+
variant: "ghost",
|
|
844
|
+
size: "sm",
|
|
845
|
+
type: "button",
|
|
846
|
+
onClick: Kt
|
|
847
|
+
}, {
|
|
848
|
+
default: z(() => [...a[18] || (a[18] = [
|
|
849
|
+
V("恢复默认列", -1)
|
|
850
|
+
])]),
|
|
851
|
+
_: 1
|
|
852
|
+
})
|
|
853
|
+
])) : h("", !0)
|
|
854
|
+
]),
|
|
855
|
+
_: 1
|
|
856
|
+
}, 8, ["popup-transition", "popup-transition-duration"])
|
|
488
857
|
], 512),
|
|
489
|
-
|
|
858
|
+
g(T, {
|
|
490
859
|
variant: "ghost",
|
|
491
860
|
size: "sm",
|
|
492
861
|
type: "button",
|
|
493
|
-
onClick:
|
|
862
|
+
onClick: ba
|
|
494
863
|
}, {
|
|
495
|
-
default: z(() => [...
|
|
496
|
-
|
|
864
|
+
default: z(() => [...a[20] || (a[20] = [
|
|
865
|
+
V("导出 CSV", -1)
|
|
497
866
|
])]),
|
|
498
867
|
_: 1
|
|
499
868
|
})
|
|
500
869
|
]),
|
|
501
|
-
|
|
870
|
+
y("div", {
|
|
871
|
+
ref_key: "scrollRef",
|
|
872
|
+
ref: ge,
|
|
502
873
|
class: "hys-ui-pf-grid-scroll",
|
|
503
|
-
|
|
874
|
+
style: $({ maxHeight: wa.value }),
|
|
875
|
+
tabindex: "0",
|
|
876
|
+
role: "region",
|
|
877
|
+
"aria-label": "表格滚动区域",
|
|
878
|
+
onDragleave: ga
|
|
504
879
|
}, [
|
|
505
|
-
|
|
506
|
-
class:
|
|
507
|
-
style:
|
|
880
|
+
y("table", {
|
|
881
|
+
class: ve({ "hys-ui-pf-grid-sticky-head": v.stickyHeader }),
|
|
882
|
+
style: $({ minWidth: da.value + "px" })
|
|
508
883
|
}, [
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
(s(!0), u(
|
|
512
|
-
key:
|
|
513
|
-
style:
|
|
884
|
+
y("colgroup", null, [
|
|
885
|
+
v.selectable ? (s(), u("col", Xa)) : h("", !0),
|
|
886
|
+
(s(!0), u(N, null, ye(G.value, (t) => (s(), u("col", {
|
|
887
|
+
key: t.key,
|
|
888
|
+
style: $({ width: B(t) + "px" })
|
|
514
889
|
}, null, 4))), 128))
|
|
515
890
|
]),
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
891
|
+
y("thead", null, [
|
|
892
|
+
y("tr", null, [
|
|
893
|
+
v.selectable ? (s(), u("th", Ga, [
|
|
894
|
+
v.selectionType !== "radio" ? (s(), D(rt, {
|
|
895
|
+
key: 0,
|
|
520
896
|
"aria-label": "选择当前页全部行",
|
|
521
|
-
"model-value":
|
|
522
|
-
indeterminate:
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
897
|
+
"model-value": kt.value,
|
|
898
|
+
indeterminate: oa.value && !kt.value,
|
|
899
|
+
disabled: !Se.value.length || Fe.value || !!m(Ve),
|
|
900
|
+
"onUpdate:modelValue": ia
|
|
901
|
+
}, null, 8, ["model-value", "indeterminate", "disabled"])) : (s(), u("span", Ya, "选择"))
|
|
902
|
+
])) : h("", !0),
|
|
903
|
+
(s(!0), u(N, null, ye(G.value, (t) => {
|
|
904
|
+
var l, o, n, r, f, k, _;
|
|
528
905
|
return s(), u("th", {
|
|
529
|
-
key:
|
|
906
|
+
key: t.key,
|
|
530
907
|
scope: "col",
|
|
531
|
-
"data-column-key":
|
|
532
|
-
class:
|
|
533
|
-
"data-drop-position": ((
|
|
534
|
-
draggable:
|
|
535
|
-
onDragstart: (
|
|
536
|
-
onDragend:
|
|
537
|
-
onDragover: (
|
|
538
|
-
onDrop: (
|
|
539
|
-
"aria-sort": ((
|
|
540
|
-
style:
|
|
908
|
+
"data-column-key": t.key,
|
|
909
|
+
class: ve({ "hys-ui-is-column-dragging": de.value === t.key }),
|
|
910
|
+
"data-drop-position": ((l = Z.value) == null ? void 0 : l.key) === t.key ? Z.value.position : void 0,
|
|
911
|
+
draggable: t.reorderable !== !1,
|
|
912
|
+
onDragstart: (d) => pa(d, t),
|
|
913
|
+
onDragend: fe,
|
|
914
|
+
onDragover: (d) => ma(d, t),
|
|
915
|
+
onDrop: (d) => ka(d, t),
|
|
916
|
+
"aria-sort": ((o = S.value.find((d) => d.key === t.key)) == null ? void 0 : o.direction) === "asc" ? "ascending" : ((n = S.value.find((d) => d.key === t.key)) == null ? void 0 : n.direction) === "desc" ? "descending" : "none",
|
|
917
|
+
style: $({ ...He(t, !0), textAlign: t.align || "left" })
|
|
541
918
|
}, [
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
919
|
+
y("div", _a, [
|
|
920
|
+
y("div", el, [
|
|
921
|
+
g(T, {
|
|
545
922
|
variant: "ghost",
|
|
546
923
|
size: "sm",
|
|
547
924
|
type: "button",
|
|
548
|
-
class:
|
|
549
|
-
|
|
925
|
+
class: ve(["hys-ui-pf-grid-sort", {
|
|
926
|
+
"hys-ui-is-sorted": S.value.some(
|
|
927
|
+
(d) => d.key === t.key
|
|
928
|
+
)
|
|
929
|
+
}]),
|
|
930
|
+
onClick: (d) => Jt(t)
|
|
550
931
|
}, {
|
|
551
932
|
default: z(() => [
|
|
552
|
-
|
|
933
|
+
y("span", tl, O(t.label), 1)
|
|
553
934
|
]),
|
|
554
935
|
_: 2
|
|
555
936
|
}, 1032, ["class", "onClick"]),
|
|
556
|
-
|
|
937
|
+
t.sortable !== !1 ? (s(), u("span", {
|
|
557
938
|
key: 0,
|
|
558
939
|
class: "hys-ui-pf-grid-sort-controls",
|
|
559
940
|
role: "group",
|
|
560
|
-
"aria-label":
|
|
941
|
+
"aria-label": t.label + "排序"
|
|
561
942
|
}, [
|
|
562
|
-
|
|
943
|
+
g(T, {
|
|
563
944
|
type: "button",
|
|
564
945
|
variant: "ghost",
|
|
565
946
|
size: "sm",
|
|
566
|
-
class:
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
947
|
+
class: ve(["hys-ui-pf-grid-sort-direction", {
|
|
948
|
+
"hys-ui-is-active": ((r = S.value.find((d) => d.key === t.key)) == null ? void 0 : r.direction) === "asc"
|
|
949
|
+
}]),
|
|
950
|
+
"aria-label": t.label + "升序",
|
|
951
|
+
"aria-pressed": ((f = S.value.find((d) => d.key === t.key)) == null ? void 0 : f.direction) === "asc",
|
|
952
|
+
onClick: q((d) => pt(t, "asc"), ["stop"])
|
|
570
953
|
}, {
|
|
571
954
|
default: z(() => [
|
|
572
|
-
m(
|
|
955
|
+
g(m(Ka), {
|
|
573
956
|
size: 11,
|
|
574
957
|
"aria-hidden": "true"
|
|
575
958
|
})
|
|
576
959
|
]),
|
|
577
960
|
_: 1
|
|
578
961
|
}, 8, ["class", "aria-label", "aria-pressed", "onClick"]),
|
|
579
|
-
|
|
962
|
+
g(T, {
|
|
580
963
|
type: "button",
|
|
581
964
|
variant: "ghost",
|
|
582
965
|
size: "sm",
|
|
583
|
-
class:
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
966
|
+
class: ve(["hys-ui-pf-grid-sort-direction", {
|
|
967
|
+
"hys-ui-is-active": ((k = S.value.find((d) => d.key === t.key)) == null ? void 0 : k.direction) === "desc"
|
|
968
|
+
}]),
|
|
969
|
+
"aria-label": t.label + "降序",
|
|
970
|
+
"aria-pressed": ((_ = S.value.find((d) => d.key === t.key)) == null ? void 0 : _.direction) === "desc",
|
|
971
|
+
onClick: q((d) => pt(t, "desc"), ["stop"])
|
|
587
972
|
}, {
|
|
588
973
|
default: z(() => [
|
|
589
|
-
m(
|
|
974
|
+
g(m(it), {
|
|
590
975
|
size: 11,
|
|
591
976
|
"aria-hidden": "true"
|
|
592
977
|
})
|
|
593
978
|
]),
|
|
594
979
|
_: 1
|
|
595
980
|
}, 8, ["class", "aria-label", "aria-pressed", "onClick"])
|
|
596
|
-
], 8,
|
|
981
|
+
], 8, al)) : h("", !0)
|
|
597
982
|
]),
|
|
598
|
-
|
|
983
|
+
t.filterable !== !1 ? (s(), D(T, {
|
|
599
984
|
key: 0,
|
|
600
985
|
variant: "ghost",
|
|
601
986
|
size: "sm",
|
|
602
987
|
type: "button",
|
|
603
|
-
class:
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
988
|
+
class: ve(["hys-ui-pf-grid-filter", {
|
|
989
|
+
"hys-ui-is-filtered": !!ct(t.key),
|
|
990
|
+
"hys-ui-is-filtering": j.value && ae.value === t.key
|
|
991
|
+
}]),
|
|
992
|
+
"aria-label": "筛选" + t.label,
|
|
993
|
+
"aria-expanded": j.value,
|
|
994
|
+
"aria-controls": m(ut),
|
|
995
|
+
title: j.value && ae.value === t.key ? "再次点击收起筛选(Esc)" : "筛选" + t.label,
|
|
996
|
+
onClick: (d) => fa(t)
|
|
607
997
|
}, {
|
|
608
998
|
default: z(() => [
|
|
609
|
-
m(
|
|
999
|
+
g(m(Aa), {
|
|
610
1000
|
size: 13,
|
|
611
1001
|
"aria-hidden": "true"
|
|
612
1002
|
})
|
|
613
1003
|
]),
|
|
614
1004
|
_: 1
|
|
615
|
-
}, 8, ["aria-label", "
|
|
616
|
-
|
|
1005
|
+
}, 8, ["aria-label", "aria-expanded", "aria-controls", "title", "class", "onClick"])) : h("", !0),
|
|
1006
|
+
t.resizable !== !1 ? (s(), u("span", {
|
|
617
1007
|
key: 1,
|
|
618
1008
|
class: "hys-ui-pf-grid-resize",
|
|
619
1009
|
role: "separator",
|
|
620
1010
|
tabindex: "0",
|
|
621
|
-
"aria-label": "调整" +
|
|
622
|
-
onPointerdown: (
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
1011
|
+
"aria-label": "调整" + t.label + "列宽",
|
|
1012
|
+
onPointerdown: (d) => va(d, t),
|
|
1013
|
+
"aria-orientation": "vertical",
|
|
1014
|
+
"aria-valuemin": Math.min(Ne(t), B(t)),
|
|
1015
|
+
"aria-valuemax": Math.max(tt(t), B(t)),
|
|
1016
|
+
"aria-valuenow": B(t),
|
|
1017
|
+
onKeydown: (d) => ya(d, t)
|
|
1018
|
+
}, null, 40, ll)) : h("", !0)
|
|
628
1019
|
])
|
|
629
|
-
], 46,
|
|
1020
|
+
], 46, Za);
|
|
630
1021
|
}), 128))
|
|
631
1022
|
]),
|
|
632
|
-
|
|
1023
|
+
j.value ? (s(), u("tr", {
|
|
633
1024
|
key: 0,
|
|
634
1025
|
class: "hys-ui-pf-grid-filter-row",
|
|
635
|
-
|
|
636
|
-
onKeydown:
|
|
1026
|
+
id: m(ut),
|
|
1027
|
+
onKeydown: a[8] || (a[8] = nt(q((t) => wt(), ["stop", "prevent"]), ["esc"])),
|
|
1028
|
+
"aria-label": "列筛选"
|
|
637
1029
|
}, [
|
|
638
|
-
|
|
639
|
-
(s(!0), u(
|
|
640
|
-
key:
|
|
641
|
-
"data-filter-key":
|
|
642
|
-
"data-column-key":
|
|
643
|
-
style:
|
|
1030
|
+
v.selectable ? (s(), u("td", nl)) : h("", !0),
|
|
1031
|
+
(s(!0), u(N, null, ye(G.value, (t) => (s(), u("td", {
|
|
1032
|
+
key: t.key,
|
|
1033
|
+
"data-filter-key": t.key,
|
|
1034
|
+
"data-column-key": t.key,
|
|
1035
|
+
style: $(He(t))
|
|
644
1036
|
}, [
|
|
645
|
-
|
|
1037
|
+
t.filterable !== !1 ? (s(), D(Ie, {
|
|
646
1038
|
key: 0,
|
|
647
|
-
|
|
648
|
-
"onUpdate:modelValue": (
|
|
649
|
-
|
|
1039
|
+
"model-value": ct(t.key),
|
|
1040
|
+
"onUpdate:modelValue": (l) => Pt(t.key, l),
|
|
1041
|
+
onFocus: (l) => ae.value = t.key,
|
|
1042
|
+
"aria-label": "过滤" + t.label,
|
|
650
1043
|
placeholder: "筛选…",
|
|
651
1044
|
clearable: ""
|
|
652
|
-
}, null, 8, ["
|
|
653
|
-
], 12,
|
|
654
|
-
],
|
|
1045
|
+
}, null, 8, ["model-value", "onUpdate:modelValue", "onFocus", "aria-label"])) : h("", !0)
|
|
1046
|
+
], 12, il))), 128))
|
|
1047
|
+
], 40, ol)) : h("", !0)
|
|
655
1048
|
]),
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
colspan:
|
|
1049
|
+
y("tbody", null, [
|
|
1050
|
+
Fe.value ? (s(), u("tr", sl, [
|
|
1051
|
+
y("td", {
|
|
1052
|
+
colspan: Math.max(1, A.value.length + Number(v.selectable)),
|
|
660
1053
|
class: "hys-ui-pf-grid-empty"
|
|
661
|
-
}, "正在加载…", 8, tl)
|
|
662
|
-
])) : (s(), u(B, { key: 1 }, [
|
|
663
|
-
(s(!0), u(B, null, de(st.value, (e) => (s(), u(B, {
|
|
664
|
-
key: e.key
|
|
665
1054
|
}, [
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
1055
|
+
y("div", ul, [
|
|
1056
|
+
$e(e.$slots, "loading", {}, () => [
|
|
1057
|
+
a[21] || (a[21] = V("正在加载…", -1))
|
|
1058
|
+
], !0)
|
|
1059
|
+
])
|
|
1060
|
+
], 8, rl)
|
|
1061
|
+
])) : m(Ve) ? (s(), u("tr", dl, [
|
|
1062
|
+
y("td", {
|
|
1063
|
+
colspan: Math.max(1, A.value.length + Number(v.selectable)),
|
|
1064
|
+
class: "hys-ui-pf-grid-empty"
|
|
1065
|
+
}, [
|
|
1066
|
+
$e(e.$slots, "error", {
|
|
1067
|
+
error: m(Ve).error,
|
|
1068
|
+
retry: Ge
|
|
1069
|
+
}, () => [
|
|
1070
|
+
a[23] || (a[23] = y("span", { role: "status" }, "加载失败", -1)),
|
|
1071
|
+
g(T, {
|
|
1072
|
+
size: "sm",
|
|
1073
|
+
variant: "ghost",
|
|
1074
|
+
onClick: Ge
|
|
1075
|
+
}, {
|
|
1076
|
+
default: z(() => [...a[22] || (a[22] = [
|
|
1077
|
+
V("重试", -1)
|
|
1078
|
+
])]),
|
|
1079
|
+
_: 1
|
|
1080
|
+
})
|
|
1081
|
+
], !0)
|
|
1082
|
+
], 8, cl)
|
|
1083
|
+
])) : (s(), u(N, { key: 2 }, [
|
|
1084
|
+
(s(!0), u(N, null, ye(Yt.value, (t) => (s(), u(N, {
|
|
1085
|
+
key: t.key
|
|
1086
|
+
}, [
|
|
1087
|
+
t.kind === "group" ? (s(), u("tr", fl, [
|
|
1088
|
+
y("td", {
|
|
1089
|
+
colspan: A.value.length + Number(v.selectable)
|
|
669
1090
|
}, [
|
|
670
|
-
|
|
1091
|
+
g(T, {
|
|
671
1092
|
variant: "ghost",
|
|
672
1093
|
size: "sm",
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
onClick: (a) => dt(e.key)
|
|
1094
|
+
"aria-expanded": !se.value.has(t.key),
|
|
1095
|
+
onClick: (l) => _t(t.key)
|
|
676
1096
|
}, {
|
|
677
1097
|
default: z(() => {
|
|
678
|
-
var
|
|
1098
|
+
var l;
|
|
679
1099
|
return [
|
|
680
|
-
(s(),
|
|
1100
|
+
(s(), D(Dt(
|
|
1101
|
+
se.value.has(t.key) ? m(Ft) : m(it)
|
|
1102
|
+
), {
|
|
681
1103
|
size: 15,
|
|
682
1104
|
"aria-hidden": "true"
|
|
683
1105
|
})),
|
|
684
|
-
|
|
685
|
-
|
|
1106
|
+
V(" " + O((l = F.value.get(he.value)) == null ? void 0 : l.label) + ":" + O(t.label) + " ", 1),
|
|
1107
|
+
y("span", null, "(" + O(t.count) + ")", 1)
|
|
686
1108
|
];
|
|
687
1109
|
}),
|
|
688
1110
|
_: 2
|
|
689
1111
|
}, 1032, ["aria-expanded", "onClick"])
|
|
690
|
-
], 8,
|
|
691
|
-
])) :
|
|
1112
|
+
], 8, vl)
|
|
1113
|
+
])) : (s(), u("tr", {
|
|
692
1114
|
key: 1,
|
|
693
|
-
|
|
1115
|
+
"data-grid-row": m(st)(t.item.id),
|
|
1116
|
+
onClick: (l) => x("rowClick", t.item.row)
|
|
694
1117
|
}, [
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
1118
|
+
v.selectable ? (s(), u("td", pl, [
|
|
1119
|
+
v.selectionType === "radio" ? (s(), D(Ha, {
|
|
1120
|
+
key: 0,
|
|
1121
|
+
name: m(Bt),
|
|
1122
|
+
"aria-label": "选择第" + (t.pageIndex + 1) + "行",
|
|
1123
|
+
"model-value": b.value[0] ?? null,
|
|
1124
|
+
value: t.item.id,
|
|
1125
|
+
disabled: !Oe(t.item),
|
|
1126
|
+
onClick: a[9] || (a[9] = q(() => {
|
|
700
1127
|
}, ["stop"])),
|
|
701
|
-
"onUpdate:modelValue": (
|
|
702
|
-
}, null, 8, ["aria-label", "model-value", "onUpdate:modelValue"])
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
1128
|
+
"onUpdate:modelValue": (l) => et(t.item.id, !0)
|
|
1129
|
+
}, null, 8, ["name", "aria-label", "model-value", "value", "disabled", "onUpdate:modelValue"])) : (s(), D(rt, {
|
|
1130
|
+
key: 1,
|
|
1131
|
+
"aria-label": "选择第" + (t.pageIndex + 1) + "行",
|
|
1132
|
+
"model-value": Le.value.has(t.item.id),
|
|
1133
|
+
disabled: !Oe(t.item),
|
|
1134
|
+
onClick: a[10] || (a[10] = q(() => {
|
|
1135
|
+
}, ["stop"])),
|
|
1136
|
+
"onUpdate:modelValue": (l) => et(t.item.id, l)
|
|
1137
|
+
}, null, 8, ["aria-label", "model-value", "disabled", "onUpdate:modelValue"]))
|
|
1138
|
+
])) : h("", !0),
|
|
1139
|
+
(s(!0), u(N, null, ye(G.value, (l, o) => {
|
|
1140
|
+
var n, r;
|
|
706
1141
|
return s(), u("td", {
|
|
707
|
-
key:
|
|
708
|
-
"data-column-key":
|
|
709
|
-
style:
|
|
710
|
-
|
|
1142
|
+
key: l.key,
|
|
1143
|
+
"data-column-key": l.key,
|
|
1144
|
+
style: $({
|
|
1145
|
+
...He(l),
|
|
1146
|
+
textAlign: l.align || "left"
|
|
1147
|
+
}),
|
|
1148
|
+
title: re(t.item.row, l)
|
|
711
1149
|
}, [
|
|
712
|
-
((n =
|
|
1150
|
+
((n = W.value) == null ? void 0 : n.id) === t.item.id && ((r = W.value) == null ? void 0 : r.key) === l.key ? (s(), D(Ie, {
|
|
713
1151
|
key: 0,
|
|
714
|
-
modelValue:
|
|
715
|
-
"onUpdate:modelValue":
|
|
1152
|
+
modelValue: Ke.value,
|
|
1153
|
+
"onUpdate:modelValue": a[11] || (a[11] = (f) => Ke.value = f),
|
|
716
1154
|
class: "hys-ui-pf-grid-edit",
|
|
717
|
-
"aria-label": "编辑" +
|
|
718
|
-
onClick:
|
|
1155
|
+
"aria-label": "编辑" + l.label,
|
|
1156
|
+
onClick: a[12] || (a[12] = q(() => {
|
|
719
1157
|
}, ["stop"])),
|
|
720
1158
|
onKeydown: [
|
|
721
|
-
|
|
722
|
-
|
|
1159
|
+
nt(q((f) => gt(t.item, l), ["stop"]), ["enter"]),
|
|
1160
|
+
a[13] || (a[13] = nt(q((f) => W.value = null, ["stop"]), ["esc"]))
|
|
723
1161
|
],
|
|
724
|
-
onFocusout: (f) =>
|
|
725
|
-
}, null, 8, ["modelValue", "aria-label", "onKeydown", "onFocusout"])) : (s(), u(
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
1162
|
+
onFocusout: (f) => gt(t.item, l)
|
|
1163
|
+
}, null, 8, ["modelValue", "aria-label", "onKeydown", "onFocusout"])) : (s(), u(N, { key: 1 }, [
|
|
1164
|
+
v.treeMode && o === 0 ? (s(), u(N, { key: 0 }, [
|
|
1165
|
+
t.item.hasChildren ? (s(), D(T, {
|
|
1166
|
+
key: 0,
|
|
1167
|
+
variant: "ghost",
|
|
1168
|
+
size: "sm",
|
|
1169
|
+
class: "hys-ui-pf-grid-tree-toggle",
|
|
1170
|
+
style: $({ marginLeft: t.item.depth * 16 + "px" }),
|
|
1171
|
+
"aria-expanded": ie.value.has(t.item.id),
|
|
1172
|
+
"aria-label": ie.value.has(t.item.id) ? "折叠子行" : "展开子行",
|
|
1173
|
+
onClick: q((f) => Zt(t.item.id), ["stop"])
|
|
1174
|
+
}, {
|
|
1175
|
+
default: z(() => [
|
|
1176
|
+
(s(), D(Dt(
|
|
1177
|
+
ie.value.has(t.item.id) ? m(it) : m(Ft)
|
|
1178
|
+
), {
|
|
1179
|
+
size: 15,
|
|
1180
|
+
"aria-hidden": "true"
|
|
1181
|
+
}))
|
|
1182
|
+
]),
|
|
1183
|
+
_: 2
|
|
1184
|
+
}, 1032, ["style", "aria-expanded", "aria-label", "onClick"])) : (s(), u("span", {
|
|
1185
|
+
key: 1,
|
|
1186
|
+
style: $({
|
|
1187
|
+
display: "inline-block",
|
|
1188
|
+
width: t.item.depth * 16 + 20 + "px"
|
|
1189
|
+
})
|
|
1190
|
+
}, null, 4))
|
|
1191
|
+
], 64)) : h("", !0),
|
|
1192
|
+
y("span", {
|
|
1193
|
+
onDblclick: q((f) => ea(t.item, l), ["stop"])
|
|
749
1194
|
}, [
|
|
750
|
-
|
|
751
|
-
row:
|
|
752
|
-
value:
|
|
1195
|
+
$e(e.$slots, l.key, {
|
|
1196
|
+
row: t.item.row,
|
|
1197
|
+
value: m(me)(t.item.row, l),
|
|
1198
|
+
index: t.item.index
|
|
753
1199
|
}, () => [
|
|
754
|
-
|
|
1200
|
+
V(O(re(t.item.row, l)), 1)
|
|
755
1201
|
], !0)
|
|
756
|
-
], 40,
|
|
1202
|
+
], 40, gl)
|
|
757
1203
|
], 64))
|
|
758
|
-
], 12,
|
|
1204
|
+
], 12, ml);
|
|
759
1205
|
}), 128))
|
|
760
|
-
], 8,
|
|
1206
|
+
], 8, yl))
|
|
761
1207
|
], 64))), 128)),
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
colspan:
|
|
1208
|
+
Xe.value.length ? h("", !0) : (s(), u("tr", hl, [
|
|
1209
|
+
y("td", {
|
|
1210
|
+
colspan: Math.max(1, A.value.length + Number(v.selectable)),
|
|
765
1211
|
class: "hys-ui-pf-grid-empty"
|
|
766
|
-
},
|
|
1212
|
+
}, [
|
|
1213
|
+
$e(e.$slots, "empty", {
|
|
1214
|
+
query: we()
|
|
1215
|
+
}, () => [
|
|
1216
|
+
V(O(v.emptyText), 1)
|
|
1217
|
+
], !0)
|
|
1218
|
+
], 8, kl)
|
|
767
1219
|
]))
|
|
768
1220
|
], 64))
|
|
769
1221
|
]),
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
(s(!0), u(
|
|
774
|
-
key:
|
|
775
|
-
"data-column-key":
|
|
776
|
-
style:
|
|
777
|
-
|
|
1222
|
+
v.showSummary && !Fe.value && !m(Ve) && be.value.length ? (s(), u("tfoot", bl, [
|
|
1223
|
+
y("tr", wl, [
|
|
1224
|
+
v.selectable ? (s(), u("td", Sl, "合计")) : h("", !0),
|
|
1225
|
+
(s(!0), u(N, null, ye(G.value, (t, l) => (s(), u("td", {
|
|
1226
|
+
key: t.key,
|
|
1227
|
+
"data-column-key": t.key,
|
|
1228
|
+
style: $({
|
|
1229
|
+
...He(t),
|
|
1230
|
+
textAlign: t.align || "left"
|
|
1231
|
+
})
|
|
1232
|
+
}, O(t.summary || v.summaryMethod ? la(t) : !v.selectable && l === 0 ? "合计" : ""), 13, Cl))), 128))
|
|
778
1233
|
])
|
|
779
|
-
])) :
|
|
1234
|
+
])) : h("", !0)
|
|
780
1235
|
], 6)
|
|
781
|
-
],
|
|
782
|
-
|
|
783
|
-
m(
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
"
|
|
788
|
-
"show-
|
|
789
|
-
|
|
1236
|
+
], 36),
|
|
1237
|
+
y("footer", xl, [
|
|
1238
|
+
!v.loadRows || m(De) !== void 0 ? (s(), D(Ua, {
|
|
1239
|
+
key: 0,
|
|
1240
|
+
page: ue.value,
|
|
1241
|
+
total: We.value,
|
|
1242
|
+
"page-size": Q.value,
|
|
1243
|
+
"show-size-changer": "",
|
|
1244
|
+
"show-quick-jumper": "",
|
|
1245
|
+
disabled: v.loading,
|
|
790
1246
|
"page-size-options": [10, 12, 20, 50, 100],
|
|
791
|
-
onChange:
|
|
792
|
-
|
|
793
|
-
}, null, 8, ["page", "total", "page-size", "disabled"])
|
|
1247
|
+
onChange: Qt,
|
|
1248
|
+
"onUpdate:pageSize": Wt
|
|
1249
|
+
}, null, 8, ["page", "total", "page-size", "disabled"])) : h("", !0)
|
|
794
1250
|
])
|
|
795
|
-
], 16));
|
|
1251
|
+
], 16, $a));
|
|
796
1252
|
}
|
|
797
1253
|
});
|
|
798
1254
|
export {
|
|
799
|
-
|
|
1255
|
+
Bl as default
|
|
800
1256
|
};
|