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,419 @@
|
|
|
1
|
+
import { defineComponent as ye, ref as o, computed as f, onMounted as ce, onBeforeUnmount as be, watch as r, Comment as ge, Text as pe, Fragment as U, nextTick as Y, createElementBlock as u, openBlock as i, normalizeClass as H, createBlock as J, resolveDynamicComponent as Q, withKeys as W, normalizeStyle as z, withModifiers as X, withCtx as he, renderList as Z, createElementVNode as D, createCommentVNode as x, toDisplayString as w, renderSlot as ke } from "vue";
|
|
2
|
+
import { B as _, f as c, g as Ie, u as Ce, e as Te, t as Be, b as ee, h as E, r as Le, c as Se, d as we } from "./index-DUh7pai4.mjs";
|
|
3
|
+
import { r as te, a as Ee } from "./setButtonCssEvent-dBs1GcAh.mjs";
|
|
4
|
+
import { _ as Me } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
|
+
const Ae = {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for the list.
|
|
8
|
+
* - Access methods via `hison.component.getList(id)`
|
|
9
|
+
* - Duplicate `id` will throw at mount time
|
|
10
|
+
*/
|
|
11
|
+
id: { type: String, required: !1 },
|
|
12
|
+
/**
|
|
13
|
+
* Custom class applied to the wrapper (string / array / object).
|
|
14
|
+
* - Works with responsive classes like `hison-col-*`, `hison-size-*`, `hison-color-*`, etc.
|
|
15
|
+
*/
|
|
16
|
+
class: {
|
|
17
|
+
type: [String, Array, Object],
|
|
18
|
+
required: !1
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Inline style for the root list container.
|
|
22
|
+
*/
|
|
23
|
+
style: {
|
|
24
|
+
type: [String, Object, Array],
|
|
25
|
+
required: !1
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Inline style for the root list container.
|
|
29
|
+
*/
|
|
30
|
+
listItemStyle: {
|
|
31
|
+
type: [String, Object, Array],
|
|
32
|
+
required: !1
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Inline style for the root list container.
|
|
36
|
+
*/
|
|
37
|
+
listItemInnerStyle: {
|
|
38
|
+
type: [String, Object, Array],
|
|
39
|
+
required: !1
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* Controls visibility of the list.
|
|
43
|
+
*/
|
|
44
|
+
visible: { type: Boolean, default: !0 },
|
|
45
|
+
/**
|
|
46
|
+
* Overall border (box-shadow) for the list container.
|
|
47
|
+
*/
|
|
48
|
+
border: { type: Boolean, default: !1 },
|
|
49
|
+
/**
|
|
50
|
+
* Whether each list item (`li`) shows border (box-shadow).
|
|
51
|
+
*/
|
|
52
|
+
listBorder: { type: Boolean, default: !1 },
|
|
53
|
+
/**
|
|
54
|
+
* Background type of the list container.
|
|
55
|
+
* - 'filled' | 'empty' | 'transparent'
|
|
56
|
+
* - Default: 'empty'
|
|
57
|
+
*/
|
|
58
|
+
backgroundType: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: c.empty,
|
|
61
|
+
validator: (t) => _.includes(t)
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* Background type of each list item (`li`).
|
|
65
|
+
* - 'filled' | 'empty' | 'transparent'
|
|
66
|
+
* - Default: 'empty'
|
|
67
|
+
*/
|
|
68
|
+
listBackgroundType: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: c.empty,
|
|
71
|
+
validator: (t) => _.includes(t)
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Choose underlying list tag: 'ul' or 'ol'.
|
|
75
|
+
*/
|
|
76
|
+
listType: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: "ul",
|
|
79
|
+
validator: (t) => t === "ul" || t === "ol"
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* When listType='ul', the bullet character shown inside each item (instead of native marker).
|
|
83
|
+
* - Ignored if `showMarker=false`
|
|
84
|
+
*/
|
|
85
|
+
bulletChar: { type: String, default: "•" },
|
|
86
|
+
/**
|
|
87
|
+
* Show marker on each item
|
|
88
|
+
* - 'ol' → index+1
|
|
89
|
+
* - 'ul' → bulletChar
|
|
90
|
+
*/
|
|
91
|
+
showMarker: { type: Boolean, default: !0 },
|
|
92
|
+
/**
|
|
93
|
+
* Text list data. Used when:
|
|
94
|
+
* - default slot is absent, OR
|
|
95
|
+
* - default slot is present but composed of text-only nodes (no element vnode).
|
|
96
|
+
*
|
|
97
|
+
* If `#item` scoped slot is provided, it will be used to render each item with props `{ item, index }`.
|
|
98
|
+
*/
|
|
99
|
+
textList: {
|
|
100
|
+
type: Array,
|
|
101
|
+
default: () => []
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* NEW: Attach textbox-like CSS events (+ emit) to each item.
|
|
105
|
+
* - true : bind addButtonCssEvent to `.hison-list-item-inner` and emit interaction events
|
|
106
|
+
* - false: unbind and do not emit
|
|
107
|
+
*/
|
|
108
|
+
addEvent: { type: Boolean, default: !1 },
|
|
109
|
+
/**
|
|
110
|
+
* Controls keyboard focus order of the element.
|
|
111
|
+
* - `0` enables natural tab navigation, positive numbers set custom order.
|
|
112
|
+
* - `null` or `''` removes tabindex (not focusable).
|
|
113
|
+
* The same tabIndex is inserted into the list items.
|
|
114
|
+
*/
|
|
115
|
+
tabIndex: {
|
|
116
|
+
type: [Number, String],
|
|
117
|
+
default: null,
|
|
118
|
+
validator: (t) => t === null || t === "" || !isNaN(+t) && isFinite(+t)
|
|
119
|
+
}
|
|
120
|
+
}, Re = ye({
|
|
121
|
+
name: "HList",
|
|
122
|
+
props: Ae,
|
|
123
|
+
inheritAttrs: !1,
|
|
124
|
+
emits: ["mounted", "responsive-change", "click", "mousedown", "mouseup", "mouseover", "mouseout"],
|
|
125
|
+
setup(t, { emit: n, slots: M }) {
|
|
126
|
+
const V = o(null), d = o([]), A = o([]), a = t.id ? t.id : Ie(), v = `hlist:${a}`, l = Ce(), p = o(null), h = o(t.visible), se = f(() => h.value ? "" : "hison-display-none"), b = o(t.listType || "ul"), k = o(t.bulletChar || "•"), I = o(t.showMarker !== !1), C = o(t.border ?? !1), T = o(t.listBorder ?? !1), B = o(t.backgroundType || c.empty), L = o(t.listBackgroundType || c.empty), y = o(!!t.addEvent), ne = f(() => C.value ? "hison-border" : ""), le = f(() => T.value ? "hison-border" : ""), oe = f(() => {
|
|
127
|
+
switch (B.value) {
|
|
128
|
+
case c.empty:
|
|
129
|
+
return "hison-bg-empty";
|
|
130
|
+
case c.transparent:
|
|
131
|
+
return "hison-bg-transparent";
|
|
132
|
+
default:
|
|
133
|
+
return "hison-bg-filled";
|
|
134
|
+
}
|
|
135
|
+
}), re = f(() => {
|
|
136
|
+
switch (L.value) {
|
|
137
|
+
case c.empty:
|
|
138
|
+
return "hison-bg-empty";
|
|
139
|
+
case c.transparent:
|
|
140
|
+
return "hison-bg-transparent";
|
|
141
|
+
default:
|
|
142
|
+
return "hison-bg-filled";
|
|
143
|
+
}
|
|
144
|
+
}), ie = f(() => {
|
|
145
|
+
var e;
|
|
146
|
+
return ((e = M.default) == null ? void 0 : e.call(M)) ?? [];
|
|
147
|
+
}), g = o(
|
|
148
|
+
t.tabIndex !== null && t.tabIndex !== "" ? Number(t.tabIndex) : null
|
|
149
|
+
), j = (e, s = []) => {
|
|
150
|
+
if (!e || e.length === 0) return s;
|
|
151
|
+
for (const m of e)
|
|
152
|
+
if (m.type !== ge && m.type !== pe)
|
|
153
|
+
if (m.type === U) {
|
|
154
|
+
const $ = m.children;
|
|
155
|
+
j($, s);
|
|
156
|
+
} else
|
|
157
|
+
s.push(m);
|
|
158
|
+
return s;
|
|
159
|
+
}, q = f(() => j(ie.value)), ae = f(() => q.value.length > 0), R = o(
|
|
160
|
+
Array.isArray(t.textList) ? t.textList : []
|
|
161
|
+
), K = f(() => R.value ?? []), ue = f(() => b.value), N = o([]), O = () => {
|
|
162
|
+
N.value = Te(Be(t.class) || "", l.value), ee(N.value, "size", E.componentStyle.size), ee(N.value, "color", "primary");
|
|
163
|
+
}, S = (e = !0) => {
|
|
164
|
+
Y(() => {
|
|
165
|
+
d.value.forEach((s) => {
|
|
166
|
+
s && (te(s), e && y.value && Ee(s));
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
}, de = (e) => {
|
|
170
|
+
y.value && n("click", e, p.value);
|
|
171
|
+
}, me = (e, s) => {
|
|
172
|
+
y.value && n(e, s, p.value);
|
|
173
|
+
}, F = () => {
|
|
174
|
+
E.component.listList[a] && E.component.listList[a].isHisonvueComponent && console.warn(`[Hisonvue] The list ID is at risk of being duplicated. ${a}`), Le(v, () => {
|
|
175
|
+
P(), Y(F);
|
|
176
|
+
}), O(), S(!0), p.value = {
|
|
177
|
+
isHisonvueComponent: !0,
|
|
178
|
+
getId: () => a,
|
|
179
|
+
getType: () => "list",
|
|
180
|
+
isVisible: () => h.value,
|
|
181
|
+
setVisible: (e) => {
|
|
182
|
+
h.value = e;
|
|
183
|
+
},
|
|
184
|
+
getListType: () => b.value,
|
|
185
|
+
setListType: (e) => {
|
|
186
|
+
b.value = e;
|
|
187
|
+
},
|
|
188
|
+
isShowMarker: () => I.value,
|
|
189
|
+
setShowMarker: (e) => {
|
|
190
|
+
I.value = e;
|
|
191
|
+
},
|
|
192
|
+
getBulletChar: () => k.value,
|
|
193
|
+
setBulletChar: (e) => {
|
|
194
|
+
k.value = e;
|
|
195
|
+
},
|
|
196
|
+
isBorder: () => C.value,
|
|
197
|
+
setBorder: (e) => {
|
|
198
|
+
C.value = e;
|
|
199
|
+
},
|
|
200
|
+
isListBorder: () => T.value,
|
|
201
|
+
setListBorder: (e) => {
|
|
202
|
+
T.value = e;
|
|
203
|
+
},
|
|
204
|
+
getBackgroundType: () => B.value,
|
|
205
|
+
setBackgroundType: (e) => {
|
|
206
|
+
B.value = e;
|
|
207
|
+
},
|
|
208
|
+
getListBackgroundType: () => L.value,
|
|
209
|
+
setListBackgroundType: (e) => {
|
|
210
|
+
L.value = e;
|
|
211
|
+
},
|
|
212
|
+
getTextList: () => [...K.value],
|
|
213
|
+
setTextList: (e) => {
|
|
214
|
+
R.value = Array.isArray(e) ? e : [];
|
|
215
|
+
},
|
|
216
|
+
isAddEvent: () => y.value,
|
|
217
|
+
setAddEvent: (e) => {
|
|
218
|
+
y.value = !!e, S(!0);
|
|
219
|
+
},
|
|
220
|
+
getTabIndex: () => g.value,
|
|
221
|
+
setTabIndex: (e) => {
|
|
222
|
+
g.value = e != null ? Number(e) : null;
|
|
223
|
+
},
|
|
224
|
+
getListRowCount: () => d.value.length,
|
|
225
|
+
getListItem: (e) => !Number.isInteger(e) || e < 0 || e >= d.value.length ? null : d.value[e] ?? null,
|
|
226
|
+
focus: (e = 0) => {
|
|
227
|
+
var $;
|
|
228
|
+
if (!y.value) return;
|
|
229
|
+
const s = g.value;
|
|
230
|
+
if (s == null || s === -1 || !Number.isInteger(e) || e < 0 || e >= d.value.length) return;
|
|
231
|
+
const m = d.value[e];
|
|
232
|
+
($ = m == null ? void 0 : m.focus) == null || $.call(m);
|
|
233
|
+
},
|
|
234
|
+
reload: () => Se(v)
|
|
235
|
+
}, E.component.listList[a] = p.value, n("mounted", p.value);
|
|
236
|
+
}, P = () => {
|
|
237
|
+
we(v), d.value.forEach((e) => e && te(e)), delete E.component.listList[a];
|
|
238
|
+
};
|
|
239
|
+
ce(F), be(P);
|
|
240
|
+
const G = (e) => {
|
|
241
|
+
if (!e) return null;
|
|
242
|
+
if (e instanceof Element) return e;
|
|
243
|
+
const s = e.$el;
|
|
244
|
+
return s instanceof Element ? s : null;
|
|
245
|
+
}, ve = (e) => {
|
|
246
|
+
const s = G(e);
|
|
247
|
+
s && (d.value.includes(s) || d.value.push(s));
|
|
248
|
+
}, fe = (e) => {
|
|
249
|
+
const s = G(e);
|
|
250
|
+
s && (A.value.includes(s) || A.value.push(s));
|
|
251
|
+
};
|
|
252
|
+
return r(l, (e) => {
|
|
253
|
+
O(), n("responsive-change", e);
|
|
254
|
+
}), r(() => t.visible, (e) => {
|
|
255
|
+
const s = !!e;
|
|
256
|
+
s !== h.value && (h.value = s);
|
|
257
|
+
}), r(() => t.border, (e) => {
|
|
258
|
+
const s = !!e;
|
|
259
|
+
s !== C.value && (C.value = s);
|
|
260
|
+
}), r(() => t.listBorder, (e) => {
|
|
261
|
+
const s = !!e;
|
|
262
|
+
s !== T.value && (T.value = s);
|
|
263
|
+
}), r(() => t.backgroundType, (e) => {
|
|
264
|
+
e && e !== B.value && (B.value = e);
|
|
265
|
+
}), r(() => t.listBackgroundType, (e) => {
|
|
266
|
+
e && e !== L.value && (L.value = e);
|
|
267
|
+
}), r(() => t.listType, (e) => {
|
|
268
|
+
const s = e === "ol" ? "ol" : "ul";
|
|
269
|
+
s !== b.value && (b.value = s);
|
|
270
|
+
}), r(() => t.bulletChar, (e) => {
|
|
271
|
+
const s = e ?? "•";
|
|
272
|
+
s !== k.value && (k.value = s);
|
|
273
|
+
}), r(() => t.showMarker, (e) => {
|
|
274
|
+
const s = e !== !1;
|
|
275
|
+
s !== I.value && (I.value = s);
|
|
276
|
+
}), r(() => t.textList, (e) => {
|
|
277
|
+
R.value = Array.isArray(e) ? e : [];
|
|
278
|
+
}), r(() => t.addEvent, (e) => {
|
|
279
|
+
const s = !!e;
|
|
280
|
+
s !== y.value && (y.value = s, S(!0));
|
|
281
|
+
}), r(() => t.tabIndex, (e) => {
|
|
282
|
+
const s = e === null || e === "" ? null : Number(e);
|
|
283
|
+
s !== g.value && (g.value = s);
|
|
284
|
+
}), r(() => t.class, () => {
|
|
285
|
+
O();
|
|
286
|
+
}), r(q, () => {
|
|
287
|
+
S(!0);
|
|
288
|
+
}), r(R, () => {
|
|
289
|
+
S(!0);
|
|
290
|
+
}, { deep: !0 }), {
|
|
291
|
+
props: t,
|
|
292
|
+
listRef: V,
|
|
293
|
+
itemRefs: d,
|
|
294
|
+
itemInnerRefs: A,
|
|
295
|
+
renderTag: ue,
|
|
296
|
+
listType: b,
|
|
297
|
+
bulletChar: k,
|
|
298
|
+
showMarker: I,
|
|
299
|
+
visibleClass: se,
|
|
300
|
+
borderClass: ne,
|
|
301
|
+
listBorderClass: le,
|
|
302
|
+
backgroundTypeClass: oe,
|
|
303
|
+
listBackgroundTypeClass: re,
|
|
304
|
+
responsiveClassList: N,
|
|
305
|
+
hasElementSlot: ae,
|
|
306
|
+
elementNodes: q,
|
|
307
|
+
normalizedItems: K,
|
|
308
|
+
tabIndex: g,
|
|
309
|
+
setItemRef: ve,
|
|
310
|
+
setItemInnerRef: fe,
|
|
311
|
+
onItemClick: de,
|
|
312
|
+
emitItem: me
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
}), Ne = ["tabindex"], $e = {
|
|
316
|
+
key: 0,
|
|
317
|
+
class: "hison-list-marker"
|
|
318
|
+
}, He = { key: 0 }, ze = { key: 1 }, De = { class: "hison-list-content" }, qe = ["tabindex"], Oe = {
|
|
319
|
+
key: 0,
|
|
320
|
+
class: "hison-list-marker"
|
|
321
|
+
}, Ue = { key: 0 }, Ve = { key: 1 }, je = { class: "hison-list-content" }, Ke = {
|
|
322
|
+
key: 1,
|
|
323
|
+
class: "hison-list-item-text"
|
|
324
|
+
};
|
|
325
|
+
function Fe(t, n, M, V, d, A) {
|
|
326
|
+
return i(), u("div", {
|
|
327
|
+
class: H([
|
|
328
|
+
"hison-wrapper",
|
|
329
|
+
...t.responsiveClassList,
|
|
330
|
+
t.visibleClass
|
|
331
|
+
])
|
|
332
|
+
}, [
|
|
333
|
+
(i(), J(Q(t.renderTag), {
|
|
334
|
+
ref: "listRef",
|
|
335
|
+
class: H([
|
|
336
|
+
"hison-list",
|
|
337
|
+
t.borderClass,
|
|
338
|
+
t.backgroundTypeClass
|
|
339
|
+
]),
|
|
340
|
+
style: z(t.props.style),
|
|
341
|
+
onKeydown: [
|
|
342
|
+
W(X(t.onItemClick, ["prevent"]), ["enter"]),
|
|
343
|
+
W(X(t.onItemClick, ["prevent"]), ["space"])
|
|
344
|
+
]
|
|
345
|
+
}, {
|
|
346
|
+
default: he(() => [
|
|
347
|
+
t.hasElementSlot ? (i(!0), u(U, { key: 0 }, Z(t.elementNodes, (a, v) => (i(), u("li", {
|
|
348
|
+
key: v,
|
|
349
|
+
class: H([
|
|
350
|
+
"hison-list-item",
|
|
351
|
+
t.listBorderClass,
|
|
352
|
+
t.listBackgroundTypeClass
|
|
353
|
+
]),
|
|
354
|
+
style: z(t.props.listItemStyle),
|
|
355
|
+
ref_for: !0,
|
|
356
|
+
ref: t.setItemRef,
|
|
357
|
+
tabindex: t.tabIndex ?? void 0,
|
|
358
|
+
onClick: n[0] || (n[0] = (...l) => t.onItemClick && t.onItemClick(...l)),
|
|
359
|
+
onMousedown: n[1] || (n[1] = (l) => t.emitItem("mousedown", l)),
|
|
360
|
+
onMouseup: n[2] || (n[2] = (l) => t.emitItem("mouseup", l)),
|
|
361
|
+
onMouseover: n[3] || (n[3] = (l) => t.emitItem("mouseover", l)),
|
|
362
|
+
onMouseout: n[4] || (n[4] = (l) => t.emitItem("mouseout", l))
|
|
363
|
+
}, [
|
|
364
|
+
D("div", {
|
|
365
|
+
class: "hison-list-item-inner",
|
|
366
|
+
style: z(t.props.listItemInnerStyle),
|
|
367
|
+
ref_for: !0,
|
|
368
|
+
ref: t.setItemInnerRef
|
|
369
|
+
}, [
|
|
370
|
+
t.showMarker ? (i(), u("div", $e, [
|
|
371
|
+
t.listType === "ol" ? (i(), u("span", He, w(v + 1) + ".", 1)) : (i(), u("span", ze, w(t.bulletChar), 1))
|
|
372
|
+
])) : x("", !0),
|
|
373
|
+
D("div", De, [
|
|
374
|
+
(i(), J(Q(a)))
|
|
375
|
+
])
|
|
376
|
+
], 4)
|
|
377
|
+
], 46, Ne))), 128)) : (i(!0), u(U, { key: 1 }, Z(t.normalizedItems, (a, v) => (i(), u("li", {
|
|
378
|
+
key: v,
|
|
379
|
+
class: H([
|
|
380
|
+
"hison-list-item",
|
|
381
|
+
t.listBorderClass,
|
|
382
|
+
t.listBackgroundTypeClass
|
|
383
|
+
]),
|
|
384
|
+
ref_for: !0,
|
|
385
|
+
ref: t.setItemRef,
|
|
386
|
+
tabindex: t.tabIndex ?? void 0,
|
|
387
|
+
onClick: n[5] || (n[5] = (...l) => t.onItemClick && t.onItemClick(...l)),
|
|
388
|
+
onMousedown: n[6] || (n[6] = (l) => t.emitItem("mousedown", l)),
|
|
389
|
+
onMouseup: n[7] || (n[7] = (l) => t.emitItem("mouseup", l)),
|
|
390
|
+
onMouseover: n[8] || (n[8] = (l) => t.emitItem("mouseover", l)),
|
|
391
|
+
onMouseout: n[9] || (n[9] = (l) => t.emitItem("mouseout", l))
|
|
392
|
+
}, [
|
|
393
|
+
D("div", {
|
|
394
|
+
class: "hison-list-item-inner",
|
|
395
|
+
style: z(t.props.listItemInnerStyle),
|
|
396
|
+
ref_for: !0,
|
|
397
|
+
ref: t.setItemInnerRef
|
|
398
|
+
}, [
|
|
399
|
+
t.showMarker ? (i(), u("div", Oe, [
|
|
400
|
+
t.listType === "ol" ? (i(), u("span", Ue, w(v + 1) + ".", 1)) : (i(), u("span", Ve, w(t.bulletChar), 1))
|
|
401
|
+
])) : x("", !0),
|
|
402
|
+
D("div", je, [
|
|
403
|
+
t.$slots.item ? ke(t.$slots, "item", {
|
|
404
|
+
key: 0,
|
|
405
|
+
item: a,
|
|
406
|
+
index: v
|
|
407
|
+
}) : (i(), u("span", Ke, w(String(a ?? "")), 1))
|
|
408
|
+
])
|
|
409
|
+
], 4)
|
|
410
|
+
], 42, qe))), 128))
|
|
411
|
+
]),
|
|
412
|
+
_: 3
|
|
413
|
+
}, 40, ["class", "style", "onKeydown"]))
|
|
414
|
+
], 2);
|
|
415
|
+
}
|
|
416
|
+
const Qe = /* @__PURE__ */ Me(Re, [["render", Fe]]);
|
|
417
|
+
export {
|
|
418
|
+
Qe as default
|
|
419
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BmKMHsSZ.js"),N=require("./setButtonCssEvent-B9WTs2X7.js"),W=require("./_plugin-vue_export-helper-BHFhmbuH.js"),X={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},listItemStyle:{type:[String,Object,Array],required:!1},listItemInnerStyle:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},border:{type:Boolean,default:!1},listBorder:{type:Boolean,default:!1},backgroundType:{type:String,default:o.BackgroundType.empty,validator:n=>o.BACKGROUND_TYPE_VALUES.includes(n)},listBackgroundType:{type:String,default:o.BackgroundType.empty,validator:n=>o.BACKGROUND_TYPE_VALUES.includes(n)},listType:{type:String,default:"ul",validator:n=>n==="ul"||n==="ol"},bulletChar:{type:String,default:"•"},showMarker:{type:Boolean,default:!0},textList:{type:Array,default:()=>[]},addEvent:{type:Boolean,default:!1},tabIndex:{type:[Number,String],default:null,validator:n=>n===null||n===""||!isNaN(+n)&&isFinite(+n)}},Z=e.defineComponent({name:"HList",props:X,inheritAttrs:!1,emits:["mounted","responsive-change","click","mousedown","mouseup","mouseover","mouseout"],setup(n,{emit:l,slots:I}){const A=e.ref(null),i=e.ref([]),T=e.ref([]),a=n.id?n.id:o.getUUID(),d=`hlist:${a}`,r=o.useDevice(),v=e.ref(null),y=e.ref(n.visible),$=e.computed(()=>y.value?"":"hison-display-none"),m=e.ref(n.listType||"ul"),p=e.ref(n.bulletChar||"•"),k=e.ref(n.showMarker!==!1),g=e.ref(n.border??!1),h=e.ref(n.listBorder??!1),B=e.ref(n.backgroundType||o.BackgroundType.empty),b=e.ref(n.listBackgroundType||o.BackgroundType.empty),c=e.ref(!!n.addEvent),H=e.computed(()=>g.value?"hison-border":""),O=e.computed(()=>h.value?"hison-border":""),U=e.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"}}),K=e.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"}}),j=e.computed(()=>{var t;return((t=I.default)==null?void 0:t.call(I))??[]}),f=e.ref(n.tabIndex!==null&&n.tabIndex!==""?Number(n.tabIndex):null),R=(t,s=[])=>{if(!t||t.length===0)return s;for(const u of t)if(u.type!==e.Comment&&u.type!==e.Text)if(u.type===e.Fragment){const S=u.children;R(S,s)}else s.push(u);return s},L=e.computed(()=>R(j.value)),F=e.computed(()=>L.value.length>0),w=e.ref(Array.isArray(n.textList)?n.textList:[]),z=e.computed(()=>w.value??[]),P=e.computed(()=>m.value),E=e.ref([]),M=()=>{E.value=o.extractResponsiveClasses(o.toClassString(n.class)||"",r.value),o.addComponentNameToClass(E.value,"size",o.hisonCloser.componentStyle.size),o.addComponentNameToClass(E.value,"color","primary")},C=(t=!0)=>{e.nextTick(()=>{i.value.forEach(s=>{s&&(N.removeButtonCssEvent(s),t&&c.value&&N.addButtonCssEvent(s))})})},G=t=>{c.value&&l("click",t,v.value)},Y=(t,s)=>{c.value&&l(t,s,v.value)},D=()=>{o.hisonCloser.component.listList[a]&&o.hisonCloser.component.listList[a].isHisonvueComponent&&console.warn(`[Hisonvue] The list ID is at risk of being duplicated. ${a}`),o.registerReloadable(d,()=>{V(),e.nextTick(D)}),M(),C(!0),v.value={isHisonvueComponent:!0,getId:()=>a,getType:()=>"list",isVisible:()=>y.value,setVisible:t=>{y.value=t},getListType:()=>m.value,setListType:t=>{m.value=t},isShowMarker:()=>k.value,setShowMarker:t=>{k.value=t},getBulletChar:()=>p.value,setBulletChar:t=>{p.value=t},isBorder:()=>g.value,setBorder:t=>{g.value=t},isListBorder:()=>h.value,setListBorder:t=>{h.value=t},getBackgroundType:()=>B.value,setBackgroundType:t=>{B.value=t},getListBackgroundType:()=>b.value,setListBackgroundType:t=>{b.value=t},getTextList:()=>[...z.value],setTextList:t=>{w.value=Array.isArray(t)?t:[]},isAddEvent:()=>c.value,setAddEvent:t=>{c.value=!!t,C(!0)},getTabIndex:()=>f.value,setTabIndex:t=>{f.value=t!=null?Number(t):null},getListRowCount:()=>i.value.length,getListItem:t=>!Number.isInteger(t)||t<0||t>=i.value.length?null:i.value[t]??null,focus:(t=0)=>{var S;if(!c.value)return;const s=f.value;if(s==null||s===-1||!Number.isInteger(t)||t<0||t>=i.value.length)return;const u=i.value[t];(S=u==null?void 0:u.focus)==null||S.call(u)},reload:()=>o.reloadHisonComponent(d)},o.hisonCloser.component.listList[a]=v.value,l("mounted",v.value)},V=()=>{o.unregisterReloadable(d),i.value.forEach(t=>t&&N.removeButtonCssEvent(t)),delete o.hisonCloser.component.listList[a]};e.onMounted(D),e.onBeforeUnmount(V);const q=t=>{if(!t)return null;if(t instanceof Element)return t;const s=t.$el;return s instanceof Element?s:null},J=t=>{const s=q(t);s&&(i.value.includes(s)||i.value.push(s))},Q=t=>{const s=q(t);s&&(T.value.includes(s)||T.value.push(s))};return e.watch(r,t=>{M(),l("responsive-change",t)}),e.watch(()=>n.visible,t=>{const s=!!t;s!==y.value&&(y.value=s)}),e.watch(()=>n.border,t=>{const s=!!t;s!==g.value&&(g.value=s)}),e.watch(()=>n.listBorder,t=>{const s=!!t;s!==h.value&&(h.value=s)}),e.watch(()=>n.backgroundType,t=>{t&&t!==B.value&&(B.value=t)}),e.watch(()=>n.listBackgroundType,t=>{t&&t!==b.value&&(b.value=t)}),e.watch(()=>n.listType,t=>{const s=t==="ol"?"ol":"ul";s!==m.value&&(m.value=s)}),e.watch(()=>n.bulletChar,t=>{const s=t??"•";s!==p.value&&(p.value=s)}),e.watch(()=>n.showMarker,t=>{const s=t!==!1;s!==k.value&&(k.value=s)}),e.watch(()=>n.textList,t=>{w.value=Array.isArray(t)?t:[]}),e.watch(()=>n.addEvent,t=>{const s=!!t;s!==c.value&&(c.value=s,C(!0))}),e.watch(()=>n.tabIndex,t=>{const s=t===null||t===""?null:Number(t);s!==f.value&&(f.value=s)}),e.watch(()=>n.class,()=>{M()}),e.watch(L,()=>{C(!0)}),e.watch(w,()=>{C(!0)},{deep:!0}),{props:n,listRef:A,itemRefs:i,itemInnerRefs:T,renderTag:P,listType:m,bulletChar:p,showMarker:k,visibleClass:$,borderClass:H,listBorderClass:O,backgroundTypeClass:U,listBackgroundTypeClass:K,responsiveClassList:E,hasElementSlot:F,elementNodes:L,normalizedItems:z,tabIndex:f,setItemRef:J,setItemInnerRef:Q,onItemClick:G,emitItem:Y}}}),x=["tabindex"],_={key:0,class:"hison-list-marker"},ee={key:0},te={key:1},ne={class:"hison-list-content"},se=["tabindex"],le={key:0,class:"hison-list-marker"},oe={key:0},re={key:1},ae={class:"hison-list-content"},ie={key:1,class:"hison-list-item-text"};function ue(n,l,I,A,i,T){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hison-wrapper",...n.responsiveClassList,n.visibleClass])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.renderTag),{ref:"listRef",class:e.normalizeClass(["hison-list",n.borderClass,n.backgroundTypeClass]),style:e.normalizeStyle(n.props.style),onKeydown:[e.withKeys(e.withModifiers(n.onItemClick,["prevent"]),["enter"]),e.withKeys(e.withModifiers(n.onItemClick,["prevent"]),["space"])]},{default:e.withCtx(()=>[n.hasElementSlot?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.elementNodes,(a,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:e.normalizeClass(["hison-list-item",n.listBorderClass,n.listBackgroundTypeClass]),style:e.normalizeStyle(n.props.listItemStyle),ref_for:!0,ref:n.setItemRef,tabindex:n.tabIndex??void 0,onClick:l[0]||(l[0]=(...r)=>n.onItemClick&&n.onItemClick(...r)),onMousedown:l[1]||(l[1]=r=>n.emitItem("mousedown",r)),onMouseup:l[2]||(l[2]=r=>n.emitItem("mouseup",r)),onMouseover:l[3]||(l[3]=r=>n.emitItem("mouseover",r)),onMouseout:l[4]||(l[4]=r=>n.emitItem("mouseout",r))},[e.createElementVNode("div",{class:"hison-list-item-inner",style:e.normalizeStyle(n.props.listItemInnerStyle),ref_for:!0,ref:n.setItemInnerRef},[n.showMarker?(e.openBlock(),e.createElementBlock("div",_,[n.listType==="ol"?(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(d+1)+".",1)):(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(n.bulletChar),1))])):e.createCommentVNode("",!0),e.createElementVNode("div",ne,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a)))])],4)],46,x))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.normalizedItems,(a,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:e.normalizeClass(["hison-list-item",n.listBorderClass,n.listBackgroundTypeClass]),ref_for:!0,ref:n.setItemRef,tabindex:n.tabIndex??void 0,onClick:l[5]||(l[5]=(...r)=>n.onItemClick&&n.onItemClick(...r)),onMousedown:l[6]||(l[6]=r=>n.emitItem("mousedown",r)),onMouseup:l[7]||(l[7]=r=>n.emitItem("mouseup",r)),onMouseover:l[8]||(l[8]=r=>n.emitItem("mouseover",r)),onMouseout:l[9]||(l[9]=r=>n.emitItem("mouseout",r))},[e.createElementVNode("div",{class:"hison-list-item-inner",style:e.normalizeStyle(n.props.listItemInnerStyle),ref_for:!0,ref:n.setItemInnerRef},[n.showMarker?(e.openBlock(),e.createElementBlock("div",le,[n.listType==="ol"?(e.openBlock(),e.createElementBlock("span",oe,e.toDisplayString(d+1)+".",1)):(e.openBlock(),e.createElementBlock("span",re,e.toDisplayString(n.bulletChar),1))])):e.createCommentVNode("",!0),e.createElementVNode("div",ae,[n.$slots.item?e.renderSlot(n.$slots,"item",{key:0,item:a,index:d}):(e.openBlock(),e.createElementBlock("span",ie,e.toDisplayString(String(a??"")),1))])],4)],42,se))),128))]),_:3},40,["class","style","onKeydown"]))],2)}const de=W._export_sfc(Z,[["render",ue]]);exports.default=de;
|