@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.
@@ -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
  }
@@ -2652,39 +2653,6 @@ FormatterService.ctorParameters = () => [
2652
2653
  { type: undefined, decorators: [{ type: Inject, args: [LANGUAGE_SERVICE,] }] }
2653
2654
  ];
2654
2655
 
2655
- class GlobalTemplateService {
2656
- constructor() {
2657
- this.templatesUpdated = new EventEmitter();
2658
- this.globalTemplates = {};
2659
- this.componentModifiers = {};
2660
- }
2661
- get(id, component) {
2662
- const template = this.globalTemplates[id];
2663
- if (!template)
2664
- return null;
2665
- const modifier = this.componentModifiers[id];
2666
- if (ObjectUtils.isFunction(modifier) && component) {
2667
- modifier(component);
2668
- }
2669
- return template;
2670
- }
2671
- add(id, template) {
2672
- this.globalTemplates[id] = template;
2673
- this.templatesUpdated.emit();
2674
- }
2675
- remove(id) {
2676
- delete this.globalTemplates[id];
2677
- this.templatesUpdated.emit();
2678
- }
2679
- addComponentModifier(id, modifier) {
2680
- this.componentModifiers[id] = modifier;
2681
- }
2682
- }
2683
- GlobalTemplateService.decorators = [
2684
- { type: Injectable }
2685
- ];
2686
- GlobalTemplateService.ctorParameters = () => [];
2687
-
2688
2656
  class IconService {
2689
2657
  constructor() {
2690
2658
  this.iconsLoaded = new EventEmitter();
@@ -3413,7 +3381,9 @@ class GlobalTemplatePipe {
3413
3381
  this.templatesUpdated.unsubscribe();
3414
3382
  }
3415
3383
  transform(templateId, component) {
3416
- if (this.cachedTemplate == null || this.cachedTemplateId !== templateId) {
3384
+ if (!templateId)
3385
+ return null;
3386
+ if (this.cachedTemplate === null || this.cachedTemplateId !== templateId) {
3417
3387
  this.cachedTemplateId = templateId;
3418
3388
  this.cachedTemplate = this.globalTemplates.get(templateId, component);
3419
3389
  }
@@ -3427,7 +3397,7 @@ GlobalTemplatePipe.decorators = [
3427
3397
  },] }
3428
3398
  ];
3429
3399
  GlobalTemplatePipe.ctorParameters = () => [
3430
- { type: GlobalTemplateService }
3400
+ { type: undefined, decorators: [{ type: Inject, args: [GLOBAL_TEMPLATES,] }] }
3431
3401
  ];
3432
3402
 
3433
3403
  class GroupByPipe {
@@ -3894,15 +3864,15 @@ DynamicTableTemplateDirective.propDecorators = {
3894
3864
  };
3895
3865
 
3896
3866
  class GlobalTemplateDirective {
3897
- constructor(globalTemplateService, template) {
3898
- this.globalTemplateService = globalTemplateService;
3867
+ constructor(globalTemplates, template) {
3868
+ this.globalTemplates = globalTemplates;
3899
3869
  this.template = template;
3900
3870
  }
3901
3871
  ngOnInit() {
3902
- this.globalTemplateService.add(this.id, this.template);
3872
+ this.globalTemplates.add(this.id, this.template);
3903
3873
  }
3904
3874
  ngOnDestroy() {
3905
- this.globalTemplateService.remove(this.id);
3875
+ this.globalTemplates.remove(this.id);
3906
3876
  }
3907
3877
  }
3908
3878
  GlobalTemplateDirective.decorators = [
@@ -3911,7 +3881,7 @@ GlobalTemplateDirective.decorators = [
3911
3881
  },] }
3912
3882
  ];
3913
3883
  GlobalTemplateDirective.ctorParameters = () => [
3914
- { type: GlobalTemplateService },
3884
+ { type: undefined, decorators: [{ type: Inject, args: [GLOBAL_TEMPLATES,] }] },
3915
3885
  { type: TemplateRef }
3916
3886
  ];
3917
3887
  GlobalTemplateDirective.propDecorators = {
@@ -4621,6 +4591,39 @@ PaginationMenuComponent.propDecorators = {
4621
4591
  boundaryLinks: [{ type: Input }]
4622
4592
  };
4623
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
+
4624
4627
  class StickyClassDirective {
4625
4628
  constructor(events, element, renderer) {
4626
4629
  this.events = events;
@@ -4783,6 +4786,10 @@ class NgxUtilsModule {
4783
4786
  provide: CONFIG_SERVICE,
4784
4787
  useExisting: (!config ? null : config.configService) || ConfigService
4785
4788
  },
4789
+ {
4790
+ provide: GLOBAL_TEMPLATES,
4791
+ useExisting: (!config ? null : config.globalTemplates) || GlobalTemplateService
4792
+ },
4786
4793
  {
4787
4794
  provide: ROOT_ELEMENT,
4788
4795
  useValue: null
@@ -4822,5 +4829,5 @@ NgxUtilsModule.decorators = [
4822
4829
  * Generated bundle index. Do not edit.
4823
4830
  */
4824
4831
 
4825
- 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, GlobalTemplateService, 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 };
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 };
4826
4833
  //# sourceMappingURL=stemy-ngx-utils.js.map