@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.
Files changed (78) hide show
  1. package/animation/index.es.js +9 -8
  2. package/assetinfo/index.d.ts +5 -4
  3. package/assetinfo/index.es.js +113 -97
  4. package/backgroundimagecropper/index.es.js +14 -12
  5. package/button/index.es.js +58 -48
  6. package/buttonbulkaction/index.es.js +67 -59
  7. package/buttondownload/index.es.js +18 -18
  8. package/buttonradio/index.es.js +11 -11
  9. package/buttonscan/index.es.js +1 -1
  10. package/buttonsearch/index.es.js +14 -14
  11. package/buttonselectuser/index.es.js +29 -29
  12. package/checkbox/index.es.js +5 -5
  13. package/config/defaultProps.es.js +3 -4
  14. package/datatable/index.es.js +470 -465
  15. package/datepicker/index.es.js +17 -17
  16. package/daypicker/index.es.js +21 -21
  17. package/dialog/index.es.js +17 -15
  18. package/dialogbasictransferlog/index.es.js +89 -89
  19. package/dialogconfirm/index.es.js +33 -33
  20. package/dialogdamagelog/index.es.js +89 -89
  21. package/dialogform/index.es.js +16 -16
  22. package/dialogfulltransferlog/index.es.js +96 -96
  23. package/dialoglinkedasset/index.es.js +48 -48
  24. package/dialogprintqr/index.es.js +70 -70
  25. package/dialogreportdamage/index.es.js +57 -57
  26. package/dialogreportmissing/index.es.js +94 -86
  27. package/dialogselecttree/index.es.js +18 -16
  28. package/dialogselectuser/index.es.js +16 -16
  29. package/directives/index.d.ts +1 -0
  30. package/directives/index.es.js +1 -0
  31. package/directives/safeHtml.d.ts +16 -0
  32. package/directives/safeHtml.es.js +12 -0
  33. package/disposalreport/index.es.js +1 -1
  34. package/disposalreportbulkaction/index.es.js +40 -41
  35. package/disposalreportdialogselectasset/index.es.js +72 -72
  36. package/disposalreporttable/index.es.js +108 -108
  37. package/disposalreporttablefilter/index.es.js +16 -17
  38. package/dropdown/index.es.js +120 -117
  39. package/fieldwrapper/index.es.js +7 -7
  40. package/fileupload/index.es.js +35 -31
  41. package/hardwaresync/index.es.js +12 -12
  42. package/headercell/index.es.js +4 -4
  43. package/icon/index.es.js +26 -25
  44. package/imagecompressor/index.es.js +143 -143
  45. package/imageinputinfo/index.es.js +13 -13
  46. package/inlinemessage/index.es.js +12 -12
  47. package/inputbadge/index.es.js +42 -43
  48. package/inputnumber/index.es.js +7 -7
  49. package/inputpassword/index.es.js +9 -9
  50. package/inputrangenumber/index.es.js +16 -16
  51. package/inputsearch/index.es.js +18 -18
  52. package/inputtext/index.es.js +33 -33
  53. package/litedropdown/index.es.js +48 -40
  54. package/menuitem/index.es.js +27 -26
  55. package/multirow/index.es.js +16 -16
  56. package/multiselect/index.es.js +86 -83
  57. package/package.json +1 -1
  58. package/plugins/basei18n.d.ts +2 -2
  59. package/plugins/basei18n.es.js +48 -42
  60. package/stats.html +1 -1
  61. package/style.css +1 -1
  62. package/tabmenu/index.es.js +14 -9
  63. package/tagtype/index.es.js +33 -30
  64. package/textarea/index.es.js +3 -3
  65. package/toggledarkmode/store/index.d.ts +7 -0
  66. package/toggleswitch/index.es.js +3 -3
  67. package/treesearchinput/index.es.js +11 -11
  68. package/username/index.es.js +39 -39
  69. package/utils/baseToast.util.es.js +23 -22
  70. package/utils/index.es.js +1 -2
  71. package/utils/textFormatter.util.d.ts +32 -0
  72. package/utils/textFormatter.util.es.js +38 -10
  73. package/validatormessage/index.es.js +1 -1
  74. package/vendor/dompurify/dist/purify.es.es.js +553 -0
  75. package/wangsvue-fats.d.ts +2 -1
  76. package/wangsvue-fats.es.js +190 -186
  77. package/wangsvue-fats.esm.browser.js +17750 -17086
  78. package/wangsvue-fats.system.js +73 -72
@@ -1,27 +1,27 @@
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 g, openBlock as n, Fragment as V, createVNode as m, normalizeClass as y, withCtx as x, createElementVNode as h, createCommentVNode as p, createBlock as k, renderList as ze, unref as S } from "vue";
2
- import { g as Ae } from "../dialogprintqr/index.es.js";
3
- import { r as Se } from "../vendor/base64toblob/base64toblob.es.js";
4
- import { u as $e } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
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 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 xe } from "../fieldwrapper/index.es.js";
14
- import { _ as O } from "../icon/index.es.js";
15
- import { _ as Oe } from "../invisiblefield/index.es.js";
16
- import { _ as qe } from "../validatormessage/index.es.js";
17
- import { B as Ke } from "../backgroundimagecropper/index.es.js";
18
- import { _ as se } from "../imageinputinfo/index.es.js";
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 He = Se();
21
- const We = /* @__PURE__ */ Ae(He), Ge = {
20
+ var We = Ae();
21
+ const Ge = /* @__PURE__ */ ze(We), Je = {
22
22
  key: 1,
23
23
  class: "flex gap-1 items-start"
24
- }, Je = ["id", "multiple"], Qe = ["for"], ga = /* @__PURE__ */ Ce({
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: ie, emit: ne }) {
56
- const ue = Be("preset", {}).image, l = Q, I = ne, { locale: E } = De("ImageCompressor");
57
- Pe(async () => {
58
- fe(), M();
59
- }), Me(() => {
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
- ]), me = Ne(), q = w(), C = w(), s = w([]), X = w(), Y = A(0), K = w(), R = w(), d = A(), T = Ue(Q, "defaultImage"), i = Fe({
72
- value: l.multiple ? [] : void 0
73
- }), B = A(!1), b = A(), de = A(0), f = 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"), ce = J(() => {
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 l.type === "inline-table" ? e.small : e[l.imagePreviewSize] || e.small;
79
+ return a.type === "inline-table" ? e.small : e[a.imagePreviewSize] || e.small;
80
80
  }), M = async () => {
81
- var e, a;
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 ? (q.value = Le(l.initialName, 125, me), s.value = [(a = q.value) == null ? void 0 : a.toDataURL()]) : s.value = [], l.imagePreviewUrl ? i.value = l.imagePreviewUrl : l.initialName && (i.value = await pe()), I("applyProp");
83
- }, pe = async () => new Promise((e) => {
84
- var a;
85
- (a = q.value) == null || a.toBlob((r) => {
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 a;
94
- l.disabled || (e && (d.value = 1), (a = X.value) == null || a.click());
95
- }, ve = async (e) => {
96
- const { files: a } = e.target, r = Array.from(a ?? []).slice(
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 ge(u, o);
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
- }, ge = async (e, a) => {
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 D, z;
112
+ var R, S;
113
113
  if (e)
114
- if (Z(a), !r(e.type))
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(), f.value = !1, F(a), o("Tipe file harus berupa gambar!");
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 l.validatorMessage != "string" && ((z = l.validatorMessage) != null && z.exceed) ? l.validatorMessage.exceed : "Ukuran gambar terlalu besar! Maks. 1 MB", M(), f.value = !1, F(a), o("Ukuran gambar terlalu besar! Maks. 1 MB");
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(a);
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[a].src = j, v.value[a].type = ye(
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 = a), f.value || (f.value = !0), B.value = !1, b.value = void 0;
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
- de.value += 1, R.value = u;
131
+ ce.value += 1, D.value = u;
132
132
  });
133
- }, fe = () => {
134
- l.useValidator && Object.assign(
133
+ }, ye = () => {
134
+ a.useValidator && Object.assign(
135
135
  i,
136
- $e(l.fieldName, (e) => {
137
- var a;
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;
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
- }, ye = (e, a = null) => {
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 a;
164
+ return l;
165
165
  }
166
166
  }
167
167
  return null;
168
168
  }, _ = (e) => {
169
- const a = We(e.split(",")[1], P.value);
170
- return window.URL.createObjectURL(a);
171
- }, be = async (e, a) => {
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], a, { type: P.value });
174
- }, we = async () => {
173
+ return new File([r], l, { type: P.value });
174
+ }, he = async () => {
175
175
  const e = d.value ?? 0;
176
176
  try {
177
- await he(e);
178
- } catch (a) {
179
- console.error(a);
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 = R.value) == null || e.call(R), R.value = void 0;
185
- }, he = async (e) => {
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 a = K.value.getResult();
188
- if (a.canvas) {
189
- const r = a.canvas.toDataURL(P.value);
190
- await ke(r, e);
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
- }, ke = async (e, a) => {
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, D = t.height * u;
199
- C.value.setAttribute("width", o.toString()), C.value.setAttribute("height", D.toString()), r && r.drawImage(t, 0, 0, o, D);
200
- const z = C.value.toDataURL(P.value, 0.95), j = Date.now() + `.${l.fileType}`, c = {
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: _(z),
204
- base64: z,
203
+ blob: _(S),
204
+ base64: S,
205
205
  fileName: j,
206
- file: await be(_(z), j),
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[a] = c.compressed.blob, l.multiple ? i.value && Array.isArray(i.value) ? i.value[a] = c.compressed.file : i.value = [c.compressed.file] : i.value = c.compressed.file, I("apply", c);
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
- l.confirmOnDelete ? H.value[e] = !0 : l.emitDeleteFn ? I("delete", G, e) : G(e);
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, l.confirmOnDelete || I("delete"), l.multiple && Array.isArray(i.value) ? i.value = i.value.toSpliced(e, 1) : i.handleReset && i.handleReset();
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 a = (r = s.value[e]) == null ? void 0 : r.toString();
225
- d.value = e, a != null && a.includes("blob") ? (d.value = e, f.value = !0) : (Z(e), U());
226
- }, Ie = () => {
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((a) => a instanceof File)) && I("update:fieldValue", e);
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
- () => l.initialName,
239
+ () => a.initialName,
240
240
  () => {
241
241
  M();
242
242
  }
243
243
  ), N(
244
- () => l.imagePreviewUrl,
244
+ () => a.imagePreviewUrl,
245
245
  () => {
246
246
  M();
247
247
  },
248
248
  { once: !0 }
249
- ), ie({ assignPreviewImagesFromProp: M }), (e, a) => (n(), g(V, null, [
250
- m(xe, {
251
- class: y([{ "!w-max": !l.multiple, "!w-full": l.multiple }]),
252
- info: l.fieldInfo,
253
- label: l.label,
254
- mandatory: l.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: x(() => [
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 }, ze(s.value, (r, t) => {
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(Ve, {
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": ce.value,
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 = S(ue)) == null ? void 0 : u.button.class,
313
+ (u = z(me)) == null ? void 0 : u.button.class,
314
314
  "hover:bg-opacity-0 rounded-lg opacity-0"
315
315
  ]),
316
- onClick: a[0] || (a[0] = (o) => U(!1)),
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(O, {
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
- !l.disabled && !W(t) ? (n(), g(V, { key: 0 }, [
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(O, {
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(O, {
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(je, {
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(se, {
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 && l.multiple,
383
+ "show-add-button": s.value.length === 1 && a.multiple,
384
384
  "show-info": e.showInfo,
385
- onAddPhoto: a[2] || (a[2] = (o) => U(!0))
385
+ onAddPhoto: l[2] || (l[2] = (o) => U(!0))
386
386
  }, {
387
- default: x(() => [
388
- s.value.length === 2 && l.multiple ? (n(), k(Ee, {
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": a[1] || (a[1] = (o) => T.value = o),
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: a[3] || (a[3] = (o) => U(!0)),
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", Ge, [
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": !l.disabled,
429
- "bg-general-50 dark:bg-grayscale-800": l.disabled
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: a[4] || (a[4] = (r) => U(!1)),
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(O, {
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(se, {
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: l.multiple && !s.value.length,
455
- onChange: ve,
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, Je)),
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
- }, a[6] || (a[6] = [
466
- h("span", { 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" }, " Browse ", -1),
467
- h("span", { 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" }, " Select File ", -1)
468
- ]), 8, Qe)) : p("", !0),
469
- e.showValidatorMessage ? (n(), k(qe, {
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
- l.multiple ? (n(), k(Oe, {
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(Te, {
482
+ m(je, {
483
483
  visible: f.value,
484
- "onUpdate:visible": a[5] || (a[5] = (r) => f.value = r),
484
+ "onUpdate:visible": l[5] || (l[5] = (r) => f.value = r),
485
485
  draggable: !1,
486
- header: S(E).cropDialogHeader,
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: x(() => [
494
- m($, {
495
- label: S(E).cancelCropLabel,
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: S(E).changeImageLabel,
504
- onClick: Ie,
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: S(E).applyCropLabel,
511
- onClick: we,
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: x(() => [
518
- d.value != null ? (n(), k(S(Re), {
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": Ke,
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
- ga as _
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 c, renderSlot as f, normalizeClass as _, Fragment as m, renderList as g, toDisplayString as r, createElementVNode as u, unref as d } from "vue";
2
- import { u as k } from "../plugins/WangsVue.es.js";
3
- import { _ as y } from "../button/index.es.js";
4
- const h = { class: "flex flex-col gap-y-4" }, w = {
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(x) {
22
- const { locale: l } = k("ImageCompressor");
21
+ setup(B) {
22
+ const { locale: l } = y("ImageCompressor");
23
23
  return (e, s) => {
24
24
  var i;
25
- return o(), t("div", h, [
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 }, g(e.customRequirements, (n) => (o(), t("li", { key: n }, r(n), 1))), 128)) : (o(), t(m, { key: 1 }, [
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(), c(y, {
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
- f(e.$slots, "default")
39
+ c(e.$slots, "default")
40
40
  ]);
41
41
  };
42
42
  }