handy-uploader 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -21
- package/dist/element/HandyUploaderElement.d.ts +20 -0
- package/dist/element/index.d.ts +21 -0
- package/dist/element/types.d.ts +108 -0
- package/dist/element.mjs +6178 -0
- package/dist/vuetify.cjs +1 -1
- package/dist/vuetify.mjs +245 -240
- package/package.json +30 -11
package/dist/vuetify.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as J, computed as
|
|
1
|
+
import { defineComponent as J, computed as Q, resolveComponent as f, openBlock as d, createElementBlock as w, createVNode as s, withCtx as o, createTextVNode as _, toDisplayString as y, ref as Z, watch as S, onMounted as ke, Fragment as H, renderList as W, createBlock as v, createElementVNode as D, unref as G, mergeProps as R, createCommentVNode as A, withDirectives as pe, vShow as ge, reactive as we, onBeforeMount as $e, onDeactivated as Ae } from "vue";
|
|
2
2
|
import { z as Le, m as se, u as re, g as ce, b as Ve, A as de, B as ue, c as Te, r as ze, l as Be, j as Se, a as Ue, y as Ie, x as Ee, i as Pe, k as me, q as je } from "./language-CYpPw-mk.mjs";
|
|
3
3
|
import { C as St, e as Ut, h as It, f as Et, d as Pt, n as jt, o as Mt, t as Ht, v as Nt, p as Ot, w as qt, s as Rt } from "./language-CYpPw-mk.mjs";
|
|
4
4
|
const te = /* @__PURE__ */ J({
|
|
@@ -8,14 +8,14 @@ const te = /* @__PURE__ */ J({
|
|
|
8
8
|
size: { default: 30 }
|
|
9
9
|
},
|
|
10
10
|
setup(l) {
|
|
11
|
-
const i = l, t =
|
|
11
|
+
const i = l, t = Q(() => {
|
|
12
12
|
const e = `file.${i.fileFormat}`;
|
|
13
13
|
return Le(e);
|
|
14
14
|
});
|
|
15
15
|
return (e, m) => {
|
|
16
|
-
const
|
|
17
|
-
return d(),
|
|
18
|
-
s(
|
|
16
|
+
const C = f("v-icon");
|
|
17
|
+
return d(), w("div", null, [
|
|
18
|
+
s(C, {
|
|
19
19
|
size: i.size,
|
|
20
20
|
color: t.value.color
|
|
21
21
|
}, {
|
|
@@ -64,7 +64,7 @@ const te = /* @__PURE__ */ J({
|
|
|
64
64
|
const t = (n) => {
|
|
65
65
|
const a = re(n);
|
|
66
66
|
return console.log("🔍 isImageFile check:", n, "→", a), a;
|
|
67
|
-
}, e = l, m = i,
|
|
67
|
+
}, e = l, m = i, C = (n) => {
|
|
68
68
|
const a = ce(n) === "video";
|
|
69
69
|
return console.log("🎥 Checking if video file:", n, "result:", a, "fileType:", ce(n)), a;
|
|
70
70
|
}, V = (n) => {
|
|
@@ -78,37 +78,38 @@ const te = /* @__PURE__ */ J({
|
|
|
78
78
|
srcLength: a.length,
|
|
79
79
|
srcPreview: a.substring(0, 100) + "..."
|
|
80
80
|
}), a;
|
|
81
|
-
},
|
|
81
|
+
}, k = (n) => {
|
|
82
82
|
var a;
|
|
83
83
|
console.error("Image failed to load:", {
|
|
84
84
|
name: n.name,
|
|
85
85
|
format: n.format,
|
|
86
86
|
base64Length: ((a = n.base64) == null ? void 0 : a.length) || 0
|
|
87
87
|
});
|
|
88
|
-
},
|
|
89
|
-
console.error("Video thumbnail failed to load:", { name: n.name, format: n.format }),
|
|
88
|
+
}, z = Z(0), g = Te(() => z.value++), h = (n) => (z.value, g.get(n)), U = (n) => {
|
|
89
|
+
console.error("Video thumbnail failed to load:", { name: n.name, format: n.format }), g.invalidate(n);
|
|
90
90
|
}, L = (n) => ({
|
|
91
91
|
icon: ue(n),
|
|
92
92
|
color: de(n)
|
|
93
|
-
}),
|
|
93
|
+
}), B = (n) => n.tags.length > 0 || !!n.description, j = (n) => {
|
|
94
94
|
n.showDetailState = !n.showDetailState;
|
|
95
95
|
}, I = (n, a) => {
|
|
96
96
|
m("openDeleteDialog", n, a);
|
|
97
97
|
}, M = (n, a) => {
|
|
98
98
|
m("openEditDocumentDialog", n, a);
|
|
99
99
|
}, u = () => {
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
if (g.retain(e.documentAttachment.map((a) => a.file)), !e.thumb) return;
|
|
101
|
+
console.log("🎯 Generating thumbnails for videos, total attachments:", e.documentAttachment.length);
|
|
102
|
+
const n = e.documentAttachment.filter((a) => C(a.file.name));
|
|
102
103
|
console.log("📹 Found video attachments:", n.length, n.map((a) => a.file.name)), n.forEach((a) => {
|
|
103
|
-
console.log("🎬 Processing video:", a.file.name),
|
|
104
|
+
console.log("🎬 Processing video:", a.file.name), h(a.file);
|
|
104
105
|
});
|
|
105
106
|
};
|
|
106
|
-
return
|
|
107
|
-
const r = f("v-icon"), c = f("v-card-subtitle"), x = f("v-chip"),
|
|
108
|
-
return d(),
|
|
107
|
+
return S(() => e.documentAttachment, u, { immediate: !0 }), ke(u), (n, a) => {
|
|
108
|
+
const r = f("v-icon"), c = f("v-card-subtitle"), x = f("v-chip"), b = f("v-divider"), T = f("v-btn"), F = f("v-tooltip"), N = f("v-spacer"), K = f("v-card-actions"), ee = f("v-chip-group"), q = f("v-card-text"), le = f("v-expand-transition"), oe = f("v-card"), ne = f("v-col"), ae = f("v-row");
|
|
109
|
+
return d(), w("div", null, [
|
|
109
110
|
s(ae, null, {
|
|
110
111
|
default: o(() => [
|
|
111
|
-
(d(!0),
|
|
112
|
+
(d(!0), w(H, null, W(l.documentAttachment, ($, X) => (d(), v(ne, {
|
|
112
113
|
key: `attachment-${X}`,
|
|
113
114
|
cols: "12",
|
|
114
115
|
md: l.cols,
|
|
@@ -124,19 +125,19 @@ const te = /* @__PURE__ */ J({
|
|
|
124
125
|
"max-width": "344"
|
|
125
126
|
}, {
|
|
126
127
|
default: o(() => [
|
|
127
|
-
t($.file.name) ? (d(),
|
|
128
|
+
l.thumb && t($.file.name) ? (d(), w("div", Me, [
|
|
128
129
|
D("img", {
|
|
129
130
|
src: V($.file),
|
|
130
131
|
style: { "max-width": "100%", "max-height": "100%", "object-fit": "contain" },
|
|
131
|
-
onError: (E) =>
|
|
132
|
+
onError: (E) => k($.file)
|
|
132
133
|
}, null, 40, He)
|
|
133
|
-
])) :
|
|
134
|
-
|
|
134
|
+
])) : l.thumb && C($.file.name) ? (d(), w("div", Ne, [
|
|
135
|
+
h($.file) ? (d(), w("img", {
|
|
135
136
|
key: 0,
|
|
136
|
-
src:
|
|
137
|
+
src: h($.file),
|
|
137
138
|
style: { width: "100%", height: "100%", "object-fit": "cover" },
|
|
138
|
-
onError: (E) =>
|
|
139
|
-
}, null, 40, Oe)) : (d(),
|
|
139
|
+
onError: (E) => U($.file)
|
|
140
|
+
}, null, 40, Oe)) : (d(), w("div", qe, [
|
|
140
141
|
s(r, {
|
|
141
142
|
size: "60",
|
|
142
143
|
color: "grey"
|
|
@@ -158,7 +159,7 @@ const te = /* @__PURE__ */ J({
|
|
|
158
159
|
_: 1
|
|
159
160
|
})
|
|
160
161
|
])
|
|
161
|
-
])) : (d(),
|
|
162
|
+
])) : (d(), w("div", We, [
|
|
162
163
|
s(r, {
|
|
163
164
|
size: "120",
|
|
164
165
|
color: L($.file.name).color
|
|
@@ -196,12 +197,12 @@ const te = /* @__PURE__ */ J({
|
|
|
196
197
|
]),
|
|
197
198
|
_: 2
|
|
198
199
|
}, 1024),
|
|
199
|
-
s(
|
|
200
|
+
s(b, { class: "mx-4" }),
|
|
200
201
|
s(K, { style: { padding: "0" } }, {
|
|
201
202
|
default: o(() => [
|
|
202
203
|
s(F, { right: "" }, {
|
|
203
204
|
activator: o(({ props: E }) => [
|
|
204
|
-
l.deletePermission ? (d(),
|
|
205
|
+
l.deletePermission ? (d(), v(T, R({
|
|
205
206
|
key: 0,
|
|
206
207
|
text: "",
|
|
207
208
|
fab: ""
|
|
@@ -226,7 +227,7 @@ const te = /* @__PURE__ */ J({
|
|
|
226
227
|
}, 1024),
|
|
227
228
|
s(F, { right: "" }, {
|
|
228
229
|
activator: o(({ props: E }) => [
|
|
229
|
-
l.editPermission ? (d(),
|
|
230
|
+
l.editPermission ? (d(), v(T, R({
|
|
230
231
|
key: 0,
|
|
231
232
|
text: "",
|
|
232
233
|
fab: ""
|
|
@@ -250,7 +251,7 @@ const te = /* @__PURE__ */ J({
|
|
|
250
251
|
_: 2
|
|
251
252
|
}, 1024),
|
|
252
253
|
s(N),
|
|
253
|
-
|
|
254
|
+
B($.file) ? (d(), v(T, {
|
|
254
255
|
key: 0,
|
|
255
256
|
icon: "",
|
|
256
257
|
onClick: (E) => j($.file)
|
|
@@ -270,16 +271,16 @@ const te = /* @__PURE__ */ J({
|
|
|
270
271
|
}, 1024),
|
|
271
272
|
s(le, null, {
|
|
272
273
|
default: o(() => [
|
|
273
|
-
|
|
274
|
-
s(
|
|
275
|
-
$.file.tags.length ? (d(),
|
|
274
|
+
B($.file) ? pe((d(), w("div", Ge, [
|
|
275
|
+
s(b),
|
|
276
|
+
$.file.tags.length ? (d(), v(ee, {
|
|
276
277
|
key: 0,
|
|
277
278
|
multiple: "",
|
|
278
279
|
"active-class": "primary--text",
|
|
279
280
|
class: "pa-2"
|
|
280
281
|
}, {
|
|
281
282
|
default: o(() => [
|
|
282
|
-
(d(!0),
|
|
283
|
+
(d(!0), w(H, null, W($.file.tags, (E, Y) => (d(), v(x, {
|
|
283
284
|
key: `tag-${Y}`,
|
|
284
285
|
class: "ma-1"
|
|
285
286
|
}, {
|
|
@@ -291,7 +292,7 @@ const te = /* @__PURE__ */ J({
|
|
|
291
292
|
]),
|
|
292
293
|
_: 2
|
|
293
294
|
}, 1024)) : A("", !0),
|
|
294
|
-
$.file.description ? (d(),
|
|
295
|
+
$.file.description ? (d(), v(q, {
|
|
295
296
|
key: 1,
|
|
296
297
|
class: "text-justify"
|
|
297
298
|
}, {
|
|
@@ -343,20 +344,20 @@ const te = /* @__PURE__ */ J({
|
|
|
343
344
|
},
|
|
344
345
|
emits: ["openDeleteDialog", "openEditDocumentDialog"],
|
|
345
346
|
setup(l, { emit: i }) {
|
|
346
|
-
const t = l, e = i, m = (
|
|
347
|
-
const
|
|
348
|
-
return
|
|
349
|
-
}, V = (
|
|
350
|
-
const
|
|
351
|
-
return
|
|
352
|
-
},
|
|
353
|
-
e("openDeleteDialog",
|
|
354
|
-
},
|
|
355
|
-
e("openEditDocumentDialog",
|
|
347
|
+
const t = l, e = i, m = (g) => g ? re(g) : !1, C = (g) => {
|
|
348
|
+
const h = g / 1e3, U = h / 1024;
|
|
349
|
+
return U >= 1 ? `${U.toFixed(1)} MB` : `${h.toFixed(1)} KB`;
|
|
350
|
+
}, V = (g) => {
|
|
351
|
+
const h = g / 1024e3;
|
|
352
|
+
return h < 1 ? "success" : h < 5 ? "warning" : "error";
|
|
353
|
+
}, k = (g, h) => {
|
|
354
|
+
e("openDeleteDialog", g, h);
|
|
355
|
+
}, z = (g, h) => {
|
|
356
|
+
e("openEditDocumentDialog", g, h);
|
|
356
357
|
};
|
|
357
|
-
return (
|
|
358
|
-
const
|
|
359
|
-
return d(),
|
|
358
|
+
return (g, h) => {
|
|
359
|
+
const U = f("v-img"), L = f("v-icon"), B = f("v-tooltip"), j = f("v-chip"), I = f("v-btn"), M = f("v-table"), u = f("v-col"), n = f("v-row");
|
|
360
|
+
return d(), w("div", null, [
|
|
360
361
|
s(n, null, {
|
|
361
362
|
default: o(() => [
|
|
362
363
|
s(u, { cols: "12" }, {
|
|
@@ -376,19 +377,19 @@ const te = /* @__PURE__ */ J({
|
|
|
376
377
|
])
|
|
377
378
|
]),
|
|
378
379
|
D("tbody", null, [
|
|
379
|
-
(d(!0),
|
|
380
|
+
(d(!0), w(H, null, W(t.documentAttachment, (a, r) => (d(), w("tr", {
|
|
380
381
|
key: `attachment-${r}`,
|
|
381
382
|
class: "table-row"
|
|
382
383
|
}, [
|
|
383
384
|
D("td", et, [
|
|
384
|
-
s(
|
|
385
|
+
s(B, { location: "top" }, {
|
|
385
386
|
activator: o(({ props: c }) => [
|
|
386
387
|
D("div", R({
|
|
387
388
|
class: "d-flex justify-center align-center",
|
|
388
389
|
style: { height: "60px", width: "60px" }
|
|
389
390
|
}, { ref_for: !0 }, c), [
|
|
390
|
-
m(a.file.name) ? (d(),
|
|
391
|
-
t.thumb && a.file.base64 ? (d(),
|
|
391
|
+
m(a.file.name) ? (d(), w(H, { key: 0 }, [
|
|
392
|
+
t.thumb && a.file.base64 ? (d(), v(U, {
|
|
392
393
|
key: 0,
|
|
393
394
|
style: { height: "40px", width: "40px" },
|
|
394
395
|
src: "data:" + a.file.format + ";base64," + a.file.base64,
|
|
@@ -396,17 +397,17 @@ const te = /* @__PURE__ */ J({
|
|
|
396
397
|
width: "40",
|
|
397
398
|
class: "rounded",
|
|
398
399
|
contain: ""
|
|
399
|
-
}, null, 8, ["src"])) : (d(),
|
|
400
|
+
}, null, 8, ["src"])) : (d(), v(L, {
|
|
400
401
|
key: 1,
|
|
401
402
|
size: "40",
|
|
402
403
|
color: "deep-purple"
|
|
403
404
|
}, {
|
|
404
|
-
default: o(() => [...
|
|
405
|
+
default: o(() => [...h[0] || (h[0] = [
|
|
405
406
|
_(" mdi-file-image-outline ", -1)
|
|
406
407
|
])]),
|
|
407
408
|
_: 1
|
|
408
409
|
}))
|
|
409
|
-
], 64)) : (d(),
|
|
410
|
+
], 64)) : (d(), v(L, {
|
|
410
411
|
key: 1,
|
|
411
412
|
icon: G(ue)(a.file.name),
|
|
412
413
|
color: G(de)(a.file.name),
|
|
@@ -421,11 +422,11 @@ const te = /* @__PURE__ */ J({
|
|
|
421
422
|
}, 1024)
|
|
422
423
|
]),
|
|
423
424
|
D("td", tt, [
|
|
424
|
-
s(
|
|
425
|
+
s(B, { location: "top" }, {
|
|
425
426
|
activator: o(({ props: c }) => [
|
|
426
427
|
D("span", R({ ref_for: !0 }, c), y((() => {
|
|
427
|
-
const x = a.file.name.split(".").pop(),
|
|
428
|
-
return `${
|
|
428
|
+
const x = a.file.name.split(".").pop(), b = a.file.name.slice(0, a.file.name.lastIndexOf("."));
|
|
429
|
+
return `${b.length > 10 ? b.slice(0, 10) + "..." : b}.${x}`;
|
|
429
430
|
})()), 17)
|
|
430
431
|
]),
|
|
431
432
|
default: o(() => [
|
|
@@ -442,14 +443,14 @@ const te = /* @__PURE__ */ J({
|
|
|
442
443
|
class: "text-caption"
|
|
443
444
|
}, {
|
|
444
445
|
default: o(() => [
|
|
445
|
-
_(y(
|
|
446
|
+
_(y(C(a.file.size)), 1)
|
|
446
447
|
]),
|
|
447
448
|
_: 2
|
|
448
449
|
}, 1032, ["color"])
|
|
449
450
|
]),
|
|
450
451
|
D("td", ot, [
|
|
451
452
|
D("div", nt, [
|
|
452
|
-
l.editPermission ? (d(),
|
|
453
|
+
l.editPermission ? (d(), v(B, {
|
|
453
454
|
key: 0,
|
|
454
455
|
location: "top"
|
|
455
456
|
}, {
|
|
@@ -460,11 +461,11 @@ const te = /* @__PURE__ */ J({
|
|
|
460
461
|
color: "success",
|
|
461
462
|
variant: "text"
|
|
462
463
|
}, { ref_for: !0 }, c, {
|
|
463
|
-
onClick: (x) =>
|
|
464
|
+
onClick: (x) => z(a, r)
|
|
464
465
|
}), {
|
|
465
466
|
default: o(() => [
|
|
466
467
|
s(L, { size: "18" }, {
|
|
467
|
-
default: o(() => [...
|
|
468
|
+
default: o(() => [...h[1] || (h[1] = [
|
|
468
469
|
_("mdi-pencil-outline", -1)
|
|
469
470
|
])]),
|
|
470
471
|
_: 1
|
|
@@ -478,7 +479,7 @@ const te = /* @__PURE__ */ J({
|
|
|
478
479
|
]),
|
|
479
480
|
_: 2
|
|
480
481
|
}, 1024)) : A("", !0),
|
|
481
|
-
l.deletePermission ? (d(),
|
|
482
|
+
l.deletePermission ? (d(), v(B, {
|
|
482
483
|
key: 1,
|
|
483
484
|
location: "top"
|
|
484
485
|
}, {
|
|
@@ -489,11 +490,11 @@ const te = /* @__PURE__ */ J({
|
|
|
489
490
|
color: "error",
|
|
490
491
|
variant: "text"
|
|
491
492
|
}, { ref_for: !0 }, c, {
|
|
492
|
-
onClick: (x) =>
|
|
493
|
+
onClick: (x) => k(r, "")
|
|
493
494
|
}), {
|
|
494
495
|
default: o(() => [
|
|
495
496
|
s(L, { size: "18" }, {
|
|
496
|
-
default: o(() => [...
|
|
497
|
+
default: o(() => [...h[2] || (h[2] = [
|
|
497
498
|
_("mdi-delete", -1)
|
|
498
499
|
])]),
|
|
499
500
|
_: 1
|
|
@@ -564,19 +565,19 @@ const te = /* @__PURE__ */ J({
|
|
|
564
565
|
},
|
|
565
566
|
emits: ["setCardTheme", "openDeleteDialog", "openEditDocumentDialog"],
|
|
566
567
|
setup(l, { emit: i }) {
|
|
567
|
-
const t = l, e = i, m = (
|
|
568
|
-
const
|
|
569
|
-
return
|
|
570
|
-
},
|
|
571
|
-
var
|
|
572
|
-
return ["jpg", "jpeg", "png", "tif", "bmp"].includes(((
|
|
573
|
-
}, V = (
|
|
574
|
-
return (
|
|
575
|
-
const
|
|
576
|
-
return d(),
|
|
568
|
+
const t = l, e = i, m = (g) => {
|
|
569
|
+
const h = g / 1e3;
|
|
570
|
+
return h < 1024 ? `${h.toFixed(1)} ${t.selectedLang[t.lang].size.kb}` : `${(h / 1024).toFixed(1)} ${t.selectedLang[t.lang].size.mb}`;
|
|
571
|
+
}, C = (g) => {
|
|
572
|
+
var h;
|
|
573
|
+
return ["jpg", "jpeg", "png", "tif", "bmp"].includes(((h = g.split(".").pop()) == null ? void 0 : h.toLowerCase()) || "");
|
|
574
|
+
}, V = (g) => g.base64 ? g.base64.startsWith("data:") ? g.base64 : `data:${g.format};base64,${g.base64}` : "", k = (g, h) => e("openDeleteDialog", g, h), z = (g, h) => e("openEditDocumentDialog", g, h);
|
|
575
|
+
return (g, h) => {
|
|
576
|
+
const U = f("v-icon"), L = f("v-chip"), B = f("v-img"), j = f("v-divider"), I = f("v-btn"), M = f("v-tooltip"), u = f("v-chip-group"), n = f("v-card-text"), a = f("v-expand-transition"), r = f("v-card"), c = f("v-col"), x = f("v-row");
|
|
577
|
+
return d(), w("div", null, [
|
|
577
578
|
s(x, null, {
|
|
578
579
|
default: o(() => [
|
|
579
|
-
(d(!0),
|
|
580
|
+
(d(!0), w(H, null, W(t.documentAttachment, (b, T) => (d(), v(c, {
|
|
580
581
|
key: `attachment-${T}`,
|
|
581
582
|
cols: "12",
|
|
582
583
|
sm: "6",
|
|
@@ -595,7 +596,7 @@ const te = /* @__PURE__ */ J({
|
|
|
595
596
|
default: o(() => [
|
|
596
597
|
D("div", it, [
|
|
597
598
|
D("div", st, [
|
|
598
|
-
D("div", rt, y(
|
|
599
|
+
D("div", rt, y(b.file.name), 1),
|
|
599
600
|
s(L, {
|
|
600
601
|
color: "teal",
|
|
601
602
|
variant: "flat",
|
|
@@ -603,36 +604,36 @@ const te = /* @__PURE__ */ J({
|
|
|
603
604
|
class: "text-white mb-2"
|
|
604
605
|
}, {
|
|
605
606
|
default: o(() => [
|
|
606
|
-
s(
|
|
607
|
+
s(U, {
|
|
607
608
|
start: "",
|
|
608
609
|
size: "16"
|
|
609
610
|
}, {
|
|
610
|
-
default: o(() => [...
|
|
611
|
+
default: o(() => [...h[0] || (h[0] = [
|
|
611
612
|
_("mdi-harddisk", -1)
|
|
612
613
|
])]),
|
|
613
614
|
_: 1
|
|
614
615
|
}),
|
|
615
|
-
_(" " + y(m(
|
|
616
|
+
_(" " + y(m(b.file.size)), 1)
|
|
616
617
|
]),
|
|
617
618
|
_: 2
|
|
618
619
|
}, 1024)
|
|
619
620
|
]),
|
|
620
621
|
D("div", dt, [
|
|
621
|
-
|
|
622
|
-
s(
|
|
623
|
-
src: V(
|
|
622
|
+
C(b.file.name) && t.thumb ? (d(), w("div", ut, [
|
|
623
|
+
s(B, {
|
|
624
|
+
src: V(b.file),
|
|
624
625
|
height: "80",
|
|
625
626
|
width: "80",
|
|
626
627
|
cover: "",
|
|
627
628
|
class: "rounded"
|
|
628
629
|
}, null, 8, ["src"])
|
|
629
|
-
])) : (d(),
|
|
630
|
-
s(
|
|
631
|
-
color: G(de)(
|
|
630
|
+
])) : (d(), w("div", ct, [
|
|
631
|
+
s(U, {
|
|
632
|
+
color: G(de)(b.file.name),
|
|
632
633
|
size: "60"
|
|
633
634
|
}, {
|
|
634
635
|
default: o(() => [
|
|
635
|
-
_(y(G(ue)(
|
|
636
|
+
_(y(G(ue)(b.file.name)), 1)
|
|
636
637
|
]),
|
|
637
638
|
_: 2
|
|
638
639
|
}, 1032, ["color"])
|
|
@@ -643,20 +644,20 @@ const te = /* @__PURE__ */ J({
|
|
|
643
644
|
D("div", mt, [
|
|
644
645
|
s(M, { bottom: "" }, {
|
|
645
646
|
activator: o(({ props: F }) => [
|
|
646
|
-
t.deletePermission ? (d(),
|
|
647
|
+
t.deletePermission ? (d(), v(I, R({
|
|
647
648
|
key: 0,
|
|
648
649
|
icon: "",
|
|
649
650
|
variant: "text",
|
|
650
651
|
size: "small"
|
|
651
652
|
}, { ref_for: !0 }, F, {
|
|
652
|
-
onClick: (N) =>
|
|
653
|
+
onClick: (N) => k(T, "")
|
|
653
654
|
}), {
|
|
654
655
|
default: o(() => [
|
|
655
|
-
s(
|
|
656
|
+
s(U, {
|
|
656
657
|
color: "red",
|
|
657
658
|
size: "20"
|
|
658
659
|
}, {
|
|
659
|
-
default: o(() => [...
|
|
660
|
+
default: o(() => [...h[1] || (h[1] = [
|
|
660
661
|
_("mdi-delete-outline", -1)
|
|
661
662
|
])]),
|
|
662
663
|
_: 1
|
|
@@ -672,20 +673,20 @@ const te = /* @__PURE__ */ J({
|
|
|
672
673
|
}, 1024),
|
|
673
674
|
s(M, { bottom: "" }, {
|
|
674
675
|
activator: o(({ props: F }) => [
|
|
675
|
-
t.editPermission ? (d(),
|
|
676
|
+
t.editPermission ? (d(), v(I, R({
|
|
676
677
|
key: 0,
|
|
677
678
|
icon: "",
|
|
678
679
|
variant: "text",
|
|
679
680
|
size: "small"
|
|
680
681
|
}, { ref_for: !0 }, F, {
|
|
681
|
-
onClick: (N) =>
|
|
682
|
+
onClick: (N) => z(b, T)
|
|
682
683
|
}), {
|
|
683
684
|
default: o(() => [
|
|
684
|
-
s(
|
|
685
|
+
s(U, {
|
|
685
686
|
color: "green",
|
|
686
687
|
size: "20"
|
|
687
688
|
}, {
|
|
688
|
-
default: o(() => [...
|
|
689
|
+
default: o(() => [...h[2] || (h[2] = [
|
|
689
690
|
_("mdi-pencil-outline", -1)
|
|
690
691
|
])]),
|
|
691
692
|
_: 1
|
|
@@ -704,14 +705,14 @@ const te = /* @__PURE__ */ J({
|
|
|
704
705
|
default: o(() => [
|
|
705
706
|
pe(D("div", null, [
|
|
706
707
|
s(j),
|
|
707
|
-
|
|
708
|
+
b.file.tags.length ? (d(), v(u, {
|
|
708
709
|
key: 0,
|
|
709
710
|
multiple: "",
|
|
710
711
|
"active-class": "primary--text",
|
|
711
712
|
style: { padding: "8px" }
|
|
712
713
|
}, {
|
|
713
714
|
default: o(() => [
|
|
714
|
-
(d(!0),
|
|
715
|
+
(d(!0), w(H, null, W(b.file.tags, (F, N) => (d(), v(L, {
|
|
715
716
|
key: `tag-${N}`,
|
|
716
717
|
style: { margin: "5px" }
|
|
717
718
|
}, {
|
|
@@ -723,17 +724,17 @@ const te = /* @__PURE__ */ J({
|
|
|
723
724
|
]),
|
|
724
725
|
_: 2
|
|
725
726
|
}, 1024)) : A("", !0),
|
|
726
|
-
|
|
727
|
+
b.file.description ? (d(), v(n, {
|
|
727
728
|
key: 1,
|
|
728
729
|
style: { "text-align": "justify" }
|
|
729
730
|
}, {
|
|
730
731
|
default: o(() => [
|
|
731
|
-
_(y(
|
|
732
|
+
_(y(b.file.description), 1)
|
|
732
733
|
]),
|
|
733
734
|
_: 2
|
|
734
735
|
}, 1024)) : A("", !0)
|
|
735
736
|
], 512), [
|
|
736
|
-
[ge,
|
|
737
|
+
[ge, b.file.showDetailState]
|
|
737
738
|
])
|
|
738
739
|
]),
|
|
739
740
|
_: 2
|
|
@@ -762,56 +763,59 @@ const te = /* @__PURE__ */ J({
|
|
|
762
763
|
},
|
|
763
764
|
emits: ["openInputDocumentModal"],
|
|
764
765
|
setup(l, { emit: i }) {
|
|
765
|
-
const t = i, e = l, m = () => {
|
|
766
|
+
const t = i, e = l, m = Q(() => e.documentAttachment.length >= e.maxFileCount), C = () => {
|
|
766
767
|
t("openInputDocumentModal");
|
|
767
768
|
};
|
|
768
|
-
return (
|
|
769
|
-
const
|
|
770
|
-
return d(),
|
|
771
|
-
e.badgeCounter ? (d(),
|
|
772
|
-
e.documentAttachment.length > 0 ? (d(),
|
|
769
|
+
return (V, k) => {
|
|
770
|
+
const z = f("v-btn"), g = f("v-badge");
|
|
771
|
+
return d(), w("div", null, [
|
|
772
|
+
e.badgeCounter ? (d(), w(H, { key: 0 }, [
|
|
773
|
+
e.documentAttachment.length > 0 ? (d(), v(g, {
|
|
773
774
|
key: 0,
|
|
774
775
|
bordered: "",
|
|
775
|
-
color:
|
|
776
|
+
color: m.value ? "error" : "success",
|
|
776
777
|
overlap: "",
|
|
777
778
|
content: l.documentAttachment.length
|
|
778
779
|
}, {
|
|
779
780
|
default: o(() => [
|
|
780
|
-
s(
|
|
781
|
+
s(z, {
|
|
781
782
|
color: e.btnColor,
|
|
782
|
-
|
|
783
|
+
disabled: m.value,
|
|
784
|
+
onClick: C,
|
|
783
785
|
class: "mb-4"
|
|
784
786
|
}, {
|
|
785
787
|
default: o(() => [
|
|
786
788
|
_(y(e.selectedLang[l.lang].insertFile), 1)
|
|
787
789
|
]),
|
|
788
790
|
_: 1
|
|
789
|
-
}, 8, ["color"])
|
|
791
|
+
}, 8, ["color", "disabled"])
|
|
790
792
|
]),
|
|
791
793
|
_: 1
|
|
792
|
-
}, 8, ["color", "content"])) : (d(),
|
|
794
|
+
}, 8, ["color", "content"])) : (d(), v(z, {
|
|
793
795
|
key: 1,
|
|
794
796
|
color: e.btnColor,
|
|
795
|
-
|
|
797
|
+
disabled: m.value,
|
|
798
|
+
onClick: C,
|
|
796
799
|
class: "mb-4"
|
|
797
800
|
}, {
|
|
798
801
|
default: o(() => [
|
|
799
802
|
_(y(e.selectedLang[l.lang].insertFile), 1)
|
|
800
803
|
]),
|
|
801
804
|
_: 1
|
|
802
|
-
}, 8, ["color"]))
|
|
805
|
+
}, 8, ["color", "disabled"]))
|
|
803
806
|
], 64)) : A("", !0),
|
|
804
|
-
e.badgeCounter ? A("", !0) : (d(),
|
|
807
|
+
e.badgeCounter ? A("", !0) : (d(), v(z, {
|
|
805
808
|
key: 1,
|
|
806
809
|
color: l.btnColor,
|
|
807
|
-
|
|
810
|
+
disabled: m.value,
|
|
811
|
+
onClick: C,
|
|
808
812
|
class: "mb-4"
|
|
809
813
|
}, {
|
|
810
814
|
default: o(() => [
|
|
811
815
|
_(y(e.selectedLang[l.lang].insertFile), 1)
|
|
812
816
|
]),
|
|
813
817
|
_: 1
|
|
814
|
-
}, 8, ["color"]))
|
|
818
|
+
}, 8, ["color", "disabled"]))
|
|
815
819
|
]);
|
|
816
820
|
};
|
|
817
821
|
}
|
|
@@ -884,8 +888,8 @@ function Ct(l) {
|
|
|
884
888
|
{ key: "documentAttachment", validator: Dt }
|
|
885
889
|
].forEach(({ key: e, validator: m }) => {
|
|
886
890
|
if (e in l) {
|
|
887
|
-
const
|
|
888
|
-
i.errors.push(...
|
|
891
|
+
const C = m(l[e]);
|
|
892
|
+
i.errors.push(...C.errors.map((V) => `${e}: ${V}`)), i.warnings.push(...C.warnings.map((V) => `${e}: ${V}`)), C.isValid || (i.isValid = !1);
|
|
889
893
|
}
|
|
890
894
|
}), i;
|
|
891
895
|
}
|
|
@@ -972,62 +976,62 @@ const kt = /* @__PURE__ */ J({
|
|
|
972
976
|
attachmentIndex: 0
|
|
973
977
|
}), m = i;
|
|
974
978
|
$e(() => {
|
|
975
|
-
|
|
979
|
+
k(), e.registryDocFile = t.documentAttachment, t.rtlSupport && z(), g();
|
|
976
980
|
});
|
|
977
|
-
let
|
|
978
|
-
|
|
981
|
+
let C = 0;
|
|
982
|
+
S(
|
|
979
983
|
() => e.tempAttachment,
|
|
980
984
|
async (u) => {
|
|
981
|
-
const n = ++
|
|
985
|
+
const n = ++C;
|
|
982
986
|
if (u && u.length > 0) {
|
|
983
987
|
e.btnLoader = !0;
|
|
984
988
|
const a = await ze(u);
|
|
985
|
-
if (n !==
|
|
989
|
+
if (n !== C || !e.insertDocumentDialog) return;
|
|
986
990
|
e.tempAttachmentChanged = a, e.btnLoader = !1;
|
|
987
991
|
} else
|
|
988
992
|
e.tempAttachmentChanged = [];
|
|
989
993
|
}
|
|
990
|
-
),
|
|
991
|
-
m("updateCardType", u),
|
|
992
|
-
}),
|
|
994
|
+
), S(() => t.cardType, (u) => {
|
|
995
|
+
m("updateCardType", u), g();
|
|
996
|
+
}), S(() => t.badgeCounter, (u) => {
|
|
993
997
|
m("updateBadgeCounter", u);
|
|
994
|
-
}),
|
|
998
|
+
}), S(() => t.maxFileCount, (u) => {
|
|
995
999
|
m("updateMaxFileCount", u);
|
|
996
|
-
}),
|
|
1000
|
+
}), S(() => t.maxFileSize, (u) => {
|
|
997
1001
|
m("updateMaxFileSize", u);
|
|
998
|
-
}),
|
|
1002
|
+
}), S(() => t.maxFileSize, (u) => {
|
|
999
1003
|
m("updateMaxFileSize", u);
|
|
1000
|
-
}),
|
|
1004
|
+
}), S(() => t.imageCompressor, (u) => {
|
|
1001
1005
|
m("updateImageCompressor", u);
|
|
1002
|
-
}),
|
|
1006
|
+
}), S(() => t.imageCompressLevel, (u) => {
|
|
1003
1007
|
m("updateImageCompressLevel", u);
|
|
1004
|
-
}),
|
|
1008
|
+
}), S(() => t.fileAccept, (u) => {
|
|
1005
1009
|
m("updateFileAccept", u);
|
|
1006
|
-
}),
|
|
1010
|
+
}), S(() => t.thumb, (u) => {
|
|
1007
1011
|
m("updateThumb", u);
|
|
1008
|
-
}),
|
|
1012
|
+
}), S(() => t.changeFileName, (u) => {
|
|
1009
1013
|
m("updateChangeFileName", u);
|
|
1010
|
-
}),
|
|
1014
|
+
}), S(() => t.addFileDescription, (u) => {
|
|
1011
1015
|
m("updateAddFileDescription", u);
|
|
1012
|
-
}),
|
|
1016
|
+
}), S(() => t.addFileTag, (u) => {
|
|
1013
1017
|
m("updateAddFileDescription", u);
|
|
1014
|
-
}),
|
|
1018
|
+
}), S(() => t.tableThumbColumn, (u) => {
|
|
1015
1019
|
m("updateTableThumbColumn", u);
|
|
1016
|
-
}),
|
|
1020
|
+
}), S(() => t.tableFixedHeader, (u) => {
|
|
1017
1021
|
m("updateTableFixedHeader", u);
|
|
1018
|
-
}),
|
|
1022
|
+
}), S(() => t.tableHeight, (u) => {
|
|
1019
1023
|
m("updateTableHeight", u);
|
|
1020
|
-
}),
|
|
1024
|
+
}), S(() => t.lang, (u) => {
|
|
1021
1025
|
m("updateLang", u);
|
|
1022
1026
|
}), Ae(() => {
|
|
1023
1027
|
e.registryDocFile = [];
|
|
1024
1028
|
});
|
|
1025
1029
|
const V = () => {
|
|
1026
1030
|
e.btnLoader = !1, e.tempAttachment = [], e.insertDocumentDialog = !0;
|
|
1027
|
-
},
|
|
1031
|
+
}, k = () => {
|
|
1028
1032
|
t.customLang !== null ? e.selectedLang = t.customLang : e.selectedLang = Be;
|
|
1029
|
-
},
|
|
1030
|
-
},
|
|
1033
|
+
}, z = () => {
|
|
1034
|
+
}, g = () => {
|
|
1031
1035
|
const n = {
|
|
1032
1036
|
default: { outlined: !1, raised: !1, shaped: !1, tile: !1 },
|
|
1033
1037
|
outlined: { outlined: !0, raised: !1, shaped: !1, tile: !1 },
|
|
@@ -1036,9 +1040,9 @@ const kt = /* @__PURE__ */ J({
|
|
|
1036
1040
|
tile: { outlined: !1, raised: !1, shaped: !1, tile: !0 }
|
|
1037
1041
|
}[t.cardType || "default"];
|
|
1038
1042
|
e.outlined = n.outlined, e.raised = n.raised, e.shaped = n.shaped, e.tile = n.tile;
|
|
1039
|
-
},
|
|
1043
|
+
}, h = (u, n) => {
|
|
1040
1044
|
e.fileUploaderSnackText = u, e.fileUploaderSnackBarAlertColor = n, e.fileUploaderSnackBarAlert = !0;
|
|
1041
|
-
},
|
|
1045
|
+
}, U = (u) => {
|
|
1042
1046
|
const n = e.selectedLang[t.lang];
|
|
1043
1047
|
switch (u.code) {
|
|
1044
1048
|
case "maxFileCount":
|
|
@@ -1059,13 +1063,13 @@ const kt = /* @__PURE__ */ J({
|
|
|
1059
1063
|
});
|
|
1060
1064
|
u.length > 0 && (e.registryDocFile.push(...u), m("updateDocumentAttachment", e.registryDocFile));
|
|
1061
1065
|
const a = n[n.length - 1];
|
|
1062
|
-
a &&
|
|
1063
|
-
},
|
|
1066
|
+
a && h(U(a), "red"), e.documentAttachmentAPI = [], e.tempAttachmentChanged = [], e.insertDocumentDialog = !1, e.btnLoader = !1;
|
|
1067
|
+
}, B = (u, n) => {
|
|
1064
1068
|
e.btnLoader = !1, e.selectedIndex = u, e.selectedId = n, e.deleteDocumentDialog = !0;
|
|
1065
1069
|
}, j = () => {
|
|
1066
1070
|
e.registryDocFile.splice(e.selectedIndex, 1), m("updateDocumentAttachment", e.registryDocFile), e.deleteDocumentDialog = !1;
|
|
1067
1071
|
}, I = (u, n) => {
|
|
1068
|
-
|
|
1072
|
+
C++, e.btnLoader = !1, e.attachmentIndex = n, e.editDocumentDialog = !0, e.tempAttachmentChanged = [u];
|
|
1069
1073
|
}, M = () => {
|
|
1070
1074
|
const u = [...t.documentAttachment];
|
|
1071
1075
|
u.splice(
|
|
@@ -1075,8 +1079,8 @@ const kt = /* @__PURE__ */ J({
|
|
|
1075
1079
|
), m("updateDocumentAttachment", u), e.editDocumentDialog = !1;
|
|
1076
1080
|
};
|
|
1077
1081
|
return (u, n) => {
|
|
1078
|
-
const a = f("v-col"), r = f("v-row"), c = f("v-icon"), x = f("v-card-title"),
|
|
1079
|
-
return d(),
|
|
1082
|
+
const a = f("v-col"), r = f("v-row"), c = f("v-icon"), x = f("v-card-title"), b = f("v-file-input"), T = f("v-expansion-panel-title"), F = f("v-text-field"), N = f("v-textarea"), K = f("v-autocomplete"), ee = f("v-img"), q = f("v-card"), le = f("v-expansion-panel-text"), oe = f("v-expansion-panel"), ne = f("v-expansion-panels"), ae = f("v-list-item-title"), $ = f("v-list-item"), X = f("v-card-text"), E = f("v-btn"), Y = f("v-card-actions"), ie = f("v-dialog"), Fe = f("v-snackbar"), De = f("v-spacer"), Ce = f("v-container");
|
|
1083
|
+
return d(), v(Ce, null, {
|
|
1080
1084
|
default: o(() => [
|
|
1081
1085
|
s(r, null, {
|
|
1082
1086
|
default: o(() => [
|
|
@@ -1086,7 +1090,8 @@ const kt = /* @__PURE__ */ J({
|
|
|
1086
1090
|
xs: "12"
|
|
1087
1091
|
}, {
|
|
1088
1092
|
default: o(() => [
|
|
1089
|
-
|
|
1093
|
+
t.insertPermission ? (d(), v(ye, {
|
|
1094
|
+
key: 0,
|
|
1090
1095
|
documentAttachment: t.documentAttachment,
|
|
1091
1096
|
selectedLang: e.selectedLang,
|
|
1092
1097
|
lang: t.lang,
|
|
@@ -1094,9 +1099,9 @@ const kt = /* @__PURE__ */ J({
|
|
|
1094
1099
|
btnColor: t.btnColor,
|
|
1095
1100
|
maxFileCount: t.maxFileCount,
|
|
1096
1101
|
onOpenInputDocumentModal: V
|
|
1097
|
-
}, null, 8, ["documentAttachment", "selectedLang", "lang", "badgeCounter", "btnColor", "maxFileCount"]),
|
|
1098
|
-
t.fileUploaderType === "simple" ? (d(),
|
|
1099
|
-
key:
|
|
1102
|
+
}, null, 8, ["documentAttachment", "selectedLang", "lang", "badgeCounter", "btnColor", "maxFileCount"])) : A("", !0),
|
|
1103
|
+
t.fileUploaderType === "simple" ? (d(), v(_e, {
|
|
1104
|
+
key: 1,
|
|
1100
1105
|
documentAttachment: t.documentAttachment,
|
|
1101
1106
|
cols: t.cols,
|
|
1102
1107
|
thumb: t.thumb,
|
|
@@ -1109,12 +1114,12 @@ const kt = /* @__PURE__ */ J({
|
|
|
1109
1114
|
deletePermission: t.deletePermission,
|
|
1110
1115
|
editPermission: t.editPermission,
|
|
1111
1116
|
selectedLang: e.selectedLang,
|
|
1112
|
-
onSetCardTheme:
|
|
1113
|
-
onOpenDeleteDialog:
|
|
1117
|
+
onSetCardTheme: g,
|
|
1118
|
+
onOpenDeleteDialog: B,
|
|
1114
1119
|
onOpenEditDocumentDialog: I
|
|
1115
1120
|
}, null, 8, ["documentAttachment", "cols", "thumb", "outlined", "raised", "shaped", "tile", "lang", "cardType", "deletePermission", "editPermission", "selectedLang"])) : A("", !0),
|
|
1116
|
-
t.fileUploaderType === "thumbnail" ? (d(),
|
|
1117
|
-
key:
|
|
1121
|
+
t.fileUploaderType === "thumbnail" ? (d(), v(he, {
|
|
1122
|
+
key: 2,
|
|
1118
1123
|
documentAttachment: t.documentAttachment,
|
|
1119
1124
|
cols: t.cols,
|
|
1120
1125
|
thumb: t.thumb,
|
|
@@ -1127,12 +1132,12 @@ const kt = /* @__PURE__ */ J({
|
|
|
1127
1132
|
deletePermission: t.deletePermission,
|
|
1128
1133
|
editPermission: t.editPermission,
|
|
1129
1134
|
selectedLang: e.selectedLang,
|
|
1130
|
-
onSetCardTheme:
|
|
1131
|
-
onOpenDeleteDialog: n[0] || (n[0] = (p, O) =>
|
|
1135
|
+
onSetCardTheme: g,
|
|
1136
|
+
onOpenDeleteDialog: n[0] || (n[0] = (p, O) => B(p, O)),
|
|
1132
1137
|
onOpenEditDocumentDialog: n[1] || (n[1] = (p, O) => I(p, O))
|
|
1133
1138
|
}, null, 8, ["documentAttachment", "cols", "thumb", "outlined", "raised", "shaped", "tile", "lang", "cardType", "deletePermission", "editPermission", "selectedLang"])) : A("", !0),
|
|
1134
|
-
t.fileUploaderType === "table" ? (d(),
|
|
1135
|
-
key:
|
|
1139
|
+
t.fileUploaderType === "table" ? (d(), v(be, {
|
|
1140
|
+
key: 3,
|
|
1136
1141
|
documentAttachment: t.documentAttachment,
|
|
1137
1142
|
cols: t.cols,
|
|
1138
1143
|
thumb: t.thumb,
|
|
@@ -1148,8 +1153,8 @@ const kt = /* @__PURE__ */ J({
|
|
|
1148
1153
|
deletePermission: t.deletePermission,
|
|
1149
1154
|
editPermission: t.editPermission,
|
|
1150
1155
|
selectedLang: e.selectedLang,
|
|
1151
|
-
onSetCardTheme:
|
|
1152
|
-
onOpenDeleteDialog:
|
|
1156
|
+
onSetCardTheme: g,
|
|
1157
|
+
onOpenDeleteDialog: B,
|
|
1153
1158
|
onOpenEditDocumentDialog: I
|
|
1154
1159
|
}, null, 8, ["documentAttachment", "cols", "thumb", "outlined", "raised", "shaped", "tile", "lang", "tableThumbColumn", "tableFixedHeader", "tableHeight", "cardType", "deletePermission", "editPermission", "selectedLang"])) : A("", !0)
|
|
1155
1160
|
]),
|
|
@@ -1185,8 +1190,8 @@ const kt = /* @__PURE__ */ J({
|
|
|
1185
1190
|
}),
|
|
1186
1191
|
s(X, null, {
|
|
1187
1192
|
default: o(() => [
|
|
1188
|
-
e.tempAttachment.length === 0 ? (d(),
|
|
1189
|
-
t.fileAccept !== "" ? (d(), b
|
|
1193
|
+
e.tempAttachment.length === 0 ? (d(), w(H, { key: 0 }, [
|
|
1194
|
+
t.fileAccept !== "" ? (d(), v(b, {
|
|
1190
1195
|
key: 0,
|
|
1191
1196
|
multiple: "",
|
|
1192
1197
|
accept: t.fileAccept,
|
|
@@ -1194,17 +1199,17 @@ const kt = /* @__PURE__ */ J({
|
|
|
1194
1199
|
modelValue: e.tempAttachment,
|
|
1195
1200
|
"onUpdate:modelValue": n[3] || (n[3] = (p) => e.tempAttachment = p),
|
|
1196
1201
|
label: e.selectedLang[l.lang].insertNewFile
|
|
1197
|
-
}, null, 8, ["accept", "modelValue", "label"])) : (d(), b
|
|
1202
|
+
}, null, 8, ["accept", "modelValue", "label"])) : (d(), v(b, {
|
|
1198
1203
|
key: 1,
|
|
1199
1204
|
multiple: "",
|
|
1200
1205
|
modelValue: e.tempAttachment,
|
|
1201
1206
|
"onUpdate:modelValue": n[4] || (n[4] = (p) => e.tempAttachment = p),
|
|
1202
1207
|
label: e.selectedLang[l.lang].insertNewFile
|
|
1203
1208
|
}, null, 8, ["modelValue", "label"]))
|
|
1204
|
-
], 64)) : (d(),
|
|
1205
|
-
t.addFileTag || t.addFileDescription || t.changeFileName ? (d(),
|
|
1209
|
+
], 64)) : (d(), w(H, { key: 1 }, [
|
|
1210
|
+
t.addFileTag || t.addFileDescription || t.changeFileName ? (d(), v(ne, { key: 0 }, {
|
|
1206
1211
|
default: o(() => [
|
|
1207
|
-
(d(!0),
|
|
1212
|
+
(d(!0), w(H, null, W(e.tempAttachmentChanged, (p, O) => (d(), v(oe, {
|
|
1208
1213
|
key: `attachment-${O}`
|
|
1209
1214
|
}, {
|
|
1210
1215
|
default: o(() => [
|
|
@@ -1228,13 +1233,13 @@ const kt = /* @__PURE__ */ J({
|
|
|
1228
1233
|
xs: "12"
|
|
1229
1234
|
}, {
|
|
1230
1235
|
default: o(() => [
|
|
1231
|
-
t.changeFileName ? (d(),
|
|
1236
|
+
t.changeFileName ? (d(), v(F, {
|
|
1232
1237
|
key: 0,
|
|
1233
1238
|
label: e.selectedLang[l.lang].fileName,
|
|
1234
1239
|
modelValue: p.file.name,
|
|
1235
1240
|
"onUpdate:modelValue": (P) => p.file.name = P
|
|
1236
1241
|
}, null, 8, ["label", "modelValue", "onUpdate:modelValue"])) : A("", !0),
|
|
1237
|
-
t.addFileDescription ? (d(),
|
|
1242
|
+
t.addFileDescription ? (d(), v(N, {
|
|
1238
1243
|
key: 1,
|
|
1239
1244
|
label: e.selectedLang[l.lang].fileDescription,
|
|
1240
1245
|
"auto-grow": "",
|
|
@@ -1242,7 +1247,7 @@ const kt = /* @__PURE__ */ J({
|
|
|
1242
1247
|
modelValue: p.file.description,
|
|
1243
1248
|
"onUpdate:modelValue": (P) => p.file.description = P
|
|
1244
1249
|
}, null, 8, ["label", "modelValue", "onUpdate:modelValue"])) : A("", !0),
|
|
1245
|
-
t.addFileTag ? (d(),
|
|
1250
|
+
t.addFileTag ? (d(), v(K, {
|
|
1246
1251
|
key: 2,
|
|
1247
1252
|
modelValue: p.file.tags,
|
|
1248
1253
|
"onUpdate:modelValue": (P) => p.file.tags = P,
|
|
@@ -1263,14 +1268,14 @@ const kt = /* @__PURE__ */ J({
|
|
|
1263
1268
|
xs: "12"
|
|
1264
1269
|
}, {
|
|
1265
1270
|
default: o(() => [
|
|
1266
|
-
p.file.format === "jpg" || p.file.format === "jpeg" || p.file.format === "png" || p.file.format === "tif" || p.file.format === "bmp" ? (d(),
|
|
1271
|
+
p.file.format === "jpg" || p.file.format === "jpeg" || p.file.format === "png" || p.file.format === "tif" || p.file.format === "bmp" ? (d(), v(q, { key: 0 }, {
|
|
1267
1272
|
default: o(() => [
|
|
1268
|
-
s(
|
|
1273
|
+
s(ee, {
|
|
1269
1274
|
src: "data:" + p.file.format + ";base64," + p.file.base64
|
|
1270
1275
|
}, null, 8, ["src"])
|
|
1271
1276
|
]),
|
|
1272
1277
|
_: 2
|
|
1273
|
-
}, 1024)) : (d(),
|
|
1278
|
+
}, 1024)) : (d(), v(te, {
|
|
1274
1279
|
key: 1,
|
|
1275
1280
|
"file-format": p.file.format,
|
|
1276
1281
|
size: 60
|
|
@@ -1289,13 +1294,13 @@ const kt = /* @__PURE__ */ J({
|
|
|
1289
1294
|
}, 1024))), 128))
|
|
1290
1295
|
]),
|
|
1291
1296
|
_: 1
|
|
1292
|
-
})) : (d(),
|
|
1297
|
+
})) : (d(), v(q, {
|
|
1293
1298
|
key: 1,
|
|
1294
1299
|
class: "mx-auto",
|
|
1295
1300
|
tile: ""
|
|
1296
1301
|
}, {
|
|
1297
1302
|
default: o(() => [
|
|
1298
|
-
(d(!0),
|
|
1303
|
+
(d(!0), w(H, null, W(e.tempAttachmentChanged, (p, O) => (d(), v($, {
|
|
1299
1304
|
key: `attachment-${O}`,
|
|
1300
1305
|
style: { "border-bottom": "1px solid #E0E0E0" }
|
|
1301
1306
|
}, {
|
|
@@ -1370,7 +1375,7 @@ const kt = /* @__PURE__ */ J({
|
|
|
1370
1375
|
]),
|
|
1371
1376
|
_: 1
|
|
1372
1377
|
}),
|
|
1373
|
-
(d(!0),
|
|
1378
|
+
(d(!0), w(H, null, W(e.tempAttachmentChanged, (p, O) => (d(), v(X, {
|
|
1374
1379
|
key: `attachment-${O}`
|
|
1375
1380
|
}, {
|
|
1376
1381
|
default: o(() => [
|
|
@@ -1386,13 +1391,13 @@ const kt = /* @__PURE__ */ J({
|
|
|
1386
1391
|
xs: "12"
|
|
1387
1392
|
}, {
|
|
1388
1393
|
default: o(() => [
|
|
1389
|
-
t.changeFileName ? (d(),
|
|
1394
|
+
t.changeFileName ? (d(), v(F, {
|
|
1390
1395
|
key: 0,
|
|
1391
1396
|
label: e.selectedLang[l.lang].fileName,
|
|
1392
1397
|
modelValue: p.file.name,
|
|
1393
1398
|
"onUpdate:modelValue": (P) => p.file.name = P
|
|
1394
1399
|
}, null, 8, ["label", "modelValue", "onUpdate:modelValue"])) : A("", !0),
|
|
1395
|
-
t.addFileDescription ? (d(),
|
|
1400
|
+
t.addFileDescription ? (d(), v(N, {
|
|
1396
1401
|
key: 1,
|
|
1397
1402
|
label: e.selectedLang[l.lang].fileDescription,
|
|
1398
1403
|
"auto-grow": "",
|
|
@@ -1400,7 +1405,7 @@ const kt = /* @__PURE__ */ J({
|
|
|
1400
1405
|
modelValue: p.file.description,
|
|
1401
1406
|
"onUpdate:modelValue": (P) => p.file.description = P
|
|
1402
1407
|
}, null, 8, ["label", "modelValue", "onUpdate:modelValue"])) : A("", !0),
|
|
1403
|
-
t.addFileTag ? (d(),
|
|
1408
|
+
t.addFileTag ? (d(), v(K, {
|
|
1404
1409
|
key: 2,
|
|
1405
1410
|
modelValue: p.file.tags,
|
|
1406
1411
|
"onUpdate:modelValue": (P) => p.file.tags = P,
|
|
@@ -1425,14 +1430,14 @@ const kt = /* @__PURE__ */ J({
|
|
|
1425
1430
|
return [
|
|
1426
1431
|
p.file.name && ["jpg", "jpeg", "png", "tif", "bmp"].includes(
|
|
1427
1432
|
((P = p.file.name.split(".").pop()) == null ? void 0 : P.toLowerCase()) || ""
|
|
1428
|
-
) ? (d(),
|
|
1433
|
+
) ? (d(), v(q, { key: 0 }, {
|
|
1429
1434
|
default: o(() => [
|
|
1430
|
-
s(
|
|
1435
|
+
s(ee, {
|
|
1431
1436
|
src: "data:" + p.file.format + ";base64," + p.file.base64
|
|
1432
1437
|
}, null, 8, ["src"])
|
|
1433
1438
|
]),
|
|
1434
1439
|
_: 2
|
|
1435
|
-
}, 1024)) : (d(),
|
|
1440
|
+
}, 1024)) : (d(), v(te, {
|
|
1436
1441
|
key: 1,
|
|
1437
1442
|
"file-format": p.file.format,
|
|
1438
1443
|
size: 60
|
|
@@ -1577,33 +1582,33 @@ function Lt(l, i = {}) {
|
|
|
1577
1582
|
// 5MB default
|
|
1578
1583
|
maxFileCount: e = 10,
|
|
1579
1584
|
imageCompressor: m = !1,
|
|
1580
|
-
imageCompressLevel:
|
|
1585
|
+
imageCompressLevel: C = 0.8,
|
|
1581
1586
|
fileAccept: V = "*"
|
|
1582
|
-
} = i,
|
|
1587
|
+
} = i, k = Z(!1), z = Z({
|
|
1583
1588
|
show: !1,
|
|
1584
1589
|
text: "",
|
|
1585
1590
|
color: "success"
|
|
1586
|
-
}),
|
|
1591
|
+
}), g = Q(() => l.value.length), h = Q(() => g.value < e), U = Q(
|
|
1587
1592
|
() => l.value.reduce((a, r) => a + r.file.size, 0)
|
|
1588
1593
|
);
|
|
1589
1594
|
function L(a, r = "success") {
|
|
1590
|
-
|
|
1595
|
+
z.value = { show: !0, text: a, color: r };
|
|
1591
1596
|
}
|
|
1592
|
-
function
|
|
1597
|
+
function B(a) {
|
|
1593
1598
|
var r;
|
|
1594
1599
|
if (!Ie(a.size, t))
|
|
1595
1600
|
return {
|
|
1596
1601
|
valid: !1,
|
|
1597
1602
|
error: `File size exceeds maximum allowed size of ${(t / 1048576).toFixed(1)}MB`
|
|
1598
1603
|
};
|
|
1599
|
-
if (!Ee(
|
|
1604
|
+
if (!Ee(g.value, e))
|
|
1600
1605
|
return {
|
|
1601
1606
|
valid: !1,
|
|
1602
1607
|
error: `Maximum file count of ${e} reached`
|
|
1603
1608
|
};
|
|
1604
1609
|
if (V !== "*") {
|
|
1605
|
-
const c = V.split(",").map((F) => F.trim()), x = `.${(r = a.name.split(".").pop()) == null ? void 0 : r.toLowerCase()}`,
|
|
1606
|
-
if (!c.some((F) => F.startsWith(".") ? F === x : F.includes("/*") ?
|
|
1610
|
+
const c = V.split(",").map((F) => F.trim()), x = `.${(r = a.name.split(".").pop()) == null ? void 0 : r.toLowerCase()}`, b = a.type;
|
|
1611
|
+
if (!c.some((F) => F.startsWith(".") ? F === x : F.includes("/*") ? b.startsWith(F.replace("/*", "")) : F === b))
|
|
1607
1612
|
return {
|
|
1608
1613
|
valid: !1,
|
|
1609
1614
|
error: `File type not accepted. Allowed types: ${V}`
|
|
@@ -1615,9 +1620,9 @@ function Lt(l, i = {}) {
|
|
|
1615
1620
|
let r;
|
|
1616
1621
|
if (m && re(a.name, a.type))
|
|
1617
1622
|
try {
|
|
1618
|
-
r = (await Pe(a,
|
|
1619
|
-
} catch (
|
|
1620
|
-
console.warn("Image compression failed, using original file:",
|
|
1623
|
+
r = (await Pe(a, C)).split(",")[1];
|
|
1624
|
+
} catch (b) {
|
|
1625
|
+
console.warn("Image compression failed, using original file:", b), r = await me(a);
|
|
1621
1626
|
}
|
|
1622
1627
|
else
|
|
1623
1628
|
r = await me(a);
|
|
@@ -1633,17 +1638,17 @@ function Lt(l, i = {}) {
|
|
|
1633
1638
|
};
|
|
1634
1639
|
}
|
|
1635
1640
|
async function I(a) {
|
|
1636
|
-
if (
|
|
1637
|
-
|
|
1641
|
+
if (k.value) return !1;
|
|
1642
|
+
k.value = !0;
|
|
1638
1643
|
const r = Array.from(a), c = [];
|
|
1639
1644
|
for (const x of r) {
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1645
|
+
const b = B(x);
|
|
1646
|
+
b.valid ? c.push(x) : L(b.error, "error");
|
|
1642
1647
|
}
|
|
1643
1648
|
if (c.length === 0)
|
|
1644
|
-
return
|
|
1649
|
+
return k.value = !1, !1;
|
|
1645
1650
|
try {
|
|
1646
|
-
const
|
|
1651
|
+
const b = (await Promise.all(
|
|
1647
1652
|
c.map((F) => j(F))
|
|
1648
1653
|
)).map((F) => {
|
|
1649
1654
|
var N;
|
|
@@ -1659,13 +1664,13 @@ function Lt(l, i = {}) {
|
|
|
1659
1664
|
}
|
|
1660
1665
|
};
|
|
1661
1666
|
});
|
|
1662
|
-
l.value.push(...
|
|
1667
|
+
l.value.push(...b);
|
|
1663
1668
|
const T = c.length === 1 ? `File "${c[0].name}" uploaded successfully` : `${c.length} files uploaded successfully`;
|
|
1664
1669
|
return L(T, "success"), !0;
|
|
1665
1670
|
} catch (x) {
|
|
1666
1671
|
return console.error("File upload error:", x), L("Failed to upload files. Please try again.", "error"), !1;
|
|
1667
1672
|
} finally {
|
|
1668
|
-
|
|
1673
|
+
k.value = !1;
|
|
1669
1674
|
}
|
|
1670
1675
|
}
|
|
1671
1676
|
function M(a) {
|
|
@@ -1688,18 +1693,18 @@ function Lt(l, i = {}) {
|
|
|
1688
1693
|
}
|
|
1689
1694
|
return {
|
|
1690
1695
|
// State
|
|
1691
|
-
isUploading:
|
|
1692
|
-
snackbar:
|
|
1696
|
+
isUploading: k,
|
|
1697
|
+
snackbar: z,
|
|
1693
1698
|
// Computed
|
|
1694
|
-
fileCount:
|
|
1695
|
-
canAddMoreFiles:
|
|
1696
|
-
totalSize:
|
|
1699
|
+
fileCount: g,
|
|
1700
|
+
canAddMoreFiles: h,
|
|
1701
|
+
totalSize: U,
|
|
1697
1702
|
// Methods
|
|
1698
1703
|
uploadFiles: I,
|
|
1699
1704
|
removeFile: M,
|
|
1700
1705
|
updateFileMetadata: u,
|
|
1701
1706
|
clearAllFiles: n,
|
|
1702
|
-
validateFile:
|
|
1707
|
+
validateFile: B,
|
|
1703
1708
|
showSnackbar: L
|
|
1704
1709
|
};
|
|
1705
1710
|
}
|
|
@@ -1709,58 +1714,58 @@ function Vt(l = {}) {
|
|
|
1709
1714
|
maxErrors: i = 10,
|
|
1710
1715
|
autoRemoveTimeout: t = 5e3,
|
|
1711
1716
|
logToConsole: e = !0
|
|
1712
|
-
} = l, m =
|
|
1717
|
+
} = l, m = Z([]), C = Z(!1);
|
|
1713
1718
|
function V() {
|
|
1714
1719
|
return `error_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
1715
1720
|
}
|
|
1716
|
-
function
|
|
1721
|
+
function k(r, c = "error", x, b) {
|
|
1717
1722
|
const T = {
|
|
1718
1723
|
id: V(),
|
|
1719
1724
|
message: r,
|
|
1720
1725
|
type: c,
|
|
1721
1726
|
timestamp: /* @__PURE__ */ new Date(),
|
|
1722
1727
|
context: x,
|
|
1723
|
-
action:
|
|
1728
|
+
action: b
|
|
1724
1729
|
};
|
|
1725
1730
|
return e && (c === "error" ? console.error : c === "warning" ? console.warn : c === "info" ? console.info : console.log)(`[${c.toUpperCase()}] ${r}`, x || ""), m.value.unshift(T), m.value.length > i && (m.value = m.value.slice(0, i)), t > 0 && setTimeout(() => {
|
|
1726
|
-
|
|
1731
|
+
z(T.id);
|
|
1727
1732
|
}, t), T.id;
|
|
1728
1733
|
}
|
|
1729
|
-
function
|
|
1734
|
+
function z(r) {
|
|
1730
1735
|
const c = m.value.findIndex((x) => x.id === r);
|
|
1731
1736
|
return c !== -1 ? (m.value.splice(c, 1), !0) : !1;
|
|
1732
1737
|
}
|
|
1733
|
-
function
|
|
1738
|
+
function g() {
|
|
1734
1739
|
m.value = [];
|
|
1735
1740
|
}
|
|
1736
|
-
function
|
|
1741
|
+
function h(r) {
|
|
1737
1742
|
m.value = m.value.filter((c) => c.type !== r);
|
|
1738
1743
|
}
|
|
1739
|
-
async function
|
|
1740
|
-
|
|
1744
|
+
async function U(r, c, x) {
|
|
1745
|
+
C.value = !0;
|
|
1741
1746
|
try {
|
|
1742
1747
|
return await r();
|
|
1743
|
-
} catch (
|
|
1744
|
-
const T = c || (
|
|
1745
|
-
return
|
|
1748
|
+
} catch (b) {
|
|
1749
|
+
const T = c || (b instanceof Error ? b.message : "An unexpected error occurred");
|
|
1750
|
+
return k(T, "error", {
|
|
1746
1751
|
...x,
|
|
1747
|
-
originalError:
|
|
1752
|
+
originalError: b instanceof Error ? b.message : String(b)
|
|
1748
1753
|
}), null;
|
|
1749
1754
|
} finally {
|
|
1750
|
-
|
|
1755
|
+
C.value = !1;
|
|
1751
1756
|
}
|
|
1752
1757
|
}
|
|
1753
1758
|
function L(r, c, x) {
|
|
1754
|
-
return r ||
|
|
1759
|
+
return r || k(c, "error", x), r;
|
|
1755
1760
|
}
|
|
1756
|
-
function
|
|
1757
|
-
return
|
|
1761
|
+
function B(r, c) {
|
|
1762
|
+
return k(r, "success", c);
|
|
1758
1763
|
}
|
|
1759
1764
|
function j(r, c) {
|
|
1760
|
-
return
|
|
1765
|
+
return k(r, "warning", c);
|
|
1761
1766
|
}
|
|
1762
1767
|
function I(r, c) {
|
|
1763
|
-
return
|
|
1768
|
+
return k(r, "info", c);
|
|
1764
1769
|
}
|
|
1765
1770
|
function M(r) {
|
|
1766
1771
|
return m.value.filter((c) => c.type === r);
|
|
@@ -1772,27 +1777,27 @@ function Vt(l = {}) {
|
|
|
1772
1777
|
return r ? m.value.some((c) => c.type === r) : m.value.length > 0;
|
|
1773
1778
|
}
|
|
1774
1779
|
const a = {
|
|
1775
|
-
fileSizeExceeded: (r, c) =>
|
|
1780
|
+
fileSizeExceeded: (r, c) => k(
|
|
1776
1781
|
`File "${r}" exceeds maximum size of ${(c / (1024 * 1024)).toFixed(1)}MB`,
|
|
1777
1782
|
"error",
|
|
1778
1783
|
{ fileName: r, maxSize: c, category: "file-upload" }
|
|
1779
1784
|
),
|
|
1780
|
-
fileCountExceeded: (r) =>
|
|
1785
|
+
fileCountExceeded: (r) => k(
|
|
1781
1786
|
`Maximum file count of ${r} reached`,
|
|
1782
1787
|
"error",
|
|
1783
1788
|
{ maxCount: r, category: "file-upload" }
|
|
1784
1789
|
),
|
|
1785
|
-
invalidFileType: (r, c) =>
|
|
1790
|
+
invalidFileType: (r, c) => k(
|
|
1786
1791
|
`File "${r}" type not allowed. Accepted types: ${c}`,
|
|
1787
1792
|
"error",
|
|
1788
1793
|
{ fileName: r, allowedTypes: c, category: "file-upload" }
|
|
1789
1794
|
),
|
|
1790
|
-
uploadFailed: (r, c) =>
|
|
1795
|
+
uploadFailed: (r, c) => k(
|
|
1791
1796
|
`Failed to upload "${r}"${c ? `: ${c}` : ""}`,
|
|
1792
1797
|
"error",
|
|
1793
1798
|
{ fileName: r, reason: c, category: "file-upload" }
|
|
1794
1799
|
),
|
|
1795
|
-
compressionFailed: (r) =>
|
|
1800
|
+
compressionFailed: (r) => k(
|
|
1796
1801
|
`Image compression failed for "${r}", using original file`,
|
|
1797
1802
|
"warning",
|
|
1798
1803
|
{ fileName: r, category: "file-upload" }
|
|
@@ -1801,15 +1806,15 @@ function Vt(l = {}) {
|
|
|
1801
1806
|
return {
|
|
1802
1807
|
// State
|
|
1803
1808
|
errors: m,
|
|
1804
|
-
isLoading:
|
|
1809
|
+
isLoading: C,
|
|
1805
1810
|
// Methods
|
|
1806
|
-
addError:
|
|
1807
|
-
removeError:
|
|
1808
|
-
clearErrors:
|
|
1809
|
-
clearErrorsByType:
|
|
1810
|
-
handleAsync:
|
|
1811
|
+
addError: k,
|
|
1812
|
+
removeError: z,
|
|
1813
|
+
clearErrors: g,
|
|
1814
|
+
clearErrorsByType: h,
|
|
1815
|
+
handleAsync: U,
|
|
1811
1816
|
validate: L,
|
|
1812
|
-
showSuccess:
|
|
1817
|
+
showSuccess: B,
|
|
1813
1818
|
showWarning: j,
|
|
1814
1819
|
showInfo: I,
|
|
1815
1820
|
getErrorsByType: M,
|