@wolkabout/commons 0.0.46 → 0.0.48

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.
@@ -57,7 +57,7 @@ import { MatSelectModule } from '@angular/material/select';
57
57
  import * as i12 from '@angular/material/card';
58
58
  import { MatCardModule } from '@angular/material/card';
59
59
  import * as i11 from '@angular/material/icon';
60
- import { MatIconModule } from '@angular/material/icon';
60
+ import { MatIconModule, MatIconRegistry } from '@angular/material/icon';
61
61
  import * as i10 from '@angular/material/table';
62
62
  import { MatTableModule } from '@angular/material/table';
63
63
  import * as i9 from '@angular/material/tabs';
@@ -65,10 +65,12 @@ import { MatTabsModule } from '@angular/material/tabs';
65
65
  import * as i32 from '@angular/cdk/drag-drop';
66
66
  import { DragDropModule } from '@angular/cdk/drag-drop';
67
67
  import * as i0 from '@angular/core';
68
- import { NgModule, InjectionToken, inject, Injectable, Injector, runInInjectionContext, DOCUMENT, Inject, Input, Directive, forwardRef, HostListener, TemplateRef, PLATFORM_ID, Pipe, ViewChild, ContentChild, Optional, Self, Component, input, computed, untracked, signal, viewChild, afterNextRender, effect, output, afterRenderEffect, contentChild } from '@angular/core';
68
+ import { NgModule, InjectionToken, inject, Injectable, DOCUMENT, Inject, Input, Directive, forwardRef, HostListener, TemplateRef, PLATFORM_ID, Pipe, ViewChild, ContentChild, Optional, Self, Component, input, computed, untracked, signal, viewChild, afterNextRender, effect, output, afterRenderEffect, contentChild } from '@angular/core';
69
69
  import { BehaviorSubject, catchError, of, switchMap, EMPTY, tap, filter, map, combineLatestWith, forkJoin, from, distinctUntilChanged, shareReplay, merge, Subject, takeUntil, combineLatest, take, first } from 'rxjs';
70
70
  import { jwtDecode } from 'jwt-decode';
71
71
  import { loadRemoteModule } from '@angular-architects/native-federation';
72
+ import * as i1$3 from '@angular/platform-browser';
73
+ import { DomSanitizer } from '@angular/platform-browser';
72
74
  import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
73
75
  import * as i1 from '@angular/material/snack-bar';
74
76
  import { TonalPalette, Hct, argbFromHex, hexFromArgb } from '@material/material-color-utilities';
@@ -81,8 +83,6 @@ import { NgxEchartsDirective } from 'ngx-echarts';
81
83
  import { NgxMatTimepickerDirective, NgxMatTimepickerComponent } from 'ngx-mat-timepicker';
82
84
  import { GoogleMap } from '@angular/google-maps';
83
85
  import { MarkerClusterer } from '@googlemaps/markerclusterer';
84
- import * as i1$3 from '@angular/platform-browser';
85
- import { DomSanitizer } from '@angular/platform-browser';
86
86
  import { CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
87
87
  import { DndDraggableDirective } from 'ngx-drag-drop';
88
88
  import { MatSlideToggle } from '@angular/material/slide-toggle';
@@ -511,8 +511,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
511
511
  }]
512
512
  }] });
513
513
 
514
+ class IconRegistryService {
515
+ matIconRegistry = inject(MatIconRegistry);
516
+ domSanitizer = inject(DomSanitizer);
517
+ registerIcon(name, path) {
518
+ this.matIconRegistry.addSvgIcon(name, this.domSanitizer.bypassSecurityTrustResourceUrl(path));
519
+ }
520
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: IconRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
521
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: IconRegistryService, providedIn: 'root' });
522
+ }
523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: IconRegistryService, decorators: [{
524
+ type: Injectable,
525
+ args: [{ providedIn: 'root' }]
526
+ }] });
527
+
514
528
  class FeatureRegistry {
515
- injector = inject(Injector);
529
+ iconRegistryService = inject(IconRegistryService);
530
+ assetManagerService = inject(AssetManager);
516
531
  loadedFeatures = [];
517
532
  _features$ = new BehaviorSubject([]);
518
533
  /**
@@ -545,8 +560,9 @@ class FeatureRegistry {
545
560
  }
546
561
  registerFeature(feature) {
547
562
  this.loadedFeatures.push(feature);
548
- if (feature.init) {
549
- runInInjectionContext(this.injector, feature.init);
563
+ if (feature.iconPath) {
564
+ const assetLocation = this.assetManagerService.getAssetLocation(feature.app);
565
+ this.iconRegistryService.registerIcon(feature.icon.id, assetLocation + '/' + feature.iconPath);
550
566
  }
551
567
  console.info('Loaded feature: ', feature.name);
552
568
  }