@luigi-project/client-support-angular 1.25.2-dev.20230191919 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/luigi-project-client-support-angular.umd.js +848 -0
- package/bundles/luigi-project-client-support-angular.umd.js.map +1 -0
- package/bundles/luigi-project-client-support-angular.umd.min.js +2 -0
- package/bundles/luigi-project-client-support-angular.umd.min.js.map +1 -0
- package/esm2015/lib/component/luigi.preload.component.js +13 -0
- package/esm2015/lib/luigi-mock/luigi-mock.module.js +170 -0
- package/esm2015/lib/luigi.angular.support.module.js +60 -0
- package/{esm2020/lib/route/luigi-activated-route-snapshot-helper.mjs → esm2015/lib/route/luigi-activated-route-snapshot-helper.js} +0 -0
- package/{esm2020/lib/route/luigi-route-strategy.mjs → esm2015/lib/route/luigi-route-strategy.js} +0 -0
- package/esm2015/lib/service/luigi-auto-routing.service.js +128 -0
- package/{esm2020/lib/service/luigi-context-service.mjs → esm2015/lib/service/luigi-context-service.js} +0 -0
- package/esm2015/lib/service/luigi-context.service.impl.js +70 -0
- package/esm2015/luigi-project-client-support-angular.js +6 -0
- package/{esm2020/public-api.mjs → esm2015/public-api.js} +0 -0
- package/fesm2015/{luigi-project-client-support-angular.mjs → luigi-project-client-support-angular.js} +75 -88
- package/fesm2015/luigi-project-client-support-angular.js.map +1 -0
- package/lib/component/luigi.preload.component.d.ts +0 -3
- package/lib/component/luigi.preload.component.d.ts.map +1 -1
- package/lib/luigi-mock/luigi-mock.module.d.ts +0 -4
- package/lib/luigi-mock/luigi-mock.module.d.ts.map +1 -1
- package/lib/luigi.angular.support.module.d.ts +0 -6
- package/lib/luigi.angular.support.module.d.ts.map +1 -1
- package/lib/service/luigi-auto-routing.service.d.ts +0 -3
- package/lib/service/luigi-auto-routing.service.d.ts.map +1 -1
- package/lib/service/luigi-context.service.impl.d.ts +0 -3
- package/lib/service/luigi-context.service.impl.d.ts.map +1 -1
- package/{index.d.ts → luigi-project-client-support-angular.d.ts} +1 -1
- package/luigi-project-client-support-angular.d.ts.map +1 -1
- package/luigi-project-client-support-angular.metadata.json +1 -0
- package/package.json +10 -22
- package/esm2020/lib/component/luigi.preload.component.mjs +0 -13
- package/esm2020/lib/luigi-mock/luigi-mock.module.mjs +0 -178
- package/esm2020/lib/luigi.angular.support.module.mjs +0 -70
- package/esm2020/lib/service/luigi-auto-routing.service.mjs +0 -124
- package/esm2020/lib/service/luigi-context.service.impl.mjs +0 -69
- package/esm2020/luigi-project-client-support-angular.mjs +0 -5
- package/fesm2015/luigi-project-client-support-angular.mjs.map +0 -1
- package/fesm2020/luigi-project-client-support-angular.mjs +0 -469
- package/fesm2020/luigi-project-client-support-angular.mjs.map +0 -1
|
@@ -0,0 +1,848 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/router'), require('rxjs'), require('rxjs/operators'), require('@luigi-project/client'), require('@luigi-project/testing-utilities')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@luigi-project/client-support-angular', ['exports', '@angular/core', '@angular/router', 'rxjs', 'rxjs/operators', '@luigi-project/client', '@luigi-project/testing-utilities'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["luigi-project"] = global["luigi-project"] || {}, global["luigi-project"]["client-support-angular"] = {}), global.ng.core, global.ng.router, global.rxjs, global.rxjs.operators, global.client, global.testingUtilities));
|
|
5
|
+
})(this, (function (exports, i0, i1, rxjs, operators, client, testingUtilities) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
27
|
+
|
|
28
|
+
var LuigiPreloadComponent = /** @class */ (function () {
|
|
29
|
+
function LuigiPreloadComponent() {
|
|
30
|
+
}
|
|
31
|
+
LuigiPreloadComponent.prototype.ngOnInit = function () { };
|
|
32
|
+
return LuigiPreloadComponent;
|
|
33
|
+
}());
|
|
34
|
+
LuigiPreloadComponent.decorators = [
|
|
35
|
+
{ type: i0.Component, args: [{
|
|
36
|
+
selector: 'lib-client-support-angular',
|
|
37
|
+
template: "<p luigipreload=\"luigipreload\"></p>\n"
|
|
38
|
+
},] }
|
|
39
|
+
];
|
|
40
|
+
LuigiPreloadComponent.ctorParameters = function () { return []; };
|
|
41
|
+
|
|
42
|
+
var LuigiContextService = /** @class */ (function () {
|
|
43
|
+
function LuigiContextService() {
|
|
44
|
+
}
|
|
45
|
+
return LuigiContextService;
|
|
46
|
+
}());
|
|
47
|
+
exports.ILuigiContextTypes = void 0;
|
|
48
|
+
(function (ILuigiContextTypes) {
|
|
49
|
+
ILuigiContextTypes[ILuigiContextTypes["INIT"] = 0] = "INIT";
|
|
50
|
+
ILuigiContextTypes[ILuigiContextTypes["UPDATE"] = 1] = "UPDATE";
|
|
51
|
+
})(exports.ILuigiContextTypes || (exports.ILuigiContextTypes = {}));
|
|
52
|
+
|
|
53
|
+
var LuigiContextServiceImpl = /** @class */ (function () {
|
|
54
|
+
function LuigiContextServiceImpl(zone) {
|
|
55
|
+
var _this = this;
|
|
56
|
+
this.zone = zone;
|
|
57
|
+
this.subject = new rxjs.ReplaySubject(1);
|
|
58
|
+
this.currentContext = null;
|
|
59
|
+
client.addInitListener(function (initContext) {
|
|
60
|
+
_this.addListener(exports.ILuigiContextTypes.INIT, initContext);
|
|
61
|
+
});
|
|
62
|
+
client.addContextUpdateListener(function (updateContext) {
|
|
63
|
+
_this.addListener(exports.ILuigiContextTypes.UPDATE, updateContext);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
LuigiContextServiceImpl.prototype.contextObservable = function () {
|
|
67
|
+
return this.subject.asObservable();
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Get latest context object retrieved from luigi core application or none, if not yet set.
|
|
71
|
+
*/
|
|
72
|
+
LuigiContextServiceImpl.prototype.getContext = function () {
|
|
73
|
+
return this.currentContext && this.currentContext.context;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Get a promise that resolves when context is set.
|
|
77
|
+
*/
|
|
78
|
+
LuigiContextServiceImpl.prototype.getContextAsync = function () {
|
|
79
|
+
var _this = this;
|
|
80
|
+
return new Promise(function (resolve, reject) {
|
|
81
|
+
if (_this.getContext()) {
|
|
82
|
+
resolve(_this.getContext());
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
_this.contextObservable()
|
|
86
|
+
.pipe(operators.first())
|
|
87
|
+
.subscribe(function (ctx) {
|
|
88
|
+
resolve(ctx.context);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Set current context
|
|
95
|
+
*/
|
|
96
|
+
LuigiContextServiceImpl.prototype.setContext = function (obj) {
|
|
97
|
+
var _this = this;
|
|
98
|
+
this.zone.run(function () {
|
|
99
|
+
_this.currentContext = obj;
|
|
100
|
+
_this.subject.next(obj);
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
LuigiContextServiceImpl.prototype.addListener = function (contextType, context) {
|
|
104
|
+
this.setContext({
|
|
105
|
+
contextType: contextType,
|
|
106
|
+
context: context
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
return LuigiContextServiceImpl;
|
|
110
|
+
}());
|
|
111
|
+
LuigiContextServiceImpl.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LuigiContextServiceImpl_Factory() { return new LuigiContextServiceImpl(i0__namespace.ɵɵinject(i0__namespace.NgZone)); }, token: LuigiContextServiceImpl, providedIn: "root" });
|
|
112
|
+
LuigiContextServiceImpl.decorators = [
|
|
113
|
+
{ type: i0.Injectable, args: [{
|
|
114
|
+
providedIn: 'root'
|
|
115
|
+
},] }
|
|
116
|
+
];
|
|
117
|
+
LuigiContextServiceImpl.ctorParameters = function () { return [
|
|
118
|
+
{ type: i0.NgZone }
|
|
119
|
+
]; };
|
|
120
|
+
|
|
121
|
+
var LuigiActivatedRouteSnapshotHelper = /** @class */ (function () {
|
|
122
|
+
function LuigiActivatedRouteSnapshotHelper() {
|
|
123
|
+
}
|
|
124
|
+
LuigiActivatedRouteSnapshotHelper.getCurrent = function () {
|
|
125
|
+
return LuigiActivatedRouteSnapshotHelper._current;
|
|
126
|
+
};
|
|
127
|
+
LuigiActivatedRouteSnapshotHelper.setCurrent = function (current) {
|
|
128
|
+
LuigiActivatedRouteSnapshotHelper._current = current;
|
|
129
|
+
};
|
|
130
|
+
return LuigiActivatedRouteSnapshotHelper;
|
|
131
|
+
}());
|
|
132
|
+
// tslint:disable-next-line:variable-name
|
|
133
|
+
LuigiActivatedRouteSnapshotHelper._current = null;
|
|
134
|
+
|
|
135
|
+
var LuigiAutoRoutingService = /** @class */ (function () {
|
|
136
|
+
function LuigiAutoRoutingService(router, luigiContextService) {
|
|
137
|
+
this.router = router;
|
|
138
|
+
this.luigiContextService = luigiContextService;
|
|
139
|
+
this.subscription = new rxjs.Subscription();
|
|
140
|
+
this.subscription.add(this.router.events.pipe(this.doFilter()).subscribe(this.doSubscription.bind(this)));
|
|
141
|
+
}
|
|
142
|
+
LuigiAutoRoutingService.prototype.doFilter = function () {
|
|
143
|
+
return operators.filter(function (event) {
|
|
144
|
+
return !!(event instanceof i1.NavigationEnd &&
|
|
145
|
+
event.url &&
|
|
146
|
+
event.url.length > 0 &&
|
|
147
|
+
!(history.state && history.state.luigiInduced));
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* This method will be take in consideration angular route that having in data object the paramter
|
|
152
|
+
* fromVirtualTreeRoot: true, here an example:
|
|
153
|
+
* {path: 'demo', component: DemoComponent, data:{fromVirtualTreeRoot: true}}
|
|
154
|
+
* Another option is to specify the LuigiPath: if you add in route data luigiRoute:'/xxxx/xxx';
|
|
155
|
+
* in the case we will update the path in LuigiCore navigation, here an example
|
|
156
|
+
* {path: 'demo', component: DemoComponent, data:{luigiRoute: '/home/demo''}}
|
|
157
|
+
* If updateModalPathParam is specified, than modalPathParam will be updated upon internal navigation:
|
|
158
|
+
* {path: 'demo', component: DemoComponent, data:{updateModalPathParam: true}}
|
|
159
|
+
* @param event the NavigationEnd event
|
|
160
|
+
*/
|
|
161
|
+
LuigiAutoRoutingService.prototype.doSubscription = function (event) {
|
|
162
|
+
var _a;
|
|
163
|
+
var current = LuigiActivatedRouteSnapshotHelper.getCurrent();
|
|
164
|
+
if (!current) {
|
|
165
|
+
current = this.router.routerState.root.snapshot;
|
|
166
|
+
var _loop_1 = function () {
|
|
167
|
+
// handle multiple children
|
|
168
|
+
var primary = null;
|
|
169
|
+
current === null || current === void 0 ? void 0 : current.children.forEach(function (childSnapshot) {
|
|
170
|
+
if (childSnapshot.outlet === 'primary') {
|
|
171
|
+
primary = childSnapshot;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
if (primary) {
|
|
175
|
+
current = primary;
|
|
176
|
+
}
|
|
177
|
+
else if (current.firstChild) {
|
|
178
|
+
current = current.firstChild;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
return "break";
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
while (((_a = current === null || current === void 0 ? void 0 : current.children) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
185
|
+
var state_1 = _loop_1();
|
|
186
|
+
if (state_1 === "break")
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (current === null || current === void 0 ? void 0 : current.data) {
|
|
191
|
+
var ux = client.uxManager();
|
|
192
|
+
var lm = client.linkManager().withoutSync();
|
|
193
|
+
var route_1;
|
|
194
|
+
if (current.data.luigiRoute) {
|
|
195
|
+
route_1 = current.data.luigiRoute;
|
|
196
|
+
if (current.params) {
|
|
197
|
+
var pmap_1 = i1.convertToParamMap(current.params);
|
|
198
|
+
pmap_1.keys.forEach(function (key) {
|
|
199
|
+
var val = pmap_1.getAll(key).forEach(function (param) {
|
|
200
|
+
route_1 = route_1 === null || route_1 === void 0 ? void 0 : route_1.replace(':' + key, param);
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
if (current.data.fromContext) {
|
|
205
|
+
if (!this.luigiContextService.getContext()) {
|
|
206
|
+
console.debug('Ignoring auto navigation request, luigi context not set');
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (current.data.fromContext === true) {
|
|
210
|
+
lm = lm.fromClosestContext();
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
lm = lm.fromContext(current.data.fromContext);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else if (current.data.fromVirtualTreeRoot) {
|
|
218
|
+
var url = event.url;
|
|
219
|
+
var truncate = current.data.fromVirtualTreeRoot.truncate;
|
|
220
|
+
if (truncate) {
|
|
221
|
+
if (truncate.indexOf('*') === 0) {
|
|
222
|
+
var index = url.indexOf(truncate.substr(1));
|
|
223
|
+
url = url.substr(index + truncate.length - 1);
|
|
224
|
+
}
|
|
225
|
+
else if (url.indexOf(truncate) === 0) {
|
|
226
|
+
url = url.substr(truncate.length);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
route_1 = url;
|
|
230
|
+
console.debug('Calling fromVirtualTreeRoot for url ==> ' + route_1);
|
|
231
|
+
lm = lm.fromVirtualTreeRoot();
|
|
232
|
+
}
|
|
233
|
+
if (ux.isModal()) {
|
|
234
|
+
if (current.data.updateModalDataPath) {
|
|
235
|
+
lm.updateModalPathInternalNavigation(route_1, {}, current.data.addHistoryEntry);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
else if (route_1) {
|
|
239
|
+
lm.navigate(route_1);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
LuigiAutoRoutingService.prototype.ngOnDestroy = function () {
|
|
244
|
+
this.subscription.unsubscribe();
|
|
245
|
+
};
|
|
246
|
+
return LuigiAutoRoutingService;
|
|
247
|
+
}());
|
|
248
|
+
LuigiAutoRoutingService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LuigiAutoRoutingService_Factory() { return new LuigiAutoRoutingService(i0__namespace.ɵɵinject(i1__namespace.Router), i0__namespace.ɵɵinject(LuigiContextService)); }, token: LuigiAutoRoutingService, providedIn: "root" });
|
|
249
|
+
LuigiAutoRoutingService.decorators = [
|
|
250
|
+
{ type: i0.Injectable, args: [{
|
|
251
|
+
providedIn: 'root'
|
|
252
|
+
},] }
|
|
253
|
+
];
|
|
254
|
+
LuigiAutoRoutingService.ctorParameters = function () { return [
|
|
255
|
+
{ type: i1.Router },
|
|
256
|
+
{ type: LuigiContextService }
|
|
257
|
+
]; };
|
|
258
|
+
|
|
259
|
+
/******************************************************************************
|
|
260
|
+
Copyright (c) Microsoft Corporation.
|
|
261
|
+
|
|
262
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
263
|
+
purpose with or without fee is hereby granted.
|
|
264
|
+
|
|
265
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
266
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
267
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
268
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
269
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
270
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
271
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
272
|
+
***************************************************************************** */
|
|
273
|
+
/* global Reflect, Promise */
|
|
274
|
+
var extendStatics = function (d, b) {
|
|
275
|
+
extendStatics = Object.setPrototypeOf ||
|
|
276
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
277
|
+
function (d, b) { for (var p in b)
|
|
278
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
279
|
+
d[p] = b[p]; };
|
|
280
|
+
return extendStatics(d, b);
|
|
281
|
+
};
|
|
282
|
+
function __extends(d, b) {
|
|
283
|
+
if (typeof b !== "function" && b !== null)
|
|
284
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
285
|
+
extendStatics(d, b);
|
|
286
|
+
function __() { this.constructor = d; }
|
|
287
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
288
|
+
}
|
|
289
|
+
var __assign = function () {
|
|
290
|
+
__assign = Object.assign || function __assign(t) {
|
|
291
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
292
|
+
s = arguments[i];
|
|
293
|
+
for (var p in s)
|
|
294
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
295
|
+
t[p] = s[p];
|
|
296
|
+
}
|
|
297
|
+
return t;
|
|
298
|
+
};
|
|
299
|
+
return __assign.apply(this, arguments);
|
|
300
|
+
};
|
|
301
|
+
function __rest(s, e) {
|
|
302
|
+
var t = {};
|
|
303
|
+
for (var p in s)
|
|
304
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
305
|
+
t[p] = s[p];
|
|
306
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
307
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
308
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
309
|
+
t[p[i]] = s[p[i]];
|
|
310
|
+
}
|
|
311
|
+
return t;
|
|
312
|
+
}
|
|
313
|
+
function __decorate(decorators, target, key, desc) {
|
|
314
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
315
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
316
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
317
|
+
else
|
|
318
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
319
|
+
if (d = decorators[i])
|
|
320
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
321
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
322
|
+
}
|
|
323
|
+
function __param(paramIndex, decorator) {
|
|
324
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
325
|
+
}
|
|
326
|
+
function __metadata(metadataKey, metadataValue) {
|
|
327
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
328
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
329
|
+
}
|
|
330
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
331
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
332
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
333
|
+
function fulfilled(value) { try {
|
|
334
|
+
step(generator.next(value));
|
|
335
|
+
}
|
|
336
|
+
catch (e) {
|
|
337
|
+
reject(e);
|
|
338
|
+
} }
|
|
339
|
+
function rejected(value) { try {
|
|
340
|
+
step(generator["throw"](value));
|
|
341
|
+
}
|
|
342
|
+
catch (e) {
|
|
343
|
+
reject(e);
|
|
344
|
+
} }
|
|
345
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
346
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
function __generator(thisArg, body) {
|
|
350
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
351
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
352
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
353
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
354
|
+
function step(op) {
|
|
355
|
+
if (f)
|
|
356
|
+
throw new TypeError("Generator is already executing.");
|
|
357
|
+
while (_)
|
|
358
|
+
try {
|
|
359
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
360
|
+
return t;
|
|
361
|
+
if (y = 0, t)
|
|
362
|
+
op = [op[0] & 2, t.value];
|
|
363
|
+
switch (op[0]) {
|
|
364
|
+
case 0:
|
|
365
|
+
case 1:
|
|
366
|
+
t = op;
|
|
367
|
+
break;
|
|
368
|
+
case 4:
|
|
369
|
+
_.label++;
|
|
370
|
+
return { value: op[1], done: false };
|
|
371
|
+
case 5:
|
|
372
|
+
_.label++;
|
|
373
|
+
y = op[1];
|
|
374
|
+
op = [0];
|
|
375
|
+
continue;
|
|
376
|
+
case 7:
|
|
377
|
+
op = _.ops.pop();
|
|
378
|
+
_.trys.pop();
|
|
379
|
+
continue;
|
|
380
|
+
default:
|
|
381
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
382
|
+
_ = 0;
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
386
|
+
_.label = op[1];
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
390
|
+
_.label = t[1];
|
|
391
|
+
t = op;
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
if (t && _.label < t[2]) {
|
|
395
|
+
_.label = t[2];
|
|
396
|
+
_.ops.push(op);
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
if (t[2])
|
|
400
|
+
_.ops.pop();
|
|
401
|
+
_.trys.pop();
|
|
402
|
+
continue;
|
|
403
|
+
}
|
|
404
|
+
op = body.call(thisArg, _);
|
|
405
|
+
}
|
|
406
|
+
catch (e) {
|
|
407
|
+
op = [6, e];
|
|
408
|
+
y = 0;
|
|
409
|
+
}
|
|
410
|
+
finally {
|
|
411
|
+
f = t = 0;
|
|
412
|
+
}
|
|
413
|
+
if (op[0] & 5)
|
|
414
|
+
throw op[1];
|
|
415
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
419
|
+
if (k2 === undefined)
|
|
420
|
+
k2 = k;
|
|
421
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
422
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
423
|
+
desc = { enumerable: true, get: function () { return m[k]; } };
|
|
424
|
+
}
|
|
425
|
+
Object.defineProperty(o, k2, desc);
|
|
426
|
+
}) : (function (o, m, k, k2) {
|
|
427
|
+
if (k2 === undefined)
|
|
428
|
+
k2 = k;
|
|
429
|
+
o[k2] = m[k];
|
|
430
|
+
});
|
|
431
|
+
function __exportStar(m, o) {
|
|
432
|
+
for (var p in m)
|
|
433
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
434
|
+
__createBinding(o, m, p);
|
|
435
|
+
}
|
|
436
|
+
function __values(o) {
|
|
437
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
438
|
+
if (m)
|
|
439
|
+
return m.call(o);
|
|
440
|
+
if (o && typeof o.length === "number")
|
|
441
|
+
return {
|
|
442
|
+
next: function () {
|
|
443
|
+
if (o && i >= o.length)
|
|
444
|
+
o = void 0;
|
|
445
|
+
return { value: o && o[i++], done: !o };
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
449
|
+
}
|
|
450
|
+
function __read(o, n) {
|
|
451
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
452
|
+
if (!m)
|
|
453
|
+
return o;
|
|
454
|
+
var i = m.call(o), r, ar = [], e;
|
|
455
|
+
try {
|
|
456
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
457
|
+
ar.push(r.value);
|
|
458
|
+
}
|
|
459
|
+
catch (error) {
|
|
460
|
+
e = { error: error };
|
|
461
|
+
}
|
|
462
|
+
finally {
|
|
463
|
+
try {
|
|
464
|
+
if (r && !r.done && (m = i["return"]))
|
|
465
|
+
m.call(i);
|
|
466
|
+
}
|
|
467
|
+
finally {
|
|
468
|
+
if (e)
|
|
469
|
+
throw e.error;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
return ar;
|
|
473
|
+
}
|
|
474
|
+
/** @deprecated */
|
|
475
|
+
function __spread() {
|
|
476
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
477
|
+
ar = ar.concat(__read(arguments[i]));
|
|
478
|
+
return ar;
|
|
479
|
+
}
|
|
480
|
+
/** @deprecated */
|
|
481
|
+
function __spreadArrays() {
|
|
482
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
483
|
+
s += arguments[i].length;
|
|
484
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
485
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
486
|
+
r[k] = a[j];
|
|
487
|
+
return r;
|
|
488
|
+
}
|
|
489
|
+
function __spreadArray(to, from, pack) {
|
|
490
|
+
if (pack || arguments.length === 2)
|
|
491
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
492
|
+
if (ar || !(i in from)) {
|
|
493
|
+
if (!ar)
|
|
494
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
495
|
+
ar[i] = from[i];
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
499
|
+
}
|
|
500
|
+
function __await(v) {
|
|
501
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
502
|
+
}
|
|
503
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
504
|
+
if (!Symbol.asyncIterator)
|
|
505
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
506
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
507
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
508
|
+
function verb(n) { if (g[n])
|
|
509
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
510
|
+
function resume(n, v) { try {
|
|
511
|
+
step(g[n](v));
|
|
512
|
+
}
|
|
513
|
+
catch (e) {
|
|
514
|
+
settle(q[0][3], e);
|
|
515
|
+
} }
|
|
516
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
517
|
+
function fulfill(value) { resume("next", value); }
|
|
518
|
+
function reject(value) { resume("throw", value); }
|
|
519
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
520
|
+
resume(q[0][0], q[0][1]); }
|
|
521
|
+
}
|
|
522
|
+
function __asyncDelegator(o) {
|
|
523
|
+
var i, p;
|
|
524
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
525
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
526
|
+
}
|
|
527
|
+
function __asyncValues(o) {
|
|
528
|
+
if (!Symbol.asyncIterator)
|
|
529
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
530
|
+
var m = o[Symbol.asyncIterator], i;
|
|
531
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
532
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
533
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
534
|
+
}
|
|
535
|
+
function __makeTemplateObject(cooked, raw) {
|
|
536
|
+
if (Object.defineProperty) {
|
|
537
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
cooked.raw = raw;
|
|
541
|
+
}
|
|
542
|
+
return cooked;
|
|
543
|
+
}
|
|
544
|
+
;
|
|
545
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
546
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
547
|
+
}) : function (o, v) {
|
|
548
|
+
o["default"] = v;
|
|
549
|
+
};
|
|
550
|
+
function __importStar(mod) {
|
|
551
|
+
if (mod && mod.__esModule)
|
|
552
|
+
return mod;
|
|
553
|
+
var result = {};
|
|
554
|
+
if (mod != null)
|
|
555
|
+
for (var k in mod)
|
|
556
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
557
|
+
__createBinding(result, mod, k);
|
|
558
|
+
__setModuleDefault(result, mod);
|
|
559
|
+
return result;
|
|
560
|
+
}
|
|
561
|
+
function __importDefault(mod) {
|
|
562
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
563
|
+
}
|
|
564
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
565
|
+
if (kind === "a" && !f)
|
|
566
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
567
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
568
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
569
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
570
|
+
}
|
|
571
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
572
|
+
if (kind === "m")
|
|
573
|
+
throw new TypeError("Private method is not writable");
|
|
574
|
+
if (kind === "a" && !f)
|
|
575
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
576
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
577
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
578
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
579
|
+
}
|
|
580
|
+
function __classPrivateFieldIn(state, receiver) {
|
|
581
|
+
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
582
|
+
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
583
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
var LuigiRouteStrategy = /** @class */ (function (_super) {
|
|
587
|
+
__extends(LuigiRouteStrategy, _super);
|
|
588
|
+
function LuigiRouteStrategy() {
|
|
589
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
590
|
+
}
|
|
591
|
+
LuigiRouteStrategy.prototype.retrieve = function (route) {
|
|
592
|
+
LuigiActivatedRouteSnapshotHelper.setCurrent(route);
|
|
593
|
+
return _super.prototype.retrieve.call(this, route);
|
|
594
|
+
};
|
|
595
|
+
return LuigiRouteStrategy;
|
|
596
|
+
}(i1.BaseRouteReuseStrategy));
|
|
597
|
+
|
|
598
|
+
var ɵ0$1 = { fromVirtualTreeRoot: true }, ɵ1 = { luigiRoute: '/home/reload' }, ɵ2 = { reuse: true }, ɵ3 = { updateModalPathParam: true };
|
|
599
|
+
var staticRoutes = [
|
|
600
|
+
/** here an example if you want to specify that this component is a virtualTree element in Luigi Core navigation*/
|
|
601
|
+
{
|
|
602
|
+
path: 'luigi-client-support-preload',
|
|
603
|
+
component: LuigiPreloadComponent,
|
|
604
|
+
data: ɵ0$1
|
|
605
|
+
},
|
|
606
|
+
/** here an example if you want to specify that this component it is a luigi component and u want to change the navigation in Luigi core*/
|
|
607
|
+
{
|
|
608
|
+
path: 'luigi-client-support-preload',
|
|
609
|
+
component: LuigiPreloadComponent,
|
|
610
|
+
data: ɵ1
|
|
611
|
+
},
|
|
612
|
+
/** here an example if you want to reuse the component and not recreating every time you navigate to it (a singleton Component) It requires in your module to redefine */
|
|
613
|
+
{
|
|
614
|
+
path: 'luigi-client-support-preload=component',
|
|
615
|
+
component: LuigiPreloadComponent,
|
|
616
|
+
data: ɵ2
|
|
617
|
+
},
|
|
618
|
+
/** here an example if you want to update modalPathParam on internal navigation */
|
|
619
|
+
{
|
|
620
|
+
path: 'luigi-client-support-preload',
|
|
621
|
+
component: LuigiPreloadComponent,
|
|
622
|
+
data: ɵ3
|
|
623
|
+
}
|
|
624
|
+
];
|
|
625
|
+
var LuigiAngularSupportModule = /** @class */ (function () {
|
|
626
|
+
function LuigiAngularSupportModule(navigation, context) {
|
|
627
|
+
}
|
|
628
|
+
return LuigiAngularSupportModule;
|
|
629
|
+
}());
|
|
630
|
+
LuigiAngularSupportModule.decorators = [
|
|
631
|
+
{ type: i0.NgModule, args: [{
|
|
632
|
+
declarations: [LuigiPreloadComponent],
|
|
633
|
+
imports: [i1.RouterModule.forChild(staticRoutes)],
|
|
634
|
+
providers: [
|
|
635
|
+
{
|
|
636
|
+
provide: LuigiContextService,
|
|
637
|
+
useClass: LuigiContextServiceImpl
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
provide: i1.RouteReuseStrategy,
|
|
641
|
+
useClass: LuigiRouteStrategy
|
|
642
|
+
}
|
|
643
|
+
],
|
|
644
|
+
exports: [LuigiPreloadComponent]
|
|
645
|
+
},] }
|
|
646
|
+
];
|
|
647
|
+
LuigiAngularSupportModule.ctorParameters = function () { return [
|
|
648
|
+
{ type: LuigiAutoRoutingService },
|
|
649
|
+
{ type: LuigiContextService }
|
|
650
|
+
]; };
|
|
651
|
+
|
|
652
|
+
var ɵ0 = testingUtilities.LuigiMockEngine.initPostMessageHook;
|
|
653
|
+
// @dynamic
|
|
654
|
+
/*
|
|
655
|
+
* This class mocks Luigi Core related functionality.
|
|
656
|
+
*
|
|
657
|
+
* Micro Frontends that use Luigi Client would usually communicate with Luigi Core
|
|
658
|
+
* back and forth. When testing Luigi Client based components, Luigi Core might
|
|
659
|
+
* not be present which leads into limitations on integration/e2e testing for standalone
|
|
660
|
+
* microfrontends.
|
|
661
|
+
*
|
|
662
|
+
* This module adds a hook to the window postMessage API by adding an event listener to the
|
|
663
|
+
* global message event of the window object and mocking the callback.
|
|
664
|
+
* In the normal workflow this message would picked up by Luigi Core which then sends the response back.
|
|
665
|
+
*/
|
|
666
|
+
var LuigiMockModule = /** @class */ (function () {
|
|
667
|
+
function LuigiMockModule() {
|
|
668
|
+
}
|
|
669
|
+
// Add a hook to the post message api to mock the LuigiCore response to the Client
|
|
670
|
+
LuigiMockModule.initPostMessageHook = function () {
|
|
671
|
+
var _this = this;
|
|
672
|
+
return function () { return __awaiter(_this, void 0, void 0, function () {
|
|
673
|
+
return __generator(this, function (_a) {
|
|
674
|
+
// Check if Luigi Client is running standalone
|
|
675
|
+
if (window.parent === window) {
|
|
676
|
+
console.debug('Detected standalone mode');
|
|
677
|
+
// Check and skip if Luigi environment is already mocked
|
|
678
|
+
if (window.luigiMockEnvironment) {
|
|
679
|
+
return [2 /*return*/];
|
|
680
|
+
}
|
|
681
|
+
// mock target origin
|
|
682
|
+
if (window.LuigiClient) {
|
|
683
|
+
window.LuigiClient.setTargetOrigin('*');
|
|
684
|
+
}
|
|
685
|
+
window.luigiMockEnvironment = {
|
|
686
|
+
msgListener: function (e) {
|
|
687
|
+
if (e.data.msg && (e.data.msg.startsWith('luigi.') || e.data.msg === 'storage')) {
|
|
688
|
+
console.debug('Luigi msg', e.data);
|
|
689
|
+
if (e.data.msg === 'luigi.get-context') {
|
|
690
|
+
window.postMessage({
|
|
691
|
+
msg: 'luigi.init',
|
|
692
|
+
emulated: true,
|
|
693
|
+
internal: {
|
|
694
|
+
viewStackSize: 1
|
|
695
|
+
},
|
|
696
|
+
context: e.data.context
|
|
697
|
+
}, '*');
|
|
698
|
+
}
|
|
699
|
+
// vizualise retrieved event data
|
|
700
|
+
testingUtilities.LuigiMockEngine.visualize(JSON.stringify(e.data));
|
|
701
|
+
// Check and run mocked callback if it exists
|
|
702
|
+
var mockListener = window.luigiMockEnvironment.mockListeners[e.data.msg];
|
|
703
|
+
if (mockListener) {
|
|
704
|
+
mockListener(e);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
mockListeners: {
|
|
709
|
+
'luigi.navigation.pathExists': function (event) {
|
|
710
|
+
var mockData = window.sessionStorage.getItem('luigiMockData');
|
|
711
|
+
var mockDataParsed = mockData ? JSON.parse(mockData) : undefined;
|
|
712
|
+
var inputPath = event.data.data.link;
|
|
713
|
+
var pathExists = mockDataParsed && mockDataParsed.pathExists && mockDataParsed.pathExists[inputPath];
|
|
714
|
+
var response = {
|
|
715
|
+
msg: 'luigi.navigation.pathExists.answer',
|
|
716
|
+
data: {
|
|
717
|
+
correlationId: event.data.data.id,
|
|
718
|
+
pathExists: pathExists ? pathExists : false
|
|
719
|
+
},
|
|
720
|
+
emulated: true
|
|
721
|
+
};
|
|
722
|
+
window.postMessage(response, '*');
|
|
723
|
+
},
|
|
724
|
+
//ux
|
|
725
|
+
'luigi.ux.confirmationModal.show': function (event) {
|
|
726
|
+
var response = {
|
|
727
|
+
msg: 'luigi.ux.confirmationModal.hide',
|
|
728
|
+
data: event.data,
|
|
729
|
+
emulated: true
|
|
730
|
+
};
|
|
731
|
+
window.postMessage(response, '*');
|
|
732
|
+
},
|
|
733
|
+
'luigi.ux.alert.show': function (event) {
|
|
734
|
+
var response = {
|
|
735
|
+
msg: 'luigi.ux.alert.hide',
|
|
736
|
+
data: event.data,
|
|
737
|
+
emulated: true
|
|
738
|
+
};
|
|
739
|
+
window.postMessage(response, '*');
|
|
740
|
+
},
|
|
741
|
+
'luigi.ux.set-current-locale': function (event) {
|
|
742
|
+
var response = {
|
|
743
|
+
msg: 'luigi.current-locale-changed',
|
|
744
|
+
currentLocale: event.data.data.currentLocale,
|
|
745
|
+
emulated: true
|
|
746
|
+
};
|
|
747
|
+
window.postMessage(response, '*');
|
|
748
|
+
},
|
|
749
|
+
// linkManager
|
|
750
|
+
'luigi.navigation.open': function (event) {
|
|
751
|
+
var response = {
|
|
752
|
+
msg: 'luigi.navigate.ok',
|
|
753
|
+
data: event.data,
|
|
754
|
+
emulated: true
|
|
755
|
+
};
|
|
756
|
+
window.postMessage(response, '*');
|
|
757
|
+
},
|
|
758
|
+
'luigi.navigation.splitview.close': function (event) {
|
|
759
|
+
var response = {
|
|
760
|
+
msg: 'luigi.navigate.ok',
|
|
761
|
+
data: event.data,
|
|
762
|
+
emulated: true
|
|
763
|
+
};
|
|
764
|
+
window.postMessage(response, '*');
|
|
765
|
+
},
|
|
766
|
+
'luigi.navigation.splitview.collapse': function (event) {
|
|
767
|
+
var response = {
|
|
768
|
+
msg: 'luigi.navigate.ok',
|
|
769
|
+
data: event.data,
|
|
770
|
+
emulated: true
|
|
771
|
+
};
|
|
772
|
+
window.postMessage(response, '*');
|
|
773
|
+
},
|
|
774
|
+
'luigi.navigation.splitview.expand': function (event) {
|
|
775
|
+
var response = {
|
|
776
|
+
msg: 'luigi.navigate.ok',
|
|
777
|
+
data: event.data,
|
|
778
|
+
emulated: true
|
|
779
|
+
};
|
|
780
|
+
window.postMessage(response, '*');
|
|
781
|
+
},
|
|
782
|
+
// storage
|
|
783
|
+
storage: function () { }
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
// Listen to the global 'message' event of the window object
|
|
787
|
+
window.addEventListener('message', window.luigiMockEnvironment.msgListener);
|
|
788
|
+
}
|
|
789
|
+
return [2 /*return*/];
|
|
790
|
+
});
|
|
791
|
+
}); };
|
|
792
|
+
};
|
|
793
|
+
/*
|
|
794
|
+
* This method takes a data object of type 'any' and vizualizes a simple container
|
|
795
|
+
* which holds data that is useful for e2e testing.
|
|
796
|
+
*/
|
|
797
|
+
LuigiMockModule.visualize = function (data) {
|
|
798
|
+
var luigiVisualizationContainer = document.querySelector('#luigi-debug-vis-cnt');
|
|
799
|
+
// Construct element structure if not already constructed
|
|
800
|
+
if (!luigiVisualizationContainer) {
|
|
801
|
+
luigiVisualizationContainer = document.createElement('div');
|
|
802
|
+
luigiVisualizationContainer.setAttribute('id', 'luigi-debug-vis-cnt');
|
|
803
|
+
// Hide the added DOM element to avoid interferring/overlapping with other elements during testing.
|
|
804
|
+
luigiVisualizationContainer.setAttribute('style', 'display:none');
|
|
805
|
+
document.body.appendChild(luigiVisualizationContainer);
|
|
806
|
+
}
|
|
807
|
+
var line = document.createElement('div');
|
|
808
|
+
line.textContent = data;
|
|
809
|
+
luigiVisualizationContainer.appendChild(line);
|
|
810
|
+
};
|
|
811
|
+
return LuigiMockModule;
|
|
812
|
+
}());
|
|
813
|
+
LuigiMockModule.decorators = [
|
|
814
|
+
{ type: i0.NgModule, args: [{
|
|
815
|
+
providers: [
|
|
816
|
+
{
|
|
817
|
+
provide: i0.APP_INITIALIZER,
|
|
818
|
+
useFactory: ɵ0,
|
|
819
|
+
multi: true
|
|
820
|
+
}
|
|
821
|
+
]
|
|
822
|
+
},] }
|
|
823
|
+
];
|
|
824
|
+
|
|
825
|
+
/*
|
|
826
|
+
* Public API Surface of client-support-angular
|
|
827
|
+
*/
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Generated bundle index. Do not edit.
|
|
831
|
+
*/
|
|
832
|
+
|
|
833
|
+
exports.LuigiAngularSupportModule = LuigiAngularSupportModule;
|
|
834
|
+
exports.LuigiAutoRoutingService = LuigiAutoRoutingService;
|
|
835
|
+
exports.LuigiContextService = LuigiContextService;
|
|
836
|
+
exports.LuigiContextServiceImpl = LuigiContextServiceImpl;
|
|
837
|
+
exports.LuigiMockModule = LuigiMockModule;
|
|
838
|
+
exports.LuigiPreloadComponent = LuigiPreloadComponent;
|
|
839
|
+
exports.staticRoutes = staticRoutes;
|
|
840
|
+
exports["ɵ1"] = ɵ1;
|
|
841
|
+
exports["ɵ2"] = ɵ2;
|
|
842
|
+
exports["ɵ3"] = ɵ3;
|
|
843
|
+
exports["ɵa"] = LuigiRouteStrategy;
|
|
844
|
+
|
|
845
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
846
|
+
|
|
847
|
+
}));
|
|
848
|
+
//# sourceMappingURL=luigi-project-client-support-angular.umd.js.map
|