@das-fed/web 7.1.0-dev.29 → 7.1.0-dev.30

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.
Files changed (65) hide show
  1. package/index.js +7 -32
  2. package/package.json +6 -6
  3. package/packages/create-das-web-app/index.js +1 -71
  4. package/packages/create-das-web-app/runtime.js +58 -0
  5. package/packages/create-das-web-app/runtime.js.gz +0 -0
  6. package/packages/i18n/index.js +1 -175
  7. package/packages/i18n/runtime.js +175 -0
  8. package/packages/layout/index.js +2 -785
  9. package/packages/layout/runtime.js +784 -0
  10. package/packages/layout/runtime.js.gz +0 -0
  11. package/packages/main-app-framework/assets/black-logo-B-Qipuvf.png +0 -0
  12. package/packages/main-app-framework/assets/cjb-CTZzysmN.png +0 -0
  13. package/packages/main-app-framework/assets/cjb-preview-Cz6ZEp0h.png +0 -0
  14. package/packages/main-app-framework/assets/cjb-preview-DWYaDhQb.png +0 -0
  15. package/packages/main-app-framework/assets/default-DOjV2jIm.png +0 -0
  16. package/packages/main-app-framework/assets/default-preview-DEfMZxi2.png +0 -0
  17. package/packages/main-app-framework/assets/default-preview-HZjPO_Oz.png +0 -0
  18. package/packages/main-app-framework/assets/dkh-DkyUTuR0.png +0 -0
  19. package/packages/main-app-framework/assets/dkh-preview-DQZDuJfb.png +0 -0
  20. package/packages/main-app-framework/assets/dkh-preview-SJ0YoU2z.png +0 -0
  21. package/packages/main-app-framework/assets/feedback-QNGIKgWm.png +0 -0
  22. package/packages/main-app-framework/assets/hengxian-CyCsW-Hu.png +0 -0
  23. package/packages/main-app-framework/assets/kjl-DozNzlyC.png +0 -0
  24. package/packages/main-app-framework/assets/kjl-preview-CCoSuYDK.png +0 -0
  25. package/packages/main-app-framework/assets/kjl-preview-xHIEscys.png +0 -0
  26. package/packages/main-app-framework/assets/noIconurl-7L4lHbul.png +0 -0
  27. package/packages/main-app-framework/assets/qianru-Bsf1Lhh2.png +0 -0
  28. package/packages/main-app-framework/assets/setected-tvECHVG9.svg +31 -0
  29. package/packages/main-app-framework/assets/ssl-XnQ4A9bQ.png +0 -0
  30. package/packages/main-app-framework/assets/ssl-preview-C4BD2d61.png +0 -0
  31. package/packages/main-app-framework/assets/ssl-preview-DI5pA3Df.png +0 -0
  32. package/packages/main-app-framework/assets/unselected-C4QVkFPL.svg +39 -0
  33. package/packages/main-app-framework/assets/white-logo-D7bqAkJL.png +0 -0
  34. package/packages/main-app-framework/{index-BY9ptpcV.js → index-D8jnUW9X.js} +1 -1
  35. package/packages/main-app-framework/index-D8jnUW9X.js.gz +0 -0
  36. package/packages/main-app-framework/index-Ej8LG4Wi.js +16723 -0
  37. package/packages/main-app-framework/index-Ej8LG4Wi.js.gz +0 -0
  38. package/{index-6Zinqnbf.js → packages/main-app-framework/index-cz4bW5fK.js} +1 -1
  39. package/packages/main-app-framework/index.js +2 -7
  40. package/packages/main-app-framework/runtime.js +6 -0
  41. package/packages/micro-frontend/index.js +2 -848
  42. package/packages/micro-frontend/runtime.js +847 -0
  43. package/packages/micro-frontend/runtime.js.gz +0 -0
  44. package/packages/style/index.js +3 -5
  45. package/packages/style/runtime.js +4 -0
  46. package/packages/theme/index.js +2 -75
  47. package/packages/theme/runtime.js +75 -0
  48. package/types/main-app-framework/i18n/index.d.ts +5 -0
  49. package/types/main-app-framework/init-platform/api.d.ts +1 -0
  50. package/index-DbzDyNY2.js +0 -20039
  51. package/index-DbzDyNY2.js.gz +0 -0
  52. package/index-cQ6KKlgp.js +0 -88
  53. package/index-cQ6KKlgp.js.gz +0 -0
  54. package/packages/create-das-web-app/index.js.gz +0 -0
  55. package/packages/layout/index.js.gz +0 -0
  56. package/packages/main-app-framework/index-6adu5oAS.js +0 -10
  57. package/packages/main-app-framework/index-BY9ptpcV.js.gz +0 -0
  58. package/packages/main-app-framework/index-FNlmEX37.js +0 -18535
  59. package/packages/main-app-framework/index-FNlmEX37.js.gz +0 -0
  60. package/packages/micro-frontend/index.js.gz +0 -0
  61. package/style.css +0 -7
  62. package/style.css.gz +0 -0
  63. package/types/create-das-web-app/get-web-config.d.ts +0 -1
  64. /package/packages/i18n/{index.js.gz → runtime.js.gz} +0 -0
  65. /package/packages/theme/{index.js.gz → runtime.js.gz} +0 -0
@@ -1,848 +1,2 @@
1
- import '@das-fed/web/packages/micro-frontend/style.css';
2
- import { ref as w, watch as M, reactive as P, getCurrentScope as ue, onScopeDispose as de, getCurrentInstance as pe, onMounted as me, nextTick as ne, unref as I, defineComponent as x, computed as N, createElementBlock as D, openBlock as E, Fragment as $, renderList as fe, withDirectives as ve, createCommentVNode as he, createBlock as se, vShow as Ae, mergeProps as we, withCtx as T, createVNode as C, renderSlot as V, onActivated as ge } from "vue";
3
- import { DasWebLayout as ye, DasWebTabs as Me, DasWebMenu as Le, DasWebNav as _e } from "@das-fed/web/packages/layout/index";
4
- const z = w("/das-micro-app"), f = w([]), k = w(!1), O = w([]), F = w(!0);
5
- let v = null, h = null, _ = null;
6
- const be = (e) => new Promise((t) => {
7
- const n = () => {
8
- if (v != null && v[e]) return t();
9
- setTimeout(() => n(), 50);
10
- };
11
- n();
12
- }), b = (e, t, n, s) => {
13
- var i;
14
- const { awaitListener: c = !1 } = s || {}, { origin: a } = new URL(location.href);
15
- c ? be(t).then(() => {
16
- var r;
17
- (r = window.self) == null || r.postMessage({ type: t, data: n }, a);
18
- }) : (i = window.self) == null || i.postMessage({ type: t, data: n }, a);
19
- }, Ie = (e) => new Promise((t) => {
20
- const n = () => {
21
- if (h != null && h[e]) return t();
22
- setTimeout(() => n(), 50);
23
- };
24
- n();
25
- }), q = (e, t, n) => {
26
- var a;
27
- const { awaitListener: s = !1 } = n || {}, { origin: c } = new URL(location.href);
28
- s ? Ie(e).then(() => {
29
- var i;
30
- (i = window.self) == null || i.postMessage({ type: e, data: t }, c);
31
- }) : (a = window.self) == null || a.postMessage({ type: e, data: t }, c);
32
- }, Ee = () => {
33
- h || (h || (h = {}), window.addEventListener(
34
- "message",
35
- (e) => {
36
- const { type: t, source: n } = e.data || {};
37
- if (n !== "react-devtools-content-script" && h[t])
38
- for (const s in h[t])
39
- h[t][s](e.data);
40
- },
41
- !1
42
- ));
43
- }, Se = () => {
44
- v || (v || (v = {}), window.addEventListener(
45
- "message",
46
- (e) => {
47
- const { type: t } = e.data || {};
48
- if (v[t])
49
- for (const n in v[t])
50
- v[t][n](e.data);
51
- },
52
- !1
53
- ));
54
- }, Pe = (e, t) => {
55
- Se();
56
- const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8);
57
- return v[e] || (v[e] = {}), v[e][n] = t, {
58
- remove: () => {
59
- v[e] && v[e][n] && delete v[e][n];
60
- }
61
- };
62
- }, Te = (e, t) => {
63
- Ee();
64
- const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8);
65
- return h[e] || (h[e] = {}), h[e][n] = t, {
66
- remove: () => {
67
- h[e] && h[e][n] && delete h[e][n];
68
- }
69
- };
70
- }, Q = async (e) => {
71
- await Promise.all(
72
- f.value.filter((t) => t.loaded).map((t) => new Promise(async (n) => {
73
- t.dom || await new Promise((s) => M(() => t.dom, s)), setTimeout(() => {
74
- b(t.name, "sessionStorage", e), n(!0);
75
- }, 0);
76
- }))
77
- );
78
- }, d = {
79
- loadMicroApp: (e) => {
80
- k.value = !0;
81
- const t = f.value.find((i) => i.name === e), n = f.value.find((i) => i.actived), s = !!t, c = !(t != null && t.loaded), a = t == null ? void 0 : t.actived;
82
- if (!s) {
83
- n && (n.actived = !1);
84
- return;
85
- }
86
- if (t.isFirstActived = !0, c) {
87
- t.src = t.entry;
88
- const i = f.value.find((r) => r.actived);
89
- i && (i.actived = !1), t.loaded = !0, t.actived = !0;
90
- return;
91
- }
92
- if (!a) {
93
- n && (n.actived = !1), t.actived = !0;
94
- return;
95
- }
96
- },
97
- hideMicroApp: async (e) => {
98
- const t = f.value.find((n) => n.name === e);
99
- t && t.loaded && (t.dom || await new Promise((n) => M(() => t.dom, n)), b(e, "router", {
100
- cmd: "push",
101
- route: {
102
- name: "das-micro-app-ghost",
103
- microAppName: e
104
- }
105
- }));
106
- },
107
- hideAllMicroApp: () => {
108
- k.value = !1, f.value.map((e) => {
109
- e.actived = !1;
110
- });
111
- },
112
- unloadMicroApp: (e) => {
113
- const t = f.value.find((n) => n.name === e);
114
- t && (t.loaded = !1, t.actived = !1, t.dom = void 0);
115
- },
116
- unloadAllMicroApp: () => {
117
- k.value = !1, f.value.map((e) => {
118
- e.loaded = !1, e.actived = !1, e.dom = void 0;
119
- });
120
- },
121
- setMicroAppRoute: async (e, t, n) => {
122
- const s = f.value.find((r) => r.name === t);
123
- if (!s || !s.loaded || !s.actived || (s.dom || await new Promise((r) => M(() => s.dom, r)), !s.actived)) return s;
124
- const c = n.path || n, a = n.query || {}, i = n.params || {};
125
- return e.push({
126
- path: `/${t}${c}`,
127
- query: a,
128
- // @ts-ignore
129
- params: i
130
- }), setTimeout(() => {
131
- const { isFirstActived: r } = s;
132
- b(t, "router", {
133
- cmd: r ? "replace" : "push",
134
- route: n,
135
- microAppName: t
136
- }), r && (s.isFirstActived = !1);
137
- }, 0), s;
138
- },
139
- sendMessageToMicroApp: b,
140
- sendMessageToMainApp: q,
141
- addEventListenerFromMainApp: Pe,
142
- addEventListenerFromMicroApp: Te,
143
- setMainAppOverlay: (e, t) => {
144
- q("bodyOverlay", { visible: e, style: t });
145
- },
146
- sessionStorage: {
147
- key: window.sessionStorage.key,
148
- getItem: window.sessionStorage.getItem,
149
- setItem: (e, t) => {
150
- window.sessionStorage.setItem(e, t), Q({ cmd: "setItem", key: e, value: t });
151
- },
152
- removeItem: (e) => {
153
- window.sessionStorage.removeItem(e), Q({ cmd: "removeItem", key: e });
154
- },
155
- clear: () => {
156
- window.sessionStorage.clear(), Q({ cmd: "clear" });
157
- }
158
- },
159
- addMicroAppLifeCycleListener: (e, t) => {
160
- const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8);
161
- _ || (_ = {});
162
- const s = () => {
163
- _[n] && delete _[n];
164
- };
165
- return _[n] = {
166
- type: e,
167
- handler: async (c) => await t(c),
168
- remove: s
169
- }, { remove: s };
170
- },
171
- triggerMicroAppLifeCycleListener: (e, t, n) => {
172
- var a;
173
- const s = _, { autoRemove: c = !1 } = n || {};
174
- for (const i in s) {
175
- const r = s[i];
176
- r.type === e && ((a = r == null ? void 0 : r.handler) == null || a.call(r, t).then(() => {
177
- c && r.remove();
178
- }));
179
- }
180
- },
181
- reloadMicroAppRoute: async (e, t) => {
182
- const n = f.value.find((s) => s.name === e);
183
- n && (!n.loaded || !n.actived || (n.dom || await new Promise((s) => M(() => n.dom, s)), b(e, "route", { cmd: "reload", path: t })));
184
- },
185
- unloadMicroAppRoute: async (e, t) => {
186
- const n = f.value.find((s) => s.name === e);
187
- n && (!n.loaded || !n.actived || (n.dom || await new Promise((s) => M(() => n.dom, s)), b(e, "route", { cmd: "unload", path: t })));
188
- },
189
- setMainAppLayoutVisible: (e) => {
190
- q("layoutVisible", { visible: e });
191
- }
192
- }, u = P({
193
- visible: !1,
194
- theme: "default",
195
- logo: "",
196
- items: [],
197
- projects: [],
198
- userInfo: {},
199
- config: {},
200
- searchConfig: {},
201
- // activeItem: '',
202
- // activeProject: {},
203
- eventListeners: {}
204
- }), W = {
205
- show: () => {
206
- u.visible = !0;
207
- },
208
- hide: () => {
209
- u.visible = !1;
210
- },
211
- setLogo: (e) => {
212
- u.logo = e;
213
- },
214
- setTheme: (e) => {
215
- u.theme = e;
216
- },
217
- setItems: (e) => {
218
- u.visible || (u.visible = !0), u.items = e;
219
- },
220
- getItems: () => u.items,
221
- removeItem: (e) => {
222
- const t = u.items.filter((n) => n.value !== e);
223
- u.items = t;
224
- },
225
- appendItem: (e) => {
226
- u.visible || (u.visible = !0), !u.items.find((n) => n.value == e.value) && u.items.push(e);
227
- },
228
- setActiveItem: (e) => {
229
- u.activeItem = e;
230
- },
231
- setConfig: (e) => {
232
- u.config = e;
233
- },
234
- setProjects: (e) => {
235
- u.projects = e;
236
- },
237
- setProjectConfig: (e) => {
238
- u.projectConfig = e;
239
- },
240
- setActiveProject: (e) => {
241
- u.activeProject = e;
242
- },
243
- setUserInfo: (e) => {
244
- u.userInfo = e;
245
- },
246
- setSearchConfig: (e) => {
247
- u.searchConfig = e;
248
- },
249
- triggerEventListener: (e, t, n) => {
250
- var i;
251
- const s = u.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
252
- for (const r in s) {
253
- const o = s[r];
254
- o.type === e && a.push(
255
- (i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
256
- c && o.remove();
257
- })
258
- );
259
- }
260
- return Promise.all(a).then(() => !0).catch(() => !1);
261
- },
262
- addEventListener: (e, t) => {
263
- const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
264
- u.eventListeners[n] && delete u.eventListeners[n];
265
- };
266
- return u.eventListeners[n] = {
267
- type: e,
268
- handler: async (c) => {
269
- try {
270
- await t(c);
271
- } catch (a) {
272
- throw a;
273
- }
274
- },
275
- remove: s
276
- }, {
277
- remove: s
278
- };
279
- }
280
- }, g = P({
281
- theme: "default",
282
- items: [],
283
- collapse: !1,
284
- eventListeners: {}
285
- }), j = {
286
- setItems: (e) => {
287
- g.items = e;
288
- },
289
- getItems: () => g.items,
290
- setTheme: (e) => {
291
- g.theme = e;
292
- },
293
- setActiveItem: (e) => {
294
- g.activeItem = e;
295
- },
296
- setCollapse: (e) => {
297
- g.collapse = e;
298
- },
299
- setPopupClassName: (e) => {
300
- g.popupClassName = e;
301
- },
302
- triggerEventListener: (e, t, n) => {
303
- var i;
304
- const s = g.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
305
- for (const r in s) {
306
- const o = s[r];
307
- o.type === e && a.push(
308
- (i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
309
- c && o.remove();
310
- })
311
- );
312
- }
313
- return Promise.all(a).then(() => !0).catch(() => !1);
314
- },
315
- addEventListener: (e, t) => {
316
- const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
317
- g.eventListeners[n] && delete g.eventListeners[n];
318
- };
319
- return g.eventListeners[n] = {
320
- type: e,
321
- handler: async (c) => {
322
- try {
323
- await t(c);
324
- } catch (a) {
325
- throw a;
326
- }
327
- },
328
- remove: s
329
- }, {
330
- remove: s
331
- };
332
- }
333
- }, A = P({
334
- theme: "default",
335
- items: [],
336
- eventListeners: {}
337
- }), H = {
338
- setItems: (e) => {
339
- A.items = e;
340
- },
341
- getItems: () => A.items,
342
- setTheme: (e) => {
343
- A.theme = e;
344
- },
345
- removeItem: (e) => {
346
- const t = A.items.filter((n) => n.value !== e);
347
- A.items = t;
348
- },
349
- appendItem: (e) => {
350
- const t = A.items.findIndex((n) => n.value == e.value);
351
- t !== -1 ? A.items.splice(t, 1, e) : A.items.push(e);
352
- },
353
- setActiveItem: (e) => {
354
- A.activeItem = e;
355
- },
356
- triggerEventListener: (e, t, n) => {
357
- var i;
358
- const s = A.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
359
- for (const r in s) {
360
- const o = s[r];
361
- o.type === e && a.push(
362
- (i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
363
- c && o.remove();
364
- })
365
- );
366
- }
367
- return Promise.all(a).then(() => !0).catch(() => !1);
368
- },
369
- addEventListener: (e, t) => {
370
- const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
371
- A.eventListeners[n] && delete A.eventListeners[n];
372
- };
373
- return A.eventListeners[n] = {
374
- type: e,
375
- handler: async (c) => {
376
- try {
377
- await t(c);
378
- } catch (a) {
379
- throw a;
380
- }
381
- },
382
- remove: s
383
- }, {
384
- remove: s
385
- };
386
- }
387
- }, R = P({
388
- eventListeners: {}
389
- }), Ce = {
390
- triggerEventListener: (e, t, n) => {
391
- var i;
392
- const s = R.eventListeners, { autoRemove: c = !1 } = n || {}, a = [];
393
- for (const r in s) {
394
- const o = s[r];
395
- o.type === e && a.push(
396
- (i = o == null ? void 0 : o.handler) == null ? void 0 : i.call(o, t).then(() => {
397
- c && o.remove();
398
- })
399
- );
400
- }
401
- return Promise.all(a).then(() => !0).catch(() => !1);
402
- },
403
- addEventListener: (e, t) => {
404
- const n = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), s = () => {
405
- R.eventListeners[n] && delete R.eventListeners[n];
406
- };
407
- return R.eventListeners[n] = {
408
- type: e,
409
- handler: async (c) => {
410
- try {
411
- await t(c);
412
- } catch (a) {
413
- throw a;
414
- }
415
- },
416
- remove: s
417
- }, {
418
- remove: s
419
- };
420
- }
421
- }, U = P({
422
- visible: !1,
423
- style: {}
424
- }), Oe = {
425
- set: (e, t) => {
426
- U.visible = e, t || (t = {}), t.transition || (t.transition = "all 0.3s"), t && (U.style = t);
427
- }
428
- }, Fe = {
429
- visible: w(!0)
430
- }, G = {
431
- nav: W,
432
- menu: j,
433
- tab: H,
434
- overlay: Oe,
435
- iframeView: Ce,
436
- setVisible: (e) => Fe.visible.value = e,
437
- setTheme: (e) => {
438
- W.setTheme(e), j.setTheme(e), H.setTheme(e);
439
- }
440
- }, re = (e, t) => {
441
- const n = e.__vccOpts || e;
442
- for (const [s, c] of t)
443
- n[s] = c;
444
- return n;
445
- };
446
- var J;
447
- const B = typeof window < "u", Re = (e) => typeof e == "string", Ne = () => {
448
- };
449
- B && ((J = window == null ? void 0 : window.navigator) != null && J.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
450
- function ae(e) {
451
- return typeof e == "function" ? e() : I(e);
452
- }
453
- function De(e) {
454
- return e;
455
- }
456
- function ie(e) {
457
- return ue() ? (de(e), !0) : !1;
458
- }
459
- function ke(e, t = !0) {
460
- pe() ? me(e) : t ? e() : ne(e);
461
- }
462
- function oe(e) {
463
- var t;
464
- const n = ae(e);
465
- return (t = n == null ? void 0 : n.$el) != null ? t : n;
466
- }
467
- const xe = B ? window : void 0, Ve = B ? window.document : void 0;
468
- function qe(...e) {
469
- let t, n, s, c;
470
- if (Re(e[0]) || Array.isArray(e[0]) ? ([n, s, c] = e, t = xe) : [t, n, s, c] = e, !t)
471
- return Ne;
472
- Array.isArray(n) || (n = [n]), Array.isArray(s) || (s = [s]);
473
- const a = [], i = () => {
474
- a.forEach((l) => l()), a.length = 0;
475
- }, r = (l, y, m, L) => (l.addEventListener(y, m, L), () => l.removeEventListener(y, m, L)), o = M(() => [oe(t), ae(c)], ([l, y]) => {
476
- i(), l && a.push(...n.flatMap((m) => s.map((L) => r(l, m, L, y))));
477
- }, { immediate: !0, flush: "post" }), p = () => {
478
- o(), i();
479
- };
480
- return ie(p), p;
481
- }
482
- function Qe(e, t = !1) {
483
- const n = w(), s = () => n.value = !!e();
484
- return s(), ke(s, t), n;
485
- }
486
- const K = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, X = "__vueuse_ssr_handlers__";
487
- K[X] = K[X] || {};
488
- const Y = [
489
- [
490
- "requestFullscreen",
491
- "exitFullscreen",
492
- "fullscreenElement",
493
- "fullscreenEnabled",
494
- "fullscreenchange",
495
- "fullscreenerror"
496
- ],
497
- [
498
- "webkitRequestFullscreen",
499
- "webkitExitFullscreen",
500
- "webkitFullscreenElement",
501
- "webkitFullscreenEnabled",
502
- "webkitfullscreenchange",
503
- "webkitfullscreenerror"
504
- ],
505
- [
506
- "webkitRequestFullScreen",
507
- "webkitCancelFullScreen",
508
- "webkitCurrentFullScreenElement",
509
- "webkitCancelFullScreen",
510
- "webkitfullscreenchange",
511
- "webkitfullscreenerror"
512
- ],
513
- [
514
- "mozRequestFullScreen",
515
- "mozCancelFullScreen",
516
- "mozFullScreenElement",
517
- "mozFullScreenEnabled",
518
- "mozfullscreenchange",
519
- "mozfullscreenerror"
520
- ],
521
- [
522
- "msRequestFullscreen",
523
- "msExitFullscreen",
524
- "msFullscreenElement",
525
- "msFullscreenEnabled",
526
- "MSFullscreenChange",
527
- "MSFullscreenError"
528
- ]
529
- ];
530
- function Be(e, t = {}) {
531
- const { document: n = Ve, autoExit: s = !1 } = t, c = n == null ? void 0 : n.querySelector("html"), a = w(!1);
532
- let i = Y[0];
533
- const r = Qe(() => {
534
- if (n) {
535
- for (const S of Y)
536
- if (S[1] in n)
537
- return i = S, !0;
538
- } else
539
- return !1;
540
- return !1;
541
- }), [o, p, l, , y] = i;
542
- async function m() {
543
- r.value && (n != null && n[l] && await n[p](), a.value = !1);
544
- }
545
- async function L() {
546
- if (!r.value)
547
- return;
548
- await m();
549
- const S = oe(c);
550
- S && (await S[o](), a.value = !0);
551
- }
552
- async function le() {
553
- a.value ? await m() : await L();
554
- }
555
- return n && qe(n, y, () => {
556
- a.value = !!(n != null && n[l]);
557
- }, !1), s && ie(m), {
558
- isSupported: r,
559
- isFullscreen: a,
560
- enter: L,
561
- exit: m,
562
- toggle: le
563
- };
564
- }
565
- var Z;
566
- (function(e) {
567
- e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
568
- })(Z || (Z = {}));
569
- var $e = Object.defineProperty, ee = Object.getOwnPropertySymbols, ze = Object.prototype.hasOwnProperty, We = Object.prototype.propertyIsEnumerable, te = (e, t, n) => t in e ? $e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, je = (e, t) => {
570
- for (var n in t || (t = {}))
571
- ze.call(t, n) && te(e, n, t[n]);
572
- if (ee)
573
- for (var n of ee(t))
574
- We.call(t, n) && te(e, n, t[n]);
575
- return e;
576
- };
577
- const He = {
578
- easeInSine: [0.12, 0, 0.39, 0],
579
- easeOutSine: [0.61, 1, 0.88, 1],
580
- easeInOutSine: [0.37, 0, 0.63, 1],
581
- easeInQuad: [0.11, 0, 0.5, 0],
582
- easeOutQuad: [0.5, 1, 0.89, 1],
583
- easeInOutQuad: [0.45, 0, 0.55, 1],
584
- easeInCubic: [0.32, 0, 0.67, 0],
585
- easeOutCubic: [0.33, 1, 0.68, 1],
586
- easeInOutCubic: [0.65, 0, 0.35, 1],
587
- easeInQuart: [0.5, 0, 0.75, 0],
588
- easeOutQuart: [0.25, 1, 0.5, 1],
589
- easeInOutQuart: [0.76, 0, 0.24, 1],
590
- easeInQuint: [0.64, 0, 0.78, 0],
591
- easeOutQuint: [0.22, 1, 0.36, 1],
592
- easeInOutQuint: [0.83, 0, 0.17, 1],
593
- easeInExpo: [0.7, 0, 0.84, 0],
594
- easeOutExpo: [0.16, 1, 0.3, 1],
595
- easeInOutExpo: [0.87, 0, 0.13, 1],
596
- easeInCirc: [0.55, 0, 1, 0.45],
597
- easeOutCirc: [0, 0.55, 0.45, 1],
598
- easeInOutCirc: [0.85, 0, 0.15, 1],
599
- easeInBack: [0.36, 0, 0.66, -0.56],
600
- easeOutBack: [0.34, 1.56, 0.64, 1],
601
- easeInOutBack: [0.68, -0.6, 0.32, 1.6]
602
- };
603
- je({
604
- linear: De
605
- }, He);
606
- const Ue = ["src", "entry", "name"], Ge = /* @__PURE__ */ x({
607
- __name: "das-micro-app",
608
- props: {
609
- src: {},
610
- name: {},
611
- actived: { type: Boolean }
612
- },
613
- emits: ["onLoaded", "onActivated", "onDeactivated"],
614
- setup(e, { emit: t }) {
615
- const n = e, s = t, c = (r) => {
616
- s("onLoaded", r);
617
- }, a = N(() => n.actived);
618
- return M(() => a.value, (r) => {
619
- r && s("onActivated"), r || s("onDeactivated");
620
- }), (r, o) => (E(), D("iframe", {
621
- class: "das-micro-app",
622
- src: n.src,
623
- entry: n.src,
624
- name: n.name,
625
- frameborder: "0",
626
- onLoad: c
627
- }, null, 40, Ue));
628
- }
629
- }), Je = /* @__PURE__ */ re(Ge, [["__scopeId", "data-v-8ae871f6"]]), Ke = /* @__PURE__ */ x({
630
- __name: "das-micro-apps",
631
- setup(e) {
632
- const t = w(null), n = async (a, i) => {
633
- const r = f.value.find((m) => m.name === i);
634
- if (!r) return;
635
- r.dom = a.target, await ne(), await new Promise((m) => setTimeout(m, 50));
636
- const o = () => {
637
- const m = t.value.getBoundingClientRect() || {};
638
- return m.width = t.value.clientWidth, m.height = t.value.clientHeight, m;
639
- };
640
- d.sendMessageToMicroApp(i, "onLoaded", {
641
- href: location.href,
642
- microAppContainerRect: o(),
643
- entry: r.entry,
644
- name: r.name
645
- });
646
- const { dom: p, ...l } = r;
647
- d.triggerMicroAppLifeCycleListener("onLoaded", l), new ResizeObserver(() => {
648
- d.sendMessageToMicroApp(i, "resize", o());
649
- }).observe(t.value), d.sendMessageToMicroApp(i, "setProxyMessageStatus", { visible: !0, parentHref: location.href }), d.sendMessageToMicroApp(i, "setProxSsoStatus", { visible: !0, parentHref: location.href });
650
- }, s = (a, i) => {
651
- const r = f.value.find((l) => l.name === i);
652
- if (!r) return;
653
- const { dom: o, ...p } = r;
654
- d.sendMessageToMicroApp(i, "onActivated"), d.triggerMicroAppLifeCycleListener("onActivated", p);
655
- }, c = (a, i) => {
656
- const r = f.value.find((l) => l.name === i);
657
- if (!r) return;
658
- const { dom: o, ...p } = r;
659
- d.sendMessageToMicroApp(i, "onDeactivated"), d.triggerMicroAppLifeCycleListener("onDeactivated", p);
660
- };
661
- return (a, i) => (E(), D(
662
- "div",
663
- {
664
- ref_key: "containerRef",
665
- ref: t,
666
- class: "das-micro-app-container"
667
- },
668
- [
669
- (E(!0), D(
670
- $,
671
- null,
672
- fe(I(f), (r) => (E(), D(
673
- $,
674
- null,
675
- [
676
- r.loaded ? ve((E(), se(Je, {
677
- key: 0,
678
- src: r.src || "",
679
- name: r.name,
680
- actived: r.actived,
681
- onOnLoaded: (o) => n(o, r.name),
682
- onOnActivated: (o) => s(o, r.name),
683
- onOnDeactivated: (o) => c(o, r.name)
684
- }, null, 8, ["src", "name", "actived", "onOnLoaded", "onOnActivated", "onOnDeactivated"])), [
685
- [Ae, r.actived]
686
- ]) : he("v-if", !0)
687
- ],
688
- 64
689
- /* STABLE_FRAGMENT */
690
- ))),
691
- 256
692
- /* UNKEYED_FRAGMENT */
693
- ))
694
- ],
695
- 512
696
- /* NEED_PATCH */
697
- ));
698
- }
699
- }), Xe = /* @__PURE__ */ re(Ke, [["__scopeId", "data-v-3abdb1e9"]]), tt = /* @__PURE__ */ x({
700
- __name: "das-main-app-layout",
701
- props: {
702
- transitionConfig: { default: () => {
703
- } },
704
- showLayout: { type: Boolean, default: !0 },
705
- showAside: { type: Boolean, default: !0 },
706
- showTabs: { type: Boolean, default: !0 },
707
- menuAttr: { default: () => {
708
- } },
709
- tabsAttr: { default: () => {
710
- } }
711
- },
712
- setup(e) {
713
- const t = e, n = N(() => !k.value), s = N(() => ({
714
- "enter-active-class": "animate__animated animate__fadeInLeft",
715
- ...t.transitionConfig
716
- })), c = N(() => ({ showLayout: t.showLayout, showAside: t.showAside, showTabs: t.showTabs }));
717
- return (a, i) => (E(), se(I(ye), we({
718
- "transition-config": s.value,
719
- "router-view-visible": n.value
720
- }, c.value), {
721
- header: T(() => [
722
- V(a.$slots, "header", {}, () => [
723
- C(I(_e))
724
- ])
725
- ]),
726
- aside: T(() => [
727
- V(a.$slots, "aside", {}, () => [
728
- C(I(Le), { menuAttr: a.menuAttr }, null, 8, ["menuAttr"])
729
- ])
730
- ]),
731
- tab: T(() => [
732
- V(a.$slots, "tab", {}, () => [
733
- C(I(Me), { tabsAttr: a.tabsAttr }, null, 8, ["tabsAttr"])
734
- ])
735
- ]),
736
- default: T(() => [
737
- C(Xe)
738
- ]),
739
- _: 3
740
- /* FORWARDED */
741
- }, 16, ["transition-config", "router-view-visible"]));
742
- }
743
- }), ce = /* @__PURE__ */ x({
744
- __name: "das-micro-app-ghost",
745
- setup(e) {
746
- return ge(() => {
747
- setTimeout(() => {
748
- document.documentElement.checkVisibility() && history.back();
749
- }, 300);
750
- }), (t, n) => null;
751
- }
752
- }), Ye = (e) => ["http://", "https://", "ws://", "wss://", "/"].find((n) => e.startsWith(n)) ? e : `/${e}`, nt = (e, t) => {
753
- if (!(e != null && e.microApps) || !Array.isArray(e.microApps)) return;
754
- window.__IN_DAS_MAIN_APP = !0, e != null && e.microAppRouterPrefix && (z.value = e.microAppRouterPrefix), f.value = (e.microApps || []).filter((c) => !!c.name).map((c) => ({ ...c, entry: Ye(c.entry || c.name) })), t == null || t.addRoute({
755
- name: "das-micro-app",
756
- path: `${z.value}/:pathMatch(.*)*`,
757
- component: ce,
758
- meta: { isMicroApp: !0, keepAlive: !0 }
759
- }), d.addEventListenerFromMicroApp("bodyOverlay", (c) => {
760
- const { visible: a, style: i } = c.data;
761
- G.overlay.set(a, i);
762
- }), d.addEventListenerFromMicroApp("layoutVisible", (c) => {
763
- const { visible: a } = c.data;
764
- G.setVisible(a);
765
- }), d.addEventListenerFromMicroApp("route", (c) => {
766
- const { name: a, cmd: i, path: r } = c.data;
767
- i === "reload" && d.reloadMicroAppRoute(a, r), i === "unload" && d.unloadMicroAppRoute(a, r);
768
- });
769
- const { enter: n, exit: s } = Be();
770
- d.addEventListenerFromMicroApp("fullscreen", (c) => {
771
- const a = c.data;
772
- a && n(), a || s();
773
- }), d.addEventListenerFromMicroApp("location", (c) => {
774
- const { cmd: a, isAutoCloseApp: i } = c.data || {};
775
- a === "reload" && (i !== void 0 && (window.__isAutoCloseApp = i), location.reload());
776
- });
777
- }, st = (e, t) => {
778
- if (!(e != null && e.microAppName)) return;
779
- window.config.microAppName = e.microAppName, window.self !== window.top && e.microAppName && (window.__IN_DAS_MICRO_APP = !0);
780
- const n = "das-micro-app-ghost";
781
- t == null || t.addRoute({
782
- name: n,
783
- path: `/${n}/:pathMatch(.*)*`,
784
- component: ce,
785
- meta: { isMicroApp: !0, keepAlive: !0 }
786
- });
787
- const s = w(!1), c = w(!1), a = w("");
788
- M(
789
- () => t.currentRoute.value,
790
- (i) => {
791
- if (s.value) {
792
- s.value = !1;
793
- return;
794
- }
795
- if (c.value) {
796
- c.value = !1;
797
- return;
798
- }
799
- const { path: r, query: o, params: p, meta: l } = i;
800
- if (a.value.includes(i.path)) {
801
- a.value = "";
802
- return;
803
- }
804
- d.sendMessageToMainApp("router", {
805
- cmd: "push",
806
- route: {
807
- path: r,
808
- query: { ...o, microAppName: e.microAppName },
809
- params: p,
810
- meta: l
811
- }
812
- });
813
- }
814
- ), d.addEventListenerFromMainApp("router", async (i) => {
815
- var l;
816
- const { cmd: r, route: o, microAppName: p = "" } = i.data;
817
- a.value = ("/" + p + o.path).replace(/\/\//g, "/"), (l = t == null ? void 0 : t[r]) == null || l.call(t, o);
818
- }), d.addEventListenerFromMainApp("onLoaded", (i) => {
819
- const { href: r, microAppContainerRect: o } = i.data;
820
- window.__IN_DAS_MICRO_APP = !0, window.__DAS_MICRO_APP_NAME = e.microAppName, window.__DAS_MAIN_APP_HREF = r, window.__DAS_MICRO_APP_CONTAINER_RECT = o;
821
- }), d.addEventListenerFromMainApp("onDeactivated", (i) => {
822
- const { name: r = "", path: o, params: p = {}, query: l = {} } = t.currentRoute.value;
823
- c.value = !0, t == null || t.push({
824
- name: n,
825
- query: { microAppName: e.microAppName, fromQuery: JSON.stringify(l), fromPath: o },
826
- params: p
827
- });
828
- }), d.addEventListenerFromMainApp("onActivated", (i) => {
829
- const { name: r = "", params: o = {}, query: p = {} } = t.currentRoute.value, { fromPath: l = "", fromQuery: y = "{}" } = p || {};
830
- s.value = !0, t == null || t.push({ path: l, query: JSON.parse(y), params: o });
831
- }), d.addEventListenerFromMainApp("sessionStorage", (i) => {
832
- const { cmd: r, key: o, value: p } = i.data;
833
- r === "setItem" && window.sessionStorage.setItem(o, p), r === "getItem" && window.sessionStorage.getItem(o), r === "removeItem" && window.sessionStorage.removeItem(o), r === "clear" && window.sessionStorage.clear();
834
- }), d.addEventListenerFromMainApp("route", (i) => {
835
- const { cmd: r, path: o } = i.data;
836
- r === "reload" && (O.value.push(o), F.value = !1, setTimeout(() => {
837
- F.value = !0, O.value = [];
838
- }, 300)), r === "unload" && (O.value.push(o), F.value = !1, setTimeout(() => {
839
- F.value = !0, O.value = [];
840
- }, 100));
841
- });
842
- };
843
- export {
844
- tt as DasMainAppLayout,
845
- nt as initMainApp,
846
- st as initMicroApp,
847
- d as microFrontend
848
- };
1
+ import '@das-fed/web/packages/micro-frontend/style.css'
2
+ export * from './runtime.js'