@stemy/ngx-utils 13.3.2 → 13.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.
@@ -16,7 +16,7 @@ import { HttpClient, HttpHeaders, HttpParams, HttpUrlEncodingCodec, HttpEventTyp
16
16
  import * as JSON5 from 'json5';
17
17
  import * as i1$2 from '@angular/platform-browser';
18
18
  import { ɵDomEventsPlugin, EVENT_MANAGER_PLUGINS } from '@angular/platform-browser';
19
- import * as detector from 'resize-detector';
19
+ import elementResizeDetectorMaker from 'element-resize-detector';
20
20
  import * as i4 from '@angular/forms';
21
21
  import { FormsModule } from '@angular/forms';
22
22
 
@@ -432,6 +432,7 @@ const CONFIG_SERVICE = new InjectionToken("config-service");
432
432
  const BASE_CONFIG = new InjectionToken("base-config");
433
433
  const SCRIPT_PARAMS = new InjectionToken("script-params");
434
434
  const ROOT_ELEMENT = new InjectionToken("app-root-element");
435
+ const RESIZE_DELAY = new InjectionToken("resize-event-delay");
435
436
  const ERROR_HANDLER = new InjectionToken("error-handler-callback");
436
437
  const GLOBAL_TEMPLATES = new InjectionToken("global-templates");
437
438
  // --- Valued promise ---
@@ -3522,9 +3523,13 @@ function emptyRemove$1() {
3522
3523
  function isWindow(el) {
3523
3524
  return typeof window !== "undefined" && el === window;
3524
3525
  }
3526
+ const detector = elementResizeDetectorMaker({
3527
+ strategy: "scroll" // For ultra performance.
3528
+ });
3525
3529
  class ResizeEventPlugin extends ɵDomEventsPlugin {
3526
- constructor(doc, universal) {
3530
+ constructor(doc, resizeDelay, universal) {
3527
3531
  super(doc);
3532
+ this.resizeDelay = resizeDelay;
3528
3533
  this.universal = universal;
3529
3534
  }
3530
3535
  supports(eventName) {
@@ -3535,14 +3540,17 @@ class ResizeEventPlugin extends ɵDomEventsPlugin {
3535
3540
  return zone.runOutsideAngular(() => {
3536
3541
  if (this.universal.isServer)
3537
3542
  return emptyRemove$1;
3543
+ const timer = TimerUtils.createTimeout();
3538
3544
  const cb = el => {
3539
- zone.run(() => handler(el));
3545
+ timer.set(() => {
3546
+ zone.run(() => handler(el));
3547
+ }, this.resizeDelay);
3540
3548
  };
3541
3549
  if (isWindow(element)) {
3542
3550
  element.addEventListener(eventName, cb);
3543
3551
  }
3544
3552
  else {
3545
- detector.addListener(element, cb);
3553
+ detector.listenTo(element, cb);
3546
3554
  }
3547
3555
  return () => {
3548
3556
  try {
@@ -3550,23 +3558,29 @@ class ResizeEventPlugin extends ɵDomEventsPlugin {
3550
3558
  element.removeEventListener(eventName, cb);
3551
3559
  }
3552
3560
  else {
3553
- detector.removeListener(element, cb);
3561
+ detector.uninstall(element);
3554
3562
  }
3555
3563
  }
3556
3564
  catch (e) {
3557
3565
  }
3566
+ finally {
3567
+ timer.clear();
3568
+ }
3558
3569
  };
3559
3570
  });
3560
3571
  }
3561
3572
  }
3562
3573
  ResizeEventPlugin.EVENT_NAME = "resize";
3563
- ResizeEventPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ResizeEventPlugin, deps: [{ token: DOCUMENT }, { token: UniversalService }], target: i0.ɵɵFactoryTarget.Injectable });
3574
+ ResizeEventPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ResizeEventPlugin, deps: [{ token: DOCUMENT }, { token: RESIZE_DELAY }, { token: UniversalService }], target: i0.ɵɵFactoryTarget.Injectable });
3564
3575
  ResizeEventPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ResizeEventPlugin });
3565
3576
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ResizeEventPlugin, decorators: [{
3566
3577
  type: Injectable
3567
3578
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
3568
3579
  type: Inject,
3569
3580
  args: [DOCUMENT]
3581
+ }] }, { type: undefined, decorators: [{
3582
+ type: Inject,
3583
+ args: [RESIZE_DELAY]
3570
3584
  }] }, { type: UniversalService }]; } });
3571
3585
 
3572
3586
  function emptyRemove() {
@@ -5563,6 +5577,10 @@ class NgxUtilsModule {
5563
5577
  provide: ROOT_ELEMENT,
5564
5578
  useValue: null
5565
5579
  },
5580
+ {
5581
+ provide: RESIZE_DELAY,
5582
+ useValue: (!config ? null : config.resizeDelay) ?? 200,
5583
+ },
5566
5584
  {
5567
5585
  provide: APP_INITIALIZER,
5568
5586
  useFactory: (!config ? null : config.initializeApp) || loadConfig,
@@ -5611,5 +5629,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
5611
5629
  * Generated bundle index. Do not edit.
5612
5630
  */
5613
5631
 
5614
- export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, 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, FileSystemEntry, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService };
5632
+ export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, 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, FileSystemEntry, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService };
5615
5633
  //# sourceMappingURL=stemy-ngx-utils.mjs.map