@fewangsit/wangsvue-fats 1.0.1-alpha.35 → 1.0.1-alpha.37
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 +14 -6
- package/image/index.es.js +110 -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 +2887 -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,25 @@ export interface ImageProps {
|
|
|
271
271
|
unstyled?: boolean;
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
274
|
+
* Returns the full image URL or a ObjetctURL from Blob 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 ObjetctURL from Blob (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 ObjetctURL from Blob. Returns `undefined` if the path is invalid.
|
|
284
|
+
* @example res.blob().then((blob) => resolve(URL.createObjectURL(blob)))
|
|
285
|
+
*
|
|
279
286
|
*/
|
|
280
287
|
getImageURL?: (
|
|
281
288
|
path?: string | null,
|
|
282
289
|
width?: number,
|
|
283
290
|
height?: number,
|
|
284
|
-
|
|
291
|
+
returnURLOnly?: boolean, // Default is undefined or will return Promise when using Auth, when it manually sets to true, return the url only
|
|
292
|
+
) => string | undefined | Promise<string | undefined>;
|
|
285
293
|
|
|
286
294
|
/**
|
|
287
295
|
* 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,118 @@ 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 or ObjectURL from Blob e.g 'blob:http://localhost:5173/ca48705d-1fc1-4a74-af38-353ffce7e02a'
|
|
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
|
-
|
|
67
|
+
const l = (r = (t = i.value).getImageURL) == null ? void 0 : r.call(
|
|
68
|
+
t,
|
|
69
|
+
"preview",
|
|
70
|
+
void 0,
|
|
71
|
+
void 0,
|
|
72
|
+
!0
|
|
73
|
+
), 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
|
|
74
|
+
l instanceof Promise;
|
|
75
|
+
e = e.includes("http") && !B || // From public resource
|
|
76
|
+
e.includes("data:image/svg+xml") ? e : await ((c = (o = i.value).getImageURL) == null ? void 0 : c.call(o, a.src));
|
|
64
77
|
}
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
var
|
|
70
|
-
const t = (
|
|
71
|
-
(t ===
|
|
72
|
-
},
|
|
73
|
-
var
|
|
78
|
+
y.value = e || i.value.placeholder;
|
|
79
|
+
}, h = (e) => {
|
|
80
|
+
w(), typeof e == "number" && (s.value = e), S.value ? window.clearTimeout(S.value) : window.setTimeout(L, 3e3);
|
|
81
|
+
}, v = (e) => {
|
|
82
|
+
var r;
|
|
83
|
+
const t = (r = e.target) == null ? void 0 : r.src;
|
|
84
|
+
(t === m.value || t.includes(m.value.toString())) && (f.value = !0);
|
|
85
|
+
}, U = (e) => {
|
|
86
|
+
var r, o, c;
|
|
74
87
|
const t = e;
|
|
75
|
-
return typeof t == "string" ? t.includes("http") ? t : (
|
|
88
|
+
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
89
|
};
|
|
77
90
|
return (e, t) => {
|
|
78
|
-
var
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
91
|
+
var r;
|
|
92
|
+
return u(), q(D(X), {
|
|
93
|
+
"image-class": e.imageClass,
|
|
94
|
+
"image-style": e.imageStyle,
|
|
95
|
+
preview: V.value,
|
|
96
|
+
pt: { root: (r = e.$preset.image) == null ? void 0 : r.root({ props: e.$props }) },
|
|
97
|
+
"zoom-in-disabled": e.zoomInDisabled,
|
|
98
|
+
"zoom-out-disabled": e.zoomOutDisabled,
|
|
99
|
+
onShow: G
|
|
100
|
+
}, {
|
|
83
101
|
image: b(() => {
|
|
84
|
-
var
|
|
102
|
+
var o;
|
|
85
103
|
return [
|
|
86
|
-
|
|
87
|
-
onerror:
|
|
88
|
-
src:
|
|
104
|
+
$("img", T((o = e.$preset.image) == null ? void 0 : o.image({ props: e.$props, context: { imageSize: R.value } }), {
|
|
105
|
+
onerror: v,
|
|
106
|
+
src: D(m),
|
|
89
107
|
alt: ""
|
|
90
|
-
}), null, 16,
|
|
108
|
+
}), null, 16, ee)
|
|
91
109
|
];
|
|
92
110
|
}),
|
|
93
111
|
indicatoricon: b(() => [
|
|
94
|
-
C(
|
|
112
|
+
C(Y, T(e.$preset.image.icon, { icon: "eye" }), null, 16)
|
|
95
113
|
]),
|
|
96
|
-
preview: b((
|
|
97
|
-
var
|
|
114
|
+
preview: b((o) => {
|
|
115
|
+
var c;
|
|
98
116
|
return [
|
|
99
|
-
(
|
|
100
|
-
(
|
|
101
|
-
key:
|
|
102
|
-
onerror:
|
|
103
|
-
src:
|
|
104
|
-
style: k(
|
|
117
|
+
(c = e.galleries) != null && c.length ? (u(), g(z, { key: 1 }, [
|
|
118
|
+
(u(!0), g(z, null, O(e.galleries, ({ src: l }, n) => x((u(), g("img", {
|
|
119
|
+
key: n,
|
|
120
|
+
onerror: v,
|
|
121
|
+
src: U(l),
|
|
122
|
+
style: k(o.style),
|
|
105
123
|
alt: "",
|
|
106
124
|
"data-wv-section": "image-gallery"
|
|
107
|
-
}, null, 12,
|
|
108
|
-
[H,
|
|
125
|
+
}, null, 12, ae)), [
|
|
126
|
+
[H, n === s.value]
|
|
109
127
|
])), 128)),
|
|
110
|
-
|
|
111
|
-
onClick: t[0] || (t[0] =
|
|
128
|
+
$("div", {
|
|
129
|
+
onClick: t[0] || (t[0] = P(() => {
|
|
112
130
|
}, ["stop"])),
|
|
113
131
|
class: "fixed bottom-0 left-0 flex justify-center items-center w-full p-4 mx-auto flex-row bg-black/80",
|
|
114
132
|
"data-wv-section": "gallery-thumbnail"
|
|
115
133
|
}, [
|
|
116
|
-
C(
|
|
117
|
-
class:
|
|
134
|
+
C(E, {
|
|
135
|
+
class: _([
|
|
118
136
|
"text-surface-0 rotate-180 sticky left-0 !w-8 !h-8 [&_i]:w-5 [&_i]:h-5",
|
|
119
137
|
"rounded-full mr-3"
|
|
120
138
|
]),
|
|
121
|
-
onClick:
|
|
139
|
+
onClick: A,
|
|
122
140
|
"aria-label": "Previous Image",
|
|
123
141
|
"data-wv-section": "prev-button",
|
|
124
142
|
icon: "arrow-right",
|
|
@@ -126,25 +144,25 @@ const Y = ["src"], Z = ["src"], ee = ["src"], te = ["src", "onClick"], ne = /* @
|
|
|
126
144
|
severity: "secondary",
|
|
127
145
|
text: ""
|
|
128
146
|
}),
|
|
129
|
-
(
|
|
130
|
-
key:
|
|
131
|
-
class:
|
|
147
|
+
(u(!0), g(z, null, O(e.galleries, ({ src: l }, n) => (u(), g("img", {
|
|
148
|
+
key: n,
|
|
149
|
+
class: _([
|
|
132
150
|
"h-10 w-10 object-cover cursor-pointer opacity-50 hover:opacity-100 transition-opacity",
|
|
133
|
-
{ "!opacity-100":
|
|
151
|
+
{ "!opacity-100": s.value == n }
|
|
134
152
|
]),
|
|
135
|
-
onerror:
|
|
136
|
-
src:
|
|
137
|
-
style: k(
|
|
138
|
-
onClick:
|
|
153
|
+
onerror: v,
|
|
154
|
+
src: U(l),
|
|
155
|
+
style: k(o.style),
|
|
156
|
+
onClick: P((B) => h(n), ["stop"]),
|
|
139
157
|
alt: "",
|
|
140
158
|
"data-wv-section": "thumbnail-image"
|
|
141
|
-
}, null, 14,
|
|
142
|
-
C(
|
|
143
|
-
class:
|
|
159
|
+
}, null, 14, re))), 128)),
|
|
160
|
+
C(E, {
|
|
161
|
+
class: _([
|
|
144
162
|
"text-surface-0 sticky !w-8 !h-8 [&_i]:w-5 [&_i]:h-5",
|
|
145
163
|
"rounded-full ml-3"
|
|
146
164
|
]),
|
|
147
|
-
onClick:
|
|
165
|
+
onClick: j,
|
|
148
166
|
"aria-label": "Next Image",
|
|
149
167
|
"data-wv-section": "next-button",
|
|
150
168
|
icon: "arrow-right",
|
|
@@ -152,20 +170,20 @@ const Y = ["src"], Z = ["src"], ee = ["src"], te = ["src", "onClick"], ne = /* @
|
|
|
152
170
|
text: ""
|
|
153
171
|
})
|
|
154
172
|
])
|
|
155
|
-
], 64)) : (
|
|
173
|
+
], 64)) : (u(), g("img", {
|
|
156
174
|
key: 0,
|
|
157
|
-
onerror:
|
|
158
|
-
src:
|
|
159
|
-
style: k(
|
|
175
|
+
onerror: v,
|
|
176
|
+
src: y.value,
|
|
177
|
+
style: k(o.style),
|
|
160
178
|
alt: ""
|
|
161
|
-
}, null, 12,
|
|
179
|
+
}, null, 12, te))
|
|
162
180
|
];
|
|
163
181
|
}),
|
|
164
182
|
_: 1
|
|
165
|
-
},
|
|
183
|
+
}, 8, ["image-class", "image-style", "preview", "pt", "zoom-in-disabled", "zoom-out-disabled"]);
|
|
166
184
|
};
|
|
167
185
|
}
|
|
168
186
|
});
|
|
169
187
|
export {
|
|
170
|
-
|
|
188
|
+
me as _
|
|
171
189
|
};
|