@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.
- package/es5.js +63 -63
- package/esm-map.json +17 -14
- package/{index-Cwnxjz4B.js → index-BJ0qSbnM.js} +1609 -1580
- package/index-BJ0qSbnM.js.gz +0 -0
- package/{index-D7Yosv5R.js → index-Dda2lRZV.js} +1 -1
- package/index-Dda2lRZV.js.gz +0 -0
- package/{index-DN3L_UYL.js → index-DpqH658a.js} +1 -1
- package/index.js +20 -17
- package/package.json +6 -6
- package/packages/create-das-web-app/es5.js +34 -34
- package/packages/create-das-web-app/index.js +29 -29
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +34 -32
- package/packages/i18n/index.js +27 -26
- package/packages/i18n/index.js.gz +0 -0
- package/types/i18n/index.d.ts +4 -2
- package/types/i18n/register.d.ts +4 -0
- package/types/index.d.ts +1 -0
- package/index-Cwnxjz4B.js.gz +0 -0
- package/index-D7Yosv5R.js.gz +0 -0
|
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-
|
|
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
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
g as currentLang,
|
|
10
|
+
u as currentTheme,
|
|
11
|
+
m as customLangeData,
|
|
12
|
+
D as getDateFormat,
|
|
13
13
|
l as getI18nRule,
|
|
14
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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.
|
|
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.
|
|
8
|
-
"@das-fed/upf-utils": "6.4.0-dev.
|
|
9
|
-
"@das-fed/upf-web": "6.4.0-dev.
|
|
10
|
-
"@das-fed/upf-web-components": "6.4.0-dev.
|
|
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.
|
|
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/
|
|
18
|
-
var
|
|
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
|
|
23
|
-
install: function install(e,
|
|
22
|
+
var k = {
|
|
23
|
+
install: function install(e, a) {
|
|
24
24
|
var l;
|
|
25
|
-
var c = (l =
|
|
26
|
-
c && Object.values(c).sort(function (t,
|
|
27
|
-
var _t$index,
|
|
28
|
-
return ((_t$index = t.index) !== null && _t$index !== void 0 ? _t$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"],
|
|
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
|
|
38
|
+
var y = function y(e) {
|
|
39
39
|
var _ref;
|
|
40
|
-
var h, b, p,
|
|
41
|
-
var
|
|
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
|
-
|
|
51
|
-
(
|
|
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,
|
|
56
|
-
var _r$index,
|
|
57
|
-
return ((_r$index = r.index) !== null && _r$index !== void 0 ? _r$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
|
-
|
|
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
|
-
}))),
|
|
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 = ((
|
|
82
|
-
n = [].concat(_toConsumableArray(i(t, e)), _toConsumableArray(i(s, e)), _toConsumableArray(i(
|
|
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(
|
|
85
|
+
history: vueRouter.createWebHistory(a),
|
|
86
86
|
routes: n
|
|
87
87
|
}, c))
|
|
88
88
|
};
|
|
89
89
|
},
|
|
90
|
-
i = function i(e,
|
|
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 :
|
|
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
|
|
103
|
-
Promise.all([index.initTheme(e),
|
|
104
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
s =
|
|
114
|
-
return
|
|
115
|
-
app:
|
|
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:
|
|
117
|
+
loading: a,
|
|
118
118
|
store: d
|
|
119
119
|
};
|
|
120
120
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { ref as
|
|
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 {
|
|
4
|
-
import {
|
|
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
|
|
8
|
-
const
|
|
9
|
-
install: (e,
|
|
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 =
|
|
12
|
-
c && Object.values(c).sort((t,
|
|
13
|
-
t.default && t.default.install && e.use(t.default,
|
|
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
|
|
19
|
-
var h, b, p,
|
|
20
|
-
const
|
|
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)),
|
|
23
|
-
(
|
|
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,
|
|
26
|
-
|
|
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
|
-
),
|
|
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 = ((
|
|
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(
|
|
39
|
+
...i(u, e)
|
|
40
40
|
];
|
|
41
|
-
return { router: j({ history:
|
|
42
|
-
}, i = (e,
|
|
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 ?? (
|
|
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
|
|
49
|
-
Promise.all([w(e),
|
|
50
|
-
|
|
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) || {},
|
|
53
|
-
|
|
54
|
-
const { router: s } =
|
|
55
|
-
return
|
|
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
|
|
Binary file
|
package/packages/i18n/es5.js
CHANGED
|
@@ -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
|
|
11
|
+
var h = "language",
|
|
12
|
+
s = vue.reactive({}),
|
|
12
13
|
c = vue.reactive({}),
|
|
13
14
|
l = vue.reactive({}),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
m = vue.ref(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 &&
|
|
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
|
|
59
|
+
return function R(_x) {
|
|
59
60
|
return _ref.apply(this, arguments);
|
|
60
61
|
};
|
|
61
62
|
}(),
|
|
62
|
-
|
|
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
|
-
|
|
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 =
|
|
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 (
|
|
84
|
-
n && (n = n.replace("$".concat(
|
|
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
|
-
|
|
89
|
-
|
|
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
|
|
94
|
+
return z.apply(void 0, [t].concat(a)).value;
|
|
94
95
|
},
|
|
95
|
-
|
|
96
|
+
T = function T(t) {
|
|
96
97
|
m.value = t, g();
|
|
97
98
|
},
|
|
98
99
|
_ = function _() {
|
|
99
100
|
return m;
|
|
100
101
|
},
|
|
101
|
-
|
|
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
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
295
|
-
exports.getI18nRule =
|
|
295
|
+
exports.getDateFormat = x;
|
|
296
|
+
exports.getI18nRule = I;
|
|
296
297
|
exports.getLang = _;
|
|
297
|
-
exports.i18n =
|
|
298
|
-
exports.initI18n =
|
|
299
|
-
exports.
|
|
300
|
-
exports.
|
|
301
|
-
exports.
|
|
302
|
-
exports.
|
|
303
|
-
exports.
|
|
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;
|
package/packages/i18n/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { getUrlParams as
|
|
3
|
-
const s =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
19
|
+
}, R = async (t) => {
|
|
20
20
|
g();
|
|
21
21
|
const a = window[D];
|
|
22
|
-
a &&
|
|
23
|
-
},
|
|
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
|
-
},
|
|
28
|
-
const r =
|
|
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((
|
|
34
|
-
n && (n = n.replace(`$${
|
|
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
|
-
}),
|
|
36
|
+
}), z = I, N = (t, ...a) => z(t, ...a).value, T = (t) => {
|
|
37
37
|
m.value = t, g();
|
|
38
|
-
}, _ = () => m,
|
|
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
|
|
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
|
|
59
|
-
const a =
|
|
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
|
-
|
|
70
|
-
|
|
69
|
+
x as getDateFormat,
|
|
70
|
+
I as getI18nRule,
|
|
71
71
|
_ as getLang,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
package/types/i18n/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
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, };
|
package/types/index.d.ts
CHANGED
package/index-Cwnxjz4B.js.gz
DELETED
|
Binary file
|
package/index-D7Yosv5R.js.gz
DELETED
|
Binary file
|