From 01c07ed8aea5d51fd1577c3a466d551ace99c6ef Mon Sep 17 00:00:00 2001 From: grabkowski Date: Thu, 8 Apr 2021 16:11:45 +0200 Subject: [PATCH] fix(form): type definitions not properly exported fix type definitions export fix incorrect "buttonAlignment" type definition from required to optional sort type definitions Fixes #3690 --- src/components/form/form-summary.d.ts | 4 +-- src/components/form/form.d.ts | 36 ++++++++++----------------- src/components/form/index.d.ts | 2 +- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/components/form/form-summary.d.ts b/src/components/form/form-summary.d.ts index ae292c7929..76d0517b4c 100644 --- a/src/components/form/form-summary.d.ts +++ b/src/components/form/form-summary.d.ts @@ -4,9 +4,9 @@ export interface FormSummaryProps { /** Child elements */ children?: React.ReactNode; /** The total number of errors present in the form */ - errorCount?: number; + errors?: number; /** The total number of warnings present in the form */ - warningCount?: number; + warnings?: number; } declare function FormSummary(props: FormSummaryProps): JSX.Element; diff --git a/src/components/form/form.d.ts b/src/components/form/form.d.ts index a0c6842625..632452e672 100644 --- a/src/components/form/form.d.ts +++ b/src/components/form/form.d.ts @@ -3,37 +3,27 @@ import { FormFieldSpacing } from "../../utils/helpers/options-helper/options-hel export interface FormProps { /** Alignment of buttons */ - buttonAlignment: "left" | "right"; - - /** Enables the sticky footer. */ - stickyFooter?: boolean; - - /** Additional buttons rendered on the left side of the save button */ - leftSideButtons?: React.ReactNode; - - /** Additional buttons rendered on the right side of the save button */ - rightSideButtons?: React.ReactNode; - - /** Callback passed to the form element */ - onSubmit?: (event: React.FormEvent) => any; - + buttonAlignment?: "left" | "right"; /** Child elements */ children?: React.ReactNode; - - /** Save button to be rendered */ - saveButton?: React.ReactNode; - /** The total number of errors present in the form */ errorCount?: number; - - /** The total number of warnings present in the form */ - warningCount?: number; - /** Spacing between form fields, given number will be multiplied by base spacing unit (8) */ fieldSpacing?: FormFieldSpacing; - + /** Additional buttons rendered on the left side of the save button */ + leftSideButtons?: React.ReactNode; /** Disable HTML5 validation */ noValidate?: boolean; + /** Callback passed to the form element */ + onSubmit?: (event: React.FormEvent) => any; + /** Additional buttons rendered on the right side of the save button */ + rightSideButtons?: React.ReactNode; + /** Save button to be rendered */ + saveButton?: React.ReactNode; + /** Enables the sticky footer. */ + stickyFooter?: boolean; + /** The total number of warnings present in the form */ + warningCount?: number; } declare function Form(props: FormProps): JSX.Element; diff --git a/src/components/form/index.d.ts b/src/components/form/index.d.ts index 58518103f3..e7a04fc1cd 100644 --- a/src/components/form/index.d.ts +++ b/src/components/form/index.d.ts @@ -1 +1 @@ -export { default as Form } from "./form"; +export { default } from "./form";