@ethlete/query 4.3.0 → 4.3.2
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 +4 -3
- package/esm2022/lib/directives/infinity-query-trigger.directive.mjs +3 -3
- package/esm2022/lib/directives/infinity-query.directive.mjs +3 -3
- package/esm2022/lib/directives/query.directive.mjs +3 -3
- package/esm2022/lib/query-form/query-form.mjs +102 -59
- package/esm2022/lib/query-form/query-form.types.mjs +1 -1
- package/fesm2022/ethlete-query.mjs +114 -70
- package/fesm2022/ethlete-query.mjs.map +1 -1
- package/lib/auth/bearer-auth-provider.d.ts +1 -1
- package/lib/query-form/query-form.d.ts +29 -8
- package/lib/query-form/query-form.types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -21,5 +21,5 @@ export declare class BearerAuthProvider<T extends AnyQueryCreator> implements Au
|
|
|
21
21
|
/**
|
|
22
22
|
* @internal
|
|
23
23
|
*/
|
|
24
|
-
_refreshQuery(): import("../query").Query<any, any, any, any, any, any> | undefined;
|
|
24
|
+
_refreshQuery(): import("../query").Query<any, any, any, any, any, any> | null | undefined;
|
|
25
25
|
}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import { FormGroup } from '@angular/forms';
|
|
2
|
-
import { QueryFieldOptions,
|
|
1
|
+
import { AbstractControl, FormGroup, ɵValue } from '@angular/forms';
|
|
2
|
+
import { QueryFieldOptions, QueryFormGroupControls, QueryFormObserveOptions, QueryFormValue } from './query-form.types';
|
|
3
|
+
export declare class QueryFormGroup<T extends {
|
|
4
|
+
[K in keyof T]: AbstractControl<any, any>;
|
|
5
|
+
} = any> extends FormGroup<T> {
|
|
6
|
+
patchValue(value: 0 extends 1 & T ? {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
} : Partial<{
|
|
9
|
+
[K in keyof T]: ɵValue<T[K]>;
|
|
10
|
+
}>, options?: {
|
|
11
|
+
onlySelf?: boolean | undefined;
|
|
12
|
+
emitEvent?: boolean | undefined;
|
|
13
|
+
} | undefined): void;
|
|
14
|
+
}
|
|
3
15
|
export declare class QueryField<T> {
|
|
4
16
|
data: QueryFieldOptions<T>;
|
|
5
17
|
changes$: import("rxjs").Observable<T | null>;
|
|
@@ -18,19 +30,28 @@ export declare class QueryForm<T extends Record<string, QueryField<any>>> {
|
|
|
18
30
|
private readonly _router;
|
|
19
31
|
private readonly _activatedRoute;
|
|
20
32
|
private readonly _defaultValues;
|
|
33
|
+
private readonly _routerStateService;
|
|
34
|
+
private readonly _zone;
|
|
21
35
|
private _isObserving;
|
|
22
|
-
readonly form:
|
|
36
|
+
readonly form: QueryFormGroup<QueryFormGroupControls<T>>;
|
|
37
|
+
private readonly _lastFormValue$;
|
|
38
|
+
private readonly _currentFormValue$;
|
|
23
39
|
private get _formValue();
|
|
24
40
|
private readonly _changes$;
|
|
25
|
-
readonly changes$: import("rxjs").Observable<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
41
|
+
readonly changes$: import("rxjs").Observable<{
|
|
42
|
+
previousValue: QueryFormValue<T> | null;
|
|
43
|
+
currentValue: QueryFormValue<T>;
|
|
44
|
+
}>;
|
|
45
|
+
get controls(): 0 extends 1 & QueryFormGroupControls<T> ? {
|
|
46
|
+
[key: string]: AbstractControl<any, any>;
|
|
47
|
+
} : QueryFormGroupControls<T>;
|
|
29
48
|
get value(): QueryFormValue<T>;
|
|
30
49
|
constructor(_fields: T);
|
|
31
50
|
observe(options?: QueryFormObserveOptions): void;
|
|
51
|
+
private _handleQueryFormResets;
|
|
32
52
|
unobserve(): void;
|
|
33
|
-
setFormValueFromUrlQueryParams(options
|
|
53
|
+
setFormValueFromUrlQueryParams(options: {
|
|
54
|
+
queryParams: Record<string, unknown>;
|
|
34
55
|
skipDebounce?: boolean;
|
|
35
56
|
}): void;
|
|
36
57
|
private _getDefaultValue;
|
|
@@ -53,7 +53,7 @@ export interface QueryFieldOptions<T = unknown> {
|
|
|
53
53
|
*/
|
|
54
54
|
valueToQueryParamTransformFn?: (val: T | null) => unknown;
|
|
55
55
|
}
|
|
56
|
-
export type
|
|
56
|
+
export type QueryFormGroupControls<T extends Record<string, QueryField<any>>> = {
|
|
57
57
|
[Property in keyof T]: T[Property]['control'];
|
|
58
58
|
};
|
|
59
59
|
export type QueryFormValue<T extends Record<string, QueryField<any>>> = {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/query",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.5.0"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"@angular/common": "^15.2.1 || ^16.0.0",
|
|
9
9
|
"@angular/core": "^15.2.1 || ^16.0.0",
|
|
10
|
-
"@ethlete/core": "2.
|
|
10
|
+
"@ethlete/core": "2.2.0"
|
|
11
11
|
},
|
|
12
12
|
"module": "fesm2022/ethlete-query.mjs",
|
|
13
13
|
"typings": "index.d.ts",
|