@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.
Files changed (37) hide show
  1. package/es5.js +626 -607
  2. package/{packages/main-app-framework/index-BSIXDWdJ.js → index-BgdQU8Qg.js} +1 -1
  3. package/index-BgdQU8Qg.js.gz +0 -0
  4. package/{index-BY6POt5_.js → index-DWgRH_-S.js} +440 -439
  5. package/index-DWgRH_-S.js.gz +0 -0
  6. package/{index-wW15s_in.js → index-Dnv3WlBw.js} +1 -1
  7. package/index.js +1 -1
  8. package/package.json +5 -5
  9. package/packages/create-das-web-app/es5.js +31 -30
  10. package/packages/create-das-web-app/index.js +37 -36
  11. package/packages/create-das-web-app/index.js.gz +0 -0
  12. package/packages/i18n/es5.js +100 -82
  13. package/packages/i18n/index.js +62 -62
  14. package/packages/i18n/index.js.gz +0 -0
  15. package/packages/layout/es5.js +96 -96
  16. package/packages/layout/index.js +98 -98
  17. package/packages/layout/index.js.gz +0 -0
  18. package/packages/main-app-framework/es5.js +29 -29
  19. package/packages/main-app-framework/{index-C0K5zcvx.js → index-7BUmPh7i.js} +1 -1
  20. package/{index-CUJfUQFX.js → packages/main-app-framework/index-BP8gHC_g.js} +1 -1
  21. package/packages/main-app-framework/index-BP8gHC_g.js.gz +0 -0
  22. package/packages/main-app-framework/{index-y647qjnX.js → index-CUuJCTjN.js} +27 -27
  23. package/packages/main-app-framework/index-CUuJCTjN.js.gz +0 -0
  24. package/packages/main-app-framework/index.js +1 -1
  25. package/packages/main-app-framework/style.css +1 -1
  26. package/packages/main-app-framework/style.css.gz +0 -0
  27. package/packages/micro-frontend/es5.js +156 -156
  28. package/packages/micro-frontend/index.js +127 -127
  29. package/packages/micro-frontend/index.js.gz +0 -0
  30. package/style.css +1 -1
  31. package/style.css.gz +0 -0
  32. package/types/i18n/getMicroI18nData.d.ts +1 -1
  33. package/types/i18n/index.d.ts +1 -1
  34. package/index-BY6POt5_.js.gz +0 -0
  35. package/index-CUJfUQFX.js.gz +0 -0
  36. package/packages/main-app-framework/index-BSIXDWdJ.js.gz +0 -0
  37. package/packages/main-app-framework/index-y647qjnX.js.gz +0 -0
@@ -1,75 +1,75 @@
1
- import { reactive as u, ref as b, computed as j } from "vue";
2
- import { handleI18nData as I, getUrlParams as L } from "@das-fed/upf-utils/common-tools";
3
- import { setI18nBridge as D } from "@das-fed/upf-utils/i18n-bridge";
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, e) {
8
- return !!(this.loaded[t] && this.loaded[t][e]);
7
+ isLoaded(t, o) {
8
+ return !!(this.loaded[t] && this.loaded[t][o]);
9
9
  },
10
- markLoaded(t, e) {
11
- this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][e] = !0;
10
+ markLoaded(t, o) {
11
+ this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][o] = !0;
12
12
  },
13
- markUnloaded(t, e) {
14
- this.loaded[t] && (delete this.loaded[t][e], Object.keys(this.loaded[t]).length === 0 && 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
- }, C = async (t, e) => {
17
- var m, p, g;
18
- const o = U() || {}, a = ((m = o.i18n) == null ? void 0 : m.fromOss) ?? !0, s = ((p = o.i18n) == null ? void 0 : p.isPullBack) ?? !1, n = ((g = o.i18n) == null ? void 0 : g.isDasUI) ?? !0;
19
- let r = "/oss/resource/";
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 I({
22
- baseUrl: a ? r : "/",
23
- currentLang: e,
21
+ const d = await L({
22
+ baseUrl: s ? p : a,
23
+ currentLang: o,
24
24
  appName: t,
25
- isPullBack: s,
26
- fallbackBaseUrl: "/",
27
- isDasUI: n
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 (h) {
33
- throw new Error(`registerResources error: ${h}`);
32
+ } catch (y) {
33
+ throw new Error(`registerResources error: ${y}`);
34
34
  }
35
- }, M = "language", i = u({}), c = u({}), f = u({}), O = L(location.href, "lang") || "", z = O || window.localStorage.getItem(M) || window.navigator.language || "zh-CN", l = b(z), A = "dasI18n", w = () => {
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
- }, y = (t = {}, e) => {
39
- const o = e === "global", a = !o, s = {};
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] ?? "", o && (c[r] || (c[r] = {}), c[r][n] = s[r][n]), a && (i[r] || (i[r] = {}), i[r][n] = s[r][n]);
43
- }, R = (t = {}, e) => {
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 o = e === "global", a = !o;
45
+ const a = o === "global", e = !a;
46
46
  for (const n in t)
47
- if (o && !c[n] && (c[n] = t[n]), a) {
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
- w();
53
- const e = window[A];
54
- e && R(e, "global");
55
- }, k = (t) => {
56
- let e = "";
57
- const o = /\/([^\/]+)\/([^\/]+)\//, a = t.match(o);
58
- return a && a.length >= 3 && (e = a[1] + "/" + a[2]), e ? e.toLowerCase() : "";
59
- }, v = (t, ...e) => j(() => {
60
- const o = k(location.pathname);
61
- let a = f.framework ?? {}, s = f[o] ?? {}, n = i[t] || c[t] || a[t] || s[t] || t;
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"]), e.map((m, p) => {
66
- r && (r = r.replace(`$${p}`, m));
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
- }), N = v, P = (t, ...e) => N(t, ...e).value;
69
- D({ t: P, currentLang: l });
70
- const T = (t) => {
71
- l.value = t, w();
72
- }, K = () => l, E = {
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, e) {
88
- var a;
89
- const o = window.DATE_FORMAT_MAP;
90
- return o && o[t] && o[t][e] ? o[t][e] : ((a = window.DATE_FORMAT_MAP[t]) == null ? void 0 : a[e]) || "YYYY-MM-DD";
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 e = E[t] || E["zh-CN"];
93
+ const o = w[t] || w["zh-CN"];
94
94
  try {
95
- const o = await e.ant();
96
- return await e.dayjs(), o.default;
95
+ const a = await o.ant();
96
+ return await o.dayjs(), a.default;
97
97
  } catch {
98
98
  }
99
- }, q = async (t = [], e = "zh-CN") => {
99
+ }, q = async (t = [], o = "zh-CN", a) => {
100
100
  try {
101
- const o = await C(t, e);
102
- o != null && o.frontEnd && typeof o.frontEnd == "object" && Object.keys(o.frontEnd).length && t.forEach((a) => {
103
- o.frontEnd[a] && typeof o.frontEnd[a] == "object" && Object.keys(o.frontEnd[a]).length && y({ [e]: o.frontEnd[a] });
104
- }), o != null && o.dasUiEnd && typeof o.dasUiEnd == "object" && Object.keys(o.dasUiEnd).length && y({ [e]: o.dasUiEnd }), T(e);
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
- v as getI18nRule,
112
+ P as getI18nRule,
113
113
  K as getLang,
114
- N as i18n,
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
- T as setLang,
122
- y as setLangRule,
123
- P as t
121
+ k as setLang,
122
+ E as setLangRule,
123
+ _ as t
124
124
  };
Binary file