@stemy/ngx-utils 12.0.0 → 12.0.3
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/stemy-ngx-utils.umd.js +259 -220
- package/bundles/stemy-ngx-utils.umd.js.map +1 -1
- package/esm2015/ngx-utils/common-types.js +2 -1
- package/esm2015/ngx-utils/directives/global-template.directive.js +8 -8
- package/esm2015/ngx-utils/ngx-utils.module.js +6 -2
- package/esm2015/ngx-utils/pipes/global-template.pipe.js +7 -5
- package/esm2015/ngx-utils/plugins/resize-event.plugin.js +16 -19
- package/esm2015/ngx-utils/plugins/scroll-event.plugin.js +1 -17
- package/esm2015/ngx-utils/services/global-template.service.js +2 -2
- package/esm2015/ngx-utils/services/state.service.js +53 -15
- package/esm2015/public_api.js +2 -3
- package/esm2015/stemy-ngx-utils.js +2 -1
- package/fesm2015/stemy-ngx-utils.js +187 -160
- package/fesm2015/stemy-ngx-utils.js.map +1 -1
- package/ngx-utils/common-types.d.ts +12 -1
- package/ngx-utils/directives/global-template.directive.d.ts +3 -3
- package/ngx-utils/ngx-utils.module.d.ts +1 -1
- package/ngx-utils/pipes/global-template.pipe.d.ts +3 -3
- package/ngx-utils/plugins/resize-event.plugin.d.ts +0 -1
- package/ngx-utils/plugins/scroll-event.plugin.d.ts +0 -1
- package/ngx-utils/services/global-template.service.d.ts +2 -2
- package/ngx-utils/services/state.service.d.ts +11 -6
- package/package.json +1 -1
- package/public_api.d.ts +1 -2
- package/stemy-ngx-utils.d.ts +1 -0
- package/stemy-ngx-utils.metadata.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InjectionToken, TemplateRef, Injectable,
|
|
1
|
+
import { InjectionToken, TemplateRef, Injectable, Inject, PLATFORM_ID, Injector, NgZone, Optional, EventEmitter, ErrorHandler, Pipe, ChangeDetectorRef, Directive, Input, Output, HostBinding, HostListener, ElementRef, Renderer2, ViewContainerRef, Component, ContentChildren, ViewChild, ContentChild, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
3
|
import { utc } from 'moment';
|
|
4
4
|
import { first, skipWhile, mergeMap, timeout, map } from 'rxjs/operators';
|
|
@@ -414,6 +414,7 @@ const BASE_CONFIG = new InjectionToken("base-config");
|
|
|
414
414
|
const SCRIPT_PARAMS = new InjectionToken("script-params");
|
|
415
415
|
const ROOT_ELEMENT = new InjectionToken("app-root-element");
|
|
416
416
|
const ERROR_HANDLER = new InjectionToken("error-handler-callback");
|
|
417
|
+
const GLOBAL_TEMPLATES = new InjectionToken("global-templates");
|
|
417
418
|
// --- Valued promise ---
|
|
418
419
|
class ValuedPromise extends Promise {
|
|
419
420
|
}
|
|
@@ -1198,16 +1199,89 @@ class MathUtils {
|
|
|
1198
1199
|
}
|
|
1199
1200
|
}
|
|
1200
1201
|
|
|
1202
|
+
/**
|
|
1203
|
+
* Use this service to determine which is the current environment
|
|
1204
|
+
*/
|
|
1205
|
+
class UniversalService {
|
|
1206
|
+
constructor(platformId, dds) {
|
|
1207
|
+
this.platformId = platformId;
|
|
1208
|
+
this.dds = dds;
|
|
1209
|
+
const info = this.dds.getDeviceInfo();
|
|
1210
|
+
this.crawler = /(bot|google|baidu|bing|msn|duckduckbot|teoma|slurp|yandex|lighthouse|angular-universal|PTST)/gi.test(info.userAgent);
|
|
1211
|
+
}
|
|
1212
|
+
get isBrowser() {
|
|
1213
|
+
return isPlatformBrowser(this.platformId);
|
|
1214
|
+
}
|
|
1215
|
+
get isServer() {
|
|
1216
|
+
return isPlatformServer(this.platformId);
|
|
1217
|
+
}
|
|
1218
|
+
get deviceInfo() {
|
|
1219
|
+
return this.isServer
|
|
1220
|
+
? {
|
|
1221
|
+
userAgent: "angular-universal",
|
|
1222
|
+
os: "unknown",
|
|
1223
|
+
browser: "node",
|
|
1224
|
+
device: "node",
|
|
1225
|
+
os_version: "unknown",
|
|
1226
|
+
browser_version: "unknown",
|
|
1227
|
+
deviceType: "unknown",
|
|
1228
|
+
orientation: "landscape"
|
|
1229
|
+
}
|
|
1230
|
+
: this.dds.getDeviceInfo();
|
|
1231
|
+
}
|
|
1232
|
+
get browserName() {
|
|
1233
|
+
return this.dds.browser;
|
|
1234
|
+
}
|
|
1235
|
+
get browserVersion() {
|
|
1236
|
+
return this.dds.browser_version;
|
|
1237
|
+
}
|
|
1238
|
+
get isExplorer() {
|
|
1239
|
+
return this.dds.browser == "ie";
|
|
1240
|
+
}
|
|
1241
|
+
get isEdge() {
|
|
1242
|
+
return this.dds.browser == "ms-edge";
|
|
1243
|
+
}
|
|
1244
|
+
get isChrome() {
|
|
1245
|
+
return this.dds.browser == "chrome";
|
|
1246
|
+
}
|
|
1247
|
+
get isFirefox() {
|
|
1248
|
+
return this.dds.browser == "firefox";
|
|
1249
|
+
}
|
|
1250
|
+
get isSafari() {
|
|
1251
|
+
return this.dds.browser == "safari";
|
|
1252
|
+
}
|
|
1253
|
+
get isTablet() {
|
|
1254
|
+
return this.dds.isTablet();
|
|
1255
|
+
}
|
|
1256
|
+
get isMobile() {
|
|
1257
|
+
return this.dds.isMobile();
|
|
1258
|
+
}
|
|
1259
|
+
get isDesktop() {
|
|
1260
|
+
return this.dds.isDesktop();
|
|
1261
|
+
}
|
|
1262
|
+
get isCrawler() {
|
|
1263
|
+
return this.crawler;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
UniversalService.decorators = [
|
|
1267
|
+
{ type: Injectable }
|
|
1268
|
+
];
|
|
1269
|
+
UniversalService.ctorParameters = () => [
|
|
1270
|
+
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
|
|
1271
|
+
{ type: DeviceDetectorService }
|
|
1272
|
+
];
|
|
1273
|
+
|
|
1201
1274
|
const emptySnapshot = new ActivatedRouteSnapshot();
|
|
1202
1275
|
const emptyData = { id: "" };
|
|
1203
1276
|
const emptyParams = {};
|
|
1204
1277
|
const emptySegments = [];
|
|
1205
1278
|
const emptyComponents = [];
|
|
1206
1279
|
class StateService extends BehaviorSubject {
|
|
1207
|
-
constructor(injector, zone, router = null) {
|
|
1280
|
+
constructor(injector, zone, universal, router = null) {
|
|
1208
1281
|
super(null);
|
|
1209
1282
|
this.injector = injector;
|
|
1210
1283
|
this.zone = zone;
|
|
1284
|
+
this.universal = universal;
|
|
1211
1285
|
this.router = router;
|
|
1212
1286
|
this.handleRouterEvent = (event) => {
|
|
1213
1287
|
if (!(event instanceof NavigationEnd))
|
|
@@ -1305,26 +1379,61 @@ class StateService extends BehaviorSubject {
|
|
|
1305
1379
|
}
|
|
1306
1380
|
});
|
|
1307
1381
|
}
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
return
|
|
1311
|
-
|
|
1312
|
-
const tree = this.router.createUrlTree(commands, extras);
|
|
1313
|
-
return this.navigateByUrl(tree, extras);
|
|
1382
|
+
navigateByUrl(url, navigationExtras = {}) {
|
|
1383
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1384
|
+
return this.navigate(url, navigationExtras);
|
|
1385
|
+
});
|
|
1314
1386
|
}
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
this.zone.run(() => {
|
|
1321
|
-
this.router.navigateByUrl(
|
|
1387
|
+
navigate(url, navigationExtras = {}) {
|
|
1388
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1389
|
+
if (!this.router)
|
|
1390
|
+
return false;
|
|
1391
|
+
const [tree, extras] = this.createUrlTree(url, navigationExtras);
|
|
1392
|
+
return this.zone.run(() => {
|
|
1393
|
+
return this.router.navigateByUrl(tree, extras);
|
|
1394
|
+
});
|
|
1395
|
+
});
|
|
1396
|
+
}
|
|
1397
|
+
open(url, target = "_blank", navigationExtras = {}) {
|
|
1398
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1399
|
+
if (!this.router)
|
|
1400
|
+
return false;
|
|
1401
|
+
const [tree, extras] = this.createUrlTree(url, navigationExtras);
|
|
1402
|
+
return this.zone.run(() => {
|
|
1403
|
+
return this.openInNewWindow(tree, target) || this.router.navigateByUrl(tree, extras);
|
|
1322
1404
|
});
|
|
1323
1405
|
});
|
|
1324
1406
|
}
|
|
1325
1407
|
subscribeImmediately(next, error, complete) {
|
|
1326
1408
|
return this.pipe(skipWhile(v => v == null)).subscribe(next, error, complete);
|
|
1327
1409
|
}
|
|
1410
|
+
openInNewWindow(tree, target) {
|
|
1411
|
+
if (!this.universal.isBrowser)
|
|
1412
|
+
return false;
|
|
1413
|
+
const baseUrl = window.location.href.replace(this.router.url, "");
|
|
1414
|
+
try {
|
|
1415
|
+
const serialized = this.router.serializeUrl(tree);
|
|
1416
|
+
const separator = serialized.startsWith("/") ? "" : "/";
|
|
1417
|
+
window.open(baseUrl + separator + serialized, target);
|
|
1418
|
+
return true;
|
|
1419
|
+
}
|
|
1420
|
+
catch (e) {
|
|
1421
|
+
console.log(`Can't open new window: ${e}`);
|
|
1422
|
+
return false;
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
createUrlTree(url, extras) {
|
|
1426
|
+
if (!this.router)
|
|
1427
|
+
return null;
|
|
1428
|
+
extras = Object.assign(extras, this.globalExtras, extras || {});
|
|
1429
|
+
if (ObjectUtils.isArray(url)) {
|
|
1430
|
+
return [this.router.createUrlTree(url, extras), extras];
|
|
1431
|
+
}
|
|
1432
|
+
if (ObjectUtils.isString(url)) {
|
|
1433
|
+
return [this.router.parseUrl(url), extras];
|
|
1434
|
+
}
|
|
1435
|
+
return [url, extras];
|
|
1436
|
+
}
|
|
1328
1437
|
}
|
|
1329
1438
|
StateService.decorators = [
|
|
1330
1439
|
{ type: Injectable }
|
|
@@ -1332,6 +1441,7 @@ StateService.decorators = [
|
|
|
1332
1441
|
StateService.ctorParameters = () => [
|
|
1333
1442
|
{ type: Injector },
|
|
1334
1443
|
{ type: NgZone },
|
|
1444
|
+
{ type: UniversalService },
|
|
1335
1445
|
{ type: Router, decorators: [{ type: Optional }] }
|
|
1336
1446
|
];
|
|
1337
1447
|
|
|
@@ -1843,78 +1953,6 @@ class Vector {
|
|
|
1843
1953
|
}
|
|
1844
1954
|
}
|
|
1845
1955
|
|
|
1846
|
-
/**
|
|
1847
|
-
* Use this service to determine which is the current environment
|
|
1848
|
-
*/
|
|
1849
|
-
class UniversalService {
|
|
1850
|
-
constructor(platformId, dds) {
|
|
1851
|
-
this.platformId = platformId;
|
|
1852
|
-
this.dds = dds;
|
|
1853
|
-
const info = this.dds.getDeviceInfo();
|
|
1854
|
-
this.crawler = /(bot|google|baidu|bing|msn|duckduckbot|teoma|slurp|yandex|lighthouse|angular-universal|PTST)/gi.test(info.userAgent);
|
|
1855
|
-
}
|
|
1856
|
-
get isBrowser() {
|
|
1857
|
-
return isPlatformBrowser(this.platformId);
|
|
1858
|
-
}
|
|
1859
|
-
get isServer() {
|
|
1860
|
-
return isPlatformServer(this.platformId);
|
|
1861
|
-
}
|
|
1862
|
-
get deviceInfo() {
|
|
1863
|
-
return this.isServer
|
|
1864
|
-
? {
|
|
1865
|
-
userAgent: "angular-universal",
|
|
1866
|
-
os: "unknown",
|
|
1867
|
-
browser: "node",
|
|
1868
|
-
device: "node",
|
|
1869
|
-
os_version: "unknown",
|
|
1870
|
-
browser_version: "unknown",
|
|
1871
|
-
deviceType: "unknown",
|
|
1872
|
-
orientation: "landscape"
|
|
1873
|
-
}
|
|
1874
|
-
: this.dds.getDeviceInfo();
|
|
1875
|
-
}
|
|
1876
|
-
get browserName() {
|
|
1877
|
-
return this.dds.browser;
|
|
1878
|
-
}
|
|
1879
|
-
get browserVersion() {
|
|
1880
|
-
return this.dds.browser_version;
|
|
1881
|
-
}
|
|
1882
|
-
get isExplorer() {
|
|
1883
|
-
return this.dds.browser == "ie";
|
|
1884
|
-
}
|
|
1885
|
-
get isEdge() {
|
|
1886
|
-
return this.dds.browser == "ms-edge";
|
|
1887
|
-
}
|
|
1888
|
-
get isChrome() {
|
|
1889
|
-
return this.dds.browser == "chrome";
|
|
1890
|
-
}
|
|
1891
|
-
get isFirefox() {
|
|
1892
|
-
return this.dds.browser == "firefox";
|
|
1893
|
-
}
|
|
1894
|
-
get isSafari() {
|
|
1895
|
-
return this.dds.browser == "safari";
|
|
1896
|
-
}
|
|
1897
|
-
get isTablet() {
|
|
1898
|
-
return this.dds.isTablet();
|
|
1899
|
-
}
|
|
1900
|
-
get isMobile() {
|
|
1901
|
-
return this.dds.isMobile();
|
|
1902
|
-
}
|
|
1903
|
-
get isDesktop() {
|
|
1904
|
-
return this.dds.isDesktop();
|
|
1905
|
-
}
|
|
1906
|
-
get isCrawler() {
|
|
1907
|
-
return this.crawler;
|
|
1908
|
-
}
|
|
1909
|
-
}
|
|
1910
|
-
UniversalService.decorators = [
|
|
1911
|
-
{ type: Injectable }
|
|
1912
|
-
];
|
|
1913
|
-
UniversalService.ctorParameters = () => [
|
|
1914
|
-
{ type: String, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
|
|
1915
|
-
{ type: DeviceDetectorService }
|
|
1916
|
-
];
|
|
1917
|
-
|
|
1918
1956
|
const emptyGuards = [];
|
|
1919
1957
|
class AclService {
|
|
1920
1958
|
constructor(injector, state, auth) {
|
|
@@ -2615,39 +2653,6 @@ FormatterService.ctorParameters = () => [
|
|
|
2615
2653
|
{ type: undefined, decorators: [{ type: Inject, args: [LANGUAGE_SERVICE,] }] }
|
|
2616
2654
|
];
|
|
2617
2655
|
|
|
2618
|
-
class GlobalTemplateService {
|
|
2619
|
-
constructor() {
|
|
2620
|
-
this.templatesUpdated = new EventEmitter();
|
|
2621
|
-
this.globalTemplates = {};
|
|
2622
|
-
this.componentModifiers = {};
|
|
2623
|
-
}
|
|
2624
|
-
get(id, component) {
|
|
2625
|
-
const template = this.globalTemplates[id];
|
|
2626
|
-
if (!template)
|
|
2627
|
-
return null;
|
|
2628
|
-
const modifier = this.componentModifiers[id];
|
|
2629
|
-
if (ObjectUtils.isFunction(modifier) && component) {
|
|
2630
|
-
modifier(component);
|
|
2631
|
-
}
|
|
2632
|
-
return template;
|
|
2633
|
-
}
|
|
2634
|
-
add(id, template) {
|
|
2635
|
-
this.globalTemplates[id] = template;
|
|
2636
|
-
this.templatesUpdated.emit();
|
|
2637
|
-
}
|
|
2638
|
-
remove(id) {
|
|
2639
|
-
delete this.globalTemplates[id];
|
|
2640
|
-
this.templatesUpdated.emit();
|
|
2641
|
-
}
|
|
2642
|
-
addComponentModifier(id, modifier) {
|
|
2643
|
-
this.componentModifiers[id] = modifier;
|
|
2644
|
-
}
|
|
2645
|
-
}
|
|
2646
|
-
GlobalTemplateService.decorators = [
|
|
2647
|
-
{ type: Injectable }
|
|
2648
|
-
];
|
|
2649
|
-
GlobalTemplateService.ctorParameters = () => [];
|
|
2650
|
-
|
|
2651
2656
|
class IconService {
|
|
2652
2657
|
constructor() {
|
|
2653
2658
|
this.iconsLoaded = new EventEmitter();
|
|
@@ -3114,6 +3119,9 @@ PromiseService.ctorParameters = () => [
|
|
|
3114
3119
|
|
|
3115
3120
|
function emptyRemove$1() {
|
|
3116
3121
|
}
|
|
3122
|
+
function isWindow(el) {
|
|
3123
|
+
return typeof window !== "undefined" && el === window;
|
|
3124
|
+
}
|
|
3117
3125
|
class ResizeEventPlugin extends ɵangular_packages_platform_browser_platform_browser_g {
|
|
3118
3126
|
constructor(doc, universal) {
|
|
3119
3127
|
super(doc);
|
|
@@ -3130,31 +3138,26 @@ class ResizeEventPlugin extends ɵangular_packages_platform_browser_platform_bro
|
|
|
3130
3138
|
const cb = el => {
|
|
3131
3139
|
zone.run(() => handler(el));
|
|
3132
3140
|
};
|
|
3133
|
-
|
|
3141
|
+
if (isWindow(element)) {
|
|
3142
|
+
element.addEventListener(eventName, cb);
|
|
3143
|
+
}
|
|
3144
|
+
else {
|
|
3145
|
+
addListener(element, cb);
|
|
3146
|
+
}
|
|
3134
3147
|
return () => {
|
|
3135
3148
|
try {
|
|
3136
|
-
|
|
3149
|
+
if (isWindow(element)) {
|
|
3150
|
+
element.removeEventListener(eventName, cb);
|
|
3151
|
+
}
|
|
3152
|
+
else {
|
|
3153
|
+
removeListener(element, cb);
|
|
3154
|
+
}
|
|
3137
3155
|
}
|
|
3138
3156
|
catch (e) {
|
|
3139
3157
|
}
|
|
3140
3158
|
};
|
|
3141
3159
|
});
|
|
3142
3160
|
}
|
|
3143
|
-
addGlobalEventListener(element, eventName, handler) {
|
|
3144
|
-
const zone = this.manager.getZone();
|
|
3145
|
-
return zone.runOutsideAngular(() => {
|
|
3146
|
-
if (this.universal.isServer)
|
|
3147
|
-
return emptyRemove$1;
|
|
3148
|
-
if (!StringUtils.has(element, "document", "window")) {
|
|
3149
|
-
console.error("Global resize event other than window or document?", element);
|
|
3150
|
-
return emptyRemove$1;
|
|
3151
|
-
}
|
|
3152
|
-
const target = "window" == element ? window : document;
|
|
3153
|
-
const listener = handler;
|
|
3154
|
-
target.addEventListener(eventName, listener);
|
|
3155
|
-
return () => target.removeEventListener(eventName, listener);
|
|
3156
|
-
});
|
|
3157
|
-
}
|
|
3158
3161
|
}
|
|
3159
3162
|
ResizeEventPlugin.EVENT_NAME = "resize";
|
|
3160
3163
|
ResizeEventPlugin.decorators = [
|
|
@@ -3187,21 +3190,6 @@ class ScrollEventPlugin extends ɵangular_packages_platform_browser_platform_bro
|
|
|
3187
3190
|
return () => element.removeEventListener(eventName, callback);
|
|
3188
3191
|
});
|
|
3189
3192
|
}
|
|
3190
|
-
addGlobalEventListener(element, eventName, handler) {
|
|
3191
|
-
const zone = this.manager.getZone();
|
|
3192
|
-
return zone.runOutsideAngular(() => {
|
|
3193
|
-
if (this.universal.isServer)
|
|
3194
|
-
return emptyRemove;
|
|
3195
|
-
if (!StringUtils.has(element, "document", "window")) {
|
|
3196
|
-
console.error("Global resize event other than window or document?", element);
|
|
3197
|
-
return emptyRemove;
|
|
3198
|
-
}
|
|
3199
|
-
const target = "window" == element ? window : document;
|
|
3200
|
-
const listener = handler;
|
|
3201
|
-
target.addEventListener(eventName, listener);
|
|
3202
|
-
return () => target.removeEventListener(eventName, listener);
|
|
3203
|
-
});
|
|
3204
|
-
}
|
|
3205
3193
|
}
|
|
3206
3194
|
ScrollEventPlugin.EVENT_NAME = "scroll";
|
|
3207
3195
|
ScrollEventPlugin.decorators = [
|
|
@@ -3393,7 +3381,9 @@ class GlobalTemplatePipe {
|
|
|
3393
3381
|
this.templatesUpdated.unsubscribe();
|
|
3394
3382
|
}
|
|
3395
3383
|
transform(templateId, component) {
|
|
3396
|
-
if (
|
|
3384
|
+
if (!templateId)
|
|
3385
|
+
return null;
|
|
3386
|
+
if (this.cachedTemplate === null || this.cachedTemplateId !== templateId) {
|
|
3397
3387
|
this.cachedTemplateId = templateId;
|
|
3398
3388
|
this.cachedTemplate = this.globalTemplates.get(templateId, component);
|
|
3399
3389
|
}
|
|
@@ -3407,7 +3397,7 @@ GlobalTemplatePipe.decorators = [
|
|
|
3407
3397
|
},] }
|
|
3408
3398
|
];
|
|
3409
3399
|
GlobalTemplatePipe.ctorParameters = () => [
|
|
3410
|
-
{ type:
|
|
3400
|
+
{ type: undefined, decorators: [{ type: Inject, args: [GLOBAL_TEMPLATES,] }] }
|
|
3411
3401
|
];
|
|
3412
3402
|
|
|
3413
3403
|
class GroupByPipe {
|
|
@@ -3874,15 +3864,15 @@ DynamicTableTemplateDirective.propDecorators = {
|
|
|
3874
3864
|
};
|
|
3875
3865
|
|
|
3876
3866
|
class GlobalTemplateDirective {
|
|
3877
|
-
constructor(
|
|
3878
|
-
this.
|
|
3867
|
+
constructor(globalTemplates, template) {
|
|
3868
|
+
this.globalTemplates = globalTemplates;
|
|
3879
3869
|
this.template = template;
|
|
3880
3870
|
}
|
|
3881
3871
|
ngOnInit() {
|
|
3882
|
-
this.
|
|
3872
|
+
this.globalTemplates.add(this.id, this.template);
|
|
3883
3873
|
}
|
|
3884
3874
|
ngOnDestroy() {
|
|
3885
|
-
this.
|
|
3875
|
+
this.globalTemplates.remove(this.id);
|
|
3886
3876
|
}
|
|
3887
3877
|
}
|
|
3888
3878
|
GlobalTemplateDirective.decorators = [
|
|
@@ -3891,7 +3881,7 @@ GlobalTemplateDirective.decorators = [
|
|
|
3891
3881
|
},] }
|
|
3892
3882
|
];
|
|
3893
3883
|
GlobalTemplateDirective.ctorParameters = () => [
|
|
3894
|
-
{ type:
|
|
3884
|
+
{ type: undefined, decorators: [{ type: Inject, args: [GLOBAL_TEMPLATES,] }] },
|
|
3895
3885
|
{ type: TemplateRef }
|
|
3896
3886
|
];
|
|
3897
3887
|
GlobalTemplateDirective.propDecorators = {
|
|
@@ -4601,6 +4591,39 @@ PaginationMenuComponent.propDecorators = {
|
|
|
4601
4591
|
boundaryLinks: [{ type: Input }]
|
|
4602
4592
|
};
|
|
4603
4593
|
|
|
4594
|
+
class GlobalTemplateService {
|
|
4595
|
+
constructor() {
|
|
4596
|
+
this.templatesUpdated = new EventEmitter();
|
|
4597
|
+
this.globalTemplates = {};
|
|
4598
|
+
this.componentModifiers = {};
|
|
4599
|
+
}
|
|
4600
|
+
get(id, component) {
|
|
4601
|
+
const template = this.globalTemplates[id];
|
|
4602
|
+
if (!template)
|
|
4603
|
+
return undefined;
|
|
4604
|
+
const modifier = this.componentModifiers[id];
|
|
4605
|
+
if (ObjectUtils.isFunction(modifier) && component) {
|
|
4606
|
+
modifier(component);
|
|
4607
|
+
}
|
|
4608
|
+
return template;
|
|
4609
|
+
}
|
|
4610
|
+
add(id, template) {
|
|
4611
|
+
this.globalTemplates[id] = template;
|
|
4612
|
+
this.templatesUpdated.emit();
|
|
4613
|
+
}
|
|
4614
|
+
remove(id) {
|
|
4615
|
+
delete this.globalTemplates[id];
|
|
4616
|
+
this.templatesUpdated.emit();
|
|
4617
|
+
}
|
|
4618
|
+
addComponentModifier(id, modifier) {
|
|
4619
|
+
this.componentModifiers[id] = modifier;
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
GlobalTemplateService.decorators = [
|
|
4623
|
+
{ type: Injectable }
|
|
4624
|
+
];
|
|
4625
|
+
GlobalTemplateService.ctorParameters = () => [];
|
|
4626
|
+
|
|
4604
4627
|
class StickyClassDirective {
|
|
4605
4628
|
constructor(events, element, renderer) {
|
|
4606
4629
|
this.events = events;
|
|
@@ -4763,6 +4786,10 @@ class NgxUtilsModule {
|
|
|
4763
4786
|
provide: CONFIG_SERVICE,
|
|
4764
4787
|
useExisting: (!config ? null : config.configService) || ConfigService
|
|
4765
4788
|
},
|
|
4789
|
+
{
|
|
4790
|
+
provide: GLOBAL_TEMPLATES,
|
|
4791
|
+
useExisting: (!config ? null : config.globalTemplates) || GlobalTemplateService
|
|
4792
|
+
},
|
|
4766
4793
|
{
|
|
4767
4794
|
provide: ROOT_ELEMENT,
|
|
4768
4795
|
useValue: null
|
|
@@ -4802,5 +4829,5 @@ NgxUtilsModule.decorators = [
|
|
|
4802
4829
|
* Generated bundle index. Do not edit.
|
|
4803
4830
|
*/
|
|
4804
4831
|
|
|
4805
|
-
export { API_SERVICE, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe,
|
|
4832
|
+
export { API_SERVICE, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PromiseService, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, StateService, StaticAuthService, StaticLanguageService, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector, pipes as ɵa, directives as ɵb, components as ɵc, providers as ɵd, loadConfig as ɵe, StickyClassDirective as ɵf, GlobalTemplateService as ɵg };
|
|
4806
4833
|
//# sourceMappingURL=stemy-ngx-utils.js.map
|