hys-ui 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +149 -0
- package/README.md +17 -1
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +639 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
- package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +256 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -27
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +288 -2
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +29 -28
- package/dist/components/HysCalendar/HysCalendar.vue.js +5 -92
- package/dist/components/HysCalendar/HysCalendar2.vue.js +815 -2
- package/dist/components/HysCard/HysCard.vue.js +2 -2
- package/dist/components/HysCard/HysCard2.vue.js +175 -42
- package/dist/components/HysCascader/HysCascader.vue.js +5 -194
- package/dist/components/HysCascader/HysCascader2.vue.js +773 -2
- package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
- package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +3 -3
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +1 -1
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -216
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
- package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
- package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
- package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1019 -563
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +270 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +820 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +270 -158
- package/dist/components/HysDivider/HysDivider.vue.js +2 -2
- package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
- package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
- package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
- package/dist/components/HysFileManager/HysFileManager.vue.js +3 -3
- package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +578 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
- package/dist/components/HysFormItem/HysFormItem2.vue.js +528 -2
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +1380 -268
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +467 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +122 -109
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +490 -85
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
- package/dist/components/HysPagination/HysPagination.vue.js +1 -1
- package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
- package/dist/components/HysPopover/HysPopover.vue.js +5 -91
- package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
- package/dist/components/HysProgress/HysProgress.vue.js +2 -2
- package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
- package/dist/components/HysRadio/HysRadio.vue.js +7 -0
- package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +2 -2
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
- package/dist/components/HysSearch/HysSearch.vue.js +37 -36
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
- package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
- package/dist/components/HysSelect/HysSelect.vue.js +3 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +999 -189
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
- package/dist/components/HysSlider/HysSlider.vue.js +1 -1
- package/dist/components/HysSlider/HysSlider2.vue.js +536 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +170 -0
- package/dist/components/HysSteps/HysSteps.vue.js +1 -1
- package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1494 -88
- package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
- package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
- package/dist/components/HysTabs/HysTabs.vue.js +2 -2
- package/dist/components/HysTabs/HysTabs2.vue.js +262 -68
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -81
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
- package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
- package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
- package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
- package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
- package/dist/components/HysTour/HysTour.vue.js +46 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
- package/dist/components/HysTransfer/HysTransfer2.vue.js +446 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +503 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +651 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +570 -2
- package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
- package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +459 -124
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- package/dist/composables/autocomplete.js +50 -0
- package/dist/composables/avatar.js +57 -0
- package/dist/composables/calendar.js +96 -0
- package/dist/composables/cascader.js +79 -0
- package/dist/composables/choice.js +38 -0
- package/dist/composables/choiceModel.js +67 -0
- package/dist/composables/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/formContext.js +92 -7
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -0
- package/dist/composables/rating.js +16 -0
- package/dist/composables/selectOptions.js +54 -0
- package/dist/composables/table.js +150 -0
- package/dist/composables/tagInput.js +16 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +65 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useColorPicker.js +402 -0
- package/dist/composables/useContextMenu.js +514 -0
- package/dist/composables/useDataGridRemote.js +67 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +136 -56
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useModal.js +295 -0
- package/dist/composables/useModalInteraction.js +394 -0
- package/dist/composables/usePopupSurface.js +458 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTransferMotion.js +185 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/composables/useUpload.js +472 -0
- package/dist/composables/useUploadModel.js +65 -0
- package/dist/composables/useUploadRequests.js +266 -0
- package/dist/composables/useVirtualTableLayout.js +277 -0
- package/dist/composables/virtualTable.js +43 -0
- package/dist/index.js +152 -139
- package/dist/internal/PopupReference.js +39 -0
- package/dist/internal/PopupSurfacePanel.vue.js +7 -0
- package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
- package/dist/motion/PopupMotion.js +105 -0
- package/dist/motion/popup.js +10 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +104 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +71 -20
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +120 -31
- package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +50 -39
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
- package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
- package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +84 -5
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +4 -3
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -35
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +34 -12
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +131 -22
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +69 -11
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +24 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +3 -3
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -9
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
- package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
- package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +50 -28
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysToast/HysToast.vue.d.ts +3 -3
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +4 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +107 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
- package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
- package/dist/types/composables/autocomplete.d.ts +109 -0
- package/dist/types/composables/avatar.d.ts +73 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +195 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/color.d.ts +97 -0
- package/dist/types/composables/dataGrid.d.ts +100 -0
- package/dist/types/composables/datePicker.d.ts +250 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/formContext.d.ts +135 -8
- package/dist/types/composables/formLayout.d.ts +11 -0
- package/dist/types/composables/formValidation.d.ts +13 -0
- package/dist/types/composables/gantt.d.ts +68 -0
- package/dist/types/composables/ganttConflicts.d.ts +30 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +183 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/overlayManager.d.ts +7 -3
- package/dist/types/composables/popupSurface.d.ts +83 -0
- package/dist/types/composables/progress.d.ts +92 -0
- package/dist/types/composables/rating.d.ts +18 -0
- package/dist/types/composables/segmented.d.ts +15 -0
- package/dist/types/composables/selectOptions.d.ts +46 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +312 -0
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/transfer.d.ts +187 -0
- package/dist/types/composables/tree.d.ts +240 -0
- package/dist/types/composables/treeSelect.d.ts +170 -0
- package/dist/types/composables/upload.d.ts +202 -0
- package/dist/types/composables/uploadRequest.d.ts +3 -0
- package/dist/types/composables/useAlert.d.ts +21 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useColorPicker.d.ts +101 -0
- package/dist/types/composables/useContextMenu.d.ts +81 -0
- package/dist/types/composables/useDataGridRemote.d.ts +15 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useDialog.d.ts +16 -3
- package/dist/types/composables/useDrawerPush.d.ts +6 -0
- package/dist/types/composables/useDrawerResize.d.ts +27 -0
- package/dist/types/composables/useFloating.d.ts +28 -6
- package/dist/types/composables/useGanttDependencies.d.ts +83 -0
- package/dist/types/composables/useGanttHistory.d.ts +42 -0
- package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useModal.d.ts +62 -0
- package/dist/types/composables/useModalInteraction.d.ts +27 -0
- package/dist/types/composables/usePopupSurface.d.ts +3341 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/composables/useUpload.d.ts +94 -0
- package/dist/types/composables/useUploadModel.d.ts +14 -0
- package/dist/types/composables/useUploadRequests.d.ts +38 -0
- package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
- package/dist/types/composables/virtualTable.d.ts +126 -0
- package/dist/types/index.d.ts +50 -9
- package/dist/types/internal/PopupReference.d.ts +18 -0
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
- package/dist/types/motion/PopupMotion.d.ts +59 -0
- package/dist/types/motion/popup.d.ts +12 -0
- package/package.json +2 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { inject as K, watch as U, onActivated as V, onDeactivated as G, onBeforeUnmount as J } from "vue";
|
|
2
|
+
import { useHysRootAttrs as Q } from "../config.js";
|
|
3
|
+
import { useMotion as X } from "../motion/useMotion.js";
|
|
4
|
+
import { overlayOwnerKey as Y } from "./overlayManager.js";
|
|
5
|
+
import { transferToken as T } from "./transfer.js";
|
|
6
|
+
const D = (x) => '[data-transfer-key="' + x.replace(
|
|
7
|
+
/["\\\n\r\f]/g,
|
|
8
|
+
(a) => "\\" + a.codePointAt(0).toString(16) + " "
|
|
9
|
+
) + '"]';
|
|
10
|
+
function ne(x, a) {
|
|
11
|
+
const j = Q(), { effectiveMotion: P } = X(), w = K(Y, void 0), C = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ new Set();
|
|
12
|
+
let A, L = 0, F = !0, k, b;
|
|
13
|
+
const q = () => Number.isFinite(a.moveDuration) ? Math.max(0, Math.min(1500, a.moveDuration)) : 240, E = () => Number.isFinite(a.maxAnimatedItems) ? Math.max(0, Math.min(12, Math.floor(a.maxAnimatedItems))) : 6, z = () => {
|
|
14
|
+
var e;
|
|
15
|
+
return F && ((e = x.value) == null ? void 0 : e.isConnected) && (w == null ? void 0 : w.value) !== !1 && a.animated !== !1 && a.moveAnimation !== "none" && q() > 0 && P.value !== "off";
|
|
16
|
+
};
|
|
17
|
+
function o() {
|
|
18
|
+
L++, A !== void 0 && cancelAnimationFrame(A), A = void 0, clearTimeout(k), k = void 0, window.removeEventListener("scroll", o, !0), window.removeEventListener("resize", o), window.removeEventListener("focusin", o), window.removeEventListener("blur", o), window.removeEventListener("keydown", B);
|
|
19
|
+
for (const e of M)
|
|
20
|
+
e.animation.cancel(), e.restore(), e.node.remove();
|
|
21
|
+
M.clear();
|
|
22
|
+
for (const e of C) e.classList.remove("hys-ui-transfer-landed");
|
|
23
|
+
C.clear(), b == null || b.classList.remove("hys-ui-transfer-received"), b = void 0;
|
|
24
|
+
}
|
|
25
|
+
function B(e) {
|
|
26
|
+
e.key === "Escape" && o();
|
|
27
|
+
}
|
|
28
|
+
function O(e) {
|
|
29
|
+
var s;
|
|
30
|
+
return (s = x.value) == null ? void 0 : s.querySelector(
|
|
31
|
+
'.hys-ui-transfer-pane[data-side="' + e + '"]'
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function I(e, s) {
|
|
35
|
+
var v, g;
|
|
36
|
+
if (o(), !z() || !s.length) return;
|
|
37
|
+
const d = (v = O(
|
|
38
|
+
e === "right" ? "left" : "right"
|
|
39
|
+
)) == null ? void 0 : v.querySelector(".hys-ui-pf-transfer-list"), i = {
|
|
40
|
+
generation: L,
|
|
41
|
+
direction: e,
|
|
42
|
+
count: s.length,
|
|
43
|
+
samples: []
|
|
44
|
+
};
|
|
45
|
+
if (!d || !E() || typeof HTMLElement.prototype.animate != "function")
|
|
46
|
+
return i;
|
|
47
|
+
const r = d.getBoundingClientRect(), u = Math.max(0, r.top), c = Math.min(window.innerHeight, r.bottom);
|
|
48
|
+
if (r.right <= 0 || r.left >= window.innerWidth || c <= u)
|
|
49
|
+
return i;
|
|
50
|
+
const l = new Set(s.map(T)), n = /* @__PURE__ */ new Set();
|
|
51
|
+
function y(t) {
|
|
52
|
+
var S;
|
|
53
|
+
if (!t || !d.contains(t) || i.samples.length >= E())
|
|
54
|
+
return;
|
|
55
|
+
const f = t.dataset.transferKey;
|
|
56
|
+
if (!l.has(f) || n.has(f)) return;
|
|
57
|
+
const m = t.getBoundingClientRect();
|
|
58
|
+
!m.width || !m.height || m.bottom <= u || m.top >= c || (n.add(f), i.samples.push({
|
|
59
|
+
token: f,
|
|
60
|
+
label: (((S = t.querySelector(".hys-ui-transfer-label")) == null ? void 0 : S.textContent) ?? t.textContent ?? "").trim().slice(0, 120),
|
|
61
|
+
box: m
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
if (s.length <= E())
|
|
65
|
+
for (const t of s)
|
|
66
|
+
y(d.querySelector(D(T(t))));
|
|
67
|
+
else if (document.elementFromPoint) {
|
|
68
|
+
const t = Math.min(24, Math.max(1, Math.ceil((c - u) / 20))), f = Math.max(
|
|
69
|
+
1,
|
|
70
|
+
Math.min(window.innerWidth - 1, r.left + r.width / 2)
|
|
71
|
+
);
|
|
72
|
+
for (let m = 0; m < t && i.samples.length < E(); m++)
|
|
73
|
+
y(
|
|
74
|
+
(g = document.elementFromPoint(f, u + (m + 0.5) * (c - u) / t)) == null ? void 0 : g.closest(".hys-ui-transfer-row")
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
return i;
|
|
78
|
+
}
|
|
79
|
+
function N(e) {
|
|
80
|
+
if (!e || e.generation !== L || !z()) return;
|
|
81
|
+
const s = O(e.direction), d = s == null ? void 0 : s.querySelector(".hys-ui-pf-transfer-list");
|
|
82
|
+
if (!s || !d) return;
|
|
83
|
+
const i = d.getBoundingClientRect();
|
|
84
|
+
if (i.right <= 0 || i.left >= window.innerWidth || i.bottom <= 0 || i.top >= window.innerHeight)
|
|
85
|
+
return;
|
|
86
|
+
b = s, s.classList.add("hys-ui-transfer-received");
|
|
87
|
+
const r = e.samples.length ? getComputedStyle(x.value) : void 0, u = (c) => {
|
|
88
|
+
c.restore(), c.node.remove(), M.delete(c);
|
|
89
|
+
};
|
|
90
|
+
for (const [c, l] of e.samples.entries()) {
|
|
91
|
+
const n = d.querySelector(D(l.token)), y = n == null ? void 0 : n.getBoundingClientRect(), v = !!y && y.bottom > Math.max(0, i.top) && y.top < Math.min(window.innerHeight, i.bottom), g = v ? y : {
|
|
92
|
+
left: Math.max(8, i.left + 8),
|
|
93
|
+
top: Math.max(
|
|
94
|
+
8,
|
|
95
|
+
Math.min(
|
|
96
|
+
window.innerHeight - 44,
|
|
97
|
+
i.top + Math.min(i.height / 2, 80) + c * 4
|
|
98
|
+
)
|
|
99
|
+
),
|
|
100
|
+
width: Math.max(40, i.width - 16),
|
|
101
|
+
height: l.box.height
|
|
102
|
+
}, t = document.createElement("div");
|
|
103
|
+
t.className = "hys-ui-transfer-flight";
|
|
104
|
+
for (const [p, h] of Object.entries(j.value))
|
|
105
|
+
t.setAttribute(p, h);
|
|
106
|
+
t.setAttribute("aria-hidden", "true"), t.inert = !0, t.textContent = l.label + (c === e.samples.length - 1 && e.count > e.samples.length ? " · +" + (e.count - e.samples.length) : ""), Object.assign(t.style, {
|
|
107
|
+
left: l.box.left + "px",
|
|
108
|
+
top: l.box.top + "px",
|
|
109
|
+
width: l.box.width + "px",
|
|
110
|
+
height: l.box.height + "px",
|
|
111
|
+
fontFamily: r == null ? void 0 : r.fontFamily,
|
|
112
|
+
fontSize: r == null ? void 0 : r.fontSize
|
|
113
|
+
});
|
|
114
|
+
for (const p of [
|
|
115
|
+
"--hys-ui-primary",
|
|
116
|
+
"--hys-ui-primary-soft",
|
|
117
|
+
"--hys-ui-border",
|
|
118
|
+
"--hys-ui-surface",
|
|
119
|
+
"--hys-ui-text",
|
|
120
|
+
"--hys-ui-muted"
|
|
121
|
+
]) {
|
|
122
|
+
const h = r == null ? void 0 : r.getPropertyValue(p);
|
|
123
|
+
h && t.style.setProperty(p, h);
|
|
124
|
+
}
|
|
125
|
+
const f = (n == null ? void 0 : n.style.opacity) ?? "", m = (n == null ? void 0 : n.style.transition) ?? "";
|
|
126
|
+
let S = !1;
|
|
127
|
+
const R = () => {
|
|
128
|
+
S || (S = !0, n && v && (n.style.opacity = f, n.style.transition = m));
|
|
129
|
+
};
|
|
130
|
+
n && v && (n.style.transition = "none", n.style.opacity = "0"), document.body.append(t);
|
|
131
|
+
const H = "translate3d(" + (g.left - l.box.left) + "px," + (g.top - l.box.top) + "px,0) scale(" + g.width / l.box.width + "," + g.height / l.box.height + ")", W = a.moveAnimation === "fade" ? [
|
|
132
|
+
{ transform: H, opacity: 0 },
|
|
133
|
+
{ transform: H, opacity: 1 }
|
|
134
|
+
] : [
|
|
135
|
+
{ transform: "translate3d(0,0,0) scale(1)", opacity: 0.9 },
|
|
136
|
+
{ transform: H, opacity: 1 }
|
|
137
|
+
];
|
|
138
|
+
try {
|
|
139
|
+
const p = t.animate(W, {
|
|
140
|
+
duration: q(),
|
|
141
|
+
easing: "cubic-bezier(.22,1,.36,1)",
|
|
142
|
+
fill: "both"
|
|
143
|
+
}), h = { node: t, animation: p, restore: R };
|
|
144
|
+
M.add(h), p.finished.then(
|
|
145
|
+
() => {
|
|
146
|
+
u(h), n && v && n.isConnected && e.generation === L && z() && a.highlightOnArrival !== !1 && (n.classList.add("hys-ui-transfer-landed"), C.add(n));
|
|
147
|
+
},
|
|
148
|
+
() => u(h)
|
|
149
|
+
);
|
|
150
|
+
} catch {
|
|
151
|
+
R(), t.remove();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
A = requestAnimationFrame(() => {
|
|
155
|
+
A = void 0, e.generation === L && window.addEventListener("scroll", o, !0);
|
|
156
|
+
}), window.addEventListener("resize", o), window.addEventListener("focusin", o), window.addEventListener("blur", o), window.addEventListener("keydown", B), k = setTimeout(o, q() + 440);
|
|
157
|
+
}
|
|
158
|
+
return U(
|
|
159
|
+
() => [
|
|
160
|
+
a.animated,
|
|
161
|
+
a.moveAnimation,
|
|
162
|
+
a.moveDuration,
|
|
163
|
+
a.maxAnimatedItems,
|
|
164
|
+
a.highlightOnArrival,
|
|
165
|
+
P.value,
|
|
166
|
+
w == null ? void 0 : w.value
|
|
167
|
+
],
|
|
168
|
+
o,
|
|
169
|
+
{ flush: "sync" }
|
|
170
|
+
), V(() => {
|
|
171
|
+
F = !0;
|
|
172
|
+
}), G(() => {
|
|
173
|
+
F = !1, o();
|
|
174
|
+
}), J(o), {
|
|
175
|
+
capture: I,
|
|
176
|
+
play: N,
|
|
177
|
+
stop: o,
|
|
178
|
+
cancelPlaying: () => {
|
|
179
|
+
(M.size || b) && o();
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
export {
|
|
184
|
+
ne as useTransferMotion
|
|
185
|
+
};
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
import { ref as xe, shallowRef as A, computed as f, watch as q, onDeactivated as ze, onBeforeUnmount as Re, onActivated as He, nextTick as F, toRaw as be } from "vue";
|
|
2
|
+
import { treeIndex as pe, treeLocale as Oe, treeKeys as x, treeKey as X, treeAssign as Se, treeField as Ue } from "./tree.js";
|
|
3
|
+
const I = (u, b) => u.length === b.length && u.every((i, z) => i === b[z]), Ae = (u, b) => u.size === b.length && b.every((i) => u.has(i));
|
|
4
|
+
function Je(u, b, i, z, T = {}) {
|
|
5
|
+
const h = xe(!0), ne = A(u.defaultValue ?? null), ue = A(
|
|
6
|
+
u.defaultCheckedKeys ?? []
|
|
7
|
+
), Y = A(
|
|
8
|
+
u.defaultExpandedKeys ?? []
|
|
9
|
+
), R = A([]), re = xe(u.defaultSearchValue ?? ""), N = A(/* @__PURE__ */ new Map()), M = A(/* @__PURE__ */ new Set()), m = A(/* @__PURE__ */ new Map()), r = f(
|
|
10
|
+
() => pe(u.nodes, u, N.value)
|
|
11
|
+
), Ne = f(() => ({ ...Oe, ...u.locale })), v = f(() => !h.value || b.value || !!u.loading), B = f(
|
|
12
|
+
() => u.modelValue === void 0 ? ne.value : u.modelValue
|
|
13
|
+
), y = f(
|
|
14
|
+
() => x(
|
|
15
|
+
Array.isArray(B.value) ? B.value : X(B.value) ? [B.value] : []
|
|
16
|
+
)
|
|
17
|
+
), se = f(() => new Set(y.value)), D = f(() => !!u.multiple || Array.isArray(B.value)), Z = f(() => u.searchValue ?? re.value), P = f(
|
|
18
|
+
() => x(u.expandedKeys ?? Y.value)
|
|
19
|
+
), _ = f(() => new Set(u.loadedKeys ?? R.value)), H = (e) => {
|
|
20
|
+
const l = [];
|
|
21
|
+
let a = r.value.map.get(e);
|
|
22
|
+
for (; (a == null ? void 0 : a.parent) !== void 0; )
|
|
23
|
+
l.push(a.parent), a = r.value.map.get(a.parent);
|
|
24
|
+
return l;
|
|
25
|
+
}, V = f(() => {
|
|
26
|
+
const e = new Set(P.value);
|
|
27
|
+
if (u.autoExpandParent)
|
|
28
|
+
for (let l = r.value.rows.length - 1; l >= 0; l--) {
|
|
29
|
+
const a = r.value.rows[l];
|
|
30
|
+
e.has(a.key) && a.parent !== void 0 && e.add(a.parent);
|
|
31
|
+
}
|
|
32
|
+
return e;
|
|
33
|
+
}), $ = f(() => {
|
|
34
|
+
const e = /* @__PURE__ */ new Set(), l = Z.value.trim();
|
|
35
|
+
if (!l) return e;
|
|
36
|
+
for (const a of r.value.rows)
|
|
37
|
+
(u.filterNode ? u.filterNode(l, a.node) : a.label.toLocaleLowerCase().includes(l.toLocaleLowerCase())) && e.add(a.key);
|
|
38
|
+
return e;
|
|
39
|
+
}), Me = f(() => {
|
|
40
|
+
const e = Z.value.trim(), l = new Set($.value);
|
|
41
|
+
if (e && u.filterMode !== "highlight") {
|
|
42
|
+
for (let t = r.value.rows.length - 1; t >= 0; t--) {
|
|
43
|
+
const n = r.value.rows[t];
|
|
44
|
+
l.has(n.key) && n.parent !== void 0 && l.add(n.parent);
|
|
45
|
+
}
|
|
46
|
+
if (u.showMatchedChildren) {
|
|
47
|
+
const t = new Set($.value);
|
|
48
|
+
for (const n of r.value.rows)
|
|
49
|
+
n.parent !== void 0 && t.has(n.parent) && (t.add(n.key), l.add(n.key));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const a = /* @__PURE__ */ new Set();
|
|
53
|
+
return r.value.rows.filter((t) => {
|
|
54
|
+
const n = e && u.filterMode !== "highlight" ? l.has(t.key) : t.parent === void 0 || a.has(t.parent);
|
|
55
|
+
return n && (e && u.filterMode !== "highlight" || V.value.has(t.key)) && a.add(t.key), n;
|
|
56
|
+
});
|
|
57
|
+
}), p = (e) => !!e && !e.checkboxDisabled && e.checkable;
|
|
58
|
+
function Pe(e, l = !0) {
|
|
59
|
+
const a = [], t = [e];
|
|
60
|
+
for (; t.length; ) {
|
|
61
|
+
const n = r.value.map.get(t.pop());
|
|
62
|
+
if (!(!n || l && !p(n))) {
|
|
63
|
+
a.push(n.key);
|
|
64
|
+
for (let s = n.children.length - 1; s >= 0; s--)
|
|
65
|
+
t.push(n.children[s]);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return a;
|
|
69
|
+
}
|
|
70
|
+
function de(e, l = !u.checkStrictly) {
|
|
71
|
+
const a = new Set(x(e)), t = /* @__PURE__ */ new Set();
|
|
72
|
+
if (l) {
|
|
73
|
+
const n = /* @__PURE__ */ new Set(), s = [...e];
|
|
74
|
+
for (; s.length; ) {
|
|
75
|
+
const o = s.pop(), d = r.value.map.get(o);
|
|
76
|
+
if (!(!d || n.has(o) || !p(d))) {
|
|
77
|
+
n.add(o), a.add(o);
|
|
78
|
+
for (const c of d.children) s.push(c);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
for (let o = r.value.rows.length - 1; o >= 0; o--) {
|
|
82
|
+
const d = r.value.rows[o];
|
|
83
|
+
if (!p(d)) continue;
|
|
84
|
+
const c = d.children.filter(
|
|
85
|
+
(C) => p(r.value.map.get(C))
|
|
86
|
+
);
|
|
87
|
+
c.length && (c.every((C) => a.has(C)) ? a.add(d.key) : (a.delete(d.key), c.some((C) => a.has(C) || t.has(C)) && t.add(d.key)));
|
|
88
|
+
}
|
|
89
|
+
} else
|
|
90
|
+
for (const n of u.halfCheckedKeys ?? [])
|
|
91
|
+
r.value.map.has(n) && !a.has(n) && t.add(n);
|
|
92
|
+
return { full: a, half: t };
|
|
93
|
+
}
|
|
94
|
+
const oe = f(
|
|
95
|
+
() => de(u.checkedKeys ?? ue.value)
|
|
96
|
+
), S = f(() => oe.value.full), O = f(() => oe.value.half), U = (e, l = !1) => r.value.rows.filter((a) => e.has(a.key) && (!l || !a.hasChildren)).map((a) => a.key), ie = (e = !1) => U(S.value, e), ce = () => U(O.value), fe = (e = !1, l = !1) => r.value.rows.filter(
|
|
97
|
+
(a) => (S.value.has(a.key) || l && O.value.has(a.key)) && (!e || !a.hasChildren)
|
|
98
|
+
).map((a) => a.node), E = (e) => X(e) ? e : typeof u.nodeKey == "function" ? u.nodeKey(e) : Ue(
|
|
99
|
+
e,
|
|
100
|
+
typeof u.nodeKey == "string" ? u.nodeKey : r.value.fields.id
|
|
101
|
+
), L = (e) => r.value.map.get(E(e)), k = (e) => {
|
|
102
|
+
var l;
|
|
103
|
+
return (l = L(e)) == null ? void 0 : l.node;
|
|
104
|
+
};
|
|
105
|
+
let w = 0, ve = 0, he = 0;
|
|
106
|
+
function ee(e, l, a) {
|
|
107
|
+
return {
|
|
108
|
+
node: e,
|
|
109
|
+
checked: l,
|
|
110
|
+
checkedKeys: ie(),
|
|
111
|
+
checkedNodes: fe(),
|
|
112
|
+
halfCheckedKeys: ce(),
|
|
113
|
+
halfCheckedNodes: r.value.rows.filter((t) => O.value.has(t.key)).map((t) => t.node),
|
|
114
|
+
event: a
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
async function we(e, l, a, t) {
|
|
118
|
+
if (v.value) return !1;
|
|
119
|
+
const n = de(e), s = [...n.full], o = ++ve, d = w;
|
|
120
|
+
return Ae(S.value, s) || (u.checkedKeys === void 0 && (ue.value = s), i("update:checkedKeys", s), i("check", s, {
|
|
121
|
+
...ee(l, a, t),
|
|
122
|
+
checkedKeys: U(n.full),
|
|
123
|
+
checkedNodes: r.value.rows.filter((c) => n.full.has(c.key)).map((c) => c.node),
|
|
124
|
+
halfCheckedKeys: U(n.half),
|
|
125
|
+
halfCheckedNodes: r.value.rows.filter((c) => n.half.has(c.key)).map((c) => c.node)
|
|
126
|
+
}), await F(), !h.value || w !== d || o !== ve || !Ae(S.value, s)) ? !1 : (i("check-change", ee(l, a, t)), z(), !0);
|
|
127
|
+
}
|
|
128
|
+
function Ve(e, l = !1) {
|
|
129
|
+
const a = x(e).filter((t) => {
|
|
130
|
+
const n = r.value.map.get(t);
|
|
131
|
+
return !n || p(n) && (!l || !n.hasChildren);
|
|
132
|
+
});
|
|
133
|
+
for (const t of S.value)
|
|
134
|
+
r.value.map.has(t) && !p(r.value.map.get(t)) && a.push(t);
|
|
135
|
+
return we(a);
|
|
136
|
+
}
|
|
137
|
+
function Ee(e, l, a = !u.checkStrictly, t) {
|
|
138
|
+
const n = L(e);
|
|
139
|
+
if (!p(n) || !n) return Promise.resolve(!1);
|
|
140
|
+
const s = new Set(S.value), o = a ? Pe(n.key) : [n.key];
|
|
141
|
+
for (const d of o) l ? s.add(d) : s.delete(d);
|
|
142
|
+
if (!l && !u.checkStrictly)
|
|
143
|
+
for (const d of H(n.key)) s.delete(d);
|
|
144
|
+
return we([...s], n.node, l, t);
|
|
145
|
+
}
|
|
146
|
+
async function ae(e, l = null, a) {
|
|
147
|
+
if (v.value || u.selectable === !1) return !1;
|
|
148
|
+
const t = x(e).filter((d) => {
|
|
149
|
+
const c = r.value.map.get(d);
|
|
150
|
+
return !c || !c.disabled && c.selectable;
|
|
151
|
+
});
|
|
152
|
+
if (D.value || t.splice(1), I(t, y.value)) return !1;
|
|
153
|
+
const n = D.value ? t : t[0] ?? null, s = w, o = ++he;
|
|
154
|
+
return u.modelValue === void 0 && (ne.value = n), i("update:modelValue", n), l && i("select", l, {
|
|
155
|
+
node: l,
|
|
156
|
+
selected: t.includes(E(l)),
|
|
157
|
+
selectedKeys: t,
|
|
158
|
+
selectedNodes: t.flatMap((d) => k(d) ?? []),
|
|
159
|
+
event: a
|
|
160
|
+
}), await F(), !h.value || w !== s || o !== he || !I(t, y.value) ? !1 : (i("selection-change", {
|
|
161
|
+
node: l,
|
|
162
|
+
selected: l ? t.includes(E(l)) : !1,
|
|
163
|
+
selectedKeys: t,
|
|
164
|
+
selectedNodes: t.flatMap((d) => k(d) ?? []),
|
|
165
|
+
event: a
|
|
166
|
+
}), z(), !0);
|
|
167
|
+
}
|
|
168
|
+
function Le(e, l) {
|
|
169
|
+
if (v.value || e.disabled || !e.selectable || u.selectable === !1)
|
|
170
|
+
return Promise.resolve(!1);
|
|
171
|
+
const a = se.value.has(e.key) ? D.value || u.allowDeselect ? y.value.filter((t) => t !== e.key) : y.value : D.value ? [...y.value, e.key] : [e.key];
|
|
172
|
+
return ae(a, e.node, l);
|
|
173
|
+
}
|
|
174
|
+
async function le(e) {
|
|
175
|
+
if (v.value) return !1;
|
|
176
|
+
const l = x(e), a = w;
|
|
177
|
+
return I(l, P.value) ? !1 : (u.expandedKeys === void 0 && (Y.value = l), i("update:expandedKeys", l), await F(), h.value && w === a && I(l, P.value));
|
|
178
|
+
}
|
|
179
|
+
const K = /* @__PURE__ */ new Map();
|
|
180
|
+
function j() {
|
|
181
|
+
for (const e of K.values()) e.controller.abort();
|
|
182
|
+
K.clear(), M.value = /* @__PURE__ */ new Set();
|
|
183
|
+
}
|
|
184
|
+
function G(e, l = !1) {
|
|
185
|
+
var ke;
|
|
186
|
+
const a = r.value.map.get(e);
|
|
187
|
+
if (!a || v.value || ((ke = T.loadActive) == null ? void 0 : ke.value) === !1 || !u.loadChildren || a.leaf)
|
|
188
|
+
return Promise.resolve(!1);
|
|
189
|
+
if (!l && (_.value.has(e) || a.children.length))
|
|
190
|
+
return Promise.resolve(!0);
|
|
191
|
+
if (K.has(e)) return K.get(e).promise;
|
|
192
|
+
const t = new AbortController(), n = w, s = u.nodes, o = u.loadChildren;
|
|
193
|
+
let d;
|
|
194
|
+
const c = new Promise((W) => d = W);
|
|
195
|
+
K.set(e, { controller: t, promise: c }), t.signal.addEventListener("abort", () => d(!1), {
|
|
196
|
+
once: !0
|
|
197
|
+
}), M.value = /* @__PURE__ */ new Set([...M.value, e]);
|
|
198
|
+
const C = new Map(m.value);
|
|
199
|
+
return C.delete(e), m.value = C, (async () => {
|
|
200
|
+
var W, Ke;
|
|
201
|
+
try {
|
|
202
|
+
const g = await o(a.node, {
|
|
203
|
+
signal: t.signal,
|
|
204
|
+
key: e
|
|
205
|
+
});
|
|
206
|
+
if (t.signal.aborted || !h.value || n !== w || s !== u.nodes || ((W = r.value.map.get(e)) == null ? void 0 : W.node) !== a.node || o !== u.loadChildren)
|
|
207
|
+
return !1;
|
|
208
|
+
if (!Array.isArray(g))
|
|
209
|
+
throw new TypeError("loadChildren must resolve to an array");
|
|
210
|
+
const te = x([...u.loadedKeys ?? R.value, e]);
|
|
211
|
+
if (u.loadedKeys === void 0 && (R.value = te), i("update:loadedKeys", te), await F(), t.signal.aborted || !h.value || n !== w || !_.value.has(e))
|
|
212
|
+
return !1;
|
|
213
|
+
const Ce = new Map(N.value);
|
|
214
|
+
return Ce.set(e, g), N.value = Ce, i("children-loaded", { node: a.node, children: g }), i("load", { node: a.node, children: g, loadedKeys: te }), !0;
|
|
215
|
+
} catch (g) {
|
|
216
|
+
return t.signal.aborted || !h.value || n !== w || (m.value = new Map([...m.value, [e, g]]), i("load-error", { node: a.node, error: g })), !1;
|
|
217
|
+
} finally {
|
|
218
|
+
if (((Ke = K.get(e)) == null ? void 0 : Ke.controller) === t) {
|
|
219
|
+
K.delete(e);
|
|
220
|
+
const g = new Set(M.value);
|
|
221
|
+
g.delete(e), M.value = g;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
})().then(d, () => d(!1)), c;
|
|
225
|
+
}
|
|
226
|
+
async function qe(e, l = !0) {
|
|
227
|
+
const a = r.value.map.get(e);
|
|
228
|
+
if (!a || a.disabled || !a.hasChildren || v.value) return !1;
|
|
229
|
+
const t = m.value.has(e);
|
|
230
|
+
let n = P.value.filter((o) => o !== e);
|
|
231
|
+
!l && u.autoExpandParent && (n = n.filter((o) => !H(o).includes(e))), l && (u.accordion && (n = n.filter((o) => {
|
|
232
|
+
let d = r.value.map.get(o);
|
|
233
|
+
for (; d && d.depth > a.depth; )
|
|
234
|
+
d = d.parent === void 0 ? void 0 : r.value.map.get(d.parent);
|
|
235
|
+
return !d || d.parent !== a.parent || d.key === e;
|
|
236
|
+
})), n.push(e));
|
|
237
|
+
const s = await le(n);
|
|
238
|
+
return s && i(l ? "node-expand" : "node-collapse", a.node, {
|
|
239
|
+
key: e,
|
|
240
|
+
expanded: l,
|
|
241
|
+
expandedKeys: [...V.value]
|
|
242
|
+
}), l && V.value.has(e) && (!m.value.has(e) || t) && await G(e), s;
|
|
243
|
+
}
|
|
244
|
+
function Te(e) {
|
|
245
|
+
v.value || (u.searchValue === void 0 && (re.value = e), i("update:searchValue", e), i("search", e));
|
|
246
|
+
}
|
|
247
|
+
async function Be(e, l = !0) {
|
|
248
|
+
if (e !== null) {
|
|
249
|
+
const a = r.value.map.get(e);
|
|
250
|
+
if (!a || a.disabled || !a.selectable) return !1;
|
|
251
|
+
}
|
|
252
|
+
return e !== null && l && await le(
|
|
253
|
+
x([...P.value, ...H(e)])
|
|
254
|
+
), ae(
|
|
255
|
+
e === null ? [] : [e],
|
|
256
|
+
e === null ? null : k(e) ?? null
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
function J(e, l) {
|
|
260
|
+
const a = r.value.map.get(e);
|
|
261
|
+
if (!a) return;
|
|
262
|
+
let t = Se(a.node, r.value.fields.children, [
|
|
263
|
+
...l
|
|
264
|
+
]), n = a;
|
|
265
|
+
for (; n.parent !== void 0; ) {
|
|
266
|
+
const s = r.value.map.get(n.parent);
|
|
267
|
+
t = Se(
|
|
268
|
+
s.node,
|
|
269
|
+
r.value.fields.children,
|
|
270
|
+
s.children.map((o) => o === n.key ? t : k(o))
|
|
271
|
+
), n = s;
|
|
272
|
+
}
|
|
273
|
+
return r.value.roots.map((s) => s === n.key ? t : k(s));
|
|
274
|
+
}
|
|
275
|
+
async function Q(e, l, a) {
|
|
276
|
+
if (!e || v.value) return !1;
|
|
277
|
+
const t = pe(e, u);
|
|
278
|
+
return t.invalid || (i("update:nodes", e), i("data-change", { nodes: e, action: l, key: a }), await F(), !h.value) ? !1 : I(
|
|
279
|
+
r.value.rows.map((n) => n.key),
|
|
280
|
+
t.rows.map((n) => n.key)
|
|
281
|
+
) && r.value.rows.every(
|
|
282
|
+
(n, s) => n.parent === t.rows[s].parent && be(n.node) === be(t.rows[s].node)
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
function ye(e) {
|
|
286
|
+
return (e.parent === void 0 ? r.value.roots : r.value.map.get(e.parent).children).map((l) => k(l));
|
|
287
|
+
}
|
|
288
|
+
function ge(e, l, a) {
|
|
289
|
+
const t = L(l), n = E(e);
|
|
290
|
+
if (!t || t.disabled || !X(n) || r.value.map.has(n))
|
|
291
|
+
return Promise.resolve(!1);
|
|
292
|
+
const s = ye(t), o = s.indexOf(t.node);
|
|
293
|
+
return s.splice(o + (a ? 1 : 0), 0, e), Q(
|
|
294
|
+
t.parent === void 0 ? s : J(t.parent, s),
|
|
295
|
+
a ? "insertAfter" : "insertBefore",
|
|
296
|
+
n
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
const De = (e, l) => {
|
|
300
|
+
const a = E(e), t = l === void 0 ? void 0 : L(l);
|
|
301
|
+
return !X(a) || r.value.map.has(a) || l !== void 0 && (!t || t.disabled || t.leaf) ? Promise.resolve(!1) : Q(
|
|
302
|
+
t ? J(t.key, [
|
|
303
|
+
...t.children.map((n) => k(n)),
|
|
304
|
+
e
|
|
305
|
+
]) : [...u.nodes, e],
|
|
306
|
+
"append",
|
|
307
|
+
a
|
|
308
|
+
);
|
|
309
|
+
};
|
|
310
|
+
function Fe(e) {
|
|
311
|
+
const l = L(e);
|
|
312
|
+
if (!l || l.disabled) return Promise.resolve(!1);
|
|
313
|
+
const a = ye(l).filter((t) => E(t) !== l.key);
|
|
314
|
+
return Q(
|
|
315
|
+
l.parent === void 0 ? a : J(l.parent, a),
|
|
316
|
+
"remove",
|
|
317
|
+
l.key
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
async function Ie(e) {
|
|
321
|
+
var a;
|
|
322
|
+
return !r.value.map.get(e) || v.value ? !1 : ((a = K.get(e)) == null || a.controller.abort(), K.delete(e), G(e, !0));
|
|
323
|
+
}
|
|
324
|
+
q(
|
|
325
|
+
() => [
|
|
326
|
+
u.nodes,
|
|
327
|
+
u.loadChildren,
|
|
328
|
+
u.nodeKey,
|
|
329
|
+
u.fieldNames
|
|
330
|
+
],
|
|
331
|
+
() => {
|
|
332
|
+
w++, j(), N.value = /* @__PURE__ */ new Map(), R.value = [], m.value = /* @__PURE__ */ new Map();
|
|
333
|
+
},
|
|
334
|
+
{ flush: "sync" }
|
|
335
|
+
), q(
|
|
336
|
+
() => [u.nodes, u.defaultExpandAll],
|
|
337
|
+
() => {
|
|
338
|
+
u.defaultExpandAll && u.expandedKeys === void 0 && (Y.value = r.value.rows.filter((e) => e.hasChildren).map((e) => e.key));
|
|
339
|
+
},
|
|
340
|
+
{ immediate: !0 }
|
|
341
|
+
), q(
|
|
342
|
+
() => {
|
|
343
|
+
var e;
|
|
344
|
+
return [
|
|
345
|
+
...V.value,
|
|
346
|
+
h.value,
|
|
347
|
+
v.value,
|
|
348
|
+
r.value,
|
|
349
|
+
(e = T.loadActive) == null ? void 0 : e.value
|
|
350
|
+
];
|
|
351
|
+
},
|
|
352
|
+
() => {
|
|
353
|
+
var e;
|
|
354
|
+
if (!v.value && ((e = T.loadActive) == null ? void 0 : e.value) !== !1)
|
|
355
|
+
for (const l of V.value) {
|
|
356
|
+
const a = r.value.map.get(l);
|
|
357
|
+
a != null && a.hasChildren && !a.children.length && !_.value.has(l) && !m.value.has(l) && G(l);
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
{ immediate: !0 }
|
|
361
|
+
), q(
|
|
362
|
+
() => u.loadedKeys,
|
|
363
|
+
(e, l) => {
|
|
364
|
+
if (e && l) {
|
|
365
|
+
const a = new Map(N.value);
|
|
366
|
+
for (const t of l) e.includes(t) || a.delete(t);
|
|
367
|
+
N.value = a;
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
{ flush: "sync" }
|
|
371
|
+
);
|
|
372
|
+
function me() {
|
|
373
|
+
h.value = !1, w++, j();
|
|
374
|
+
}
|
|
375
|
+
return T.loadActive && q(
|
|
376
|
+
T.loadActive,
|
|
377
|
+
(e) => {
|
|
378
|
+
e || j();
|
|
379
|
+
},
|
|
380
|
+
{ flush: "sync" }
|
|
381
|
+
), q(
|
|
382
|
+
v,
|
|
383
|
+
(e) => {
|
|
384
|
+
e && j();
|
|
385
|
+
},
|
|
386
|
+
{ flush: "sync" }
|
|
387
|
+
), ze(me), Re(me), He(() => h.value = !0), {
|
|
388
|
+
live: h,
|
|
389
|
+
busy: v,
|
|
390
|
+
index: r,
|
|
391
|
+
words: Ne,
|
|
392
|
+
query: Z,
|
|
393
|
+
expanded: V,
|
|
394
|
+
rawExpanded: P,
|
|
395
|
+
selected: y,
|
|
396
|
+
selection: se,
|
|
397
|
+
multiple: D,
|
|
398
|
+
visible: Me,
|
|
399
|
+
matches: $,
|
|
400
|
+
checked: S,
|
|
401
|
+
halfChecked: O,
|
|
402
|
+
loadingKeys: M,
|
|
403
|
+
failures: m,
|
|
404
|
+
ancestors: H,
|
|
405
|
+
getNode: k,
|
|
406
|
+
getNodeInfo: L,
|
|
407
|
+
getCheckedKeys: ie,
|
|
408
|
+
getCheckedNodes: fe,
|
|
409
|
+
getHalfCheckedKeys: ce,
|
|
410
|
+
checkInfo: ee,
|
|
411
|
+
setCheckedKeys: Ve,
|
|
412
|
+
setChecked: Ee,
|
|
413
|
+
selectNode: Le,
|
|
414
|
+
setSelectedKeys: ae,
|
|
415
|
+
setCurrentKey: Be,
|
|
416
|
+
getCurrentKey: () => y.value[0] ?? null,
|
|
417
|
+
getCurrentNode: () => y.value.length ? k(y.value[0]) ?? null : null,
|
|
418
|
+
setExpandedKeys: le,
|
|
419
|
+
expandNode: qe,
|
|
420
|
+
filter: Te,
|
|
421
|
+
reloadNode: Ie,
|
|
422
|
+
load: G,
|
|
423
|
+
append: De,
|
|
424
|
+
remove: Fe,
|
|
425
|
+
insertBefore: (e, l) => ge(e, l, !1),
|
|
426
|
+
insertAfter: (e, l) => ge(e, l, !0),
|
|
427
|
+
updateKeyChildren: (e, l) => {
|
|
428
|
+
var a, t;
|
|
429
|
+
return (a = r.value.map.get(e)) != null && a.disabled || (t = r.value.map.get(e)) != null && t.leaf && l.length ? Promise.resolve(!1) : Q(
|
|
430
|
+
J(e, l),
|
|
431
|
+
"updateKeyChildren",
|
|
432
|
+
e
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
export {
|
|
438
|
+
Je as useTree
|
|
439
|
+
};
|