@arudovwen/form-builder-react 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -8
- package/dist/form-builder.es.js +4542 -4272
- package/dist/form-builder.umd.js +27 -27
- package/dist/index.css +1 -1
- package/package.json +7 -2
- package/types/components/editor/element-canvas.d.ts +3 -1
- package/types/components/editor/layout.d.ts +9 -8
- package/types/components/editor/main.d.ts +1 -2
- package/types/components/editor/topbar.d.ts +3 -1
- package/types/components/elements/element-container.d.ts +1 -1
- package/types/components/elements/grid-input.d.ts +13 -6
- package/types/components/elements/multi-input-options.d.ts +13 -0
- package/types/components/elements/multi-input.d.ts +15 -0
- package/types/components/viewer/index.d.ts +15 -1
- package/types/components/viewer/multi-page.d.ts +5 -0
- package/types/components/viewer/single-page.d.ts +4 -0
- package/types/context/editor-context.d.ts +2 -0
- package/types/pages/builder/index.d.ts +3 -3
- package/types/pages/viewer/index.d.ts +2 -1
- package/types/utils/contants.d.ts +5 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
The **Form Builder Package** is a reusable library designed to simplify the creation and management of dynamic forms in web applications. It provides a robust API and customizable components to streamline form-building workflows.
|
|
5
5
|
|
|
6
|
-
**This package is still in development
|
|
6
|
+
> **Note**: This package is still in development.
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
@@ -23,12 +23,14 @@ npm install @arudovwen/form-builder-react
|
|
|
23
23
|
|
|
24
24
|
## Demo
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
Explore the live demo of the Form Builder Package:
|
|
27
|
+
- [Form Builder Demo](https://form-builder-inky-nine.vercel.app/)
|
|
28
|
+
- [Form Viewer](https://form-builder-inky-nine.vercel.app/viewer)
|
|
28
29
|
|
|
29
30
|
## GitHub Repository
|
|
30
31
|
|
|
31
|
-
Find the source code and contribute to the project on GitHub:
|
|
32
|
+
Find the source code and contribute to the project on GitHub:
|
|
33
|
+
[Form Builder GitHub Repository](https://github.com/arudovwen/Form.Builder)
|
|
32
34
|
|
|
33
35
|
## Usage
|
|
34
36
|
|
|
@@ -69,11 +71,12 @@ function App() {
|
|
|
69
71
|
<FormBuilder
|
|
70
72
|
onSubmit={(form_data: any) => console.log(form_data)}
|
|
71
73
|
config={config}
|
|
74
|
+
title="My Form Title"
|
|
72
75
|
/>
|
|
73
76
|
<FormViewer
|
|
74
77
|
onSubmit={(e: any) => console.log(e)}
|
|
75
78
|
form_data={formData}
|
|
76
|
-
|
|
79
|
+
answerData={[]}
|
|
77
80
|
config={config}
|
|
78
81
|
loading={loading}
|
|
79
82
|
/>
|
|
@@ -88,12 +91,14 @@ export default App;
|
|
|
88
91
|
|
|
89
92
|
| Prop | Type | Description |
|
|
90
93
|
|--------------|--------------------|--------------------------------------------------|
|
|
94
|
+
| `title` | `string` | TItle of the form, optional |
|
|
91
95
|
| `form_data` | `FormElement[]` | Array of form elements to render in the form. |
|
|
92
|
-
| `
|
|
96
|
+
| `answerData` | `any[]` | Array of user-provided answers to the form. |
|
|
93
97
|
| `config` | `object` | Configuration object (e.g., `buttonColor`, `loaderColor`). |
|
|
94
98
|
| `onSubmit` | `(data: any) => void` | Callback function triggered when the form is submitted. |
|
|
95
99
|
| `loading` | `boolean` | Indicates whether the form is in a loading state. |
|
|
96
100
|
| `isReadOnly` | `boolean` | Determines if the form is rendered in read-only mode. |
|
|
101
|
+
| `renderType` | `string` | Determines the style the form is rendered, either `multi` or `single`. |
|
|
97
102
|
|
|
98
103
|
### Form Element Types
|
|
99
104
|
|
|
@@ -113,8 +118,8 @@ To contribute or modify the package:
|
|
|
113
118
|
1. Clone the repository:
|
|
114
119
|
|
|
115
120
|
```bash
|
|
116
|
-
git clone https://github.com/
|
|
117
|
-
cd
|
|
121
|
+
git clone https://github.com/arudovwen/Form.Builder.git
|
|
122
|
+
cd Form.Builder
|
|
118
123
|
```
|
|
119
124
|
|
|
120
125
|
2. Install dependencies:
|