hys-ui 0.6.0 → 0.8.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 +15 -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/HysDatePicker/HysDatePicker.vue.js +102 -48
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +874 -532
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +209 -168
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +102 -48
- 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/datePicker.js +153 -94
- package/dist/composables/datePickerModel.js +156 -0
- package/dist/composables/datePickerPanels.js +78 -0
- package/dist/composables/datePickerRules.js +166 -0
- package/dist/composables/floatingPosition.js +32 -13
- package/dist/composables/formLayout.js +20 -42
- package/dist/composables/popupSurfaceStyle.js +30 -0
- package/dist/composables/useContainerWidth.js +24 -0
- package/dist/composables/useDatePicker.js +274 -381
- package/dist/composables/useFloating.js +42 -41
- 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/HysDatePicker/HysDatePicker.vue.d.ts +6 -9
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +12 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +6 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +6 -9
- 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/datePicker.d.ts +14 -214
- package/dist/types/composables/datePickerModel.d.ts +63 -0
- package/dist/types/composables/datePickerPanels.d.ts +23 -0
- package/dist/types/composables/datePickerRules.d.ts +31 -0
- package/dist/types/composables/datePickerTypes.d.ts +277 -0
- package/dist/types/composables/floatingPosition.d.ts +1 -1
- 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 +2 -4
- package/dist/types/composables/useContainerWidth.d.ts +2 -0
- package/dist/types/composables/useContextMenu.d.ts +2 -4
- package/dist/types/composables/useDatePicker.d.ts +20 -11
- package/dist/types/composables/useFloating.d.ts +4 -5
- 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 +31 -3
- 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,191 @@
|
|
|
1
|
+
const m = /* @__PURE__ */ new Set([
|
|
2
|
+
"g",
|
|
3
|
+
"path",
|
|
4
|
+
"circle",
|
|
5
|
+
"ellipse",
|
|
6
|
+
"rect",
|
|
7
|
+
"line",
|
|
8
|
+
"polyline",
|
|
9
|
+
"polygon",
|
|
10
|
+
"defs",
|
|
11
|
+
"linearGradient",
|
|
12
|
+
"radialGradient",
|
|
13
|
+
"stop",
|
|
14
|
+
"clipPath",
|
|
15
|
+
"mask"
|
|
16
|
+
]), x = /* @__PURE__ */ new Set([
|
|
17
|
+
"id",
|
|
18
|
+
"d",
|
|
19
|
+
"x",
|
|
20
|
+
"y",
|
|
21
|
+
"x1",
|
|
22
|
+
"y1",
|
|
23
|
+
"x2",
|
|
24
|
+
"y2",
|
|
25
|
+
"cx",
|
|
26
|
+
"cy",
|
|
27
|
+
"r",
|
|
28
|
+
"rx",
|
|
29
|
+
"ry",
|
|
30
|
+
"fx",
|
|
31
|
+
"fy",
|
|
32
|
+
"width",
|
|
33
|
+
"height",
|
|
34
|
+
"points",
|
|
35
|
+
"transform",
|
|
36
|
+
"opacity",
|
|
37
|
+
"fill",
|
|
38
|
+
"fill-opacity",
|
|
39
|
+
"fill-rule",
|
|
40
|
+
"stroke",
|
|
41
|
+
"stroke-width",
|
|
42
|
+
"stroke-opacity",
|
|
43
|
+
"stroke-linecap",
|
|
44
|
+
"stroke-linejoin",
|
|
45
|
+
"stroke-miterlimit",
|
|
46
|
+
"stroke-dasharray",
|
|
47
|
+
"stroke-dashoffset",
|
|
48
|
+
"vector-effect",
|
|
49
|
+
"clip-path",
|
|
50
|
+
"clip-rule",
|
|
51
|
+
"mask",
|
|
52
|
+
"gradientUnits",
|
|
53
|
+
"gradientTransform",
|
|
54
|
+
"spreadMethod",
|
|
55
|
+
"offset",
|
|
56
|
+
"stop-color",
|
|
57
|
+
"stop-opacity",
|
|
58
|
+
"maskUnits",
|
|
59
|
+
"maskContentUnits",
|
|
60
|
+
"clipPathUnits",
|
|
61
|
+
"pathLength"
|
|
62
|
+
]), f = /^[A-Za-z_][\w.-]*$/, h = /^url\(#([A-Za-z_][\w.-]*)\)$/, g = /^[^<>\\\x00-\x1f]{0,16000}$/, u = "http://www.w3.org/2000/svg";
|
|
63
|
+
function y(r) {
|
|
64
|
+
const n = r == null ? void 0 : r.trim().split(/[ ,]+/).map(Number);
|
|
65
|
+
return (n == null ? void 0 : n.length) === 4 && n.every(Number.isFinite) && n[2] > 0 && n[3] > 0 ? n.join(" ") : "0 0 24 24";
|
|
66
|
+
}
|
|
67
|
+
function v(r) {
|
|
68
|
+
if (g.test(r))
|
|
69
|
+
return /url\s*\(/i.test(r) ? h.test(r) ? r : void 0 : r;
|
|
70
|
+
}
|
|
71
|
+
function k(r, n) {
|
|
72
|
+
const i = {};
|
|
73
|
+
for (const [t, o] of Object.entries(r ?? {})) {
|
|
74
|
+
if (!x.has(t) || typeof o != "string" && typeof o != "number")
|
|
75
|
+
continue;
|
|
76
|
+
const e = String(o).trim();
|
|
77
|
+
if (g.test(e)) {
|
|
78
|
+
if (t === "id") {
|
|
79
|
+
f.test(e) && (i[t] = n + e);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (/url\s*\(/i.test(e)) {
|
|
83
|
+
const c = h.exec(e);
|
|
84
|
+
c && ["fill", "stroke", "clip-path", "mask"].includes(t) && (i[t] = "url(#" + n + c[1] + ")");
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
(t === "clip-path" || t === "mask") && e !== "none" || (i[t] = e);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return i;
|
|
91
|
+
}
|
|
92
|
+
function w(r, n = "") {
|
|
93
|
+
let i = 500;
|
|
94
|
+
function t(o, e) {
|
|
95
|
+
if (!Array.isArray(o) || e > 15) return [];
|
|
96
|
+
const c = [];
|
|
97
|
+
for (const a of o) {
|
|
98
|
+
if (--i < 0) break;
|
|
99
|
+
!a || !m.has(a.tag) || c.push({
|
|
100
|
+
tag: a.tag,
|
|
101
|
+
attrs: k(a.attrs, n),
|
|
102
|
+
children: t(a.children, e + 1)
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return c;
|
|
106
|
+
}
|
|
107
|
+
return t(r, 0);
|
|
108
|
+
}
|
|
109
|
+
function b(r) {
|
|
110
|
+
var a, p;
|
|
111
|
+
if (typeof DOMParser > "u")
|
|
112
|
+
throw new Error("SVG import requires DOMParser");
|
|
113
|
+
if (r.length > 25e4 || /<!\s*(?:doctype|entity)/i.test(r))
|
|
114
|
+
throw new Error("SVG document is too large or contains a document type");
|
|
115
|
+
const n = new DOMParser().parseFromString(r, "image/svg+xml"), i = n.documentElement;
|
|
116
|
+
if (i.localName !== "svg" || i.namespaceURI && i.namespaceURI !== u || n.querySelector("parsererror"))
|
|
117
|
+
throw new Error("Invalid SVG document");
|
|
118
|
+
let t = 0;
|
|
119
|
+
function o(s, d) {
|
|
120
|
+
if (!(d > 15 || ++t > 500) && !(!m.has(s.localName) || s.namespaceURI && s.namespaceURI !== u))
|
|
121
|
+
return {
|
|
122
|
+
tag: s.localName,
|
|
123
|
+
attrs: Object.fromEntries(
|
|
124
|
+
[...s.attributes].map((l) => [
|
|
125
|
+
l.name,
|
|
126
|
+
l.value
|
|
127
|
+
])
|
|
128
|
+
),
|
|
129
|
+
children: [...s.children].map((l) => o(l, d + 1)).filter((l) => l !== void 0)
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
const e = [...i.children].map((s) => o(s, 1)).filter((s) => s !== void 0), c = w([
|
|
133
|
+
{
|
|
134
|
+
tag: "g",
|
|
135
|
+
attrs: Object.fromEntries(
|
|
136
|
+
[...i.attributes].map((s) => [
|
|
137
|
+
s.name,
|
|
138
|
+
s.value
|
|
139
|
+
])
|
|
140
|
+
),
|
|
141
|
+
children: e
|
|
142
|
+
}
|
|
143
|
+
]);
|
|
144
|
+
if (!((p = (a = c[0]) == null ? void 0 : a.children) != null && p.some((s) => s.tag !== "defs")))
|
|
145
|
+
throw new Error("SVG contains no supported graphics");
|
|
146
|
+
return {
|
|
147
|
+
type: "svg",
|
|
148
|
+
viewBox: y(i.getAttribute("viewBox") ?? void 0),
|
|
149
|
+
nodes: c
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function S(r, n, i = !1) {
|
|
153
|
+
const t = r == null ? void 0 : r.trim();
|
|
154
|
+
if (!(!t || /[\\\x00-\x1f]/.test(t))) {
|
|
155
|
+
if (t.startsWith("#"))
|
|
156
|
+
return i && f.test(t.slice(1)) ? t : void 0;
|
|
157
|
+
try {
|
|
158
|
+
const o = typeof document > "u" ? "https://hys-ui.invalid/" : document.baseURI, e = new URL(t, o);
|
|
159
|
+
return !["https:", "http:"].includes(e.protocol) || e.username || e.password || n && e.origin !== new URL(o).origin && !n.includes(e.origin) || i && !f.test(e.hash.slice(1)) ? void 0 : t;
|
|
160
|
+
} catch {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function U(r, n) {
|
|
166
|
+
if (!r) return;
|
|
167
|
+
const i = [];
|
|
168
|
+
for (const t of r.split(",")) {
|
|
169
|
+
const [o, e, c] = t.trim().split(/\s+/), a = S(o, n);
|
|
170
|
+
if (!a || c || e && !/^\d+(?:\.\d+)?[wx]$/.test(e))
|
|
171
|
+
return;
|
|
172
|
+
i.push(e ? a + " " + e : a);
|
|
173
|
+
}
|
|
174
|
+
return i.join(", ");
|
|
175
|
+
}
|
|
176
|
+
function A(r) {
|
|
177
|
+
const n = (t) => t.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<").replaceAll(">", ">"), i = (t) => {
|
|
178
|
+
const o = Object.entries(t.attrs ?? {}).map(([e, c]) => " " + e + '="' + n(String(c)) + '"').join("");
|
|
179
|
+
return "<" + t.tag + o + ">" + (t.children ?? []).map(i).join("") + "</" + t.tag + ">";
|
|
180
|
+
};
|
|
181
|
+
return '<svg xmlns="' + u + '" viewBox="' + y(r.viewBox) + '" fill="none" stroke="currentColor">' + w(r.nodes).map(i).join("") + "</svg>";
|
|
182
|
+
}
|
|
183
|
+
export {
|
|
184
|
+
S as iconAssetUrl,
|
|
185
|
+
v as iconPaint,
|
|
186
|
+
U as iconSrcset,
|
|
187
|
+
y as iconViewBox,
|
|
188
|
+
b as importHysIconSvg,
|
|
189
|
+
w as sanitizeIconNodes,
|
|
190
|
+
A as serializeHysIconSvg
|
|
191
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const h = {
|
|
2
|
+
xs: 12,
|
|
3
|
+
sm: 16,
|
|
4
|
+
md: 20,
|
|
5
|
+
lg: 28,
|
|
6
|
+
xl: 36
|
|
7
|
+
}, n = (e) => typeof e == "number" && Number.isFinite(e) ? e + "px" : typeof e == "string" ? e : void 0;
|
|
8
|
+
function a(e, i, c, r) {
|
|
9
|
+
return Number.isFinite(e) ? Math.min(r, Math.max(c, e)) : i;
|
|
10
|
+
}
|
|
11
|
+
const y = [
|
|
12
|
+
"none",
|
|
13
|
+
"spin",
|
|
14
|
+
"rotate",
|
|
15
|
+
"pulse",
|
|
16
|
+
"bounce",
|
|
17
|
+
"shake",
|
|
18
|
+
"swing",
|
|
19
|
+
"wiggle",
|
|
20
|
+
"float",
|
|
21
|
+
"breathing",
|
|
22
|
+
"scale",
|
|
23
|
+
"fade",
|
|
24
|
+
"slide",
|
|
25
|
+
"flip",
|
|
26
|
+
"spring",
|
|
27
|
+
"heartbeat",
|
|
28
|
+
"blink",
|
|
29
|
+
"draw",
|
|
30
|
+
"morph",
|
|
31
|
+
"gradient",
|
|
32
|
+
"loading"
|
|
33
|
+
];
|
|
34
|
+
function g(e, i, c) {
|
|
35
|
+
const r = n(
|
|
36
|
+
typeof e.size == "string" && Object.hasOwn(h, e.size) ? h[e.size] : e.size
|
|
37
|
+
) ?? "1em", s = y.includes(i), d = i === "none" ? "none" : s ? "hys-icon-" + i : i, t = a(e.duration, 900, 0, 6e4) / a(e.speed, 1, 0.05, 20), l = typeof e.iterations == "number" ? a(e.iterations, 1, 0, 1e5) : e.iterations ?? (e.animateOn === "click" || e.animateOn === "state" ? 1 : "infinite");
|
|
38
|
+
return {
|
|
39
|
+
"--hys-icon-width": n(e.width) ?? r,
|
|
40
|
+
"--hys-icon-height": n(e.height) ?? r,
|
|
41
|
+
"--hys-icon-font-size": n(e.height) ?? r,
|
|
42
|
+
"--hys-icon-padding": n(e.padding) ?? "0px",
|
|
43
|
+
"--hys-icon-gap": n(e.gap) ?? "6px",
|
|
44
|
+
"--hys-icon-radius": n(e.radius) ?? (e.shape === "circle" ? "50%" : e.shape === "square" ? "0px" : "7px"),
|
|
45
|
+
"--hys-icon-angle": a(e.rotate, 0, -36e3, 36e3) + "deg",
|
|
46
|
+
"--hys-icon-flip-x": e.flipX ? -1 : 1,
|
|
47
|
+
"--hys-icon-flip-y": e.flipY ? -1 : 1,
|
|
48
|
+
"--hys-icon-mirrored-x": e.flipX ? 1 : -1,
|
|
49
|
+
"--hys-icon-animation": d,
|
|
50
|
+
"--hys-icon-duration": t + "ms",
|
|
51
|
+
"--hys-icon-delay": a(e.animationDelay, 0, -6e4, 6e4) + "ms",
|
|
52
|
+
"--hys-icon-ease": e.easing ?? (["spin", "rotate", "loading", "draw"].includes(i) ? "linear" : "ease-in-out"),
|
|
53
|
+
"--hys-icon-repeat": l,
|
|
54
|
+
"--hys-icon-play": c ? "paused" : "running",
|
|
55
|
+
color: e.color,
|
|
56
|
+
opacity: a(e.opacity, 1, 0, 1),
|
|
57
|
+
background: e.background,
|
|
58
|
+
border: e.border,
|
|
59
|
+
boxShadow: e.shadow,
|
|
60
|
+
filter: e.glow ? "drop-shadow(" + e.glow + ")" : void 0,
|
|
61
|
+
verticalAlign: e.verticalAlign,
|
|
62
|
+
...e.animationStyle
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
y as hysIconAnimations,
|
|
67
|
+
n as iconLength,
|
|
68
|
+
a as iconNumber,
|
|
69
|
+
g as iconStyle
|
|
70
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { shallowRef as d, computed as E, watch as R, onMounted as U, onActivated as x, onDeactivated as A, onBeforeUnmount as O } from "vue";
|
|
2
|
+
import { iconAssetUrl as h } from "./iconSafety.js";
|
|
3
|
+
function D(r) {
|
|
4
|
+
const a = d(), u = d(), c = d(!1);
|
|
5
|
+
let i = !1, o = 0;
|
|
6
|
+
const I = E(() => {
|
|
7
|
+
const e = r.registry();
|
|
8
|
+
e.revision.value;
|
|
9
|
+
const t = r.reference();
|
|
10
|
+
return typeof t == "string" ? e.resolve(t) : void 0;
|
|
11
|
+
});
|
|
12
|
+
function g(e) {
|
|
13
|
+
var n;
|
|
14
|
+
const t = (n = r.allowedOrigins) == null ? void 0 : n.call(r);
|
|
15
|
+
if (e.type === "image" && !h(e.src, t) || e.type === "sprite" && !h(e.href, t, !0))
|
|
16
|
+
throw new Error("Icon URL is not allowed");
|
|
17
|
+
a.value = e;
|
|
18
|
+
}
|
|
19
|
+
function f(e) {
|
|
20
|
+
a.value = void 0, u.value = e ?? new Error("Icon failed to load"), c.value = !1;
|
|
21
|
+
}
|
|
22
|
+
function s() {
|
|
23
|
+
const e = ++o;
|
|
24
|
+
u.value = void 0, c.value = !1;
|
|
25
|
+
const t = r.reference();
|
|
26
|
+
if (!t) {
|
|
27
|
+
a.value = void 0;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const n = r.registry(), w = r.variant();
|
|
31
|
+
try {
|
|
32
|
+
const l = typeof t == "string" ? n.get(t, w) : t;
|
|
33
|
+
if (l) {
|
|
34
|
+
g(l);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (a.value = void 0, typeof t != "string" || !n.resolve(t)) {
|
|
38
|
+
f(new Error("Icon not found: " + t));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (c.value = !0, !i) return;
|
|
42
|
+
n.load(t, w).then((v) => {
|
|
43
|
+
e === o && (g(v), c.value = !1);
|
|
44
|
+
}).catch((v) => {
|
|
45
|
+
e === o && f(v);
|
|
46
|
+
});
|
|
47
|
+
} catch (l) {
|
|
48
|
+
f(l);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
R(
|
|
52
|
+
[
|
|
53
|
+
r.reference,
|
|
54
|
+
r.registry,
|
|
55
|
+
() => r.registry().revision.value,
|
|
56
|
+
r.variant,
|
|
57
|
+
() => {
|
|
58
|
+
var e;
|
|
59
|
+
return (e = r.allowedOrigins) == null ? void 0 : e.call(r);
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
s,
|
|
63
|
+
{ immediate: !0 }
|
|
64
|
+
);
|
|
65
|
+
function y() {
|
|
66
|
+
i || (i = !0, s());
|
|
67
|
+
}
|
|
68
|
+
function m() {
|
|
69
|
+
i = !1, o++;
|
|
70
|
+
}
|
|
71
|
+
return U(y), x(y), A(m), O(m), { source: a, loading: c, error: u, record: I, fail: f, reload: s };
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
D as useIconResource
|
|
75
|
+
};
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { defineComponent as le, useSlots as ie, ref as re, computed as s, watch as _, openBlock as u, createElementBlock as x, mergeProps as se, unref as l, createVNode as H, withCtx as T, renderSlot as m, normalizeProps as v, guardReactiveProps as y, createBlock as R, createTextVNode as h, toDisplayString as g, createCommentVNode as C, createElementVNode as P, resolveDynamicComponent as ce, nextTick as W } from "vue";
|
|
2
|
+
import { CircleAlert as ue, TriangleAlert as de, CircleCheck as fe, Info as pe, CircleHelp as me } from "lucide-vue-next";
|
|
3
|
+
import { useHysRootAttrs as ve } from "../../config.js";
|
|
4
|
+
import { useHysControlState as ye } from "../../composables/formContext.js";
|
|
5
|
+
import { usePopupSurface as ge } from "../../composables/usePopupSurface.js";
|
|
6
|
+
import be from "../../internal/PopupReference.js";
|
|
7
|
+
import he from "../../internal/PopupSurfacePanel.vue.js";
|
|
8
|
+
import N from "../HysButton/HysButton.vue.js";
|
|
9
|
+
import { usePopconfirmAction as Ce } from "./usePopconfirmAction.js";
|
|
10
|
+
const we = ["data-external"], Be = ["data-tone"], xe = { class: "hys-popconfirm-body" }, Te = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "hys-popconfirm-icon",
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
}, Pe = { class: "hys-popconfirm-copy" }, ke = ["id"], De = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "hys-popconfirm-error",
|
|
17
|
+
role: "alert"
|
|
18
|
+
}, Ee = ["data-align"], Se = {
|
|
19
|
+
class: "hys-popconfirm-sr",
|
|
20
|
+
role: "status"
|
|
21
|
+
}, Ne = /* @__PURE__ */ le({
|
|
22
|
+
__name: "HysPopconfirm",
|
|
23
|
+
props: {
|
|
24
|
+
trigger: { default: "click" },
|
|
25
|
+
triggerText: { default: "打开确认" },
|
|
26
|
+
title: { default: "确认操作?" },
|
|
27
|
+
description: {},
|
|
28
|
+
tone: { default: "warning" },
|
|
29
|
+
icon: { type: Boolean, default: void 0 },
|
|
30
|
+
showIcon: { type: Boolean, default: !0 },
|
|
31
|
+
confirmText: { default: "确认" },
|
|
32
|
+
cancelText: { default: "取消" },
|
|
33
|
+
pendingText: { default: "处理中…" },
|
|
34
|
+
errorText: {},
|
|
35
|
+
confirmVariant: {},
|
|
36
|
+
cancelVariant: { default: "secondary" },
|
|
37
|
+
size: { default: "sm" },
|
|
38
|
+
align: { default: "end" },
|
|
39
|
+
showCancel: { type: Boolean, default: !0 },
|
|
40
|
+
confirmDisabled: { type: Boolean },
|
|
41
|
+
cancelDisabled: { type: Boolean },
|
|
42
|
+
loading: { type: Boolean },
|
|
43
|
+
allowCancelWhilePending: { type: Boolean },
|
|
44
|
+
dismissWhilePending: { type: Boolean },
|
|
45
|
+
closeOnConfirm: { type: Boolean, default: !0 },
|
|
46
|
+
closeOnCancel: { type: Boolean, default: !0 },
|
|
47
|
+
initialFocus: { default: "cancel" },
|
|
48
|
+
restoreFocus: { type: Boolean, default: !0 },
|
|
49
|
+
beforeConfirm: {},
|
|
50
|
+
beforeCancel: {},
|
|
51
|
+
action: {},
|
|
52
|
+
open: { type: Boolean, default: void 0 },
|
|
53
|
+
modelValue: { type: Boolean, default: void 0 },
|
|
54
|
+
defaultOpen: { type: Boolean },
|
|
55
|
+
disabled: { type: Boolean },
|
|
56
|
+
triggerKeys: {},
|
|
57
|
+
triggerTabindex: {},
|
|
58
|
+
placement: { default: "top" },
|
|
59
|
+
offset: { default: 9 },
|
|
60
|
+
autoAdjustOverflow: { type: Boolean, default: !0 },
|
|
61
|
+
closeOnEscape: { type: Boolean, default: !0 },
|
|
62
|
+
closeOnOutside: { type: Boolean, default: !0 },
|
|
63
|
+
destroyOnHide: { type: Boolean, default: !0 },
|
|
64
|
+
forceRender: { type: Boolean },
|
|
65
|
+
appendTo: { type: [String, Boolean], default: "body" },
|
|
66
|
+
reference: {},
|
|
67
|
+
width: {},
|
|
68
|
+
maxWidth: { default: 360 },
|
|
69
|
+
maxHeight: {},
|
|
70
|
+
showArrow: { type: Boolean, default: !0 },
|
|
71
|
+
arrowOffset: {},
|
|
72
|
+
effect: {},
|
|
73
|
+
color: {},
|
|
74
|
+
textColor: {},
|
|
75
|
+
overlayClass: {},
|
|
76
|
+
overlayStyle: {},
|
|
77
|
+
contentClass: {},
|
|
78
|
+
contentStyle: {},
|
|
79
|
+
zIndex: {},
|
|
80
|
+
ariaLabel: {},
|
|
81
|
+
popupTransition: {},
|
|
82
|
+
popupTransitionDuration: {}
|
|
83
|
+
},
|
|
84
|
+
emits: ["update:open", "update:modelValue", "openChange", "visibleChange", "show", "hide", "opened", "closed", "confirm", "cancel", "dismiss", "error"],
|
|
85
|
+
setup(a, { expose: ee, emit: oe }) {
|
|
86
|
+
const t = a, w = oe, q = ie(), te = ve(), { disabled: k } = ye({
|
|
87
|
+
get disabled() {
|
|
88
|
+
return t.disabled;
|
|
89
|
+
}
|
|
90
|
+
}), d = Ce(), f = re(""), p = s(
|
|
91
|
+
() => d.pending.value ?? (t.loading ? "confirm" : null)
|
|
92
|
+
), b = s(() => p.value !== null), o = ge(
|
|
93
|
+
t,
|
|
94
|
+
"popover",
|
|
95
|
+
(e, ...i) => w(e, ...i),
|
|
96
|
+
{
|
|
97
|
+
allowClose: (e) => e === "programmatic" || e === "anchor" || !b.value || t.dismissWhilePending,
|
|
98
|
+
onDismiss: (e) => {
|
|
99
|
+
e !== "auto" && w("dismiss", e);
|
|
100
|
+
},
|
|
101
|
+
allowTabExit: !0,
|
|
102
|
+
shouldRestoreFocus: () => t.restoreFocus
|
|
103
|
+
}
|
|
104
|
+
), ne = {
|
|
105
|
+
neutral: me,
|
|
106
|
+
info: pe,
|
|
107
|
+
success: fe,
|
|
108
|
+
warning: de,
|
|
109
|
+
danger: ue
|
|
110
|
+
}, K = s(
|
|
111
|
+
() => t.showIcon && (t.icon ?? ne[t.tone])
|
|
112
|
+
), ae = s(
|
|
113
|
+
() => t.confirmVariant ?? (t.tone === "danger" ? "danger" : t.tone === "success" ? "success" : "primary")
|
|
114
|
+
), O = s(
|
|
115
|
+
() => k.value || t.confirmDisabled || b.value
|
|
116
|
+
), V = s(
|
|
117
|
+
() => k.value || t.cancelDisabled || p.value === "cancel" || b.value && !t.allowCancelWhilePending
|
|
118
|
+
), j = s(() => !!(t.title || q.title)), L = s(
|
|
119
|
+
() => !!(t.description || q.description)
|
|
120
|
+
), G = o.id + "-description";
|
|
121
|
+
function z() {
|
|
122
|
+
f.value = "";
|
|
123
|
+
}
|
|
124
|
+
function D() {
|
|
125
|
+
return o.request(!1, t.restoreFocus);
|
|
126
|
+
}
|
|
127
|
+
function J() {
|
|
128
|
+
var e;
|
|
129
|
+
(e = o.panel.value) == null || e.focus({ preventScroll: !0 });
|
|
130
|
+
}
|
|
131
|
+
function M(e) {
|
|
132
|
+
var n, E;
|
|
133
|
+
(E = ((n = o.panel.value) == null ? void 0 : n.querySelector(
|
|
134
|
+
`[data-hys-popconfirm-focus="${e}"]:not(:disabled):not([aria-disabled="true"])`
|
|
135
|
+
)) ?? o.panel.value) == null || E.focus({ preventScroll: !0 });
|
|
136
|
+
}
|
|
137
|
+
let F = !1;
|
|
138
|
+
_(
|
|
139
|
+
[o.open, o.panel, () => o.style.value.visibility],
|
|
140
|
+
([e, i, n]) => {
|
|
141
|
+
if (!e) {
|
|
142
|
+
F = !1;
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
!i || n === "hidden" || F || (F = !0, t.initialFocus === "panel" ? J() : t.initialFocus !== "none" && M(t.initialFocus));
|
|
146
|
+
},
|
|
147
|
+
{ flush: "post" }
|
|
148
|
+
), _(
|
|
149
|
+
o.open,
|
|
150
|
+
(e) => {
|
|
151
|
+
e ? z() : d.abort();
|
|
152
|
+
},
|
|
153
|
+
{ flush: "sync" }
|
|
154
|
+
);
|
|
155
|
+
function Q(e, i) {
|
|
156
|
+
var Z;
|
|
157
|
+
if (!o.open.value || (e === "confirm" ? O.value : V.value))
|
|
158
|
+
return Promise.resolve(!1);
|
|
159
|
+
e === "cancel" && p.value === "confirm" && d.abort();
|
|
160
|
+
const n = document.activeElement, E = !!(n != null && n.matches(`[data-hys-popconfirm-focus="${e}"]`)) && !!((Z = o.panel.value) != null && Z.contains(n)), X = e === "confirm" ? t.beforeConfirm : t.beforeCancel, I = e === "confirm" ? t.action : void 0;
|
|
161
|
+
z();
|
|
162
|
+
const Y = d.run(
|
|
163
|
+
e,
|
|
164
|
+
i,
|
|
165
|
+
async (r) => X && await X(r) === !1 || r.signal.aborted ? !1 : I == null ? void 0 : I(r),
|
|
166
|
+
async (r, B, S) => {
|
|
167
|
+
e === "confirm" ? w("confirm", r, B) : w("cancel", B), (e === "confirm" ? t.closeOnConfirm : t.closeOnCancel) && (await W(), S() && o.open.value && await o.request(
|
|
168
|
+
!1,
|
|
169
|
+
t.restoreFocus,
|
|
170
|
+
"programmatic",
|
|
171
|
+
!1
|
|
172
|
+
));
|
|
173
|
+
},
|
|
174
|
+
(r, B) => {
|
|
175
|
+
const S = e === "confirm" ? "操作失败,请重试。" : "取消失败,请重试。";
|
|
176
|
+
try {
|
|
177
|
+
f.value = (typeof t.errorText == "function" ? t.errorText(r, B) : t.errorText) || S;
|
|
178
|
+
} catch {
|
|
179
|
+
f.value = S;
|
|
180
|
+
}
|
|
181
|
+
w("error", r, B);
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
return E ? (W(() => {
|
|
185
|
+
o.open.value && d.pending.value === e && (document.activeElement === n || document.activeElement === document.body) && J();
|
|
186
|
+
}), Y.then(async (r) => (await W(), o.open.value && !b.value && document.activeElement === o.panel.value && M(e), r))) : Y;
|
|
187
|
+
}
|
|
188
|
+
const $ = (e) => Q("confirm", e), A = (e) => Q("cancel", e), U = () => o.open.value ? D() : o.show(), c = s(() => ({
|
|
189
|
+
...o.scope.value,
|
|
190
|
+
close: D,
|
|
191
|
+
toggle: U,
|
|
192
|
+
confirm: $,
|
|
193
|
+
cancel: A,
|
|
194
|
+
abort: d.abort,
|
|
195
|
+
pending: p.value,
|
|
196
|
+
busy: b.value,
|
|
197
|
+
disabled: k.value,
|
|
198
|
+
confirmDisabled: O.value,
|
|
199
|
+
cancelDisabled: V.value,
|
|
200
|
+
error: f.value
|
|
201
|
+
}));
|
|
202
|
+
return ee({
|
|
203
|
+
element: o.panel,
|
|
204
|
+
referenceElement: o.actualReference,
|
|
205
|
+
open: o.open,
|
|
206
|
+
placement: o.placement,
|
|
207
|
+
show: o.show,
|
|
208
|
+
close: D,
|
|
209
|
+
hide: D,
|
|
210
|
+
toggle: U,
|
|
211
|
+
updatePosition: o.updatePosition,
|
|
212
|
+
focus: o.focus,
|
|
213
|
+
confirm: $,
|
|
214
|
+
cancel: A,
|
|
215
|
+
abort: d.abort,
|
|
216
|
+
pending: p,
|
|
217
|
+
error: f,
|
|
218
|
+
clearError: z
|
|
219
|
+
}), (e, i) => (u(), x("span", se({
|
|
220
|
+
ref: (n) => l(o).wrapper.value = n
|
|
221
|
+
}, { ...l(te), ...l(o).wrapperAttrs.value }, {
|
|
222
|
+
class: "hys-ui-popconfirm",
|
|
223
|
+
"data-external": !!a.reference || void 0,
|
|
224
|
+
onClick: i[1] || (i[1] = //@ts-ignore
|
|
225
|
+
(...n) => l(o).click && l(o).click(...n)),
|
|
226
|
+
onContextmenu: i[2] || (i[2] = //@ts-ignore
|
|
227
|
+
(...n) => l(o).contextmenu && l(o).contextmenu(...n)),
|
|
228
|
+
onKeydown: i[3] || (i[3] = //@ts-ignore
|
|
229
|
+
(...n) => l(o).key && l(o).key(...n))
|
|
230
|
+
}), [
|
|
231
|
+
H(l(be), {
|
|
232
|
+
id: l(o).id,
|
|
233
|
+
open: c.value.open,
|
|
234
|
+
kind: "popover",
|
|
235
|
+
onElement: i[0] || (i[0] = (n) => l(o).referenceElement.value = n)
|
|
236
|
+
}, {
|
|
237
|
+
default: T(() => [
|
|
238
|
+
m(e.$slots, "trigger", v(y(c.value)), () => [
|
|
239
|
+
m(e.$slots, "default", v(y(c.value)), () => [
|
|
240
|
+
a.reference ? C("", !0) : (u(), R(N, {
|
|
241
|
+
key: 0,
|
|
242
|
+
variant: "secondary",
|
|
243
|
+
disabled: l(k)
|
|
244
|
+
}, {
|
|
245
|
+
default: T(() => [
|
|
246
|
+
h(g(a.triggerText), 1)
|
|
247
|
+
]),
|
|
248
|
+
_: 1
|
|
249
|
+
}, 8, ["disabled"]))
|
|
250
|
+
], !0)
|
|
251
|
+
], !0)
|
|
252
|
+
]),
|
|
253
|
+
_: 3
|
|
254
|
+
}, 8, ["id", "open"]),
|
|
255
|
+
H(he, {
|
|
256
|
+
surface: l(o),
|
|
257
|
+
options: t,
|
|
258
|
+
kind: "popover",
|
|
259
|
+
tabindex: -1,
|
|
260
|
+
"labelled-by": j.value ? l(o).titleId : void 0,
|
|
261
|
+
"described-by": L.value ? G : void 0
|
|
262
|
+
}, {
|
|
263
|
+
default: T(() => [
|
|
264
|
+
P("div", {
|
|
265
|
+
class: "hys-popconfirm-layout",
|
|
266
|
+
"data-tone": a.tone
|
|
267
|
+
}, [
|
|
268
|
+
P("div", xe, [
|
|
269
|
+
a.showIcon && (K.value || e.$slots.icon) ? (u(), x("div", Te, [
|
|
270
|
+
m(e.$slots, "icon", v(y(c.value)), () => [
|
|
271
|
+
(u(), R(ce(K.value), { size: 19 }))
|
|
272
|
+
], !0)
|
|
273
|
+
])) : C("", !0),
|
|
274
|
+
P("div", Pe, [
|
|
275
|
+
j.value ? (u(), x("div", {
|
|
276
|
+
key: 0,
|
|
277
|
+
id: l(o).titleId,
|
|
278
|
+
class: "hys-popconfirm-title"
|
|
279
|
+
}, [
|
|
280
|
+
m(e.$slots, "title", v(y(c.value)), () => [
|
|
281
|
+
h(g(a.title), 1)
|
|
282
|
+
], !0)
|
|
283
|
+
], 8, ke)) : C("", !0),
|
|
284
|
+
L.value ? (u(), x("div", {
|
|
285
|
+
key: 1,
|
|
286
|
+
id: G,
|
|
287
|
+
class: "hys-popconfirm-description"
|
|
288
|
+
}, [
|
|
289
|
+
m(e.$slots, "description", v(y(c.value)), () => [
|
|
290
|
+
h(g(a.description), 1)
|
|
291
|
+
], !0)
|
|
292
|
+
])) : C("", !0)
|
|
293
|
+
])
|
|
294
|
+
]),
|
|
295
|
+
f.value ? (u(), x("div", De, [
|
|
296
|
+
m(e.$slots, "error", v(y(c.value)), () => [
|
|
297
|
+
h(g(f.value), 1)
|
|
298
|
+
], !0)
|
|
299
|
+
])) : C("", !0),
|
|
300
|
+
P("div", {
|
|
301
|
+
class: "hys-popconfirm-actions",
|
|
302
|
+
"data-align": a.align
|
|
303
|
+
}, [
|
|
304
|
+
m(e.$slots, "actions", v(y(c.value)), () => [
|
|
305
|
+
a.showCancel ? (u(), R(N, {
|
|
306
|
+
key: 0,
|
|
307
|
+
size: a.size,
|
|
308
|
+
variant: a.cancelVariant,
|
|
309
|
+
disabled: V.value,
|
|
310
|
+
loading: p.value === "cancel",
|
|
311
|
+
"loading-text": a.pendingText,
|
|
312
|
+
"data-hys-popconfirm-focus": "cancel",
|
|
313
|
+
onClick: A
|
|
314
|
+
}, {
|
|
315
|
+
default: T(() => [
|
|
316
|
+
h(g(a.cancelText), 1)
|
|
317
|
+
]),
|
|
318
|
+
_: 1
|
|
319
|
+
}, 8, ["size", "variant", "disabled", "loading", "loading-text"])) : C("", !0),
|
|
320
|
+
H(N, {
|
|
321
|
+
size: a.size,
|
|
322
|
+
variant: ae.value,
|
|
323
|
+
disabled: O.value,
|
|
324
|
+
loading: p.value === "confirm",
|
|
325
|
+
"loading-text": a.pendingText,
|
|
326
|
+
"data-hys-popconfirm-focus": "confirm",
|
|
327
|
+
onClick: $
|
|
328
|
+
}, {
|
|
329
|
+
default: T(() => [
|
|
330
|
+
h(g(a.confirmText), 1)
|
|
331
|
+
]),
|
|
332
|
+
_: 1
|
|
333
|
+
}, 8, ["size", "variant", "disabled", "loading", "loading-text"])
|
|
334
|
+
], !0)
|
|
335
|
+
], 8, Ee),
|
|
336
|
+
P("span", Se, g(b.value ? a.pendingText : ""), 1)
|
|
337
|
+
], 8, Be)
|
|
338
|
+
]),
|
|
339
|
+
_: 3
|
|
340
|
+
}, 8, ["surface", "labelled-by", "described-by"])
|
|
341
|
+
], 16, we));
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
export {
|
|
345
|
+
Ne as default
|
|
346
|
+
};
|