hys-ui 0.6.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 +9 -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/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/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/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/composables/formLayout.js +20 -42
- package/dist/composables/popupSurfaceStyle.js +30 -0
- package/dist/composables/useContainerWidth.js +24 -0
- package/dist/composables/useFloating.js +28 -28
- package/dist/composables/usePageVisibility.js +19 -0
- package/dist/composables/usePopupSurface.js +153 -162
- package/dist/composables/usePopupSurfaceInteractions.js +91 -90
- 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 +229 -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/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/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/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/toastPresentation.d.ts +1 -1
- 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/popupSurfaceStyle.d.ts +7 -0
- package/dist/types/composables/table.d.ts +10 -1
- package/dist/types/composables/toastQueue.d.ts +4 -4
- package/dist/types/composables/toastQueueModel.d.ts +2 -2
- 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/usePageVisibility.d.ts +1 -0
- package/dist/types/composables/usePopupSurface.d.ts +9 -3
- package/dist/types/composables/usePopupSurfaceInteractions.d.ts +4 -2
- 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 +30 -2
- 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,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
|
+
};
|