@ssv/ngx.ux 3.3.0-dev.76 → 3.3.0-dev.82

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.
package/README.md CHANGED
@@ -17,6 +17,7 @@ Choose the version corresponding to your Angular version:
17
17
 
18
18
  | Angular | library |
19
19
  | ------- | ------- |
20
+ | 17+ | 4.x+ |
20
21
  | 17+ | 3.x+ |
21
22
  | 10+ | 2.x+ |
22
23
  | 4 to 9 | 1.x+ |
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Injectable, makeEnvironmentProviders, ChangeDetectorRef, Pipe, ViewContainerRef, TemplateRef, Directive, Input, Renderer2, NgModule } from '@angular/core';
3
- import { fromEvent, map, share, auditTime, of, startWith, distinctUntilChanged, shareReplay, Subscription, tap, Subject, ReplaySubject, combineLatest, takeUntil, filter, pairwise } from 'rxjs';
4
- import { toSignal } from '@angular/core/rxjs-interop';
2
+ import { InjectionToken, inject, Injectable, makeEnvironmentProviders, ChangeDetectorRef, DestroyRef, Pipe, ViewContainerRef, TemplateRef, Directive, Input, Renderer2, NgModule } from '@angular/core';
3
+ import { fromEvent, map, share, auditTime, of, startWith, distinctUntilChanged, shareReplay, Subscription, tap, ReplaySubject, combineLatest, Subject, filter, pairwise } from 'rxjs';
4
+ import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
5
 
6
6
  var ViewportDataMatchStrategy;
7
7
  (function (ViewportDataMatchStrategy) {
@@ -566,6 +566,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
566
566
  class ViewportDataPipe {
567
567
  #viewportData = inject(ViewportDataService);
568
568
  #cdr = inject(ChangeDetectorRef);
569
+ #destroyRef = inject(DestroyRef);
569
570
  markForTransform = true;
570
571
  value;
571
572
  data;
@@ -582,13 +583,10 @@ class ViewportDataPipe {
582
583
  this.markForTransform = true;
583
584
  this.value = value;
584
585
  this.#cdr.markForCheck();
585
- })).subscribe();
586
+ }), takeUntilDestroyed(this.#destroyRef)).subscribe();
586
587
  this.markForTransform = false;
587
588
  return this.value;
588
589
  }
589
- ngOnDestroy() {
590
- this.data$$.unsubscribe();
591
- }
592
590
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: ViewportDataPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
593
591
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.7", ngImport: i0, type: ViewportDataPipe, isStandalone: true, name: "ssvViewportData", pure: false });
594
592
  }
@@ -608,13 +606,13 @@ class SsvViewportMatcherVarContext {
608
606
  this.$implicit = $implicit;
609
607
  }
610
608
  }
611
- class SsvViewportMatcherVarDirective {
609
+ class SsvViewportMatcherVar {
612
610
  #viewport = inject(ViewportService);
613
611
  #viewContainer = inject(ViewContainerRef);
614
612
  #templateRef = inject(TemplateRef);
613
+ #destroyRef = inject(DestroyRef);
615
614
  _matchConditions = {};
616
615
  _context = new SsvViewportMatcherVarContext();
617
- _destroy$ = new Subject();
618
616
  _update$ = new ReplaySubject(1);
619
617
  _viewRef;
620
618
  set condition(value) {
@@ -635,20 +633,16 @@ class SsvViewportMatcherVarDirective {
635
633
  }
636
634
  ngOnInit() {
637
635
  this.updateView();
638
- combineLatest([this.#viewport.sizeType$, this._update$]).pipe(map(([sizeType]) => isViewportConditionMatch(sizeType, this._matchConditions, this.#viewport.sizeTypeMap)), tap(x => this._context.$implicit = x), tap(() => this._viewRef.markForCheck()), takeUntil(this._destroy$)).subscribe();
639
- }
640
- ngOnDestroy() {
641
- this._destroy$.next();
642
- this._destroy$.complete();
636
+ combineLatest([this.#viewport.sizeType$, this._update$]).pipe(map(([sizeType]) => isViewportConditionMatch(sizeType, this._matchConditions, this.#viewport.sizeTypeMap)), tap(x => this._context.$implicit = x), tap(() => this._viewRef.markForCheck()), takeUntilDestroyed(this.#destroyRef)).subscribe();
643
637
  }
644
638
  updateView() {
645
639
  this.#viewContainer.clear();
646
640
  this._viewRef = this.#viewContainer.createEmbeddedView(this.#templateRef, this._context);
647
641
  }
648
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvViewportMatcherVarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
649
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.7", type: SsvViewportMatcherVarDirective, isStandalone: true, selector: "[ssvViewportMatcherVar]", inputs: { condition: ["ssvViewportMatcherVarWhen", "condition"] }, ngImport: i0 });
642
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvViewportMatcherVar, deps: [], target: i0.ɵɵFactoryTarget.Directive });
643
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.7", type: SsvViewportMatcherVar, isStandalone: true, selector: "[ssvViewportMatcherVar]", inputs: { condition: ["ssvViewportMatcherVarWhen", "condition"] }, ngImport: i0 });
650
644
  }
651
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvViewportMatcherVarDirective, decorators: [{
645
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvViewportMatcherVar, decorators: [{
652
646
  type: Directive,
653
647
  args: [{
654
648
  selector: `[${NAME_CAMEL}]`,
@@ -664,19 +658,18 @@ class SsvViewportMatcherContext {
664
658
  sizeTypeExclude = null;
665
659
  expression;
666
660
  }
667
- class SsvViewportMatcherDirective {
661
+ class SsvViewportMatcher {
668
662
  #viewport = inject(ViewportService);
669
663
  #renderer = inject(Renderer2);
670
664
  #viewContainer = inject(ViewContainerRef);
671
665
  #cdr = inject(ChangeDetectorRef);
666
+ #destroyRef = inject(DestroyRef);
672
667
  sizeInfo;
673
668
  _context = new SsvViewportMatcherContext();
674
669
  _thenTemplateRef = null;
675
670
  _elseTemplateRef = null;
676
671
  _thenViewRef = null;
677
672
  _elseViewRef = null;
678
- sizeType$$ = Subscription.EMPTY;
679
- cssClass$$ = Subscription.EMPTY;
680
673
  _update$ = new Subject();
681
674
  set ssvViewportMatcher(value) {
682
675
  if (isViewportSizeMatcherExpression(value)) {
@@ -712,6 +705,9 @@ class SsvViewportMatcherDirective {
712
705
  constructor() {
713
706
  const templateRef = inject(TemplateRef);
714
707
  this._thenTemplateRef = templateRef;
708
+ this.#destroyRef.onDestroy(() => {
709
+ this._update$.complete();
710
+ });
715
711
  }
716
712
  ngOnInit() {
717
713
  // console.log("ssvViewportMatcher init");
@@ -723,12 +719,12 @@ class SsvViewportMatcherDirective {
723
719
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
724
720
  tap(() => this._updateView(this.sizeInfo)), tap(() => this.#cdr.markForCheck()))
725
721
  .subscribe();
726
- this.sizeType$$ = this.#viewport.sizeType$
722
+ this.#viewport.sizeType$
727
723
  .pipe(
728
724
  // tap(x => console.log("ssvViewportMatcher - sizeType changed", x)),
729
- tap(x => this.sizeInfo = x), tap(() => this._update$.next(this._context)))
725
+ tap(x => this.sizeInfo = x), tap(() => this._update$.next(this._context)), takeUntilDestroyed(this.#destroyRef))
730
726
  .subscribe();
731
- this.cssClass$$ = this.#viewport.sizeType$
727
+ this.#viewport.sizeType$
732
728
  .pipe(startWith(undefined), filter(() => !!(this._thenViewRef || this._elseViewRef)), pairwise(), tap(([prev, curr]) => {
733
729
  const el = this._thenViewRef
734
730
  ? this._thenViewRef.rootNodes[0]
@@ -740,14 +736,9 @@ class SsvViewportMatcherDirective {
740
736
  this.#renderer.removeClass(el, `ssv-vp-size--${prev.name}`);
741
737
  }
742
738
  this.#renderer.addClass(el, `ssv-vp-size--${curr?.name}`);
743
- }))
739
+ }), takeUntilDestroyed(this.#destroyRef))
744
740
  .subscribe();
745
741
  }
746
- ngOnDestroy() {
747
- this.cssClass$$.unsubscribe();
748
- this.sizeType$$.unsubscribe();
749
- this._update$.complete();
750
- }
751
742
  _updateView(sizeInfo) {
752
743
  if (isViewportConditionMatch(sizeInfo, this._context, this.#viewport.sizeTypeMap)) {
753
744
  if (!this._thenViewRef) {
@@ -768,10 +759,10 @@ class SsvViewportMatcherDirective {
768
759
  }
769
760
  }
770
761
  }
771
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvViewportMatcherDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
772
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.7", type: SsvViewportMatcherDirective, isStandalone: true, selector: "[ssvViewportMatcher]", inputs: { ssvViewportMatcher: "ssvViewportMatcher", ssvViewportMatcherExclude: "ssvViewportMatcherExclude", ssvViewportMatcherElse: "ssvViewportMatcherElse" }, exportAs: ["ssvViewportMatcher"], ngImport: i0 });
762
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvViewportMatcher, deps: [], target: i0.ɵɵFactoryTarget.Directive });
763
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.7", type: SsvViewportMatcher, isStandalone: true, selector: "[ssvViewportMatcher]", inputs: { ssvViewportMatcher: "ssvViewportMatcher", ssvViewportMatcherExclude: "ssvViewportMatcherExclude", ssvViewportMatcherElse: "ssvViewportMatcherElse" }, exportAs: ["ssvViewportMatcher"], ngImport: i0 });
773
764
  }
774
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvViewportMatcherDirective, decorators: [{
765
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvViewportMatcher, decorators: [{
775
766
  type: Directive,
776
767
  args: [{
777
768
  selector: "[ssvViewportMatcher]",
@@ -787,16 +778,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
787
778
  }] } });
788
779
 
789
780
  const EXPORTED_IMPORTS$1 = [
790
- SsvViewportMatcherDirective,
791
- SsvViewportMatcherVarDirective,
781
+ SsvViewportMatcher,
782
+ SsvViewportMatcherVar,
792
783
  ViewportDataPipe,
793
784
  ];
785
+ /** @deprecated Use standalone instead. */
794
786
  class SsvUxViewportModule {
795
787
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvUxViewportModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
796
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.7", ngImport: i0, type: SsvUxViewportModule, imports: [SsvViewportMatcherDirective,
797
- SsvViewportMatcherVarDirective,
798
- ViewportDataPipe], exports: [SsvViewportMatcherDirective,
799
- SsvViewportMatcherVarDirective,
788
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.7", ngImport: i0, type: SsvUxViewportModule, imports: [SsvViewportMatcher,
789
+ SsvViewportMatcherVar,
790
+ ViewportDataPipe], exports: [SsvViewportMatcher,
791
+ SsvViewportMatcherVar,
800
792
  ViewportDataPipe] });
801
793
  static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvUxViewportModule });
802
794
  }
@@ -811,6 +803,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
811
803
  const EXPORTED_IMPORTS = [
812
804
  SsvUxViewportModule,
813
805
  ];
806
+ /** @deprecated Use standalone instead. */
814
807
  class SsvUxModule {
815
808
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: SsvUxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
816
809
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.7", ngImport: i0, type: SsvUxModule, imports: [SsvUxViewportModule], exports: [SsvUxViewportModule] });
@@ -824,11 +817,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
824
817
  }]
825
818
  }] });
826
819
 
827
- const VERSION = "3.3.0-dev.76";
820
+ const VERSION = "3.3.0-dev.82";
828
821
 
829
822
  /**
830
823
  * Generated bundle index. Do not edit.
831
824
  */
832
825
 
833
- export { ComparisonOperation, DeviceType, SsvUxModule, SsvUxViewportModule, SsvViewportMatcherContext, SsvViewportMatcherDirective, SsvViewportMatcherVarContext, SsvViewportMatcherVarDirective, VERSION, VIEWPORT_OPTIONS, VIEWPORT_SSR_DEVICE, ViewportDataMatchStrategy, ViewportDataPipe, ViewportDataService, ViewportServerSizeService, ViewportService, ViewportSizeType, generateViewportSizeType, provideSsvUxViewportOptions, withViewportSsrDevice };
826
+ export { ComparisonOperation, DeviceType, SsvUxModule, SsvUxViewportModule, SsvViewportMatcher, SsvViewportMatcherContext, SsvViewportMatcherVar, SsvViewportMatcherVarContext, VERSION, VIEWPORT_OPTIONS, VIEWPORT_SSR_DEVICE, ViewportDataMatchStrategy, ViewportDataPipe, ViewportDataService, ViewportServerSizeService, ViewportService, ViewportSizeType, generateViewportSizeType, provideSsvUxViewportOptions, withViewportSsrDevice };
834
827
  //# sourceMappingURL=ssv-ngx.ux.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ssv-ngx.ux.mjs","sources":["../../../../libs/ngx.ux/src/viewport/viewport-data/viewport-data-matcher.ts","../../../../libs/ngx.ux/src/platform/window.ts","../../../../libs/ngx.ux/src/viewport/viewport.model.ts","../../../../libs/ngx.ux/src/viewport/viewport-server-size.service.ts","../../../../libs/ngx.ux/src/viewport/viewport.util.ts","../../../../libs/ngx.ux/src/viewport/viewport.options.ts","../../../../libs/ngx.ux/src/viewport/viewport.service.ts","../../../../libs/ngx.ux/src/viewport/viewport-data/viewport-data.utils.ts","../../../../libs/ngx.ux/src/viewport/viewport-data/viewport-data.service.ts","../../../../libs/ngx.ux/src/viewport/viewport-data/viewport-data.pipe.ts","../../../../libs/ngx.ux/src/viewport/viewport-matcher-var.directive.ts","../../../../libs/ngx.ux/src/viewport/viewport-matcher.directive.ts","../../../../libs/ngx.ux/src/viewport/viewport.module.ts","../../../../libs/ngx.ux/src/ux.module.ts","../../../../libs/ngx.ux/src/version.ts","../../../../libs/ngx.ux/src/ssv-ngx.ux.ts"],"sourcesContent":["import type { Dictionary } from \"../../internal/internal.model\";\nimport type { ViewportSizeTypeInfo } from \"../viewport.model\";\n\nexport type ViewportDataConfig<TValue = unknown, TData = Dictionary<TValue>> = TData & {\n\tdefault?: TValue\n};\n\nexport enum ViewportDataMatchStrategy {\n\t/** Indicates that size should match exact or default. */\n\texact,\n\n\t/** Indicates that size matches when exact match, first match smaller (down) or default. */\n\tsmaller,\n\n\t/** Indicates that size matches when exact match, first match larger (up) or default. */\n\tlarger,\n\n\t/** Indicates that size matches when exact match, or it tries both smaller/larger (smaller is preferred) until match or default. */\n\tclosestSmallerFirst,\n\n\t/** Indicates that size matches when exact match, or it tries both larger/smaller (larger is preferred) until match or default. */\n\tclosestLargerFirst,\n}\nexport type ViewportDataMatchStrategyLiteral = keyof typeof ViewportDataMatchStrategy;\n\nexport interface ViewportDataMatcher<T = unknown> {\n\t(\n\t\tdataConfig: ViewportDataConfig<T>,\n\t\tcurrentSizeType: ViewportSizeTypeInfo,\n\t\tsizeTypes: ViewportSizeTypeInfo[],\n\t\tsizeTypeMap: Dictionary<ViewportSizeTypeInfo>,\n\t): T | undefined;\n}\n\n/**\n * Utility function to match data based on strategy and size.\n *\n * @param dataConfig Data config to generate rules based on.\n * @param sizeType Size type to get data for.\n * @param strategy Strategy to use when building rules.\n * @param sizeTypes Available size types ordered by index type. (Can be obtained from `ViewportService`)\n * @param sizeTypeMap Available size type map. (Can be obtained from `ViewportService`)\n * @returns Returns the matched data value.\n */\nexport function matchViewportData<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tsizeType: ViewportSizeTypeInfo,\n\tstrategy: ViewportDataMatchStrategy,\n\tsizeTypes: ViewportSizeTypeInfo[],\n\tsizeTypeMap: Dictionary<ViewportSizeTypeInfo>,\n): T | undefined {\n\tconst matchFn = matchStrategyHandlerMap[strategy];\n\tif (!matchFn) {\n\t\tthrow Error(`matchViewportData: Viewport Data strategy not implemented. Strategy: '${strategy}'`);\n\t}\n\tconst data = matchFn(dataConfig, sizeType, sizeTypes, sizeTypeMap) as T;\n\tif (data !== undefined) {\n\t\treturn data;\n\t}\n\treturn dataConfig.default;\n}\n\n\nconst matchStrategyHandlerMap: Dictionary<ViewportDataMatcher> = {\n\t[ViewportDataMatchStrategy.exact]: matchWithExact,\n\t[ViewportDataMatchStrategy.larger]: matchWithLargerMatch,\n\t[ViewportDataMatchStrategy.smaller]: matchWithSmallerMatch,\n\t[ViewportDataMatchStrategy.closestSmallerFirst]: matchWithClosestSmallerFirstMatch,\n\t[ViewportDataMatchStrategy.closestLargerFirst]: matchWithClosestLargerFirstMatch,\n};\n\nfunction matchWithExact<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n): T | undefined {\n\treturn dataConfig[currentSizeType.name];\n}\n\nfunction matchWithLargerMatch<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n): T | undefined {\n\tlet data = dataConfig[currentSizeType.name];\n\tif (data !== undefined) {\n\t\treturn data;\n\t}\n\n\tconst largestTypeIdx = sizeTypes[sizeTypes.length - 1].type;\n\tif (currentSizeType.type >= largestTypeIdx) {\n\t\treturn undefined;\n\t}\n\n\tfor (let index = currentSizeType.type; index < sizeTypes.length; index++) {\n\t\tconst sizeType = sizeTypes[index];\n\t\tdata = dataConfig[sizeType.name];\n\t\tif (data !== undefined) {\n\t\t\treturn data;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nfunction matchWithSmallerMatch<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n): T | undefined {\n\tlet data = dataConfig[currentSizeType.name];\n\tif (data !== undefined) {\n\t\treturn data;\n\t}\n\n\tif (currentSizeType.type <= 0) {\n\t\treturn undefined;\n\t}\n\n\t// eslint-disable-next-line for-direction\n\tfor (let index = currentSizeType.type; index < sizeTypes.length; index--) {\n\t\tconst sizeType = sizeTypes[index];\n\t\tdata = dataConfig[sizeType.name];\n\t\tif (data !== undefined) {\n\t\t\treturn data;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nfunction matchWithClosestSmallerFirstMatch<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n): T | undefined {\n\treturn closestMatch(dataConfig, currentSizeType, sizeTypes, true);\n}\n\nfunction matchWithClosestLargerFirstMatch<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n): T | undefined {\n\treturn closestMatch(dataConfig, currentSizeType, sizeTypes, false);\n}\n\nfunction closestMatch<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n\tisSmallerFirst: boolean\n): T | undefined {\n\tlet data = dataConfig[currentSizeType.name];\n\tif (data !== undefined) {\n\t\treturn data;\n\t}\n\n\tlet downIndex = currentSizeType.type;\n\tlet upIndex = currentSizeType.type;\n\n\t \n\tfor (let index = 0; index < sizeTypes.length; index++) {\n\t\tfor (const idx of isSmallerFirst ? [--downIndex, ++upIndex] : [++upIndex, --downIndex]) {\n\t\t\tconst sizeType = sizeTypes[idx];\n\t\t\tif (sizeType) {\n\t\t\t\tdata = dataConfig[sizeType.name];\n\t\t\t\tif (data !== undefined) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined;\n}\n","import { InjectionToken, Injectable, inject } from \"@angular/core\";\n\nexport const WINDOW = new InjectionToken<Window>(\"Window\", {\n\tfactory: () => _window() as Window,\n});\n\nexport function _window(): unknown {\n\tif (typeof window !== \"undefined\") {\n\t\treturn window;\n\t}\n\treturn {};\n}\n\n@Injectable({\n\tprovidedIn: \"root\",\n})\nexport class WindowRef {\n\n\tprivate readonly window = inject(WINDOW);\n\n\t/** Window underlying native object. */\n\tget native(): Window {\n\t\treturn this.window as Window;\n\t}\n\n\t/** Determines whether native element is supported or not. Generally `false` when executing in SSR. */\n\tget hasNative(): boolean {\n\t\treturn !!this.native.window;\n\t}\n\n}\n","/**\n * The indices of each breakpoint provided based on the `UX_VIEWPORT_DEFAULT_BREAKPOINTS`.\n * @see UX_VIEWPORT_DEFAULT_BREAKPOINTS\n */\nexport enum ViewportSizeType {\n\txsmall = 0,\n\tsmall = 1,\n\tmedium = 2,\n\tlarge = 3,\n\txlarge = 4,\n\txxlarge = 5,\n\txxlarge1 = 6,\n}\n\nexport enum ComparisonOperation {\n\tequals = \"=\",\n\tnotEquals = \"<>\",\n\tlessThan = \"<\",\n\tlessOrEqualThan = \"<=\",\n\tgreaterThan = \">\",\n\tgreaterOrEqualThan = \">=\",\n}\n\nexport type ComparisonOperationKeyType = keyof typeof ComparisonOperation;\nexport type ComparisonOperationValueType = \"=\" | \"<>\" | \"<\" | \"<=\" | \">\" | \">=\"; // todo: find a better way to do this\nexport type ComparisonOperationLiteral = ComparisonOperationKeyType | ComparisonOperationValueType;\n\nexport enum DeviceType {\n\tdesktop = \"desktop\",\n\tmobile = \"mobile\",\n\ttablet = \"tablet\"\n}\n\nexport interface ViewportSize {\n\twidth: number;\n\theight: number;\n}\n\nexport interface ViewportSizeTypeInfo {\n\ttype: number;\n\tname: string;\n\twidthThreshold: number;\n}\n\nexport interface ViewportMatchConditions {\n\tsizeType?: string | string[] | null;\n\tsizeTypeExclude?: string | string[] | null;\n\texpression?: ViewportSizeMatcherExpression;\n}\n\nexport interface ViewportSizeMatcherExpression {\n\tsize: string;\n\toperation: ComparisonOperationLiteral;\n}\n","import { Injectable, InjectionToken, inject } from \"@angular/core\";\n\nimport { DeviceType, ViewportSize } from \"./viewport.model\";\n\n// todo: make this configurable\n/** Viewport size for SSR. */\nconst viewportSizeSSR: Record<DeviceType, ViewportSize> = {\n\t[DeviceType.desktop]: {\n\t\twidth: 1366,\n\t\theight: 768,\n\t},\n\t[DeviceType.tablet]: {\n\t\twidth: 768,\n\t\theight: 1024,\n\t},\n\t[DeviceType.mobile]: {\n\t\twidth: 414,\n\t\theight: 736,\n\t},\n};\n\nexport const VIEWPORT_SSR_DEVICE = new InjectionToken<DeviceType>(\"UX_VIEWPORT_SSR_DEVICE\", {\n\tfactory: () => DeviceType.desktop,\n\tprovidedIn: \"platform\",\n});\n\n@Injectable({\n\tprovidedIn: \"root\",\n})\nexport class ViewportServerSizeService {\n\n\tprivate readonly deviceType = inject(VIEWPORT_SSR_DEVICE);\n\n\tget(): ViewportSize {\n\t\treturn viewportSizeSSR[this.deviceType] || viewportSizeSSR[DeviceType.desktop];\n\t}\n\n}\n","import { Dictionary } from \"../internal/internal.model\";\nimport {\n\tComparisonOperation,\n\tViewportSizeMatcherExpression,\n\tViewportSizeTypeInfo,\n\tViewportMatchConditions\n} from \"./viewport.model\";\n\nexport function isViewportSizeMatcherExpression(value: unknown): value is ViewportSizeMatcherExpression {\n\tif (typeof value !== \"object\" || !value) {\n\t\treturn false;\n\t}\n\tconst args: Partial<ViewportSizeMatcherExpression> = value;\n\tif (args.size && args.operation) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nexport function isViewportSizeMatcherTupleExpression(arg: unknown): arg is [ComparisonOperation, string] {\n\tif (!arg) {\n\t\treturn false;\n\t}\n\tif (Array.isArray(arg)) {\n\t\tif (arg.length === 2) {\n\t\t\tconst [op] = arg;\n\t\t\treturn operations.includes(op);\n\t\t}\n\t}\n\treturn false;\n}\n\n\nconst operations = Object.values(ComparisonOperation);\n\nexport const COMPARISON_OPERATION_FUNC_MAPPING: Dictionary<(a: number, b: number) => boolean> = {\n\t[ComparisonOperation.equals]: (a: number, b: number) => a === b,\n\t[ComparisonOperation.notEquals]: (a: number, b: number) => a !== b,\n\t[ComparisonOperation.lessThan]: (a: number, b: number) => a < b,\n\t[ComparisonOperation.lessOrEqualThan]: (a: number, b: number) => a <= b,\n\t[ComparisonOperation.greaterThan]: (a: number, b: number) => a > b,\n\t[ComparisonOperation.greaterOrEqualThan]: (a: number, b: number) => a >= b,\n};\n\nexport function isViewportConditionMatch(\n\tevaluateSize: ViewportSizeTypeInfo,\n\tconditions: ViewportMatchConditions,\n\tviewportSizeTypeInfoRefs: Dictionary<ViewportSizeTypeInfo>\n): boolean {\n\tconst isExcluded = match(conditions.sizeTypeExclude, evaluateSize.name, false);\n\tlet isIncluded;\n\tlet isExpressionTruthy;\n\n\tif (!isExcluded && conditions.expression) {\n\t\tconst ref = viewportSizeTypeInfoRefs[conditions.expression.size];\n\t\tif(!ref) {\n\t\t\tthrow new Error(`Viewport size type is invalid. Size type: '${conditions.expression.size}'`);\n\t\t}\n\t\tconst expMatcher = COMPARISON_OPERATION_FUNC_MAPPING[conditions.expression.operation];\n\n\t\tisExpressionTruthy = expMatcher(evaluateSize.type, ref.type);\n\t} else {\n\t\tisIncluded = match(conditions.sizeType, evaluateSize.name, true);\n\t}\n\n\tconst shouldRender = (isExpressionTruthy || isIncluded) && !isExcluded;\n\t// console.warn(\">>> shouldRender\", { evaluateSize, conditions, shouldRender });\n\treturn !!shouldRender;\n}\n\nfunction match(value: string | string[] | null | undefined, targetValue: string, defaultValue: boolean) {\n\tif (!value) {\n\t\treturn defaultValue;\n\t}\n\n\treturn Array.isArray(value)\n\t\t? value.includes(targetValue)\n\t\t: value === targetValue;\n}\n\nexport function getSizeTypeInfo(width: number, sizeTypes: ViewportSizeTypeInfo[]): ViewportSizeTypeInfo {\n\tconst lastEntryIndex = sizeTypes.length - 1;\n\n\tfor (let idx = 0; idx < lastEntryIndex; idx++) {\n\t\tconst viewportSizeTypeInfo = sizeTypes[idx];\n\n\t\tif (width <= viewportSizeTypeInfo.widthThreshold) {\n\t\t\treturn viewportSizeTypeInfo;\n\t\t}\n\t}\n\n\treturn sizeTypes[lastEntryIndex];\n}\n\n/**\n * Converts the breakpoints into a 2 dimensional array containing the name and width, and sorted from\n * smallest to largest.\n * @param breakpoints the breakpoints obtained from the config\n * @internal\n */\nfunction getSortedBreakpoints(breakpoints: Dictionary<number>): [string, number][] {\n\treturn Object.entries(breakpoints)\n\t\t.sort(([, widthA], [, widthB]) => widthA - widthB);\n}\n\n/**\n * A util function which generates the ViewportSizeTypeInfo.type for each breakpoint.\n * @param breakpoints the custom breakpoints\n */\nexport function generateViewportSizeType<T extends Record<string, number>>(breakpoints: T): T & Record<number, string> {\n\treturn Object.freeze(\n\t\tgetSortedBreakpoints(breakpoints).reduce<Record<number | string, string | number>>(\n\t\t\t(dictionary, [name], index) => {\n\t\t\t\tdictionary[name] = index;\n\t\t\t\tdictionary[index] = name;\n\t\t\t\treturn dictionary;\n\t\t\t}, {}\n\t\t)\n\t) as T & Record<number, string>;\n}\n\n/**\n * Pre-processes the given breakpoints into an ordered list from smallest to largest while generating\n * all the necessary information on the viewport.\n * @param breakpoints the breakpoints obtained from the config\n * @internal\n */\nexport function generateViewportSizeTypeInfoList(breakpoints: Dictionary<number>): ViewportSizeTypeInfo[] {\n\treturn getSortedBreakpoints(breakpoints)\n\t\t.map(([name, width], index) =>\n\t\t\t(Object.freeze({\n\t\t\t\tname,\n\t\t\t\ttype: index,\n\t\t\t\twidthThreshold: width\n\t\t\t}))\n\t\t);\n}\n\n/**\n * Converts the breakpoint list into a dictionary while using the name as key.\n * @param breakpointList the list of breakpoints\n * @internal\n */\nexport function generateViewportSizeTypeInfoRefs(breakpointList: ViewportSizeTypeInfo[]): Dictionary<ViewportSizeTypeInfo> {\n\treturn Object.freeze(\n\t\tbreakpointList.reduce<Dictionary<ViewportSizeTypeInfo>>((dictionary, breakpoint) => {\n\t\t\tdictionary[breakpoint.name] = breakpoint;\n\t\t\tdictionary[breakpoint.type] = breakpoint;\n\t\t\treturn dictionary;\n\t\t}, {})\n\t);\n}\n","import { type EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from \"@angular/core\";\n\nimport type { Dictionary } from \"../internal/internal.model\";\nimport { ViewportDataMatchStrategy } from \"./viewport-data/viewport-data-matcher\";\nimport { VIEWPORT_SSR_DEVICE } from \"./viewport-server-size.service\";\nimport { DeviceType } from \"./viewport.model\";\n\n/** Default viewport breakpoints. */\nexport const UX_VIEWPORT_DEFAULT_BREAKPOINTS: Dictionary<number> = {\n\txsmall: 450,\n\tsmall: 767,\n\tmedium: 992,\n\tlarge: 1200,\n\txlarge: 1500,\n\txxlarge: 1920,\n\txxlarge1: 2100,\n};\n\nexport interface UxViewportOptions {\n\t/** Polling speed on resizing (in milliseconds). e.g. the higher the number the longer it takes to recalculate. */\n\tresizePollingSpeed: number;\n\n\t/** Breakpoints to use. Key needs to match the size type and the value the width threshold.\n\t * e.g. given width '1000' and `medium` is set to '992' => `large`.\n\t */\n\tbreakpoints: Dictionary<number>;\n\n\t/** Default data match strategy to use. */\n\tdefaultDataMatchStrategy: ViewportDataMatchStrategy;\n}\n\nconst DEFAULT_OPTIONS = Object.freeze<UxViewportOptions>({\n\tresizePollingSpeed: 33,\n\tbreakpoints: UX_VIEWPORT_DEFAULT_BREAKPOINTS,\n\tdefaultDataMatchStrategy: ViewportDataMatchStrategy.smaller,\n});\n\nexport const VIEWPORT_OPTIONS = new InjectionToken<UxViewportOptions>(\"SSV_UX_VIEWPORT_OPTIONS\", {\n\tfactory: () => DEFAULT_OPTIONS,\n});\n\nexport function provideSsvUxViewportOptions(\n\toptions: Partial<UxViewportOptions> | ((defaults: Readonly<UxViewportOptions>) => Partial<UxViewportOptions>),\n\t...features: EnvironmentProviders[]\n): EnvironmentProviders {\n\treturn makeEnvironmentProviders([\n\t\t{\n\t\t\tprovide: VIEWPORT_OPTIONS,\n\t\t\tuseFactory: () => {\n\t\t\t\tlet opts = typeof options === \"function\" ? options(DEFAULT_OPTIONS) : options;\n\t\t\t\topts = opts\n\t\t\t\t\t? {\n\t\t\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\t\t\t...opts, // NOTE: breakpoints shoudn't be merged\n\t\t\t\t\t}\n\t\t\t\t\t: DEFAULT_OPTIONS;\n\t\t\t\treturn opts;\n\t\t\t},\n\t\t},\n\t\t...features,\n\t]);\n}\n\nexport function withViewportSsrDevice(options: DeviceType | (() => DeviceType)): EnvironmentProviders {\n\treturn makeEnvironmentProviders([\n\t\t{\n\t\t\tprovide: VIEWPORT_SSR_DEVICE,\n\t\t\tuseFactory: () => {\n\t\t\t\tconst deviceType = typeof options === \"function\" ? options() : options;\n\t\t\t\treturn deviceType;\n\t\t\t},\n\t\t},\n\t]);\n}","import { Injectable, Signal, inject } from \"@angular/core\";\nimport { toSignal } from \"@angular/core/rxjs-interop\";\nimport {\n\tObservable,\n\tfromEvent,\n\tmap,\n\tdistinctUntilChanged,\n\tstartWith,\n\tshare,\n\tshareReplay,\n\tauditTime,\n\tof,\n} from \"rxjs\";\n\nimport { ViewportSizeTypeInfo, ViewportSize } from \"./viewport.model\";\nimport { WindowRef } from \"../platform/window\";\nimport { ViewportServerSizeService } from \"./viewport-server-size.service\";\nimport { generateViewportSizeTypeInfoList, generateViewportSizeTypeInfoRefs, getSizeTypeInfo } from \"./viewport.util\";\nimport { VIEWPORT_OPTIONS } from \"./viewport.options\";\n\n@Injectable({\n\tprovidedIn: \"root\",\n})\nexport class ViewportService {\n\n\treadonly #viewportServerSize = inject(ViewportServerSizeService);\n\treadonly #windowRef = inject(WindowRef);\n\treadonly #config = inject(VIEWPORT_OPTIONS);\n\n\t/** Viewport size types list ordered by type, smallest to largest. */\n\treadonly sizeTypes = generateViewportSizeTypeInfoList(this.#config.breakpoints);\n\n\t/** Size types refs of the generated viewport size type info. */\n\treadonly sizeTypeMap = generateViewportSizeTypeInfoRefs(this.sizeTypes);\n\n\t/** Viewport size signal (which is also throttled). */\n\treadonly viewportSize: Signal<ViewportSize>;\n\n\t/** Viewport size type signal (which is also throttled). */\n\treadonly sizeType: Signal<ViewportSizeTypeInfo>;\n\n\t/** Window resize observable. */\n\treadonly resizeSnap$: Observable<ViewportSize>;\n\n\t/** Window resize observable (which is also throttled). */\n\treadonly resize$: Observable<ViewportSize>;\n\n\t/** Viewport size type observable (which is also throttled). */\n\treadonly sizeType$: Observable<ViewportSizeTypeInfo>;\n\n\t/** Viewport size type observable. */\n\treadonly sizeTypeSnap$: Observable<ViewportSizeTypeInfo>;\n\n\t/** Viewport size type snapshot of the last value. (Prefer use `sizeType$` observable when possible.) */\n\tget sizeTypeSnapshot(): ViewportSizeTypeInfo { return this.sizeType(); }\n\n\t/** Viewport size observable (which is also throttled). */\n\treadonly size$: Observable<ViewportSize>;\n\n\t/** Viewport size observable. */\n\treadonly sizeSnap$: Observable<ViewportSize>;\n\n\tconstructor(\n\t) {\n\t\tif (this.#windowRef.hasNative) {\n\t\t\tthis.resizeSnap$ = fromEvent<Event>(this.#windowRef.native, \"resize\").pipe(\n\t\t\t\tmap(() => this.getViewportSize()),\n\t\t\t\tshare()\n\t\t\t);\n\n\t\t\tthis.resize$ = this.resizeSnap$.pipe(\n\t\t\t\tauditTime(this.#config.resizePollingSpeed),\n\t\t\t\tshare(),\n\t\t\t);\n\t\t} else {\n\t\t\tthis.resizeSnap$ = this.resize$ = of(this.#viewportServerSize.get());\n\t\t}\n\t\tconst size = this.getViewportSize();\n\n\t\tconst sizeFn = (obs$: Observable<ViewportSize>) => obs$.pipe(\n\t\t\tstartWith(size),\n\t\t\tdistinctUntilChanged((a, b) => a.width === b.width && a.height === b.height),\n\t\t\tshareReplay(1),\n\t\t);\n\n\t\tthis.sizeSnap$ = sizeFn(this.resizeSnap$);\n\t\tthis.size$ = sizeFn(this.resize$);\n\n\t\tconst sizeTypeFn = (obs$: Observable<ViewportSize>) => obs$.pipe(\n\t\t\tdistinctUntilChanged((a, b) => a.width === b.width),\n\t\t\tmap(x => getSizeTypeInfo(x.width, this.sizeTypes)),\n\t\t\tdistinctUntilChanged(),\n\t\t\tshareReplay(1),\n\t\t);\n\n\t\tthis.sizeType$ = sizeTypeFn(this.size$);\n\t\tthis.sizeTypeSnap$ = sizeTypeFn(this.sizeSnap$);\n\n\t\tthis.viewportSize = toSignal(this.size$, { initialValue: size });\n\t\tthis.sizeType = toSignal(this.sizeTypeSnap$, { initialValue: getSizeTypeInfo(size.width, this.sizeTypes) });\n\t}\n\n\t/** Returns the current viewport size */\n\tprivate getViewportSize(): ViewportSize {\n\t\tif (!this.#windowRef.hasNative) {\n\t\t\treturn this.#viewportServerSize.get();\n\t\t}\n\n\t\tconst ua = navigator.userAgent.toLowerCase();\n\t\tif (ua.indexOf(\"safari\") !== -1 && ua.indexOf(\"chrome\") === -1) { // safari subtracts the scrollbar width\n\t\t\treturn {\n\t\t\t\twidth: this.#windowRef.native.document.documentElement.clientWidth,\n\t\t\t\theight: this.#windowRef.native.document.documentElement.clientHeight,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\twidth: this.#windowRef.native.innerWidth,\n\t\t\theight: this.#windowRef.native.innerHeight,\n\t\t};\n\t}\n\n}\n","import { Dictionary } from \"../../internal/internal.model\";\nimport { ViewportSizeTypeInfo } from \"../viewport.model\";\nimport { ViewportDataConfig, ViewportDataMatchStrategy } from \"./viewport-data-matcher\";\n\nexport interface ViewportDataRule<T> {\n\tmin?: number;\n\tmax?: number;\n\tvalue: T;\n}\n\n/**\n * Utility function to generate rules based on strategies.\n *\n * @param dataConfig Data config to generate rules based on.\n * @param strategy Strategy to use when building rules.\n * @param sizeTypes Available size types ordered by index type. (Can be obtained from `ViewportService`)\n * @param sizeTypeMap Available size type map. (Can be obtained from `ViewportService`)\n * @returns Returns a collection of rules (ordered).\n */\nexport function generateViewportRulesRangeFromDataMatcher<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tstrategy: ViewportDataMatchStrategy,\n\tsizeTypes: ViewportSizeTypeInfo[],\n\tsizeTypeMap: Dictionary<ViewportSizeTypeInfo>,\n): ViewportDataRule<T>[] {\n\tconst ruleBuilderFn = matchStrategyHandlerMap[strategy];\n\tif (!ruleBuilderFn) {\n\t\tthrow Error(`generateViewportRulesRangeFromDataMatcher: Viewport Data strategy not implemented. Strategy: '${strategy}'`);\n\t}\n\n\tlet dataSizes: ViewportSizeTypeInfo[] = [];\n\tfor (const key in dataConfig) {\n\t\tif (Object.prototype.hasOwnProperty.call(dataConfig, key)) {\n\t\t\tconst data = dataConfig[key];\n\t\t\tif (data === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst size = sizeTypeMap[key];\n\t\t\tif (size) {\n\t\t\t\tdataSizes.push(size);\n\t\t\t}\n\t\t}\n\t}\n\tdataSizes = dataSizes.sort(({ type: typeA }, { type: typeB }) => typeA - typeB);\n\n\tconst rules: ViewportDataRule<T>[] = [];\n\tif (dataConfig.default) {\n\t\trules.push({ value: dataConfig.default, min: undefined, max: undefined });\n\t}\n\n\tlet prevRule: ViewportDataRule<T> | undefined;\n\tfor (let index = 0; index < dataSizes.length; index++) {\n\t\tconst prevDataSize = dataSizes[index - 1];\n\t\tconst nextDataSize = dataSizes[index + 1];\n\t\tconst dataSize = dataSizes[index];\n\t\tconst prevSize = sizeTypes[dataSize.type - 1];\n\t\t// const nextSize = sizeTypes[dataSize.type + 1];\n\t\tconst data = dataConfig[dataSize.name];\n\t\tconst rule: ViewportDataRule<T> = {\n\t\t\tvalue: data,\n\t\t\tmin: undefined,\n\t\t\tmax: undefined,\n\t\t};\n\n\t\truleBuilderFn(rule, dataSize, nextDataSize, prevDataSize, prevSize, prevRule, sizeTypes);\n\n\t\tprevRule = rule;\n\t\trules.push(rule);\n\t}\n\treturn rules;\n}\n\nexport interface ViewportRuleRangeBuilder<T = unknown> {\n\t(\n\t\trule: ViewportDataRule<T>,\n\t\tdataSize: ViewportSizeTypeInfo,\n\t\tnextDataSize: ViewportSizeTypeInfo | undefined,\n\t\tprevDataSize: ViewportSizeTypeInfo | undefined,\n\t\tprevSize: ViewportSizeTypeInfo | undefined,\n\t\tprevRule: ViewportDataRule<T> | undefined,\n\t\tsizeTypes: ViewportSizeTypeInfo[],\n\t): void;\n}\n\nconst matchStrategyHandlerMap: Dictionary<ViewportRuleRangeBuilder> = {\n\t[ViewportDataMatchStrategy.exact]: (rule, dataSize, _nextDataSize, _prevDataSize, prevSize) => {\n\t\trule.max = dataSize.widthThreshold;\n\t\tif (prevSize) {\n\t\t\trule.min = prevSize.widthThreshold + 1;\n\t\t}\n\t},\n\t[ViewportDataMatchStrategy.smaller]: (rule, dataSize, nextDataSize, _prevDataSize, prevSize) => {\n\t\tif (nextDataSize) {\n\t\t\trule.max = dataSize.widthThreshold;\n\t\t}\n\t\tif (prevSize) {\n\t\t\trule.min = prevSize.widthThreshold + 1;\n\t\t}\n\t},\n\t[ViewportDataMatchStrategy.larger]: (rule, dataSize, _nextDataSize, prevDataSize) => {\n\t\tif (dataSize) {\n\t\t\trule.max = dataSize.widthThreshold;\n\t\t}\n\t\tif (prevDataSize) {\n\t\t\trule.min = prevDataSize.widthThreshold + 1;\n\t\t}\n\t},\n\t[ViewportDataMatchStrategy.closestSmallerFirst]: (rule, dataSize, nextDataSize, _prevDataSize, _prevSize, prevRule, sizeTypes) => {\n\t\tif (nextDataSize) {\n\t\t\trule.max = calculateClosestWidthThreshold(nextDataSize, dataSize, sizeTypes, true);\n\t\t}\n\t\tif (prevRule?.max) {\n\t\t\trule.min = prevRule.max + 1;\n\t\t}\n\t},\n\t[ViewportDataMatchStrategy.closestLargerFirst]: (rule, dataSize, nextDataSize, _prevDataSize, _prevSize, prevRule, sizeTypes) => {\n\t\tif (nextDataSize) {\n\t\t\trule.max = calculateClosestWidthThreshold(nextDataSize, dataSize, sizeTypes, false);\n\t\t}\n\t\tif (prevRule?.max) {\n\t\t\trule.min = prevRule.max + 1;\n\t\t}\n\t},\n};\n\nfunction calculateClosestWidthThreshold(\n\tnextDataSize: ViewportSizeTypeInfo,\n\tdataSize: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n\tisSmallerPreferred: boolean,\n) {\n\tconst fn = isSmallerPreferred ? Math.ceil : Math.floor;\n\t// get closest between curr and next\n\tconst diffIndex = fn((nextDataSize.type - dataSize.type - 1) / 2);\n\tconst diffNextSize = sizeTypes[dataSize.type + diffIndex];\n\treturn (diffNextSize || dataSize).widthThreshold;\n}\n","import { inject, Injectable } from \"@angular/core\";\nimport { Observable, distinctUntilChanged, map } from \"rxjs\";\n\nimport { ViewportSizeTypeInfo } from \"../viewport.model\";\nimport { ViewportService } from \"../viewport.service\";\nimport { matchViewportData, ViewportDataConfig, ViewportDataMatchStrategy } from \"./viewport-data-matcher\";\nimport { generateViewportRulesRangeFromDataMatcher, ViewportDataRule } from \"./viewport-data.utils\";\nimport { VIEWPORT_OPTIONS } from \"../viewport.options\";\n\n@Injectable({\n\tprovidedIn: \"root\",\n})\nexport class ViewportDataService {\n\n\treadonly #viewport = inject(ViewportService);\n\treadonly #config = inject(VIEWPORT_OPTIONS);\n\n\t/** Get data for match. */\n\tget<T>(\n\t\tdataConfig: ViewportDataConfig<T>,\n\t\tstrategy: ViewportDataMatchStrategy = this.#config.defaultDataMatchStrategy,\n\t\tsizeType: ViewportSizeTypeInfo = this.#viewport.sizeTypeSnapshot\n\t): T | undefined {\n\t\treturn matchViewportData(dataConfig, sizeType, strategy, this.#viewport.sizeTypes, this.#viewport.sizeTypeMap);\n\t}\n\n\t/** Get data for match as observable. */\n\tget$<T>(dataConfig: ViewportDataConfig<T>, strategy?: ViewportDataMatchStrategy, throttle = true): Observable<T | undefined> {\n\t\treturn (throttle ? this.#viewport.sizeType$ : this.#viewport.sizeTypeSnap$).pipe(\n\t\t\tmap(sizeType => this.get<T>(dataConfig, strategy, sizeType)),\n\t\t\tdistinctUntilChanged(),\n\t\t);\n\t}\n\n\t/** Generate rules based on strategies for data. */\n\tgenerateRules<T>(\n\t\tdataConfig: ViewportDataConfig<T>,\n\t\tstrategy: ViewportDataMatchStrategy = this.#config.defaultDataMatchStrategy,\n\t): ViewportDataRule<T>[] {\n\t\treturn generateViewportRulesRangeFromDataMatcher(\n\t\t\tdataConfig,\n\t\t\tstrategy,\n\t\t\tthis.#viewport.sizeTypes,\n\t\t\tthis.#viewport.sizeTypeMap\n\t\t);\n\t}\n\n}\n","import { Subscription, tap } from \"rxjs\";\nimport { Pipe, PipeTransform, OnDestroy, ChangeDetectorRef, inject } from \"@angular/core\";\n\nimport { ViewportDataConfig, ViewportDataMatchStrategy, ViewportDataMatchStrategyLiteral } from \"./viewport-data-matcher\";\nimport { ViewportDataService } from \"./viewport-data.service\";\n\n\n@Pipe({\n\tname: \"ssvViewportData\",\n\tpure: false,\n\tstandalone: true,\n})\nexport class ViewportDataPipe implements PipeTransform, OnDestroy {\n\t#viewportData = inject(ViewportDataService);\n\t#cdr = inject(ChangeDetectorRef);\n\n\tprivate markForTransform = true;\n\tprivate value: unknown;\n\tprivate data: ViewportDataConfig | undefined;\n\tprivate strategy: ViewportDataMatchStrategyLiteral | undefined;\n\tprivate data$$ = Subscription.EMPTY;\n\n\ttransform(data: ViewportDataConfig, strategy: ViewportDataMatchStrategyLiteral): unknown {\n\t\tif (!this.markForTransform && data === this.data && strategy === this.strategy) {\n\t\t\treturn this.value;\n\t\t}\n\t\tthis.data = data;\n\t\tthis.strategy = strategy;\n\n\t\tthis.data$$.unsubscribe();\n\t\tthis.data$$ = this.#viewportData.get$(data, ViewportDataMatchStrategy[strategy]).pipe(\n\t\t\ttap(value => {\n\t\t\t\tthis.markForTransform = true;\n\t\t\t\tthis.value = value;\n\t\t\t\tthis.#cdr.markForCheck();\n\t\t\t}),\n\t\t).subscribe();\n\n\t\tthis.markForTransform = false;\n\t\treturn this.value;\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.data$$.unsubscribe();\n\t}\n\n}\n","import { OnInit, OnDestroy, Directive, Input, TemplateRef, ViewContainerRef, EmbeddedViewRef, inject } from \"@angular/core\";\nimport { combineLatest, ReplaySubject, Subject, tap, map, takeUntil } from \"rxjs\";\n\nimport { ViewportService } from \"./viewport.service\";\nimport {\n\tisViewportSizeMatcherExpression,\n\tisViewportSizeMatcherTupleExpression,\n\tisViewportConditionMatch\n} from \"./viewport.util\";\nimport { ViewportMatchConditions, ViewportSizeMatcherExpression } from \"./viewport.model\";\n\nconst NAME_CAMEL = \"ssvViewportMatcherVar\";\n\nexport class SsvViewportMatcherVarContext {\n\n\tconstructor(\n\t\tpublic $implicit = false,\n\t) { }\n\n}\n\n@Directive({\n\tselector: `[${NAME_CAMEL}]`,\n\tstandalone: true,\n})\nexport class SsvViewportMatcherVarDirective implements OnInit, OnDestroy {\n\t#viewport = inject(ViewportService);\n\t#viewContainer = inject(ViewContainerRef);\n\t#templateRef = inject<TemplateRef<SsvViewportMatcherVarContext>>(TemplateRef);\n\n\tprivate _matchConditions: ViewportMatchConditions = {};\n\tprivate _context = new SsvViewportMatcherVarContext();\n\tprivate readonly _destroy$ = new Subject<void>();\n\tprivate readonly _update$ = new ReplaySubject<void>(1);\n\tprivate _viewRef!: EmbeddedViewRef<SsvViewportMatcherVarContext>;\n\n\t@Input(`${NAME_CAMEL}When`) set condition(value: string | string[] | ViewportSizeMatcherExpression) {\n\t\tif (isViewportSizeMatcherExpression(value)) {\n\t\t\tthis._matchConditions.expression = value;\n\t\t} else if (isViewportSizeMatcherTupleExpression(value)) {\n\t\t\tconst [op, size] = value;\n\t\t\tthis._matchConditions.expression = {\n\t\t\t\toperation: op,\n\t\t\t\tsize\n\t\t\t};\n\t\t} else {\n\t\t\tthis._matchConditions.sizeType = value;\n\t\t}\n\n\t\tthis._update$.next();\n\t}\n\n\tngOnInit(): void {\n\t\tthis.updateView();\n\t\tcombineLatest([this.#viewport.sizeType$, this._update$]).pipe(\n\t\t\tmap(([sizeType]) => isViewportConditionMatch(sizeType, this._matchConditions, this.#viewport.sizeTypeMap)),\n\t\t\ttap(x => this._context.$implicit = x),\n\t\t\ttap(() => this._viewRef.markForCheck()),\n\t\t\ttakeUntil(this._destroy$),\n\t\t).subscribe();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._destroy$.next();\n\t\tthis._destroy$.complete();\n\t}\n\n\tprivate updateView(): void {\n\t\tthis.#viewContainer.clear();\n\t\tthis._viewRef = this.#viewContainer.createEmbeddedView(this.#templateRef, this._context);\n\t}\n\n}\n","import { OnInit, OnDestroy, Directive, Renderer2, ViewContainerRef, Input, EmbeddedViewRef, TemplateRef, ChangeDetectorRef, inject } from \"@angular/core\";\nimport { Subscription, Subject, tap, filter, pairwise, startWith } from \"rxjs\";\n\nimport { ViewportService } from \"./viewport.service\";\nimport {\n\tisViewportSizeMatcherExpression,\n\tisViewportSizeMatcherTupleExpression,\n\tisViewportConditionMatch\n} from \"./viewport.util\";\nimport { ViewportSizeTypeInfo, ViewportMatchConditions, ViewportSizeMatcherExpression } from \"./viewport.model\";\n\nexport class SsvViewportMatcherContext implements ViewportMatchConditions {\n\n\tsizeType: string | string[] | null = null;\n\tsizeTypeExclude: string | string[] | null = null;\n\texpression?: ViewportSizeMatcherExpression;\n\n}\n\n@Directive({\n\tselector: \"[ssvViewportMatcher]\",\n\texportAs: \"ssvViewportMatcher\",\n\tstandalone: true,\n})\nexport class SsvViewportMatcherDirective implements OnInit, OnDestroy {\n\t#viewport = inject(ViewportService);\n\t#renderer = inject(Renderer2);\n\t#viewContainer = inject(ViewContainerRef);\n\t#cdr = inject(ChangeDetectorRef);\n\n\tsizeInfo: ViewportSizeTypeInfo | undefined;\n\n\tprivate _context: SsvViewportMatcherContext = new SsvViewportMatcherContext();\n\tprivate _thenTemplateRef: TemplateRef<SsvViewportMatcherContext> | null = null;\n\tprivate _elseTemplateRef: TemplateRef<SsvViewportMatcherContext> | null = null;\n\tprivate _thenViewRef: EmbeddedViewRef<SsvViewportMatcherContext> | null = null;\n\tprivate _elseViewRef: EmbeddedViewRef<SsvViewportMatcherContext> | null = null;\n\tprivate sizeType$$ = Subscription.EMPTY;\n\tprivate cssClass$$ = Subscription.EMPTY;\n\tprivate readonly _update$ = new Subject<SsvViewportMatcherContext>();\n\n\t@Input() set ssvViewportMatcher(value: string | string[] | ViewportSizeMatcherExpression) {\n\t\tif (isViewportSizeMatcherExpression(value)) {\n\t\t\tthis._context.expression = value;\n\t\t} else if (isViewportSizeMatcherTupleExpression(value)) {\n\t\t\tconst [op, size] = value;\n\t\t\tthis._context.expression = {\n\t\t\t\toperation: op,\n\t\t\t\tsize\n\t\t\t};\n\t\t} else {\n\t\t\tthis._context.sizeType = value;\n\t\t}\n\n\t\tif (this.sizeInfo) {\n\t\t\tthis._update$.next(this._context);\n\t\t}\n\t}\n\n\t@Input() set ssvViewportMatcherExclude(value: string | string[]) {\n\t\tthis._context.sizeTypeExclude = value;\n\n\t\tif (this.sizeInfo) {\n\t\t\tthis._update$.next(this._context);\n\t\t}\n\t}\n\n\t@Input() set ssvViewportMatcherElse(templateRef: TemplateRef<SsvViewportMatcherContext> | null) {\n\t\tthis._elseTemplateRef = templateRef;\n\t\tthis._elseViewRef = null; // clear previous view if any.\n\t\tif (this.sizeInfo) {\n\t\t\tthis._update$.next(this._context);\n\t\t}\n\t}\n\n\tconstructor() {\n\t\tconst templateRef = inject<TemplateRef<SsvViewportMatcherContext>>(TemplateRef);\n\n\t\tthis._thenTemplateRef = templateRef;\n\t}\n\n\tngOnInit(): void {\n\t\t// console.log(\"ssvViewportMatcher init\");\n\n\t\tthis._update$\n\t\t\t.pipe(\n\t\t\t\t// tap(x => console.log(\">>> ssvViewportMatcher - update triggered\", x)),\n\t\t\t\tfilter(() => !!this.sizeInfo),\n\t\t\t\t// tap(x => console.log(\">>> ssvViewportMatcher - updating...\", x)),\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\ttap(() => this._updateView(this.sizeInfo!)),\n\t\t\t\ttap(() => this.#cdr.markForCheck())\n\t\t\t)\n\t\t\t.subscribe();\n\n\t\tthis.sizeType$$ = this.#viewport.sizeType$\n\t\t\t.pipe(\n\t\t\t\t// tap(x => console.log(\"ssvViewportMatcher - sizeType changed\", x)),\n\t\t\t\ttap(x => this.sizeInfo = x),\n\t\t\t\ttap(() => this._update$.next(this._context)),\n\t\t\t)\n\t\t\t.subscribe();\n\n\t\tthis.cssClass$$ = this.#viewport.sizeType$\n\t\t\t.pipe(\n\t\t\t\tstartWith<ViewportSizeTypeInfo | undefined>(undefined),\n\t\t\t\tfilter(() => !!(this._thenViewRef || this._elseViewRef)),\n\t\t\t\tpairwise(),\n\t\t\t\ttap(([prev, curr]) => {\n\t\t\t\t\tconst el: Element = this._thenViewRef\n\t\t\t\t\t\t? this._thenViewRef.rootNodes[0]\n\t\t\t\t\t\t: this._elseViewRef?.rootNodes[0];\n\n\t\t\t\t\tif (!el.classList) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (prev) {\n\t\t\t\t\t\tthis.#renderer.removeClass(el, `ssv-vp-size--${prev.name}`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.#renderer.addClass(el, `ssv-vp-size--${curr?.name}`);\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.cssClass$$.unsubscribe();\n\t\tthis.sizeType$$.unsubscribe();\n\t\tthis._update$.complete();\n\t}\n\n\tprivate _updateView(sizeInfo: ViewportSizeTypeInfo) {\n\t\tif (isViewportConditionMatch(sizeInfo, this._context, this.#viewport.sizeTypeMap)) {\n\t\t\tif (!this._thenViewRef) {\n\t\t\t\tthis.#viewContainer.clear();\n\t\t\t\tthis._elseViewRef = null;\n\n\t\t\t\tif (this._thenTemplateRef) {\n\t\t\t\t\tthis._thenViewRef = this.#viewContainer.createEmbeddedView(\n\t\t\t\t\t\tthis._thenTemplateRef,\n\t\t\t\t\t\tthis._context,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this._elseViewRef) {\n\t\t\t\tthis.#viewContainer.clear();\n\t\t\t\tthis._thenViewRef = null;\n\n\t\t\t\tif (this._elseTemplateRef) {\n\t\t\t\t\tthis._elseViewRef = this.#viewContainer.createEmbeddedView(\n\t\t\t\t\t\tthis._elseTemplateRef,\n\t\t\t\t\t\tthis._context,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n}\n","import { NgModule } from \"@angular/core\";\n\nimport { ViewportDataPipe } from \"./viewport-data/viewport-data.pipe\";\nimport { SsvViewportMatcherVarDirective } from \"./viewport-matcher-var.directive\";\nimport { SsvViewportMatcherDirective } from \"./viewport-matcher.directive\";\n\nconst EXPORTED_IMPORTS = [\n\tSsvViewportMatcherDirective,\n\tSsvViewportMatcherVarDirective,\n\tViewportDataPipe,\n];\n\n@NgModule({\n\timports: [EXPORTED_IMPORTS],\n\texports: [EXPORTED_IMPORTS]\n})\nexport class SsvUxViewportModule {\n\n}","import { NgModule } from \"@angular/core\";\n\nimport { SsvUxViewportModule } from \"./viewport/viewport.module\";\n\nconst EXPORTED_IMPORTS = [\n\tSsvUxViewportModule,\n];\n\n@NgModule({\n\timports: [EXPORTED_IMPORTS],\n\texports: [EXPORTED_IMPORTS]\n})\nexport class SsvUxModule {\n\n}","export const VERSION = \"3.3.0-dev.76\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["matchStrategyHandlerMap","EXPORTED_IMPORTS"],"mappings":";;;;;IAOY,0BAeX;AAfD,CAAA,UAAY,yBAAyB,EAAA;;AAEpC,IAAA,yBAAA,CAAA,yBAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAK,CAAA;;AAGL,IAAA,yBAAA,CAAA,yBAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA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AA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAACA,kBAAgB,CAAC;oBAC3B,OAAO,EAAE,CAACA,kBAAgB,CAAC;AAC3B,iBAAA,CAAA;;;ACXD,MAAM,gBAAgB,GAAG;IACxB,mBAAmB;CACnB,CAAC;MAMW,WAAW,CAAA;uGAAX,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;wGAAX,WAAW,EAAA,OAAA,EAAA,CAPvB,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAAnB,mBAAmB,CAAA,EAAA,CAAA,CAAA;wGAOP,WAAW,EAAA,OAAA,EAAA,CAHb,gBAAgB,EAJ1B,mBAAmB,CAAA,EAAA,CAAA,CAAA;;2FAOP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC3B,iBAAA,CAAA;;;ACXM,MAAM,OAAO,GAAG;;ACAvB;;AAEG;;;;"}
1
+ {"version":3,"file":"ssv-ngx.ux.mjs","sources":["../../../../libs/ngx.ux/src/viewport/viewport-data/viewport-data-matcher.ts","../../../../libs/ngx.ux/src/platform/window.ts","../../../../libs/ngx.ux/src/viewport/viewport.model.ts","../../../../libs/ngx.ux/src/viewport/viewport-server-size.service.ts","../../../../libs/ngx.ux/src/viewport/viewport.util.ts","../../../../libs/ngx.ux/src/viewport/viewport.options.ts","../../../../libs/ngx.ux/src/viewport/viewport.service.ts","../../../../libs/ngx.ux/src/viewport/viewport-data/viewport-data.utils.ts","../../../../libs/ngx.ux/src/viewport/viewport-data/viewport-data.service.ts","../../../../libs/ngx.ux/src/viewport/viewport-data/viewport-data.pipe.ts","../../../../libs/ngx.ux/src/viewport/viewport-matcher-var.directive.ts","../../../../libs/ngx.ux/src/viewport/viewport-matcher.directive.ts","../../../../libs/ngx.ux/src/viewport/viewport.module.ts","../../../../libs/ngx.ux/src/ux.module.ts","../../../../libs/ngx.ux/src/version.ts","../../../../libs/ngx.ux/src/ssv-ngx.ux.ts"],"sourcesContent":["import type { Dictionary } from \"../../internal/internal.model\";\nimport type { ViewportSizeTypeInfo } from \"../viewport.model\";\n\nexport type ViewportDataConfig<TValue = unknown, TData = Dictionary<TValue>> = TData & {\n\tdefault?: TValue\n};\n\nexport enum ViewportDataMatchStrategy {\n\t/** Indicates that size should match exact or default. */\n\texact,\n\n\t/** Indicates that size matches when exact match, first match smaller (down) or default. */\n\tsmaller,\n\n\t/** Indicates that size matches when exact match, first match larger (up) or default. */\n\tlarger,\n\n\t/** Indicates that size matches when exact match, or it tries both smaller/larger (smaller is preferred) until match or default. */\n\tclosestSmallerFirst,\n\n\t/** Indicates that size matches when exact match, or it tries both larger/smaller (larger is preferred) until match or default. */\n\tclosestLargerFirst,\n}\nexport type ViewportDataMatchStrategyLiteral = keyof typeof ViewportDataMatchStrategy;\n\nexport interface ViewportDataMatcher<T = unknown> {\n\t(\n\t\tdataConfig: ViewportDataConfig<T>,\n\t\tcurrentSizeType: ViewportSizeTypeInfo,\n\t\tsizeTypes: ViewportSizeTypeInfo[],\n\t\tsizeTypeMap: Dictionary<ViewportSizeTypeInfo>,\n\t): T | undefined;\n}\n\n/**\n * Utility function to match data based on strategy and size.\n *\n * @param dataConfig Data config to generate rules based on.\n * @param sizeType Size type to get data for.\n * @param strategy Strategy to use when building rules.\n * @param sizeTypes Available size types ordered by index type. (Can be obtained from `ViewportService`)\n * @param sizeTypeMap Available size type map. (Can be obtained from `ViewportService`)\n * @returns Returns the matched data value.\n */\nexport function matchViewportData<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tsizeType: ViewportSizeTypeInfo,\n\tstrategy: ViewportDataMatchStrategy,\n\tsizeTypes: ViewportSizeTypeInfo[],\n\tsizeTypeMap: Dictionary<ViewportSizeTypeInfo>,\n): T | undefined {\n\tconst matchFn = matchStrategyHandlerMap[strategy];\n\tif (!matchFn) {\n\t\tthrow Error(`matchViewportData: Viewport Data strategy not implemented. Strategy: '${strategy}'`);\n\t}\n\tconst data = matchFn(dataConfig, sizeType, sizeTypes, sizeTypeMap) as T;\n\tif (data !== undefined) {\n\t\treturn data;\n\t}\n\treturn dataConfig.default;\n}\n\n\nconst matchStrategyHandlerMap: Dictionary<ViewportDataMatcher> = {\n\t[ViewportDataMatchStrategy.exact]: matchWithExact,\n\t[ViewportDataMatchStrategy.larger]: matchWithLargerMatch,\n\t[ViewportDataMatchStrategy.smaller]: matchWithSmallerMatch,\n\t[ViewportDataMatchStrategy.closestSmallerFirst]: matchWithClosestSmallerFirstMatch,\n\t[ViewportDataMatchStrategy.closestLargerFirst]: matchWithClosestLargerFirstMatch,\n};\n\nfunction matchWithExact<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n): T | undefined {\n\treturn dataConfig[currentSizeType.name];\n}\n\nfunction matchWithLargerMatch<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n): T | undefined {\n\tlet data = dataConfig[currentSizeType.name];\n\tif (data !== undefined) {\n\t\treturn data;\n\t}\n\n\tconst largestTypeIdx = sizeTypes[sizeTypes.length - 1].type;\n\tif (currentSizeType.type >= largestTypeIdx) {\n\t\treturn undefined;\n\t}\n\n\tfor (let index = currentSizeType.type; index < sizeTypes.length; index++) {\n\t\tconst sizeType = sizeTypes[index];\n\t\tdata = dataConfig[sizeType.name];\n\t\tif (data !== undefined) {\n\t\t\treturn data;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nfunction matchWithSmallerMatch<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n): T | undefined {\n\tlet data = dataConfig[currentSizeType.name];\n\tif (data !== undefined) {\n\t\treturn data;\n\t}\n\n\tif (currentSizeType.type <= 0) {\n\t\treturn undefined;\n\t}\n\n\t// eslint-disable-next-line for-direction\n\tfor (let index = currentSizeType.type; index < sizeTypes.length; index--) {\n\t\tconst sizeType = sizeTypes[index];\n\t\tdata = dataConfig[sizeType.name];\n\t\tif (data !== undefined) {\n\t\t\treturn data;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nfunction matchWithClosestSmallerFirstMatch<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n): T | undefined {\n\treturn closestMatch(dataConfig, currentSizeType, sizeTypes, true);\n}\n\nfunction matchWithClosestLargerFirstMatch<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n): T | undefined {\n\treturn closestMatch(dataConfig, currentSizeType, sizeTypes, false);\n}\n\nfunction closestMatch<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tcurrentSizeType: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n\tisSmallerFirst: boolean\n): T | undefined {\n\tlet data = dataConfig[currentSizeType.name];\n\tif (data !== undefined) {\n\t\treturn data;\n\t}\n\n\tlet downIndex = currentSizeType.type;\n\tlet upIndex = currentSizeType.type;\n\n\t \n\tfor (let index = 0; index < sizeTypes.length; index++) {\n\t\tfor (const idx of isSmallerFirst ? [--downIndex, ++upIndex] : [++upIndex, --downIndex]) {\n\t\t\tconst sizeType = sizeTypes[idx];\n\t\t\tif (sizeType) {\n\t\t\t\tdata = dataConfig[sizeType.name];\n\t\t\t\tif (data !== undefined) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined;\n}\n","import { InjectionToken, Injectable, inject } from \"@angular/core\";\n\nexport const WINDOW = new InjectionToken<Window>(\"Window\", {\n\tfactory: () => _window() as Window,\n});\n\nexport function _window(): unknown {\n\tif (typeof window !== \"undefined\") {\n\t\treturn window;\n\t}\n\treturn {};\n}\n\n@Injectable({\n\tprovidedIn: \"root\",\n})\nexport class WindowRef {\n\n\tprivate readonly window = inject(WINDOW);\n\n\t/** Window underlying native object. */\n\tget native(): Window {\n\t\treturn this.window as Window;\n\t}\n\n\t/** Determines whether native element is supported or not. Generally `false` when executing in SSR. */\n\tget hasNative(): boolean {\n\t\treturn !!this.native.window;\n\t}\n\n}\n","/**\n * The indices of each breakpoint provided based on the `UX_VIEWPORT_DEFAULT_BREAKPOINTS`.\n * @see UX_VIEWPORT_DEFAULT_BREAKPOINTS\n */\nexport enum ViewportSizeType {\n\txsmall = 0,\n\tsmall = 1,\n\tmedium = 2,\n\tlarge = 3,\n\txlarge = 4,\n\txxlarge = 5,\n\txxlarge1 = 6,\n}\n\nexport enum ComparisonOperation {\n\tequals = \"=\",\n\tnotEquals = \"<>\",\n\tlessThan = \"<\",\n\tlessOrEqualThan = \"<=\",\n\tgreaterThan = \">\",\n\tgreaterOrEqualThan = \">=\",\n}\n\nexport type ComparisonOperationKeyType = keyof typeof ComparisonOperation;\nexport type ComparisonOperationValueType = \"=\" | \"<>\" | \"<\" | \"<=\" | \">\" | \">=\"; // todo: find a better way to do this\nexport type ComparisonOperationLiteral = ComparisonOperationKeyType | ComparisonOperationValueType;\n\nexport enum DeviceType {\n\tdesktop = \"desktop\",\n\tmobile = \"mobile\",\n\ttablet = \"tablet\"\n}\n\nexport interface ViewportSize {\n\twidth: number;\n\theight: number;\n}\n\nexport interface ViewportSizeTypeInfo {\n\ttype: number;\n\tname: string;\n\twidthThreshold: number;\n}\n\nexport interface ViewportMatchConditions {\n\tsizeType?: string | string[] | null;\n\tsizeTypeExclude?: string | string[] | null;\n\texpression?: ViewportSizeMatcherExpression;\n}\n\nexport interface ViewportSizeMatcherExpression {\n\tsize: string;\n\toperation: ComparisonOperationLiteral;\n}\n","import { Injectable, InjectionToken, inject } from \"@angular/core\";\n\nimport { DeviceType, ViewportSize } from \"./viewport.model\";\n\n// todo: make this configurable\n/** Viewport size for SSR. */\nconst viewportSizeSSR: Record<DeviceType, ViewportSize> = {\n\t[DeviceType.desktop]: {\n\t\twidth: 1366,\n\t\theight: 768,\n\t},\n\t[DeviceType.tablet]: {\n\t\twidth: 768,\n\t\theight: 1024,\n\t},\n\t[DeviceType.mobile]: {\n\t\twidth: 414,\n\t\theight: 736,\n\t},\n};\n\nexport const VIEWPORT_SSR_DEVICE = new InjectionToken<DeviceType>(\"UX_VIEWPORT_SSR_DEVICE\", {\n\tfactory: () => DeviceType.desktop,\n\tprovidedIn: \"platform\",\n});\n\n@Injectable({\n\tprovidedIn: \"root\",\n})\nexport class ViewportServerSizeService {\n\n\tprivate readonly deviceType = inject(VIEWPORT_SSR_DEVICE);\n\n\tget(): ViewportSize {\n\t\treturn viewportSizeSSR[this.deviceType] || viewportSizeSSR[DeviceType.desktop];\n\t}\n\n}\n","import { Dictionary } from \"../internal/internal.model\";\nimport {\n\tComparisonOperation,\n\tViewportSizeMatcherExpression,\n\tViewportSizeTypeInfo,\n\tViewportMatchConditions\n} from \"./viewport.model\";\n\nexport function isViewportSizeMatcherExpression(value: unknown): value is ViewportSizeMatcherExpression {\n\tif (typeof value !== \"object\" || !value) {\n\t\treturn false;\n\t}\n\tconst args: Partial<ViewportSizeMatcherExpression> = value;\n\tif (args.size && args.operation) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nexport function isViewportSizeMatcherTupleExpression(arg: unknown): arg is [ComparisonOperation, string] {\n\tif (!arg) {\n\t\treturn false;\n\t}\n\tif (Array.isArray(arg)) {\n\t\tif (arg.length === 2) {\n\t\t\tconst [op] = arg;\n\t\t\treturn operations.includes(op);\n\t\t}\n\t}\n\treturn false;\n}\n\n\nconst operations = Object.values(ComparisonOperation);\n\nexport const COMPARISON_OPERATION_FUNC_MAPPING: Dictionary<(a: number, b: number) => boolean> = {\n\t[ComparisonOperation.equals]: (a: number, b: number) => a === b,\n\t[ComparisonOperation.notEquals]: (a: number, b: number) => a !== b,\n\t[ComparisonOperation.lessThan]: (a: number, b: number) => a < b,\n\t[ComparisonOperation.lessOrEqualThan]: (a: number, b: number) => a <= b,\n\t[ComparisonOperation.greaterThan]: (a: number, b: number) => a > b,\n\t[ComparisonOperation.greaterOrEqualThan]: (a: number, b: number) => a >= b,\n};\n\nexport function isViewportConditionMatch(\n\tevaluateSize: ViewportSizeTypeInfo,\n\tconditions: ViewportMatchConditions,\n\tviewportSizeTypeInfoRefs: Dictionary<ViewportSizeTypeInfo>\n): boolean {\n\tconst isExcluded = match(conditions.sizeTypeExclude, evaluateSize.name, false);\n\tlet isIncluded;\n\tlet isExpressionTruthy;\n\n\tif (!isExcluded && conditions.expression) {\n\t\tconst ref = viewportSizeTypeInfoRefs[conditions.expression.size];\n\t\tif(!ref) {\n\t\t\tthrow new Error(`Viewport size type is invalid. Size type: '${conditions.expression.size}'`);\n\t\t}\n\t\tconst expMatcher = COMPARISON_OPERATION_FUNC_MAPPING[conditions.expression.operation];\n\n\t\tisExpressionTruthy = expMatcher(evaluateSize.type, ref.type);\n\t} else {\n\t\tisIncluded = match(conditions.sizeType, evaluateSize.name, true);\n\t}\n\n\tconst shouldRender = (isExpressionTruthy || isIncluded) && !isExcluded;\n\t// console.warn(\">>> shouldRender\", { evaluateSize, conditions, shouldRender });\n\treturn !!shouldRender;\n}\n\nfunction match(value: string | string[] | null | undefined, targetValue: string, defaultValue: boolean) {\n\tif (!value) {\n\t\treturn defaultValue;\n\t}\n\n\treturn Array.isArray(value)\n\t\t? value.includes(targetValue)\n\t\t: value === targetValue;\n}\n\nexport function getSizeTypeInfo(width: number, sizeTypes: ViewportSizeTypeInfo[]): ViewportSizeTypeInfo {\n\tconst lastEntryIndex = sizeTypes.length - 1;\n\n\tfor (let idx = 0; idx < lastEntryIndex; idx++) {\n\t\tconst viewportSizeTypeInfo = sizeTypes[idx];\n\n\t\tif (width <= viewportSizeTypeInfo.widthThreshold) {\n\t\t\treturn viewportSizeTypeInfo;\n\t\t}\n\t}\n\n\treturn sizeTypes[lastEntryIndex];\n}\n\n/**\n * Converts the breakpoints into a 2 dimensional array containing the name and width, and sorted from\n * smallest to largest.\n * @param breakpoints the breakpoints obtained from the config\n * @internal\n */\nfunction getSortedBreakpoints(breakpoints: Dictionary<number>): [string, number][] {\n\treturn Object.entries(breakpoints)\n\t\t.sort(([, widthA], [, widthB]) => widthA - widthB);\n}\n\n/**\n * A util function which generates the ViewportSizeTypeInfo.type for each breakpoint.\n * @param breakpoints the custom breakpoints\n */\nexport function generateViewportSizeType<T extends Record<string, number>>(breakpoints: T): T & Record<number, string> {\n\treturn Object.freeze(\n\t\tgetSortedBreakpoints(breakpoints).reduce<Record<number | string, string | number>>(\n\t\t\t(dictionary, [name], index) => {\n\t\t\t\tdictionary[name] = index;\n\t\t\t\tdictionary[index] = name;\n\t\t\t\treturn dictionary;\n\t\t\t}, {}\n\t\t)\n\t) as T & Record<number, string>;\n}\n\n/**\n * Pre-processes the given breakpoints into an ordered list from smallest to largest while generating\n * all the necessary information on the viewport.\n * @param breakpoints the breakpoints obtained from the config\n * @internal\n */\nexport function generateViewportSizeTypeInfoList(breakpoints: Dictionary<number>): ViewportSizeTypeInfo[] {\n\treturn getSortedBreakpoints(breakpoints)\n\t\t.map(([name, width], index) =>\n\t\t\t(Object.freeze({\n\t\t\t\tname,\n\t\t\t\ttype: index,\n\t\t\t\twidthThreshold: width\n\t\t\t}))\n\t\t);\n}\n\n/**\n * Converts the breakpoint list into a dictionary while using the name as key.\n * @param breakpointList the list of breakpoints\n * @internal\n */\nexport function generateViewportSizeTypeInfoRefs(breakpointList: ViewportSizeTypeInfo[]): Dictionary<ViewportSizeTypeInfo> {\n\treturn Object.freeze(\n\t\tbreakpointList.reduce<Dictionary<ViewportSizeTypeInfo>>((dictionary, breakpoint) => {\n\t\t\tdictionary[breakpoint.name] = breakpoint;\n\t\t\tdictionary[breakpoint.type] = breakpoint;\n\t\t\treturn dictionary;\n\t\t}, {})\n\t);\n}\n","import { type EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from \"@angular/core\";\n\nimport type { Dictionary } from \"../internal/internal.model\";\nimport { ViewportDataMatchStrategy } from \"./viewport-data/viewport-data-matcher\";\nimport { VIEWPORT_SSR_DEVICE } from \"./viewport-server-size.service\";\nimport { DeviceType } from \"./viewport.model\";\n\n/** Default viewport breakpoints. */\nexport const UX_VIEWPORT_DEFAULT_BREAKPOINTS: Dictionary<number> = {\n\txsmall: 450,\n\tsmall: 767,\n\tmedium: 992,\n\tlarge: 1200,\n\txlarge: 1500,\n\txxlarge: 1920,\n\txxlarge1: 2100,\n};\n\nexport interface UxViewportOptions {\n\t/** Polling speed on resizing (in milliseconds). e.g. the higher the number the longer it takes to recalculate. */\n\tresizePollingSpeed: number;\n\n\t/** Breakpoints to use. Key needs to match the size type and the value the width threshold.\n\t * e.g. given width '1000' and `medium` is set to '992' => `large`.\n\t */\n\tbreakpoints: Dictionary<number>;\n\n\t/** Default data match strategy to use. */\n\tdefaultDataMatchStrategy: ViewportDataMatchStrategy;\n}\n\nconst DEFAULT_OPTIONS = Object.freeze<UxViewportOptions>({\n\tresizePollingSpeed: 33,\n\tbreakpoints: UX_VIEWPORT_DEFAULT_BREAKPOINTS,\n\tdefaultDataMatchStrategy: ViewportDataMatchStrategy.smaller,\n});\n\nexport const VIEWPORT_OPTIONS = new InjectionToken<UxViewportOptions>(\"SSV_UX_VIEWPORT_OPTIONS\", {\n\tfactory: () => DEFAULT_OPTIONS,\n});\n\nexport function provideSsvUxViewportOptions(\n\toptions: Partial<UxViewportOptions> | ((defaults: Readonly<UxViewportOptions>) => Partial<UxViewportOptions>),\n\t...features: EnvironmentProviders[]\n): EnvironmentProviders {\n\treturn makeEnvironmentProviders([\n\t\t{\n\t\t\tprovide: VIEWPORT_OPTIONS,\n\t\t\tuseFactory: () => {\n\t\t\t\tlet opts = typeof options === \"function\" ? options(DEFAULT_OPTIONS) : options;\n\t\t\t\topts = opts\n\t\t\t\t\t? {\n\t\t\t\t\t\t...DEFAULT_OPTIONS,\n\t\t\t\t\t\t...opts, // NOTE: breakpoints shoudn't be merged\n\t\t\t\t\t}\n\t\t\t\t\t: DEFAULT_OPTIONS;\n\t\t\t\treturn opts;\n\t\t\t},\n\t\t},\n\t\t...features,\n\t]);\n}\n\nexport function withViewportSsrDevice(options: DeviceType | (() => DeviceType)): EnvironmentProviders {\n\treturn makeEnvironmentProviders([\n\t\t{\n\t\t\tprovide: VIEWPORT_SSR_DEVICE,\n\t\t\tuseFactory: () => {\n\t\t\t\tconst deviceType = typeof options === \"function\" ? options() : options;\n\t\t\t\treturn deviceType;\n\t\t\t},\n\t\t},\n\t]);\n}","import { Injectable, Signal, inject } from \"@angular/core\";\nimport { toSignal } from \"@angular/core/rxjs-interop\";\nimport {\n\tObservable,\n\tfromEvent,\n\tmap,\n\tdistinctUntilChanged,\n\tstartWith,\n\tshare,\n\tshareReplay,\n\tauditTime,\n\tof,\n} from \"rxjs\";\n\nimport { ViewportSizeTypeInfo, ViewportSize } from \"./viewport.model\";\nimport { WindowRef } from \"../platform/window\";\nimport { ViewportServerSizeService } from \"./viewport-server-size.service\";\nimport { generateViewportSizeTypeInfoList, generateViewportSizeTypeInfoRefs, getSizeTypeInfo } from \"./viewport.util\";\nimport { VIEWPORT_OPTIONS } from \"./viewport.options\";\n\n@Injectable({\n\tprovidedIn: \"root\",\n})\nexport class ViewportService {\n\n\treadonly #viewportServerSize = inject(ViewportServerSizeService);\n\treadonly #windowRef = inject(WindowRef);\n\treadonly #config = inject(VIEWPORT_OPTIONS);\n\n\t/** Viewport size types list ordered by type, smallest to largest. */\n\treadonly sizeTypes = generateViewportSizeTypeInfoList(this.#config.breakpoints);\n\n\t/** Size types refs of the generated viewport size type info. */\n\treadonly sizeTypeMap = generateViewportSizeTypeInfoRefs(this.sizeTypes);\n\n\t/** Viewport size signal (which is also throttled). */\n\treadonly viewportSize: Signal<ViewportSize>;\n\n\t/** Viewport size type signal (which is also throttled). */\n\treadonly sizeType: Signal<ViewportSizeTypeInfo>;\n\n\t/** Window resize observable. */\n\treadonly resizeSnap$: Observable<ViewportSize>;\n\n\t/** Window resize observable (which is also throttled). */\n\treadonly resize$: Observable<ViewportSize>;\n\n\t/** Viewport size type observable (which is also throttled). */\n\treadonly sizeType$: Observable<ViewportSizeTypeInfo>;\n\n\t/** Viewport size type observable. */\n\treadonly sizeTypeSnap$: Observable<ViewportSizeTypeInfo>;\n\n\t/** Viewport size type snapshot of the last value. (Prefer use `sizeType$` observable when possible.) */\n\tget sizeTypeSnapshot(): ViewportSizeTypeInfo { return this.sizeType(); }\n\n\t/** Viewport size observable (which is also throttled). */\n\treadonly size$: Observable<ViewportSize>;\n\n\t/** Viewport size observable. */\n\treadonly sizeSnap$: Observable<ViewportSize>;\n\n\tconstructor(\n\t) {\n\t\tif (this.#windowRef.hasNative) {\n\t\t\tthis.resizeSnap$ = fromEvent<Event>(this.#windowRef.native, \"resize\").pipe(\n\t\t\t\tmap(() => this.getViewportSize()),\n\t\t\t\tshare()\n\t\t\t);\n\n\t\t\tthis.resize$ = this.resizeSnap$.pipe(\n\t\t\t\tauditTime(this.#config.resizePollingSpeed),\n\t\t\t\tshare(),\n\t\t\t);\n\t\t} else {\n\t\t\tthis.resizeSnap$ = this.resize$ = of(this.#viewportServerSize.get());\n\t\t}\n\t\tconst size = this.getViewportSize();\n\n\t\tconst sizeFn = (obs$: Observable<ViewportSize>) => obs$.pipe(\n\t\t\tstartWith(size),\n\t\t\tdistinctUntilChanged((a, b) => a.width === b.width && a.height === b.height),\n\t\t\tshareReplay(1),\n\t\t);\n\n\t\tthis.sizeSnap$ = sizeFn(this.resizeSnap$);\n\t\tthis.size$ = sizeFn(this.resize$);\n\n\t\tconst sizeTypeFn = (obs$: Observable<ViewportSize>) => obs$.pipe(\n\t\t\tdistinctUntilChanged((a, b) => a.width === b.width),\n\t\t\tmap(x => getSizeTypeInfo(x.width, this.sizeTypes)),\n\t\t\tdistinctUntilChanged(),\n\t\t\tshareReplay(1),\n\t\t);\n\n\t\tthis.sizeType$ = sizeTypeFn(this.size$);\n\t\tthis.sizeTypeSnap$ = sizeTypeFn(this.sizeSnap$);\n\n\t\tthis.viewportSize = toSignal(this.size$, { initialValue: size });\n\t\tthis.sizeType = toSignal(this.sizeTypeSnap$, { initialValue: getSizeTypeInfo(size.width, this.sizeTypes) });\n\t}\n\n\t/** Returns the current viewport size */\n\tprivate getViewportSize(): ViewportSize {\n\t\tif (!this.#windowRef.hasNative) {\n\t\t\treturn this.#viewportServerSize.get();\n\t\t}\n\n\t\tconst ua = navigator.userAgent.toLowerCase();\n\t\tif (ua.indexOf(\"safari\") !== -1 && ua.indexOf(\"chrome\") === -1) { // safari subtracts the scrollbar width\n\t\t\treturn {\n\t\t\t\twidth: this.#windowRef.native.document.documentElement.clientWidth,\n\t\t\t\theight: this.#windowRef.native.document.documentElement.clientHeight,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\twidth: this.#windowRef.native.innerWidth,\n\t\t\theight: this.#windowRef.native.innerHeight,\n\t\t};\n\t}\n\n}\n","import { Dictionary } from \"../../internal/internal.model\";\nimport { ViewportSizeTypeInfo } from \"../viewport.model\";\nimport { ViewportDataConfig, ViewportDataMatchStrategy } from \"./viewport-data-matcher\";\n\nexport interface ViewportDataRule<T> {\n\tmin?: number;\n\tmax?: number;\n\tvalue: T;\n}\n\n/**\n * Utility function to generate rules based on strategies.\n *\n * @param dataConfig Data config to generate rules based on.\n * @param strategy Strategy to use when building rules.\n * @param sizeTypes Available size types ordered by index type. (Can be obtained from `ViewportService`)\n * @param sizeTypeMap Available size type map. (Can be obtained from `ViewportService`)\n * @returns Returns a collection of rules (ordered).\n */\nexport function generateViewportRulesRangeFromDataMatcher<T>(\n\tdataConfig: ViewportDataConfig<T>,\n\tstrategy: ViewportDataMatchStrategy,\n\tsizeTypes: ViewportSizeTypeInfo[],\n\tsizeTypeMap: Dictionary<ViewportSizeTypeInfo>,\n): ViewportDataRule<T>[] {\n\tconst ruleBuilderFn = matchStrategyHandlerMap[strategy];\n\tif (!ruleBuilderFn) {\n\t\tthrow Error(`generateViewportRulesRangeFromDataMatcher: Viewport Data strategy not implemented. Strategy: '${strategy}'`);\n\t}\n\n\tlet dataSizes: ViewportSizeTypeInfo[] = [];\n\tfor (const key in dataConfig) {\n\t\tif (Object.prototype.hasOwnProperty.call(dataConfig, key)) {\n\t\t\tconst data = dataConfig[key];\n\t\t\tif (data === undefined) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst size = sizeTypeMap[key];\n\t\t\tif (size) {\n\t\t\t\tdataSizes.push(size);\n\t\t\t}\n\t\t}\n\t}\n\tdataSizes = dataSizes.sort(({ type: typeA }, { type: typeB }) => typeA - typeB);\n\n\tconst rules: ViewportDataRule<T>[] = [];\n\tif (dataConfig.default) {\n\t\trules.push({ value: dataConfig.default, min: undefined, max: undefined });\n\t}\n\n\tlet prevRule: ViewportDataRule<T> | undefined;\n\tfor (let index = 0; index < dataSizes.length; index++) {\n\t\tconst prevDataSize = dataSizes[index - 1];\n\t\tconst nextDataSize = dataSizes[index + 1];\n\t\tconst dataSize = dataSizes[index];\n\t\tconst prevSize = sizeTypes[dataSize.type - 1];\n\t\t// const nextSize = sizeTypes[dataSize.type + 1];\n\t\tconst data = dataConfig[dataSize.name];\n\t\tconst rule: ViewportDataRule<T> = {\n\t\t\tvalue: data,\n\t\t\tmin: undefined,\n\t\t\tmax: undefined,\n\t\t};\n\n\t\truleBuilderFn(rule, dataSize, nextDataSize, prevDataSize, prevSize, prevRule, sizeTypes);\n\n\t\tprevRule = rule;\n\t\trules.push(rule);\n\t}\n\treturn rules;\n}\n\nexport interface ViewportRuleRangeBuilder<T = unknown> {\n\t(\n\t\trule: ViewportDataRule<T>,\n\t\tdataSize: ViewportSizeTypeInfo,\n\t\tnextDataSize: ViewportSizeTypeInfo | undefined,\n\t\tprevDataSize: ViewportSizeTypeInfo | undefined,\n\t\tprevSize: ViewportSizeTypeInfo | undefined,\n\t\tprevRule: ViewportDataRule<T> | undefined,\n\t\tsizeTypes: ViewportSizeTypeInfo[],\n\t): void;\n}\n\nconst matchStrategyHandlerMap: Dictionary<ViewportRuleRangeBuilder> = {\n\t[ViewportDataMatchStrategy.exact]: (rule, dataSize, _nextDataSize, _prevDataSize, prevSize) => {\n\t\trule.max = dataSize.widthThreshold;\n\t\tif (prevSize) {\n\t\t\trule.min = prevSize.widthThreshold + 1;\n\t\t}\n\t},\n\t[ViewportDataMatchStrategy.smaller]: (rule, dataSize, nextDataSize, _prevDataSize, prevSize) => {\n\t\tif (nextDataSize) {\n\t\t\trule.max = dataSize.widthThreshold;\n\t\t}\n\t\tif (prevSize) {\n\t\t\trule.min = prevSize.widthThreshold + 1;\n\t\t}\n\t},\n\t[ViewportDataMatchStrategy.larger]: (rule, dataSize, _nextDataSize, prevDataSize) => {\n\t\tif (dataSize) {\n\t\t\trule.max = dataSize.widthThreshold;\n\t\t}\n\t\tif (prevDataSize) {\n\t\t\trule.min = prevDataSize.widthThreshold + 1;\n\t\t}\n\t},\n\t[ViewportDataMatchStrategy.closestSmallerFirst]: (rule, dataSize, nextDataSize, _prevDataSize, _prevSize, prevRule, sizeTypes) => {\n\t\tif (nextDataSize) {\n\t\t\trule.max = calculateClosestWidthThreshold(nextDataSize, dataSize, sizeTypes, true);\n\t\t}\n\t\tif (prevRule?.max) {\n\t\t\trule.min = prevRule.max + 1;\n\t\t}\n\t},\n\t[ViewportDataMatchStrategy.closestLargerFirst]: (rule, dataSize, nextDataSize, _prevDataSize, _prevSize, prevRule, sizeTypes) => {\n\t\tif (nextDataSize) {\n\t\t\trule.max = calculateClosestWidthThreshold(nextDataSize, dataSize, sizeTypes, false);\n\t\t}\n\t\tif (prevRule?.max) {\n\t\t\trule.min = prevRule.max + 1;\n\t\t}\n\t},\n};\n\nfunction calculateClosestWidthThreshold(\n\tnextDataSize: ViewportSizeTypeInfo,\n\tdataSize: ViewportSizeTypeInfo,\n\tsizeTypes: ViewportSizeTypeInfo[],\n\tisSmallerPreferred: boolean,\n) {\n\tconst fn = isSmallerPreferred ? Math.ceil : Math.floor;\n\t// get closest between curr and next\n\tconst diffIndex = fn((nextDataSize.type - dataSize.type - 1) / 2);\n\tconst diffNextSize = sizeTypes[dataSize.type + diffIndex];\n\treturn (diffNextSize || dataSize).widthThreshold;\n}\n","import { inject, Injectable } from \"@angular/core\";\nimport { Observable, distinctUntilChanged, map } from \"rxjs\";\n\nimport { ViewportSizeTypeInfo } from \"../viewport.model\";\nimport { ViewportService } from \"../viewport.service\";\nimport { matchViewportData, ViewportDataConfig, ViewportDataMatchStrategy } from \"./viewport-data-matcher\";\nimport { generateViewportRulesRangeFromDataMatcher, ViewportDataRule } from \"./viewport-data.utils\";\nimport { VIEWPORT_OPTIONS } from \"../viewport.options\";\n\n@Injectable({\n\tprovidedIn: \"root\",\n})\nexport class ViewportDataService {\n\n\treadonly #viewport = inject(ViewportService);\n\treadonly #config = inject(VIEWPORT_OPTIONS);\n\n\t/** Get data for match. */\n\tget<T>(\n\t\tdataConfig: ViewportDataConfig<T>,\n\t\tstrategy: ViewportDataMatchStrategy = this.#config.defaultDataMatchStrategy,\n\t\tsizeType: ViewportSizeTypeInfo = this.#viewport.sizeTypeSnapshot\n\t): T | undefined {\n\t\treturn matchViewportData(dataConfig, sizeType, strategy, this.#viewport.sizeTypes, this.#viewport.sizeTypeMap);\n\t}\n\n\t/** Get data for match as observable. */\n\tget$<T>(dataConfig: ViewportDataConfig<T>, strategy?: ViewportDataMatchStrategy, throttle = true): Observable<T | undefined> {\n\t\treturn (throttle ? this.#viewport.sizeType$ : this.#viewport.sizeTypeSnap$).pipe(\n\t\t\tmap(sizeType => this.get<T>(dataConfig, strategy, sizeType)),\n\t\t\tdistinctUntilChanged(),\n\t\t);\n\t}\n\n\t/** Generate rules based on strategies for data. */\n\tgenerateRules<T>(\n\t\tdataConfig: ViewportDataConfig<T>,\n\t\tstrategy: ViewportDataMatchStrategy = this.#config.defaultDataMatchStrategy,\n\t): ViewportDataRule<T>[] {\n\t\treturn generateViewportRulesRangeFromDataMatcher(\n\t\t\tdataConfig,\n\t\t\tstrategy,\n\t\t\tthis.#viewport.sizeTypes,\n\t\t\tthis.#viewport.sizeTypeMap\n\t\t);\n\t}\n\n}\n","import { Subscription, tap } from \"rxjs\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { Pipe, PipeTransform, ChangeDetectorRef, inject, DestroyRef } from \"@angular/core\";\n\nimport { ViewportDataConfig, ViewportDataMatchStrategy, ViewportDataMatchStrategyLiteral } from \"./viewport-data-matcher\";\nimport { ViewportDataService } from \"./viewport-data.service\";\n\n\n@Pipe({\n\tname: \"ssvViewportData\",\n\tpure: false,\n\tstandalone: true,\n})\nexport class ViewportDataPipe implements PipeTransform {\n\t#viewportData = inject(ViewportDataService);\n\t#cdr = inject(ChangeDetectorRef);\n\t#destroyRef = inject(DestroyRef);\n\n\tprivate markForTransform = true;\n\tprivate value: unknown;\n\tprivate data: ViewportDataConfig | undefined;\n\tprivate strategy: ViewportDataMatchStrategyLiteral | undefined;\n\tprivate data$$ = Subscription.EMPTY;\n\n\ttransform(data: ViewportDataConfig, strategy: ViewportDataMatchStrategyLiteral): unknown {\n\t\tif (!this.markForTransform && data === this.data && strategy === this.strategy) {\n\t\t\treturn this.value;\n\t\t}\n\t\tthis.data = data;\n\t\tthis.strategy = strategy;\n\n\t\tthis.data$$.unsubscribe();\n\t\tthis.data$$ = this.#viewportData.get$(data, ViewportDataMatchStrategy[strategy]).pipe(\n\t\t\ttap(value => {\n\t\t\t\tthis.markForTransform = true;\n\t\t\t\tthis.value = value;\n\t\t\t\tthis.#cdr.markForCheck();\n\t\t\t}),\n\t\t\ttakeUntilDestroyed(this.#destroyRef),\n\t\t).subscribe();\n\n\t\tthis.markForTransform = false;\n\t\treturn this.value;\n\t}\n\n}\n","import { OnInit, Directive, Input, TemplateRef, ViewContainerRef, EmbeddedViewRef, inject, DestroyRef } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { combineLatest, ReplaySubject, tap, map } from \"rxjs\";\n\nimport { ViewportService } from \"./viewport.service\";\nimport {\n\tisViewportSizeMatcherExpression,\n\tisViewportSizeMatcherTupleExpression,\n\tisViewportConditionMatch\n} from \"./viewport.util\";\nimport { ViewportMatchConditions, ViewportSizeMatcherExpression } from \"./viewport.model\";\n\nconst NAME_CAMEL = \"ssvViewportMatcherVar\";\n\nexport class SsvViewportMatcherVarContext {\n\n\tconstructor(\n\t\tpublic $implicit = false,\n\t) { }\n\n}\n\n@Directive({\n\tselector: `[${NAME_CAMEL}]`,\n\tstandalone: true,\n})\nexport class SsvViewportMatcherVar implements OnInit {\n\t#viewport = inject(ViewportService);\n\t#viewContainer = inject(ViewContainerRef);\n\t#templateRef = inject<TemplateRef<SsvViewportMatcherVarContext>>(TemplateRef);\n\t#destroyRef = inject(DestroyRef);\n\n\tprivate _matchConditions: ViewportMatchConditions = {};\n\tprivate _context = new SsvViewportMatcherVarContext();\n\tprivate readonly _update$ = new ReplaySubject<void>(1);\n\tprivate _viewRef!: EmbeddedViewRef<SsvViewportMatcherVarContext>;\n\n\t@Input(`${NAME_CAMEL}When`) set condition(value: string | string[] | ViewportSizeMatcherExpression) {\n\t\tif (isViewportSizeMatcherExpression(value)) {\n\t\t\tthis._matchConditions.expression = value;\n\t\t} else if (isViewportSizeMatcherTupleExpression(value)) {\n\t\t\tconst [op, size] = value;\n\t\t\tthis._matchConditions.expression = {\n\t\t\t\toperation: op,\n\t\t\t\tsize\n\t\t\t};\n\t\t} else {\n\t\t\tthis._matchConditions.sizeType = value;\n\t\t}\n\n\t\tthis._update$.next();\n\t}\n\n\tngOnInit(): void {\n\t\tthis.updateView();\n\t\tcombineLatest([this.#viewport.sizeType$, this._update$]).pipe(\n\t\t\tmap(([sizeType]) => isViewportConditionMatch(sizeType, this._matchConditions, this.#viewport.sizeTypeMap)),\n\t\t\ttap(x => this._context.$implicit = x),\n\t\t\ttap(() => this._viewRef.markForCheck()),\n\t\t\ttakeUntilDestroyed(this.#destroyRef),\n\t\t).subscribe();\n\t}\n\n\tprivate updateView(): void {\n\t\tthis.#viewContainer.clear();\n\t\tthis._viewRef = this.#viewContainer.createEmbeddedView(this.#templateRef, this._context);\n\t}\n\n}\n","import { OnInit, Directive, Renderer2, ViewContainerRef, Input, EmbeddedViewRef, TemplateRef, ChangeDetectorRef, inject, DestroyRef } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { Subject, tap, filter, pairwise, startWith } from \"rxjs\";\n\nimport { ViewportService } from \"./viewport.service\";\nimport {\n\tisViewportSizeMatcherExpression,\n\tisViewportSizeMatcherTupleExpression,\n\tisViewportConditionMatch\n} from \"./viewport.util\";\nimport { ViewportSizeTypeInfo, ViewportMatchConditions, ViewportSizeMatcherExpression } from \"./viewport.model\";\n\nexport class SsvViewportMatcherContext implements ViewportMatchConditions {\n\n\tsizeType: string | string[] | null = null;\n\tsizeTypeExclude: string | string[] | null = null;\n\texpression?: ViewportSizeMatcherExpression;\n\n}\n\n@Directive({\n\tselector: \"[ssvViewportMatcher]\",\n\texportAs: \"ssvViewportMatcher\",\n\tstandalone: true,\n})\nexport class SsvViewportMatcher implements OnInit {\n\t#viewport = inject(ViewportService);\n\t#renderer = inject(Renderer2);\n\t#viewContainer = inject(ViewContainerRef);\n\t#cdr = inject(ChangeDetectorRef);\n\t#destroyRef = inject(DestroyRef);\n\n\tsizeInfo: ViewportSizeTypeInfo | undefined;\n\n\tprivate _context: SsvViewportMatcherContext = new SsvViewportMatcherContext();\n\tprivate _thenTemplateRef: TemplateRef<SsvViewportMatcherContext> | null = null;\n\tprivate _elseTemplateRef: TemplateRef<SsvViewportMatcherContext> | null = null;\n\tprivate _thenViewRef: EmbeddedViewRef<SsvViewportMatcherContext> | null = null;\n\tprivate _elseViewRef: EmbeddedViewRef<SsvViewportMatcherContext> | null = null;\n\n\tprivate readonly _update$ = new Subject<SsvViewportMatcherContext>();\n\n\t@Input() set ssvViewportMatcher(value: string | string[] | ViewportSizeMatcherExpression) {\n\t\tif (isViewportSizeMatcherExpression(value)) {\n\t\t\tthis._context.expression = value;\n\t\t} else if (isViewportSizeMatcherTupleExpression(value)) {\n\t\t\tconst [op, size] = value;\n\t\t\tthis._context.expression = {\n\t\t\t\toperation: op,\n\t\t\t\tsize\n\t\t\t};\n\t\t} else {\n\t\t\tthis._context.sizeType = value;\n\t\t}\n\n\t\tif (this.sizeInfo) {\n\t\t\tthis._update$.next(this._context);\n\t\t}\n\t}\n\n\t@Input() set ssvViewportMatcherExclude(value: string | string[]) {\n\t\tthis._context.sizeTypeExclude = value;\n\n\t\tif (this.sizeInfo) {\n\t\t\tthis._update$.next(this._context);\n\t\t}\n\t}\n\n\t@Input() set ssvViewportMatcherElse(templateRef: TemplateRef<SsvViewportMatcherContext> | null) {\n\t\tthis._elseTemplateRef = templateRef;\n\t\tthis._elseViewRef = null; // clear previous view if any.\n\t\tif (this.sizeInfo) {\n\t\t\tthis._update$.next(this._context);\n\t\t}\n\t}\n\n\tconstructor() {\n\t\tconst templateRef = inject<TemplateRef<SsvViewportMatcherContext>>(TemplateRef);\n\n\t\tthis._thenTemplateRef = templateRef;\n\n\t\tthis.#destroyRef.onDestroy(() => {\n\t\t\tthis._update$.complete();\n\t\t});\n\t}\n\n\tngOnInit(): void {\n\t\t// console.log(\"ssvViewportMatcher init\");\n\n\t\tthis._update$\n\t\t\t.pipe(\n\t\t\t\t// tap(x => console.log(\">>> ssvViewportMatcher - update triggered\", x)),\n\t\t\t\tfilter(() => !!this.sizeInfo),\n\t\t\t\t// tap(x => console.log(\">>> ssvViewportMatcher - updating...\", x)),\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\ttap(() => this._updateView(this.sizeInfo!)),\n\t\t\t\ttap(() => this.#cdr.markForCheck())\n\t\t\t)\n\t\t\t.subscribe();\n\n\t\tthis.#viewport.sizeType$\n\t\t\t.pipe(\n\t\t\t\t// tap(x => console.log(\"ssvViewportMatcher - sizeType changed\", x)),\n\t\t\t\ttap(x => this.sizeInfo = x),\n\t\t\t\ttap(() => this._update$.next(this._context)),\n\t\t\t\ttakeUntilDestroyed(this.#destroyRef),\n\t\t\t)\n\t\t\t.subscribe();\n\n\t\tthis.#viewport.sizeType$\n\t\t\t.pipe(\n\t\t\t\tstartWith<ViewportSizeTypeInfo | undefined>(undefined),\n\t\t\t\tfilter(() => !!(this._thenViewRef || this._elseViewRef)),\n\t\t\t\tpairwise(),\n\t\t\t\ttap(([prev, curr]) => {\n\t\t\t\t\tconst el: Element = this._thenViewRef\n\t\t\t\t\t\t? this._thenViewRef.rootNodes[0]\n\t\t\t\t\t\t: this._elseViewRef?.rootNodes[0];\n\n\t\t\t\t\tif (!el.classList) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (prev) {\n\t\t\t\t\t\tthis.#renderer.removeClass(el, `ssv-vp-size--${prev.name}`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.#renderer.addClass(el, `ssv-vp-size--${curr?.name}`);\n\t\t\t\t}),\n\t\t\t\ttakeUntilDestroyed(this.#destroyRef),\n\t\t\t)\n\t\t\t.subscribe();\n\t}\n\n\tprivate _updateView(sizeInfo: ViewportSizeTypeInfo) {\n\t\tif (isViewportConditionMatch(sizeInfo, this._context, this.#viewport.sizeTypeMap)) {\n\t\t\tif (!this._thenViewRef) {\n\t\t\t\tthis.#viewContainer.clear();\n\t\t\t\tthis._elseViewRef = null;\n\n\t\t\t\tif (this._thenTemplateRef) {\n\t\t\t\t\tthis._thenViewRef = this.#viewContainer.createEmbeddedView(\n\t\t\t\t\t\tthis._thenTemplateRef,\n\t\t\t\t\t\tthis._context,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this._elseViewRef) {\n\t\t\t\tthis.#viewContainer.clear();\n\t\t\t\tthis._thenViewRef = null;\n\n\t\t\t\tif (this._elseTemplateRef) {\n\t\t\t\t\tthis._elseViewRef = this.#viewContainer.createEmbeddedView(\n\t\t\t\t\t\tthis._elseTemplateRef,\n\t\t\t\t\t\tthis._context,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n}\n","import { NgModule } from \"@angular/core\";\n\nimport { ViewportDataPipe } from \"./viewport-data/viewport-data.pipe\";\nimport { SsvViewportMatcherVar } from \"./viewport-matcher-var.directive\";\nimport { SsvViewportMatcher } from \"./viewport-matcher.directive\";\n\nconst EXPORTED_IMPORTS = [\n\tSsvViewportMatcher,\n\tSsvViewportMatcherVar,\n\tViewportDataPipe,\n];\n\n/** @deprecated Use standalone instead. */\n@NgModule({\n\timports: [EXPORTED_IMPORTS],\n\texports: [EXPORTED_IMPORTS]\n})\nexport class SsvUxViewportModule {\n\n}","import { NgModule } from \"@angular/core\";\n\nimport { SsvUxViewportModule } from \"./viewport/viewport.module\";\n\nconst EXPORTED_IMPORTS = [\n\tSsvUxViewportModule,\n];\n\n/** @deprecated Use standalone instead. */\n@NgModule({\n\timports: [EXPORTED_IMPORTS],\n\texports: [EXPORTED_IMPORTS]\n})\nexport class SsvUxModule {\n\n}","export const VERSION = \"3.3.0-dev.82\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["matchStrategyHandlerMap","EXPORTED_IMPORTS"],"mappings":";;;;;IAOY,0BAeX;AAfD,CAAA,UAAY,yBAAyB,EAAA;;AAEpC,IAAA,yBAAA,CAAA,yBAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAK,CAAA;;AAGL,IAAA,yBAAA,CAAA,yBAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA;;AAGP,IAAA,yBAAA,CAAA,yBAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAA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AAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;wGAAX,WAAW,EAAA,OAAA,EAAA,CARvB,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAAnB,mBAAmB,CAAA,EAAA,CAAA,CAAA;wGAQP,WAAW,EAAA,OAAA,EAAA,CAHb,gBAAgB,EAL1B,mBAAmB,CAAA,EAAA,CAAA,CAAA;;2FAQP,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACT,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,OAAO,EAAE,CAAC,gBAAgB,CAAC;AAC3B,iBAAA,CAAA;;;ACZM,MAAM,OAAO,GAAG;;ACAvB;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { OnInit, OnDestroy, TemplateRef, PipeTransform, InjectionToken, EnvironmentProviders, Signal } from '@angular/core';
2
+ import { OnInit, TemplateRef, PipeTransform, InjectionToken, EnvironmentProviders, Signal } from '@angular/core';
3
3
  import { Observable } from 'rxjs';
4
4
 
5
5
  /**
@@ -55,7 +55,7 @@ declare class SsvViewportMatcherContext implements ViewportMatchConditions {
55
55
  sizeTypeExclude: string | string[] | null;
56
56
  expression?: ViewportSizeMatcherExpression;
57
57
  }
58
- declare class SsvViewportMatcherDirective implements OnInit, OnDestroy {
58
+ declare class SsvViewportMatcher implements OnInit {
59
59
  #private;
60
60
  sizeInfo: ViewportSizeTypeInfo | undefined;
61
61
  private _context;
@@ -63,37 +63,32 @@ declare class SsvViewportMatcherDirective implements OnInit, OnDestroy {
63
63
  private _elseTemplateRef;
64
64
  private _thenViewRef;
65
65
  private _elseViewRef;
66
- private sizeType$$;
67
- private cssClass$$;
68
66
  private readonly _update$;
69
67
  set ssvViewportMatcher(value: string | string[] | ViewportSizeMatcherExpression);
70
68
  set ssvViewportMatcherExclude(value: string | string[]);
71
69
  set ssvViewportMatcherElse(templateRef: TemplateRef<SsvViewportMatcherContext> | null);
72
70
  constructor();
73
71
  ngOnInit(): void;
74
- ngOnDestroy(): void;
75
72
  private _updateView;
76
- static ɵfac: i0.ɵɵFactoryDeclaration<SsvViewportMatcherDirective, never>;
77
- static ɵdir: i0.ɵɵDirectiveDeclaration<SsvViewportMatcherDirective, "[ssvViewportMatcher]", ["ssvViewportMatcher"], { "ssvViewportMatcher": { "alias": "ssvViewportMatcher"; "required": false; }; "ssvViewportMatcherExclude": { "alias": "ssvViewportMatcherExclude"; "required": false; }; "ssvViewportMatcherElse": { "alias": "ssvViewportMatcherElse"; "required": false; }; }, {}, never, never, true, never>;
73
+ static ɵfac: i0.ɵɵFactoryDeclaration<SsvViewportMatcher, never>;
74
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SsvViewportMatcher, "[ssvViewportMatcher]", ["ssvViewportMatcher"], { "ssvViewportMatcher": { "alias": "ssvViewportMatcher"; "required": false; }; "ssvViewportMatcherExclude": { "alias": "ssvViewportMatcherExclude"; "required": false; }; "ssvViewportMatcherElse": { "alias": "ssvViewportMatcherElse"; "required": false; }; }, {}, never, never, true, never>;
78
75
  }
79
76
 
80
77
  declare class SsvViewportMatcherVarContext {
81
78
  $implicit: boolean;
82
79
  constructor($implicit?: boolean);
83
80
  }
84
- declare class SsvViewportMatcherVarDirective implements OnInit, OnDestroy {
81
+ declare class SsvViewportMatcherVar implements OnInit {
85
82
  #private;
86
83
  private _matchConditions;
87
84
  private _context;
88
- private readonly _destroy$;
89
85
  private readonly _update$;
90
86
  private _viewRef;
91
87
  set condition(value: string | string[] | ViewportSizeMatcherExpression);
92
88
  ngOnInit(): void;
93
- ngOnDestroy(): void;
94
89
  private updateView;
95
- static ɵfac: i0.ɵɵFactoryDeclaration<SsvViewportMatcherVarDirective, never>;
96
- static ɵdir: i0.ɵɵDirectiveDeclaration<SsvViewportMatcherVarDirective, "[ssvViewportMatcherVar]", never, { "condition": { "alias": "ssvViewportMatcherVarWhen"; "required": false; }; }, {}, never, never, true, never>;
90
+ static ɵfac: i0.ɵɵFactoryDeclaration<SsvViewportMatcherVar, never>;
91
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SsvViewportMatcherVar, "[ssvViewportMatcherVar]", never, { "condition": { "alias": "ssvViewportMatcherVarWhen"; "required": false; }; }, {}, never, never, true, never>;
97
92
  }
98
93
 
99
94
  interface Dictionary<T> {
@@ -117,7 +112,7 @@ declare enum ViewportDataMatchStrategy {
117
112
  }
118
113
  type ViewportDataMatchStrategyLiteral = keyof typeof ViewportDataMatchStrategy;
119
114
 
120
- declare class ViewportDataPipe implements PipeTransform, OnDestroy {
115
+ declare class ViewportDataPipe implements PipeTransform {
121
116
  #private;
122
117
  private markForTransform;
123
118
  private value;
@@ -125,17 +120,18 @@ declare class ViewportDataPipe implements PipeTransform, OnDestroy {
125
120
  private strategy;
126
121
  private data$$;
127
122
  transform(data: ViewportDataConfig, strategy: ViewportDataMatchStrategyLiteral): unknown;
128
- ngOnDestroy(): void;
129
123
  static ɵfac: i0.ɵɵFactoryDeclaration<ViewportDataPipe, never>;
130
124
  static ɵpipe: i0.ɵɵPipeDeclaration<ViewportDataPipe, "ssvViewportData", true>;
131
125
  }
132
126
 
127
+ /** @deprecated Use standalone instead. */
133
128
  declare class SsvUxViewportModule {
134
129
  static ɵfac: i0.ɵɵFactoryDeclaration<SsvUxViewportModule, never>;
135
- static ɵmod: i0.ɵɵNgModuleDeclaration<SsvUxViewportModule, never, [typeof SsvViewportMatcherDirective, typeof SsvViewportMatcherVarDirective, typeof ViewportDataPipe], [typeof SsvViewportMatcherDirective, typeof SsvViewportMatcherVarDirective, typeof ViewportDataPipe]>;
130
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SsvUxViewportModule, never, [typeof SsvViewportMatcher, typeof SsvViewportMatcherVar, typeof ViewportDataPipe], [typeof SsvViewportMatcher, typeof SsvViewportMatcherVar, typeof ViewportDataPipe]>;
136
131
  static ɵinj: i0.ɵɵInjectorDeclaration<SsvUxViewportModule>;
137
132
  }
138
133
 
134
+ /** @deprecated Use standalone instead. */
139
135
  declare class SsvUxModule {
140
136
  static ɵfac: i0.ɵɵFactoryDeclaration<SsvUxModule, never>;
141
137
  static ɵmod: i0.ɵɵNgModuleDeclaration<SsvUxModule, never, [typeof SsvUxViewportModule], [typeof SsvUxViewportModule]>;
@@ -219,7 +215,7 @@ declare class ViewportService {
219
215
  */
220
216
  declare function generateViewportSizeType<T extends Record<string, number>>(breakpoints: T): T & Record<number, string>;
221
217
 
222
- declare const VERSION = "3.3.0-dev.76";
218
+ declare const VERSION = "3.3.0-dev.82";
223
219
 
224
- export { ComparisonOperation, DeviceType, SsvUxModule, SsvUxViewportModule, SsvViewportMatcherContext, SsvViewportMatcherDirective, SsvViewportMatcherVarContext, SsvViewportMatcherVarDirective, VERSION, VIEWPORT_OPTIONS, VIEWPORT_SSR_DEVICE, ViewportDataMatchStrategy, ViewportDataPipe, ViewportDataService, ViewportServerSizeService, ViewportService, ViewportSizeType, generateViewportSizeType, provideSsvUxViewportOptions, withViewportSsrDevice };
220
+ export { ComparisonOperation, DeviceType, SsvUxModule, SsvUxViewportModule, SsvViewportMatcher, SsvViewportMatcherContext, SsvViewportMatcherVar, SsvViewportMatcherVarContext, VERSION, VIEWPORT_OPTIONS, VIEWPORT_SSR_DEVICE, ViewportDataMatchStrategy, ViewportDataPipe, ViewportDataService, ViewportServerSizeService, ViewportService, ViewportSizeType, generateViewportSizeType, provideSsvUxViewportOptions, withViewportSsrDevice };
225
221
  export type { ComparisonOperationKeyType, ComparisonOperationLiteral, ComparisonOperationValueType, UxViewportOptions, ViewportDataConfig, ViewportDataMatchStrategyLiteral, ViewportSize, ViewportSizeTypeInfo };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssv/ngx.ux",
3
- "version": "3.3.0-dev.76",
3
+ "version": "3.3.0-dev.82",
4
4
  "versionSuffix": "",
5
5
  "description": "UX essentials for building apps, utilities which enables you writing richer apps easier.",
6
6
  "keywords": [