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

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