Releases: vue-generators/vue-form-generator
v2.2.0
- add console.log (fa779bd)
- add console.log to debug (d05818e)
- add indent (026439a)
- add unscape html for error message. (20b8d9d)
- added "getLabelClasses" and unit test, using the fieldClasses unit test as an example (8c01307)
- added labelClasses support (acdbb6c)
- added missing "id" attributes to checkbox, checklist, radios and submit (09d44c1)
- added missing comma that failed in Travis (32c7627)
- added styleClasses support to groups (8b6801b)
- addeds "styleClasses" to group schemas, reimplements #339 (8e4b43d)
- bumped vue version to 2.5.3 (7d7c0c4)
- change the judgement (d4bc27a)
- check if field.type is undefined before appending the "field-undefined" class (9993550)
- commit the built bundle (45e1436)
- commit the built dist (12b3cf7)
- commit without console.log (79a77bd)
- delete console.log (ed853a2)
- don't render labels when no label text is provided, proposed option 1 from #347 (8ecc851)
- fix bower.json validation (2afb4ac)
- fixed null check (7842b92)
- fixed Vue version (624ed92)
- fixes #340 - "none" value set to
null
, formatValueToField checks forisNil(value)
and returns `n (5b42807), closes #340 - fixes #341 - introduced debounce functionality into
formatValueToModel
(a46fe31), closes #341 - fixes #345 - declare debouncedValidateFunc and set it when debouncedValidate() is called... vue 2.2. (ee684f0), closes #345
- fixes #358 - support "validateBeforeSubmit" with async validators (5a26ef1), closes #358
- fixes #361 - use $event.target.valueAsNumber for number/range inputs, debounce
formatValueToModel
(d1a8bcf), closes #361 - fixes #362 -
integer
validator now callsnumber
validator, and returns `invalidIntegerl: "The va (8d436be), closes #362 - Groupped fields "tag" param fixed. (9275a26)
- moved unit test to formGenerator, as labels are managed by formGenerator and not the field component (f102967)
- remove garbage (17eeae5)
- remove the errorUnescaped property, add v-html on the error part (ecd2ca5)
- remove uniqueId import (c86d7dc)
- removed commented out console.log statements (e9bf285)
- removed console.log and fixed quotes (025b541)
- removed indentation (49f57b8)
- requested by @icebob (2724809)
- reverted back to
schema.required
for "none selected" disabled state, per @icebob (f562d7f) - reverting back to original test (4ba3d4a)
- Update badges (705c6a7)
- Update formGenerator.vue (3208446)
- update node-sass (e3eee64)
- Update README.md (f57faba)
- Update README.md (1092e01)
- Update README.md (9d9701b)
- updated tests for modified label logic (f0c2281)
v2.1.1
- 📦 build (a8eaf38)
- 📦 Build (c0b9007)
- 📦 Build (e43baec)
- Add
validateDebounceTime
formOption to fix #309 (20bbd59), closes #309 - Add empty formatValueToField & formatValueToModel. Fix #308 #276 (3353860), closes #308 #276
- Add minlength attribute to input field (f608113)
- added css classes for core fields (05a98eb)
- bump version (b8d5820)
- checklist input name (9c6c8d8), closes #243
- Clarified css import instructions (f1f6997)
- Cleave field fixed. (3aec9af)
- Error options handled. (7877bb7)
- File input warning message fixed. (c0ea9f7)
- fix custom field import error (22a3197)
- Fix lint. (c4e4a52)
- Fix slugify. (17aba74)
- Fix syntax error in template. (19cb7bb)
- Fixed #234 (42b4fcb), closes #234
- fixed missing semi-colon (e4c6093)
- fixed pug syntax (b4bf14e)
- Group options in function value. (15344d7)
- hint (a8f09ae)
- Hint (4fe380e)
- Hint test (e637c60)
- Improve onChange in file field. (b0baf00)
- Input type range now return a
Number
(8d891d2) - Missing semicolon fixed. (fec34f4)
- New field: file upload (fieldFile). (5b74ead)
- refactored to (db63f91)
- Refinement (89ee169)
- Refinement (daefe38)
- removed unnecessary semi-colon to fix travis (076f0e8)
- Rename fieldFile to fieldUpload. (9bfbb4e)
- Syntax error fix. (6a171e3)
- Test 1. version. (cacf34f)
- Test fixed. (98bc6b6)
- Update selection field with group options. (07bbb07)
- Use
name
in checklist input fields with slugify. Fix #243 (a60c0db), closes #243 - Use selectOptions in selectEx (fa2acf1)
Stable v2.0.0
This is the stable version of VFG v2.0.0 which supports Vue v2.x
v2.0.0-beta7
New
Accessibility #201
Now every field has an id
property which is the id of input
.If not set, will be auto-generated from the slugified version of either: schema.inputName
, schema.label
or schema.model
, in that order. If the fieldIdPrefix
option is set, it's value will be prepended to both manual & auto-generated ids.
Grouping fields #209
This PR add two new features to vfg by @dflock & @jmverges.
- add ID prefix for fields
- support to grouping fields of schema
Syntax:
schema: {
groups:[{
legend: "Contact Details",
fields: [
{
type: "input",
inputType: "text",
label: "Name",
model: "name"
},
{
type: "input",
inputType: "email",
label: "Email",
model: "email"
}
]
},{
legend: "Other Details",
fields: [
{
type: "input",
inputType: "text",
label: "More",
model: "others.more"
},
{
type: "input",
inputType: "text",
label: "Things",
model: "others.things"
}
]
}],
fields: [
{
type: "input",
inputType: "text",
label: "Single field (without group)",
model: "single"
}
]
}
Dev example: http://localhost:8080/grouping/
Support bootstrap columns on fields #180
This would allow styleClasses:'col-xs-6'
for example if you want to have multiple fields in one row.
Support custom validation classes #183
Usage:
formOptions: {
validationErrorClass: "has-error",
validationSuccessClass: "has-success"
}
Add a props to change the main tag #198
I have a first solution to make it a little more flexible with the is
attribute.
// vfg.vue
<template>
<div :is="tag">VFG</div>
</template>
<script>
export default {
props: {
tag: {
type: String,
default: 'fieldset'
}
}
};
</script>
basic usage
<vfg></vfg>
config usage
<vfg tag="section"></vfg>
basic usage rendered
<fieldset>VFG</fieldset>
config usage rendered
<section>VFG</section>
Commits
- 📦 build (71e9eb4)
- 📦 build (908100e)
- 📦 build (5105f39)
- [BUGFIX] Fieldset in proper place un puq template (79c0852)
- [BUGFIX] vue-form-gerenator class in wrapper div (b5d58ac)
- [FEATURE] Groups (613e831)
- Add a props to change the main tag (90b0767)
- Add support for schema.legend & field id prefixes (a6165c8)
- Add unit test for vueFormGenerator.fieldTypeHasLabel (c61b941)
- Added props validation for "tag" and unit test for it. (c728597)
- Added tests for abstractField.getFieldID() (492514d)
- bump version (5a30f87)
- fix checklist validation bug #194 (bea085f), closes #194
- fix lints (890ed44)
- fix schema.fields error (d2b67e0)
- fix tests & layout for fields (ee5ed30)
- fixed indentation (425faa2)
- Implement #199 (547ea2e)
- Make fieldTypeHasLabel test actually work & test default path (d618958)
- remove .sync (d008869)
- remove tag from groups (b4dc972)
- rename
options
toformOptions
because conflicted with vueMultiSelect property (2f29943) - rename example & improve code (caa4124)
- Support bootstrap columns on fields (fc2d47a)
- Support custom validation classes (378a2a7)
v2.0.0-beta6
New
Support async validators #171
let customAsyncValidator = function(value) {
return new Promise((resolve, reject) => {
setTimeout(() => {
if (value)
resolve();
else
resolve([ "Invalid value from async validator" ]);
}, 1000);
});
};
Schema:
{
type: "input",
inputType: "url",
label: "URL",
model: "website",
validator: customAsyncValidator
}
Custom messages for validators #169
You can add custom validator messages for fields in schema.
Every validator function has a method locale
. Parameter is an object of custom messages.
Example:
let schema = {
fields: [
{
type: "input",
inputType: "password",
label: "Password",
model: "password",
min: 6,
required: true,
// String validator with custom error messages
validator: validators.string.locale({
fieldIsRequired: "The password is required!",
textTooSmall: "Password must be at least {1} characters"
})
}
]
}
Ability to use string as name of validator by jmverges #167
You can set validator as string instead of Function.
{
type: "input",
inputType: "text",
label: "Name",
model: "name",
min: 3,
validator: "string"
}
This is a shorthand for VueFormGenerator.validators.string
. It can be an Array of Strings too.
Fixes
- fixed vue-multiselect customLabel handling by cristijora #159
- fixed "TypeError: this.value.push is not a function" in
checklist
by lionel-bijaoui #156 - ... other minor fixes.
Commits
- 📦 build (dd33ea0)
- #159 Fix customLabel function from multi-select field to work with object values (84d3e41)
- #172 Sync model value with files from file upload input (4ac96e4)
checklist
field now support array of string or array of objects (withname
andvalue
propertie (be09146)radios
field now support array of string or array of objects (withname
andvalue
properties) (0f48c30)- add
.locale
method to every validator (1dc7fb7) - Add a
is-checked
class to element where the input is checked to ease customisation. Add checklist (3facc08) - add example to dev (267073c)
- add test for async validator (e9463c2)
- bump version (8ced4af)
- change
input
event tochange
on checlist field (e6a2b9a) - Change
onChange
trigger event fromchange
toinput
forchecklist
(67a3659) - fix #174 (d939c95), closes #174
- Fix a problem with value define but not an Array (190f67a)
- fix double validator (7c6d658)
- Fix error "TypeError: this.value.push is not a function" in
checklist
(c66b0e9) - fix lint (1f99ab6)
- fix parameters of validators (d97c917)
- Fix test to reflect changes (6126f25)
- fix usage example in readme (596b302)
- Fix validator messages interpolation (6b44e39)
- Improve readme file. (846cf15)
- Move some dependency to devDependency (b00e4bb)
- Provides ability to use strings as validators (36c7829)
- remove only from test (560d234)
- simplify code (cd922ee)
- support async (promised) validators #170 (d50a756)
- update code language in readme (3ee0865)
- Update the unit test to reflect the changes and test for the new behavior. Fix lint error. (1f6150f)
- Update unit test for
checklist
(24eb17f) - Update unit test for
radios
(8a94e81) - Use
this.$set
instead of a direct assignation (4b7e118)
v2.0.0-beta5
Break changes
Removed deprecated fields. #121
If you are using text
, number
, color
, email
, password
or range
field type in schema, please change it to input
and set the type into inputType
property. Example:
Old way
{
type: "text"
},
{
type: "number"
}
New way
{
type: "input"
inputType: "text"
},
{
type: "input"
inputType: "number"
}
Created two separated & renamed bundle file: full
and core
#121
Core is a more minimal version with only half the fields.
Full is core + other fields.
- Full bundle: 75 kB (gzipped: 19 kB)
- Core bundle: 39 kB (gzipped: 11 kB)
If you don't know what to choose, don't worry, the full is the default version.
If you want the slim down version, here is the changes:
// the "core" way
<script>
import VueFormGenerator from "vue-form-generator/dist/vfg-core.js";
import "vue-form-generator/dist/vfg-core.css";
</script>
Validation error handling changed #128 #109
- VFG component emits a
validated
event, if validation executed. Event parameters:isValid: boolean, errors: Array
Example:
<vue-form-generator @validated="onValidated" />
...
methods:{
onValidated(isValid, errors) {
console.log("Validation result: ", isValid, ", Errors:", errors);
}
}
- Fields validation
schema.errors
issue is fixed. Nowerrors
in the local data. The communication with parent is event-based (similar@validated
solution) - Fix
this
in schema functions. Nowthis
is always the instance of vfg. Parameters:model, fieldSchema, vfg
Other important updates
v2.0.0-beta4
- #112 Get rid of Vue dependency in the code. (01fa81b)
- add fecha (4751917)
- add fecha instead of moment (dcaa273)
- add lodash babel plugin (8dce56d)
- Amend error message for vue-multi-select (dc0ace9)
- bump version (ede7fd8)
- fix dateTimePicker (53d3867)
- fix dev example (ecd812f)
- fix dev example (8be80aa)
- fix eslint restspread error (cc7a436)
- fix fieldImage url if undefined (d199677)
- fix model-changed event value (364a1ce)
- fix pikaday (e7589b3)
- fix unreactive model sets (again) (2bef826)
- handle null value (97213a8)
- remove skip from pikaday tests (39ce4c6)
- remove unused comment (8c47cf9)
- remove unused comments (c61ab6b)
- update datetimepicker version (d3faf1c)
- Update README.md (2095c08)
- Update README.md (b095166)
- update year (afe5e74)
v2.0.0-beta3
v2.0.0-beta2
- 🐛 fix examples (b8c82c0)
- 🐛 fix examples (86d2ef4)
- 📦 Build beta2 (ab562bd)
- Add support for readonly and featured field functions (065d0a7)
- Allow form fields required state to be controlled with a function, (e08dbbb)
- bump version to 2.0.0-beta2 (94347e7)
- fix checkbox tests (593307b)
- Fix some CSS visual bugs (7a786f7)
- fix some errors (8d3ca97)
- Fix vue version in examples (ebfc4b0)
- fix vue-multiselect test errors (2aacb57)
- remove console.log (454fa0e)
- remove v4 from travis (bbdcc0f)
- reorganize dev codes (386fa3f)
- update deps (f4e5709)
- update readme (eb6328c)
- Update README.md (ea91365)
- update travis. Remove v5, add v7 (1d85539)
- update yarn lock (e57725c)
- update yarn lock (df5aca0)
v2.0.0 Beta 1
- 🐛 fix $index (80ecf31)
- 🐛 fix examples (8ab6894)
- 📦 first build for Vue 2.x (393461b)
- [wip] modification to work with vuejs 2.0. (0b1df2c)
- Fix a bug with v-model and dynamic type on input. (1d090df)
- fix validator error (d671057)
- Update README.md (acd1e22)
- Update vuejs version to 2.1.3, and made change accordingly (added vue-template-compiler). Update vue (61b76c1)
- test: fix checklist tests (f3202fa)
- test: fix fieldCleave tests (caae630)
- test: fix selectEx tests (b240183)
- test: fix test cases (8044f9e)
- fix: aligned with issue #84 (5d6c0c7)
- fix: rewrite in jade and commenting problematic fields (35be49e)