@ethlete/query 4.3.2 → 4.3.4

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.
@@ -2,7 +2,7 @@ import * as i1 from '@ethlete/core';
2
2
  import { BehaviorSubjectWithSubscriberCount, getCookie, setCookie, deleteCookie, createDestroy, DelayableDirective, RouterStateService, clone, equal, ET_PROPERTY_REMOVED } from '@ethlete/core';
3
3
  import { Observable, filter, takeWhile, switchMap, of, tap, BehaviorSubject, shareReplay, Subject, takeUntil, interval, skip, map, timer, combineLatest, withLatestFrom, fromEvent, startWith, debounceTime, take, concat } from 'rxjs';
4
4
  import * as i0 from '@angular/core';
5
- import { isDevMode, Directive, Input, InjectionToken, inject, ChangeDetectorRef, ViewContainerRef, TemplateRef, ErrorHandler, ElementRef, NgZone, assertInInjectionContext } from '@angular/core';
5
+ import { isDevMode, inject, TemplateRef, ViewContainerRef, ErrorHandler, ChangeDetectorRef, Directive, Input, InjectionToken, ElementRef, NgZone, assertInInjectionContext } from '@angular/core';
6
6
  import { FormGroup } from '@angular/forms';
7
7
  import { Router, ActivatedRoute } from '@angular/router';
8
8
 
@@ -1132,7 +1132,9 @@ class BearerAuthProvider {
1132
1132
  }
1133
1133
  else {
1134
1134
  this._tokens$.next({
1135
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1135
1136
  token: state.response['token'],
1137
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1136
1138
  refreshToken: state.response['refreshToken'],
1137
1139
  });
1138
1140
  }
@@ -1155,6 +1157,23 @@ class BearerAuthProvider {
1155
1157
  }
1156
1158
 
1157
1159
  class QueryDirective {
1160
+ constructor() {
1161
+ this._mainTemplateRef = inject(TemplateRef);
1162
+ this._viewContainerRef = inject(ViewContainerRef);
1163
+ this._errorHandler = inject(ErrorHandler);
1164
+ this._cdr = inject(ChangeDetectorRef);
1165
+ this._isMainViewCreated = false;
1166
+ this._subscription = null;
1167
+ this._viewContext = {
1168
+ $implicit: null,
1169
+ etQuery: null,
1170
+ loading: false,
1171
+ refreshing: false,
1172
+ error: null,
1173
+ progress: null,
1174
+ };
1175
+ this._cache = false;
1176
+ }
1158
1177
  get query() {
1159
1178
  return this._query;
1160
1179
  }
@@ -1168,23 +1187,6 @@ class QueryDirective {
1168
1187
  set cache(v) {
1169
1188
  this._cache = v;
1170
1189
  }
1171
- constructor(_mainTemplateRef, _viewContainerRef, _errorHandler, _cdr) {
1172
- this._mainTemplateRef = _mainTemplateRef;
1173
- this._viewContainerRef = _viewContainerRef;
1174
- this._errorHandler = _errorHandler;
1175
- this._cdr = _cdr;
1176
- this._isMainViewCreated = false;
1177
- this._subscription = null;
1178
- this._viewContext = {
1179
- $implicit: null,
1180
- etQuery: null,
1181
- loading: false,
1182
- refreshing: false,
1183
- error: null,
1184
- progress: null,
1185
- };
1186
- this._cache = false;
1187
- }
1188
1190
  static ngTemplateContextGuard(dir, ctx) {
1189
1191
  return true;
1190
1192
  }
@@ -1212,9 +1214,11 @@ class QueryDirective {
1212
1214
  }
1213
1215
  _updateView(state) {
1214
1216
  if (isQueryStateLoading(state)) {
1215
- this._viewContext.loading = true;
1216
1217
  this._viewContext.progress = state.progress ?? null;
1217
1218
  this._viewContext.refreshing = state.meta.triggeredVia === 'auto' || state.meta.triggeredVia === 'poll';
1219
+ if (!this._viewContext.refreshing) {
1220
+ this._viewContext.loading = true;
1221
+ }
1218
1222
  }
1219
1223
  else {
1220
1224
  this._viewContext.loading = false;
@@ -1244,17 +1248,17 @@ class QueryDirective {
1244
1248
  this._viewContainerRef.createEmbeddedView(this._mainTemplateRef, this._viewContext);
1245
1249
  }
1246
1250
  }
1247
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: QueryDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ErrorHandler }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1248
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.1", type: QueryDirective, isStandalone: true, selector: "[etQuery]", inputs: { query: ["etQuery", "query"], cache: ["etQueryCache", "cache"] }, ngImport: i0 }); }
1251
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: QueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1252
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: QueryDirective, isStandalone: true, selector: "[etQuery]", inputs: { query: ["etQuery", "query"], cache: ["etQueryCache", "cache"] }, ngImport: i0 }); }
1249
1253
  }
1250
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: QueryDirective, decorators: [{
1254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: QueryDirective, decorators: [{
1251
1255
  type: Directive,
1252
1256
  args: [{
1253
1257
  // eslint-disable-next-line @angular-eslint/directive-selector
1254
1258
  selector: '[etQuery]',
1255
1259
  standalone: true,
1256
1260
  }]
1257
- }], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.ErrorHandler }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { query: [{
1261
+ }], propDecorators: { query: [{
1258
1262
  type: Input,
1259
1263
  args: ['etQuery']
1260
1264
  }], cache: [{
@@ -1573,10 +1577,10 @@ class InfinityQueryDirective {
1573
1577
  this._viewContext.currentQuery = null;
1574
1578
  this._data$.next([]);
1575
1579
  }
1576
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: InfinityQueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1577
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.1", type: InfinityQueryDirective, isStandalone: true, selector: "[etInfinityQuery]", inputs: { infinityQuery: ["etInfinityQuery", "infinityQuery"] }, providers: [{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective }], exportAs: ["etInfinityQuery"], hostDirectives: [{ directive: i1.DelayableDirective }], ngImport: i0 }); }
1580
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: InfinityQueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1581
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: InfinityQueryDirective, isStandalone: true, selector: "[etInfinityQuery]", inputs: { infinityQuery: ["etInfinityQuery", "infinityQuery"] }, providers: [{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective }], exportAs: ["etInfinityQuery"], hostDirectives: [{ directive: i1.DelayableDirective }], ngImport: i0 }); }
1578
1582
  }
1579
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: InfinityQueryDirective, decorators: [{
1583
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: InfinityQueryDirective, decorators: [{
1580
1584
  type: Directive,
1581
1585
  args: [{
1582
1586
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -1627,10 +1631,10 @@ class InfinityQueryTriggerDirective {
1627
1631
  });
1628
1632
  this._observer.observe(this._elementRef.nativeElement);
1629
1633
  }
1630
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: InfinityQueryTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1631
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.1", type: InfinityQueryTriggerDirective, isStandalone: true, selector: "[etInfinityQueryTrigger], et-infinity-query-trigger", inputs: { scrollContainerSelector: "scrollContainerSelector" }, ngImport: i0 }); }
1634
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: InfinityQueryTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1635
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: InfinityQueryTriggerDirective, isStandalone: true, selector: "[etInfinityQueryTrigger], et-infinity-query-trigger", inputs: { scrollContainerSelector: "scrollContainerSelector" }, ngImport: i0 }); }
1632
1636
  }
1633
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: InfinityQueryTriggerDirective, decorators: [{
1637
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: InfinityQueryTriggerDirective, decorators: [{
1634
1638
  type: Directive,
1635
1639
  args: [{
1636
1640
  // eslint-disable-next-line @angular-eslint/directive-selector