diff --git a/build/webpack.dev.config.js b/build/webpack.dev.config.js
index c840e470..00d2bf9c 100644
--- a/build/webpack.dev.config.js
+++ b/build/webpack.dev.config.js
@@ -48,6 +48,7 @@ module.exports = {
basic: path.resolve("dev", "projects", "basic", "main.js"),
mselect: path.resolve("dev", "projects", "multiselect", "main.js"),
grouping: path.resolve("dev", "projects", "grouping", "main.js"),
+ multi: path.resolve("dev", "projects", "multi", "main.js"),
checklist: path.resolve("dev", "projects", "checklist", "main.js"),
picker: path.resolve("dev", "projects", "picker", "main.js")
},
diff --git a/dev/projects/basic/app.vue b/dev/projects/basic/app.vue
index 40a32d19..31f5431a 100644
--- a/dev/projects/basic/app.vue
+++ b/dev/projects/basic/app.vue
@@ -97,8 +97,7 @@ export default {
formOptions: {
validateAfterLoad: true,
- validateAfterChanged: true,
- validateBeforeSave: true
+ validateAfterChanged: true
}
};
},
diff --git a/dev/projects/full/app.vue b/dev/projects/full/app.vue
index ba4c898d..cbc5b439 100644
--- a/dev/projects/full/app.vue
+++ b/dev/projects/full/app.vue
@@ -75,8 +75,7 @@ export default {
formOptions: {
validateAfterLoad: true,
- validateAfterChanged: true,
- validateBeforeSave: true
+ validateAfterChanged: true
}
};
},
@@ -118,7 +117,7 @@ export default {
},
onValidated(res, errors) {
- console.log("VFG validated:", res, errors);
+ console.log("onValidated VFG validated:", arguments, res, errors);
},
generateModel() {
@@ -145,24 +144,28 @@ export default {
},
saveModel() {
- console.log("Save model...");
- if (this.formOptions.validateBeforeSave === false || this.validate()) {
- this.mergeModelValues();
-
- if (this.isNewModel) {
- this.rows.push(this.model);
- this.selectRow(null, this.model, false);
+ console.log("Save model...", this.validate, typeof this.validate);
+ this.validate().then(
+ (test) => {
+ console.log("saveModel", test);
+ this.mergeModelValues();
+
+ if (this.isNewModel) {
+ this.rows.push(this.model);
+ this.selectRow(null, this.model, false);
+ }
+ },
+ (error) => {
+ // Validation error
+ console.warn("Error saving model...", error);
}
- } else {
- console.warn("Error saving model...");
- // Validation error
- }
+ );
},
mergeModelValues() {
let model = this.model;
if (model && this.selected.length > 0) {
- each(this.selected, row => {
+ each(this.selected, (row) => {
merge(row, model);
});
}
@@ -170,7 +173,7 @@ export default {
deleteModel() {
if (this.selected.length > 0) {
- each(this.selected, row => {
+ each(this.selected, (row) => {
let index = this.rows.indexOf(row);
this.rows.splice(index, 1);
});
@@ -181,7 +184,7 @@ export default {
getNextID() {
let id = 0;
- each(this.rows, row => {
+ each(this.rows, (row) => {
if (row.id > id) id = row.id;
});
@@ -189,7 +192,8 @@ export default {
},
validate() {
- // console.log("validate", this.$refs.form, this.$refs.form.validate());
+ console.log("APP validate", this.$refs.form, typeof this.$refs.form.validate);
+
return this.$refs.form.validate();
},
@@ -199,7 +203,7 @@ export default {
getLocation(model) {
if (navigator.geolocation) {
- navigator.geolocation.getCurrentPosition(pos => {
+ navigator.geolocation.getCurrentPosition((pos) => {
if (!model.address) model.address = {};
if (!model.address.geo) model.address.geo = {};
model.address.geo.latitude = pos.coords.latitude.toFixed(5);
diff --git a/dev/projects/full/schema.js b/dev/projects/full/schema.js
index 10bc44a9..3ba4aa64 100644
--- a/dev/projects/full/schema.js
+++ b/dev/projects/full/schema.js
@@ -461,30 +461,30 @@ export default {
}
]
},
- {
- type: "staticMap",
- model: "address.geo",
- label: "Map",
- visible: false,
- fieldOptions: {
- lat: "latitude",
- lng: "longitude",
- zoom: 6,
- sizeX: 640,
- sizeY: 640,
- scale: 1,
- format: "png",
- // maptype:"satellite",
- language: "FR-fr",
- // region:
- markers: "color:blue%7Clabel:S%7C43.107733,4.541936"
- // path:
- // visible:
- // style:"feature:road.highway%7Celement:labels.text.stroke%7Cvisibility:on%7Ccolor:0xb06eba&style=feature:road.highway%7Celement:labels.text.fill%7Cvisibility:on%7Ccolor:0xffffff",
- // key:
- // signature:
- }
- },
+ // {
+ // type: "staticMap",
+ // model: "address.geo",
+ // label: "Map",
+ // visible: false,
+ // fieldOptions: {
+ // lat: "latitude",
+ // lng: "longitude",
+ // zoom: 6,
+ // sizeX: 640,
+ // sizeY: 640,
+ // scale: 1,
+ // format: "png",
+ // // maptype:"satellite",
+ // language: "FR-fr",
+ // // region:
+ // markers: "color:blue%7Clabel:S%7C43.107733,4.541936"
+ // // path:
+ // // visible:
+ // // style:"feature:road.highway%7Celement:labels.text.stroke%7Cvisibility:on%7Ccolor:0xb06eba&style=feature:road.highway%7Celement:labels.text.fill%7Cvisibility:on%7Ccolor:0xffffff",
+ // // key:
+ // // signature:
+ // }
+ // },
{
type: "switch",
model: "status",
diff --git a/dev/projects/grouping/app.vue b/dev/projects/grouping/app.vue
index 7a337fc8..9a81fb18 100644
--- a/dev/projects/grouping/app.vue
+++ b/dev/projects/grouping/app.vue
@@ -29,13 +29,16 @@ export default {
more: "More",
things: "Things"
},
- single: "blah"
+ single: "blah",
+ subname: ""
},
schema: {
- groups: [
+ fields: [
{
+ type: "group",
legend: "Contact Details",
+ tag: "div",
fields: [
{
type: "input",
@@ -43,7 +46,27 @@ export default {
label: "Name",
fieldOptions: {
inputType: "text"
- }
+ },
+ required: true,
+ validator: ["required"]
+ },
+ {
+ type: "group",
+ legend: "Subgroup",
+ styleClasses: "subgroup",
+ tag: "fieldset",
+ fields: [
+ {
+ type: "input",
+ model: "subname",
+ label: "Name",
+ fieldOptions: {
+ inputType: "text"
+ },
+ required: true,
+ validator: ["required"]
+ }
+ ]
},
{
type: "input",
@@ -56,6 +79,17 @@ export default {
]
},
{
+ type: "input",
+ model: "single",
+ label: "Single field (without group)",
+ fieldOptions: {
+ inputType: "text"
+ },
+ required: true,
+ validator: ["string"]
+ },
+ {
+ type: "group",
legend: "Other Details",
fields: [
{
@@ -76,20 +110,12 @@ export default {
}
]
}
- ],
- fields: [
- {
- type: "input",
- model: "single",
- label: "Single field (without group)",
- fieldOptions: {
- inputType: "text"
- }
- }
]
},
formOptions: {
+ validateAfterLoad: true,
+ validateAfterChanged: true,
fieldIdPrefix: "frm1-"
}
};
@@ -103,4 +129,15 @@ export default {
diff --git a/dev/projects/multi/app.vue b/dev/projects/multi/app.vue
new file mode 100644
index 00000000..05cebd8a
--- /dev/null
+++ b/dev/projects/multi/app.vue
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
diff --git a/dev/projects/multi/index.html b/dev/projects/multi/index.html
new file mode 100644
index 00000000..c9dde342
--- /dev/null
+++ b/dev/projects/multi/index.html
@@ -0,0 +1,22 @@
+
+
+
+
+
+ vue-form-generator development
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/projects/multi/main.js b/dev/projects/multi/main.js
new file mode 100644
index 00000000..b63543ee
--- /dev/null
+++ b/dev/projects/multi/main.js
@@ -0,0 +1,9 @@
+import Vue from "vue";
+import VueFormGenerator from "../../../src";
+Vue.use(VueFormGenerator);
+
+import App from "./app.vue";
+
+new Vue({
+ ...App
+}).$mount("#app");
diff --git a/package-lock.json b/package-lock.json
index f93aa73a..f7f16a62 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,24 +13,51 @@
"@babel/highlight": "7.0.0-beta.44"
}
},
+ "@babel/generator": {
+ "version": "7.0.0-beta.44",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.44.tgz",
+ "integrity": "sha512-5xVb7hlhjGcdkKpMXgicAVgx8syK5VJz193k0i/0sLP6DzE6lRrU1K3B/rFefgdo9LPGMAOOOAWW4jycj07ShQ==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "7.0.0-beta.44",
+ "jsesc": "2.5.1",
+ "lodash": "4.17.11",
+ "source-map": "0.5.7",
+ "trim-right": "1.0.1"
+ },
+ "dependencies": {
+ "jsesc": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz",
+ "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=",
+ "dev": true
+ },
+ "source-map": {
+ "version": "0.5.7",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+ "dev": true
+ }
+ }
+ },
"@babel/helper-function-name": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.36.tgz",
- "integrity": "sha512-/SGPOyifPf20iTrMN+WdlY2MbKa7/o4j7B/4IAsdOusASp2icT+Wcdjf4tjJHaXNX8Pe9bpgVxLNxhRvcf8E5w==",
+ "version": "7.0.0-beta.44",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz",
+ "integrity": "sha512-MHRG2qZMKMFaBavX0LWpfZ2e+hLloT++N7rfM3DYOMUOGCD8cVjqZpwiL8a0bOX3IYcQev1ruciT0gdFFRTxzg==",
"dev": true,
"requires": {
- "@babel/helper-get-function-arity": "7.0.0-beta.36",
- "@babel/template": "7.0.0-beta.36",
- "@babel/types": "7.0.0-beta.36"
+ "@babel/helper-get-function-arity": "7.0.0-beta.44",
+ "@babel/template": "7.0.0-beta.44",
+ "@babel/types": "7.0.0-beta.44"
}
},
"@babel/helper-get-function-arity": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.36.tgz",
- "integrity": "sha512-vPPcx2vsSoDbcyWr9S3nd0FM3B4hEXnt0p1oKpwa08GwK0fSRxa98MyaRGf8suk8frdQlG1P3mDrz5p/Rr3pbA==",
+ "version": "7.0.0-beta.44",
+ "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz",
+ "integrity": "sha512-w0YjWVwrM2HwP6/H3sEgrSQdkCaxppqFeJtAnB23pRiJB5E/O9Yp7JAAeWBl+gGEgmBFinnTyOv2RN7rcSmMiw==",
"dev": true,
"requires": {
- "@babel/types": "7.0.0-beta.36"
+ "@babel/types": "7.0.0-beta.44"
}
},
"@babel/helper-module-imports": {
@@ -40,7 +67,7 @@
"dev": true,
"requires": {
"@babel/types": "7.0.0-beta.51",
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
},
"dependencies": {
"@babel/types": {
@@ -50,7 +77,7 @@
"dev": true,
"requires": {
"esutils": "2.0.2",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"to-fast-properties": "2.0.0"
}
},
@@ -62,6 +89,15 @@
}
}
},
+ "@babel/helper-split-export-declaration": {
+ "version": "7.0.0-beta.44",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz",
+ "integrity": "sha512-aQ7QowtkgKKzPGf0j6u77kBMdUFVBKNHw2p/3HX/POt5/oz8ec5cs0GwlgM8Hz7ui5EwJnzyfRmkNF1Nx1N7aA==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "7.0.0-beta.44"
+ }
+ },
"@babel/highlight": {
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz",
@@ -111,118 +147,49 @@
"dev": true
},
"@babel/template": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.36.tgz",
- "integrity": "sha512-mUBi90WRyZ9iVvlWLEdeo8gn/tROyJdjKNC4W5xJTSZL+9MS89rTJSqiaJKXIkxk/YRDL/g/8snrG/O0xl33uA==",
+ "version": "7.0.0-beta.44",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz",
+ "integrity": "sha512-w750Sloq0UNifLx1rUqwfbnC6uSUk0mfwwgGRfdLiaUzfAOiH0tHJE6ILQIUi3KYkjiCDTskoIsnfqZvWLBDng==",
"dev": true,
"requires": {
- "@babel/code-frame": "7.0.0-beta.36",
- "@babel/types": "7.0.0-beta.36",
- "babylon": "7.0.0-beta.36",
- "lodash": "4.17.10"
+ "@babel/code-frame": "7.0.0-beta.44",
+ "@babel/types": "7.0.0-beta.44",
+ "babylon": "7.0.0-beta.44",
+ "lodash": "4.17.11"
},
"dependencies": {
- "@babel/code-frame": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz",
- "integrity": "sha512-sW77BFwJ48YvQp3Gzz5xtAUiXuYOL2aMJKDwiaY3OcvdqBFurtYfOpSa4QrNyDxmOGRFSYzUpabU2m9QrlWE7w==",
- "dev": true,
- "requires": {
- "chalk": "2.4.1",
- "esutils": "2.0.2",
- "js-tokens": "3.0.2"
- }
- },
- "ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
"babylon": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.36.tgz",
- "integrity": "sha512-rw4YdadGwajAMMRl6a5swhQ0JCOOFyaYCfJ0AsmNBD8uBD/r4J8mux7wBaqavvFKqUKQYWOzA1Speams4YDzsQ==",
+ "version": "7.0.0-beta.44",
+ "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz",
+ "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==",
"dev": true
- },
- "chalk": {
- "version": "2.4.1",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
- "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.1",
- "escape-string-regexp": "1.0.5",
- "supports-color": "5.4.0"
- }
- },
- "supports-color": {
- "version": "5.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
- "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
- "dev": true,
- "requires": {
- "has-flag": "3.0.0"
- }
}
}
},
"@babel/traverse": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.36.tgz",
- "integrity": "sha512-OTUb6iSKVR/98dGThRJ1BiyfwbuX10BVnkz89IpaerjTPRhDfMBfLsqmzxz5MiywUOW4M0Clta0o7rSxkfcuzw==",
+ "version": "7.0.0-beta.44",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz",
+ "integrity": "sha512-UHuDz8ukQkJCDASKHf+oDt3FVUzFd+QYfuBIsiNu/4+/ix6pP/C+uQZJ6K1oEfbCMv/IKWbgDEh7fcsnIE5AtA==",
"dev": true,
"requires": {
- "@babel/code-frame": "7.0.0-beta.36",
- "@babel/helper-function-name": "7.0.0-beta.36",
- "@babel/types": "7.0.0-beta.36",
- "babylon": "7.0.0-beta.36",
+ "@babel/code-frame": "7.0.0-beta.44",
+ "@babel/generator": "7.0.0-beta.44",
+ "@babel/helper-function-name": "7.0.0-beta.44",
+ "@babel/helper-split-export-declaration": "7.0.0-beta.44",
+ "@babel/types": "7.0.0-beta.44",
+ "babylon": "7.0.0-beta.44",
"debug": "3.1.0",
"globals": "11.7.0",
"invariant": "2.2.4",
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
},
"dependencies": {
- "@babel/code-frame": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz",
- "integrity": "sha512-sW77BFwJ48YvQp3Gzz5xtAUiXuYOL2aMJKDwiaY3OcvdqBFurtYfOpSa4QrNyDxmOGRFSYzUpabU2m9QrlWE7w==",
- "dev": true,
- "requires": {
- "chalk": "2.4.1",
- "esutils": "2.0.2",
- "js-tokens": "3.0.2"
- }
- },
- "ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
"babylon": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.36.tgz",
- "integrity": "sha512-rw4YdadGwajAMMRl6a5swhQ0JCOOFyaYCfJ0AsmNBD8uBD/r4J8mux7wBaqavvFKqUKQYWOzA1Speams4YDzsQ==",
+ "version": "7.0.0-beta.44",
+ "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz",
+ "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==",
"dev": true
},
- "chalk": {
- "version": "2.4.1",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
- "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.1",
- "escape-string-regexp": "1.0.5",
- "supports-color": "5.4.0"
- }
- },
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
@@ -237,26 +204,17 @@
"resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz",
"integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==",
"dev": true
- },
- "supports-color": {
- "version": "5.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
- "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
- "dev": true,
- "requires": {
- "has-flag": "3.0.0"
- }
}
}
},
"@babel/types": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.36.tgz",
- "integrity": "sha512-PyAORDO9um9tfnrddXgmWN9e6Sq9qxraQIt5ynqBOSXKA5qvK1kUr+Q3nSzKFdzorsiK+oqcUnAFvEoKxv9D+Q==",
+ "version": "7.0.0-beta.44",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz",
+ "integrity": "sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ==",
"dev": true,
"requires": {
"esutils": "2.0.2",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"to-fast-properties": "2.0.0"
},
"dependencies": {
@@ -313,13 +271,13 @@
"integrity": "sha512-GJyoAbyo1rEyohUziouJqDL7Nu7stSl3ByyYXLTppbrwdKZ9fFZPLZwKxkxS/Ks4Fo9YG5lALLLttypz0SC7FA==",
"dev": true,
"requires": {
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
}
},
"JSONStream": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.3.tgz",
- "integrity": "sha512-3Sp6WZZ/lXl+nTDoGpGWHEpTnnC6X5fnkolYZR6nwIfzbxxvA8utPWe1gCt7i0m9uVGsSz2IS8K8mJ7HmlduMg==",
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.4.tgz",
+ "integrity": "sha512-Y7vfi3I5oMOYIr+WxV8NZxDSwcbNgzdKYsTNInmycOq9bUYwGg9ryu57Wg5NLmCjqdFPNUmpMBo3kSJN9tCbXg==",
"dev": true,
"requires": {
"jsonparse": "1.3.1",
@@ -482,9 +440,9 @@
}
},
"ajv": {
- "version": "6.5.2",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.2.tgz",
- "integrity": "sha512-hOs7GfvI6tUI1LfZddH82ky6mOMyTuY0mk7kE2pWpmhhUSkumzaTO5vbVwij39MdwPQWCV4Zv57Eo06NtL/GVA==",
+ "version": "6.5.3",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz",
+ "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==",
"dev": true,
"requires": {
"fast-deep-equal": "2.0.1",
@@ -507,10 +465,16 @@
}
}
},
+ "ajv-errors": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.0.tgz",
+ "integrity": "sha1-7PAh+hCP0X37Xms4Py3SM+Mf/Fk=",
+ "dev": true
+ },
"ajv-keywords": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz",
- "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=",
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz",
+ "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=",
"dev": true
},
"align-text": {
@@ -905,17 +869,82 @@
"dev": true
},
"autoprefixer": {
- "version": "8.6.3",
- "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-8.6.3.tgz",
- "integrity": "sha512-KkQyCHBxma7R2eoEkjja/RHUBw+Fc1nY46LdV62fzJI5D7i8mLLCtAZ/AVR3UbXhDZ8mUz4C/PF4lZrbiHa1ZQ==",
+ "version": "9.1.5",
+ "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.1.5.tgz",
+ "integrity": "sha512-kk4Zb6RUc58ld7gdosERHMF3DzIYJc2fp5sX46qEsGXQQy5bXsu8qyLjoxuY1NuQ/cJuCYnx99BfjwnRggrYIw==",
"dev": true,
"requires": {
- "browserslist": "3.2.8",
- "caniuse-lite": "1.0.30000856",
+ "browserslist": "4.1.1",
+ "caniuse-lite": "1.0.30000885",
"normalize-range": "0.1.2",
"num2fraction": "1.2.2",
- "postcss": "6.0.22",
+ "postcss": "7.0.2",
"postcss-value-parser": "3.3.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "1.9.0"
+ }
+ },
+ "browserslist": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.1.1.tgz",
+ "integrity": "sha512-VBorw+tgpOtZ1BYhrVSVTzTt/3+vSE3eFUh0N2GCFK1HffceOaf32YS/bs6WiFhjDAblAFrx85jMy3BG9fBK2Q==",
+ "dev": true,
+ "requires": {
+ "caniuse-lite": "1.0.30000885",
+ "electron-to-chromium": "1.3.70",
+ "node-releases": "1.0.0-alpha.11"
+ }
+ },
+ "caniuse-lite": {
+ "version": "1.0.30000885",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000885.tgz",
+ "integrity": "sha512-cXKbYwpxBLd7qHyej16JazPoUacqoVuDhvR61U7Fr5vSxMUiodzcYa1rQYRYfZ5GexV03vGZHd722vNPLjPJGQ==",
+ "dev": true
+ },
+ "chalk": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
+ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "3.2.1",
+ "escape-string-regexp": "1.0.5",
+ "supports-color": "5.5.0"
+ }
+ },
+ "electron-to-chromium": {
+ "version": "1.3.70",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.70.tgz",
+ "integrity": "sha512-WYMjqCnPVS5JA+XvwEnpwucJpVi2+q9cdCFpbhxgWGsCtforFBEkuP9+nCyy/wnU/0SyLcLRIeZct9ayMGcXoQ==",
+ "dev": true
+ },
+ "postcss": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.2.tgz",
+ "integrity": "sha512-fmaUY5370keLUTx+CnwRxtGiuFTcNBLQBqr1oE3WZ/euIYmGAo0OAgOhVJ3ByDnVmOR3PK+0V9VebzfjRIUcqw==",
+ "dev": true,
+ "requires": {
+ "chalk": "2.4.1",
+ "source-map": "0.6.1",
+ "supports-color": "5.5.0"
+ }
+ },
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "3.0.0"
+ }
+ }
}
},
"aws-sign2": {
@@ -960,7 +989,7 @@
"convert-source-map": "1.5.1",
"debug": "2.6.9",
"json5": "0.5.1",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"minimatch": "3.0.4",
"path-is-absolute": "1.0.1",
"private": "0.1.8",
@@ -993,64 +1022,24 @@
}
},
"babel-eslint": {
- "version": "8.2.1",
- "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.1.tgz",
- "integrity": "sha512-RzdVOyWKQRUnLXhwLk+eKb4oyW+BykZSkpYwFhM4tnfzAG5OWfvG0w/uyzMp5XKEU0jN82+JefHr39bG2+KhRQ==",
+ "version": "8.2.6",
+ "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.6.tgz",
+ "integrity": "sha512-aCdHjhzcILdP8c9lej7hvXKvQieyRt20SF102SIGyY4cUIiw6UaAtK4j2o3dXX74jEmy0TJ0CEhv4fTIM3SzcA==",
"dev": true,
"requires": {
- "@babel/code-frame": "7.0.0-beta.36",
- "@babel/traverse": "7.0.0-beta.36",
- "@babel/types": "7.0.0-beta.36",
- "babylon": "7.0.0-beta.36",
+ "@babel/code-frame": "7.0.0-beta.44",
+ "@babel/traverse": "7.0.0-beta.44",
+ "@babel/types": "7.0.0-beta.44",
+ "babylon": "7.0.0-beta.44",
"eslint-scope": "3.7.1",
"eslint-visitor-keys": "1.0.0"
},
"dependencies": {
- "@babel/code-frame": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz",
- "integrity": "sha512-sW77BFwJ48YvQp3Gzz5xtAUiXuYOL2aMJKDwiaY3OcvdqBFurtYfOpSa4QrNyDxmOGRFSYzUpabU2m9QrlWE7w==",
- "dev": true,
- "requires": {
- "chalk": "2.4.1",
- "esutils": "2.0.2",
- "js-tokens": "3.0.2"
- }
- },
- "ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
"babylon": {
- "version": "7.0.0-beta.36",
- "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.36.tgz",
- "integrity": "sha512-rw4YdadGwajAMMRl6a5swhQ0JCOOFyaYCfJ0AsmNBD8uBD/r4J8mux7wBaqavvFKqUKQYWOzA1Speams4YDzsQ==",
+ "version": "7.0.0-beta.44",
+ "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz",
+ "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==",
"dev": true
- },
- "chalk": {
- "version": "2.4.1",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
- "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.1",
- "escape-string-regexp": "1.0.5",
- "supports-color": "5.4.0"
- }
- },
- "supports-color": {
- "version": "5.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
- "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
- "dev": true,
- "requires": {
- "has-flag": "3.0.0"
- }
}
}
},
@@ -1065,7 +1054,7 @@
"babel-types": "6.26.0",
"detect-indent": "4.0.0",
"jsesc": "1.3.0",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"source-map": "0.5.7",
"trim-right": "1.0.1"
},
@@ -1137,7 +1126,7 @@
"babel-helper-function-name": "6.24.1",
"babel-runtime": "6.26.0",
"babel-types": "6.26.0",
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
},
"dependencies": {
"babel-runtime": {
@@ -1232,7 +1221,7 @@
"requires": {
"babel-runtime": "6.26.0",
"babel-types": "6.26.0",
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
},
"dependencies": {
"babel-runtime": {
@@ -1351,7 +1340,7 @@
"@babel/helper-module-imports": "7.0.0-beta.51",
"@babel/types": "7.0.0-beta.51",
"glob": "7.1.2",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"require-package-name": "2.0.1"
},
"dependencies": {
@@ -1362,7 +1351,7 @@
"dev": true,
"requires": {
"esutils": "2.0.2",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"to-fast-properties": "2.0.0"
}
},
@@ -1497,7 +1486,7 @@
"babel-template": "6.26.0",
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
},
"dependencies": {
"babel-runtime": {
@@ -1879,7 +1868,7 @@
"babel-runtime": "6.26.0",
"core-js": "2.5.1",
"home-or-tmp": "2.0.0",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"mkdirp": "0.5.1",
"source-map-support": "0.4.18"
},
@@ -1922,7 +1911,7 @@
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
},
"dependencies": {
"babel-runtime": {
@@ -1957,7 +1946,7 @@
"debug": "2.6.9",
"globals": "9.18.0",
"invariant": "2.2.4",
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
},
"dependencies": {
"babel-runtime": {
@@ -1986,7 +1975,7 @@
"requires": {
"babel-runtime": "6.26.0",
"esutils": "2.0.2",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"to-fast-properties": "1.0.3"
},
"dependencies": {
@@ -2466,7 +2455,7 @@
"integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
"dev": true,
"requires": {
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
}
},
"camelcase": {
@@ -2959,9 +2948,9 @@
}
},
"cleave.js": {
- "version": "1.4.2",
- "resolved": "https://registry.npmjs.org/cleave.js/-/cleave.js-1.4.2.tgz",
- "integrity": "sha512-m3Yv7yyuy4W2sUGCdge0IUkJ1PnGk6wuCgbfjxUlfZWzT5pF0OIpggk/xhjBjXTItPnOy/E4+i3w8h903+zK9g==",
+ "version": "1.4.4",
+ "resolved": "https://registry.npmjs.org/cleave.js/-/cleave.js-1.4.4.tgz",
+ "integrity": "sha512-QZw3B9dhTEe2W9zUJLvJdqn1Bwgq/SlAwRQD7x+EO+QNfYKdLXow2GCLAjhyrGI+vD8P7RTVX6f8b+m3X9niiw==",
"dev": true
},
"cli-boxes": {
@@ -3143,6 +3132,13 @@
"delayed-stream": "1.0.0"
}
},
+ "commander": {
+ "version": "2.17.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
+ "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
+ "dev": true,
+ "optional": true
+ },
"commondir": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
@@ -3197,18 +3193,6 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
- "concat-stream": {
- "version": "1.6.2",
- "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
- "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
- "dev": true,
- "requires": {
- "buffer-from": "1.1.0",
- "inherits": "2.0.3",
- "readable-stream": "2.3.3",
- "typedarray": "0.0.6"
- }
- },
"configstore": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz",
@@ -3301,22 +3285,22 @@
"dev": true
},
"conventional-changelog": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-2.0.1.tgz",
- "integrity": "sha512-WeWcEcR7uBtRZ/uG6DRIlVqsm7UTnxrixaAPoPvfQP7FRPf1qIXL76nGKy4wXq+wO3zOpqYubWUqrYLIL3+xww==",
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-2.0.3.tgz",
+ "integrity": "sha512-4bcII9cJHSKb2qi9e8qGF6aJHLf/AB0dokhyR+X6QILTMl77s4l163vK+reXhajvfOYbbHQvsrWybr5+PKZwNA==",
"dev": true,
"requires": {
"conventional-changelog-angular": "1.6.6",
"conventional-changelog-atom": "2.0.0",
"conventional-changelog-codemirror": "2.0.0",
- "conventional-changelog-core": "3.0.0",
- "conventional-changelog-ember": "2.0.0",
+ "conventional-changelog-core": "3.1.0",
+ "conventional-changelog-ember": "2.0.1",
"conventional-changelog-eslint": "3.0.0",
"conventional-changelog-express": "2.0.0",
"conventional-changelog-jquery": "0.1.0",
"conventional-changelog-jscs": "0.1.0",
"conventional-changelog-jshint": "2.0.0",
- "conventional-changelog-preset-loader": "2.0.0"
+ "conventional-changelog-preset-loader": "2.0.1"
}
},
"conventional-changelog-angular": {
@@ -3339,14 +3323,14 @@
}
},
"conventional-changelog-cli": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-2.0.1.tgz",
- "integrity": "sha512-gQzMbLyPNYymbzJncJNBapLZTXEtXrq6qmQOJH0w/jVX9fxIli4sLalQgzEPjD7M1noLJd1cIdQAP1R++TkGxg==",
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-2.0.5.tgz",
+ "integrity": "sha512-StqCVo10g194UhyLIhg+M/tTVu6YjGnON/IiQ9Ty/h+dgi9obYAkknwpmmgGJMQ3P3vNRljuZBupz0N2tpdxXg==",
"dev": true,
"requires": {
"add-stream": "1.0.0",
- "conventional-changelog": "2.0.1",
- "lodash": "4.17.10",
+ "conventional-changelog": "2.0.3",
+ "lodash": "4.17.11",
"meow": "4.0.1",
"tempfile": "1.1.1"
},
@@ -3420,7 +3404,7 @@
},
"minimist": {
"version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
@@ -3510,9 +3494,9 @@
}
},
"conventional-changelog-core": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.0.0.tgz",
- "integrity": "sha512-D2hApWWsdh4tkNgDjn1KtRapxUJ70Sd+V84btTVJJJ96S3cVRES8Ty3ih0TRkOZmDkw/uS0mxrHSskQ/P/Gvsg==",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.1.0.tgz",
+ "integrity": "sha512-bcZkcFXkqVgG2W8m/1wjlp2wn/BKDcrPgw3/mvSEQtzs8Pax8JbAPFpEQReHY92+EKNNXC67wLA8y2xcNx0rDA==",
"dev": true,
"requires": {
"conventional-changelog-writer": "4.0.0",
@@ -3522,7 +3506,7 @@
"git-raw-commits": "2.0.0",
"git-remote-origin-url": "2.0.0",
"git-semver-tags": "2.0.0",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"normalize-package-data": "2.4.0",
"q": "1.5.1",
"read-pkg": "1.1.0",
@@ -3531,9 +3515,9 @@
}
},
"conventional-changelog-ember": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.0.tgz",
- "integrity": "sha512-s9ZYf3VMdYe8ca8bw1X+he050HZNy9Pm3dBpYA+BunDGFE4Fy7whOvYhWah2U9+j9l6y/whfa0+eHANvZytE9A==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.1.tgz",
+ "integrity": "sha512-Ym1xLi7YLGooLUpHCJhlXJW5V7u/g+hlYD/+HKt0KqG2qbiBi7e7/HO9aScXTEKUBGMm7m4C443R+eCWQI2ynA==",
"dev": true,
"requires": {
"q": "1.5.1"
@@ -3586,9 +3570,9 @@
}
},
"conventional-changelog-preset-loader": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.0.0.tgz",
- "integrity": "sha512-hEWm9o6TxjS9aO1AKaHpl8avSXaUHiUXBT25vJ4ToaDi/gPDqt3OnZkwhIgubADUF+lPqcXpjFTOYcOL4AwyvA==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.0.1.tgz",
+ "integrity": "sha512-HiSfhXNzAzG9klIqJaA97MMiNBR4js+53g4Px0k7tgKeCNVXmrDrm+CY+nIqcmG5NVngEPf8rAr7iji1TWW7zg==",
"dev": true
},
"conventional-changelog-writer": {
@@ -3600,11 +3584,11 @@
"compare-func": "1.3.2",
"conventional-commits-filter": "2.0.0",
"dateformat": "3.0.3",
- "handlebars": "4.0.11",
+ "handlebars": "4.0.12",
"json-stringify-safe": "5.0.1",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"meow": "4.0.1",
- "semver": "5.5.0",
+ "semver": "5.5.1",
"split": "1.0.1",
"through2": "2.0.3"
},
@@ -3678,7 +3662,7 @@
},
"minimist": {
"version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
@@ -3739,9 +3723,9 @@
}
},
"semver": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
- "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
+ "version": "5.5.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz",
+ "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==",
"dev": true
},
"strip-bom": {
@@ -3780,9 +3764,9 @@
"integrity": "sha512-GWh71U26BLWgMykCp+VghZ4s64wVbtseECcKQ/PvcPZR2cUnz+FUc2J9KjxNl7/ZbCxST8R03c9fc+Vi0umS9Q==",
"dev": true,
"requires": {
- "JSONStream": "1.3.3",
+ "JSONStream": "1.3.4",
"is-text-path": "1.0.1",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"meow": "4.0.1",
"split2": "2.2.0",
"through2": "2.0.3",
@@ -3858,7 +3842,7 @@
},
"minimist": {
"version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
@@ -4985,35 +4969,35 @@
}
},
"eslint": {
- "version": "4.19.1",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz",
- "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==",
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.3.0.tgz",
+ "integrity": "sha512-N/tCqlMKkyNvAvLu+zI9AqDasnSLt00K+Hu8kdsERliC9jYEc8ck12XtjvOXrBKu8fK6RrBcN9bat6Xk++9jAg==",
"dev": true,
"requires": {
- "ajv": "5.5.2",
+ "ajv": "6.5.3",
"babel-code-frame": "6.26.0",
"chalk": "2.4.1",
- "concat-stream": "1.6.2",
- "cross-spawn": "5.1.0",
+ "cross-spawn": "6.0.5",
"debug": "3.1.0",
"doctrine": "2.1.0",
- "eslint-scope": "3.7.1",
+ "eslint-scope": "4.0.0",
+ "eslint-utils": "1.3.1",
"eslint-visitor-keys": "1.0.0",
- "espree": "3.5.4",
+ "espree": "4.0.0",
"esquery": "1.0.1",
"esutils": "2.0.2",
"file-entry-cache": "2.0.0",
"functional-red-black-tree": "1.0.1",
"glob": "7.1.2",
- "globals": "11.5.0",
- "ignore": "3.3.8",
+ "globals": "11.7.0",
+ "ignore": "4.0.6",
"imurmurhash": "0.1.4",
- "inquirer": "3.3.0",
+ "inquirer": "5.2.0",
"is-resolvable": "1.1.0",
"js-yaml": "3.12.0",
"json-stable-stringify-without-jsonify": "1.0.1",
"levn": "0.3.0",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"minimatch": "3.0.4",
"mkdirp": "0.5.1",
"natural-compare": "1.4.0",
@@ -5021,25 +5005,23 @@
"path-is-inside": "1.0.2",
"pluralize": "7.0.0",
"progress": "2.0.0",
- "regexpp": "1.1.0",
+ "regexpp": "2.0.0",
"require-uncached": "1.0.3",
- "semver": "5.4.1",
+ "semver": "5.5.0",
+ "string.prototype.matchall": "2.0.0",
"strip-ansi": "4.0.0",
"strip-json-comments": "2.0.1",
- "table": "4.0.2",
+ "table": "4.0.3",
"text-table": "0.2.0"
},
"dependencies": {
- "ajv": {
- "version": "5.5.2",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
- "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
+ "acorn-jsx": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-4.1.1.tgz",
+ "integrity": "sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw==",
"dev": true,
"requires": {
- "co": "4.6.0",
- "fast-deep-equal": "1.1.0",
- "fast-json-stable-stringify": "2.0.0",
- "json-schema-traverse": "0.3.1"
+ "acorn": "5.7.1"
}
},
"ansi-regex": {
@@ -5068,17 +5050,6 @@
"supports-color": "5.4.0"
}
},
- "cross-spawn": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
- "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
- "dev": true,
- "requires": {
- "lru-cache": "4.1.1",
- "shebang-command": "1.2.0",
- "which": "1.3.0"
- }
- },
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
@@ -5088,28 +5059,38 @@
"ms": "2.0.0"
}
},
- "esprima": {
+ "eslint-scope": {
"version": "4.0.0",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
- "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==",
- "dev": true
- },
- "globals": {
- "version": "11.5.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz",
- "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==",
- "dev": true
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
+ "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "4.2.1",
+ "estraverse": "4.2.0"
+ }
},
- "js-yaml": {
- "version": "3.12.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
- "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
+ "espree": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-4.0.0.tgz",
+ "integrity": "sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg==",
"dev": true,
"requires": {
- "argparse": "1.0.9",
- "esprima": "4.0.0"
+ "acorn": "5.7.1",
+ "acorn-jsx": "4.1.1"
}
},
+ "globals": {
+ "version": "11.7.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz",
+ "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==",
+ "dev": true
+ },
+ "semver": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
+ "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
+ "dev": true
+ },
"strip-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
@@ -5307,7 +5288,7 @@
"eslint-import-resolver-node": "0.3.2",
"eslint-module-utils": "2.2.0",
"has": "1.0.3",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"minimatch": "3.0.4",
"read-pkg-up": "2.0.0",
"resolve": "1.8.1"
@@ -6047,7 +6028,7 @@
"integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==",
"dev": true,
"requires": {
- "ajv": "6.5.2",
+ "ajv": "6.5.3",
"ajv-keywords": "3.2.0"
}
}
@@ -7397,7 +7378,7 @@
},
"minimist": {
"version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
@@ -7494,7 +7475,7 @@
"dev": true,
"requires": {
"meow": "4.0.1",
- "semver": "5.5.0"
+ "semver": "5.5.1"
},
"dependencies": {
"camelcase": {
@@ -7566,7 +7547,7 @@
},
"minimist": {
"version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
@@ -7627,9 +7608,9 @@
}
},
"semver": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
- "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
+ "version": "5.5.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz",
+ "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==",
"dev": true
},
"strip-bom": {
@@ -7754,7 +7735,7 @@
"dev": true,
"requires": {
"glob": "7.1.2",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"minimatch": "3.0.4"
}
},
@@ -7802,24 +7783,35 @@
"dev": true
},
"handlebars": {
- "version": "4.0.11",
- "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz",
- "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=",
+ "version": "4.0.12",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz",
+ "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==",
"dev": true,
"requires": {
- "async": "1.5.2",
+ "async": "2.6.1",
"optimist": "0.6.1",
- "source-map": "0.4.4",
- "uglify-js": "2.8.29"
+ "source-map": "0.6.1",
+ "uglify-js": "3.4.9"
},
"dependencies": {
- "source-map": {
- "version": "0.4.4",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
- "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
+ "async": {
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
+ "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
"dev": true,
"requires": {
- "amdefine": "1.0.1"
+ "lodash": "4.17.11"
+ }
+ },
+ "uglify-js": {
+ "version": "3.4.9",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz",
+ "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "commander": "2.17.1",
+ "source-map": "0.6.1"
}
}
}
@@ -8086,7 +8078,7 @@
"requires": {
"http-proxy": "1.17.0",
"is-glob": "3.1.0",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"micromatch": "2.3.11"
},
"dependencies": {
@@ -8253,9 +8245,9 @@
"dev": true
},
"ignore": {
- "version": "3.3.8",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz",
- "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==",
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
"dev": true
},
"import-lazy": {
@@ -8339,9 +8331,9 @@
}
},
"inquirer": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz",
- "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz",
+ "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==",
"dev": true,
"requires": {
"ansi-escapes": "3.1.0",
@@ -8350,11 +8342,10 @@
"cli-width": "2.2.0",
"external-editor": "2.2.0",
"figures": "2.0.0",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"mute-stream": "0.0.7",
"run-async": "2.3.0",
- "rx-lite": "4.0.8",
- "rx-lite-aggregates": "4.0.8",
+ "rxjs": "5.5.11",
"string-width": "2.1.1",
"strip-ansi": "4.0.0",
"through": "2.3.8"
@@ -8822,7 +8813,7 @@
"integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=",
"dev": true,
"requires": {
- "text-extensions": "1.7.0"
+ "text-extensions": "1.8.0"
}
},
"is-typedarray": {
@@ -9401,7 +9392,7 @@
"integrity": "sha512-e+lJAJeNWuPCNyxZKOBdaJGyLGHugXVQtrAwtuAe2vhxTYxFTKE73p8JuTmdH0qdQZtDvI4dhJwjZc5zsfIsYw==",
"dev": true,
"requires": {
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
}
},
"load-json-file": {
@@ -9665,9 +9656,9 @@
}
},
"lodash": {
- "version": "4.17.10",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
- "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
+ "version": "4.17.11",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
+ "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
"dev": true
},
"lodash._arraycopy": {
@@ -9993,9 +9984,9 @@
}
},
"lolex": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.1.tgz",
- "integrity": "sha512-Oo2Si3RMKV3+lV5MsSWplDQFoTClz/24S0MMHYcgGWWmFXr6TMlqcqk/l1GtH+d5wLBwNRiqGnwDRMirtFalJw==",
+ "version": "2.7.5",
+ "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz",
+ "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==",
"dev": true
},
"longest": {
@@ -10621,7 +10612,7 @@
"interpret": "1.1.0",
"is-glob": "4.0.0",
"loader-utils": "1.1.0",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"memory-fs": "0.4.1",
"nodent-runtime": "3.2.1",
"normalize-path": "2.1.1",
@@ -10990,7 +10981,7 @@
"requires": {
"@sinonjs/formatio": "2.0.0",
"just-extend": "1.1.27",
- "lolex": "2.7.1",
+ "lolex": "2.7.5",
"path-to-regexp": "1.7.0",
"text-encoding": "0.6.4"
}
@@ -11060,6 +11051,15 @@
"vm-browserify": "0.0.4"
}
},
+ "node-releases": {
+ "version": "1.0.0-alpha.11",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.0.0-alpha.11.tgz",
+ "integrity": "sha512-CaViu+2FqTNYOYNihXa5uPS/zry92I3vPU4nCB6JB3OeZ2UGtOpF5gRwuN4+m3hbEcL47bOXyun1jX2iC+3uEQ==",
+ "dev": true,
+ "requires": {
+ "semver": "5.4.1"
+ }
+ },
"node-sass": {
"version": "4.9.3",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.9.3.tgz",
@@ -11358,7 +11358,7 @@
"requires": {
"@babel/types": "7.0.0-beta.49",
"jsesc": "2.5.1",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"source-map": "0.5.7",
"trim-right": "1.0.1"
}
@@ -11412,7 +11412,7 @@
"@babel/code-frame": "7.0.0-beta.49",
"@babel/parser": "7.0.0-beta.49",
"@babel/types": "7.0.0-beta.49",
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
}
},
"@babel/traverse": {
@@ -11430,7 +11430,7 @@
"debug": "3.1.0",
"globals": "11.5.0",
"invariant": "2.2.4",
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
}
},
"@babel/types": {
@@ -11440,7 +11440,7 @@
"dev": true,
"requires": {
"esutils": "2.0.2",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"to-fast-properties": "2.0.0"
}
},
@@ -16000,10 +16000,19 @@
}
}
},
+ "regexp.prototype.flags": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz",
+ "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==",
+ "dev": true,
+ "requires": {
+ "define-properties": "1.1.2"
+ }
+ },
"regexpp": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz",
- "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.0.tgz",
+ "integrity": "sha512-g2FAVtR8Uh8GO1Nv5wpxW7VFVwHcCEr4wyA8/MHiRkO8uHoR5ntAA8Uq3P1vvMTX/BeQiRVSpDGLd+Wn5HNOTA==",
"dev": true
},
"regexpu-core": {
@@ -16155,7 +16164,7 @@
"integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=",
"dev": true,
"requires": {
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
}
},
"request-promise-native": {
@@ -16366,19 +16375,13 @@
"is-promise": "2.1.0"
}
},
- "rx-lite": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
- "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
- "dev": true
- },
- "rx-lite-aggregates": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz",
- "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=",
+ "rxjs": {
+ "version": "5.5.11",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.11.tgz",
+ "integrity": "sha512-3bjO7UwWfA2CV7lmwYMBzj4fQ6Cq+ftHc2MvUe+WMS7wcdJ1LosDWmdjPQanYp2dBRj572p7PeU81JUxHKOcBA==",
"dev": true,
"requires": {
- "rx-lite": "4.0.8"
+ "symbol-observable": "1.0.1"
}
},
"safe-buffer": {
@@ -16415,7 +16418,7 @@
"dev": true,
"requires": {
"glob": "7.1.2",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"scss-tokenizer": "0.2.3",
"yargs": "7.1.0"
},
@@ -17219,7 +17222,7 @@
"integrity": "sha1-LFlJtTHgf4eojm6k3PrFOqjHWis=",
"dev": true,
"requires": {
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
}
},
"statuses": {
@@ -17315,6 +17318,19 @@
"strip-ansi": "3.0.1"
}
},
+ "string.prototype.matchall": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz",
+ "integrity": "sha512-WoZ+B2ypng1dp4iFLF2kmZlwwlE19gmjgKuhL1FJfDgCREWb3ye3SDVHSzLH6bxfnvYmkCxbzkmWcQZHA4P//Q==",
+ "dev": true,
+ "requires": {
+ "define-properties": "1.1.2",
+ "es-abstract": "1.12.0",
+ "function-bind": "1.1.1",
+ "has-symbols": "1.0.0",
+ "regexp.prototype.flags": "1.2.0"
+ }
+ },
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
@@ -17396,6 +17412,12 @@
}
}
},
+ "symbol-observable": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
+ "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=",
+ "dev": true
+ },
"symbol-tree": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz",
@@ -17403,31 +17425,19 @@
"dev": true
},
"table": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",
- "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==",
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz",
+ "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==",
"dev": true,
"requires": {
- "ajv": "5.5.2",
- "ajv-keywords": "2.1.1",
+ "ajv": "6.5.3",
+ "ajv-keywords": "3.2.0",
"chalk": "2.4.1",
- "lodash": "4.17.10",
+ "lodash": "4.17.11",
"slice-ansi": "1.0.0",
"string-width": "2.1.1"
},
"dependencies": {
- "ajv": {
- "version": "5.5.2",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
- "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
- "dev": true,
- "requires": {
- "co": "4.6.0",
- "fast-deep-equal": "1.1.0",
- "fast-json-stable-stringify": "2.0.0",
- "json-schema-traverse": "0.3.1"
- }
- },
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
@@ -17546,9 +17556,9 @@
"dev": true
},
"text-extensions": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.7.0.tgz",
- "integrity": "sha512-AKXZeDq230UaSzaO5s3qQUZOaC7iKbzq0jOFL614R7d9R593HLqAOL0cYoqLdkNrjBSOdmoQI06yigq1TSBXAg==",
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.8.0.tgz",
+ "integrity": "sha512-mVzjRxuWnDKs/qH1rbOJEVHLlSX9kty9lpi7lMvLgU9S74mQ8/Ozg9UPcKxShh0qG2NZ+NyPOPpcZU4C1Eld9A==",
"dev": true
},
"text-table": {
@@ -17839,12 +17849,6 @@
}
}
},
- "typedarray": {
- "version": "0.0.6",
- "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
- "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
- "dev": true
- },
"uglify-js": {
"version": "2.8.29",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz",
@@ -18098,40 +18102,24 @@
"dev": true
},
"url-loader": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-1.0.1.tgz",
- "integrity": "sha512-rAonpHy7231fmweBKUFe0bYnlGDty77E+fm53NZdij7j/YOpyGzc7ttqG1nAXl3aRs0k41o0PC3TvGXQiw2Zvw==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-1.1.1.tgz",
+ "integrity": "sha512-vugEeXjyYFBCUOpX+ZuaunbK3QXMKaQ3zUnRfIpRBlGkY7QizCnzyyn2ASfcxsvyU3ef+CJppVywnl3Kgf13Gg==",
"dev": true,
"requires": {
"loader-utils": "1.1.0",
"mime": "2.3.1",
- "schema-utils": "0.4.5"
+ "schema-utils": "1.0.0"
},
"dependencies": {
- "ajv-keywords": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz",
- "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=",
- "dev": true
- },
- "loader-utils": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz",
- "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=",
- "dev": true,
- "requires": {
- "big.js": "3.2.0",
- "emojis-list": "2.1.0",
- "json5": "0.5.1"
- }
- },
"schema-utils": {
- "version": "0.4.5",
- "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.5.tgz",
- "integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==",
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz",
+ "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==",
"dev": true,
"requires": {
- "ajv": "6.5.2",
+ "ajv": "6.5.3",
+ "ajv-errors": "1.0.0",
"ajv-keywords": "3.2.0"
}
}
@@ -18279,7 +18267,7 @@
"eslint-visitor-keys": "1.0.0",
"espree": "3.5.4",
"esquery": "1.0.1",
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
},
"dependencies": {
"debug": {
@@ -18993,7 +18981,7 @@
"requires": {
"acorn": "5.7.1",
"acorn-dynamic-import": "2.0.2",
- "ajv": "6.5.2",
+ "ajv": "6.5.3",
"ajv-keywords": "3.2.0",
"async": "2.6.1",
"enhanced-resolve": "3.4.1",
@@ -19033,7 +19021,7 @@
"integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
"dev": true,
"requires": {
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
}
},
"camelcase": {
@@ -19524,7 +19512,7 @@
"integrity": "sha512-TmSe1HZKeOPey3oy1Ov2iS3guIZjWvMT2BBJDzzT5jScHTjVC3mpjJofgueEzaEd6ibhxRDD6MIblDr8tzh8iQ==",
"dev": true,
"requires": {
- "lodash": "4.17.10"
+ "lodash": "4.17.11"
}
},
"webpack-node-externals": {
diff --git a/package.json b/package.json
index ca48762c..95988d5b 100644
--- a/package.json
+++ b/package.json
@@ -46,10 +46,10 @@
"license": "MIT",
"devDependencies": {
"@vue/test-utils": "1.0.0-beta.24",
- "ajv": "6.5.2",
- "autoprefixer": "8.6.3",
+ "ajv": "6.5.3",
+ "autoprefixer": "9.1.5",
"babel-core": "6.26.3",
- "babel-eslint": "8.2.1",
+ "babel-eslint": "8.2.6",
"babel-loader": "7.1.5",
"babel-plugin-istanbul": "4.1.6",
"babel-plugin-lodash": "3.3.4",
@@ -59,13 +59,13 @@
"bumped": "0.10.10",
"bumped-terminal": "0.7.5",
"chai": "4.1.2",
- "cleave.js": "1.4.2",
- "conventional-changelog-cli": "2.0.1",
+ "cleave.js": "1.4.4",
+ "conventional-changelog-cli": "2.0.5",
"coveralls": "3.0.2",
"cross-env": "5.2.0",
"css-loader": "0.28.11",
"eonasdan-bootstrap-datetimepicker": "4.17.47",
- "eslint": "4.19.1",
+ "eslint": "5.3.0",
"eslint-config-prettier": "3.0.1",
"eslint-friendly-formatter": "4.0.1",
"eslint-loader": "2.1.0",
@@ -84,8 +84,8 @@
"jquery": "3.3.1",
"jsdom": "11.12.0",
"jsdom-global": "3.0.2",
- "lodash": "4.17.10",
- "lolex": "2.7.1",
+ "lodash": "4.17.11",
+ "lolex": "2.7.5",
"mocha": "5.2.0",
"mocha-generators": "2.0.0",
"mocha-loader": "1.1.3",
@@ -103,7 +103,7 @@
"sinon-chai": "3.2.0",
"spectrum-colorpicker": "1.8.0",
"stats-webpack-plugin": "0.6.2",
- "url-loader": "1.0.1",
+ "url-loader": "1.1.1",
"vue": "2.5.17",
"vue-loader": "14.2.2",
"vue-multiselect": "2.1.0",
@@ -130,16 +130,7 @@
"bracketSpacing": true,
"semi": true,
"useTabs": true,
- "arrowParens": "always",
- "overrides": [
- {
- "files": "*.yml",
- "options": {
- "tabWidth": 2,
- "useTabs": false
- }
- }
- ]
+ "arrowParens": "always"
},
"nyc": {
"include": [
diff --git a/src/fields/abstractField.js b/src/fields/abstractField.js
index 7096e322..84a32842 100644
--- a/src/fields/abstractField.js
+++ b/src/fields/abstractField.js
@@ -1,6 +1,5 @@
-import { get as objGet, forEach, isFunction, isString, isArray, debounce, isNil } from "lodash";
+import { get as objGet, forEach, isFunction, isString, isArray, debounce, isNil, uniqueId } from "lodash";
import validators from "../utils/validators";
-import { slugifyFormID } from "../utils/schema";
const convertValidator = (validator) => {
if (isString(validator)) {
@@ -33,15 +32,20 @@ export default {
type: Object
},
formOptions: {
- type: [Object, Function],
- default: () => {
- return {};
- }
+ type: Object
+ },
+ eventBus: {
+ type: Object
+ },
+ fieldID: {
+ type: String
}
},
data() {
+ const fieldUID = uniqueId(this.fieldID + "_");
return {
+ fieldUID,
errors: [],
debouncedValidateFunc: null,
debouncedFormatFunction: null
@@ -107,23 +111,32 @@ export default {
}
},
+ watch: {
+ errors: {
+ handler(errors) {
+ this.$emit("errors-updated", errors);
+ }
+ }
+ },
+
methods: {
getValueFromOption(field, option, defaultValue) {
- if (typeof this.$parent.getValueFromOption === "function") {
+ if (isFunction(this.$parent.getValueFromOption)) {
return this.$parent.getValueFromOption(field, option, defaultValue);
} else {
// Environnement de test ?
- if (isNil(field[option])) return defaultValue;
+ if (isNil(field[option])) {
+ return defaultValue;
+ }
return field[option];
}
},
- validate(calledParent) {
+ validate() {
this.clearValidationErrors();
let validateAsync = objGet(this.formOptions, "validateAsync", false);
let results = [];
- // console.log("validate", this.schema.readonly);
if (
this.schema.validator &&
@@ -135,12 +148,12 @@ export default {
if (!isArray(this.schema.validator)) {
validators.push(convertValidator(this.schema.validator).bind(this));
} else {
- forEach(this.schema.validator, (validator) => {
+ this.schema.validator.forEach((validator) => {
validators.push(convertValidator(validator).bind(this));
});
}
- forEach(validators, (validator) => {
+ validators.forEach((validator) => {
if (validateAsync) {
results.push(validator(this.value, this.schema, this.model));
} else {
@@ -150,8 +163,6 @@ export default {
if (err) {
this.errors = this.errors.concat(err);
}
- let isValid = this.errors.length === 0;
- this.$emit("validated", isValid, this.errors, this);
});
} else if (result) {
results = results.concat(result);
@@ -162,7 +173,7 @@ export default {
let handleErrors = (errors) => {
let fieldErrors = [];
- forEach(errors, (err) => {
+ errors.forEach((err) => {
if (isArray(err) && err.length > 0) {
fieldErrors = fieldErrors.concat(err);
} else if (isString(err)) {
@@ -174,10 +185,10 @@ export default {
}
let isValid = fieldErrors.length === 0;
- if (!calledParent) {
- this.$emit("validated", isValid, fieldErrors, this);
- }
+
this.errors = fieldErrors;
+
+ this.eventBus.$emit("field-validated", isValid, fieldErrors, this.fieldUID);
return fieldErrors;
};
@@ -192,7 +203,7 @@ export default {
if (!isFunction(this.debouncedValidateFunc)) {
this.debouncedValidateFunc = debounce(
this.validate.bind(this),
- objGet(this, "$parent.options.validateDebounceTime", 500)
+ objGet(this.formOptions, "validateDebounceTime", 500)
);
}
this.debouncedValidateFunc();
@@ -209,14 +220,13 @@ export default {
}
if (changed) {
- this.$emit("model-updated", newValue, this.schema.model);
+ this.eventBus.$emit("model-updated", newValue, this.schema.model);
if (isFunction(this.schema.onChanged)) {
this.schema.onChanged.call(this, this.model, newValue, oldValue, this.schema);
}
-
- if (objGet(this.$parent, "options.validateAfterChanged", false) === true) {
- if (objGet(this.$parent, "options.validateDebounceTime", 0) > 0) {
+ if (objGet(this.formOptions, "validateAfterChanged", false)) {
+ if (objGet(this.formOptions, "validateDebounceTime", 500) > 0) {
this.debouncedValidate();
} else {
this.validate();
@@ -261,11 +271,6 @@ export default {
}
},
- getFieldID(schema) {
- const idPrefix = objGet(this.formOptions, "fieldIdPrefix", "");
- return slugifyFormID(schema, idPrefix);
- },
-
formatValueToField(value) {
return value;
},
@@ -274,6 +279,11 @@ export default {
return value;
}
},
+ created() {
+ this.eventBus.$on("clear-validation-errors", this.clearValidationErrors);
+ this.eventBus.$on("validate-fields", this.validate);
+ this.eventBus.$emit("field-registering");
+ },
mounted() {
const diff = function(a, b) {
return b.filter(function(i) {
@@ -321,5 +331,10 @@ export default {
console.log("diff", result, this.schema.type, this.schema.model);
}
}
+ },
+ beforeDestroy() {
+ this.eventBus.$off("clear-validation-errors");
+ this.eventBus.$off("validate-fields");
+ this.eventBus.$emit("field-deregistering", this);
}
};
diff --git a/src/fields/core/fieldCheckbox.vue b/src/fields/core/fieldCheckbox.vue
index e53dcf20..6f7eef4c 100644
--- a/src/fields/core/fieldCheckbox.vue
+++ b/src/fields/core/fieldCheckbox.vue
@@ -1,5 +1,5 @@
- input(:id="getFieldID(schema)", type="checkbox", v-model="value", :autocomplete="fieldOptions.autocomplete", :disabled="disabled", :name="inputName", :class="fieldClasses", v-attributes="'input'")
+ input(:id="fieldID", type="checkbox", v-model="value", :autocomplete="fieldOptions.autocomplete", :disabled="disabled", :name="inputName", :class="fieldClasses", v-attributes="'input'")
+
diff --git a/src/formGenerator.vue b/src/formGenerator.vue
index a62e7e49..fe84f12a 100644
--- a/src/formGenerator.vue
+++ b/src/formGenerator.vue
@@ -1,29 +1,27 @@
-
-div.vue-form-generator(v-if='schema != null')
- fieldset(v-if="schema.fields", :is='tag')
- template(v-for='field in fields')
- form-group(v-if='fieldVisible(field)', :field="field", :errors="errors", :model="model", :options="options", @validated="onFieldValidated")
-
- template(v-for='group in groups')
- fieldset(:is='tag', :class='getFieldRowClasses(group)')
- legend(v-if='group.legend') {{ group.legend }}
- template(v-for='field in group.fields')
- form-group(v-if='fieldVisible(field)', :field="field", :errors="errors", :model="model", :options="options", @validated="onFieldValidated", @model-updated="onModelUpdated")
+
+
diff --git a/src/formGroup.vue b/src/formGroup.vue
index f38ad812..d3fb5a88 100644
--- a/src/formGroup.vue
+++ b/src/formGroup.vue
@@ -1,171 +1,99 @@
-
+
-
+};
+
diff --git a/src/formMixin.js b/src/formMixin.js
index 2a4aa700..68eb1c72 100644
--- a/src/formMixin.js
+++ b/src/formMixin.js
@@ -1,42 +1,18 @@
-import { get as objGet, forEach, isNil, isArray, isString, isFunction } from "lodash";
+import { isArray, isString } from "lodash";
export default {
methods: {
- // Get style classes of field
- getFieldRowClasses(field) {
- const hasErrors = this.fieldErrors(field).length > 0;
- let baseClasses = {
- [objGet(this.options, "validationErrorClass", "error")]: hasErrors,
- [objGet(this.options, "validationSuccessClass", "valid")]: !hasErrors,
- disabled: this.getValueFromOption(field, "disabled"),
- readonly: this.getValueFromOption(field, "readonly"),
- featured: this.getValueFromOption(field, "featured"),
- required: this.getValueFromOption(field, "required")
- };
+ getStyleClasses(field, baseClasses) {
let styleClasses = field.styleClasses;
if (isArray(styleClasses)) {
- forEach(styleClasses, (c) => (baseClasses[c] = true));
+ styleClasses.forEach((c) => {
+ baseClasses[c] = true;
+ });
} else if (isString(styleClasses)) {
baseClasses[styleClasses] = true;
}
-
- if (!isNil(field.type)) {
- baseClasses["field-" + field.type] = true;
- }
-
return baseClasses;
- },
- fieldErrors(field) {
- let res = this.errors.filter((e) => e.field === field);
- return res.map((item) => item.error);
- },
- getValueFromOption(field, option, defaultValue = false) {
- if (isFunction(field[option])) return field[option].call(this, this.model, field, this);
-
- if (isNil(field[option])) return defaultValue;
-
- return field[option];
}
}
};
diff --git a/src/utils/fieldsLoader.js b/src/utils/fieldsLoader.js
index 7eddec09..fceef432 100644
--- a/src/utils/fieldsLoader.js
+++ b/src/utils/fieldsLoader.js
@@ -1,20 +1,20 @@
-const forEach = require("lodash").forEach;
-
let fieldComponents = {};
let coreFields = require.context("../fields/core", false, /^\.\/field([\w-_]+)\.vue$/);
-forEach(coreFields.keys(), (key) => {
- let compName = key.replace(/^\.\//, "").replace(/\.vue/, "");
- fieldComponents[compName] = coreFields(key).default;
+const getCompName = (key) => {
+ return key.replace(/^\.\//, "").replace(/\.vue/, "");
+};
+
+coreFields.keys().forEach((key) => {
+ fieldComponents[getCompName(key)] = coreFields(key).default;
});
if (process.env.FULL_BUNDLE) {
let optionalFields = require.context("../fields/optional", false, /^\.\/field([\w-_]+)\.vue$/);
- forEach(optionalFields.keys(), (key) => {
- let compName = key.replace(/^\.\//, "").replace(/\.vue/, "");
- fieldComponents[compName] = optionalFields(key).default;
+ optionalFields.keys().forEach((key) => {
+ fieldComponents[getCompName(key)] = optionalFields(key).default;
});
}
diff --git a/src/utils/schema.js b/src/utils/schema.js
index f664a7bb..c508e89c 100644
--- a/src/utils/schema.js
+++ b/src/utils/schema.js
@@ -1,4 +1,4 @@
-import { get, set, each, isObject, isArray, isFunction, cloneDeep } from "lodash";
+import { get, set, each, isObject, isArray, isFunction, isNil, cloneDeep } from "lodash";
// Create a new model by schema default values
const createDefaultObject = (schema, obj = {}) => {
@@ -54,7 +54,7 @@ const mergeMultiObjectFields = (schema, objs) => {
const slugifyFormID = (schema, prefix = "") => {
// Try to get a reasonable default id from the schema,
// then slugify it.
- if (typeof schema.id !== "undefined") {
+ if (!isNil(schema.id)) {
// If an ID's been explicitly set, use it unchanged
return prefix + schema.id;
} else {
diff --git a/test/unit/setup.js b/test/unit/setup.js
index 0f3bb30d..ece10096 100644
--- a/test/unit/setup.js
+++ b/test/unit/setup.js
@@ -25,9 +25,13 @@ global.checkAttribute = (name, wrapper, schema, type = "input") => {
const { isNil, isFunction } = require("lodash");
global.getValueFromOption = (field, option, defaultValue = false) => {
- if (isFunction(field[option])) return field[option].call(this, this.model, field, this);
+ if (isFunction(field[option])) {
+ return field[option].call(this, this.model, field, this);
+ }
- if (isNil(field[option])) return defaultValue;
+ if (isNil(field[option])) {
+ return defaultValue;
+ }
return field[option];
};
diff --git a/test/unit/specs/VueFormGenerator.spec.js b/test/unit/specs/VueFormGenerator.spec.js
index aaccdca6..2c726e11 100644
--- a/test/unit/specs/VueFormGenerator.spec.js
+++ b/test/unit/specs/VueFormGenerator.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import VueFormGenerator from "src/index";
const localVue = createLocalVue();
@@ -70,7 +71,7 @@ describe("VueFormGenerator.vue", () => {
});
});
- describe("check form-group classes", () => {
+ describe("check form-element classes", () => {
let group;
let schema = {
fields: [
@@ -108,13 +109,12 @@ describe("VueFormGenerator.vue", () => {
]
};
createFormGenerator({ schema });
-
- group = wrapper.find(".form-group");
+ group = wrapper.find(".form-element");
});
it("should be minimal classes", () => {
expect(group.classes().length).to.be.equal(2);
- expect(group.classes()).to.include("form-group");
+ expect(group.classes()).to.include("form-element");
expect(group.classes()).to.include("field-input");
});
@@ -143,29 +143,33 @@ describe("VueFormGenerator.vue", () => {
});
it("should be error class", () => {
- wrapper.vm.$refs.form.errors.push({ field: wrapper.vm.schema.fields[0], error: "Validation error!" });
-
+ const formElement = wrapper.find({ name: "form-element" });
+ formElement.vm.onChildValidated(["Validation error!"]);
expect(group.classes()).to.include("error");
});
describe("custom validation classes", () => {
beforeEach(() => {
- let options = {
- validationErrorClass: "has-error",
- validationSuccessClass: "has-success"
- };
- createFormGenerator({ schema, options: options });
- group = wrapper.find(".form-group");
+ let options = { validationErrorClass: "has-error", validationSuccessClass: "has-success" };
+ createFormGenerator({
+ schema,
+ options: options
+ });
+ group = wrapper.find(".form-element");
});
it("error class", () => {
- wrapper.vm.$refs.form.errors.push({ field: wrapper.vm.schema.fields[0], error: "Validation error!" });
+ const formElement = wrapper.find({ name: "form-element" });
+ formElement.vm.onChildValidated(["Validation error!"]);
expect(group.classes()).to.include("has-error");
});
it("success class", () => {
- wrapper.vm.$refs.form.errors = [];
+ const formElement = wrapper.find({
+ name: "form-element"
+ });
+ formElement.vm.onChildValidated([]);
expect(group.classes()).to.include("has-success");
});
@@ -230,7 +234,7 @@ describe("VueFormGenerator.vue", () => {
before(() => {
createFormGenerator({ schema });
- group = wrapper.find(".form-group");
+ group = wrapper.find(".form-element");
label = group.find("label");
});
@@ -252,7 +256,7 @@ describe("VueFormGenerator.vue", () => {
});
describe("check form row field cell", () => {
- let group; //, label;
+ let formElement; //, label;
let schema = {
fields: [
{
@@ -271,23 +275,22 @@ describe("VueFormGenerator.vue", () => {
before(() => {
createFormGenerator({ schema });
- group = wrapper.find(".form-group");
+ formElement = wrapper.find({ name: "form-element" });
});
it("should be a .field-wrap div", () => {
- expect(group.find(".field-wrap").exists()).to.be.true;
+ expect(formElement.find(".field-wrap").exists()).to.be.true;
});
it("should be a hint div if hint is not null", () => {
- let hint = group.find(".hint");
+ let hint = formElement.find(".hint");
expect(hint.exists()).to.be.true;
expect(hint.text()).to.be.equal("Hint text");
});
it("should be .errors div if there are errors in fields", () => {
- wrapper.vm.$refs.form.errors.push({ field: wrapper.vm.schema.fields[0], error: "Some error!" });
- wrapper.vm.$refs.form.errors.push({ field: wrapper.vm.schema.fields[0], error: "Another error!" });
- let div = group.find(".errors");
+ formElement.vm.onChildValidated(["Some error!", "Another error!"]);
+ let div = formElement.find(".errors");
expect(div.exists()).to.be.true;
@@ -297,50 +300,6 @@ describe("VueFormGenerator.vue", () => {
expect(errors.at(1).text()).to.be.equal("Another error!");
});
});
- // TODO: to delete
- describe.skip("check computed fields if multiple is true", () => {
- let schema = {
- fields: [
- {
- type: "input",
- model: "name",
- label: "name",
- fieldOptions: {
- inputType: "text"
- },
- multi: false
- },
- {
- type: "input",
- model: "phone",
- label: "phone",
- fieldOptions: {
- inputType: "text"
- },
- multi: true
- },
- {
- type: "input",
- model: "email",
- label: "email",
- fieldOptions: {
- inputType: "text"
- }
- }
- ]
- };
- let form;
-
- before(() => {
- createFormGenerator({ schema, multiple: true });
- form = wrapper.vm.$refs.form;
- });
-
- it("should render only phone field", () => {
- expect(form.fields.length).to.be.equal(1);
- expect(wrapper.find(".form-group label").text()).to.be.equal("phone");
- });
- });
describe("check fieldDisabled with function", () => {
let schema = {
@@ -382,17 +341,16 @@ describe("VueFormGenerator.vue", () => {
});
});
- describe("check fieldDisabled function parameters", () => {
+ describe.skip("check fieldDisabled function parameters", () => {
+ let fieldDisabled = sinon.spy();
let schema = {
fields: [
{
type: "input",
- fieldOptions: {
- inputType: "text"
- },
+ fieldOptions: { inputType: "text" },
label: "Name",
model: "name",
- disabled: sinon.spy()
+ disabled: fieldDisabled
}
]
};
@@ -407,9 +365,9 @@ describe("VueFormGenerator.vue", () => {
});
it("should be called with correct params", () => {
- let spy = wrapper.vm.schema.fields[0].disabled;
- expect(spy.called).to.be.true;
- expect(spy.calledWith(model, wrapper.vm.schema.fields[0], wrapper.vm.$children[0].$children[0])).to.be.true;
+ expect(fieldDisabled.called).to.be.true;
+ expect(fieldDisabled.calledWith(model, wrapper.vm.schema.fields[0], wrapper.vm.$children[0].$children[0]))
+ .to.be.true;
});
});
@@ -474,7 +432,7 @@ describe("VueFormGenerator.vue", () => {
before(() => {
createFormGenerator({ schema, model });
- group = wrapper.find(".form-group");
+ group = wrapper.find(".form-element");
});
it("should be readonly", () => {
@@ -517,13 +475,13 @@ describe("VueFormGenerator.vue", () => {
});
it("should be applay", () => {
- expect(wrapper.find(".form-group .hint").text()).to.be.equal("8 of max 500 characters used!");
+ expect(wrapper.find(".form-element .hint").text()).to.be.equal("8 of max 500 characters used!");
});
it("should be changed", () => {
model.note = "Dr. John Doe";
- expect(wrapper.find(".form-group .hint").text()).to.be.equal("12 of max 500 characters used!");
+ expect(wrapper.find(".form-element .hint").text()).to.be.equal("12 of max 500 characters used!");
});
});
@@ -553,7 +511,7 @@ describe("VueFormGenerator.vue", () => {
before(() => {
createFormGenerator({ schema, model });
- group = wrapper.find(".form-group");
+ group = wrapper.find(".form-element");
});
it("should be featured", () => {
@@ -593,7 +551,7 @@ describe("VueFormGenerator.vue", () => {
before(() => {
createFormGenerator({ schema, model });
- group = wrapper.find(".form-group");
+ group = wrapper.find(".form-element");
});
it("should be required", () => {
@@ -704,23 +662,39 @@ describe("VueFormGenerator.vue", () => {
form = wrapper.vm.$refs.form;
});
- it("should empty the errors", () => {
- expect(form.validate()).to.be.true;
- expect(form.errors).to.be.length(0);
+ it("should empty the errors", (done) => {
+ form.validate().then(
+ () => {
+ expect(form.errors).to.be.length(0);
+ done();
+ },
+ () => {}
+ );
});
- it("should give a validation error", () => {
+ it("should give a validation error", (done) => {
model.name = "Ab";
wrapper.setData({ model: { ...model } });
-
- expect(form.validate()).to.be.false;
- expect(form.errors).to.be.length(1);
+ form.validate().then(
+ () => {},
+ (errors) => {
+ expect(errors[0].error).to.be.equal("The length of text is too small! Current: 2, Minimum: 3");
+ expect(form.errors).to.be.length(1);
+ done();
+ }
+ );
});
- it("should no validation error", () => {
- wrapper.vm.model.name = "Abc";
- expect(form.validate()).to.be.true;
- expect(form.errors).to.be.length(0);
+ it("should no validation error", (done) => {
+ model.name = "Abc";
+ wrapper.setData({ model: { ...model } });
+ form.validate().then(
+ () => {
+ expect(form.errors).to.be.length(0);
+ done();
+ },
+ () => {}
+ );
});
});
@@ -748,21 +722,39 @@ describe("VueFormGenerator.vue", () => {
form = wrapper.vm.$refs.form;
});
- it("should empty the errors", () => {
- expect(form.validate()).to.be.true;
- expect(form.errors).to.be.length(0);
+ it("should empty the errors", (done) => {
+ form.validate().then(
+ () => {
+ expect(form.errors).to.be.length(0);
+ done();
+ },
+ () => {}
+ );
});
- it("should give a validation error", () => {
- wrapper.vm.model.name = "Ab";
- expect(form.validate()).to.be.false;
- expect(form.errors).to.be.length(1);
+ it("should give a validation error", (done) => {
+ model.name = "Ab";
+ wrapper.setData({ model: { ...model } });
+ form.validate().then(
+ () => {},
+ (errors) => {
+ expect(errors[0].error).to.be.equal("The length of text is too small! Current: 2, Minimum: 3");
+ expect(form.errors).to.be.length(1);
+ done();
+ }
+ );
});
- it("should no validation error", () => {
- wrapper.vm.model.name = "Abc";
- expect(form.validate()).to.be.true;
- expect(form.errors).to.be.length(0);
+ it("should no validation error", (done) => {
+ model.name = "Abc";
+ wrapper.setData({ model: { ...model } });
+ form.validate().then(
+ () => {
+ expect(form.errors).to.be.length(0);
+ done();
+ },
+ () => {}
+ );
});
});
@@ -863,47 +855,46 @@ describe("VueFormGenerator.vue", () => {
};
let model = { name: "Bob" };
+ let formGenerator;
let form;
- let onValidated = sinon.spy();
beforeEach(() => {
- createFormGenerator(
- { schema, model },
- { onValidated: onValidated },
- ``
- );
- form = wrapper.vm.$refs.form;
+ createFormGenerator({ schema, model });
+ formGenerator = wrapper.find({ name: "formGenerator" });
+ form = formGenerator.vm;
});
it("should no errors after mounted()", () => {
expect(form.errors).to.be.length(0);
});
- it.skip("should be validation error if model value is not valid", () => {
- wrapper.vm.model.name = "A";
- onValidated.resetHistory();
+ it("should be validation error if model value is not valid", () => {
+ formGenerator.setProps({ model: { name: "A" } });
form.validate();
expect(form.errors).to.be.length(1);
- expect(onValidated.callCount).to.be.equal(1);
- expect(
- onValidated.calledWith(false, [
- {
- field: schema.fields[0],
- error: "The length of text is too small! Current: 1, Minimum: 3"
- }
- ])
- ).to.be.true;
+ expect(formGenerator.emitted().validated).to.be.an.instanceof(Array);
+ expect(formGenerator.emitted().validated.length).to.be.equal(1);
+ expect(formGenerator.emitted().validated[0][0]).to.be.false;
+ expect(formGenerator.emitted().validated[0][1]).to.be.an.instanceof(Array);
+ expect(formGenerator.emitted().validated[0][1].length).to.be.equal(1);
+ expect(formGenerator.emitted().validated[0][1][0].uid).to.be.a("string");
+ expect(formGenerator.emitted().validated[0][1][0].error).to.be.a("string");
+ expect(formGenerator.emitted().validated[0][1][0].error).to.be.equal(
+ "The length of text is too small! Current: 1, Minimum: 3"
+ );
});
it("should no validation error if model valie is valid", () => {
- wrapper.vm.model.name = "Alan";
- onValidated.resetHistory();
+ formGenerator.setProps({ model: { name: "Alan" } });
form.validate();
expect(form.errors).to.be.length(0);
- expect(onValidated.callCount).to.be.equal(1);
- expect(onValidated.calledWith(true, [])).to.be.true;
+ expect(formGenerator.emitted().validated).to.be.an.instanceof(Array);
+ expect(formGenerator.emitted().validated.length).to.be.equal(1);
+ expect(formGenerator.emitted().validated[0][0]).to.be.true;
+ expect(formGenerator.emitted().validated[0][1]).to.be.an.instanceof(Array);
+ expect(formGenerator.emitted().validated[0][1].length).to.be.equal(0);
});
});
@@ -965,6 +956,7 @@ describe("VueFormGenerator.vue", () => {
};
let model = { name: "Bob" };
+ let formGenerator;
let form;
let field;
let onValidated = sinon.spy();
@@ -975,13 +967,14 @@ describe("VueFormGenerator.vue", () => {
{ onValidated: onValidated },
``
);
- form = wrapper.vm.$refs.form;
+ formGenerator = wrapper.find({ name: "formGenerator" });
+ form = formGenerator.vm;
field = form.$children[0];
});
it("should no errors after mounted()", (done) => {
+ expect(form.errors).to.be.length(0);
wrapper.vm.$nextTick(() => {
- expect(form.errors).to.be.length(0);
done();
});
});
@@ -1047,6 +1040,7 @@ describe("VueFormGenerator.vue", () => {
};
let model = { name: "Bob" };
+ let formGenerator;
let form;
let field;
let onValidated = sinon.spy();
@@ -1057,8 +1051,9 @@ describe("VueFormGenerator.vue", () => {
{ onValidated: onValidated },
``
);
- form = wrapper.vm.$refs.form;
- field = form.$children[0].$children[0];
+ formGenerator = wrapper.find({ name: "formGenerator" });
+ form = formGenerator.vm;
+ field = formGenerator.find({ name: "form-element" }).vm.$children[0];
});
it("should no errors after mounted()", (done) => {
@@ -1068,17 +1063,30 @@ describe("VueFormGenerator.vue", () => {
});
});
- it("should be validation error if model value is not valid", (done) => {
+ it.skip("should be validation error if model value is not valid", (done) => {
onValidated.resetHistory();
wrapper.vm.model.name = "A";
+ // console.log(formGenerator.find({ name: "form-element" }).vm.$children[0].validate);
field.validate();
+ Vue.config.errorHandler = done;
+ Vue.nextTick(() => {
+ console.log(form.errors);
+ console.log(formGenerator.emitted().validated);
- setTimeout(() => {
expect(form.errors).to.be.length(1);
+ expect(formGenerator.emitted().validated).to.be.an.instanceof(Array);
+ expect(formGenerator.emitted().validated.length).to.be.equal(1);
+ expect(formGenerator.emitted().validated[0][0]).to.be.false;
+ expect(formGenerator.emitted().validated[0][1]).to.be.an.instanceof(Array);
+ expect(formGenerator.emitted().validated[0][1].length).to.be.equal(1);
+ expect(formGenerator.emitted().validated[0][1][0].uid).to.be.a("string");
+ expect(formGenerator.emitted().validated[0][1][0].error).to.be.a("string");
+ expect(formGenerator.emitted().validated[0][1][0].error).to.be.equal(
+ "The length of text is too small! Current: 1, Minimum: 3"
+ );
expect(onValidated.calledWith(false, [{ field: schema.fields[0], error: "Invalid name" }])).to.be.true;
-
done();
- }, 15);
+ });
});
});
});
diff --git a/test/unit/specs/fields/abstractField.spec.js b/test/unit/specs/fields/abstractField.spec.js
index 76993e5d..276e1db9 100644
--- a/test/unit/specs/fields/abstractField.spec.js
+++ b/test/unit/specs/fields/abstractField.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import AbstractField from "src/fields/abstractField";
const localVue = createLocalVue();
@@ -14,8 +15,11 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data,
- template: ``
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ },
+ template: ``
});
if (methods) {
_wrapper.setMethods(methods);
@@ -197,26 +201,36 @@ describe("abstractField.vue", () => {
};
let model = { name: "John Doe" };
- let options = {
- validateAfterChanged: false
- };
+ let formOptions = { validateAfterChanged: false };
beforeEach(() => {
- createField({ schema, model, options });
+ createField({ schema, model, formOptions });
+
field.validate = sinon.spy();
});
it("should not call validate function after value changed", () => {
- model.name = "Jane Doe";
+ wrapper.setProps({ model: { name: "Jane Doe" } });
expect(field.validate.callCount).to.be.equal(0);
});
- it.skip("should call validate function after value changed", () => {
- options.validateAfterChanged = true;
- field.value = "Jane Roe";
+ it.skip("should call validate function after value changed", (done) => {
+ // options.validateAfterChanged = true;
- expect(field.validate.callCount).to.be.equal(1);
+ wrapper.setProps({ formOptions: { validateAfterChanged: true } });
+ console.log("---", field.value);
+ // console.log("---", wrapper);
+ const textInput = wrapper.find(`input[type="text"]`);
+ textInput.setValue("Jane Roe");
+ // field.value.set("Jane Roe");
+ console.log("---", field.value);
+ // wrapper.setData({ value: "Jane Roe" });
+ Vue.config.errorHandler = done;
+ Vue.nextTick(() => {
+ expect(field.validate.callCount).to.be.equal(1);
+ done();
+ });
});
});
@@ -346,29 +360,30 @@ describe("abstractField.vue", () => {
});
describe("check schema onValidated event", () => {
- let schema = {
- type: "text",
- label: "Name",
- model: "name",
- fieldOptions: {
- min: 3
- },
- validator: ["string"]
- };
+ let schema = { type: "text", label: "Name", model: "name", fieldOptions: { min: 3 }, validator: ["string"] };
let model = { name: "John Doe" };
beforeEach(() => {
- createField({ schema, model });
+ createField({
+ schema,
+ model
+ });
});
it("should return empty array", () => {
+ const spy = sinon.spy(wrapper.props().eventBus, "$emit");
+
let res = field.validate();
expect(res).to.be.an.instanceof(Array);
expect(res.length).to.be.equal(0);
- expect(wrapper.emitted().validated).to.be.an.instanceof(Array);
- expect(wrapper.emitted().validated[0][0]).to.be.true;
- expect(wrapper.emitted().validated[0][1]).to.be.an.instanceof(Array);
+ expect(spy.calledOnce).to.be.true;
+ expect(spy.args[0][0]).to.be.equal("field-validated");
+ expect(spy.args[0][1]).to.be.true;
+ expect(spy.args[0][2]).to.be.an.instanceof(Array);
+ expect(spy.args[0][2].length).to.be.equal(0);
+
+ spy.restore();
});
it("should not call 'onValidated'", () => {
@@ -381,19 +396,23 @@ describe("abstractField.vue", () => {
});
it("should return empty array", () => {
- model.name = "Al";
+ const spy = sinon.spy(wrapper.props().eventBus, "$emit");
+
+ wrapper.setProps({ model: { name: "Al" } });
+
let res = field.validate();
expect(res).to.be.an.instanceof(Array);
expect(res.length).to.be.equal(1);
expect(res[0]).to.be.equal("The length of text is too small! Current: 2, Minimum: 3");
- expect(wrapper.emitted().validated).to.be.an.instanceof(Array);
- expect(wrapper.emitted().validated[0][0]).to.be.false;
- expect(wrapper.emitted().validated[0][1]).to.be.an.instanceof(Array);
- expect(wrapper.emitted().validated[0][1][0]).to.be.equal(
- "The length of text is too small! Current: 2, Minimum: 3"
- );
+ expect(spy.calledOnce).to.be.true;
+ expect(spy.args[0][0]).to.be.equal("field-validated");
+ expect(spy.args[0][1]).to.be.false;
+ expect(spy.args[0][2]).to.be.an.instanceof(Array);
+ expect(spy.args[0][2][0]).to.be.equal("The length of text is too small! Current: 2, Minimum: 3");
+
+ spy.restore();
});
});
@@ -428,36 +447,36 @@ describe("abstractField.vue", () => {
expect(field.errors[0]).to.be.equal("Validation error!");
});
});
-
- describe("check getFieldID function", () => {
- let schema = {
- type: "text",
- label: "First Name",
- model: "user__model",
- inputName: "input_name"
- };
- let model = {};
-
- before(() => {
- createField({ schema, model });
- });
-
- it("should return slugified inputName, if available", () => {
- expect(field.getFieldID(schema)).to.be.equal("input-name");
- });
-
- it("should return slugified label, if no inputName", () => {
- delete schema.inputName;
-
- expect(field.getFieldID(schema)).to.be.equal("first-name");
- });
-
- it("should return slugified model name, if no inputName or label", () => {
- delete schema.label;
-
- expect(field.getFieldID(schema)).to.be.equal("user-model");
- });
- });
+ // TODO move into formElement.spec
+ // describe("check getFieldID function", () => {
+ // let schema = {
+ // type: "text",
+ // label: "First Name",
+ // model: "user__model",
+ // inputName: "input_name"
+ // };
+ // let model = {};
+
+ // before(() => {
+ // createField({ schema, model });
+ // });
+
+ // it("should return slugified inputName, if available", () => {
+ // expect(field.getFieldID(schema)).to.be.equal("input-name");
+ // });
+
+ // it("should return slugified label, if no inputName", () => {
+ // delete schema.inputName;
+
+ // expect(field.getFieldID(schema)).to.be.equal("first-name");
+ // });
+
+ // it("should return slugified model name, if no inputName or label", () => {
+ // delete schema.label;
+
+ // expect(field.getFieldID(schema)).to.be.equal("user-model");
+ // });
+ // });
describe("check classes application to fields", () => {
let schema = {
diff --git a/test/unit/specs/fields/fieldCheckbox.spec.js b/test/unit/specs/fields/fieldCheckbox.spec.js
index 16f6a272..4fa88af0 100644
--- a/test/unit/specs/fields/fieldCheckbox.spec.js
+++ b/test/unit/specs/fields/fieldCheckbox.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldCheckbox from "src/fields/core/fieldCheckbox.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldChecklist.spec.js b/test/unit/specs/fields/fieldChecklist.spec.js
index 8888ead9..6ac022fe 100644
--- a/test/unit/specs/fields/fieldChecklist.spec.js
+++ b/test/unit/specs/fields/fieldChecklist.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldChecklist from "src/fields/core/fieldChecklist.vue";
const localVue = createLocalVue();
@@ -17,7 +18,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldCleave.spec.js b/test/unit/specs/fields/fieldCleave.spec.js
index 5347276e..8efc0aeb 100644
--- a/test/unit/specs/fields/fieldCleave.spec.js
+++ b/test/unit/specs/fields/fieldCleave.spec.js
@@ -17,7 +17,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldDateTimePicker.spec.js b/test/unit/specs/fields/fieldDateTimePicker.spec.js
index 5bcbdd64..a65f1fab 100644
--- a/test/unit/specs/fields/fieldDateTimePicker.spec.js
+++ b/test/unit/specs/fields/fieldDateTimePicker.spec.js
@@ -22,7 +22,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldGoogleAddress.spec.js b/test/unit/specs/fields/fieldGoogleAddress.spec.js
index f68d2f0f..63bcd704 100644
--- a/test/unit/specs/fields/fieldGoogleAddress.spec.js
+++ b/test/unit/specs/fields/fieldGoogleAddress.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldGoogleAddress from "src/fields/optional/fieldGoogleAddress.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldImage.spec.js b/test/unit/specs/fields/fieldImage.spec.js
index 5b375cc2..aee6e291 100644
--- a/test/unit/specs/fields/fieldImage.spec.js
+++ b/test/unit/specs/fields/fieldImage.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldImage from "src/fields/optional/fieldImage.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldInput.spec.js b/test/unit/specs/fields/fieldInput.spec.js
index 33728fde..bbb18a89 100644
--- a/test/unit/specs/fields/fieldInput.spec.js
+++ b/test/unit/specs/fields/fieldInput.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import fieldInput from "src/fields/core/fieldInput.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldLabel.spec.js b/test/unit/specs/fields/fieldLabel.spec.js
index 722fa38b..e1c28765 100644
--- a/test/unit/specs/fields/fieldLabel.spec.js
+++ b/test/unit/specs/fields/fieldLabel.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldLabel from "src/fields/core/fieldLabel.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldMasked.spec.js b/test/unit/specs/fields/fieldMasked.spec.js
index 7151f2ae..a470d7b7 100644
--- a/test/unit/specs/fields/fieldMasked.spec.js
+++ b/test/unit/specs/fields/fieldMasked.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldMasked from "src/fields/optional/fieldMasked.vue";
let jQuery = require("jquery");
let $ = jQuery(window);
@@ -17,7 +18,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldNoUiSlider.spec.js b/test/unit/specs/fields/fieldNoUiSlider.spec.js
index ee2ecd46..1636624f 100644
--- a/test/unit/specs/fields/fieldNoUiSlider.spec.js
+++ b/test/unit/specs/fields/fieldNoUiSlider.spec.js
@@ -18,7 +18,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldPikaday.spec.js b/test/unit/specs/fields/fieldPikaday.spec.js
index e366e3d7..c78f93b8 100644
--- a/test/unit/specs/fields/fieldPikaday.spec.js
+++ b/test/unit/specs/fields/fieldPikaday.spec.js
@@ -19,7 +19,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldRadios.spec.js b/test/unit/specs/fields/fieldRadios.spec.js
index 424b1e98..2fbe0309 100644
--- a/test/unit/specs/fields/fieldRadios.spec.js
+++ b/test/unit/specs/fields/fieldRadios.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldRadios from "src/fields/core/fieldRadios.vue";
const localVue = createLocalVue();
@@ -17,7 +18,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldRangeSlider.spec.js b/test/unit/specs/fields/fieldRangeSlider.spec.js
index ee09bbed..a07f48b1 100644
--- a/test/unit/specs/fields/fieldRangeSlider.spec.js
+++ b/test/unit/specs/fields/fieldRangeSlider.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldRangeSlider from "src/fields/optional/fieldRangeSlider.vue";
let jQuery = require("jquery");
@@ -19,7 +20,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldSelect.spec.js b/test/unit/specs/fields/fieldSelect.spec.js
index 12d1a7d2..22acad63 100644
--- a/test/unit/specs/fields/fieldSelect.spec.js
+++ b/test/unit/specs/fields/fieldSelect.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldSelect from "src/fields/core/fieldSelect.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldSelectEx.spec.js b/test/unit/specs/fields/fieldSelectEx.spec.js
index 264edc92..611c1291 100644
--- a/test/unit/specs/fields/fieldSelectEx.spec.js
+++ b/test/unit/specs/fields/fieldSelectEx.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldSelectEx from "src/fields/optional/fieldSelectEx.vue";
const localVue = createLocalVue();
@@ -15,7 +16,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldSpectrum.spec.js b/test/unit/specs/fields/fieldSpectrum.spec.js
index 0a7cdf39..097cd842 100644
--- a/test/unit/specs/fields/fieldSpectrum.spec.js
+++ b/test/unit/specs/fields/fieldSpectrum.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldSpectrum from "src/fields/optional/fieldSpectrum.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldStaticMap.spec.js b/test/unit/specs/fields/fieldStaticMap.spec.js
index cb98876e..39289402 100644
--- a/test/unit/specs/fields/fieldStaticMap.spec.js
+++ b/test/unit/specs/fields/fieldStaticMap.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldStaticMap from "src/fields/optional/fieldStaticMap.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldSubmit.spec.js b/test/unit/specs/fields/fieldSubmit.spec.js
index e9e7f2d2..8e53a95c 100644
--- a/test/unit/specs/fields/fieldSubmit.spec.js
+++ b/test/unit/specs/fields/fieldSubmit.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldSubmit from "src/fields/core/fieldSubmit.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
@@ -55,44 +59,56 @@ describe("fieldSubmit.vue", () => {
it("should not call validate if validateBeforeSubmit is false", () => {
schema.fieldOptions.onSubmit = sinon.spy();
wrapper.setProps({ schema: { ...schema } });
- let cb = sinon.spy();
- wrapper.vm.$parent.validate = cb;
input.trigger("click");
- expect(cb.called).to.be.false;
expect(schema.fieldOptions.onSubmit.calledOnce).to.be.true;
expect(schema.fieldOptions.onSubmit.calledWith(model, schema)).to.be.true;
});
it("should call validate if validateBeforeSubmit is true", () => {
+ const spyEmit = sinon.spy(wrapper.props().eventBus, "$emit");
schema.fieldOptions.validateBeforeSubmit = true;
schema.fieldOptions.onSubmit = sinon.spy();
wrapper.setProps({ schema: { ...schema } });
- let cb = sinon.spy();
- wrapper.vm.$parent.validate = cb;
input.trigger("click");
- expect(cb.called).to.be.true;
+ expect(spyEmit.calledOnce).to.be.true;
+ expect(spyEmit.args[0][0]).to.be.equal("fields-validation-trigger");
+
+ spyEmit.restore();
+
+ // Simulate feedback from formGenerator
+ wrapper.props().eventBus.$emit("fields-validation-terminated", []);
+
expect(schema.fieldOptions.onSubmit.called).to.be.true;
+ expect(schema.fieldOptions.onSubmit.calledWith(model, schema)).to.be.true;
});
});
describe("invalid form", () => {
- it("should not call onSubmit if validateBeforeSubmit is true", () => {
+ it("should not call onSubmit if validateBeforeSubmit is true and onValidationError is defined", () => {
+ const spyEmit = sinon.spy(wrapper.props().eventBus, "$emit");
+ const formErrors = [{ uid: "123", error: ["an error occurred"] }];
schema.fieldOptions.validateBeforeSubmit = true;
+ schema.fieldOptions.onValidationError = sinon.spy();
schema.fieldOptions.onSubmit = sinon.spy();
wrapper.setProps({ schema: { ...schema } });
- let cb = sinon.spy(() => {
- return ["an error occurred"];
- });
- wrapper.vm.$parent.validate = cb;
input.trigger("click");
- expect(cb.called).to.be.true;
- expect(schema.fieldOptions.onSubmit.called).to.be.true;
+ expect(spyEmit.calledOnce).to.be.true;
+ expect(spyEmit.args[0][0]).to.be.equal("fields-validation-trigger");
+
+ spyEmit.restore();
+
+ // Simulate feedback from formGenerator
+ wrapper.props().eventBus.$emit("fields-validation-terminated", formErrors);
+
+ expect(schema.fieldOptions.onValidationError.called).to.be.true;
+ expect(schema.fieldOptions.onValidationError.calledWith(model, schema, formErrors)).to.be.true;
+ expect(schema.fieldOptions.onSubmit.called).to.be.false;
});
});
diff --git a/test/unit/specs/fields/fieldSwitch.spec.js b/test/unit/specs/fields/fieldSwitch.spec.js
index 7c75bfab..6711ad7d 100644
--- a/test/unit/specs/fields/fieldSwitch.spec.js
+++ b/test/unit/specs/fields/fieldSwitch.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldSwitch from "src/fields/optional/fieldSwitch.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldTextArea.spec.js b/test/unit/specs/fields/fieldTextArea.spec.js
index 6d7d0031..69d8533c 100644
--- a/test/unit/specs/fields/fieldTextArea.spec.js
+++ b/test/unit/specs/fields/fieldTextArea.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import FieldTextArea from "src/fields/core/fieldTextArea.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldUpload.spec.js b/test/unit/specs/fields/fieldUpload.spec.js
index 07ea8287..69bd8d08 100644
--- a/test/unit/specs/fields/fieldUpload.spec.js
+++ b/test/unit/specs/fields/fieldUpload.spec.js
@@ -1,5 +1,6 @@
import { mount, createLocalVue } from "@vue/test-utils";
+import Vue from "vue";
import fieldUpload from "src/fields/core/fieldUpload.vue";
const localVue = createLocalVue();
@@ -14,7 +15,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ }
});
if (methods) {
_wrapper.setMethods(methods);
diff --git a/test/unit/specs/fields/fieldVueMultiSelect.spec.js b/test/unit/specs/fields/fieldVueMultiSelect.spec.js
index 19cd789f..90eca9e9 100644
--- a/test/unit/specs/fields/fieldVueMultiSelect.spec.js
+++ b/test/unit/specs/fields/fieldVueMultiSelect.spec.js
@@ -17,7 +17,10 @@ function createField(data, methods) {
getValueFromOption: global.getValueFromOption
}
},
- propsData: data,
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ },
components: {
multiselect: VueMultiSelect
}
diff --git a/test/unit/specs/formElement.spec.js b/test/unit/specs/formElement.spec.js
new file mode 100644
index 00000000..af72782b
--- /dev/null
+++ b/test/unit/specs/formElement.spec.js
@@ -0,0 +1,185 @@
+import { mount, createLocalVue } from "@vue/test-utils";
+
+import Vue from "vue";
+import formElement from "src/formElement.vue";
+
+const localVue = createLocalVue();
+let wrapper;
+
+function createFormElement(data, methods) {
+ const _wrapper = mount(formElement, {
+ localVue,
+ propsData: {
+ eventBus: new Vue(),
+ ...data
+ },
+ methods: methods
+ });
+
+ wrapper = _wrapper;
+
+ return _wrapper;
+}
+describe("formElement.vue", () => {
+ describe("check fieldTypeHasLabel function", () => {
+ let form;
+ before(() => {
+ createFormElement({ field: {} }, {});
+ form = wrapper.vm;
+ });
+
+ it("should return true", () => {
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "checkbox"
+ },
+ label: "checkbox"
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.true;
+
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "text"
+ },
+ label: "text"
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.true;
+
+ wrapper.setProps({ field: { type: "checklist", label: "checklist" } });
+ expect(form.fieldTypeHasLabel).to.be.true;
+
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "image"
+ },
+ label: "image"
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.true;
+ });
+
+ it("should return false", () => {
+ // with label text defined
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "button"
+ },
+ label: "button"
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.false;
+
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "submit"
+ },
+ label: "submit"
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.false;
+
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "reset"
+ },
+ label: "reset"
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.false;
+
+ // without label text defined
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "checkbox"
+ }
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.false;
+
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "text"
+ }
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.false;
+
+ wrapper.setProps({ field: { type: "checklist" } });
+ expect(form.fieldTypeHasLabel).to.be.false;
+
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "image"
+ }
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.false;
+
+ wrapper.setProps({ field: { type: "input", fieldOptions: { inputType: "button" } } });
+ expect(form.fieldTypeHasLabel).to.be.false;
+
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "submit"
+ }
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.false;
+
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "reset"
+ }
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.false;
+ });
+
+ it("should default to true for unknown types", () => {
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "unsupported-or-unknown"
+ },
+ label: "unsupported"
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.true;
+
+ wrapper.setProps({
+ field: {
+ type: "input",
+ fieldOptions: {
+ inputType: "unsupported-or-unknown"
+ }
+ }
+ });
+ expect(form.fieldTypeHasLabel).to.be.false;
+ });
+ });
+});
diff --git a/test/unit/specs/formGroup.spec.js b/test/unit/specs/formGroup.spec.js
deleted file mode 100644
index 177b11d3..00000000
--- a/test/unit/specs/formGroup.spec.js
+++ /dev/null
@@ -1,165 +0,0 @@
-import { mount, createLocalVue } from "@vue/test-utils";
-
-import formGroup from "src/formGroup.vue";
-
-const localVue = createLocalVue();
-let wrapper;
-
-function createFormGroup(data, methods) {
- const _wrapper = mount(formGroup, {
- localVue,
- propsData: data,
- methods: methods
- });
-
- wrapper = _wrapper;
-
- return _wrapper;
-}
-describe("formGroup.vue", () => {
- describe("check fieldTypeHasLabel function", () => {
- let form;
- before(() => {
- createFormGroup({ field: {} }, {});
- form = wrapper.vm;
- });
-
- it("should return true", () => {
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "checkbox"
- },
- label: "checkbox"
- })
- ).to.be.true;
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "text"
- },
- label: "text"
- })
- ).to.be.true;
- expect(
- form.fieldTypeHasLabel({
- type: "checklist",
- label: "checklist"
- })
- ).to.be.true;
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "image"
- },
- label: "image"
- })
- ).to.be.true;
- });
-
- it("should return false", () => {
- // with label text defined
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "button"
- },
- label: "button"
- })
- ).to.be.false;
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "submit"
- },
- label: "submit"
- })
- ).to.be.false;
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "reset"
- },
- label: "reset"
- })
- ).to.be.false;
-
- // without label text defined
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "checkbox"
- }
- })
- ).to.be.false;
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "text"
- }
- })
- ).to.be.false;
- expect(form.fieldTypeHasLabel({ type: "checklist" })).to.be.false;
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "image"
- }
- })
- ).to.be.false;
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "button"
- }
- })
- ).to.be.false;
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "submit"
- }
- })
- ).to.be.false;
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "reset"
- }
- })
- ).to.be.false;
- });
-
- it("should default to true for unknown types", () => {
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "unsupported-or-unknown"
- },
- label: "unsupported"
- })
- ).to.be.true;
- expect(
- form.fieldTypeHasLabel({
- type: "input",
- fieldOptions: {
- inputType: "unsupported-or-unknown"
- }
- })
- ).to.be.false;
- });
- });
-});
diff --git a/test/unit/specs/utils/validators.spec.js b/test/unit/specs/utils/validators.spec.js
index f3b7bd4a..1b929d8a 100644
--- a/test/unit/specs/utils/validators.spec.js
+++ b/test/unit/specs/utils/validators.spec.js
@@ -412,6 +412,9 @@ describe("Validators", () => {
expect(v.number(null, field)[0]).to.be.equal("A mezőt kötelező kitölteni!");
expect(v.string("Ab", field)[0]).to.be.equal("A szöveg túl rövid. Minimum 5 a 2 helyett");
+
+ v.resources.fieldIsRequired = "This field is required!";
+ v.resources.textTooSmall = "The length of text is too small! Current: {0}, Minimum: {1}";
});
});