feat: Checkbox and Radio classes, todo comment

This commit is contained in:
Ayo 2022-09-27 17:37:32 +02:00
parent cdf15935f0
commit d585975091

View file

@ -1,7 +1,21 @@
export class FormControl {
name: string;
type?: 'text' | 'checkbox' | 'radio' = 'text'; // add more
value?: string | number | null | string[];
type?: 'text' | 'checkbox' | 'radio' = 'text'; // add more
value?: string | number | null | string[];
label?: string;
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;
}