@das-fed/upf-web 6.4.0-hot.4 → 6.4.0-hot.6
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/es5.js +13 -13
- package/{index-Dv9DDevb.js → index-BhEtGWg9.js} +1 -1
- package/index-BhEtGWg9.js.gz +0 -0
- package/{index-D5VSmbe-.js → index-CihmHNMg.js} +1 -1
- package/{index-DTDqZtIi.js → index-ClQkHyu0.js} +115 -117
- package/index-ClQkHyu0.js.gz +0 -0
- package/index.js +1 -1
- package/package.json +6 -6
- package/packages/create-das-web-app/es5.js +87 -87
- package/packages/create-das-web-app/index.js +71 -72
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +18 -18
- package/packages/i18n/index.js +17 -17
- package/packages/i18n/index.js.gz +0 -0
- package/packages/layout/index.js.gz +0 -0
- package/packages/micro-frontend/index.js.gz +0 -0
- package/index-DTDqZtIi.js.gz +0 -0
- package/index-Dv9DDevb.js.gz +0 -0
package/packages/i18n/es5.js
CHANGED
|
@@ -8,14 +8,14 @@ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.
|
|
|
8
8
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
9
9
|
var vue = require('vue');
|
|
10
10
|
var commonTools = require('@das-fed/upf-utils/common-tools');
|
|
11
|
-
var
|
|
12
|
-
i = vue.reactive({}),
|
|
11
|
+
var C = "language",
|
|
13
12
|
l = vue.reactive({}),
|
|
13
|
+
i = vue.reactive({}),
|
|
14
14
|
m = vue.reactive({}),
|
|
15
15
|
h = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
16
|
-
j = h || window.localStorage.getItem(
|
|
16
|
+
j = h || window.localStorage.getItem(C) || window.navigator.language || "zh-CN",
|
|
17
17
|
c = vue.ref(j),
|
|
18
|
-
|
|
18
|
+
b = "dasI18n",
|
|
19
19
|
p = function p() {
|
|
20
20
|
var t = document.documentElement;
|
|
21
21
|
t && t.setAttribute("lang", c.value);
|
|
@@ -29,19 +29,19 @@ var D = "language",
|
|
|
29
29
|
var s = {};
|
|
30
30
|
for (var o in t) for (var n in t[o]) {
|
|
31
31
|
var _t$o$n;
|
|
32
|
-
s[n] || (s[n] = {}), s[n][o] = (_t$o$n = t[o][n]) !== null && _t$o$n !== void 0 ? _t$o$n : "", e && (
|
|
32
|
+
s[n] || (s[n] = {}), s[n][o] = (_t$o$n = t[o][n]) !== null && _t$o$n !== void 0 ? _t$o$n : "", e && (i[n] || (i[n] = {}), i[n][o] = s[n][o]), r && (l[n] || (l[n] = {}, console.log("".concat(l[n], "\u4E3A\u7A7A\uFF0C\u91CD\u65B0\u8BBE\u7F6E\u4E3A{}"))), l[n][o] = s[n][o]);
|
|
33
33
|
}
|
|
34
|
-
console.log("customLangeData
|
|
34
|
+
console.log("customLangeData===注入", l), console.log("globalLangeData===注入", i);
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
y = function y() {
|
|
37
37
|
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38
38
|
var a = arguments.length > 1 ? arguments[1] : undefined;
|
|
39
39
|
var s;
|
|
40
40
|
var e = a === "global",
|
|
41
41
|
r = !e;
|
|
42
|
-
for (var o in t) if (e && !
|
|
42
|
+
for (var o in t) if (e && !i[o] && (i[o] = t[o]), r) {
|
|
43
43
|
var n = (s = t[o]) != null && s._appCode ? t[o]._appCode.toLowerCase() : "";
|
|
44
|
-
n && (m[n] || (m[n] = {}), m[n][o] = t[o]),
|
|
44
|
+
n && (m[n] || (m[n] = {}), m[n][o] = t[o]), l[o] || (l[o] = t[o]);
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
R = /*#__PURE__*/function () {
|
|
@@ -51,8 +51,8 @@ var D = "language",
|
|
|
51
51
|
while (1) switch (_context.n) {
|
|
52
52
|
case 0:
|
|
53
53
|
p();
|
|
54
|
-
a = window[
|
|
55
|
-
a &&
|
|
54
|
+
a = window[b];
|
|
55
|
+
a && y(a, "global");
|
|
56
56
|
case 1:
|
|
57
57
|
return _context.a(2);
|
|
58
58
|
}
|
|
@@ -77,9 +77,9 @@ var D = "language",
|
|
|
77
77
|
var e = v(location.pathname);
|
|
78
78
|
var r = (_m$framework = m.framework) !== null && _m$framework !== void 0 ? _m$framework : {},
|
|
79
79
|
s = (_m$e = m[e]) !== null && _m$e !== void 0 ? _m$e : {},
|
|
80
|
-
o =
|
|
80
|
+
o = l[t] || i[t] || r[t] || s[t] || t;
|
|
81
81
|
if (o === t) return t;
|
|
82
|
-
console.log("customLangeData
|
|
82
|
+
console.log("customLangeData===获取时", l, l[t]), console.log("globalLangeData===获取时", i, i[t]), typeof o == "string" && (o = {
|
|
83
83
|
"zh-CN": o
|
|
84
84
|
});
|
|
85
85
|
var n = o[c.value];
|
|
@@ -101,7 +101,7 @@ var D = "language",
|
|
|
101
101
|
_ = function _() {
|
|
102
102
|
return c;
|
|
103
103
|
},
|
|
104
|
-
|
|
104
|
+
u = {
|
|
105
105
|
"en-US": {
|
|
106
106
|
ant: function ant() {
|
|
107
107
|
return Promise.resolve().then(function () {
|
|
@@ -270,7 +270,7 @@ var O = /*#__PURE__*/function () {
|
|
|
270
270
|
return _regenerator().w(function (_context2) {
|
|
271
271
|
while (1) switch (_context2.p = _context2.n) {
|
|
272
272
|
case 0:
|
|
273
|
-
a =
|
|
273
|
+
a = u[t] || u["zh-CN"];
|
|
274
274
|
_context2.p = 1;
|
|
275
275
|
_context2.n = 2;
|
|
276
276
|
return a.ant();
|
|
@@ -294,15 +294,15 @@ var O = /*#__PURE__*/function () {
|
|
|
294
294
|
};
|
|
295
295
|
}();
|
|
296
296
|
exports.currentLang = c;
|
|
297
|
-
exports.customLangeData =
|
|
297
|
+
exports.customLangeData = l;
|
|
298
298
|
exports.getDateFormat = x;
|
|
299
299
|
exports.getI18nRule = A;
|
|
300
300
|
exports.getLang = _;
|
|
301
301
|
exports.i18n = I;
|
|
302
302
|
exports.initI18n = R;
|
|
303
|
-
exports.languageKey =
|
|
303
|
+
exports.languageKey = C;
|
|
304
304
|
exports.loadLocale = O;
|
|
305
|
-
exports.setI18nRule =
|
|
305
|
+
exports.setI18nRule = y;
|
|
306
306
|
exports.setLang = T;
|
|
307
307
|
exports.setLangRule = M;
|
|
308
308
|
exports.t = N;
|
package/packages/i18n/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { getUrlParams as
|
|
3
|
-
const
|
|
1
|
+
import { reactive as g, ref as L, computed as w } from "vue";
|
|
2
|
+
import { getUrlParams as D } from "@das-fed/upf-utils/common-tools";
|
|
3
|
+
const C = "language", l = g({}), i = g({}), m = g({}), h = D(location.href, "uiCulture") || "", j = h || window.localStorage.getItem(C) || window.navigator.language || "zh-CN", c = L(j), b = "dasI18n", p = () => {
|
|
4
4
|
const t = document.documentElement;
|
|
5
5
|
t && t.setAttribute("lang", c.value);
|
|
6
6
|
}, M = (t = {}, a) => {
|
|
@@ -9,36 +9,36 @@ const D = "language", i = u({}), l = u({}), m = u({}), h = C(location.href, "uiC
|
|
|
9
9
|
const s = {};
|
|
10
10
|
for (const o in t)
|
|
11
11
|
for (const n in t[o])
|
|
12
|
-
s[n] || (s[n] = {}), s[n][o] = t[o][n] ?? "", e && (
|
|
13
|
-
console.log("customLangeData
|
|
14
|
-
},
|
|
12
|
+
s[n] || (s[n] = {}), s[n][o] = t[o][n] ?? "", e && (i[n] || (i[n] = {}), i[n][o] = s[n][o]), r && (l[n] || (l[n] = {}, console.log(`${l[n]}为空,重新设置为{}`)), l[n][o] = s[n][o]);
|
|
13
|
+
console.log("customLangeData===注入", l), console.log("globalLangeData===注入", i);
|
|
14
|
+
}, y = (t = {}, a) => {
|
|
15
15
|
var s;
|
|
16
16
|
const e = a === "global", r = !e;
|
|
17
17
|
for (const o in t)
|
|
18
|
-
if (e && !
|
|
18
|
+
if (e && !i[o] && (i[o] = t[o]), r) {
|
|
19
19
|
const n = (s = t[o]) != null && s._appCode ? t[o]._appCode.toLowerCase() : "";
|
|
20
|
-
n && (m[n] || (m[n] = {}), m[n][o] = t[o]),
|
|
20
|
+
n && (m[n] || (m[n] = {}), m[n][o] = t[o]), l[o] || (l[o] = t[o]);
|
|
21
21
|
}
|
|
22
22
|
}, R = async (t) => {
|
|
23
23
|
p();
|
|
24
|
-
const a = window[
|
|
25
|
-
a &&
|
|
24
|
+
const a = window[b];
|
|
25
|
+
a && y(a, "global");
|
|
26
26
|
}, v = (t) => {
|
|
27
27
|
let a = "";
|
|
28
28
|
const e = /\/([^\/]+)\/([^\/]+)\//, r = t.match(e);
|
|
29
29
|
return r && r.length >= 3 && (a = r[1] + "/" + r[2]), a ? a.toLowerCase() : "";
|
|
30
30
|
}, A = (t, ...a) => w(() => {
|
|
31
31
|
const e = v(location.pathname);
|
|
32
|
-
let r = m.framework ?? {}, s = m[e] ?? {}, o =
|
|
32
|
+
let r = m.framework ?? {}, s = m[e] ?? {}, o = l[t] || i[t] || r[t] || s[t] || t;
|
|
33
33
|
if (o === t) return t;
|
|
34
|
-
console.log("customLangeData
|
|
34
|
+
console.log("customLangeData===获取时", l, l[t]), console.log("globalLangeData===获取时", i, i[t]), typeof o == "string" && (o = { "zh-CN": o });
|
|
35
35
|
let n = o[c.value];
|
|
36
36
|
return c.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (n = o["zh-cn"]), a.map((f, d) => {
|
|
37
37
|
n && (n = n.replace(`$${d}`, f));
|
|
38
38
|
}), n;
|
|
39
39
|
}), I = A, N = (t, ...a) => I(t, ...a).value, T = (t) => {
|
|
40
40
|
c.value = t, console.log("currentLang.value===", c.value), p();
|
|
41
|
-
}, _ = () => c,
|
|
41
|
+
}, _ = () => c, u = {
|
|
42
42
|
"en-US": { ant: () => import("ant-design-vue/es/locale/en_US"), dayjs: () => import("dayjs/locale/en") },
|
|
43
43
|
"zh-CN": { ant: () => import("ant-design-vue/es/locale/zh_CN"), dayjs: () => import("dayjs/locale/zh-cn") },
|
|
44
44
|
"zh-MO": { ant: () => import("ant-design-vue/es/locale/zh_TW"), dayjs: () => import("dayjs/locale/zh-tw") },
|
|
@@ -59,7 +59,7 @@ function x(t, a) {
|
|
|
59
59
|
return e && e[t] && e[t][a] ? e[t][a] : ((r = window.DATE_FORMAT_MAP[t]) == null ? void 0 : r[a]) || "YYYY-MM-DD";
|
|
60
60
|
}
|
|
61
61
|
const O = async (t) => {
|
|
62
|
-
const a =
|
|
62
|
+
const a = u[t] || u["zh-CN"];
|
|
63
63
|
try {
|
|
64
64
|
const e = await a.ant();
|
|
65
65
|
return await a.dayjs(), e.default;
|
|
@@ -69,15 +69,15 @@ const O = async (t) => {
|
|
|
69
69
|
};
|
|
70
70
|
export {
|
|
71
71
|
c as currentLang,
|
|
72
|
-
|
|
72
|
+
l as customLangeData,
|
|
73
73
|
x as getDateFormat,
|
|
74
74
|
A as getI18nRule,
|
|
75
75
|
_ as getLang,
|
|
76
76
|
I as i18n,
|
|
77
77
|
R as initI18n,
|
|
78
|
-
|
|
78
|
+
C as languageKey,
|
|
79
79
|
O as loadLocale,
|
|
80
|
-
|
|
80
|
+
y as setI18nRule,
|
|
81
81
|
T as setLang,
|
|
82
82
|
M as setLangRule,
|
|
83
83
|
N as t
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index-DTDqZtIi.js.gz
DELETED
|
Binary file
|
package/index-Dv9DDevb.js.gz
DELETED
|
Binary file
|