@das-fed/upf-web 6.4.0-dev.199 → 6.4.0-dev.201

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.
Binary file
@@ -6,7 +6,7 @@ import { DasSpin as x } from "@das-fed/upf-ui/packages/components/spin/index";
6
6
  import { getTabInfo as T } from "@das-fed/upf-utils/common-info";
7
7
  import { setShowLayout as b } from "@das-fed/upf-utils/common-tools";
8
8
  import { createService as E } from "@das-fed/upf-utils/create-api-service";
9
- import { u as L, p as P, a as u, c as f, b as q, l as B, g as K, d as M } from "./index-Cwnxjz4B.js";
9
+ import { u as L, p as P, a as u, c as f, b as q, l as B, g as K, d as M } from "./index-BJ0qSbnM.js";
10
10
  const N = "v1", O = E(`/api/justauth/client/${N}`), V = O.get("/visitor/kingdee/auth/user/auth_code"), z = /* @__PURE__ */ k({
11
11
  __name: "index",
12
12
  setup(F) {
Binary file
@@ -1,5 +1,5 @@
1
1
  import { openBlock as e, createElementBlock as r } from "vue";
2
- import { _ as c } from "./index-Cwnxjz4B.js";
2
+ import { _ as c } from "./index-BJ0qSbnM.js";
3
3
  const o = {};
4
4
  function t(n, _) {
5
5
  return e(), r("div");
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { L as s, C as t, E as n, D as r, F as i, e as o, n as u, y as m, q as g, f as p, h as l, m as D, x as L, A as c, B as b, j as h, i as A, I as T, J as y, v as M, G as R, H as W, r as F, M as I, K as V, s as d, k as f, o as k, w as v, z as w, t as x } from "./index-Cwnxjz4B.js";
1
+ import { O as s, F as t, H as n, G as r, I as i, e as o, o as g, B as u, r as m, f as D, j as l, n as p, A as L, D as c, E as b, k as h, i as y, L as A, M as I, y as M, h as T, J as R, K as W, v as F, P as V, N as d, w as f, x as k, s as v, m as w, q as x, z as K, C as N, t as j } from "./index-BJ0qSbnM.js";
2
2
  export {
3
3
  s as DasMainAppLayout,
4
4
  t as DasWebLayout,
@@ -6,29 +6,32 @@ export {
6
6
  r as DasWebNav,
7
7
  i as DasWebTabs,
8
8
  o as createDasWebApp,
9
- u as currentLang,
10
- m as currentTheme,
11
- g as customLangeData,
12
- p as getDateFormat,
9
+ g as currentLang,
10
+ u as currentTheme,
11
+ m as customLangeData,
12
+ D as getDateFormat,
13
13
  l as getI18nRule,
14
- D as getLang,
14
+ p as getLang,
15
15
  L as getThemeRule,
16
16
  c as getVar,
17
17
  b as getVarValue,
18
18
  h as i18n,
19
- A as initI18n,
20
- T as initMainApp,
21
- y as initMicroApp,
19
+ y as initI18n,
20
+ A as initMainApp,
21
+ I as initMicroApp,
22
22
  M as initTheme,
23
+ T as languageKey,
23
24
  R as layout,
24
25
  W as layoutData,
25
26
  F as loadLocale,
26
- I as mainAppFramework,
27
- V as microFrontend,
28
- d as setI18nRule,
29
- f as setLang,
30
- k as setLangRule,
31
- v as setTheme,
32
- w as setThemeRule,
33
- x as t
27
+ V as mainAppFramework,
28
+ d as microFrontend,
29
+ f as registerI18nData,
30
+ k as registerMicroI18nData,
31
+ v as setI18nRule,
32
+ w as setLang,
33
+ x as setLangRule,
34
+ K as setTheme,
35
+ N as setThemeRule,
36
+ j as t
34
37
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@das-fed/upf-web",
3
- "version": "6.4.0-dev.199",
3
+ "version": "6.4.0-dev.201",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "dependencies": {
7
- "@das-fed/upf-ui": "6.4.0-dev.199",
8
- "@das-fed/upf-utils": "6.4.0-dev.199",
9
- "@das-fed/upf-web": "6.4.0-dev.199",
10
- "@das-fed/upf-web-components": "6.4.0-dev.199",
7
+ "@das-fed/upf-ui": "6.4.0-dev.201",
8
+ "@das-fed/upf-utils": "6.4.0-dev.201",
9
+ "@das-fed/upf-web": "6.4.0-dev.201",
10
+ "@das-fed/upf-web-components": "6.4.0-dev.201",
11
11
  "@microsoft/signalr": "^8.0.7",
12
12
  "@vueuse/core": "^9.13.0",
13
13
  "animate.css": "^4.1.1",
@@ -19,7 +19,7 @@
19
19
  "vue-router": "^4.4.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@das-fed/upf-cli": "6.4.0-dev.199",
22
+ "@das-fed/upf-cli": "6.4.0-dev.201",
23
23
  "@types/crypto-js": "^4.2.2",
24
24
  "@types/lodash": "^4.14.194",
25
25
  "@types/lodash-es": "^4.17.12",
@@ -14,31 +14,31 @@ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(
14
14
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
15
15
  var vue = require('vue');
16
16
  var index = require('@das-fed/upf-web/packages/theme/index/es5');
17
- var index$1 = require('@das-fed/upf-web/packages/i18n/index/es5');
18
- var index$2 = require('@das-fed/upf-web/packages/layout/index/es5');
17
+ var index$1 = require('@das-fed/upf-web/packages/layout/index/es5');
18
+ var register = require('@das-fed/upf-web/packages/i18n/register/es5');
19
19
  var pinia = require('pinia');
20
20
  var $ = require('pinia-plugin-persistedstate');
21
21
  var vueRouter = require('vue-router');
22
- var y = {
23
- install: function install(e, u) {
22
+ var k = {
23
+ install: function install(e, a) {
24
24
  var l;
25
- var c = (l = u == null ? undefined : u.plugins) == null ? undefined : l.glob;
26
- c && Object.values(c).sort(function (t, a) {
27
- var _t$index, _a$index;
28
- return ((_t$index = t.index) !== null && _t$index !== void 0 ? _t$index : 0) - ((_a$index = a.index) !== null && _a$index !== void 0 ? _a$index : 0);
25
+ var c = (l = a == null ? undefined : a.plugins) == null ? undefined : l.glob;
26
+ c && Object.values(c).sort(function (t, u) {
27
+ var _t$index, _u$index;
28
+ return ((_t$index = t.index) !== null && _t$index !== void 0 ? _t$index : 0) - ((_u$index = u.index) !== null && _u$index !== void 0 ? _u$index : 0);
29
29
  }).filter(function (t) {
30
30
  return t ? !!(t["default"] && t["default"].install || t.install) : false;
31
31
  }).forEach(function (t) {
32
- t["default"] && t["default"].install && e.use(t["default"], u), t.install && e.use(t, u);
32
+ t["default"] && t["default"].install && e.use(t["default"], a), t.install && e.use(t, a);
33
33
  });
34
34
  }
35
35
  },
36
36
  d = pinia.createPinia();
37
37
  d.use($);
38
- var D = function D(e) {
38
+ var y = function y(e) {
39
39
  var _ref;
40
- var h, b, p, A, g;
41
- var u = (_ref = (h = e == null ? undefined : e.router) == null ? undefined : h.routerBase) !== null && _ref !== void 0 ? _ref : "/",
40
+ var h, b, p, g, A;
41
+ var a = (_ref = (h = e == null ? undefined : e.router) == null ? undefined : h.routerBase) !== null && _ref !== void 0 ? _ref : "/",
42
42
  c = ((b = e == null ? undefined : e.router) == null ? undefined : b.options) || {};
43
43
  var l = Object.assign(((p = e == null ? undefined : e.router) == null ? undefined : p.glob) || {});
44
44
  var t = Object.values(l).filter(function (f) {
@@ -47,20 +47,20 @@ var D = function D(e) {
47
47
  var _f$index, _m$index;
48
48
  return ((_f$index = f.index) !== null && _f$index !== void 0 ? _f$index : 0) - ((_m$index = m.index) !== null && _m$index !== void 0 ? _m$index : 0);
49
49
  }),
50
- a = [];
51
- (A = e == null ? undefined : e.microApps) == null || A.map(function (f) {
50
+ u = [];
51
+ (g = e == null ? undefined : e.microApps) == null || g.map(function (f) {
52
52
  var R;
53
53
  var m = Object.values(((R = f.router) == null ? undefined : R.glob) || {}).filter(function (r) {
54
54
  return !!r;
55
- }).flat().sort(function (r, v) {
56
- var _r$index, _v$index;
57
- return ((_r$index = r.index) !== null && _r$index !== void 0 ? _r$index : 0) - ((_v$index = v.index) !== null && _v$index !== void 0 ? _v$index : 0);
55
+ }).flat().sort(function (r, o) {
56
+ var _r$index, _o$index;
57
+ return ((_r$index = r.index) !== null && _r$index !== void 0 ? _r$index : 0) - ((_o$index = o.index) !== null && _o$index !== void 0 ? _o$index : 0);
58
58
  });
59
- a.push.apply(a, _toConsumableArray(m.map(function (r) {
59
+ u.push.apply(u, _toConsumableArray(m.map(function (r) {
60
60
  return _objectSpread(_objectSpread({}, r), {}, {
61
61
  path: "/".concat(f.microAppName).concat(r.path)
62
62
  });
63
- }))), a.push.apply(a, _toConsumableArray(m.filter(function (r) {
63
+ }))), u.push.apply(u, _toConsumableArray(m.filter(function (r) {
64
64
  return !!r.path;
65
65
  }).filter(function (r) {
66
66
  return r.path !== "";
@@ -78,20 +78,20 @@ var D = function D(e) {
78
78
  };
79
79
  })));
80
80
  });
81
- var s = ((g = e == null ? undefined : e.router) == null ? undefined : g.routers) || [],
82
- n = [].concat(_toConsumableArray(i(t, e)), _toConsumableArray(i(s, e)), _toConsumableArray(i(a, e)));
81
+ var s = ((A = e == null ? undefined : e.router) == null ? undefined : A.routers) || [],
82
+ n = [].concat(_toConsumableArray(i(t, e)), _toConsumableArray(i(s, e)), _toConsumableArray(i(u, e)));
83
83
  return {
84
84
  router: vueRouter.createRouter(_objectSpread({
85
- history: vueRouter.createWebHistory(u),
85
+ history: vueRouter.createWebHistory(a),
86
86
  routes: n
87
87
  }, c))
88
88
  };
89
89
  },
90
- i = function i(e, u) {
90
+ i = function i(e, a) {
91
91
  return e.map(function (c) {
92
92
  var _ref2, _l$keepAlive;
93
93
  var l = c.meta || {};
94
- return l.keepAlive = (_ref2 = (_l$keepAlive = l.keepAlive) !== null && _l$keepAlive !== void 0 ? _l$keepAlive : u == null ? undefined : u.keepAlive) !== null && _ref2 !== void 0 ? _ref2 : true, _objectSpread(_objectSpread({}, c), {}, {
94
+ return l.keepAlive = (_ref2 = (_l$keepAlive = l.keepAlive) !== null && _l$keepAlive !== void 0 ? _l$keepAlive : a == null ? undefined : a.keepAlive) !== null && _ref2 !== void 0 ? _ref2 : true, _objectSpread(_objectSpread({}, c), {}, {
95
95
  meta: l
96
96
  });
97
97
  });
@@ -99,22 +99,22 @@ var D = function D(e) {
99
99
  q = function q(e) {
100
100
  var n;
101
101
  e || (e = {});
102
- var u = vue.ref(true);
103
- Promise.all([index.initTheme(e), index$1.initI18n(e)]).then(function () {
104
- u.value = false;
102
+ var a = vue.ref(true);
103
+ Promise.all([index.initTheme(e), register.registerMicroI18nData(e)]).then(function () {
104
+ a.value = false;
105
105
  });
106
106
  var _ref3 = (e == null ? undefined : e.root) || {},
107
107
  c = _ref3.container,
108
108
  l = _ref3.component,
109
109
  t = _ref3.props,
110
- a = vue.createApp(l || index$2.DasWebLayout, t);
111
- a.use(y, e), a.use(d);
112
- var _D = D(e),
113
- s = _D.router;
114
- return a.use(s), a.mount(c || "#app"), (n = window.top) != null && n.vueRouter || window.top && (window.top.vueRouter = s), {
115
- app: a,
110
+ u = vue.createApp(l || index$1.DasWebLayout, t);
111
+ u.use(k, e), u.use(d);
112
+ var _y = y(e),
113
+ s = _y.router;
114
+ return u.use(s), u.mount(c || "#app"), (n = window.top) != null && n.vueRouter || window.top && (window.top.vueRouter = s), {
115
+ app: u,
116
116
  router: s,
117
- loading: u,
117
+ loading: a,
118
118
  store: d
119
119
  };
120
120
  };
@@ -1,31 +1,31 @@
1
- import { ref as o, createApp as x } from "vue";
1
+ import { ref as v, createApp as x } from "vue";
2
2
  import { initTheme as w } from "@das-fed/upf-web/packages/theme/index";
3
- import { initI18n as O } from "@das-fed/upf-web/packages/i18n/index";
4
- import { DasWebLayout as P } from "@das-fed/upf-web/packages/layout/index";
3
+ import { DasWebLayout as O } from "@das-fed/upf-web/packages/layout/index";
4
+ import { registerMicroI18nData as P } from "@das-fed/upf-web/packages/i18n/register";
5
5
  import { createPinia as W } from "pinia";
6
6
  import $ from "pinia-plugin-persistedstate";
7
- import { createRouter as j, createWebHistory as k } from "vue-router";
8
- const y = {
9
- install: (e, u) => {
7
+ import { createRouter as j, createWebHistory as D } from "vue-router";
8
+ const k = {
9
+ install: (e, a) => {
10
10
  var l;
11
- const c = (l = u == null ? void 0 : u.plugins) == null ? void 0 : l.glob;
12
- c && Object.values(c).sort((t, a) => (t.index ?? 0) - (a.index ?? 0)).filter((t) => t ? !!(t.default && t.default.install || t.install) : !1).forEach((t) => {
13
- t.default && t.default.install && e.use(t.default, u), t.install && e.use(t, u);
11
+ const c = (l = a == null ? void 0 : a.plugins) == null ? void 0 : l.glob;
12
+ c && Object.values(c).sort((t, u) => (t.index ?? 0) - (u.index ?? 0)).filter((t) => t ? !!(t.default && t.default.install || t.install) : !1).forEach((t) => {
13
+ t.default && t.default.install && e.use(t.default, a), t.install && e.use(t, a);
14
14
  });
15
15
  }
16
16
  }, d = W();
17
17
  d.use($);
18
- const D = (e) => {
19
- var h, b, p, A, g;
20
- const u = ((h = e == null ? void 0 : e.router) == null ? void 0 : h.routerBase) ?? "/", c = ((b = e == null ? void 0 : e.router) == null ? void 0 : b.options) || {};
18
+ const y = (e) => {
19
+ var h, b, p, g, A;
20
+ const a = ((h = e == null ? void 0 : e.router) == null ? void 0 : h.routerBase) ?? "/", c = ((b = e == null ? void 0 : e.router) == null ? void 0 : b.options) || {};
21
21
  let l = Object.assign(((p = e == null ? void 0 : e.router) == null ? void 0 : p.glob) || {});
22
- const t = Object.values(l).filter((f) => !!f).flat().sort((f, m) => (f.index ?? 0) - (m.index ?? 0)), a = [];
23
- (A = e == null ? void 0 : e.microApps) == null || A.map((f) => {
22
+ const t = Object.values(l).filter((f) => !!f).flat().sort((f, m) => (f.index ?? 0) - (m.index ?? 0)), u = [];
23
+ (g = e == null ? void 0 : e.microApps) == null || g.map((f) => {
24
24
  var R;
25
- const m = Object.values(((R = f.router) == null ? void 0 : R.glob) || {}).filter((r) => !!r).flat().sort((r, v) => (r.index ?? 0) - (v.index ?? 0));
26
- a.push(
25
+ const m = Object.values(((R = f.router) == null ? void 0 : R.glob) || {}).filter((r) => !!r).flat().sort((r, o) => (r.index ?? 0) - (o.index ?? 0));
26
+ u.push(
27
27
  ...m.map((r) => ({ ...r, path: `/${f.microAppName}${r.path}` }))
28
- ), a.push(
28
+ ), u.push(
29
29
  ...m.filter((r) => !!r.path).filter((r) => r.path !== "").filter((r) => r.path !== "/").filter((r) => !r.path.startsWith(`/${r.microAppName}`)).map((r) => ({
30
30
  path: r.path,
31
31
  redirect: `/${f.microAppName}${r.path}`,
@@ -33,26 +33,26 @@ const D = (e) => {
33
33
  }))
34
34
  );
35
35
  });
36
- const s = ((g = e == null ? void 0 : e.router) == null ? void 0 : g.routers) || [], n = [
36
+ const s = ((A = e == null ? void 0 : e.router) == null ? void 0 : A.routers) || [], n = [
37
37
  ...i(t, e),
38
38
  ...i(s, e),
39
- ...i(a, e)
39
+ ...i(u, e)
40
40
  ];
41
- return { router: j({ history: k(u), routes: n, ...c }) };
42
- }, i = (e, u) => e.map((c) => {
41
+ return { router: j({ history: D(a), routes: n, ...c }) };
42
+ }, i = (e, a) => e.map((c) => {
43
43
  const l = c.meta || {};
44
- return l.keepAlive = l.keepAlive ?? (u == null ? void 0 : u.keepAlive) ?? !0, { ...c, meta: l };
44
+ return l.keepAlive = l.keepAlive ?? (a == null ? void 0 : a.keepAlive) ?? !0, { ...c, meta: l };
45
45
  }), q = (e) => {
46
46
  var n;
47
47
  e || (e = {});
48
- const u = o(!0);
49
- Promise.all([w(e), O(e)]).then(() => {
50
- u.value = !1;
48
+ const a = v(!0);
49
+ Promise.all([w(e), P(e)]).then(() => {
50
+ a.value = !1;
51
51
  });
52
- const { container: c, component: l, props: t } = (e == null ? void 0 : e.root) || {}, a = x(l || P, t);
53
- a.use(y, e), a.use(d);
54
- const { router: s } = D(e);
55
- return a.use(s), a.mount(c || "#app"), (n = window.top) != null && n.vueRouter || window.top && (window.top.vueRouter = s), { app: a, router: s, loading: u, store: d };
52
+ const { container: c, component: l, props: t } = (e == null ? void 0 : e.root) || {}, u = x(l || O, t);
53
+ u.use(k, e), u.use(d);
54
+ const { router: s } = y(e);
55
+ return u.use(s), u.mount(c || "#app"), (n = window.top) != null && n.vueRouter || window.top && (window.top.vueRouter = s), { app: u, router: s, loading: a, store: d };
56
56
  };
57
57
  export {
58
58
  q as createDasWebApp
@@ -8,18 +8,19 @@ 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 s = vue.reactive({}),
11
+ var h = "language",
12
+ s = vue.reactive({}),
12
13
  c = vue.reactive({}),
13
14
  l = vue.reactive({}),
14
- p = commonTools.getUrlParams(location.href, "uiCulture") || {},
15
- j = (p == null ? undefined : p.uiCulture) || window.localStorage.getItem("language") || window.navigator.language || "zh-CN",
16
- m = vue.ref(j),
15
+ j = commonTools.getUrlParams(location.href, "uiCulture") || "",
16
+ y = j || window.localStorage.getItem(h) || window.navigator.language || "zh-CN",
17
+ m = vue.ref(y),
17
18
  D = "dasI18n",
18
19
  g = function g() {
19
20
  var t = document.documentElement;
20
21
  t && t.setAttribute("lang", m.value);
21
22
  },
22
- M = function M() {
23
+ v = function v() {
23
24
  var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
24
25
  var a = arguments.length > 1 ? arguments[1] : undefined;
25
26
  var r = a === "global",
@@ -30,7 +31,7 @@ var s = vue.reactive({}),
30
31
  i[n] || (i[n] = {}), i[n][o] = (_t$o$n = t[o][n]) !== null && _t$o$n !== void 0 ? _t$o$n : "", r && (c[n] || (c[n] = {}), c[n][o] = i[n][o]), e && (s[n] || (s[n] = {}), s[n][o] = i[n][o]);
31
32
  }
32
33
  },
33
- y = function y() {
34
+ b = function b() {
34
35
  var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35
36
  var a = arguments.length > 1 ? arguments[1] : undefined;
36
37
  var i;
@@ -41,7 +42,7 @@ var s = vue.reactive({}),
41
42
  n && (l[n] || (l[n] = {}), l[n][o] = t[o]), s[o] || (s[o] = t[o]);
42
43
  }
43
44
  },
44
- v = /*#__PURE__*/function () {
45
+ R = /*#__PURE__*/function () {
45
46
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t) {
46
47
  var a;
47
48
  return _regenerator().w(function (_context) {
@@ -49,29 +50,29 @@ var s = vue.reactive({}),
49
50
  case 0:
50
51
  g();
51
52
  a = window[D];
52
- a && y(a, "global");
53
+ a && b(a, "global");
53
54
  case 1:
54
55
  return _context.a(2);
55
56
  }
56
57
  }, _callee);
57
58
  }));
58
- return function v(_x) {
59
+ return function R(_x) {
59
60
  return _ref.apply(this, arguments);
60
61
  };
61
62
  }(),
62
- b = function b(t) {
63
+ A = function A(t) {
63
64
  var a = "";
64
65
  var r = /\/([^\/]+)\/([^\/]+)\//,
65
66
  e = t.match(r);
66
67
  return e && e.length >= 3 && (a = e[1] + "/" + e[2]), a ? a.toLowerCase() : "";
67
68
  },
68
- A = function A(t) {
69
+ I = function I(t) {
69
70
  for (var _len = arguments.length, a = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
70
71
  a[_key - 1] = arguments[_key];
71
72
  }
72
73
  return vue.computed(function () {
73
74
  var _l$framework, _l$r;
74
- var r = b(location.pathname);
75
+ var r = A(location.pathname);
75
76
  var e = (_l$framework = l.framework) !== null && _l$framework !== void 0 ? _l$framework : {},
76
77
  i = (_l$r = l[r]) !== null && _l$r !== void 0 ? _l$r : {},
77
78
  o = s[t] || c[t] || e[t] || i[t] || t;
@@ -80,25 +81,25 @@ var s = vue.reactive({}),
80
81
  "zh-CN": o
81
82
  });
82
83
  var n = o[m.value];
83
- return m.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (n = o["zh-cn"]), a.map(function (d, w) {
84
- n && (n = n.replace("$".concat(w), d));
84
+ return m.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (n = o["zh-cn"]), a.map(function (f, d) {
85
+ n && (n = n.replace("$".concat(d), f));
85
86
  }), n;
86
87
  });
87
88
  },
88
- I = A,
89
- R = function R(t) {
89
+ z = I,
90
+ N = function N(t) {
90
91
  for (var _len2 = arguments.length, a = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
91
92
  a[_key2 - 1] = arguments[_key2];
92
93
  }
93
- return I.apply(void 0, [t].concat(a)).value;
94
+ return z.apply(void 0, [t].concat(a)).value;
94
95
  },
95
- N = function N(t) {
96
+ T = function T(t) {
96
97
  m.value = t, g();
97
98
  },
98
99
  _ = function _() {
99
100
  return m;
100
101
  },
101
- f = {
102
+ u = {
102
103
  "en-US": {
103
104
  ant: function ant() {
104
105
  return Promise.resolve().then(function () {
@@ -256,18 +257,18 @@ var s = vue.reactive({}),
256
257
  }
257
258
  }
258
259
  };
259
- function T(t, a) {
260
+ function x(t, a) {
260
261
  var e;
261
262
  var r = window.DATE_FORMAT_MAP;
262
263
  return r && r[t] && r[t][a] ? r[t][a] : ((e = window.DATE_FORMAT_MAP[t]) == null ? undefined : e[a]) || "YYYY-MM-DD";
263
264
  }
264
- var x = /*#__PURE__*/function () {
265
+ var O = /*#__PURE__*/function () {
265
266
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t) {
266
267
  var a, r, _t;
267
268
  return _regenerator().w(function (_context2) {
268
269
  while (1) switch (_context2.p = _context2.n) {
269
270
  case 0:
270
- a = f[t] || f["zh-CN"];
271
+ a = u[t] || u["zh-CN"];
271
272
  _context2.p = 1;
272
273
  _context2.n = 2;
273
274
  return a.ant();
@@ -285,19 +286,20 @@ var x = /*#__PURE__*/function () {
285
286
  }
286
287
  }, _callee2, null, [[1, 4]]);
287
288
  }));
288
- return function x(_x2) {
289
+ return function O(_x2) {
289
290
  return _ref2.apply(this, arguments);
290
291
  };
291
292
  }();
292
293
  exports.currentLang = m;
293
294
  exports.customLangeData = s;
294
- exports.getDateFormat = T;
295
- exports.getI18nRule = A;
295
+ exports.getDateFormat = x;
296
+ exports.getI18nRule = I;
296
297
  exports.getLang = _;
297
- exports.i18n = I;
298
- exports.initI18n = v;
299
- exports.loadLocale = x;
300
- exports.setI18nRule = y;
301
- exports.setLang = N;
302
- exports.setLangRule = M;
303
- exports.t = R;
298
+ exports.i18n = z;
299
+ exports.initI18n = R;
300
+ exports.languageKey = h;
301
+ exports.loadLocale = O;
302
+ exports.setI18nRule = b;
303
+ exports.setLang = T;
304
+ exports.setLangRule = v;
305
+ exports.t = N;
@@ -1,14 +1,14 @@
1
- import { reactive as u, ref as C, computed as L } from "vue";
2
- import { getUrlParams as h } from "@das-fed/upf-utils/common-tools";
3
- const s = u({}), c = u({}), l = u({}), p = h(location.href, "uiCulture") || {}, j = (p == null ? void 0 : p.uiCulture) || window.localStorage.getItem("language") || window.navigator.language || "zh-CN", m = C(j), D = "dasI18n", g = () => {
1
+ import { reactive as p, ref as w, computed as C } from "vue";
2
+ import { getUrlParams as L } from "@das-fed/upf-utils/common-tools";
3
+ const h = "language", s = p({}), c = p({}), l = p({}), j = L(location.href, "uiCulture") || "", y = j || window.localStorage.getItem(h) || window.navigator.language || "zh-CN", m = w(y), D = "dasI18n", g = () => {
4
4
  const t = document.documentElement;
5
5
  t && t.setAttribute("lang", m.value);
6
- }, M = (t = {}, a) => {
6
+ }, v = (t = {}, a) => {
7
7
  const r = a === "global", e = !r, i = {};
8
8
  for (const o in t)
9
9
  for (const n in t[o])
10
10
  i[n] || (i[n] = {}), i[n][o] = t[o][n] ?? "", r && (c[n] || (c[n] = {}), c[n][o] = i[n][o]), e && (s[n] || (s[n] = {}), s[n][o] = i[n][o]);
11
- }, y = (t = {}, a) => {
11
+ }, b = (t = {}, a) => {
12
12
  var i;
13
13
  const r = a === "global", e = !r;
14
14
  for (const o in t)
@@ -16,26 +16,26 @@ const s = u({}), c = u({}), l = u({}), p = h(location.href, "uiCulture") || {},
16
16
  const n = (i = t[o]) != null && i._appCode ? t[o]._appCode.toLowerCase() : "";
17
17
  n && (l[n] || (l[n] = {}), l[n][o] = t[o]), s[o] || (s[o] = t[o]);
18
18
  }
19
- }, v = async (t) => {
19
+ }, R = async (t) => {
20
20
  g();
21
21
  const a = window[D];
22
- a && y(a, "global");
23
- }, b = (t) => {
22
+ a && b(a, "global");
23
+ }, A = (t) => {
24
24
  let a = "";
25
25
  const r = /\/([^\/]+)\/([^\/]+)\//, e = t.match(r);
26
26
  return e && e.length >= 3 && (a = e[1] + "/" + e[2]), a ? a.toLowerCase() : "";
27
- }, A = (t, ...a) => L(() => {
28
- const r = b(location.pathname);
27
+ }, I = (t, ...a) => C(() => {
28
+ const r = A(location.pathname);
29
29
  let e = l.framework ?? {}, i = l[r] ?? {}, o = s[t] || c[t] || e[t] || i[t] || t;
30
30
  if (o === t) return t;
31
31
  typeof o == "string" && (o = { "zh-CN": o });
32
32
  let n = o[m.value];
33
- return m.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (n = o["zh-cn"]), a.map((d, w) => {
34
- n && (n = n.replace(`$${w}`, d));
33
+ return m.value === "zh-CN" && o["zh-cn"] && !o["zh-CN"] && (n = o["zh-cn"]), a.map((f, d) => {
34
+ n && (n = n.replace(`$${d}`, f));
35
35
  }), n;
36
- }), I = A, R = (t, ...a) => I(t, ...a).value, N = (t) => {
36
+ }), z = I, N = (t, ...a) => z(t, ...a).value, T = (t) => {
37
37
  m.value = t, g();
38
- }, _ = () => m, f = {
38
+ }, _ = () => m, u = {
39
39
  "en-US": { ant: () => import("ant-design-vue/es/locale/en_US"), dayjs: () => import("dayjs/locale/en") },
40
40
  "zh-CN": { ant: () => import("ant-design-vue/es/locale/zh_CN"), dayjs: () => import("dayjs/locale/zh-cn") },
41
41
  "zh-MO": { ant: () => import("ant-design-vue/es/locale/zh_TW"), dayjs: () => import("dayjs/locale/zh-tw") },
@@ -50,13 +50,13 @@ const s = u({}), c = u({}), l = u({}), p = h(location.href, "uiCulture") || {},
50
50
  "nl-NL": { ant: () => import("ant-design-vue/es/locale/nl_NL"), dayjs: () => import("dayjs/locale/nl") },
51
51
  "tr-TR": { ant: () => import("ant-design-vue/es/locale/tr_TR"), dayjs: () => import("dayjs/locale/tr") }
52
52
  };
53
- function T(t, a) {
53
+ function x(t, a) {
54
54
  var e;
55
55
  const r = window.DATE_FORMAT_MAP;
56
56
  return r && r[t] && r[t][a] ? r[t][a] : ((e = window.DATE_FORMAT_MAP[t]) == null ? void 0 : e[a]) || "YYYY-MM-DD";
57
57
  }
58
- const x = async (t) => {
59
- const a = f[t] || f["zh-CN"];
58
+ const O = async (t) => {
59
+ const a = u[t] || u["zh-CN"];
60
60
  try {
61
61
  const r = await a.ant();
62
62
  return await a.dayjs(), r.default;
@@ -66,14 +66,15 @@ const x = async (t) => {
66
66
  export {
67
67
  m as currentLang,
68
68
  s as customLangeData,
69
- T as getDateFormat,
70
- A as getI18nRule,
69
+ x as getDateFormat,
70
+ I as getI18nRule,
71
71
  _ as getLang,
72
- I as i18n,
73
- v as initI18n,
74
- x as loadLocale,
75
- y as setI18nRule,
76
- N as setLang,
77
- M as setLangRule,
78
- R as t
72
+ z as i18n,
73
+ R as initI18n,
74
+ h as languageKey,
75
+ O as loadLocale,
76
+ b as setI18nRule,
77
+ T as setLang,
78
+ v as setLangRule,
79
+ N as t
79
80
  };
Binary file
@@ -1,4 +1,6 @@
1
- type langType = 'zh-CN' | 'en-US' | 'zh-MO';
1
+ import { langType } from './type';
2
+
3
+ declare const languageKey = "language";
2
4
  declare const customLangeData: any;
3
5
  declare const currentLang: import('vue').Ref<any, any>;
4
6
  declare const setLangRule: (data?: any, type?: "global" | "custom") => void;
@@ -23,4 +25,4 @@ declare const setLang: (lang: langType) => void;
23
25
  declare const getLang: () => import('vue').Ref<any, any>;
24
26
  export declare function getDateFormat(type: 'month' | 'date' | 'datetime' | 'time', lang: string): string;
25
27
  declare const loadLocale: (lang: string) => unknown;
26
- export { initI18n, setI18nRule, getI18nRule, i18n, t, setLang, getLang, currentLang, setLangRule, customLangeData, loadLocale };
28
+ export { languageKey, initI18n, setI18nRule, getI18nRule, i18n, t, setLang, getLang, currentLang, setLangRule, customLangeData, loadLocale, };
@@ -0,0 +1,4 @@
1
+ import { langType } from './type';
2
+
3
+ export declare const registerI18nData: (appName: string[], currentLang: langType, cb: any) => Promise<void>;
4
+ export declare const registerMicroI18nData: (opt?: any) => void;
package/types/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './create-das-web-app';
2
2
  export * from './i18n';
3
+ export * from './i18n/register';
3
4
  export * from './theme';
4
5
  export * from './layout';
5
6
  export * from './micro-frontend';
Binary file
Binary file