@fewangsit/wangsvue-fats 1.0.1-alpha.39 → 1.0.1-alpha.40

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.
@@ -50,8 +50,8 @@ const I = (i, s) => {
50
50
  _: 3
51
51
  }, 8, ["mouse-move", "touch-move", "touch-resize", "wheel-resize"]));
52
52
  }
53
- }), S = /* @__PURE__ */ I(R, [["__scopeId", "data-v-9031c32d"]]);
53
+ }), b = /* @__PURE__ */ I(R, [["__scopeId", "data-v-5cd98b2d"]]);
54
54
  export {
55
- S as B,
55
+ b as B,
56
56
  I as _
57
57
  };
@@ -988,7 +988,7 @@ const zt = (W, $) => W.every((t) => $.includes(t)), jt = ["id"], Vt = ["onClick"
988
988
  ], 16);
989
989
  };
990
990
  }
991
- }), Fl = /* @__PURE__ */ Lt(sl, [["__scopeId", "data-v-015be0a0"]]);
991
+ }), Fl = /* @__PURE__ */ Lt(sl, [["__scopeId", "data-v-37d9df20"]]);
992
992
  export {
993
993
  Fl as D
994
994
  };
@@ -231,8 +231,8 @@ const H = /* @__PURE__ */ nA(vA), j = "data:image/png;base64,iVBORw0KGgoAAAANSUh
231
231
  t[4] || (t[4] = e("span", null, "Preview", -1)),
232
232
  a(eA, {
233
233
  icon: "info",
234
- info: `This preview is only for showing the side of the\r
235
- label that printed or not. It does not show the\r
234
+ info: `This preview is only for showing the side of the
235
+ label that printed or not. It does not show the
236
236
  exact amount you entered.`,
237
237
  severity: "primary"
238
238
  })
package/image/index.es.js CHANGED
@@ -1,11 +1,11 @@
1
- import { defineComponent as W, computed as I, onMounted as Z, onUnmounted as q, shallowRef as d, createBlock as x, openBlock as m, unref as $, withCtx as k, createElementBlock as g, normalizeStyle as z, Fragment as L, createElementVNode as j, renderList as D, withDirectives as H, vShow as J, withModifiers as P, createVNode as R, normalizeClass as U, mergeProps as T } from "vue";
2
- import { c as K } from "../vendor/@vueuse/core/index.es.js";
3
- import { u as Q } from "../plugins/WangsVue.es.js";
4
- import { m as X } from "../utils/mergePropsWithDefaults.util.es.js";
5
- import { s as Y } from "../vendor/primevue/image/image.esm.es.js";
1
+ import { defineComponent as W, computed as I, onMounted as Z, onUnmounted as q, shallowRef as d, watch as x, createBlock as H, openBlock as m, unref as $, withCtx as k, createElementBlock as g, normalizeStyle as z, Fragment as L, createElementVNode as j, renderList as D, withDirectives as J, vShow as K, withModifiers as P, createVNode as R, normalizeClass as U, mergeProps as T } from "vue";
2
+ import { c as Q } from "../vendor/@vueuse/core/index.es.js";
3
+ import { u as X } from "../plugins/WangsVue.es.js";
4
+ import { m as Y } from "../utils/mergePropsWithDefaults.util.es.js";
5
+ import { s as ee } from "../vendor/primevue/image/image.esm.es.js";
6
6
  import { _ as E } from "../button/index.es.js";
7
- import { _ as ee } from "../icon/index.es.js";
8
- const te = ["src"], ae = ["src"], oe = ["src"], le = ["src", "onClick"], ge = /* @__PURE__ */ W({
7
+ import { _ as te } from "../icon/index.es.js";
8
+ const ae = ["src"], oe = ["src"], le = ["src"], re = ["src", "onClick"], de = /* @__PURE__ */ W({
9
9
  __name: "Image",
10
10
  props: {
11
11
  src: {},
@@ -26,76 +26,78 @@ const te = ["src"], ae = ["src"], oe = ["src"], le = ["src", "onClick"], ge = /*
26
26
  placeholder: {}
27
27
  },
28
28
  setup(F) {
29
- const a = F, { defaultProps: N } = Q("Image"), i = I(() => X(a, N));
29
+ const a = F, { defaultProps: N } = X("Image"), s = I(() => Y(a, N));
30
30
  Z(() => {
31
31
  setTimeout(() => {
32
32
  _();
33
33
  }, 3e3);
34
34
  }), q(() => {
35
- h(), typeof n.value == "string" && n.value.includes("blob") && URL.revokeObjectURL(n.value);
36
- for (const e of y) URL.revokeObjectURL(e);
35
+ w(), typeof r.value == "string" && r.value.includes("blob") && URL.revokeObjectURL(r.value);
36
+ for (const e of h) URL.revokeObjectURL(e);
37
37
  });
38
- const s = d(0), p = d(), C = d(), f = d(!1), y = [], V = I(() => {
38
+ const n = d(0), v = d(), C = d(), y = d(!1), h = [], V = I(() => {
39
39
  var e;
40
- return a.preview === !1 ? !1 : !f.value && !((e = n.value) != null && e.toString().includes("data:image/png;base64")) && n.value !== i.value.placeholder;
40
+ return a.preview === !1 ? !1 : !y.value && !((e = r.value) != null && e.toString().includes("data:image/png;base64")) && r.value !== s.value.placeholder;
41
41
  }), A = () => {
42
42
  const e = a.galleries ?? [];
43
- s.value = (s.value + 1) % e.length, b();
43
+ n.value = (n.value + 1) % e.length, b();
44
44
  }, G = () => {
45
45
  const e = a.galleries ?? [];
46
- s.value = (s.value - 1 + e.length) % e.length, b();
46
+ n.value = (n.value - 1 + e.length) % e.length, b();
47
47
  }, _ = () => {
48
48
  var e;
49
- h(), (e = a.galleries) != null && e.length && (p.value = window.setInterval(() => {
49
+ w(), (e = a.galleries) != null && e.length && (v.value = window.setInterval(() => {
50
50
  const t = a.galleries ?? [];
51
- s.value = (s.value + 1) % t.length;
51
+ n.value = (n.value + 1) % t.length;
52
52
  }, 3e3));
53
- }, h = () => {
54
- p.value && (window.clearInterval(p.value), p.value = void 0);
55
- }, S = I(() => a.width != null ? a.width : a.size === "small" ? 30 : a.size === "medium" ? 80 : 125), n = K(
53
+ }, w = () => {
54
+ v.value && (window.clearInterval(v.value), v.value = void 0);
55
+ }, S = I(() => a.width != null ? a.width : a.size === "small" ? 30 : a.size === "medium" ? 80 : 125), r = Q(
56
56
  async () => {
57
57
  var e, t;
58
- if (!a.src || f.value) return i.value.placeholder;
58
+ if (!a.src || y.value) return s.value.placeholder;
59
59
  if (typeof a.src == "string") {
60
60
  const o = a.src.includes("http") || // From public image or ObjectURL from Blob e.g 'blob:http://localhost:5173/ca48705d-1fc1-4a74-af38-353ffce7e02a'
61
- /^data:image\/[a-zA-Z0-9.+-]+;base64,/.test(a.src) ? a.src : await ((t = (e = i.value).getImageURL) == null ? void 0 : t.call(e, a.src, S.value));
62
- return typeof o == "string" && o.includes("blob") && y.push(o), o || i.value.placeholder;
61
+ /^data:image\/[a-zA-Z0-9.+-]+;base64,/.test(a.src) ? a.src : await ((t = (e = s.value).getImageURL) == null ? void 0 : t.call(e, a.src, S.value));
62
+ return typeof o == "string" && o.includes("blob") && h.push(o), o || s.value.placeholder;
63
63
  }
64
64
  return a.src;
65
65
  },
66
- i.value.placeholder
66
+ s.value.placeholder
67
67
  // Show placeholder while fetching image
68
- ), w = d(), M = async () => {
68
+ ), p = d(), M = async () => {
69
69
  var t, o, l, u;
70
- if (w.value != null) return;
71
- let e = n.value;
70
+ if (p.value != null) return;
71
+ let e = r.value;
72
72
  if (typeof e == "string") {
73
- const r = (o = (t = i.value).getImageURL) == null ? void 0 : o.call(
73
+ const i = (o = (t = s.value).getImageURL) == null ? void 0 : o.call(
74
74
  t,
75
75
  "preview",
76
76
  void 0,
77
77
  void 0,
78
78
  !0
79
- ), c = typeof r == "string" && !(r != null && r.includes("undefined")) ? new URL(r).origin : "", B = c && e.includes(c) || // For getImageURL that return the image full url
80
- r instanceof Promise;
79
+ ), c = typeof i == "string" && !(i != null && i.includes("undefined")) ? new URL(i).origin : "", B = c && e.includes(c) || // For getImageURL that return the image full url
80
+ i instanceof Promise;
81
81
  e = e.includes("http") && !B || // From public resource
82
- e.includes("data:image/svg+xml") ? e : await ((u = (l = i.value).getImageURL) == null ? void 0 : u.call(l, a.src));
82
+ e.includes("data:image/svg+xml") ? e : await ((u = (l = s.value).getImageURL) == null ? void 0 : u.call(l, a.src));
83
83
  }
84
- typeof e == "string" && e.includes("blob") && y.push(e), w.value = e || i.value.placeholder;
84
+ typeof e == "string" && e.includes("blob") && h.push(e), p.value = e || s.value.placeholder;
85
85
  }, b = (e) => {
86
- h(), typeof e == "number" && (s.value = e), C.value ? window.clearTimeout(C.value) : window.setTimeout(_, 3e3);
87
- }, v = (e) => {
86
+ w(), typeof e == "number" && (n.value = e), C.value ? window.clearTimeout(C.value) : window.setTimeout(_, 3e3);
87
+ }, f = (e) => {
88
88
  var o;
89
89
  const t = (o = e.target) == null ? void 0 : o.src;
90
- (t === n.value || t.includes(n.value.toString())) && (f.value = !0);
90
+ (t === r.value || t.includes(r.value.toString())) && (y.value = !0);
91
91
  }, O = (e) => {
92
92
  var o, l, u;
93
93
  const t = e;
94
- return typeof t == "string" ? t.includes("http") ? t : (u = (l = (o = i.value).getImageURL) == null ? void 0 : l.call(o, t)) == null ? void 0 : u.toString() : t;
94
+ return typeof t == "string" ? t.includes("http") ? t : (u = (l = (o = s.value).getImageURL) == null ? void 0 : l.call(o, t)) == null ? void 0 : u.toString() : t;
95
95
  };
96
- return (e, t) => {
96
+ return x(r, () => {
97
+ p.value = void 0;
98
+ }), (e, t) => {
97
99
  var o;
98
- return m(), x($(Y), {
100
+ return m(), H($(ee), {
99
101
  "image-class": e.imageClass,
100
102
  "image-style": e.imageStyle,
101
103
  preview: V.value,
@@ -108,28 +110,28 @@ const te = ["src"], ae = ["src"], oe = ["src"], le = ["src", "onClick"], ge = /*
108
110
  var l;
109
111
  return [
110
112
  j("img", T((l = e.$preset.image) == null ? void 0 : l.image({ props: e.$props, context: { imageSize: S.value } }), {
111
- onerror: v,
112
- src: $(n),
113
+ onerror: f,
114
+ src: $(r),
113
115
  alt: ""
114
- }), null, 16, te)
116
+ }), null, 16, ae)
115
117
  ];
116
118
  }),
117
119
  indicatoricon: k(() => [
118
- R(ee, T(e.$preset.image.icon, { icon: "eye" }), null, 16)
120
+ R(te, T(e.$preset.image.icon, { icon: "eye" }), null, 16)
119
121
  ]),
120
122
  preview: k((l) => {
121
123
  var u;
122
124
  return [
123
125
  (u = e.galleries) != null && u.length ? (m(), g(L, { key: 1 }, [
124
- (m(!0), g(L, null, D(e.galleries, ({ src: r }, c) => H((m(), g("img", {
126
+ (m(!0), g(L, null, D(e.galleries, ({ src: i }, c) => J((m(), g("img", {
125
127
  key: c,
126
- onerror: v,
127
- src: O(r),
128
+ onerror: f,
129
+ src: O(i),
128
130
  style: z(l.style),
129
131
  alt: "",
130
132
  "data-wv-section": "image-gallery"
131
- }, null, 12, oe)), [
132
- [J, c === s.value]
133
+ }, null, 12, le)), [
134
+ [K, c === n.value]
133
135
  ])), 128)),
134
136
  j("div", {
135
137
  onClick: t[0] || (t[0] = P(() => {
@@ -150,19 +152,19 @@ const te = ["src"], ae = ["src"], oe = ["src"], le = ["src", "onClick"], ge = /*
150
152
  severity: "secondary",
151
153
  text: ""
152
154
  }),
153
- (m(!0), g(L, null, D(e.galleries, ({ src: r }, c) => (m(), g("img", {
155
+ (m(!0), g(L, null, D(e.galleries, ({ src: i }, c) => (m(), g("img", {
154
156
  key: c,
155
157
  class: U([
156
158
  "h-10 w-10 object-cover cursor-pointer opacity-50 hover:opacity-100 transition-opacity",
157
- { "!opacity-100": s.value == c }
159
+ { "!opacity-100": n.value == c }
158
160
  ]),
159
- onerror: v,
160
- src: O(r),
161
+ onerror: f,
162
+ src: O(i),
161
163
  style: z(l.style),
162
164
  onClick: P((B) => b(c), ["stop"]),
163
165
  alt: "",
164
166
  "data-wv-section": "thumbnail-image"
165
- }, null, 14, le))), 128)),
167
+ }, null, 14, re))), 128)),
166
168
  R(E, {
167
169
  class: U([
168
170
  "text-surface-0 sticky !w-8 !h-8 [&_i]:w-5 [&_i]:h-5",
@@ -178,11 +180,11 @@ const te = ["src"], ae = ["src"], oe = ["src"], le = ["src", "onClick"], ge = /*
178
180
  ])
179
181
  ], 64)) : (m(), g("img", {
180
182
  key: 0,
181
- onerror: v,
182
- src: w.value,
183
+ onerror: f,
184
+ src: p.value,
183
185
  style: z(l.style),
184
186
  alt: ""
185
- }, null, 12, ae))
187
+ }, null, 12, oe))
186
188
  ];
187
189
  }),
188
190
  _: 1
@@ -191,5 +193,5 @@ const te = ["src"], ae = ["src"], oe = ["src"], le = ["src", "onClick"], ge = /*
191
193
  }
192
194
  });
193
195
  export {
194
- ge as _
196
+ de as _
195
197
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.39",
3
+ "version": "1.0.1-alpha.40",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",