@fewangsit/wangsvue-fats 1.0.1-alpha.37 → 1.0.1-alpha.39
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.es.js +87 -81
- package/package.json +1 -1
- package/stats.html +1 -1
- package/style.css +1 -1
- package/utils/date.util.es.js +45 -32
- package/wangsvue-fats.esm.browser.js +2688 -2669
- package/wangsvue-fats.system.js +43 -43
|
@@ -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
|
+
}), S = /* @__PURE__ */ I(R, [["__scopeId", "data-v-9031c32d"]]);
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
S 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-015be0a0"]]);
|
|
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\r
|
|
235
|
+
label that printed or not. It does not show the\r
|
|
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
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as
|
|
4
|
-
import { m as
|
|
5
|
-
import { s as
|
|
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";
|
|
6
6
|
import { _ as E } from "../button/index.es.js";
|
|
7
|
-
import { _ as
|
|
8
|
-
const
|
|
7
|
+
import { _ as ee } from "../icon/index.es.js";
|
|
8
|
+
const te = ["src"], ae = ["src"], oe = ["src"], le = ["src", "onClick"], ge = /* @__PURE__ */ W({
|
|
9
9
|
__name: "Image",
|
|
10
10
|
props: {
|
|
11
11
|
src: {},
|
|
@@ -26,117 +26,123 @@ const ee = ["src"], te = ["src"], ae = ["src"], re = ["src", "onClick"], me = /*
|
|
|
26
26
|
placeholder: {}
|
|
27
27
|
},
|
|
28
28
|
setup(F) {
|
|
29
|
-
const a = F, { defaultProps: N } =
|
|
30
|
-
|
|
29
|
+
const a = F, { defaultProps: N } = Q("Image"), i = I(() => X(a, N));
|
|
30
|
+
Z(() => {
|
|
31
31
|
setTimeout(() => {
|
|
32
|
-
|
|
32
|
+
_();
|
|
33
33
|
}, 3e3);
|
|
34
|
-
}),
|
|
35
|
-
|
|
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);
|
|
36
37
|
});
|
|
37
|
-
const s = d(0), p = d(),
|
|
38
|
+
const s = d(0), p = d(), C = d(), f = d(!1), y = [], V = I(() => {
|
|
38
39
|
var e;
|
|
39
|
-
return a.preview === !1 ? !1 : !f.value && !((e =
|
|
40
|
-
}),
|
|
40
|
+
return a.preview === !1 ? !1 : !f.value && !((e = n.value) != null && e.toString().includes("data:image/png;base64")) && n.value !== i.value.placeholder;
|
|
41
|
+
}), A = () => {
|
|
41
42
|
const e = a.galleries ?? [];
|
|
42
|
-
s.value = (s.value + 1) % e.length,
|
|
43
|
-
},
|
|
43
|
+
s.value = (s.value + 1) % e.length, b();
|
|
44
|
+
}, G = () => {
|
|
44
45
|
const e = a.galleries ?? [];
|
|
45
|
-
s.value = (s.value - 1 + e.length) % e.length,
|
|
46
|
-
},
|
|
46
|
+
s.value = (s.value - 1 + e.length) % e.length, b();
|
|
47
|
+
}, _ = () => {
|
|
47
48
|
var e;
|
|
48
|
-
|
|
49
|
+
h(), (e = a.galleries) != null && e.length && (p.value = window.setInterval(() => {
|
|
49
50
|
const t = a.galleries ?? [];
|
|
50
51
|
s.value = (s.value + 1) % t.length;
|
|
51
52
|
}, 3e3));
|
|
52
|
-
},
|
|
53
|
+
}, h = () => {
|
|
53
54
|
p.value && (window.clearInterval(p.value), p.value = void 0);
|
|
54
|
-
},
|
|
55
|
+
}, S = I(() => a.width != null ? a.width : a.size === "small" ? 30 : a.size === "medium" ? 80 : 125), n = K(
|
|
55
56
|
async () => {
|
|
56
57
|
var e, t;
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
if (!a.src || f.value) return i.value.placeholder;
|
|
59
|
+
if (typeof a.src == "string") {
|
|
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;
|
|
63
|
+
}
|
|
64
|
+
return a.src;
|
|
59
65
|
},
|
|
60
66
|
i.value.placeholder
|
|
61
67
|
// Show placeholder while fetching image
|
|
62
|
-
),
|
|
63
|
-
var t,
|
|
64
|
-
if (
|
|
65
|
-
let e =
|
|
68
|
+
), w = d(), M = async () => {
|
|
69
|
+
var t, o, l, u;
|
|
70
|
+
if (w.value != null) return;
|
|
71
|
+
let e = n.value;
|
|
66
72
|
if (typeof e == "string") {
|
|
67
|
-
const
|
|
73
|
+
const r = (o = (t = i.value).getImageURL) == null ? void 0 : o.call(
|
|
68
74
|
t,
|
|
69
75
|
"preview",
|
|
70
76
|
void 0,
|
|
71
77
|
void 0,
|
|
72
78
|
!0
|
|
73
|
-
),
|
|
74
|
-
|
|
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;
|
|
75
81
|
e = e.includes("http") && !B || // From public resource
|
|
76
|
-
e.includes("data:image/svg+xml") ? e : await ((
|
|
82
|
+
e.includes("data:image/svg+xml") ? e : await ((u = (l = i.value).getImageURL) == null ? void 0 : u.call(l, a.src));
|
|
77
83
|
}
|
|
78
|
-
y.value = e || i.value.placeholder;
|
|
79
|
-
},
|
|
80
|
-
|
|
84
|
+
typeof e == "string" && e.includes("blob") && y.push(e), w.value = e || i.value.placeholder;
|
|
85
|
+
}, b = (e) => {
|
|
86
|
+
h(), typeof e == "number" && (s.value = e), C.value ? window.clearTimeout(C.value) : window.setTimeout(_, 3e3);
|
|
81
87
|
}, v = (e) => {
|
|
82
|
-
var
|
|
83
|
-
const t = (
|
|
84
|
-
(t ===
|
|
85
|
-
},
|
|
86
|
-
var
|
|
88
|
+
var o;
|
|
89
|
+
const t = (o = e.target) == null ? void 0 : o.src;
|
|
90
|
+
(t === n.value || t.includes(n.value.toString())) && (f.value = !0);
|
|
91
|
+
}, O = (e) => {
|
|
92
|
+
var o, l, u;
|
|
87
93
|
const t = e;
|
|
88
|
-
return typeof t == "string" ? t.includes("http") ? t : (
|
|
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;
|
|
89
95
|
};
|
|
90
96
|
return (e, t) => {
|
|
91
|
-
var
|
|
92
|
-
return
|
|
97
|
+
var o;
|
|
98
|
+
return m(), x($(Y), {
|
|
93
99
|
"image-class": e.imageClass,
|
|
94
100
|
"image-style": e.imageStyle,
|
|
95
101
|
preview: V.value,
|
|
96
|
-
pt: { root: (
|
|
102
|
+
pt: { root: (o = e.$preset.image) == null ? void 0 : o.root({ props: e.$props }) },
|
|
97
103
|
"zoom-in-disabled": e.zoomInDisabled,
|
|
98
104
|
"zoom-out-disabled": e.zoomOutDisabled,
|
|
99
|
-
onShow:
|
|
105
|
+
onShow: M
|
|
100
106
|
}, {
|
|
101
|
-
image:
|
|
102
|
-
var
|
|
107
|
+
image: k(() => {
|
|
108
|
+
var l;
|
|
103
109
|
return [
|
|
104
|
-
|
|
110
|
+
j("img", T((l = e.$preset.image) == null ? void 0 : l.image({ props: e.$props, context: { imageSize: S.value } }), {
|
|
105
111
|
onerror: v,
|
|
106
|
-
src:
|
|
112
|
+
src: $(n),
|
|
107
113
|
alt: ""
|
|
108
|
-
}), null, 16,
|
|
114
|
+
}), null, 16, te)
|
|
109
115
|
];
|
|
110
116
|
}),
|
|
111
|
-
indicatoricon:
|
|
112
|
-
|
|
117
|
+
indicatoricon: k(() => [
|
|
118
|
+
R(ee, T(e.$preset.image.icon, { icon: "eye" }), null, 16)
|
|
113
119
|
]),
|
|
114
|
-
preview:
|
|
115
|
-
var
|
|
120
|
+
preview: k((l) => {
|
|
121
|
+
var u;
|
|
116
122
|
return [
|
|
117
|
-
(
|
|
118
|
-
(
|
|
119
|
-
key:
|
|
123
|
+
(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", {
|
|
125
|
+
key: c,
|
|
120
126
|
onerror: v,
|
|
121
|
-
src:
|
|
122
|
-
style:
|
|
127
|
+
src: O(r),
|
|
128
|
+
style: z(l.style),
|
|
123
129
|
alt: "",
|
|
124
130
|
"data-wv-section": "image-gallery"
|
|
125
|
-
}, null, 12,
|
|
126
|
-
[
|
|
131
|
+
}, null, 12, oe)), [
|
|
132
|
+
[J, c === s.value]
|
|
127
133
|
])), 128)),
|
|
128
|
-
|
|
134
|
+
j("div", {
|
|
129
135
|
onClick: t[0] || (t[0] = P(() => {
|
|
130
136
|
}, ["stop"])),
|
|
131
137
|
class: "fixed bottom-0 left-0 flex justify-center items-center w-full p-4 mx-auto flex-row bg-black/80",
|
|
132
138
|
"data-wv-section": "gallery-thumbnail"
|
|
133
139
|
}, [
|
|
134
|
-
|
|
135
|
-
class:
|
|
140
|
+
R(E, {
|
|
141
|
+
class: U([
|
|
136
142
|
"text-surface-0 rotate-180 sticky left-0 !w-8 !h-8 [&_i]:w-5 [&_i]:h-5",
|
|
137
143
|
"rounded-full mr-3"
|
|
138
144
|
]),
|
|
139
|
-
onClick:
|
|
145
|
+
onClick: G,
|
|
140
146
|
"aria-label": "Previous Image",
|
|
141
147
|
"data-wv-section": "prev-button",
|
|
142
148
|
icon: "arrow-right",
|
|
@@ -144,25 +150,25 @@ const ee = ["src"], te = ["src"], ae = ["src"], re = ["src", "onClick"], me = /*
|
|
|
144
150
|
severity: "secondary",
|
|
145
151
|
text: ""
|
|
146
152
|
}),
|
|
147
|
-
(
|
|
148
|
-
key:
|
|
149
|
-
class:
|
|
153
|
+
(m(!0), g(L, null, D(e.galleries, ({ src: r }, c) => (m(), g("img", {
|
|
154
|
+
key: c,
|
|
155
|
+
class: U([
|
|
150
156
|
"h-10 w-10 object-cover cursor-pointer opacity-50 hover:opacity-100 transition-opacity",
|
|
151
|
-
{ "!opacity-100": s.value ==
|
|
157
|
+
{ "!opacity-100": s.value == c }
|
|
152
158
|
]),
|
|
153
159
|
onerror: v,
|
|
154
|
-
src:
|
|
155
|
-
style:
|
|
156
|
-
onClick: P((B) =>
|
|
160
|
+
src: O(r),
|
|
161
|
+
style: z(l.style),
|
|
162
|
+
onClick: P((B) => b(c), ["stop"]),
|
|
157
163
|
alt: "",
|
|
158
164
|
"data-wv-section": "thumbnail-image"
|
|
159
|
-
}, null, 14,
|
|
160
|
-
|
|
161
|
-
class:
|
|
165
|
+
}, null, 14, le))), 128)),
|
|
166
|
+
R(E, {
|
|
167
|
+
class: U([
|
|
162
168
|
"text-surface-0 sticky !w-8 !h-8 [&_i]:w-5 [&_i]:h-5",
|
|
163
169
|
"rounded-full ml-3"
|
|
164
170
|
]),
|
|
165
|
-
onClick:
|
|
171
|
+
onClick: A,
|
|
166
172
|
"aria-label": "Next Image",
|
|
167
173
|
"data-wv-section": "next-button",
|
|
168
174
|
icon: "arrow-right",
|
|
@@ -170,13 +176,13 @@ const ee = ["src"], te = ["src"], ae = ["src"], re = ["src", "onClick"], me = /*
|
|
|
170
176
|
text: ""
|
|
171
177
|
})
|
|
172
178
|
])
|
|
173
|
-
], 64)) : (
|
|
179
|
+
], 64)) : (m(), g("img", {
|
|
174
180
|
key: 0,
|
|
175
181
|
onerror: v,
|
|
176
|
-
src:
|
|
177
|
-
style:
|
|
182
|
+
src: w.value,
|
|
183
|
+
style: z(l.style),
|
|
178
184
|
alt: ""
|
|
179
|
-
}, null, 12,
|
|
185
|
+
}, null, 12, ae))
|
|
180
186
|
];
|
|
181
187
|
}),
|
|
182
188
|
_: 1
|
|
@@ -185,5 +191,5 @@ const ee = ["src"], te = ["src"], ae = ["src"], re = ["src", "onClick"], me = /*
|
|
|
185
191
|
}
|
|
186
192
|
});
|
|
187
193
|
export {
|
|
188
|
-
|
|
194
|
+
ge as _
|
|
189
195
|
};
|