@ethlete/query 4.3.1 → 4.3.3
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/esm2022/lib/auth/bearer-auth-provider.mjs +6 -3
- package/esm2022/lib/directives/infinity-query-trigger.directive.mjs +5 -6
- package/esm2022/lib/directives/infinity-query.directive.mjs +5 -6
- package/esm2022/lib/directives/query.directive.mjs +24 -25
- package/esm2022/lib/request/request.util.mjs +1 -1
- package/fesm2022/ethlete-query.mjs +33 -30
- package/fesm2022/ethlete-query.mjs.map +1 -1
- package/lib/auth/bearer-auth-provider.d.ts +1 -1
- package/lib/directives/infinity-query-trigger.directive.d.ts +1 -1
- package/lib/directives/infinity-query.directive.d.ts +1 -1
- package/lib/directives/query.directive.d.ts +2 -3
- package/lib/request/request.util.d.ts +1 -1
- package/package.json +2 -2
|
@@ -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,
|
|
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
|
|
|
@@ -1107,8 +1107,9 @@ class BearerAuthProvider {
|
|
|
1107
1107
|
* @internal
|
|
1108
1108
|
*/
|
|
1109
1109
|
_refreshQuery() {
|
|
1110
|
-
|
|
1111
|
-
|
|
1110
|
+
const currentQuery = this._currentRefreshQuery$.getValue();
|
|
1111
|
+
if (isQueryStateLoading(currentQuery?.rawState)) {
|
|
1112
|
+
return currentQuery;
|
|
1112
1113
|
}
|
|
1113
1114
|
const currentRefreshToken = this.tokens.refreshToken;
|
|
1114
1115
|
if (!currentRefreshToken || !this._config.refreshConfig) {
|
|
@@ -1131,7 +1132,9 @@ class BearerAuthProvider {
|
|
|
1131
1132
|
}
|
|
1132
1133
|
else {
|
|
1133
1134
|
this._tokens$.next({
|
|
1135
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1134
1136
|
token: state.response['token'],
|
|
1137
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1135
1138
|
refreshToken: state.response['refreshToken'],
|
|
1136
1139
|
});
|
|
1137
1140
|
}
|
|
@@ -1154,6 +1157,23 @@ class BearerAuthProvider {
|
|
|
1154
1157
|
}
|
|
1155
1158
|
|
|
1156
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
|
+
}
|
|
1157
1177
|
get query() {
|
|
1158
1178
|
return this._query;
|
|
1159
1179
|
}
|
|
@@ -1167,23 +1187,6 @@ class QueryDirective {
|
|
|
1167
1187
|
set cache(v) {
|
|
1168
1188
|
this._cache = v;
|
|
1169
1189
|
}
|
|
1170
|
-
constructor(_mainTemplateRef, _viewContainerRef, _errorHandler, _cdr) {
|
|
1171
|
-
this._mainTemplateRef = _mainTemplateRef;
|
|
1172
|
-
this._viewContainerRef = _viewContainerRef;
|
|
1173
|
-
this._errorHandler = _errorHandler;
|
|
1174
|
-
this._cdr = _cdr;
|
|
1175
|
-
this._isMainViewCreated = false;
|
|
1176
|
-
this._subscription = null;
|
|
1177
|
-
this._viewContext = {
|
|
1178
|
-
$implicit: null,
|
|
1179
|
-
etQuery: null,
|
|
1180
|
-
loading: false,
|
|
1181
|
-
refreshing: false,
|
|
1182
|
-
error: null,
|
|
1183
|
-
progress: null,
|
|
1184
|
-
};
|
|
1185
|
-
this._cache = false;
|
|
1186
|
-
}
|
|
1187
1190
|
static ngTemplateContextGuard(dir, ctx) {
|
|
1188
1191
|
return true;
|
|
1189
1192
|
}
|
|
@@ -1243,17 +1246,17 @@ class QueryDirective {
|
|
|
1243
1246
|
this._viewContainerRef.createEmbeddedView(this._mainTemplateRef, this._viewContext);
|
|
1244
1247
|
}
|
|
1245
1248
|
}
|
|
1246
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
1247
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
1249
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0", ngImport: i0, type: QueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1250
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.0", type: QueryDirective, isStandalone: true, selector: "[etQuery]", inputs: { query: ["etQuery", "query"], cache: ["etQueryCache", "cache"] }, ngImport: i0 }); }
|
|
1248
1251
|
}
|
|
1249
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
1252
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0", ngImport: i0, type: QueryDirective, decorators: [{
|
|
1250
1253
|
type: Directive,
|
|
1251
1254
|
args: [{
|
|
1252
1255
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
1253
1256
|
selector: '[etQuery]',
|
|
1254
1257
|
standalone: true,
|
|
1255
1258
|
}]
|
|
1256
|
-
}],
|
|
1259
|
+
}], propDecorators: { query: [{
|
|
1257
1260
|
type: Input,
|
|
1258
1261
|
args: ['etQuery']
|
|
1259
1262
|
}], cache: [{
|
|
@@ -1572,10 +1575,10 @@ class InfinityQueryDirective {
|
|
|
1572
1575
|
this._viewContext.currentQuery = null;
|
|
1573
1576
|
this._data$.next([]);
|
|
1574
1577
|
}
|
|
1575
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
1576
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
1578
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0", ngImport: i0, type: InfinityQueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1579
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.0", 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 }); }
|
|
1577
1580
|
}
|
|
1578
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
1581
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0", ngImport: i0, type: InfinityQueryDirective, decorators: [{
|
|
1579
1582
|
type: Directive,
|
|
1580
1583
|
args: [{
|
|
1581
1584
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
@@ -1626,10 +1629,10 @@ class InfinityQueryTriggerDirective {
|
|
|
1626
1629
|
});
|
|
1627
1630
|
this._observer.observe(this._elementRef.nativeElement);
|
|
1628
1631
|
}
|
|
1629
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.
|
|
1630
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.
|
|
1632
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.0", ngImport: i0, type: InfinityQueryTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1633
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.0", type: InfinityQueryTriggerDirective, isStandalone: true, selector: "[etInfinityQueryTrigger], et-infinity-query-trigger", inputs: { scrollContainerSelector: "scrollContainerSelector" }, ngImport: i0 }); }
|
|
1631
1634
|
}
|
|
1632
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.
|
|
1635
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.0", ngImport: i0, type: InfinityQueryTriggerDirective, decorators: [{
|
|
1633
1636
|
type: Directive,
|
|
1634
1637
|
args: [{
|
|
1635
1638
|
// eslint-disable-next-line @angular-eslint/directive-selector
|