|
1 |
| -# vue-form-builder |
2 |
| -[](https://www.npmjs.com/package/v-form-builder) |
3 |
| -[](https://github.com/sethsandaru/vue-form-builder/blob/master/LICENSE)  |
4 |
| -[](http://hits.dwyl.io/sethsandaru/vue-form-builder) |
5 |
| -[](https://github.com/sethsandaru/vue-form-builder/wiki) |
| 1 | +# form |
6 | 2 |
|
7 |
| -A simple form-builder with drag & drop to help you deal your own form. Less code in development and your site will be more generic, configurable. |
8 |
| - |
9 |
| -Advantages: |
10 |
| -- Less code in development |
11 |
| -- Wide range of APIs |
12 |
| -- Easily to maintain, update later |
13 |
| -- Easily to config your form (drag & drop, control settings) |
14 |
| -- Extensibility (Extend-able): Help you to import your own Control |
15 |
| -- Validation & Custom Control Validation Supported. |
16 |
| -- ... |
17 |
| - |
18 |
| -Fully documentation in this Repo's Wiki. Check it out! |
19 |
| - |
20 |
| -Give this repo a ⭐ (star) if you actually like this and will use it for your development/production :D! Thank you! |
21 |
| - |
22 |
| -The library is built & ready for production but if you meet any bugs or issues, feel free to open! |
23 |
| - |
24 |
| -Demo Online: http://vue-form-builder.sethphat.com |
25 |
| -Demo Project: https://github.com/sethsandaru/demo-vue-form-builder |
26 |
| - |
27 |
| -## Big Announcement |
28 |
| -Hey guys, seem likes I have ignored the project for nearly 1 year. Still a lot of problems left to make the form become better, like: |
29 |
| -- The library itself is too highly depended from many libraries. This cost us a lot (including the final bundle size, too heavy) |
30 |
| -- Multilingual - One of the must-have feature. |
31 |
| -- Better approaches in the library, implement most of the good features from Vue, less depend on JQuery,... |
32 |
| -- Extendable (yes it extendable, but still, not perfect enough) |
33 |
| -- ... |
34 |
| - |
35 |
| -I got a plan to build a new version which is **v2.0.0**, to rebuild the library and make it better. |
36 |
| - |
37 |
| -You can send me an email to: `vue-form-builder@sethphat.com`, I would love to receive your feedback, ideas for the next version of Vue Form Builder. Together for the better. |
38 |
| - |
39 |
| -### New Plan - v2.0.0 |
40 |
| -- A new structural for the Vue-Form-Builder. New codebase, new everything new. |
41 |
| -- Still Vue, Still 2.5+ |
42 |
| -- Less dependencies |
43 |
| -- Style Injection - not only Bootstrap, you can use any CSS Framework as you want, even your own CSS Styling. |
44 |
| -- More controls: |
45 |
| - - Date Range (Start date - End date) |
46 |
| - - File Upload (Interact with RestAPI) |
47 |
| - - ... (your ideas here) |
48 |
| -- ... |
49 |
| - |
50 |
| -## Current version |
51 |
| -Current latest version of the Vue Form Builder: **1.4.1-rc1**. |
52 |
| - |
53 |
| -Updated/Features: |
54 |
| -- Update dependencies that got security problem. |
55 |
| -- Placeholder for Sortable (drag n' drop section, row, control to order) |
56 |
| -- Update some CSS, JS |
57 |
| - |
58 |
| -## Technologies/Libraries using |
59 |
| -- Javascript |
60 |
| -- VueJS 2.x |
61 |
| -- Webpack |
62 |
| -- JQuery/JQuery UI |
63 |
| -- Bootstrap 4 |
64 |
| -- ... |
65 |
| - |
66 |
| -**Note**: From the version **1.2.0** to above, I don't import bootstrap 4 stylesheet into the bundle, you should include your own bootstrap 4 stylesheet in order |
67 |
| -to get both of GUI & Template working normally. |
68 |
| - |
69 |
| -## Form Builder Structure |
70 |
| -- Template: is where you can config/create/edit your own form. |
71 |
| - |
72 |
| - |
73 |
| -- GUI: is where the form will be built by your configuration. |
74 |
| - |
75 |
| - |
76 |
| -For more information please visit this Repo's wiki, thanks :D! |
77 |
| - |
78 |
| -## How to install? |
79 |
| -Run this command to install: |
80 |
| -```php |
81 |
| -npm i v-form-builder --save |
| 3 | +## Project setup |
82 | 4 | ```
|
83 |
| - |
84 |
| -NPMJS: [https://www.npmjs.com/package/v-form-builder](https://www.npmjs.com/package/v-form-builder) |
85 |
| - |
86 |
| -**Notes:** |
87 |
| -- For the best experience, please install the latest version! |
88 |
| -- Please don't install the old version below **v1.1.1**. Thank you! |
89 |
| - |
90 |
| -## How to implement? |
91 |
| - |
92 |
| -### Import into your project |
93 |
| -1/ Import as global component |
94 |
| -```javascript |
95 |
| -import FormBuilder from 'v-form-builder'; |
96 |
| -Vue.component('FormBuilder', FormBuilder); |
| 5 | +yarn install |
97 | 6 | ```
|
98 | 7 |
|
99 |
| -2/ Import as single component |
100 |
| -```javascript |
101 |
| -import FormBuilder from 'v-form-builder'; |
102 |
| - |
103 |
| -export default { |
104 |
| - components: {FormBuilder} |
105 |
| - ... |
106 |
| -} |
| 8 | +### Compiles and hot-reloads for development |
107 | 9 | ```
|
108 |
| - |
109 |
| -**Note:** you should have your own Bootstrap 4 stylesheet imported inside your project in order to use the Form Builder normally. |
110 |
| - |
111 |
| -### Usage |
112 |
| -```php |
113 |
| -<template> |
114 |
| - <div> |
115 |
| - // form builder template |
116 |
| - <form-builder type="template"></form-builder> |
117 |
| - |
118 |
| - // form builder gui |
119 |
| - <form-builder type="gui" :form="yourConfigFormObject"></form-builder> |
120 |
| - </div> |
121 |
| -</template> |
| 10 | +yarn run serve |
122 | 11 | ```
|
123 |
| -Binding options: |
124 |
| -- type (String): |
125 |
| - - Form Config (Template): **template** |
126 |
| - - Form GUI: **gui** |
127 |
| -- form (Object) - for Form GUI Only, where you passing the configuration data and the Form Builder will build the form by your configuration data. |
128 | 12 |
|
129 |
| -#### V-Model for Form Builder Template |
130 |
| -You can use v-model in Form Builder Template, it'll return to you the form configuration data that you're configurated (object) and also render the old configuration and let you edit/update that configuration. |
131 |
| -```php |
132 |
| -<template> |
133 |
| - <div> |
134 |
| - <form-builder type="template" v-model="formData"></form-builder> |
135 |
| - </div> |
136 |
| -</template> |
| 13 | +### Compiles and minifies for production |
137 | 14 | ```
|
138 |
| -The form config data would look like this: |
139 |
| -```javascript |
140 |
| -{ |
141 |
| - sections: [...], |
142 |
| - layout: "...", |
143 |
| - _uniqueId: "..." |
144 |
| -} |
| 15 | +yarn run build |
145 | 16 | ```
|
146 | 17 |
|
147 |
| -Ideally, you need to convert that Object to JSON string and then save it in your database :D |
148 |
| - |
149 |
| -#### V-Model for Form Builder GUI |
150 |
| -You can use V-Model to get/set values from your built form. |
151 |
| -```php |
152 |
| -<template> |
153 |
| - <div> |
154 |
| - <form-builder type="gui" :form="formData" v-model="formValues"></form-builder> |
155 |
| - </div> |
156 |
| -</template> |
| 18 | +### Lints and fixes files |
157 | 19 | ```
|
158 |
| -The form values data would look like this: |
159 |
| -```javascript |
160 |
| -{ |
161 |
| - section_key: { |
162 |
| - control_name_1: "data", |
163 |
| - control_name_2: 123, |
164 |
| - ... |
165 |
| - }, |
166 |
| - ... |
167 |
| -} |
| 20 | +yarn run lint |
168 | 21 | ```
|
169 |
| - |
170 |
| -### APIs |
171 |
| -Please visit this Repo's Wiki. |
172 |
| - |
173 |
| -## Release notes |
174 |
| -- Version **1.4.0**: |
175 |
| - - Refactored, the code is more easy to view & read. |
176 |
| - - Able to extend a custom control. |
177 |
| - - Fix some minor bugs. |
178 |
| -- Version **1.3.0**: |
179 |
| - - Milestone 3 released. |
180 |
| - - Able to validate the form. |
181 |
| - - Able to styling the label (bold, italic, underline). |
182 |
| - - Able to set control label position for Section (horizontal or vertical) |
183 |
| - - Fix some bugs |
184 |
| - - Constraints for some Hooks |
185 |
| - - APIs for Validate |
186 |
| -- Version **1.2.1**: |
187 |
| - - Fix some minor bugs. |
188 |
| -- Version **1.2.0**: |
189 |
| - - Hooks are available now for both Template & GUI. |
190 |
| - - More options for controls, like: |
191 |
| - - Select: Ajax data source (URL) |
192 |
| - - Date Picker: date format |
193 |
| - - Time Picker: time format |
194 |
| - - Update control: |
195 |
| - - Number Control to work properly with the decimal places. |
196 |
| - - Time Picker: change to another time picker with a better APIs + options. |
197 |
| - - Fix a problem that make the Date Picker icon didn't show. |
198 |
| - - Stop import Bootstrap 4 CSS into the bundle. |
199 |
| -- Version **1.1.1**: |
200 |
| - - First Release of Vue Form Builder |
201 |
| - - Able to config form & render form by config data. |
202 |
| - - Get/set value for both GUI & Template. |
203 |
| - |
204 |
| -## Supporting the project |
205 |
| -If you really like this project & want to contribute a little for the development. You can buy me a coffee. Thank you very much for your supporting <3. |
206 |
| - |
207 |
| -<a href="https://www.buymeacoffee.com/xKOM9NB8p" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a> |
208 |
| - |
209 |
| -Copyright © 2018 by [Seth Phat](http://sethphat.com) aka Phat Tran Minh! |
0 commit comments