angular-toolbox 1.1.1 → 1.2.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/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 +44 -0
- package/esm2022/lib/model/service/ui/window/index.mjs +3 -0
- package/esm2022/lib/model/service/ui/window/window.service.mjs +97 -0
- package/esm2022/lib/model/service/version/angular-toolbox-version.service.mjs +4 -4
- 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 +371 -57
- 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 +60 -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:
|
|
547
|
-
patch:
|
|
548
|
-
buildTimestamp:
|
|
546
|
+
minor: 2,
|
|
547
|
+
patch: 0,
|
|
548
|
+
buildTimestamp: 1725808881311
|
|
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,259 @@ 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
|
+
* @private
|
|
2180
|
+
*/
|
|
2181
|
+
this.windowRefMap = new Map();
|
|
2182
|
+
}
|
|
2183
|
+
/**
|
|
2184
|
+
* Returns the window reference object associated with the specified `Uuid` object.
|
|
2185
|
+
*
|
|
2186
|
+
* @param uuid The `Uuid` object associated with the window reference to get.
|
|
2187
|
+
*
|
|
2188
|
+
* @returns A `WindowRef` object, or `undefined` if the reference cannot be found.
|
|
2189
|
+
*/
|
|
2190
|
+
get(uuid) {
|
|
2191
|
+
return this.windowRefMap.get(uuid);
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* Returns all the window reference objects created by the service.
|
|
2195
|
+
*
|
|
2196
|
+
* @returns A list of `WindowRef` objects created by this service.
|
|
2197
|
+
*/
|
|
2198
|
+
getAll() {
|
|
2199
|
+
return Array.from(this.windowRefMap.values());
|
|
2200
|
+
}
|
|
2201
|
+
/**
|
|
2202
|
+
* @private
|
|
2203
|
+
*/
|
|
2204
|
+
destroy() {
|
|
2205
|
+
this.windowRefMap.clear();
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
/**
|
|
2210
|
+
* @license
|
|
2211
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
2212
|
+
*
|
|
2213
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
2214
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
2215
|
+
*/
|
|
2216
|
+
/**
|
|
2217
|
+
* A static builder that creates the features associated with a popup window created by
|
|
2218
|
+
* the `WindowService.open()` method.
|
|
2219
|
+
*/
|
|
2220
|
+
class BrowserWindowFeaturesBuilder {
|
|
2221
|
+
/**
|
|
2222
|
+
* Builds a string that represents the features parameter of the `Window.open()` method.
|
|
2223
|
+
*
|
|
2224
|
+
* @param init A `WindowInit` object that contains data to initialize the features string.
|
|
2225
|
+
*
|
|
2226
|
+
* @returns A string that represents the features parameter of the `Window.open()` method.
|
|
2227
|
+
*/
|
|
2228
|
+
static build(init) {
|
|
2229
|
+
if (!init)
|
|
2230
|
+
return "popup=true,left=100,top=100,width=800,height=450";
|
|
2231
|
+
let features = "popup=true";
|
|
2232
|
+
features += BrowserWindowFeaturesBuilder.getLeft(init);
|
|
2233
|
+
features += BrowserWindowFeaturesBuilder.getTop(init);
|
|
2234
|
+
features += BrowserWindowFeaturesBuilder.getWidth(init);
|
|
2235
|
+
features += BrowserWindowFeaturesBuilder.getHeight(init);
|
|
2236
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("directories", init);
|
|
2237
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("titlebar", init);
|
|
2238
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("scrollbars", init);
|
|
2239
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("toolbar", init);
|
|
2240
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("location", init);
|
|
2241
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("status", init);
|
|
2242
|
+
features += BrowserWindowFeaturesBuilder.getPopupProp("menubar", init);
|
|
2243
|
+
return features;
|
|
2244
|
+
}
|
|
2245
|
+
/**
|
|
2246
|
+
* @private
|
|
2247
|
+
*/
|
|
2248
|
+
static getLeft(init) {
|
|
2249
|
+
const v = init?.left;
|
|
2250
|
+
return ",left=" + (v || 100);
|
|
2251
|
+
}
|
|
2252
|
+
/**
|
|
2253
|
+
* @private
|
|
2254
|
+
*/
|
|
2255
|
+
static getTop(init) {
|
|
2256
|
+
const v = init?.top;
|
|
2257
|
+
return ",top=" + (v || 100);
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* @private
|
|
2261
|
+
*/
|
|
2262
|
+
static getWidth(init) {
|
|
2263
|
+
const v = init?.width;
|
|
2264
|
+
return ",width=" + (v || 800);
|
|
2265
|
+
}
|
|
2266
|
+
/**
|
|
2267
|
+
* @private
|
|
2268
|
+
*/
|
|
2269
|
+
static getHeight(init) {
|
|
2270
|
+
const v = init?.height;
|
|
2271
|
+
return ",height=" + (v || 450);
|
|
2272
|
+
}
|
|
2273
|
+
/**
|
|
2274
|
+
* @private
|
|
2275
|
+
*/
|
|
2276
|
+
static getPopupProp(property, init) {
|
|
2277
|
+
if (!init)
|
|
2278
|
+
return EMPTY_STRING;
|
|
2279
|
+
const v = init[property];
|
|
2280
|
+
if (!v)
|
|
2281
|
+
return EMPTY_STRING;
|
|
2282
|
+
return `,${property}=${v}`;
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
/**
|
|
2287
|
+
* @license
|
|
2288
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
2289
|
+
*
|
|
2290
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
2291
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
2292
|
+
*/
|
|
2293
|
+
/**
|
|
2294
|
+
* A static utility class that creates header tags for windows created by the `WindowService.open()` method.
|
|
2295
|
+
*/
|
|
2296
|
+
class WindowHeaderTagUtil {
|
|
2297
|
+
/**
|
|
2298
|
+
* Sets the title of the specified window if defined in the `WindowInit` config object.
|
|
2299
|
+
*
|
|
2300
|
+
* @param win The window for which to set the title.
|
|
2301
|
+
* @param init The `WindowInit` config object used to initialize the window.
|
|
2302
|
+
*/
|
|
2303
|
+
static setTitle(win, init) {
|
|
2304
|
+
const title = init?.title;
|
|
2305
|
+
if (!title)
|
|
2306
|
+
return;
|
|
2307
|
+
win.document.title = title;
|
|
2308
|
+
}
|
|
2309
|
+
/**
|
|
2310
|
+
* Sets the icon of the specified window if defined in the `WindowInit` config object.
|
|
2311
|
+
*
|
|
2312
|
+
* @param win The window for which to set the icon.
|
|
2313
|
+
* @param init The `WindowInit` config object used to initialize the window.
|
|
2314
|
+
*/
|
|
2315
|
+
static setIcon(win, init) {
|
|
2316
|
+
const icon = init?.icon;
|
|
2317
|
+
if (!icon)
|
|
2318
|
+
return;
|
|
2319
|
+
const doc = win.document;
|
|
2320
|
+
const head = doc.getElementsByTagName('head')[0];
|
|
2321
|
+
const link = doc.createElement('link');
|
|
2322
|
+
link.rel = 'shortcut icon';
|
|
2323
|
+
link.href = icon;
|
|
2324
|
+
head.appendChild(link);
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
/**
|
|
2329
|
+
* @license
|
|
2330
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
2331
|
+
*
|
|
2332
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
2333
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
2334
|
+
*/
|
|
2335
|
+
/**
|
|
2336
|
+
* Provides functionality to display Angular component within a new browser window.
|
|
2337
|
+
*/
|
|
2338
|
+
class WindowService extends AbstractWindowService {
|
|
2339
|
+
/**
|
|
2340
|
+
* @private
|
|
2341
|
+
*/
|
|
2342
|
+
constructor(_appRef) {
|
|
2343
|
+
super();
|
|
2344
|
+
this._appRef = _appRef;
|
|
2345
|
+
window.addEventListener("beforeunload", () => this.beforUnloadHandler());
|
|
2346
|
+
}
|
|
2347
|
+
/**
|
|
2348
|
+
* @inheritdoc
|
|
2349
|
+
*/
|
|
2350
|
+
open(component, init) {
|
|
2351
|
+
const id = Uuid.build();
|
|
2352
|
+
const features = BrowserWindowFeaturesBuilder.build(init);
|
|
2353
|
+
const win = window.open(EMPTY_STRING, this.getTarget(init), features);
|
|
2354
|
+
WindowHeaderTagUtil.setTitle(win, init);
|
|
2355
|
+
WindowHeaderTagUtil.setIcon(win, init);
|
|
2356
|
+
const componentRef = this._appRef.bootstrap(component, win.document.body);
|
|
2357
|
+
const winRef = {
|
|
2358
|
+
window: win,
|
|
2359
|
+
componentRef: componentRef
|
|
2360
|
+
};
|
|
2361
|
+
this.windowRefMap.set(id, winRef);
|
|
2362
|
+
return id;
|
|
2363
|
+
}
|
|
2364
|
+
/**
|
|
2365
|
+
* @inheritdoc
|
|
2366
|
+
*/
|
|
2367
|
+
close(uuid) {
|
|
2368
|
+
const winRef = this.windowRefMap.get(uuid);
|
|
2369
|
+
if (!winRef)
|
|
2370
|
+
return false;
|
|
2371
|
+
this.windowRefMap.delete(uuid);
|
|
2372
|
+
winRef.window.close();
|
|
2373
|
+
winRef.window = null;
|
|
2374
|
+
winRef.componentRef.destroy();
|
|
2375
|
+
winRef.componentRef;
|
|
2376
|
+
return true;
|
|
2377
|
+
}
|
|
2378
|
+
/**
|
|
2379
|
+
* @inheritdoc
|
|
2380
|
+
*/
|
|
2381
|
+
closeAll() {
|
|
2382
|
+
const keys = this.windowRefMap.keys();
|
|
2383
|
+
for (const key of keys)
|
|
2384
|
+
this.close(key);
|
|
2385
|
+
}
|
|
2386
|
+
/**
|
|
2387
|
+
* @private
|
|
2388
|
+
*/
|
|
2389
|
+
ngOnDestroy() {
|
|
2390
|
+
this.closeAll();
|
|
2391
|
+
this.destroy();
|
|
2392
|
+
}
|
|
2393
|
+
/**
|
|
2394
|
+
* @private
|
|
2395
|
+
*/
|
|
2396
|
+
beforUnloadHandler() {
|
|
2397
|
+
this.ngOnDestroy();
|
|
2398
|
+
window.removeEventListener("beforeunload", () => this.beforUnloadHandler());
|
|
2399
|
+
}
|
|
2400
|
+
/**
|
|
2401
|
+
* @private
|
|
2402
|
+
*/
|
|
2403
|
+
getTarget(init) {
|
|
2404
|
+
if (init)
|
|
2405
|
+
return init.target || WindowTarget.BLANK;
|
|
2406
|
+
return WindowTarget.BLANK;
|
|
2407
|
+
}
|
|
2408
|
+
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 }); }
|
|
2409
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: WindowService, providedIn: 'root' }); }
|
|
2410
|
+
}
|
|
2411
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: WindowService, decorators: [{
|
|
2412
|
+
type: Injectable,
|
|
2413
|
+
args: [{
|
|
2414
|
+
providedIn: 'root'
|
|
2415
|
+
}]
|
|
2416
|
+
}], ctorParameters: () => [{ type: i0.ApplicationRef }] });
|
|
2417
|
+
|
|
2093
2418
|
/**
|
|
2094
2419
|
* @license
|
|
2095
2420
|
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
@@ -6050,6 +6375,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
|
|
|
6050
6375
|
* Use of this source code is governed by an MIT-style license that can be found in
|
|
6051
6376
|
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
6052
6377
|
*/
|
|
6378
|
+
/**
|
|
6379
|
+
* @private
|
|
6380
|
+
*/
|
|
6381
|
+
const NO = WindowFeatureState.NO;
|
|
6382
|
+
/**
|
|
6383
|
+
* @private
|
|
6384
|
+
*/
|
|
6385
|
+
const FEATURES = {
|
|
6386
|
+
left: 100,
|
|
6387
|
+
top: 100,
|
|
6388
|
+
width: 800,
|
|
6389
|
+
height: 450,
|
|
6390
|
+
directories: NO,
|
|
6391
|
+
titlebar: NO,
|
|
6392
|
+
scrollbars: NO,
|
|
6393
|
+
toolbar: NO,
|
|
6394
|
+
location: NO,
|
|
6395
|
+
status: NO,
|
|
6396
|
+
menubar: NO,
|
|
6397
|
+
title: "HTTP Mocking Framework Console",
|
|
6398
|
+
icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABdJJREFUWEedl3tsU1Ucx7+/e/vYGNs6ZOrawSBsIgwQCC/jJhAgiIkkvkBgBJB2Q4eSoBHwFQaiTsBgdMRBMNEwum5/8EoQAQF5yQQhBB0ZOBSS6cIYsPa269rec8ztY33sru24Sf/o/Z3f93zuOb/f7/wO4WEea/sgQaNfAJmXkKPDyUG7mSjU4fWctr7KUdIO1fcyRYP+ZYCVADQVgADOAIcjKEFeEI6A8xqZ0X6UGV3JaMcHqOZa0eB6DuDKpC8APDVKNAogwsIhAXwvQajxGXKOYR7JvcGoAmhrXVMYKZPy+QAG9volvQFEOVArcWYjUdjtXW68GKsVBqhz5wvcW0IQFgE8P5nli96CxB4ENDHwGsbYHpQNblY8/ACiTbIBeDX0P7FUcERSK6CqxgFeL1ty54cADgOYnfTEoYEPD6AoHJQtprlBAMdOgMxqAMP6E3QEXHPwnuYIgFSRsGBYKqYbddh4ScJ1uy/u93DOt7PS3HI/gFDr+JiIKmI98vsTfp6WiuwUwrYmLzY1euCMjOcgQHaKgC1TMpCbJuLqPS9Wn7eDqfBG6nOOtazUVBlYgVr7MpDwXSzAOIOA87NS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zT2EQ1GZWnRcMeDG5GT+4Vph2wxlqkCoE56XOR8I0DLlDZBLSOi3vWpJeNezulbpk+vwJKMdnWA0Ns90hhRxBYAs+JCJA1Ae2XO1qI093qsXtyLiVjvnMM530wc3UHTtxXgF2QI78BiPN3bhyS+mq0/oRFGTDITuNIzPpoMAAduEaP35dIcK4jiHg6JAUIz7m7PEDT6dUS0qvuK1mMLeAfn9BnTer7CsqHh3Iuzj8kDhERqOvNEUf4UhAXgjAJpSF7OeTVzuzbg7YI+3ZD7DhACqXNNEmXfVkiOdlnAGiw3qfaUiTLpf29zez9zLqGcAAAAAElFTkSuQmCC"
|
|
6399
|
+
};
|
|
6053
6400
|
/**
|
|
6054
6401
|
* Provides functionality to display the ATX monitoring console within a new window.
|
|
6055
6402
|
*/
|
|
@@ -6057,81 +6404,48 @@ class AtxHttpMockConsoleService {
|
|
|
6057
6404
|
/**
|
|
6058
6405
|
* @private
|
|
6059
6406
|
*/
|
|
6060
|
-
constructor(
|
|
6061
|
-
this.
|
|
6062
|
-
/**
|
|
6063
|
-
* @private
|
|
6064
|
-
*/
|
|
6065
|
-
this._window = null;
|
|
6066
|
-
/**
|
|
6067
|
-
* @private
|
|
6068
|
-
*/
|
|
6069
|
-
this._componentRef = null;
|
|
6407
|
+
constructor(_windowSrv) {
|
|
6408
|
+
this._windowSrv = _windowSrv;
|
|
6070
6409
|
/**
|
|
6071
6410
|
* @private
|
|
6072
6411
|
*/
|
|
6073
|
-
this.
|
|
6074
|
-
window.addEventListener("beforeunload", () => this.beforUnloadHandler());
|
|
6412
|
+
this._uuid = null;
|
|
6075
6413
|
}
|
|
6076
6414
|
/**
|
|
6077
6415
|
* Opens the ATX monitoring console within a new window and returns reference objects
|
|
6078
6416
|
* to control it.
|
|
6079
|
-
*
|
|
6080
|
-
* @returns An `AtxHttpMockConsolePopup` object.
|
|
6081
6417
|
*/
|
|
6082
6418
|
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
|
-
};
|
|
6419
|
+
if (this._uuid)
|
|
6420
|
+
return;
|
|
6421
|
+
this._uuid = this._windowSrv.open(AtxMonitoringConsoleComponent, FEATURES);
|
|
6097
6422
|
}
|
|
6098
6423
|
/**
|
|
6099
6424
|
* Closes the ATX monitoring console currently opened within a popup window.
|
|
6100
6425
|
*/
|
|
6101
6426
|
close() {
|
|
6102
|
-
if (!this.
|
|
6427
|
+
if (!this._uuid)
|
|
6103
6428
|
return;
|
|
6104
|
-
this.
|
|
6105
|
-
this.
|
|
6106
|
-
this._componentRef?.destroy();
|
|
6107
|
-
this._componentRef = null;
|
|
6108
|
-
}
|
|
6109
|
-
/**
|
|
6110
|
-
* @private
|
|
6111
|
-
*/
|
|
6112
|
-
ngOnDestroy() {
|
|
6113
|
-
this.close();
|
|
6429
|
+
this._windowSrv.close(this._uuid);
|
|
6430
|
+
this._uuid = null;
|
|
6114
6431
|
}
|
|
6115
6432
|
/**
|
|
6116
|
-
*
|
|
6433
|
+
* Returns reference to the opened popup window.
|
|
6434
|
+
*
|
|
6435
|
+
* @returns A `WindowRef` object, or undefined if the ATX monitoring console is not opened.
|
|
6117
6436
|
*/
|
|
6118
|
-
|
|
6119
|
-
this.
|
|
6120
|
-
|
|
6437
|
+
getWindowRef() {
|
|
6438
|
+
if (!this._uuid)
|
|
6439
|
+
return undefined;
|
|
6440
|
+
return this._windowSrv.get(this._uuid);
|
|
6121
6441
|
}
|
|
6122
6442
|
/**
|
|
6123
6443
|
* @private
|
|
6124
6444
|
*/
|
|
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";
|
|
6445
|
+
ngOnDestroy() {
|
|
6446
|
+
this.close();
|
|
6133
6447
|
}
|
|
6134
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: AtxHttpMockConsoleService, deps: [{ token:
|
|
6448
|
+
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
6449
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: AtxHttpMockConsoleService, providedIn: 'root' }); }
|
|
6136
6450
|
}
|
|
6137
6451
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: AtxHttpMockConsoleService, decorators: [{
|
|
@@ -6139,7 +6453,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
|
|
|
6139
6453
|
args: [{
|
|
6140
6454
|
providedIn: 'root'
|
|
6141
6455
|
}]
|
|
6142
|
-
}], ctorParameters: () => [{ type:
|
|
6456
|
+
}], ctorParameters: () => [{ type: WindowService }] });
|
|
6143
6457
|
|
|
6144
6458
|
/**
|
|
6145
6459
|
* @license
|
|
@@ -7683,5 +7997,5 @@ const httpMockFactory = () => {
|
|
|
7683
7997
|
* Generated bundle index. Do not edit.
|
|
7684
7998
|
*/
|
|
7685
7999
|
|
|
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 };
|
|
8000
|
+
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
8001
|
//# sourceMappingURL=angular-toolbox.mjs.map
|