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,147 @@
|
|
|
1
|
+
import { defineComponent as B, computed as b, h as r } from "vue";
|
|
2
|
+
import { useSvgInstanceId as I } from "../../../composables/useSvgInstanceId.js";
|
|
3
|
+
import { sanitizeIconNodes as M, iconPaint as v, iconViewBox as S, iconAssetUrl as x, iconSrcset as T } from "../iconSafety.js";
|
|
4
|
+
const j = /* @__PURE__ */ new Set([
|
|
5
|
+
"path",
|
|
6
|
+
"circle",
|
|
7
|
+
"ellipse",
|
|
8
|
+
"rect",
|
|
9
|
+
"line",
|
|
10
|
+
"polyline",
|
|
11
|
+
"polygon"
|
|
12
|
+
]), O = {
|
|
13
|
+
bold: 2.8,
|
|
14
|
+
thin: 1,
|
|
15
|
+
round: 2.1
|
|
16
|
+
}, q = B({
|
|
17
|
+
name: "HysIconGraphic",
|
|
18
|
+
props: {
|
|
19
|
+
source: { type: Object, required: !0 },
|
|
20
|
+
variant: String,
|
|
21
|
+
fill: String,
|
|
22
|
+
stroke: String,
|
|
23
|
+
strokeWidth: Number,
|
|
24
|
+
fit: String,
|
|
25
|
+
gradient: Array,
|
|
26
|
+
allowedOrigins: Array,
|
|
27
|
+
morphTo: String,
|
|
28
|
+
draw: Boolean
|
|
29
|
+
},
|
|
30
|
+
emits: { load: (e) => !0, error: (e) => !0 },
|
|
31
|
+
setup(e, { emit: g }) {
|
|
32
|
+
const m = I("icon"), A = b(
|
|
33
|
+
() => e.source.type === "svg" ? M(e.source.nodes, m.value + "-node-") : []
|
|
34
|
+
), y = b(
|
|
35
|
+
() => e.fit === "fill" ? "none" : e.fit === "cover" ? "xMidYMid slice" : "xMidYMid meet"
|
|
36
|
+
);
|
|
37
|
+
function k(t, n, a) {
|
|
38
|
+
var s;
|
|
39
|
+
const c = {
|
|
40
|
+
...t.attrs,
|
|
41
|
+
key: n,
|
|
42
|
+
...e.draw && j.has(t.tag) ? { pathLength: 1, "data-hys-icon-draw": "" } : {}
|
|
43
|
+
};
|
|
44
|
+
let o;
|
|
45
|
+
return a.available && t.tag === "path" && typeof ((s = t.attrs) == null ? void 0 : s.d) == "string" && (o = { "--hys-icon-morph-path": 'path("' + e.morphTo + '")' }, a.available = !1), r(
|
|
46
|
+
t.tag,
|
|
47
|
+
{ ...c, style: o, "data-hys-icon-morph-path": o ? "" : void 0 },
|
|
48
|
+
(t.children ?? []).map(
|
|
49
|
+
(d, h) => k(d, h, a)
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
return () => {
|
|
54
|
+
var w;
|
|
55
|
+
const t = e.source, n = {
|
|
56
|
+
class: "hys-icon-graphic",
|
|
57
|
+
"aria-hidden": "true",
|
|
58
|
+
focusable: "false"
|
|
59
|
+
}, a = ((w = e.gradient) == null ? void 0 : w.map((i) => v(i)).filter((i) => i !== void 0)) ?? [], c = m.value + "-tone", o = a.length ? "url(#" + c + ")" : void 0, s = e.stroke && v(e.stroke) || o || "currentColor", d = e.fill && v(e.fill) || "none", h = e.strokeWidth ?? (e.variant && Object.hasOwn(O, e.variant) ? O[e.variant] : 1.8);
|
|
60
|
+
if (t.type === "svg") {
|
|
61
|
+
const i = {
|
|
62
|
+
available: !!e.morphTo && /^[MmLlHhVvCcSsQqTtAaZz0-9+eE.,\s-]{1,16000}$/.test(e.morphTo)
|
|
63
|
+
}, l = a.length ? r("defs", [
|
|
64
|
+
r(
|
|
65
|
+
"linearGradient",
|
|
66
|
+
{ id: c, x2: "1", y2: "1" },
|
|
67
|
+
a.map(
|
|
68
|
+
(u, f) => r("stop", {
|
|
69
|
+
key: f,
|
|
70
|
+
offset: a.length === 1 ? 0 : f / (a.length - 1),
|
|
71
|
+
"stop-color": u
|
|
72
|
+
})
|
|
73
|
+
)
|
|
74
|
+
)
|
|
75
|
+
]) : null;
|
|
76
|
+
return r(
|
|
77
|
+
"svg",
|
|
78
|
+
{
|
|
79
|
+
...n,
|
|
80
|
+
viewBox: S(t.viewBox),
|
|
81
|
+
preserveAspectRatio: y.value,
|
|
82
|
+
fill: d,
|
|
83
|
+
stroke: s,
|
|
84
|
+
"stroke-width": h,
|
|
85
|
+
"stroke-linecap": e.variant === "sharp" ? "square" : "round",
|
|
86
|
+
"stroke-linejoin": e.variant === "sharp" ? "miter" : "round"
|
|
87
|
+
},
|
|
88
|
+
[
|
|
89
|
+
l,
|
|
90
|
+
...A.value.map((u, f) => k(u, f, i))
|
|
91
|
+
]
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
if (t.type === "sprite") {
|
|
95
|
+
const i = x(t.href, e.allowedOrigins, !0);
|
|
96
|
+
return r(
|
|
97
|
+
"svg",
|
|
98
|
+
{
|
|
99
|
+
...n,
|
|
100
|
+
viewBox: S(t.viewBox),
|
|
101
|
+
preserveAspectRatio: y.value,
|
|
102
|
+
fill: e.fill ?? "currentColor",
|
|
103
|
+
stroke: e.stroke
|
|
104
|
+
},
|
|
105
|
+
i ? [r("use", { href: i })] : []
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
if (t.type === "image") {
|
|
109
|
+
const i = x(t.src, e.allowedOrigins);
|
|
110
|
+
return r("img", {
|
|
111
|
+
...n,
|
|
112
|
+
alt: "",
|
|
113
|
+
src: i,
|
|
114
|
+
srcset: T(t.srcset, e.allowedOrigins),
|
|
115
|
+
referrerpolicy: "no-referrer",
|
|
116
|
+
decoding: "async",
|
|
117
|
+
draggable: !1,
|
|
118
|
+
style: { objectFit: e.fit ?? "contain" },
|
|
119
|
+
onLoad: (l) => g("load", l),
|
|
120
|
+
onError: (l) => g("error", l)
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return t.type === "component" ? r(t.component, {
|
|
124
|
+
...t.props,
|
|
125
|
+
...n,
|
|
126
|
+
...e.fill ? { fill: d } : {},
|
|
127
|
+
...e.stroke ? { stroke: s } : {},
|
|
128
|
+
...e.strokeWidth !== void 0 || ["bold", "thin"].includes(e.variant ?? "") ? { "stroke-width": h } : {}
|
|
129
|
+
}) : t.type === "font" ? r(
|
|
130
|
+
"span",
|
|
131
|
+
{
|
|
132
|
+
...n,
|
|
133
|
+
class: [n.class, "hys-icon-character", t.className],
|
|
134
|
+
style: { fontFamily: t.family }
|
|
135
|
+
},
|
|
136
|
+
t.glyph
|
|
137
|
+
) : r(
|
|
138
|
+
"span",
|
|
139
|
+
{ ...n, class: [n.class, "hys-icon-character"] },
|
|
140
|
+
t.text
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
export {
|
|
146
|
+
q as default
|
|
147
|
+
};
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { defineComponent as de, computed as y, ref as v, watch as x, onMounted as ye, onBeforeUnmount as ge, openBlock as r, createElementBlock as s, createElementVNode as t, createVNode as h, unref as V, withDirectives as D, vModelText as me, toDisplayString as n, Fragment as z, renderList as U, vModelSelect as G, createTextVNode as j, createCommentVNode as f, nextTick as fe } from "vue";
|
|
2
|
+
import { Search as he, Upload as be, ChevronLeft as ke, ChevronRight as we, Star as _e, Copy as Se } from "lucide-vue-next";
|
|
3
|
+
import ee from "../IconReferenceGraphic/IconReferenceGraphic.vue.js";
|
|
4
|
+
import { serializeHysIconSvg as Ce, importHysIconSvg as xe } from "../iconSafety.js";
|
|
5
|
+
import { useIconResource as Ve } from "../useIconResource.js";
|
|
6
|
+
const ze = { class: "hys-icon-picker-filters" }, Ue = { class: "hys-icon-picker-search" }, Ae = ["aria-label", "placeholder"], Ie = ["aria-label"], Oe = { value: "" }, $e = ["aria-label"], Fe = { value: "" }, Me = ["aria-label"], Ne = { value: "" }, Ke = { class: "hys-icon-picker-toolbar" }, Re = ["aria-pressed", "onClick"], De = { class: "hys-icon-picker-main" }, Te = ["aria-label"], Ee = ["tabindex", "aria-selected", "aria-label", "title", "onFocus", "onClick"], He = { class: "hys-icon-picker-glyph" }, Le = { class: "hys-icon-picker-label" }, Be = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "hys-icon-picker-empty"
|
|
9
|
+
}, Ge = {
|
|
10
|
+
key: 2,
|
|
11
|
+
class: "hys-icon-picker-pages",
|
|
12
|
+
"aria-label": "图标分页"
|
|
13
|
+
}, qe = ["aria-label", "disabled"], Je = ["aria-label", "disabled"], Pe = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "hys-icon-picker-detail"
|
|
16
|
+
}, je = { class: "hys-icon-picker-preview" }, We = { class: "hys-icon-picker-large" }, Qe = ["aria-label", "aria-pressed"], Xe = { key: 0 }, Ye = { key: 1 }, Ze = ["aria-label"], ea = { value: "" }, aa = { class: "hys-icon-picker-actions" }, la = { key: 2 }, ta = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "hys-icon-picker-feedback",
|
|
19
|
+
"aria-live": "polite"
|
|
20
|
+
}, ua = /* @__PURE__ */ de({
|
|
21
|
+
__name: "IconPickerPanel",
|
|
22
|
+
props: {
|
|
23
|
+
name: {},
|
|
24
|
+
registry: {},
|
|
25
|
+
variant: {},
|
|
26
|
+
allowUpload: { type: Boolean },
|
|
27
|
+
storageKey: {},
|
|
28
|
+
allowedOrigins: {},
|
|
29
|
+
locale: {}
|
|
30
|
+
},
|
|
31
|
+
emits: ["select"],
|
|
32
|
+
setup(b, { emit: ae }) {
|
|
33
|
+
const u = b, le = ae, o = y(() => ({
|
|
34
|
+
search: "搜索名称或关键词",
|
|
35
|
+
library: "图标库",
|
|
36
|
+
category: "分类",
|
|
37
|
+
variant: "风格",
|
|
38
|
+
all: "全部",
|
|
39
|
+
favorites: "收藏",
|
|
40
|
+
recent: "最近使用",
|
|
41
|
+
popular: "常用",
|
|
42
|
+
empty: "没有符合条件的图标",
|
|
43
|
+
previous: "上一页",
|
|
44
|
+
next: "下一页",
|
|
45
|
+
addFavorite: "收藏图标",
|
|
46
|
+
removeFavorite: "取消收藏",
|
|
47
|
+
copyName: "复制名称",
|
|
48
|
+
copyCode: "复制组件代码",
|
|
49
|
+
copySvg: "复制 SVG",
|
|
50
|
+
copied: "已复制",
|
|
51
|
+
copyFailed: "无法复制,请检查浏览器剪贴板权限",
|
|
52
|
+
upload: "导入 SVG",
|
|
53
|
+
imported: (a) => "已导入 " + a + " 个图标",
|
|
54
|
+
...u.locale
|
|
55
|
+
})), W = v(), Q = v(), A = v(""), I = v(""), O = v(""), k = v(""), p = v(1), m = v(0), w = v("all"), d = v([]), _ = v([]), $ = v(""), F = v(42);
|
|
56
|
+
let M;
|
|
57
|
+
const te = [
|
|
58
|
+
"core:search",
|
|
59
|
+
"core:plus",
|
|
60
|
+
"core:check",
|
|
61
|
+
"core:close",
|
|
62
|
+
"core:arrow-right",
|
|
63
|
+
"core:folder",
|
|
64
|
+
"core:settings",
|
|
65
|
+
"core:star",
|
|
66
|
+
"core:refresh",
|
|
67
|
+
"core:download"
|
|
68
|
+
];
|
|
69
|
+
let N = !1;
|
|
70
|
+
const q = y(() => (u.registry.revision.value, u.registry.list())), oe = y(() => [
|
|
71
|
+
...new Set(q.value.map((a) => a.namespace))
|
|
72
|
+
]), ne = y(() => [
|
|
73
|
+
...new Set(q.value.map((a) => a.category))
|
|
74
|
+
]), ie = y(() => [
|
|
75
|
+
...new Set(q.value.flatMap((a) => [...a.variants]))
|
|
76
|
+
]), X = y(() => {
|
|
77
|
+
u.registry.revision.value;
|
|
78
|
+
const a = u.registry.search(A.value, {
|
|
79
|
+
namespace: I.value,
|
|
80
|
+
category: O.value,
|
|
81
|
+
variant: k.value
|
|
82
|
+
});
|
|
83
|
+
if (w.value === "all") return a;
|
|
84
|
+
const l = w.value === "popular" ? te : w.value === "favorites" ? d.value : _.value, e = new Map(a.map((i) => [i.name, i]));
|
|
85
|
+
return l.map((i) => e.get(i)).filter((i) => i !== void 0);
|
|
86
|
+
}), T = y(
|
|
87
|
+
() => Math.max(1, Math.ceil(X.value.length / F.value))
|
|
88
|
+
), K = y(
|
|
89
|
+
() => X.value.slice(
|
|
90
|
+
(p.value - 1) * F.value,
|
|
91
|
+
p.value * F.value
|
|
92
|
+
)
|
|
93
|
+
), c = y(() => (u.registry.revision.value, u.name ? u.registry.resolve(u.name) : void 0)), E = v(""), H = y(
|
|
94
|
+
() => E.value || k.value || u.variant || "outline"
|
|
95
|
+
), Y = Ve({
|
|
96
|
+
reference: () => {
|
|
97
|
+
var a;
|
|
98
|
+
return (a = c.value) == null ? void 0 : a.name;
|
|
99
|
+
},
|
|
100
|
+
registry: () => u.registry,
|
|
101
|
+
variant: () => H.value,
|
|
102
|
+
allowedOrigins: () => u.allowedOrigins
|
|
103
|
+
}), L = y(
|
|
104
|
+
() => {
|
|
105
|
+
var a;
|
|
106
|
+
return ((a = Y.source.value) == null ? void 0 : a.type) === "svg" ? Ce(Y.source.value) : void 0;
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
x([A, I, O, k, w], () => {
|
|
110
|
+
p.value = 1, m.value = 0;
|
|
111
|
+
}), x(T, (a) => {
|
|
112
|
+
p.value > a && (p.value = a);
|
|
113
|
+
}), x(c, () => {
|
|
114
|
+
E.value = "";
|
|
115
|
+
}), x(p, () => {
|
|
116
|
+
m.value = 0;
|
|
117
|
+
}), x(
|
|
118
|
+
F,
|
|
119
|
+
(a, l) => {
|
|
120
|
+
p.value = Math.floor((p.value - 1) * l / a) + 1, m.value = 0;
|
|
121
|
+
},
|
|
122
|
+
{ flush: "sync" }
|
|
123
|
+
);
|
|
124
|
+
function re(a, l) {
|
|
125
|
+
m.value = l, _.value = [
|
|
126
|
+
a.name,
|
|
127
|
+
..._.value.filter((e) => e !== a.name)
|
|
128
|
+
].slice(0, 32), le("select", a.name);
|
|
129
|
+
}
|
|
130
|
+
function se(a) {
|
|
131
|
+
d.value = d.value.includes(a) ? d.value.filter((l) => l !== a) : [...d.value, a].slice(-150);
|
|
132
|
+
}
|
|
133
|
+
function ue(a) {
|
|
134
|
+
if (![
|
|
135
|
+
"ArrowLeft",
|
|
136
|
+
"ArrowRight",
|
|
137
|
+
"ArrowUp",
|
|
138
|
+
"ArrowDown",
|
|
139
|
+
"Home",
|
|
140
|
+
"End"
|
|
141
|
+
].includes(a.key) || !K.value.length)
|
|
142
|
+
return;
|
|
143
|
+
const l = a.currentTarget, e = getComputedStyle(l).gridTemplateColumns.split(/\s+/).length || 1, i = getComputedStyle(l).direction === "rtl", g = {
|
|
144
|
+
ArrowLeft: i ? 1 : -1,
|
|
145
|
+
ArrowRight: i ? -1 : 1,
|
|
146
|
+
ArrowUp: -e,
|
|
147
|
+
ArrowDown: e
|
|
148
|
+
}, S = a.key === "Home" ? 0 : a.key === "End" ? K.value.length - 1 : m.value + (g[a.key] ?? 0);
|
|
149
|
+
m.value = Math.min(K.value.length - 1, Math.max(0, S)), a.preventDefault(), fe(
|
|
150
|
+
() => {
|
|
151
|
+
var R;
|
|
152
|
+
return (R = l.querySelectorAll(".hys-icon-picker-tile")[m.value]) == null ? void 0 : R.focus();
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
async function J(a) {
|
|
157
|
+
try {
|
|
158
|
+
await navigator.clipboard.writeText(a), $.value = o.value.copied;
|
|
159
|
+
} catch {
|
|
160
|
+
$.value = o.value.copyFailed;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function ce() {
|
|
164
|
+
c.value && J(
|
|
165
|
+
'<HysIcon name="' + c.value.name + '" variant="' + H.value.replace(/[^\w-]/g, "") + '" />'
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
function Z() {
|
|
169
|
+
if (d.value = [], _.value = [], !(!N || !u.storageKey))
|
|
170
|
+
try {
|
|
171
|
+
const a = JSON.parse(localStorage.getItem(u.storageKey) ?? "{}"), l = (e, i) => Array.isArray(e) ? e.filter((g) => typeof g == "string").slice(0, i) : [];
|
|
172
|
+
d.value = l(a.favorites, 150), _.value = l(a.recent, 32);
|
|
173
|
+
} catch {
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
x([d, _], () => {
|
|
177
|
+
if (!(!N || !u.storageKey))
|
|
178
|
+
try {
|
|
179
|
+
localStorage.setItem(
|
|
180
|
+
u.storageKey,
|
|
181
|
+
JSON.stringify({ favorites: d.value, recent: _.value })
|
|
182
|
+
);
|
|
183
|
+
} catch {
|
|
184
|
+
}
|
|
185
|
+
}), x(() => u.storageKey, Z);
|
|
186
|
+
async function ve(a) {
|
|
187
|
+
const l = a.target, e = [...l.files ?? []].slice(0, 32);
|
|
188
|
+
l.value = "";
|
|
189
|
+
const i = [];
|
|
190
|
+
let g = 0;
|
|
191
|
+
for (const C of e)
|
|
192
|
+
try {
|
|
193
|
+
if (C.size > 25e4) throw new Error("SVG is too large");
|
|
194
|
+
const P = C.name.replace(/\.svg$/i, "").toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^[^a-z0-9]+/, "").slice(0, 80) || "icon";
|
|
195
|
+
i.push({
|
|
196
|
+
base: P,
|
|
197
|
+
entry: {
|
|
198
|
+
source: xe(await C.text()),
|
|
199
|
+
label: C.name,
|
|
200
|
+
category: "导入"
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
} catch {
|
|
204
|
+
g++;
|
|
205
|
+
}
|
|
206
|
+
if (!N) return;
|
|
207
|
+
const S = /* @__PURE__ */ Object.create(null);
|
|
208
|
+
for (const { base: C, entry: P } of i) {
|
|
209
|
+
let B = C, pe = 2;
|
|
210
|
+
for (; S[B] || u.registry.resolve("uploads:" + B); )
|
|
211
|
+
B = C + "-" + pe++;
|
|
212
|
+
S[B] = P;
|
|
213
|
+
}
|
|
214
|
+
const R = i.length;
|
|
215
|
+
R && (u.registry.register({
|
|
216
|
+
namespace: "uploads",
|
|
217
|
+
icons: S,
|
|
218
|
+
version: (/* @__PURE__ */ new Date()).toISOString()
|
|
219
|
+
}), A.value = O.value = k.value = "", w.value = "all", I.value = "uploads"), $.value = o.value.imported(R) + (g ? "," + g + " 个文件无法导入" : "");
|
|
220
|
+
}
|
|
221
|
+
return ye(() => {
|
|
222
|
+
N = !0, Z();
|
|
223
|
+
const a = W.value;
|
|
224
|
+
if (a) {
|
|
225
|
+
const l = (e) => {
|
|
226
|
+
F.value = e < 460 ? 9 : 42;
|
|
227
|
+
};
|
|
228
|
+
l(a.clientWidth), typeof ResizeObserver < "u" && (M = new ResizeObserver(
|
|
229
|
+
([e]) => l(e.contentRect.width)
|
|
230
|
+
), M.observe(a));
|
|
231
|
+
}
|
|
232
|
+
}), ge(() => {
|
|
233
|
+
N = !1, M == null || M.disconnect();
|
|
234
|
+
}), (a, l) => (r(), s("div", {
|
|
235
|
+
ref_key: "root",
|
|
236
|
+
ref: W,
|
|
237
|
+
class: "hys-icon-picker"
|
|
238
|
+
}, [
|
|
239
|
+
t("div", ze, [
|
|
240
|
+
t("label", Ue, [
|
|
241
|
+
h(V(he), {
|
|
242
|
+
size: 16,
|
|
243
|
+
"aria-hidden": "true"
|
|
244
|
+
}),
|
|
245
|
+
D(t("input", {
|
|
246
|
+
"onUpdate:modelValue": l[0] || (l[0] = (e) => A.value = e),
|
|
247
|
+
type: "search",
|
|
248
|
+
"aria-label": o.value.search,
|
|
249
|
+
placeholder: o.value.search
|
|
250
|
+
}, null, 8, Ae), [
|
|
251
|
+
[me, A.value]
|
|
252
|
+
])
|
|
253
|
+
]),
|
|
254
|
+
t("label", null, [
|
|
255
|
+
t("span", null, n(o.value.library), 1),
|
|
256
|
+
D(t("select", {
|
|
257
|
+
"onUpdate:modelValue": l[1] || (l[1] = (e) => I.value = e),
|
|
258
|
+
"aria-label": o.value.library
|
|
259
|
+
}, [
|
|
260
|
+
t("option", Oe, n(o.value.all), 1),
|
|
261
|
+
(r(!0), s(z, null, U(oe.value, (e) => (r(), s("option", { key: e }, n(e), 1))), 128))
|
|
262
|
+
], 8, Ie), [
|
|
263
|
+
[G, I.value]
|
|
264
|
+
])
|
|
265
|
+
]),
|
|
266
|
+
t("label", null, [
|
|
267
|
+
t("span", null, n(o.value.category), 1),
|
|
268
|
+
D(t("select", {
|
|
269
|
+
"onUpdate:modelValue": l[2] || (l[2] = (e) => O.value = e),
|
|
270
|
+
"aria-label": o.value.category
|
|
271
|
+
}, [
|
|
272
|
+
t("option", Fe, n(o.value.all), 1),
|
|
273
|
+
(r(!0), s(z, null, U(ne.value, (e) => (r(), s("option", { key: e }, n(e), 1))), 128))
|
|
274
|
+
], 8, $e), [
|
|
275
|
+
[G, O.value]
|
|
276
|
+
])
|
|
277
|
+
]),
|
|
278
|
+
t("label", null, [
|
|
279
|
+
t("span", null, n(o.value.variant), 1),
|
|
280
|
+
D(t("select", {
|
|
281
|
+
"onUpdate:modelValue": l[3] || (l[3] = (e) => k.value = e),
|
|
282
|
+
"aria-label": o.value.variant
|
|
283
|
+
}, [
|
|
284
|
+
t("option", Ne, n(o.value.all), 1),
|
|
285
|
+
(r(!0), s(z, null, U(ie.value, (e) => (r(), s("option", { key: e }, n(e), 1))), 128))
|
|
286
|
+
], 8, Me), [
|
|
287
|
+
[G, k.value]
|
|
288
|
+
])
|
|
289
|
+
])
|
|
290
|
+
]),
|
|
291
|
+
t("div", Ke, [
|
|
292
|
+
(r(), s(z, null, U(["all", "popular", "favorites", "recent"], (e) => t("button", {
|
|
293
|
+
key: e,
|
|
294
|
+
type: "button",
|
|
295
|
+
"aria-pressed": w.value === e,
|
|
296
|
+
onClick: (i) => w.value = e
|
|
297
|
+
}, n(o.value[e]), 9, Re)), 64)),
|
|
298
|
+
b.allowUpload ? (r(), s("button", {
|
|
299
|
+
key: 0,
|
|
300
|
+
type: "button",
|
|
301
|
+
class: "hys-icon-picker-upload",
|
|
302
|
+
onClick: l[4] || (l[4] = (e) => {
|
|
303
|
+
var i;
|
|
304
|
+
return (i = Q.value) == null ? void 0 : i.click();
|
|
305
|
+
})
|
|
306
|
+
}, [
|
|
307
|
+
h(V(be), { size: 15 }),
|
|
308
|
+
j(n(o.value.upload), 1)
|
|
309
|
+
])) : f("", !0),
|
|
310
|
+
b.allowUpload ? (r(), s("input", {
|
|
311
|
+
key: 1,
|
|
312
|
+
ref_key: "fileInput",
|
|
313
|
+
ref: Q,
|
|
314
|
+
hidden: "",
|
|
315
|
+
type: "file",
|
|
316
|
+
accept: ".svg,image/svg+xml",
|
|
317
|
+
multiple: "",
|
|
318
|
+
onChange: ve
|
|
319
|
+
}, null, 544)) : f("", !0)
|
|
320
|
+
]),
|
|
321
|
+
t("div", De, [
|
|
322
|
+
t("div", null, [
|
|
323
|
+
K.value.length ? (r(), s("div", {
|
|
324
|
+
key: 0,
|
|
325
|
+
class: "hys-icon-picker-grid",
|
|
326
|
+
role: "listbox",
|
|
327
|
+
"aria-label": o.value.library,
|
|
328
|
+
onKeydown: ue
|
|
329
|
+
}, [
|
|
330
|
+
(r(!0), s(z, null, U(K.value, (e, i) => {
|
|
331
|
+
var g;
|
|
332
|
+
return r(), s("button", {
|
|
333
|
+
key: e.name,
|
|
334
|
+
class: "hys-icon-picker-tile",
|
|
335
|
+
role: "option",
|
|
336
|
+
type: "button",
|
|
337
|
+
tabindex: i === m.value ? 0 : -1,
|
|
338
|
+
"aria-selected": ((g = c.value) == null ? void 0 : g.name) === e.name,
|
|
339
|
+
"aria-label": e.label + " " + e.name,
|
|
340
|
+
title: e.name,
|
|
341
|
+
onFocus: (S) => m.value = i,
|
|
342
|
+
onClick: (S) => re(e, i)
|
|
343
|
+
}, [
|
|
344
|
+
t("span", He, [
|
|
345
|
+
h(ee, {
|
|
346
|
+
icon: e.name,
|
|
347
|
+
registry: b.registry,
|
|
348
|
+
variant: k.value || u.variant,
|
|
349
|
+
"allowed-origins": b.allowedOrigins
|
|
350
|
+
}, null, 8, ["icon", "registry", "variant", "allowed-origins"])
|
|
351
|
+
]),
|
|
352
|
+
t("span", Le, n(e.label), 1)
|
|
353
|
+
], 40, Ee);
|
|
354
|
+
}), 128))
|
|
355
|
+
], 40, Te)) : (r(), s("p", Be, n(o.value.empty), 1)),
|
|
356
|
+
T.value > 1 ? (r(), s("nav", Ge, [
|
|
357
|
+
t("button", {
|
|
358
|
+
type: "button",
|
|
359
|
+
"aria-label": o.value.previous,
|
|
360
|
+
disabled: p.value === 1,
|
|
361
|
+
onClick: l[5] || (l[5] = (e) => p.value--)
|
|
362
|
+
}, [
|
|
363
|
+
h(V(ke), { size: 16 })
|
|
364
|
+
], 8, qe),
|
|
365
|
+
t("span", null, n(p.value) + " / " + n(T.value), 1),
|
|
366
|
+
t("button", {
|
|
367
|
+
type: "button",
|
|
368
|
+
"aria-label": o.value.next,
|
|
369
|
+
disabled: p.value === T.value,
|
|
370
|
+
onClick: l[6] || (l[6] = (e) => p.value++)
|
|
371
|
+
}, [
|
|
372
|
+
h(V(we), { size: 16 })
|
|
373
|
+
], 8, Je)
|
|
374
|
+
])) : f("", !0)
|
|
375
|
+
]),
|
|
376
|
+
c.value ? (r(), s("aside", Pe, [
|
|
377
|
+
t("div", je, [
|
|
378
|
+
t("span", We, [
|
|
379
|
+
h(ee, {
|
|
380
|
+
icon: c.value.name,
|
|
381
|
+
registry: b.registry,
|
|
382
|
+
variant: H.value,
|
|
383
|
+
"allowed-origins": b.allowedOrigins
|
|
384
|
+
}, null, 8, ["icon", "registry", "variant", "allowed-origins"])
|
|
385
|
+
]),
|
|
386
|
+
t("button", {
|
|
387
|
+
type: "button",
|
|
388
|
+
"aria-label": d.value.includes(c.value.name) ? o.value.removeFavorite : o.value.addFavorite,
|
|
389
|
+
"aria-pressed": d.value.includes(c.value.name),
|
|
390
|
+
onClick: l[7] || (l[7] = (e) => se(c.value.name))
|
|
391
|
+
}, [
|
|
392
|
+
h(V(_e), { size: 16 })
|
|
393
|
+
], 8, Qe)
|
|
394
|
+
]),
|
|
395
|
+
t("strong", null, n(c.value.label), 1),
|
|
396
|
+
t("code", null, n(c.value.name), 1),
|
|
397
|
+
c.value.version ? (r(), s("small", Xe, n(c.value.namespace) + " · " + n(c.value.version), 1)) : f("", !0),
|
|
398
|
+
c.value.variants.length > 1 ? (r(), s("label", Ye, [
|
|
399
|
+
j(n(o.value.variant), 1),
|
|
400
|
+
D(t("select", {
|
|
401
|
+
"onUpdate:modelValue": l[8] || (l[8] = (e) => E.value = e),
|
|
402
|
+
"aria-label": o.value.variant
|
|
403
|
+
}, [
|
|
404
|
+
t("option", ea, n(H.value), 1),
|
|
405
|
+
(r(!0), s(z, null, U(c.value.variants, (e) => (r(), s("option", { key: e }, n(e), 1))), 128))
|
|
406
|
+
], 8, Ze), [
|
|
407
|
+
[G, E.value]
|
|
408
|
+
])
|
|
409
|
+
])) : f("", !0),
|
|
410
|
+
t("div", aa, [
|
|
411
|
+
t("button", {
|
|
412
|
+
type: "button",
|
|
413
|
+
onClick: l[9] || (l[9] = (e) => J(c.value.name))
|
|
414
|
+
}, [
|
|
415
|
+
h(V(Se), { size: 13 }),
|
|
416
|
+
j(n(o.value.copyName), 1)
|
|
417
|
+
]),
|
|
418
|
+
t("button", {
|
|
419
|
+
type: "button",
|
|
420
|
+
onClick: ce
|
|
421
|
+
}, n(o.value.copyCode), 1),
|
|
422
|
+
L.value ? (r(), s("button", {
|
|
423
|
+
key: 0,
|
|
424
|
+
type: "button",
|
|
425
|
+
onClick: l[10] || (l[10] = (e) => J(L.value))
|
|
426
|
+
}, n(o.value.copySvg), 1)) : f("", !0)
|
|
427
|
+
]),
|
|
428
|
+
L.value ? (r(), s("details", la, [
|
|
429
|
+
l[11] || (l[11] = t("summary", null, "SVG", -1)),
|
|
430
|
+
t("pre", null, n(L.value), 1)
|
|
431
|
+
])) : f("", !0)
|
|
432
|
+
])) : f("", !0)
|
|
433
|
+
]),
|
|
434
|
+
$.value ? (r(), s("output", ta, n($.value), 1)) : f("", !0)
|
|
435
|
+
], 512));
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
export {
|
|
439
|
+
ua as default
|
|
440
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent as i, unref as o, openBlock as a, createBlock as t, createCommentVNode as c } from "vue";
|
|
2
|
+
import { useIconResource as s } from "../useIconResource.js";
|
|
3
|
+
import l from "../IconGraphic/IconGraphic.vue.js";
|
|
4
|
+
const p = /* @__PURE__ */ i({
|
|
5
|
+
__name: "IconReferenceGraphic",
|
|
6
|
+
props: {
|
|
7
|
+
icon: {},
|
|
8
|
+
registry: {},
|
|
9
|
+
variant: {},
|
|
10
|
+
allowedOrigins: {}
|
|
11
|
+
},
|
|
12
|
+
setup(r) {
|
|
13
|
+
const e = r, { source: n } = s({
|
|
14
|
+
reference: () => e.icon,
|
|
15
|
+
registry: () => e.registry,
|
|
16
|
+
variant: () => e.variant ?? "outline",
|
|
17
|
+
allowedOrigins: () => e.allowedOrigins
|
|
18
|
+
});
|
|
19
|
+
return (u, m) => o(n) ? (a(), t(l, {
|
|
20
|
+
key: 0,
|
|
21
|
+
source: o(n),
|
|
22
|
+
variant: r.variant,
|
|
23
|
+
"allowed-origins": r.allowedOrigins
|
|
24
|
+
}, null, 8, ["source", "variant", "allowed-origins"])) : c("", !0);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
p as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineComponent as n, h as f } from "vue";
|
|
2
|
+
import i from "../../HysTooltip/HysTooltip.vue.js";
|
|
3
|
+
const m = n({
|
|
4
|
+
name: "HysIconTooltip",
|
|
5
|
+
props: { text: String },
|
|
6
|
+
setup(e, { slots: t }) {
|
|
7
|
+
return () => {
|
|
8
|
+
var r;
|
|
9
|
+
return e.text ? f(
|
|
10
|
+
i,
|
|
11
|
+
{ text: e.text, triggerKeys: [] },
|
|
12
|
+
{ default: t.default }
|
|
13
|
+
) : (r = t.default) == null ? void 0 : r.call(t);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
m as default
|
|
19
|
+
};
|