@ethlete/query 4.2.1 → 4.3.0

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.
@@ -13,10 +13,13 @@ export declare class QueryField<T> {
13
13
  }
14
14
  export declare class QueryForm<T extends Record<string, QueryField<any>>> {
15
15
  private _fields;
16
- private _router;
17
- private _activatedRoute;
18
- private _defaultValues;
19
- form: FormGroup<QueryFormGroup<T>>;
16
+ private readonly _destroy$;
17
+ private readonly _unobserveTrigger$;
18
+ private readonly _router;
19
+ private readonly _activatedRoute;
20
+ private readonly _defaultValues;
21
+ private _isObserving;
22
+ readonly form: FormGroup<QueryFormGroup<T>>;
20
23
  private get _formValue();
21
24
  private readonly _changes$;
22
25
  readonly changes$: import("rxjs").Observable<QueryFormValueEvent<T>>;
@@ -25,11 +28,11 @@ export declare class QueryForm<T extends Record<string, QueryField<any>>> {
25
28
  } : QueryFormGroup<T>;
26
29
  get value(): QueryFormValue<T>;
27
30
  constructor(_fields: T);
28
- observe(options?: QueryFormObserveOptions): import("rxjs").Observable<null>;
31
+ observe(options?: QueryFormObserveOptions): void;
32
+ unobserve(): void;
29
33
  setFormValueFromUrlQueryParams(options?: {
30
34
  skipDebounce?: boolean;
31
35
  }): void;
32
- updateFormOnUrlQueryParamsChange(): import("rxjs").Observable<import("@angular/router").Params>;
33
36
  private _getDefaultValue;
34
37
  private _isDefaultValue;
35
38
  private _setupFormGroup;
@@ -62,8 +62,19 @@ export type QueryFormValue<T extends Record<string, QueryField<any>>> = {
62
62
  export interface QueryFormObserveOptions {
63
63
  /**
64
64
  * Whether the form value should be synced to the url query params.
65
+ * @default true
66
+ */
67
+ writeToQueryParams?: boolean;
68
+ /**
69
+ * Whether the form value should be updated when the url query params change.
70
+ * @default true
71
+ */
72
+ syncOnNavigation?: boolean;
73
+ /**
74
+ * If true, the navigation will not create a new entry in the browser's history.
75
+ * @default false
65
76
  */
66
- syncViaUrlQueryParams?: boolean;
77
+ replaceUrl?: boolean;
67
78
  }
68
79
  export interface QueryFormValueEvent<T extends Record<string, QueryField<any>>> {
69
80
  previousValue: QueryFormValue<T> | null;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@ethlete/query",
3
- "version": "4.2.1",
3
+ "version": "4.3.0",
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": "1.10.1"
10
+ "@ethlete/core": "2.1.0"
11
11
  },
12
12
  "module": "fesm2022/ethlete-query.mjs",
13
13
  "typings": "index.d.ts",