formsy-react
- Version 2.4.4
- Published
- 66.5 kB
- 1 dependency
- MIT license
Install
npm i formsy-reactyarn add formsy-reactpnpm add formsy-reactOverview
A form input builder and validator for React
Index
Variables
Functions
Classes
Formsy
- attachToForm
- componentDidMount
- componentDidUpdate
- detachFromForm
- displayName
- emptyArray
- getCurrentValues
- getModel
- getPristineValues
- inputs
- isChanged
- isFormDisabled
- isValidValue
- mapModel
- prevInputNames
- render()
- reset
- runValidation
- setFormPristine
- setFormValidState
- setInputValidationErrors
- submit
- updateInputsWithError
- updateInputsWithValue
- validate
- validateForm
Interfaces
Type Aliases
Variables
variable validationRules
const validationRules: Validations<any>;Functions
function addValidationRule
addValidationRule: <V>(name: string, func: ValidationFunction<V>) => void;function withFormsy
withFormsy: <T, V>( WrappedComponent: React.ComponentType<T & WrapperProps<V> & InjectedProps<V>>) => React.ComponentType<Omit<T & WrapperProps<V>, keyof InjectedProps<V>>>;Classes
class Formsy
class Formsy extends React.Component<PropsWithChildren<FormsyProps>, FormsyState> {}constructor
constructor(props: FormsyProps);property attachToForm
attachToForm: (component: any) => void;property componentDidMount
componentDidMount: () => void;property componentDidUpdate
componentDidUpdate: (prevProps: FormsyProps) => void;property detachFromForm
detachFromForm: <V>(component: InputComponent<V>) => void;property displayName
static displayName: string;property emptyArray
emptyArray: any[];property getCurrentValues
getCurrentValues: () => any;property getModel
getModel: () => any;property getPristineValues
getPristineValues: () => any;property inputs
inputs: any[];property isChanged
isChanged: () => boolean;property isFormDisabled
isFormDisabled: () => boolean;property isValidValue
isValidValue: (component: any, value: any) => boolean;property mapModel
mapModel: (model: IModel) => IModel;property prevInputNames
prevInputNames: any[];property reset
reset: (model?: IModel) => void;property runValidation
runValidation: <V>( component: InputComponent<V>, value?: V) => { isRequired: boolean; isValid: boolean; validationError: ValidationError[];};property setFormPristine
setFormPristine: (isPristine: boolean) => void;property setFormValidState
setFormValidState: (allIsValid: boolean) => void;property setInputValidationErrors
setInputValidationErrors: (errors: any) => void;property submit
submit: (event?: React.SyntheticEvent<HTMLFormElement>) => void;property updateInputsWithError
updateInputsWithError: IUpdateInputsWithError;property updateInputsWithValue
updateInputsWithValue: IUpdateInputsWithValue<any>;property validate
validate: <V>(component: InputComponent<V>) => void;property validateForm
validateForm: () => void;method render
render: () => React.FunctionComponentElement< React.ProviderProps<FormsyContextInterface>>;Interfaces
interface InjectedProps
interface InjectedProps<V> {}property errorMessage
errorMessage: ValidationError;property errorMessages
errorMessages: ValidationError[];property hasValue
hasValue: boolean;property isFormDisabled
isFormDisabled: boolean;property isFormSubmitted
isFormSubmitted: boolean;property isPristine
isPristine: boolean;property isRequired
isRequired: boolean;property isValid
isValid: boolean;property isValidValue
isValidValue: (value: V) => boolean;property ref
ref?: React.Ref<any>;property resetValue
resetValue: () => void;property setValidations
setValidations: ( validations: Validations<V>, required: RequiredValidation<V>) => void;property setValue
setValue: (value: V, validate?: boolean) => void;property showError
showError: boolean;property showRequired
showRequired: boolean;Type Aliases
type FormsyInjectedProps
type PassDownProps<V> = WrapperProps<V> & InjectedProps<V>;Package Files (4)
Dependencies (1)
Dev Dependencies (25)
Peer Dependencies (2)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/formsy-react.
- Markdown[](https://www.jsdocs.io/package/formsy-react)
- HTML<a href="https://www.jsdocs.io/package/formsy-react"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3284 ms. - Missing or incorrect documentation? Open an issue for this package.
