# antd-form-manager-components

> This project base on CRA and Ant.design to help you make a form manager quickly with some features

Latest version **0.1.7** (published 2022-05-19) · 0 weekly downloads

## Install

```sh
npm install antd-form-manager-components
pnpm add antd-form-manager-components
yarn add antd-form-manager-components
bun add antd-form-manager-components
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2022-05-19 |
| First published | 2022-01-24 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 74.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | duvie |

## Links

- npm: https://www.npmjs.com/package/antd-form-manager-components
- Repository: https://github.com/phamvietdung/antd-form-manager-components
- Homepage: https://github.com/phamvietdung/antd-form-manager-components#readme
- Issues: https://github.com/phamvietdung/antd-form-manager-components/issues
- npm.io page: https://npm.io/package/antd-form-manager-components

## Dependencies (18)

- [antd](https://npm.io/package/antd.md) ^4.18.5
- [react](https://npm.io/package/react.md) ^17.0.2
- [draft-js](https://npm.io/package/draft-js.md) ^0.11.7
- [react-dom](https://npm.io/package/react-dom.md) ^17.0.2
- [typescript](https://npm.io/package/typescript.md) ^4.5.5
- [web-vitals](https://npm.io/package/web-vitals.md) ^2.1.4
- [@types/jest](https://npm.io/package/@types/jest.md) ^27.4.0
- [@types/node](https://npm.io/package/@types/node.md) ^16.11.21
- [@types/react](https://npm.io/package/@types/react.md) ^17.0.38
- [react-scripts](https://npm.io/package/react-scripts.md) 5.0.0
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^17.0.11
- [react-draft-wysiwyg](https://npm.io/package/react-draft-wysiwyg.md) ^1.14.7
- [react-test-renderer](https://npm.io/package/react-test-renderer.md) ^17.0.2
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^12.1.2
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^5.16.1
- [@types/react-draft-wysiwyg](https://npm.io/package/@types/react-draft-wysiwyg.md) ^1.13.4
- [@storybook/addon-storyshots](https://npm.io/package/@storybook/addon-storyshots.md) ^6.4.14
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^13.5.0

## Recent versions

- 0.1.7 (latest) — 2022-05-19
- 0.1.6 — 2022-05-19
- 0.1.5 — 2022-05-19
- 1.0.4 — 2022-05-19
- 0.1.4 — 2022-03-04
- 0.1.3 — 2022-01-28
- 0.1.2 — 2022-01-25
- 0.1.1 — 2022-01-24
- 0.1.0 — 2022-01-24

## README

# Getting Started with Antd Form Manager Components

This project base on CRA and Ant.design to help you make a form manager quickly with some features

- [StoryBook](https://phamvietdung.github.io/antd-form-manager-components/)
- [NPM](https://www.npmjs.com/package/antd-form-manager-components)


## Available Scripts

In the your project directory, you can run:

#### `npm i antd-form-manager-components`

***

Once it install, let do some fun

#### Input 

```js

const simple_form = [
  {
    type: 'heading',
    label: <>
      <Title level={3}>Just simple form</Title>
      <Text>It's quick and easy.</Text>
      <Divider />
    </>,
    align: 'left'
  },
  {
    type: 'input',
    name: 'firstName',
    label: 'First name',
    required: true,
    span: 12
  },
  {
    type: 'input',
    name: 'surName',
    label: 'Surmame',
    required: false,
    span: 12
  },
]
```

#### Result

![sample1](./assets/images/sample-1.gif)

***

#### With custom validator

```js
const simple_form_validator = [
  {
    type: 'heading',
    label: <>
      <Title level={3}>Just simple form</Title>
      <Text>It's quick and easy.</Text>
      <Divider />
    </>,
    align: 'left'
  },
  {
    type: 'input',
    name: 'firstName',
    label: 'First name',
    required: true,
    span: 12,
  },
  {
    type: 'input',
    name: 'surName',
    label: 'Surmame',
    required: false,
    span: 12,
    validator: (values: any, current: any) => {
      if (values.firstName == current) return true;
      return false;
    },
    validatorMessage: "Oops!"
  },
]
```
#### And the result

![sample 2](/assets/images/sample-2.gif)


***


#### Hide some thing ?

```js
const simple_form_visible = [
  {
    type: 'heading',
    label: <>
      <Title level={3}>Just simple form</Title>
      <Text>It's quick and easy.</Text>
      <Divider />
    </>,
    align: 'left'
  },
  {
    type: 'input',
    name: 'firstName',
    label: 'First name',
    // required: true,
    span: 8,
  },
  {
    type: 'input',
    name: 'surName',
    label: 'Surmame',
    required: false,
    span: 16,
    visible: (values: any) => {
      if (values.firstName == 'oops') return true;
      return false;
    }
  },
]
```

#### It's simple, yet

 ![sample 3](/assets/images/sample-3.gif)

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