@sumaris-net/ngx-components 1.12.13 → 1.13.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/bundles/sumaris-net.ngx-components.umd.js +104 -5
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +9 -2
- package/esm2015/src/app/core/auth/form/form-auth.js +2 -2
- package/esm2015/src/app/core/install/install-upgrade-card.component.js +3 -3
- package/esm2015/src/app/core/services/base-entity-service.class.js +6 -3
- package/esm2015/src/app/core/services/platform.service.js +4 -1
- package/esm2015/src/app/shared/observables.js +1 -1
- package/esm2015/src/app/shared/validator/validators.js +94 -2
- package/fesm2015/sumaris-net.ngx-components.js +102 -7
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/services/platform.service.d.ts +1 -0
- package/src/app/shared/validator/validators.d.ts +30 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AbstractControl, FormControl, ValidationErrors, ValidatorFn } from '@angular/forms';
|
|
1
|
+
import { AbstractControl, AsyncValidatorFn, FormControl, ValidationErrors, ValidatorFn } from '@angular/forms';
|
|
2
2
|
import { Moment, unitOfTime } from 'moment';
|
|
3
|
+
import { Observable, Subscription } from 'rxjs';
|
|
3
4
|
export declare class SharedValidators {
|
|
4
5
|
private static _REGEXP_CACHE;
|
|
5
6
|
private static getDoubleRegexp;
|
|
@@ -71,3 +72,31 @@ export declare class SharedFormArrayValidators {
|
|
|
71
72
|
*/
|
|
72
73
|
static validSumMaxValue(controlName: string, max: number): ValidatorFn;
|
|
73
74
|
}
|
|
75
|
+
export declare type ObservableValidatorFn = (control: AbstractControl) => Observable<ValidationErrors | null>;
|
|
76
|
+
export declare type PromiseValidatorFn = (control: AbstractControl) => Promise<ValidationErrors | null>;
|
|
77
|
+
export declare class SharedAsyncValidators {
|
|
78
|
+
private static DEBOUNCE_TIME_VALIDATOR_ID;
|
|
79
|
+
/**
|
|
80
|
+
* Add a debounce time to a validator.
|
|
81
|
+
* @param form
|
|
82
|
+
* @param validatorFn
|
|
83
|
+
* @param opts Use opts.stopSubject to stop the validator, before end
|
|
84
|
+
*/
|
|
85
|
+
static debounceTime(validatorFn: ValidatorFn | AsyncValidatorFn, opts?: {
|
|
86
|
+
dispose?: Observable<any>;
|
|
87
|
+
debounceTime?: number;
|
|
88
|
+
markForCheck?: () => void;
|
|
89
|
+
debug?: boolean;
|
|
90
|
+
}): ObservableValidatorFn;
|
|
91
|
+
/**
|
|
92
|
+
* Add an async validator, that can be disposed by the returned subscription
|
|
93
|
+
* @param form
|
|
94
|
+
* @param validatorFn the validator or job to execute
|
|
95
|
+
* @param opts
|
|
96
|
+
*/
|
|
97
|
+
static registerAsyncValidator(form: AbstractControl, validatorFn: ValidatorFn | AsyncValidatorFn, opts?: {
|
|
98
|
+
debounceTime?: number;
|
|
99
|
+
markForCheck?: () => void;
|
|
100
|
+
debug?: boolean;
|
|
101
|
+
}): Subscription;
|
|
102
|
+
}
|