feat: Checkbox and Radio classes, todo comment
This commit is contained in:
parent
cdf15935f0
commit
d585975091
1 changed files with 16 additions and 2 deletions
|
@ -1,7 +1,21 @@
|
||||||
export class FormControl {
|
export class FormControl {
|
||||||
name: string;
|
name: string;
|
||||||
type?: 'text' | 'checkbox' | 'radio' = 'text'; // add more
|
type?: 'text' | 'checkbox' | 'radio' = 'text'; // add more
|
||||||
value?: string | number | null | string[];
|
value?: string | number | null | string[];
|
||||||
label?: string;
|
label?: string;
|
||||||
labelPosition?: 'right' | 'left' = 'left';
|
labelPosition?: 'right' | 'left' = 'left';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO: Create classes for each control type
|
||||||
|
*/
|
||||||
|
|
||||||
|
export class Checkbox extends FormControl {
|
||||||
|
type: 'checkbox';
|
||||||
|
checked: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Radio extends FormControl {
|
||||||
|
type: 'checkbox';
|
||||||
|
checked: boolean;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue