@fewangsit/wangsvue-fats 1.0.1-alpha.21 → 1.0.1-alpha.23
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/buttonscan/index.d.ts +1 -1
- package/buttonscan/index.es.js +23 -22
- package/datatable/index.d.ts +8 -1
- package/datatable/index.es.js +367 -363
- package/dialogprintqr/index.es.js +2 -2
- package/languageswitcher/index.es.js +30 -29
- package/package.json +1 -1
- package/plugins/basei18n.es.js +59 -58
- package/stats.html +1 -1
- package/style.css +1 -1
- package/utils/cookie.util.d.ts +18 -0
- package/utils/cookie.util.es.js +19 -0
- package/wangsvue-fats.esm.browser.js +4207 -4188
- package/wangsvue-fats.system.js +70 -70
|
@@ -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
|
})
|
|
@@ -1,51 +1,52 @@
|
|
|
1
|
-
import { defineComponent as h, onMounted as v, shallowRef as i, watch as w, createBlock as
|
|
1
|
+
import { defineComponent as h, onMounted as v, shallowRef as i, watch as w, createBlock as u, openBlock as c, unref as _, withCtx as s, createVNode as g, createCommentVNode as y } from "vue";
|
|
2
2
|
import { u as L } from "../plugins/basei18n.es.js";
|
|
3
|
+
import { g as C } from "../utils/cookie.util.es.js";
|
|
3
4
|
import { s as x } from "../vendor/primevue/dropdown/dropdown.esm.es.js";
|
|
4
|
-
import { _ as
|
|
5
|
+
import { _ as k } from "../icon/index.es.js";
|
|
5
6
|
import { _ as p } from "../languagedropdownoption/index.es.js";
|
|
6
|
-
const
|
|
7
|
+
const N = /* @__PURE__ */ h({
|
|
7
8
|
__name: "LanguageSwitcher",
|
|
8
|
-
setup(
|
|
9
|
+
setup(O) {
|
|
9
10
|
v(async () => {
|
|
10
|
-
|
|
11
|
+
t.value = await f();
|
|
11
12
|
});
|
|
12
|
-
const { service: r, setLocale: m } = L(),
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
13
|
+
const { service: r, setLocale: m } = L(), t = i(), a = i([]), l = i(!1), f = async () => {
|
|
14
|
+
const o = C("lang") || navigator.language.split("-")[0];
|
|
15
|
+
if (!a.value.length)
|
|
15
16
|
try {
|
|
16
|
-
const e = await r.getLanguageOptionMeta(
|
|
17
|
+
const e = await r.getLanguageOptionMeta(o);
|
|
17
18
|
if (e.isoCode)
|
|
18
|
-
return
|
|
19
|
+
return a.value[0] = e, e;
|
|
19
20
|
} catch (e) {
|
|
20
21
|
console.error(
|
|
21
22
|
"Ups! Something error while fetching Language Option Meta.",
|
|
22
23
|
e
|
|
23
24
|
);
|
|
24
25
|
}
|
|
25
|
-
return
|
|
26
|
+
return a.value.find((e) => e.isoCode === o) || a.value[0];
|
|
26
27
|
}, d = async () => {
|
|
27
|
-
if (!(!r ||
|
|
28
|
+
if (!(!r || a.value.length > 1))
|
|
28
29
|
try {
|
|
29
30
|
l.value = !0;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
} catch (
|
|
31
|
+
const o = await r.getLanguageOptions();
|
|
32
|
+
a.value = o;
|
|
33
|
+
} catch (o) {
|
|
33
34
|
console.error(
|
|
34
35
|
"Ups! Something error while fetching language options.",
|
|
35
|
-
|
|
36
|
+
o
|
|
36
37
|
);
|
|
37
38
|
} finally {
|
|
38
39
|
l.value = !1;
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
|
-
return w(
|
|
42
|
-
m(
|
|
43
|
-
}), (
|
|
44
|
-
modelValue:
|
|
45
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
42
|
+
return w(t, (o) => {
|
|
43
|
+
m(o.isoCode);
|
|
44
|
+
}), (o, e) => (c(), u(_(x), {
|
|
45
|
+
modelValue: t.value,
|
|
46
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => t.value = n),
|
|
46
47
|
"filter-fields": ["language", "name"],
|
|
47
48
|
loading: l.value,
|
|
48
|
-
options:
|
|
49
|
+
options: a.value,
|
|
49
50
|
pt: {
|
|
50
51
|
root: {
|
|
51
52
|
class: "flex items-center gap-1 gap-1"
|
|
@@ -64,25 +65,25 @@ const b = /* @__PURE__ */ h({
|
|
|
64
65
|
"filter-placeholder": "Search language"
|
|
65
66
|
}, {
|
|
66
67
|
dropdownicon: s(() => [
|
|
67
|
-
g(
|
|
68
|
+
g(k, {
|
|
68
69
|
class: "w-4 h-4 rotate-180 text-general-800 transition-transform",
|
|
69
70
|
icon: "arrow-up-s"
|
|
70
71
|
})
|
|
71
72
|
]),
|
|
72
|
-
value: s(({ value:
|
|
73
|
-
|
|
73
|
+
value: s(({ value: n }) => [
|
|
74
|
+
n ? (c(), u(p, {
|
|
74
75
|
key: 0,
|
|
75
|
-
option:
|
|
76
|
+
option: n,
|
|
76
77
|
"icon-only": ""
|
|
77
78
|
}, null, 8, ["option"])) : y("", !0)
|
|
78
79
|
]),
|
|
79
|
-
option: s(({ option:
|
|
80
|
-
g(p, { option:
|
|
80
|
+
option: s(({ option: n }) => [
|
|
81
|
+
g(p, { option: n }, null, 8, ["option"])
|
|
81
82
|
]),
|
|
82
83
|
_: 1
|
|
83
84
|
}, 8, ["modelValue", "loading", "options"]));
|
|
84
85
|
}
|
|
85
86
|
});
|
|
86
87
|
export {
|
|
87
|
-
|
|
88
|
+
N as _
|
|
88
89
|
};
|
package/package.json
CHANGED
package/plugins/basei18n.es.js
CHANGED
|
@@ -1,88 +1,89 @@
|
|
|
1
|
-
import { shallowRef as
|
|
2
|
-
import { u as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { shallowRef as m, shallowReactive as P, inject as I } from "vue";
|
|
2
|
+
import { u as M } from "../assetinfo/index.es.js";
|
|
3
|
+
import { s as b, g as y } from "../utils/cookie.util.es.js";
|
|
4
|
+
const s = m(), u = "messages";
|
|
5
|
+
let o;
|
|
5
6
|
const f = () => {
|
|
6
7
|
try {
|
|
7
|
-
const
|
|
8
|
-
return
|
|
8
|
+
const e = localStorage.getItem(u);
|
|
9
|
+
return e ? JSON.parse(e) : {};
|
|
9
10
|
} catch {
|
|
10
11
|
return {};
|
|
11
12
|
}
|
|
12
|
-
},
|
|
13
|
-
get: (
|
|
14
|
-
const l = f()[
|
|
15
|
-
return
|
|
13
|
+
}, i = P(f()), r = new Proxy(i, {
|
|
14
|
+
get: (e, t) => {
|
|
15
|
+
const l = f()[t];
|
|
16
|
+
return i[t] = l, l;
|
|
16
17
|
},
|
|
17
|
-
set: (
|
|
18
|
-
}),
|
|
19
|
-
localStorage.setItem(u, JSON.stringify(
|
|
20
|
-
},
|
|
21
|
-
var
|
|
22
|
-
if (!(
|
|
23
|
-
const { setLoading:
|
|
24
|
-
|
|
18
|
+
set: (e, t, n) => (i[t] = n, x(i), !0)
|
|
19
|
+
}), x = (e) => {
|
|
20
|
+
localStorage.setItem(u, JSON.stringify(e));
|
|
21
|
+
}, A = async (e) => {
|
|
22
|
+
var t;
|
|
23
|
+
if (!(e in r)) {
|
|
24
|
+
const { setLoading: n } = M();
|
|
25
|
+
n(!0, "Loading language package...");
|
|
25
26
|
let l = {};
|
|
26
27
|
try {
|
|
27
|
-
const { data: c } = await (((
|
|
28
|
+
const { data: c } = await (((t = o == null ? void 0 : o.getMessages) == null ? void 0 : t.call(o, e)) ?? {});
|
|
28
29
|
l = c.data;
|
|
29
30
|
} catch {
|
|
30
31
|
} finally {
|
|
31
|
-
|
|
32
|
+
n(!1);
|
|
32
33
|
}
|
|
33
34
|
return l;
|
|
34
35
|
}
|
|
35
|
-
return
|
|
36
|
-
}, d = (
|
|
36
|
+
return r[e];
|
|
37
|
+
}, d = (e, ...t) => {
|
|
37
38
|
var c;
|
|
38
|
-
if (!
|
|
39
|
-
let
|
|
40
|
-
const l =
|
|
41
|
-
if ((!
|
|
42
|
-
|
|
43
|
-
...
|
|
44
|
-
[
|
|
45
|
-
} :
|
|
46
|
-
[
|
|
39
|
+
if (!s.value && !y("lang")) return e;
|
|
40
|
+
let n = (c = r[s.value]) == null ? void 0 : c[e];
|
|
41
|
+
const l = n === e && s.value !== "en";
|
|
42
|
+
if ((!n || l) && (n = e, o == null || o.translateText(e, s.value).then((a) => {
|
|
43
|
+
r[s.value] ? r[s.value] = {
|
|
44
|
+
...r[s.value],
|
|
45
|
+
[e]: a
|
|
46
|
+
} : r[s.value] = {
|
|
47
|
+
[e]: a
|
|
47
48
|
};
|
|
48
|
-
}).catch((
|
|
49
|
-
console.error("Translation error:",
|
|
50
|
-
})),
|
|
51
|
-
const
|
|
52
|
-
return Object.keys(
|
|
53
|
-
(h,
|
|
54
|
-
|
|
49
|
+
}).catch((a) => {
|
|
50
|
+
console.error("Translation error:", a);
|
|
51
|
+
})), t.length === 1 && typeof t[0] == "object" && !Array.isArray(t[0])) {
|
|
52
|
+
const a = t[0];
|
|
53
|
+
return Object.keys(a).reduce(
|
|
54
|
+
(h, g) => h.replaceAll(`{${g}}`, a[g]),
|
|
55
|
+
n
|
|
55
56
|
);
|
|
56
57
|
}
|
|
57
|
-
if (
|
|
58
|
-
let
|
|
59
|
-
return
|
|
58
|
+
if (t.length > 0) {
|
|
59
|
+
let a = 0;
|
|
60
|
+
return n.replace(/%s/g, () => String(t[a++] ?? ""));
|
|
60
61
|
}
|
|
61
|
-
return
|
|
62
|
-
}, v = async (
|
|
63
|
-
if (
|
|
64
|
-
const
|
|
65
|
-
|
|
62
|
+
return n;
|
|
63
|
+
}, v = async (e) => {
|
|
64
|
+
if (s.value !== e) {
|
|
65
|
+
const t = await A(e);
|
|
66
|
+
s.value = e, r[e] = t, b({ name: "lang", value: s.value, path: "/" });
|
|
66
67
|
}
|
|
67
|
-
},
|
|
68
|
+
}, E = () => (I("i18n") || console.error("I18n Plugin not installed!"), {
|
|
68
69
|
t: d,
|
|
69
|
-
locale:
|
|
70
|
+
locale: s,
|
|
70
71
|
setLocale: v,
|
|
71
|
-
service:
|
|
72
|
-
}),
|
|
73
|
-
const
|
|
72
|
+
service: o
|
|
73
|
+
}), O = () => {
|
|
74
|
+
const e = {
|
|
74
75
|
t: d,
|
|
75
|
-
locale:
|
|
76
|
+
locale: s,
|
|
76
77
|
setLocale: v,
|
|
77
|
-
service:
|
|
78
|
+
service: o
|
|
78
79
|
};
|
|
79
80
|
return {
|
|
80
|
-
install(
|
|
81
|
-
|
|
81
|
+
install(t) {
|
|
82
|
+
t.config.globalProperties.$i18n = e, t.config.globalProperties.$t = e.t, t.provide("i18n", e);
|
|
82
83
|
}
|
|
83
84
|
};
|
|
84
|
-
},
|
|
85
|
+
}, R = (e) => (o = e, O());
|
|
85
86
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
R as c,
|
|
88
|
+
E as u
|
|
88
89
|
};
|