hisonvue 1.1.13 → 1.1.15
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/dist/{HAccordion-DzD88p_k.mjs → HAccordion-AMMxc-n7.mjs} +2 -2
- package/dist/{HAccordion-BPcUkox0.js → HAccordion-DUbR-LEB.js} +1 -1
- package/dist/{HBaggie-CoE3swPJ.mjs → HBaggie-D1SDq6Aq.mjs} +2 -2
- package/dist/{HBaggie-DN3TUx7R.js → HBaggie-GcDxoIp_.js} +1 -1
- package/dist/{HBanner-wYmOu8Da.mjs → HBanner-BDmz48P7.mjs} +2 -2
- package/dist/{HBanner-CO620JW2.js → HBanner-eYrKFMD3.js} +1 -1
- package/dist/{HButton-BcGJbrDW.mjs → HButton-D5J3QJ3k.mjs} +2 -2
- package/dist/{HButton-DuHEt4L4.js → HButton-DY0Z8AD0.js} +1 -1
- package/dist/{HCalendar-BCnJmmwt.mjs → HCalendar-B70zw7PF.mjs} +1 -1
- package/dist/{HCalendar-w59hzWIb.js → HCalendar-DdGP7stc.js} +1 -1
- package/dist/{HCaption-BS-kcsPL.js → HCaption-Brk7an21.js} +1 -1
- package/dist/{HCaption-CEcuoI2Z.mjs → HCaption-CZS7sSnK.mjs} +1 -1
- package/dist/{HChart-GW0MC1O-.js → HChart-Bp-Pe6N4.js} +1 -1
- package/dist/{HChart-BVErh-TI.mjs → HChart-DDOyVEKT.mjs} +1 -1
- package/dist/HDrawer-XsgiKbXk.js +1 -0
- package/dist/{HDrawer-BeFNw6it.mjs → HDrawer-hHybg8SX.mjs} +131 -127
- package/dist/{HDropdown-DAPxzzLT.mjs → HDropdown-B1lOTt80.mjs} +2 -2
- package/dist/{HDropdown-4PzlwYQK.js → HDropdown-BAhVukt7.js} +1 -1
- package/dist/{HFileset-DH4RVJMc.mjs → HFileset--kImkvAy.mjs} +1 -1
- package/dist/{HFileset-C3jH-75M.js → HFileset-BqFrvfdg.js} +1 -1
- package/dist/{HGap-xEp9kuzW.mjs → HGap-BAT2kKz2.mjs} +1 -1
- package/dist/{HGap-BICfHf2P.js → HGap-DgiEBgM7.js} +1 -1
- package/dist/{HGrid-CMj1N_CR.mjs → HGrid-CKBU9x2G.mjs} +1 -1
- package/dist/{HGrid-BYpzERIV.js → HGrid-DcrmReS5.js} +1 -1
- package/dist/{HImagebox-CjP4ifUf.mjs → HImagebox-CCFVW-fE.mjs} +1 -1
- package/dist/{HImagebox-BK13d9hC.js → HImagebox-p-VeFWFd.js} +1 -1
- package/dist/{HInput-C6P1WBQR.js → HInput-CIPnIotR.js} +1 -1
- package/dist/{HInput-BsQwJ4oK.mjs → HInput-Dnzu2oDw.mjs} +1 -1
- package/dist/{HInputGroup-DSytkVgB.mjs → HInputGroup-CEVPImN2.mjs} +1 -1
- package/dist/{HInputGroup-CJvqmDw_.js → HInputGroup-LkHKC_Y0.js} +1 -1
- package/dist/{HLabel-BZmcQdJZ.js → HLabel-CfZ6vkuS.js} +1 -1
- package/dist/{HLabel-CVlUjx2J.mjs → HLabel-W1SpsHAb.mjs} +2 -2
- package/dist/{HLayout-CTokm5DW.mjs → HLayout-DmV1cmwM.mjs} +1 -1
- package/dist/{HLayout-Cvh9owsl.js → HLayout-fV1YUnaU.js} +1 -1
- package/dist/{HList-CjQUGjSi.mjs → HList-DVOTg58_.mjs} +2 -2
- package/dist/{HList-B56HtoRE.js → HList-SesiDx90.js} +1 -1
- package/dist/{HModal-pR6tdZaS.js → HModal-CkKQ2QOR.js} +1 -1
- package/dist/{HModal-B60an2UM.mjs → HModal-DYvv8zcl.mjs} +1 -1
- package/dist/{HNote-aGk4Iq2z.js → HNote-DYIug_Uu.js} +1 -1
- package/dist/{HNote-DbolymFq.mjs → HNote-txZdZMkb.mjs} +1 -1
- package/dist/{HPagination-BZ17GWQO.js → HPagination-DSp3KBLT.js} +1 -1
- package/dist/{HPagination-BrMrMfTw.mjs → HPagination-DgUKOXec.mjs} +2 -2
- package/dist/{HParagraph-D5k1Wd5x.mjs → HParagraph-Bd6H8B4S.mjs} +1 -1
- package/dist/{HParagraph-BSv_Wsjz.js → HParagraph-uLP5-Rxz.js} +1 -1
- package/dist/{HPopup-BvZpNjfs.mjs → HPopup-CiQK7Lcy.mjs} +1 -1
- package/dist/{HPopup-ASomoAz9.js → HPopup-Cx8Zu9C0.js} +1 -1
- package/dist/{HSpinner-BpZVFnXH.mjs → HSpinner-Cj1Dyp1l.mjs} +1 -1
- package/dist/{HSpinner-CmyqXHMh.js → HSpinner-Ddqgbqv8.js} +1 -1
- package/dist/{HTable-lqvTk19w.js → HTable-BIP9_Lby.js} +1 -1
- package/dist/{HTable-CV3PO9DY.mjs → HTable-BXrwEo6K.mjs} +1 -1
- package/dist/hisonvue.cjs.js +1 -1
- package/dist/hisonvue.d.ts +11 -6
- package/dist/hisonvue.es.js +2 -2
- package/dist/{index-DeOa0YJA.js → index-Bv6aEJhv.js} +1 -1
- package/dist/{index-CC0B7Mqx.mjs → index-q_fzCRqA.mjs} +1 -1
- package/dist/{setButtonCssEvent-DK69MUM5.js → setButtonCssEvent-Dk2GorRb.js} +1 -1
- package/dist/{setButtonCssEvent-CYoAPu2n.mjs → setButtonCssEvent-YKTJlBkM.mjs} +1 -1
- package/nuxt/module.mjs +21 -39
- package/nuxt/plugin.mjs +22 -0
- package/nuxt/warn-filter.mjs +42 -0
- package/package.json +7 -4
- package/dist/HDrawer-BYNWM5oo.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { g as
|
|
3
|
-
import { a as
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as Ve, ref as n, computed as r, onMounted as Pe, onBeforeUnmount as He, watch as a, unref as j, nextTick as A, resolveComponent as Re, createElementBlock as se, openBlock as ne, normalizeClass as R, createCommentVNode as Y, createElementVNode as ae, normalizeStyle as F, renderSlot as D, createVNode as De, createSlots as Ne, withCtx as ie } from "vue";
|
|
2
|
+
import { g as We, u as qe, j as Ue, t as re, e as Xe, b as ue, h as $, r as Ze, c as Me, d as je } from "./index-q_fzCRqA.mjs";
|
|
3
|
+
import { a as Ye, r as Fe } from "./scrollManager-BGnq4wyt.mjs";
|
|
4
|
+
import { _ as Ge } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
|
+
const Je = ["top", "bottom", "left", "right"], Ke = {
|
|
6
6
|
/**
|
|
7
7
|
* Unique identifier for the drawer instance.
|
|
8
8
|
* - Retrieve runtime methods via `hison.component.getDrawer(id)`
|
|
@@ -53,7 +53,7 @@ const Ge = ["top", "bottom", "left", "right"], Je = {
|
|
|
53
53
|
position: {
|
|
54
54
|
type: String,
|
|
55
55
|
default: "bottom",
|
|
56
|
-
validator: (t) =>
|
|
56
|
+
validator: (t) => Je.includes(t)
|
|
57
57
|
},
|
|
58
58
|
/**
|
|
59
59
|
* Drawer width in pixels.
|
|
@@ -126,33 +126,33 @@ const Ge = ["top", "bottom", "left", "right"], Je = {
|
|
|
126
126
|
* - Default: chosen internally by `position` if not provided
|
|
127
127
|
*/
|
|
128
128
|
leaveAnimationClass: { type: String, required: !1 }
|
|
129
|
-
},
|
|
129
|
+
}, Qe = Ve({
|
|
130
130
|
name: "HDrawer",
|
|
131
|
-
props:
|
|
131
|
+
props: Ke,
|
|
132
132
|
inheritAttrs: !1,
|
|
133
133
|
emits: ["mounted", "responsive-change", "open", "close"],
|
|
134
|
-
setup(t, { emit:
|
|
135
|
-
const
|
|
134
|
+
setup(t, { emit: f, slots: ce }) {
|
|
135
|
+
const u = t.id || We(), I = `hdrawer:${u}`, N = qe(), W = n(null), y = n(null), k = n(t.visible), c = n(t.visible), g = n(t.zIndex ?? 1100), b = n(t.border), S = n(t.showOverlay), L = n(t.closeClickOverlay), p = n(t.scrollLock), o = n(t.position), v = n(t.width ?? null), d = n(t.height ?? null), O = n(t.closeButtonVisible), ve = r(() => b.value), de = r(() => b.value ? "filled" : "empty"), q = n(t.closeButtonText || "X"), U = n(t.closeButtonTitle || "Close"), T = n(t.swipeClose), E = {
|
|
136
136
|
top: "hison-drawer-enter-top",
|
|
137
137
|
bottom: "hison-drawer-enter-bottom",
|
|
138
138
|
left: "hison-drawer-enter-left",
|
|
139
139
|
right: "hison-drawer-enter-right"
|
|
140
|
-
},
|
|
140
|
+
}, z = {
|
|
141
141
|
top: "hison-drawer-leave-top",
|
|
142
142
|
bottom: "hison-drawer-leave-bottom",
|
|
143
143
|
left: "hison-drawer-leave-left",
|
|
144
144
|
right: "hison-drawer-leave-right"
|
|
145
|
-
},
|
|
145
|
+
}, h = n(t.enterAnimationClass || E[o.value]), m = n(t.leaveAnimationClass || z[o.value]), fe = r(() => "hison-bg-empty"), ye = r(() => b.value ? "hison-border" : ""), he = r(() => k.value ? "" : "hison-display-none"), V = n([]), X = () => {
|
|
146
146
|
var e;
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
...
|
|
150
|
-
]),
|
|
147
|
+
V.value = Xe(re(t.class) || "", N.value), ue(V.value, "size", ((e = $.componentStyle) == null ? void 0 : e.size) || "m"), ue(V.value, "color", "primary");
|
|
148
|
+
}, me = r(() => [
|
|
149
|
+
...Ue(re(t.class) || "", "color")
|
|
150
|
+
]), we = r(() => c.value && S.value), be = r(() => {
|
|
151
151
|
const l = { zIndex: (g.value ?? 1100) - 1 }, s = t.overlayStyle;
|
|
152
152
|
return s ? Array.isArray(s) ? [{ ...l }, ...s] : typeof s == "string" ? [l, s] : { ...l, ...s } : l;
|
|
153
|
-
}),
|
|
154
|
-
|
|
155
|
-
},
|
|
153
|
+
}), Ce = () => {
|
|
154
|
+
L.value && w();
|
|
155
|
+
}, ge = r(() => {
|
|
156
156
|
const e = { zIndex: g.value, position: "fixed", inset: "auto" };
|
|
157
157
|
switch (e.left = "", e.right = "", e.top = "", e.bottom = "", o.value) {
|
|
158
158
|
case "top":
|
|
@@ -169,50 +169,50 @@ const Ge = ["top", "bottom", "left", "right"], Je = {
|
|
|
169
169
|
break;
|
|
170
170
|
}
|
|
171
171
|
return e;
|
|
172
|
-
}),
|
|
172
|
+
}), pe = r(() => {
|
|
173
173
|
const e = {};
|
|
174
174
|
return o.value === "top" || o.value === "bottom" ? (e.width = "100vw", d.value != null && (e.height = `${d.value}px`), v.value != null && (e.width = `${v.value}px`)) : (e.height = "100vh", v.value != null && (e.width = `${v.value}px`), d.value != null && (e.height = `${d.value}px`)), e;
|
|
175
|
-
}),
|
|
176
|
-
p.value &&
|
|
177
|
-
},
|
|
178
|
-
p.value &&
|
|
175
|
+
}), P = () => {
|
|
176
|
+
p.value && Ye(u);
|
|
177
|
+
}, H = () => {
|
|
178
|
+
p.value && Fe(u);
|
|
179
179
|
}, G = async () => {
|
|
180
|
-
const e =
|
|
181
|
-
!e || !
|
|
182
|
-
},
|
|
183
|
-
const e =
|
|
184
|
-
!e || !
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
if (
|
|
180
|
+
const e = y.value;
|
|
181
|
+
!e || !h.value || (e.classList.remove(m.value), e.offsetWidth, e.classList.add(h.value));
|
|
182
|
+
}, Be = async () => {
|
|
183
|
+
const e = y.value;
|
|
184
|
+
!e || !m.value || (e.classList.remove(h.value), e.offsetWidth, e.classList.add(m.value), await new Promise((l) => setTimeout(l, 200)));
|
|
185
|
+
}, J = async () => {
|
|
186
|
+
c.value || (c.value = !0, P(), await A(), G(), f("open", j(B)));
|
|
187
|
+
}, w = async () => {
|
|
188
|
+
if (c.value)
|
|
189
189
|
try {
|
|
190
|
-
await
|
|
190
|
+
await Be();
|
|
191
191
|
} finally {
|
|
192
|
-
|
|
192
|
+
c.value = !1, H(), f("close", j(B));
|
|
193
193
|
}
|
|
194
|
-
},
|
|
195
|
-
let Z = !1,
|
|
196
|
-
const
|
|
197
|
-
T.value && (Z = !0,
|
|
198
|
-
},
|
|
194
|
+
}, ke = async () => c.value ? w() : J(), Se = () => w();
|
|
195
|
+
let Z = !1, K = 0, Q = 0;
|
|
196
|
+
const x = 40, Le = (e) => {
|
|
197
|
+
T.value && (Z = !0, K = e.clientX, Q = e.clientY, window.addEventListener("pointerup", Oe, { once: !0, capture: !0 }));
|
|
198
|
+
}, Oe = (e) => {
|
|
199
199
|
if (!Z) return;
|
|
200
200
|
Z = !1;
|
|
201
|
-
const l = e.clientX -
|
|
202
|
-
(o.value === "top" && C > i && s >
|
|
201
|
+
const l = e.clientX - K, s = e.clientY - Q, i = Math.abs(l), C = Math.abs(s);
|
|
202
|
+
(o.value === "top" && C > i && s > x || o.value === "bottom" && C > i && s < -40 || o.value === "left" && i > C && l < -40 || o.value === "right" && i > C && l > x) && w();
|
|
203
203
|
}, Te = 200, Ae = "ease";
|
|
204
|
-
function
|
|
205
|
-
return new Promise((
|
|
206
|
-
e.style.transition = "none", e.style[l] = `${s}px`, e.offsetWidth, e.style.transition = `${l} ${C}ms ${
|
|
204
|
+
function _(e, l, s, i, C = Te, Ee = Ae) {
|
|
205
|
+
return new Promise((ze) => {
|
|
206
|
+
e.style.transition = "none", e.style[l] = `${s}px`, e.offsetWidth, e.style.transition = `${l} ${C}ms ${Ee}`, e.style[l] = `${i}px`;
|
|
207
207
|
const M = () => {
|
|
208
|
-
e.removeEventListener("transitionend", M), e.style.transition = "",
|
|
208
|
+
e.removeEventListener("transitionend", M), e.style.transition = "", ze();
|
|
209
209
|
};
|
|
210
210
|
e.addEventListener("transitionend", M), setTimeout(M, C + 50);
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
|
-
const
|
|
214
|
-
async function
|
|
215
|
-
const s =
|
|
213
|
+
const $e = r(() => o.value === "left" || o.value === "right"), Ie = r(() => o.value === "top" || o.value === "bottom");
|
|
214
|
+
async function ee(e, l = !0) {
|
|
215
|
+
const s = y.value;
|
|
216
216
|
if (!s) {
|
|
217
217
|
v.value = e;
|
|
218
218
|
return;
|
|
@@ -222,14 +222,14 @@ const Ge = ["top", "bottom", "left", "right"], Je = {
|
|
|
222
222
|
v.value = e;
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
|
-
if (!l || e == null ||
|
|
225
|
+
if (!l || e == null || !$e.value) {
|
|
226
226
|
v.value = e;
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
|
-
v.value = e, await A(), await
|
|
229
|
+
v.value = e, await A(), await _(s, "width", i, e);
|
|
230
230
|
}
|
|
231
|
-
async function
|
|
232
|
-
const s =
|
|
231
|
+
async function te(e, l = !0) {
|
|
232
|
+
const s = y.value;
|
|
233
233
|
if (!s) {
|
|
234
234
|
d.value = e;
|
|
235
235
|
return;
|
|
@@ -239,73 +239,77 @@ const Ge = ["top", "bottom", "left", "right"], Je = {
|
|
|
239
239
|
d.value = e;
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
242
|
-
if (!l || e == null ||
|
|
242
|
+
if (!l || e == null || !Ie.value) {
|
|
243
243
|
d.value = e;
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
|
-
d.value = e, await A(), await
|
|
246
|
+
d.value = e, await A(), await _(s, "height", i, e);
|
|
247
247
|
}
|
|
248
|
-
const B = n(null),
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}), X(),
|
|
248
|
+
const B = n(null), le = () => {
|
|
249
|
+
$.component.drawerList[u] && $.component.drawerList[u].isHisonvueComponent && console.warn(`[Hisonvue] The drawer ID is at risk of being duplicated. ${u}`), Ze(I, () => {
|
|
250
|
+
oe(), A(le);
|
|
251
|
+
}), X(), c.value && (P(), A(G)), B.value = {
|
|
252
252
|
isHisonvueComponent: !0,
|
|
253
|
-
getId: () =>
|
|
253
|
+
getId: () => u,
|
|
254
254
|
getType: () => "drawer",
|
|
255
|
-
isVisible: () =>
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
isVisible: () => k.value,
|
|
256
|
+
isOpen: () => c.value,
|
|
257
|
+
open: J,
|
|
258
|
+
close: w,
|
|
259
|
+
toggle: ke,
|
|
260
|
+
setVisible: (e) => {
|
|
261
|
+
k.value = !!e;
|
|
262
|
+
},
|
|
260
263
|
getZIndex: () => g.value,
|
|
261
264
|
setZIndex: (e) => {
|
|
262
265
|
g.value = e;
|
|
263
266
|
},
|
|
264
267
|
getPosition: () => o.value,
|
|
265
268
|
setPosition: (e) => {
|
|
266
|
-
o.value = e, t.enterAnimationClass || (
|
|
269
|
+
o.value = e, t.enterAnimationClass || (h.value = E[o.value]), t.leaveAnimationClass || (m.value = z[o.value]);
|
|
267
270
|
},
|
|
268
271
|
getWidth: () => v.value,
|
|
269
|
-
setWidth: (e, l = !0) =>
|
|
272
|
+
setWidth: (e, l = !0) => ee(e, l),
|
|
270
273
|
getHeight: () => d.value,
|
|
271
|
-
setHeight: (e, l = !0) =>
|
|
274
|
+
setHeight: (e, l = !0) => te(e, l),
|
|
272
275
|
isSwipeCloseEnabled: () => T.value,
|
|
273
276
|
setSwipeCloseEnabled: (e) => {
|
|
274
277
|
T.value = e;
|
|
275
278
|
},
|
|
276
|
-
isCloseButtonVisible: () =>
|
|
279
|
+
isCloseButtonVisible: () => O.value,
|
|
277
280
|
setCloseButtonVisible: (e) => {
|
|
278
|
-
|
|
281
|
+
O.value = e;
|
|
279
282
|
},
|
|
280
|
-
isOverlayShown: () =>
|
|
283
|
+
isOverlayShown: () => S.value,
|
|
281
284
|
setOverlayShown: (e) => {
|
|
282
|
-
|
|
285
|
+
S.value = e;
|
|
283
286
|
},
|
|
284
|
-
isCloseClickOverlay: () =>
|
|
287
|
+
isCloseClickOverlay: () => L.value,
|
|
285
288
|
setCloseClickOverlay: (e) => {
|
|
286
|
-
|
|
289
|
+
L.value = e;
|
|
287
290
|
},
|
|
288
291
|
isScrollLocked: () => p.value,
|
|
289
292
|
setScrollLock: (e) => {
|
|
290
|
-
p.value = e,
|
|
293
|
+
p.value = e, c.value && (e ? P() : H());
|
|
291
294
|
},
|
|
292
295
|
isBorder: () => b.value,
|
|
293
296
|
setBorder: (e) => {
|
|
294
297
|
b.value = e;
|
|
295
298
|
},
|
|
296
|
-
getAnimationClasses: () => ({ enter:
|
|
299
|
+
getAnimationClasses: () => ({ enter: h.value, leave: m.value }),
|
|
297
300
|
setAnimationClasses: (e) => {
|
|
298
|
-
"enter" in e && (
|
|
301
|
+
"enter" in e && (h.value = e.enter || ""), "leave" in e && (m.value = e.leave || "");
|
|
299
302
|
},
|
|
300
|
-
reload: () =>
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
|
|
303
|
+
reload: () => Me(I)
|
|
304
|
+
}, $.component.drawerList[u] = B.value, f("mounted", B.value);
|
|
305
|
+
}, oe = () => {
|
|
306
|
+
je(I), delete $.component.drawerList[u], c.value && H();
|
|
304
307
|
};
|
|
305
|
-
return
|
|
306
|
-
X(),
|
|
308
|
+
return Pe(le), He(oe), a(N, (e) => {
|
|
309
|
+
X(), f("responsive-change", e);
|
|
307
310
|
}), a(() => t.visible, (e) => {
|
|
308
|
-
|
|
311
|
+
const l = !!e;
|
|
312
|
+
l !== k.value && (k.value = l);
|
|
309
313
|
}), a(() => t.zIndex, (e) => {
|
|
310
314
|
const l = Number(e);
|
|
311
315
|
Number.isFinite(l) && l !== g.value && (g.value = l);
|
|
@@ -314,24 +318,24 @@ const Ge = ["top", "bottom", "left", "right"], Je = {
|
|
|
314
318
|
l !== b.value && (b.value = l);
|
|
315
319
|
}), a(() => t.showOverlay, (e) => {
|
|
316
320
|
const l = !!e;
|
|
317
|
-
l !==
|
|
321
|
+
l !== S.value && (S.value = l);
|
|
318
322
|
}), a(() => t.closeClickOverlay, (e) => {
|
|
319
323
|
const l = !!e;
|
|
320
|
-
l !==
|
|
324
|
+
l !== L.value && (L.value = l);
|
|
321
325
|
}), a(() => t.scrollLock, (e) => {
|
|
322
326
|
const l = !!e;
|
|
323
|
-
l !== p.value && (p.value = l,
|
|
327
|
+
l !== p.value && (p.value = l, c.value && (l ? P() : H()));
|
|
324
328
|
}), a(() => t.position, (e) => {
|
|
325
|
-
e && e !== o.value && (o.value = e, t.enterAnimationClass || (
|
|
329
|
+
e && e !== o.value && (o.value = e, t.enterAnimationClass || (h.value = E[o.value]), t.leaveAnimationClass || (m.value = z[o.value]));
|
|
326
330
|
}), a(() => t.width, (e) => {
|
|
327
331
|
const l = e == null ? null : Number(e);
|
|
328
|
-
l !== v.value &&
|
|
332
|
+
l !== v.value && ee(l, !1);
|
|
329
333
|
}), a(() => t.height, (e) => {
|
|
330
334
|
const l = e == null ? null : Number(e);
|
|
331
|
-
l !== d.value &&
|
|
335
|
+
l !== d.value && te(l, !1);
|
|
332
336
|
}), a(() => t.closeButtonVisible, (e) => {
|
|
333
337
|
const l = !!e;
|
|
334
|
-
l !==
|
|
338
|
+
l !== O.value && (O.value = l);
|
|
335
339
|
}), a(() => t.closeButtonText, (e) => {
|
|
336
340
|
const l = e ?? "X";
|
|
337
341
|
l !== q.value && (q.value = l);
|
|
@@ -342,60 +346,60 @@ const Ge = ["top", "bottom", "left", "right"], Je = {
|
|
|
342
346
|
const l = !!e;
|
|
343
347
|
l !== T.value && (T.value = l);
|
|
344
348
|
}), a(() => t.enterAnimationClass, (e) => {
|
|
345
|
-
const l = e || I[o.value];
|
|
346
|
-
l !== m.value && (m.value = l);
|
|
347
|
-
}), a(() => t.leaveAnimationClass, (e) => {
|
|
348
349
|
const l = e || E[o.value];
|
|
349
|
-
l !==
|
|
350
|
+
l !== h.value && (h.value = l);
|
|
351
|
+
}), a(() => t.leaveAnimationClass, (e) => {
|
|
352
|
+
const l = e || z[o.value];
|
|
353
|
+
l !== m.value && (m.value = l);
|
|
350
354
|
}), a(() => t.class, () => X()), {
|
|
351
|
-
id:
|
|
355
|
+
id: u,
|
|
352
356
|
props: t,
|
|
353
357
|
wrapperRef: W,
|
|
354
|
-
drawerRef:
|
|
358
|
+
drawerRef: y,
|
|
355
359
|
position: o,
|
|
356
|
-
visibleClass:
|
|
357
|
-
responsiveClassList:
|
|
358
|
-
childClassList:
|
|
359
|
-
borderClass:
|
|
360
|
-
backgroundTypeClass:
|
|
361
|
-
wrapperStyle:
|
|
362
|
-
overlayStyleWithZ:
|
|
363
|
-
isOverlayVisible:
|
|
364
|
-
sizeStyle:
|
|
365
|
-
closeButtonVisible:
|
|
366
|
-
closeButtonBorder:
|
|
367
|
-
closeButtonBackgroundType:
|
|
360
|
+
visibleClass: he,
|
|
361
|
+
responsiveClassList: V,
|
|
362
|
+
childClassList: me,
|
|
363
|
+
borderClass: ye,
|
|
364
|
+
backgroundTypeClass: fe,
|
|
365
|
+
wrapperStyle: ge,
|
|
366
|
+
overlayStyleWithZ: be,
|
|
367
|
+
isOverlayVisible: we,
|
|
368
|
+
sizeStyle: pe,
|
|
369
|
+
closeButtonVisible: O,
|
|
370
|
+
closeButtonBorder: ve,
|
|
371
|
+
closeButtonBackgroundType: de,
|
|
368
372
|
closeButtonText: q,
|
|
369
373
|
closeButtonTitle: U,
|
|
370
|
-
onOverlayClick:
|
|
371
|
-
onClickClose:
|
|
372
|
-
onSwipePointerDown:
|
|
373
|
-
drawerMethods:
|
|
374
|
+
onOverlayClick: Ce,
|
|
375
|
+
onClickClose: Se,
|
|
376
|
+
onSwipePointerDown: Le,
|
|
377
|
+
drawerMethods: r(() => j(B))
|
|
374
378
|
};
|
|
375
379
|
}
|
|
376
380
|
});
|
|
377
|
-
function
|
|
378
|
-
const W =
|
|
379
|
-
return
|
|
381
|
+
function xe(t, f, ce, u, I, N) {
|
|
382
|
+
const W = Re("HButton");
|
|
383
|
+
return ne(), se("div", {
|
|
380
384
|
class: R(["hison-layer-host", t.visibleClass])
|
|
381
385
|
}, [
|
|
382
|
-
t.isOverlayVisible ? (
|
|
386
|
+
t.isOverlayVisible ? (ne(), se("div", {
|
|
383
387
|
key: 0,
|
|
384
388
|
class: "hison-drawer-overlay",
|
|
385
389
|
style: F(t.overlayStyleWithZ),
|
|
386
|
-
onClick:
|
|
390
|
+
onClick: f[0] || (f[0] = (...y) => t.onOverlayClick && t.onOverlayClick(...y))
|
|
387
391
|
}, null, 4)) : Y("", !0),
|
|
388
|
-
|
|
392
|
+
ae("div", {
|
|
389
393
|
ref: "wrapperRef",
|
|
390
394
|
class: R(["hison-drawer-wrapper", `hison-pos-${t.position}`, ...t.responsiveClassList]),
|
|
391
395
|
style: F(t.wrapperStyle)
|
|
392
396
|
}, [
|
|
393
|
-
|
|
397
|
+
ae("div", {
|
|
394
398
|
ref: "drawerRef",
|
|
395
399
|
class: R(["hison-drawer", t.borderClass, t.backgroundTypeClass]),
|
|
396
400
|
style: F([t.sizeStyle, t.props.style]),
|
|
397
401
|
role: "dialog",
|
|
398
|
-
onPointerdown:
|
|
402
|
+
onPointerdown: f[1] || (f[1] = (...y) => t.onSwipePointerDown && t.onSwipePointerDown(...y))
|
|
399
403
|
}, [
|
|
400
404
|
t.closeButtonVisible ? D(t.$slots, "close-button", {
|
|
401
405
|
key: 0,
|
|
@@ -403,7 +407,7 @@ function Qe(t, y, ue, c, $, N) {
|
|
|
403
407
|
text: t.closeButtonText,
|
|
404
408
|
title: t.closeButtonTitle || "Close"
|
|
405
409
|
}, () => [
|
|
406
|
-
|
|
410
|
+
De(W, {
|
|
407
411
|
id: `hison_drawer_close_${t.id}`,
|
|
408
412
|
class: R(["hison-drawer-close-btn", "hison-pos-right", "hison-pos-top", "hison-size-s", ...t.childClassList]),
|
|
409
413
|
text: t.closeButtonText,
|
|
@@ -411,15 +415,15 @@ function Qe(t, y, ue, c, $, N) {
|
|
|
411
415
|
border: t.closeButtonBorder,
|
|
412
416
|
"background-type": t.closeButtonBackgroundType,
|
|
413
417
|
onClick: t.onClickClose
|
|
414
|
-
},
|
|
415
|
-
default:
|
|
418
|
+
}, Ne({
|
|
419
|
+
default: ie(() => [
|
|
416
420
|
t.$slots["close-label"] ? D(t.$slots, "close-label", { key: 0 }) : Y("", !0)
|
|
417
421
|
]),
|
|
418
422
|
_: 2
|
|
419
423
|
}, [
|
|
420
424
|
t.$slots["close-icon"] ? {
|
|
421
425
|
name: "icon",
|
|
422
|
-
fn:
|
|
426
|
+
fn: ie(() => [
|
|
423
427
|
D(t.$slots, "close-icon")
|
|
424
428
|
]),
|
|
425
429
|
key: "0"
|
|
@@ -431,7 +435,7 @@ function Qe(t, y, ue, c, $, N) {
|
|
|
431
435
|
], 6)
|
|
432
436
|
], 2);
|
|
433
437
|
}
|
|
434
|
-
const
|
|
438
|
+
const ot = /* @__PURE__ */ Ge(Qe, [["render", xe]]);
|
|
435
439
|
export {
|
|
436
|
-
|
|
440
|
+
ot as default
|
|
437
441
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as Ee, ref as o, computed as v, onMounted as Oe, onBeforeUnmount as Me, watch as i, nextTick as c, unref as ae, createElementBlock as j, openBlock as U, normalizeStyle as $, normalizeClass as P, createElementVNode as A, withKeys as ie, withModifiers as se, renderSlot as Te, toDisplayString as ue, createCommentVNode as xe, Fragment as Le, renderList as De } from "vue";
|
|
2
|
-
import { T as He, w as b, D as ke, x as Ve, E as Re, y as Z, g as $e, u as ze, e as Be, t as Fe, b as re, h as N, r as qe, c as je, d as Ue } from "./index-
|
|
3
|
-
import { a as Pe, r as Ge } from "./setButtonCssEvent-
|
|
2
|
+
import { T as He, w as b, D as ke, x as Ve, E as Re, y as Z, g as $e, u as ze, e as Be, t as Fe, b as re, h as N, r as qe, c as je, d as Ue } from "./index-q_fzCRqA.mjs";
|
|
3
|
+
import { a as Pe, r as Ge } from "./setButtonCssEvent-YKTJlBkM.mjs";
|
|
4
4
|
import { _ as Ye } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
5
|
const Ke = {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),o=require("./index-DeOa0YJA.js"),X=require("./setButtonCssEvent-DK69MUM5.js"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ge={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},toggleStyle:{type:[String,Object,Array],required:!1},menuStyle:{type:[String,Object,Array],required:!1},itemStyle:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},editMode:{type:String,default:o.EditMode.editable,validator:n=>o.EDIT_MODE_VALUES.includes(n)},placeholder:{type:String,default:""},trigger:{type:String,default:o.DropdownTrigger.click,validator:n=>o.DROPDOWN_TRIGGER_VALUES.includes(n)},modelValue:{type:Object,required:!0},maxHeight:{type:Number,default:240,validator:n=>Number.isFinite(n)&&n>=0},closeOnSelect:{type:Boolean,default:!0},textAlign:{type:String,default:o.TextAlign.left,validator:n=>o.TEXT_ALIGN_VALUES.includes(n)},animate:{type:Boolean,default:!0},duration:{type:Number,default:500,validator:n=>Number.isFinite(n)&&n>=0},easing:{type:String,default:"ease"},tabIndex:{type:[Number,String],default:null,validator:n=>n===null||n===""||!isNaN(+n)&&isFinite(+n)},zIndex:{type:Number,default:1050}},fe=t.defineComponent({name:"HDropdown",props:ge,inheritAttrs:!1,emits:["mounted","responsive-change","open","close","toggle-click","item-click","change","update:modelValue"],setup(n,{emit:i}){var K,Y;const g=n.id||o.getUUID(),V=`hdropdown:${g}`,s=t.ref(null),p=t.ref(null),a=o.useDevice(),r=t.ref(!1),c=t.ref(((K=n.modelValue)==null?void 0:K.options)??[]),d=t.ref(((Y=n.modelValue)==null?void 0:Y.value)??null),y=t.ref(!!n.visible),b=t.ref(n.editMode),S=t.computed(()=>b.value===o.EditMode.disable),C=t.computed(()=>b.value===o.EditMode.readonly),L=t.ref(n.placeholder||""),T=t.ref(n.trigger),x=t.ref(n.textAlign??o.TextAlign.left),Z=t.computed(()=>({textAlign:x.value})),E=t.ref(n.animate??!0),A=t.ref(n.duration??500),N=t.ref(n.easing??"ease"),k=t.ref(n.tabIndex!==null&&n.tabIndex!==""?Number(n.tabIndex):null),I=t.ref(n.zIndex??1100),J=t.computed(()=>({"--hdd-duration":`${A.value}ms`,"--hdd-easing":N.value})),Q=t.computed(()=>y.value?"":"hison-display-none"),_=t.computed(()=>S.value?"hison-disable":""),ee=t.computed(()=>C.value?"hison-readonly":""),z=t.ref([]),D=()=>{z.value=o.extractResponsiveClasses(o.toClassString(n.class)||"",a.value),o.addComponentNameToClass(z.value,"size",o.hisonCloser.componentStyle.size),o.addComponentNameToClass(z.value,"color","primary")},F=t.computed(()=>{const e=c.value.find(l=>l.value===d.value);return(e==null?void 0:e.label)??""}),h=t.ref(n.maxHeight??240),te=t.computed(()=>({maxHeight:`${h.value}px`,overflowY:"auto"})),M=t.ref(n.closeOnSelect??!0),ne=t.computed(()=>{const e=c.value.findIndex(l=>l.value===d.value);return e>=0?`opt-${e}`:void 0}),j=t.ref({}),w=t.ref(!0),B=0,le=120;function oe(){if(!p.value)return 0;const e=p.value.querySelector(".hison-dropdown-panel-inner");return e&&e.scrollHeight||0}function u(){if(!r.value||!s.value)return;const e=s.value.getBoundingClientRect(),l=window.innerHeight,v=e.width,m=e.left,W=l-e.bottom,se=e.top;w.value=W>=le;const re=oe(),ue=w.value?W-B:se-B,q=Math.max(0,Math.min(re||h.value,h.value,ue)),de=w.value?e.bottom+B:e.top-q-B,ce=getComputedStyle(s.value).fontSize||"inherit";j.value={position:"fixed",left:`${m}px`,top:`${de}px`,width:`${v}px`,height:w.value?"auto":`${q}px`,maxHeight:`${q}px`,overflowY:"auto",zIndex:String(I.value),fontSize:ce,transformOrigin:w.value?"top center":"bottom center"}}function H(){r.value&&u()}const U=e=>{if(!r.value)return;const l=e.target,v=!!s.value&&!!l&&s.value.contains(l),m=!!p.value&&!!l&&p.value.contains(l);!v&&!m&&O()},R=e=>{S.value||C.value||!y.value||r.value||(r.value=!0,t.nextTick(()=>{u(),requestAnimationFrame(()=>u())}),i("open",e??null,f.value))},O=e=>{var m;if(!r.value)return;const l=document.activeElement,v=p.value;v&&l&&v.contains(l)&&((m=s.value)==null||m.focus()),r.value=!1,i("close",e??null,f.value)},$=e=>r.value?O(e):R(e),ie=e=>{T.value==="click"&&(S.value||C.value||(i("toggle-click",e,f.value),$(e)))},ae=(e,l)=>{if(e.disabled||S.value||C.value)return;l&&i("item-click",l,f.value,e);const v=d.value;if(e.value!==v){d.value=e.value;const m={value:d.value,options:t.unref(c)};i("update:modelValue",m),i("change",v,d.value,f.value)}M.value&&O(l)},f=t.ref(null),P=()=>{o.hisonCloser.component.dropdownList[g]&&o.hisonCloser.component.dropdownList[g].isHisonvueComponent&&console.warn(`[Hisonvue] The dropdown ID is at risk of being duplicated. ${g}`),o.registerReloadable(V,()=>{G(),t.nextTick(P)}),s.value&&X.addButtonCssEvent(s.value),D(),f.value={isHisonvueComponent:!0,getId:()=>g,getType:()=>"dropdown",isVisible:()=>y.value,setVisible:e=>{y.value=e},getEditMode:()=>b.value,setEditMode:e=>{b.value=e},isOpen:()=>r.value,open:R,close:O,toggle:$,getValue:()=>d.value,setValue:e=>{d.value=e},getText:()=>F.value,getOptions:()=>t.unref(c),setOptions:e=>{c.value=Array.isArray(e)?e:[]},setTriggerType:e=>{T.value=e},getMaxHeight:()=>h.value,setMaxHeight:e=>{const l=Number(e);!Number.isFinite(l)||l<0||(h.value=l,t.nextTick(u))},isCloseOnSelect:()=>M.value,setCloseOnSelect:e=>{M.value=!!e},getTextAlign:()=>x.value,setTextAlign:e=>{(e===o.TextAlign.left||e===o.TextAlign.center||e===o.TextAlign.right)&&(x.value=e,t.nextTick(u))},getAnimate:()=>E.value,setAnimate:e=>{E.value=!!e},getDuration:()=>A.value,setDuration:e=>{const l=Number(e);Number.isFinite(l)&&l>=0&&(A.value=l)},getEasing:()=>N.value,setEasing:e=>{typeof e=="string"&&(N.value=e)},getTabIndex:()=>k.value,setTabIndex:e=>{k.value=e!=null?Number(e):null},getZIndex:()=>I.value,setZIndex:e=>{I.value=e},focus:()=>{var e;(e=s.value)==null||e.focus()},reload:()=>o.reloadHisonComponent(V)},o.hisonCloser.component.dropdownList[g]=f.value,document.addEventListener("mousedown",U),window.addEventListener("scroll",H,!0),window.addEventListener("resize",H),t.nextTick(u),i("mounted",f.value)},G=()=>{var e;o.unregisterReloadable(V);try{document.removeEventListener("mousedown",U)}catch{}try{window.removeEventListener("scroll",H,!0)}catch{}try{window.removeEventListener("resize",H)}catch{}s.value&&X.removeButtonCssEvent(s.value),(e=o.hisonCloser.component)!=null&&e.dropdownList&&delete o.hisonCloser.component.dropdownList[g]};return t.onMounted(P),t.onBeforeUnmount(G),t.watch(()=>n.modelValue,e=>{!e||typeof e!="object"||(Array.isArray(e.options)&&(c.value=e.options),d.value=e.value,t.nextTick(u))},{deep:!0}),t.watch(a,e=>{D(),i("responsive-change",e),t.nextTick(u)}),t.watch(()=>n.visible,e=>{!!e!==y.value&&(y.value=!!e)}),t.watch(()=>n.editMode,e=>{e&&e!==b.value&&(b.value=e)}),t.watch(()=>n.placeholder,e=>{const l=e??"";l!==L.value&&(L.value=l)}),t.watch(()=>n.trigger,e=>{e&&e!==T.value&&(T.value=e)}),t.watch(()=>n.textAlign,e=>{(e===o.TextAlign.left||e===o.TextAlign.center||e===o.TextAlign.right)&&e!==x.value&&(x.value=e,t.nextTick(u))}),t.watch(()=>n.animate,e=>{const l=!!e;l!==E.value&&(E.value=l)}),t.watch(()=>n.duration,e=>{const l=Number(e);Number.isFinite(l)&&l>=0&&l!==A.value&&(A.value=l)}),t.watch(()=>n.easing,e=>{const l=typeof e=="string"?e:"ease";l!==N.value&&(N.value=l)}),t.watch(()=>n.tabIndex,e=>{const l=e===null||e===""?null:Number(e);l!==k.value&&(k.value=l)}),t.watch(()=>n.maxHeight,e=>{const l=Number(e);Number.isFinite(l)&&l>=0&&l!==h.value&&(h.value=l,t.nextTick(u))}),t.watch(()=>n.closeOnSelect,e=>{const l=!!e;l!==M.value&&(M.value=l)}),t.watch(()=>n.class,()=>{D(),t.nextTick(u)}),t.watch(()=>n.zIndex,e=>{const l=Number(e);Number.isFinite(l)&&l!==I.value&&(I.value=l)}),{toggleRef:s,menuRef:p,props:n,isDisabled:S,isReadonly:C,visibleClass:Q,disableClass:_,readonlyClass:ee,responsiveClassList:z,isOpen:r,trigger:T,selectedValue:d,selectedLabel:F,placeholder:L,activeDescId:ne,menuInlineStyle:te,options:c,animate:E,rootInlineStyle:J,tabIndex:k,fixedMenuStyle:j,openBelow:w,onToggleClick:ie,onSelect:ae,textAlignStyle:Z,open:R,close:O,toggle:$}}}),me=["aria-expanded","aria-disabled","tabindex"],pe={class:"hison-dropdown-label"},he=["aria-activedescendant","inert"],ye={class:"hison-dropdown-panel"},be=["aria-selected","onClick"],we={key:0,class:"hison-dropdown-empty"};function Se(n,i,g,V,s,p){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-dropdown",...n.responsiveClassList,n.visibleClass,n.disableClass,n.readonlyClass,n.isOpen?"hison-open":"",n.animate?"":"hison-no-anim"]),style:t.normalizeStyle([n.rootInlineStyle,n.props.style]),onMouseenter:i[3]||(i[3]=a=>n.trigger==="hover"?n.open(a):null),onMouseleave:i[4]||(i[4]=a=>n.trigger==="hover"?n.close(a):null)},[t.createElementVNode("div",{ref:"toggleRef",class:t.normalizeClass(["hison-dropdown-toggle",[n.isDisabled?"hison-disable":"",n.isReadonly?"hison-readonly":""]]),"aria-expanded":n.isOpen,role:"combobox","aria-disabled":n.isDisabled||n.isReadonly?"true":"false",tabindex:n.tabIndex??void 0,style:t.normalizeStyle([n.textAlignStyle,n.props.toggleStyle]),onClick:i[0]||(i[0]=a=>n.onToggleClick(a)),onKeydown:[i[1]||(i[1]=t.withKeys(t.withModifiers(a=>n.onToggleClick(a),["prevent"]),["enter"])),i[2]||(i[2]=t.withKeys(t.withModifiers(a=>n.onToggleClick(a),["prevent"]),["space"]))]},[t.createElementVNode("span",pe,t.toDisplayString(n.selectedLabel||n.placeholder),1),t.renderSlot(n.$slots,"caret",{},()=>[i[5]||(i[5]=t.createElementVNode("span",{class:"hison-dropdown-caret"},"▾",-1))])],46,me),t.createElementVNode("div",{ref:"menuRef",class:t.normalizeClass(["hison-dropdown-menu hison-dropdown-menu-fixed",[n.isOpen?"hison-open":"",n.openBelow?"hison-open-below":"hison-open-above"]]),style:t.normalizeStyle([n.fixedMenuStyle,n.textAlignStyle,n.props.menuStyle]),role:"listbox","aria-activedescendant":n.activeDescId,inert:!n.isOpen||void 0},[t.createElementVNode("div",ye,[t.createElementVNode("div",{class:"hison-dropdown-panel-inner",style:t.normalizeStyle(n.menuInlineStyle)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.options,(a,r)=>(t.openBlock(),t.createElementBlock("div",{key:`opt-${r}`,class:t.normalizeClass(["hison-dropdown-item",[a.disabled?"hison-disable":"",a.value===n.selectedValue?"hison-selected":""]]),style:t.normalizeStyle(n.props.itemStyle),role:"option","aria-selected":a.value===n.selectedValue?"true":"false",onClick:c=>n.onSelect(a,c)},t.toDisplayString(a.label),15,be))),128)),n.options.length===0?(t.openBlock(),t.createElementBlock("div",we,"No options")):t.createCommentVNode("",!0)],4)])],14,he)],38)}const Ce=ve._export_sfc(fe,[["render",Se]]);exports.default=Ce;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),o=require("./index-Bv6aEJhv.js"),X=require("./setButtonCssEvent-Dk2GorRb.js"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ge={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},toggleStyle:{type:[String,Object,Array],required:!1},menuStyle:{type:[String,Object,Array],required:!1},itemStyle:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},editMode:{type:String,default:o.EditMode.editable,validator:n=>o.EDIT_MODE_VALUES.includes(n)},placeholder:{type:String,default:""},trigger:{type:String,default:o.DropdownTrigger.click,validator:n=>o.DROPDOWN_TRIGGER_VALUES.includes(n)},modelValue:{type:Object,required:!0},maxHeight:{type:Number,default:240,validator:n=>Number.isFinite(n)&&n>=0},closeOnSelect:{type:Boolean,default:!0},textAlign:{type:String,default:o.TextAlign.left,validator:n=>o.TEXT_ALIGN_VALUES.includes(n)},animate:{type:Boolean,default:!0},duration:{type:Number,default:500,validator:n=>Number.isFinite(n)&&n>=0},easing:{type:String,default:"ease"},tabIndex:{type:[Number,String],default:null,validator:n=>n===null||n===""||!isNaN(+n)&&isFinite(+n)},zIndex:{type:Number,default:1050}},fe=t.defineComponent({name:"HDropdown",props:ge,inheritAttrs:!1,emits:["mounted","responsive-change","open","close","toggle-click","item-click","change","update:modelValue"],setup(n,{emit:i}){var K,Y;const g=n.id||o.getUUID(),V=`hdropdown:${g}`,s=t.ref(null),p=t.ref(null),a=o.useDevice(),r=t.ref(!1),c=t.ref(((K=n.modelValue)==null?void 0:K.options)??[]),d=t.ref(((Y=n.modelValue)==null?void 0:Y.value)??null),y=t.ref(!!n.visible),b=t.ref(n.editMode),S=t.computed(()=>b.value===o.EditMode.disable),C=t.computed(()=>b.value===o.EditMode.readonly),L=t.ref(n.placeholder||""),T=t.ref(n.trigger),x=t.ref(n.textAlign??o.TextAlign.left),Z=t.computed(()=>({textAlign:x.value})),E=t.ref(n.animate??!0),A=t.ref(n.duration??500),N=t.ref(n.easing??"ease"),k=t.ref(n.tabIndex!==null&&n.tabIndex!==""?Number(n.tabIndex):null),I=t.ref(n.zIndex??1100),J=t.computed(()=>({"--hdd-duration":`${A.value}ms`,"--hdd-easing":N.value})),Q=t.computed(()=>y.value?"":"hison-display-none"),_=t.computed(()=>S.value?"hison-disable":""),ee=t.computed(()=>C.value?"hison-readonly":""),z=t.ref([]),D=()=>{z.value=o.extractResponsiveClasses(o.toClassString(n.class)||"",a.value),o.addComponentNameToClass(z.value,"size",o.hisonCloser.componentStyle.size),o.addComponentNameToClass(z.value,"color","primary")},F=t.computed(()=>{const e=c.value.find(l=>l.value===d.value);return(e==null?void 0:e.label)??""}),h=t.ref(n.maxHeight??240),te=t.computed(()=>({maxHeight:`${h.value}px`,overflowY:"auto"})),M=t.ref(n.closeOnSelect??!0),ne=t.computed(()=>{const e=c.value.findIndex(l=>l.value===d.value);return e>=0?`opt-${e}`:void 0}),j=t.ref({}),w=t.ref(!0),B=0,le=120;function oe(){if(!p.value)return 0;const e=p.value.querySelector(".hison-dropdown-panel-inner");return e&&e.scrollHeight||0}function u(){if(!r.value||!s.value)return;const e=s.value.getBoundingClientRect(),l=window.innerHeight,v=e.width,m=e.left,W=l-e.bottom,se=e.top;w.value=W>=le;const re=oe(),ue=w.value?W-B:se-B,q=Math.max(0,Math.min(re||h.value,h.value,ue)),de=w.value?e.bottom+B:e.top-q-B,ce=getComputedStyle(s.value).fontSize||"inherit";j.value={position:"fixed",left:`${m}px`,top:`${de}px`,width:`${v}px`,height:w.value?"auto":`${q}px`,maxHeight:`${q}px`,overflowY:"auto",zIndex:String(I.value),fontSize:ce,transformOrigin:w.value?"top center":"bottom center"}}function H(){r.value&&u()}const U=e=>{if(!r.value)return;const l=e.target,v=!!s.value&&!!l&&s.value.contains(l),m=!!p.value&&!!l&&p.value.contains(l);!v&&!m&&O()},R=e=>{S.value||C.value||!y.value||r.value||(r.value=!0,t.nextTick(()=>{u(),requestAnimationFrame(()=>u())}),i("open",e??null,f.value))},O=e=>{var m;if(!r.value)return;const l=document.activeElement,v=p.value;v&&l&&v.contains(l)&&((m=s.value)==null||m.focus()),r.value=!1,i("close",e??null,f.value)},$=e=>r.value?O(e):R(e),ie=e=>{T.value==="click"&&(S.value||C.value||(i("toggle-click",e,f.value),$(e)))},ae=(e,l)=>{if(e.disabled||S.value||C.value)return;l&&i("item-click",l,f.value,e);const v=d.value;if(e.value!==v){d.value=e.value;const m={value:d.value,options:t.unref(c)};i("update:modelValue",m),i("change",v,d.value,f.value)}M.value&&O(l)},f=t.ref(null),P=()=>{o.hisonCloser.component.dropdownList[g]&&o.hisonCloser.component.dropdownList[g].isHisonvueComponent&&console.warn(`[Hisonvue] The dropdown ID is at risk of being duplicated. ${g}`),o.registerReloadable(V,()=>{G(),t.nextTick(P)}),s.value&&X.addButtonCssEvent(s.value),D(),f.value={isHisonvueComponent:!0,getId:()=>g,getType:()=>"dropdown",isVisible:()=>y.value,setVisible:e=>{y.value=e},getEditMode:()=>b.value,setEditMode:e=>{b.value=e},isOpen:()=>r.value,open:R,close:O,toggle:$,getValue:()=>d.value,setValue:e=>{d.value=e},getText:()=>F.value,getOptions:()=>t.unref(c),setOptions:e=>{c.value=Array.isArray(e)?e:[]},setTriggerType:e=>{T.value=e},getMaxHeight:()=>h.value,setMaxHeight:e=>{const l=Number(e);!Number.isFinite(l)||l<0||(h.value=l,t.nextTick(u))},isCloseOnSelect:()=>M.value,setCloseOnSelect:e=>{M.value=!!e},getTextAlign:()=>x.value,setTextAlign:e=>{(e===o.TextAlign.left||e===o.TextAlign.center||e===o.TextAlign.right)&&(x.value=e,t.nextTick(u))},getAnimate:()=>E.value,setAnimate:e=>{E.value=!!e},getDuration:()=>A.value,setDuration:e=>{const l=Number(e);Number.isFinite(l)&&l>=0&&(A.value=l)},getEasing:()=>N.value,setEasing:e=>{typeof e=="string"&&(N.value=e)},getTabIndex:()=>k.value,setTabIndex:e=>{k.value=e!=null?Number(e):null},getZIndex:()=>I.value,setZIndex:e=>{I.value=e},focus:()=>{var e;(e=s.value)==null||e.focus()},reload:()=>o.reloadHisonComponent(V)},o.hisonCloser.component.dropdownList[g]=f.value,document.addEventListener("mousedown",U),window.addEventListener("scroll",H,!0),window.addEventListener("resize",H),t.nextTick(u),i("mounted",f.value)},G=()=>{var e;o.unregisterReloadable(V);try{document.removeEventListener("mousedown",U)}catch{}try{window.removeEventListener("scroll",H,!0)}catch{}try{window.removeEventListener("resize",H)}catch{}s.value&&X.removeButtonCssEvent(s.value),(e=o.hisonCloser.component)!=null&&e.dropdownList&&delete o.hisonCloser.component.dropdownList[g]};return t.onMounted(P),t.onBeforeUnmount(G),t.watch(()=>n.modelValue,e=>{!e||typeof e!="object"||(Array.isArray(e.options)&&(c.value=e.options),d.value=e.value,t.nextTick(u))},{deep:!0}),t.watch(a,e=>{D(),i("responsive-change",e),t.nextTick(u)}),t.watch(()=>n.visible,e=>{!!e!==y.value&&(y.value=!!e)}),t.watch(()=>n.editMode,e=>{e&&e!==b.value&&(b.value=e)}),t.watch(()=>n.placeholder,e=>{const l=e??"";l!==L.value&&(L.value=l)}),t.watch(()=>n.trigger,e=>{e&&e!==T.value&&(T.value=e)}),t.watch(()=>n.textAlign,e=>{(e===o.TextAlign.left||e===o.TextAlign.center||e===o.TextAlign.right)&&e!==x.value&&(x.value=e,t.nextTick(u))}),t.watch(()=>n.animate,e=>{const l=!!e;l!==E.value&&(E.value=l)}),t.watch(()=>n.duration,e=>{const l=Number(e);Number.isFinite(l)&&l>=0&&l!==A.value&&(A.value=l)}),t.watch(()=>n.easing,e=>{const l=typeof e=="string"?e:"ease";l!==N.value&&(N.value=l)}),t.watch(()=>n.tabIndex,e=>{const l=e===null||e===""?null:Number(e);l!==k.value&&(k.value=l)}),t.watch(()=>n.maxHeight,e=>{const l=Number(e);Number.isFinite(l)&&l>=0&&l!==h.value&&(h.value=l,t.nextTick(u))}),t.watch(()=>n.closeOnSelect,e=>{const l=!!e;l!==M.value&&(M.value=l)}),t.watch(()=>n.class,()=>{D(),t.nextTick(u)}),t.watch(()=>n.zIndex,e=>{const l=Number(e);Number.isFinite(l)&&l!==I.value&&(I.value=l)}),{toggleRef:s,menuRef:p,props:n,isDisabled:S,isReadonly:C,visibleClass:Q,disableClass:_,readonlyClass:ee,responsiveClassList:z,isOpen:r,trigger:T,selectedValue:d,selectedLabel:F,placeholder:L,activeDescId:ne,menuInlineStyle:te,options:c,animate:E,rootInlineStyle:J,tabIndex:k,fixedMenuStyle:j,openBelow:w,onToggleClick:ie,onSelect:ae,textAlignStyle:Z,open:R,close:O,toggle:$}}}),me=["aria-expanded","aria-disabled","tabindex"],pe={class:"hison-dropdown-label"},he=["aria-activedescendant","inert"],ye={class:"hison-dropdown-panel"},be=["aria-selected","onClick"],we={key:0,class:"hison-dropdown-empty"};function Se(n,i,g,V,s,p){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-dropdown",...n.responsiveClassList,n.visibleClass,n.disableClass,n.readonlyClass,n.isOpen?"hison-open":"",n.animate?"":"hison-no-anim"]),style:t.normalizeStyle([n.rootInlineStyle,n.props.style]),onMouseenter:i[3]||(i[3]=a=>n.trigger==="hover"?n.open(a):null),onMouseleave:i[4]||(i[4]=a=>n.trigger==="hover"?n.close(a):null)},[t.createElementVNode("div",{ref:"toggleRef",class:t.normalizeClass(["hison-dropdown-toggle",[n.isDisabled?"hison-disable":"",n.isReadonly?"hison-readonly":""]]),"aria-expanded":n.isOpen,role:"combobox","aria-disabled":n.isDisabled||n.isReadonly?"true":"false",tabindex:n.tabIndex??void 0,style:t.normalizeStyle([n.textAlignStyle,n.props.toggleStyle]),onClick:i[0]||(i[0]=a=>n.onToggleClick(a)),onKeydown:[i[1]||(i[1]=t.withKeys(t.withModifiers(a=>n.onToggleClick(a),["prevent"]),["enter"])),i[2]||(i[2]=t.withKeys(t.withModifiers(a=>n.onToggleClick(a),["prevent"]),["space"]))]},[t.createElementVNode("span",pe,t.toDisplayString(n.selectedLabel||n.placeholder),1),t.renderSlot(n.$slots,"caret",{},()=>[i[5]||(i[5]=t.createElementVNode("span",{class:"hison-dropdown-caret"},"▾",-1))])],46,me),t.createElementVNode("div",{ref:"menuRef",class:t.normalizeClass(["hison-dropdown-menu hison-dropdown-menu-fixed",[n.isOpen?"hison-open":"",n.openBelow?"hison-open-below":"hison-open-above"]]),style:t.normalizeStyle([n.fixedMenuStyle,n.textAlignStyle,n.props.menuStyle]),role:"listbox","aria-activedescendant":n.activeDescId,inert:!n.isOpen||void 0},[t.createElementVNode("div",ye,[t.createElementVNode("div",{class:"hison-dropdown-panel-inner",style:t.normalizeStyle(n.menuInlineStyle)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.options,(a,r)=>(t.openBlock(),t.createElementBlock("div",{key:`opt-${r}`,class:t.normalizeClass(["hison-dropdown-item",[a.disabled?"hison-disable":"",a.value===n.selectedValue?"hison-selected":""]]),style:t.normalizeStyle(n.props.itemStyle),role:"option","aria-selected":a.value===n.selectedValue?"true":"false",onClick:c=>n.onSelect(a,c)},t.toDisplayString(a.label),15,be))),128)),n.options.length===0?(t.openBlock(),t.createElementBlock("div",we,"No options")):t.createCommentVNode("",!0)],4)])],14,he)],38)}const Ce=ve._export_sfc(fe,[["render",Se]]);exports.default=Ce;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as Me, ref as i, computed as N, onMounted as ze, onBeforeUnmount as Ne, watch as o, nextTick as _, resolveComponent as xe, createElementBlock as F, openBlock as T, normalizeClass as x, createElementVNode as O, normalizeStyle as $e, createCommentVNode as de, withModifiers as W, toDisplayString as X, Fragment as re, renderList as Ae, renderSlot as ee, createVNode as ke, withCtx as Be } from "vue";
|
|
2
|
-
import { E as Ee, y as D, g as Le, l as y, u as Oe, j as ve, t as le, h as S, e as je, a as Re, b as fe, r as He, c as Ve, d as Pe } from "./index-
|
|
2
|
+
import { E as Ee, y as D, g as Le, l as y, u as Oe, j as ve, t as le, h as S, e as je, a as Re, b as fe, r as He, c as Ve, d as Pe } from "./index-q_fzCRqA.mjs";
|
|
3
3
|
import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const Je = {
|
|
5
5
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),i=require("./index-Bv6aEJhv.js"),re=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ce={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},editMode:{type:String,default:i.EditMode.editable,validator:t=>i.EDIT_MODE_VALUES.includes(t)},modelValue:{type:Array,default:()=>[]},attId:{type:String,default:""},addButtonText:{type:String,default:"Add"},removeButtonText:{type:String,default:"x"},placeholder:{type:String,default:"There are no files."},enableDrop:{type:Boolean,default:!0},downloadHandler:{type:Function,default:void 0},multiCols:{type:Boolean,default:!1},multiple:{type:Boolean,default:!0},allowedTypes:{type:[String,Array],default:void 0,validator:t=>t===void 0||typeof t=="string"||Array.isArray(t)&&t.every(o=>typeof o=="string")},disallowedTypes:{type:[String,Array],default:void 0,validator:t=>t===void 0||typeof t=="string"||Array.isArray(t)&&t.every(o=>typeof o=="string")},maxFileSize:{type:Number,default:1/0,validator:t=>Number.isFinite(t)&&t>=0||t===1/0},maxTotalFileSize:{type:Number,default:1/0,validator:t=>Number.isFinite(t)&&t>=0||t===1/0},maxFileCount:{type:Number,default:0,validator:t=>Number.isInteger(t)&&t>=0},onDisallowedType:{type:Function,default:void 0},onMaxFileSizeExceeded:{type:Function,default:void 0},onMaxTotalSizeExceeded:{type:Function,default:void 0},tabIndex:{type:[Number,String],default:null,validator:t=>t===null||t===""||!isNaN(+t)&&isFinite(+t)}},fe=l.defineComponent({name:"HFileset",props:ce,emits:["mounted","responsive-change","update:modelValue","add","remove","focus","blur","download","change"],setup(t,{emit:o}){const F=l.ref(null),n=l.ref([...t.modelValue]),m=l.ref(null),c=t.id?t.id:i.getUUID(),N=`hbutton:${c}`,s=l.ref(t.visible),d=l.ref(t.editMode),B=l.computed(()=>d.value===i.EditMode.disable),X=l.computed(()=>d.value===i.EditMode.readonly),Y=l.computed(()=>d.value!==i.EditMode.editable?`hison-fileset-${d.value}`:""),Z=l.computed(()=>s.value?"":"hison-display-none"),j=l.ref(t.attId||""),E=l.ref(t.addButtonText||""),x=l.ref(t.removeButtonText||""),A=l.ref(t.placeholder??""),R=l.ref(!1),M=l.ref(t.enableDrop),$=l.ref(typeof t.downloadHandler=="function"?t.downloadHandler:void 0),O=l.ref(t.multiCols??!1),h=l.ref(t.multiple??!1),H=l.ref(!1),_=l.computed(()=>{if(y.value.length===0)return"";const e=new Set(w.value.map(u=>u.toLowerCase())),a=y.value.filter(u=>!e.has(u.toLowerCase()));return a.length>0?a.join(","):void 0}),y=l.ref(Array.isArray(t.allowedTypes)?t.allowedTypes:t.allowedTypes?t.allowedTypes.split(","):[]),w=l.ref(Array.isArray(t.disallowedTypes)?t.disallowedTypes:t.disallowedTypes?t.disallowedTypes.split(","):[]),b=l.ref(t.maxFileSize??i.hison.getMaxFilesetSize()),C=l.ref(t.maxTotalFileSize??i.hison.getMaxFilesetTotalSize()),D=l.ref(t.maxFileCount),g=l.ref(typeof t.onDisallowedType=="function"?t.onDisallowedType:void 0),z=l.ref(typeof t.onMaxFileSizeExceeded=="function"?t.onMaxFileSizeExceeded:void 0),k=l.ref(typeof t.onMaxTotalSizeExceeded=="function"?t.onMaxTotalSizeExceeded:void 0),L=l.ref(t.tabIndex!==null&&t.tabIndex!==""?Number(t.tabIndex):null),U=i.useDevice(),I=l.ref([]),P=()=>{I.value=i.extractResponsiveClasses(i.toClassString(t.class)||"",U.value),i.getIndexSpecificClassNameFromClassList(I.value,"col")===-1&&I.value.push("hison-col-12"),i.addComponentNameToClass(I.value,"size",i.hisonCloser.componentStyle.size),i.addComponentNameToClass(I.value,"color","primary")},ee=l.computed(()=>{const e=[];return e.push(...i.extractPrefixedClasses(i.toClassString(t.class)||"","size")),e.push(...i.extractPrefixedClasses(i.toClassString(t.class)||"","color")),e}),te=()=>{var e;(e=F.value)==null||e.click()},le=e=>{var r,S,f;const a=e.type,u="."+((r=e.name.split(".").pop())==null?void 0:r.toLowerCase());return y.value.length>0&&!y.value.some(T=>T===a||T===u)?(console.warn(`File type not in allowedTypes: ${a} / ${u}`),(S=g.value)==null||S.call(g,e,y.value,null),!1):w.value.length>0&&w.value.some(T=>T===a||T===u)?(console.warn(`File type is in disallowedTypes: ${a} / ${u}`),(f=g.value)==null||f.call(g,e,null,w.value),!1):!0},ae=e=>{var a;return typeof b.value=="number"&&Number.isFinite(b.value)&&e.size>b.value?(console.warn(`File too large: ${e.name}
|
|
2
2
|
Max size: ${b.value} Byte`),(a=z.value)==null||a.call(z,e,e.size,b.value),!1):!0},q=e=>{var S;let a=e.filter(f=>ae(f)&&le(f));!h.value&&a.length>1&&(a=[a[0]]);let u=!1;const r=[];for(const f of a){let V=n.value.filter(v=>!v.isDeleted),T=V.length;const Q=V.reduce((v,p)=>v+(p.fileSize??0),0)+f.size;if(C.value>0&&Q>C.value){(S=k.value)==null||S.call(k,f,Q,C.value),console.warn("Total file size exceeds limit.");break}if(!h.value){for(const v of V)if(v.isNew){const p=n.value.indexOf(v);p!==-1&&n.value.splice(p,1)}else v.isDeleted=!0;u=!0}if(h.value&&D.value>0&&T>=D.value){const v=n.value.findIndex(p=>!p.isDeleted);if(v!==-1){const p=n.value[v];p.isNew?n.value.splice(v,1):p.isDeleted=!0,u=!0}else{console.warn("No replaceable file found for maxFileCount overflow.");break}}const W={fileName:f.name,fileSize:f.size,extension:f.name.split(".").pop(),file:f,isNew:!0};n.value.push(W),u=!0,r.push(W)}u&&(H.value=!0,o("update:modelValue",[...n.value]),r.length&&o("add",i.hison.utils.deepCopyObject(r),m.value),o("change",i.hison.utils.deepCopyObject(n.value),m.value))},ie=e=>{if(d.value!==i.EditMode.editable)return;const a=n.value[e];a.fileId?a.isDeleted=!0:n.value.splice(e,1),H.value=!0,o("update:modelValue",[...n.value]),o("remove",i.hison.utils.deepCopyObject(a),e,m.value),o("change",i.hison.utils.deepCopyObject(n.value),m.value)},oe=e=>{if(d.value!==i.EditMode.editable)return;const a=e.target.files;!a||a.length===0||(q(Array.from(a)),l.nextTick(()=>{F.value&&(F.value.value="")}))},ne=l.computed(()=>n.value.filter(e=>!e.isDeleted)),se=e=>{if(o("download",i.hison.utils.deepCopyObject(e),m.value),$.value){$.value(e);return}let a="",u=e.fileName||"download";if(e.file){const S=new Blob([e.file],{type:e.file.type});a=URL.createObjectURL(S)}else if(e.filePath)a=e.filePath;else{console.warn("Download failed: no filePath or file object.");return}const r=document.createElement("a");r.href=a,r.download=u,r.click(),e.file&&URL.revokeObjectURL(a)},ue=e=>{!M.value||d.value!==i.EditMode.editable||(R.value=!0)},de=e=>{var a;R.value=!1,!(!M.value||d.value!==i.EditMode.editable)&&(a=e.dataTransfer)!=null&&a.files&&q(Array.from(e.dataTransfer.files))},J=e=>{if(!e||!e.getIsDataModel||!e.getIsDataModel()||e.getRowCount()===0)return;const a=e.getRows();n.value=[...a]},G=()=>{i.hisonCloser.component.filesetList[c]&&i.hisonCloser.component.filesetList[c].isHisonvueComponent&&console.warn(`[Hisonvue] The fileset ID is at risk of being duplicated. ${c}`),i.registerReloadable(N,()=>{K(),l.nextTick(G)}),F.value&&(P(),m.value={isHisonvueComponent:!0,getId:()=>c,getType:()=>"fileset",isVisible:()=>s.value,setVisible:e=>{s.value=e},getEditMode:()=>d.value,setEditMode:e=>{var a;d.value=e,(a=i.hisonCloser.component.buttonList[`hison_fileset_add_button_${c}`])==null||a.setDisable(B.value)},getValue:()=>i.hison.utils.deepCopyObject(n.value),setValue:e=>{n.value=i.hison.utils.deepCopyObject([...e])},getDataModel:()=>n.value.length>0?new i.hison.data.DataModel(n.value):null,setDataModel:e=>{J(e)},load:e=>{e&&e.getIsDataModel&&e.getIsDataModel()?J(e):n.value=i.hison.utils.deepCopyObject([...e])},getAttId:()=>j.value,setAttId:e=>{j.value=e},getAddButtonText:()=>E.value,setAddButtonText:e=>{E.value=e},getRemoveButtonText:()=>x.value,setRemoveButtonText:e=>{x.value=e},isEnableDrop:()=>M.value,setEnableDrop:e=>{M.value=e},setDownloadHandler:e=>{$.value=e},isMultiCols:()=>O.value,setMultiCols:e=>{O.value=e},isMultiple:()=>h.value,setMultiple:e=>{h.value=e},getPlaceholder:()=>A.value,setPlaceholder:e=>{A.value=e},getAllowedTypes:()=>y.value,setAllowedTypes:e=>{y.value=e},getDisallowedTypes:()=>w.value,setDisallowedTypes:e=>{w.value=e},getMaxFileSize:()=>b.value,setMaxFileSize:e=>{b.value=e},getMaxTotalFileSize:()=>C.value,setMaxTotalFileSize:e=>{C.value=e},getMaxFileCount:()=>D.value,setMaxFileCount:e=>{D.value=e},setOnDisallowedType:e=>{g.value=e},setOnMaxFileSizeExceeded:e=>{z.value=e},setOnMaxTotalSizeExceeded:e=>{k.value=e},isModified:()=>H.value,setModified:e=>{H.value=e},getTabIndex:()=>L.value,setTabIndex:e=>{L.value=e!=null?Number(e):null},focus:()=>{var e;(e=i.hisonCloser.component.buttonList[`hison_fileset_add_button_${c}`])==null||e.focus()},reload:()=>i.reloadHisonComponent(N)},i.hisonCloser.component.filesetList[c]=m.value,o("mounted",m.value))},K=()=>{i.unregisterReloadable(N),delete i.hisonCloser.component.filesetList[c]};return l.onMounted(G),l.onBeforeUnmount(K),l.watch(()=>t.modelValue,e=>{JSON.stringify(e)!==JSON.stringify(n.value)&&(n.value=[...e])},{deep:!0}),l.watch(U,e=>{P(),o("responsive-change",e)}),l.watch(()=>t.visible,e=>{const a=!!e;a!==s.value&&(s.value=a)}),l.watch(()=>t.editMode,e=>{e&&e!==d.value&&(d.value=e,l.nextTick(()=>{var a;return(a=i.hisonCloser.component.buttonList[`hison_fileset_add_button_${c}`])==null?void 0:a.setDisable(B.value)}))}),l.watch(()=>t.attId,e=>{const a=e??"";a!==j.value&&(j.value=a)}),l.watch(()=>t.addButtonText,e=>{const a=e??"";a!==E.value&&(E.value=a)}),l.watch(()=>t.removeButtonText,e=>{const a=e??"";a!==x.value&&(x.value=a)}),l.watch(()=>t.placeholder,e=>{const a=e??"";a!==A.value&&(A.value=a)}),l.watch(()=>t.enableDrop,e=>{const a=!!e;a!==M.value&&(M.value=a)}),l.watch(()=>t.downloadHandler,e=>{const a=typeof e=="function"?e:void 0;a!==$.value&&($.value=a)}),l.watch(()=>t.multiCols,e=>{const a=!!e;a!==O.value&&(O.value=a)}),l.watch(()=>t.multiple,e=>{const a=!!e;a!==h.value&&(h.value=a)}),l.watch(()=>t.allowedTypes,e=>{const u=(Array.isArray(e)?e:typeof e=="string"?e.split(","):[]).map(r=>String(r).trim()).filter(Boolean);JSON.stringify(u)!==JSON.stringify(y.value)&&(y.value=u)}),l.watch(()=>t.disallowedTypes,e=>{const u=(Array.isArray(e)?e:typeof e=="string"?e.split(","):[]).map(r=>String(r).trim()).filter(Boolean);JSON.stringify(u)!==JSON.stringify(w.value)&&(w.value=u)}),l.watch(()=>t.maxFileSize,e=>{const a=e===1/0?1/0:Number(e);(Number.isFinite(a)||a===1/0)&&a!==b.value&&(b.value=a)}),l.watch(()=>t.maxTotalFileSize,e=>{const a=e===1/0?1/0:Number(e);(Number.isFinite(a)||a===1/0)&&a!==C.value&&(C.value=a)}),l.watch(()=>t.maxFileCount,e=>{const a=Number(e);Number.isInteger(a)&&a>=0&&a!==D.value&&(D.value=a)}),l.watch(()=>t.onDisallowedType,e=>{const a=typeof e=="function"?e:void 0;a!==g.value&&(g.value=a)}),l.watch(()=>t.onMaxFileSizeExceeded,e=>{const a=typeof e=="function"?e:void 0;a!==z.value&&(z.value=a)}),l.watch(()=>t.onMaxTotalSizeExceeded,e=>{const a=typeof e=="function"?e:void 0;a!==k.value&&(k.value=a)}),l.watch(()=>t.tabIndex,e=>{const a=e===null||e===""?null:Number(e);a!==L.value&&(L.value=a)}),l.watch(()=>t.class,()=>{P()}),{fileInputRef:F,id:c,props:t,visibleFiles:ne,filesetMethods:m,responsiveClassList:I,buttonClassList:ee,visibleClass:Z,editModeClass:Y,disable:B,readonly:X,addButtonText:E,removeButtonText:x,placeholder:A,isDragging:R,multiCols:O,multiple:h,accept:_,tabIndex:L,openFileDialog:te,removeFile:ie,onFileChange:oe,downloadFile:se,handleDragEnter:ue,handleDrop:de}}}),ve={key:0,class:"file-placeholder"},me=["onClick"],ye=["disabled","onClick"],be={class:"hison-fileset-remove-text"},ge={key:0,class:"add-btn-container"},pe={key:1,class:"hison-fileset-add-text"},he=["id","accept","multiple"];function we(t,o,F,n,m,c){const N=l.resolveComponent("HButton");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["hison-wrapper",...t.responsiveClassList,t.visibleClass])},[l.createElementVNode("div",{class:l.normalizeClass(["hison-fileset",t.editModeClass]),style:l.normalizeStyle(t.props.style)},[l.createElementVNode("div",{class:l.normalizeClass(["file-list-wrapper",{"drag-over":t.isDragging}]),onDragover:o[0]||(o[0]=l.withModifiers(()=>{},["prevent"])),onDragenter:o[1]||(o[1]=l.withModifiers((...s)=>t.handleDragEnter&&t.handleDragEnter(...s),["prevent"])),onDragleave:o[2]||(o[2]=l.withModifiers(s=>t.isDragging=!1,["prevent"])),onDrop:o[3]||(o[3]=l.withModifiers((...s)=>t.handleDrop&&t.handleDrop(...s),["prevent"]))},[l.createElementVNode("div",{class:l.normalizeClass(["file-list",{"multi-cols":t.multiCols}])},[t.visibleFiles.length===0&&t.placeholder?(l.openBlock(),l.createElementBlock("div",ve,l.toDisplayString(t.placeholder),1)):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(t.visibleFiles,(s,d)=>(l.openBlock(),l.createElementBlock("div",{key:d,class:"file-item"},[l.renderSlot(t.$slots,"file-icon",{file:s}),l.createElementVNode("span",{class:l.normalizeClass(["file-name",{clickable:s.file||s.filePath}]),onClick:B=>t.downloadFile(s)},l.toDisplayString(s.fileName),11,me),t.readonly?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[t.$slots["remove-button"]?l.renderSlot(t.$slots,"remove-button",{key:0,file:s,index:d,remove:()=>t.removeFile(d),disable:t.disable}):(l.openBlock(),l.createElementBlock("button",{key:1,class:l.normalizeClass(["delete-btn",{"hison-disable":t.disable}]),disabled:t.disable,onClick:B=>t.removeFile(d)},[l.createElementVNode("span",be,l.toDisplayString(t.removeButtonText),1)],10,ye))],64))]))),128))],2)],34),t.readonly?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",ge,[l.createVNode(N,{onClick:t.openFileDialog,onFocus:o[4]||(o[4]=s=>t.$emit("focus",t.filesetMethods)),onBlur:o[5]||(o[5]=s=>t.$emit("blur",t.filesetMethods)),id:`hison_fileset_add_button_${t.id}`,disable:t.disable,class:l.normalizeClass([...t.buttonClassList]),tabindex:t.tabIndex??void 0},{default:l.withCtx(()=>[t.$slots["add-button"]?l.renderSlot(t.$slots,"add-button",{key:0,add:t.openFileDialog}):(l.openBlock(),l.createElementBlock("span",pe,l.toDisplayString(t.addButtonText),1))]),_:3},8,["onClick","id","disable","class","tabindex"])])),l.createElementVNode("input",{id:`hison_fileset_${t.id}`,ref:"fileInputRef",type:"file",accept:t.accept||void 0,multiple:t.multiple,hidden:"",onChange:o[6]||(o[6]=(...s)=>t.onFileChange&&t.onFileChange(...s))},null,40,he)],6)],2)}const Ce=re._export_sfc(fe,[["render",we]]);exports.default=Ce;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as D, ref as n, computed as i, onMounted as P, onBeforeUnmount as q, watch as s, nextTick as O, createElementBlock as S, openBlock as L, normalizeClass as U, createElementVNode as j, normalizeStyle as T, createCommentVNode as M } from "vue";
|
|
2
|
-
import { z as Y, A as K, B as J, f as b, g as Q, u as X, F as V, o as Z, h as c, e as ee, t as te, b as W, a as le, r as ne, c as se, d as ae } from "./index-
|
|
2
|
+
import { z as Y, A as K, B as J, f as b, g as Q, u as X, F as V, o as Z, h as c, e as ee, t as te, b as W, a as le, r as ne, c as se, d as ae } from "./index-q_fzCRqA.mjs";
|
|
3
3
|
import { _ as oe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const ie = {
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),n=require("./index-Bv6aEJhv.js"),A=require("./_plugin-vue_export-helper-BHFhmbuH.js"),R={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},border:{type:Boolean,default:!1},backgroundType:{type:String,default:n.BackgroundType.empty,validator:l=>n.BACKGROUND_TYPE_VALUES.includes(l)},line:{type:String,default:"none",validator:l=>n.H_GAP_RULE_VALUES.includes(l)},lineStyle:{type:String,default:"solid",validator:l=>n.H_GAP_LINE_STYLE_VALUES.includes(l)},lineWidth:{type:[Number,String],default:1},lineColor:{type:String,default:""}},V=t.defineComponent({name:"HGap",props:R,inheritAttrs:!1,emits:["mounted","responsive-change"],setup(l,{emit:y}){const h=t.ref(null),g=t.ref(null),a=l.id?l.id:n.getUUID(),f=`hgap:${a}`,C=n.useDevice(),u=t.ref(l.visible),c=t.ref(l.border??!1),d=t.ref(l.backgroundType??n.BackgroundType.empty),v=t.ref(l.line),i=t.ref(l.lineStyle||"solid"),r=t.ref(l.lineWidth??1),p=t.ref(l.lineColor||""),b=t.computed(()=>{var w,$;const e=String(p.value||"").trim(),o=n.getHexCodeFromColorText(e);if(o)return o;if(e)return e;const k=n.getSpecificClassValueFromClassList(s.value,"color"),B=k?n.getHexCodeFromColorText(k):null;return B||(($=(w=n.hisonCloser)==null?void 0:w.componentStyle)==null?void 0:$.mutedColor)||"#999999"}),S=t.computed(()=>{const e=r.value;return typeof e=="number"?`${e}px`:String(e||"1px")}),z=t.computed(()=>({borderTop:`${S.value} ${i.value} ${b.value}`})),E=t.computed(()=>({borderLeft:`${S.value} ${i.value} ${b.value}`})),H=t.computed(()=>u.value?"":"hison-display-none"),N=t.computed(()=>c.value?"hison-border":""),_=t.computed(()=>{switch(d.value){case n.BackgroundType.empty:return"hison-bg-empty";case n.BackgroundType.transparent:return"hison-bg-transparent";default:return"hison-bg-filled"}}),s=t.ref([]),m=()=>{s.value=n.extractResponsiveClasses(n.toClassString(l.class)||"",C.value),n.addComponentNameToClass(s.value,"size",n.hisonCloser.componentStyle.size),n.addComponentNameToClass(s.value,"color","primary"),n.getIndexSpecificClassNameFromClassList(s.value,"col")===-1&&s.value.push("hison-col-12")},L=()=>{n.hisonCloser.component.gapList[a]&&n.hisonCloser.component.gapList[a].isHisonvueComponent&&console.warn(`[Hisonvue] The gap ID is at risk of being duplicated. ${a}`),n.registerReloadable(f,()=>{T(),t.nextTick(L)}),m(),g.value={isHisonvueComponent:!0,getId:()=>a,getType:()=>"gap",isVisible:()=>u.value,setVisible:e=>{u.value=e},isBorder:()=>c.value,setBorder:e=>{c.value=e},getBackgroundType:()=>d.value,setBackgroundType:e=>{d.value=e},getLine:()=>v.value,setLine:e=>{v.value=e},getLineStyle:()=>i.value,setLineStyle:e=>{i.value=e},getLineWidth:()=>r.value,setLineWidth:e=>{r.value=e},getLineColor:()=>p.value,setLineColor:e=>{p.value=e??""},reload:()=>n.reloadHisonComponent(f)},n.hisonCloser.component.gapList[a]=g.value,y("mounted",g.value)},T=()=>{n.unregisterReloadable(f),delete n.hisonCloser.component.gapList[a]};return t.onMounted(L),t.onBeforeUnmount(T),t.watch(C,e=>{m(),y("responsive-change",e)}),t.watch(()=>l.visible,e=>{const o=!!e;o!==u.value&&(u.value=o)}),t.watch(()=>l.border,e=>{const o=!!e;o!==c.value&&(c.value=o)}),t.watch(()=>l.backgroundType,e=>{e&&e!==d.value&&(d.value=e)}),t.watch(()=>l.line,e=>{(e==="none"||e==="horizontal"||e==="vertical")&&e!==v.value&&(v.value=e)}),t.watch(()=>l.lineStyle,e=>{["solid","dashed","dotted","double","groove","ridge","inset","outset"].includes(e)&&e!==i.value&&(i.value=e)}),t.watch(()=>l.lineWidth,e=>{const o=typeof e=="number"&&Number.isFinite(e)&&e>=0||typeof e=="string"?e:r.value;o!==r.value&&(r.value=o)}),t.watch(()=>l.lineColor,e=>{const o=(e??"").toString();o!==p.value&&(p.value=o)}),t.watch(()=>l.class,()=>{m()}),{gapRef:h,props:l,line:v,visibleClass:H,borderClass:N,backgroundTypeClass:_,responsiveClassList:s,horizontalStyle:z,verticalStyle:E}}});function U(l,y,h,g,a,f){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-wrapper",...l.responsiveClassList,l.visibleClass])},[t.createElementVNode("div",{ref:"gapRef",class:t.normalizeClass(["hison-gap",l.borderClass,l.backgroundTypeClass]),style:t.normalizeStyle(l.props.style)},[l.line==="horizontal"?(t.openBlock(),t.createElementBlock("div",{key:0,class:"hison-gap-line-horizontal",style:t.normalizeStyle(l.horizontalStyle)},null,4)):l.line==="vertical"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"hison-gap-line-vertical",style:t.normalizeStyle(l.verticalStyle)},null,4)):t.createCommentVNode("",!0)],6)],2)}const x=A._export_sfc(V,[["render",U]]);exports.default=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as N, ref as c, computed as H, onMounted as T, onBeforeUnmount as U, watch as F, triggerRef as $, nextTick as P, createElementBlock as K, openBlock as j, normalizeStyle as W, normalizeClass as Y, createElementVNode as Z, mergeProps as J } from "vue";
|
|
2
|
-
import { G as X, I as Q, J as ee, K as te, L as ie, M as le, g as re, u as oe, e as z, t as G, o as k, a as ne, l as h, F as _, h as b, v as S, d as B, r as ae, c as ue } from "./index-
|
|
2
|
+
import { G as X, I as Q, J as ee, K as te, L as ie, M as le, g as re, u as oe, e as z, t as G, o as k, a as ne, l as h, F as _, h as b, v as S, d as B, r as ae, c as ue } from "./index-q_fzCRqA.mjs";
|
|
3
3
|
import { _ as ce } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const se = {
|
|
5
5
|
modelValue: Array,
|