@ethlete/query 0.1.0-next.20 → 0.1.0-next.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { getCookie, setCookie, deleteCookie, DestroyService } from '@ethlete/core';
1
+ import { getCookie, setCookie, deleteCookie, DestroyService, equal, clone } from '@ethlete/core';
2
2
  import { filter, takeWhile, switchMap, of, BehaviorSubject, Subject, interval, takeUntil, tap, timer, fromEvent, startWith, concat, take, debounceTime, combineLatest, map, distinctUntilChanged } from 'rxjs';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Directive, Input, InjectionToken, inject, ChangeDetectorRef, ViewContainerRef, TemplateRef, ErrorHandler, ElementRef } from '@angular/core';
@@ -823,9 +823,9 @@ class QueryDirective {
823
823
  }
824
824
  }
825
825
  }
826
- QueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: QueryDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ErrorHandler }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
827
- QueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.2", type: QueryDirective, isStandalone: true, selector: "[query]", inputs: { query: "query", cache: ["queryCache", "cache"] }, ngImport: i0 });
828
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: QueryDirective, decorators: [{
826
+ QueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: QueryDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ErrorHandler }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
827
+ QueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: QueryDirective, isStandalone: true, selector: "[query]", inputs: { query: "query", cache: ["queryCache", "cache"] }, ngImport: i0 });
828
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: QueryDirective, decorators: [{
829
829
  type: Directive,
830
830
  args: [{
831
831
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -1019,7 +1019,7 @@ class InfinityQueryDirective {
1019
1019
  itemsPerPage: null,
1020
1020
  };
1021
1021
  this._infinityQueryInstance = null;
1022
- this._destroy$ = inject(DestroyService, { self: true }).destroy$;
1022
+ this._destroy$ = inject(DestroyService, { host: true }).destroy$;
1023
1023
  this._cdr = inject(ChangeDetectorRef);
1024
1024
  this._viewContainerRef = inject(ViewContainerRef);
1025
1025
  this._mainTemplateRef = inject((TemplateRef));
@@ -1134,9 +1134,9 @@ class InfinityQueryDirective {
1134
1134
  this._data$.next([]);
1135
1135
  }
1136
1136
  }
1137
- InfinityQueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: InfinityQueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1138
- InfinityQueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.2", type: InfinityQueryDirective, isStandalone: true, selector: "[infinityQuery]", inputs: { infinityQuery: "infinityQuery" }, providers: [{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective }, DestroyService], exportAs: ["infinityQuery"], ngImport: i0 });
1139
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: InfinityQueryDirective, decorators: [{
1137
+ InfinityQueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: InfinityQueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1138
+ InfinityQueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: InfinityQueryDirective, isStandalone: true, selector: "[infinityQuery]", inputs: { infinityQuery: "infinityQuery" }, providers: [{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective }, DestroyService], exportAs: ["infinityQuery"], ngImport: i0 });
1139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: InfinityQueryDirective, decorators: [{
1140
1140
  type: Directive,
1141
1141
  args: [{
1142
1142
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -1186,9 +1186,9 @@ class InfinityQueryTriggerDirective {
1186
1186
  this._observer.observe(this._elementRef.nativeElement);
1187
1187
  }
1188
1188
  }
1189
- InfinityQueryTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: InfinityQueryTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1190
- InfinityQueryTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.2", type: InfinityQueryTriggerDirective, isStandalone: true, selector: "[infinityQueryTrigger], infinity-query-trigger", inputs: { scrollContainerSelector: "scrollContainerSelector" }, ngImport: i0 });
1191
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: InfinityQueryTriggerDirective, decorators: [{
1189
+ InfinityQueryTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: InfinityQueryTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1190
+ InfinityQueryTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.4", type: InfinityQueryTriggerDirective, isStandalone: true, selector: "[infinityQueryTrigger], infinity-query-trigger", inputs: { scrollContainerSelector: "scrollContainerSelector" }, ngImport: i0 });
1191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: InfinityQueryTriggerDirective, decorators: [{
1192
1192
  type: Directive,
1193
1193
  args: [{
1194
1194
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -1406,7 +1406,7 @@ class QueryForm {
1406
1406
  this.form = this._setupFormGroup();
1407
1407
  }
1408
1408
  observe(options) {
1409
- return combineLatest(Object.values(this._fields).map((field) => field.changes$)).pipe(map(() => this.form.getRawValue()), distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)), tap((values) => {
1409
+ return combineLatest(Object.values(this._fields).map((field) => field.changes$)).pipe(map(() => this.form.getRawValue()), distinctUntilChanged((a, b) => equal(a, b)), tap((values) => {
1410
1410
  if (options?.syncViaUrlQueryParams !== false) {
1411
1411
  this._syncViaUrlQueryParams(values);
1412
1412
  }
@@ -1467,7 +1467,7 @@ class QueryForm {
1467
1467
  if (!this._router || !this._activatedRoute) {
1468
1468
  return;
1469
1469
  }
1470
- const queryParams = structuredClone(this._activatedRoute.snapshot.queryParams);
1470
+ const queryParams = clone(this._activatedRoute.snapshot.queryParams);
1471
1471
  for (const [key, value] of Object.entries(values)) {
1472
1472
  if (this._isDefaultValue(key, value) || this._fields[key].data.appendToUrl === false) {
1473
1473
  delete queryParams[key];