hisonvue 1.0.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/LICENSE +21 -0
- package/README.md +248 -0
- package/dist/HAccordion-CPtgQUK0.js +1 -0
- package/dist/HAccordion-ll-4cIAw.mjs +262 -0
- package/dist/HBaggie-D6omQoFh.js +1 -0
- package/dist/HBaggie-D_7mEiuV.mjs +283 -0
- package/dist/HBanner-DmcMOFqS.mjs +420 -0
- package/dist/HBanner-Io4SdGGs.js +1 -0
- package/dist/HButton-DAVuDmOQ.js +1 -0
- package/dist/HButton-DAriO81x.mjs +256 -0
- package/dist/HCalendar-DKwGatUk.js +2 -0
- package/dist/HCalendar-w18iIB90.mjs +3387 -0
- package/dist/HCaption-6CbSqRA7.js +1 -0
- package/dist/HCaption-DwsXHDNK.mjs +275 -0
- package/dist/HChart-C86JXUyW.js +1 -0
- package/dist/HChart-CcArHFr0.mjs +179 -0
- package/dist/HDrawer-DG1O42iF.mjs +439 -0
- package/dist/HDrawer-U5VC_okK.js +1 -0
- package/dist/HDropdown-Bs7AfefJ.mjs +393 -0
- package/dist/HDropdown-D4RAGmjE.js +1 -0
- package/dist/HFileset-BGuP9O4l.mjs +578 -0
- package/dist/HFileset-CuPR6Hwf.js +2 -0
- package/dist/HGap-BPAdnOQz.js +1 -0
- package/dist/HGap-DzGrfWVt.mjs +233 -0
- package/dist/HGrid-BiIhVCv_.mjs +345 -0
- package/dist/HGrid-C3EV_pgM.js +1 -0
- package/dist/HImagebox-D_DKeCrO.mjs +654 -0
- package/dist/HImagebox-t_UdFjQO.js +2 -0
- package/dist/HInput-BEyJqYkD.mjs +1103 -0
- package/dist/HInput-DMGLY473.js +1 -0
- package/dist/HInputGroup-D37WTYoI.mjs +281 -0
- package/dist/HInputGroup-Dcfr23sZ.js +1 -0
- package/dist/HLabel-B2FOqSiS.mjs +369 -0
- package/dist/HLabel-Dm48mSwn.js +1 -0
- package/dist/HLayout-BbCEm_aO.mjs +196 -0
- package/dist/HLayout-C1e4BZ_K.js +1 -0
- package/dist/HList-CAeYb-hz.mjs +419 -0
- package/dist/HList-eNXmMf27.js +1 -0
- package/dist/HModal-BDBEEpKm.mjs +778 -0
- package/dist/HModal-GODLq3wH.js +1 -0
- package/dist/HNote-CWnUjt3_.mjs +934 -0
- package/dist/HNote-D_Xwu9oL.js +1 -0
- package/dist/HPagination-Db_L9wv-.js +1 -0
- package/dist/HPagination-e5e2a5GS.mjs +496 -0
- package/dist/HParagraph-BRuSeOMU.js +1 -0
- package/dist/HParagraph-DYuB-qjY.mjs +463 -0
- package/dist/HPopup-Brp1FVpm.mjs +431 -0
- package/dist/HPopup-ChkoI3xm.js +1 -0
- package/dist/HSpinner-DDtU9PL_.js +1 -0
- package/dist/HSpinner-DOq2k5kT.mjs +281 -0
- package/dist/HTable-DGFnzD4u.js +1 -0
- package/dist/HTable-GCDP5O_J.mjs +620 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/dist/ar.es-CKau4tBl.js +5 -0
- package/dist/ar.es-XxSuE68c.mjs +57 -0
- package/dist/bg.es-BJ7fu6yy.mjs +57 -0
- package/dist/bg.es-Melqx1M5.js +5 -0
- package/dist/bn.es-CYlBkxc5.mjs +57 -0
- package/dist/bn.es-ClbAZ4WP.js +5 -0
- package/dist/bs.es-KjOcbE96.js +5 -0
- package/dist/bs.es-yMnaKmdi.mjs +57 -0
- package/dist/ca.es-BaGTENcW.js +5 -0
- package/dist/ca.es-DIhlxmQc.mjs +67 -0
- package/dist/cs.es-BN8oxRXQ.mjs +57 -0
- package/dist/cs.es-ChOlHqBr.js +5 -0
- package/dist/da.es-DJB5lAli.mjs +57 -0
- package/dist/da.es-DOFXbf8-.js +5 -0
- package/dist/de.es-DwE82Kaw.js +5 -0
- package/dist/de.es-glb8GeJh.mjs +57 -0
- package/dist/drag-and-drop.es-4ttM1tRs.js +5 -0
- package/dist/drag-and-drop.es-Ckzp6XEn.mjs +183 -0
- package/dist/el.es-CNrCgzYI.js +5 -0
- package/dist/el.es-_bBZf22h.mjs +76 -0
- package/dist/en.es-CV9nmQGr.mjs +57 -0
- package/dist/en.es-CgL601qd.js +5 -0
- package/dist/es.es-CZjcWK54.mjs +57 -0
- package/dist/es.es-IdFGKY7Q.js +5 -0
- package/dist/et.es-BygWmV3P.js +5 -0
- package/dist/et.es-CjvQAzNF.mjs +57 -0
- package/dist/fa.es-DW_0SmsT.js +5 -0
- package/dist/fa.es-DykeFwDA.mjs +57 -0
- package/dist/fi.es-Bl7Pp7AO.mjs +57 -0
- package/dist/fi.es-pgfJlZ8i.js +5 -0
- package/dist/fr.es-CNKVhFfO.mjs +57 -0
- package/dist/fr.es-OENguFuM.js +5 -0
- package/dist/he.es-bixEnAeH.js +5 -0
- package/dist/he.es-nF4GFhjH.mjs +57 -0
- package/dist/hisonvue.cjs.js +1 -0
- package/dist/hisonvue.css +1 -0
- package/dist/hisonvue.d.ts +19934 -0
- package/dist/hisonvue.es.js +114 -0
- package/dist/hr.es-CkRAP94O.js +5 -0
- package/dist/hr.es-QFfz660j.mjs +57 -0
- package/dist/hu.es-Ck2rE01V.mjs +57 -0
- package/dist/hu.es-DG6HeiQJ.js +5 -0
- package/dist/id.es-D4tPi6wP.js +5 -0
- package/dist/id.es-Je7FEUJ5.mjs +57 -0
- package/dist/index-BmKMHsSZ.js +153 -0
- package/dist/index-DUh7pai4.mjs +19976 -0
- package/dist/is.es-CDFqLYCV.js +5 -0
- package/dist/is.es-bzprHvXI.mjs +57 -0
- package/dist/it.es-BHgrw_C6.js +5 -0
- package/dist/it.es-CJtfqmNS.mjs +57 -0
- package/dist/ja.es-BaiGjqZ6.mjs +57 -0
- package/dist/ja.es-D-lxWwyb.js +5 -0
- package/dist/ka.es-CnnB6q4A.js +5 -0
- package/dist/ka.es-x9QJo_dl.mjs +57 -0
- package/dist/ko.es-6c447eTS.mjs +57 -0
- package/dist/ko.es-b18aaB3V.js +5 -0
- package/dist/lt.es-2twYdvmJ.mjs +57 -0
- package/dist/lt.es-BY9UQ6wZ.js +5 -0
- package/dist/mn.es-BLQRG1uu.mjs +57 -0
- package/dist/mn.es-YFS7gSdf.js +5 -0
- package/dist/nl.es-BEx-4hnj.js +5 -0
- package/dist/nl.es-bB1qWR_S.mjs +57 -0
- package/dist/no.es-BQnRWlWR.js +5 -0
- package/dist/no.es-CWDVXpTf.mjs +57 -0
- package/dist/pl.es-CKCsZ_02.js +5 -0
- package/dist/pl.es-Dzct23w9.mjs +57 -0
- package/dist/pt-br.es-BeBuiitI.mjs +57 -0
- package/dist/pt-br.es-oH7qh6Fd.js +5 -0
- package/dist/pt-pt.es-BeBuiitI.mjs +57 -0
- package/dist/pt-pt.es-DLk5I0ej.js +5 -0
- package/dist/ro.es-DfMVJ30M.mjs +57 -0
- package/dist/ro.es-DgTen1Dh.js +5 -0
- package/dist/ru.es-Bv9UvrBe.mjs +67 -0
- package/dist/ru.es-jGIQfREl.js +5 -0
- package/dist/scrollManager-BGnq4wyt.mjs +14 -0
- package/dist/scrollManager-CEEWQwoK.js +1 -0
- package/dist/setButtonCssEvent-B9WTs2X7.js +1 -0
- package/dist/setButtonCssEvent-dBs1GcAh.mjs +70 -0
- package/dist/sk.es-CUOTpLuL.mjs +57 -0
- package/dist/sk.es-D2bhVb26.js +5 -0
- package/dist/sl.es-DeIGgZbR.mjs +57 -0
- package/dist/sl.es-TV8Uraa1.js +5 -0
- package/dist/sq.es-CQJJrZHv.mjs +67 -0
- package/dist/sq.es-Cc65zxbr.js +5 -0
- package/dist/sr.es-CKS0AkiW.mjs +57 -0
- package/dist/sr.es-D5VNA_GW.js +5 -0
- package/dist/sv.es-ChHQRrAe.mjs +57 -0
- package/dist/sv.es-dBeK_DZs.js +5 -0
- package/dist/tr.es-B3v90gVv.mjs +57 -0
- package/dist/tr.es-BUz4S13G.js +5 -0
- package/dist/uk.es-B8uaeLcK.js +5 -0
- package/dist/uk.es-CiR4NnbN.mjs +67 -0
- package/dist/vi.es-2OFMtbQI.js +5 -0
- package/dist/vi.es-DFDi5l7p.mjs +67 -0
- package/dist/zh-cn.es-9cbEAuAi.mjs +67 -0
- package/dist/zh-cn.es-fDHCbCIg.js +5 -0
- package/dist/zh-hk.es-COzeh5F8.js +5 -0
- package/dist/zh-hk.es-z0tio4jE.mjs +67 -0
- package/nuxt/module.mjs +39 -0
- package/nuxt/plugin.mjs +21 -0
- package/package.json +53 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { defineComponent as ie, ref as a, useSlots as ue, computed as o, Text as re, onMounted as j, onBeforeUnmount as de, watch as n, nextTick as E, unref as fe, createElementBlock as F, openBlock as L, normalizeClass as ve, createBlock as ce, resolveDynamicComponent as be, mergeProps as ge, withKeys as q, withModifiers as V, withCtx as me, renderSlot as he, Fragment as ye, createTextVNode as Te, toDisplayString as z } from "vue";
|
|
2
|
+
import { B as Ae, f as M, T as Ce, g as Be, u as Se, w as b, e as ke, t as pe, b as P, h as w, r as Ie, c as we, d as Ne } from "./index-DUh7pai4.mjs";
|
|
3
|
+
import { r as G, a as Ue } from "./setButtonCssEvent-dBs1GcAh.mjs";
|
|
4
|
+
import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
|
+
const Me = {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for the label.
|
|
8
|
+
* - Access methods via `hison.component.getLabel(id)`
|
|
9
|
+
* - Duplicate `id` will throw at mount time
|
|
10
|
+
*/
|
|
11
|
+
id: { type: String, required: !1 },
|
|
12
|
+
/**
|
|
13
|
+
* Custom class applied to the label (string / array / object all supported).
|
|
14
|
+
* - Works with responsive classes like `hison-col-*`, `hison-size-*`, etc.
|
|
15
|
+
*/
|
|
16
|
+
class: {
|
|
17
|
+
type: [String, Array, Object],
|
|
18
|
+
required: !1
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Inline style for the label (string, object, or an array of objects).
|
|
22
|
+
*/
|
|
23
|
+
style: {
|
|
24
|
+
type: [String, Object, Array],
|
|
25
|
+
required: !1
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Controls visibility of the label.
|
|
29
|
+
* - Boolean only. Use `:visible="false"` (with a colon).
|
|
30
|
+
*/
|
|
31
|
+
visible: { type: Boolean, default: !0 },
|
|
32
|
+
/**
|
|
33
|
+
* Tooltip text shown on hover (maps to `title` attribute).
|
|
34
|
+
*/
|
|
35
|
+
title: { type: String, required: !1 },
|
|
36
|
+
/**
|
|
37
|
+
* Text content of the label (alternative to default slot).
|
|
38
|
+
*/
|
|
39
|
+
text: { type: String, required: !1 },
|
|
40
|
+
/**
|
|
41
|
+
* When provided (non-empty), label renders an <a> instead of <span>.
|
|
42
|
+
*/
|
|
43
|
+
href: { type: String, default: null },
|
|
44
|
+
/**
|
|
45
|
+
* Extra attributes forwarded to the underlying `<a>` element when `href` is set.
|
|
46
|
+
* - Maps directly to native anchor/ARIA attributes (e.g., `target`, `rel`, `download`, `aria-label`, ...).
|
|
47
|
+
* - Use this to control accessibility and advanced link behavior.
|
|
48
|
+
*
|
|
49
|
+
* Example:
|
|
50
|
+
* { target: '_blank', rel: 'noopener noreferrer', download: true, 'aria-label': 'External link' }
|
|
51
|
+
*/
|
|
52
|
+
anchorAttrs: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: () => ({})
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Bold font style toggle.
|
|
58
|
+
* - Boolean only
|
|
59
|
+
* - Adds `hison-font-bold` class when enabled
|
|
60
|
+
*/
|
|
61
|
+
fontBold: { type: Boolean, default: !1 },
|
|
62
|
+
/**
|
|
63
|
+
* Italic font style toggle.
|
|
64
|
+
* - Boolean only
|
|
65
|
+
* - Adds `hison-font-italic` class when enabled
|
|
66
|
+
*/
|
|
67
|
+
fontItalic: { type: Boolean, default: !1 },
|
|
68
|
+
/**
|
|
69
|
+
* Strikethrough font style toggle.
|
|
70
|
+
* - Boolean only
|
|
71
|
+
* - Adds `hison-font-thruline` class when enabled
|
|
72
|
+
*/
|
|
73
|
+
fontThruline: { type: Boolean, default: !1 },
|
|
74
|
+
/**
|
|
75
|
+
* Underline font style toggle.
|
|
76
|
+
* - Boolean only
|
|
77
|
+
* - Adds `hison-font-underline` class when enabled
|
|
78
|
+
*/
|
|
79
|
+
fontUnderline: { type: Boolean, default: !1 },
|
|
80
|
+
/**
|
|
81
|
+
* Text alignment for the input’s display text.
|
|
82
|
+
* - 'left' | 'center' | 'right'
|
|
83
|
+
* - Accepts enum `TextAlign` or its literal strings
|
|
84
|
+
*/
|
|
85
|
+
textAlign: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: null,
|
|
88
|
+
validator: (t) => t == null || Ce.includes(t)
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* Whether to show border (rendered as subtle box-shadow).
|
|
92
|
+
* - Default: false (no border)
|
|
93
|
+
*/
|
|
94
|
+
border: { type: Boolean, default: !1 },
|
|
95
|
+
/**
|
|
96
|
+
* Label background type.
|
|
97
|
+
* - 'filled' | 'empty' | 'transparent'
|
|
98
|
+
* - Default: 'empty'
|
|
99
|
+
*/
|
|
100
|
+
backgroundType: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: M.empty,
|
|
103
|
+
validator: (t) => Ae.includes(t)
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* Controls keyboard focus order of the element.
|
|
107
|
+
* - `0` enables natural tab navigation, positive numbers set custom order.
|
|
108
|
+
* - `null` or `''` removes tabindex (not focusable).
|
|
109
|
+
*/
|
|
110
|
+
tabIndex: {
|
|
111
|
+
type: [Number, String],
|
|
112
|
+
default: null,
|
|
113
|
+
validator: (t) => t === null || t === "" || !isNaN(+t) && isFinite(+t)
|
|
114
|
+
}
|
|
115
|
+
}, He = ie({
|
|
116
|
+
name: "HLabel",
|
|
117
|
+
props: Me,
|
|
118
|
+
inheritAttrs: !1,
|
|
119
|
+
emits: ["mounted", "responsive-change", "click", "mousedown", "mouseup", "mouseover", "mouseout"],
|
|
120
|
+
setup(t, { emit: s, slots: J }) {
|
|
121
|
+
const g = a(null), m = a(null), r = t.id ? t.id : Be(), i = `hlabel:${r}`, K = Se(), H = ue(), h = a(t.visible), f = a(t.title || ""), y = a(t.textAlign ?? b.left), X = o(() => ({ textAlign: y.value })), v = a(t.href ?? null), u = a({ ...t.anchorAttrs || {} }), c = o(() => !!(v.value && String(v.value).trim())), Y = o(() => {
|
|
122
|
+
const e = { ...u.value };
|
|
123
|
+
return f.value && e.title == null && (e.title = f.value), e.href = v.value || void 0, e.download === !0 && (e.download = ""), String(e.target || "") === "_blank" && (e.rel == null || String(e.rel).trim() === "") && (e.rel = "noopener noreferrer"), e;
|
|
124
|
+
}), N = o(() => H.default ? H.default() : []), $ = o(
|
|
125
|
+
() => N.value.length > 0 && N.value.every((e) => e.type === re)
|
|
126
|
+
), T = o(
|
|
127
|
+
() => !!H.default && !$.value
|
|
128
|
+
), Q = o(() => T.value ? "div" : c.value ? "a" : "span"), A = a(t.fontBold), W = o(() => {
|
|
129
|
+
if (A.value) return "hison-font-bold";
|
|
130
|
+
}), C = a(t.fontItalic), Z = o(() => {
|
|
131
|
+
if (C.value) return "hison-font-italic";
|
|
132
|
+
}), B = a(t.fontThruline), _ = o(() => {
|
|
133
|
+
if (B.value) return "hison-font-thruline";
|
|
134
|
+
}), S = a(t.fontUnderline), ee = o(() => {
|
|
135
|
+
if (S.value) return "hison-font-underline";
|
|
136
|
+
}), k = a(t.border ?? !1), p = a(t.backgroundType || M.empty), te = o(() => h.value ? "" : "hison-display-none"), le = o(() => k.value ? "hison-border" : ""), ne = o(() => {
|
|
137
|
+
switch (p.value) {
|
|
138
|
+
case M.empty:
|
|
139
|
+
return "hison-bg-empty";
|
|
140
|
+
case M.transparent:
|
|
141
|
+
return "hison-bg-transparent";
|
|
142
|
+
default:
|
|
143
|
+
return "hison-bg-filled";
|
|
144
|
+
}
|
|
145
|
+
}), d = a(t.text || "");
|
|
146
|
+
j(() => {
|
|
147
|
+
if ($.value) {
|
|
148
|
+
const e = N.value.map((l) => String(l.children ?? "")).join("");
|
|
149
|
+
d.value = e;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
const I = a(
|
|
153
|
+
t.tabIndex !== null && t.tabIndex !== "" ? Number(t.tabIndex) : null
|
|
154
|
+
), U = a([]), x = () => {
|
|
155
|
+
U.value = ke(pe(t.class) || "", K.value), P(U.value, "size", w.componentStyle.size), P(U.value, "color", "primary");
|
|
156
|
+
}, ae = (e) => {
|
|
157
|
+
c.value && s("click", e, m.value);
|
|
158
|
+
}, oe = (e) => {
|
|
159
|
+
if (!c.value) return;
|
|
160
|
+
const l = g.value;
|
|
161
|
+
l && l.tagName === "A" && l.click();
|
|
162
|
+
}, O = (e = !0) => {
|
|
163
|
+
const l = g.value;
|
|
164
|
+
l && (G(l), e && c.value && l.tagName === "A" && Ue(l));
|
|
165
|
+
}, R = () => {
|
|
166
|
+
w.component.labelList[r] && w.component.labelList[r].isHisonvueComponent && console.warn(`[Hisonvue] The label ID is at risk of being duplicated. ${r}`), Ie(i, () => {
|
|
167
|
+
D(), E(R);
|
|
168
|
+
}), x(), E(() => O(!0)), m.value = {
|
|
169
|
+
isHisonvueComponent: !0,
|
|
170
|
+
getId: () => r,
|
|
171
|
+
getType: () => "label",
|
|
172
|
+
isVisible: () => h.value,
|
|
173
|
+
setVisible: (e) => {
|
|
174
|
+
h.value = e;
|
|
175
|
+
},
|
|
176
|
+
getTitle: () => f.value,
|
|
177
|
+
setTitle: (e) => {
|
|
178
|
+
f.value = e;
|
|
179
|
+
},
|
|
180
|
+
getText: () => T.value ? "" : d.value,
|
|
181
|
+
setText: (e) => {
|
|
182
|
+
T.value || (d.value = e);
|
|
183
|
+
},
|
|
184
|
+
getHref: () => v.value ?? "",
|
|
185
|
+
setHref: (e) => {
|
|
186
|
+
v.value = e ?? null;
|
|
187
|
+
},
|
|
188
|
+
getAnchorAttrs: () => ({ ...u.value }),
|
|
189
|
+
replaceAnchorAttrs: (e) => {
|
|
190
|
+
u.value = { ...e };
|
|
191
|
+
},
|
|
192
|
+
mergeAnchorAttrs: (e) => {
|
|
193
|
+
u.value = { ...u.value, ...e };
|
|
194
|
+
},
|
|
195
|
+
setAnchorAttr: (e, l) => {
|
|
196
|
+
u.value = { ...u.value, [e]: l };
|
|
197
|
+
},
|
|
198
|
+
removeAnchorAttr: (e) => {
|
|
199
|
+
const l = { ...u.value };
|
|
200
|
+
delete l[e], u.value = l;
|
|
201
|
+
},
|
|
202
|
+
isFontBold: () => A.value,
|
|
203
|
+
setFontBold: (e) => {
|
|
204
|
+
A.value = e;
|
|
205
|
+
},
|
|
206
|
+
isFontItalic: () => C.value,
|
|
207
|
+
setFontItalic: (e) => {
|
|
208
|
+
C.value = e;
|
|
209
|
+
},
|
|
210
|
+
isFontThruline: () => B.value,
|
|
211
|
+
setFontThruline: (e) => {
|
|
212
|
+
B.value = e;
|
|
213
|
+
},
|
|
214
|
+
isFontUnderline: () => S.value,
|
|
215
|
+
setFontUnderline: (e) => {
|
|
216
|
+
S.value = e;
|
|
217
|
+
},
|
|
218
|
+
getTextAlign: () => y.value,
|
|
219
|
+
setTextAlign: (e) => {
|
|
220
|
+
(e === b.left || e === b.center || e === b.right) && (y.value = e);
|
|
221
|
+
},
|
|
222
|
+
isBorder: () => k.value,
|
|
223
|
+
setBorder: (e) => {
|
|
224
|
+
k.value = e;
|
|
225
|
+
},
|
|
226
|
+
getBackgroundType: () => p.value,
|
|
227
|
+
setBackgroundType: (e) => {
|
|
228
|
+
p.value = e;
|
|
229
|
+
},
|
|
230
|
+
reload: () => we(i),
|
|
231
|
+
getTabIndex: () => I.value,
|
|
232
|
+
setTabIndex: (e) => {
|
|
233
|
+
I.value = e != null ? Number(e) : null;
|
|
234
|
+
},
|
|
235
|
+
focus: () => {
|
|
236
|
+
const e = g.value;
|
|
237
|
+
e && c.value && e.tagName === "A" && e.focus();
|
|
238
|
+
}
|
|
239
|
+
}, w.component.labelList[r] = m.value, s("mounted", m.value);
|
|
240
|
+
}, D = () => {
|
|
241
|
+
Ne(i);
|
|
242
|
+
const e = g.value;
|
|
243
|
+
e && G(e), delete w.component.labelList[r];
|
|
244
|
+
};
|
|
245
|
+
return j(R), de(D), n(K, (e) => {
|
|
246
|
+
x(), s("responsive-change", e);
|
|
247
|
+
}), n(c, (e) => {
|
|
248
|
+
E(() => O(e));
|
|
249
|
+
}, { flush: "post" }), n(() => t.visible, (e) => {
|
|
250
|
+
const l = !!e;
|
|
251
|
+
l !== h.value && (h.value = l);
|
|
252
|
+
}), n(() => t.title, (e) => {
|
|
253
|
+
const l = e ?? "";
|
|
254
|
+
l !== f.value && (f.value = l);
|
|
255
|
+
}), n(() => t.text, (e) => {
|
|
256
|
+
if (!T.value) {
|
|
257
|
+
const l = e ?? "";
|
|
258
|
+
l !== d.value && (d.value = l);
|
|
259
|
+
}
|
|
260
|
+
}), n(N, (e) => {
|
|
261
|
+
if ($.value) {
|
|
262
|
+
const l = e.map((se) => String(se.children ?? "")).join("");
|
|
263
|
+
l !== d.value && (d.value = l);
|
|
264
|
+
}
|
|
265
|
+
}), n(() => t.href, (e) => {
|
|
266
|
+
const l = e ?? null;
|
|
267
|
+
l !== v.value && (v.value = l);
|
|
268
|
+
}), n(() => t.anchorAttrs, (e) => {
|
|
269
|
+
const l = { ...e || {} };
|
|
270
|
+
JSON.stringify(l) !== JSON.stringify(u.value) && (u.value = l);
|
|
271
|
+
}), n(() => t.fontBold, (e) => {
|
|
272
|
+
const l = !!e;
|
|
273
|
+
l !== A.value && (A.value = l);
|
|
274
|
+
}), n(() => t.fontItalic, (e) => {
|
|
275
|
+
const l = !!e;
|
|
276
|
+
l !== C.value && (C.value = l);
|
|
277
|
+
}), n(() => t.fontThruline, (e) => {
|
|
278
|
+
const l = !!e;
|
|
279
|
+
l !== B.value && (B.value = l);
|
|
280
|
+
}), n(() => t.fontUnderline, (e) => {
|
|
281
|
+
const l = !!e;
|
|
282
|
+
l !== S.value && (S.value = l);
|
|
283
|
+
}), n(() => t.textAlign, (e) => {
|
|
284
|
+
e && e !== y.value && (e === b.left || e === b.center || e === b.right) && (y.value = e);
|
|
285
|
+
}), n(() => t.border, (e) => {
|
|
286
|
+
const l = !!e;
|
|
287
|
+
l !== k.value && (k.value = l);
|
|
288
|
+
}), n(() => t.backgroundType, (e) => {
|
|
289
|
+
e && e !== p.value && (p.value = e);
|
|
290
|
+
}), n(() => t.tabIndex, (e) => {
|
|
291
|
+
const l = e === null || e === "" ? null : Number(e);
|
|
292
|
+
l !== I.value && (I.value = l);
|
|
293
|
+
}), n(() => t.class, () => {
|
|
294
|
+
x();
|
|
295
|
+
}), {
|
|
296
|
+
labelRef: g,
|
|
297
|
+
labelMethods: o(() => fe(m)),
|
|
298
|
+
props: t,
|
|
299
|
+
title: f,
|
|
300
|
+
hasHref: c,
|
|
301
|
+
hasElementSlot: T,
|
|
302
|
+
renderTag: Q,
|
|
303
|
+
internalText: d,
|
|
304
|
+
computedAnchorAttrs: Y,
|
|
305
|
+
visibleClass: te,
|
|
306
|
+
fontBoldClass: W,
|
|
307
|
+
fontItalicClass: Z,
|
|
308
|
+
fontThrulineClass: _,
|
|
309
|
+
fontUnderlineClass: ee,
|
|
310
|
+
textAlignStyle: X,
|
|
311
|
+
borderClass: le,
|
|
312
|
+
backgroundTypeClass: ne,
|
|
313
|
+
responsiveClassList: U,
|
|
314
|
+
tabIndex: I,
|
|
315
|
+
onClick: ae,
|
|
316
|
+
onKeyActivate: oe
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
}), $e = {
|
|
320
|
+
key: 2,
|
|
321
|
+
class: "hison-label-text"
|
|
322
|
+
};
|
|
323
|
+
function xe(t, s, J, g, m, r) {
|
|
324
|
+
return L(), F("div", {
|
|
325
|
+
class: ve([
|
|
326
|
+
"hison-wrapper",
|
|
327
|
+
...t.responsiveClassList,
|
|
328
|
+
t.visibleClass
|
|
329
|
+
])
|
|
330
|
+
}, [
|
|
331
|
+
(L(), ce(be(t.renderTag), ge({
|
|
332
|
+
ref: "labelRef",
|
|
333
|
+
class: [
|
|
334
|
+
"hison-label",
|
|
335
|
+
t.hasHref ? "hison-label-link" : null,
|
|
336
|
+
t.fontBoldClass,
|
|
337
|
+
t.fontItalicClass,
|
|
338
|
+
t.fontThrulineClass,
|
|
339
|
+
t.fontUnderlineClass,
|
|
340
|
+
t.borderClass,
|
|
341
|
+
t.backgroundTypeClass
|
|
342
|
+
],
|
|
343
|
+
style: [t.textAlignStyle, t.props.style],
|
|
344
|
+
title: t.title || void 0,
|
|
345
|
+
tabindex: t.tabIndex ?? void 0
|
|
346
|
+
}, t.renderTag === "a" ? t.computedAnchorAttrs : void 0, {
|
|
347
|
+
onClick: t.onClick,
|
|
348
|
+
onMousedown: s[0] || (s[0] = (i) => t.$emit("mousedown", i, t.labelMethods)),
|
|
349
|
+
onMouseup: s[1] || (s[1] = (i) => t.$emit("mouseup", i, t.labelMethods)),
|
|
350
|
+
onMouseover: s[2] || (s[2] = (i) => t.$emit("mouseover", i, t.labelMethods)),
|
|
351
|
+
onMouseout: s[3] || (s[3] = (i) => t.$emit("mouseout", i, t.labelMethods)),
|
|
352
|
+
onKeydown: [
|
|
353
|
+
q(V(t.onKeyActivate, ["prevent"]), ["enter"]),
|
|
354
|
+
q(V(t.onKeyActivate, ["prevent"]), ["space"])
|
|
355
|
+
]
|
|
356
|
+
}), {
|
|
357
|
+
default: me(() => [
|
|
358
|
+
t.hasElementSlot ? he(t.$slots, "default", { key: 0 }) : t.hasHref ? (L(), F(ye, { key: 1 }, [
|
|
359
|
+
Te(z(t.internalText), 1)
|
|
360
|
+
], 64)) : (L(), F("span", $e, z(t.internalText), 1))
|
|
361
|
+
]),
|
|
362
|
+
_: 3
|
|
363
|
+
}, 16, ["class", "style", "title", "tabindex", "onClick", "onKeydown"]))
|
|
364
|
+
], 2);
|
|
365
|
+
}
|
|
366
|
+
const Re = /* @__PURE__ */ Le(He, [["render", xe]]);
|
|
367
|
+
export {
|
|
368
|
+
Re as default
|
|
369
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),o=require("./index-BmKMHsSZ.js"),M=require("./setButtonCssEvent-B9WTs2X7.js"),Y=require("./_plugin-vue_export-helper-BHFhmbuH.js"),Q={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},title:{type:String,required:!1},text:{type:String,required:!1},href:{type:String,default:null},anchorAttrs:{type:Object,default:()=>({})},fontBold:{type:Boolean,default:!1},fontItalic:{type:Boolean,default:!1},fontThruline:{type:Boolean,default:!1},fontUnderline:{type:Boolean,default:!1},textAlign:{type:String,default:null,validator:n=>n==null||o.TEXT_ALIGN_VALUES.includes(n)},border:{type:Boolean,default:!1},backgroundType:{type:String,default:o.BackgroundType.empty,validator:n=>o.BACKGROUND_TYPE_VALUES.includes(n)},tabIndex:{type:[Number,String],default:null,validator:n=>n===null||n===""||!isNaN(+n)&&isFinite(+n)}},W=t.defineComponent({name:"HLabel",props:Q,inheritAttrs:!1,emits:["mounted","responsive-change","click","mousedown","mouseup","mouseover","mouseout"],setup(n,{emit:a,slots:$}){const v=t.ref(null),h=t.ref(null),u=n.id?n.id:o.getUUID(),s=`hlabel:${u}`,E=o.useDevice(),I=t.useSlots(),g=t.ref(n.visible),c=t.ref(n.title||""),m=t.ref(n.textAlign??o.TextAlign.left),F=t.computed(()=>({textAlign:m.value})),d=t.ref(n.href??null),i=t.ref({...n.anchorAttrs||{}}),f=t.computed(()=>!!(d.value&&String(d.value).trim())),q=t.computed(()=>{const e={...i.value};return c.value&&e.title==null&&(e.title=c.value),e.href=d.value||void 0,e.download===!0&&(e.download=""),String(e.target||"")==="_blank"&&(e.rel==null||String(e.rel).trim()==="")&&(e.rel="noopener noreferrer"),e}),w=t.computed(()=>I.default?I.default():[]),x=t.computed(()=>w.value.length>0&&w.value.every(e=>e.type===t.Text)),b=t.computed(()=>!!I.default&&!x.value),K=t.computed(()=>b.value?"div":f.value?"a":"span"),y=t.ref(n.fontBold),O=t.computed(()=>{if(y.value)return"hison-font-bold"}),T=t.ref(n.fontItalic),D=t.computed(()=>{if(T.value)return"hison-font-italic"}),A=t.ref(n.fontThruline),R=t.computed(()=>{if(A.value)return"hison-font-thruline"}),p=t.ref(n.fontUnderline),j=t.computed(()=>{if(p.value)return"hison-font-underline"}),C=t.ref(n.border??!1),B=t.ref(n.backgroundType||o.BackgroundType.empty),V=t.computed(()=>g.value?"":"hison-display-none"),P=t.computed(()=>C.value?"hison-border":""),z=t.computed(()=>{switch(B.value){case o.BackgroundType.empty:return"hison-bg-empty";case o.BackgroundType.transparent:return"hison-bg-transparent";default:return"hison-bg-filled"}}),r=t.ref(n.text||"");t.onMounted(()=>{if(x.value){const e=w.value.map(l=>String(l.children??"")).join("");r.value=e}});const k=t.ref(n.tabIndex!==null&&n.tabIndex!==""?Number(n.tabIndex):null),S=t.ref([]),N=()=>{S.value=o.extractResponsiveClasses(o.toClassString(n.class)||"",E.value),o.addComponentNameToClass(S.value,"size",o.hisonCloser.componentStyle.size),o.addComponentNameToClass(S.value,"color","primary")},G=e=>{f.value&&a("click",e,h.value)},J=e=>{if(!f.value)return;const l=v.value;l&&l.tagName==="A"&&l.click()},U=(e=!0)=>{const l=v.value;l&&(M.removeButtonCssEvent(l),e&&f.value&&l.tagName==="A"&&M.addButtonCssEvent(l))},H=()=>{o.hisonCloser.component.labelList[u]&&o.hisonCloser.component.labelList[u].isHisonvueComponent&&console.warn(`[Hisonvue] The label ID is at risk of being duplicated. ${u}`),o.registerReloadable(s,()=>{L(),t.nextTick(H)}),N(),t.nextTick(()=>U(!0)),h.value={isHisonvueComponent:!0,getId:()=>u,getType:()=>"label",isVisible:()=>g.value,setVisible:e=>{g.value=e},getTitle:()=>c.value,setTitle:e=>{c.value=e},getText:()=>b.value?"":r.value,setText:e=>{b.value||(r.value=e)},getHref:()=>d.value??"",setHref:e=>{d.value=e??null},getAnchorAttrs:()=>({...i.value}),replaceAnchorAttrs:e=>{i.value={...e}},mergeAnchorAttrs:e=>{i.value={...i.value,...e}},setAnchorAttr:(e,l)=>{i.value={...i.value,[e]:l}},removeAnchorAttr:e=>{const l={...i.value};delete l[e],i.value=l},isFontBold:()=>y.value,setFontBold:e=>{y.value=e},isFontItalic:()=>T.value,setFontItalic:e=>{T.value=e},isFontThruline:()=>A.value,setFontThruline:e=>{A.value=e},isFontUnderline:()=>p.value,setFontUnderline:e=>{p.value=e},getTextAlign:()=>m.value,setTextAlign:e=>{(e===o.TextAlign.left||e===o.TextAlign.center||e===o.TextAlign.right)&&(m.value=e)},isBorder:()=>C.value,setBorder:e=>{C.value=e},getBackgroundType:()=>B.value,setBackgroundType:e=>{B.value=e},reload:()=>o.reloadHisonComponent(s),getTabIndex:()=>k.value,setTabIndex:e=>{k.value=e!=null?Number(e):null},focus:()=>{const e=v.value;e&&f.value&&e.tagName==="A"&&e.focus()}},o.hisonCloser.component.labelList[u]=h.value,a("mounted",h.value)},L=()=>{o.unregisterReloadable(s);const e=v.value;e&&M.removeButtonCssEvent(e),delete o.hisonCloser.component.labelList[u]};return t.onMounted(H),t.onBeforeUnmount(L),t.watch(E,e=>{N(),a("responsive-change",e)}),t.watch(f,e=>{t.nextTick(()=>U(e))},{flush:"post"}),t.watch(()=>n.visible,e=>{const l=!!e;l!==g.value&&(g.value=l)}),t.watch(()=>n.title,e=>{const l=e??"";l!==c.value&&(c.value=l)}),t.watch(()=>n.text,e=>{if(!b.value){const l=e??"";l!==r.value&&(r.value=l)}}),t.watch(w,e=>{if(x.value){const l=e.map(X=>String(X.children??"")).join("");l!==r.value&&(r.value=l)}}),t.watch(()=>n.href,e=>{const l=e??null;l!==d.value&&(d.value=l)}),t.watch(()=>n.anchorAttrs,e=>{const l={...e||{}};JSON.stringify(l)!==JSON.stringify(i.value)&&(i.value=l)}),t.watch(()=>n.fontBold,e=>{const l=!!e;l!==y.value&&(y.value=l)}),t.watch(()=>n.fontItalic,e=>{const l=!!e;l!==T.value&&(T.value=l)}),t.watch(()=>n.fontThruline,e=>{const l=!!e;l!==A.value&&(A.value=l)}),t.watch(()=>n.fontUnderline,e=>{const l=!!e;l!==p.value&&(p.value=l)}),t.watch(()=>n.textAlign,e=>{e&&e!==m.value&&(e===o.TextAlign.left||e===o.TextAlign.center||e===o.TextAlign.right)&&(m.value=e)}),t.watch(()=>n.border,e=>{const l=!!e;l!==C.value&&(C.value=l)}),t.watch(()=>n.backgroundType,e=>{e&&e!==B.value&&(B.value=e)}),t.watch(()=>n.tabIndex,e=>{const l=e===null||e===""?null:Number(e);l!==k.value&&(k.value=l)}),t.watch(()=>n.class,()=>{N()}),{labelRef:v,labelMethods:t.computed(()=>t.unref(h)),props:n,title:c,hasHref:f,hasElementSlot:b,renderTag:K,internalText:r,computedAnchorAttrs:q,visibleClass:V,fontBoldClass:O,fontItalicClass:D,fontThrulineClass:R,fontUnderlineClass:j,textAlignStyle:F,borderClass:P,backgroundTypeClass:z,responsiveClassList:S,tabIndex:k,onClick:G,onKeyActivate:J}}}),Z={key:2,class:"hison-label-text"};function _(n,a,$,v,h,u){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-wrapper",...n.responsiveClassList,n.visibleClass])},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.renderTag),t.mergeProps({ref:"labelRef",class:["hison-label",n.hasHref?"hison-label-link":null,n.fontBoldClass,n.fontItalicClass,n.fontThrulineClass,n.fontUnderlineClass,n.borderClass,n.backgroundTypeClass],style:[n.textAlignStyle,n.props.style],title:n.title||void 0,tabindex:n.tabIndex??void 0},n.renderTag==="a"?n.computedAnchorAttrs:void 0,{onClick:n.onClick,onMousedown:a[0]||(a[0]=s=>n.$emit("mousedown",s,n.labelMethods)),onMouseup:a[1]||(a[1]=s=>n.$emit("mouseup",s,n.labelMethods)),onMouseover:a[2]||(a[2]=s=>n.$emit("mouseover",s,n.labelMethods)),onMouseout:a[3]||(a[3]=s=>n.$emit("mouseout",s,n.labelMethods)),onKeydown:[t.withKeys(t.withModifiers(n.onKeyActivate,["prevent"]),["enter"]),t.withKeys(t.withModifiers(n.onKeyActivate,["prevent"]),["space"])]}),{default:t.withCtx(()=>[n.hasElementSlot?t.renderSlot(n.$slots,"default",{key:0}):n.hasHref?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(n.internalText),1)],64)):(t.openBlock(),t.createElementBlock("span",Z,t.toDisplayString(n.internalText),1))]),_:3},16,["class","style","title","tabindex","onClick","onKeydown"]))],2)}const ee=Y._export_sfc(W,[["render",_]]);exports.default=ee;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { defineComponent as A, ref as d, computed as m, onMounted as B, onBeforeUnmount as $, watch as b, unref as L, nextTick as M, createElementBlock as R, openBlock as V, normalizeStyle as p, normalizeClass as q, createElementVNode as E, renderSlot as H, createTextVNode as T } from "vue";
|
|
2
|
+
import { X as N, Y as U, Z as w, g as G, u as W, F as I, e as z, t as P, a as j, b as D, h as k, r as F, c as K, d as Y } from "./index-DUh7pai4.mjs";
|
|
3
|
+
import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
|
+
const X = {
|
|
5
|
+
/**
|
|
6
|
+
* Unique identifier for the layout.
|
|
7
|
+
* - You can later retrieve its methods via `hison.component.getLayout(id)`
|
|
8
|
+
* - ⚠️ Duplicate `id` values will throw an error at mount time
|
|
9
|
+
*/
|
|
10
|
+
id: { type: String, required: !1 },
|
|
11
|
+
/**
|
|
12
|
+
* Custom class string applied to the layout container.
|
|
13
|
+
* - You can use `hison-col-*`, `hison-pos-*`, `hison-size-*` and other responsive classes
|
|
14
|
+
* - These classes will be processed internally for device-specific application
|
|
15
|
+
*/
|
|
16
|
+
class: {
|
|
17
|
+
type: [String, Array, Object],
|
|
18
|
+
required: !1
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Inline style string applied to the layout container.
|
|
22
|
+
* - Accepts valid CSS style text (e.g., 'padding: 10px; margin-top: 20px')
|
|
23
|
+
* - Merged with dynamic computed styles like background and border settings
|
|
24
|
+
*/
|
|
25
|
+
style: {
|
|
26
|
+
type: [String, Object, Array],
|
|
27
|
+
required: !1
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* Controls visibility of the layout.
|
|
31
|
+
* - Boolean only. Use `:visible="false"` (with a colon)
|
|
32
|
+
* - Defaults to visible if not provided
|
|
33
|
+
*/
|
|
34
|
+
visible: { type: Boolean, default: !0 },
|
|
35
|
+
/** Background image URL */
|
|
36
|
+
backImageSrc: { type: String, required: !1 },
|
|
37
|
+
/**
|
|
38
|
+
* Background repeat/cover/contain settings
|
|
39
|
+
* - Quick tokens: 'repeat' | 'no-repeat' | 'cover' | 'contain'
|
|
40
|
+
* - Also accepts any valid CSS background-repeat/size shorthand string (e.g. 'repeat-x', 'repeat-y', 'no-repeat center/cover')
|
|
41
|
+
*/
|
|
42
|
+
backImageRepeat: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: !1,
|
|
45
|
+
validator: (e) => e == null || w.includes(e) ? !0 : /^(repeat-x|repeat-y|repeat|no-repeat)(\s+\S+\/\S+)?$/.test(e) || /^(cover|contain)$/.test(e) || /[\/\s]/.test(e)
|
|
46
|
+
},
|
|
47
|
+
/** Background width (e.g. '100%', '300px') */
|
|
48
|
+
backImageWidth: { type: String, required: !1 },
|
|
49
|
+
/** Horizontal alignment: left, center, right */
|
|
50
|
+
backImageAlign: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: !1,
|
|
53
|
+
validator: (e) => e == null || U.includes(e)
|
|
54
|
+
},
|
|
55
|
+
/** Vertical alignment: top, center, bottom */
|
|
56
|
+
backImageVerticalAlign: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: !1,
|
|
59
|
+
validator: (e) => e == null || N.includes(e)
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* Background color of layout.
|
|
63
|
+
* Acceptable values:
|
|
64
|
+
* - Hex: '#ffffff', '#fff'
|
|
65
|
+
* - RGB/RGBA: 'rgb(255,255,255)', 'rgba(0,0,0,0.5)'
|
|
66
|
+
* - Keyword: 'primary', 'muted', 'info', 'success', 'danger', 'warning'
|
|
67
|
+
* (these will be resolved via getHexCodeFromColorText)
|
|
68
|
+
*/
|
|
69
|
+
backColor: { type: String, required: !1 },
|
|
70
|
+
/**
|
|
71
|
+
* Whether to show border (rendered as subtle box-shadow).
|
|
72
|
+
* - Default: false (no border)
|
|
73
|
+
*/
|
|
74
|
+
border: { type: Boolean, default: !1 },
|
|
75
|
+
/**
|
|
76
|
+
* Height of the layout container.
|
|
77
|
+
* Use valid CSS height values:
|
|
78
|
+
* - e.g., '100px', '50%', 'auto', '100vh'
|
|
79
|
+
*/
|
|
80
|
+
height: { type: String, required: !1 }
|
|
81
|
+
}, Z = A({
|
|
82
|
+
name: "HLayout",
|
|
83
|
+
props: X,
|
|
84
|
+
inheritAttrs: !1,
|
|
85
|
+
emits: ["mounted", "responsive-change", "click", "mousedown", "mouseup", "mouseover", "mouseout"],
|
|
86
|
+
setup(e, { emit: t }) {
|
|
87
|
+
const o = d(null), i = d(null), n = e.id ? e.id : G(), g = `hlayout:${n}`, l = W(), r = d(e.visible), C = m(() => r.value ? "" : "hison-display-none"), u = d(e.border ?? !1), S = m(() => u.value ? "hison-border" : ""), h = m(() => {
|
|
88
|
+
const a = {};
|
|
89
|
+
if (e.backImageSrc && (a.backgroundImage = `url(${e.backImageSrc})`, a.backgroundRepeat = e.backImageRepeat || "no-repeat", a.backgroundSize = e.backImageWidth || "auto", a.backgroundPosition = `${e.backImageAlign || "center"} ${e.backImageVerticalAlign || "center"}`), e.backColor) {
|
|
90
|
+
const s = I(e.backColor) || e.backColor;
|
|
91
|
+
a.backgroundColor = s;
|
|
92
|
+
}
|
|
93
|
+
return e.height && (a.height = e.height), a;
|
|
94
|
+
}), c = d([]), y = () => {
|
|
95
|
+
c.value = z(P(e.class) || "", l.value), j(c.value, "col") === -1 && c.value.push("hison-col-12"), D(c.value, "color", "primary");
|
|
96
|
+
}, v = () => {
|
|
97
|
+
k.component.layoutList[n] && k.component.layoutList[n].isHisonvueComponent && console.warn(`[Hisonvue] The layout ID is at risk of being duplicated. ${n}`), F(g, () => {
|
|
98
|
+
f(), M(v);
|
|
99
|
+
}), o.value && (y(), i.value = {
|
|
100
|
+
isHisonvueComponent: !0,
|
|
101
|
+
getId: () => n,
|
|
102
|
+
getType: () => "layout",
|
|
103
|
+
isVisible: () => r.value,
|
|
104
|
+
setVisible: (a) => {
|
|
105
|
+
r.value = a;
|
|
106
|
+
},
|
|
107
|
+
getBackImageSrc: () => e.backImageSrc || "",
|
|
108
|
+
setBackImageSrc: (a) => {
|
|
109
|
+
o.value && (o.value.style.backgroundImage = `url(${a})`);
|
|
110
|
+
},
|
|
111
|
+
getBackImageRepeat: () => e.backImageRepeat || "",
|
|
112
|
+
setBackImageRepeat: (a) => {
|
|
113
|
+
o.value && (o.value.style.backgroundRepeat = a);
|
|
114
|
+
},
|
|
115
|
+
getBackImageWidth: () => e.backImageWidth || "",
|
|
116
|
+
setBackImageWidth: (a) => {
|
|
117
|
+
o.value && (o.value.style.backgroundSize = a);
|
|
118
|
+
},
|
|
119
|
+
getBackImageAlign: () => e.backImageAlign || "",
|
|
120
|
+
setBackImageAlign: (a) => {
|
|
121
|
+
if (o.value) {
|
|
122
|
+
const s = e.backImageVerticalAlign || "center";
|
|
123
|
+
o.value.style.backgroundPosition = `${a} ${s}`;
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
getBackImageVerticalAlign: () => e.backImageVerticalAlign || "",
|
|
127
|
+
setBackImageVerticalAlign: (a) => {
|
|
128
|
+
if (o.value) {
|
|
129
|
+
const s = e.backImageAlign || "center";
|
|
130
|
+
o.value.style.backgroundPosition = `${s} ${a}`;
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
getBackColor: () => e.backColor || "",
|
|
134
|
+
setBackColor: (a) => {
|
|
135
|
+
o.value && (o.value.style.backgroundColor = I(a) || a);
|
|
136
|
+
},
|
|
137
|
+
isBorder: () => u.value,
|
|
138
|
+
setBorder: (a) => {
|
|
139
|
+
u.value = a;
|
|
140
|
+
},
|
|
141
|
+
getHeight: () => e.height || "",
|
|
142
|
+
setHeight: (a) => {
|
|
143
|
+
o.value && (o.value.style.height = a);
|
|
144
|
+
},
|
|
145
|
+
reload: () => K(g)
|
|
146
|
+
}, k.component.layoutList[n] = i.value, t("mounted", i.value));
|
|
147
|
+
}, f = () => {
|
|
148
|
+
Y(g), delete k.component.layoutList[n];
|
|
149
|
+
};
|
|
150
|
+
return B(v), $(f), b(l, (a) => {
|
|
151
|
+
y(), t("responsive-change", a);
|
|
152
|
+
}), b(() => e.visible, (a) => {
|
|
153
|
+
const s = !!a;
|
|
154
|
+
s !== r.value && (r.value = s);
|
|
155
|
+
}), b(() => e.border, (a) => {
|
|
156
|
+
const s = !!a;
|
|
157
|
+
s !== u.value && (u.value = s);
|
|
158
|
+
}), b(() => e.class, () => {
|
|
159
|
+
y();
|
|
160
|
+
}), {
|
|
161
|
+
layoutRef: o,
|
|
162
|
+
layoutMethods: m(() => L(i)),
|
|
163
|
+
props: e,
|
|
164
|
+
responsiveClassList: c,
|
|
165
|
+
visibleClass: C,
|
|
166
|
+
borderClass: S,
|
|
167
|
+
computedBackStyle: h
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
function J(e, t, o, i, n, g) {
|
|
172
|
+
return V(), R("div", {
|
|
173
|
+
ref: "layoutRef",
|
|
174
|
+
class: q([
|
|
175
|
+
"hison-layout",
|
|
176
|
+
...e.responsiveClassList,
|
|
177
|
+
e.visibleClass,
|
|
178
|
+
e.borderClass
|
|
179
|
+
]),
|
|
180
|
+
style: p([e.props.style, e.computedBackStyle]),
|
|
181
|
+
onClick: t[0] || (t[0] = (l) => e.$emit("click", l, e.layoutMethods)),
|
|
182
|
+
onMousedown: t[1] || (t[1] = (l) => e.$emit("mousedown", l, e.layoutMethods)),
|
|
183
|
+
onMouseup: t[2] || (t[2] = (l) => e.$emit("mouseup", l, e.layoutMethods)),
|
|
184
|
+
onMouseover: t[3] || (t[3] = (l) => e.$emit("mouseover", l, e.layoutMethods)),
|
|
185
|
+
onMouseout: t[4] || (t[4] = (l) => e.$emit("mouseout", l, e.layoutMethods))
|
|
186
|
+
}, [
|
|
187
|
+
t[6] || (t[6] = E("div", { class: "hison-layout-frame-adjust" }, null, -1)),
|
|
188
|
+
H(e.$slots, "default", {}, () => [
|
|
189
|
+
t[5] || (t[5] = T("Hison Layout"))
|
|
190
|
+
])
|
|
191
|
+
], 38);
|
|
192
|
+
}
|
|
193
|
+
const ee = /* @__PURE__ */ O(Z, [["render", J]]);
|
|
194
|
+
export {
|
|
195
|
+
ee as default
|
|
196
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),l=require("./index-BmKMHsSZ.js"),C=require("./_plugin-vue_export-helper-BHFhmbuH.js"),h={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},backImageSrc:{type:String,required:!1},backImageRepeat:{type:String,required:!1,validator:e=>e==null||l.BACK_IMAGE_STYLE_VALUES.includes(e)?!0:/^(repeat-x|repeat-y|repeat|no-repeat)(\s+\S+\/\S+)?$/.test(e)||/^(cover|contain)$/.test(e)||/[\/\s]/.test(e)},backImageWidth:{type:String,required:!1},backImageAlign:{type:String,required:!1,validator:e=>e==null||l.BACK_IMAGE_ALIGN_VALUES.includes(e)},backImageVerticalAlign:{type:String,required:!1,validator:e=>e==null||l.BACK_IMAGE_VERTICAL_ALIGN_VALUES.includes(e)},backColor:{type:String,required:!1},border:{type:Boolean,default:!1},height:{type:String,required:!1}},S=a.defineComponent({name:"HLayout",props:h,inheritAttrs:!1,emits:["mounted","responsive-change","click","mousedown","mouseup","mouseover","mouseout"],setup(e,{emit:o}){const n=a.ref(null),u=a.ref(null),r=e.id?e.id:l.getUUID(),m=`hlayout:${r}`,s=l.useDevice(),c=a.ref(e.visible),v=a.computed(()=>c.value?"":"hison-display-none"),d=a.ref(e.border??!1),f=a.computed(()=>d.value?"hison-border":""),I=a.computed(()=>{const t={};if(e.backImageSrc&&(t.backgroundImage=`url(${e.backImageSrc})`,t.backgroundRepeat=e.backImageRepeat||"no-repeat",t.backgroundSize=e.backImageWidth||"auto",t.backgroundPosition=`${e.backImageAlign||"center"} ${e.backImageVerticalAlign||"center"}`),e.backColor){const i=l.getHexCodeFromColorText(e.backColor)||e.backColor;t.backgroundColor=i}return e.height&&(t.height=e.height),t}),g=a.ref([]),b=()=>{g.value=l.extractResponsiveClasses(l.toClassString(e.class)||"",s.value),l.getIndexSpecificClassNameFromClassList(g.value,"col")===-1&&g.value.push("hison-col-12"),l.addComponentNameToClass(g.value,"color","primary")},y=()=>{l.hisonCloser.component.layoutList[r]&&l.hisonCloser.component.layoutList[r].isHisonvueComponent&&console.warn(`[Hisonvue] The layout ID is at risk of being duplicated. ${r}`),l.registerReloadable(m,()=>{k(),a.nextTick(y)}),n.value&&(b(),u.value={isHisonvueComponent:!0,getId:()=>r,getType:()=>"layout",isVisible:()=>c.value,setVisible:t=>{c.value=t},getBackImageSrc:()=>e.backImageSrc||"",setBackImageSrc:t=>{n.value&&(n.value.style.backgroundImage=`url(${t})`)},getBackImageRepeat:()=>e.backImageRepeat||"",setBackImageRepeat:t=>{n.value&&(n.value.style.backgroundRepeat=t)},getBackImageWidth:()=>e.backImageWidth||"",setBackImageWidth:t=>{n.value&&(n.value.style.backgroundSize=t)},getBackImageAlign:()=>e.backImageAlign||"",setBackImageAlign:t=>{if(n.value){const i=e.backImageVerticalAlign||"center";n.value.style.backgroundPosition=`${t} ${i}`}},getBackImageVerticalAlign:()=>e.backImageVerticalAlign||"",setBackImageVerticalAlign:t=>{if(n.value){const i=e.backImageAlign||"center";n.value.style.backgroundPosition=`${i} ${t}`}},getBackColor:()=>e.backColor||"",setBackColor:t=>{n.value&&(n.value.style.backgroundColor=l.getHexCodeFromColorText(t)||t)},isBorder:()=>d.value,setBorder:t=>{d.value=t},getHeight:()=>e.height||"",setHeight:t=>{n.value&&(n.value.style.height=t)},reload:()=>l.reloadHisonComponent(m)},l.hisonCloser.component.layoutList[r]=u.value,o("mounted",u.value))},k=()=>{l.unregisterReloadable(m),delete l.hisonCloser.component.layoutList[r]};return a.onMounted(y),a.onBeforeUnmount(k),a.watch(s,t=>{b(),o("responsive-change",t)}),a.watch(()=>e.visible,t=>{const i=!!t;i!==c.value&&(c.value=i)}),a.watch(()=>e.border,t=>{const i=!!t;i!==d.value&&(d.value=i)}),a.watch(()=>e.class,()=>{b()}),{layoutRef:n,layoutMethods:a.computed(()=>a.unref(u)),props:e,responsiveClassList:g,visibleClass:v,borderClass:f,computedBackStyle:I}}});function A(e,o,n,u,r,m){return a.openBlock(),a.createElementBlock("div",{ref:"layoutRef",class:a.normalizeClass(["hison-layout",...e.responsiveClassList,e.visibleClass,e.borderClass]),style:a.normalizeStyle([e.props.style,e.computedBackStyle]),onClick:o[0]||(o[0]=s=>e.$emit("click",s,e.layoutMethods)),onMousedown:o[1]||(o[1]=s=>e.$emit("mousedown",s,e.layoutMethods)),onMouseup:o[2]||(o[2]=s=>e.$emit("mouseup",s,e.layoutMethods)),onMouseover:o[3]||(o[3]=s=>e.$emit("mouseover",s,e.layoutMethods)),onMouseout:o[4]||(o[4]=s=>e.$emit("mouseout",s,e.layoutMethods))},[o[6]||(o[6]=a.createElementVNode("div",{class:"hison-layout-frame-adjust"},null,-1)),a.renderSlot(e.$slots,"default",{},()=>[o[5]||(o[5]=a.createTextVNode("Hison Layout"))])],38)}const B=C._export_sfc(S,[["render",A]]);exports.default=B;
|