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,46 @@
|
|
|
1
|
+
import { positiveInteger as h } from "../../composables/dataGrid.js";
|
|
2
|
+
const f = (r) => h(r.minWidth, 80), p = (r) => Math.max(f(r), h(r.maxWidth, 800)), c = (r, e) => Math.max(
|
|
3
|
+
f(r),
|
|
4
|
+
Math.min(p(r), e)
|
|
5
|
+
);
|
|
6
|
+
function x(r, e) {
|
|
7
|
+
const d = [...r.keys()], g = [
|
|
8
|
+
.../* @__PURE__ */ new Set([
|
|
9
|
+
...Array.isArray(e == null ? void 0 : e.order) ? e.order.filter((i) => r.has(i)) : [],
|
|
10
|
+
...d
|
|
11
|
+
])
|
|
12
|
+
], s = [
|
|
13
|
+
...new Set(
|
|
14
|
+
Array.isArray(e == null ? void 0 : e.hidden) ? e.hidden.filter(
|
|
15
|
+
(i) => {
|
|
16
|
+
var n;
|
|
17
|
+
return r.has(i) && ((n = r.get(i)) == null ? void 0 : n.hideable) !== !1;
|
|
18
|
+
}
|
|
19
|
+
) : []
|
|
20
|
+
)
|
|
21
|
+
], m = Object.fromEntries(
|
|
22
|
+
Object.entries((e == null ? void 0 : e.widths) ?? {}).flatMap(([i, n]) => {
|
|
23
|
+
const t = r.get(i);
|
|
24
|
+
return t && typeof n == "number" && Number.isFinite(n) ? [[i, c(t, n)]] : [];
|
|
25
|
+
})
|
|
26
|
+
), b = Object.fromEntries(
|
|
27
|
+
Object.entries((e == null ? void 0 : e.pins) ?? {}).filter(
|
|
28
|
+
([i, n]) => {
|
|
29
|
+
var t;
|
|
30
|
+
return r.has(i) && ((t = r.get(i)) == null ? void 0 : t.pinnable) !== !1 && (n === null || n === "left" || n === "right");
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
return {
|
|
35
|
+
order: g,
|
|
36
|
+
hidden: s.length === d.length ? [] : s,
|
|
37
|
+
widths: m,
|
|
38
|
+
pins: b
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
c as gridBoundColumnWidth,
|
|
43
|
+
p as gridMaxColumnWidth,
|
|
44
|
+
f as gridMinColumnWidth,
|
|
45
|
+
x as normalizeGridColumnLayout
|
|
46
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function c(p, t) {
|
|
2
|
+
var e, r;
|
|
3
|
+
const u = [];
|
|
4
|
+
for (const o of p) {
|
|
5
|
+
const s = t(o), n = u.at(-1);
|
|
6
|
+
n && ((e = n.group) == null ? void 0 : e.key) === ((r = o.group) == null ? void 0 : r.key) && n.pinned === s ? n.columns.push(o) : u.push({
|
|
7
|
+
id: o.key,
|
|
8
|
+
group: o.group,
|
|
9
|
+
columns: [o],
|
|
10
|
+
pinned: s
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return u;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
c as gridHeaderGroups
|
|
17
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useTemplateRef as C, shallowRef as m, nextTick as R } from "vue";
|
|
2
|
+
function A(c) {
|
|
3
|
+
const i = C("gridContextMenu"), r = m(), d = m([]);
|
|
4
|
+
let u = 0;
|
|
5
|
+
async function x(t, e) {
|
|
6
|
+
var h;
|
|
7
|
+
const n = c.config();
|
|
8
|
+
if (e.defaultPrevented || !n || !c.enabled(t)) return;
|
|
9
|
+
const y = c.defaults(t), l = typeof n == "function" ? n(t, y) : y;
|
|
10
|
+
if (!l || !l.some(
|
|
11
|
+
(f) => !f.hidden && f.type !== "divider" && f.type !== "group"
|
|
12
|
+
))
|
|
13
|
+
return;
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
const o = e.currentTarget, s = o.getBoundingClientRect(), a = e instanceof MouseEvent && (e.detail > 0 || e.type === "contextmenu" && (e.button === 2 || e.clientX !== 0 || e.clientY !== 0)), k = a ? e.clientX : s.left + Math.min(s.width / 2, 28), M = a ? e.clientY : s.bottom, g = ++u;
|
|
16
|
+
a && !o.contains(o.ownerDocument.activeElement) && (o.tabIndex >= 0 || o.hasAttribute("tabindex")) && o.focus({ preventScroll: !0 }), r.value = t, d.value = l, await R(), g === u && c.enabled(t) && await ((h = i.value) == null ? void 0 : h.showAt(k, M));
|
|
17
|
+
}
|
|
18
|
+
function b(t, e) {
|
|
19
|
+
(e.key === "ContextMenu" || e.shiftKey && e.key === "F10") && x(t, e);
|
|
20
|
+
}
|
|
21
|
+
function p(t, e) {
|
|
22
|
+
const n = r.value;
|
|
23
|
+
n && c.enabled(n) && c.select(t, n, e);
|
|
24
|
+
}
|
|
25
|
+
function w() {
|
|
26
|
+
var t;
|
|
27
|
+
u++, (t = i.value) != null && t.open && i.value.hide(!1);
|
|
28
|
+
}
|
|
29
|
+
return { items: d, open: x, keydown: b, select: p, close: w };
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
A as useGridContextMenu
|
|
33
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { defineComponent as A, useSlots as N, ref as B, useId as F, computed as S, openBlock as a, createElementBlock as i, mergeProps as d, unref as L, renderSlot as o, createTextVNode as u, toDisplayString as c, createCommentVNode as y, Fragment as M, renderList as W, normalizeStyle as f, createElementVNode as p, normalizeClass as $ } from "vue";
|
|
2
|
+
import { useHysRootAttrs as I } from "../../config.js";
|
|
3
|
+
import { resolveFormGrid as T } from "../../composables/formLayout.js";
|
|
4
|
+
import { useContainerWidth as V } from "../../composables/useContainerWidth.js";
|
|
5
|
+
const D = ["data-layout", "data-size", "data-bordered", "aria-label", "aria-labelledby"], E = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "hys-descriptions-header"
|
|
8
|
+
}, H = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "hys-descriptions-extra"
|
|
11
|
+
}, R = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "hys-descriptions-list"
|
|
14
|
+
}, G = {
|
|
15
|
+
key: 0,
|
|
16
|
+
"aria-hidden": "true"
|
|
17
|
+
}, P = {
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "hys-descriptions-empty"
|
|
20
|
+
}, O = /* @__PURE__ */ A({
|
|
21
|
+
__name: "HysDescriptions",
|
|
22
|
+
props: {
|
|
23
|
+
items: { default: () => [] },
|
|
24
|
+
title: {},
|
|
25
|
+
extra: {},
|
|
26
|
+
columns: { default: () => ({ xs: 1, sm: 2, lg: 3 }) },
|
|
27
|
+
layout: { default: "horizontal" },
|
|
28
|
+
size: { default: "md" },
|
|
29
|
+
bordered: { type: Boolean },
|
|
30
|
+
colon: { type: Boolean },
|
|
31
|
+
labelWidth: {},
|
|
32
|
+
labelAlign: { default: "start" },
|
|
33
|
+
align: { default: "start" },
|
|
34
|
+
labelStyle: {},
|
|
35
|
+
contentStyle: {},
|
|
36
|
+
placeholder: { default: "—" },
|
|
37
|
+
emptyText: { default: "暂无详情" },
|
|
38
|
+
ariaLabel: {}
|
|
39
|
+
},
|
|
40
|
+
setup(l) {
|
|
41
|
+
const h = l, n = N(), v = B(), z = I(), g = F() + "-descriptions-title", C = V(v), m = S(() => T(h.columns, C.value)), b = S(
|
|
42
|
+
() => h.items.filter((e) => !e.hidden).map((e, s) => {
|
|
43
|
+
const t = e.value, r = e.format ? e.format(t, e) : t;
|
|
44
|
+
return {
|
|
45
|
+
item: e,
|
|
46
|
+
index: s,
|
|
47
|
+
value: t,
|
|
48
|
+
text: r == null || r === "" ? h.placeholder : String(r)
|
|
49
|
+
};
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
function k(e) {
|
|
53
|
+
return typeof e != "number" ? e : Number.isFinite(e) ? Math.max(0, e) + "px" : void 0;
|
|
54
|
+
}
|
|
55
|
+
function x(e, s) {
|
|
56
|
+
return Number.isFinite(e) ? Math.min(s, Math.max(1, Math.floor(e))) : 1;
|
|
57
|
+
}
|
|
58
|
+
function w(e) {
|
|
59
|
+
const { item: s } = e, t = x(
|
|
60
|
+
s.span === "full" ? m.value : s.span,
|
|
61
|
+
m.value
|
|
62
|
+
), r = m.value === 1 ? 1 : x(s.rowSpan, b.value.length);
|
|
63
|
+
return {
|
|
64
|
+
gridColumn: "span " + t,
|
|
65
|
+
gridRow: "span " + r,
|
|
66
|
+
"--hys-description-field-label-width": k(s.labelWidth)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return (e, s) => (a(), i("section", d({
|
|
70
|
+
ref_key: "root",
|
|
71
|
+
ref: v
|
|
72
|
+
}, L(z), {
|
|
73
|
+
class: "hys-ui-descriptions",
|
|
74
|
+
"data-layout": l.layout,
|
|
75
|
+
"data-size": l.size,
|
|
76
|
+
"data-bordered": l.bordered || void 0,
|
|
77
|
+
"aria-label": l.ariaLabel,
|
|
78
|
+
"aria-labelledby": !l.ariaLabel && (l.title || n.title) ? g : void 0,
|
|
79
|
+
style: {
|
|
80
|
+
"--hys-descriptions-columns": m.value,
|
|
81
|
+
"--hys-descriptions-label-width": k(l.labelWidth)
|
|
82
|
+
}
|
|
83
|
+
}), [
|
|
84
|
+
l.title || l.extra || n.title || n.extra ? (a(), i("header", E, [
|
|
85
|
+
l.title || n.title ? (a(), i("div", {
|
|
86
|
+
key: 0,
|
|
87
|
+
id: g,
|
|
88
|
+
class: "hys-descriptions-title"
|
|
89
|
+
}, [
|
|
90
|
+
o(e.$slots, "title", {}, () => [
|
|
91
|
+
u(c(l.title), 1)
|
|
92
|
+
], !0)
|
|
93
|
+
])) : y("", !0),
|
|
94
|
+
l.extra || n.extra ? (a(), i("div", H, [
|
|
95
|
+
o(e.$slots, "extra", {}, () => [
|
|
96
|
+
u(c(l.extra), 1)
|
|
97
|
+
], !0)
|
|
98
|
+
])) : y("", !0)
|
|
99
|
+
])) : y("", !0),
|
|
100
|
+
b.value.length ? (a(), i("dl", R, [
|
|
101
|
+
(a(!0), i(M, null, W(b.value, (t) => (a(), i("div", {
|
|
102
|
+
key: t.item.key,
|
|
103
|
+
class: "hys-descriptions-field",
|
|
104
|
+
style: f(w(t))
|
|
105
|
+
}, [
|
|
106
|
+
p("dt", {
|
|
107
|
+
class: $(["hys-descriptions-label", t.item.labelClass]),
|
|
108
|
+
style: f([
|
|
109
|
+
{ textAlign: t.item.labelAlign ?? l.labelAlign },
|
|
110
|
+
l.labelStyle,
|
|
111
|
+
t.item.labelStyle
|
|
112
|
+
])
|
|
113
|
+
}, [
|
|
114
|
+
o(e.$slots, `label-${t.item.key}`, d({ ref_for: !0 }, t), () => [
|
|
115
|
+
o(e.$slots, "label", d({ ref_for: !0 }, t), () => [
|
|
116
|
+
u(c(t.item.label), 1)
|
|
117
|
+
], !0)
|
|
118
|
+
], !0),
|
|
119
|
+
l.colon ? (a(), i("span", G, ":")) : y("", !0)
|
|
120
|
+
], 6),
|
|
121
|
+
p("dd", {
|
|
122
|
+
class: $(["hys-descriptions-value", t.item.contentClass]),
|
|
123
|
+
style: f([
|
|
124
|
+
{ textAlign: t.item.align ?? l.align },
|
|
125
|
+
l.contentStyle,
|
|
126
|
+
t.item.contentStyle
|
|
127
|
+
])
|
|
128
|
+
}, [
|
|
129
|
+
o(e.$slots, `value-${t.item.key}`, d({ ref_for: !0 }, t), () => [
|
|
130
|
+
o(e.$slots, "value", d({ ref_for: !0 }, t), () => [
|
|
131
|
+
u(c(t.text), 1)
|
|
132
|
+
], !0)
|
|
133
|
+
], !0)
|
|
134
|
+
], 6)
|
|
135
|
+
], 4))), 128))
|
|
136
|
+
])) : (a(), i("div", P, [
|
|
137
|
+
o(e.$slots, "empty", {}, () => [
|
|
138
|
+
u(c(l.emptyText), 1)
|
|
139
|
+
], !0)
|
|
140
|
+
]))
|
|
141
|
+
], 16, D));
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
export {
|
|
145
|
+
O as default
|
|
146
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { defineComponent as cl, ref as V, shallowRef as dl, computed as r, provide as vl, watch as Y, nextTick as G, onActivated as fl, onDeactivated as pl, onBeforeUnmount as gl, openBlock as qe, createElementBlock as Ie, mergeProps as ml, unref as bl, withModifiers as Le, createElementVNode as yl, renderSlot as _e, createCommentVNode as hl } from "vue";
|
|
2
2
|
import { formPath as T, formKey as wl, formValue as g, setFormValue as Z, focusHysField as Fl } from "../../composables/formContext.js";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveFormGrid as kl, resolveFormCol as Ml } from "../../composables/formLayout.js";
|
|
4
4
|
import { snapshotForm as d, sameFormValue as H, nestedFormRules as ze, runFormRules as $e } from "../../composables/formValidation.js";
|
|
5
|
-
import { useHysRootAttrs as
|
|
5
|
+
import { useHysRootAttrs as Ol } from "../../config.js";
|
|
6
|
+
import { useContainerWidth as jl } from "../../composables/useContainerWidth.js";
|
|
6
7
|
const Bl = ["aria-busy"], Pl = ["disabled", "inert"], Vl = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "hys-ui-ent-form-actions"
|
|
9
|
-
},
|
|
10
|
+
}, Tl = /* @__PURE__ */ cl({
|
|
10
11
|
__name: "HysForm",
|
|
11
12
|
props: {
|
|
12
13
|
model: {},
|
|
@@ -45,14 +46,14 @@ const Bl = ["aria-busy"], Pl = ["disabled", "inert"], Vl = {
|
|
|
45
46
|
},
|
|
46
47
|
emits: ["submit", "invalid", "reset", "validate", "validation"],
|
|
47
48
|
setup(N, { expose: Ge, emit: He }) {
|
|
48
|
-
const a = N, D = He, Ne =
|
|
49
|
+
const a = N, D = He, Ne = Ol(), ee = V(), v = V({}), f = V({}), p = V({}), M = V(!1), ce = V(!1), E = V(!1), O = V({}), j = V({}), m = dl([]), R = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), de = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map(), le = r(
|
|
49
50
|
() => Object.fromEntries(
|
|
50
51
|
Object.entries(a.rules).map(([e, l]) => [T(e), l])
|
|
51
52
|
)
|
|
52
53
|
), x = r(() => !!(a.disabled || a.loading)), ve = r(
|
|
53
54
|
() => typeof a.labelWidth == "number" ? a.labelWidth + "px" : a.labelWidth
|
|
54
|
-
), te =
|
|
55
|
-
() =>
|
|
55
|
+
), te = jl(ee), we = r(
|
|
56
|
+
() => kl(a.columns, te.value)
|
|
56
57
|
), De = r(
|
|
57
58
|
() => a.layout === "inline" || !a.layout && a.inline
|
|
58
59
|
), ae = r(
|
|
@@ -76,7 +77,7 @@ const Bl = ["aria-busy"], Pl = ["disabled", "inert"], Vl = {
|
|
|
76
77
|
const ke = r(
|
|
77
78
|
() => ve.value === "auto" ? Fe.value : ve.value
|
|
78
79
|
), Je = r(() => {
|
|
79
|
-
const e =
|
|
80
|
+
const e = Ml(a.labelCol, te.value);
|
|
80
81
|
return {
|
|
81
82
|
"--hys-ui-form-label-width": ke.value,
|
|
82
83
|
"--hys-ui-form-columns": we.value,
|
|
@@ -607,5 +608,5 @@ const Bl = ["aria-busy"], Pl = ["disabled", "inert"], Vl = {
|
|
|
607
608
|
}
|
|
608
609
|
});
|
|
609
610
|
export {
|
|
610
|
-
|
|
611
|
+
Tl as default
|
|
611
612
|
};
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { defineComponent as ke, defineAsyncComponent as we, useAttrs as Be, computed as i, ref as d, watch as k, onBeforeUnmount as Oe, onMounted as $e, openBlock as c, createBlock as A, unref as r, mergeProps as ee, withCtx as U, resolveDynamicComponent as Ie, createElementVNode as ae, createVNode as le, Transition as Se, createElementBlock as $, renderSlot as I, normalizeProps as S, guardReactiveProps as x, createCommentVNode as oe, Fragment as xe, renderList as Ce, normalizeStyle as Le, createTextVNode as je, toDisplayString as Ee } from "vue";
|
|
2
|
+
import { useHysRootAttrs as Me } from "../../config.js";
|
|
3
|
+
import { usePageVisibility as Pe } from "../../composables/usePageVisibility.js";
|
|
4
|
+
import ze from "./IconGraphic/IconGraphic.vue.js";
|
|
5
|
+
import Ae from "./IconReferenceGraphic/IconReferenceGraphic.vue.js";
|
|
6
|
+
import De from "./IconTooltip/IconTooltip.vue.js";
|
|
7
|
+
import { useIconConfig as Ne } from "./iconConfig.js";
|
|
8
|
+
import { hysIconRegistry as te } from "./iconRegistry.js";
|
|
9
|
+
import { iconAssetUrl as ie } from "./iconSafety.js";
|
|
10
|
+
import { iconStyle as Ve, iconNumber as Re, iconLength as F } from "./iconStyle.js";
|
|
11
|
+
import { useIconResource as H } from "./useIconResource.js";
|
|
12
|
+
const Te = {
|
|
13
|
+
class: "hys-icon-box",
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
}, Ue = { class: "hys-icon-orientation" }, Fe = { key: 1 }, He = ["data-position", "data-dot"], aa = /* @__PURE__ */ ke({
|
|
16
|
+
inheritAttrs: !1,
|
|
17
|
+
__name: "HysIcon",
|
|
18
|
+
props: {
|
|
19
|
+
name: {},
|
|
20
|
+
source: {},
|
|
21
|
+
variant: {},
|
|
22
|
+
registry: {},
|
|
23
|
+
status: {},
|
|
24
|
+
statusIcons: {},
|
|
25
|
+
fallback: { type: [String, Object, Boolean], default: void 0 },
|
|
26
|
+
loadingIcon: { type: [String, Object, Boolean], default: void 0 },
|
|
27
|
+
size: {},
|
|
28
|
+
width: {},
|
|
29
|
+
height: {},
|
|
30
|
+
fit: {},
|
|
31
|
+
color: {},
|
|
32
|
+
theme: {},
|
|
33
|
+
fill: {},
|
|
34
|
+
stroke: {},
|
|
35
|
+
strokeWidth: {},
|
|
36
|
+
gradient: {},
|
|
37
|
+
opacity: {},
|
|
38
|
+
background: {},
|
|
39
|
+
shape: {},
|
|
40
|
+
radius: {},
|
|
41
|
+
border: {},
|
|
42
|
+
padding: {},
|
|
43
|
+
gap: {},
|
|
44
|
+
shadow: {},
|
|
45
|
+
glow: {},
|
|
46
|
+
rotate: {},
|
|
47
|
+
flipX: { type: Boolean, default: void 0 },
|
|
48
|
+
flipY: { type: Boolean, default: void 0 },
|
|
49
|
+
align: {},
|
|
50
|
+
verticalAlign: {},
|
|
51
|
+
directional: { type: Boolean, default: void 0 },
|
|
52
|
+
animation: {},
|
|
53
|
+
animateOn: {},
|
|
54
|
+
animated: { type: Boolean, default: void 0 },
|
|
55
|
+
paused: { type: Boolean, default: void 0 },
|
|
56
|
+
duration: {},
|
|
57
|
+
speed: {},
|
|
58
|
+
animationDelay: {},
|
|
59
|
+
iterations: {},
|
|
60
|
+
easing: {},
|
|
61
|
+
morphTo: {},
|
|
62
|
+
animationStyle: {},
|
|
63
|
+
decorative: { type: Boolean, default: void 0 },
|
|
64
|
+
label: {},
|
|
65
|
+
clickable: { type: Boolean, default: void 0 },
|
|
66
|
+
href: {},
|
|
67
|
+
target: {},
|
|
68
|
+
rel: {},
|
|
69
|
+
disabled: { type: Boolean, default: void 0 },
|
|
70
|
+
readonly: { type: Boolean, default: void 0 },
|
|
71
|
+
active: { type: Boolean, default: void 0 },
|
|
72
|
+
selected: { type: Boolean, default: void 0 },
|
|
73
|
+
tooltip: {},
|
|
74
|
+
badge: { type: [Number, String, Boolean], default: void 0 },
|
|
75
|
+
badgePosition: {},
|
|
76
|
+
badgeMax: {},
|
|
77
|
+
secondary: {},
|
|
78
|
+
layers: {},
|
|
79
|
+
allowedOrigins: {},
|
|
80
|
+
picker: { type: Boolean, default: void 0 },
|
|
81
|
+
allowUpload: { type: Boolean, default: void 0 },
|
|
82
|
+
storageKey: {},
|
|
83
|
+
pickerLocale: {}
|
|
84
|
+
},
|
|
85
|
+
emits: ["update:name", "update:selected", "change", "statusChange", "load", "error", "click", "dblclick", "mouseenter", "mouseleave", "focus", "blur", "keydown"],
|
|
86
|
+
setup(ne, { expose: ue, emit: re }) {
|
|
87
|
+
const se = we(
|
|
88
|
+
() => import("./IconPickerPanel/IconPickerPanel.vue.js")
|
|
89
|
+
), ve = ne, n = re, K = Ne(), W = Me(), C = Be(), e = i(() => ({
|
|
90
|
+
...K.defaults.value,
|
|
91
|
+
...Object.fromEntries(
|
|
92
|
+
Object.entries(ve).filter(([, a]) => a !== void 0)
|
|
93
|
+
)
|
|
94
|
+
})), f = i(() => e.value.registry ?? K.registry.value), m = d(e.value.name), D = d(), L = d(!1);
|
|
95
|
+
k(
|
|
96
|
+
() => e.value.name,
|
|
97
|
+
(a) => {
|
|
98
|
+
m.value = a;
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
const g = i(() => e.value.status ?? "default"), s = i(() => e.value.variant ?? "outline"), X = {
|
|
102
|
+
loading: "loader",
|
|
103
|
+
success: "success",
|
|
104
|
+
error: "error",
|
|
105
|
+
warning: "warning",
|
|
106
|
+
info: "info"
|
|
107
|
+
}, Y = i(() => {
|
|
108
|
+
const a = e.value.statusIcons, l = g.value;
|
|
109
|
+
return (a && Object.hasOwn(a, l) ? a[l] : void 0) ?? (Object.hasOwn(X, l) ? X[l] : void 0) ?? e.value.source ?? m.value;
|
|
110
|
+
}), N = () => e.value.allowedOrigins, o = H({
|
|
111
|
+
reference: () => Y.value,
|
|
112
|
+
registry: () => f.value,
|
|
113
|
+
variant: () => s.value,
|
|
114
|
+
allowedOrigins: N
|
|
115
|
+
}), de = H({
|
|
116
|
+
reference: () => o.error.value && e.value.fallback !== !1 ? e.value.fallback ?? "help" : void 0,
|
|
117
|
+
registry: () => f.value,
|
|
118
|
+
variant: () => s.value,
|
|
119
|
+
allowedOrigins: N
|
|
120
|
+
}), ce = H({
|
|
121
|
+
reference: () => o.loading.value && e.value.loadingIcon !== !1 ? e.value.loadingIcon ?? "loader" : void 0,
|
|
122
|
+
registry: () => f.value,
|
|
123
|
+
variant: () => s.value,
|
|
124
|
+
allowedOrigins: N
|
|
125
|
+
}), V = d(!1);
|
|
126
|
+
k(
|
|
127
|
+
[
|
|
128
|
+
Y,
|
|
129
|
+
s,
|
|
130
|
+
f,
|
|
131
|
+
() => f.value.revision.value,
|
|
132
|
+
() => e.value.fallback
|
|
133
|
+
],
|
|
134
|
+
() => {
|
|
135
|
+
V.value = !1;
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
const y = i(() => {
|
|
139
|
+
if (o.source.value) return o.source.value;
|
|
140
|
+
if (o.loading.value && e.value.loadingIcon !== !1)
|
|
141
|
+
return ce.source.value ?? te.get("loader");
|
|
142
|
+
if (o.error.value && e.value.fallback !== !1)
|
|
143
|
+
return (V.value ? void 0 : de.source.value) ?? te.get("help");
|
|
144
|
+
}), v = i(() => ({
|
|
145
|
+
name: m.value,
|
|
146
|
+
variant: s.value,
|
|
147
|
+
status: g.value,
|
|
148
|
+
loading: o.loading.value || g.value === "loading",
|
|
149
|
+
source: o.source.value
|
|
150
|
+
})), p = i(() => e.value.href !== void 0), b = i(() => p.value || e.value.clickable), R = i(
|
|
151
|
+
() => e.value.href ? ie(e.value.href, void 0, !0) ?? ie(e.value.href) : void 0
|
|
152
|
+
), h = i(
|
|
153
|
+
() => !!(e.value.disabled || e.value.readonly || p.value && !R.value)
|
|
154
|
+
), w = i(
|
|
155
|
+
() => p.value ? "a" : e.value.clickable ? "button" : "span"
|
|
156
|
+
), j = i(
|
|
157
|
+
() => {
|
|
158
|
+
var a;
|
|
159
|
+
return e.value.label ?? e.value.tooltip ?? (b.value || e.value.decorative === !1 ? [
|
|
160
|
+
((a = o.record.value) == null ? void 0 : a.label) ?? m.value ?? "图标",
|
|
161
|
+
typeof e.value.badge == "number" ? e.value.badge + " 条通知" : ""
|
|
162
|
+
].filter(Boolean).join(",") : void 0);
|
|
163
|
+
}
|
|
164
|
+
), E = i(
|
|
165
|
+
() => e.value.animation ?? (g.value === "loading" || o.loading.value ? "loading" : "none")
|
|
166
|
+
), B = i(() => e.value.animateOn ?? "always"), fe = Pe(), q = d(!1);
|
|
167
|
+
let u;
|
|
168
|
+
const M = () => {
|
|
169
|
+
q.value = !!(u != null && u.matches);
|
|
170
|
+
};
|
|
171
|
+
k([() => e.value.theme, L], ([a, l]) => {
|
|
172
|
+
u == null || u.removeEventListener("change", M), u = void 0, !(a !== "system" || !l || typeof window.matchMedia != "function") && (u = window.matchMedia("(prefers-color-scheme: dark)"), M(), u.addEventListener("change", M));
|
|
173
|
+
}), Oe(() => u == null ? void 0 : u.removeEventListener("change", M));
|
|
174
|
+
const G = i(() => ({
|
|
175
|
+
...W.value,
|
|
176
|
+
"data-hys-theme": e.value.theme === "system" ? q.value ? "dark" : "blue" : e.value.theme ?? W.value["data-hys-theme"]
|
|
177
|
+
})), P = d(!1), z = d(!1), J = d(!1), Q = d(0), ge = i(
|
|
178
|
+
() => Ve(
|
|
179
|
+
e.value,
|
|
180
|
+
E.value,
|
|
181
|
+
P.value || !!e.value.paused || fe.value
|
|
182
|
+
)
|
|
183
|
+
), pe = i(
|
|
184
|
+
() => {
|
|
185
|
+
var a;
|
|
186
|
+
return e.value.directional ?? ((a = o.record.value) == null ? void 0 : a.directional) ?? !1;
|
|
187
|
+
}
|
|
188
|
+
), me = i(() => [
|
|
189
|
+
...e.value.secondary ? [{ icon: e.value.secondary, size: "52%", x: "32%", y: "28%" }] : [],
|
|
190
|
+
...e.value.layers ?? []
|
|
191
|
+
]), T = i(() => {
|
|
192
|
+
const a = e.value.badge, l = Re(e.value.badgeMax, 99, 1, 9999);
|
|
193
|
+
return typeof a == "number" && a > l ? l + "+" : a === !0 ? "" : a;
|
|
194
|
+
});
|
|
195
|
+
function O() {
|
|
196
|
+
J.value = !0, z.value = P.value = !1, Q.value++;
|
|
197
|
+
}
|
|
198
|
+
function Z(a) {
|
|
199
|
+
m.value = a, n("update:name", a);
|
|
200
|
+
}
|
|
201
|
+
function ye(a) {
|
|
202
|
+
if (!b.value || h.value) {
|
|
203
|
+
h.value && a.preventDefault();
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
B.value === "click" && O(), e.value.selected !== void 0 && n("update:selected", !e.value.selected), n("click", a);
|
|
207
|
+
}
|
|
208
|
+
function _(a) {
|
|
209
|
+
n("load", v.value, a);
|
|
210
|
+
}
|
|
211
|
+
function be(a) {
|
|
212
|
+
y.value === o.source.value ? o.fail(a) : V.value = !0;
|
|
213
|
+
}
|
|
214
|
+
return k([m, s, g], () => n("change", v.value)), k(g, (a, l) => {
|
|
215
|
+
n("statusChange", a, l), B.value === "state" && O();
|
|
216
|
+
}), k(
|
|
217
|
+
[() => o.source.value, L],
|
|
218
|
+
([a, l]) => {
|
|
219
|
+
l && a && a.type !== "image" && _();
|
|
220
|
+
},
|
|
221
|
+
{ flush: "post" }
|
|
222
|
+
), k(
|
|
223
|
+
[() => o.error.value, L],
|
|
224
|
+
([a, l]) => {
|
|
225
|
+
l && a && n("error", a, v.value);
|
|
226
|
+
},
|
|
227
|
+
{ flush: "post" }
|
|
228
|
+
), $e(() => {
|
|
229
|
+
L.value = !0, B.value === "state" && g.value !== "default" && O();
|
|
230
|
+
}), ue({
|
|
231
|
+
element: D,
|
|
232
|
+
focus: () => {
|
|
233
|
+
var a;
|
|
234
|
+
return (a = D.value) == null ? void 0 : a.focus();
|
|
235
|
+
},
|
|
236
|
+
select: Z,
|
|
237
|
+
reload: o.reload,
|
|
238
|
+
preload: (a) => f.value.preload(a, s.value, e.value.allowedOrigins),
|
|
239
|
+
play: O,
|
|
240
|
+
restart: O,
|
|
241
|
+
pause: () => {
|
|
242
|
+
P.value = !0;
|
|
243
|
+
},
|
|
244
|
+
resume: () => {
|
|
245
|
+
P.value = z.value = !1;
|
|
246
|
+
},
|
|
247
|
+
stop: () => {
|
|
248
|
+
z.value = !0;
|
|
249
|
+
}
|
|
250
|
+
}), (a, l) => e.value.picker ? (c(), A(r(se), ee({ key: 0 }, { ...G.value, ...r(C) }, {
|
|
251
|
+
name: m.value,
|
|
252
|
+
registry: f.value,
|
|
253
|
+
variant: s.value,
|
|
254
|
+
"allow-upload": e.value.allowUpload,
|
|
255
|
+
"allowed-origins": e.value.allowedOrigins,
|
|
256
|
+
"storage-key": e.value.storageKey,
|
|
257
|
+
locale: e.value.pickerLocale,
|
|
258
|
+
onSelect: Z
|
|
259
|
+
}), null, 16, ["name", "registry", "variant", "allow-upload", "allowed-origins", "storage-key", "locale"])) : (c(), A(De, {
|
|
260
|
+
key: 1,
|
|
261
|
+
text: e.value.tooltip
|
|
262
|
+
}, {
|
|
263
|
+
default: U(() => [
|
|
264
|
+
(c(), A(Ie(w.value), ee({
|
|
265
|
+
ref_key: "element",
|
|
266
|
+
ref: D
|
|
267
|
+
}, { ...G.value, ...r(C) }, {
|
|
268
|
+
class: "hys-ui-icon",
|
|
269
|
+
style: [ge.value, r(C).style],
|
|
270
|
+
type: w.value === "button" ? "button" : void 0,
|
|
271
|
+
disabled: w.value === "button" && !!e.value.disabled || void 0,
|
|
272
|
+
href: p.value && !h.value ? R.value : void 0,
|
|
273
|
+
tabindex: p.value && h.value ? e.value.readonly && !e.value.disabled && R.value ? 0 : -1 : r(C).tabindex,
|
|
274
|
+
target: p.value ? e.value.target : void 0,
|
|
275
|
+
rel: p.value ? e.value.rel ?? (e.value.target === "_blank" ? "noopener noreferrer" : void 0) : void 0,
|
|
276
|
+
role: w.value === "span" && j.value && !e.value.decorative && !a.$slots.default ? "img" : p.value && h.value ? "link" : void 0,
|
|
277
|
+
"aria-hidden": !b.value && !a.$slots.default && (e.value.decorative || !j.value) || void 0,
|
|
278
|
+
"aria-label": b.value || !e.value.decorative ? j.value : void 0,
|
|
279
|
+
"aria-disabled": b.value && h.value || void 0,
|
|
280
|
+
"aria-pressed": w.value === "button" ? e.value.selected : void 0,
|
|
281
|
+
"aria-busy": v.value.loading && !!(b.value || j.value) || void 0,
|
|
282
|
+
"data-status": g.value,
|
|
283
|
+
"data-active": e.value.active || e.value.selected || void 0,
|
|
284
|
+
"data-align": e.value.align,
|
|
285
|
+
"data-directional": pe.value || void 0,
|
|
286
|
+
"data-animation": E.value,
|
|
287
|
+
"data-trigger": B.value,
|
|
288
|
+
"data-played": J.value || void 0,
|
|
289
|
+
"data-off": z.value || e.value.animated === !1 || void 0,
|
|
290
|
+
onClick: ye,
|
|
291
|
+
onDblclick: l[1] || (l[1] = (t) => b.value && !h.value && n("dblclick", t)),
|
|
292
|
+
onMouseenter: l[2] || (l[2] = (t) => n("mouseenter", t)),
|
|
293
|
+
onMouseleave: l[3] || (l[3] = (t) => n("mouseleave", t)),
|
|
294
|
+
onFocus: l[4] || (l[4] = (t) => n("focus", t)),
|
|
295
|
+
onBlur: l[5] || (l[5] = (t) => n("blur", t)),
|
|
296
|
+
onKeydown: l[6] || (l[6] = (t) => n("keydown", t))
|
|
297
|
+
}), {
|
|
298
|
+
default: U(() => [
|
|
299
|
+
ae("span", Te, [
|
|
300
|
+
ae("span", Ue, [
|
|
301
|
+
le(Se, {
|
|
302
|
+
name: "hys-icon-change",
|
|
303
|
+
mode: "out-in",
|
|
304
|
+
css: B.value === "state" && e.value.animated !== !1
|
|
305
|
+
}, {
|
|
306
|
+
default: U(() => [
|
|
307
|
+
(c(), $("span", {
|
|
308
|
+
key: Q.value,
|
|
309
|
+
class: "hys-icon-motion"
|
|
310
|
+
}, [
|
|
311
|
+
r(o).loading.value && a.$slots.loading ? I(a.$slots, "loading", S(x(v.value)), void 0, void 0, 0) : r(o).error.value && a.$slots.fallback ? I(a.$slots, "fallback", S(x(v.value)), void 0, void 0, 1) : I(a.$slots, "icon", S(x(v.value)), () => [
|
|
312
|
+
y.value ? (c(), A(ze, {
|
|
313
|
+
key: y.value.type === "image" ? y.value.src : y.value.type,
|
|
314
|
+
source: y.value,
|
|
315
|
+
variant: s.value,
|
|
316
|
+
fill: e.value.fill,
|
|
317
|
+
stroke: e.value.stroke,
|
|
318
|
+
"stroke-width": e.value.strokeWidth,
|
|
319
|
+
fit: e.value.fit,
|
|
320
|
+
gradient: e.value.gradient,
|
|
321
|
+
"allowed-origins": e.value.allowedOrigins,
|
|
322
|
+
"morph-to": E.value === "morph" ? e.value.morphTo : void 0,
|
|
323
|
+
draw: E.value === "draw",
|
|
324
|
+
onLoad: l[0] || (l[0] = (t) => y.value === r(o).source.value && _(t)),
|
|
325
|
+
onError: be
|
|
326
|
+
}, null, 8, ["source", "variant", "fill", "stroke", "stroke-width", "fit", "gradient", "allowed-origins", "morph-to", "draw"])) : r(o).error.value && e.value.fallback !== !1 ? (c(), $("span", Fe, "?")) : oe("", !0)
|
|
327
|
+
], void 0, 2)
|
|
328
|
+
]))
|
|
329
|
+
]),
|
|
330
|
+
_: 3
|
|
331
|
+
}, 8, ["css"]),
|
|
332
|
+
(c(!0), $(xe, null, Ce(me.value, (t, he) => (c(), $("span", {
|
|
333
|
+
key: he,
|
|
334
|
+
class: "hys-icon-layer",
|
|
335
|
+
style: Le({
|
|
336
|
+
color: t.color,
|
|
337
|
+
"--hys-icon-layer-size": r(F)(t.size) ?? "65%",
|
|
338
|
+
"--hys-icon-layer-x": r(F)(t.x) ?? "0px",
|
|
339
|
+
"--hys-icon-layer-y": r(F)(t.y) ?? "0px",
|
|
340
|
+
"--hys-icon-layer-angle": (t.rotate ?? 0) + "deg"
|
|
341
|
+
})
|
|
342
|
+
}, [
|
|
343
|
+
le(Ae, {
|
|
344
|
+
icon: t.icon,
|
|
345
|
+
registry: f.value,
|
|
346
|
+
variant: s.value,
|
|
347
|
+
"allowed-origins": e.value.allowedOrigins
|
|
348
|
+
}, null, 8, ["icon", "registry", "variant", "allowed-origins"])
|
|
349
|
+
], 4))), 128))
|
|
350
|
+
]),
|
|
351
|
+
a.$slots.badge || T.value !== void 0 && T.value !== !1 ? (c(), $("span", {
|
|
352
|
+
key: 0,
|
|
353
|
+
class: "hys-icon-badge",
|
|
354
|
+
"data-position": e.value.badgePosition ?? "top-end",
|
|
355
|
+
"data-dot": e.value.badge === !0 && !a.$slots.badge || void 0
|
|
356
|
+
}, [
|
|
357
|
+
I(a.$slots, "badge", S(x(v.value)), () => [
|
|
358
|
+
je(Ee(T.value), 1)
|
|
359
|
+
])
|
|
360
|
+
], 8, He)) : oe("", !0)
|
|
361
|
+
]),
|
|
362
|
+
I(a.$slots, "default", S(x(v.value)))
|
|
363
|
+
]),
|
|
364
|
+
_: 3
|
|
365
|
+
}, 16, ["style", "type", "disabled", "href", "tabindex", "target", "rel", "role", "aria-hidden", "aria-label", "aria-disabled", "aria-pressed", "aria-busy", "data-status", "data-active", "data-align", "data-directional", "data-animation", "data-trigger", "data-played", "data-off"]))
|
|
366
|
+
]),
|
|
367
|
+
_: 3
|
|
368
|
+
}, 8, ["text"]));
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
export {
|
|
372
|
+
aa as default
|
|
373
|
+
};
|