hisonvue 1.1.37 → 1.1.39
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-DRqLk7NC.js → HAccordion-Bb5EQl3Q.js} +1 -1
- package/dist/{HAccordion-0fAMHdvs.mjs → HAccordion-BkEvH6Ey.mjs} +2 -2
- package/dist/{HBaggie-DbgCMqIg.mjs → HBaggie-CfeAvM0z.mjs} +2 -2
- package/dist/{HBaggie--YNtbozl.js → HBaggie-e3WlKWB5.js} +1 -1
- package/dist/{HBanner-DQB6bYLH.js → HBanner-CkDsf505.js} +1 -1
- package/dist/{HBanner-BvngNVzL.mjs → HBanner-xCcVSety.mjs} +2 -2
- package/dist/{HButton-mKSYHJBc.mjs → HButton-BK77iM6O.mjs} +2 -2
- package/dist/{HButton-lKxJqRBv.js → HButton-pdDP3xI3.js} +1 -1
- package/dist/{HCalendar-wthRMju8.mjs → HCalendar-D5o7cn04.mjs} +1 -1
- package/dist/{HCalendar-CYAUr0D3.js → HCalendar-k8W3KKtT.js} +1 -1
- package/dist/{HCaption-of-hBSrs.mjs → HCaption-CVmGUpim.mjs} +1 -1
- package/dist/{HCaption-CZY_twQN.js → HCaption-SDbWenvp.js} +1 -1
- package/dist/{HChart-BHYjt4tu.mjs → HChart-BAZ_mje0.mjs} +1 -1
- package/dist/{HChart-BOp9MvXx.js → HChart-Cg6WvF-m.js} +1 -1
- package/dist/{HDrawer-ySPslfOa.js → HDrawer-CdXPUYKs.js} +1 -1
- package/dist/{HDrawer-P63zubvp.mjs → HDrawer-CuYTcazp.mjs} +1 -1
- package/dist/{HDropdown-5OIyHiBR.js → HDropdown-Crtq97na.js} +1 -1
- package/dist/{HDropdown-Be-RU_Tv.mjs → HDropdown-trpRIODH.mjs} +2 -2
- package/dist/HFileset-CQPVTrc0.js +2 -0
- package/dist/{HFileset-Drg3x1Bj.mjs → HFileset-yDnoWeFJ.mjs} +187 -184
- package/dist/{HGap-DVst2R4w.js → HGap-D2VPEhTy.js} +1 -1
- package/dist/{HGap-CJpPjoq7.mjs → HGap-DM1hp0HZ.mjs} +1 -1
- package/dist/{HGrid-Bc_eMWRM.js → HGrid-9WW04j6i.js} +1 -1
- package/dist/{HGrid-Bfl0GpxJ.mjs → HGrid-OT55Vyqy.mjs} +1 -1
- package/dist/{HImagebox-B6GQqzAA.mjs → HImagebox-DXnfszdl.mjs} +161 -158
- package/dist/HImagebox-Dn6okVVd.js +2 -0
- package/dist/HInput-D-WhZgWg.js +1 -0
- package/dist/{HInput-CauTfu6o.mjs → HInput-DxqBZopO.mjs} +128 -113
- package/dist/{HInputGroup-DgQ_ZgEF.js → HInputGroup-CMOBOaIy.js} +1 -1
- package/dist/{HInputGroup-tzzcUdWg.mjs → HInputGroup-kjL_gkY3.mjs} +1 -1
- package/dist/{HLabel-B1xFYyGZ.js → HLabel-CdRo92gc.js} +1 -1
- package/dist/{HLabel-4Ueeu03H.mjs → HLabel-CuOsomVK.mjs} +2 -2
- package/dist/{HLayout-oc8xia2w.js → HLayout-BCjLoYqu.js} +1 -1
- package/dist/{HLayout-dYSL76ri.mjs → HLayout-SDUsOGH9.mjs} +1 -1
- package/dist/{HList-Dj9P7i1D.js → HList-BARBWvNB.js} +1 -1
- package/dist/{HList-CEfj_bhs.mjs → HList-Cebfzf83.mjs} +2 -2
- package/dist/{HModal-BaHo5t5Y.mjs → HModal-BPmK-z7W.mjs} +1 -1
- package/dist/{HModal-CfRqg5z8.js → HModal-BQC6Dwcw.js} +1 -1
- package/dist/{HNote-u3GGVOTW.mjs → HNote-DcZpFM82.mjs} +1 -1
- package/dist/{HNote-DmSTpkhw.js → HNote-DpqAofRU.js} +1 -1
- package/dist/{HPagination-C-azoXcO.mjs → HPagination-DzGUrGXP.mjs} +2 -2
- package/dist/{HPagination-x09Oruv4.js → HPagination-v-NFDeDA.js} +1 -1
- package/dist/{HParagraph-DSZYpVMA.js → HParagraph-CdOVGIlk.js} +1 -1
- package/dist/{HParagraph-DG1lR5Wh.mjs → HParagraph-W9TnHmze.mjs} +1 -1
- package/dist/{HPopup-DgAe0yj_.js → HPopup-CNt-lvtH.js} +1 -1
- package/dist/{HPopup-DvtYEMFe.mjs → HPopup-CXxinQhO.mjs} +1 -1
- package/dist/{HSpinner-CTbOv6Nj.mjs → HSpinner-DsolJ5Oc.mjs} +1 -1
- package/dist/{HSpinner-BquVCXhI.js → HSpinner-meptBXhz.js} +1 -1
- package/dist/{HTable-s0DC1ahZ.js → HTable-TGIonXp7.js} +1 -1
- package/dist/{HTable-CQjoFylD.mjs → HTable-f_QsXz2G.mjs} +1 -1
- package/dist/hisonvue.cjs.js +1 -1
- package/dist/hisonvue.css +1 -1
- package/dist/hisonvue.d.ts +2 -0
- package/dist/hisonvue.es.js +2 -2
- package/dist/{index-BVRi26ir.mjs → index-CjHzPazZ.mjs} +2 -1
- package/dist/{index-C4arLfL7.js → index-DvM-XIAr.js} +2 -1
- package/dist/{setButtonCssEvent-sJeEDC4h.js → setButtonCssEvent-C2lqu16u.js} +1 -1
- package/dist/{setButtonCssEvent-CTkkoDql.mjs → setButtonCssEvent-DzgOFy1K.mjs} +1 -1
- package/package.json +1 -1
- package/dist/HFileset-ByX1zHG4.js +0 -2
- package/dist/HImagebox-sjOxzUWR.js +0 -2
- package/dist/HInput-DOctOG23.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { E as N, A as
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as Oe, ref as s, computed as D, onMounted as Le, onBeforeUnmount as Ee, watch as d, nextTick as ie, resolveComponent as je, openBlock as y, createElementBlock as b, Fragment as Y, createBlock as Re, normalizeStyle as me, normalizeClass as M, withCtx as be, renderSlot as Z, toDisplayString as K, createCommentVNode as ae, createElementVNode as j, withModifiers as _, renderList as Pe, createVNode as He } from "vue";
|
|
2
|
+
import { E as N, A as Ve, g as Ue, l as g, u as Je, j as ge, t as ee, h as z, e as qe, a as We, b as pe, r as Ge, c as Ke, d as Qe } from "./index-CjHzPazZ.mjs";
|
|
3
|
+
import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
|
+
const Ye = {
|
|
5
5
|
/**
|
|
6
6
|
* Unique identifier for the file set.
|
|
7
7
|
* - Access methods via `hison.component.getFileset(id)`
|
|
@@ -35,7 +35,7 @@ const Xe = {
|
|
|
35
35
|
editMode: {
|
|
36
36
|
type: String,
|
|
37
37
|
default: N.editable,
|
|
38
|
-
validator: (l) =>
|
|
38
|
+
validator: (l) => Ve.includes(l)
|
|
39
39
|
},
|
|
40
40
|
/**
|
|
41
41
|
* v-model: list of attached files.
|
|
@@ -168,9 +168,9 @@ const Xe = {
|
|
|
168
168
|
default: null,
|
|
169
169
|
validator: (l) => l === null || l === "" || !isNaN(+l) && isFinite(+l)
|
|
170
170
|
}
|
|
171
|
-
},
|
|
171
|
+
}, Ze = Oe({
|
|
172
172
|
name: "HFileset",
|
|
173
|
-
props:
|
|
173
|
+
props: Ye,
|
|
174
174
|
emits: [
|
|
175
175
|
"mounted",
|
|
176
176
|
"responsive-change",
|
|
@@ -183,106 +183,109 @@ const Xe = {
|
|
|
183
183
|
"change"
|
|
184
184
|
],
|
|
185
185
|
setup(l, { emit: a }) {
|
|
186
|
-
const
|
|
186
|
+
const k = s(null), o = s([...l.modelValue]), p = s(null), c = l.id ? l.id : Ue(), x = `hfileset:${c}`, u = s(l.visible), f = s(l.editMode), R = D(() => f.value === N.disable), he = D(() => f.value === N.readonly), we = D(() => f.value !== N.editable ? `hison-fileset-${f.value}` : ""), ne = D(() => u.value ? "" : "hison-display-none"), Q = s(l.attId || ""), P = s(l.addButtonText || ""), H = s(l.removeButtonText || ""), V = s(l.placeholder ?? ""), le = s(!1), B = s(l.enableDrop), U = s(typeof l.downloadHandler == "function" ? l.downloadHandler : void 0), J = s(l.multiCols ?? !1), I = s(l.multiple ?? !1), q = s(!!l.buttonOnly), X = s(!1), w = s(
|
|
187
187
|
Array.isArray(l.allowedTypes) ? l.allowedTypes : l.allowedTypes ? l.allowedTypes.split(",") : []
|
|
188
|
-
), S =
|
|
188
|
+
), S = s(
|
|
189
189
|
Array.isArray(l.disallowedTypes) ? l.disallowedTypes : l.disallowedTypes ? l.disallowedTypes.split(",") : []
|
|
190
|
-
), C =
|
|
190
|
+
), C = s(l.maxFileSize ?? g.getMaxFilesetSize()), $ = s(l.maxTotalFileSize ?? g.getMaxFilesetTotalSize()), A = s(l.maxFileCount), F = s(typeof l.onDisallowedType == "function" ? l.onDisallowedType : void 0), O = s(typeof l.onMaxFileSizeExceeded == "function" ? l.onMaxFileSizeExceeded : void 0), L = s(typeof l.onMaxTotalSizeExceeded == "function" ? l.onMaxTotalSizeExceeded : void 0), W = s(
|
|
191
191
|
l.tabIndex !== null && l.tabIndex !== "" ? Number(l.tabIndex) : null
|
|
192
|
-
), oe =
|
|
193
|
-
|
|
194
|
-
},
|
|
192
|
+
), oe = Je(), E = s([]), te = () => {
|
|
193
|
+
E.value = qe(ee(l.class) || "", oe.value), We(E.value, "col") === -1 && E.value.push("hison-col-12"), pe(E.value, "size", z.componentStyle.size), pe(E.value, "color", "primary");
|
|
194
|
+
}, Ce = D(() => {
|
|
195
195
|
const e = [];
|
|
196
|
-
return e.push(...
|
|
197
|
-
}),
|
|
196
|
+
return e.push(...ge(ee(l.class) || "", "size")), e.push(...ge(ee(l.class) || "", "color")), e;
|
|
197
|
+
}), Fe = D(() => ["fileset-add-btn", ee(l.class) || "", ne.value].filter(Boolean).join(" ")), Te = D(() => {
|
|
198
198
|
if (w.value.length === 0) return "";
|
|
199
199
|
const e = new Set(S.value.map((i) => i.toLowerCase())), t = w.value.filter((i) => !e.has(i.toLowerCase()));
|
|
200
200
|
return t.length > 0 ? t.join(",") : void 0;
|
|
201
201
|
}), Ie = () => {
|
|
202
202
|
var e;
|
|
203
|
-
(e =
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return w.value.length > 0 && !w.value.some((k) => k === t || k === i) ? (console.warn(`File type not in allowedTypes: ${t} / ${i}`), (h = F.value) == null || h.call(F, e, w.value, null), !1) : S.value.length > 0 && S.value.some((k) => k === t || k === i) ? (console.warn(`File type is in disallowedTypes: ${t} / ${i}`), (r = F.value) == null || r.call(F, e, null, S.value), !1) : !0;
|
|
203
|
+
(e = k.value) == null || e.click();
|
|
204
|
+
}, se = (e, t, i) => {
|
|
205
|
+
const n = e.trim().toLowerCase();
|
|
206
|
+
return n.endsWith("/*") ? t.toLowerCase().startsWith(n.slice(0, -1)) : n === t.toLowerCase() || n === i;
|
|
208
207
|
}, Se = (e) => {
|
|
208
|
+
var n, h, r;
|
|
209
|
+
const t = e.type, i = "." + ((n = e.name.split(".").pop()) == null ? void 0 : n.toLowerCase());
|
|
210
|
+
return w.value.length > 0 && !w.value.some((G) => se(G, t, i)) ? (console.warn(`File type not in allowedTypes: ${t} / ${i}`), (h = F.value) == null || h.call(F, e, w.value, null), !1) : S.value.length > 0 && S.value.some((G) => se(G, t, i)) ? (console.warn(`File type is in disallowedTypes: ${t} / ${i}`), (r = F.value) == null || r.call(F, e, null, S.value), !1) : !0;
|
|
211
|
+
}, De = (e) => {
|
|
209
212
|
var t;
|
|
210
213
|
return typeof C.value == "number" && Number.isFinite(C.value) && e.size > C.value ? (console.warn(`File too large: ${e.name}
|
|
211
|
-
Max size: ${C.value} Byte`), (t =
|
|
212
|
-
},
|
|
214
|
+
Max size: ${C.value} Byte`), (t = O.value) == null || t.call(O, e, e.size, C.value), !1) : !0;
|
|
215
|
+
}, ue = (e) => {
|
|
213
216
|
var h;
|
|
214
217
|
let t = e.filter(
|
|
215
|
-
(r) =>
|
|
218
|
+
(r) => De(r) && Se(r)
|
|
216
219
|
);
|
|
217
|
-
!
|
|
220
|
+
!I.value && t.length > 1 && (t = [t[0]]);
|
|
218
221
|
let i = !1;
|
|
219
|
-
const
|
|
222
|
+
const n = [];
|
|
220
223
|
for (const r of t) {
|
|
221
|
-
const v =
|
|
222
|
-
if ($.value > 0 &&
|
|
223
|
-
(h = L.value) == null || h.call(L, r,
|
|
224
|
+
const v = o.value.filter((m) => !m.isDeleted), G = v.length, ce = v.reduce((m, T) => m + (T.fileSize ?? 0), 0) + r.size;
|
|
225
|
+
if ($.value > 0 && ce > $.value) {
|
|
226
|
+
(h = L.value) == null || h.call(L, r, ce, $.value), console.warn("Total file size exceeds limit.");
|
|
224
227
|
break;
|
|
225
228
|
}
|
|
226
|
-
if (!
|
|
229
|
+
if (!I.value) {
|
|
227
230
|
for (const m of v)
|
|
228
231
|
if (m.isNew) {
|
|
229
|
-
const
|
|
230
|
-
|
|
232
|
+
const T = o.value.indexOf(m);
|
|
233
|
+
T !== -1 && o.value.splice(T, 1);
|
|
231
234
|
} else
|
|
232
235
|
m.isDeleted = !0;
|
|
233
236
|
i = !0;
|
|
234
237
|
}
|
|
235
|
-
if (
|
|
236
|
-
const m =
|
|
238
|
+
if (I.value && A.value > 0 && G >= A.value) {
|
|
239
|
+
const m = o.value.findIndex((T) => !T.isDeleted);
|
|
237
240
|
if (m !== -1) {
|
|
238
|
-
const
|
|
239
|
-
|
|
241
|
+
const T = o.value[m];
|
|
242
|
+
T.isNew ? o.value.splice(m, 1) : T.isDeleted = !0, i = !0;
|
|
240
243
|
} else {
|
|
241
244
|
console.warn("No replaceable file found for maxFileCount overflow.");
|
|
242
245
|
break;
|
|
243
246
|
}
|
|
244
247
|
}
|
|
245
|
-
const
|
|
248
|
+
const ye = {
|
|
246
249
|
fileName: r.name,
|
|
247
250
|
fileSize: r.size,
|
|
248
251
|
extension: r.name.split(".").pop(),
|
|
249
252
|
file: r,
|
|
250
253
|
isNew: !0
|
|
251
254
|
};
|
|
252
|
-
|
|
255
|
+
o.value.push(ye), i = !0, n.push(ye);
|
|
253
256
|
}
|
|
254
|
-
i && (X.value = !0, a("update:modelValue", [...
|
|
255
|
-
},
|
|
256
|
-
const t =
|
|
257
|
+
i && (X.value = !0, a("update:modelValue", [...o.value]), n.length && a("add", g.utils.deepCopyObject(n), p.value), a("change", g.utils.deepCopyObject(o.value), p.value));
|
|
258
|
+
}, Me = (e) => {
|
|
259
|
+
const t = o.value.indexOf(e);
|
|
257
260
|
if (t !== -1) return t;
|
|
258
261
|
if (e.fileId) {
|
|
259
|
-
const i =
|
|
262
|
+
const i = o.value.findIndex((n) => n.fileId === e.fileId);
|
|
260
263
|
if (i !== -1) return i;
|
|
261
264
|
}
|
|
262
265
|
if (e.file) {
|
|
263
|
-
const i =
|
|
266
|
+
const i = o.value.findIndex((n) => n.file === e.file);
|
|
264
267
|
if (i !== -1) return i;
|
|
265
268
|
}
|
|
266
269
|
if (e.filePath) {
|
|
267
|
-
const i =
|
|
270
|
+
const i = o.value.findIndex((n) => n.filePath === e.filePath);
|
|
268
271
|
if (i !== -1) return i;
|
|
269
272
|
}
|
|
270
273
|
return -1;
|
|
271
|
-
},
|
|
274
|
+
}, ze = (e) => {
|
|
272
275
|
if (f.value !== N.editable) return;
|
|
273
|
-
const t =
|
|
276
|
+
const t = Me(e);
|
|
274
277
|
if (t === -1) return;
|
|
275
|
-
const i =
|
|
276
|
-
i.fileId ? i.isDeleted = !0 :
|
|
277
|
-
},
|
|
278
|
+
const i = o.value[t];
|
|
279
|
+
i.fileId ? i.isDeleted = !0 : o.value.splice(t, 1), X.value = !0, a("update:modelValue", [...o.value]), a("remove", g.utils.deepCopyObject(i), t, p.value), a("change", g.utils.deepCopyObject(o.value), p.value);
|
|
280
|
+
}, Ne = (e) => {
|
|
278
281
|
if (f.value !== N.editable) return;
|
|
279
282
|
const t = e.target.files;
|
|
280
|
-
!t || t.length === 0 || (
|
|
281
|
-
|
|
283
|
+
!t || t.length === 0 || (ue(Array.from(t)), ie(() => {
|
|
284
|
+
k.value && (k.value.value = "");
|
|
282
285
|
}));
|
|
283
|
-
},
|
|
284
|
-
if (a("download", g.utils.deepCopyObject(e), p.value),
|
|
285
|
-
|
|
286
|
+
}, $e = D(() => o.value.filter((e) => !e.isDeleted)), ke = (e) => {
|
|
287
|
+
if (a("download", g.utils.deepCopyObject(e), p.value), U.value) {
|
|
288
|
+
U.value(e);
|
|
286
289
|
return;
|
|
287
290
|
}
|
|
288
291
|
let t = "";
|
|
@@ -295,18 +298,18 @@ Max size: ${C.value} Byte`), (t = E.value) == null || t.call(E, e, e.size, C.val
|
|
|
295
298
|
console.warn("Download failed: no filePath or file object.");
|
|
296
299
|
return;
|
|
297
300
|
}
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
},
|
|
301
|
-
!
|
|
302
|
-
},
|
|
301
|
+
const n = document.createElement("a");
|
|
302
|
+
n.href = t, n.download = i, n.click(), e.file && URL.revokeObjectURL(t);
|
|
303
|
+
}, xe = () => {
|
|
304
|
+
!B.value || f.value !== N.editable || (le.value = !0);
|
|
305
|
+
}, Be = (e) => {
|
|
303
306
|
var t;
|
|
304
|
-
le.value = !1, !(!
|
|
305
|
-
},
|
|
307
|
+
le.value = !1, !(!B.value || f.value !== N.editable) && (t = e.dataTransfer) != null && t.files && ue(Array.from(e.dataTransfer.files));
|
|
308
|
+
}, de = (e) => {
|
|
306
309
|
if (!e || !e.getIsDataModel || !e.getIsDataModel() || e.getRowCount && e.getRowCount() === 0) return;
|
|
307
310
|
const t = e.getRows();
|
|
308
|
-
|
|
309
|
-
},
|
|
311
|
+
o.value = [...t];
|
|
312
|
+
}, re = (e) => (e || []).map((t) => ({
|
|
310
313
|
fileId: t.fileId ?? "",
|
|
311
314
|
fileName: t.fileName ?? "",
|
|
312
315
|
fileSize: Number(t.fileSize ?? 0),
|
|
@@ -314,71 +317,71 @@ Max size: ${C.value} Byte`), (t = E.value) == null || t.call(E, e, e.size, C.val
|
|
|
314
317
|
isDeleted: !!t.isDeleted,
|
|
315
318
|
isNew: !!t.isNew,
|
|
316
319
|
fileMeta: t.file ? `${t.file.name}|${t.file.size}|${t.file.type}` : ""
|
|
317
|
-
})),
|
|
318
|
-
const i =
|
|
319
|
-
if (i.length !==
|
|
320
|
+
})), Ae = (e, t) => {
|
|
321
|
+
const i = re(e), n = re(t);
|
|
322
|
+
if (i.length !== n.length) return !1;
|
|
320
323
|
for (let h = 0; h < i.length; h++) {
|
|
321
|
-
const r = i[h], v =
|
|
324
|
+
const r = i[h], v = n[h];
|
|
322
325
|
if (r.fileId !== v.fileId || r.fileName !== v.fileName || r.fileSize !== v.fileSize || r.filePath !== v.filePath || r.isDeleted !== v.isDeleted || r.isNew !== v.isNew || r.fileMeta !== v.fileMeta) return !1;
|
|
323
326
|
}
|
|
324
327
|
return !0;
|
|
325
|
-
},
|
|
326
|
-
z.component.filesetList[c] && z.component.filesetList[c].isHisonvueComponent && console.warn(`[Hisonvue] The fileset ID is at risk of being duplicated. ${c}`), Ge(
|
|
327
|
-
|
|
328
|
-
}),
|
|
328
|
+
}, fe = () => {
|
|
329
|
+
z.component.filesetList[c] && z.component.filesetList[c].isHisonvueComponent && console.warn(`[Hisonvue] The fileset ID is at risk of being duplicated. ${c}`), Ge(x, () => {
|
|
330
|
+
ve(), ie(fe);
|
|
331
|
+
}), k.value && (te(), p.value = {
|
|
329
332
|
isHisonvueComponent: !0,
|
|
330
333
|
getId: () => c,
|
|
331
334
|
getType: () => "fileset",
|
|
332
|
-
isVisible: () =>
|
|
335
|
+
isVisible: () => u.value,
|
|
333
336
|
setVisible: (e) => {
|
|
334
|
-
|
|
337
|
+
u.value = e;
|
|
335
338
|
},
|
|
336
339
|
getEditMode: () => f.value,
|
|
337
340
|
setEditMode: (e) => {
|
|
338
341
|
var t;
|
|
339
|
-
f.value = e, (t = z.component.buttonList[`hison_fileset_add_button_${c}`]) == null || t.setDisable(
|
|
342
|
+
f.value = e, (t = z.component.buttonList[`hison_fileset_add_button_${c}`]) == null || t.setDisable(R.value);
|
|
340
343
|
},
|
|
341
|
-
getValue: () => g.utils.deepCopyObject(
|
|
344
|
+
getValue: () => g.utils.deepCopyObject(o.value),
|
|
342
345
|
setValue: (e) => {
|
|
343
|
-
|
|
346
|
+
o.value = g.utils.deepCopyObject([...e ?? []]);
|
|
344
347
|
},
|
|
345
|
-
getDataModel: () =>
|
|
348
|
+
getDataModel: () => o.value.length > 0 ? new g.data.DataModel(o.value) : null,
|
|
346
349
|
setDataModel: (e) => {
|
|
347
|
-
|
|
350
|
+
de(e);
|
|
348
351
|
},
|
|
349
352
|
load: (e) => {
|
|
350
|
-
e && e.getIsDataModel && e.getIsDataModel() ?
|
|
353
|
+
e && e.getIsDataModel && e.getIsDataModel() ? de(e) : o.value = g.utils.deepCopyObject([...e]);
|
|
351
354
|
},
|
|
352
|
-
getAttId: () =>
|
|
355
|
+
getAttId: () => Q.value,
|
|
353
356
|
setAttId: (e) => {
|
|
354
|
-
|
|
357
|
+
Q.value = e;
|
|
355
358
|
},
|
|
356
|
-
getAddButtonText: () =>
|
|
359
|
+
getAddButtonText: () => P.value,
|
|
357
360
|
setAddButtonText: (e) => {
|
|
358
|
-
|
|
361
|
+
P.value = e;
|
|
359
362
|
},
|
|
360
|
-
getRemoveButtonText: () =>
|
|
363
|
+
getRemoveButtonText: () => H.value,
|
|
361
364
|
setRemoveButtonText: (e) => {
|
|
362
|
-
|
|
365
|
+
H.value = e;
|
|
363
366
|
},
|
|
364
|
-
isEnableDrop: () =>
|
|
367
|
+
isEnableDrop: () => B.value,
|
|
365
368
|
setEnableDrop: (e) => {
|
|
366
|
-
|
|
369
|
+
B.value = e;
|
|
367
370
|
},
|
|
368
371
|
setDownloadHandler: (e) => {
|
|
369
|
-
|
|
372
|
+
U.value = e;
|
|
370
373
|
},
|
|
371
|
-
isMultiCols: () =>
|
|
374
|
+
isMultiCols: () => J.value,
|
|
372
375
|
setMultiCols: (e) => {
|
|
373
|
-
|
|
376
|
+
J.value = e;
|
|
374
377
|
},
|
|
375
|
-
isMultiple: () =>
|
|
378
|
+
isMultiple: () => I.value,
|
|
376
379
|
setMultiple: (e) => {
|
|
377
|
-
|
|
380
|
+
I.value = e;
|
|
378
381
|
},
|
|
379
|
-
getPlaceholder: () =>
|
|
382
|
+
getPlaceholder: () => V.value,
|
|
380
383
|
setPlaceholder: (e) => {
|
|
381
|
-
|
|
384
|
+
V.value = e;
|
|
382
385
|
},
|
|
383
386
|
getAllowedTypes: () => w.value,
|
|
384
387
|
setAllowedTypes: (e) => {
|
|
@@ -396,15 +399,15 @@ Max size: ${C.value} Byte`), (t = E.value) == null || t.call(E, e, e.size, C.val
|
|
|
396
399
|
setMaxTotalFileSize: (e) => {
|
|
397
400
|
$.value = e;
|
|
398
401
|
},
|
|
399
|
-
getMaxFileCount: () =>
|
|
402
|
+
getMaxFileCount: () => A.value,
|
|
400
403
|
setMaxFileCount: (e) => {
|
|
401
|
-
|
|
404
|
+
A.value = e;
|
|
402
405
|
},
|
|
403
406
|
setOnDisallowedType: (e) => {
|
|
404
407
|
F.value = e;
|
|
405
408
|
},
|
|
406
409
|
setOnMaxFileSizeExceeded: (e) => {
|
|
407
|
-
|
|
410
|
+
O.value = e;
|
|
408
411
|
},
|
|
409
412
|
setOnMaxTotalSizeExceeded: (e) => {
|
|
410
413
|
L.value = e;
|
|
@@ -413,73 +416,73 @@ Max size: ${C.value} Byte`), (t = E.value) == null || t.call(E, e, e.size, C.val
|
|
|
413
416
|
setModified: (e) => {
|
|
414
417
|
X.value = e;
|
|
415
418
|
},
|
|
416
|
-
getTabIndex: () =>
|
|
419
|
+
getTabIndex: () => W.value,
|
|
417
420
|
setTabIndex: (e) => {
|
|
418
|
-
|
|
421
|
+
W.value = e != null ? Number(e) : null;
|
|
419
422
|
},
|
|
420
423
|
// ✅ new: buttonOnly runtime
|
|
421
|
-
isButtonOnly: () =>
|
|
424
|
+
isButtonOnly: () => q.value,
|
|
422
425
|
setButtonOnly: (e) => {
|
|
423
|
-
|
|
426
|
+
q.value = !!e;
|
|
424
427
|
},
|
|
425
428
|
focus: () => {
|
|
426
429
|
var e;
|
|
427
430
|
(e = z.component.buttonList[`hison_fileset_add_button_${c}`]) == null || e.focus();
|
|
428
431
|
},
|
|
429
|
-
reload: () => Ke(
|
|
432
|
+
reload: () => Ke(x)
|
|
430
433
|
}, z.component.filesetList[c] = p.value, a("mounted", p.value));
|
|
431
|
-
},
|
|
432
|
-
Qe(
|
|
434
|
+
}, ve = () => {
|
|
435
|
+
Qe(x), delete z.component.filesetList[c];
|
|
433
436
|
};
|
|
434
|
-
return
|
|
437
|
+
return Le(fe), Ee(ve), d(
|
|
435
438
|
() => l.modelValue,
|
|
436
439
|
(e) => {
|
|
437
440
|
const t = Array.isArray(e) ? e : [];
|
|
438
|
-
|
|
441
|
+
Ae(t, o.value) || (o.value = [...t]);
|
|
439
442
|
},
|
|
440
443
|
{ deep: !0 }
|
|
441
444
|
), d(oe, (e) => {
|
|
442
445
|
te(), a("responsive-change", e);
|
|
443
446
|
}), d(() => l.visible, (e) => {
|
|
444
447
|
const t = !!e;
|
|
445
|
-
t !==
|
|
448
|
+
t !== u.value && (u.value = t);
|
|
446
449
|
}), d(() => l.editMode, (e) => {
|
|
447
450
|
e && e !== f.value && (f.value = e, ie(() => {
|
|
448
451
|
var t;
|
|
449
|
-
return (t = z.component.buttonList[`hison_fileset_add_button_${c}`]) == null ? void 0 : t.setDisable(
|
|
452
|
+
return (t = z.component.buttonList[`hison_fileset_add_button_${c}`]) == null ? void 0 : t.setDisable(R.value);
|
|
450
453
|
}));
|
|
451
454
|
}), d(() => l.attId, (e) => {
|
|
452
455
|
const t = e ?? "";
|
|
453
|
-
t !==
|
|
456
|
+
t !== Q.value && (Q.value = t);
|
|
454
457
|
}), d(() => l.addButtonText, (e) => {
|
|
455
458
|
const t = e ?? "";
|
|
456
|
-
t !==
|
|
459
|
+
t !== P.value && (P.value = t);
|
|
457
460
|
}), d(() => l.removeButtonText, (e) => {
|
|
458
461
|
const t = e ?? "";
|
|
459
|
-
t !==
|
|
462
|
+
t !== H.value && (H.value = t);
|
|
460
463
|
}), d(() => l.placeholder, (e) => {
|
|
461
464
|
const t = e ?? "";
|
|
462
|
-
t !==
|
|
465
|
+
t !== V.value && (V.value = t);
|
|
463
466
|
}), d(() => l.enableDrop, (e) => {
|
|
464
467
|
const t = !!e;
|
|
465
|
-
t !==
|
|
468
|
+
t !== B.value && (B.value = t);
|
|
466
469
|
}), d(() => l.downloadHandler, (e) => {
|
|
467
470
|
const t = typeof e == "function" ? e : void 0;
|
|
468
|
-
t !==
|
|
471
|
+
t !== U.value && (U.value = t);
|
|
469
472
|
}), d(() => l.multiCols, (e) => {
|
|
470
473
|
const t = !!e;
|
|
471
|
-
t !==
|
|
474
|
+
t !== J.value && (J.value = t);
|
|
472
475
|
}), d(() => l.multiple, (e) => {
|
|
473
476
|
const t = !!e;
|
|
474
|
-
t !==
|
|
477
|
+
t !== I.value && (I.value = t);
|
|
475
478
|
}), d(() => l.buttonOnly, (e) => {
|
|
476
479
|
const t = !!e;
|
|
477
|
-
t !==
|
|
480
|
+
t !== q.value && (q.value = t);
|
|
478
481
|
}), d(() => l.allowedTypes, (e) => {
|
|
479
|
-
const i = (Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : []).map((
|
|
482
|
+
const i = (Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : []).map((n) => String(n).trim()).filter(Boolean);
|
|
480
483
|
JSON.stringify(i) !== JSON.stringify(w.value) && (w.value = i);
|
|
481
484
|
}), d(() => l.disallowedTypes, (e) => {
|
|
482
|
-
const i = (Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : []).map((
|
|
485
|
+
const i = (Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : []).map((n) => String(n).trim()).filter(Boolean);
|
|
483
486
|
JSON.stringify(i) !== JSON.stringify(S.value) && (S.value = i);
|
|
484
487
|
}), d(() => l.maxFileSize, (e) => {
|
|
485
488
|
const t = e === 1 / 0 ? 1 / 0 : Number(e);
|
|
@@ -489,85 +492,85 @@ Max size: ${C.value} Byte`), (t = E.value) == null || t.call(E, e, e.size, C.val
|
|
|
489
492
|
(Number.isFinite(t) || t === 1 / 0) && t !== $.value && ($.value = t);
|
|
490
493
|
}), d(() => l.maxFileCount, (e) => {
|
|
491
494
|
const t = Number(e);
|
|
492
|
-
Number.isInteger(t) && t >= 0 && t !==
|
|
495
|
+
Number.isInteger(t) && t >= 0 && t !== A.value && (A.value = t);
|
|
493
496
|
}), d(() => l.onDisallowedType, (e) => {
|
|
494
497
|
const t = typeof e == "function" ? e : void 0;
|
|
495
498
|
t !== F.value && (F.value = t);
|
|
496
499
|
}), d(() => l.onMaxFileSizeExceeded, (e) => {
|
|
497
500
|
const t = typeof e == "function" ? e : void 0;
|
|
498
|
-
t !==
|
|
501
|
+
t !== O.value && (O.value = t);
|
|
499
502
|
}), d(() => l.onMaxTotalSizeExceeded, (e) => {
|
|
500
503
|
const t = typeof e == "function" ? e : void 0;
|
|
501
504
|
t !== L.value && (L.value = t);
|
|
502
505
|
}), d(() => l.tabIndex, (e) => {
|
|
503
506
|
const t = e === null || e === "" ? null : Number(e);
|
|
504
|
-
t !==
|
|
507
|
+
t !== W.value && (W.value = t);
|
|
505
508
|
}), d(() => l.class, () => {
|
|
506
509
|
te();
|
|
507
510
|
}), {
|
|
508
|
-
fileInputRef:
|
|
511
|
+
fileInputRef: k,
|
|
509
512
|
id: c,
|
|
510
513
|
props: l,
|
|
511
|
-
visibleFiles:
|
|
514
|
+
visibleFiles: $e,
|
|
512
515
|
filesetMethods: p,
|
|
513
|
-
responsiveClassList:
|
|
514
|
-
buttonClassList:
|
|
516
|
+
responsiveClassList: E,
|
|
517
|
+
buttonClassList: Ce,
|
|
515
518
|
visibleClass: ne,
|
|
516
|
-
editModeClass:
|
|
517
|
-
disable:
|
|
518
|
-
readonly:
|
|
519
|
-
addButtonText:
|
|
520
|
-
removeButtonText:
|
|
521
|
-
placeholder:
|
|
519
|
+
editModeClass: we,
|
|
520
|
+
disable: R,
|
|
521
|
+
readonly: he,
|
|
522
|
+
addButtonText: P,
|
|
523
|
+
removeButtonText: H,
|
|
524
|
+
placeholder: V,
|
|
522
525
|
isDragging: le,
|
|
523
|
-
multiCols:
|
|
524
|
-
multiple:
|
|
525
|
-
accept:
|
|
526
|
-
tabIndex:
|
|
527
|
-
buttonOnly:
|
|
528
|
-
buttonOnlyClass:
|
|
526
|
+
multiCols: J,
|
|
527
|
+
multiple: I,
|
|
528
|
+
accept: Te,
|
|
529
|
+
tabIndex: W,
|
|
530
|
+
buttonOnly: q,
|
|
531
|
+
buttonOnlyClass: Fe,
|
|
529
532
|
openFileDialog: Ie,
|
|
530
|
-
removeFile:
|
|
531
|
-
onFileChange:
|
|
532
|
-
downloadFile:
|
|
533
|
-
handleDragEnter:
|
|
534
|
-
handleDrop:
|
|
533
|
+
removeFile: ze,
|
|
534
|
+
onFileChange: Ne,
|
|
535
|
+
downloadFile: ke,
|
|
536
|
+
handleDragEnter: xe,
|
|
537
|
+
handleDrop: Be
|
|
535
538
|
};
|
|
536
539
|
}
|
|
537
|
-
}),
|
|
540
|
+
}), _e = {
|
|
538
541
|
key: 1,
|
|
539
542
|
class: "hison-fileset-add-text"
|
|
540
|
-
},
|
|
543
|
+
}, el = {
|
|
541
544
|
key: 0,
|
|
542
545
|
class: "file-placeholder"
|
|
543
|
-
},
|
|
546
|
+
}, ll = ["onClick"], tl = ["disabled", "onClick"], il = { class: "hison-fileset-remove-text" }, al = {
|
|
544
547
|
key: 0,
|
|
545
548
|
class: "add-btn-container"
|
|
546
|
-
},
|
|
549
|
+
}, nl = {
|
|
547
550
|
key: 1,
|
|
548
551
|
class: "hison-fileset-add-text"
|
|
549
|
-
},
|
|
550
|
-
function
|
|
551
|
-
const
|
|
552
|
+
}, ol = ["id", "accept", "multiple"];
|
|
553
|
+
function sl(l, a, k, o, p, c) {
|
|
554
|
+
const x = je("HButton");
|
|
552
555
|
return y(), b(Y, null, [
|
|
553
556
|
l.buttonOnly ? (y(), b(Y, { key: 0 }, [
|
|
554
|
-
l.readonly ? ae("", !0) : (y(),
|
|
557
|
+
l.readonly ? ae("", !0) : (y(), Re(x, {
|
|
555
558
|
key: 0,
|
|
556
559
|
onClick: l.openFileDialog,
|
|
557
|
-
onFocus: a[0] || (a[0] = (
|
|
558
|
-
onBlur: a[1] || (a[1] = (
|
|
560
|
+
onFocus: a[0] || (a[0] = (u) => l.$emit("focus", l.filesetMethods)),
|
|
561
|
+
onBlur: a[1] || (a[1] = (u) => l.$emit("blur", l.filesetMethods)),
|
|
559
562
|
id: `hison_fileset_add_button_${l.id}`,
|
|
560
563
|
disable: l.disable,
|
|
561
564
|
class: M(l.buttonOnlyClass),
|
|
562
|
-
style:
|
|
565
|
+
style: me(l.props.style),
|
|
563
566
|
tabIndex: l.tabIndex ?? void 0
|
|
564
567
|
}, {
|
|
565
|
-
default:
|
|
568
|
+
default: be(() => [
|
|
566
569
|
l.$slots["add-button"] ? Z(l.$slots, "add-button", {
|
|
567
570
|
key: 0,
|
|
568
571
|
add: l.openFileDialog,
|
|
569
572
|
disable: l.disable
|
|
570
|
-
}) : (y(), b("span",
|
|
573
|
+
}) : (y(), b("span", _e, K(l.addButtonText), 1))
|
|
571
574
|
]),
|
|
572
575
|
_: 3
|
|
573
576
|
}, 8, ["onClick", "id", "disable", "class", "style", "tabIndex"]))
|
|
@@ -579,86 +582,86 @@ function ol(l, a, x, n, p, c) {
|
|
|
579
582
|
l.visibleClass
|
|
580
583
|
])
|
|
581
584
|
}, [
|
|
582
|
-
|
|
585
|
+
j("div", {
|
|
583
586
|
class: M([
|
|
584
587
|
"hison-fileset",
|
|
585
588
|
l.editModeClass
|
|
586
589
|
]),
|
|
587
|
-
style:
|
|
590
|
+
style: me(l.props.style)
|
|
588
591
|
}, [
|
|
589
|
-
|
|
592
|
+
j("div", {
|
|
590
593
|
class: M(["file-list-wrapper", { "drag-over": l.isDragging }]),
|
|
591
594
|
onDragover: a[2] || (a[2] = _(() => {
|
|
592
595
|
}, ["prevent"])),
|
|
593
|
-
onDragenter: a[3] || (a[3] = _((...
|
|
594
|
-
onDragleave: a[4] || (a[4] = _((
|
|
595
|
-
onDrop: a[5] || (a[5] = _((...
|
|
596
|
+
onDragenter: a[3] || (a[3] = _((...u) => l.handleDragEnter && l.handleDragEnter(...u), ["prevent"])),
|
|
597
|
+
onDragleave: a[4] || (a[4] = _((u) => l.isDragging = !1, ["prevent"])),
|
|
598
|
+
onDrop: a[5] || (a[5] = _((...u) => l.handleDrop && l.handleDrop(...u), ["prevent"]))
|
|
596
599
|
}, [
|
|
597
|
-
|
|
600
|
+
j("div", {
|
|
598
601
|
class: M(["file-list", { "multi-cols": l.multiCols }])
|
|
599
602
|
}, [
|
|
600
|
-
l.visibleFiles.length === 0 && l.placeholder ? (y(), b("div",
|
|
603
|
+
l.visibleFiles.length === 0 && l.placeholder ? (y(), b("div", el, K(l.placeholder), 1)) : (y(!0), b(Y, { key: 1 }, Pe(l.visibleFiles, (u, f) => (y(), b("div", {
|
|
601
604
|
key: f,
|
|
602
605
|
class: "file-item"
|
|
603
606
|
}, [
|
|
604
|
-
Z(l.$slots, "file-icon", { file:
|
|
605
|
-
|
|
606
|
-
class: M(["file-name", { clickable:
|
|
607
|
-
onClick: (
|
|
608
|
-
},
|
|
607
|
+
Z(l.$slots, "file-icon", { file: u }),
|
|
608
|
+
j("span", {
|
|
609
|
+
class: M(["file-name", { clickable: u.file || u.filePath }]),
|
|
610
|
+
onClick: (R) => l.downloadFile(u)
|
|
611
|
+
}, K(u.fileName), 11, ll),
|
|
609
612
|
l.readonly ? ae("", !0) : (y(), b(Y, { key: 0 }, [
|
|
610
613
|
l.$slots["remove-button"] ? Z(l.$slots, "remove-button", {
|
|
611
614
|
key: 0,
|
|
612
|
-
file:
|
|
615
|
+
file: u,
|
|
613
616
|
index: f,
|
|
614
|
-
remove: () => l.removeFile(
|
|
617
|
+
remove: () => l.removeFile(u),
|
|
615
618
|
disable: l.disable
|
|
616
619
|
}) : (y(), b("button", {
|
|
617
620
|
key: 1,
|
|
618
621
|
class: M(["delete-btn", { "hison-disable": l.disable }]),
|
|
619
622
|
disabled: l.disable,
|
|
620
|
-
onClick: (
|
|
623
|
+
onClick: (R) => l.removeFile(u)
|
|
621
624
|
}, [
|
|
622
|
-
|
|
623
|
-
], 10,
|
|
625
|
+
j("span", il, K(l.removeButtonText), 1)
|
|
626
|
+
], 10, tl))
|
|
624
627
|
], 64))
|
|
625
628
|
]))), 128))
|
|
626
629
|
], 2)
|
|
627
630
|
], 34),
|
|
628
|
-
l.readonly ? ae("", !0) : (y(), b("div",
|
|
629
|
-
|
|
631
|
+
l.readonly ? ae("", !0) : (y(), b("div", al, [
|
|
632
|
+
He(x, {
|
|
630
633
|
onClick: l.openFileDialog,
|
|
631
|
-
onFocus: a[6] || (a[6] = (
|
|
632
|
-
onBlur: a[7] || (a[7] = (
|
|
634
|
+
onFocus: a[6] || (a[6] = (u) => l.$emit("focus", l.filesetMethods)),
|
|
635
|
+
onBlur: a[7] || (a[7] = (u) => l.$emit("blur", l.filesetMethods)),
|
|
633
636
|
id: `hison_fileset_add_button_${l.id}`,
|
|
634
637
|
disable: l.disable,
|
|
635
638
|
class: M([...l.buttonClassList]),
|
|
636
639
|
tabIndex: l.tabIndex ?? void 0
|
|
637
640
|
}, {
|
|
638
|
-
default:
|
|
641
|
+
default: be(() => [
|
|
639
642
|
l.$slots["add-button"] ? Z(l.$slots, "add-button", {
|
|
640
643
|
key: 0,
|
|
641
644
|
add: l.openFileDialog,
|
|
642
645
|
disable: l.disable
|
|
643
|
-
}) : (y(), b("span",
|
|
646
|
+
}) : (y(), b("span", nl, K(l.addButtonText), 1))
|
|
644
647
|
]),
|
|
645
648
|
_: 3
|
|
646
649
|
}, 8, ["onClick", "id", "disable", "class", "tabIndex"])
|
|
647
650
|
]))
|
|
648
651
|
], 6)
|
|
649
652
|
], 2)),
|
|
650
|
-
|
|
653
|
+
j("input", {
|
|
651
654
|
id: `hison_fileset_${l.id}`,
|
|
652
655
|
ref: "fileInputRef",
|
|
653
656
|
type: "file",
|
|
654
657
|
accept: l.accept || void 0,
|
|
655
658
|
multiple: l.multiple,
|
|
656
659
|
hidden: "",
|
|
657
|
-
onChange: a[8] || (a[8] = (...
|
|
658
|
-
}, null, 40,
|
|
660
|
+
onChange: a[8] || (a[8] = (...u) => l.onFileChange && l.onFileChange(...u))
|
|
661
|
+
}, null, 40, ol)
|
|
659
662
|
], 64);
|
|
660
663
|
}
|
|
661
|
-
const
|
|
664
|
+
const vl = /* @__PURE__ */ Xe(Ze, [["render", sl]]);
|
|
662
665
|
export {
|
|
663
|
-
|
|
666
|
+
vl as default
|
|
664
667
|
};
|