From 94845433d8acfa6aedd538bc7b649c3ef3608cdb Mon Sep 17 00:00:00 2001 From: Mert Sincan Date: Wed, 23 Oct 2024 21:37:45 +0100 Subject: [PATCH] Refactor --- apps/showcase/doc/common/apidoc/index.json | 12 ++++++------ packages/form/src/form/Form.d.ts | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/showcase/doc/common/apidoc/index.json b/apps/showcase/doc/common/apidoc/index.json index 241069a20..d590e087e 100644 --- a/apps/showcase/doc/common/apidoc/index.json +++ b/apps/showcase/doc/common/apidoc/index.json @@ -213,7 +213,7 @@ "optional": false, "readonly": false, "type": "boolean", - "default": "", + "default": "false", "description": "Whether the form field has been touched." }, { @@ -221,7 +221,7 @@ "optional": false, "readonly": false, "type": "boolean", - "default": "", + "default": "false", "description": "Whether the form field has been modified." }, { @@ -229,7 +229,7 @@ "optional": false, "readonly": false, "type": "boolean", - "default": "", + "default": "true", "description": "Whether the form field has not been modified." }, { @@ -237,7 +237,7 @@ "optional": false, "readonly": false, "type": "boolean", - "default": "", + "default": "true", "description": "Whether the form field is valid." }, { @@ -245,7 +245,7 @@ "optional": false, "readonly": false, "type": "boolean", - "default": "", + "default": "false", "description": "Whether the form field is invalid." }, { @@ -261,7 +261,7 @@ "optional": false, "readonly": false, "type": "any[]", - "default": "", + "default": "[]", "description": "All error messages of the form field." } ], diff --git a/packages/form/src/form/Form.d.ts b/packages/form/src/form/Form.d.ts index ac613199b..c59de23f9 100644 --- a/packages/form/src/form/Form.d.ts +++ b/packages/form/src/form/Form.d.ts @@ -126,22 +126,27 @@ export interface FormFieldState { value: any; /** * Whether the form field has been touched. + * @defaultValue false */ touched: boolean; /** * Whether the form field has been modified. + * @defaultValue false */ dirty: boolean; /** * Whether the form field has not been modified. + * @defaultValue true */ pristine: boolean; /** * Whether the form field is valid. + * @defaultValue true */ valid: boolean; /** * Whether the form field is invalid. + * @defaultValue false */ invalid: boolean; /** @@ -150,6 +155,7 @@ export interface FormFieldState { error: any; /** * All error messages of the form field. + * @defaultValue [] */ errors: any[]; }