diff --git a/docs/validation.html b/docs/validation.html index 32b33fc..2c45318 100644 --- a/docs/validation.html +++ b/docs/validation.html @@ -880,2301 +880,7 @@

diff --git a/js/dist/aire-umd.min.js b/js/dist/aire-umd.min.js new file mode 100644 index 0000000..d89de3d --- /dev/null +++ b/js/dist/aire-umd.min.js @@ -0,0 +1 @@ +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).Aire={})}(this,function(e){"use strict";function p(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(t.push(o.value),!r||t.length!==r);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw a}}return t}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function f(e){return function(e){if(Array.isArray(e)){for(var r=0,t=new Array(e.length);r",suffix:""}},classnames:{none:{},valid:{},invalid:{}}},y=function(e){e.form;var r=e.errors,t=e.data,n=e.rules,i=e.refs,a=e.touched,o=l,s=o.templates,u=o.classnames;Object.keys(n).forEach(function(e){if(e in i){var l=a.has(e)&&e in r,c=a.has(e)&&!l&&e in t;"errors"in i[e]&&(c?(i[e].errors[0].classList.add("hidden"),i[e].errors[0].innerHTML=""):l&&(i[e].errors[0].classList.remove("hidden"),i[e].errors[0].innerHTML=r[e].map(function(e){return"".concat(s.error.prefix).concat(e).concat(s.error.suffix)}).join(""))),Object.entries(i[e]).forEach(function(e){var r=p(e,2),s=r[0];r[1].forEach(function(e){var r,t,n,i,a,o;s in u.valid&&(c?(r=e.classList).add.apply(r,f(u.valid[s].split(" "))):(t=e.classList).remove.apply(t,f(u.valid[s].split(" "))));s in u.invalid&&(l?(n=e.classList).add.apply(n,f(u.invalid[s].split(" "))):(i=e.classList).remove.apply(i,f(u.invalid[s].split(" "))));s in u.none&&(c||l?(a=e.classList).remove.apply(a,f(u.none[s].split(" "))):(o=e.classList).add.apply(o,f(u.none[s].split(" "))))})})}})},m="undefined"!=typeof FormData&&"getAll"in FormData.prototype;e.configure=function(e){l=e},e.connect=function(e,r){var i=1()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)},numeric:function(t){var e;return"number"==typeof(e=Number(t))&&!isNaN(e)&&"boolean"!=typeof t},array:function(t){return t instanceof Array},url:function(t){return/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/i.test(t)},alpha:function(t){return/^[a-zA-Z]+$/.test(t)},alpha_dash:function(t){return/^[a-zA-Z0-9_\-]+$/.test(t)},alpha_num:function(t){return/^[a-zA-Z0-9]+$/.test(t)},same:function(t,e){return this.validator._flattenObject(this.validator.input)[e]===t},different:function(t,e){return this.validator._flattenObject(this.validator.input)[e]!==t},in:function(t,e){var r,i;if(t&&(r=this.getParameters()),t&&!(t instanceof Array)){var a=t;for(i=0;inew Date(i).getTime())},before_or_equal:function(t,e){var r=this.validator.input[e],i=t;return!!a(r)&&(!!a(i)&&new Date(r).getTime()>=new Date(i).getTime())},hex:function(t){return/^[0-9a-f]+$/i.test(t)}},s=function(){throw new Error("Validator `"+this.name+"` is not defined!")};function u(t,e,r){this.name=t,this.fn=e,this.passes=null,this._customMessage=void 0,this.async=r}u.prototype={validate:function(t,e,r,i){var a=this;if(this._setValidatingData(r,t,e),"function"!=typeof i)return this._apply(t,e,r);this.callback=i;function n(t,e){a.response(t,e)}return this.async?this._apply(t,e,r,n):n(this._apply(t,e,r))},_apply:function(t,e,r,i){return(this.isMissed()?s:this.fn).apply(this,[t,e,r,i])},_setValidatingData:function(t,e,r){this.attribute=t,this.inputValue=e,this.ruleValue=r},getParameters:function(){var t=[];return"string"==typeof this.ruleValue&&(t=this.ruleValue.split(",")),"number"==typeof this.ruleValue&&t.push(this.ruleValue),this.ruleValue instanceof Array&&(t=this.ruleValue),t},getSize:function(){var t=this.inputValue;return t instanceof Array?t.length:"number"==typeof t?t:this.validator._hasNumericRule(this.attribute)?parseFloat(t,10):t.length},_getValueType:function(){return"number"==typeof this.inputValue||this.validator._hasNumericRule(this.attribute)?"numeric":"string"},response:function(t,e){this.passes=void 0===t||!0===t,this._customMessage=e,this.callback(this.passes,e)},setValidator:function(t){this.validator=t},isMissed:function(){return"function"!=typeof this.fn},get customMessage(){return this.isMissed()?r:this._customMessage}};var o={asyncRules:[],implicitRules:["required","required_if","required_unless","required_with","required_with_all","required_without","required_without_all","accepted","present"],make:function(t,e){var r=this.isAsync(t),i=new u(t,n[t],r);return i.setValidator(e),i},isAsync:function(t){for(var e=0,r=this.asyncRules.length;e",suffix:""}},classnames:{none:{},valid:{},invalid:{}}},w=function(t){t.form;var e=t.errors,r=t.data,i=t.rules,a=t.refs,n=t.touched,s=A,u=s.templates,h=s.classnames;Object.keys(i).forEach(function(t){if(t in a){var o=n.has(t)&&t in e,l=n.has(t)&&!o&&t in r;"errors"in a[t]&&(l?(a[t].errors[0].classList.add("hidden"),a[t].errors[0].innerHTML=""):o&&(a[t].errors[0].classList.remove("hidden"),a[t].errors[0].innerHTML=e[t].map(function(t){return"".concat(u.error.prefix).concat(t).concat(u.error.suffix)}).join(""))),Object.entries(a[t]).forEach(function(t){var e=v(t,2),u=e[0];e[1].forEach(function(t){var e,r,i,a,n,s;u in h.valid&&(l?(e=t.classList).add.apply(e,b(h.valid[u].split(" "))):(r=t.classList).remove.apply(r,b(h.valid[u].split(" "))));u in h.invalid&&(o?(i=t.classList).add.apply(i,b(h.invalid[u].split(" "))):(a=t.classList).remove.apply(a,b(h.invalid[u].split(" "))));u in h.none&&(l||o?(n=t.classList).remove.apply(n,b(h.none[u].split(" "))):(s=t.classList).add.apply(s,b(h.none[u].split(" "))))})})}})},R="undefined"!=typeof FormData&&"getAll"in FormData.prototype,T=Object.freeze({configure:function(t){A=t},setRenderer:function(t){w=t},supported:R,connect:function(t,e){var a=1aire->config('inline_validation', true)) { - $aire_src = file_get_contents(__DIR__.'/../../js/dist/aire.js'); + $aire_src = file_get_contents(__DIR__.'/../../js/dist/aire.min.js'); return "\n{$config_js}"; } diff --git a/yarn.lock b/yarn.lock index 6ddc34e..2afc805 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1235,6 +1235,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +commander@~2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + common-path-prefix@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-1.0.0.tgz#cd52f6f0712e0baab97d6f9732874f22f47752c0" @@ -2113,6 +2118,14 @@ isobject@^4.0.0: resolved "https://registry.yarnpkg.com/isobject/-/isobject-4.0.0.tgz#3f1c9155e73b192022a80819bacd0343711697b0" integrity sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA== +jest-worker@^24.0.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3" + integrity sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ== + dependencies: + merge-stream "^1.0.1" + supports-color "^6.1.0" + js-levenshtein@^1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" @@ -2386,6 +2399,13 @@ meow@^5.0.0: trim-newlines "^2.0.0" yargs-parser "^10.0.0" +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= + dependencies: + readable-stream "^2.0.1" + merge2@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" @@ -2964,7 +2984,7 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" -readable-stream@^2.2.2: +readable-stream@^2.0.1, readable-stream@^2.2.2: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -3151,6 +3171,16 @@ rollup-plugin-node-resolve@^5.2.0: resolve "^1.11.1" rollup-pluginutils "^2.8.1" +rollup-plugin-uglify@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.2.tgz#681042cfdf7ea4e514971946344e1a95bc2772fe" + integrity sha512-qwz2Tryspn5QGtPUowq5oumKSxANKdrnfz7C0jm4lKxvRDsNe/hSGsB9FntUul7UeC4TsZEWKErVgE1qWSO0gw== + dependencies: + "@babel/code-frame" "^7.0.0" + jest-worker "^24.0.0" + serialize-javascript "^1.6.1" + uglify-js "^3.4.9" + rollup-pluginutils@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz#8fa6dd0697344938ef26c2c09d2488ce9e33ce97" @@ -3204,6 +3234,11 @@ serialize-error@^2.1.0: resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-2.1.0.tgz#50b679d5635cdf84667bdc8e59af4e5b81d5f60a" integrity sha1-ULZ51WNc34Rme9yOWa9OW4HV9go= +serialize-javascript@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" + integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA== + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -3248,7 +3283,7 @@ source-map@^0.5.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0, source-map@^0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -3490,6 +3525,14 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +uglify-js@^3.4.9: + version "3.6.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" + integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg== + dependencies: + commander "~2.20.0" + source-map "~0.6.1" + uid2@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/uid2/-/uid2-0.0.3.tgz#483126e11774df2f71b8b639dcd799c376162b82"