@rxap/forms 14.0.2 → 14.1.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.
- package/esm2020/lib/directives/form.directive.mjs +14 -4
- package/esm2020/lib/form-array.mjs +38 -11
- package/esm2020/lib/form-group.mjs +17 -3
- package/esm2020/lib/types.mjs +1 -1
- package/esm2020/lib/validators/index.mjs +6 -2
- package/esm2020/lib/validators/is-port.mjs +19 -0
- package/esm2020/lib/validators/is-uuid.mjs +19 -0
- package/fesm2015/rxap-forms.mjs +106 -17
- package/fesm2015/rxap-forms.mjs.map +1 -1
- package/fesm2020/rxap-forms.mjs +106 -17
- package/fesm2020/rxap-forms.mjs.map +1 -1
- package/lib/form-array.d.ts +5 -3
- package/lib/form-group.d.ts +1 -0
- package/lib/types.d.ts +26 -1
- package/lib/validators/index.d.ts +4 -0
- package/lib/validators/is-port.d.ts +4 -0
- package/lib/validators/is-uuid.d.ts +5 -0
- package/package.json +2 -2
package/lib/form-array.d.ts
CHANGED
|
@@ -42,8 +42,9 @@ export declare class RxapFormArray<T = any, E extends object = any, Parent exten
|
|
|
42
42
|
*
|
|
43
43
|
* @param index (optional) the index where the control should be created
|
|
44
44
|
* @param state (optional) the initial state of the new control
|
|
45
|
+
* @param options (optional) ControlEventOptions
|
|
45
46
|
*/
|
|
46
|
-
insertAt(index?: number, state?: T): void;
|
|
47
|
+
insertAt(index?: number, state?: T, options?: ControlEventOptions): void;
|
|
47
48
|
disabledWhile(observable: Observable<boolean>, options?: ControlOptions): Subscription;
|
|
48
49
|
enabledWhile(observable: Observable<boolean>, options?: ControlOptions): Subscription;
|
|
49
50
|
mergeValidators(validators: Validator): void;
|
|
@@ -54,13 +55,14 @@ export declare class RxapFormArray<T = any, E extends object = any, Parent exten
|
|
|
54
55
|
markAllAsUntouched(): void;
|
|
55
56
|
validateOn(observableValidation: Observable<null | object>): Subscription;
|
|
56
57
|
hasErrorAndTouched(errorCode: ExtractStrings<E>, path?: ControlPath): boolean;
|
|
58
|
+
private _patchValue;
|
|
57
59
|
patchValue(valueOrObservable: any, options?: ControlEventOptions): Subscription | void;
|
|
58
60
|
hasErrorAndDirty(errorCode: ExtractStrings<E>, path?: ControlPath): boolean;
|
|
59
61
|
removeAt(index: number): void;
|
|
60
62
|
setEnable(enable?: boolean, opts?: ControlEventOptions): void;
|
|
61
|
-
push(control: AbstractControl<T
|
|
63
|
+
push(control: AbstractControl<T>, options?: ControlEventOptions): void;
|
|
62
64
|
setDisable(disable?: boolean, opts?: ControlEventOptions): void;
|
|
63
|
-
setControl(index: number, control: AbstractControl<T
|
|
65
|
+
setControl(index: number, control: AbstractControl<T>, options?: ControlEventOptions): void;
|
|
64
66
|
markAsTouched(opts?: OnlySelf): void;
|
|
65
67
|
markAsUntouched(opts?: OnlySelf): void;
|
|
66
68
|
markAsPristine(opts?: OnlySelf): void;
|
package/lib/form-group.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export declare class RxapFormGroup<T extends Record<string, any> = any, E extend
|
|
|
49
49
|
setControl<K extends ExtractStrings<T>>(name: K, control: AbstractControl<T[K]>): void;
|
|
50
50
|
setValue(valueOrObservable: Observable<T>, options?: ControlEventOptions): Subscription;
|
|
51
51
|
setValue(valueOrObservable: T, options?: ControlEventOptions): void;
|
|
52
|
+
private _patchValue;
|
|
52
53
|
patchValue(valueOrObservable: Observable<Partial<T>>, options?: ControlEventOptions): Subscription;
|
|
53
54
|
patchValue(valueOrObservable: Partial<T>, options?: ControlEventOptions): void;
|
|
54
55
|
disabledWhile(observable: Observable<boolean>, options?: ControlOptions): Subscription;
|
package/lib/types.d.ts
CHANGED
|
@@ -20,8 +20,33 @@ export interface ControlOptions {
|
|
|
20
20
|
emitModelToViewChange?: boolean;
|
|
21
21
|
emitViewToModelChange?: boolean;
|
|
22
22
|
initial?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* used in the RxapFormArray patchValue method.
|
|
25
|
+
*
|
|
26
|
+
* true - if the value has not a control with any index. The control is created
|
|
27
|
+
* false - default behavior
|
|
28
|
+
*/
|
|
29
|
+
coerce?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* used in the RxapFormArray patchValue method.
|
|
32
|
+
*
|
|
33
|
+
* true - the length of the control array is limited by the length of the value.
|
|
34
|
+
* false - default behavior
|
|
35
|
+
*
|
|
36
|
+
* example with strict = true
|
|
37
|
+
*
|
|
38
|
+
* current from array controls: [ 0: {}, 1: {}, 2: {} ]
|
|
39
|
+
*
|
|
40
|
+
* patch value A: [ 0: {}, 1: {}, 2: {} ]
|
|
41
|
+
* result: [ 0: {}, 1: {}, 2: {} ]
|
|
42
|
+
*
|
|
43
|
+
* path value B: [ 0: {}, 1: {} ]
|
|
44
|
+
* result: [ 0: {}, 1: {} ]
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
strict?: boolean;
|
|
23
48
|
}
|
|
24
|
-
export declare type ControlEventOptions = Pick<ControlOptions, 'emitEvent' | 'onlySelf'>;
|
|
49
|
+
export declare type ControlEventOptions = Pick<ControlOptions, 'emitEvent' | 'onlySelf' | 'coerce' | 'strict'>;
|
|
25
50
|
export declare type OnlySelf = Pick<ControlOptions, 'onlySelf'>;
|
|
26
51
|
export declare type EmitEvent = Pick<ControlOptions, 'emitEvent'>;
|
|
27
52
|
export declare type ControlPath = Array<string | number> | string;
|
|
@@ -11,6 +11,8 @@ import { IsPhoneNumber } from './is-phone-number';
|
|
|
11
11
|
import { IsEmail } from './is-email';
|
|
12
12
|
import { IsUrl } from './is-url';
|
|
13
13
|
import { IsIP } from './is-ip';
|
|
14
|
+
import { IsPort } from './is-port';
|
|
15
|
+
import { IsUUID } from './is-uuid';
|
|
14
16
|
export declare const RxapValidators: {
|
|
15
17
|
IsNumber: typeof IsNumber;
|
|
16
18
|
IsBoolean: typeof IsBoolean;
|
|
@@ -25,4 +27,6 @@ export declare const RxapValidators: {
|
|
|
25
27
|
IsEmail: typeof IsEmail;
|
|
26
28
|
IsUrl: typeof IsUrl;
|
|
27
29
|
IsIP: typeof IsIP;
|
|
30
|
+
IsPort: typeof IsPort;
|
|
31
|
+
IsUUID: typeof IsUUID;
|
|
28
32
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxap/forms",
|
|
3
|
-
"version": "14.0
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Merzough Münker",
|
|
6
6
|
"homepage": "https://gitlab.com/rxap/packages/libs/forms",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@rxap/definition": "^14.0.3",
|
|
29
29
|
"@rxap/directives": "^14.0.3",
|
|
30
30
|
"@rxap/services": "^14.0.5",
|
|
31
|
-
"@rxap/utilities": "^14.0
|
|
31
|
+
"@rxap/utilities": "^14.1.0",
|
|
32
32
|
"reflect-metadata": "^0.1.13",
|
|
33
33
|
"rxjs": "^6.6.0"
|
|
34
34
|
},
|