@aofl/form-validate
Advanced tools
Comparing version 3.2.2-alpha.0 to 3.2.2-alpha.1
@@ -1,2 +0,2 @@ | ||
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s="QfWi")}({"7W2i":function(t,e,n){var r=n("SksO");t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},Bnag:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},EbDI:function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},Ijbi:function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},Nsbk:function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},PJYZ:function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},QfWi:function(t,e,n){"use strict";n.r(e);var r=n("lwsE"),i=n.n(r),o=n("a1gu"),s=n.n(o),a=n("Nsbk"),u=n.n(a),l=n("PJYZ"),c=n.n(l),f=n("7W2i"),p=n.n(f),h=n("RIqP"),v=n.n(h),d=n("W8MJ"),y=n.n(d),b=function(){function t(e,n,r){i()(this,t),Object.defineProperties(this,{target:{value:e},propName:{value:r},resolve:{writable:!0},cachedPromise:{writable:!0},validateCompletePromise:{writable:!0},valid:{writable:!0},observed:{writable:!0},pending:{writable:!0},validatorFn:{value:n}}),this.reset()}return y()(t,[{key:"reset",value:function(){this.cachedPromise=null,this.resolve=null,this.valid=!0,this.observed=!1,this.pending=!1,this.validateCompletePromise=null}},{key:"validate",value:function(){var t=this;this.observed=!0;for(var e=this.target,n=this.propName.split("."),r=0;r<n.length-1;r++)e=e[n[r]];var i=Promise.resolve(this.validatorFn(e));this.cachedPromise=i,!1===this.pending&&(this.validateCompletePromise=new Promise((function(e){t.resolve=e}))),this.pending=!0,i.then((function(e){t.cachedPromise===i&&(t.valid=e,t.pending=!1,t.resolve(),t.target.requestUpdate())}))}},{key:"getKeys",value:function(){var t=["valid","pending","observed"];for(var e in this)Object.prototype.hasOwnProperty.call(this,e)&&t.push(e);return t}},{key:"toString",value:function(){var t=this.getKeys();return JSON.stringify(this,t,2)}},{key:"validateComplete",get:function(){return this.validateCompletePromise}}]),t}(),g=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";for(var o in i()(this,t),Object.defineProperty(this,"resolve",{writable:!0}),Object.defineProperty(this,"validateCompleteResolved",{writable:!0}),Object.defineProperty(this,"validateCompletePromise",{writable:!0}),n)if(Object.prototype.hasOwnProperty.call(n,o)){if(Object.prototype.hasOwnProperty.call(this,o))throw new Error("".concat(o," is a reserved keyword and cannot be used as a validator name."));var s=r;0===s.length?s=o:s+="."+o,"function"==typeof n[o]?this[o]=new b(e,n[o],s):this[o]=new t(e,n[o],s)}this.reset()}return y()(t,[{key:"reset",value:function(){var e=this;for(var n in this.validateCompletePromise=new Promise((function(t){e.resolve=t})),this.validateCompleteResolved=!1,this)Object.prototype.hasOwnProperty.call(this,n)&&(this[n]instanceof t||this[n]instanceof b)&&this[n].reset()}},{key:"validate",value:function(){for(var e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]instanceof t||this[e]instanceof b)&&this[e].validate()}},{key:"getKeys",value:function(){var t=["valid","pending","observed"];for(var e in this)Object.prototype.hasOwnProperty.call(this,e)&&(t.push(e),t.push.apply(t,v()(this[e].getKeys())));return t}},{key:"toString",value:function(){var t=this.getKeys();return JSON.stringify(this,t,2)}},{key:"valid",get:function(){for(var e in this)if(Object.prototype.hasOwnProperty.call(this,e)&&(this[e]instanceof t||this[e]instanceof b)&&!1===this[e].valid)return!1;return!0}},{key:"pending",get:function(){for(var e in this)if(Object.prototype.hasOwnProperty.call(this,e)&&(this[e]instanceof t||this[e]instanceof b)&&!0===this[e].pending)return!0;return!1}},{key:"observed",get:function(){for(var e in this)if(Object.prototype.hasOwnProperty.call(this,e)&&(this[e]instanceof t||this[e]instanceof b)&&!0===this[e].observed)return!0;return!1}},{key:"validateComplete",get:function(){var t=this;this.pending&&this.validateCompleteResolved&&(this.validateCompleteResolved=!1,this.validateCompletePromise=new Promise((function(e){t.resolve=e})));return function e(){var n=Object.keys(t).map((function(e){return t[e].validateComplete}));Promise.all(n).then((function(){if(t.pending)return e();t.resolve(),t.validateCompleteResolved=!0}))}(),this.validateCompletePromise}}]),t}(),m=function(t){return function(t){function e(){var t,n;i()(this,e);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];n=s()(this,(t=u()(e)).call.apply(t,[this].concat(o)));var l=void 0;return Object.defineProperties(c()(n),{validators:{get:function(){return l},set:function(t){void 0===l&&(l=t,this.form=new g(this,t))}},form:{writable:!0,enumerable:!0}}),n}return p()(e,t),e}(t)},O=/^[0-9]+$/,P=function(t){return"string"==typeof t&&O.test(t)};const w=(t,e,n)=>{const r=""===e?"":e.split("."),i=(t,e)=>{let r="",o=[];return t.length&&(r=t[0],o=t.slice(1)),n(r,o,e,i)};return i(r,t)};var j=function(t,e){return function(n){var r,i=(r=this.target,w(r,t,(t,e,n,r)=>0===e.length?n[t]:void 0!==n[t]?r(e,n[t]):void 0));return void 0!==i&&e(n,i)}},x=function(t){return j(t,(function(t,e){return"undefined"!=typeof otherVal&&t===e}))},k=function(t){return function(e){return"string"==typeof e&&e.length>=t}},S=function(t){return function(e){return"string"==typeof e&&e.length<=t}};function C(t){return"string"==typeof t&&""!==t}var _=function(t,e){return t instanceof RegExp||(t=new RegExp(t,e)),function(e){return t.test(e)}};n.d(e,"validationMixin",(function(){return m})),n.d(e,"isAllDigits",(function(){return P})),n.d(e,"isEqual",(function(){return x})),n.d(e,"minLength",(function(){return k})),n.d(e,"maxLength",(function(){return S})),n.d(e,"isRequired",(function(){return C})),n.d(e,"ValidationFunction",(function(){return b})),n.d(e,"ValidationProperty",(function(){return g})),n.d(e,"pattern",(function(){return _}))},RIqP:function(t,e,n){var r=n("Ijbi"),i=n("EbDI"),o=n("Bnag");t.exports=function(t){return r(t)||i(t)||o()}},SksO:function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},W8MJ:function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},a1gu:function(t,e,n){var r=n("cDf5"),i=n("PJYZ");t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},cDf5:function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},lwsE:function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}}}); | ||
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s="QfWi")}({"7W2i":function(t,e,n){var r=n("SksO");t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},Bnag:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},EbDI:function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},Ijbi:function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},Nsbk:function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},PJYZ:function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},QfWi:function(t,e,n){"use strict";n.r(e);var r=n("lwsE"),o=n.n(r),i=n("a1gu"),u=n.n(i),c=n("Nsbk"),s=n.n(c),a=n("PJYZ"),f=n.n(a),l=n("7W2i"),p=n.n(l),y=n("RIqP"),d=n.n(y),b=n("W8MJ"),v=n.n(b),h=function(){function t(e,n,r){o()(this,t),Object.defineProperties(this,{target:{value:e},propName:{value:r},resolve:{writable:!0},cachedPromise:{writable:!0},validateCompletePromise:{writable:!0},valid:{writable:!0},observed:{writable:!0},pending:{writable:!0},validatorFn:{value:n}}),this.reset()}return v()(t,[{key:"reset",value:function(){this.cachedPromise=null,this.resolve=null,this.valid=!0,this.observed=!1,this.pending=!1,this.validateCompletePromise=null}},{key:"validate",value:function(){var t=this;this.observed=!0;for(var e=this.target,n=this.propName.split("."),r=0;r<n.length-1;r++)e=e[n[r]];var o=Promise.resolve(this.validatorFn(e));this.cachedPromise=o,!1===this.pending&&(this.validateCompletePromise=new Promise((function(e){t.resolve=e}))),this.pending=!0,o.then((function(e){t.cachedPromise===o&&(t.valid=e,t.pending=!1,t.resolve(),t.target.requestUpdate())}))}},{key:"getKeys",value:function(){var t=["valid","pending","observed"];for(var e in this)Object.prototype.hasOwnProperty.call(this,e)&&t.push(e);return t}},{key:"toString",value:function(){var t=this.getKeys();return JSON.stringify(this,t,2)}},{key:"validateComplete",get:function(){return this.validateCompletePromise}}]),t}(),m=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";for(var i in o()(this,t),Object.defineProperty(this,"resolve",{writable:!0}),Object.defineProperty(this,"validateCompleteResolved",{writable:!0}),Object.defineProperty(this,"validateCompletePromise",{writable:!0}),n)if(Object.prototype.hasOwnProperty.call(n,i)){if(Object.prototype.hasOwnProperty.call(this,i))throw new Error("".concat(i," is a reserved keyword and cannot be used as a validator name."));var u=r;0===u.length?u=i:u+="."+i,"function"==typeof n[i]?this[i]=new h(e,n[i],u):this[i]=new t(e,n[i],u)}this.reset()}return v()(t,[{key:"reset",value:function(){var e=this;for(var n in this.validateCompletePromise=new Promise((function(t){e.resolve=t})),this.validateCompleteResolved=!1,this)Object.prototype.hasOwnProperty.call(this,n)&&(this[n]instanceof t||this[n]instanceof h)&&this[n].reset()}},{key:"validate",value:function(){for(var e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]instanceof t||this[e]instanceof h)&&this[e].validate()}},{key:"getKeys",value:function(){var t=["valid","pending","observed"];for(var e in this)Object.prototype.hasOwnProperty.call(this,e)&&(t.push(e),t.push.apply(t,d()(this[e].getKeys())));return t}},{key:"toString",value:function(){var t=this.getKeys();return JSON.stringify(this,t,2)}},{key:"valid",get:function(){for(var e in this)if(Object.prototype.hasOwnProperty.call(this,e)&&(this[e]instanceof t||this[e]instanceof h)&&!1===this[e].valid)return!1;return!0}},{key:"pending",get:function(){for(var e in this)if(Object.prototype.hasOwnProperty.call(this,e)&&(this[e]instanceof t||this[e]instanceof h)&&!0===this[e].pending)return!0;return!1}},{key:"observed",get:function(){for(var e in this)if(Object.prototype.hasOwnProperty.call(this,e)&&(this[e]instanceof t||this[e]instanceof h)&&!0===this[e].observed)return!0;return!1}},{key:"validateComplete",get:function(){var t=this;this.pending&&this.validateCompleteResolved&&(this.validateCompleteResolved=!1,this.validateCompletePromise=new Promise((function(e){t.resolve=e})));return function e(){var n=Object.keys(t).map((function(e){return t[e].validateComplete}));Promise.all(n).then((function(){if(t.pending)return e();t.resolve(),t.validateCompleteResolved=!0}))}(),this.validateCompletePromise}}]),t}(),g=function(t){return function(t){function e(){var t,n;o()(this,e);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];n=u()(this,(t=s()(e)).call.apply(t,[this].concat(i)));var a=void 0;return Object.defineProperties(f()(n),{validators:{get:function(){return a},set:function(t){void 0===a&&(a=t,this.form=new m(this,t))}},form:{writable:!0,enumerable:!0}}),n}return p()(e,t),e}(t)},O=/^[0-9]+$/,P=function(t){return"string"==typeof t&&O.test(t)},j=n("bfNk"),w=function(t,e){return function(n){var r=Object(j.get)(this.target,t);return void 0!==r&&e(n,r)}},S=function(t){return w(t,(function(t,e){return"undefined"!=typeof otherVal&&t===e}))},x=function(t){return function(e){return"string"==typeof e&&e.length>=t}},k=function(t){return function(e){return"string"==typeof e&&e.length<=t}};function _(t){return"string"==typeof t&&""!==t}var C=function(t,e){return t instanceof RegExp||(t=new RegExp(t,e)),function(e){return t.test(e)}};n.d(e,"validationMixin",(function(){return g})),n.d(e,"isAllDigits",(function(){return P})),n.d(e,"isEqual",(function(){return S})),n.d(e,"minLength",(function(){return x})),n.d(e,"maxLength",(function(){return k})),n.d(e,"isRequired",(function(){return _})),n.d(e,"ValidationFunction",(function(){return h})),n.d(e,"ValidationProperty",(function(){return m})),n.d(e,"pattern",(function(){return C})),n.d(e,"compare",(function(){return w}))},RIqP:function(t,e,n){var r=n("Ijbi"),o=n("EbDI"),i=n("Bnag");t.exports=function(t){return r(t)||o(t)||i()}},SksO:function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},W8MJ:function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},a1gu:function(t,e,n){var r=n("cDf5"),o=n("PJYZ");t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?o(t):e}},bfNk:function(t,e){t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s="QfWi")}({QfWi:function(t,e,n){"use strict";n.r(e);var r=function(t,e,n){return function t(e,r){var o="",i=[];return e.length&&(o=e[0],i=e.slice(1)),n(o,i,r,t)}(""===e?"":e.split("."),t)},o=n("lSNA"),i=n.n(o),u=function(t,e,n){return r(t,e,(function(t,e,r,o){return 0===e.length?""===t?Object.assign({},r,n):Object.assign({},r,i()({},t,Object.assign({},r[t],n))):Object.assign({},r,i()({},t,o(e,r[t])))}))},c=n("cDf5"),s=n.n(c);function a(t){for(var e in Object.freeze(t),t)!Object.hasOwnProperty.call(t,e)||null===t[e]||"object"!==s()(t[e])&&"function"!=typeof t[e]||Object.isFrozen(t[e])||a(t[e]);return t}var f=function(t,e){return r(t,e,(function(t,e,n,r){return 0===e.length?n[t]:void 0!==n[t]?r(e,n[t]):void 0}))},l=function(t,e){return r(t,e,(function(t,e,n,r){return 0===e.length?void 0!==n[t]:void 0!==n[t]&&r(e,n[t])}))},p=function(t,e,n){return r(t,e,(function(t,e,r,o){if(0!==e.length)return void 0===r[t]&&(r[t]={}),o(e,r[t]);r[t]=n}))},y=function(t,e){!function t(e,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(void 0===e[r]?Array.isArray(n[r])?e[r]=[].concat(n[r]):"object"===s()(n[r])?(e[r]={},t(e[r],n[r])):e[r]=n[r]:"object"!==s()(e[r])||Array.isArray(e[r])||t(e[r],n[r]))}(t,e)};n.d(e,"recurseObjectByPath",(function(){return r})),n.d(e,"deepAssign",(function(){return u})),n.d(e,"deepFreeze",(function(){return a})),n.d(e,"get",(function(){return f})),n.d(e,"has",(function(){return l})),n.d(e,"set",(function(){return p})),n.d(e,"defaults",(function(){return y}))},cDf5:function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},lSNA:function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}}})},cDf5:function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=r=function(t){return n(t)}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(e)}t.exports=r},lwsE:function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}}}); | ||
//# sourceMappingURL=index.js.map |
@@ -18,1 +18,2 @@ /** | ||
export {pattern} from './modules/pattern'; | ||
export {compare} from './modules/compare'; |
{ | ||
"name": "@aofl/form-validate", | ||
"version": "3.2.2-alpha.0", | ||
"version": "3.2.2-alpha.1", | ||
"description": "Form validation mixin for AoflElement", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
51037
18
802