@stemy/ngx-utils 12.0.2 → 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.
@@ -792,6 +792,7 @@
792
792
  var SCRIPT_PARAMS = new core.InjectionToken("script-params");
793
793
  var ROOT_ELEMENT = new core.InjectionToken("app-root-element");
794
794
  var ERROR_HANDLER = new core.InjectionToken("error-handler-callback");
795
+ var GLOBAL_TEMPLATES = new core.InjectionToken("global-templates");
795
796
  // --- Valued promise ---
796
797
  var ValuedPromise = /** @class */ (function (_super) {
797
798
  __extends(ValuedPromise, _super);
@@ -3453,40 +3454,6 @@
3453
3454
  { type: undefined, decorators: [{ type: core.Inject, args: [LANGUAGE_SERVICE,] }] }
3454
3455
  ]; };
3455
3456
 
3456
- var GlobalTemplateService = /** @class */ (function () {
3457
- function GlobalTemplateService() {
3458
- this.templatesUpdated = new core.EventEmitter();
3459
- this.globalTemplates = {};
3460
- this.componentModifiers = {};
3461
- }
3462
- GlobalTemplateService.prototype.get = function (id, component) {
3463
- var template = this.globalTemplates[id];
3464
- if (!template)
3465
- return null;
3466
- var modifier = this.componentModifiers[id];
3467
- if (ObjectUtils.isFunction(modifier) && component) {
3468
- modifier(component);
3469
- }
3470
- return template;
3471
- };
3472
- GlobalTemplateService.prototype.add = function (id, template) {
3473
- this.globalTemplates[id] = template;
3474
- this.templatesUpdated.emit();
3475
- };
3476
- GlobalTemplateService.prototype.remove = function (id) {
3477
- delete this.globalTemplates[id];
3478
- this.templatesUpdated.emit();
3479
- };
3480
- GlobalTemplateService.prototype.addComponentModifier = function (id, modifier) {
3481
- this.componentModifiers[id] = modifier;
3482
- };
3483
- return GlobalTemplateService;
3484
- }());
3485
- GlobalTemplateService.decorators = [
3486
- { type: core.Injectable }
3487
- ];
3488
- GlobalTemplateService.ctorParameters = function () { return []; };
3489
-
3490
3457
  var IconService = /** @class */ (function () {
3491
3458
  function IconService() {
3492
3459
  this.iconsLoaded = new core.EventEmitter();
@@ -4380,7 +4347,9 @@
4380
4347
  this.templatesUpdated.unsubscribe();
4381
4348
  };
4382
4349
  GlobalTemplatePipe.prototype.transform = function (templateId, component) {
4383
- if (this.cachedTemplate == null || this.cachedTemplateId !== templateId) {
4350
+ if (!templateId)
4351
+ return null;
4352
+ if (this.cachedTemplate === null || this.cachedTemplateId !== templateId) {
4384
4353
  this.cachedTemplateId = templateId;
4385
4354
  this.cachedTemplate = this.globalTemplates.get(templateId, component);
4386
4355
  }
@@ -4395,7 +4364,7 @@
4395
4364
  },] }
4396
4365
  ];
4397
4366
  GlobalTemplatePipe.ctorParameters = function () { return [
4398
- { type: GlobalTemplateService }
4367
+ { type: undefined, decorators: [{ type: core.Inject, args: [GLOBAL_TEMPLATES,] }] }
4399
4368
  ]; };
4400
4369
 
4401
4370
  var GroupByPipe = /** @class */ (function () {
@@ -4937,15 +4906,15 @@
4937
4906
  };
4938
4907
 
4939
4908
  var GlobalTemplateDirective = /** @class */ (function () {
4940
- function GlobalTemplateDirective(globalTemplateService, template) {
4941
- this.globalTemplateService = globalTemplateService;
4909
+ function GlobalTemplateDirective(globalTemplates, template) {
4910
+ this.globalTemplates = globalTemplates;
4942
4911
  this.template = template;
4943
4912
  }
4944
4913
  GlobalTemplateDirective.prototype.ngOnInit = function () {
4945
- this.globalTemplateService.add(this.id, this.template);
4914
+ this.globalTemplates.add(this.id, this.template);
4946
4915
  };
4947
4916
  GlobalTemplateDirective.prototype.ngOnDestroy = function () {
4948
- this.globalTemplateService.remove(this.id);
4917
+ this.globalTemplates.remove(this.id);
4949
4918
  };
4950
4919
  return GlobalTemplateDirective;
4951
4920
  }());
@@ -4955,7 +4924,7 @@
4955
4924
  },] }
4956
4925
  ];
4957
4926
  GlobalTemplateDirective.ctorParameters = function () { return [
4958
- { type: GlobalTemplateService },
4927
+ { type: undefined, decorators: [{ type: core.Inject, args: [GLOBAL_TEMPLATES,] }] },
4959
4928
  { type: core.TemplateRef }
4960
4929
  ]; };
4961
4930
  GlobalTemplateDirective.propDecorators = {
@@ -5761,6 +5730,40 @@
5761
5730
  boundaryLinks: [{ type: core.Input }]
5762
5731
  };
5763
5732
 
5733
+ var GlobalTemplateService = /** @class */ (function () {
5734
+ function GlobalTemplateService() {
5735
+ this.templatesUpdated = new core.EventEmitter();
5736
+ this.globalTemplates = {};
5737
+ this.componentModifiers = {};
5738
+ }
5739
+ GlobalTemplateService.prototype.get = function (id, component) {
5740
+ var template = this.globalTemplates[id];
5741
+ if (!template)
5742
+ return undefined;
5743
+ var modifier = this.componentModifiers[id];
5744
+ if (ObjectUtils.isFunction(modifier) && component) {
5745
+ modifier(component);
5746
+ }
5747
+ return template;
5748
+ };
5749
+ GlobalTemplateService.prototype.add = function (id, template) {
5750
+ this.globalTemplates[id] = template;
5751
+ this.templatesUpdated.emit();
5752
+ };
5753
+ GlobalTemplateService.prototype.remove = function (id) {
5754
+ delete this.globalTemplates[id];
5755
+ this.templatesUpdated.emit();
5756
+ };
5757
+ GlobalTemplateService.prototype.addComponentModifier = function (id, modifier) {
5758
+ this.componentModifiers[id] = modifier;
5759
+ };
5760
+ return GlobalTemplateService;
5761
+ }());
5762
+ GlobalTemplateService.decorators = [
5763
+ { type: core.Injectable }
5764
+ ];
5765
+ GlobalTemplateService.ctorParameters = function () { return []; };
5766
+
5764
5767
  var StickyClassDirective = /** @class */ (function () {
5765
5768
  function StickyClassDirective(events, element, renderer) {
5766
5769
  this.events = events;
@@ -5925,6 +5928,10 @@
5925
5928
  provide: CONFIG_SERVICE,
5926
5929
  useExisting: (!config ? null : config.configService) || ConfigService
5927
5930
  },
5931
+ {
5932
+ provide: GLOBAL_TEMPLATES,
5933
+ useExisting: (!config ? null : config.globalTemplates) || GlobalTemplateService
5934
+ },
5928
5935
  {
5929
5936
  provide: ROOT_ELEMENT,
5930
5937
  useValue: null
@@ -5992,12 +5999,12 @@
5992
5999
  exports.FindPipe = FindPipe;
5993
6000
  exports.FormatNumberPipe = FormatNumberPipe;
5994
6001
  exports.FormatterService = FormatterService;
6002
+ exports.GLOBAL_TEMPLATES = GLOBAL_TEMPLATES;
5995
6003
  exports.GenericValue = GenericValue;
5996
6004
  exports.GetOffsetPipe = GetOffsetPipe;
5997
6005
  exports.GetTypePipe = GetTypePipe;
5998
6006
  exports.GlobalTemplateDirective = GlobalTemplateDirective;
5999
6007
  exports.GlobalTemplatePipe = GlobalTemplatePipe;
6000
- exports.GlobalTemplateService = GlobalTemplateService;
6001
6008
  exports.GroupByPipe = GroupByPipe;
6002
6009
  exports.HttpPromise = HttpPromise;
6003
6010
  exports.ICON_SERVICE = ICON_SERVICE;
@@ -6067,6 +6074,7 @@
6067
6074
  exports["ɵd"] = providers;
6068
6075
  exports["ɵe"] = loadConfig;
6069
6076
  exports["ɵf"] = StickyClassDirective;
6077
+ exports["ɵg"] = GlobalTemplateService;
6070
6078
 
6071
6079
  Object.defineProperty(exports, '__esModule', { value: true });
6072
6080