@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.
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-IJWJDds3.js";
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.231",
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.231",
9
- "@das-fed/upf-utils": "6.4.0-dev.231",
10
- "@das-fed/upf-web-components": "6.4.0-dev.231",
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.231",
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 D = require('pinia-plugin-persistedstate');
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 I = {
31
+ var U = {
32
32
  install: function install(e, u) {
33
33
  var l;
34
- var f = (l = u == null ? undefined : u.plugins) == null ? undefined : l.glob;
35
- f && Object.values(f).sort(function (t, c) {
36
- var _t$index, _c$index;
37
- return ((_t$index = t.index) !== null && _t$index !== void 0 ? _t$index : 0) - ((_c$index = c.index) !== null && _c$index !== void 0 ? _c$index : 0);
38
- }).filter(function (t) {
39
- return t ? !!(t["default"] && t["default"].install || t.install) : false;
40
- }).forEach(function (t) {
41
- t["default"] && t["default"].install && e.use(t["default"], u), t.install && e.use(t, u);
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
- b = pinia.createPinia();
46
- b.use(D);
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, x;
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
- f = ((R = e == null ? undefined : e.router) == null ? undefined : R.options) || {};
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 t = Object.values(l).filter(function (n) {
53
+ var a = Object.values(l).filter(function (n) {
54
54
  return !!n;
55
- }).flat().sort(function (n, a) {
56
- var _n$index, _a$index;
57
- return ((_n$index = n.index) !== null && _n$index !== void 0 ? _n$index : 0) - ((_a$index = a.index) !== null && _a$index !== void 0 ? _a$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 a = Object.values(((g = n.router) == null ? undefined : g.glob) || {}).filter(function (r) {
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(a.map(function (r) {
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(a.filter(function (r) {
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 i = ((x = e == null ? undefined : e.router) == null ? undefined : x.routers) || [],
91
- d = [].concat(_toConsumableArray(A(t, e)), _toConsumableArray(A(i, e)), _toConsumableArray(A(c, e))),
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
- }, f)),
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 a = _step.value;
104
- a != null && a.microAppName && a != null && a.i18n && n.set(a.microAppName, a.i18n);
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(a, g, r) {
113
- var p, m, $, _iterator2, _step2, _step2$value, o, s, L, _t, _t2, _t3;
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 = a.query) == null ? void 0 : p.lang) || window.localStorage.getItem(index$2.languageKey) || window.navigator.language || "zh-CN", $ = a.path || "";
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), o = _step2$value[0], s = _step2$value[1];
128
- if (!(!o || !$.toLowerCase().startsWith("/".concat(o.toLowerCase())))) {
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, o) || !s || !(s != null && s.length))) {
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
- L = typeof s == "string" ? [s] : s;
141
- h.markLoaded(m, o);
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(L, m);
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, o);
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
- A = function A(e, u) {
193
- return e.map(function (f) {
193
+ b = function b(e, u) {
194
+ return e.map(function (s) {
194
195
  var _ref3, _l$keepAlive;
195
- var l = f.meta || {};
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({}, f), {}, {
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
- f = _ref4.container,
210
+ s = _ref4.container,
210
211
  l = _ref4.component,
211
- t = _ref4.props,
212
- c = vue.createApp(l || index$1.DasWebLayout, t);
213
- c.use(I, e), c.use(b);
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
- i = _q.router;
216
- return c.use(i), c.mount(f || "#app"), (d = window.top) != null && d.vueRouter || window.top && (window.top.vueRouter = i), {
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: i,
219
+ router: o,
219
220
  loading: u,
220
- store: b
221
+ store: A
221
222
  };
222
223
  };
223
224
  exports.createDasWebApp = Q;
@@ -1,60 +1,61 @@
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 D from "pinia-plugin-persistedstate";
6
- import { createRouter as M, createWebHistory as C } 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 = {
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 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);
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
- }, b = j();
17
- b.use(D);
16
+ }, A = D();
17
+ A.use(M);
18
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) || {};
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 t = Object.values(l).filter((n) => !!n).flat().sort((n, a) => (n.index ?? 0) - (a.index ?? 0)), c = [];
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 a = Object.values(((g = n.router) == null ? void 0 : g.glob) || {}).filter((r) => !!r).flat().sort((r, p) => (r.index ?? 0) - (p.index ?? 0));
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
- ...a.map((r) => ({ ...r, path: `/${n.microAppName}${r.path}` }))
27
+ ...t.map((r) => ({ ...r, path: `/${n.microAppName}${r.path}` }))
28
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) => ({
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 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 = M({ history: C(u), routes: d, ...f }), h = E;
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 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) => {
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 = a.query) == null ? void 0 : p.lang) || 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);
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
- await B(L, m);
55
+ const x = `/web/${i}/`;
56
+ await E(N, m, x);
56
57
  } catch {
57
- h.markUnloaded(m, o);
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
- }, 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 };
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 = N(!0);
75
- Promise.all([O(e)]).then(() => {
75
+ const u = W(!0);
76
+ Promise.all([P(e)]).then(() => {
76
77
  u.value = !1;
77
78
  });
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 };
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