@fewangsit/wangsvue-fats 1.0.1-alpha.35 → 1.0.1-alpha.36
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/backgroundimagecropper/index.es.js +2 -2
- package/datatable/index.es.js +1 -1
- package/dialogprintqr/index.es.js +2 -2
- package/image/index.d.ts +11 -6
- package/image/index.es.js +104 -92
- package/package.json +1 -1
- package/stats.html +1 -1
- package/style.css +1 -1
- package/vendor/@vueuse/core/index.es.js +41 -0
- package/vendor/@vueuse/shared/index.es.js +7 -0
- package/wangsvue-fats.esm.browser.js +2881 -2831
- package/wangsvue-fats.system.js +56 -56
|
@@ -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
|
-
}),
|
|
53
|
+
}), b = /* @__PURE__ */ I(R, [["__scopeId", "data-v-5cd98b2d"]]);
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
b as B,
|
|
56
56
|
I as _
|
|
57
57
|
};
|
package/datatable/index.es.js
CHANGED
|
@@ -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-
|
|
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
|
|
235
|
-
label that printed or not. It does not show the
|
|
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.d.ts
CHANGED
|
@@ -271,17 +271,22 @@ export interface ImageProps {
|
|
|
271
271
|
unstyled?: boolean;
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
274
|
+
* Returns the full image URL or a Data URI for an image resource, based on the provided path and dimensions.
|
|
275
|
+
*
|
|
276
|
+
* If the image is publicly accessible, this typically returns a fully qualified URL.
|
|
277
|
+
* If the image requires authentication or protected access, this may return a Data URI (e.g., Base64-encoded).
|
|
278
|
+
*
|
|
279
|
+
* @param path - The image path as provided in the API response JSON. Can be null or undefined.
|
|
280
|
+
* @param width - Optional width of the image in pixels.
|
|
281
|
+
* @param height - Optional height of the image in pixels.
|
|
282
|
+
*
|
|
283
|
+
* @returns A string representing either the full image URL or a Data URI. Returns `undefined` if the path is invalid.
|
|
279
284
|
*/
|
|
280
285
|
getImageURL?: (
|
|
281
286
|
path?: string | null,
|
|
282
287
|
width?: number,
|
|
283
288
|
height?: number,
|
|
284
|
-
) => string | undefined
|
|
289
|
+
) => string | undefined | Promise<string | undefined>;
|
|
285
290
|
|
|
286
291
|
/**
|
|
287
292
|
* The placeholder to be shown when the image failed to load, or the src is not provided.
|
package/image/index.es.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { _ as
|
|
7
|
-
|
|
1
|
+
import { defineComponent as M, computed as I, onMounted as W, onUnmounted as Z, shallowRef as d, createBlock as q, openBlock as u, unref as D, withCtx as b, createElementBlock as g, normalizeStyle as k, Fragment as z, createElementVNode as $, renderList as O, withDirectives as x, vShow as H, withModifiers as P, createVNode as C, normalizeClass as _, mergeProps as T } from "vue";
|
|
2
|
+
import { c as J } from "../vendor/@vueuse/core/index.es.js";
|
|
3
|
+
import { u as K } from "../plugins/WangsVue.es.js";
|
|
4
|
+
import { m as Q } from "../utils/mergePropsWithDefaults.util.es.js";
|
|
5
|
+
import { s as X } from "../vendor/primevue/image/image.esm.es.js";
|
|
6
|
+
import { _ as E } from "../button/index.es.js";
|
|
7
|
+
import { _ as Y } from "../icon/index.es.js";
|
|
8
|
+
const ee = ["src"], te = ["src"], ae = ["src"], re = ["src", "onClick"], me = /* @__PURE__ */ M({
|
|
8
9
|
__name: "Image",
|
|
9
10
|
props: {
|
|
10
11
|
src: {},
|
|
@@ -24,101 +25,112 @@ const Y = ["src"], Z = ["src"], ee = ["src"], te = ["src", "onClick"], ne = /* @
|
|
|
24
25
|
getImageURL: {},
|
|
25
26
|
placeholder: {}
|
|
26
27
|
},
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
setup(F) {
|
|
29
|
+
const a = F, { defaultProps: N } = K("Image"), i = I(() => Q(a, N));
|
|
30
|
+
W(() => {
|
|
30
31
|
setTimeout(() => {
|
|
31
|
-
|
|
32
|
+
L();
|
|
32
33
|
}, 3e3);
|
|
33
|
-
}),
|
|
34
|
-
|
|
34
|
+
}), Z(() => {
|
|
35
|
+
w();
|
|
35
36
|
});
|
|
36
|
-
const
|
|
37
|
+
const s = d(0), p = d(), S = d(), f = d(!1), V = I(() => {
|
|
37
38
|
var e;
|
|
38
|
-
return
|
|
39
|
-
}),
|
|
40
|
-
const e =
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
const e =
|
|
44
|
-
|
|
45
|
-
},
|
|
39
|
+
return a.preview === !1 ? !1 : !f.value && !((e = m.value) != null && e.toString().includes("data:image/png;base64")) && m.value !== i.value.placeholder;
|
|
40
|
+
}), j = () => {
|
|
41
|
+
const e = a.galleries ?? [];
|
|
42
|
+
s.value = (s.value + 1) % e.length, h();
|
|
43
|
+
}, A = () => {
|
|
44
|
+
const e = a.galleries ?? [];
|
|
45
|
+
s.value = (s.value - 1 + e.length) % e.length, h();
|
|
46
|
+
}, L = () => {
|
|
46
47
|
var e;
|
|
47
|
-
|
|
48
|
-
const t =
|
|
49
|
-
|
|
48
|
+
w(), (e = a.galleries) != null && e.length && (p.value = window.setInterval(() => {
|
|
49
|
+
const t = a.galleries ?? [];
|
|
50
|
+
s.value = (s.value + 1) % t.length;
|
|
50
51
|
}, 3e3));
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
}, w = () => {
|
|
53
|
+
p.value && (window.clearInterval(p.value), p.value = void 0);
|
|
54
|
+
}, R = I(() => a.width != null ? a.width : a.size === "small" ? 30 : a.size === "medium" ? 80 : 125), m = J(
|
|
55
|
+
async () => {
|
|
56
|
+
var e, t;
|
|
57
|
+
return !a.src || f.value ? i.value.placeholder : typeof a.src == "string" ? (a.src.includes("http") || // From public image
|
|
58
|
+
/^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, R.value))) || i.value.placeholder : a.src;
|
|
59
|
+
},
|
|
60
|
+
i.value.placeholder
|
|
61
|
+
// Show placeholder while fetching image
|
|
62
|
+
), y = d(), G = async () => {
|
|
63
|
+
var t, r, o, c;
|
|
64
|
+
if (y.value != null) return;
|
|
65
|
+
let e = m.value;
|
|
60
66
|
if (typeof e == "string") {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
e.includes("
|
|
67
|
+
const l = (r = (t = i.value).getImageURL) == null ? void 0 : r.call(t, "preview"), n = typeof l == "string" && !(l != null && l.includes("undefined")) ? new URL(l).origin : "", B = n && e.includes(n) || // For getImageURL that return the image full url
|
|
68
|
+
l instanceof Promise;
|
|
69
|
+
e = e.includes("http") && !B || // From public resource
|
|
70
|
+
e.includes("data:image/svg+xml") ? e : await ((c = (o = i.value).getImageURL) == null ? void 0 : c.call(o, a.src));
|
|
64
71
|
}
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
var
|
|
70
|
-
const t = (
|
|
71
|
-
(t ===
|
|
72
|
-
},
|
|
73
|
-
var
|
|
72
|
+
y.value = e || i.value.placeholder;
|
|
73
|
+
}, h = (e) => {
|
|
74
|
+
w(), typeof e == "number" && (s.value = e), S.value ? window.clearTimeout(S.value) : window.setTimeout(L, 3e3);
|
|
75
|
+
}, v = (e) => {
|
|
76
|
+
var r;
|
|
77
|
+
const t = (r = e.target) == null ? void 0 : r.src;
|
|
78
|
+
(t === m.value || t.includes(m.value.toString())) && (f.value = !0);
|
|
79
|
+
}, U = (e) => {
|
|
80
|
+
var r, o, c;
|
|
74
81
|
const t = e;
|
|
75
|
-
return typeof t == "string" ? t.includes("http") ? t : (
|
|
82
|
+
return typeof t == "string" ? t.includes("http") ? t : (c = (o = (r = i.value).getImageURL) == null ? void 0 : o.call(r, t)) == null ? void 0 : c.toString() : t;
|
|
76
83
|
};
|
|
77
84
|
return (e, t) => {
|
|
78
|
-
var
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
var r;
|
|
86
|
+
return u(), q(D(X), {
|
|
87
|
+
"image-class": e.imageClass,
|
|
88
|
+
"image-style": e.imageStyle,
|
|
89
|
+
preview: V.value,
|
|
90
|
+
pt: { root: (r = e.$preset.image) == null ? void 0 : r.root({ props: e.$props }) },
|
|
91
|
+
"zoom-in-disabled": e.zoomInDisabled,
|
|
92
|
+
"zoom-out-disabled": e.zoomOutDisabled,
|
|
93
|
+
onShow: G
|
|
94
|
+
}, {
|
|
83
95
|
image: b(() => {
|
|
84
|
-
var
|
|
96
|
+
var o;
|
|
85
97
|
return [
|
|
86
|
-
|
|
87
|
-
onerror:
|
|
88
|
-
src:
|
|
98
|
+
$("img", T((o = e.$preset.image) == null ? void 0 : o.image({ props: e.$props, context: { imageSize: R.value } }), {
|
|
99
|
+
onerror: v,
|
|
100
|
+
src: D(m),
|
|
89
101
|
alt: ""
|
|
90
|
-
}), null, 16,
|
|
102
|
+
}), null, 16, ee)
|
|
91
103
|
];
|
|
92
104
|
}),
|
|
93
105
|
indicatoricon: b(() => [
|
|
94
|
-
C(
|
|
106
|
+
C(Y, T(e.$preset.image.icon, { icon: "eye" }), null, 16)
|
|
95
107
|
]),
|
|
96
|
-
preview: b((
|
|
97
|
-
var
|
|
108
|
+
preview: b((o) => {
|
|
109
|
+
var c;
|
|
98
110
|
return [
|
|
99
|
-
(
|
|
100
|
-
(
|
|
101
|
-
key:
|
|
102
|
-
onerror:
|
|
103
|
-
src:
|
|
104
|
-
style: k(
|
|
111
|
+
(c = e.galleries) != null && c.length ? (u(), g(z, { key: 1 }, [
|
|
112
|
+
(u(!0), g(z, null, O(e.galleries, ({ src: l }, n) => x((u(), g("img", {
|
|
113
|
+
key: n,
|
|
114
|
+
onerror: v,
|
|
115
|
+
src: U(l),
|
|
116
|
+
style: k(o.style),
|
|
105
117
|
alt: "",
|
|
106
118
|
"data-wv-section": "image-gallery"
|
|
107
|
-
}, null, 12,
|
|
108
|
-
[H,
|
|
119
|
+
}, null, 12, ae)), [
|
|
120
|
+
[H, n === s.value]
|
|
109
121
|
])), 128)),
|
|
110
|
-
|
|
111
|
-
onClick: t[0] || (t[0] =
|
|
122
|
+
$("div", {
|
|
123
|
+
onClick: t[0] || (t[0] = P(() => {
|
|
112
124
|
}, ["stop"])),
|
|
113
125
|
class: "fixed bottom-0 left-0 flex justify-center items-center w-full p-4 mx-auto flex-row bg-black/80",
|
|
114
126
|
"data-wv-section": "gallery-thumbnail"
|
|
115
127
|
}, [
|
|
116
|
-
C(
|
|
117
|
-
class:
|
|
128
|
+
C(E, {
|
|
129
|
+
class: _([
|
|
118
130
|
"text-surface-0 rotate-180 sticky left-0 !w-8 !h-8 [&_i]:w-5 [&_i]:h-5",
|
|
119
131
|
"rounded-full mr-3"
|
|
120
132
|
]),
|
|
121
|
-
onClick:
|
|
133
|
+
onClick: A,
|
|
122
134
|
"aria-label": "Previous Image",
|
|
123
135
|
"data-wv-section": "prev-button",
|
|
124
136
|
icon: "arrow-right",
|
|
@@ -126,25 +138,25 @@ const Y = ["src"], Z = ["src"], ee = ["src"], te = ["src", "onClick"], ne = /* @
|
|
|
126
138
|
severity: "secondary",
|
|
127
139
|
text: ""
|
|
128
140
|
}),
|
|
129
|
-
(
|
|
130
|
-
key:
|
|
131
|
-
class:
|
|
141
|
+
(u(!0), g(z, null, O(e.galleries, ({ src: l }, n) => (u(), g("img", {
|
|
142
|
+
key: n,
|
|
143
|
+
class: _([
|
|
132
144
|
"h-10 w-10 object-cover cursor-pointer opacity-50 hover:opacity-100 transition-opacity",
|
|
133
|
-
{ "!opacity-100":
|
|
145
|
+
{ "!opacity-100": s.value == n }
|
|
134
146
|
]),
|
|
135
|
-
onerror:
|
|
136
|
-
src:
|
|
137
|
-
style: k(
|
|
138
|
-
onClick:
|
|
147
|
+
onerror: v,
|
|
148
|
+
src: U(l),
|
|
149
|
+
style: k(o.style),
|
|
150
|
+
onClick: P((B) => h(n), ["stop"]),
|
|
139
151
|
alt: "",
|
|
140
152
|
"data-wv-section": "thumbnail-image"
|
|
141
|
-
}, null, 14,
|
|
142
|
-
C(
|
|
143
|
-
class:
|
|
153
|
+
}, null, 14, re))), 128)),
|
|
154
|
+
C(E, {
|
|
155
|
+
class: _([
|
|
144
156
|
"text-surface-0 sticky !w-8 !h-8 [&_i]:w-5 [&_i]:h-5",
|
|
145
157
|
"rounded-full ml-3"
|
|
146
158
|
]),
|
|
147
|
-
onClick:
|
|
159
|
+
onClick: j,
|
|
148
160
|
"aria-label": "Next Image",
|
|
149
161
|
"data-wv-section": "next-button",
|
|
150
162
|
icon: "arrow-right",
|
|
@@ -152,20 +164,20 @@ const Y = ["src"], Z = ["src"], ee = ["src"], te = ["src", "onClick"], ne = /* @
|
|
|
152
164
|
text: ""
|
|
153
165
|
})
|
|
154
166
|
])
|
|
155
|
-
], 64)) : (
|
|
167
|
+
], 64)) : (u(), g("img", {
|
|
156
168
|
key: 0,
|
|
157
|
-
onerror:
|
|
158
|
-
src:
|
|
159
|
-
style: k(
|
|
169
|
+
onerror: v,
|
|
170
|
+
src: y.value,
|
|
171
|
+
style: k(o.style),
|
|
160
172
|
alt: ""
|
|
161
|
-
}, null, 12,
|
|
173
|
+
}, null, 12, te))
|
|
162
174
|
];
|
|
163
175
|
}),
|
|
164
176
|
_: 1
|
|
165
|
-
},
|
|
177
|
+
}, 8, ["image-class", "image-style", "preview", "pt", "zoom-in-disabled", "zoom-out-disabled"]);
|
|
166
178
|
};
|
|
167
179
|
}
|
|
168
180
|
});
|
|
169
181
|
export {
|
|
170
|
-
|
|
182
|
+
me as _
|
|
171
183
|
};
|