@rolster/forms 2.3.0 → 2.4.1
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/dist/cjs/helpers.js +2 -2
- package/dist/cjs/helpers.js.map +1 -1
- package/dist/cjs/index.js +36 -26
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/helpers.js +2 -2
- package/dist/es/helpers.js.map +1 -1
- package/dist/es/index.js +36 -26
- package/dist/es/index.js.map +1 -1
- package/dist/esm/form-array/form-array.d.ts +9 -4
- package/dist/esm/form-array/form-array.js +21 -8
- package/dist/esm/form-array/form-array.js.map +1 -1
- package/dist/esm/form-control.d.ts +0 -2
- package/dist/esm/form-control.js +7 -10
- package/dist/esm/form-control.js.map +1 -1
- package/dist/esm/form-group.d.ts +4 -4
- package/dist/esm/form-group.js +6 -6
- package/dist/esm/form-group.js.map +1 -1
- package/dist/esm/helpers.js +2 -2
- package/dist/esm/helpers.js.map +1 -1
- package/dist/esm/types.d.ts +41 -41
- package/package.json +1 -1
- package/dist/cjs/form-array/form-array-control.d.ts +0 -17
- package/dist/cjs/form-array/form-array-group.d.ts +0 -13
- package/dist/cjs/form-array/index.d.ts +0 -4
- package/dist/cjs/form-array/types.d.ts +0 -2
- package/dist/cjs/helpers.d.ts +0 -23
- package/dist/cjs/index.d.ts +0 -4
- package/dist/es/form-array/form-array-control.d.ts +0 -17
- package/dist/es/form-array/form-array-group.d.ts +0 -13
- package/dist/es/form-array/index.d.ts +0 -4
- package/dist/es/form-array/types.d.ts +0 -2
- package/dist/es/helpers.d.ts +0 -23
- package/dist/es/index.d.ts +0 -4
package/dist/cjs/helpers.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ValidatorError, ValidatorFn } from '@rolster/validators';
|
|
2
|
-
import { AbstractControl, AbstractArrayGroup, AbstractArrayControls, AbstractGroup, AbstractControls, StateGroup, ValidatorArrayFn, ValidatorGroupFn } from './types';
|
|
3
|
-
interface ControlValidOptions<T> {
|
|
4
|
-
state: T;
|
|
5
|
-
validators: ValidatorFn<T>[];
|
|
6
|
-
}
|
|
7
|
-
interface GroupValidOptions<T extends AbstractControls> {
|
|
8
|
-
controls: T;
|
|
9
|
-
validators: ValidatorGroupFn<T>[];
|
|
10
|
-
}
|
|
11
|
-
interface ArrayValidOptions<T extends AbstractArrayControls = AbstractArrayControls, R = any, G extends AbstractArrayGroup<T, R> = AbstractArrayGroup<T, R>> {
|
|
12
|
-
groups: G[];
|
|
13
|
-
validators: ValidatorArrayFn<T, R>[];
|
|
14
|
-
}
|
|
15
|
-
export declare const controlIsValid: <T>({ state, validators }: ControlValidOptions<T>) => ValidatorError[];
|
|
16
|
-
export declare const controlsAllChecked: <T extends AbstractControl<any>>(controls: AbstractControls<T>, key: keyof T) => boolean;
|
|
17
|
-
export declare const controlsPartialChecked: <T extends AbstractControl<any>>(controls: AbstractControls<T>, key: keyof T) => boolean;
|
|
18
|
-
export declare const controlsToState: <C extends AbstractControls<AbstractControl<any>>>(controls: C) => StateGroup<C>;
|
|
19
|
-
export declare const groupIsValid: <C extends AbstractControls<AbstractControl<any>>>({ controls, validators }: GroupValidOptions<C>) => ValidatorError[];
|
|
20
|
-
export declare function groupAllChecked<C extends AbstractControls>(groups: AbstractGroup<C>[], key: keyof AbstractGroup<C>): boolean;
|
|
21
|
-
export declare function groupPartialChecked<C extends AbstractControls>(groups: AbstractGroup<C>[], key: keyof AbstractGroup<C>): boolean;
|
|
22
|
-
export declare const arrayIsValid: <C extends AbstractArrayControls<import("./types").AbstractArrayControl<any>> = AbstractArrayControls<import("./types").AbstractArrayControl<any>>, R = any>({ groups, validators }: ArrayValidOptions<C, R, AbstractArrayGroup<C, R>>) => ValidatorError[];
|
|
23
|
-
export {};
|
package/dist/cjs/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { FormArray, FormArrayControl, FormArrayControls, FormArrayGroup, formArray, formArrayControl, formArrayGroup } from './form-array';
|
|
2
|
-
export { FormControl, formControl } from './form-control';
|
|
3
|
-
export { FormControls, FormGroup, formGroup } from './form-group';
|
|
4
|
-
export * from './types';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ValidatorFn } from '@rolster/validators';
|
|
2
|
-
import { FormControl } from '../form-control';
|
|
3
|
-
import { AbstractArrayControl, FormArrayControlOptions } from '../types';
|
|
4
|
-
type ArrayControlOptions<T> = Omit<FormArrayControlOptions<T>, 'uuid'>;
|
|
5
|
-
export declare class FormArrayControl<T = any> extends FormControl<T> implements AbstractArrayControl<T> {
|
|
6
|
-
readonly uuid: string;
|
|
7
|
-
constructor();
|
|
8
|
-
constructor(options: ArrayControlOptions<T>);
|
|
9
|
-
constructor(state: T, validators?: ValidatorFn<T>[]);
|
|
10
|
-
}
|
|
11
|
-
type ArrayStateProps<T> = Omit<ArrayControlOptions<T>, 'validators'>;
|
|
12
|
-
type ArrayValidatorsProps<T> = Omit<ArrayControlOptions<T>, 'state'>;
|
|
13
|
-
export declare function formArrayControl<T>(): FormArrayControl<T | undefined>;
|
|
14
|
-
export declare function formArrayControl<T>(options: ArrayStateProps<T>): FormArrayControl<T>;
|
|
15
|
-
export declare function formArrayControl<T>(options: ArrayValidatorsProps<T>): FormArrayControl<T | undefined>;
|
|
16
|
-
export declare function formArrayControl<T>(state: T, validators?: ValidatorFn<T>[]): FormArrayControl<T>;
|
|
17
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FormGroup } from '../form-group';
|
|
2
|
-
import { AbstractReactiveArrayGroup, FormArrayGroupOptions, ValidatorGroupFn } from '../types';
|
|
3
|
-
import { FormArrayControls } from './types';
|
|
4
|
-
type ArrayGroupOptions<T extends FormArrayControls> = Omit<FormArrayGroupOptions<T>, 'uuid'>;
|
|
5
|
-
export declare class FormArrayGroup<C extends FormArrayControls = FormArrayControls, R = any> extends FormGroup<C> implements AbstractReactiveArrayGroup<C> {
|
|
6
|
-
readonly uuid: string;
|
|
7
|
-
readonly resource?: R;
|
|
8
|
-
constructor(options: ArrayGroupOptions<C>);
|
|
9
|
-
constructor(controls: C, validators?: ValidatorGroupFn<C>[]);
|
|
10
|
-
}
|
|
11
|
-
export declare function formArrayGroup<C extends FormArrayControls = FormArrayControls>(options: ArrayGroupOptions<C>): FormArrayGroup<C>;
|
|
12
|
-
export declare function formArrayGroup<C extends FormArrayControls = FormArrayControls>(controls: C, validators?: ValidatorGroupFn<C>[]): FormArrayGroup<C>;
|
|
13
|
-
export {};
|
package/dist/es/helpers.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ValidatorError, ValidatorFn } from '@rolster/validators';
|
|
2
|
-
import { AbstractControl, AbstractArrayGroup, AbstractArrayControls, AbstractGroup, AbstractControls, StateGroup, ValidatorArrayFn, ValidatorGroupFn } from './types';
|
|
3
|
-
interface ControlValidOptions<T> {
|
|
4
|
-
state: T;
|
|
5
|
-
validators: ValidatorFn<T>[];
|
|
6
|
-
}
|
|
7
|
-
interface GroupValidOptions<T extends AbstractControls> {
|
|
8
|
-
controls: T;
|
|
9
|
-
validators: ValidatorGroupFn<T>[];
|
|
10
|
-
}
|
|
11
|
-
interface ArrayValidOptions<T extends AbstractArrayControls = AbstractArrayControls, R = any, G extends AbstractArrayGroup<T, R> = AbstractArrayGroup<T, R>> {
|
|
12
|
-
groups: G[];
|
|
13
|
-
validators: ValidatorArrayFn<T, R>[];
|
|
14
|
-
}
|
|
15
|
-
export declare const controlIsValid: <T>({ state, validators }: ControlValidOptions<T>) => ValidatorError[];
|
|
16
|
-
export declare const controlsAllChecked: <T extends AbstractControl<any>>(controls: AbstractControls<T>, key: keyof T) => boolean;
|
|
17
|
-
export declare const controlsPartialChecked: <T extends AbstractControl<any>>(controls: AbstractControls<T>, key: keyof T) => boolean;
|
|
18
|
-
export declare const controlsToState: <C extends AbstractControls<AbstractControl<any>>>(controls: C) => StateGroup<C>;
|
|
19
|
-
export declare const groupIsValid: <C extends AbstractControls<AbstractControl<any>>>({ controls, validators }: GroupValidOptions<C>) => ValidatorError[];
|
|
20
|
-
export declare function groupAllChecked<C extends AbstractControls>(groups: AbstractGroup<C>[], key: keyof AbstractGroup<C>): boolean;
|
|
21
|
-
export declare function groupPartialChecked<C extends AbstractControls>(groups: AbstractGroup<C>[], key: keyof AbstractGroup<C>): boolean;
|
|
22
|
-
export declare const arrayIsValid: <C extends AbstractArrayControls<import("./types").AbstractArrayControl<any>> = AbstractArrayControls<import("./types").AbstractArrayControl<any>>, R = any>({ groups, validators }: ArrayValidOptions<C, R, AbstractArrayGroup<C, R>>) => ValidatorError[];
|
|
23
|
-
export {};
|
package/dist/es/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { FormArray, FormArrayControl, FormArrayControls, FormArrayGroup, formArray, formArrayControl, formArrayGroup } from './form-array';
|
|
2
|
-
export { FormControl, formControl } from './form-control';
|
|
3
|
-
export { FormControls, FormGroup, formGroup } from './form-group';
|
|
4
|
-
export * from './types';
|