@das-fed/upf-web 6.4.0-hot.1 → 6.4.0-hot.3
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 +2 -2
- package/{packages/main-app-framework/index-CTrEkjBn.js → index-BcEiAZYT.js} +1 -1
- package/index-BcEiAZYT.js.gz +0 -0
- package/{index-BrzqXXoy.js → index-CuxN_o3P.js} +7 -5
- package/index-CuxN_o3P.js.gz +0 -0
- package/{index-DYlUn0zE.js → index-Z2BfbNda.js} +1 -1
- package/index.js +1 -1
- package/package.json +6 -6
- package/packages/create-das-web-app/es5.js +105 -100
- package/packages/create-das-web-app/index.js +87 -83
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +53 -50
- package/packages/i18n/index.js +41 -37
- package/packages/i18n/index.js.gz +0 -0
- package/packages/main-app-framework/es5.js +58 -58
- package/{index-C23JhEM4.js → packages/main-app-framework/index-BotXvTrW.js} +1 -1
- package/packages/main-app-framework/index-BotXvTrW.js.gz +0 -0
- package/packages/main-app-framework/{index-DP_6ucmg.js → index-C8tjINrY.js} +1 -1
- package/packages/main-app-framework/{index-g8fpmsMz.js → index-qZN6TvxI.js} +1334 -1315
- package/packages/main-app-framework/index-qZN6TvxI.js.gz +0 -0
- package/packages/main-app-framework/index.js +1 -1
- package/packages/micro-frontend/index.js.gz +0 -0
- package/index-BrzqXXoy.js.gz +0 -0
- package/index-C23JhEM4.js.gz +0 -0
- package/packages/main-app-framework/index-CTrEkjBn.js.gz +0 -0
- package/packages/main-app-framework/index-g8fpmsMz.js.gz +0 -0
package/packages/i18n/es5.js
CHANGED
|
@@ -8,38 +8,40 @@ 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
|
-
|
|
13
|
-
c = vue.reactive({}),
|
|
11
|
+
var D = "language",
|
|
12
|
+
i = vue.reactive({}),
|
|
14
13
|
l = vue.reactive({}),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
m = vue.reactive({}),
|
|
15
|
+
h = commonTools.getUrlParams(location.href, "uiCulture") || "",
|
|
16
|
+
j = h || window.localStorage.getItem(D) || window.navigator.language || "zh-CN",
|
|
17
|
+
c = vue.ref(j),
|
|
18
|
+
y = "dasI18n",
|
|
19
19
|
g = function g() {
|
|
20
20
|
var t = document.documentElement;
|
|
21
|
-
t && t.setAttribute("lang",
|
|
21
|
+
t && t.setAttribute("lang", c.value);
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
M = function M() {
|
|
24
24
|
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
25
25
|
var a = arguments.length > 1 ? arguments[1] : undefined;
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
var e = a === "global",
|
|
27
|
+
r = !e;
|
|
28
|
+
console.log("setLangRule===", t, a);
|
|
29
|
+
var s = {};
|
|
29
30
|
for (var o in t) for (var n in t[o]) {
|
|
30
31
|
var _t$o$n;
|
|
31
|
-
|
|
32
|
+
s[n] || (s[n] = {}), s[n][o] = (_t$o$n = t[o][n]) !== null && _t$o$n !== void 0 ? _t$o$n : "", e && (l[n] || (l[n] = {}), l[n][o] = s[n][o]), r && (i[n] || (i[n] = {}), i[n][o] = s[n][o]);
|
|
32
33
|
}
|
|
34
|
+
console.log("customLangeData===", i), console.log("globalLangeData===", l);
|
|
33
35
|
},
|
|
34
36
|
b = function b() {
|
|
35
37
|
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
36
38
|
var a = arguments.length > 1 ? arguments[1] : undefined;
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
for (var o in t) if (
|
|
41
|
-
var n = (
|
|
42
|
-
n && (
|
|
39
|
+
var s;
|
|
40
|
+
var e = a === "global",
|
|
41
|
+
r = !e;
|
|
42
|
+
for (var o in t) if (e && !l[o] && (l[o] = t[o]), r) {
|
|
43
|
+
var n = (s = t[o]) != null && s._appCode ? t[o]._appCode.toLowerCase() : "";
|
|
44
|
+
n && (m[n] || (m[n] = {}), m[n][o] = t[o]), i[o] || (i[o] = t[o]);
|
|
43
45
|
}
|
|
44
46
|
},
|
|
45
47
|
R = /*#__PURE__*/function () {
|
|
@@ -49,7 +51,7 @@ var h = "language",
|
|
|
49
51
|
while (1) switch (_context.n) {
|
|
50
52
|
case 0:
|
|
51
53
|
g();
|
|
52
|
-
a = window[
|
|
54
|
+
a = window[y];
|
|
53
55
|
a && b(a, "global");
|
|
54
56
|
case 1:
|
|
55
57
|
return _context.a(2);
|
|
@@ -60,46 +62,46 @@ var h = "language",
|
|
|
60
62
|
return _ref.apply(this, arguments);
|
|
61
63
|
};
|
|
62
64
|
}(),
|
|
63
|
-
|
|
65
|
+
v = function v(t) {
|
|
64
66
|
var a = "";
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
return
|
|
67
|
+
var e = /\/([^\/]+)\/([^\/]+)\//,
|
|
68
|
+
r = t.match(e);
|
|
69
|
+
return r && r.length >= 3 && (a = r[1] + "/" + r[2]), a ? a.toLowerCase() : "";
|
|
68
70
|
},
|
|
69
|
-
|
|
71
|
+
A = function A(t) {
|
|
70
72
|
for (var _len = arguments.length, a = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
71
73
|
a[_key - 1] = arguments[_key];
|
|
72
74
|
}
|
|
73
75
|
return vue.computed(function () {
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
o =
|
|
76
|
+
var _m$framework, _m$e;
|
|
77
|
+
var e = v(location.pathname);
|
|
78
|
+
var r = (_m$framework = m.framework) !== null && _m$framework !== void 0 ? _m$framework : {},
|
|
79
|
+
s = (_m$e = m[e]) !== null && _m$e !== void 0 ? _m$e : {},
|
|
80
|
+
o = i[t] || l[t] || r[t] || s[t] || t;
|
|
79
81
|
if (o === t) return t;
|
|
80
82
|
typeof o == "string" && (o = {
|
|
81
83
|
"zh-CN": o
|
|
82
84
|
});
|
|
83
|
-
var n = o[
|
|
84
|
-
return
|
|
85
|
+
var n = o[c.value];
|
|
86
|
+
return c.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (n = o["zh-cn"]), a.map(function (f, d) {
|
|
85
87
|
n && (n = n.replace("$".concat(d), f));
|
|
86
88
|
}), n;
|
|
87
89
|
});
|
|
88
90
|
},
|
|
89
|
-
|
|
91
|
+
I = A,
|
|
90
92
|
N = function N(t) {
|
|
91
93
|
for (var _len2 = arguments.length, a = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
92
94
|
a[_key2 - 1] = arguments[_key2];
|
|
93
95
|
}
|
|
94
|
-
return
|
|
96
|
+
return I.apply(void 0, [t].concat(a)).value;
|
|
95
97
|
},
|
|
96
98
|
T = function T(t) {
|
|
97
|
-
|
|
99
|
+
c.value = t, console.log("currentLang.value===", c.value), g();
|
|
98
100
|
},
|
|
99
101
|
_ = function _() {
|
|
100
|
-
return
|
|
102
|
+
return c;
|
|
101
103
|
},
|
|
102
|
-
|
|
104
|
+
p = {
|
|
103
105
|
"en-US": {
|
|
104
106
|
ant: function ant() {
|
|
105
107
|
return Promise.resolve().then(function () {
|
|
@@ -258,29 +260,30 @@ var h = "language",
|
|
|
258
260
|
}
|
|
259
261
|
};
|
|
260
262
|
function x(t, a) {
|
|
261
|
-
var
|
|
262
|
-
var
|
|
263
|
-
return
|
|
263
|
+
var r;
|
|
264
|
+
var e = window.DATE_FORMAT_MAP;
|
|
265
|
+
return e && e[t] && e[t][a] ? e[t][a] : ((r = window.DATE_FORMAT_MAP[t]) == null ? undefined : r[a]) || "YYYY-MM-DD";
|
|
264
266
|
}
|
|
265
267
|
var O = /*#__PURE__*/function () {
|
|
266
268
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t) {
|
|
267
|
-
var a,
|
|
269
|
+
var a, e, _t;
|
|
268
270
|
return _regenerator().w(function (_context2) {
|
|
269
271
|
while (1) switch (_context2.p = _context2.n) {
|
|
270
272
|
case 0:
|
|
271
|
-
a =
|
|
273
|
+
a = p[t] || p["zh-CN"];
|
|
272
274
|
_context2.p = 1;
|
|
273
275
|
_context2.n = 2;
|
|
274
276
|
return a.ant();
|
|
275
277
|
case 2:
|
|
276
|
-
|
|
278
|
+
e = _context2.v;
|
|
277
279
|
_context2.n = 3;
|
|
278
280
|
return a.dayjs();
|
|
279
281
|
case 3:
|
|
280
|
-
return _context2.a(2,
|
|
282
|
+
return _context2.a(2, e["default"]);
|
|
281
283
|
case 4:
|
|
282
284
|
_context2.p = 4;
|
|
283
285
|
_t = _context2.v;
|
|
286
|
+
console.warn("\u672A\u627E\u5230\u5BF9\u5E94\u7684\u8BED\u8A00\u5305: ".concat(_t));
|
|
284
287
|
case 5:
|
|
285
288
|
return _context2.a(2);
|
|
286
289
|
}
|
|
@@ -290,16 +293,16 @@ var O = /*#__PURE__*/function () {
|
|
|
290
293
|
return _ref2.apply(this, arguments);
|
|
291
294
|
};
|
|
292
295
|
}();
|
|
293
|
-
exports.currentLang =
|
|
294
|
-
exports.customLangeData =
|
|
296
|
+
exports.currentLang = c;
|
|
297
|
+
exports.customLangeData = i;
|
|
295
298
|
exports.getDateFormat = x;
|
|
296
|
-
exports.getI18nRule =
|
|
299
|
+
exports.getI18nRule = A;
|
|
297
300
|
exports.getLang = _;
|
|
298
|
-
exports.i18n =
|
|
301
|
+
exports.i18n = I;
|
|
299
302
|
exports.initI18n = R;
|
|
300
|
-
exports.languageKey =
|
|
303
|
+
exports.languageKey = D;
|
|
301
304
|
exports.loadLocale = O;
|
|
302
305
|
exports.setI18nRule = b;
|
|
303
306
|
exports.setLang = T;
|
|
304
|
-
exports.setLangRule =
|
|
307
|
+
exports.setLangRule = M;
|
|
305
308
|
exports.t = N;
|
package/packages/i18n/index.js
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { getUrlParams as
|
|
3
|
-
const
|
|
1
|
+
import { reactive as u, ref as L, computed as w } from "vue";
|
|
2
|
+
import { getUrlParams as C } from "@das-fed/upf-utils/common-tools";
|
|
3
|
+
const D = "language", i = u({}), l = u({}), m = u({}), h = C(location.href, "uiCulture") || "", j = h || window.localStorage.getItem(D) || window.navigator.language || "zh-CN", c = L(j), y = "dasI18n", g = () => {
|
|
4
4
|
const t = document.documentElement;
|
|
5
|
-
t && t.setAttribute("lang",
|
|
6
|
-
},
|
|
7
|
-
const
|
|
5
|
+
t && t.setAttribute("lang", c.value);
|
|
6
|
+
}, M = (t = {}, a) => {
|
|
7
|
+
const e = a === "global", r = !e;
|
|
8
|
+
console.log("setLangRule===", t, a);
|
|
9
|
+
const s = {};
|
|
8
10
|
for (const o in t)
|
|
9
11
|
for (const n in t[o])
|
|
10
|
-
|
|
12
|
+
s[n] || (s[n] = {}), s[n][o] = t[o][n] ?? "", e && (l[n] || (l[n] = {}), l[n][o] = s[n][o]), r && (i[n] || (i[n] = {}), i[n][o] = s[n][o]);
|
|
13
|
+
console.log("customLangeData===", i), console.log("globalLangeData===", l);
|
|
11
14
|
}, b = (t = {}, a) => {
|
|
12
|
-
var
|
|
13
|
-
const
|
|
15
|
+
var s;
|
|
16
|
+
const e = a === "global", r = !e;
|
|
14
17
|
for (const o in t)
|
|
15
|
-
if (
|
|
16
|
-
const n = (
|
|
17
|
-
n && (
|
|
18
|
+
if (e && !l[o] && (l[o] = t[o]), r) {
|
|
19
|
+
const n = (s = t[o]) != null && s._appCode ? t[o]._appCode.toLowerCase() : "";
|
|
20
|
+
n && (m[n] || (m[n] = {}), m[n][o] = t[o]), i[o] || (i[o] = t[o]);
|
|
18
21
|
}
|
|
19
22
|
}, R = async (t) => {
|
|
20
23
|
g();
|
|
21
|
-
const a = window[
|
|
24
|
+
const a = window[y];
|
|
22
25
|
a && b(a, "global");
|
|
23
|
-
},
|
|
26
|
+
}, v = (t) => {
|
|
24
27
|
let a = "";
|
|
25
|
-
const
|
|
26
|
-
return
|
|
27
|
-
},
|
|
28
|
-
const
|
|
29
|
-
let
|
|
28
|
+
const e = /\/([^\/]+)\/([^\/]+)\//, r = t.match(e);
|
|
29
|
+
return r && r.length >= 3 && (a = r[1] + "/" + r[2]), a ? a.toLowerCase() : "";
|
|
30
|
+
}, A = (t, ...a) => w(() => {
|
|
31
|
+
const e = v(location.pathname);
|
|
32
|
+
let r = m.framework ?? {}, s = m[e] ?? {}, o = i[t] || l[t] || r[t] || s[t] || t;
|
|
30
33
|
if (o === t) return t;
|
|
31
34
|
typeof o == "string" && (o = { "zh-CN": o });
|
|
32
|
-
let n = o[
|
|
33
|
-
return
|
|
35
|
+
let n = o[c.value];
|
|
36
|
+
return c.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (n = o["zh-cn"]), a.map((f, d) => {
|
|
34
37
|
n && (n = n.replace(`$${d}`, f));
|
|
35
38
|
}), n;
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
}, _ = () =>
|
|
39
|
+
}), I = A, N = (t, ...a) => I(t, ...a).value, T = (t) => {
|
|
40
|
+
c.value = t, console.log("currentLang.value===", c.value), g();
|
|
41
|
+
}, _ = () => c, p = {
|
|
39
42
|
"en-US": { ant: () => import("ant-design-vue/es/locale/en_US"), dayjs: () => import("dayjs/locale/en") },
|
|
40
43
|
"zh-CN": { ant: () => import("ant-design-vue/es/locale/zh_CN"), dayjs: () => import("dayjs/locale/zh-cn") },
|
|
41
44
|
"zh-MO": { ant: () => import("ant-design-vue/es/locale/zh_TW"), dayjs: () => import("dayjs/locale/zh-tw") },
|
|
@@ -51,30 +54,31 @@ const h = "language", s = p({}), c = p({}), l = p({}), j = L(location.href, "uiC
|
|
|
51
54
|
"tr-TR": { ant: () => import("ant-design-vue/es/locale/tr_TR"), dayjs: () => import("dayjs/locale/tr") }
|
|
52
55
|
};
|
|
53
56
|
function x(t, a) {
|
|
54
|
-
var
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
+
var r;
|
|
58
|
+
const e = window.DATE_FORMAT_MAP;
|
|
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";
|
|
57
60
|
}
|
|
58
61
|
const O = async (t) => {
|
|
59
|
-
const a =
|
|
62
|
+
const a = p[t] || p["zh-CN"];
|
|
60
63
|
try {
|
|
61
|
-
const
|
|
62
|
-
return await a.dayjs(),
|
|
63
|
-
} catch {
|
|
64
|
+
const e = await a.ant();
|
|
65
|
+
return await a.dayjs(), e.default;
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.warn(`未找到对应的语言包: ${e}`);
|
|
64
68
|
}
|
|
65
69
|
};
|
|
66
70
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
c as currentLang,
|
|
72
|
+
i as customLangeData,
|
|
69
73
|
x as getDateFormat,
|
|
70
|
-
|
|
74
|
+
A as getI18nRule,
|
|
71
75
|
_ as getLang,
|
|
72
|
-
|
|
76
|
+
I as i18n,
|
|
73
77
|
R as initI18n,
|
|
74
|
-
|
|
78
|
+
D as languageKey,
|
|
75
79
|
O as loadLocale,
|
|
76
80
|
b as setI18nRule,
|
|
77
81
|
T as setLang,
|
|
78
|
-
|
|
82
|
+
M as setLangRule,
|
|
79
83
|
N as t
|
|
80
84
|
};
|
|
Binary file
|