diff --git a/dev/app.vue b/dev/app.vue index 5445bbb8..83883086 100644 --- a/dev/app.vue +++ b/dev/app.vue @@ -1,85 +1,154 @@ + + \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 2c164995..99e99857 100644 --- a/dev/index.html +++ b/dev/index.html @@ -15,7 +15,8 @@ - +
+ diff --git a/dev/schema.js b/dev/schema.js index 9e7b1d08..90950615 100644 --- a/dev/schema.js +++ b/dev/schema.js @@ -1,4 +1,5 @@ import moment from "moment"; +import faker from "faker"; import {} from "lodash"; import { validators } from "../src"; @@ -76,7 +77,7 @@ module.exports = { "CoffeeScript", "AngularJS", "ReactJS", - "VueJS", + "VueJS" ] }, { @@ -174,19 +175,19 @@ module.exports = { default: "en_GB" }, { - type: "select", + type: "selectEx", label: "Country", model: "address.country", multi: true, required: true, - values: [ - "France", - "United Kingdom", - "United States of America", - "Germany", - "Italiy" - ], - default: "United Kingdom" + values: faker.definitions.address.country, + default: "United Kingdom", + multiSelect: false, + selectOptions: { + // https://silviomoreto.github.io/bootstrap-select/options/ + liveSearch: true, + size: 10 + } }, { type: "text", diff --git a/dev/utils.js b/dev/utils.js new file mode 100644 index 00000000..1413d0ad --- /dev/null +++ b/dev/utils.js @@ -0,0 +1,27 @@ +module.exports = { + + filters: { + prettyJSON: function(json) { + if (json) { + json = JSON.stringify(json, undefined, 4); + json = json.replace(/&/g, '&').replace(//g, '>'); + return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { + var cls = 'number'; + if (/^"/.test(match)) { + if (/:$/.test(match)) { + cls = 'key'; + } else { + cls = 'string'; + } + } else if (/true|false/.test(match)) { + cls = 'boolean'; + } else if (/null/.test(match)) { + cls = 'null'; + } + return '' + match + ''; + }); + } + } + + } +} \ No newline at end of file diff --git a/package.json b/package.json index 4304d8b1..fe6d83e8 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "babel-preset-stage-0": "6.5.0", "babel-runtime": "5.8.38", "css-loader": "0.23.1", + "faker": "3.1.0", "jade": "1.11.0", "jade-loader": "0.8.0", "lodash": "4.11.1",