Skip to content

Commit d53e00a

Browse files
committed
* 'v3' of https://github.com/icebob/vue-form-generator: vue-generators#472 - fix `model-updated` event Code refactoring and fix codacity issues Alternative solution to expose embeded fields Fix fields exposition (temporary solution) Fix bug in IE11 and Edge Fix version number Fix URL, rename and move mixinsUtils.js, modify a comment Rework of formGenerator to use a component Allow HTML for label & hint Fixed vue-generators#380 - Added vue-multiselect noResult slot option Bumped [email protected] for Node 10 Compatibility add vfg-field-array into the readme Return entire VFG instance with validation event Include UID for emitted form validation events
2 parents 4fc7c97 + 1d3a0a3 commit d53e00a

27 files changed

+3156
-1674
lines changed

README.md

+59-34
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# vue-form-generator [![NPM version](https://img.shields.io/npm/v/vue-form-generator.svg)](https://www.npmjs.com/package/vue-form-generator) ![VueJS v2.x compatible](https://img.shields.io/badge/vue%202.x-compatible-green.svg)
2+
23
A schema-based form generator component for Vue.js.
34

4-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d27be05a35bf459b9292b8172e314a08)](https://www.codacy.com/app/mereg-norbert/vue-form-generator_2?utm_source=github.com&utm_medium=referral&utm_content=vue-generators/vue-form-generator&utm_campaign=Badge_Grade)
5+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d27be05a35bf459b9292b8172e314a08)](https://www.codacy.com/app/mereg-norbert/vue-form-generator_2?utm_source=github.com&utm_medium=referral&utm_content=vue-generators/vue-form-generator&utm_campaign=Badge_Grade)
56
[![Build Status](https://travis-ci.org/vue-generators/vue-form-generator.svg?branch=master)](https://travis-ci.org/vue-generators/vue-form-generator)
67
[![Coverage Status](https://coveralls.io/repos/github/vue-generators/vue-form-generator/badge.svg?branch=master)](https://coveralls.io/github/vue-generators/vue-form-generator?branch=master)
78
[![NPMS.io score](https://badges.npms.io/vue-form-generator.svg)]()
@@ -13,51 +14,61 @@ A schema-based form generator component for Vue.js.
1314
[![Downloads](https://img.shields.io/npm/dm/vue-form-generator.svg)](https://www.npmjs.com/package/vue-form-generator)
1415

1516
## Demo
17+
1618
[JSFiddle simple example](https://jsfiddle.net/icebob/0mg1v81e/)
1719

1820
[![Screenshot](https://icebob.gitbooks.io/vueformgenerator/content/assets/vfg-example1.png)](https://jsfiddle.net/icebob/0mg1v81e/)
1921

2022
## Features
21-
- reactive forms based on schemas
22-
- multiple object editing
23-
- 21 field types
24-
- built-in validators
25-
- core & full bundles (11kb and 19kb gzipped)
26-
- Bootstrap friendly templates
27-
- customizable styles
28-
- can be extended easily with custom fields
29-
- ...etc
23+
24+
* reactive forms based on schemas
25+
* multiple object editing
26+
* 21 field types
27+
* built-in validators
28+
* core & full bundles (11kb and 19kb gzipped)
29+
* Bootstrap friendly templates
30+
* customizable styles
31+
* can be extended easily with custom fields
32+
* ...etc
3033

3134
## Documentation
35+
3236
[Online documentation on Gitbook](https://icebob.gitbooks.io/vueformgenerator/content/)
3337

3438
## Dependencies
39+
3540
vue-form-generator uses [fecha](https://github.com/taylorhakes/fecha) and [lodash](https://lodash.com/) internally.
3641

37-
While built-in fields don't need external dependencies, optional fields may need other libraries.
42+
While built-in fields don't need external dependencies, optional fields may need other libraries.
3843
These dependencies fall into two camps: jQuery or Vanilla. You can find almost the same functionality in both flavors.
3944
In the end, it's your choice to depend on jQuery or not.
4045

4146
You can find details about dependencies in the official [documentation](https://icebob.gitbooks.io/vueformgenerator/content/) under each specific component.
4247

4348
## Installation
49+
4450
### NPM
51+
4552
You can install it via [NPM](http://npmjs.org/) or [yarn](https://yarnpkg.com/).
4653

4754
#### Latest version for Vue 2.x
55+
4856
```
4957
$ npm install vue-form-generator
5058
```
5159

5260
#### Legacy version for Vue 1.0.x
61+
5362
```
5463
$ npm install [email protected]
5564
```
5665

5766
### Manual
67+
5868
Download zip package and unpack and add the vfg.css and vfg.js file to your project from dist folder.
69+
5970
```
60-
https://github.com/icebob/vue-form-generator/archive/master.zip
71+
https://github.com/vue-generators/vue-form-generator/archive/master.zip
6172
```
6273

6374
### Core vs Full version
@@ -66,10 +77,10 @@ VueFormGenerator come in two version : `core` and `full`.
6677
Core is a more minimal version with only half the fields.
6778
Full is core + other fields.
6879

69-
* Full bundle: 75 kB (gzipped: 19 kB)
70-
* Core bundle: 39 kB (gzipped: 11 kB)
80+
* Full bundle: 75 kB (gzipped: 19 kB)
81+
* Core bundle: 39 kB (gzipped: 11 kB)
7182

72-
If you don't know what to choose, don't worry, the full is the default version.
83+
If you don't know what to choose, don't worry, the full is the default version.
7384
If you want the slim down version, here is the changes:
7485

7586
```js
@@ -87,6 +98,7 @@ If you want the slim down version, here is the changes:
8798
```
8899

89100
## Usage
101+
90102
```html
91103
<template>
92104
<div class="panel-body">
@@ -101,23 +113,23 @@ Vue.use(VueFormGenerator);
101113
102114
export default {
103115
data: {
104-
105-
model: {
116+
117+
model: {
106118
id: 1,
107119
name: "John Doe",
108120
password: "J0hnD03!x4",
109121
skills: ["Javascript", "VueJS"],
110122
111123
status: true
112124
},
113-
125+
114126
schema: {
115127
fields: [{
116128
type: "input",
117129
inputType: "text",
118130
label: "ID (disabled text field)",
119131
model: "id",
120-
readonly: true,
132+
readonly: true,
121133
disabled: true
122134
},{
123135
type: "input",
@@ -139,7 +151,7 @@ export default {
139151
},{
140152
type: "select",
141153
label: "Skills",
142-
model: "skills",
154+
model: "skills",
143155
values: ["Javascript", "VueJS", "CSS3", "HTML5"]
144156
},{
145157
type: "input",
@@ -165,56 +177,69 @@ export default {
165177
```
166178

167179
Usage in local components
180+
168181
```js
169182
import VueFormGenerator from "vue-form-generator";
170183

171184
//component javascript
172-
export default{
173-
components:{
174-
"vue-form-generator": VueFormGenerator.component
175-
}
176-
}
185+
export default {
186+
components: {
187+
"vue-form-generator": VueFormGenerator.component
188+
}
189+
};
177190
```
191+
178192
## Development
193+
179194
This command will start a `webpack-dev-server` with content of `dev` folder.
195+
180196
```bash
181197
npm run dev
182198
```
183199

184200
## Build
201+
185202
This command will build a distributable version in the `dist` directory.
203+
186204
```bash
187205
npm run build
188206
```
189207

190208
## Test
209+
191210
```bash
192211
npm test
193212
```
194-
or
213+
214+
or
215+
195216
```bash
196217
npm run ci
197218
```
198219

199-
## More fields *new*
200-
VueFormGenerator supports custom fields. If you decide to release your custom field into the wild, please open a new issue so we can add you to a list here! Please try to use this naming convention for your custom field : vfg-field-* Example :
220+
## More fields _new_
201221

202-
- `vfg-field-myfield`
203-
- `vfg-field-calendar`
204-
- `vfg-field-awesome-dropdown`
222+
VueFormGenerator supports custom fields. If you decide to release your custom field into the wild, please open a new issue so we can add you to a list here! Please try to use this naming convention for your custom field : vfg-field-\* Example :
223+
224+
* `vfg-field-myfield`
225+
* `vfg-field-calendar`
226+
* `vfg-field-awesome-dropdown`
205227

206228
This way, it will be easier for everyone to find it. Thank you !
207229

208230
### Public Custom Fields
209231

210-
- [vue-tel-input](https://github.com/EducationLink/vue-tel-input) - International Telephone Input Boilerplate with Vue (integrated with VueFormGenerator).
211-
- [vfg-field-sourcecode](https://github.com/gwenaelp/vfg-field-sourcecode) - A source code field for vue-form-generator
212-
- [vfg-field-object](https://github.com/gwenaelp/vfg-field-object) - A vue-form-generator field to handle objects, with or without schemas.
232+
* [vue-tel-input](https://github.com/EducationLink/vue-tel-input) - International Telephone Input Boilerplate with Vue (integrated with VueFormGenerator).
233+
* [vfg-field-sourcecode](https://github.com/gwenaelp/vfg-field-sourcecode) - A source code field for vue-form-generator
234+
* [vfg-field-array](https://github.com/gwenaelp/vfg-field-array) - A vue-form-generator field to handle arrays of items of any type.
235+
* [vfg-field-object](https://github.com/gwenaelp/vfg-field-object) - A vue-form-generator field to handle objects, with or without schemas.
213236

214237
## Contribution
238+
215239
Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.
216240

217241
## License
242+
218243
vue-form-generator is available under the [MIT license](https://tldrlegal.com/license/mit-license).
219244

220245
## Contact

bower.json

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
{
2-
"name": "vue-form-generator",
3-
"version": "2.2.2",
4-
"homepage": "https://github.com/icebob/vue-form-generator",
5-
"authors": [
6-
"Icebob"
7-
],
8-
"description": "A schema-based form generator component for Vue.js",
9-
"main": [
10-
"dist/vfg.js",
11-
"dist/vfg.css",
12-
"dist/vfg-core.js",
13-
"dist/vfg-core.css"
14-
],
15-
"moduleType": [
16-
"amd"
17-
],
18-
"keywords": [
19-
"vue",
20-
"vuejs",
21-
"form",
22-
"generator",
23-
"schema",
24-
"json"
25-
],
26-
"license": "MIT",
27-
"ignore": [
28-
"**/.*",
29-
"node_modules",
30-
"bower_components",
31-
"test",
32-
"tests"
33-
]
2+
"name": "vue-form-generator",
3+
"version": "2.3.0",
4+
"homepage": "https://github.com/vue-generators/vue-form-generator/",
5+
"authors": [
6+
"Icebob"
7+
],
8+
"description": "A schema-based form generator component for Vue.js",
9+
"main": [
10+
"dist/vfg.js",
11+
"dist/vfg.css",
12+
"dist/vfg-core.js",
13+
"dist/vfg-core.css"
14+
],
15+
"moduleType": [
16+
"amd"
17+
],
18+
"keywords": [
19+
"vue",
20+
"vuejs",
21+
"form",
22+
"generator",
23+
"schema",
24+
"json"
25+
],
26+
"license": "MIT",
27+
"ignore": [
28+
"**/.*",
29+
"node_modules",
30+
"bower_components",
31+
"test",
32+
"tests"
33+
]
3434
}

build/webpack.build.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const banner =
77
" * vue-form-generator v" +
88
version +
99
"\n" +
10-
" * https://github.com/icebob/vue-form-generator\n" +
10+
" * https://github.com/vue-generators/vue-form-generator/\n" +
1111
" * Released under the MIT License.\n" +
1212
" */\n";
1313
const ExtractTextPlugin = require("extract-text-webpack-plugin");
File renamed without changes.

dev/projects/basic/app.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</template>
1616

1717
<script>
18-
import mixinUtils from "../../mixinUtils";
18+
import mixinUtils from "../../mixins/utils.js";
1919
2020
export default {
2121
mixins: [mixinUtils],

dev/projects/checklist/app.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<script>
1818
import { validators } from "../../../src";
19-
import mixinUtils from "../../mixinUtils";
19+
import mixinUtils from "../../mixins/utils.js";
2020
2121
export default {
2222
mixins: [mixinUtils],

dev/projects/full/app.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import Fakerator from "fakerator";
3939
4040
import Schema from "./schema";
4141
import { users } from "./data";
42-
import mixinUtils from "../../mixinUtils";
42+
import mixinUtils from "../../mixins/utils.js";
4343
4444
import Multiselect from "vue-multiselect";
4545
Vue.component("multiselect", Multiselect);

dev/projects/full/schema.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ export default {
991991
// pattern: "^\\+[0-9]{2}-[237]0-[0-9]{3}-[0-9]{4}$",
992992
// placeholder: "User's phone number",
993993
// hint: "Format: +36-(20|30|70)-000-0000",
994-
// help: "You can use any <b>formatted</b> texts. Or place a <a target='_blank' href='https://github.com/icebob/vue-form-generator'>link</a> to another site.",
994+
// help: "You can use any <b>formatted</b> texts. Or place a <a target='_blank' href='https://github.com/vue-generators/vue-form-generator/'>link</a> to another site.",
995995
// styleClasses: "half-width"
996996
// //validator: validators.regexp
997997
// },

dev/projects/grouping/app.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<div class="container">
33
<h1>Grouping</h1>
44
<div class="row">
5-
<div class="col-sm-12">
5+
<div class="col-sm-12">
66
<vue-form-generator :schema="schema" :model="model" :options="formOptions" tag="section"></vue-form-generator>
7-
</div>
8-
</div>
7+
</div>
8+
</div>
99
<div class="row">
1010
<div class="col-sm-12">
1111
<pre v-if="model" v-html="prettyModel"></pre>
@@ -15,7 +15,7 @@
1515
</template>
1616

1717
<script>
18-
import mixinUtils from "../../mixinUtils";
18+
import mixinUtils from "../../mixins/utils.js";
1919
2020
export default {
2121
mixins: [mixinUtils],

dev/projects/multiselect/app.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<div class="container">
33
<h1>Multiselect</h1>
44
<div class="row">
5-
<div class="col-sm-12">
5+
<div class="col-sm-12">
66
<vue-form-generator :schema="schema" :model="model" :options="formOptions"></vue-form-generator>
7-
</div>
8-
</div>
7+
</div>
8+
</div>
99
<div class="row">
1010
<div class="col-sm-12">
1111
<pre v-if="model" v-html="prettyModel"></pre>
@@ -15,7 +15,7 @@
1515
</template>
1616

1717
<script>
18-
import mixinUtils from "../../mixinUtils";
18+
import mixinUtils from "../../mixins/utils.js";
1919
2020
import Vue from "vue";
2121
import Multiselect from "vue-multiselect";

dev/projects/picker/app.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</template>
1616

1717
<script>
18-
import mixinUtils from "../../mixinUtils";
18+
import mixinUtils from "../../mixins/utils.js";
1919
2020
export default {
2121
mixins: [mixinUtils],

0 commit comments

Comments
 (0)