handy-uploader 2.0.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +183 -297
  3. package/dist/components/InsertButton.vue.d.ts +5 -13
  4. package/dist/components/SelectFileIconType.vue.d.ts +3 -23
  5. package/dist/components/SimpleUploader.vue.d.ts +7 -35
  6. package/dist/components/TableUploader.vue.d.ts +6 -38
  7. package/dist/components/ThumbnailUploader.vue.d.ts +8 -44
  8. package/dist/components/handyUploader.vue.d.ts +21 -79
  9. package/dist/composables/deprecation.d.ts +2 -0
  10. package/dist/composables/useErrorHandler.d.ts +8 -4
  11. package/dist/composables/useFileUpload.d.ts +7 -2
  12. package/dist/core/attachments.d.ts +91 -0
  13. package/dist/core/fileUtils.d.ts +56 -0
  14. package/dist/core/index.d.ts +3 -0
  15. package/dist/core/videoThumbnail.d.ts +32 -0
  16. package/dist/handy-uploader.cjs +1 -0
  17. package/dist/handy-uploader.css +1 -0
  18. package/dist/handy-uploader.mjs +1110 -0
  19. package/dist/language-CYpPw-mk.mjs +551 -0
  20. package/dist/language-fvWXvWRx.js +1 -0
  21. package/dist/lib/index.d.ts +10 -712
  22. package/dist/lib/language.d.ts +3 -0
  23. package/dist/lib/shared.d.ts +5 -0
  24. package/dist/lib/vuetify.d.ts +15 -0
  25. package/dist/logo.png +0 -0
  26. package/dist/types/index.d.ts +4 -0
  27. package/dist/utils/fileUtils.d.ts +1 -41
  28. package/dist/vue/components/HandyDialog.vue.d.ts +31 -0
  29. package/dist/vue/components/HandyDropzone.vue.d.ts +38 -0
  30. package/dist/vue/components/HandyFileIcon.vue.d.ts +9 -0
  31. package/dist/vue/components/HandyFileList.vue.d.ts +65 -0
  32. package/dist/vue/components/HandyIcon.vue.d.ts +10 -0
  33. package/dist/vue/components/HandyUploader.vue.d.ts +137 -0
  34. package/dist/vue/index.d.ts +9 -0
  35. package/dist/vue/types.d.ts +5 -0
  36. package/dist/vue/useUploader.d.ts +46 -0
  37. package/dist/vuetify.cjs +1 -0
  38. package/dist/vuetify.mjs +1870 -0
  39. package/package.json +66 -26
  40. package/dist/handy-uploader.es.js +0 -2407
  41. package/dist/handy-uploader.umd.js +0 -1
@@ -1,2407 +0,0 @@
1
- import { defineComponent as te, computed as ie, resolveComponent as f, openBlock as c, createElementBlock as V, createVNode as r, toDisplayString as x, reactive as ge, watch as I, onMounted as xe, withCtx as o, Fragment as R, renderList as Z, createBlock as h, unref as se, createTextVNode as _, createElementVNode as P, mergeProps as ee, createCommentVNode as z, withDirectives as ve, vShow as he, nextTick as Fe, withModifiers as De, ref as ae, onBeforeMount as Ce, onDeactivated as ze } from "vue";
2
- const ne = /* @__PURE__ */ te({
3
- __name: "SelectFileIconType",
4
- props: {
5
- fileFormat: {},
6
- size: { default: 30 }
7
- },
8
- setup(a) {
9
- const n = a, e = ie(() => ({
10
- pdf: { icon: "mdi-file-pdf-outline", color: "red darken-1" },
11
- doc: { icon: "mdi-file-word-outline", color: "blue darken-1" },
12
- docx: { icon: "mdi-file-word-outline", color: "blue darken-1" },
13
- odt: { icon: "mdi-file-word-outline", color: "blue darken-1" },
14
- jpg: { icon: "mdi-file-image-outline", color: "deep-purple darken-1" },
15
- jpeg: { icon: "mdi-file-image-outline", color: "deep-purple darken-1" },
16
- png: { icon: "mdi-file-image-outline", color: "deep-purple darken-1" },
17
- tif: { icon: "mdi-file-image-outline", color: "deep-purple darken-1" },
18
- bmp: { icon: "mdi-file-image-outline", color: "deep-purple darken-1" },
19
- xls: { icon: "mdi-file-excel-outline", color: "teal darken-1" },
20
- xlsx: { icon: "mdi-file-excel-outline", color: "teal darken-1" },
21
- ppt: { icon: "mdi-file-powerpoint-outline", color: "orange darken-3" },
22
- pptx: { icon: "mdi-file-powerpoint-outline", color: "orange darken-3" },
23
- pptm: { icon: "mdi-file-powerpoint-outline", color: "orange darken-3" },
24
- mp4: { icon: "mdi-file-video-outline", color: "red lighten-1" },
25
- mov: { icon: "mdi-file-video-outline", color: "red lighten-1" },
26
- flv: { icon: "mdi-file-video-outline", color: "red lighten-1" },
27
- wmv: { icon: "mdi-file-video-outline", color: "red lighten-1" },
28
- avi: { icon: "mdi-file-video-outline", color: "red lighten-1" },
29
- dwg: { icon: "mdi-file-cad", color: "indigo lighten-2" },
30
- zip: { icon: "mdi-folder-zip-outline", color: "lime lighten-1" },
31
- rar: { icon: "mdi-folder-zip-outline", color: "lime lighten-1" },
32
- "7-zip": { icon: "mdi-folder-zip-outline", color: "lime lighten-1" },
33
- txt: { icon: "mdi-script-text-outline", color: "light-green darken-3" }
34
- })[n.fileFormat] || {
35
- icon: "mdi-file-question-outline",
36
- color: "indigo lighten-1"
37
- });
38
- return (t, p) => {
39
- const D = f("v-icon");
40
- return c(), V("div", null, [
41
- r(D, {
42
- size: n.size,
43
- color: e.value.color,
44
- textContent: x(e.value.icon)
45
- }, null, 8, ["size", "color", "textContent"])
46
- ]);
47
- };
48
- }
49
- });
50
- function de(a) {
51
- const n = a / 1024, e = n / 1024;
52
- return e >= 1 ? {
53
- text: `${e.toFixed(2)} MB`,
54
- color: e > 10 ? "red" : e > 5 ? "orange" : "green"
55
- } : {
56
- text: `${n.toFixed(2)} KB`,
57
- color: n > 1e3 ? "orange" : "green"
58
- };
59
- }
60
- function re(a, n) {
61
- var t;
62
- const e = ((t = a.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "";
63
- return ["jpg", "jpeg", "png", "gif", "bmp", "svg", "webp", "tiff"].includes(e) || n != null && n.startsWith("image/") ? "image" : ["pdf", "doc", "docx", "txt", "rtf", "odt"].includes(e) ? "document" : ["xls", "xlsx", "csv", "ods"].includes(e) ? "spreadsheet" : ["ppt", "pptx", "odp"].includes(e) ? "presentation" : ["zip", "rar", "7z", "tar", "gz"].includes(e) ? "archive" : ["mp4", "avi", "mov", "wmv", "flv", "webm"].includes(e) ? "video" : ["mp3", "wav", "flac", "aac", "ogg"].includes(e) ? "audio" : "file";
64
- }
65
- function Te(a, n) {
66
- const e = re(a, n), t = {
67
- image: { icon: "mdi-file-image", color: "blue" },
68
- document: { icon: "mdi-file-document", color: "red" },
69
- spreadsheet: { icon: "mdi-file-excel", color: "green" },
70
- presentation: { icon: "mdi-file-powerpoint", color: "orange" },
71
- archive: { icon: "mdi-folder-zip", color: "purple" },
72
- video: { icon: "mdi-file-video", color: "pink" },
73
- audio: { icon: "mdi-file-music", color: "teal" },
74
- file: { icon: "mdi-file", color: "grey" }
75
- };
76
- return t[e] || t.file;
77
- }
78
- function be(a, n) {
79
- return re(a, n) === "image";
80
- }
81
- function Ae(a, n) {
82
- return a <= n;
83
- }
84
- function Le(a, n) {
85
- return a < n;
86
- }
87
- function _e(a) {
88
- var t;
89
- const n = ((t = a.split(".").pop()) == null ? void 0 : t.toLowerCase()) || "";
90
- return {
91
- // Image types
92
- jpg: "image/jpeg",
93
- jpeg: "image/jpeg",
94
- png: "image/png",
95
- gif: "image/gif",
96
- bmp: "image/bmp",
97
- tiff: "image/tiff",
98
- svg: "image/svg+xml",
99
- webp: "image/webp",
100
- // Video types
101
- mp4: "video/mp4",
102
- avi: "video/x-msvideo",
103
- mov: "video/quicktime",
104
- wmv: "video/x-ms-wmv",
105
- flv: "video/x-flv",
106
- webm: "video/webm",
107
- // Document types
108
- pdf: "application/pdf",
109
- doc: "application/msword",
110
- docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
111
- txt: "text/plain",
112
- csv: "text/csv",
113
- // Archive types
114
- zip: "application/zip",
115
- rar: "application/x-rar-compressed"
116
- }[n] || "application/octet-stream";
117
- }
118
- function Ve(a, n) {
119
- const e = a.replace(/^data:image\/[a-zA-Z]+;base64,/, "");
120
- return `data:${n.startsWith("image/") ? n : `image/${n}`};base64,${e}`;
121
- }
122
- function $e(a, n = 0.8, e = 1920, t = 1080) {
123
- return new Promise((p, D) => {
124
- const L = document.createElement("canvas"), v = L.getContext("2d"), g = new Image();
125
- g.onload = () => {
126
- let { width: y, height: w } = g;
127
- if (y > e || w > t) {
128
- const T = Math.min(e / y, t / w);
129
- y *= T, w *= T;
130
- }
131
- L.width = y, L.height = w, v == null || v.drawImage(g, 0, 0, y, w);
132
- const $ = L.toDataURL("image/jpeg", n);
133
- p($);
134
- }, g.onerror = () => D(new Error("Failed to load image for compression"));
135
- const U = new FileReader();
136
- U.onload = (y) => {
137
- var w;
138
- g.src = (w = y.target) == null ? void 0 : w.result;
139
- }, U.onerror = () => D(new Error("Failed to read file")), U.readAsDataURL(a);
140
- });
141
- }
142
- function fe(a) {
143
- return new Promise((n, e) => {
144
- const t = new FileReader();
145
- t.onload = () => {
146
- const p = t.result, D = p.split(",")[1] || p;
147
- n(D);
148
- }, t.onerror = () => e(new Error("Failed to read file")), t.readAsDataURL(a);
149
- });
150
- }
151
- const Se = {
152
- key: 1,
153
- style: { height: "200px", "background-color": "#f5f5f5", position: "relative", overflow: "hidden", display: "flex", "align-items": "center", "justify-content": "center" }
154
- }, Be = ["src", "onError"], Ue = {
155
- key: 1,
156
- style: { width: "100%", height: "100%", background: "#e0e0e0", display: "flex", "align-items": "center", "justify-content": "center" }
157
- }, Ee = {
158
- class: "d-flex justify-center align-center",
159
- style: { position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)", background: "rgba(0,0,0,0.7)", "border-radius": "50%", width: "60px", height: "60px", cursor: "pointer" }
160
- }, Ie = {
161
- key: 2,
162
- class: "d-flex justify-center align-center",
163
- style: { height: "200px", "background-color": "#f5f5f5" }
164
- }, Me = { class: "BYekan" }, Pe = { class: "BYekan" }, je = { key: 0 }, ue = /* @__PURE__ */ te({
165
- __name: "ThumbnailUploader",
166
- props: {
167
- lang: { default: "en" },
168
- documentAttachment: {},
169
- thumb: { type: Boolean, default: !0 },
170
- cols: { default: 4 },
171
- editPermission: { type: Boolean, default: !0 },
172
- deletePermission: { type: Boolean, default: !0 },
173
- selectedLang: {},
174
- cardType: {},
175
- outlined: { type: Boolean, default: !1 },
176
- raised: { type: Boolean, default: !1 },
177
- shaped: { type: Boolean, default: !1 },
178
- tile: { type: Boolean, default: !1 }
179
- },
180
- emits: ["openDeleteDialog", "openEditDocumentDialog"],
181
- setup(a, { emit: n }) {
182
- const e = a, t = n, p = (l) => {
183
- const i = re(l) === "video";
184
- return console.log("🎥 Checking if video file:", l, "result:", i, "fileType:", re(l)), i;
185
- }, D = (l) => Ve(l.base64, l.format), L = (l) => {
186
- var i;
187
- console.error("Image failed to load:", {
188
- name: l.name,
189
- format: l.format,
190
- base64Length: ((i = l.base64) == null ? void 0 : i.length) || 0
191
- });
192
- }, v = ge(/* @__PURE__ */ new Map()), g = (l) => (console.log("🎬 Starting video thumbnail generation for:", l.name), new Promise((i, u) => {
193
- var G;
194
- const m = document.createElement("video"), k = document.createElement("canvas"), S = k.getContext("2d");
195
- if (!S) {
196
- console.error("❌ Canvas context not available"), u(new Error("Canvas context not available"));
197
- return;
198
- }
199
- m.crossOrigin = "anonymous", m.preload = "metadata", m.muted = !0, m.onloadedmetadata = () => {
200
- if (console.log("📹 Video metadata loaded:", {
201
- duration: m.duration,
202
- width: m.videoWidth,
203
- height: m.videoHeight,
204
- readyState: m.readyState,
205
- networkState: m.networkState
206
- }), m.duration === 0 || isNaN(m.duration)) {
207
- console.error("❌ Invalid video duration:", m.duration);
208
- const K = U(l);
209
- y.delete(K), u(new Error("Invalid video duration"));
210
- return;
211
- }
212
- if (m.videoWidth === 0 || m.videoHeight === 0) {
213
- console.error("❌ Invalid video dimensions:", m.videoWidth, "x", m.videoHeight);
214
- const K = U(l);
215
- y.delete(K), u(new Error("Invalid video dimensions"));
216
- return;
217
- }
218
- k.width = m.videoWidth, k.height = m.videoHeight;
219
- const E = Math.min(1, m.duration * 0.1);
220
- console.log("⏰ Seeking to time:", E, "of total duration:", m.duration), m.currentTime = E;
221
- }, m.onseeked = () => {
222
- console.log("🎯 Video seeked successfully to:", m.currentTime);
223
- try {
224
- console.log("🖼️ Canvas setup:", {
225
- width: k.width,
226
- height: k.height,
227
- videoCurrentTime: m.currentTime,
228
- videoReadyState: m.readyState
229
- }), S.drawImage(m, 0, 0, k.width, k.height);
230
- const K = S.getImageData(0, 0, k.width, k.height).data.some((Y) => Y !== 0);
231
- console.log("🎨 Canvas content check:", K ? "Has content" : "Empty/transparent");
232
- const A = k.toDataURL("image/jpeg", 0.8);
233
- console.log("✅ Generated thumbnail:", {
234
- dataUrlLength: A.length,
235
- startsWithData: A.startsWith("data:image/jpeg"),
236
- preview: A.substring(0, 50) + "..."
237
- }), i(A);
238
- } catch (E) {
239
- console.error("❌ Error during thumbnail generation:", E), u(E);
240
- }
241
- }, m.onabort = () => {
242
- console.warn("⚠️ Video loading aborted"), u(new Error("Video loading aborted"));
243
- }, m.onstalled = () => {
244
- console.warn("⚠️ Video loading stalled");
245
- }, m.onerror = (E) => {
246
- console.error("❌ Video failed to load for thumbnail generation:", E), u(new Error("Video failed to load for thumbnail generation"));
247
- }, m.onloadstart = () => {
248
- console.log("🔄 Video load started");
249
- }, m.oncanplay = () => {
250
- console.log("▶️ Video can play");
251
- };
252
- const F = ((G = l.base64) == null ? void 0 : G.replace(/^data:[^;]+;base64,/, "")) || "";
253
- let B;
254
- l.format.startsWith("video/") ? B = l.format : (B = _e(l.name), B.startsWith("video/") || (B = `video/${l.format}`));
255
- const M = `data:${B};base64,${F}`;
256
- console.log("🔗 Setting video source:", {
257
- fileName: l.name,
258
- format: l.format,
259
- mimeType: B,
260
- base64Length: F.length,
261
- videoSrcLength: M.length
262
- }), m.src = M;
263
- })), U = (l) => {
264
- var i;
265
- return `${l.name}_${(i = l.base64) == null ? void 0 : i.substring(0, 50)}`;
266
- };
267
- ie(() => (console.log("🔄 Video thumbnails computed updated:", Array.from(v.keys())), v));
268
- const y = /* @__PURE__ */ new Set(), w = (l) => {
269
- const i = U(l);
270
- if (console.log("🔍 Getting video thumbnail for:", l.name, "cache key:", i), v.has(i))
271
- return console.log("💾 Returning cached thumbnail for:", l.name), v.get(i);
272
- if (y.has(i)) {
273
- console.log("⏳ Thumbnail already being generated for:", l.name);
274
- return;
275
- }
276
- console.log("🚀 No cached thumbnail, generating new one for:", l.name), y.add(i), g(l).then((u) => {
277
- console.log("✅ Thumbnail generated and cached for:", l.name), v.set(i, u), y.delete(i), Fe(() => {
278
- console.log("🔄 UI update triggered for:", l.name);
279
- });
280
- }).catch((u) => {
281
- console.error("❌ Failed to generate video thumbnail for:", l.name, u), y.delete(i);
282
- });
283
- }, $ = (l) => {
284
- console.error("Video thumbnail failed to load:", {
285
- name: l.name,
286
- format: l.format
287
- });
288
- const i = U(l);
289
- v.delete(i);
290
- }, T = (l) => Te(l), j = (l) => l.tags.length > 0 || !!l.description, H = (l) => {
291
- l.showDetailState = !l.showDetailState;
292
- }, O = (l, i) => {
293
- t("openDeleteDialog", l, i);
294
- }, d = (l, i) => {
295
- t("openEditDocumentDialog", l, i);
296
- }, s = () => {
297
- console.log("🎯 Generating thumbnails for videos, total attachments:", e.documentAttachment.length);
298
- const l = e.documentAttachment.filter((i) => p(i.file.name));
299
- console.log("📹 Found video attachments:", l.length, l.map((i) => i.file.name)), l.forEach((i) => {
300
- console.log("🎬 Processing video:", i.file.name), w(i.file);
301
- });
302
- };
303
- return I(() => e.documentAttachment, s, { immediate: !0 }), xe(s), (l, i) => {
304
- const u = f("v-img"), m = f("v-icon"), k = f("v-card-subtitle"), S = f("v-chip"), F = f("v-divider"), B = f("v-btn"), M = f("v-tooltip"), G = f("v-spacer"), E = f("v-card-actions"), K = f("v-chip-group"), A = f("v-card-text"), Y = f("v-expand-transition"), q = f("v-card"), J = f("v-col"), oe = f("v-row");
305
- return c(), V("div", null, [
306
- r(oe, null, {
307
- default: o(() => [
308
- (c(!0), V(R, null, Z(l.documentAttachment, (C, Q) => (c(), h(J, {
309
- key: `attachment-${Q}`,
310
- cols: "12",
311
- md: l.cols,
312
- xs: "12"
313
- }, {
314
- default: o(() => [
315
- r(q, {
316
- shaped: l.shaped,
317
- outlined: l.outlined,
318
- raised: l.raised,
319
- tile: l.tile,
320
- class: "mx-auto",
321
- "max-width": "344"
322
- }, {
323
- default: o(() => [
324
- se(be)(C.file.name) ? (c(), h(u, {
325
- key: 0,
326
- src: D(C.file),
327
- height: "200px",
328
- onError: (W) => L(C.file)
329
- }, null, 8, ["src", "onError"])) : p(C.file.name) ? (c(), V("div", Se, [
330
- w(C.file) ? (c(), V("img", {
331
- key: 0,
332
- src: w(C.file),
333
- style: { width: "100%", height: "100%", "object-fit": "cover" },
334
- onError: (W) => $(C.file)
335
- }, null, 40, Be)) : (c(), V("div", Ue, [
336
- r(m, {
337
- size: "60",
338
- color: "grey"
339
- }, {
340
- default: o(() => i[0] || (i[0] = [
341
- _("mdi-video")
342
- ])),
343
- _: 1
344
- })
345
- ])),
346
- P("div", Ee, [
347
- r(m, {
348
- color: "white",
349
- size: "30"
350
- }, {
351
- default: o(() => i[1] || (i[1] = [
352
- _("mdi-play")
353
- ])),
354
- _: 1
355
- })
356
- ])
357
- ])) : (c(), V("div", Ie, [
358
- r(m, {
359
- size: "120",
360
- color: T(C.file.name).color
361
- }, {
362
- default: o(() => [
363
- _(x(T(C.file.name).icon), 1)
364
- ]),
365
- _: 2
366
- }, 1032, ["color"])
367
- ])),
368
- r(k, { class: "text-truncate py-2" }, {
369
- default: o(() => [
370
- _(x(C.file.name), 1)
371
- ]),
372
- _: 2
373
- }, 1024),
374
- r(k, { class: "pt-2 pb-3" }, {
375
- default: o(() => [
376
- r(S, {
377
- color: se(de)(C.file.size).color,
378
- label: "",
379
- "text-color": "white"
380
- }, {
381
- default: o(() => [
382
- _(x(se(de)(C.file.size).text) + " ", 1),
383
- r(m, { right: "" }, {
384
- default: o(() => i[2] || (i[2] = [
385
- _("mdi-harddisk")
386
- ])),
387
- _: 1
388
- })
389
- ]),
390
- _: 2
391
- }, 1032, ["color"])
392
- ]),
393
- _: 2
394
- }, 1024),
395
- r(F, { class: "mx-4" }),
396
- r(E, { style: { padding: "0" } }, {
397
- default: o(() => [
398
- r(M, { right: "" }, {
399
- activator: o(({ props: W }) => [
400
- l.deletePermission ? (c(), h(B, ee({
401
- key: 0,
402
- text: "",
403
- fab: "",
404
- ref_for: !0
405
- }, W, {
406
- onClick: (le) => O(Q, "")
407
- }), {
408
- default: o(() => [
409
- r(m, { color: "red" }, {
410
- default: o(() => i[3] || (i[3] = [
411
- _("mdi-trash-can-outline")
412
- ])),
413
- _: 1
414
- })
415
- ]),
416
- _: 2
417
- }, 1040, ["onClick"])) : z("", !0)
418
- ]),
419
- default: o(() => [
420
- P("span", Me, x(l.selectedLang[l.lang].delete), 1)
421
- ]),
422
- _: 2
423
- }, 1024),
424
- r(M, { right: "" }, {
425
- activator: o(({ props: W }) => [
426
- l.editPermission ? (c(), h(B, ee({
427
- key: 0,
428
- text: "",
429
- fab: "",
430
- ref_for: !0
431
- }, W, {
432
- onClick: (le) => d(C, Q)
433
- }), {
434
- default: o(() => [
435
- r(m, { color: "green" }, {
436
- default: o(() => i[4] || (i[4] = [
437
- _("mdi-pencil-outline")
438
- ])),
439
- _: 1
440
- })
441
- ]),
442
- _: 2
443
- }, 1040, ["onClick"])) : z("", !0)
444
- ]),
445
- default: o(() => [
446
- P("span", Pe, x(l.selectedLang[l.lang].edit), 1)
447
- ]),
448
- _: 2
449
- }, 1024),
450
- r(G),
451
- j(C.file) ? (c(), h(B, {
452
- key: 0,
453
- icon: "",
454
- onClick: (W) => H(C.file)
455
- }, {
456
- default: o(() => [
457
- r(m, null, {
458
- default: o(() => [
459
- _(x(C.file.showDetailState ? "mdi-chevron-up" : "mdi-chevron-down"), 1)
460
- ]),
461
- _: 2
462
- }, 1024)
463
- ]),
464
- _: 2
465
- }, 1032, ["onClick"])) : z("", !0)
466
- ]),
467
- _: 2
468
- }, 1024),
469
- r(Y, null, {
470
- default: o(() => [
471
- j(C.file) ? ve((c(), V("div", je, [
472
- r(F),
473
- C.file.tags.length ? (c(), h(K, {
474
- key: 0,
475
- multiple: "",
476
- "active-class": "primary--text",
477
- class: "pa-2"
478
- }, {
479
- default: o(() => [
480
- (c(!0), V(R, null, Z(C.file.tags, (W, le) => (c(), h(S, {
481
- key: `tag-${le}`,
482
- class: "ma-1"
483
- }, {
484
- default: o(() => [
485
- _(x(W), 1)
486
- ]),
487
- _: 2
488
- }, 1024))), 128))
489
- ]),
490
- _: 2
491
- }, 1024)) : z("", !0),
492
- C.file.description ? (c(), h(A, {
493
- key: 1,
494
- class: "text-justify"
495
- }, {
496
- default: o(() => [
497
- _(x(C.file.description), 1)
498
- ]),
499
- _: 2
500
- }, 1024)) : z("", !0)
501
- ], 512)), [
502
- [he, C.file.showDetailState]
503
- ]) : z("", !0)
504
- ]),
505
- _: 2
506
- }, 1024)
507
- ]),
508
- _: 2
509
- }, 1032, ["shaped", "outlined", "raised", "tile"])
510
- ]),
511
- _: 2
512
- }, 1032, ["md"]))), 128))
513
- ]),
514
- _: 1
515
- })
516
- ]);
517
- };
518
- }
519
- }), Ne = {
520
- key: 0,
521
- class: "text-left"
522
- }, He = { class: "text-left" }, Re = { class: "text-left" }, We = { class: "text-left" }, Oe = { key: 0 }, Ke = { class: "BYekan" }, ce = /* @__PURE__ */ te({
523
- __name: "TableUploader",
524
- props: {
525
- documentAttachment: {},
526
- thumb: { type: Boolean, default: !0 },
527
- lang: { default: "en" },
528
- cols: { default: 4 },
529
- editPermission: { type: Boolean, default: !0 },
530
- deletePermission: { type: Boolean, default: !0 },
531
- tableThumbColumn: { type: Boolean },
532
- tableFixedHeader: { type: Boolean, default: !0 },
533
- tableHeight: { default: 400 },
534
- selectedLang: {}
535
- },
536
- emits: ["openDeleteDialog", "openEditDocumentDialog"],
537
- setup(a, { emit: n }) {
538
- const e = a, t = n, p = (v) => {
539
- var g;
540
- return v && ((g = v.split(".").pop()) == null ? void 0 : g.toLowerCase()) || "";
541
- }, D = (v, g) => {
542
- t("openDeleteDialog", v, g);
543
- }, L = (v, g) => {
544
- t("openEditDocumentDialog", v, g);
545
- };
546
- return (v, g) => {
547
- const U = f("v-img"), y = f("v-icon"), w = f("v-chip"), $ = f("v-card-subtitle"), T = f("v-btn"), j = f("v-tooltip"), H = f("v-simple-table"), O = f("v-col"), d = f("v-row");
548
- return c(), V("div", null, [
549
- r(d, null, {
550
- default: o(() => [
551
- r(O, {
552
- cols: "12",
553
- lg: "12",
554
- md: "12",
555
- xs: "12"
556
- }, {
557
- default: o(() => [
558
- r(H, {
559
- "fixed-header": e.tableFixedHeader,
560
- height: e.tableHeight + "px"
561
- }, {
562
- default: o(() => [
563
- P("thead", null, [
564
- P("tr", null, [
565
- e.tableThumbColumn ? (c(), V("th", Ne, x(e.selectedLang[v.lang].table.thumb), 1)) : z("", !0),
566
- P("th", He, x(e.selectedLang[v.lang].table.name), 1),
567
- P("th", Re, x(e.selectedLang[v.lang].table.size), 1),
568
- P("th", We, x(e.selectedLang[v.lang].table.action.action), 1)
569
- ])
570
- ]),
571
- P("tbody", null, [
572
- (c(!0), V(R, null, Z(e.documentAttachment, (s, l) => {
573
- var i;
574
- return c(), V("tr", {
575
- key: `attachment-${l}`
576
- }, [
577
- e.tableThumbColumn ? (c(), V("td", Oe, [
578
- s.file.name && ["jpg", "jpeg", "png", "tif", "bmp"].includes(
579
- ((i = s.file.name.split(".").pop()) == null ? void 0 : i.toLowerCase()) || ""
580
- ) ? (c(), V(R, { key: 0 }, [
581
- e.thumb ? (c(), h(U, {
582
- key: 0,
583
- style: { margin: "10px" },
584
- src: "data:" + s.file.format + "," + s.file.base64,
585
- height: "50px",
586
- width: "50px"
587
- }, null, 8, ["src"])) : (c(), h(y, {
588
- key: 1,
589
- style: { "margin-left": "10px" },
590
- size: "50",
591
- "file-word-outline": "",
592
- color: "deep-purple darken-1"
593
- }, {
594
- default: o(() => g[0] || (g[0] = [
595
- _("mdi-file-image-outline")
596
- ])),
597
- _: 1
598
- }))
599
- ], 64)) : (c(), V(R, { key: 1 }, [
600
- p(s.file.name) === "pdf" ? (c(), h(y, {
601
- key: 0,
602
- style: { "margin-left": "10px" },
603
- size: "50",
604
- "file-word-outline": "",
605
- color: "red darken-1"
606
- }, {
607
- default: o(() => g[1] || (g[1] = [
608
- _("mdi-file-pdf-outline")
609
- ])),
610
- _: 1
611
- })) : ["doc", "docx", "odt"].includes(p(s.file.name)) ? (c(), h(y, {
612
- key: 1,
613
- style: { "margin-left": "10px" },
614
- size: "50",
615
- "file-word-outline": "",
616
- color: "blue darken-1"
617
- }, {
618
- default: o(() => g[2] || (g[2] = [
619
- _("mdi-file-word-outline")
620
- ])),
621
- _: 1
622
- })) : ["xls", "xlsx"].includes(p(s.file.name)) ? (c(), h(y, {
623
- key: 2,
624
- style: { "margin-left": "10px" },
625
- size: "50",
626
- "file-word-outline": "",
627
- color: "teal darken-1"
628
- }, {
629
- default: o(() => g[3] || (g[3] = [
630
- _("mdi-file-excel-outline")
631
- ])),
632
- _: 1
633
- })) : ["pptx", "pptm", "ppt"].includes(p(s.file.name)) ? (c(), h(y, {
634
- key: 3,
635
- style: { "margin-left": "10px" },
636
- size: "50",
637
- "file-word-outline": "",
638
- color: "orange darken-3"
639
- }, {
640
- default: o(() => g[4] || (g[4] = [
641
- _("mdi-file-powerpoint-outline")
642
- ])),
643
- _: 1
644
- })) : ["mp4", "mov", "flv", "wmv", "avi"].includes(p(s.file.name)) ? (c(), h(y, {
645
- key: 4,
646
- style: { "margin-left": "10px" },
647
- size: "50",
648
- "file-word-outline": "",
649
- color: "red lighten-1"
650
- }, {
651
- default: o(() => g[5] || (g[5] = [
652
- _("mdi-file-video-outline")
653
- ])),
654
- _: 1
655
- })) : p(s.file.name) === "dwg" ? (c(), h(y, {
656
- key: 5,
657
- style: { "margin-left": "10px" },
658
- size: "50",
659
- "file-word-outline": "",
660
- color: "indigo lighten-2"
661
- }, {
662
- default: o(() => g[6] || (g[6] = [
663
- _("mdi-file-cad")
664
- ])),
665
- _: 1
666
- })) : ["zip", "rar", "7-zip"].includes(p(s.file.name)) ? (c(), h(y, {
667
- key: 6,
668
- size: "120",
669
- "file-word-outline": "",
670
- color: "lime lighten-1"
671
- }, {
672
- default: o(() => g[7] || (g[7] = [
673
- _("mdi-folder-zip-outline")
674
- ])),
675
- _: 1
676
- })) : p(s.file.name) === "txt" ? (c(), h(y, {
677
- key: 7,
678
- style: { "margin-left": "10px" },
679
- size: "50",
680
- "file-word-outline": "",
681
- color: "light-green darken-3"
682
- }, {
683
- default: o(() => g[8] || (g[8] = [
684
- _("mdi-script-text-outline")
685
- ])),
686
- _: 1
687
- })) : (c(), h(y, {
688
- key: 8,
689
- "x-large": "",
690
- "file-word-outline": "",
691
- color: "indigo lighten-1"
692
- }, {
693
- default: o(() => g[9] || (g[9] = [
694
- _("mdi-file-question-outline")
695
- ])),
696
- _: 1
697
- }))
698
- ], 64))
699
- ])) : z("", !0),
700
- P("td", null, x(s.file.name), 1),
701
- P("td", null, [
702
- Number((s.file.size / 1e3).toFixed(1)) < 1024 ? (c(), h($, {
703
- key: 0,
704
- class: "mt2"
705
- }, {
706
- default: o(() => [
707
- r(w, {
708
- color: "teal lighten-2",
709
- label: "",
710
- "text-color": "white"
711
- }, {
712
- default: o(() => [
713
- _(x(Number((s.file.size / 1e3).toFixed(1)) + v.selectedLang[v.lang].size.kb) + " ", 1),
714
- r(y, { right: "" }, {
715
- default: o(() => g[10] || (g[10] = [
716
- _("mdi-harddisk")
717
- ])),
718
- _: 1
719
- })
720
- ]),
721
- _: 2
722
- }, 1024)
723
- ]),
724
- _: 2
725
- }, 1024)) : z("", !0),
726
- Number((s.file.size / 1e3).toFixed(1)) > 1024 ? (c(), h($, { key: 1 }, {
727
- default: o(() => [
728
- r(w, {
729
- color: "teal lighten-2",
730
- label: "",
731
- "text-color": "white"
732
- }, {
733
- default: o(() => [
734
- _(x(Number(
735
- (s.file.size / 1e3 / 1024).toFixed(1)
736
- ) + v.selectedLang[v.lang].size.mb) + " ", 1),
737
- r(y, { right: "" }, {
738
- default: o(() => g[11] || (g[11] = [
739
- _("mdi-harddisk")
740
- ])),
741
- _: 1
742
- })
743
- ]),
744
- _: 2
745
- }, 1024)
746
- ]),
747
- _: 2
748
- }, 1024)) : z("", !0)
749
- ]),
750
- P("td", null, [
751
- r(j, { top: "" }, {
752
- activator: o(({ props: u }) => [
753
- v.deletePermission ? (c(), h(T, ee({
754
- key: 0,
755
- icon: "",
756
- color: "red",
757
- ref_for: !0
758
- }, u, {
759
- onClick: (m) => D(l, "")
760
- }), {
761
- default: o(() => [
762
- r(y, null, {
763
- default: o(() => g[12] || (g[12] = [
764
- _("mdi-delete")
765
- ])),
766
- _: 1
767
- })
768
- ]),
769
- _: 2
770
- }, 1040, ["onClick"])) : z("", !0)
771
- ]),
772
- default: o(() => [
773
- P("span", null, x(v.selectedLang[v.lang].table.action.deleteTooltip), 1)
774
- ]),
775
- _: 2
776
- }, 1024),
777
- r(j, { top: "" }, {
778
- activator: o(({ props: u }) => [
779
- v.editPermission ? (c(), h(T, ee({
780
- key: 0,
781
- text: "",
782
- fab: "",
783
- ref_for: !0
784
- }, u, {
785
- onClick: (m) => L(s, l)
786
- }), {
787
- default: o(() => [
788
- r(y, { color: "green" }, {
789
- default: o(() => g[13] || (g[13] = [
790
- _("mdi-pencil-outline")
791
- ])),
792
- _: 1
793
- })
794
- ]),
795
- _: 2
796
- }, 1040, ["onClick"])) : z("", !0)
797
- ]),
798
- default: o(() => [
799
- P("span", Ke, x(v.selectedLang[v.lang].edit), 1)
800
- ]),
801
- _: 2
802
- }, 1024)
803
- ])
804
- ]);
805
- }), 128))
806
- ])
807
- ]),
808
- _: 1
809
- }, 8, ["fixed-header", "height"])
810
- ]),
811
- _: 1
812
- })
813
- ]),
814
- _: 1
815
- })
816
- ]);
817
- };
818
- }
819
- }), me = /* @__PURE__ */ te({
820
- __name: "SimpleUploader",
821
- props: {
822
- documentAttachment: {},
823
- lang: { default: "en" },
824
- thumb: { type: Boolean, default: !0 },
825
- cols: { default: 4 },
826
- editPermission: { type: Boolean, default: !0 },
827
- cardType: {},
828
- outlined: { type: Boolean },
829
- raised: { type: Boolean },
830
- shaped: { type: Boolean },
831
- tile: { type: Boolean },
832
- deletePermission: { type: Boolean, default: !0 },
833
- selectedLang: {}
834
- },
835
- emits: ["setCardTheme", "openDeleteDialog", "openEditDocumentDialog"],
836
- setup(a, { emit: n }) {
837
- const e = a, t = n, p = (y) => {
838
- const w = y / 1e3;
839
- return w < 1024 ? `${w.toFixed(1)} ${e.selectedLang[e.lang].size.kb}` : `${(w / 1024).toFixed(1)} ${e.selectedLang[e.lang].size.mb}`;
840
- }, D = (y) => {
841
- var w;
842
- return ["jpg", "jpeg", "png", "tif", "bmp"].includes(((w = y.split(".").pop()) == null ? void 0 : w.toLowerCase()) || "");
843
- }, L = (y) => {
844
- var T;
845
- const w = (T = y.split(".").pop()) == null ? void 0 : T.toLowerCase();
846
- return w && {
847
- pdf: "mdi-file-pdf-outline",
848
- doc: "mdi-file-word-outline",
849
- docx: "mdi-file-word-outline",
850
- odt: "mdi-file-word-outline",
851
- jpg: "mdi-file-image-outline",
852
- jpeg: "mdi-file-image-outline",
853
- png: "mdi-file-image-outline",
854
- tif: "mdi-file-image-outline",
855
- bmp: "mdi-file-image-outline",
856
- xls: "mdi-file-excel-outline",
857
- xlsx: "mdi-file-excel-outline",
858
- pptx: "mdi-file-powerpoint-outline",
859
- pptm: "mdi-file-powerpoint-outline",
860
- ppt: "mdi-file-powerpoint-outline",
861
- mp4: "mdi-file-video-outline",
862
- mov: "mdi-file-video-outline",
863
- flv: "mdi-file-video-outline",
864
- wmv: "mdi-file-video-outline",
865
- avi: "mdi-file-video-outline",
866
- dwg: "mdi-file-cad",
867
- zip: "mdi-folder-zip-outline",
868
- rar: "mdi-folder-zip-outline",
869
- "7-zip": "mdi-folder-zip-outline",
870
- txt: "mdi-script-text-outline"
871
- }[w] || "mdi-file-question-outline";
872
- }, v = (y) => {
873
- var T;
874
- const w = (T = y.split(".").pop()) == null ? void 0 : T.toLowerCase();
875
- return w && {
876
- pdf: "red darken-1",
877
- doc: "blue darken-1",
878
- docx: "blue darken-1",
879
- odt: "blue darken-1",
880
- jpg: "deep-purple darken-1",
881
- jpeg: "deep-purple darken-1",
882
- png: "deep-purple darken-1",
883
- tif: "deep-purple darken-1",
884
- bmp: "deep-purple darken-1",
885
- xls: "teal darken-1",
886
- xlsx: "teal darken-1",
887
- pptx: "orange darken-3",
888
- pptm: "orange darken-3",
889
- ppt: "orange darken-3",
890
- mp4: "red lighten-1",
891
- mov: "red lighten-1",
892
- flv: "red lighten-1",
893
- wmv: "red lighten-1",
894
- avi: "red lighten-1",
895
- dwg: "indigo lighten-2",
896
- zip: "lime lighten-1",
897
- rar: "lime lighten-1",
898
- "7-zip": "lime lighten-1",
899
- txt: "light-green darken-3"
900
- }[w] || "indigo lighten-1";
901
- }, g = (y, w) => t("openDeleteDialog", y, w), U = (y, w) => t("openEditDocumentDialog", y, w);
902
- return (y, w) => {
903
- const $ = f("v-list-item-subtitle"), T = f("v-icon"), j = f("v-chip"), H = f("v-list-item-content"), O = f("v-img"), d = f("v-avatar"), s = f("v-list-item-title"), l = f("v-list-item"), i = f("v-divider"), u = f("v-btn"), m = f("v-tooltip"), k = f("v-spacer"), S = f("v-card-actions"), F = f("v-chip-group"), B = f("v-card-text"), M = f("v-expand-transition"), G = f("v-card"), E = f("v-col"), K = f("v-row");
904
- return c(), V("div", null, [
905
- r(K, null, {
906
- default: o(() => [
907
- (c(!0), V(R, null, Z(e.documentAttachment, (A, Y) => (c(), h(E, {
908
- key: `attachment-${Y}`,
909
- cols: "12",
910
- md: e.cols,
911
- xs: "12"
912
- }, {
913
- default: o(() => [
914
- r(G, {
915
- shaped: e.shaped,
916
- outlined: e.outlined,
917
- raised: e.raised,
918
- tile: e.tile
919
- }, {
920
- default: o(() => [
921
- r(l, { "three-line": "" }, {
922
- default: o(() => [
923
- r(H, null, {
924
- default: o(() => [
925
- r($, { color: "blue-grey darken-3" }, {
926
- default: o(() => [
927
- _(x(A.file.name), 1)
928
- ]),
929
- _: 2
930
- }, 1024),
931
- r($, null, {
932
- default: o(() => [
933
- r(j, {
934
- color: "teal lighten-2",
935
- label: "",
936
- "text-color": "white"
937
- }, {
938
- default: o(() => [
939
- _(x(p(A.file.size)) + " ", 1),
940
- r(T, { right: "" }, {
941
- default: o(() => w[0] || (w[0] = [
942
- _("mdi-harddisk")
943
- ])),
944
- _: 1
945
- })
946
- ]),
947
- _: 2
948
- }, 1024)
949
- ]),
950
- _: 2
951
- }, 1024)
952
- ]),
953
- _: 2
954
- }, 1024),
955
- r(l, null, {
956
- prepend: o(() => [
957
- r(d, {
958
- size: "80",
959
- color: "blue-grey lighten-5"
960
- }, {
961
- default: o(() => [
962
- D(A.file.name) && e.thumb ? (c(), h(O, {
963
- key: 0,
964
- src: "data:" + A.file.format + "," + A.file.base64
965
- }, null, 8, ["src"])) : (c(), h(T, {
966
- key: 1,
967
- color: v(A.file.name),
968
- size: "50"
969
- }, {
970
- default: o(() => [
971
- _(x(L(A.file.name)), 1)
972
- ]),
973
- _: 2
974
- }, 1032, ["color"]))
975
- ]),
976
- _: 2
977
- }, 1024)
978
- ]),
979
- default: o(() => [
980
- r(s, null, {
981
- default: o(() => w[1] || (w[1] = [
982
- _("File Title Here")
983
- ])),
984
- _: 1
985
- })
986
- ]),
987
- _: 2
988
- }, 1024)
989
- ]),
990
- _: 2
991
- }, 1024),
992
- r(i, { class: "mx-4" }),
993
- r(S, { style: { padding: "0" } }, {
994
- default: o(() => [
995
- r(m, { right: "" }, {
996
- activator: o(({ props: q }) => [
997
- e.deletePermission ? (c(), h(u, ee({
998
- key: 0,
999
- text: "",
1000
- fab: "",
1001
- ref_for: !0
1002
- }, q, {
1003
- onClick: (J) => g(Y, "")
1004
- }), {
1005
- default: o(() => [
1006
- r(T, { color: "red" }, {
1007
- default: o(() => w[2] || (w[2] = [
1008
- _("mdi-trash-can-outline")
1009
- ])),
1010
- _: 1
1011
- })
1012
- ]),
1013
- _: 2
1014
- }, 1040, ["onClick"])) : z("", !0)
1015
- ]),
1016
- default: o(() => [
1017
- P("span", null, x(e.selectedLang[y.lang].delete), 1)
1018
- ]),
1019
- _: 2
1020
- }, 1024),
1021
- r(m, { right: "" }, {
1022
- activator: o(({ props: q }) => [
1023
- e.editPermission ? (c(), h(u, ee({
1024
- key: 0,
1025
- text: "",
1026
- fab: "",
1027
- ref_for: !0
1028
- }, q, {
1029
- onClick: (J) => U(A, Y)
1030
- }), {
1031
- default: o(() => [
1032
- r(T, { color: "green" }, {
1033
- default: o(() => w[3] || (w[3] = [
1034
- _("mdi-pencil-outline")
1035
- ])),
1036
- _: 1
1037
- })
1038
- ]),
1039
- _: 2
1040
- }, 1040, ["onClick"])) : z("", !0)
1041
- ]),
1042
- default: o(() => [
1043
- P("span", null, x(e.selectedLang[y.lang].edit), 1)
1044
- ]),
1045
- _: 2
1046
- }, 1024),
1047
- r(k),
1048
- A.file.tags.length > 0 || A.file.description ? (c(), h(u, {
1049
- key: 0,
1050
- icon: "",
1051
- onClick: De((q) => A.file.showDetailState = !A.file.showDetailState, ["prevent"])
1052
- }, {
1053
- default: o(() => [
1054
- r(T, null, {
1055
- default: o(() => [
1056
- _(x(A.file.showDetailState ? "mdi-chevron-up" : "mdi-chevron-down"), 1)
1057
- ]),
1058
- _: 2
1059
- }, 1024)
1060
- ]),
1061
- _: 2
1062
- }, 1032, ["onClick"])) : z("", !0)
1063
- ]),
1064
- _: 2
1065
- }, 1024),
1066
- r(M, null, {
1067
- default: o(() => [
1068
- ve(P("div", null, [
1069
- r(i),
1070
- A.file.tags.length ? (c(), h(F, {
1071
- key: 0,
1072
- multiple: "",
1073
- "active-class": "primary--text",
1074
- style: { padding: "8px" }
1075
- }, {
1076
- default: o(() => [
1077
- (c(!0), V(R, null, Z(A.file.tags, (q, J) => (c(), h(j, {
1078
- key: `tag-${J}`,
1079
- style: { margin: "5px" }
1080
- }, {
1081
- default: o(() => [
1082
- _(x(q), 1)
1083
- ]),
1084
- _: 2
1085
- }, 1024))), 128))
1086
- ]),
1087
- _: 2
1088
- }, 1024)) : z("", !0),
1089
- A.file.description ? (c(), h(B, {
1090
- key: 1,
1091
- style: { "text-align": "justify" }
1092
- }, {
1093
- default: o(() => [
1094
- _(x(A.file.description), 1)
1095
- ]),
1096
- _: 2
1097
- }, 1024)) : z("", !0)
1098
- ], 512), [
1099
- [he, A.file.showDetailState]
1100
- ])
1101
- ]),
1102
- _: 2
1103
- }, 1024)
1104
- ]),
1105
- _: 2
1106
- }, 1032, ["shaped", "outlined", "raised", "tile"])
1107
- ]),
1108
- _: 2
1109
- }, 1032, ["md"]))), 128))
1110
- ]),
1111
- _: 1
1112
- })
1113
- ]);
1114
- };
1115
- }
1116
- }), pe = /* @__PURE__ */ te({
1117
- __name: "InsertButton",
1118
- props: {
1119
- documentAttachment: {},
1120
- badgeCounter: { type: Boolean },
1121
- btnColor: {},
1122
- lang: {},
1123
- maxFileCount: {},
1124
- selectedLang: {}
1125
- },
1126
- emits: ["openInputDocumentModal"],
1127
- setup(a, { emit: n }) {
1128
- const e = n, t = a, p = () => {
1129
- e("openInputDocumentModal");
1130
- };
1131
- return (D, L) => {
1132
- const v = f("v-btn"), g = f("v-badge");
1133
- return c(), V("div", null, [
1134
- t.badgeCounter ? (c(), V(R, { key: 0 }, [
1135
- t.documentAttachment.length > 0 ? (c(), h(g, {
1136
- key: 0,
1137
- bordered: "",
1138
- color: t.documentAttachment.length === t.maxFileCount ? "error" : "success",
1139
- overlap: "",
1140
- content: D.documentAttachment.length
1141
- }, {
1142
- default: o(() => [
1143
- r(v, {
1144
- color: t.btnColor,
1145
- onClick: p,
1146
- class: "mb-4"
1147
- }, {
1148
- default: o(() => [
1149
- _(x(t.selectedLang[D.lang].insertFile), 1)
1150
- ]),
1151
- _: 1
1152
- }, 8, ["color"])
1153
- ]),
1154
- _: 1
1155
- }, 8, ["color", "content"])) : (c(), h(v, {
1156
- key: 1,
1157
- color: t.btnColor,
1158
- onClick: p,
1159
- class: "mb-4"
1160
- }, {
1161
- default: o(() => [
1162
- _(x(t.selectedLang[D.lang].insertFile), 1)
1163
- ]),
1164
- _: 1
1165
- }, 8, ["color"]))
1166
- ], 64)) : z("", !0),
1167
- t.badgeCounter ? z("", !0) : (c(), h(v, {
1168
- key: 1,
1169
- color: D.btnColor,
1170
- onClick: p,
1171
- class: "mb-4"
1172
- }, {
1173
- default: o(() => [
1174
- _(x(t.selectedLang[D.lang].insertFile), 1)
1175
- ]),
1176
- _: 1
1177
- }, 8, ["color"]))
1178
- ]);
1179
- };
1180
- }
1181
- }), qe = {
1182
- en: {
1183
- insertFile: "Insert File",
1184
- insertNewFile: "Insert New File",
1185
- add: "Add",
1186
- delete: "Delete",
1187
- edit: "Edit",
1188
- deleteDialog: {
1189
- message: "Are you sure you want to delete the file?",
1190
- cancel: "cancel"
1191
- },
1192
- table: {
1193
- thumb: "Thumb",
1194
- name: "Name",
1195
- size: "Size",
1196
- tags: "tags",
1197
- action: {
1198
- action: "Action",
1199
- deleteTooltip: "Delete"
1200
- }
1201
- },
1202
- size: {
1203
- kb: "KB",
1204
- mb: "MB"
1205
- },
1206
- maxFileSizeAlert: "Max file Size is",
1207
- maxFileCountAlert: "Max file Count is",
1208
- fileName: "File Name",
1209
- fileDescription: "File Description",
1210
- fileTags: "File Tags"
1211
- },
1212
- fa: {
1213
- insertFile: "افزودن فایل",
1214
- insertNewFile: "افزودن فایل جدید",
1215
- add: "افزودن",
1216
- delete: "حذف",
1217
- edit: "ویرایش",
1218
- deleteDialog: {
1219
- message: "آیا برای حذف فایل اطمینان دارید؟",
1220
- cancel: "لغو"
1221
- },
1222
- table: {
1223
- thumb: "پیش نمایش",
1224
- name: "نام",
1225
- size: "حجم",
1226
- action: {
1227
- action: "عملیات",
1228
- deleteTooltip: "حذف"
1229
- }
1230
- },
1231
- size: {
1232
- kb: "کیلو بایت",
1233
- mb: "مگابایت"
1234
- },
1235
- maxFileSizeAlert: "حداکثر حجم فایل انتحابی ",
1236
- maxFileCountAlert: "حداکثر تعداد فایل انتخابی",
1237
- fileName: "نام فایل",
1238
- fileDescription: "توضیحات فایل",
1239
- fileTags: "برچسب فایل"
1240
- },
1241
- fr: {
1242
- insertFile: "Insérer un fichier",
1243
- insertNewFile: "Insérer un nouveau fichier",
1244
- add: "Ajouter",
1245
- delete: "Supprimer",
1246
- edit: "Éditer",
1247
- deleteDialog: {
1248
- message: "Voulez-vous vraiment supprimer le fichier?",
1249
- cancel: "Annuler"
1250
- },
1251
- table: {
1252
- thumb: "la vignette",
1253
- name: "Nom",
1254
- size: "Taille",
1255
- action: {
1256
- action: "Action",
1257
- deleteTooltip: "Supprimer"
1258
- }
1259
- },
1260
- size: {
1261
- kb: "KB",
1262
- mb: "MB"
1263
- },
1264
- maxFileSizeAlert: "La taille maximale du fichier est",
1265
- maxFileCountAlert: "Le nombre maximal de fichiers est",
1266
- fileName: "Nom de fichier",
1267
- fileDescription: "description du fichier",
1268
- fileTags: "Balises de fichier"
1269
- },
1270
- ch: {
1271
- insertFile: "插入档案",
1272
- insertNewFile: "插入新文件",
1273
- add: "加",
1274
- delete: "删除",
1275
- edit: "编辑",
1276
- deleteDialog: {
1277
- message: "您确定要删除文件吗?",
1278
- cancel: "取消"
1279
- },
1280
- table: {
1281
- thumb: "缩图",
1282
- name: "名称",
1283
- size: "尺寸",
1284
- action: {
1285
- action: "行动",
1286
- deleteTooltip: "删除"
1287
- }
1288
- },
1289
- size: {
1290
- kb: "KB",
1291
- mb: "MB"
1292
- },
1293
- maxFileSizeAlert: "档案大小上限为",
1294
- maxFileCountAlert: "现“最大文件数”为",
1295
- fileName: "文档名称",
1296
- fileDescription: "文件描述",
1297
- fileTags: "文件标签"
1298
- },
1299
- ar: {
1300
- insertFile: "إدراج ملف",
1301
- insertNewFile: "إدراج ملف جديد",
1302
- add: "أضف",
1303
- delete: "حذف",
1304
- edit: "تعديل",
1305
- deleteDialog: {
1306
- message: "هل أنت متأكد أنك تريد حذف الملف؟",
1307
- cancel: "إلغاء"
1308
- },
1309
- table: {
1310
- thumb: "ظفري",
1311
- name: "اسم",
1312
- size: "بحجم",
1313
- action: {
1314
- action: "عمل",
1315
- deleteTooltip: "حذف"
1316
- }
1317
- },
1318
- size: {
1319
- kb: "کیلو بایت",
1320
- mb: "ميغا بايت"
1321
- },
1322
- maxFileSizeAlert: "الحجم الأقصى للملف هو",
1323
- maxFileCountAlert: "الحد الأقصى لعدد الملفات هو",
1324
- fileName: "اسم الملف",
1325
- fileDescription: "وصف الملف",
1326
- fileTags: "علامات الملف"
1327
- }
1328
- };
1329
- function rt(a, n = {}) {
1330
- const {
1331
- maxFileSize: e = 5 * 1024 * 1024,
1332
- // 5MB default
1333
- maxFileCount: t = 10,
1334
- imageCompressor: p = !1,
1335
- imageCompressLevel: D = 0.8,
1336
- fileAccept: L = "*"
1337
- } = n, v = ae(!1), g = ae({
1338
- show: !1,
1339
- text: "",
1340
- color: "success"
1341
- }), U = ie(() => a.value.length), y = ie(() => U.value < t), w = ie(
1342
- () => a.value.reduce((l, i) => l + i.file.size, 0)
1343
- );
1344
- function $(l, i = "success") {
1345
- g.value = { show: !0, text: l, color: i };
1346
- }
1347
- function T(l) {
1348
- var i;
1349
- if (!Ae(l.size, e))
1350
- return {
1351
- valid: !1,
1352
- error: `File size exceeds maximum allowed size of ${(e / 1048576).toFixed(1)}MB`
1353
- };
1354
- if (!Le(U.value, t))
1355
- return {
1356
- valid: !1,
1357
- error: `Maximum file count of ${t} reached`
1358
- };
1359
- if (L !== "*") {
1360
- const u = L.split(",").map((F) => F.trim()), m = `.${(i = l.name.split(".").pop()) == null ? void 0 : i.toLowerCase()}`, k = l.type;
1361
- if (!u.some((F) => F.startsWith(".") ? F === m : F.includes("/*") ? k.startsWith(F.replace("/*", "")) : F === k))
1362
- return {
1363
- valid: !1,
1364
- error: `File type not accepted. Allowed types: ${L}`
1365
- };
1366
- }
1367
- return { valid: !0 };
1368
- }
1369
- async function j(l) {
1370
- let i;
1371
- if (p && be(l.name, l.type))
1372
- try {
1373
- i = (await $e(l, D)).split(",")[1];
1374
- } catch (k) {
1375
- console.warn("Image compression failed, using original file:", k), i = await fe(l);
1376
- }
1377
- else
1378
- i = await fe(l);
1379
- const u = de(l.size), m = _e(l.name);
1380
- return {
1381
- base64: i,
1382
- size: u.text,
1383
- name: l.name,
1384
- tags: [],
1385
- description: "",
1386
- showDetailState: !1,
1387
- format: m
1388
- };
1389
- }
1390
- async function H(l) {
1391
- if (v.value) return !1;
1392
- v.value = !0;
1393
- const i = Array.from(l), u = [];
1394
- for (const m of i) {
1395
- const k = T(m);
1396
- k.valid ? u.push(m) : $(k.error, "error");
1397
- }
1398
- if (u.length === 0)
1399
- return v.value = !1, !1;
1400
- try {
1401
- const k = (await Promise.all(
1402
- u.map((F) => j(F))
1403
- )).map((F) => {
1404
- var B;
1405
- return {
1406
- file: {
1407
- name: F.name,
1408
- format: F.format,
1409
- base64: F.base64,
1410
- size: ((B = u.find((M) => M.name === F.name)) == null ? void 0 : B.size) || 0,
1411
- tags: F.tags,
1412
- description: F.description,
1413
- showDetailState: F.showDetailState
1414
- }
1415
- };
1416
- });
1417
- a.value.push(...k);
1418
- const S = u.length === 1 ? `File "${u[0].name}" uploaded successfully` : `${u.length} files uploaded successfully`;
1419
- return $(S, "success"), !0;
1420
- } catch (m) {
1421
- return console.error("File upload error:", m), $("Failed to upload files. Please try again.", "error"), !1;
1422
- } finally {
1423
- v.value = !1;
1424
- }
1425
- }
1426
- function O(l) {
1427
- if (l >= 0 && l < a.value.length) {
1428
- const i = a.value[l];
1429
- return a.value.splice(l, 1), $(`File "${i.file.name}" removed`, "warning"), !0;
1430
- }
1431
- return !1;
1432
- }
1433
- function d(l, i) {
1434
- if (l >= 0 && l < a.value.length) {
1435
- const u = a.value[l].file;
1436
- return Object.assign(u, i), $("File updated successfully", "success"), !0;
1437
- }
1438
- return !1;
1439
- }
1440
- function s() {
1441
- const l = a.value.length;
1442
- a.value.splice(0), $(`${l} files cleared`, "warning");
1443
- }
1444
- return {
1445
- // State
1446
- isUploading: v,
1447
- snackbar: g,
1448
- // Computed
1449
- fileCount: U,
1450
- canAddMoreFiles: y,
1451
- totalSize: w,
1452
- // Methods
1453
- uploadFiles: H,
1454
- removeFile: O,
1455
- updateFileMetadata: d,
1456
- clearAllFiles: s,
1457
- validateFile: T,
1458
- showSnackbar: $
1459
- };
1460
- }
1461
- function st(a = {}) {
1462
- const {
1463
- maxErrors: n = 10,
1464
- autoRemoveTimeout: e = 5e3,
1465
- logToConsole: t = !0
1466
- } = a, p = ae([]), D = ae(!1);
1467
- function L() {
1468
- return `error_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
1469
- }
1470
- function v(i, u = "error", m, k) {
1471
- const S = {
1472
- id: L(),
1473
- message: i,
1474
- type: u,
1475
- timestamp: /* @__PURE__ */ new Date(),
1476
- context: m,
1477
- action: k
1478
- };
1479
- return t && (u === "error" ? console.error : u === "warning" ? console.warn : u === "info" ? console.info : console.log)(`[${u.toUpperCase()}] ${i}`, m || ""), p.value.unshift(S), p.value.length > n && (p.value = p.value.slice(0, n)), e > 0 && setTimeout(() => {
1480
- g(S.id);
1481
- }, e), S.id;
1482
- }
1483
- function g(i) {
1484
- const u = p.value.findIndex((m) => m.id === i);
1485
- return u !== -1 ? (p.value.splice(u, 1), !0) : !1;
1486
- }
1487
- function U() {
1488
- p.value = [];
1489
- }
1490
- function y(i) {
1491
- p.value = p.value.filter((u) => u.type !== i);
1492
- }
1493
- async function w(i, u, m) {
1494
- D.value = !0;
1495
- try {
1496
- return await i();
1497
- } catch (k) {
1498
- const S = u || (k instanceof Error ? k.message : "An unexpected error occurred");
1499
- return v(S, "error", {
1500
- ...m,
1501
- originalError: k instanceof Error ? k.message : String(k)
1502
- }), null;
1503
- } finally {
1504
- D.value = !1;
1505
- }
1506
- }
1507
- function $(i, u, m) {
1508
- return i || v(u, "error", m), i;
1509
- }
1510
- function T(i, u) {
1511
- return v(i, "success", u);
1512
- }
1513
- function j(i, u) {
1514
- return v(i, "warning", u);
1515
- }
1516
- function H(i, u) {
1517
- return v(i, "info", u);
1518
- }
1519
- function O(i) {
1520
- return p.value.filter((u) => u.type === i);
1521
- }
1522
- function d() {
1523
- return p.value[0] || null;
1524
- }
1525
- function s(i) {
1526
- return i ? p.value.some((u) => u.type === i) : p.value.length > 0;
1527
- }
1528
- const l = {
1529
- fileSizeExceeded: (i, u) => v(
1530
- `File "${i}" exceeds maximum size of ${(u / (1024 * 1024)).toFixed(1)}MB`,
1531
- "error",
1532
- { fileName: i, maxSize: u, category: "file-upload" }
1533
- ),
1534
- fileCountExceeded: (i) => v(
1535
- `Maximum file count of ${i} reached`,
1536
- "error",
1537
- { maxCount: i, category: "file-upload" }
1538
- ),
1539
- invalidFileType: (i, u) => v(
1540
- `File "${i}" type not allowed. Accepted types: ${u}`,
1541
- "error",
1542
- { fileName: i, allowedTypes: u, category: "file-upload" }
1543
- ),
1544
- uploadFailed: (i, u) => v(
1545
- `Failed to upload "${i}"${u ? `: ${u}` : ""}`,
1546
- "error",
1547
- { fileName: i, reason: u, category: "file-upload" }
1548
- ),
1549
- compressionFailed: (i) => v(
1550
- `Image compression failed for "${i}", using original file`,
1551
- "warning",
1552
- { fileName: i, category: "file-upload" }
1553
- )
1554
- };
1555
- return {
1556
- // State
1557
- errors: p,
1558
- isLoading: D,
1559
- // Methods
1560
- addError: v,
1561
- removeError: g,
1562
- clearErrors: U,
1563
- clearErrorsByType: y,
1564
- handleAsync: w,
1565
- validate: $,
1566
- showSuccess: T,
1567
- showWarning: j,
1568
- showInfo: H,
1569
- getErrorsByType: O,
1570
- getLatestError: d,
1571
- hasErrors: s,
1572
- // File upload specific
1573
- fileUploadErrors: l
1574
- };
1575
- }
1576
- function Ge(a) {
1577
- const n = ["simple", "thumbnail", "table"], e = { isValid: !0, errors: [], warnings: [] };
1578
- return typeof a != "string" ? (e.isValid = !1, e.errors.push("File uploader type must be a string")) : n.includes(a) || (e.isValid = !1, e.errors.push(`File uploader type must be one of: ${n.join(", ")}`)), e;
1579
- }
1580
- function Ye(a) {
1581
- const n = ["default", "outlined", "shaped", "raised", "tile"], e = { isValid: !0, errors: [], warnings: [] };
1582
- return a !== void 0 && typeof a != "string" ? (e.isValid = !1, e.errors.push("Card type must be a string")) : a && !n.includes(a) && (e.isValid = !1, e.errors.push(`Card type must be one of: ${n.join(", ")}`)), e;
1583
- }
1584
- function Xe(a) {
1585
- const n = ["en", "fa", "fr", "ch", "ar"], e = { isValid: !0, errors: [], warnings: [] };
1586
- return typeof a != "string" ? (e.isValid = !1, e.errors.push("Language code must be a string")) : n.includes(a) || (e.isValid = !1, e.errors.push(`Language code must be one of: ${n.join(", ")}`)), e;
1587
- }
1588
- function Ze(a) {
1589
- const n = { isValid: !0, errors: [], warnings: [] };
1590
- return typeof a != "number" ? (n.isValid = !1, n.errors.push("File size must be a number")) : a <= 0 ? (n.isValid = !1, n.errors.push("File size must be greater than 0")) : a > 100 * 1024 * 1024 && n.warnings.push("File size limit is very large (>100MB), consider reducing for better performance"), n;
1591
- }
1592
- function Je(a) {
1593
- const n = { isValid: !0, errors: [], warnings: [] };
1594
- return typeof a != "number" ? (n.isValid = !1, n.errors.push("File count must be a number")) : a < 0 ? (n.isValid = !1, n.errors.push("File count cannot be negative")) : a > 100 && n.warnings.push("File count limit is very high (>100), consider reducing for better performance"), n;
1595
- }
1596
- function Qe(a) {
1597
- const n = { isValid: !0, errors: [], warnings: [] };
1598
- return typeof a != "number" ? (n.isValid = !1, n.errors.push("Compression level must be a number")) : a < 0 || a > 1 ? (n.isValid = !1, n.errors.push("Compression level must be between 0 and 1")) : a < 0.1 ? n.warnings.push("Very low compression level may result in poor image quality") : a > 0.9 && n.warnings.push("Very high compression level may not reduce file size significantly"), n;
1599
- }
1600
- function et(a) {
1601
- const n = { isValid: !0, errors: [], warnings: [] };
1602
- return a !== void 0 && typeof a != "string" ? (n.isValid = !1, n.errors.push("File accept pattern must be a string")) : a && a.trim() === "" && n.warnings.push("Empty file accept pattern will accept all files"), n;
1603
- }
1604
- function tt(a) {
1605
- const n = { isValid: !0, errors: [], warnings: [] };
1606
- return typeof a != "number" ? (n.isValid = !1, n.errors.push("Columns count must be a number")) : (a < 1 || a > 12) && (n.isValid = !1, n.errors.push("Columns count must be between 1 and 12")), n;
1607
- }
1608
- function ot(a) {
1609
- const n = { isValid: !0, errors: [], warnings: [] };
1610
- return a !== void 0 && typeof a != "number" ? (n.isValid = !1, n.errors.push("Table height must be a number")) : a && a < 100 ? n.warnings.push("Table height is very small (<100px), content may not be visible") : a && a > 1e3 && n.warnings.push("Table height is very large (>1000px), consider reducing for better UX"), n;
1611
- }
1612
- function lt(a) {
1613
- const n = { isValid: !0, errors: [], warnings: [] };
1614
- return Array.isArray(a) ? (a.forEach((e, t) => {
1615
- if (!e || typeof e != "object") {
1616
- n.errors.push(`Attachment at index ${t} must be an object`);
1617
- return;
1618
- }
1619
- if (!e.file || typeof e.file != "object") {
1620
- n.errors.push(`Attachment at index ${t} must have a file property`);
1621
- return;
1622
- }
1623
- const p = e.file;
1624
- ["name", "format", "base64", "size"].forEach((L) => {
1625
- L in p || n.errors.push(`File at index ${t} is missing required field: ${L}`);
1626
- }), p.name && typeof p.name != "string" && n.errors.push(`File name at index ${t} must be a string`), p.format && typeof p.format != "string" && n.errors.push(`File format at index ${t} must be a string`), p.base64 && typeof p.base64 != "string" && n.errors.push(`File base64 at index ${t} must be a string`), p.size && typeof p.size != "number" && n.errors.push(`File size at index ${t} must be a number`), p.tags && !Array.isArray(p.tags) && n.errors.push(`File tags at index ${t} must be an array`);
1627
- }), n.errors.length > 0 && (n.isValid = !1), n) : (n.isValid = !1, n.errors.push("Document attachment must be an array"), n);
1628
- }
1629
- function it(a) {
1630
- const n = { isValid: !0, errors: [], warnings: [] };
1631
- return [
1632
- { key: "fileUploaderType", validator: Ge },
1633
- { key: "cardType", validator: Ye },
1634
- { key: "lang", validator: Xe },
1635
- { key: "maxFileSize", validator: Ze },
1636
- { key: "maxFileCount", validator: Je },
1637
- { key: "imageCompressLevel", validator: Qe },
1638
- { key: "fileAccept", validator: et },
1639
- { key: "cols", validator: tt },
1640
- { key: "tableHeight", validator: ot },
1641
- { key: "documentAttachment", validator: lt }
1642
- ].forEach(({ key: t, validator: p }) => {
1643
- if (t in a) {
1644
- const D = p(a[t]);
1645
- n.errors.push(...D.errors.map((L) => `${t}: ${L}`)), n.warnings.push(...D.warnings.map((L) => `${t}: ${L}`)), D.isValid || (n.isValid = !1);
1646
- }
1647
- }), n;
1648
- }
1649
- const ye = /* @__PURE__ */ te({
1650
- __name: "handyUploader",
1651
- props: {
1652
- documentAttachment: {},
1653
- lang: { default: "en" },
1654
- maxFileSize: { default: 5242880 },
1655
- fileUploaderType: { default: "thumbnail" },
1656
- maxFileCount: { default: 10 },
1657
- badgeCounter: { type: Boolean, default: !0 },
1658
- btnColor: { default: "info" },
1659
- imageCompressor: { type: Boolean },
1660
- imageCompressLevel: { default: 0.8 },
1661
- fileAccept: {},
1662
- thumb: { type: Boolean, default: !0 },
1663
- tableThumbColumn: { type: Boolean },
1664
- tableFixedHeader: { type: Boolean, default: !0 },
1665
- tableHeight: { default: 400 },
1666
- rtlSupport: { type: Boolean, default: !1 },
1667
- changeFileName: { type: Boolean, default: !1 },
1668
- addFileDescription: { type: Boolean, default: !1 },
1669
- addFileTag: { type: Boolean, default: !1 },
1670
- tags: {},
1671
- customLang: { default: null },
1672
- insertPermission: { type: Boolean, default: !0 },
1673
- cols: { default: 3 },
1674
- editPermission: { type: Boolean, default: !0 },
1675
- deletePermission: { type: Boolean, default: !0 },
1676
- cardType: { default: "default" },
1677
- outlined: { type: Boolean },
1678
- raised: { type: Boolean },
1679
- shaped: { type: Boolean },
1680
- tile: { type: Boolean }
1681
- },
1682
- emits: [
1683
- "updateCardType",
1684
- "updateBadgeCounter",
1685
- "updateMaxFileCount",
1686
- "updateMaxFileSize",
1687
- "updateImageCompressor",
1688
- "updateImageCompressLevel",
1689
- "updateFileAccept",
1690
- "updateThumb",
1691
- "updateChangeFileName",
1692
- "updateAddFileDescription",
1693
- "updateTableThumbColumn",
1694
- "updateTableFixedHeader",
1695
- "updateTableHeight",
1696
- "updateLang",
1697
- "updateDocumentAttachment"
1698
- ],
1699
- setup(a, { emit: n }) {
1700
- const e = a;
1701
- if (process.env.NODE_ENV === "development") {
1702
- const d = it(e);
1703
- d.isValid || console.error("HandyUploader prop validation failed:", d.errors), d.warnings.length > 0 && console.warn("HandyUploader prop validation warnings:", d.warnings);
1704
- }
1705
- const t = ge({
1706
- insertDocumentDialog: !1,
1707
- editDocumentDialog: !1,
1708
- deleteDocumentDialog: !1,
1709
- tempAttachment: [],
1710
- tempAttachmentChanged: [],
1711
- fileUploaderSnackBarAlert: !1,
1712
- fileUploaderSnackText: "",
1713
- fileUploaderSnackBarAlertColor: "green",
1714
- readerFile: null,
1715
- registryDocFile: [],
1716
- documentAttachmentAPI: [],
1717
- btnLoader: !1,
1718
- showDetail: !1,
1719
- showDetailState: [],
1720
- selectedIndex: 0,
1721
- selectedId: "",
1722
- returnedRecord: {},
1723
- outlined: !1,
1724
- raised: !1,
1725
- shaped: !1,
1726
- tile: !1,
1727
- selectedLang: {},
1728
- beforeInsertAttachments: {},
1729
- attachmentIndex: 0
1730
- }), p = n;
1731
- Ce(() => {
1732
- L(), t.registryDocFile = e.documentAttachment, e.rtlSupport && v(), g();
1733
- }), I(
1734
- () => t.tempAttachment,
1735
- (d) => {
1736
- d && d.length > 0 ? j(d) : t.tempAttachmentChanged = [];
1737
- }
1738
- ), I(() => e.cardType, (d) => {
1739
- p("updateCardType", d), g();
1740
- }), I(() => e.badgeCounter, (d) => {
1741
- p("updateBadgeCounter", d);
1742
- }), I(() => e.maxFileCount, (d) => {
1743
- p("updateMaxFileCount", d);
1744
- }), I(() => e.maxFileSize, (d) => {
1745
- p("updateMaxFileSize", d);
1746
- }), I(() => e.maxFileSize, (d) => {
1747
- p("updateMaxFileSize", d);
1748
- }), I(() => e.imageCompressor, (d) => {
1749
- p("updateImageCompressor", d);
1750
- }), I(() => e.imageCompressLevel, (d) => {
1751
- p("updateImageCompressLevel", d);
1752
- }), I(() => e.fileAccept, (d) => {
1753
- p("updateFileAccept", d);
1754
- }), I(() => e.thumb, (d) => {
1755
- p("updateThumb", d);
1756
- }), I(() => e.changeFileName, (d) => {
1757
- p("updateChangeFileName", d);
1758
- }), I(() => e.addFileDescription, (d) => {
1759
- p("updateAddFileDescription", d);
1760
- }), I(() => e.addFileTag, (d) => {
1761
- p("updateAddFileDescription", d);
1762
- }), I(() => e.tableThumbColumn, (d) => {
1763
- p("updateTableThumbColumn", d);
1764
- }), I(() => e.tableFixedHeader, (d) => {
1765
- p("updateTableFixedHeader", d);
1766
- }), I(() => e.tableHeight, (d) => {
1767
- p("updateTableHeight", d);
1768
- }), I(() => e.lang, (d) => {
1769
- p("updateLang", d);
1770
- }), ze(() => {
1771
- t.registryDocFile = [];
1772
- });
1773
- const D = () => {
1774
- t.btnLoader = !1, t.tempAttachment = [], t.insertDocumentDialog = !0;
1775
- }, L = () => {
1776
- e.customLang !== null ? t.selectedLang = e.customLang : t.selectedLang = qe;
1777
- }, v = () => {
1778
- }, g = () => {
1779
- const s = {
1780
- default: { outlined: !1, raised: !1, shaped: !1, tile: !1 },
1781
- outlined: { outlined: !0, raised: !1, shaped: !1, tile: !1 },
1782
- shaped: { outlined: !1, raised: !1, shaped: !0, tile: !1 },
1783
- raised: { outlined: !1, raised: !0, shaped: !1, tile: !1 },
1784
- tile: { outlined: !1, raised: !1, shaped: !1, tile: !0 }
1785
- }[e.cardType || "default"];
1786
- t.outlined = s.outlined, t.raised = s.raised, t.shaped = s.shaped, t.tile = s.tile;
1787
- }, U = (d) => {
1788
- let s = new FileReader();
1789
- return new Promise(function(l) {
1790
- s.onloadend = () => {
1791
- l(s.result);
1792
- }, s.readAsDataURL(d);
1793
- });
1794
- }, y = async () => {
1795
- t.btnLoader = !0;
1796
- const d = (s, l) => {
1797
- t.fileUploaderSnackText = s, t.fileUploaderSnackBarAlertColor = l, t.fileUploaderSnackBarAlert = !0;
1798
- };
1799
- for (const [s, l] of t.tempAttachmentChanged.entries()) {
1800
- if (e.documentAttachment.length >= e.maxFileCount) {
1801
- d(
1802
- `${t.selectedLang[e.lang].maxFileCountAlert} ${e.maxFileCount}`,
1803
- "red"
1804
- );
1805
- break;
1806
- }
1807
- if (l.file.size / 1e3 > e.maxFileSize) {
1808
- d(
1809
- `${t.selectedLang[e.lang].maxFileSizeAlert} ${Math.round(e.maxFileSize / 1024)} ${t.selectedLang[e.lang].size.mb}`,
1810
- "red"
1811
- );
1812
- continue;
1813
- }
1814
- let i = {}, u = {};
1815
- const m = l.file, k = m.format;
1816
- let S = !1, F = "", B = m.base64;
1817
- e.imageCompressor && ["image/png", "image/jpg", "image/jpeg", "image/webp"].includes(k) && (S = !0, F = await w(`data:${k};base64,${B}`), B = F.split(",")[1]);
1818
- try {
1819
- const M = B.replace(/\s/g, "");
1820
- i = {
1821
- base64: M,
1822
- size: S ? (atob(M).length / 1024).toFixed(1) : m.size.toString(),
1823
- name: `${m.name}.${m.format}`,
1824
- tags: m.tags || [],
1825
- description: m.description || "",
1826
- showDetailState: !1,
1827
- format: k
1828
- }, u.file = i, t.registryDocFile.push(u), p("updateDocumentAttachment", t.registryDocFile);
1829
- } catch (M) {
1830
- console.error("Error processing Base64 string:", M), d("File could not be processed due to an invalid format.", "red");
1831
- continue;
1832
- }
1833
- }
1834
- t.documentAttachmentAPI = [], t.tempAttachmentChanged = [], t.insertDocumentDialog = !1, t.btnLoader = !1;
1835
- }, w = (d) => {
1836
- const s = document.createElement("canvas"), l = document.createElement("img");
1837
- return new Promise((i, u) => {
1838
- let m = e.imageCompressLevel;
1839
- l.onload = function() {
1840
- let k = l.width, S = l.height;
1841
- s.width = k, s.height = S;
1842
- const F = s.getContext("2d");
1843
- F == null || F.drawImage(l, 0, 0, k, S), i(s.toDataURL("image/jpeg", m));
1844
- }, l.onerror = function(k) {
1845
- u(k);
1846
- }, l.src = d;
1847
- });
1848
- }, $ = (d, s) => {
1849
- t.btnLoader = !1, t.selectedIndex = d, t.selectedId = s, t.deleteDocumentDialog = !0;
1850
- }, T = () => {
1851
- t.registryDocFile.splice(t.selectedIndex, 1), p("updateDocumentAttachment", t.registryDocFile), t.deleteDocumentDialog = !1;
1852
- }, j = async (d) => {
1853
- for (let s of d) {
1854
- let l = "";
1855
- try {
1856
- l = await U(s);
1857
- } catch (m) {
1858
- console.log(m);
1859
- continue;
1860
- }
1861
- let u = { file: {
1862
- name: s.name.split(".")[0],
1863
- format: s.name.substr(s.name.lastIndexOf(".") + 1),
1864
- base64: l.split(",")[1],
1865
- // Remove data:mime;base64, prefix
1866
- size: s.size,
1867
- tags: [],
1868
- description: null,
1869
- showDetailState: !1
1870
- } };
1871
- t.tempAttachmentChanged.push(u);
1872
- }
1873
- }, H = (d, s) => {
1874
- t.btnLoader = !1, t.attachmentIndex = s, t.editDocumentDialog = !0, t.tempAttachmentChanged = [d];
1875
- }, O = () => {
1876
- const d = [...e.documentAttachment];
1877
- d.splice(
1878
- t.attachmentIndex,
1879
- 1,
1880
- t.tempAttachmentChanged[0]
1881
- ), p("updateDocumentAttachment", d), t.editDocumentDialog = !1;
1882
- };
1883
- return (d, s) => {
1884
- const l = f("v-col"), i = f("v-row"), u = f("v-icon"), m = f("v-card-title"), k = f("v-file-input"), S = f("v-expansion-panel-title"), F = f("v-text-field"), B = f("v-textarea"), M = f("v-autocomplete"), G = f("v-img"), E = f("v-card"), K = f("v-expansion-panel-text"), A = f("v-expansion-panel"), Y = f("v-expansion-panels"), q = f("v-list-item-title"), J = f("v-list-item"), oe = f("v-card-text"), C = f("v-btn"), Q = f("v-card-actions"), W = f("v-dialog"), le = f("v-snackbar"), we = f("v-spacer"), ke = f("v-container");
1885
- return c(), h(ke, null, {
1886
- default: o(() => [
1887
- r(i, null, {
1888
- default: o(() => [
1889
- r(l, {
1890
- cols: "12",
1891
- md: "12",
1892
- xs: "12"
1893
- }, {
1894
- default: o(() => [
1895
- r(pe, {
1896
- documentAttachment: e.documentAttachment,
1897
- selectedLang: t.selectedLang,
1898
- lang: e.lang,
1899
- badgeCounter: e.badgeCounter,
1900
- btnColor: e.btnColor,
1901
- maxFileCount: e.maxFileCount,
1902
- onOpenInputDocumentModal: D
1903
- }, null, 8, ["documentAttachment", "selectedLang", "lang", "badgeCounter", "btnColor", "maxFileCount"]),
1904
- e.fileUploaderType === "simple" ? (c(), h(me, {
1905
- key: 0,
1906
- documentAttachment: e.documentAttachment,
1907
- cols: e.cols,
1908
- thumb: e.thumb,
1909
- outlined: t.outlined,
1910
- raised: t.raised,
1911
- shaped: t.shaped,
1912
- tile: t.tile,
1913
- lang: e.lang,
1914
- cardType: e.cardType,
1915
- deletePermission: e.deletePermission,
1916
- editPermission: e.editPermission,
1917
- selectedLang: t.selectedLang,
1918
- onSetCardTheme: g,
1919
- onOpenDeleteDialog: $,
1920
- onOpenEditDocumentDialog: H
1921
- }, null, 8, ["documentAttachment", "cols", "thumb", "outlined", "raised", "shaped", "tile", "lang", "cardType", "deletePermission", "editPermission", "selectedLang"])) : z("", !0),
1922
- e.fileUploaderType === "thumbnail" ? (c(), h(ue, {
1923
- key: 1,
1924
- documentAttachment: e.documentAttachment,
1925
- cols: e.cols,
1926
- thumb: e.thumb,
1927
- outlined: t.outlined,
1928
- raised: t.raised,
1929
- shaped: t.shaped,
1930
- tile: t.tile,
1931
- lang: e.lang,
1932
- cardType: e.cardType,
1933
- deletePermission: e.deletePermission,
1934
- editPermission: e.editPermission,
1935
- selectedLang: t.selectedLang,
1936
- onSetCardTheme: g,
1937
- onOpenDeleteDialog: s[0] || (s[0] = (b, X) => $(b, X)),
1938
- onOpenEditDocumentDialog: s[1] || (s[1] = (b, X) => H(b, X))
1939
- }, null, 8, ["documentAttachment", "cols", "thumb", "outlined", "raised", "shaped", "tile", "lang", "cardType", "deletePermission", "editPermission", "selectedLang"])) : z("", !0),
1940
- e.fileUploaderType === "table" ? (c(), h(ce, {
1941
- key: 2,
1942
- documentAttachment: e.documentAttachment,
1943
- cols: e.cols,
1944
- thumb: e.thumb,
1945
- outlined: t.outlined,
1946
- raised: t.raised,
1947
- shaped: t.shaped,
1948
- tile: t.tile,
1949
- lang: e.lang,
1950
- tableThumbColumn: e.tableThumbColumn,
1951
- tableFixedHeader: e.tableFixedHeader,
1952
- tableHeight: e.tableHeight,
1953
- cardType: e.cardType,
1954
- deletePermission: e.deletePermission,
1955
- editPermission: e.editPermission,
1956
- selectedLang: t.selectedLang,
1957
- onSetCardTheme: g,
1958
- onOpenDeleteDialog: $,
1959
- onOpenEditDocumentDialog: H
1960
- }, null, 8, ["documentAttachment", "cols", "thumb", "outlined", "raised", "shaped", "tile", "lang", "tableThumbColumn", "tableFixedHeader", "tableHeight", "cardType", "deletePermission", "editPermission", "selectedLang"])) : z("", !0)
1961
- ]),
1962
- _: 1
1963
- })
1964
- ]),
1965
- _: 1
1966
- }),
1967
- r(i, { justify: "center" }, {
1968
- default: o(() => [
1969
- r(W, {
1970
- modelValue: t.insertDocumentDialog,
1971
- "onUpdate:modelValue": s[5] || (s[5] = (b) => t.insertDocumentDialog = b),
1972
- scrollable: !1,
1973
- persistent: "",
1974
- width: "50%"
1975
- }, {
1976
- default: o(() => [
1977
- r(E, null, {
1978
- default: o(() => [
1979
- r(m, null, {
1980
- default: o(() => [
1981
- r(u, {
1982
- onClick: s[2] || (s[2] = (b) => t.insertDocumentDialog = !1)
1983
- }, {
1984
- default: o(() => s[12] || (s[12] = [
1985
- _("mdi-close")
1986
- ])),
1987
- _: 1
1988
- })
1989
- ]),
1990
- _: 1
1991
- }),
1992
- r(oe, null, {
1993
- default: o(() => [
1994
- t.tempAttachment.length === 0 ? (c(), V(R, { key: 0 }, [
1995
- e.fileAccept !== "" ? (c(), h(k, {
1996
- key: 0,
1997
- multiple: "",
1998
- accept: e.fileAccept,
1999
- chip: "",
2000
- modelValue: t.tempAttachment,
2001
- "onUpdate:modelValue": s[3] || (s[3] = (b) => t.tempAttachment = b),
2002
- label: t.selectedLang[d.lang].insertNewFile
2003
- }, null, 8, ["accept", "modelValue", "label"])) : (c(), h(k, {
2004
- key: 1,
2005
- multiple: "",
2006
- modelValue: t.tempAttachment,
2007
- "onUpdate:modelValue": s[4] || (s[4] = (b) => t.tempAttachment = b),
2008
- label: t.selectedLang[d.lang].insertNewFile
2009
- }, null, 8, ["modelValue", "label"]))
2010
- ], 64)) : (c(), V(R, { key: 1 }, [
2011
- e.addFileTag || e.addFileDescription || e.changeFileName ? (c(), h(Y, { key: 0 }, {
2012
- default: o(() => [
2013
- (c(!0), V(R, null, Z(t.tempAttachmentChanged, (b, X) => (c(), h(A, {
2014
- key: `attachment-${X}`
2015
- }, {
2016
- default: o(() => [
2017
- r(S, null, {
2018
- default: o(() => [
2019
- _(x(b.file.name), 1)
2020
- ]),
2021
- _: 2
2022
- }, 1024),
2023
- r(K, null, {
2024
- default: o(() => [
2025
- r(i, {
2026
- align: "center",
2027
- justify: "center"
2028
- }, {
2029
- default: o(() => [
2030
- r(l, {
2031
- cols: "12",
2032
- lg: "9",
2033
- md: "9",
2034
- xs: "12"
2035
- }, {
2036
- default: o(() => [
2037
- e.changeFileName ? (c(), h(F, {
2038
- key: 0,
2039
- label: t.selectedLang[d.lang].fileName,
2040
- modelValue: b.file.name,
2041
- "onUpdate:modelValue": (N) => b.file.name = N
2042
- }, null, 8, ["label", "modelValue", "onUpdate:modelValue"])) : z("", !0),
2043
- e.addFileDescription ? (c(), h(B, {
2044
- key: 1,
2045
- label: t.selectedLang[d.lang].fileDescription,
2046
- "auto-grow": "",
2047
- "row-height": "1",
2048
- modelValue: b.file.description,
2049
- "onUpdate:modelValue": (N) => b.file.description = N
2050
- }, null, 8, ["label", "modelValue", "onUpdate:modelValue"])) : z("", !0),
2051
- e.addFileTag ? (c(), h(M, {
2052
- key: 2,
2053
- modelValue: b.file.tags,
2054
- "onUpdate:modelValue": (N) => b.file.tags = N,
2055
- items: e.tags,
2056
- dense: "",
2057
- chips: "",
2058
- label: t.selectedLang[d.lang].fileTags,
2059
- multiple: ""
2060
- }, null, 8, ["modelValue", "onUpdate:modelValue", "items", "label"])) : z("", !0)
2061
- ]),
2062
- _: 2
2063
- }, 1024),
2064
- r(l, {
2065
- align: "center",
2066
- cols: "12",
2067
- lg: "3",
2068
- md: "3",
2069
- xs: "12"
2070
- }, {
2071
- default: o(() => [
2072
- b.file.format === "jpg" || b.file.format === "jpeg" || b.file.format === "png" || b.file.format === "tif" || b.file.format === "bmp" ? (c(), h(E, { key: 0 }, {
2073
- default: o(() => [
2074
- r(G, {
2075
- src: "data:" + b.file.format + ";base64," + b.file.base64
2076
- }, null, 8, ["src"])
2077
- ]),
2078
- _: 2
2079
- }, 1024)) : (c(), h(ne, {
2080
- key: 1,
2081
- "file-format": b.file.format,
2082
- size: 60
2083
- }, null, 8, ["file-format"]))
2084
- ]),
2085
- _: 2
2086
- }, 1024)
2087
- ]),
2088
- _: 2
2089
- }, 1024)
2090
- ]),
2091
- _: 2
2092
- }, 1024)
2093
- ]),
2094
- _: 2
2095
- }, 1024))), 128))
2096
- ]),
2097
- _: 1
2098
- })) : (c(), h(E, {
2099
- key: 1,
2100
- class: "mx-auto",
2101
- tile: ""
2102
- }, {
2103
- default: o(() => [
2104
- (c(!0), V(R, null, Z(t.tempAttachmentChanged, (b, X) => (c(), h(J, {
2105
- key: `attachment-${X}`,
2106
- style: { "border-bottom": "1px solid #E0E0E0" }
2107
- }, {
2108
- default: o(() => [
2109
- r(q, null, {
2110
- default: o(() => [
2111
- r(ne, {
2112
- "file-format": b.file.format,
2113
- size: 24
2114
- }, null, 8, ["file-format"]),
2115
- _(" " + x(b.file.name) + "." + x(b.file.format), 1)
2116
- ]),
2117
- _: 2
2118
- }, 1024)
2119
- ]),
2120
- _: 2
2121
- }, 1024))), 128))
2122
- ]),
2123
- _: 1
2124
- }))
2125
- ], 64))
2126
- ]),
2127
- _: 1
2128
- }),
2129
- r(Q, null, {
2130
- default: o(() => [
2131
- r(C, {
2132
- disabled: t.tempAttachment == null || t.btnLoader,
2133
- loading: t.btnLoader,
2134
- color: e.btnColor,
2135
- onClick: y
2136
- }, {
2137
- default: o(() => [
2138
- _(x(t.selectedLang[d.lang].add), 1)
2139
- ]),
2140
- _: 1
2141
- }, 8, ["disabled", "loading", "color"])
2142
- ]),
2143
- _: 1
2144
- })
2145
- ]),
2146
- _: 1
2147
- })
2148
- ]),
2149
- _: 1
2150
- }, 8, ["modelValue"])
2151
- ]),
2152
- _: 1
2153
- }),
2154
- r(i, { justify: "center" }, {
2155
- default: o(() => [
2156
- r(W, {
2157
- modelValue: t.editDocumentDialog,
2158
- "onUpdate:modelValue": s[7] || (s[7] = (b) => t.editDocumentDialog = b),
2159
- scrollable: !1,
2160
- persistent: "",
2161
- width: "50%"
2162
- }, {
2163
- default: o(() => [
2164
- r(E, null, {
2165
- default: o(() => [
2166
- r(m, null, {
2167
- default: o(() => [
2168
- r(u, {
2169
- onClick: s[6] || (s[6] = (b) => t.editDocumentDialog = !1)
2170
- }, {
2171
- default: o(() => s[13] || (s[13] = [
2172
- _("mdi-close")
2173
- ])),
2174
- _: 1
2175
- })
2176
- ]),
2177
- _: 1
2178
- }),
2179
- (c(!0), V(R, null, Z(t.tempAttachmentChanged, (b, X) => (c(), h(oe, {
2180
- key: `attachment-${X}`
2181
- }, {
2182
- default: o(() => [
2183
- r(i, {
2184
- align: "center",
2185
- justify: "center"
2186
- }, {
2187
- default: o(() => [
2188
- r(l, {
2189
- cols: "12",
2190
- lg: "9",
2191
- md: "9",
2192
- xs: "12"
2193
- }, {
2194
- default: o(() => [
2195
- e.changeFileName ? (c(), h(F, {
2196
- key: 0,
2197
- label: t.selectedLang[d.lang].fileName,
2198
- modelValue: b.file.name,
2199
- "onUpdate:modelValue": (N) => b.file.name = N
2200
- }, null, 8, ["label", "modelValue", "onUpdate:modelValue"])) : z("", !0),
2201
- e.addFileDescription ? (c(), h(B, {
2202
- key: 1,
2203
- label: t.selectedLang[d.lang].fileDescription,
2204
- "auto-grow": "",
2205
- "row-height": "1",
2206
- modelValue: b.file.description,
2207
- "onUpdate:modelValue": (N) => b.file.description = N
2208
- }, null, 8, ["label", "modelValue", "onUpdate:modelValue"])) : z("", !0),
2209
- e.addFileTag ? (c(), h(M, {
2210
- key: 2,
2211
- modelValue: b.file.tags,
2212
- "onUpdate:modelValue": (N) => b.file.tags = N,
2213
- items: e.tags,
2214
- dense: "",
2215
- chips: "",
2216
- label: t.selectedLang[d.lang].fileTags,
2217
- multiple: ""
2218
- }, null, 8, ["modelValue", "onUpdate:modelValue", "items", "label"])) : z("", !0)
2219
- ]),
2220
- _: 2
2221
- }, 1024),
2222
- r(l, {
2223
- align: "center",
2224
- cols: "12",
2225
- lg: "3",
2226
- md: "3",
2227
- xs: "12"
2228
- }, {
2229
- default: o(() => {
2230
- var N;
2231
- return [
2232
- b.file.name && ["jpg", "jpeg", "png", "tif", "bmp"].includes(
2233
- ((N = b.file.name.split(".").pop()) == null ? void 0 : N.toLowerCase()) || ""
2234
- ) ? (c(), h(E, { key: 0 }, {
2235
- default: o(() => [
2236
- r(G, {
2237
- src: "data:" + b.file.format + ";base64," + b.file.base64
2238
- }, null, 8, ["src"])
2239
- ]),
2240
- _: 2
2241
- }, 1024)) : (c(), h(ne, {
2242
- key: 1,
2243
- "file-format": b.file.format,
2244
- size: 60
2245
- }, null, 8, ["file-format"]))
2246
- ];
2247
- }),
2248
- _: 2
2249
- }, 1024)
2250
- ]),
2251
- _: 2
2252
- }, 1024)
2253
- ]),
2254
- _: 2
2255
- }, 1024))), 128)),
2256
- r(Q, null, {
2257
- default: o(() => [
2258
- r(C, {
2259
- disabled: t.tempAttachment === null || t.btnLoader,
2260
- loading: t.btnLoader,
2261
- color: e.btnColor,
2262
- onClick: O
2263
- }, {
2264
- default: o(() => [
2265
- _(x(t.selectedLang[d.lang].edit), 1)
2266
- ]),
2267
- _: 1
2268
- }, 8, ["disabled", "loading", "color"])
2269
- ]),
2270
- _: 1
2271
- })
2272
- ]),
2273
- _: 1
2274
- })
2275
- ]),
2276
- _: 1
2277
- }, 8, ["modelValue"])
2278
- ]),
2279
- _: 1
2280
- }),
2281
- r(le, {
2282
- modelValue: t.fileUploaderSnackBarAlert,
2283
- "onUpdate:modelValue": s[9] || (s[9] = (b) => t.fileUploaderSnackBarAlert = b),
2284
- right: "",
2285
- bottom: "",
2286
- color: t.fileUploaderSnackBarAlertColor,
2287
- timeout: 3e3
2288
- }, {
2289
- default: o(() => [
2290
- _(x(t.fileUploaderSnackText) + " ", 1),
2291
- r(C, {
2292
- color: "white",
2293
- text: "",
2294
- onClick: s[8] || (s[8] = (b) => t.fileUploaderSnackBarAlert = !1)
2295
- }, {
2296
- default: o(() => [
2297
- r(u, null, {
2298
- default: o(() => s[14] || (s[14] = [
2299
- _("mdi-close")
2300
- ])),
2301
- _: 1
2302
- })
2303
- ]),
2304
- _: 1
2305
- })
2306
- ]),
2307
- _: 1
2308
- }, 8, ["modelValue", "color"]),
2309
- r(i, { justify: "center" }, {
2310
- default: o(() => [
2311
- r(W, {
2312
- modelValue: t.deleteDocumentDialog,
2313
- "onUpdate:modelValue": s[11] || (s[11] = (b) => t.deleteDocumentDialog = b),
2314
- persistent: "",
2315
- width: "30%"
2316
- }, {
2317
- default: o(() => [
2318
- r(E, null, {
2319
- default: o(() => [
2320
- r(m, null, {
2321
- default: o(() => [
2322
- r(u, { color: "red" })
2323
- ]),
2324
- _: 1
2325
- }),
2326
- r(oe, null, {
2327
- default: o(() => [
2328
- _(x(t.selectedLang[d.lang].deleteDialog.message), 1)
2329
- ]),
2330
- _: 1
2331
- }),
2332
- r(Q, null, {
2333
- default: o(() => [
2334
- r(we),
2335
- r(C, {
2336
- color: "green darken-1",
2337
- text: "",
2338
- onClick: s[10] || (s[10] = (b) => t.deleteDocumentDialog = !1)
2339
- }, {
2340
- default: o(() => [
2341
- _(x(t.selectedLang[d.lang].deleteDialog.cancel), 1)
2342
- ]),
2343
- _: 1
2344
- }),
2345
- r(C, {
2346
- color: "primary",
2347
- disabled: t.btnLoader,
2348
- loading: t.btnLoader,
2349
- onClick: T
2350
- }, {
2351
- default: o(() => [
2352
- _(x(t.selectedLang[d.lang].delete), 1)
2353
- ]),
2354
- _: 1
2355
- }, 8, ["disabled", "loading"])
2356
- ]),
2357
- _: 1
2358
- })
2359
- ]),
2360
- _: 1
2361
- })
2362
- ]),
2363
- _: 1
2364
- }, 8, ["modelValue"])
2365
- ]),
2366
- _: 1
2367
- })
2368
- ]),
2369
- _: 1
2370
- });
2371
- };
2372
- }
2373
- }), dt = {
2374
- ThumbnailUploader: ue,
2375
- TableUploader: ce,
2376
- SimpleUploader: me,
2377
- HandyUploader: ye,
2378
- InsertButton: pe,
2379
- SelectFileIconType: ne
2380
- };
2381
- function nt(a) {
2382
- a.component("ThumbnailUploader", ue), a.component("TableUploader", ce), a.component("SimpleUploader", me), a.component("HandyUploader", ye), a.component("InsertButton", pe), a.component("SelectFileIconType", ne);
2383
- }
2384
- typeof window < "u" && window.Vue && nt(window.Vue);
2385
- export {
2386
- ye as HandyUploader,
2387
- pe as InsertButton,
2388
- ne as SelectFileIconType,
2389
- me as SimpleUploader,
2390
- ce as TableUploader,
2391
- ue as ThumbnailUploader,
2392
- $e as compressImage,
2393
- Ve as constructImageDataUrl,
2394
- dt as default,
2395
- fe as fileToBase64,
2396
- de as formatFileSize,
2397
- Te as getFileIcon,
2398
- re as getFileType,
2399
- _e as getMimeTypeFromExtension,
2400
- nt as install,
2401
- be as isImageFile,
2402
- qe as languageData,
2403
- st as useErrorHandler,
2404
- rt as useFileUpload,
2405
- Le as validateFileCount,
2406
- Ae as validateFileSize
2407
- };