angular-toolbox 1.1.1 → 1.2.1
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/README.md +24 -24
- package/esm2022/lib/model/business/ui/index.mjs +2 -1
- package/esm2022/lib/model/business/ui/window/index.mjs +5 -0
- package/esm2022/lib/model/business/ui/window/window-feature-state.mjs +22 -0
- package/esm2022/lib/model/business/ui/window/window-init.mjs +9 -0
- package/esm2022/lib/model/business/ui/window/window-ref.mjs +9 -0
- package/esm2022/lib/model/business/ui/window/window-target.mjs +34 -0
- package/esm2022/lib/model/service/mock/http/logging/atx-http-mock-console.service.mjs +45 -55
- package/esm2022/lib/model/service/ui/index.mjs +2 -1
- package/esm2022/lib/model/service/ui/window/abstract-window.service.mjs +49 -0
- package/esm2022/lib/model/service/ui/window/index.mjs +3 -0
- package/esm2022/lib/model/service/ui/window/window.service.mjs +98 -0
- package/esm2022/lib/model/service/version/angular-toolbox-version.service.mjs +3 -3
- package/esm2022/lib/util/window/window-features-builder.mjs +78 -0
- package/esm2022/lib/util/window/window-header-tag-util.mjs +42 -0
- package/fesm2022/angular-toolbox.mjs +375 -56
- package/fesm2022/angular-toolbox.mjs.map +1 -1
- package/lib/model/business/ui/index.d.ts +1 -0
- package/lib/model/business/ui/window/index.d.ts +4 -0
- package/lib/model/business/ui/window/window-feature-state.d.ts +20 -0
- package/lib/model/business/ui/window/window-init.d.ts +70 -0
- package/lib/model/business/ui/window/window-ref.d.ts +21 -0
- package/lib/model/business/ui/window/window-target.d.ts +32 -0
- package/lib/model/service/mock/http/logging/atx-http-mock-console.service.d.ts +17 -23
- package/lib/model/service/ui/index.d.ts +1 -0
- package/lib/model/service/ui/window/abstract-window.service.d.ts +64 -0
- package/lib/model/service/ui/window/index.d.ts +2 -0
- package/lib/model/service/ui/window/window.service.d.ts +48 -0
- package/lib/util/window/window-features-builder.d.ts +42 -0
- package/lib/util/window/window-header-tag-util.d.ts +27 -0
- package/package.json +1 -1
- package/esm2022/lib/model/business/mock/http/popup/atx-http-mock-console-popup.mjs +0 -9
- package/lib/model/business/mock/http/popup/atx-http-mock-console-popup.d.ts +0 -23
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
6
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
7
|
+
*/
|
|
8
|
+
import { EMPTY_STRING } from "../empty-string.const";
|
|
9
|
+
/**
|
|
10
|
+
* A static builder that creates the features associated with a popup window created by
|
|
11
|
+
* the `WindowService.open()` method.
|
|
12
|
+
*/
|
|
13
|
+
export class BrowserWindowFeaturesBuilder {
|
|
14
|
+
/**
|
|
15
|
+
* Builds a string that represents the features parameter of the `Window.open()` method.
|
|
16
|
+
*
|
|
17
|
+
* @param init A `WindowInit` object that contains data to initialize the features string.
|
|
18
|
+
*
|
|
19
|
+
* @returns A string that represents the features parameter of the `Window.open()` method.
|
|
20
|
+
*/
|
|
21
|
+
static build(init) {
|
|
22
|
+
if (!init)
|
|
23
|
+
return "popup=true,left=100,top=100,width=800,height=450";
|
|
24
|
+
let features = "popup=true";
|
|
25
|
+
features += BrowserWindowFeaturesBuilder.getLeft(init);
|
|
26
|
+
features += BrowserWindowFeaturesBuilder.getTop(init);
|
|
27
|
+
features += BrowserWindowFeaturesBuilder.getWidth(init);
|
|
28
|
+
features += BrowserWindowFeaturesBuilder.getHeight(init);
|
|
29
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("directories", init);
|
|
30
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("titlebar", init);
|
|
31
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("scrollbars", init);
|
|
32
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("toolbar", init);
|
|
33
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("location", init);
|
|
34
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("status", init);
|
|
35
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("menubar", init);
|
|
36
|
+
return features;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @private
|
|
40
|
+
*/
|
|
41
|
+
static getLeft(init) {
|
|
42
|
+
const v = init?.left;
|
|
43
|
+
return ",left=" + (v || 100);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
static getTop(init) {
|
|
49
|
+
const v = init?.top;
|
|
50
|
+
return ",top=" + (v || 100);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @private
|
|
54
|
+
*/
|
|
55
|
+
static getWidth(init) {
|
|
56
|
+
const v = init?.width;
|
|
57
|
+
return ",width=" + (v || 800);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @private
|
|
61
|
+
*/
|
|
62
|
+
static getHeight(init) {
|
|
63
|
+
const v = init?.height;
|
|
64
|
+
return ",height=" + (v || 450);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @private
|
|
68
|
+
*/
|
|
69
|
+
static getPopupProp(property, init) {
|
|
70
|
+
if (!init)
|
|
71
|
+
return EMPTY_STRING;
|
|
72
|
+
const v = init[property];
|
|
73
|
+
if (!v)
|
|
74
|
+
return EMPTY_STRING;
|
|
75
|
+
return `,${property}=${v}`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2luZG93LWZlYXR1cmVzLWJ1aWxkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLXRvb2xib3gvc3JjL2xpYi91dGlsL3dpbmRvdy93aW5kb3ctZmVhdHVyZXMtYnVpbGRlci50cyJdLCJuYW1lcy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yBzdGF0aWMgZ2V0VG9wKGluaXQ/OiBXaW5kb3dJbml0KTogc3RyaW5nIHtcclxuICAgICAgICBjb25zdCB2OiBudW1iZXIgfCB1bmRlZmluZWQgPSBpbml0Py50b3A7XHJcbiAgICAgICAgcmV0dXJuIFwiLHRvcD1cIiArICh2IHx8IDEwMCk7XHJcbiAgICB9XHJcblxyXG4gICAgLyoqXHJcbiAgICAgKiBAcHJpdmF0ZVxyXG4gICAgICovXHJcbiAgICBwdWJsaWMgc3RhdGljIGdldFdpZHRoKGluaXQ/OiBXaW5kb3dJbml0KTogc3RyaW5nIHtcclxuICAgICAgICBjb25zdCB2OiBudW1iZXIgfCB1bmRlZmluZWQgPSBpbml0Py53aWR0aDtcclxuICAgICAgICByZXR1cm4gXCIsd2lkdGg9XCIgKyAodiB8fCA4MDApO1xyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogQHByaXZhdGVcclxuICAgICAqL1xyXG4gICAgcHVibGljIHN0YXRpYyBnZXRIZWlnaHQoaW5pdD86IFdpbmRvd0luaXQpOiBzdHJpbmcge1xyXG4gICAgICAgIGNvbnN0IHY6IG51bWJlciB8IHVuZGVmaW5lZCA9IGluaXQ/LmhlaWdodDtcclxuICAgICAgICByZXR1cm4gXCIsaGVpZ2h0PVwiICsgKHYgfHwgNDUwKTtcclxuICAgIH1cclxuXHJcbiAgICAvKipcclxuICAgICAqIEBwcml2YXRlXHJcbiAgICAgKi9cclxuICAgIHB1YmxpYyBzdGF0aWMgZ2V0UG9wdXBQcm9wKHByb3BlcnR5OiBzdHJpbmcsIGluaXQ/OiBXaW5kb3dJbml0KTogc3RyaW5nIHtcclxuICAgICAgICBpZiAoIWluaXQpIHJldHVybiBFTVBUWV9TVFJJTkc7XHJcbiAgICAgICAgY29uc3QgdjogYW55ID0gKGluaXQgYXMgYW55KVtwcm9wZXJ0eSBhcyBhbnldO1xyXG4gICAgICAgIGlmICghdikgcmV0dXJuIEVNUFRZX1NUUklORztcclxuICAgICAgICByZXR1cm4gYCwke3Byb3BlcnR5fT0ke3Z9YDtcclxuICAgIH1cclxufVxyXG4iXX0=
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
6
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A static utility class that creates header tags for windows created by the `WindowService.open()` method.
|
|
10
|
+
*/
|
|
11
|
+
export class WindowHeaderTagUtil {
|
|
12
|
+
/**
|
|
13
|
+
* Sets the title of the specified window if defined in the `WindowInit` config object.
|
|
14
|
+
*
|
|
15
|
+
* @param win The window for which to set the title.
|
|
16
|
+
* @param init The `WindowInit` config object used to initialize the window.
|
|
17
|
+
*/
|
|
18
|
+
static setTitle(win, init) {
|
|
19
|
+
const title = init?.title;
|
|
20
|
+
if (!title)
|
|
21
|
+
return;
|
|
22
|
+
win.document.title = title;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Sets the icon of the specified window if defined in the `WindowInit` config object.
|
|
26
|
+
*
|
|
27
|
+
* @param win The window for which to set the icon.
|
|
28
|
+
* @param init The `WindowInit` config object used to initialize the window.
|
|
29
|
+
*/
|
|
30
|
+
static setIcon(win, init) {
|
|
31
|
+
const icon = init?.icon;
|
|
32
|
+
if (!icon)
|
|
33
|
+
return;
|
|
34
|
+
const doc = win.document;
|
|
35
|
+
const head = doc.getElementsByTagName('head')[0];
|
|
36
|
+
const link = doc.createElement('link');
|
|
37
|
+
link.rel = 'shortcut icon';
|
|
38
|
+
link.href = icon;
|
|
39
|
+
head.appendChild(link);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2luZG93LWhlYWRlci10YWctdXR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aW5rLnJlbCA9ICdzaG9ydGN1dCBpY29uJztcclxuICAgICAgICBsaW5rLmhyZWYgPSBpY29uO1xyXG4gICAgICAgIGhlYWQuYXBwZW5kQ2hpbGQobGluayk7XHJcbiAgICB9XHJcbn1cclxuIl19
|
|
@@ -543,9 +543,9 @@ class AbstractVersionManager {
|
|
|
543
543
|
*/
|
|
544
544
|
const LAYERS_VERSION_CONFIG = {
|
|
545
545
|
major: 1,
|
|
546
|
-
minor:
|
|
546
|
+
minor: 2,
|
|
547
547
|
patch: 1,
|
|
548
|
-
buildTimestamp:
|
|
548
|
+
buildTimestamp: 1725880857406
|
|
549
549
|
};
|
|
550
550
|
/**
|
|
551
551
|
* The public service that exposes the current version of the Angular Toolbox library.
|
|
@@ -1265,6 +1265,78 @@ const DARK_MODE_CONFIG = {
|
|
|
1265
1265
|
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
1266
1266
|
*/
|
|
1267
1267
|
|
|
1268
|
+
/**
|
|
1269
|
+
* @license
|
|
1270
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
1271
|
+
*
|
|
1272
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
1273
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
1274
|
+
*/
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* @license
|
|
1278
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
1279
|
+
*
|
|
1280
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
1281
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
1282
|
+
*/
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* @license
|
|
1286
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
1287
|
+
*
|
|
1288
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
1289
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
1290
|
+
*/
|
|
1291
|
+
/**
|
|
1292
|
+
* Specifies values used to activate, or deactivate, a feature for a browser window created by the `WindowService.open()` method.
|
|
1293
|
+
*/
|
|
1294
|
+
var WindowFeatureState;
|
|
1295
|
+
(function (WindowFeatureState) {
|
|
1296
|
+
/**
|
|
1297
|
+
* The value used to activate a feature.
|
|
1298
|
+
*/
|
|
1299
|
+
WindowFeatureState["YES"] = "yes";
|
|
1300
|
+
/**
|
|
1301
|
+
* The value used to deactivate a feature.
|
|
1302
|
+
*/
|
|
1303
|
+
WindowFeatureState["NO"] = "no";
|
|
1304
|
+
})(WindowFeatureState || (WindowFeatureState = {}));
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* @license
|
|
1308
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
1309
|
+
*
|
|
1310
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
1311
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
1312
|
+
*/
|
|
1313
|
+
/**
|
|
1314
|
+
* Specifies the name of the browsing context the resource is being loaded into.
|
|
1315
|
+
*/
|
|
1316
|
+
var WindowTarget;
|
|
1317
|
+
(function (WindowTarget) {
|
|
1318
|
+
/**
|
|
1319
|
+
* The current browsing context.
|
|
1320
|
+
*/
|
|
1321
|
+
WindowTarget["SELF"] = "self";
|
|
1322
|
+
/**
|
|
1323
|
+
* Usually a new tab, but users can configure browsers to open a new window instead.
|
|
1324
|
+
*/
|
|
1325
|
+
WindowTarget["BLANK"] = "_blank";
|
|
1326
|
+
/**
|
|
1327
|
+
* The parent browsing context of the current one. If no parent, behaves as `WindowTarget.SELF`.
|
|
1328
|
+
*/
|
|
1329
|
+
WindowTarget["PARENT"] = "_parent";
|
|
1330
|
+
/**
|
|
1331
|
+
* The topmost browsing context.
|
|
1332
|
+
*/
|
|
1333
|
+
WindowTarget["TOP"] = "_top";
|
|
1334
|
+
/**
|
|
1335
|
+
* Allows embedded fenced frames to navigate the top-level frame.
|
|
1336
|
+
*/
|
|
1337
|
+
WindowTarget["UNFENCED_TOP"] = "_unfencedTop";
|
|
1338
|
+
})(WindowTarget || (WindowTarget = {}));
|
|
1339
|
+
|
|
1268
1340
|
/**
|
|
1269
1341
|
* @license
|
|
1270
1342
|
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
@@ -2090,6 +2162,264 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
|
|
|
2090
2162
|
args: [DOCUMENT]
|
|
2091
2163
|
}] }] });
|
|
2092
2164
|
|
|
2165
|
+
/**
|
|
2166
|
+
* @license
|
|
2167
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
2168
|
+
*
|
|
2169
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
2170
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
2171
|
+
*/
|
|
2172
|
+
/**
|
|
2173
|
+
* The abstract class that must be implemented by services that provide
|
|
2174
|
+
* functionality to display Angular component within a new browser window.
|
|
2175
|
+
*/
|
|
2176
|
+
class AbstractWindowService {
|
|
2177
|
+
constructor() {
|
|
2178
|
+
/**
|
|
2179
|
+
* An event triggered each time a window is closed.
|
|
2180
|
+
*/
|
|
2181
|
+
this.windowClose = new EventEmitter();
|
|
2182
|
+
/**
|
|
2183
|
+
* @private
|
|
2184
|
+
*/
|
|
2185
|
+
this.windowRefMap = new Map();
|
|
2186
|
+
}
|
|
2187
|
+
/**
|
|
2188
|
+
* Returns the window reference object associated with the specified `Uuid` object.
|
|
2189
|
+
*
|
|
2190
|
+
* @param uuid The `Uuid` object associated with the window reference to get.
|
|
2191
|
+
*
|
|
2192
|
+
* @returns A `WindowRef` object, or `undefined` if the reference cannot be found.
|
|
2193
|
+
*/
|
|
2194
|
+
get(uuid) {
|
|
2195
|
+
return this.windowRefMap.get(uuid);
|
|
2196
|
+
}
|
|
2197
|
+
/**
|
|
2198
|
+
* Returns all the window reference objects created by the service.
|
|
2199
|
+
*
|
|
2200
|
+
* @returns A list of `WindowRef` objects created by this service.
|
|
2201
|
+
*/
|
|
2202
|
+
getAll() {
|
|
2203
|
+
return Array.from(this.windowRefMap.values());
|
|
2204
|
+
}
|
|
2205
|
+
/**
|
|
2206
|
+
* @private
|
|
2207
|
+
*/
|
|
2208
|
+
destroy() {
|
|
2209
|
+
this.windowRefMap.clear();
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
/**
|
|
2214
|
+
* @license
|
|
2215
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
2216
|
+
*
|
|
2217
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
2218
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
2219
|
+
*/
|
|
2220
|
+
/**
|
|
2221
|
+
* A static builder that creates the features associated with a popup window created by
|
|
2222
|
+
* the `WindowService.open()` method.
|
|
2223
|
+
*/
|
|
2224
|
+
class BrowserWindowFeaturesBuilder {
|
|
2225
|
+
/**
|
|
2226
|
+
* Builds a string that represents the features parameter of the `Window.open()` method.
|
|
2227
|
+
*
|
|
2228
|
+
* @param init A `WindowInit` object that contains data to initialize the features string.
|
|
2229
|
+
*
|
|
2230
|
+
* @returns A string that represents the features parameter of the `Window.open()` method.
|
|
2231
|
+
*/
|
|
2232
|
+
static build(init) {
|
|
2233
|
+
if (!init)
|
|
2234
|
+
return "popup=true,left=100,top=100,width=800,height=450";
|
|
2235
|
+
let features = "popup=true";
|
|
2236
|
+
features += BrowserWindowFeaturesBuilder.getLeft(init);
|
|
2237
|
+
features += BrowserWindowFeaturesBuilder.getTop(init);
|
|
2238
|
+
features += BrowserWindowFeaturesBuilder.getWidth(init);
|
|
2239
|
+
features += BrowserWindowFeaturesBuilder.getHeight(init);
|
|
2240
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("directories", init);
|
|
2241
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("titlebar", init);
|
|
2242
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("scrollbars", init);
|
|
2243
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("toolbar", init);
|
|
2244
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("location", init);
|
|
2245
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("status", init);
|
|
2246
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("menubar", init);
|
|
2247
|
+
return features;
|
|
2248
|
+
}
|
|
2249
|
+
/**
|
|
2250
|
+
* @private
|
|
2251
|
+
*/
|
|
2252
|
+
static getLeft(init) {
|
|
2253
|
+
const v = init?.left;
|
|
2254
|
+
return ",left=" + (v || 100);
|
|
2255
|
+
}
|
|
2256
|
+
/**
|
|
2257
|
+
* @private
|
|
2258
|
+
*/
|
|
2259
|
+
static getTop(init) {
|
|
2260
|
+
const v = init?.top;
|
|
2261
|
+
return ",top=" + (v || 100);
|
|
2262
|
+
}
|
|
2263
|
+
/**
|
|
2264
|
+
* @private
|
|
2265
|
+
*/
|
|
2266
|
+
static getWidth(init) {
|
|
2267
|
+
const v = init?.width;
|
|
2268
|
+
return ",width=" + (v || 800);
|
|
2269
|
+
}
|
|
2270
|
+
/**
|
|
2271
|
+
* @private
|
|
2272
|
+
*/
|
|
2273
|
+
static getHeight(init) {
|
|
2274
|
+
const v = init?.height;
|
|
2275
|
+
return ",height=" + (v || 450);
|
|
2276
|
+
}
|
|
2277
|
+
/**
|
|
2278
|
+
* @private
|
|
2279
|
+
*/
|
|
2280
|
+
static getPopupProp(property, init) {
|
|
2281
|
+
if (!init)
|
|
2282
|
+
return EMPTY_STRING;
|
|
2283
|
+
const v = init[property];
|
|
2284
|
+
if (!v)
|
|
2285
|
+
return EMPTY_STRING;
|
|
2286
|
+
return `,${property}=${v}`;
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
/**
|
|
2291
|
+
* @license
|
|
2292
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
2293
|
+
*
|
|
2294
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
2295
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
2296
|
+
*/
|
|
2297
|
+
/**
|
|
2298
|
+
* A static utility class that creates header tags for windows created by the `WindowService.open()` method.
|
|
2299
|
+
*/
|
|
2300
|
+
class WindowHeaderTagUtil {
|
|
2301
|
+
/**
|
|
2302
|
+
* Sets the title of the specified window if defined in the `WindowInit` config object.
|
|
2303
|
+
*
|
|
2304
|
+
* @param win The window for which to set the title.
|
|
2305
|
+
* @param init The `WindowInit` config object used to initialize the window.
|
|
2306
|
+
*/
|
|
2307
|
+
static setTitle(win, init) {
|
|
2308
|
+
const title = init?.title;
|
|
2309
|
+
if (!title)
|
|
2310
|
+
return;
|
|
2311
|
+
win.document.title = title;
|
|
2312
|
+
}
|
|
2313
|
+
/**
|
|
2314
|
+
* Sets the icon of the specified window if defined in the `WindowInit` config object.
|
|
2315
|
+
*
|
|
2316
|
+
* @param win The window for which to set the icon.
|
|
2317
|
+
* @param init The `WindowInit` config object used to initialize the window.
|
|
2318
|
+
*/
|
|
2319
|
+
static setIcon(win, init) {
|
|
2320
|
+
const icon = init?.icon;
|
|
2321
|
+
if (!icon)
|
|
2322
|
+
return;
|
|
2323
|
+
const doc = win.document;
|
|
2324
|
+
const head = doc.getElementsByTagName('head')[0];
|
|
2325
|
+
const link = doc.createElement('link');
|
|
2326
|
+
link.rel = 'shortcut icon';
|
|
2327
|
+
link.href = icon;
|
|
2328
|
+
head.appendChild(link);
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
/**
|
|
2333
|
+
* @license
|
|
2334
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
2335
|
+
*
|
|
2336
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
2337
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
2338
|
+
*/
|
|
2339
|
+
/**
|
|
2340
|
+
* Provides functionality to display Angular component within a new browser window.
|
|
2341
|
+
*/
|
|
2342
|
+
class WindowService extends AbstractWindowService {
|
|
2343
|
+
/**
|
|
2344
|
+
* @private
|
|
2345
|
+
*/
|
|
2346
|
+
constructor(_appRef) {
|
|
2347
|
+
super();
|
|
2348
|
+
this._appRef = _appRef;
|
|
2349
|
+
window.addEventListener("beforeunload", () => this.beforUnloadHandler());
|
|
2350
|
+
}
|
|
2351
|
+
/**
|
|
2352
|
+
* @inheritdoc
|
|
2353
|
+
*/
|
|
2354
|
+
open(component, init) {
|
|
2355
|
+
const id = Uuid.build();
|
|
2356
|
+
const features = BrowserWindowFeaturesBuilder.build(init);
|
|
2357
|
+
const win = window.open(EMPTY_STRING, this.getTarget(init), features);
|
|
2358
|
+
WindowHeaderTagUtil.setTitle(win, init);
|
|
2359
|
+
WindowHeaderTagUtil.setIcon(win, init);
|
|
2360
|
+
const componentRef = this._appRef.bootstrap(component, win.document.body);
|
|
2361
|
+
const winRef = {
|
|
2362
|
+
window: win,
|
|
2363
|
+
componentRef: componentRef
|
|
2364
|
+
};
|
|
2365
|
+
this.windowRefMap.set(id, winRef);
|
|
2366
|
+
return id;
|
|
2367
|
+
}
|
|
2368
|
+
/**
|
|
2369
|
+
* @inheritdoc
|
|
2370
|
+
*/
|
|
2371
|
+
close(uuid) {
|
|
2372
|
+
const winRef = this.windowRefMap.get(uuid);
|
|
2373
|
+
if (!winRef)
|
|
2374
|
+
return false;
|
|
2375
|
+
this.windowRefMap.delete(uuid);
|
|
2376
|
+
winRef.window.close();
|
|
2377
|
+
winRef.window = null;
|
|
2378
|
+
winRef.componentRef.destroy();
|
|
2379
|
+
winRef.componentRef;
|
|
2380
|
+
this.windowClose.emit(uuid);
|
|
2381
|
+
return true;
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* @inheritdoc
|
|
2385
|
+
*/
|
|
2386
|
+
closeAll() {
|
|
2387
|
+
const keys = this.windowRefMap.keys();
|
|
2388
|
+
for (const key of keys)
|
|
2389
|
+
this.close(key);
|
|
2390
|
+
}
|
|
2391
|
+
/**
|
|
2392
|
+
* @private
|
|
2393
|
+
*/
|
|
2394
|
+
ngOnDestroy() {
|
|
2395
|
+
this.closeAll();
|
|
2396
|
+
this.destroy();
|
|
2397
|
+
}
|
|
2398
|
+
/**
|
|
2399
|
+
* @private
|
|
2400
|
+
*/
|
|
2401
|
+
beforUnloadHandler() {
|
|
2402
|
+
this.ngOnDestroy();
|
|
2403
|
+
window.removeEventListener("beforeunload", () => this.beforUnloadHandler());
|
|
2404
|
+
}
|
|
2405
|
+
/**
|
|
2406
|
+
* @private
|
|
2407
|
+
*/
|
|
2408
|
+
getTarget(init) {
|
|
2409
|
+
if (init)
|
|
2410
|
+
return init.target || WindowTarget.BLANK;
|
|
2411
|
+
return WindowTarget.BLANK;
|
|
2412
|
+
}
|
|
2413
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: WindowService, deps: [{ token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2414
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: WindowService, providedIn: 'root' }); }
|
|
2415
|
+
}
|
|
2416
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: WindowService, decorators: [{
|
|
2417
|
+
type: Injectable,
|
|
2418
|
+
args: [{
|
|
2419
|
+
providedIn: 'root'
|
|
2420
|
+
}]
|
|
2421
|
+
}], ctorParameters: () => [{ type: i0.ApplicationRef }] });
|
|
2422
|
+
|
|
2093
2423
|
/**
|
|
2094
2424
|
* @license
|
|
2095
2425
|
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
@@ -6050,6 +6380,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
|
|
|
6050
6380
|
* Use of this source code is governed by an MIT-style license that can be found in
|
|
6051
6381
|
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
6052
6382
|
*/
|
|
6383
|
+
/**
|
|
6384
|
+
* @private
|
|
6385
|
+
*/
|
|
6386
|
+
const NO = WindowFeatureState.NO;
|
|
6387
|
+
/**
|
|
6388
|
+
* @private
|
|
6389
|
+
*/
|
|
6390
|
+
const FEATURES = {
|
|
6391
|
+
left: 100,
|
|
6392
|
+
top: 100,
|
|
6393
|
+
width: 800,
|
|
6394
|
+
height: 450,
|
|
6395
|
+
directories: NO,
|
|
6396
|
+
titlebar: NO,
|
|
6397
|
+
scrollbars: NO,
|
|
6398
|
+
toolbar: NO,
|
|
6399
|
+
location: NO,
|
|
6400
|
+
status: NO,
|
|
6401
|
+
menubar: NO,
|
|
6402
|
+
title: "HTTP Mocking Framework Console",
|
|
6403
|
+
icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABdJJREFUWEedl3tsU1Ucx7+/e/vYGNs6ZOrawSBsIgwQCC/jJhAgiIkkvkBgBJB2Q4eSoBHwFQaiTsBgdMRBMNEwum5/8EoQAQF5yQQhBB0ZOBSS6cIYsPa269rec8ztY33sru24Sf/o/Z3f93zuOb/f7/wO4WEea/sgQaNfAJmXkKPDyUG7mSjU4fWctr7KUdIO1fcyRYP+ZYCVADQVgADOAIcjKEFeEI6A8xqZ0X6UGV3JaMcHqOZa0eB6DuDKpC8APDVKNAogwsIhAXwvQajxGXKOYR7JvcGoAmhrXVMYKZPy+QAG9volvQFEOVArcWYjUdjtXW68GKsVBqhz5wvcW0IQFgE8P5nli96CxB4ENDHwGsbYHpQNblY8/ACiTbIBeDX0P7FUcERSK6CqxgFeL1ty54cADgOYnfTEoYEPD6AoHJQtprlBAMdOgMxqAMP6E3QEXHPwnuYIgFSRsGBYKqYbddh4ScJ1uy/u93DOt7PS3HI/gFDr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ybqsCS49EpBef4XN07dDZ1EgbMg3BUHvCIhlDQtP9uBv+wRpyHRYdlsnKMOYHPUA/RKyFiYIcD6tB7pWsKbF7vwY2vMsdpLRzT2EQ1GZWnRcMeDG5GT+4Vph2wxlqkCoE56XOR8I0DLlDZBLSOi3vWpJeNezulbpk+vwJKMdnWA0Ns90hhRxBYAs+JCJA1Ae2XO1qI093qsXtyLiVjvnMM530wc3UHTtxXgF2QI78BiPN3bhyS+mq0/oRFGTDITuNIzPpoMAAduEaP35dIcK4jiHg6JAUIz7m7PEDT6dUS0qvuK1mMLeAfn9BnTer7CsqHh3Iuzj8kDhERqOvNEUf4UhAXgjAJpSF7OeTVzuzbg7YI+3ZD7DhACqXNNEmXfVkiOdlnAGiw3qfaUiTLpf29zez9zLqGcAAAAAElFTkSuQmCC"
|
|
6404
|
+
};
|
|
6053
6405
|
/**
|
|
6054
6406
|
* Provides functionality to display the ATX monitoring console within a new window.
|
|
6055
6407
|
*/
|
|
@@ -6057,81 +6409,48 @@ class AtxHttpMockConsoleService {
|
|
|
6057
6409
|
/**
|
|
6058
6410
|
* @private
|
|
6059
6411
|
*/
|
|
6060
|
-
constructor(
|
|
6061
|
-
this.
|
|
6062
|
-
/**
|
|
6063
|
-
* @private
|
|
6064
|
-
*/
|
|
6065
|
-
this._window = null;
|
|
6066
|
-
/**
|
|
6067
|
-
* @private
|
|
6068
|
-
*/
|
|
6069
|
-
this._componentRef = null;
|
|
6412
|
+
constructor(_windowSrv) {
|
|
6413
|
+
this._windowSrv = _windowSrv;
|
|
6070
6414
|
/**
|
|
6071
6415
|
* @private
|
|
6072
6416
|
*/
|
|
6073
|
-
this.
|
|
6074
|
-
window.addEventListener("beforeunload", () => this.beforUnloadHandler());
|
|
6417
|
+
this._uuid = null;
|
|
6075
6418
|
}
|
|
6076
6419
|
/**
|
|
6077
6420
|
* Opens the ATX monitoring console within a new window and returns reference objects
|
|
6078
6421
|
* to control it.
|
|
6079
|
-
*
|
|
6080
|
-
* @returns An `AtxHttpMockConsolePopup` object.
|
|
6081
6422
|
*/
|
|
6082
6423
|
open() {
|
|
6083
|
-
if (this.
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
const popup = window.open(EMPTY_STRING, '_blank', features);
|
|
6087
|
-
this._window = popup;
|
|
6088
|
-
if (!popup)
|
|
6089
|
-
return null;
|
|
6090
|
-
this.createHeadTags(popup);
|
|
6091
|
-
const componentRef = this._appRef.bootstrap(AtxMonitoringConsoleComponent, popup.document.body);
|
|
6092
|
-
this._componentRef = componentRef;
|
|
6093
|
-
return {
|
|
6094
|
-
popup: popup,
|
|
6095
|
-
componentRef: componentRef
|
|
6096
|
-
};
|
|
6424
|
+
if (this._uuid)
|
|
6425
|
+
return;
|
|
6426
|
+
this._uuid = this._windowSrv.open(AtxMonitoringConsoleComponent, FEATURES);
|
|
6097
6427
|
}
|
|
6098
6428
|
/**
|
|
6099
6429
|
* Closes the ATX monitoring console currently opened within a popup window.
|
|
6100
6430
|
*/
|
|
6101
6431
|
close() {
|
|
6102
|
-
if (!this.
|
|
6432
|
+
if (!this._uuid)
|
|
6103
6433
|
return;
|
|
6104
|
-
this.
|
|
6105
|
-
this.
|
|
6106
|
-
this._componentRef?.destroy();
|
|
6107
|
-
this._componentRef = null;
|
|
6108
|
-
}
|
|
6109
|
-
/**
|
|
6110
|
-
* @private
|
|
6111
|
-
*/
|
|
6112
|
-
ngOnDestroy() {
|
|
6113
|
-
this.close();
|
|
6434
|
+
this._windowSrv.close(this._uuid);
|
|
6435
|
+
this._uuid = null;
|
|
6114
6436
|
}
|
|
6115
6437
|
/**
|
|
6116
|
-
*
|
|
6438
|
+
* Returns reference to the opened popup window.
|
|
6439
|
+
*
|
|
6440
|
+
* @returns A `WindowRef` object, or undefined if the ATX monitoring console is not opened.
|
|
6117
6441
|
*/
|
|
6118
|
-
|
|
6119
|
-
this.
|
|
6120
|
-
|
|
6442
|
+
getWindowRef() {
|
|
6443
|
+
if (!this._uuid)
|
|
6444
|
+
return undefined;
|
|
6445
|
+
return this._windowSrv.get(this._uuid);
|
|
6121
6446
|
}
|
|
6122
6447
|
/**
|
|
6123
6448
|
* @private
|
|
6124
6449
|
*/
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
const head = doc.getElementsByTagName('head')[0];
|
|
6128
|
-
const link = doc.createElement('link');
|
|
6129
|
-
link.rel = 'shortcut icon';
|
|
6130
|
-
link.href = this.ICON;
|
|
6131
|
-
head.appendChild(link);
|
|
6132
|
-
doc.title = "HTTP Mocking Framework Console";
|
|
6450
|
+
ngOnDestroy() {
|
|
6451
|
+
this.close();
|
|
6133
6452
|
}
|
|
6134
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: AtxHttpMockConsoleService, deps: [{ token:
|
|
6453
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: AtxHttpMockConsoleService, deps: [{ token: WindowService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6135
6454
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: AtxHttpMockConsoleService, providedIn: 'root' }); }
|
|
6136
6455
|
}
|
|
6137
6456
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: AtxHttpMockConsoleService, decorators: [{
|
|
@@ -6139,7 +6458,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
|
|
|
6139
6458
|
args: [{
|
|
6140
6459
|
providedIn: 'root'
|
|
6141
6460
|
}]
|
|
6142
|
-
}], ctorParameters: () => [{ type:
|
|
6461
|
+
}], ctorParameters: () => [{ type: WindowService }] });
|
|
6143
6462
|
|
|
6144
6463
|
/**
|
|
6145
6464
|
* @license
|
|
@@ -7683,5 +8002,5 @@ const httpMockFactory = () => {
|
|
|
7683
8002
|
* Generated bundle index. Do not edit.
|
|
7684
8003
|
*/
|
|
7685
8004
|
|
|
7686
|
-
export { APP_PRIDGE_REF, ATX_LOGGER_CONFIG, AbstractLogger, AbstractSubscriptionManager, AbstractVersionManager, AnchorLinklDirective, AngularToolboxLogoComponent, AngularToolboxModule, AngularToolboxVersionService, AppBridgeError, AppBridgeService, ArrayList, ArrayListEvent, ArrayListEventType, AtxHttpMockConsoleService, AtxMonitoringConsoleComponent, BIGINT, BOOLEAN, BUTTON_ROLE, ButtonRoleDirective, CSS_PROP, ConsoleLogConnector, ContentRendererDirective, DARK_MODE_CONFIG, DEFAULT_LOG_CONNECTOR, DarkModeService, DefaultLogConnector, EMPTY_STRING, FUNCTION, FetchClient, FetchClientBuilder, FetchClientResponseType, HTTP_MOCKING_FRAMEWORK_CONFIG, HTTP_MOCK_MAX_DELAY, HTTP_MOCK_SERVICE, HtmlLogConnector, HttpHeadersMockBuilder, HttpMock, HttpMockLoggingService, HttpMockProductionPolicy, HttpMockService, HttpMockServiceError, HttpResponseMockBuilder, IdentifiableComponent, IntegrityError, LINK_ROLE, LOG_CONFIG_STRING, LOG_ERROR_STRING, LOG_INFO_STRING, LOG_WARNING_STRING, LogBuilder, LogImpl, LogLevel, LogUtil, LoggerService, NUMBER, NavigateToUrlDirective, OBJECT, STORAGE_KEY, STRING, SYMBOL, SafeHtmlPipe, ScrollService, SubscriptionError, SubscriptionService, UNDEFINED, Uuid, VERSION_CONFIG, VersionService, httpHeadersMock, httpMockFactory, httpResponseMock };
|
|
8005
|
+
export { APP_PRIDGE_REF, ATX_LOGGER_CONFIG, AbstractLogger, AbstractSubscriptionManager, AbstractVersionManager, AbstractWindowService, AnchorLinklDirective, AngularToolboxLogoComponent, AngularToolboxModule, AngularToolboxVersionService, AppBridgeError, AppBridgeService, ArrayList, ArrayListEvent, ArrayListEventType, AtxHttpMockConsoleService, AtxMonitoringConsoleComponent, BIGINT, BOOLEAN, BUTTON_ROLE, ButtonRoleDirective, CSS_PROP, ConsoleLogConnector, ContentRendererDirective, DARK_MODE_CONFIG, DEFAULT_LOG_CONNECTOR, DarkModeService, DefaultLogConnector, EMPTY_STRING, FEATURES, FUNCTION, FetchClient, FetchClientBuilder, FetchClientResponseType, HTTP_MOCKING_FRAMEWORK_CONFIG, HTTP_MOCK_MAX_DELAY, HTTP_MOCK_SERVICE, HtmlLogConnector, HttpHeadersMockBuilder, HttpMock, HttpMockLoggingService, HttpMockProductionPolicy, HttpMockService, HttpMockServiceError, HttpResponseMockBuilder, IdentifiableComponent, IntegrityError, LINK_ROLE, LOG_CONFIG_STRING, LOG_ERROR_STRING, LOG_INFO_STRING, LOG_WARNING_STRING, LogBuilder, LogImpl, LogLevel, LogUtil, LoggerService, NUMBER, NavigateToUrlDirective, OBJECT, STORAGE_KEY, STRING, SYMBOL, SafeHtmlPipe, ScrollService, SubscriptionError, SubscriptionService, UNDEFINED, Uuid, VERSION_CONFIG, VersionService, WindowFeatureState, WindowService, WindowTarget, httpHeadersMock, httpMockFactory, httpResponseMock };
|
|
7687
8006
|
//# sourceMappingURL=angular-toolbox.mjs.map
|