UNPKG

apphouse

Version:

Component library for React that uses observable state management and theme-able components.

46 lines (45 loc) 1.53 kB
import React from 'react'; import { CSSProperties } from 'glamor'; import { ApphouseComponent } from '../component.interfaces'; import { FormV2 as FormModel } from '../../models/Form/FormV2'; import { onSubmissionFormCompletedCallback } from '../../models/Form/FormV2'; import { BoxSizeStyles } from '../../styles/defaults/themes.interface'; export interface ApphouseFormV2Styles { container?: CSSProperties; } export interface ApphouseFormV2Props extends ApphouseComponent<ApphouseFormV2Styles> { form: FormModel; /** * A callback function needs to called when the form is submitted * Note: this callback is added for convenience * this callback does not alter any data in this form * @optional */ onSubmit?: onSubmissionFormCompletedCallback; /** * The label of the submit button * @default 'Submit' * @optional */ submitButtonLabel?: React.ReactNode; /** * if the submit button is loading * it true, it will display a spinner in the submit button * @default false */ loading?: boolean; /** * if true, the submit button will be hidden * @default false - the submit button will be visible */ hideSubmitButton?: boolean; /** * The size of the input */ inputSize?: keyof BoxSizeStyles; } /** * ApphouseFormV2 renders the fields of a form smartly * It detects the type of the field and renders the appropriate input */ export declare const ApphouseFormV2: React.FC<ApphouseFormV2Props>;