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