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

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, e as o, o as u, z as g, r as m, f as l, j as p, n as D, y as L, B as c, C as b, k as h, i as y, J as A, K as T, w as M, h as R, H as W, I as F, v as I, N as V, L as d, s as f, m as k, q as v, x as w, A as x, t as K } from "./index-DBJqJe-a.js";
1
+ import { M as s, D as t, F as n, E as r, G as i, e as o, o as u, z as g, r as m, f as l, j as p, n as D, y as L, B as c, C as b, k as h, i as y, J as A, K as T, w as M, h as R, H as W, I as F, v as I, N as V, L as d, s as f, m as k, q as v, x as w, A as x, t as K } from "./index-BTfDckHk.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.203",
3
+ "version": "6.4.0-dev.204",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "dependencies": {
7
- "@das-fed/upf-ui": "6.4.0-dev.203",
8
- "@das-fed/upf-utils": "6.4.0-dev.203",
9
- "@das-fed/upf-web": "6.4.0-dev.203",
10
- "@das-fed/upf-web-components": "6.4.0-dev.203",
7
+ "@das-fed/upf-ui": "6.4.0-dev.204",
8
+ "@das-fed/upf-utils": "6.4.0-dev.204",
9
+ "@das-fed/upf-web": "6.4.0-dev.204",
10
+ "@das-fed/upf-web-components": "6.4.0-dev.204",
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.203",
22
+ "@das-fed/upf-cli": "6.4.0-dev.204",
23
23
  "@types/crypto-js": "^4.2.2",
24
24
  "@types/lodash": "^4.14.194",
25
25
  "@types/lodash-es": "^4.17.12",
@@ -25,89 +25,89 @@ 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 W = require('pinia-plugin-persistedstate');
28
+ var C = require('pinia-plugin-persistedstate');
29
29
  var vueRouter = require('vue-router');
30
30
  var commonTools = require('@das-fed/upf-utils/common-tools');
31
31
  var config = require('@das-fed/upf-utils/config');
32
- var H = {
33
- install: function install(e, n) {
34
- var a;
35
- var r = (a = n == null ? undefined : n.plugins) == null ? undefined : a.glob;
36
- r && Object.values(r).sort(function (t, s) {
37
- var _t$index, _s$index;
38
- return ((_t$index = t.index) !== null && _t$index !== void 0 ? _t$index : 0) - ((_s$index = s.index) !== null && _s$index !== void 0 ? _s$index : 0);
39
- }).filter(function (t) {
40
- return t ? !!(t["default"] && t["default"].install || t.install) : false;
41
- }).forEach(function (t) {
42
- t["default"] && t["default"].install && e.use(t["default"], n), t.install && e.use(t, n);
32
+ var q = {
33
+ install: function install(e, t) {
34
+ var s;
35
+ var r = (s = t == null ? undefined : t.plugins) == null ? undefined : s.glob;
36
+ r && Object.values(r).sort(function (a, o) {
37
+ var _a$index, _o$index;
38
+ return ((_a$index = a.index) !== null && _a$index !== void 0 ? _a$index : 0) - ((_o$index = o.index) !== null && _o$index !== void 0 ? _o$index : 0);
39
+ }).filter(function (a) {
40
+ return a ? !!(a["default"] && a["default"].install || a.install) : false;
41
+ }).forEach(function (a) {
42
+ a["default"] && a["default"].install && e.use(a["default"], t), a.install && e.use(a, t);
43
43
  });
44
44
  }
45
45
  },
46
- E = pinia.createPinia();
47
- E.use(W);
48
- var P = "language",
49
- A = vue.reactive({});
46
+ v = pinia.createPinia();
47
+ v.use(C);
48
+ var N = "language",
49
+ k = vue.reactive({});
50
50
  vue.reactive({});
51
51
  vue.reactive({});
52
- var K = commonTools.getUrlParams(location.href, "uiCulture") || "",
53
- F = K || window.localStorage.getItem(P) || window.navigator.language || "zh-CN",
54
- $ = vue.ref(F),
55
- G = function G() {
52
+ var F = commonTools.getUrlParams(location.href, "uiCulture") || "",
53
+ G = F || window.localStorage.getItem(N) || window.navigator.language || "zh-CN",
54
+ P = vue.ref(G),
55
+ T = function T() {
56
56
  var e = document.documentElement;
57
- e && e.setAttribute("lang", $.value);
57
+ e && e.setAttribute("lang", P.value);
58
58
  },
59
- R = function R() {
59
+ L = function L() {
60
60
  var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
61
- var n = arguments.length > 1 ? arguments[1] : undefined;
61
+ var t = arguments.length > 1 ? arguments[1] : undefined;
62
62
  var r = {};
63
- for (var a in e) for (var t in e[a]) {
64
- var _e$a$t;
65
- r[t] || (r[t] = {}), r[t][a] = (_e$a$t = e[a][t]) !== null && _e$a$t !== void 0 ? _e$a$t : "", A[t] || (A[t] = {}), A[t][a] = r[t][a];
63
+ for (var s in e) for (var a in e[s]) {
64
+ var _e$s$a;
65
+ r[a] || (r[a] = {}), r[a][s] = (_e$s$a = e[s][a]) !== null && _e$s$a !== void 0 ? _e$s$a : "", k[a] || (k[a] = {}), k[a][s] = r[a][s];
66
66
  }
67
67
  },
68
- T = function T(e) {
69
- $.value = e, G();
68
+ J = function J(e) {
69
+ P.value = e, T();
70
70
  },
71
- q = {
71
+ Q = {
72
72
  loaded: {},
73
- isLoaded: function isLoaded(e) {
74
- return !!this.loaded[e];
73
+ isLoaded: function isLoaded(e, t) {
74
+ return !!(this.loaded[e] && this.loaded[e][t]);
75
75
  },
76
- markLoaded: function markLoaded(e) {
77
- this.loaded[e] = true;
76
+ markLoaded: function markLoaded(e, t) {
77
+ this.loaded[e] || (this.loaded[e] = {}), this.loaded[e][t] = true;
78
78
  },
79
- markUnloaded: function markUnloaded(e) {
80
- delete this.loaded[e];
79
+ markUnloaded: function markUnloaded(e, t) {
80
+ this.loaded[e] && (delete this.loaded[e][t], Object.keys(this.loaded[e]).length === 0 && delete this.loaded[e]);
81
81
  }
82
82
  },
83
- J = /*#__PURE__*/function () {
84
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(e, n) {
83
+ V = /*#__PURE__*/function () {
84
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(e, t) {
85
85
  var _ref2, _ref3, _ref4;
86
- var d, g, l, r, a, t, s, i, f, _t;
86
+ var f, h, d, r, s, a, o, i, u, _t;
87
87
  return _regenerator().w(function (_context) {
88
88
  while (1) switch (_context.p = _context.n) {
89
89
  case 0:
90
- r = config.getConfig() || {}, a = (_ref2 = (d = r.i18n) == null ? undefined : d.fromOss) !== null && _ref2 !== void 0 ? _ref2 : true, t = (_ref3 = (g = r.i18n) == null ? undefined : g.isPullBack) !== null && _ref3 !== void 0 ? _ref3 : false, s = (_ref4 = (l = r.i18n) == null ? undefined : l.isDasUI) !== null && _ref4 !== void 0 ? _ref4 : true;
90
+ r = config.getConfig() || {}, s = (_ref2 = (f = r.i18n) == null ? undefined : f.fromOss) !== null && _ref2 !== void 0 ? _ref2 : true, a = (_ref3 = (h = r.i18n) == null ? undefined : h.isPullBack) !== null && _ref3 !== void 0 ? _ref3 : false, o = (_ref4 = (d = r.i18n) == null ? undefined : d.isDasUI) !== null && _ref4 !== void 0 ? _ref4 : true;
91
91
  i = "/oss/resource/";
92
92
  _context.p = 1;
93
93
  _context.n = 2;
94
94
  return commonTools.handleI18nData({
95
- baseUrl: a ? i : "/",
96
- currentLang: n,
95
+ baseUrl: s ? i : "/",
96
+ currentLang: t,
97
97
  appName: e,
98
- isPullBack: t,
98
+ isPullBack: a,
99
99
  fallbackBaseUrl: "/",
100
- isDasUI: s
100
+ isDasUI: o
101
101
  });
102
102
  case 2:
103
- f = _context.v;
104
- if (!(!f || !(f != null && f.frontEnd))) {
103
+ u = _context.v;
104
+ if (!(!u || !(u != null && u.frontEnd))) {
105
105
  _context.n = 3;
106
106
  break;
107
107
  }
108
108
  throw new Error("Failed to fetch i18n data");
109
109
  case 3:
110
- return _context.a(2, f);
110
+ return _context.a(2, u);
111
111
  case 4:
112
112
  _context.p = 4;
113
113
  _t = _context.v;
@@ -117,14 +117,14 @@ var K = commonTools.getUrlParams(location.href, "uiCulture") || "",
117
117
  }
118
118
  }, _callee, null, [[1, 4]]);
119
119
  }));
120
- return function J(_x, _x2) {
120
+ return function V(_x, _x2) {
121
121
  return _ref.apply(this, arguments);
122
122
  };
123
123
  }(),
124
- Q = /*#__PURE__*/function () {
124
+ X = /*#__PURE__*/function () {
125
125
  var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
126
126
  var e,
127
- n,
127
+ t,
128
128
  r,
129
129
  _args2 = arguments,
130
130
  _t2;
@@ -132,15 +132,15 @@ var K = commonTools.getUrlParams(location.href, "uiCulture") || "",
132
132
  while (1) switch (_context2.p = _context2.n) {
133
133
  case 0:
134
134
  e = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : [];
135
- n = commonTools.getUrlParams(location.href, "uiCulture") || window.localStorage.getItem(P) || window.navigator.language || "zh-CN";
135
+ t = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : "zh-CN";
136
136
  _context2.p = 1;
137
137
  _context2.n = 2;
138
- return J(e, n);
138
+ return V(e, t);
139
139
  case 2:
140
140
  r = _context2.v;
141
- r != null && r.frontEnd && _typeof(r.frontEnd) == "object" && Object.keys(r.frontEnd).length && e.forEach(function (a) {
142
- r.frontEnd[a] && _typeof(r.frontEnd[a]) == "object" && Object.keys(r.frontEnd[a]).length && R(_defineProperty({}, n, r.frontEnd[a]));
143
- }), r != null && r.dasUiEnd && _typeof(r.dasUiEnd) == "object" && Object.keys(r.dasUiEnd).length && R(_defineProperty({}, n, r.dasUiEnd)), T(n);
141
+ r != null && r.frontEnd && _typeof(r.frontEnd) == "object" && Object.keys(r.frontEnd).length && e.forEach(function (s) {
142
+ r.frontEnd[s] && _typeof(r.frontEnd[s]) == "object" && Object.keys(r.frontEnd[s]).length && L(_defineProperty({}, t, r.frontEnd[s]));
143
+ }), r != null && r.dasUiEnd && _typeof(r.dasUiEnd) == "object" && Object.keys(r.dasUiEnd).length && L(_defineProperty({}, t, r.dasUiEnd)), J(t);
144
144
  _context2.n = 4;
145
145
  break;
146
146
  case 3:
@@ -151,36 +151,36 @@ var K = commonTools.getUrlParams(location.href, "uiCulture") || "",
151
151
  }
152
152
  }, _callee2, null, [[1, 3]]);
153
153
  }));
154
- return function Q() {
154
+ return function X() {
155
155
  return _ref5.apply(this, arguments);
156
156
  };
157
157
  }(),
158
- V = function V(e) {
158
+ Y = function Y(e) {
159
159
  var _ref6;
160
- var h, p, f, U, v;
161
- var n = (_ref6 = (h = e == null ? undefined : e.router) == null ? undefined : h.routerBase) !== null && _ref6 !== void 0 ? _ref6 : "/",
160
+ var g, p, u, R, j;
161
+ var t = (_ref6 = (g = e == null ? undefined : e.router) == null ? undefined : g.routerBase) !== null && _ref6 !== void 0 ? _ref6 : "/",
162
162
  r = ((p = e == null ? undefined : e.router) == null ? undefined : p.options) || {};
163
- var a = Object.assign(((f = e == null ? undefined : e.router) == null ? undefined : f.glob) || {});
164
- var t = Object.values(a).filter(function (u) {
165
- return !!u;
166
- }).flat().sort(function (u, o) {
167
- var _u$index, _o$index;
168
- return ((_u$index = u.index) !== null && _u$index !== void 0 ? _u$index : 0) - ((_o$index = o.index) !== null && _o$index !== void 0 ? _o$index : 0);
163
+ var s = Object.assign(((u = e == null ? undefined : e.router) == null ? undefined : u.glob) || {});
164
+ var a = Object.values(s).filter(function (l) {
165
+ return !!l;
166
+ }).flat().sort(function (l, n) {
167
+ var _l$index, _n$index;
168
+ return ((_l$index = l.index) !== null && _l$index !== void 0 ? _l$index : 0) - ((_n$index = n.index) !== null && _n$index !== void 0 ? _n$index : 0);
169
169
  }),
170
- s = [];
171
- (U = e == null ? undefined : e.microApps) == null || U.map(function (u) {
172
- var w;
173
- var o = Object.values(((w = u.router) == null ? undefined : w.glob) || {}).filter(function (c) {
170
+ o = [];
171
+ (R = e == null ? undefined : e.microApps) == null || R.map(function (l) {
172
+ var A;
173
+ var n = Object.values(((A = l.router) == null ? undefined : A.glob) || {}).filter(function (c) {
174
174
  return !!c;
175
- }).flat().sort(function (c, y) {
176
- var _c$index, _y$index;
177
- return ((_c$index = c.index) !== null && _c$index !== void 0 ? _c$index : 0) - ((_y$index = y.index) !== null && _y$index !== void 0 ? _y$index : 0);
175
+ }).flat().sort(function (c, w) {
176
+ var _c$index, _w$index;
177
+ return ((_c$index = c.index) !== null && _c$index !== void 0 ? _c$index : 0) - ((_w$index = w.index) !== null && _w$index !== void 0 ? _w$index : 0);
178
178
  });
179
- s.push.apply(s, _toConsumableArray(o.map(function (c) {
179
+ o.push.apply(o, _toConsumableArray(n.map(function (c) {
180
180
  return _objectSpread(_objectSpread({}, c), {}, {
181
- path: "/".concat(u.microAppName).concat(c.path)
181
+ path: "/".concat(l.microAppName).concat(c.path)
182
182
  });
183
- }))), s.push.apply(s, _toConsumableArray(o.filter(function (c) {
183
+ }))), o.push.apply(o, _toConsumableArray(n.filter(function (c) {
184
184
  return !!c.path;
185
185
  }).filter(function (c) {
186
186
  return c.path !== "";
@@ -191,43 +191,43 @@ var K = commonTools.getUrlParams(location.href, "uiCulture") || "",
191
191
  }).map(function (c) {
192
192
  return {
193
193
  path: c.path,
194
- redirect: "/".concat(u.microAppName).concat(c.path),
194
+ redirect: "/".concat(l.microAppName).concat(c.path),
195
195
  meta: _objectSpread(_objectSpread({}, c.meta || {}), {}, {
196
196
  isMicroAppRouteRedirect: true
197
197
  })
198
198
  };
199
199
  })));
200
200
  });
201
- var i = ((v = e == null ? undefined : e.router) == null ? undefined : v.routers) || [],
202
- d = [].concat(_toConsumableArray(k(t, e)), _toConsumableArray(k(i, e)), _toConsumableArray(k(s, e))),
203
- g = vueRouter.createRouter(_objectSpread({
204
- history: vueRouter.createWebHistory(n),
205
- routes: d
201
+ var i = ((j = e == null ? undefined : e.router) == null ? undefined : j.routers) || [],
202
+ f = [].concat(_toConsumableArray(E(a, e)), _toConsumableArray(E(i, e)), _toConsumableArray(E(o, e))),
203
+ h = vueRouter.createRouter(_objectSpread({
204
+ history: vueRouter.createWebHistory(t),
205
+ routes: f
206
206
  }, r)),
207
- l = q;
208
- if (Array.isArray(e == null ? undefined : e.microApps) && e.microApps.length && l) {
209
- var u = /* @__PURE__ */new Map();
207
+ d = Q;
208
+ if (Array.isArray(e == null ? undefined : e.microApps) && e.microApps.length && d) {
209
+ var l = /* @__PURE__ */new Map();
210
210
  var _iterator = _createForOfIteratorHelper(e.microApps),
211
211
  _step;
212
212
  try {
213
213
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
214
- var o = _step.value;
215
- o != null && o.microAppName && o != null && o.i18n && u.set(o.microAppName, o.i18n);
214
+ var n = _step.value;
215
+ n != null && n.microAppName && n != null && n.i18n && l.set(n.microAppName, n.i18n);
216
216
  }
217
217
  } catch (err) {
218
218
  _iterator.e(err);
219
219
  } finally {
220
220
  _iterator.f();
221
221
  }
222
- g.beforeEach(/*#__PURE__*/function () {
223
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(o, w, c) {
224
- var y, _iterator2, _step2, _step2$value, b, m, x, _t3, _t4, _t5;
222
+ h.beforeEach(/*#__PURE__*/function () {
223
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(n, A, c) {
224
+ var w, b, $, _iterator2, _step2, _step2$value, y, m, x, _t3, _t4, _t5;
225
225
  return _regenerator().w(function (_context3) {
226
226
  while (1) switch (_context3.p = _context3.n) {
227
227
  case 0:
228
228
  _context3.p = 0;
229
- y = o.path || "";
230
- _iterator2 = _createForOfIteratorHelper(u.entries());
229
+ b = ((w = n.query) == null ? void 0 : w.uiCulture) || window.localStorage.getItem(N) || window.navigator.language || "zh-CN", $ = n.path || "";
230
+ _iterator2 = _createForOfIteratorHelper(l.entries());
231
231
  _context3.p = 1;
232
232
  _iterator2.s();
233
233
  case 2:
@@ -235,31 +235,31 @@ var K = commonTools.getUrlParams(location.href, "uiCulture") || "",
235
235
  _context3.n = 10;
236
236
  break;
237
237
  }
238
- _step2$value = _slicedToArray(_step2.value, 2), b = _step2$value[0], m = _step2$value[1];
239
- if (!(!b || !y.toLowerCase().startsWith("/".concat(b.toLowerCase())))) {
238
+ _step2$value = _slicedToArray(_step2.value, 2), y = _step2$value[0], m = _step2$value[1];
239
+ if (!(!y || !$.toLowerCase().startsWith("/".concat(y.toLowerCase())))) {
240
240
  _context3.n = 3;
241
241
  break;
242
242
  }
243
243
  return _context3.a(3, 9);
244
244
  case 3:
245
- if (!(typeof l.isLoaded == "function" && l.isLoaded(b) || !m || !(m != null && m.length))) {
245
+ if (!(d.isLoaded(b, y) || !m || !(m != null && m.length))) {
246
246
  _context3.n = 4;
247
247
  break;
248
248
  }
249
249
  return _context3.a(3, 10);
250
250
  case 4:
251
251
  x = typeof m == "string" ? [m] : m;
252
- typeof l.markLoaded == "function" && l.markLoaded(b);
252
+ d.markLoaded(b, y);
253
253
  _context3.p = 5;
254
254
  _context3.n = 6;
255
- return Q(x);
255
+ return X(x, b);
256
256
  case 6:
257
257
  _context3.n = 8;
258
258
  break;
259
259
  case 7:
260
260
  _context3.p = 7;
261
261
  _t3 = _context3.v;
262
- typeof l.markUnloaded == "function" && l.markUnloaded(b);
262
+ d.markUnloaded(b, y);
263
263
  case 8:
264
264
  return _context3.a(3, 10);
265
265
  case 9:
@@ -297,38 +297,38 @@ var K = commonTools.getUrlParams(location.href, "uiCulture") || "",
297
297
  }());
298
298
  }
299
299
  return {
300
- router: g
300
+ router: h
301
301
  };
302
302
  },
303
- k = function k(e, n) {
303
+ E = function E(e, t) {
304
304
  return e.map(function (r) {
305
- var _ref8, _a$keepAlive;
306
- var a = r.meta || {};
307
- return a.keepAlive = (_ref8 = (_a$keepAlive = a.keepAlive) !== null && _a$keepAlive !== void 0 ? _a$keepAlive : n == null ? undefined : n.keepAlive) !== null && _ref8 !== void 0 ? _ref8 : true, _objectSpread(_objectSpread({}, r), {}, {
308
- meta: a
305
+ var _ref8, _s$keepAlive;
306
+ var s = r.meta || {};
307
+ return s.keepAlive = (_ref8 = (_s$keepAlive = s.keepAlive) !== null && _s$keepAlive !== void 0 ? _s$keepAlive : t == null ? undefined : t.keepAlive) !== null && _ref8 !== void 0 ? _ref8 : true, _objectSpread(_objectSpread({}, r), {}, {
308
+ meta: s
309
309
  });
310
310
  });
311
311
  },
312
- ce = function ce(e) {
313
- var d;
312
+ oe = function oe(e) {
313
+ var f;
314
314
  e || (e = {});
315
- var n = vue.ref(true);
315
+ var t = vue.ref(true);
316
316
  Promise.all([index.initTheme(e)]).then(function () {
317
- n.value = false;
317
+ t.value = false;
318
318
  });
319
319
  var _ref9 = (e == null ? undefined : e.root) || {},
320
320
  r = _ref9.container,
321
- a = _ref9.component,
322
- t = _ref9.props,
323
- s = vue.createApp(a || index$1.DasWebLayout, t);
324
- s.use(H, e), s.use(E);
325
- var _V = V(e),
326
- i = _V.router;
327
- return s.use(i), s.mount(r || "#app"), (d = window.top) != null && d.vueRouter || window.top && (window.top.vueRouter = i), {
328
- app: s,
321
+ s = _ref9.component,
322
+ a = _ref9.props,
323
+ o = vue.createApp(s || index$1.DasWebLayout, a);
324
+ o.use(q, e), o.use(v);
325
+ var _Y = Y(e),
326
+ i = _Y.router;
327
+ return o.use(i), o.mount(r || "#app"), (f = window.top) != null && f.vueRouter || window.top && (window.top.vueRouter = i), {
328
+ app: o,
329
329
  router: i,
330
- loading: n,
331
- store: E
330
+ loading: t,
331
+ store: v
332
332
  };
333
333
  };
334
- exports.createDasWebApp = ce;
334
+ exports.createDasWebApp = oe;