@das-fed/upf-web 6.4.0-dev.203 → 6.4.0-dev.205

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.
@@ -1,137 +1,85 @@
1
- import { reactive as L, ref as j, createApp as B } from "vue";
2
- import { initTheme as I } from "@das-fed/upf-web/packages/theme/index";
3
- import { DasWebLayout as N } from "@das-fed/upf-web/packages/layout/index";
4
- import { createPinia as D } from "pinia";
5
- import W from "pinia-plugin-persistedstate";
6
- import { createRouter as C, createWebHistory as M } from "vue-router";
7
- import { getUrlParams as O, handleI18nData as S } from "@das-fed/upf-utils/common-tools";
8
- import { getConfig as z } from "@das-fed/upf-utils/config";
9
- const H = {
10
- install: (e, n) => {
11
- var a;
12
- const r = (a = n == null ? void 0 : n.plugins) == null ? void 0 : a.glob;
13
- r && Object.values(r).sort((t, s) => (t.index ?? 0) - (s.index ?? 0)).filter((t) => t ? !!(t.default && t.default.install || t.install) : !1).forEach((t) => {
14
- t.default && t.default.install && e.use(t.default, n), t.install && e.use(t, n);
1
+ import { ref as N, createApp as W } from "vue";
2
+ import { initTheme as O } from "@das-fed/upf-web/packages/theme/index";
3
+ import { DasWebLayout as P } from "@das-fed/upf-web/packages/layout/index";
4
+ import { createPinia as j } from "pinia";
5
+ import C from "pinia-plugin-persistedstate";
6
+ import { createRouter as D, createWebHistory as M } from "vue-router";
7
+ import { languageKey as S, registerMicroI18nData as B, microI18nStore as E } from "@das-fed/upf-web/packages/i18n/index";
8
+ const I = {
9
+ install: (e, u) => {
10
+ var l;
11
+ const f = (l = u == null ? void 0 : u.plugins) == null ? void 0 : l.glob;
12
+ f && Object.values(f).sort((t, c) => (t.index ?? 0) - (c.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);
15
14
  });
16
15
  }
17
- }, E = D();
18
- E.use(W);
19
- const P = "language", A = L({});
20
- L({});
21
- L({});
22
- const K = O(location.href, "uiCulture") || "", F = K || window.localStorage.getItem(P) || window.navigator.language || "zh-CN", $ = j(F), G = () => {
23
- const e = document.documentElement;
24
- e && e.setAttribute("lang", $.value);
25
- }, R = (e = {}, n) => {
26
- const r = {};
27
- for (const a in e)
28
- for (const t in e[a])
29
- r[t] || (r[t] = {}), r[t][a] = e[a][t] ?? "", A[t] || (A[t] = {}), A[t][a] = r[t][a];
30
- }, T = (e) => {
31
- $.value = e, G();
32
- }, q = {
33
- loaded: {},
34
- isLoaded(e) {
35
- return !!this.loaded[e];
36
- },
37
- markLoaded(e) {
38
- this.loaded[e] = !0;
39
- },
40
- markUnloaded(e) {
41
- delete this.loaded[e];
42
- }
43
- }, J = async (e, n) => {
44
- var d, g, l;
45
- const r = z() || {}, a = ((d = r.i18n) == null ? void 0 : d.fromOss) ?? !0, t = ((g = r.i18n) == null ? void 0 : g.isPullBack) ?? !1, s = ((l = r.i18n) == null ? void 0 : l.isDasUI) ?? !0;
46
- let i = "/oss/resource/";
47
- try {
48
- const f = await S({
49
- baseUrl: a ? i : "/",
50
- currentLang: n,
51
- appName: e,
52
- isPullBack: t,
53
- fallbackBaseUrl: "/",
54
- isDasUI: s
55
- });
56
- if (!f || !(f != null && f.frontEnd))
57
- throw new Error("Failed to fetch i18n data");
58
- return f;
59
- } catch (h) {
60
- throw new Error(`registerResources error: ${h}`);
61
- }
62
- }, Q = async (e = []) => {
63
- const n = O(location.href, "uiCulture") || window.localStorage.getItem(P) || window.navigator.language || "zh-CN";
64
- try {
65
- const r = await J(e, n);
66
- r != null && r.frontEnd && typeof r.frontEnd == "object" && Object.keys(r.frontEnd).length && e.forEach((a) => {
67
- r.frontEnd[a] && typeof r.frontEnd[a] == "object" && Object.keys(r.frontEnd[a]).length && R({ [n]: r.frontEnd[a] });
68
- }), r != null && r.dasUiEnd && typeof r.dasUiEnd == "object" && Object.keys(r.dasUiEnd).length && R({ [n]: r.dasUiEnd }), T(n);
69
- } catch {
70
- }
71
- }, V = (e) => {
72
- var h, p, f, U, v;
73
- const n = ((h = e == null ? void 0 : e.router) == null ? void 0 : h.routerBase) ?? "/", r = ((p = e == null ? void 0 : e.router) == null ? void 0 : p.options) || {};
74
- let a = Object.assign(((f = e == null ? void 0 : e.router) == null ? void 0 : f.glob) || {});
75
- const t = Object.values(a).filter((u) => !!u).flat().sort((u, o) => (u.index ?? 0) - (o.index ?? 0)), s = [];
76
- (U = e == null ? void 0 : e.microApps) == null || U.map((u) => {
77
- var w;
78
- const o = Object.values(((w = u.router) == null ? void 0 : w.glob) || {}).filter((c) => !!c).flat().sort((c, y) => (c.index ?? 0) - (y.index ?? 0));
79
- s.push(
80
- ...o.map((c) => ({ ...c, path: `/${u.microAppName}${c.path}` }))
81
- ), s.push(
82
- ...o.filter((c) => !!c.path).filter((c) => c.path !== "").filter((c) => c.path !== "/").filter((c) => !c.path.startsWith(`/${c.microAppName}`)).map((c) => ({
83
- path: c.path,
84
- redirect: `/${u.microAppName}${c.path}`,
85
- meta: { ...c.meta || {}, isMicroAppRouteRedirect: !0 }
16
+ }, b = j();
17
+ b.use(C);
18
+ const q = (e) => {
19
+ var y, R, v, k, x;
20
+ const u = ((y = e == null ? void 0 : e.router) == null ? void 0 : y.routerBase) ?? "/", f = ((R = e == null ? void 0 : e.router) == null ? void 0 : R.options) || {};
21
+ let l = Object.assign(((v = e == null ? void 0 : e.router) == null ? void 0 : v.glob) || {});
22
+ const t = Object.values(l).filter((n) => !!n).flat().sort((n, a) => (n.index ?? 0) - (a.index ?? 0)), c = [];
23
+ (k = e == null ? void 0 : e.microApps) == null || k.map((n) => {
24
+ var g;
25
+ const a = Object.values(((g = n.router) == null ? void 0 : g.glob) || {}).filter((r) => !!r).flat().sort((r, p) => (r.index ?? 0) - (p.index ?? 0));
26
+ c.push(
27
+ ...a.map((r) => ({ ...r, path: `/${n.microAppName}${r.path}` }))
28
+ ), c.push(
29
+ ...a.filter((r) => !!r.path).filter((r) => r.path !== "").filter((r) => r.path !== "/").filter((r) => !r.path.startsWith(`/${r.microAppName}`)).map((r) => ({
30
+ path: r.path,
31
+ redirect: `/${n.microAppName}${r.path}`,
32
+ meta: { ...r.meta || {}, isMicroAppRouteRedirect: !0 }
86
33
  }))
87
34
  );
88
35
  });
89
- const i = ((v = e == null ? void 0 : e.router) == null ? void 0 : v.routers) || [], d = [
90
- ...k(t, e),
91
- ...k(i, e),
92
- ...k(s, e)
93
- ], g = C({ history: M(n), routes: d, ...r }), l = q;
94
- if (Array.isArray(e == null ? void 0 : e.microApps) && e.microApps.length && l) {
95
- const u = /* @__PURE__ */ new Map();
96
- for (const o of e.microApps)
97
- o != null && o.microAppName && (o != null && o.i18n) && u.set(o.microAppName, o.i18n);
98
- g.beforeEach(async (o, w, c) => {
36
+ const i = ((x = e == null ? void 0 : e.router) == null ? void 0 : x.routers) || [], d = [
37
+ ...A(t, e),
38
+ ...A(i, e),
39
+ ...A(c, e)
40
+ ], w = D({ history: M(u), routes: d, ...f }), h = E;
41
+ if (Array.isArray(e == null ? void 0 : e.microApps) && e.microApps.length && h) {
42
+ const n = /* @__PURE__ */ new Map();
43
+ for (const a of e.microApps)
44
+ a != null && a.microAppName && (a != null && a.i18n) && n.set(a.microAppName, a.i18n);
45
+ w.beforeEach(async (a, g, r) => {
46
+ var p;
99
47
  try {
100
- const y = o.path || "";
101
- for (const [b, m] of u.entries()) {
102
- if (!b || !y.toLowerCase().startsWith(`/${b.toLowerCase()}`)) continue;
103
- if (typeof l.isLoaded == "function" && l.isLoaded(b) || !m || !(m != null && m.length)) break;
104
- const x = typeof m == "string" ? [m] : m;
105
- typeof l.markLoaded == "function" && l.markLoaded(b);
48
+ const m = ((p = a.query) == null ? void 0 : p.uiCulture) || window.localStorage.getItem(S) || window.navigator.language || "zh-CN", $ = a.path || "";
49
+ for (const [o, s] of n.entries()) {
50
+ if (!o || !$.toLowerCase().startsWith(`/${o.toLowerCase()}`)) continue;
51
+ if (h.isLoaded(m, o) || !s || !(s != null && s.length)) break;
52
+ const L = typeof s == "string" ? [s] : s;
53
+ h.markLoaded(m, o);
106
54
  try {
107
- await Q(x);
55
+ await B(L, m);
108
56
  } catch {
109
- typeof l.markUnloaded == "function" && l.markUnloaded(b);
57
+ h.markUnloaded(m, o);
110
58
  }
111
59
  break;
112
60
  }
113
61
  } catch {
114
62
  } finally {
115
- c();
63
+ r();
116
64
  }
117
65
  });
118
66
  }
119
- return { router: g };
120
- }, k = (e, n) => e.map((r) => {
121
- const a = r.meta || {};
122
- return a.keepAlive = a.keepAlive ?? (n == null ? void 0 : n.keepAlive) ?? !0, { ...r, meta: a };
123
- }), ce = (e) => {
67
+ return { router: w };
68
+ }, A = (e, u) => e.map((f) => {
69
+ const l = f.meta || {};
70
+ return l.keepAlive = l.keepAlive ?? (u == null ? void 0 : u.keepAlive) ?? !0, { ...f, meta: l };
71
+ }), Q = (e) => {
124
72
  var d;
125
73
  e || (e = {});
126
- const n = j(!0);
127
- Promise.all([I(e)]).then(() => {
128
- n.value = !1;
74
+ const u = N(!0);
75
+ Promise.all([O(e)]).then(() => {
76
+ u.value = !1;
129
77
  });
130
- const { container: r, component: a, props: t } = (e == null ? void 0 : e.root) || {}, s = B(a || N, t);
131
- s.use(H, e), s.use(E);
132
- const { router: i } = V(e);
133
- return s.use(i), s.mount(r || "#app"), (d = window.top) != null && d.vueRouter || window.top && (window.top.vueRouter = i), { app: s, router: i, loading: n, store: E };
78
+ const { container: f, component: l, props: t } = (e == null ? void 0 : e.root) || {}, c = W(l || P, t);
79
+ c.use(I, e), c.use(b);
80
+ const { router: i } = q(e);
81
+ return c.use(i), c.mount(f || "#app"), (d = window.top) != null && d.vueRouter || window.top && (window.top.vueRouter = i), { app: c, router: i, loading: u, store: b };
134
82
  };
135
83
  export {
136
- ce as createDasWebApp
84
+ Q as createDasWebApp
137
85
  };
@@ -1,105 +1,162 @@
1
1
  'use strict';
2
2
 
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
3
6
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
7
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t4 in e) "default" !== _t4 && {}.hasOwnProperty.call(e, _t4) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t4)) && (i.get || i.set) ? o(f, _t4, i) : f[_t4] = e[_t4]); return f; })(e, t); }
5
8
  function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
6
9
  function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
7
10
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
8
11
  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
12
  var vue = require('vue');
10
13
  var commonTools = require('@das-fed/upf-utils/common-tools');
11
- var h = "language",
12
- s = vue.reactive({}),
14
+ var config = require('@das-fed/upf-utils/config');
15
+ var x = {
16
+ loaded: {},
17
+ isLoaded: function isLoaded(t, e) {
18
+ return !!(this.loaded[t] && this.loaded[t][e]);
19
+ },
20
+ markLoaded: function markLoaded(t, e) {
21
+ this.loaded[t] || (this.loaded[t] = {}), this.loaded[t][e] = true;
22
+ },
23
+ markUnloaded: function markUnloaded(t, e) {
24
+ this.loaded[t] && (delete this.loaded[t][e], Object.keys(this.loaded[t]).length === 0 && delete this.loaded[t]);
25
+ }
26
+ },
27
+ D = /*#__PURE__*/function () {
28
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t, e) {
29
+ var _ref2, _ref3, _ref4;
30
+ var m, u, g, o, a, s, n, r, l, _t;
31
+ return _regenerator().w(function (_context) {
32
+ while (1) switch (_context.p = _context.n) {
33
+ case 0:
34
+ o = config.getConfig() || {}, a = (_ref2 = (m = o.i18n) == null ? undefined : m.fromOss) !== null && _ref2 !== void 0 ? _ref2 : true, s = (_ref3 = (u = o.i18n) == null ? undefined : u.isPullBack) !== null && _ref3 !== void 0 ? _ref3 : false, n = (_ref4 = (g = o.i18n) == null ? undefined : g.isDasUI) !== null && _ref4 !== void 0 ? _ref4 : true;
35
+ r = "/oss/resource/";
36
+ _context.p = 1;
37
+ _context.n = 2;
38
+ return commonTools.handleI18nData({
39
+ baseUrl: a ? r : "/",
40
+ currentLang: e,
41
+ appName: t,
42
+ isPullBack: s,
43
+ fallbackBaseUrl: "/",
44
+ isDasUI: n
45
+ });
46
+ case 2:
47
+ l = _context.v;
48
+ if (!(!l || !(l != null && l.frontEnd))) {
49
+ _context.n = 3;
50
+ break;
51
+ }
52
+ throw new Error("Failed to fetch i18n data");
53
+ case 3:
54
+ return _context.a(2, l);
55
+ case 4:
56
+ _context.p = 4;
57
+ _t = _context.v;
58
+ throw new Error("registerResources error: ".concat(_t));
59
+ case 5:
60
+ return _context.a(2);
61
+ }
62
+ }, _callee, null, [[1, 4]]);
63
+ }));
64
+ return function D(_x, _x2) {
65
+ return _ref.apply(this, arguments);
66
+ };
67
+ }(),
68
+ U = "language",
69
+ i = vue.reactive({}),
13
70
  c = vue.reactive({}),
14
- l = vue.reactive({}),
15
- j = commonTools.getUrlParams(location.href, "uiCulture") || "",
16
- y = j || window.localStorage.getItem(h) || window.navigator.language || "zh-CN",
17
- m = vue.ref(y),
18
- D = "dasI18n",
19
- g = function g() {
71
+ d = vue.reactive({}),
72
+ M = commonTools.getUrlParams(location.href, "uiCulture") || "",
73
+ O = M || window.localStorage.getItem(U) || window.navigator.language || "zh-CN",
74
+ f = vue.ref(O),
75
+ z = "dasI18n",
76
+ w = function w() {
20
77
  var t = document.documentElement;
21
- t && t.setAttribute("lang", m.value);
78
+ t && t.setAttribute("lang", f.value);
22
79
  },
23
- v = function v() {
80
+ y = function y() {
24
81
  var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25
- var a = arguments.length > 1 ? arguments[1] : undefined;
26
- var r = a === "global",
27
- e = !r,
28
- i = {};
29
- for (var o in t) for (var n in t[o]) {
30
- var _t$o$n;
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]);
82
+ var e = arguments.length > 1 ? arguments[1] : undefined;
83
+ var o = e === "global",
84
+ a = !o,
85
+ s = {};
86
+ for (var n in t) for (var r in t[n]) {
87
+ var _t$n$r;
88
+ s[r] || (s[r] = {}), s[r][n] = (_t$n$r = t[n][r]) !== null && _t$n$r !== void 0 ? _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]);
32
89
  }
33
90
  },
34
- b = function b() {
91
+ A = function A() {
35
92
  var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
36
- var a = arguments.length > 1 ? arguments[1] : undefined;
37
- var i;
38
- var r = a === "global",
39
- e = !r;
40
- for (var o in t) if (r && !c[o] && (c[o] = t[o]), e) {
41
- var n = (i = t[o]) != null && i._appCode ? t[o]._appCode.toLowerCase() : "";
42
- n && (l[n] || (l[n] = {}), l[n][o] = t[o]), s[o] || (s[o] = t[o]);
93
+ var e = arguments.length > 1 ? arguments[1] : undefined;
94
+ var s;
95
+ var o = e === "global",
96
+ a = !o;
97
+ for (var n in t) if (o && !c[n] && (c[n] = t[n]), a) {
98
+ var r = (s = t[n]) != null && s._appCode ? t[n]._appCode.toLowerCase() : "";
99
+ r && (d[r] || (d[r] = {}), d[r][n] = t[n]), i[n] || (i[n] = t[n]);
43
100
  }
44
101
  },
45
- R = /*#__PURE__*/function () {
46
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t) {
47
- var a;
48
- return _regenerator().w(function (_context) {
49
- while (1) switch (_context.n) {
102
+ B = /*#__PURE__*/function () {
103
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t) {
104
+ var e;
105
+ return _regenerator().w(function (_context2) {
106
+ while (1) switch (_context2.n) {
50
107
  case 0:
51
- g();
52
- a = window[D];
53
- a && b(a, "global");
108
+ w();
109
+ e = window[z];
110
+ e && A(e, "global");
54
111
  case 1:
55
- return _context.a(2);
112
+ return _context2.a(2);
56
113
  }
57
- }, _callee);
114
+ }, _callee2);
58
115
  }));
59
- return function R(_x) {
60
- return _ref.apply(this, arguments);
116
+ return function B(_x3) {
117
+ return _ref5.apply(this, arguments);
61
118
  };
62
119
  }(),
63
- A = function A(t) {
64
- var a = "";
65
- var r = /\/([^\/]+)\/([^\/]+)\//,
66
- e = t.match(r);
67
- return e && e.length >= 3 && (a = e[1] + "/" + e[2]), a ? a.toLowerCase() : "";
120
+ R = function R(t) {
121
+ var e = "";
122
+ var o = /\/([^\/]+)\/([^\/]+)\//,
123
+ a = t.match(o);
124
+ return a && a.length >= 3 && (e = a[1] + "/" + a[2]), e ? e.toLowerCase() : "";
68
125
  },
69
- I = function I(t) {
70
- for (var _len = arguments.length, a = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
71
- a[_key - 1] = arguments[_key];
126
+ k = function k(t) {
127
+ for (var _len = arguments.length, e = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
128
+ e[_key - 1] = arguments[_key];
72
129
  }
73
130
  return vue.computed(function () {
74
- var _l$framework, _l$r;
75
- var r = A(location.pathname);
76
- var e = (_l$framework = l.framework) !== null && _l$framework !== void 0 ? _l$framework : {},
77
- i = (_l$r = l[r]) !== null && _l$r !== void 0 ? _l$r : {},
78
- o = s[t] || c[t] || e[t] || i[t] || t;
79
- if (o === t) return t;
80
- typeof o == "string" && (o = {
81
- "zh-CN": o
131
+ var _d$framework, _d$o;
132
+ var o = R(location.pathname);
133
+ var a = (_d$framework = d.framework) !== null && _d$framework !== void 0 ? _d$framework : {},
134
+ s = (_d$o = d[o]) !== null && _d$o !== void 0 ? _d$o : {},
135
+ n = i[t] || c[t] || a[t] || s[t] || t;
136
+ if (n === t) return t;
137
+ typeof n == "string" && (n = {
138
+ "zh-CN": n
82
139
  });
83
- var n = o[m.value];
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));
86
- }), n;
140
+ var r = n[f.value];
141
+ return f.value === "zh-CN" && n["zh-cn"] && !n["zh-CN"] && (r = n["zh-cn"]), e.map(function (m, u) {
142
+ r && (r = r.replace("$".concat(u), m));
143
+ }), r;
87
144
  });
88
145
  },
89
- z = I,
90
- N = function N(t) {
91
- for (var _len2 = arguments.length, a = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
92
- a[_key2 - 1] = arguments[_key2];
146
+ v = k,
147
+ F = function F(t) {
148
+ for (var _len2 = arguments.length, e = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
149
+ e[_key2 - 1] = arguments[_key2];
93
150
  }
94
- return z.apply(void 0, [t].concat(a)).value;
151
+ return v.apply(void 0, [t].concat(e)).value;
95
152
  },
96
- T = function T(t) {
97
- m.value = t, g();
153
+ N = function N(t) {
154
+ f.value = t, w();
98
155
  },
99
- _ = function _() {
100
- return m;
156
+ G = function G() {
157
+ return f;
101
158
  },
102
- u = {
159
+ E = {
103
160
  "en-US": {
104
161
  ant: function ant() {
105
162
  return Promise.resolve().then(function () {
@@ -257,49 +314,85 @@ var h = "language",
257
314
  }
258
315
  }
259
316
  };
260
- function x(t, a) {
261
- var e;
262
- var r = window.DATE_FORMAT_MAP;
263
- return r && r[t] && r[t][a] ? r[t][a] : ((e = window.DATE_FORMAT_MAP[t]) == null ? undefined : e[a]) || "YYYY-MM-DD";
317
+ function Y(t, e) {
318
+ var a;
319
+ var o = window.DATE_FORMAT_MAP;
320
+ return o && o[t] && o[t][e] ? o[t][e] : ((a = window.DATE_FORMAT_MAP[t]) == null ? undefined : a[e]) || "YYYY-MM-DD";
264
321
  }
265
- var O = /*#__PURE__*/function () {
266
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t) {
267
- var a, r, _t;
268
- return _regenerator().w(function (_context2) {
269
- while (1) switch (_context2.p = _context2.n) {
270
- case 0:
271
- a = u[t] || u["zh-CN"];
272
- _context2.p = 1;
273
- _context2.n = 2;
274
- return a.ant();
275
- case 2:
276
- r = _context2.v;
277
- _context2.n = 3;
278
- return a.dayjs();
279
- case 3:
280
- return _context2.a(2, r["default"]);
281
- case 4:
282
- _context2.p = 4;
283
- _t = _context2.v;
284
- case 5:
285
- return _context2.a(2);
286
- }
287
- }, _callee2, null, [[1, 4]]);
288
- }));
289
- return function O(_x2) {
290
- return _ref2.apply(this, arguments);
291
- };
292
- }();
293
- exports.currentLang = m;
294
- exports.customLangeData = s;
295
- exports.getDateFormat = x;
296
- exports.getI18nRule = I;
297
- exports.getLang = _;
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;
322
+ var K = /*#__PURE__*/function () {
323
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(t) {
324
+ var e, o, _t2;
325
+ return _regenerator().w(function (_context3) {
326
+ while (1) switch (_context3.p = _context3.n) {
327
+ case 0:
328
+ e = E[t] || E["zh-CN"];
329
+ _context3.p = 1;
330
+ _context3.n = 2;
331
+ return e.ant();
332
+ case 2:
333
+ o = _context3.v;
334
+ _context3.n = 3;
335
+ return e.dayjs();
336
+ case 3:
337
+ return _context3.a(2, o["default"]);
338
+ case 4:
339
+ _context3.p = 4;
340
+ _t2 = _context3.v;
341
+ case 5:
342
+ return _context3.a(2);
343
+ }
344
+ }, _callee3, null, [[1, 4]]);
345
+ }));
346
+ return function K(_x4) {
347
+ return _ref6.apply(this, arguments);
348
+ };
349
+ }(),
350
+ $ = /*#__PURE__*/function () {
351
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
352
+ var t,
353
+ e,
354
+ o,
355
+ _args4 = arguments,
356
+ _t3;
357
+ return _regenerator().w(function (_context4) {
358
+ while (1) switch (_context4.p = _context4.n) {
359
+ case 0:
360
+ t = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : [];
361
+ e = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : "zh-CN";
362
+ _context4.p = 1;
363
+ _context4.n = 2;
364
+ return D(t, e);
365
+ case 2:
366
+ o = _context4.v;
367
+ o != null && o.frontEnd && _typeof(o.frontEnd) == "object" && Object.keys(o.frontEnd).length && t.forEach(function (a) {
368
+ o.frontEnd[a] && _typeof(o.frontEnd[a]) == "object" && Object.keys(o.frontEnd[a]).length && y(_defineProperty({}, e, o.frontEnd[a]));
369
+ }), o != null && o.dasUiEnd && _typeof(o.dasUiEnd) == "object" && Object.keys(o.dasUiEnd).length && y(_defineProperty({}, e, o.dasUiEnd)), N(e);
370
+ _context4.n = 4;
371
+ break;
372
+ case 3:
373
+ _context4.p = 3;
374
+ _t3 = _context4.v;
375
+ case 4:
376
+ return _context4.a(2);
377
+ }
378
+ }, _callee4, null, [[1, 3]]);
379
+ }));
380
+ return function $() {
381
+ return _ref7.apply(this, arguments);
382
+ };
383
+ }();
384
+ exports.currentLang = f;
385
+ exports.customLangeData = i;
386
+ exports.getDateFormat = Y;
387
+ exports.getI18nRule = k;
388
+ exports.getLang = G;
389
+ exports.i18n = v;
390
+ exports.initI18n = B;
391
+ exports.languageKey = U;
392
+ exports.loadLocale = K;
393
+ exports.microI18nStore = x;
394
+ exports.registerMicroI18nData = $;
395
+ exports.setI18nRule = A;
396
+ exports.setLang = N;
397
+ exports.setLangRule = y;
398
+ exports.t = F;