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,144 @@
|
|
|
1
|
+
import { computed as d, ref as k, shallowRef as p, watch as F, onBeforeUnmount as q, nextTick as I } from "vue";
|
|
2
|
+
import { layoutOf as K, keyToken as N } from "./model.js";
|
|
3
|
+
const G = (n, u, l, s) => Number.isFinite(n) ? Math.min(s, Math.max(l, n)) : u;
|
|
4
|
+
function H(n, u) {
|
|
5
|
+
let l = 0, s = n.length - 1;
|
|
6
|
+
for (; l < s; ) {
|
|
7
|
+
const m = Math.ceil((l + s) / 2);
|
|
8
|
+
n[m] <= u ? l = m : s = m - 1;
|
|
9
|
+
}
|
|
10
|
+
return Math.min(l, Math.max(0, n.length - 2));
|
|
11
|
+
}
|
|
12
|
+
function J(n, u, l, s, m) {
|
|
13
|
+
const x = d(
|
|
14
|
+
() => typeof n.virtual == "object" ? n.virtual : {}
|
|
15
|
+
), c = d(() => K(n) === "horizontal"), v = k(0), L = k(0), z = k(0), y = k(0), h = /* @__PURE__ */ new Map(), R = p(0), b = d(() => {
|
|
16
|
+
if (K(n) !== "grid" || !n.virtual) return 1;
|
|
17
|
+
const e = x.value.columns;
|
|
18
|
+
return Math.floor(
|
|
19
|
+
G(
|
|
20
|
+
typeof e == "function" ? e(L.value) : e,
|
|
21
|
+
2,
|
|
22
|
+
1,
|
|
23
|
+
100
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
}), w = d(() => {
|
|
27
|
+
if (!n.virtual) return [0];
|
|
28
|
+
R.value;
|
|
29
|
+
const e = [0], t = G(
|
|
30
|
+
x.value.estimateSize,
|
|
31
|
+
c.value ? 160 : 48,
|
|
32
|
+
1,
|
|
33
|
+
2e3
|
|
34
|
+
), a = b.value;
|
|
35
|
+
for (let o = 0; o < u.value.length; o += a) {
|
|
36
|
+
let i = 0;
|
|
37
|
+
for (let r = o; r < Math.min(o + a, u.value.length); r++)
|
|
38
|
+
i = Math.max(
|
|
39
|
+
i,
|
|
40
|
+
h.get(N(m(u.value[r]))) ?? t
|
|
41
|
+
);
|
|
42
|
+
e.push(e[e.length - 1] + i + y.value);
|
|
43
|
+
}
|
|
44
|
+
return e;
|
|
45
|
+
}), W = d(() => {
|
|
46
|
+
if (!n.virtual)
|
|
47
|
+
return { start: 0, end: u.value.length, before: 0, after: 0 };
|
|
48
|
+
const e = w.value, t = e.length - 1, a = Math.floor(G(x.value.overscan, 4, 1, 100)), o = Math.max(0, H(e, v.value) - a), i = Math.min(
|
|
49
|
+
t,
|
|
50
|
+
H(e, v.value + (z.value || 300)) + a + 1
|
|
51
|
+
);
|
|
52
|
+
return {
|
|
53
|
+
start: o * b.value,
|
|
54
|
+
end: Math.min(i * b.value, u.value.length),
|
|
55
|
+
before: Math.max(0, e[o] - y.value),
|
|
56
|
+
after: Math.max(0, e[t] - e[i] - y.value)
|
|
57
|
+
};
|
|
58
|
+
}), P = d(
|
|
59
|
+
() => u.value.slice(W.value.start, W.value.end)
|
|
60
|
+
), O = d(() => {
|
|
61
|
+
if (!n.virtual) return;
|
|
62
|
+
const e = x.value.height ?? (c.value ? "auto" : 320);
|
|
63
|
+
return typeof e == "number" ? `${Math.max(1, e)}px` : e;
|
|
64
|
+
});
|
|
65
|
+
let g, f;
|
|
66
|
+
const M = /* @__PURE__ */ new Set();
|
|
67
|
+
function S() {
|
|
68
|
+
const e = l.value;
|
|
69
|
+
if (!e || !n.virtual) return;
|
|
70
|
+
v.value = c.value ? Math.abs(e.scrollLeft) : e.scrollTop, z.value = c.value ? e.clientWidth : e.clientHeight, L.value = e.clientWidth;
|
|
71
|
+
const t = s.value;
|
|
72
|
+
if (t) {
|
|
73
|
+
const a = getComputedStyle(t);
|
|
74
|
+
y.value = parseFloat(c.value ? a.columnGap : a.rowGap) || 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function T(e) {
|
|
78
|
+
const t = l.value;
|
|
79
|
+
t && (c.value ? t.scrollLeft = getComputedStyle(t).direction === "rtl" ? -e : e : t.scrollTop = e, S());
|
|
80
|
+
}
|
|
81
|
+
function U(e) {
|
|
82
|
+
const t = w.value, a = H(t, v.value);
|
|
83
|
+
let o = !1;
|
|
84
|
+
for (const i of e) {
|
|
85
|
+
const r = i.target, A = r.dataset.sortKey;
|
|
86
|
+
if (A === void 0 || !M.has(r)) continue;
|
|
87
|
+
const C = c.value ? r.offsetWidth : r.offsetHeight;
|
|
88
|
+
!C || h.get(A) === C || (h.set(A, C), o = !0);
|
|
89
|
+
}
|
|
90
|
+
if (o) {
|
|
91
|
+
R.value++;
|
|
92
|
+
const i = (w.value[a] ?? 0) - (t[a] ?? 0);
|
|
93
|
+
if (i && v.value > 0) {
|
|
94
|
+
const r = v.value;
|
|
95
|
+
I(() => {
|
|
96
|
+
v.value === r && T(r + i);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function j() {
|
|
102
|
+
if (!f || !s.value) return;
|
|
103
|
+
const e = new Set(
|
|
104
|
+
Array.from(s.value.children).filter(
|
|
105
|
+
(t) => t.hasAttribute("data-sort-key")
|
|
106
|
+
)
|
|
107
|
+
);
|
|
108
|
+
for (const t of M)
|
|
109
|
+
e.has(t) || (f.unobserve(t), M.delete(t));
|
|
110
|
+
for (const t of e)
|
|
111
|
+
M.has(t) || (M.add(t), f.observe(t));
|
|
112
|
+
}
|
|
113
|
+
function B() {
|
|
114
|
+
g == null || g.disconnect(), f == null || f.disconnect(), g = f = void 0, M.clear();
|
|
115
|
+
}
|
|
116
|
+
F(
|
|
117
|
+
[l, s, () => !!n.virtual, c],
|
|
118
|
+
() => {
|
|
119
|
+
B(), h.clear(), R.value++, !(!l.value || !n.virtual) && (S(), typeof ResizeObserver < "u" && (g = new ResizeObserver(S), g.observe(l.value), f = new ResizeObserver(U), j()));
|
|
120
|
+
},
|
|
121
|
+
{ flush: "post" }
|
|
122
|
+
), F(P, j, { flush: "post" }), F(u, (e) => {
|
|
123
|
+
if (!h.size) return;
|
|
124
|
+
const t = new Set(e.map((a) => N(m(a))));
|
|
125
|
+
for (const a of h.keys()) t.has(a) || h.delete(a);
|
|
126
|
+
}), q(B);
|
|
127
|
+
async function $(e) {
|
|
128
|
+
if (!n.virtual || e < 0) return;
|
|
129
|
+
const t = Math.floor(e / b.value), a = w.value[t], o = w.value[t + 1] - y.value;
|
|
130
|
+
a < v.value ? T(a) : o > v.value + z.value && T(Math.max(0, o - z.value)), await I();
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
visibleItems: P,
|
|
134
|
+
range: W,
|
|
135
|
+
horizontal: c,
|
|
136
|
+
length: O,
|
|
137
|
+
columns: b,
|
|
138
|
+
reveal: $,
|
|
139
|
+
syncPosition: S
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
export {
|
|
143
|
+
J as useSortWindow
|
|
144
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { defineComponent as g, useSlots as v, computed as w, openBlock as a, createElementBlock as o, mergeProps as x, unref as p, Fragment as i, renderList as f, renderSlot as B, createTextVNode as j, toDisplayString as z, createCommentVNode as S, createElementVNode as V, createBlock as C, resolveDynamicComponent as N } from "vue";
|
|
2
|
+
import { useHysRootAttrs as R } from "../../config.js";
|
|
3
|
+
import { spaceGap as y, collectSpaceItems as D } from "./spaceItems.js";
|
|
4
|
+
const E = ["data-direction", "data-wrap", "data-block", "data-fill"], F = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "hys-space-separator",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
}, H = { class: "hys-space-content" }, G = /* @__PURE__ */ g({
|
|
9
|
+
__name: "HysSpace",
|
|
10
|
+
props: {
|
|
11
|
+
direction: { default: "horizontal" },
|
|
12
|
+
size: { default: "sm" },
|
|
13
|
+
align: {},
|
|
14
|
+
justify: { default: "start" },
|
|
15
|
+
wrap: { type: Boolean },
|
|
16
|
+
block: { type: Boolean },
|
|
17
|
+
fill: { type: Boolean },
|
|
18
|
+
fillRatio: {},
|
|
19
|
+
separator: {}
|
|
20
|
+
},
|
|
21
|
+
setup(e) {
|
|
22
|
+
const t = e, s = v(), m = R(), h = {
|
|
23
|
+
start: "flex-start",
|
|
24
|
+
center: "center",
|
|
25
|
+
end: "flex-end",
|
|
26
|
+
between: "space-between",
|
|
27
|
+
around: "space-around",
|
|
28
|
+
evenly: "space-evenly"
|
|
29
|
+
}, k = {
|
|
30
|
+
start: "flex-start",
|
|
31
|
+
center: "center",
|
|
32
|
+
end: "flex-end",
|
|
33
|
+
baseline: "baseline",
|
|
34
|
+
stretch: "stretch"
|
|
35
|
+
}, b = w(() => {
|
|
36
|
+
const n = t.size, [c, r] = typeof n == "object" ? n : [n, n], l = t.align ?? (t.direction === "horizontal" ? "center" : t.fill ? "stretch" : "start");
|
|
37
|
+
return {
|
|
38
|
+
"--hys-space-inline-gap": y(c),
|
|
39
|
+
"--hys-space-block-gap": y(r),
|
|
40
|
+
"--hys-space-basis": Number.isFinite(t.fillRatio) ? Math.max(0, Math.min(100, t.fillRatio)) + "%" : t.wrap ? "auto" : "0%",
|
|
41
|
+
alignItems: k[l],
|
|
42
|
+
justifyContent: h[t.justify]
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
return (n, c) => {
|
|
46
|
+
var r;
|
|
47
|
+
return a(), o("div", x(p(m), {
|
|
48
|
+
class: "hys-ui-space",
|
|
49
|
+
style: b.value,
|
|
50
|
+
"data-direction": e.direction,
|
|
51
|
+
"data-wrap": e.wrap && e.direction === "horizontal" || void 0,
|
|
52
|
+
"data-block": e.block || e.fill || void 0,
|
|
53
|
+
"data-fill": e.fill || void 0
|
|
54
|
+
}), [
|
|
55
|
+
(a(!0), o(i, null, f([p(D)(((r = s.default) == null ? void 0 : r.call(s)) ?? [])], (l) => (a(), o(i, { key: 0 }, [
|
|
56
|
+
(a(!0), o(i, null, f(l, (d, u) => (a(), o("div", {
|
|
57
|
+
key: d.key,
|
|
58
|
+
class: "hys-space-item"
|
|
59
|
+
}, [
|
|
60
|
+
u && (s.separator || e.separator) ? (a(), o("div", F, [
|
|
61
|
+
B(n.$slots, "separator", {
|
|
62
|
+
index: u,
|
|
63
|
+
count: l.length
|
|
64
|
+
}, () => [
|
|
65
|
+
j(z(e.separator), 1)
|
|
66
|
+
], !0)
|
|
67
|
+
])) : S("", !0),
|
|
68
|
+
V("div", H, [
|
|
69
|
+
(a(), C(N(d.node)))
|
|
70
|
+
])
|
|
71
|
+
]))), 128))
|
|
72
|
+
], 64))), 128))
|
|
73
|
+
], 16, E);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
export {
|
|
78
|
+
G as default
|
|
79
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isVNode as n, Comment as y, Text as m, Fragment as f } from "vue";
|
|
2
|
+
function h(t, c = "", i = []) {
|
|
3
|
+
return t.forEach((r, s) => {
|
|
4
|
+
if (!n(r) || r.type === y || r.type === m && !String(r.children ?? "").trim())
|
|
5
|
+
return;
|
|
6
|
+
const p = c + "/" + (r.key === null ? "#" + s : JSON.stringify([typeof r.key, String(r.key)]));
|
|
7
|
+
r.type === f && Array.isArray(r.children) ? h(r.children, p, i) : i.push({ key: p, node: r });
|
|
8
|
+
}), i;
|
|
9
|
+
}
|
|
10
|
+
const e = { sm: "8px", md: "12px", lg: "20px" };
|
|
11
|
+
function a(t) {
|
|
12
|
+
return typeof t == "number" ? Number.isFinite(t) ? Math.max(0, t) + "px" : e.sm : Object.hasOwn(e, t) ? e[t] : t;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
h as collectSpaceItems,
|
|
16
|
+
a as spaceGap
|
|
17
|
+
};
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import { defineComponent as _e, useSlots as Te, useAttrs as Be, computed as l, ref as y, watch as V, onMounted as de, onDeactivated as $e, onActivated as we, openBlock as n, createElementBlock as o, mergeProps as ce, unref as g, normalizeClass as pe, renderSlot as h, createCommentVNode as v, createBlock as ze, Teleport as Ve, createVNode as me, Transition as Ce, withCtx as Le, normalizeProps as T, guardReactiveProps as B, createElementVNode as K, normalizeStyle as x, toDisplayString as c, createTextVNode as Pe, Fragment as He, renderList as Ie } from "vue";
|
|
2
|
+
import { useHysRootAttrs as Me } from "../../config.js";
|
|
3
|
+
import { usePageVisibility as De } from "../../composables/usePageVisibility.js";
|
|
4
|
+
import xe from "./SpinGlyph/SpinGlyph.vue.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { useSpinConfig as Ee } from "./spinConfig.js";
|
|
7
|
+
import { spinStyle as Ne, bounded as E } from "./spinStyle.js";
|
|
8
|
+
import { useHysSpinTask as Re, clampSpinProgress as Ae } from "./useHysSpinTask.js";
|
|
9
|
+
import { useSpinVisibility as Oe } from "./useSpinVisibility.js";
|
|
10
|
+
import { useSpinFullscreen as We } from "./useSpinFullscreen.js";
|
|
11
|
+
const je = ["data-mode"], qe = ["inert", "aria-busy"], Fe = ["data-mode", "data-placement", "data-block", "data-mask", "data-motion-off", "data-status", "role", "aria-modal", "aria-label", "tabindex"], Ge = ["data-layout", "data-align"], Ke = ["aria-busy"], Je = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "hys-spin-title"
|
|
14
|
+
}, Qe = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "hys-spin-message"
|
|
17
|
+
}, Ue = {
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "hys-spin-description"
|
|
20
|
+
}, Xe = {
|
|
21
|
+
key: 3,
|
|
22
|
+
class: "hys-spin-description"
|
|
23
|
+
}, Ye = {
|
|
24
|
+
key: 4,
|
|
25
|
+
class: "hys-spin-description"
|
|
26
|
+
}, Ze = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "hys-spin-line",
|
|
29
|
+
"aria-hidden": "true"
|
|
30
|
+
}, ea = {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "hys-spin-segments",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}, aa = {
|
|
35
|
+
key: 2,
|
|
36
|
+
class: "hys-spin-percent"
|
|
37
|
+
}, ta = {
|
|
38
|
+
key: 1,
|
|
39
|
+
class: "hys-spin-actions"
|
|
40
|
+
}, la = ["aria-label", "aria-valuenow"], sa = ["role"], ya = /* @__PURE__ */ _e({
|
|
41
|
+
inheritAttrs: !1,
|
|
42
|
+
__name: "HysSpin",
|
|
43
|
+
props: {
|
|
44
|
+
spinning: { type: Boolean, default: void 0 },
|
|
45
|
+
modelValue: { type: Boolean, default: void 0 },
|
|
46
|
+
defaultSpinning: { type: Boolean, default: void 0 },
|
|
47
|
+
mode: {},
|
|
48
|
+
size: {},
|
|
49
|
+
width: {},
|
|
50
|
+
height: {},
|
|
51
|
+
regionHeight: {},
|
|
52
|
+
delay: {},
|
|
53
|
+
minDuration: {},
|
|
54
|
+
timeout: {},
|
|
55
|
+
autoEnd: {},
|
|
56
|
+
task: {},
|
|
57
|
+
status: {},
|
|
58
|
+
showResult: { type: Boolean, default: void 0 },
|
|
59
|
+
progress: {},
|
|
60
|
+
progressType: {},
|
|
61
|
+
segments: {},
|
|
62
|
+
showPercentage: { type: Boolean, default: void 0 },
|
|
63
|
+
formatProgress: {},
|
|
64
|
+
title: {},
|
|
65
|
+
message: {},
|
|
66
|
+
description: {},
|
|
67
|
+
stage: {},
|
|
68
|
+
remainingTime: {},
|
|
69
|
+
layout: {},
|
|
70
|
+
placement: {},
|
|
71
|
+
align: {},
|
|
72
|
+
gap: {},
|
|
73
|
+
ariaLabel: {},
|
|
74
|
+
mask: { type: Boolean, default: void 0 },
|
|
75
|
+
maskColor: {},
|
|
76
|
+
maskOpacity: {},
|
|
77
|
+
blur: {},
|
|
78
|
+
zIndex: {},
|
|
79
|
+
appendTo: {},
|
|
80
|
+
blockInteraction: { type: Boolean, default: void 0 },
|
|
81
|
+
lockScroll: { type: Boolean, default: void 0 },
|
|
82
|
+
cancellable: { type: Boolean, default: void 0 },
|
|
83
|
+
retryable: { type: Boolean, default: void 0 },
|
|
84
|
+
escapeCancel: { type: Boolean, default: void 0 },
|
|
85
|
+
cancelLabel: {},
|
|
86
|
+
retryLabel: {},
|
|
87
|
+
preset: {},
|
|
88
|
+
animationDelay: {},
|
|
89
|
+
animated: { type: Boolean, default: void 0 },
|
|
90
|
+
paused: { type: Boolean, default: void 0 },
|
|
91
|
+
pauseWhenHidden: { type: Boolean, default: void 0 },
|
|
92
|
+
transitionDuration: {},
|
|
93
|
+
color: {},
|
|
94
|
+
trackColor: {},
|
|
95
|
+
strokeWidth: {},
|
|
96
|
+
dotSize: {},
|
|
97
|
+
dotGap: {},
|
|
98
|
+
colors: {},
|
|
99
|
+
gradient: {},
|
|
100
|
+
indicatorStyle: {},
|
|
101
|
+
messageStyle: {},
|
|
102
|
+
overlayStyle: {},
|
|
103
|
+
animation: {},
|
|
104
|
+
animationName: {},
|
|
105
|
+
speed: {},
|
|
106
|
+
animationDuration: {},
|
|
107
|
+
easing: {},
|
|
108
|
+
direction: {},
|
|
109
|
+
iterations: {},
|
|
110
|
+
angle: {},
|
|
111
|
+
path: {}
|
|
112
|
+
},
|
|
113
|
+
emits: ["update:modelValue", "update:spinning", "change", "start", "end", "show", "hide", "afterHide", "cancel", "timeout", "retry", "error", "success"],
|
|
114
|
+
setup(ye, { expose: ge, emit: fe }) {
|
|
115
|
+
const J = ye, u = fe, he = Te(), Q = Ee(), U = Me(), X = Be(), e = l(() => {
|
|
116
|
+
const a = Q.defaults.value, r = J.preset ?? a.preset;
|
|
117
|
+
return {
|
|
118
|
+
...a,
|
|
119
|
+
...r ? Q.presets.value[r] : {},
|
|
120
|
+
...Object.fromEntries(
|
|
121
|
+
Object.entries(J).filter(([, z]) => z !== void 0)
|
|
122
|
+
)
|
|
123
|
+
};
|
|
124
|
+
}), t = Re(), Y = y(), $ = y(!0), Z = y(!1), ee = y(), i = y({}), C = y(!1), L = y(!1), ae = y(0), ke = De(), k = l(
|
|
125
|
+
() => e.value.mode ?? (he.default ? "container" : "inline")
|
|
126
|
+
), N = l(
|
|
127
|
+
() => ["container", "overlay", "fullscreen"].includes(k.value)
|
|
128
|
+
), p = l(() => k.value === "fullscreen"), be = l(() => e.value.appendTo ?? "body"), P = l(
|
|
129
|
+
() => $.value && (e.value.spinning ?? e.value.modelValue ?? Y.value ?? (e.value.task ? !1 : e.value.defaultSpinning ?? !0))
|
|
130
|
+
), d = l(
|
|
131
|
+
() => e.value.status ?? i.value.status ?? (t.state.value.status === "idle" ? P.value ? "loading" : "idle" : t.state.value.status)
|
|
132
|
+
), m = l(
|
|
133
|
+
() => Ae(
|
|
134
|
+
e.value.progress ?? ("progress" in i.value ? i.value.progress ?? void 0 : t.state.value.progress)
|
|
135
|
+
)
|
|
136
|
+
), w = l(
|
|
137
|
+
() => !["idle", "loading", "retrying"].includes(d.value)
|
|
138
|
+
), s = l(() => ({
|
|
139
|
+
spinning: P.value,
|
|
140
|
+
status: d.value,
|
|
141
|
+
progress: m.value,
|
|
142
|
+
message: e.value.message ?? i.value.message ?? t.state.value.message,
|
|
143
|
+
stage: e.value.stage ?? i.value.stage ?? (t.state.value.spinning ? t.state.value.stage : void 0),
|
|
144
|
+
remainingTime: e.value.remainingTime ?? i.value.remainingTime ?? (t.state.value.spinning ? t.state.value.remainingTime : void 0),
|
|
145
|
+
error: t.state.value.error
|
|
146
|
+
}));
|
|
147
|
+
function R(a) {
|
|
148
|
+
Y.value = a, u("update:modelValue", a), u("update:spinning", a);
|
|
149
|
+
}
|
|
150
|
+
function te() {
|
|
151
|
+
i.value = {}, t.state.value.spinning || t.reset(), R(!0);
|
|
152
|
+
}
|
|
153
|
+
function H() {
|
|
154
|
+
R(!1);
|
|
155
|
+
}
|
|
156
|
+
function A(a) {
|
|
157
|
+
i.value = { ...i.value, ...a };
|
|
158
|
+
}
|
|
159
|
+
function I() {
|
|
160
|
+
t.state.value.spinning ? t.cancel() : (A({ status: "cancelled" }), H(), u("cancel", s.value));
|
|
161
|
+
}
|
|
162
|
+
function O() {
|
|
163
|
+
const a = t.retry();
|
|
164
|
+
return a && (i.value = {}), u("retry", s.value), a;
|
|
165
|
+
}
|
|
166
|
+
function W(a, r) {
|
|
167
|
+
return i.value = {}, t.run(a, { timeout: e.value.timeout, ...r });
|
|
168
|
+
}
|
|
169
|
+
V(() => t.state.value.spinning, R, { flush: "sync" }), V(
|
|
170
|
+
() => t.state.value.status,
|
|
171
|
+
(a) => {
|
|
172
|
+
a === "error" && u("error", t.state.value.error, s.value), a === "success" && u("success", s.value), a === "cancelled" && u("cancel", s.value), a === "timeout" && u("timeout", s.value);
|
|
173
|
+
}
|
|
174
|
+
), V(
|
|
175
|
+
() => e.value.task,
|
|
176
|
+
(a) => {
|
|
177
|
+
!Z.value || !$.value || (a ? W(a).catch(() => {
|
|
178
|
+
}) : t.state.value.spinning && t.cancel());
|
|
179
|
+
}
|
|
180
|
+
), de(() => {
|
|
181
|
+
Z.value = !0, e.value.task && W(e.value.task).catch(() => {
|
|
182
|
+
});
|
|
183
|
+
}), $e(() => {
|
|
184
|
+
$.value = !1, t.reset();
|
|
185
|
+
}), we(() => {
|
|
186
|
+
$.value = !0;
|
|
187
|
+
});
|
|
188
|
+
const j = Oe({
|
|
189
|
+
requested: () => P.value,
|
|
190
|
+
delay: () => e.value.delay,
|
|
191
|
+
minimum: () => e.value.minDuration,
|
|
192
|
+
timeout: () => t.state.value.spinning ? void 0 : e.value.timeout,
|
|
193
|
+
autoEnd: () => e.value.autoEnd,
|
|
194
|
+
start: () => u("start", s.value),
|
|
195
|
+
end: () => u("end", s.value),
|
|
196
|
+
stop(a) {
|
|
197
|
+
a === "timeout" ? (A({ status: "timeout" }), u("timeout", s.value)) : t.state.value.spinning && t.cancel(), H();
|
|
198
|
+
}
|
|
199
|
+
}), M = l(
|
|
200
|
+
() => $.value && (j.value || e.value.showResult && w.value)
|
|
201
|
+
), f = l(() => j.value && !w.value), b = l(
|
|
202
|
+
() => f.value && N.value && e.value.blockInteraction !== !1
|
|
203
|
+
), Se = We(ee, {
|
|
204
|
+
trap: () => p.value && b.value,
|
|
205
|
+
lock: () => p.value && f.value && e.value.lockScroll !== !1,
|
|
206
|
+
zIndex: () => e.value.zIndex ?? 2200,
|
|
207
|
+
escape: () => {
|
|
208
|
+
e.value.escapeCancel && e.value.cancellable && I();
|
|
209
|
+
}
|
|
210
|
+
}), S = l(() => m.value !== void 0), D = l(() => e.value.progressType ?? "ring"), le = l(
|
|
211
|
+
() => {
|
|
212
|
+
var a, r;
|
|
213
|
+
return S.value ? ((r = (a = e.value).formatProgress) == null ? void 0 : r.call(a, m.value)) ?? Math.round(m.value) + "%" : "";
|
|
214
|
+
}
|
|
215
|
+
), _ = l(() => ({
|
|
216
|
+
...s.value,
|
|
217
|
+
visible: M.value === !0,
|
|
218
|
+
percentText: le.value,
|
|
219
|
+
cancel: I,
|
|
220
|
+
retry: O
|
|
221
|
+
})), se = l(
|
|
222
|
+
() => Ne(
|
|
223
|
+
e.value,
|
|
224
|
+
C.value || !!e.value.paused || e.value.pauseWhenHidden !== !1 && ke.value
|
|
225
|
+
)
|
|
226
|
+
), ne = {
|
|
227
|
+
retrying: "正在重试",
|
|
228
|
+
success: "加载完成",
|
|
229
|
+
error: "加载失败",
|
|
230
|
+
cancelled: "已取消加载",
|
|
231
|
+
timeout: "加载超时"
|
|
232
|
+
}, oe = l(
|
|
233
|
+
() => Object.hasOwn(ne, d.value) ? ne[d.value] : void 0
|
|
234
|
+
), q = l(
|
|
235
|
+
() => w.value ? e.value.message ?? i.value.message ?? oe.value ?? s.value.message : s.value.message ?? oe.value
|
|
236
|
+
), F = l(
|
|
237
|
+
() => e.value.ariaLabel || q.value || e.value.title || "正在加载"
|
|
238
|
+
), ue = l(
|
|
239
|
+
() => Math.round(E(e.value.segments, 8, 2, 30))
|
|
240
|
+
);
|
|
241
|
+
V(s, (a) => u("change", a));
|
|
242
|
+
let ie = !1;
|
|
243
|
+
function re() {
|
|
244
|
+
const a = M.value === !0;
|
|
245
|
+
ie !== a && (ie = a, u(a ? "show" : "hide", s.value));
|
|
246
|
+
}
|
|
247
|
+
return V(M, re), de(re), ge({
|
|
248
|
+
show: te,
|
|
249
|
+
hide: H,
|
|
250
|
+
toggle: () => P.value ? H() : te(),
|
|
251
|
+
run: W,
|
|
252
|
+
cancel: I,
|
|
253
|
+
retry: O,
|
|
254
|
+
update: A,
|
|
255
|
+
pause: () => {
|
|
256
|
+
C.value = !0;
|
|
257
|
+
},
|
|
258
|
+
resume: () => {
|
|
259
|
+
C.value = L.value = !1;
|
|
260
|
+
},
|
|
261
|
+
stop: () => {
|
|
262
|
+
L.value = !0;
|
|
263
|
+
},
|
|
264
|
+
restart: () => {
|
|
265
|
+
L.value = C.value = !1, ae.value++;
|
|
266
|
+
},
|
|
267
|
+
clearResult: () => {
|
|
268
|
+
t.state.value.spinning || (t.reset(), i.value = {});
|
|
269
|
+
},
|
|
270
|
+
visible: j,
|
|
271
|
+
snapshot: s
|
|
272
|
+
}), (a, r) => (n(), o("div", ce({ ...g(U), ...g(X) }, {
|
|
273
|
+
class: "hys-ui-spin",
|
|
274
|
+
"data-mode": k.value,
|
|
275
|
+
style: [se.value, g(X).style]
|
|
276
|
+
}), [
|
|
277
|
+
a.$slots.default ? (n(), o("div", {
|
|
278
|
+
key: 0,
|
|
279
|
+
class: pe(["hys-spin-content", {
|
|
280
|
+
"hys-spin-scroll-locked": N.value && !p.value && f.value && e.value.lockScroll
|
|
281
|
+
}]),
|
|
282
|
+
inert: b.value || void 0,
|
|
283
|
+
"aria-busy": f.value || void 0
|
|
284
|
+
}, [
|
|
285
|
+
h(a.$slots, "default", {}, void 0, !0)
|
|
286
|
+
], 10, qe)) : v("", !0),
|
|
287
|
+
(n(), ze(Ve, {
|
|
288
|
+
to: be.value,
|
|
289
|
+
disabled: !p.value
|
|
290
|
+
}, [
|
|
291
|
+
me(Ce, {
|
|
292
|
+
name: "hys-spin-fade",
|
|
293
|
+
appear: "",
|
|
294
|
+
onAfterLeave: r[1] || (r[1] = (z) => u("afterHide", s.value))
|
|
295
|
+
}, {
|
|
296
|
+
default: Le(() => {
|
|
297
|
+
var z;
|
|
298
|
+
return [
|
|
299
|
+
M.value ? (n(), o("div", ce({
|
|
300
|
+
key: 0,
|
|
301
|
+
ref_key: "panel",
|
|
302
|
+
ref: ee
|
|
303
|
+
}, g(U), {
|
|
304
|
+
class: "hys-spin-layer",
|
|
305
|
+
style: [
|
|
306
|
+
se.value,
|
|
307
|
+
{ zIndex: ((z = g(Se)) == null ? void 0 : z.zIndex.value) ?? e.value.zIndex },
|
|
308
|
+
e.value.overlayStyle
|
|
309
|
+
],
|
|
310
|
+
"data-mode": k.value,
|
|
311
|
+
"data-placement": e.value.placement ?? "center",
|
|
312
|
+
"data-block": b.value || void 0,
|
|
313
|
+
"data-mask": N.value && e.value.mask !== !1 || void 0,
|
|
314
|
+
"data-motion-off": L.value || e.value.animated === !1 || void 0,
|
|
315
|
+
"data-status": d.value,
|
|
316
|
+
role: p.value && b.value ? "dialog" : void 0,
|
|
317
|
+
"aria-modal": p.value && b.value || void 0,
|
|
318
|
+
"aria-label": p.value ? F.value : void 0,
|
|
319
|
+
tabindex: p.value && b.value ? -1 : void 0
|
|
320
|
+
}), [
|
|
321
|
+
h(a.$slots, "overlay", T(B(_.value)), () => [
|
|
322
|
+
K("div", {
|
|
323
|
+
class: "hys-spin-indicator",
|
|
324
|
+
"data-layout": e.value.layout ?? (k.value === "inline" || k.value === "indicator" ? "left" : "top"),
|
|
325
|
+
"data-align": e.value.align ?? "center",
|
|
326
|
+
style: x(e.value.indicatorStyle)
|
|
327
|
+
}, [
|
|
328
|
+
D.value === "ring" || !S.value || w.value || a.$slots.indicator || a.$slots.icon ? (n(), o("div", {
|
|
329
|
+
key: ae.value,
|
|
330
|
+
class: pe(["hys-spin-icon", { "hys-spin-custom": e.value.animationName }]),
|
|
331
|
+
"aria-busy": !a.$slots.default && f.value || void 0
|
|
332
|
+
}, [
|
|
333
|
+
h(a.$slots, "indicator", T(B(_.value)), () => [
|
|
334
|
+
h(a.$slots, "icon", T(B(_.value)), () => [
|
|
335
|
+
me(xe, {
|
|
336
|
+
animation: e.value.animation ?? "circle",
|
|
337
|
+
status: d.value,
|
|
338
|
+
progress: D.value === "ring" ? m.value : void 0,
|
|
339
|
+
stroke: g(E)(e.value.strokeWidth, 4, 0.5, 8),
|
|
340
|
+
dot: g(E)(e.value.dotSize, 4, 1, 8),
|
|
341
|
+
spacing: g(E)(e.value.dotGap, 11, 6, 17),
|
|
342
|
+
colors: e.value.colors,
|
|
343
|
+
gradient: e.value.gradient,
|
|
344
|
+
path: e.value.path
|
|
345
|
+
}, null, 8, ["animation", "status", "progress", "stroke", "dot", "spacing", "colors", "gradient", "path"])
|
|
346
|
+
], !0)
|
|
347
|
+
], !0)
|
|
348
|
+
], 10, Ke)) : v("", !0),
|
|
349
|
+
K("div", {
|
|
350
|
+
class: "hys-spin-details",
|
|
351
|
+
style: x(e.value.messageStyle)
|
|
352
|
+
}, [
|
|
353
|
+
e.value.title ? (n(), o("span", Je, c(e.value.title), 1)) : v("", !0),
|
|
354
|
+
q.value || a.$slots.message ? (n(), o("div", Qe, [
|
|
355
|
+
h(a.$slots, "message", T(B(_.value)), () => [
|
|
356
|
+
Pe(c(q.value), 1)
|
|
357
|
+
], !0)
|
|
358
|
+
])) : v("", !0),
|
|
359
|
+
e.value.description ? (n(), o("span", Ue, c(e.value.description), 1)) : v("", !0),
|
|
360
|
+
s.value.stage ? (n(), o("span", Xe, c(s.value.stage), 1)) : v("", !0),
|
|
361
|
+
s.value.remainingTime !== void 0 ? (n(), o("span", Ye, "约剩 " + c(Math.max(0, Math.ceil(s.value.remainingTime / 1e3))) + " 秒", 1)) : v("", !0),
|
|
362
|
+
h(a.$slots, "progress", T(B(_.value)), () => [
|
|
363
|
+
S.value && D.value === "line" ? (n(), o("span", Ze, [
|
|
364
|
+
K("i", {
|
|
365
|
+
style: x({ inlineSize: (m.value ?? 0) + "%" })
|
|
366
|
+
}, null, 4)
|
|
367
|
+
])) : S.value && D.value === "segments" ? (n(), o("span", ea, [
|
|
368
|
+
(n(!0), o(He, null, Ie(ue.value, (G) => (n(), o("i", {
|
|
369
|
+
key: G,
|
|
370
|
+
style: x({
|
|
371
|
+
"--hys-spin-segment-fill": Math.min(
|
|
372
|
+
1,
|
|
373
|
+
Math.max(
|
|
374
|
+
0,
|
|
375
|
+
m.value / 100 * ue.value - G + 1
|
|
376
|
+
)
|
|
377
|
+
) * 100 + "%"
|
|
378
|
+
})
|
|
379
|
+
}, null, 4))), 128))
|
|
380
|
+
])) : v("", !0),
|
|
381
|
+
S.value && e.value.showPercentage !== !1 ? (n(), o("span", aa, c(le.value), 1)) : v("", !0)
|
|
382
|
+
], !0)
|
|
383
|
+
], 4),
|
|
384
|
+
a.$slots.actions || e.value.cancellable && f.value || e.value.retryable && ["error", "timeout", "cancelled"].includes(d.value) ? (n(), o("div", ta, [
|
|
385
|
+
h(a.$slots, "actions", T(B(_.value)), () => [
|
|
386
|
+
e.value.cancellable && f.value ? (n(), o("button", {
|
|
387
|
+
key: 0,
|
|
388
|
+
type: "button",
|
|
389
|
+
onClick: I
|
|
390
|
+
}, c(e.value.cancelLabel ?? "取消加载"), 1)) : e.value.retryable ? (n(), o("button", {
|
|
391
|
+
key: 1,
|
|
392
|
+
type: "button",
|
|
393
|
+
onClick: r[0] || (r[0] = (G) => {
|
|
394
|
+
var ve;
|
|
395
|
+
return (ve = O()) == null ? void 0 : ve.catch(() => {
|
|
396
|
+
});
|
|
397
|
+
})
|
|
398
|
+
}, c(e.value.retryLabel ?? "重试"), 1)) : v("", !0)
|
|
399
|
+
], !0)
|
|
400
|
+
])) : v("", !0)
|
|
401
|
+
], 12, Ge)
|
|
402
|
+
], !0),
|
|
403
|
+
S.value && !w.value ? (n(), o("div", {
|
|
404
|
+
key: 0,
|
|
405
|
+
class: "hys-spin-sr",
|
|
406
|
+
role: "progressbar",
|
|
407
|
+
"aria-label": F.value,
|
|
408
|
+
"aria-valuenow": m.value,
|
|
409
|
+
"aria-valuemin": "0",
|
|
410
|
+
"aria-valuemax": "100"
|
|
411
|
+
}, null, 8, la)) : (n(), o("span", {
|
|
412
|
+
key: 1,
|
|
413
|
+
class: "hys-spin-sr",
|
|
414
|
+
role: d.value === "error" || d.value === "timeout" ? "alert" : "status"
|
|
415
|
+
}, c(F.value), 9, sa))
|
|
416
|
+
], 16, Fe)) : v("", !0)
|
|
417
|
+
];
|
|
418
|
+
}),
|
|
419
|
+
_: 3
|
|
420
|
+
})
|
|
421
|
+
], 8, ["to", "disabled"]))
|
|
422
|
+
], 16, je));
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
export {
|
|
426
|
+
ya as default
|
|
427
|
+
};
|