formsy-react

  • Version 2.2.5
  • Published
  • 354 kB
  • 3 dependencies
  • MIT license

Install

npm i formsy-react
yarn add formsy-react
pnpm add formsy-react

Overview

A form input builder and validator for React

Index

Variables

variable propTypes

const propTypes: {
innerRef: any;
name: any;
required: any;
validations: any;
value: any;
};

    variable validationRules

    const validationRules: Validations<any>;

      Functions

      function addValidationRule

      addValidationRule: <V>(name: string, func: ValidationFunction<V>) => void;

        function withFormsy

        withFormsy: <T, V>(WrappedComponent: any) => any;

          Classes

          class Formsy

          class Formsy extends React.Component<FormsyProps, FormsyState> {}

            constructor

            constructor(props: FormsyProps);

              property attachToForm

              attachToForm: (component: any) => void;

                property componentDidMount

                componentDidMount: () => void;

                  property componentDidUpdate

                  componentDidUpdate: (prevProps: FormsyProps) => void;

                    property defaultProps

                    static defaultProps: Partial<FormsyProps>;

                      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 propTypes

                                              static propTypes: {
                                              disabled: any;
                                              mapping: any;
                                              formElement: any;
                                              onChange: any;
                                              onInvalid: any;
                                              onInvalidSubmit: any;
                                              onReset: any;
                                              onSubmit: any;
                                              onValid: any;
                                              onValidSubmit: any;
                                              preventDefaultSubmit: any;
                                              preventExternalInvalidation: any;
                                              validationErrors: 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?: any) => 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: () => any;

                                                                      Type Aliases

                                                                      type FormsyInjectedProps

                                                                      type PassDownProps<V> = WrapperProps<V> & InjectedProps<V>;

                                                                        Package Files (4)

                                                                        Dependencies (3)

                                                                        Dev Dependencies (19)

                                                                        Peer Dependencies (2)

                                                                        Badge

                                                                        To add a badge like this onejsDocs.io badgeto 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
                                                                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](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>