@kuzntsv/uikit 1.0.57 → 1.0.58

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Directive, ElementRef, HostListener, Injectable, InjectionToken, NgZone, Pipe, computed, effect, inject, input, linkedSignal, makeEnvironmentProviders, model, output, signal, viewChild } from "@angular/core";
2
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Directive, ElementRef, HostListener, Injectable, InjectionToken, Injector, NgZone, Pipe, computed, effect, inject, input, linkedSignal, makeEnvironmentProviders, model, output, runInInjectionContext, signal, viewChild } from "@angular/core";
3
3
  import { Router, RouterLink } from "@angular/router";
4
4
  import { ReplaySubject, Subject, Subscription, filter, finalize, forkJoin, map, of, startWith, switchMap, take, tap } from "rxjs";
5
5
  import { API_NAME, AuthService, HIDE_ROLE_MARKER, NotificationService, RoleService, UIKIT_NOTIFICATION_TOKEN } from "@kuzntsv/uikit";
@@ -2736,6 +2736,7 @@ i0.ɵɵngDeclareClassMetadata({
2736
2736
  });
2737
2737
  var BaseSignalPageClass = class BaseSignalPageClass {
2738
2738
  dialog = inject(MatDialog);
2739
+ injector = inject(Injector);
2739
2740
  entityService;
2740
2741
  entityEditComponent;
2741
2742
  extraData;
@@ -2770,13 +2771,13 @@ var BaseSignalPageClass = class BaseSignalPageClass {
2770
2771
  if (!fetchFn) return null;
2771
2772
  this.tableState();
2772
2773
  this.filters();
2773
- return fetchFn();
2774
+ return runInInjectionContext(this.componentInjector || this.injector, () => fetchFn());
2774
2775
  }, ...ngDevMode ? [{ debugName: "dataResource" }] : /* istanbul ignore next */ []);
2775
2776
  countResource = computed(() => {
2776
2777
  const fetchCountFn = this.fnGetCount();
2777
2778
  if (!fetchCountFn) return null;
2778
2779
  this.filters();
2779
- return fetchCountFn();
2780
+ return runInInjectionContext(this.componentInjector || this.injector, () => fetchCountFn());
2780
2781
  }, ...ngDevMode ? [{ debugName: "countResource" }] : /* istanbul ignore next */ []);
2781
2782
  data = computed(() => {
2782
2783
  const rawData = this.dataResource()?.value() || [];
@@ -2790,6 +2791,7 @@ var BaseSignalPageClass = class BaseSignalPageClass {
2790
2791
  const countLoading = this.countResource()?.isLoading() ?? false;
2791
2792
  return dataLoading || countLoading;
2792
2793
  }, ...ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []);
2794
+ componentInjector = null;
2793
2795
  editBtnDisabled = true;
2794
2796
  removeBtnDisabled = true;
2795
2797
  dblClickedEventEnable = true;
@@ -2890,7 +2892,8 @@ var BaseSignalPageClass = class BaseSignalPageClass {
2890
2892
  ngOnDestroy() {
2891
2893
  this.subscription.unsubscribe();
2892
2894
  }
2893
- subscribeToLoadData(fnGetData, fnGetCount, fnMapEntity) {
2895
+ subscribeToLoadData(fnGetData, fnGetCount, fnMapEntity, injector) {
2896
+ if (injector) this.componentInjector = injector;
2894
2897
  this.fnMapEntity.set(fnMapEntity);
2895
2898
  this.fnGetData.set(fnGetData);
2896
2899
  this.fnGetCount.set(fnGetCount);