@stemy/ngx-utils 17.3.16 → 17.4.1

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.
@@ -3066,12 +3066,12 @@ class ConfigService {
3066
3066
  return "";
3067
3067
  return decodeURIComponent(results[2].replace(/\+/g, " "));
3068
3068
  }
3069
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ConfigService, deps: [{ token: i1$1.HttpClient }, { token: UniversalService }, { token: i0.Injector }, { token: ROOT_ELEMENT }, { token: APP_BASE_URL }, { token: BASE_CONFIG, optional: true }, { token: SCRIPT_PARAMS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
3069
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ConfigService, deps: [{ token: BaseHttpClient }, { token: UniversalService }, { token: i0.Injector }, { token: ROOT_ELEMENT }, { token: APP_BASE_URL }, { token: BASE_CONFIG, optional: true }, { token: SCRIPT_PARAMS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
3070
3070
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ConfigService }); }
3071
3071
  }
3072
3072
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ConfigService, decorators: [{
3073
3073
  type: Injectable
3074
- }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: UniversalService }, { type: i0.Injector }, { type: undefined, decorators: [{
3074
+ }], ctorParameters: () => [{ type: BaseHttpClient }, { type: UniversalService }, { type: i0.Injector }, { type: undefined, decorators: [{
3075
3075
  type: Inject,
3076
3076
  args: [ROOT_ELEMENT]
3077
3077
  }] }, { type: undefined, decorators: [{
@@ -3723,6 +3723,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
3723
3723
  args: [NgZone]
3724
3724
  }] }] });
3725
3725
 
3726
+ class ResizeDetector {
3727
+ constructor(resizeStrategy) {
3728
+ this.resizeStrategy = resizeStrategy;
3729
+ this.detector = elementResizeDetectorMaker({
3730
+ strategy: resizeStrategy === "observer" ? "object" : resizeStrategy
3731
+ });
3732
+ this.isObservable = resizeStrategy === "observer" && typeof ResizeObserver === "function";
3733
+ this.observers = new Map();
3734
+ }
3735
+ listenTo(elem, cb) {
3736
+ if (!this.isObservable) {
3737
+ this.detector.listenTo(elem, cb);
3738
+ return;
3739
+ }
3740
+ if (this.observers.has(elem))
3741
+ return;
3742
+ const observer = new ResizeObserver(() => {
3743
+ requestAnimationFrame(() => {
3744
+ cb(elem);
3745
+ });
3746
+ });
3747
+ observer.observe(elem);
3748
+ this.observers.set(elem, observer);
3749
+ }
3750
+ uninstall(elem) {
3751
+ if (!this.isObservable) {
3752
+ this.detector.uninstall(elem);
3753
+ return;
3754
+ }
3755
+ if (!this.observers.has(elem))
3756
+ return;
3757
+ const observer = this.observers.get(elem);
3758
+ observer.unobserve(elem);
3759
+ this.observers.delete(elem);
3760
+ }
3761
+ }
3762
+
3726
3763
  function emptyRemove$1() {
3727
3764
  }
3728
3765
  function isWindow(el) {
@@ -3735,9 +3772,7 @@ class ResizeEventPlugin extends _DomEventsPlugin {
3735
3772
  this.resizeDelay = resizeDelay;
3736
3773
  this.resizeStrategy = resizeStrategy;
3737
3774
  this.universal = universal;
3738
- this.detector = elementResizeDetectorMaker({
3739
- strategy: resizeStrategy
3740
- });
3775
+ this.detector = new ResizeDetector(resizeStrategy);
3741
3776
  }
3742
3777
  supports(eventName) {
3743
3778
  return eventName === ResizeEventPlugin.EVENT_NAME;
@@ -3748,7 +3783,7 @@ class ResizeEventPlugin extends _DomEventsPlugin {
3748
3783
  if (this.universal.isServer)
3749
3784
  return emptyRemove$1;
3750
3785
  const timer = TimerUtils.createTimeout();
3751
- const cb = el => {
3786
+ const cb = (el) => {
3752
3787
  timer.set(() => {
3753
3788
  zone.run(() => handler(el));
3754
3789
  }, this.resizeDelay);
@@ -6355,7 +6390,7 @@ class NgxUtilsModule {
6355
6390
  },
6356
6391
  {
6357
6392
  provide: RESIZE_STRATEGY,
6358
- useValue: (!config ? null : config.resizeStrategy) ?? "object",
6393
+ useValue: (!config ? null : config.resizeStrategy) ?? "observer",
6359
6394
  },
6360
6395
  {
6361
6396
  provide: APP_INITIALIZER,