# imcformbuilder

> Welcome to Form Builder 👋

Latest version **1.2.0** (published 2022-06-30) · 0 weekly downloads

## Install

```sh
npm install imcformbuilder
pnpm add imcformbuilder
yarn add imcformbuilder
bun add imcformbuilder
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-06-30 |
| First published | 2021-08-10 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 16 |
| Unpacked size | 141 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | youngkinam |

## Links

- npm: https://www.npmjs.com/package/imcformbuilder
- npm.io page: https://npm.io/package/imcformbuilder

## Dependencies (16)

- [antd](https://npm.io/package/antd.md) ^4.16.13
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [react](https://npm.io/package/react.md) ^17.0.2
- [jquery](https://npm.io/package/jquery.md) ^3.6.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [rc-slider](https://npm.io/package/rc-slider.md) ^9.7.2
- [react-dom](https://npm.io/package/react-dom.md) ^17.0.2
- [fg-loadcss](https://npm.io/package/fg-loadcss.md) ^3.1.0
- [react-color](https://npm.io/package/react-color.md) ^2.19.3
- [react-scripts](https://npm.io/package/react-scripts.md) 4.0.3
- [rc-color-picker](https://npm.io/package/rc-color-picker.md) ^1.2.6
- [@material-ui/lab](https://npm.io/package/@material-ui/lab.md) ^4.0.0-alpha.60
- [react-router-dom](https://npm.io/package/react-router-dom.md) ^5.2.1
- [@ant-design/icons](https://npm.io/package/@ant-design/icons.md) ^4.6.4
- [@material-ui/core](https://npm.io/package/@material-ui/core.md) ^4.12.3
- [@material-ui/icons](https://npm.io/package/@material-ui/icons.md) ^4.11.2

## Recent versions

- 1.2.0 (latest) — 2022-06-30
- 1.1.9 — 2022-06-27
- 1.1.8 — 2021-11-04
- 1.1.7 — 2021-11-04
- 1.1.62 — 2021-10-04
- 1.1.61 — 2021-10-04
- 1.1.6 — 2021-10-04
- 1.1.5 — 2021-10-02
- 1.1.4 — 2021-10-01
- 1.1.3 — 2021-09-16
- 1.1.2 — 2021-09-15
- 1.1.1 — 2021-09-15
- 1.1.0 — 2021-09-09
- 1.0.9 — 2021-09-09
- 1.0.8 — 2021-09-09
- … 28 more at https://npm.io/package/imcformbuilder/versions

## README

<h1 align="center">Welcome to Form Builder 👋</h1>

![npm](https://img.shields.io/npm/v/imcformbuilder)
![npm bundle size](https://img.shields.io/bundlephobia/min/imcformbuilder?style=plastic)
![npm](https://img.shields.io/npm/dm/imcformbuild)

> Make ant design base styled form with ease. It enable to use form by just adding json files of style and list. Form Builder provides editing function, such as adding, removing items, change look and feels like number of columes, vertical, horizontal title layout etc. It can edit existing form, also create new form from scratch.
>
> | Display                                                                                                                | Form Edit                                                                                                            |
> | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
> | <a href="http://imcmaster.iptime.org/form" ><img src="https://i.ibb.co/7yWH0tT/antformdisplay.png" width="400px"/></a> | <a href="http://imcmaster.iptime.org:3080" ><img src="https://i.ibb.co/RNbtwWF/imcformedit.png" width="400px"/> </a> |

### 🏠 [Homepage](http://imcmaster.iptime.org:3080)

### ✨ [Demo](http://imcmaster.iptime.org:4009/form/edit)

English | [한글](./README - kr_KR.md)

## Install

```sh
npm install formbuilder
```

## Usage basic

While you develop, showedit={true} will show you edit button.
Upon complete development, change showedit to false to hide button.

```js
<AntFormDisplay
  showedit={true}
  formArray={formArray}
  onFinish={onFinish}
  onValuesChange={onValuesChange}
/>
```

## EventHandler

1. onFinish: By clicking submit button, onFinish function returns a value as object.
   With this you can proceed other action, such as save to server or change state.
   Return data is key value object for example: {collection:"abc",querystring:"123",.....}
2. onValuesChange: returns two parameters, changedValues, allValues.
   First value return just changed key value object, last value returns all key value object.
   e.g.
   a. changedValues: {collection:"abc"},
   b. allValues:{collection:"abc",querystring:undefined.....}

```js
const onFinish = (val) => {
  console.log(val);
};
const onValuesChange = (changedValues, allValues) => {
  console.log(changedValues, allValues);
};
```

## Sample data(formArray)

formArray is composed of two parts:

1. list: items in the form
2. setting: look and feel of the form

```sh
{
  "list": [
    {
      "label": "Collection",
      "name": "collection",
      "type": "input",
      "seq": 0,
      "placeholder": "database table",
      "rules": [
        {
          "required": false
        }
      ],
      "requiredmsg": "you must insert"
    },
    {
      "label": "QueryString",
      "name": "querystring",
      "type": "input",
      "seq": 1,
      "placeholder": "pid=xxxx or _id=yyyy",
      "msgright": "라이트 메시지"
    },
    {
      "label": "Submit",
      "name": "",
      "type": "button",
      "seq": 7,
      "action": "submit",
      "btnStyle": "primary",
      "btnColor": "primary",
      "align": "right"
    }
  ],
 "setting": {
    "editable": false,
    "name": "antform",
    "layout": "horizontal",
    "formColumn": 1,
    "formItemLayout": {
      "labelCol": {
        "span": 4
      },
      "wrapperCol": {
        "span": 20
      }
    },
    "tailLayout": {},
    "initial": {},
    "size": "middle",
    "onFinish": "{values => {console.log(values);};}",
    "initialValues": {}
  },
 }
```

## Edit Form

If you provide pros as showedit={true} and click edit button, it redirect edit page.

[![FormEdit](https://i.ibb.co/ZhgW0SR/Imcformedit-small.png)](https://www.youtube.com/watch?v=_Fgp1g39Dc8 "Everything Is AWESOME")

## Author

👤 **Youngki Nam**

- Website: http://imcmaster.iptime.org
- Github: [@ykn9080](https://github.com/ykn9080)

## Show your support

Give a ⭐️ if this project helped you!

---

_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

---
_Source: https://npm.io/package/imcformbuilder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
