@fewangsit/wangsvue-fats 1.0.1-alpha.65 → 1.0.1-alpha.66
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/imagecompressor/index.es.js +108 -100
- package/package.json +1 -1
- package/stats.html +1 -1
- package/wangsvue-fats.esm.browser.js +3981 -3973
- package/wangsvue-fats.system.js +39 -39
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Ce, mergeModels as oe, inject as Be, onMounted as Pe, onUnmounted as Me, ref as w, shallowRef as A, useModel as Ue, reactive as Fe, computed as J, watch as N, createElementBlock as f, openBlock as n, Fragment as V, createVNode as m, normalizeClass as y, withCtx as O, createElementVNode as h, createCommentVNode as c, createBlock as I, renderList as ze, unref as S } from "vue";
|
|
2
2
|
import { g as Ae } from "../dialogprintqr/index.es.js";
|
|
3
3
|
import { r as Se } from "../vendor/base64toblob/base64toblob.es.js";
|
|
4
4
|
import { u as $e } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
|
|
5
5
|
import { f as Re } from "../vendor/vue-advanced-cropper/dist/index.esm-bundler.es.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import { g as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { _ as
|
|
11
|
-
import { _ as
|
|
12
|
-
import { _ as
|
|
13
|
-
import { _ as
|
|
6
|
+
import { u as De } from "../plugins/WangsVue.es.js";
|
|
7
|
+
import { g as Le, a as Ne } from "../utils/genPlaceholder.util.es.js";
|
|
8
|
+
import { _ as Ve } from "../image/index.es.js";
|
|
9
|
+
import { _ as $ } from "../button/index.es.js";
|
|
10
|
+
import { _ as Ee } from "../buttonradio/index.es.js";
|
|
11
|
+
import { _ as Te } from "../dialog/index.es.js";
|
|
12
|
+
import { _ as je } from "../dialogconfirm/index.es.js";
|
|
13
|
+
import { _ as Oe } from "../fieldwrapper/index.es.js";
|
|
14
14
|
import { _ as q } from "../icon/index.es.js";
|
|
15
|
-
import { _ as
|
|
16
|
-
import { _ as
|
|
17
|
-
import { B as
|
|
15
|
+
import { _ as qe } from "../invisiblefield/index.es.js";
|
|
16
|
+
import { _ as xe } from "../validatormessage/index.es.js";
|
|
17
|
+
import { B as Ke } from "../backgroundimagecropper/index.es.js";
|
|
18
18
|
import { _ as se } from "../imageinputinfo/index.es.js";
|
|
19
19
|
/* empty css */
|
|
20
|
-
var
|
|
21
|
-
const
|
|
20
|
+
var He = Se();
|
|
21
|
+
const We = /* @__PURE__ */ Ae(He), Ge = {
|
|
22
22
|
key: 1,
|
|
23
23
|
class: "flex gap-1 items-start"
|
|
24
|
-
},
|
|
24
|
+
}, Je = ["id", "multiple"], Qe = ["for"], fa = /* @__PURE__ */ Ce({
|
|
25
25
|
__name: "ImageCompressor",
|
|
26
|
-
props: /* @__PURE__ */
|
|
26
|
+
props: /* @__PURE__ */ oe({
|
|
27
27
|
initialName: {},
|
|
28
28
|
multiple: { type: Boolean },
|
|
29
29
|
defaultImage: {},
|
|
@@ -51,12 +51,12 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
51
51
|
defaultImage: { default: 0 },
|
|
52
52
|
defaultImageModifiers: {}
|
|
53
53
|
}),
|
|
54
|
-
emits: /* @__PURE__ */
|
|
55
|
-
setup(
|
|
56
|
-
const ue =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}),
|
|
54
|
+
emits: /* @__PURE__ */ oe(["apply", "applyProp", "update:defaultImage", "update:fieldValue", "delete"], ["update:defaultImage"]),
|
|
55
|
+
setup(Q, { expose: ie, emit: ne }) {
|
|
56
|
+
const ue = Be("preset", {}).image, l = Q, k = ne, { locale: E } = De("ImageCompressor");
|
|
57
|
+
Pe(async () => {
|
|
58
|
+
ge(), M();
|
|
59
|
+
}), Me(() => {
|
|
60
60
|
F(0), F(1);
|
|
61
61
|
});
|
|
62
62
|
const v = w([
|
|
@@ -68,12 +68,19 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
68
68
|
src: null,
|
|
69
69
|
type: null
|
|
70
70
|
}
|
|
71
|
-
]), me =
|
|
71
|
+
]), me = Ne(), x = w(), C = w(), s = w([]), X = w(), Y = A(0), K = w(), R = w(), d = A(), T = Ue(Q, "defaultImage"), i = Fe({
|
|
72
72
|
value: l.multiple ? [] : void 0
|
|
73
|
-
}), B =
|
|
73
|
+
}), B = A(!1), b = A(), de = A(0), g = A(!1), H = w([!1, !1]), P = J(() => `image/${l.fileType}`), W = (e) => typeof s.value[e] == "string" && s.value[e].includes("data:image/png;base64"), pe = J(() => {
|
|
74
|
+
const e = {
|
|
75
|
+
big: 125,
|
|
76
|
+
medium: 80,
|
|
77
|
+
small: 30
|
|
78
|
+
};
|
|
79
|
+
return l.type === "inline-table" ? e.small : e[l.imagePreviewSize] || e.small;
|
|
80
|
+
}), M = async () => {
|
|
74
81
|
var e, a;
|
|
75
|
-
(e = l.imagePreviewUrl) != null && e.length ? s.value = Array.isArray(l.imagePreviewUrl) ? l.imagePreviewUrl : [l.imagePreviewUrl] : Array.isArray(l.compressedBlob) ? s.value = l.compressedBlob : l.compressedBlob ? s.value = [l.compressedBlob] : l.initialName ? (x.value =
|
|
76
|
-
},
|
|
82
|
+
(e = l.imagePreviewUrl) != null && e.length ? s.value = Array.isArray(l.imagePreviewUrl) ? l.imagePreviewUrl : [l.imagePreviewUrl] : Array.isArray(l.compressedBlob) ? s.value = l.compressedBlob : l.compressedBlob ? s.value = [l.compressedBlob] : l.initialName ? (x.value = Le(l.initialName, 125, me), s.value = [(a = x.value) == null ? void 0 : a.toDataURL()]) : s.value = [], l.imagePreviewUrl ? i.value = l.imagePreviewUrl : l.initialName && (i.value = await ce()), k("applyProp");
|
|
83
|
+
}, ce = async () => new Promise((e) => {
|
|
77
84
|
var a;
|
|
78
85
|
(a = x.value) == null || a.toBlob((r) => {
|
|
79
86
|
e(
|
|
@@ -84,8 +91,8 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
84
91
|
});
|
|
85
92
|
}), U = (e = !1) => {
|
|
86
93
|
var a;
|
|
87
|
-
l.disabled || (e && (d.value = 1), (a =
|
|
88
|
-
},
|
|
94
|
+
l.disabled || (e && (d.value = 1), (a = X.value) == null || a.click());
|
|
95
|
+
}, ve = async (e) => {
|
|
89
96
|
const { files: a } = e.target, r = Array.from(a ?? []).slice(
|
|
90
97
|
0,
|
|
91
98
|
s.value.length ? 1 : 2
|
|
@@ -93,37 +100,37 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
93
100
|
for (const [t, u] of r.entries())
|
|
94
101
|
try {
|
|
95
102
|
const o = d.value ?? t;
|
|
96
|
-
await
|
|
103
|
+
await fe(u, o);
|
|
97
104
|
} catch (o) {
|
|
98
105
|
console.error("Error loading image:", o);
|
|
99
106
|
} finally {
|
|
100
107
|
d.value = void 0;
|
|
101
108
|
}
|
|
102
|
-
},
|
|
109
|
+
}, fe = async (e, a) => {
|
|
103
110
|
const r = (u) => u.includes("image"), t = (u) => u > 1e6;
|
|
104
111
|
return new Promise((u, o) => {
|
|
105
|
-
var D,
|
|
112
|
+
var D, z;
|
|
106
113
|
if (e)
|
|
107
|
-
if (
|
|
114
|
+
if (Z(a), !r(e.type))
|
|
108
115
|
B.value = !0, b.value = typeof l.validatorMessage != "string" && ((D = l.validatorMessage) != null && D.invalidFormat) ? l.validatorMessage.invalidFormat : "Tipe file harus berupa gambar!", M(), g.value = !1, F(a), o("Tipe file harus berupa gambar!");
|
|
109
116
|
else if (t(e.size))
|
|
110
|
-
B.value = !0, b.value = typeof l.validatorMessage != "string" && ((
|
|
117
|
+
B.value = !0, b.value = typeof l.validatorMessage != "string" && ((z = l.validatorMessage) != null && z.exceed) ? l.validatorMessage.exceed : "Ukuran gambar terlalu besar! Maks. 1 MB", M(), g.value = !1, F(a), o("Ukuran gambar terlalu besar! Maks. 1 MB");
|
|
111
118
|
else {
|
|
112
119
|
F(a);
|
|
113
120
|
const j = URL.createObjectURL(e), p = new FileReader();
|
|
114
121
|
p.onload = (L) => {
|
|
115
|
-
var
|
|
116
|
-
v.value[a].src = j, v.value[a].type =
|
|
117
|
-
(
|
|
122
|
+
var re;
|
|
123
|
+
v.value[a].src = j, v.value[a].type = ye(
|
|
124
|
+
(re = L == null ? void 0 : L.target) == null ? void 0 : re.result,
|
|
118
125
|
e.type
|
|
119
126
|
);
|
|
120
127
|
}, p.onerror = (L) => {
|
|
121
128
|
console.error("🚀 ~ returnnewPromise ~ e:", L);
|
|
122
129
|
}, p.readAsArrayBuffer(e), d.value == null && (d.value = a), g.value || (g.value = !0), B.value = !1, b.value = void 0;
|
|
123
130
|
}
|
|
124
|
-
de.value += 1,
|
|
131
|
+
de.value += 1, R.value = u;
|
|
125
132
|
});
|
|
126
|
-
},
|
|
133
|
+
}, ge = () => {
|
|
127
134
|
l.useValidator && Object.assign(
|
|
128
135
|
i,
|
|
129
136
|
$e(l.fieldName, (e) => {
|
|
@@ -131,12 +138,12 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
131
138
|
return !e && l.mandatory ? typeof l.validatorMessage != "string" && ((a = l.validatorMessage) != null && a.empty) ? l.validatorMessage.empty : (l.label ?? "Photo") + " must be uploaded" : l.invalid && l.validatorMessage ? l.validatorMessage : b.value ? b.value : !0;
|
|
132
139
|
})
|
|
133
140
|
);
|
|
134
|
-
},
|
|
141
|
+
}, Z = (e) => {
|
|
135
142
|
v.value[e] = {
|
|
136
143
|
src: null,
|
|
137
144
|
type: null
|
|
138
145
|
};
|
|
139
|
-
},
|
|
146
|
+
}, ye = (e, a = null) => {
|
|
140
147
|
if (e) {
|
|
141
148
|
const r = new Uint8Array(e).subarray(0, 4);
|
|
142
149
|
let t = "";
|
|
@@ -158,45 +165,45 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
158
165
|
}
|
|
159
166
|
}
|
|
160
167
|
return null;
|
|
161
|
-
},
|
|
162
|
-
const a =
|
|
168
|
+
}, _ = (e) => {
|
|
169
|
+
const a = We(e.split(",")[1], P.value);
|
|
163
170
|
return window.URL.createObjectURL(a);
|
|
164
|
-
},
|
|
171
|
+
}, be = async (e, a) => {
|
|
165
172
|
const r = await fetch(e).then((t) => t.blob());
|
|
166
173
|
return new File([r], a, { type: P.value });
|
|
167
|
-
},
|
|
174
|
+
}, we = async () => {
|
|
168
175
|
const e = d.value ?? 0;
|
|
169
176
|
try {
|
|
170
|
-
await
|
|
177
|
+
await he(e);
|
|
171
178
|
} catch (a) {
|
|
172
179
|
console.error(a);
|
|
173
180
|
}
|
|
174
|
-
|
|
175
|
-
},
|
|
181
|
+
ee();
|
|
182
|
+
}, ee = () => {
|
|
176
183
|
var e;
|
|
177
|
-
g.value = !1, (e =
|
|
178
|
-
},
|
|
184
|
+
g.value = !1, (e = R.value) == null || e.call(R), R.value = void 0;
|
|
185
|
+
}, he = async (e) => {
|
|
179
186
|
if (K.value) {
|
|
180
187
|
const a = K.value.getResult();
|
|
181
188
|
if (a.canvas) {
|
|
182
189
|
const r = a.canvas.toDataURL(P.value);
|
|
183
|
-
await
|
|
190
|
+
await Ie(r, e);
|
|
184
191
|
}
|
|
185
192
|
}
|
|
186
|
-
},
|
|
193
|
+
}, Ie = async (e, a) => {
|
|
187
194
|
try {
|
|
188
195
|
C.value = document.createElement("canvas");
|
|
189
196
|
const r = C.value.getContext("2d"), t = new Image();
|
|
190
197
|
t.src = e, await t.decode();
|
|
191
198
|
const u = 80 / 100, o = t.width * u, D = t.height * u;
|
|
192
199
|
C.value.setAttribute("width", o.toString()), C.value.setAttribute("height", D.toString()), r && r.drawImage(t, 0, 0, o, D);
|
|
193
|
-
const
|
|
200
|
+
const z = C.value.toDataURL(P.value, 0.95), j = Date.now() + `.${l.fileType}`, p = {
|
|
194
201
|
canvas: C.value,
|
|
195
202
|
compressed: {
|
|
196
|
-
blob:
|
|
197
|
-
base64:
|
|
203
|
+
blob: _(z),
|
|
204
|
+
base64: z,
|
|
198
205
|
fileName: j,
|
|
199
|
-
file: await
|
|
206
|
+
file: await be(_(z), j),
|
|
200
207
|
size: "",
|
|
201
208
|
type: P.value
|
|
202
209
|
},
|
|
@@ -208,17 +215,17 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
208
215
|
}
|
|
209
216
|
}, F = (e) => {
|
|
210
217
|
v.value[e].src && URL.revokeObjectURL(v.value[e].src);
|
|
211
|
-
},
|
|
218
|
+
}, ae = (e) => {
|
|
212
219
|
l.confirmOnDelete ? H.value[e] = !0 : l.emitDeleteFn ? k("delete", G, e) : G(e);
|
|
213
220
|
}, G = (e = 0) => {
|
|
214
221
|
B.value = !1, b.value = void 0, s.value = s.value.toSpliced(e, 1), F(e), v.value[e] = { src: null, type: null }, v.value = [v.value[+!e], v.value[e]], d.value = 0, T.value = 0, l.confirmOnDelete || k("delete"), l.multiple && Array.isArray(i.value) ? i.value = i.value.toSpliced(e, 1) : i.handleReset && i.handleReset();
|
|
215
|
-
},
|
|
222
|
+
}, le = (e) => {
|
|
216
223
|
var r;
|
|
217
224
|
const a = (r = s.value[e]) == null ? void 0 : r.toString();
|
|
218
|
-
d.value = e, a != null && a.includes("blob") ? (d.value = e, g.value = !0) : (
|
|
219
|
-
},
|
|
225
|
+
d.value = e, a != null && a.includes("blob") ? (d.value = e, g.value = !0) : (Z(e), U());
|
|
226
|
+
}, ke = () => {
|
|
220
227
|
U();
|
|
221
|
-
},
|
|
228
|
+
}, te = J(() => navigator.userAgent.includes("Chrome"));
|
|
222
229
|
return N(
|
|
223
230
|
() => i.value,
|
|
224
231
|
(e) => {
|
|
@@ -227,7 +234,7 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
227
234
|
), N(b, (e) => {
|
|
228
235
|
e && i.setErrors && i.setErrors(e);
|
|
229
236
|
}), N(g, (e) => {
|
|
230
|
-
e ||
|
|
237
|
+
e || Y.value++;
|
|
231
238
|
}), N(
|
|
232
239
|
() => l.initialName,
|
|
233
240
|
() => {
|
|
@@ -240,7 +247,7 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
240
247
|
},
|
|
241
248
|
{ once: !0 }
|
|
242
249
|
), ie({ assignPreviewImagesFromProp: M }), (e, a) => (n(), f(V, null, [
|
|
243
|
-
m(
|
|
250
|
+
m(Oe, {
|
|
244
251
|
class: y([{ "!w-max": !l.multiple, "!w-full": l.multiple }]),
|
|
245
252
|
info: l.fieldInfo,
|
|
246
253
|
label: l.label,
|
|
@@ -259,7 +266,7 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
259
266
|
]),
|
|
260
267
|
"data-wv-section": "wrapper"
|
|
261
268
|
}, [
|
|
262
|
-
s.value.length ? (n(!0), f(V, { key: 0 },
|
|
269
|
+
s.value.length ? (n(!0), f(V, { key: 0 }, ze(s.value, (r, t) => {
|
|
263
270
|
var u;
|
|
264
271
|
return n(), f("div", {
|
|
265
272
|
key: t,
|
|
@@ -292,17 +299,18 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
292
299
|
]),
|
|
293
300
|
"data-wv-section": "image-wrapper"
|
|
294
301
|
}, [
|
|
295
|
-
m(
|
|
302
|
+
m(Ve, {
|
|
296
303
|
class: y([{ "w-[30px] h-[30px]": e.type === "inline-table" }, "transition-opacity duration-300"]),
|
|
297
304
|
rounded: e.rounded,
|
|
298
|
-
size: e.type === "normal" ? e.imagePreviewSize : "small",
|
|
299
305
|
src: r,
|
|
306
|
+
"thumbnail-size": pe.value,
|
|
307
|
+
"use-default-size": !1,
|
|
300
308
|
"data-wv-section": "preview-image"
|
|
301
|
-
}, null, 8, ["class", "rounded", "
|
|
309
|
+
}, null, 8, ["class", "rounded", "src", "thumbnail-size"]),
|
|
302
310
|
W(t) ? (n(), f("button", {
|
|
303
311
|
key: 0,
|
|
304
312
|
class: y([
|
|
305
|
-
(u =
|
|
313
|
+
(u = S(ue)) == null ? void 0 : u.button.class,
|
|
306
314
|
"hover:bg-opacity-0 rounded-lg opacity-0"
|
|
307
315
|
]),
|
|
308
316
|
onClick: a[0] || (a[0] = (o) => U(!1)),
|
|
@@ -326,16 +334,16 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
326
334
|
"data-wv-section": "preview-buttons"
|
|
327
335
|
}, [
|
|
328
336
|
e.type === "normal" ? (n(), f(V, { key: 0 }, [
|
|
329
|
-
m(
|
|
330
|
-
onClick: (o) =>
|
|
337
|
+
m($, {
|
|
338
|
+
onClick: (o) => le(t),
|
|
331
339
|
class: "!py-0 !px-1 !h-max",
|
|
332
340
|
icon: "pencil",
|
|
333
341
|
label: "Edit",
|
|
334
342
|
text: ""
|
|
335
343
|
}, null, 8, ["onClick"]),
|
|
336
|
-
e.useDeleteButton ? (n(), I(
|
|
344
|
+
e.useDeleteButton ? (n(), I($, {
|
|
337
345
|
key: 0,
|
|
338
|
-
onClick: (o) =>
|
|
346
|
+
onClick: (o) => ae(t),
|
|
339
347
|
class: "!py-0 !px-1 !h-max",
|
|
340
348
|
icon: "delete-bin",
|
|
341
349
|
label: "Delete",
|
|
@@ -344,20 +352,20 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
344
352
|
}, null, 8, ["onClick"])) : c("", !0)
|
|
345
353
|
], 64)) : (n(), f(V, { key: 1 }, [
|
|
346
354
|
m(q, {
|
|
347
|
-
onClick: (o) =>
|
|
355
|
+
onClick: (o) => le(t),
|
|
348
356
|
class: "text-xs p-0.5 rounded-xs mr-1",
|
|
349
357
|
icon: "pencil",
|
|
350
358
|
severity: "primary"
|
|
351
359
|
}, null, 8, ["onClick"]),
|
|
352
360
|
m(q, {
|
|
353
|
-
onClick: (o) =>
|
|
361
|
+
onClick: (o) => ae(t),
|
|
354
362
|
class: "text-xs p-0.5 rounded-xs",
|
|
355
363
|
icon: "delete-bin",
|
|
356
364
|
severity: "danger"
|
|
357
365
|
}, null, 8, ["onClick"])
|
|
358
366
|
], 64))
|
|
359
367
|
], 2),
|
|
360
|
-
m(
|
|
368
|
+
m(je, {
|
|
361
369
|
visible: H.value[t],
|
|
362
370
|
"onUpdate:visible": (o) => H.value[t] = o,
|
|
363
371
|
closable: !1,
|
|
@@ -377,7 +385,7 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
377
385
|
onAddPhoto: a[2] || (a[2] = (o) => U(!0))
|
|
378
386
|
}, {
|
|
379
387
|
default: O(() => [
|
|
380
|
-
s.value.length === 2 && l.multiple ? (n(), I(
|
|
388
|
+
s.value.length === 2 && l.multiple ? (n(), I(Ee, {
|
|
381
389
|
key: 0,
|
|
382
390
|
modelValue: T.value,
|
|
383
391
|
"onUpdate:modelValue": a[1] || (a[1] = (o) => T.value = o),
|
|
@@ -388,7 +396,7 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
388
396
|
]),
|
|
389
397
|
_: 2
|
|
390
398
|
}, 1032, ["custom-requirements", "show-add-button", "show-info"])) : c("", !0),
|
|
391
|
-
e.multiple && s.value.length == 1 && e.type === "inline-table" ? (n(), I(
|
|
399
|
+
e.multiple && s.value.length == 1 && e.type === "inline-table" ? (n(), I($, {
|
|
392
400
|
key: 1,
|
|
393
401
|
onClick: a[3] || (a[3] = (o) => U(!0)),
|
|
394
402
|
icon: "add",
|
|
@@ -396,7 +404,7 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
396
404
|
text: ""
|
|
397
405
|
})) : c("", !0)
|
|
398
406
|
], 2);
|
|
399
|
-
}), 128)) : e.type != "inline-table" ? (n(), f("div",
|
|
407
|
+
}), 128)) : e.type != "inline-table" ? (n(), f("div", Ge, [
|
|
400
408
|
h("button", {
|
|
401
409
|
class: y([
|
|
402
410
|
{
|
|
@@ -408,8 +416,8 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
408
416
|
"ring-inset",
|
|
409
417
|
"cursor-pointer",
|
|
410
418
|
{
|
|
411
|
-
"ring-1": !
|
|
412
|
-
"ring-[0.5px]":
|
|
419
|
+
"ring-1": !te.value,
|
|
420
|
+
"ring-[0.5px]": te.value
|
|
413
421
|
},
|
|
414
422
|
{ "rounded-full": e.rounded, "rounded-lg": !e.rounded },
|
|
415
423
|
{
|
|
@@ -440,16 +448,16 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
440
448
|
], 2),
|
|
441
449
|
(n(), f("input", {
|
|
442
450
|
id: e.fieldName,
|
|
443
|
-
key:
|
|
451
|
+
key: Y.value,
|
|
444
452
|
ref_key: "inputImageFile",
|
|
445
|
-
ref:
|
|
453
|
+
ref: X,
|
|
446
454
|
multiple: l.multiple && !s.value.length,
|
|
447
|
-
onChange:
|
|
455
|
+
onChange: ve,
|
|
448
456
|
accept: "image/*",
|
|
449
457
|
class: "hidden",
|
|
450
458
|
"data-wv-section": "hidden-image-input",
|
|
451
459
|
type: "file"
|
|
452
|
-
}, null, 40,
|
|
460
|
+
}, null, 40, Je)),
|
|
453
461
|
e.type === "inline-table" && !s.value.length ? (n(), f("label", {
|
|
454
462
|
key: 0,
|
|
455
463
|
for: e.fieldName,
|
|
@@ -457,13 +465,13 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
457
465
|
}, a[6] || (a[6] = [
|
|
458
466
|
h("span", { class: "inline-flex items-center text-body-medium rounded-bl rounded-tl bg-general-50 px-3 h-[26px] border-[0.5px] border-general-200" }, " Browse ", -1),
|
|
459
467
|
h("span", { class: "inline-flex items-center text-body-medium !text-general-200 !font-light rounded-br rounded-tr px-3 h-[26px] leading-4 border-[0.5px] border-l-0 border-general-200" }, " Select File ", -1)
|
|
460
|
-
]), 8,
|
|
461
|
-
e.showValidatorMessage ? (n(), I(
|
|
468
|
+
]), 8, Qe)) : c("", !0),
|
|
469
|
+
e.showValidatorMessage ? (n(), I(xe, {
|
|
462
470
|
key: 1,
|
|
463
471
|
format: !1,
|
|
464
472
|
message: i.errorMessage ?? b.value
|
|
465
473
|
}, null, 8, ["message"])) : c("", !0),
|
|
466
|
-
l.multiple ? (n(), I(
|
|
474
|
+
l.multiple ? (n(), I(qe, {
|
|
467
475
|
key: 2,
|
|
468
476
|
value: T.value ? "secondImage" : "firstImage",
|
|
469
477
|
"field-name": "defaultImage"
|
|
@@ -471,11 +479,11 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
471
479
|
]),
|
|
472
480
|
_: 1
|
|
473
481
|
}, 8, ["class", "info", "label", "mandatory"]),
|
|
474
|
-
m(
|
|
482
|
+
m(Te, {
|
|
475
483
|
visible: g.value,
|
|
476
484
|
"onUpdate:visible": a[5] || (a[5] = (r) => g.value = r),
|
|
477
485
|
draggable: !1,
|
|
478
|
-
header:
|
|
486
|
+
header: S(E).cropDialogHeader,
|
|
479
487
|
class: "w-max max-w-[98vw] min-w-[min(500px,98vw)] !max-h-[94vh]",
|
|
480
488
|
"content-class": "overflow-hidden overflow-y-auto min-h-[100px]",
|
|
481
489
|
"data-wv-section": "dialog-cropper",
|
|
@@ -483,36 +491,36 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
483
491
|
modal: ""
|
|
484
492
|
}, {
|
|
485
493
|
footer: O(() => [
|
|
486
|
-
m(
|
|
487
|
-
label:
|
|
488
|
-
onClick:
|
|
494
|
+
m($, {
|
|
495
|
+
label: S(E).cancelCropLabel,
|
|
496
|
+
onClick: ee,
|
|
489
497
|
"data-wv-section": "cancel-crop",
|
|
490
498
|
severity: "secondary",
|
|
491
499
|
text: "",
|
|
492
500
|
type: "button"
|
|
493
501
|
}, null, 8, ["label"]),
|
|
494
|
-
m(
|
|
495
|
-
label:
|
|
496
|
-
onClick:
|
|
502
|
+
m($, {
|
|
503
|
+
label: S(E).changeImageLabel,
|
|
504
|
+
onClick: ke,
|
|
497
505
|
"data-wv-section": "change-image-button",
|
|
498
506
|
text: "",
|
|
499
507
|
type: "button"
|
|
500
508
|
}, null, 8, ["label"]),
|
|
501
|
-
m(
|
|
502
|
-
label:
|
|
503
|
-
onClick:
|
|
509
|
+
m($, {
|
|
510
|
+
label: S(E).applyCropLabel,
|
|
511
|
+
onClick: we,
|
|
504
512
|
"data-wv-section": "apply-image-button",
|
|
505
513
|
severity: "success",
|
|
506
514
|
type: "button"
|
|
507
515
|
}, null, 8, ["label"])
|
|
508
516
|
]),
|
|
509
517
|
default: O(() => [
|
|
510
|
-
d.value != null ? (n(), I(
|
|
518
|
+
d.value != null ? (n(), I(S(Re), {
|
|
511
519
|
key: 0,
|
|
512
520
|
ref_key: "vueAdvanceCropper",
|
|
513
521
|
ref: K,
|
|
514
522
|
"auto-zoom": !1,
|
|
515
|
-
"background-wrapper-component":
|
|
523
|
+
"background-wrapper-component": Ke,
|
|
516
524
|
src: v.value[d.value].src,
|
|
517
525
|
class: "upload-example-cropper h-400",
|
|
518
526
|
"foreground-class": "h-400",
|
|
@@ -525,5 +533,5 @@ const He = /* @__PURE__ */ Ae(Ke), We = {
|
|
|
525
533
|
}
|
|
526
534
|
});
|
|
527
535
|
export {
|
|
528
|
-
|
|
536
|
+
fa as _
|
|
529
537
|
};
|