@arudovwen/form-builder-react 1.1.0 → 1.1.2
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 +20 -20
- package/dist/form-builder.es.js +2407 -2357
- package/dist/form-builder.umd.js +25 -25
- package/dist/index.css +1 -1
- package/package.json +1 -1
- package/types/components/Loader.d.ts +1 -1
- package/types/components/editor/layout.d.ts +11 -9
- package/types/components/editor/topbar.d.ts +4 -3
- package/types/pages/builder/index.d.ts +3 -3
package/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
# React Form Builder
|
|
3
2
|
|
|
4
3
|
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.
|
|
@@ -23,8 +22,9 @@ npm install @arudovwen/form-builder-react
|
|
|
23
22
|
|
|
24
23
|
## Demo
|
|
25
24
|
|
|
26
|
-
Explore the live demo of the Form Builder Package:
|
|
27
|
-
|
|
25
|
+
Explore the live demo of the Form Builder Package:
|
|
26
|
+
|
|
27
|
+
- [Form Builder Demo](https://form-builder-inky-nine.vercel.app/)
|
|
28
28
|
- [Form Viewer](https://form-builder-inky-nine.vercel.app/viewer)
|
|
29
29
|
|
|
30
30
|
## GitHub Repository
|
|
@@ -89,27 +89,28 @@ export default App;
|
|
|
89
89
|
|
|
90
90
|
### Props for `FormBuilder`
|
|
91
91
|
|
|
92
|
-
| Prop | Type
|
|
93
|
-
|
|
94
|
-
| `title` | `string`
|
|
95
|
-
| `form_data` | `FormElement[]`
|
|
96
|
-
| `answerData` | `any[]`
|
|
97
|
-
| `config` | `object`
|
|
98
|
-
| `onSubmit` | `(data: any) => void` | Callback function triggered when the form is submitted.
|
|
99
|
-
| `loading` | `boolean`
|
|
100
|
-
| `isReadOnly` | `boolean`
|
|
101
|
-
| `renderType` | `string`
|
|
92
|
+
| Prop | Type | Description |
|
|
93
|
+
| ------------ | --------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
94
|
+
| `title` | `string` | TItle of the form, optional |
|
|
95
|
+
| `form_data` | `FormElement[]` | Array of form elements to render in the form. |
|
|
96
|
+
| `answerData` | `any[]` | Array of user-provided answers to the form. |
|
|
97
|
+
| `config` | `object` | Configuration object (e.g., `buttonColor`, `loaderColor`, `elementColor`, `elementBgColor`, `elementBorderColor`). |
|
|
98
|
+
| `onSubmit` | `(data: any) => void` | Callback function triggered when the form is submitted. |
|
|
99
|
+
| `loading` | `boolean` | Indicates whether the form is in a loading state. |
|
|
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`. |
|
|
102
|
+
| `backUrl` | `string` | Url to navigate back too |
|
|
102
103
|
|
|
103
104
|
### Form Element Types
|
|
104
105
|
|
|
105
106
|
The `FormElement` type supports the following fields:
|
|
106
107
|
|
|
107
|
-
| Field | Type
|
|
108
|
-
|
|
109
|
-
| `id` | `string`
|
|
110
|
-
| `type` | `string`
|
|
111
|
-
| `label` | `string`
|
|
112
|
-
| `placeholder` | `string`
|
|
108
|
+
| Field | Type | Description |
|
|
109
|
+
| ------------- | -------- | ------------------------------------------ |
|
|
110
|
+
| `id` | `string` | Unique identifier for the form element. |
|
|
111
|
+
| `type` | `string` | Type of the input (e.g., `text`, `email`). |
|
|
112
|
+
| `label` | `string` | Label for the form element. |
|
|
113
|
+
| `placeholder` | `string` | Placeholder text for the input. |
|
|
113
114
|
|
|
114
115
|
## Development
|
|
115
116
|
|
|
@@ -164,4 +165,3 @@ Contributions are welcome! Please fork the repository, create a feature branch,
|
|
|
164
165
|
---
|
|
165
166
|
|
|
166
167
|
Happy form building!
|
|
167
|
-
|