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