Skip to content

Commit cefea7f

Browse files
Merge branch 'master' into master
2 parents f39ec46 + bc44da9 commit cefea7f

File tree

122 files changed

+20796
-13428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+20796
-13428
lines changed

.babelrc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
{
2-
"presets": ["es2015", "stage-2"],
3-
"plugins": ["transform-runtime", "lodash"],
4-
"comments": false
5-
}
2+
"presets": [
3+
[
4+
"env",
5+
{
6+
"modules": false,
7+
"useBuiltIns": "entry"
8+
}
9+
],
10+
"stage-2"
11+
],
12+
"plugins": ["transform-runtime", "lodash"],
13+
"env": {
14+
"test": {
15+
"plugins": ["istanbul"]
16+
}
17+
}
18+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = tab
8+
indent_size = 4
9+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/*.js
2+
build/*.js
3+
config/*.js
4+
!.eslintrc.js

.eslintrc.js

Lines changed: 26 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,27 @@
11
module.exports = {
2-
root: true,
3-
"env": {
4-
"browser": true,
5-
"commonjs": true,
6-
"es6": true,
7-
"jquery": false,
8-
"mocha": true
9-
},
10-
"extends": "eslint:recommended",
11-
"parserOptions": {
12-
"sourceType": "module",
13-
"ecmaVersion": 6,
14-
"ecmaFeatures": {
15-
"experimentalObjectRestSpread": true
16-
}
17-
},
18-
"plugins": [
19-
"html"
20-
],
21-
"rules": {
22-
"indent": [
23-
"warn",
24-
"tab",
25-
{ SwitchCase: 1 }
26-
],
27-
"quotes": [
28-
"warn",
29-
"double"
30-
],
31-
"semi": [
32-
"error",
33-
"always"
34-
],
35-
"no-var": [
36-
"error"
37-
],
38-
"no-console": [
39-
"off"
40-
],
41-
"no-unused-vars": [
42-
"warn"
43-
]
44-
}
45-
};
2+
root: true,
3+
parser: "vue-eslint-parser",
4+
parserOptions: {
5+
sourceType: "module",
6+
parser: "babel-eslint"
7+
},
8+
env: {
9+
browser: true,
10+
commonjs: true
11+
},
12+
globals: {
13+
process: true
14+
},
15+
extends: ["eslint:recommended", "plugin:vue/essential"],
16+
plugins: ["prettier"],
17+
rules: {
18+
indent: [1, "tab", { SwitchCase: 1 }],
19+
quotes: [1, "double", { allowTemplateLiterals: true }],
20+
semi: [2, "always"],
21+
"no-var": [2],
22+
"no-console": [0],
23+
"no-unused-vars": [1],
24+
"no-throw-literal": 0,
25+
eqeqeq: [2, "smart"]
26+
}
27+
};

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
.DS_Store
22
node_modules/
3-
coverage/
43
docs/_book/
54
npm-debug.log
65
selenium-debug.log
76
test/unit/coverage
87
test/e2e/reports
98
stats.json
109
typings/
11-
typings.json
10+
typings.json

.jsbeautifyrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 59 additions & 35 deletions
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,57 +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-array](https://github.com/gwenaelp/vfg-field-array) - A vue-form-generator field to handle arrays of items of any type.
213-
- [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.
214236

215237
## Contribution
238+
216239
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.
217240

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

221245
## Contact

0 commit comments

Comments
 (0)