From d585975091ae221f4a0e9fc0f3850a86b7b5ac43 Mon Sep 17 00:00:00 2001 From: Ayo Date: Tue, 27 Sep 2022 17:37:32 +0200 Subject: [PATCH] feat: Checkbox and Radio classes, todo comment --- src/form-control.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/form-control.ts b/src/form-control.ts index 7cbd04d..3105548 100644 --- a/src/form-control.ts +++ b/src/form-control.ts @@ -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; +}