@das-fed/upf-web 6.4.0-dev.232 → 6.4.0-dev.234
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 +626 -607
- package/{packages/main-app-framework/index-BSIXDWdJ.js → index-BgdQU8Qg.js} +1 -1
- package/index-BgdQU8Qg.js.gz +0 -0
- package/{index-BY6POt5_.js → index-DWgRH_-S.js} +440 -439
- package/index-DWgRH_-S.js.gz +0 -0
- package/{index-wW15s_in.js → index-Dnv3WlBw.js} +1 -1
- package/index.js +1 -1
- package/package.json +5 -5
- package/packages/create-das-web-app/es5.js +31 -30
- package/packages/create-das-web-app/index.js +37 -36
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +100 -82
- package/packages/i18n/index.js +62 -62
- package/packages/i18n/index.js.gz +0 -0
- package/packages/layout/es5.js +96 -96
- package/packages/layout/index.js +98 -98
- package/packages/layout/index.js.gz +0 -0
- package/packages/main-app-framework/es5.js +29 -29
- package/packages/main-app-framework/{index-C0K5zcvx.js → index-7BUmPh7i.js} +1 -1
- package/{index-CUJfUQFX.js → packages/main-app-framework/index-BP8gHC_g.js} +1 -1
- package/packages/main-app-framework/index-BP8gHC_g.js.gz +0 -0
- package/packages/main-app-framework/{index-y647qjnX.js → index-CUuJCTjN.js} +27 -27
- package/packages/main-app-framework/index-CUuJCTjN.js.gz +0 -0
- package/packages/main-app-framework/index.js +1 -1
- package/packages/main-app-framework/style.css +1 -1
- package/packages/main-app-framework/style.css.gz +0 -0
- package/packages/micro-frontend/es5.js +156 -156
- package/packages/micro-frontend/index.js +127 -127
- package/packages/micro-frontend/index.js.gz +0 -0
- package/style.css +1 -1
- package/style.css.gz +0 -0
- package/types/i18n/getMicroI18nData.d.ts +1 -1
- package/types/i18n/index.d.ts +1 -1
- package/index-BY6POt5_.js.gz +0 -0
- package/index-CUJfUQFX.js.gz +0 -0
- package/packages/main-app-framework/index-BSIXDWdJ.js.gz +0 -0
- package/packages/main-app-framework/index-y647qjnX.js.gz +0 -0
package/packages/i18n/index.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { reactive as u, ref as b, computed as
|
|
2
|
-
import { handleI18nData as
|
|
3
|
-
import { setI18nBridge as
|
|
1
|
+
import { reactive as u, ref as b, computed as I } from "vue";
|
|
2
|
+
import { handleI18nData as L, getUrlParams as D } from "@das-fed/upf-utils/common-tools";
|
|
3
|
+
import { setI18nBridge as C } from "@das-fed/upf-utils/i18n-bridge";
|
|
4
4
|
import { getConfig as U } from "@das-fed/upf-utils/config";
|
|
5
5
|
const G = {
|
|
6
6
|
loaded: {},
|
|
7
|
-
isLoaded(t,
|
|
8
|
-
return !!(this.loaded[t] && this.loaded[t][
|
|
7
|
+
isLoaded(t, o) {
|
|
8
|
+
return !!(this.loaded[t] && this.loaded[t][o]);
|
|
9
9
|
},
|
|
10
|
-
markLoaded(t,
|
|
11
|
-
this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][
|
|
10
|
+
markLoaded(t, o) {
|
|
11
|
+
this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][o] = !0;
|
|
12
12
|
},
|
|
13
|
-
markUnloaded(t,
|
|
14
|
-
this.loaded[t] && (delete this.loaded[t][
|
|
13
|
+
markUnloaded(t, o) {
|
|
14
|
+
this.loaded[t] && (delete this.loaded[t][o], Object.keys(this.loaded[t]).length === 0 && delete this.loaded[t]);
|
|
15
15
|
}
|
|
16
|
-
},
|
|
17
|
-
var m,
|
|
18
|
-
const
|
|
19
|
-
let
|
|
16
|
+
}, z = async (t = [], o = "zh-CN", a) => {
|
|
17
|
+
var m, g, h;
|
|
18
|
+
const e = U() || {}, s = ((m = e.i18n) == null ? void 0 : m.fromOss) ?? !0, n = ((g = e.i18n) == null ? void 0 : g.isPullBack) ?? !1, r = ((h = e.i18n) == null ? void 0 : h.isDasUI) ?? !0;
|
|
19
|
+
let p = "/oss/resource/";
|
|
20
20
|
try {
|
|
21
|
-
const d = await
|
|
22
|
-
baseUrl:
|
|
23
|
-
currentLang:
|
|
21
|
+
const d = await L({
|
|
22
|
+
baseUrl: s ? p : a,
|
|
23
|
+
currentLang: o,
|
|
24
24
|
appName: t,
|
|
25
|
-
isPullBack:
|
|
26
|
-
fallbackBaseUrl:
|
|
27
|
-
isDasUI:
|
|
25
|
+
isPullBack: n,
|
|
26
|
+
fallbackBaseUrl: a,
|
|
27
|
+
isDasUI: r
|
|
28
28
|
});
|
|
29
29
|
if (!d || !(d != null && d.frontEnd))
|
|
30
30
|
throw new Error("Failed to fetch i18n data");
|
|
31
31
|
return d;
|
|
32
|
-
} catch (
|
|
33
|
-
throw new Error(`registerResources error: ${
|
|
32
|
+
} catch (y) {
|
|
33
|
+
throw new Error(`registerResources error: ${y}`);
|
|
34
34
|
}
|
|
35
|
-
}, M = "language", i = u({}), c = u({}), f = u({}), O =
|
|
35
|
+
}, M = "language", i = u({}), c = u({}), f = u({}), O = D(location.href, "lang") || "", A = O || window.localStorage.getItem(M) || window.navigator.language || "zh-CN", l = b(A), N = "dasI18n", j = () => {
|
|
36
36
|
const t = document.documentElement;
|
|
37
37
|
t && t.setAttribute("lang", l.value);
|
|
38
|
-
},
|
|
39
|
-
const
|
|
38
|
+
}, E = (t = {}, o) => {
|
|
39
|
+
const a = o === "global", e = !a, s = {};
|
|
40
40
|
for (const n in t)
|
|
41
41
|
for (const r in t[n])
|
|
42
|
-
s[r] || (s[r] = {}), s[r][n] = t[n][r] ?? "",
|
|
43
|
-
}, R = (t = {},
|
|
42
|
+
s[r] || (s[r] = {}), s[r][n] = t[n][r] ?? "", a && (c[r] || (c[r] = {}), c[r][n] = s[r][n]), e && (i[r] || (i[r] = {}), i[r][n] = s[r][n]);
|
|
43
|
+
}, R = (t = {}, o) => {
|
|
44
44
|
var s;
|
|
45
|
-
const
|
|
45
|
+
const a = o === "global", e = !a;
|
|
46
46
|
for (const n in t)
|
|
47
|
-
if (
|
|
47
|
+
if (a && !c[n] && (c[n] = t[n]), e) {
|
|
48
48
|
const r = (s = t[n]) != null && s._appCode ? t[n]._appCode.toLowerCase() : "";
|
|
49
49
|
r && (f[r] || (f[r] = {}), f[r][n] = t[n]), i[n] || (i[n] = t[n]);
|
|
50
50
|
}
|
|
51
51
|
}, Y = async (t) => {
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
let
|
|
57
|
-
const
|
|
58
|
-
return
|
|
59
|
-
},
|
|
60
|
-
const
|
|
61
|
-
let
|
|
52
|
+
j();
|
|
53
|
+
const o = window[N];
|
|
54
|
+
o && R(o, "global");
|
|
55
|
+
}, v = (t) => {
|
|
56
|
+
let o = "";
|
|
57
|
+
const a = /\/([^\/]+)\/([^\/]+)\//, e = t.match(a);
|
|
58
|
+
return e && e.length >= 3 && (o = e[1] + "/" + e[2]), o ? o.toLowerCase() : "";
|
|
59
|
+
}, P = (t, ...o) => I(() => {
|
|
60
|
+
const a = v(location.pathname);
|
|
61
|
+
let e = f.framework ?? {}, s = f[a] ?? {}, n = i[t] || c[t] || e[t] || s[t] || t;
|
|
62
62
|
if (n === t) return t;
|
|
63
63
|
typeof n == "string" && (n = { "zh-CN": n });
|
|
64
64
|
let r = n[l.value];
|
|
65
|
-
return l.value === "zh-CN" && n["zh-cn"] && !n["zh-CN"] && (r = n["zh-cn"]),
|
|
66
|
-
r && (r = r.replace(`$${
|
|
65
|
+
return l.value === "zh-CN" && n["zh-cn"] && !n["zh-CN"] && (r = n["zh-cn"]), o.map((p, m) => {
|
|
66
|
+
r && (r = r.replace(`$${m}`, p));
|
|
67
67
|
}), r;
|
|
68
|
-
}),
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
l.value = t,
|
|
72
|
-
}, K = () => l,
|
|
68
|
+
}), T = P, _ = (t, ...o) => T(t, ...o).value;
|
|
69
|
+
C({ t: _, currentLang: l });
|
|
70
|
+
const k = (t) => {
|
|
71
|
+
l.value = t, j();
|
|
72
|
+
}, K = () => l, w = {
|
|
73
73
|
"en-US": { ant: () => import("ant-design-vue/es/locale/en_US"), dayjs: () => import("dayjs/locale/en") },
|
|
74
74
|
"zh-CN": { ant: () => import("ant-design-vue/es/locale/zh_CN"), dayjs: () => import("dayjs/locale/zh-cn") },
|
|
75
75
|
"zh-MO": { ant: () => import("ant-design-vue/es/locale/zh_TW"), dayjs: () => import("dayjs/locale/zh-tw") },
|
|
@@ -84,24 +84,24 @@ const T = (t) => {
|
|
|
84
84
|
"nl-NL": { ant: () => import("ant-design-vue/es/locale/nl_NL"), dayjs: () => import("dayjs/locale/nl") },
|
|
85
85
|
"tr-TR": { ant: () => import("ant-design-vue/es/locale/tr_TR"), dayjs: () => import("dayjs/locale/tr") }
|
|
86
86
|
};
|
|
87
|
-
function $(t,
|
|
88
|
-
var
|
|
89
|
-
const
|
|
90
|
-
return
|
|
87
|
+
function $(t, o) {
|
|
88
|
+
var e;
|
|
89
|
+
const a = window.DATE_FORMAT_MAP;
|
|
90
|
+
return a && a[t] && a[t][o] ? a[t][o] : ((e = window.DATE_FORMAT_MAP[t]) == null ? void 0 : e[o]) || "YYYY-MM-DD";
|
|
91
91
|
}
|
|
92
92
|
const H = async (t) => {
|
|
93
|
-
const
|
|
93
|
+
const o = w[t] || w["zh-CN"];
|
|
94
94
|
try {
|
|
95
|
-
const
|
|
96
|
-
return await
|
|
95
|
+
const a = await o.ant();
|
|
96
|
+
return await o.dayjs(), a.default;
|
|
97
97
|
} catch {
|
|
98
98
|
}
|
|
99
|
-
}, q = async (t = [],
|
|
99
|
+
}, q = async (t = [], o = "zh-CN", a) => {
|
|
100
100
|
try {
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}),
|
|
101
|
+
const e = await z(t, o, a);
|
|
102
|
+
e != null && e.frontEnd && typeof e.frontEnd == "object" && Object.keys(e.frontEnd).length && t.forEach((s) => {
|
|
103
|
+
e.frontEnd[s] && typeof e.frontEnd[s] == "object" && Object.keys(e.frontEnd[s]).length && E({ [o]: e.frontEnd[s] });
|
|
104
|
+
}), e != null && e.dasUiEnd && typeof e.dasUiEnd == "object" && Object.keys(e.dasUiEnd).length && E({ [o]: e.dasUiEnd }), k(o);
|
|
105
105
|
} catch {
|
|
106
106
|
}
|
|
107
107
|
};
|
|
@@ -109,16 +109,16 @@ export {
|
|
|
109
109
|
l as currentLang,
|
|
110
110
|
i as customLangeData,
|
|
111
111
|
$ as getDateFormat,
|
|
112
|
-
|
|
112
|
+
P as getI18nRule,
|
|
113
113
|
K as getLang,
|
|
114
|
-
|
|
114
|
+
T as i18n,
|
|
115
115
|
Y as initI18n,
|
|
116
116
|
M as languageKey,
|
|
117
117
|
H as loadLocale,
|
|
118
118
|
G as microI18nStore,
|
|
119
119
|
q as registerMicroI18nData,
|
|
120
120
|
R as setI18nRule,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
k as setLang,
|
|
122
|
+
E as setLangRule,
|
|
123
|
+
_ as t
|
|
124
124
|
};
|
|
Binary file
|