hys-ui 0.5.0 → 0.7.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 +16 -0
- package/LICENSE +19 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1055 -753
- package/dist/components/HysDataGrid/gridColumnLayout.js +46 -0
- package/dist/components/HysDataGrid/gridPresentation.js +17 -0
- package/dist/components/HysDataGrid/useGridContextMenu.js +33 -0
- package/dist/components/HysDescriptions/HysDescriptions.vue.js +7 -0
- package/dist/components/HysDescriptions/HysDescriptions2.vue.js +146 -0
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +2 -2
- package/dist/components/HysForm/HysForm2.vue.js +9 -8
- package/dist/components/HysIcon/HysIcon.vue.js +373 -0
- package/dist/components/HysIcon/HysIcon2.vue.js +5 -0
- package/dist/components/HysIcon/IconGraphic/IconGraphic.vue.js +147 -0
- package/dist/components/HysIcon/IconGraphic/IconGraphic2.vue.js +4 -0
- package/dist/components/HysIcon/IconPickerPanel/IconPickerPanel.vue.js +7 -0
- package/dist/components/HysIcon/IconPickerPanel/IconPickerPanel2.vue.js +440 -0
- package/dist/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic.vue.js +29 -0
- package/dist/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic2.vue.js +4 -0
- package/dist/components/HysIcon/IconTooltip/IconTooltip.vue.js +19 -0
- package/dist/components/HysIcon/IconTooltip/IconTooltip2.vue.js +4 -0
- package/dist/components/HysIcon/builtins/access.js +180 -0
- package/dist/components/HysIcon/builtins/actions.js +327 -0
- package/dist/components/HysIcon/builtins/business.js +364 -0
- package/dist/components/HysIcon/builtins/catalog/access-1.json.js +51 -0
- package/dist/components/HysIcon/builtins/catalog/access-2.json.js +35 -0
- package/dist/components/HysIcon/builtins/catalog/accessibility.json.js +26 -0
- package/dist/components/HysIcon/builtins/catalog/arrows-1.json.js +45 -0
- package/dist/components/HysIcon/builtins/catalog/arrows-2.json.js +46 -0
- package/dist/components/HysIcon/builtins/catalog/arrows-3.json.js +42 -0
- package/dist/components/HysIcon/builtins/catalog/charts-1.json.js +50 -0
- package/dist/components/HysIcon/builtins/catalog/charts-2.json.js +13 -0
- package/dist/components/HysIcon/builtins/catalog/commerce.json.js +43 -0
- package/dist/components/HysIcon/builtins/catalog/communication-1.json.js +49 -0
- package/dist/components/HysIcon/builtins/catalog/communication-2.json.js +37 -0
- package/dist/components/HysIcon/builtins/catalog/design-1.json.js +61 -0
- package/dist/components/HysIcon/builtins/catalog/design-2.json.js +27 -0
- package/dist/components/HysIcon/builtins/catalog/development-1.json.js +58 -0
- package/dist/components/HysIcon/builtins/catalog/development-2.json.js +60 -0
- package/dist/components/HysIcon/builtins/catalog/development-3.json.js +25 -0
- package/dist/components/HysIcon/builtins/catalog/devices-1.json.js +52 -0
- package/dist/components/HysIcon/builtins/catalog/devices-2.json.js +55 -0
- package/dist/components/HysIcon/builtins/catalog/devices-3.json.js +23 -0
- package/dist/components/HysIcon/builtins/catalog/education.json.js +34 -0
- package/dist/components/HysIcon/builtins/catalog/emoji.json.js +24 -0
- package/dist/components/HysIcon/builtins/catalog/files-1.json.js +45 -0
- package/dist/components/HysIcon/builtins/catalog/files-2.json.js +47 -0
- package/dist/components/HysIcon/builtins/catalog/files-3.json.js +8 -0
- package/dist/components/HysIcon/builtins/catalog/food-1.json.js +67 -0
- package/dist/components/HysIcon/builtins/catalog/food-2.json.js +40 -0
- package/dist/components/HysIcon/builtins/catalog/home.json.js +36 -0
- package/dist/components/HysIcon/builtins/catalog/layout-1.json.js +46 -0
- package/dist/components/HysIcon/builtins/catalog/layout-2.json.js +45 -0
- package/dist/components/HysIcon/builtins/catalog/manifest.json.js +4 -0
- package/dist/components/HysIcon/builtins/catalog/maps-1.json.js +61 -0
- package/dist/components/HysIcon/builtins/catalog/maps-2.json.js +24 -0
- package/dist/components/HysIcon/builtins/catalog/media-1.json.js +57 -0
- package/dist/components/HysIcon/builtins/catalog/media-2.json.js +13 -0
- package/dist/components/HysIcon/builtins/catalog/medical.json.js +30 -0
- package/dist/components/HysIcon/builtins/catalog/nature.json.js +54 -0
- package/dist/components/HysIcon/builtins/catalog/recreation.json.js +51 -0
- package/dist/components/HysIcon/builtins/catalog/shapes.json.js +54 -0
- package/dist/components/HysIcon/builtins/catalog/text-1.json.js +52 -0
- package/dist/components/HysIcon/builtins/catalog/text-2.json.js +54 -0
- package/dist/components/HysIcon/builtins/catalog/text-3.json.js +58 -0
- package/dist/components/HysIcon/builtins/catalog/text-4.json.js +41 -0
- package/dist/components/HysIcon/builtins/catalog/time.json.js +39 -0
- package/dist/components/HysIcon/builtins/catalog/transport-1.json.js +57 -0
- package/dist/components/HysIcon/builtins/catalog/transport-2.json.js +7 -0
- package/dist/components/HysIcon/builtins/catalog/weather.json.js +46 -0
- package/dist/components/HysIcon/builtins/communication.js +314 -0
- package/dist/components/HysIcon/builtins/documents.js +315 -0
- package/dist/components/HysIcon/builtins/extendedCatalog.js +75 -0
- package/dist/components/HysIcon/builtins/iconInCategory.js +11 -0
- package/dist/components/HysIcon/builtins/media.js +255 -0
- package/dist/components/HysIcon/builtins/navigation.js +276 -0
- package/dist/components/HysIcon/builtins/technology.js +189 -0
- package/dist/components/HysIcon/iconBuiltins.js +228 -0
- package/dist/components/HysIcon/iconConfig.js +30 -0
- package/dist/components/HysIcon/iconRegistry.js +183 -0
- package/dist/components/HysIcon/iconSafety.js +191 -0
- package/dist/components/HysIcon/iconStyle.js +70 -0
- package/dist/components/HysIcon/useIconResource.js +75 -0
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +38 -38
- package/dist/components/HysPopconfirm/HysPopconfirm.vue.js +7 -0
- package/dist/components/HysPopconfirm/HysPopconfirm2.vue.js +346 -0
- package/dist/components/HysPopconfirm/usePopconfirmAction.js +32 -0
- package/dist/components/HysResult/HysResult.vue.js +7 -0
- package/dist/components/HysResult/HysResult2.vue.js +124 -0
- package/dist/components/HysSearch/HysSearch.vue.js +2 -2
- package/dist/components/HysSortableList/HysSortableList.vue.js +2 -2
- package/dist/components/HysSortableList/HysSortableList2.vue.js +498 -129
- package/dist/components/HysSortableList/SortableGhost/SortableGhost.vue.js +7 -0
- package/dist/components/HysSortableList/SortableGhost/SortableGhost2.vue.js +43 -0
- package/dist/components/HysSortableList/SortableGhost/useSortGhost.js +54 -0
- package/dist/components/HysSortableList/geometry.js +230 -0
- package/dist/components/HysSortableList/model.js +254 -0
- package/dist/components/HysSortableList/transactions.js +281 -0
- package/dist/components/HysSortableList/useSortDrag.js +270 -0
- package/dist/components/HysSortableList/useSortKeyboard.js +72 -0
- package/dist/components/HysSortableList/useSortWindow.js +144 -0
- package/dist/components/HysSpace/HysSpace.vue.js +7 -0
- package/dist/components/HysSpace/HysSpace2.vue.js +79 -0
- package/dist/components/HysSpace/spaceItems.js +17 -0
- package/dist/components/HysSpin/HysSpin.vue.js +7 -0
- package/dist/components/HysSpin/HysSpin2.vue.js +427 -0
- package/dist/components/HysSpin/SpinGlyph/SpinGlyph.vue.js +334 -0
- package/dist/components/HysSpin/SpinGlyph/SpinGlyph2.vue.js +5 -0
- package/dist/components/HysSpin/SpinPortal/SpinPortal.vue.js +7 -0
- package/dist/components/HysSpin/SpinPortal/SpinPortal2.vue.js +66 -0
- package/dist/components/HysSpin/SpinPortal/spinTarget.js +57 -0
- package/dist/components/HysSpin/spinCatalog.js +35 -0
- package/dist/components/HysSpin/spinConfig.js +32 -0
- package/dist/components/HysSpin/spinService.js +160 -0
- package/dist/components/HysSpin/spinStyle.js +39 -0
- package/dist/components/HysSpin/useHysSpinTask.js +92 -0
- package/dist/components/HysSpin/useSpinFullscreen.js +60 -0
- package/dist/components/HysSpin/useSpinVisibility.js +59 -0
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +285 -204
- package/dist/components/HysSplitPane/splitPaneResize.js +75 -0
- package/dist/components/HysTabPane/HysTabPane.vue.js +49 -0
- package/dist/components/HysTabPane/HysTabPane2.vue.js +4 -0
- package/dist/components/HysTable/HysTable.vue.js +3 -3
- package/dist/components/HysTable/HysTable2.vue.js +412 -383
- package/dist/components/HysTable/tableSearch.js +24 -0
- package/dist/components/HysTabs/HysTabs.vue.js +172 -5
- package/dist/components/HysTabs/HysTabs2.vue.js +2 -275
- package/dist/components/HysTabs/TabsMore/TabsMore.vue.js +7 -0
- package/dist/components/HysTabs/TabsMore/TabsMore2.vue.js +133 -0
- package/dist/components/HysTabs/TabsPanels/TabsPanels.vue.js +161 -0
- package/dist/components/HysTabs/TabsPanels/TabsPanels2.vue.js +4 -0
- package/dist/components/HysTabs/TabsPrompts/TabsPrompts.vue.js +4 -0
- package/dist/components/HysTabs/TabsPrompts/TabsPrompts2.vue.js +88 -0
- package/dist/components/HysTabs/TabsSlot/TabsSlot.js +13 -0
- package/dist/components/HysTabs/TabsWorkbench/TabsWorkbench.vue.js +7 -0
- package/dist/components/HysTabs/TabsWorkbench/TabsWorkbench2.vue.js +687 -0
- package/dist/components/HysTabs/tabsConfig.js +35 -0
- package/dist/components/HysTabs/tabsItems.js +79 -0
- package/dist/components/HysTabs/tabsPersistence.js +118 -0
- package/dist/components/HysTabs/useHysRouteTabs.js +77 -0
- package/dist/components/HysTabs/useTabsDragGhost.js +47 -0
- package/dist/components/HysTabs/useTabsNav.js +127 -0
- package/dist/components/HysTabs/useTabsOverlays.js +52 -0
- package/dist/components/HysTabs/useTabsPanels.js +101 -0
- package/dist/components/HysTabs/useTabsPointer.js +131 -0
- package/dist/components/HysTabs/useTabsState.js +263 -0
- package/dist/components/HysToast/HysToast.vue.js +3 -3
- package/dist/components/HysToast/HysToast2.vue.js +379 -107
- package/dist/components/HysToast/ToastViewport/ToastViewport.vue.js +7 -0
- package/dist/components/HysToast/ToastViewport/ToastViewport2.vue.js +211 -0
- package/dist/components/HysToast/ToastViewport/useToastStackDisclosure.js +71 -0
- package/dist/components/HysToast/toastPresentation.js +98 -0
- package/dist/components/HysToast/useToastActions.js +62 -0
- package/dist/components/HysToast/useToastSwipe.js +48 -0
- package/dist/components/HysToast/useToastTimer.js +90 -0
- package/dist/composables/formLayout.js +20 -42
- package/dist/composables/popupReferenceBinding.js +41 -0
- package/dist/composables/popupSurfaceStyle.js +30 -0
- package/dist/composables/toastEscape.js +18 -10
- package/dist/composables/toastQueue.js +276 -0
- package/dist/composables/toastQueueModel.js +86 -0
- package/dist/composables/toastTasks.js +58 -0
- package/dist/composables/useContainerWidth.js +24 -0
- package/dist/composables/useFloating.js +28 -28
- package/dist/composables/useHysToast.js +117 -135
- package/dist/composables/usePageVisibility.js +19 -0
- package/dist/composables/usePopupSurface.js +181 -356
- package/dist/composables/usePopupSurfaceInteractions.js +173 -0
- package/dist/composables/useSplitPaneDrag.js +29 -26
- package/dist/composables/useSvgInstanceId.js +15 -0
- package/dist/composables/useTable.js +321 -306
- package/dist/composables/useTabularRowNavigation.js +46 -0
- package/dist/index.js +231 -185
- package/dist/internal/MultiSplitPane.vue.js +246 -205
- package/dist/internal/PopupSurfacePanel.vue.js +2 -2
- package/dist/internal/PopupSurfacePanel2.vue.js +35 -30
- package/dist/style.css +1 -1
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +40 -2
- package/dist/types/components/HysDataGrid/gridColumnLayout.d.ts +22 -0
- package/dist/types/components/HysDataGrid/gridPresentation.d.ts +47 -0
- package/dist/types/components/HysDataGrid/useGridContextMenu.d.ts +14 -0
- package/dist/types/components/HysDescriptions/HysDescriptions.vue.d.ts +20 -0
- package/dist/types/components/HysDescriptions/descriptionsTypes.d.ts +54 -0
- package/dist/types/components/HysForm/HysForm.vue.d.ts +1 -1
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +1 -1
- package/dist/types/components/HysIcon/HysIcon.vue.d.ts +76 -0
- package/dist/types/components/HysIcon/IconGraphic/IconGraphic.vue.d.ts +43 -0
- package/dist/types/components/HysIcon/IconPickerPanel/IconPickerPanel.vue.d.ts +17 -0
- package/dist/types/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic.vue.d.ts +10 -0
- package/dist/types/components/HysIcon/IconTooltip/IconTooltip.vue.d.ts +11 -0
- package/dist/types/components/HysIcon/builtins/access.d.ts +15 -0
- package/dist/types/components/HysIcon/builtins/actions.d.ts +30 -0
- package/dist/types/components/HysIcon/builtins/business.d.ts +31 -0
- package/dist/types/components/HysIcon/builtins/communication.d.ts +27 -0
- package/dist/types/components/HysIcon/builtins/documents.d.ts +29 -0
- package/dist/types/components/HysIcon/builtins/extendedCatalog.d.ts +2 -0
- package/dist/types/components/HysIcon/builtins/iconInCategory.d.ts +2 -0
- package/dist/types/components/HysIcon/builtins/media.d.ts +24 -0
- package/dist/types/components/HysIcon/builtins/navigation.d.ts +30 -0
- package/dist/types/components/HysIcon/builtins/technology.d.ts +18 -0
- package/dist/types/components/HysIcon/iconBuiltins.d.ts +2 -0
- package/dist/types/components/HysIcon/iconConfig.d.ts +10 -0
- package/dist/types/components/HysIcon/iconRegistry.d.ts +5 -0
- package/dist/types/components/HysIcon/iconSafety.d.ts +8 -0
- package/dist/types/components/HysIcon/iconStyle.d.ts +6 -0
- package/dist/types/components/HysIcon/iconTypes.d.ts +192 -0
- package/dist/types/components/HysIcon/useIconResource.d.ts +14 -0
- package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
- package/dist/types/components/HysPopconfirm/HysPopconfirm.vue.d.ts +85 -0
- package/dist/types/components/HysPopconfirm/popconfirmTypes.d.ts +72 -0
- package/dist/types/components/HysPopconfirm/usePopconfirmAction.d.ts +6 -0
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
- package/dist/types/components/HysResult/HysResult.vue.d.ts +22 -0
- package/dist/types/components/HysResult/resultTypes.d.ts +32 -0
- package/dist/types/components/HysSortableList/HysSortableList.vue.d.ts +48 -25
- package/dist/types/components/HysSortableList/SortableGhost/SortableGhost.vue.d.ts +31 -0
- package/dist/types/components/HysSortableList/SortableGhost/useSortGhost.d.ts +23 -0
- package/dist/types/components/HysSortableList/geometry.d.ts +35 -0
- package/dist/types/components/HysSortableList/model.d.ts +61 -0
- package/dist/types/components/HysSortableList/sortableList.d.ts +151 -0
- package/dist/types/components/HysSortableList/transactions.d.ts +10 -0
- package/dist/types/components/HysSortableList/useSortDrag.d.ts +25 -0
- package/dist/types/components/HysSortableList/useSortKeyboard.d.ts +17 -0
- package/dist/types/components/HysSortableList/useSortWindow.d.ts +16 -0
- package/dist/types/components/HysSpace/HysSpace.vue.d.ts +15 -0
- package/dist/types/components/HysSpace/spaceItems.d.ts +9 -0
- package/dist/types/components/HysSpace/spaceTypes.d.ts +20 -0
- package/dist/types/components/HysSpin/HysSpin.vue.d.ts +84 -0
- package/dist/types/components/HysSpin/SpinGlyph/SpinGlyph.vue.d.ts +16 -0
- package/dist/types/components/HysSpin/SpinPortal/SpinPortal.vue.d.ts +21 -0
- package/dist/types/components/HysSpin/SpinPortal/spinTarget.d.ts +3 -0
- package/dist/types/components/HysSpin/spinCatalog.d.ts +122 -0
- package/dist/types/components/HysSpin/spinConfig.d.ts +10 -0
- package/dist/types/components/HysSpin/spinService.d.ts +7 -0
- package/dist/types/components/HysSpin/spinStyle.d.ts +5 -0
- package/dist/types/components/HysSpin/spinTypes.d.ts +133 -0
- package/dist/types/components/HysSpin/useHysSpinTask.d.ts +4 -0
- package/dist/types/components/HysSpin/useSpinFullscreen.d.ts +17 -0
- package/dist/types/components/HysSpin/useSpinVisibility.d.ts +10 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +25 -2
- package/dist/types/components/HysSplitPane/splitPaneResize.d.ts +17 -0
- package/dist/types/components/HysTabPane/HysTabPane.vue.d.ts +11 -0
- package/dist/types/components/HysTable/HysTable.vue.d.ts +16 -10
- package/dist/types/components/HysTable/tableSearch.d.ts +2 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +83 -74
- package/dist/types/components/HysTabs/TabsMore/TabsMore.vue.d.ts +14 -0
- package/dist/types/components/HysTabs/TabsPanels/TabsPanels.vue.d.ts +17 -0
- package/dist/types/components/HysTabs/TabsPrompts/TabsPrompts.vue.d.ts +7 -0
- package/dist/types/components/HysTabs/TabsSlot/TabsSlot.d.ts +9 -0
- package/dist/types/components/HysTabs/TabsWorkbench/TabsWorkbench.vue.d.ts +32 -0
- package/dist/types/components/HysTabs/tabsConfig.d.ts +4 -0
- package/dist/types/components/HysTabs/tabsItems.d.ts +14 -0
- package/dist/types/components/HysTabs/tabsPersistence.d.ts +6 -0
- package/dist/types/components/HysTabs/tabsTypes.d.ts +236 -0
- package/dist/types/components/HysTabs/useHysRouteTabs.d.ts +22 -0
- package/dist/types/components/HysTabs/useTabsDragGhost.d.ts +22 -0
- package/dist/types/components/HysTabs/useTabsNav.d.ts +20 -0
- package/dist/types/components/HysTabs/useTabsOverlays.d.ts +54 -0
- package/dist/types/components/HysTabs/useTabsPanels.d.ts +14 -0
- package/dist/types/components/HysTabs/useTabsPointer.d.ts +30 -0
- package/dist/types/components/HysTabs/useTabsState.d.ts +32 -0
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +2 -2
- package/dist/types/components/HysToast/HysToast.vue.d.ts +44 -46
- package/dist/types/components/HysToast/ToastViewport/ToastViewport.vue.d.ts +25 -0
- package/dist/types/components/HysToast/ToastViewport/useToastStackDisclosure.d.ts +16 -0
- package/dist/types/components/HysToast/toastPresentation.d.ts +8 -0
- package/dist/types/components/HysToast/toastTypes.d.ts +212 -0
- package/dist/types/components/HysToast/useToastActions.d.ts +18 -0
- package/dist/types/components/HysToast/useToastSwipe.d.ts +11 -0
- package/dist/types/components/HysToast/useToastTimer.d.ts +22 -0
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +2 -2
- package/dist/types/composables/dataGrid.d.ts +34 -0
- package/dist/types/composables/formLayout.d.ts +1 -2
- package/dist/types/composables/popupReferenceBinding.d.ts +9 -0
- package/dist/types/composables/popupSurfaceStyle.d.ts +7 -0
- package/dist/types/composables/table.d.ts +10 -1
- package/dist/types/composables/toastEscape.d.ts +1 -1
- package/dist/types/composables/toastQueue.d.ts +121 -0
- package/dist/types/composables/toastQueueModel.d.ts +116 -0
- package/dist/types/composables/toastTasks.d.ts +2 -0
- package/dist/types/composables/useColorPicker.d.ts +1 -1
- package/dist/types/composables/useContainerWidth.d.ts +2 -0
- package/dist/types/composables/useContextMenu.d.ts +1 -1
- package/dist/types/composables/useFloating.d.ts +2 -2
- package/dist/types/composables/useHysToast.d.ts +4 -48
- package/dist/types/composables/usePageVisibility.d.ts +1 -0
- package/dist/types/composables/usePopupSurface.d.ts +28 -22
- package/dist/types/composables/usePopupSurfaceInteractions.d.ts +35 -0
- package/dist/types/composables/useSplitPaneDrag.d.ts +2 -2
- package/dist/types/composables/useSvgInstanceId.d.ts +1 -0
- package/dist/types/composables/useTable.d.ts +2 -0
- package/dist/types/composables/useTabularRowNavigation.d.ts +18 -0
- package/dist/types/index.d.ts +33 -6
- package/dist/types/internal/MultiSplitPane.vue.d.ts +10 -1
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent as r, openBlock as e, createElementBlock as n, mergeProps as o, createElementVNode as i, normalizeStyle as s, normalizeClass as d, renderSlot as c, createCommentVNode as u } from "vue";
|
|
2
|
+
const g = { key: 0 }, y = /* @__PURE__ */ r({
|
|
3
|
+
__name: "SortableGhost",
|
|
4
|
+
props: {
|
|
5
|
+
track: {},
|
|
6
|
+
appearance: {},
|
|
7
|
+
motion: { type: Boolean },
|
|
8
|
+
ghostClass: {},
|
|
9
|
+
ghostStyle: { type: [Boolean, null, String, Object, Array] }
|
|
10
|
+
},
|
|
11
|
+
setup(t) {
|
|
12
|
+
return (l, h) => {
|
|
13
|
+
var a;
|
|
14
|
+
return e(), n("div", o(t.appearance, {
|
|
15
|
+
class: ["hys-sort-ghost", {
|
|
16
|
+
"hys-sort-returning": t.motion && t.track.returning.value,
|
|
17
|
+
"hys-sort-landing": t.motion && t.track.landing.value
|
|
18
|
+
}],
|
|
19
|
+
style: {
|
|
20
|
+
transform: "translate3d(" + t.track.position.value.x + "px," + t.track.position.value.y + "px,0)",
|
|
21
|
+
width: t.track.width + "px",
|
|
22
|
+
"--hys-sort-landing-duration": t.track.landing.value ? t.track.landing.value.duration + "ms" : void 0,
|
|
23
|
+
"--hys-sort-landing-easing": (a = t.track.landing.value) == null ? void 0 : a.easing
|
|
24
|
+
},
|
|
25
|
+
"aria-hidden": "true"
|
|
26
|
+
}), [
|
|
27
|
+
i("div", {
|
|
28
|
+
class: d(["hys-sort-ghost-card", t.ghostClass]),
|
|
29
|
+
style: s(t.ghostStyle)
|
|
30
|
+
}, [
|
|
31
|
+
c(l.$slots, "default", {
|
|
32
|
+
drag: t.track.drag,
|
|
33
|
+
allowed: t.track.allowed.value
|
|
34
|
+
}, void 0, !0),
|
|
35
|
+
t.track.allowed.value ? u("", !0) : (e(), n("small", g, "不可放置"))
|
|
36
|
+
], 6)
|
|
37
|
+
], 16);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
y as default
|
|
43
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { shallowRef as y, watch as C, ref as d } from "vue";
|
|
2
|
+
let x = 0;
|
|
3
|
+
function L(o, c) {
|
|
4
|
+
const i = y(null);
|
|
5
|
+
let f, r, s;
|
|
6
|
+
function h(t, e, n) {
|
|
7
|
+
u(!1), r = e.getBoundingClientRect(), i.value = {
|
|
8
|
+
drag: t,
|
|
9
|
+
width: Math.max(96, Math.min(r.width || 200, 360)),
|
|
10
|
+
position: d(n),
|
|
11
|
+
returning: d(!1),
|
|
12
|
+
landing: d(null),
|
|
13
|
+
allowed: d(!0)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function u(t, e) {
|
|
17
|
+
clearTimeout(f), s == null || s(), s = void 0;
|
|
18
|
+
const n = i.value;
|
|
19
|
+
if (!t || !n || !r || !o()) {
|
|
20
|
+
i.value = null;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const l = e != null && e.isConnected ? e.getBoundingClientRect() : r;
|
|
24
|
+
n.landing.value = null, n.returning.value = !0, n.position.value = { x: l.left, y: l.top }, f = setTimeout(() => {
|
|
25
|
+
i.value === n && (i.value = null);
|
|
26
|
+
}, 200);
|
|
27
|
+
}
|
|
28
|
+
function p(t) {
|
|
29
|
+
const e = i.value, { duration: n, easing: l } = c();
|
|
30
|
+
if (!e || !o() || !Number.isFinite(n) || n <= 0 || !(t != null && t.isConnected))
|
|
31
|
+
return u(!1);
|
|
32
|
+
const v = String(++x);
|
|
33
|
+
t.style.setProperty("--hys-sort-landing-duration", `${n}ms`), t.dataset.sortLanding = v, s = () => {
|
|
34
|
+
t.dataset.sortLanding === v && (delete t.dataset.sortLanding, t.style.removeProperty("--hys-sort-landing-duration"));
|
|
35
|
+
};
|
|
36
|
+
const a = t.getBoundingClientRect(), g = t.ownerDocument.defaultView;
|
|
37
|
+
if (!a.width || !a.height || !g || a.right <= 0 || a.bottom <= 0 || a.left >= g.innerWidth || a.top >= g.innerHeight)
|
|
38
|
+
return u(!1);
|
|
39
|
+
e.landing.value = { duration: n, easing: l }, e.position.value = { x: a.left, y: a.top }, f = setTimeout(() => u(!1), n);
|
|
40
|
+
}
|
|
41
|
+
function m(t, e) {
|
|
42
|
+
const n = i.value;
|
|
43
|
+
return !n || !o() || c().duration <= 0 ? (u(!1), t()) : t((l) => {
|
|
44
|
+
i.value === n && p(l);
|
|
45
|
+
}).then((l) => (!l && i.value === n && u(!0, e()), l));
|
|
46
|
+
}
|
|
47
|
+
return C(o, (t) => {
|
|
48
|
+
const e = i.value;
|
|
49
|
+
!t && (e != null && e.landing.value || e != null && e.returning.value) && u(!1);
|
|
50
|
+
}), { ghost: i, show: h, clear: u, release: m };
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
L as useSortGhost
|
|
54
|
+
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { layoutOf as E, portAt as L, keyToken as O, linkedPorts as I } from "./model.js";
|
|
2
|
+
function X(t) {
|
|
3
|
+
return t.handle === !1 || t.showHandle === !1 && typeof t.handle != "string";
|
|
4
|
+
}
|
|
5
|
+
function j(t, e, n) {
|
|
6
|
+
var s;
|
|
7
|
+
const r = Array.from(t.childNodes).filter(
|
|
8
|
+
(i) => {
|
|
9
|
+
var c;
|
|
10
|
+
return i.nodeType === Node.TEXT_NODE && ((c = i.textContent) == null ? void 0 : c.trim());
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
if (!r.length || ((s = t.ownerDocument.defaultView) == null ? void 0 : s.getComputedStyle(t).userSelect) === "none")
|
|
14
|
+
return !1;
|
|
15
|
+
const o = t.ownerDocument.createRange();
|
|
16
|
+
return r.some((i) => {
|
|
17
|
+
var c;
|
|
18
|
+
return o.selectNodeContents(i), Array.from(((c = o.getClientRects) == null ? void 0 : c.call(o)) ?? []).some(
|
|
19
|
+
({ left: a, right: l, top: d, bottom: h, width: f }) => f > 0 && e >= a && e <= l && n >= d && n <= h
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function F(t, e, n, r) {
|
|
24
|
+
if (r && !("reason" in r)) {
|
|
25
|
+
if (r.source === t && t.props.livePreview !== !1 && !(t.props.virtual && n.source === "keyboard"))
|
|
26
|
+
return { key: n.keys[0], position: "before" };
|
|
27
|
+
const o = r.proposal.index;
|
|
28
|
+
if (o !== e.index) {
|
|
29
|
+
const s = t.data().items, i = s[o] ?? s.at(-1);
|
|
30
|
+
if (i)
|
|
31
|
+
return {
|
|
32
|
+
key: t.key(i),
|
|
33
|
+
position: o < s.length ? "before" : "after"
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return { key: e.anchor, position: e.position };
|
|
38
|
+
}
|
|
39
|
+
const u = (t, e, n) => Math.max(e, Math.min(n, t)), S = (t) => Array.from(t.children).filter(
|
|
40
|
+
(e) => e instanceof HTMLElement && e.dataset.sortKey !== void 0
|
|
41
|
+
), y = (t, e) => Math.hypot(
|
|
42
|
+
t.x - u(t.x, e.left, e.right),
|
|
43
|
+
t.y - u(t.y, e.top, e.bottom)
|
|
44
|
+
);
|
|
45
|
+
function Y(t, e, n) {
|
|
46
|
+
var d;
|
|
47
|
+
const { axis: r, bounds: o } = t.props, s = r === "y" ? n.x : e.x, i = r === "x" ? n.y : e.y, c = o === "list" ? t.root() : typeof o == "function" ? o() : typeof o == "object" ? o : void 0, a = c == null ? void 0 : c.getBoundingClientRect(), l = (d = t.root()) == null ? void 0 : d.ownerDocument.defaultView;
|
|
48
|
+
return a ? {
|
|
49
|
+
point: {
|
|
50
|
+
x: u(s, a.left, a.right),
|
|
51
|
+
y: u(i, a.top, a.bottom)
|
|
52
|
+
},
|
|
53
|
+
inside: y({ x: s, y: i }, a) === 0
|
|
54
|
+
} : l ? {
|
|
55
|
+
point: {
|
|
56
|
+
x: u(s, 0, l.innerWidth),
|
|
57
|
+
y: u(i, 0, l.innerHeight)
|
|
58
|
+
},
|
|
59
|
+
inside: s >= 0 && i >= 0 && s < l.innerWidth && i < l.innerHeight
|
|
60
|
+
} : { point: { x: s, y: i }, inside: !0 };
|
|
61
|
+
}
|
|
62
|
+
function W(t) {
|
|
63
|
+
var s;
|
|
64
|
+
if (!t) return 1;
|
|
65
|
+
const e = Number(t.dataset.sortColumns);
|
|
66
|
+
if (e > 0) return e;
|
|
67
|
+
const n = S(t), r = ((s = n[0]) == null ? void 0 : s.getBoundingClientRect().top) ?? 0, o = n.findIndex(
|
|
68
|
+
(i) => Math.abs(i.getBoundingClientRect().top - r) > 2
|
|
69
|
+
);
|
|
70
|
+
return o > 0 ? o : Math.max(1, n.length);
|
|
71
|
+
}
|
|
72
|
+
function A(t, e) {
|
|
73
|
+
const n = t.getBoundingClientRect();
|
|
74
|
+
if (!e.some((c) => t.classList.contains(c)))
|
|
75
|
+
return n;
|
|
76
|
+
const r = t.ownerDocument.defaultView;
|
|
77
|
+
if (!(r != null && r.DOMMatrixReadOnly)) return n;
|
|
78
|
+
const o = r.getComputedStyle(t).transform;
|
|
79
|
+
if (o === "none") return n;
|
|
80
|
+
const { m41: s, m42: i } = new r.DOMMatrixReadOnly(o);
|
|
81
|
+
return {
|
|
82
|
+
left: n.left - s,
|
|
83
|
+
right: n.right - s,
|
|
84
|
+
top: n.top - i,
|
|
85
|
+
bottom: n.bottom - i,
|
|
86
|
+
width: n.width,
|
|
87
|
+
height: n.height
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function z(t, e, n) {
|
|
91
|
+
let r, o = 1 / 0;
|
|
92
|
+
for (const s of S(t)) {
|
|
93
|
+
const i = A(s, n), c = y(e, i);
|
|
94
|
+
if (c < o && (o = c, r = { row: s, box: i }, c === 0))
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
return r;
|
|
98
|
+
}
|
|
99
|
+
function P(t, e) {
|
|
100
|
+
var o;
|
|
101
|
+
let n, r = 17;
|
|
102
|
+
for (const s of I(t)) {
|
|
103
|
+
if (!t.props.snap && !s.props.snap) continue;
|
|
104
|
+
const i = s.surface();
|
|
105
|
+
if (!i || i.ownerDocument !== ((o = t.root()) == null ? void 0 : o.ownerDocument) || !i.isConnected)
|
|
106
|
+
continue;
|
|
107
|
+
const c = y(e, i.getBoundingClientRect());
|
|
108
|
+
c < r && (r = c, n = s);
|
|
109
|
+
}
|
|
110
|
+
return n;
|
|
111
|
+
}
|
|
112
|
+
function U(t, e) {
|
|
113
|
+
var b, D;
|
|
114
|
+
const n = (b = t.root()) == null ? void 0 : b.ownerDocument, r = ((D = n == null ? void 0 : n.elementFromPoint) == null ? void 0 : D.call(n, e.x, e.y)) ?? null, o = L(r) ?? P(t, e), s = o == null ? void 0 : o.surface();
|
|
115
|
+
if (!o || !s) return { element: r };
|
|
116
|
+
const i = o.data();
|
|
117
|
+
if (!i.items.length)
|
|
118
|
+
return { element: r, candidate: { port: o, index: 0, position: "inside" } };
|
|
119
|
+
const c = (o.props.moveClass || "hys-sort-motion-move").split(/\s+/).filter(Boolean), a = r == null ? void 0 : r.closest("[data-sort-key]"), l = (a == null ? void 0 : a.parentElement) === s ? A(a, c) : void 0, d = a && l && y(e, l) === 0 ? { row: a, box: l } : z(s, e, c);
|
|
120
|
+
if (!d) return { element: r };
|
|
121
|
+
const { row: h, box: f } = d, g = Number(h.dataset.sortIndex);
|
|
122
|
+
if (!Number.isInteger(g) || g < 0 || g >= i.items.length)
|
|
123
|
+
return { element: r };
|
|
124
|
+
const x = E(o.props), m = x === "horizontal" || x === "grid" && f.width + 1 < s.clientWidth, T = m && getComputedStyle(s).direction === "rtl";
|
|
125
|
+
let w = m ? e.x >= f.left + f.width / 2 !== T : e.y >= f.top + f.height / 2;
|
|
126
|
+
e.y < f.top && (w = !1), e.y > f.bottom && (w = !0);
|
|
127
|
+
const C = t === o && o.props.mode === "swap", p = m ? e.x - f.left : e.y - f.top, M = m ? f.width : f.height, v = u(M * 0.12, 4, 10), B = Math.min(Math.abs(p), Math.abs(M - p)), H = x === "grid" ? Math.min(Math.abs(e.y - f.top), Math.abs(e.y - f.bottom)) : 1 / 0, N = i.items[g];
|
|
128
|
+
return {
|
|
129
|
+
element: r,
|
|
130
|
+
rowKey: h.dataset.sortKey,
|
|
131
|
+
nearCenter: !C && Math.abs(p - M / 2) <= v,
|
|
132
|
+
nearEdge: Math.min(B, H) <= v,
|
|
133
|
+
candidate: {
|
|
134
|
+
port: o,
|
|
135
|
+
index: g + (w && !C ? 1 : 0),
|
|
136
|
+
position: w ? "after" : "before",
|
|
137
|
+
anchor: o.key(N)
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function _(t, e, n) {
|
|
142
|
+
if (!e || !(n != null && n.candidate) || e.port !== n.candidate.port)
|
|
143
|
+
return !1;
|
|
144
|
+
const r = n.candidate;
|
|
145
|
+
if (r.port === t && t.props.mode === "swap") return n.nearEdge;
|
|
146
|
+
const o = Math.abs(e.index - r.index);
|
|
147
|
+
return o === 0 ? n.nearEdge : o === 1 && n.nearCenter;
|
|
148
|
+
}
|
|
149
|
+
function V(t, e, n) {
|
|
150
|
+
const r = e.data().items, o = r.at(-1), s = r[n] ?? o;
|
|
151
|
+
return {
|
|
152
|
+
port: e,
|
|
153
|
+
index: n,
|
|
154
|
+
position: r.length ? n >= r.length && (t !== e || e.props.mode !== "swap") ? "after" : "before" : "inside",
|
|
155
|
+
anchor: s ? e.key(s) : void 0
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function q(t, e, n) {
|
|
159
|
+
const r = t.data().keys.get(e);
|
|
160
|
+
if (r === void 0 || !Number.isInteger(n) || !n) return;
|
|
161
|
+
const o = r + n;
|
|
162
|
+
if (!(o < 0 || o >= t.data().items.length))
|
|
163
|
+
return V(
|
|
164
|
+
t,
|
|
165
|
+
t,
|
|
166
|
+
o + (t.props.mode !== "swap" && n > 0 ? 1 : 0)
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
function G(t, e) {
|
|
170
|
+
const n = E(t.props), r = n === "horizontal", o = n === "grid", s = t.surface();
|
|
171
|
+
if (e === "ArrowLeft" || e === "ArrowRight") {
|
|
172
|
+
if (!r && !o) return 0;
|
|
173
|
+
const i = s && getComputedStyle(s).direction === "rtl";
|
|
174
|
+
return e === "ArrowRight" !== i ? 1 : -1;
|
|
175
|
+
}
|
|
176
|
+
return e === "ArrowUp" || e === "ArrowDown" ? r ? 0 : (e === "ArrowDown" ? 1 : -1) * (o ? W(s) : 1) : 0;
|
|
177
|
+
}
|
|
178
|
+
function J(t, e) {
|
|
179
|
+
return (t == null ? void 0 : t.port) === (e == null ? void 0 : e.port) && (t == null ? void 0 : t.index) === (e == null ? void 0 : e.index) && (t == null ? void 0 : t.position) === (e == null ? void 0 : e.position) && (t == null ? void 0 : t.anchor) === (e == null ? void 0 : e.anchor);
|
|
180
|
+
}
|
|
181
|
+
const Q = O;
|
|
182
|
+
function k(t, e, n, r, o) {
|
|
183
|
+
if (t < e || t > n) return 0;
|
|
184
|
+
const s = Math.min(r, (n - e) / 2);
|
|
185
|
+
return s ? t < e + s ? -Math.ceil(o * (1 - (t - e) / s)) : t > n - s ? Math.ceil(o * (1 - (n - t) / s)) : 0 : 0;
|
|
186
|
+
}
|
|
187
|
+
function R(t, e, n, r, o, s) {
|
|
188
|
+
const i = t.ownerDocument.defaultView;
|
|
189
|
+
if (!i) return { x: !1, y: !1 };
|
|
190
|
+
const c = r ? { left: 0, top: 0, right: i.innerWidth, bottom: i.innerHeight } : t.getBoundingClientRect();
|
|
191
|
+
if (y(e, c) > 0) return { x: !1, y: !1 };
|
|
192
|
+
const a = getComputedStyle(t), l = u(n.threshold ?? 36, 1, 200), d = u(n.speed ?? 14, 1, 100), h = t.scrollLeft, f = t.scrollTop;
|
|
193
|
+
return !o && n.axis !== "y" && t.scrollWidth > t.clientWidth && (r || /auto|scroll|overlay/.test(a.overflowX)) && (t.scrollLeft += k(
|
|
194
|
+
e.x,
|
|
195
|
+
c.left,
|
|
196
|
+
c.right,
|
|
197
|
+
l,
|
|
198
|
+
d
|
|
199
|
+
)), !s && n.axis !== "x" && t.scrollHeight > t.clientHeight && (r || /auto|scroll|overlay/.test(a.overflowY)) && (t.scrollTop += k(e.y, c.top, c.bottom, l, d)), { x: t.scrollLeft !== h, y: t.scrollTop !== f };
|
|
200
|
+
}
|
|
201
|
+
function Z(t, e, n) {
|
|
202
|
+
if (n === !1 || !t) return !1;
|
|
203
|
+
const r = typeof n == "object" ? n : {}, o = t.ownerDocument.scrollingElement;
|
|
204
|
+
let s = !1, i = !1;
|
|
205
|
+
for (let c = t; c && !(s && i); c = c.parentElement) {
|
|
206
|
+
if (!(c instanceof HTMLElement) || c === o) continue;
|
|
207
|
+
const a = R(c, e, r, !1, s, i);
|
|
208
|
+
s || (s = a.x), i || (i = a.y);
|
|
209
|
+
}
|
|
210
|
+
if (r.window !== !1 && o instanceof HTMLElement && !(s && i)) {
|
|
211
|
+
const c = R(o, e, r, !0, s, i);
|
|
212
|
+
s || (s = c.x), i || (i = c.y);
|
|
213
|
+
}
|
|
214
|
+
return s || i;
|
|
215
|
+
}
|
|
216
|
+
export {
|
|
217
|
+
Z as autoScrollSort,
|
|
218
|
+
V as candidateAt,
|
|
219
|
+
F as dropMarkerFor,
|
|
220
|
+
U as findSortHit,
|
|
221
|
+
W as gridColumns,
|
|
222
|
+
j as hitsSelectableText,
|
|
223
|
+
_ as keepSortCandidate,
|
|
224
|
+
G as keyStep,
|
|
225
|
+
q as relativeCandidate,
|
|
226
|
+
J as sameCandidate,
|
|
227
|
+
Q as tokenOf,
|
|
228
|
+
X as wholeRowDrag,
|
|
229
|
+
Y as withinDragBounds
|
|
230
|
+
};
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { toRaw as b } from "vue";
|
|
2
|
+
const g = /* @__PURE__ */ new Map(), P = (t) => t;
|
|
3
|
+
function G(t, o) {
|
|
4
|
+
return g.set(t, o), () => {
|
|
5
|
+
g.delete(t);
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
const K = () => Array.from(g.values(), P);
|
|
9
|
+
function H(t) {
|
|
10
|
+
const o = t == null ? void 0 : t.closest("[data-sort-root]"), s = o && g.get(o);
|
|
11
|
+
return s ? P(s) : void 0;
|
|
12
|
+
}
|
|
13
|
+
const m = (t) => {
|
|
14
|
+
const o = t.props.group;
|
|
15
|
+
return typeof o == "string" ? { name: o } : o;
|
|
16
|
+
};
|
|
17
|
+
function J(t) {
|
|
18
|
+
var i;
|
|
19
|
+
const o = m(t);
|
|
20
|
+
if (!o) return [t];
|
|
21
|
+
const s = (i = t.root()) == null ? void 0 : i.ownerDocument;
|
|
22
|
+
return K().filter((e) => {
|
|
23
|
+
var r, c;
|
|
24
|
+
if (e === t) return !0;
|
|
25
|
+
const n = m(e);
|
|
26
|
+
return !n || ((r = e.root()) == null ? void 0 : r.ownerDocument) !== s || !((c = e.root()) != null && c.isConnected) ? !1 : n.name === o.name || n.put === !0 || typeof n.put == "function" || Array.isArray(n.put) && n.put.includes(o.name);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const x = (t) => {
|
|
30
|
+
var o;
|
|
31
|
+
return {
|
|
32
|
+
id: t.id(),
|
|
33
|
+
group: (o = m(t)) == null ? void 0 : o.name,
|
|
34
|
+
items: t.data().items
|
|
35
|
+
};
|
|
36
|
+
}, L = (t) => typeof t == "number" ? `n:${t}` : `s:${t}`, Q = (t) => t.listTag === "table" ? "vertical" : t.layout ?? "vertical", A = (t) => typeof t == "string" || typeof t == "number" && Number.isFinite(t);
|
|
37
|
+
function U(t, o, s) {
|
|
38
|
+
const i = /* @__PURE__ */ new Map(), e = [], n = Array.isArray(s) ? new Set(s) : void 0;
|
|
39
|
+
return t.forEach((r, c) => {
|
|
40
|
+
const a = o(r);
|
|
41
|
+
A(a) && i.set(a, c);
|
|
42
|
+
const u = typeof s == "function" ? s(r, c) : n == null ? void 0 : n.has(a);
|
|
43
|
+
u && e.push({ key: a, index: c, placement: u });
|
|
44
|
+
}), { keys: i, fixed: e, items: t, valid: i.size === t.length };
|
|
45
|
+
}
|
|
46
|
+
const N = {
|
|
47
|
+
cancelled: "已取消排序",
|
|
48
|
+
outside: "请放到可排序区域内",
|
|
49
|
+
disabled: "该项目或列表已禁用排序",
|
|
50
|
+
keys: "项目键缺失或重复",
|
|
51
|
+
group: "这两个列表不允许此操作",
|
|
52
|
+
capacity: "目标列表已满",
|
|
53
|
+
fixed: "不能改变固定项目的位置",
|
|
54
|
+
cycle: "不能将项目移动到自己的子列表",
|
|
55
|
+
noop: "顺序没有变化",
|
|
56
|
+
rule: "不符合排序规则",
|
|
57
|
+
conflict: "列表已更新,请重新操作",
|
|
58
|
+
save: "保存排序失败"
|
|
59
|
+
};
|
|
60
|
+
function f(t, o, s = N[t], i) {
|
|
61
|
+
return { reason: t, proposal: o, message: s, error: i };
|
|
62
|
+
}
|
|
63
|
+
const I = (t) => t === !1 || typeof t == "string";
|
|
64
|
+
function T(t, o, s) {
|
|
65
|
+
var r, c;
|
|
66
|
+
if (t.props.disabled) return f("disabled");
|
|
67
|
+
if (!t.data().valid) return f("keys");
|
|
68
|
+
const i = t.key(o), e = t.props.itemDisabled;
|
|
69
|
+
if (typeof e == "function" ? e(o, s) : e != null && e.includes(i))
|
|
70
|
+
return f("disabled");
|
|
71
|
+
if (t.data().fixed.some((a) => a.key === i))
|
|
72
|
+
return f("fixed");
|
|
73
|
+
const n = (c = (r = t.props).canDrag) == null ? void 0 : c.call(r, o, s);
|
|
74
|
+
if (I(n))
|
|
75
|
+
return f(
|
|
76
|
+
"rule",
|
|
77
|
+
void 0,
|
|
78
|
+
typeof n == "string" ? n : void 0
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function V(t, o, s) {
|
|
82
|
+
const i = t.data();
|
|
83
|
+
if (!i.valid) return f("keys");
|
|
84
|
+
const e = Array.from(
|
|
85
|
+
new Set(o),
|
|
86
|
+
(n) => i.keys.get(n) ?? -1
|
|
87
|
+
).sort((n, r) => n - r);
|
|
88
|
+
if (!e.length || e[0] < 0) return f("conflict");
|
|
89
|
+
for (const n of e) {
|
|
90
|
+
const r = T(t, i.items[n], n);
|
|
91
|
+
if (r) return r;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
source: s,
|
|
95
|
+
from: x(t),
|
|
96
|
+
indices: e,
|
|
97
|
+
items: e.map((n) => i.items[n]),
|
|
98
|
+
keys: e.map((n) => t.key(i.items[n]))
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function _(t, o, s, i) {
|
|
102
|
+
if (t === o)
|
|
103
|
+
return i && i !== "move" ? f("group", s) : "move";
|
|
104
|
+
const e = m(t), n = m(o);
|
|
105
|
+
if (!(e != null && e.name) || !(n != null && n.name)) return f("group", s);
|
|
106
|
+
const r = typeof e.pull == "function" ? e.pull(s) : e.pull;
|
|
107
|
+
if (r === !1) return f("group", s);
|
|
108
|
+
const c = typeof r == "string" ? r : "move";
|
|
109
|
+
if (i && i !== c) return f("group", s);
|
|
110
|
+
const a = { ...s, operation: c };
|
|
111
|
+
if (typeof n.put == "function") {
|
|
112
|
+
const p = n.put(a);
|
|
113
|
+
return I(p) ? f(
|
|
114
|
+
"group",
|
|
115
|
+
a,
|
|
116
|
+
typeof p == "string" ? p : void 0
|
|
117
|
+
) : c;
|
|
118
|
+
}
|
|
119
|
+
return (Array.isArray(n.put) ? n.put.includes(e.name) : n.put === !0 || n.put !== !1 && e.name === n.name) ? c : f("group", a);
|
|
120
|
+
}
|
|
121
|
+
function k(t, o) {
|
|
122
|
+
const s = t.data().fixed;
|
|
123
|
+
if (!s.length) return !0;
|
|
124
|
+
const i = new Map(o.map((r, c) => [t.key(r), c])), e = s.filter((r) => r.placement === "top"), n = s.filter((r) => r.placement === "bottom");
|
|
125
|
+
return e.every((r, c) => i.get(r.key) === c) && n.every(
|
|
126
|
+
(r, c) => i.get(r.key) === o.length - n.length + c
|
|
127
|
+
) && s.every(
|
|
128
|
+
(r) => r.placement !== !0 || i.get(r.key) === r.index
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
const j = (t, o) => t.length === o.length && t.every((s, i) => b(s) === b(o[i]));
|
|
132
|
+
function F(t, o, s) {
|
|
133
|
+
const i = o.map((n, r) => s + r);
|
|
134
|
+
if (i.some(
|
|
135
|
+
(n) => n >= t.length || o.includes(n)
|
|
136
|
+
))
|
|
137
|
+
return;
|
|
138
|
+
const e = t.slice();
|
|
139
|
+
return o.forEach((n, r) => {
|
|
140
|
+
e[n] = t[i[r]], e[i[r]] = t[n];
|
|
141
|
+
}), e;
|
|
142
|
+
}
|
|
143
|
+
let w = 0;
|
|
144
|
+
function R(t, o, s) {
|
|
145
|
+
const i = t.props.clone ?? o.props.clone, e = /* @__PURE__ */ new Set([
|
|
146
|
+
...o.data().keys.keys(),
|
|
147
|
+
...t.data().keys.keys()
|
|
148
|
+
]), n = o.props.itemKey ?? "id";
|
|
149
|
+
return s.items.map((r) => {
|
|
150
|
+
let c;
|
|
151
|
+
if (i) c = i(r, s);
|
|
152
|
+
else {
|
|
153
|
+
if (typeof n == "function")
|
|
154
|
+
throw Error("函数形式的 itemKey 需要 clone 回调生成新键");
|
|
155
|
+
const u = b(r);
|
|
156
|
+
c = s.operation === "clone" ? structuredClone(u) : { ...u };
|
|
157
|
+
const p = o.key(r);
|
|
158
|
+
let y;
|
|
159
|
+
do
|
|
160
|
+
w++, y = typeof p == "number" ? -w : `${p}-copy-${w}`;
|
|
161
|
+
while (e.has(y));
|
|
162
|
+
Object.assign(c, { [n]: y });
|
|
163
|
+
}
|
|
164
|
+
const a = o.key(c);
|
|
165
|
+
if (!A(a) || e.has(a))
|
|
166
|
+
throw Error("复制项目必须提供新的唯一键");
|
|
167
|
+
return e.add(a), c;
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function W(t, o, s, i = !1) {
|
|
171
|
+
var O, E, $, M;
|
|
172
|
+
const e = s.port, n = t.data().items, r = e.data().items, c = t === e, a = c ? e.props.mode ?? "insert" : "insert", u = {
|
|
173
|
+
...o,
|
|
174
|
+
from: x(t),
|
|
175
|
+
to: x(e),
|
|
176
|
+
index: s.index,
|
|
177
|
+
position: s.position,
|
|
178
|
+
targetItem: s.anchor === void 0 ? void 0 : r[e.data().keys.get(s.anchor) ?? -1],
|
|
179
|
+
operation: s.operation ?? "move",
|
|
180
|
+
mode: a
|
|
181
|
+
};
|
|
182
|
+
if (e.props.disabled) return f("disabled", u);
|
|
183
|
+
if (!t.data().valid || !e.data().valid)
|
|
184
|
+
return f("keys", u);
|
|
185
|
+
if (!c && o.keys.some((l) => {
|
|
186
|
+
var d;
|
|
187
|
+
return (d = t.row(l)) == null ? void 0 : d.contains(e.root() ?? null);
|
|
188
|
+
}))
|
|
189
|
+
return f("cycle", u);
|
|
190
|
+
const p = _(
|
|
191
|
+
t,
|
|
192
|
+
e,
|
|
193
|
+
u,
|
|
194
|
+
s.operation
|
|
195
|
+
);
|
|
196
|
+
if (typeof p != "string") return p;
|
|
197
|
+
u.operation = p, u.index = ((E = (O = e.props).resolveIndex) == null ? void 0 : E.call(O, u)) ?? u.index;
|
|
198
|
+
const { index: y } = u;
|
|
199
|
+
if (!Number.isInteger(y) || y < 0 || y > r.length || a === "swap" && y === r.length)
|
|
200
|
+
return f("outside", u);
|
|
201
|
+
if (!c && r.length + o.items.length > (e.props.maxItems ?? 1 / 0))
|
|
202
|
+
return f("capacity", u);
|
|
203
|
+
const z = c ? [t] : [t, e];
|
|
204
|
+
for (const l of z) {
|
|
205
|
+
const d = (M = ($ = l.props).canDrop) == null ? void 0 : M.call($, u);
|
|
206
|
+
if (I(d))
|
|
207
|
+
return f(
|
|
208
|
+
"rule",
|
|
209
|
+
u,
|
|
210
|
+
typeof d == "string" ? d : void 0
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
const C = new Set(o.indices), v = n.filter((l, d) => !C.has(d));
|
|
214
|
+
if (c) {
|
|
215
|
+
const l = a === "swap" ? F(n, o.indices, y) : v;
|
|
216
|
+
return !l || (a === "insert" && l.splice(
|
|
217
|
+
y - o.indices.filter((d) => d < y).length,
|
|
218
|
+
0,
|
|
219
|
+
...o.items
|
|
220
|
+
), j(n, l)) ? f("noop", u) : k(t, l) ? {
|
|
221
|
+
source: t,
|
|
222
|
+
target: e,
|
|
223
|
+
proposal: u,
|
|
224
|
+
changes: [{ port: t, previous: n, next: l }]
|
|
225
|
+
} : f("fixed", u);
|
|
226
|
+
}
|
|
227
|
+
const S = p === "move" || !i ? o.items : R(t, e, u);
|
|
228
|
+
if (p === "move" || i) {
|
|
229
|
+
const l = S.map(e.key);
|
|
230
|
+
if (new Set(l).size !== l.length || l.some((d) => !A(d) || e.data().keys.has(d)))
|
|
231
|
+
return f("keys", u);
|
|
232
|
+
}
|
|
233
|
+
const h = r.slice();
|
|
234
|
+
if (h.splice(y, 0, ...S), !k(e, h) || p === "move" && !k(t, v))
|
|
235
|
+
return f("fixed", u);
|
|
236
|
+
const D = [{ port: e, previous: r, next: h }];
|
|
237
|
+
return p === "move" && D.unshift({ port: t, previous: n, next: v }), { source: t, target: e, proposal: u, changes: D };
|
|
238
|
+
}
|
|
239
|
+
export {
|
|
240
|
+
U as buildSortIndex,
|
|
241
|
+
T as dragIssue,
|
|
242
|
+
f as feedback,
|
|
243
|
+
m as groupOf,
|
|
244
|
+
L as keyToken,
|
|
245
|
+
Q as layoutOf,
|
|
246
|
+
J as linkedPorts,
|
|
247
|
+
V as makeDrag,
|
|
248
|
+
H as portAt,
|
|
249
|
+
k as preserved,
|
|
250
|
+
W as proposeSort,
|
|
251
|
+
G as registerSortPort,
|
|
252
|
+
j as sameItems,
|
|
253
|
+
K as sortPorts
|
|
254
|
+
};
|