@ethlete/query 4.10.0 → 4.11.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.
@@ -56,6 +56,24 @@ export interface BearerRefreshConfig<T extends AnyQueryCreator> {
56
56
  * The cookie name where the refresh token is stored
57
57
  */
58
58
  cookieName?: string;
59
+ /**
60
+ * The domain of the cookie. If not set, the current origin will be used.
61
+ *
62
+ * @example
63
+ * "https://example.com" -> "example.com"
64
+ * "https://sub.example.com" -> "example.com"
65
+ */
66
+ cookieDomain?: string;
67
+ /**
68
+ * The days until the cookie expires
69
+ * @default 30
70
+ */
71
+ cookieExpiresInDays?: number;
72
+ /**
73
+ * The path of the cookie
74
+ * @default '/'
75
+ */
76
+ cookiePath?: string;
59
77
  /**
60
78
  * Enable or disable the cookie
61
79
  * @default true
@@ -17,5 +17,7 @@ export declare class BearerAuthProvider<T extends AnyQueryCreator> implements Au
17
17
  cleanUp(): void;
18
18
  enableCookie(): void;
19
19
  disableCookie(): void;
20
+ private _setCookie;
21
+ private _deleteCookie;
20
22
  private _prepareForRefresh;
21
23
  }
@@ -1,27 +1,9 @@
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
- }
1
+ import { FormGroup } from '@angular/forms';
2
+ import { QueryFieldOptions, QueryFormGroupControls, QueryFormObserveOptions, QueryFormValue, QueryFormValueEvent } from './query-form.types';
15
3
  export declare class QueryField<T> {
16
4
  data: QueryFieldOptions<T>;
17
- changes$: import("rxjs").Observable<T | null>;
18
5
  get control(): import("@angular/forms").FormControl<T | null>;
19
- private _currentDebounceTimeout;
20
6
  constructor(data: QueryFieldOptions<T>);
21
- setValue(value: T | null, options?: {
22
- skipDebounce?: boolean;
23
- }): void;
24
- private _setupChangesObservable;
25
7
  }
26
8
  export declare class QueryForm<T extends Record<string, QueryField<any>>> {
27
9
  private _fields;
@@ -32,18 +14,16 @@ export declare class QueryForm<T extends Record<string, QueryField<any>>> {
32
14
  private readonly _defaultValues;
33
15
  private readonly _routerStateService;
34
16
  private readonly _zone;
17
+ private readonly _didValueChanges$;
35
18
  private _isObserving;
36
- readonly form: QueryFormGroup<QueryFormGroupControls<T>>;
19
+ readonly form: FormGroup<QueryFormGroupControls<T>>;
37
20
  private readonly _lastFormValue$;
38
21
  private readonly _currentFormValue$;
39
22
  private get _formValue();
40
23
  private readonly _changes$;
41
- readonly changes$: import("rxjs").Observable<{
42
- previousValue: QueryFormValue<T> | null;
43
- currentValue: QueryFormValue<T>;
44
- }>;
24
+ readonly changes$: import("rxjs").Observable<QueryFormValueEvent<T>>;
45
25
  get controls(): 0 extends 1 & QueryFormGroupControls<T> ? {
46
- [key: string]: AbstractControl<any, any>;
26
+ [key: string]: import("@angular/forms").AbstractControl<any, any>;
47
27
  } : QueryFormGroupControls<T>;
48
28
  get value(): QueryFormValue<T>;
49
29
  constructor(_fields: T);
@@ -52,11 +32,11 @@ export declare class QueryForm<T extends Record<string, QueryField<any>>> {
52
32
  unobserve(): void;
53
33
  setFormValueFromUrlQueryParams(options: {
54
34
  queryParams: Record<string, unknown>;
55
- skipDebounce?: boolean;
56
- }): void;
35
+ }): boolean;
57
36
  private _getDefaultValue;
58
37
  private _isDefaultValue;
59
38
  private _setupFormGroup;
60
39
  private _extractDefaultValues;
61
40
  private _syncViaUrlQueryParams;
41
+ private _handleFormChange;
62
42
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@ethlete/query",
3
- "version": "4.10.0",
3
+ "version": "4.11.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": "3.3.1"
10
+ "@ethlete/core": "3.4.0"
11
11
  },
12
12
  "module": "fesm2022/ethlete-query.mjs",
13
13
  "typings": "index.d.ts",