formex
Simple form builder and validation library
Last updated 5 years ago by michalkvasnicak .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install formex 
SYNC missed versions from official npm registry.

Formex

Build Status

Simple form builder and validation library.

Can be used as standalone, with Redux or React;

This library is experimental and it not tested in production!! Use at your own risk! Pull requests/issues are welcome

Installation

npm install formex

Usage

// form component
import { Formex } from 'formex';

class LoginForm extends Component {
    static propTypes = {
        pristine: PropTypes.bool.isRequired,
        valid: PropTypes.bool.isRequired,
        dirty: PropTypes.bool.isRequired,
        invalid: PropTypes.bool.isRequired,
        validating: PropTypes.bool.isRequired,
        validated: PropTypes.bool.isRequired,
        onSubmit: PropTypes.func.isRequired,
        errors: PropTypes.array.isRequired
    };
    // ...
}

export default Formex.Form()(LoginForm);

// input component
import { Formex } from 'formex';

class MyInput extends Component {
    static propTypes = {
        pristine: PropTypes.bool.isRequired,
        valid: PropTypes.bool.isRequired,
        dirty: PropTypes.bool.isRequired,
        invalid: PropTypes.bool.isRequired,
        validating: PropTypes.bool.isRequired,
        validated: PropTypes.bool.isRequired,
        onChange: PropTypes.func.isRequired
    };
    
    // ...
}

export default Formex.Input()(MyInput);

// error message
import { Formex } from 'formex';

class MyErrorMessage extends Component {
    static propTypes = {
        show: PropTypes.bool.isRequired,
        args: PropTypes.array.isRequired
    };
    
    //...
}

export default Formex.Message()(MyErrorMessage);

Current Tags

  • 0.1.1                                ...           latest (5 years ago)

1 Versions

  • 0.1.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (13)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |