@das-fed/upf-web 6.4.0-dev.231 → 6.4.0-dev.233
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 +593 -574
- package/{index-CppaPRNy.js → index-CNxj49VD.js} +1 -1
- package/{index-0g6_Ce0M.js → index-CUR2UuLR.js} +1 -1
- package/index-CUR2UuLR.js.gz +0 -0
- package/{index-IJWJDds3.js → index-DeaZJ_4F.js} +407 -406
- package/index-DeaZJ_4F.js.gz +0 -0
- package/index.js +1 -1
- package/package.json +5 -5
- package/packages/create-das-web-app/es5.js +49 -48
- package/packages/create-das-web-app/index.js +45 -44
- package/packages/create-das-web-app/index.js.gz +0 -0
- package/packages/i18n/es5.js +100 -82
- package/packages/i18n/index.js +62 -62
- package/packages/i18n/index.js.gz +0 -0
- package/types/i18n/getMicroI18nData.d.ts +1 -1
- package/types/i18n/index.d.ts +1 -1
- package/index-0g6_Ce0M.js.gz +0 -0
- package/index-IJWJDds3.js.gz +0 -0
|
Binary file
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as s, D as t, F as n, E as r, G as i, b as o, m as u, z as g, o as m, d as l, f as p, k as D, y as c, B as L, C as b, h, i as y, J as A, K as I, w as M, e as T, H as R, I as W, q as F, N as d, L as V, r as f, v as k, s as v, j as w, n as x, x as K, A as N, t as j } from "./index-
|
|
1
|
+
import { M as s, D as t, F as n, E as r, G as i, b as o, m as u, z as g, o as m, d as l, f as p, k as D, y as c, B as L, C as b, h, i as y, J as A, K as I, w as M, e as T, H as R, I as W, q as F, N as d, L as V, r as f, v as k, s as v, j as w, n as x, x as K, A as N, t as j } from "./index-DeaZJ_4F.js";
|
|
2
2
|
export {
|
|
3
3
|
s as DasMainAppLayout,
|
|
4
4
|
t as DasWebLayout,
|
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.233",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@das-fed/mframe": "0.0.41",
|
|
8
|
-
"@das-fed/upf-ui": "6.4.0-dev.
|
|
9
|
-
"@das-fed/upf-utils": "6.4.0-dev.
|
|
10
|
-
"@das-fed/upf-web-components": "6.4.0-dev.
|
|
8
|
+
"@das-fed/upf-ui": "6.4.0-dev.233",
|
|
9
|
+
"@das-fed/upf-utils": "6.4.0-dev.233",
|
|
10
|
+
"@das-fed/upf-web-components": "6.4.0-dev.233",
|
|
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.233",
|
|
23
23
|
"@types/crypto-js": "^4.2.2",
|
|
24
24
|
"@types/lodash": "^4.14.194",
|
|
25
25
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -25,51 +25,51 @@ var vue = require('vue');
|
|
|
25
25
|
var index = require('@das-fed/upf-web/packages/theme/index/es5');
|
|
26
26
|
var index$1 = require('@das-fed/upf-web/packages/layout/index/es5');
|
|
27
27
|
var pinia = require('pinia');
|
|
28
|
-
var
|
|
28
|
+
var M = require('pinia-plugin-persistedstate');
|
|
29
29
|
var vueRouter = require('vue-router');
|
|
30
30
|
var index$2 = require('@das-fed/upf-web/packages/i18n/index/es5');
|
|
31
|
-
var
|
|
31
|
+
var U = {
|
|
32
32
|
install: function install(e, u) {
|
|
33
33
|
var l;
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
return ((
|
|
38
|
-
}).filter(function (
|
|
39
|
-
return
|
|
40
|
-
}).forEach(function (
|
|
41
|
-
|
|
34
|
+
var s = (l = u == null ? undefined : u.plugins) == null ? undefined : l.glob;
|
|
35
|
+
s && Object.values(s).sort(function (a, c) {
|
|
36
|
+
var _a$index, _c$index;
|
|
37
|
+
return ((_a$index = a.index) !== null && _a$index !== void 0 ? _a$index : 0) - ((_c$index = c.index) !== null && _c$index !== void 0 ? _c$index : 0);
|
|
38
|
+
}).filter(function (a) {
|
|
39
|
+
return a ? !!(a["default"] && a["default"].install || a.install) : false;
|
|
40
|
+
}).forEach(function (a) {
|
|
41
|
+
a["default"] && a["default"].install && e.use(a["default"], u), a.install && e.use(a, u);
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
A = pinia.createPinia();
|
|
46
|
+
A.use(M);
|
|
47
47
|
var q = function q(e) {
|
|
48
48
|
var _ref;
|
|
49
|
-
var y, R, v, k,
|
|
49
|
+
var y, R, v, k, $;
|
|
50
50
|
var u = (_ref = (y = e == null ? undefined : e.router) == null ? undefined : y.routerBase) !== null && _ref !== void 0 ? _ref : "/",
|
|
51
|
-
|
|
51
|
+
s = ((R = e == null ? undefined : e.router) == null ? undefined : R.options) || {};
|
|
52
52
|
var l = Object.assign(((v = e == null ? undefined : e.router) == null ? undefined : v.glob) || {});
|
|
53
|
-
var
|
|
53
|
+
var a = Object.values(l).filter(function (n) {
|
|
54
54
|
return !!n;
|
|
55
|
-
}).flat().sort(function (n,
|
|
56
|
-
var _n$index,
|
|
57
|
-
return ((_n$index = n.index) !== null && _n$index !== void 0 ? _n$index : 0) - ((
|
|
55
|
+
}).flat().sort(function (n, t) {
|
|
56
|
+
var _n$index, _t$index;
|
|
57
|
+
return ((_n$index = n.index) !== null && _n$index !== void 0 ? _n$index : 0) - ((_t$index = t.index) !== null && _t$index !== void 0 ? _t$index : 0);
|
|
58
58
|
}),
|
|
59
59
|
c = [];
|
|
60
60
|
(k = e == null ? undefined : e.microApps) == null || k.map(function (n) {
|
|
61
61
|
var g;
|
|
62
|
-
var
|
|
62
|
+
var t = Object.values(((g = n.router) == null ? undefined : g.glob) || {}).filter(function (r) {
|
|
63
63
|
return !!r;
|
|
64
64
|
}).flat().sort(function (r, p) {
|
|
65
65
|
var _r$index, _p$index;
|
|
66
66
|
return ((_r$index = r.index) !== null && _r$index !== void 0 ? _r$index : 0) - ((_p$index = p.index) !== null && _p$index !== void 0 ? _p$index : 0);
|
|
67
67
|
});
|
|
68
|
-
c.push.apply(c, _toConsumableArray(
|
|
68
|
+
c.push.apply(c, _toConsumableArray(t.map(function (r) {
|
|
69
69
|
return _objectSpread(_objectSpread({}, r), {}, {
|
|
70
70
|
path: "/".concat(n.microAppName).concat(r.path)
|
|
71
71
|
});
|
|
72
|
-
}))), c.push.apply(c, _toConsumableArray(
|
|
72
|
+
}))), c.push.apply(c, _toConsumableArray(t.filter(function (r) {
|
|
73
73
|
return !!r.path;
|
|
74
74
|
}).filter(function (r) {
|
|
75
75
|
return r.path !== "";
|
|
@@ -87,12 +87,12 @@ var q = function q(e) {
|
|
|
87
87
|
};
|
|
88
88
|
})));
|
|
89
89
|
});
|
|
90
|
-
var
|
|
91
|
-
d = [].concat(_toConsumableArray(
|
|
90
|
+
var o = (($ = e == null ? undefined : e.router) == null ? undefined : $.routers) || [],
|
|
91
|
+
d = [].concat(_toConsumableArray(b(a, e)), _toConsumableArray(b(o, e)), _toConsumableArray(b(c, e))),
|
|
92
92
|
w = vueRouter.createRouter(_objectSpread({
|
|
93
93
|
history: vueRouter.createWebHistory(u),
|
|
94
94
|
routes: d
|
|
95
|
-
},
|
|
95
|
+
}, s)),
|
|
96
96
|
h = index$2.microI18nStore;
|
|
97
97
|
if (Array.isArray(e == null ? undefined : e.microApps) && e.microApps.length && h) {
|
|
98
98
|
var n = /* @__PURE__ */new Map();
|
|
@@ -100,8 +100,8 @@ var q = function q(e) {
|
|
|
100
100
|
_step;
|
|
101
101
|
try {
|
|
102
102
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
103
|
-
var
|
|
104
|
-
|
|
103
|
+
var t = _step.value;
|
|
104
|
+
t != null && t.microAppName && t != null && t.i18n && n.set(t.microAppName, t.i18n);
|
|
105
105
|
}
|
|
106
106
|
} catch (err) {
|
|
107
107
|
_iterator.e(err);
|
|
@@ -109,13 +109,13 @@ var q = function q(e) {
|
|
|
109
109
|
_iterator.f();
|
|
110
110
|
}
|
|
111
111
|
w.beforeEach(/*#__PURE__*/function () {
|
|
112
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(
|
|
113
|
-
var p, m,
|
|
112
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t, g, r) {
|
|
113
|
+
var p, m, L, _iterator2, _step2, _step2$value, i, f, N, x, _t, _t2, _t3;
|
|
114
114
|
return _regenerator().w(function (_context) {
|
|
115
115
|
while (1) switch (_context.p = _context.n) {
|
|
116
116
|
case 0:
|
|
117
117
|
_context.p = 0;
|
|
118
|
-
m = ((p =
|
|
118
|
+
m = ((p = t.query) == null ? void 0 : p.lang) || window.localStorage.getItem(index$2.languageKey) || window.navigator.language || "zh-CN", L = t.path || "";
|
|
119
119
|
_iterator2 = _createForOfIteratorHelper(n.entries());
|
|
120
120
|
_context.p = 1;
|
|
121
121
|
_iterator2.s();
|
|
@@ -124,31 +124,32 @@ var q = function q(e) {
|
|
|
124
124
|
_context.n = 10;
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
|
-
_step2$value = _slicedToArray(_step2.value, 2),
|
|
128
|
-
if (!(!
|
|
127
|
+
_step2$value = _slicedToArray(_step2.value, 2), i = _step2$value[0], f = _step2$value[1];
|
|
128
|
+
if (!(!i || !L.toLowerCase().startsWith("/".concat(i.toLowerCase())))) {
|
|
129
129
|
_context.n = 3;
|
|
130
130
|
break;
|
|
131
131
|
}
|
|
132
132
|
return _context.a(3, 9);
|
|
133
133
|
case 3:
|
|
134
|
-
if (!(h.isLoaded(m,
|
|
134
|
+
if (!(h.isLoaded(m, i) || !f || !(f != null && f.length))) {
|
|
135
135
|
_context.n = 4;
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
138
|
return _context.a(3, 10);
|
|
139
139
|
case 4:
|
|
140
|
-
|
|
141
|
-
h.markLoaded(m,
|
|
140
|
+
N = typeof f == "string" ? [f] : f;
|
|
141
|
+
h.markLoaded(m, i);
|
|
142
142
|
_context.p = 5;
|
|
143
|
+
x = "/web/".concat(i, "/");
|
|
143
144
|
_context.n = 6;
|
|
144
|
-
return index$2.registerMicroI18nData(
|
|
145
|
+
return index$2.registerMicroI18nData(N, m, x);
|
|
145
146
|
case 6:
|
|
146
147
|
_context.n = 8;
|
|
147
148
|
break;
|
|
148
149
|
case 7:
|
|
149
150
|
_context.p = 7;
|
|
150
151
|
_t = _context.v;
|
|
151
|
-
h.markUnloaded(m,
|
|
152
|
+
h.markUnloaded(m, i);
|
|
152
153
|
case 8:
|
|
153
154
|
return _context.a(3, 10);
|
|
154
155
|
case 9:
|
|
@@ -189,11 +190,11 @@ var q = function q(e) {
|
|
|
189
190
|
router: w
|
|
190
191
|
};
|
|
191
192
|
},
|
|
192
|
-
|
|
193
|
-
return e.map(function (
|
|
193
|
+
b = function b(e, u) {
|
|
194
|
+
return e.map(function (s) {
|
|
194
195
|
var _ref3, _l$keepAlive;
|
|
195
|
-
var l =
|
|
196
|
-
return l.keepAlive = (_ref3 = (_l$keepAlive = l.keepAlive) !== null && _l$keepAlive !== void 0 ? _l$keepAlive : u == null ? undefined : u.keepAlive) !== null && _ref3 !== void 0 ? _ref3 : true, _objectSpread(_objectSpread({},
|
|
196
|
+
var l = s.meta || {};
|
|
197
|
+
return l.keepAlive = (_ref3 = (_l$keepAlive = l.keepAlive) !== null && _l$keepAlive !== void 0 ? _l$keepAlive : u == null ? undefined : u.keepAlive) !== null && _ref3 !== void 0 ? _ref3 : true, _objectSpread(_objectSpread({}, s), {}, {
|
|
197
198
|
meta: l
|
|
198
199
|
});
|
|
199
200
|
});
|
|
@@ -206,18 +207,18 @@ var q = function q(e) {
|
|
|
206
207
|
u.value = false;
|
|
207
208
|
});
|
|
208
209
|
var _ref4 = (e == null ? undefined : e.root) || {},
|
|
209
|
-
|
|
210
|
+
s = _ref4.container,
|
|
210
211
|
l = _ref4.component,
|
|
211
|
-
|
|
212
|
-
c = vue.createApp(l || index$1.DasWebLayout,
|
|
213
|
-
c.use(
|
|
212
|
+
a = _ref4.props,
|
|
213
|
+
c = vue.createApp(l || index$1.DasWebLayout, a);
|
|
214
|
+
c.use(U, e), c.use(A);
|
|
214
215
|
var _q = q(e),
|
|
215
|
-
|
|
216
|
-
return c.use(
|
|
216
|
+
o = _q.router;
|
|
217
|
+
return c.use(o), c.mount(s || "#app"), (d = window.top) != null && d.vueRouter || window.top && (window.top.vueRouter = o), {
|
|
217
218
|
app: c,
|
|
218
|
-
router:
|
|
219
|
+
router: o,
|
|
219
220
|
loading: u,
|
|
220
|
-
store:
|
|
221
|
+
store: A
|
|
221
222
|
};
|
|
222
223
|
};
|
|
223
224
|
exports.createDasWebApp = Q;
|
|
@@ -1,60 +1,61 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { initTheme as
|
|
3
|
-
import { DasWebLayout as
|
|
4
|
-
import { createPinia as
|
|
5
|
-
import
|
|
6
|
-
import { createRouter as
|
|
7
|
-
import { languageKey as S, registerMicroI18nData as
|
|
8
|
-
const
|
|
1
|
+
import { ref as W, createApp as O } from "vue";
|
|
2
|
+
import { initTheme as P } from "@das-fed/upf-web/packages/theme/index";
|
|
3
|
+
import { DasWebLayout as j } from "@das-fed/upf-web/packages/layout/index";
|
|
4
|
+
import { createPinia as D } from "pinia";
|
|
5
|
+
import M from "pinia-plugin-persistedstate";
|
|
6
|
+
import { createRouter as B, createWebHistory as C } from "vue-router";
|
|
7
|
+
import { languageKey as S, registerMicroI18nData as E, microI18nStore as I } from "@das-fed/upf-web/packages/i18n/index";
|
|
8
|
+
const U = {
|
|
9
9
|
install: (e, u) => {
|
|
10
10
|
var l;
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const s = (l = u == null ? void 0 : u.plugins) == null ? void 0 : l.glob;
|
|
12
|
+
s && Object.values(s).sort((a, c) => (a.index ?? 0) - (c.index ?? 0)).filter((a) => a ? !!(a.default && a.default.install || a.install) : !1).forEach((a) => {
|
|
13
|
+
a.default && a.default.install && e.use(a.default, u), a.install && e.use(a, u);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
},
|
|
17
|
-
|
|
16
|
+
}, A = D();
|
|
17
|
+
A.use(M);
|
|
18
18
|
const q = (e) => {
|
|
19
|
-
var y, R, v, k,
|
|
20
|
-
const u = ((y = e == null ? void 0 : e.router) == null ? void 0 : y.routerBase) ?? "/",
|
|
19
|
+
var y, R, v, k, $;
|
|
20
|
+
const u = ((y = e == null ? void 0 : e.router) == null ? void 0 : y.routerBase) ?? "/", s = ((R = e == null ? void 0 : e.router) == null ? void 0 : R.options) || {};
|
|
21
21
|
let l = Object.assign(((v = e == null ? void 0 : e.router) == null ? void 0 : v.glob) || {});
|
|
22
|
-
const
|
|
22
|
+
const a = Object.values(l).filter((n) => !!n).flat().sort((n, t) => (n.index ?? 0) - (t.index ?? 0)), c = [];
|
|
23
23
|
(k = e == null ? void 0 : e.microApps) == null || k.map((n) => {
|
|
24
24
|
var g;
|
|
25
|
-
const
|
|
25
|
+
const t = Object.values(((g = n.router) == null ? void 0 : g.glob) || {}).filter((r) => !!r).flat().sort((r, p) => (r.index ?? 0) - (p.index ?? 0));
|
|
26
26
|
c.push(
|
|
27
|
-
...
|
|
27
|
+
...t.map((r) => ({ ...r, path: `/${n.microAppName}${r.path}` }))
|
|
28
28
|
), c.push(
|
|
29
|
-
...
|
|
29
|
+
...t.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: `/${n.microAppName}${r.path}`,
|
|
32
32
|
meta: { ...r.meta || {}, isMicroAppRouteRedirect: !0 }
|
|
33
33
|
}))
|
|
34
34
|
);
|
|
35
35
|
});
|
|
36
|
-
const
|
|
37
|
-
...
|
|
38
|
-
...
|
|
39
|
-
...
|
|
40
|
-
], w =
|
|
36
|
+
const o = (($ = e == null ? void 0 : e.router) == null ? void 0 : $.routers) || [], d = [
|
|
37
|
+
...b(a, e),
|
|
38
|
+
...b(o, e),
|
|
39
|
+
...b(c, e)
|
|
40
|
+
], w = B({ history: C(u), routes: d, ...s }), h = I;
|
|
41
41
|
if (Array.isArray(e == null ? void 0 : e.microApps) && e.microApps.length && h) {
|
|
42
42
|
const n = /* @__PURE__ */ new Map();
|
|
43
|
-
for (const
|
|
44
|
-
|
|
45
|
-
w.beforeEach(async (
|
|
43
|
+
for (const t of e.microApps)
|
|
44
|
+
t != null && t.microAppName && (t != null && t.i18n) && n.set(t.microAppName, t.i18n);
|
|
45
|
+
w.beforeEach(async (t, g, r) => {
|
|
46
46
|
var p;
|
|
47
47
|
try {
|
|
48
|
-
const m = ((p =
|
|
49
|
-
for (const [
|
|
50
|
-
if (!
|
|
51
|
-
if (h.isLoaded(m,
|
|
52
|
-
const
|
|
53
|
-
h.markLoaded(m,
|
|
48
|
+
const m = ((p = t.query) == null ? void 0 : p.lang) || window.localStorage.getItem(S) || window.navigator.language || "zh-CN", L = t.path || "";
|
|
49
|
+
for (const [i, f] of n.entries()) {
|
|
50
|
+
if (!i || !L.toLowerCase().startsWith(`/${i.toLowerCase()}`)) continue;
|
|
51
|
+
if (h.isLoaded(m, i) || !f || !(f != null && f.length)) break;
|
|
52
|
+
const N = typeof f == "string" ? [f] : f;
|
|
53
|
+
h.markLoaded(m, i);
|
|
54
54
|
try {
|
|
55
|
-
|
|
55
|
+
const x = `/web/${i}/`;
|
|
56
|
+
await E(N, m, x);
|
|
56
57
|
} catch {
|
|
57
|
-
h.markUnloaded(m,
|
|
58
|
+
h.markUnloaded(m, i);
|
|
58
59
|
}
|
|
59
60
|
break;
|
|
60
61
|
}
|
|
@@ -65,20 +66,20 @@ const q = (e) => {
|
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
return { router: w };
|
|
68
|
-
},
|
|
69
|
-
const l =
|
|
70
|
-
return l.keepAlive = l.keepAlive ?? (u == null ? void 0 : u.keepAlive) ?? !0, { ...
|
|
69
|
+
}, b = (e, u) => e.map((s) => {
|
|
70
|
+
const l = s.meta || {};
|
|
71
|
+
return l.keepAlive = l.keepAlive ?? (u == null ? void 0 : u.keepAlive) ?? !0, { ...s, meta: l };
|
|
71
72
|
}), Q = (e) => {
|
|
72
73
|
var d;
|
|
73
74
|
e || (e = {});
|
|
74
|
-
const u =
|
|
75
|
-
Promise.all([
|
|
75
|
+
const u = W(!0);
|
|
76
|
+
Promise.all([P(e)]).then(() => {
|
|
76
77
|
u.value = !1;
|
|
77
78
|
});
|
|
78
|
-
const { container:
|
|
79
|
-
c.use(
|
|
80
|
-
const { router:
|
|
81
|
-
return c.use(
|
|
79
|
+
const { container: s, component: l, props: a } = (e == null ? void 0 : e.root) || {}, c = O(l || j, a);
|
|
80
|
+
c.use(U, e), c.use(A);
|
|
81
|
+
const { router: o } = q(e);
|
|
82
|
+
return c.use(o), c.mount(s || "#app"), (d = window.top) != null && d.vueRouter || window.top && (window.top.vueRouter = o), { app: c, router: o, loading: u, store: A };
|
|
82
83
|
};
|
|
83
84
|
export {
|
|
84
85
|
Q as createDasWebApp
|
|
Binary file
|