conform-ts
TypeScript icon, indicating that this package has built-in type declarations

0.0.13 • Public • Published

Form-awesome

Feature

- Fast building form with file config

🖥 Environment Support

- Modern browsers and Internet Explorer 9+
- Server-side Rendering
- [Electron](http://electron.atom.io/)

📦 Install

🔨 Usage

Config File

import {Input} from "antd";
import { inputFieldsType} from "../formEngine";

export const inputFields : inputFieldsType = [
    {
        size: 12,
        key: 'name',
        Element: Input,
        propsElement: {},
        fieldDecorator: {
            rules: [
                {
                    required: true,
                    message: 'Must fill this field'
                }
            ]
        }
    },
    {
        size: 12,
        key: 'userName',
        Element: Input,
        propsElement: {},
        fieldDecorator: {}
    }
];

Code

    <FormEngine
        formName={formName}
        inputFields={inputFields}
        dataSource={info}
        onFieldChangeFunc={(listFieldChanged) =>
            listFieldChanged.forEach((temp) => {
                setInfo({
                    ...info,
                    [temp.key]: temp.value
                });
        })}
        onSubmit={(data: Object) => console.error(data)}
        wrappedComponentRef={formRef}
    />

Package Sidebar

Install

npm i conform-ts

Weekly Downloads

6

Version

0.0.13

License

ISC

Unpacked Size

5.11 kB

Total Files

6

Last publish

Collaborators

  • longnh.it07