@aofl/form-validate
Advanced tools
Comparing version 3.0.0-beta.30 to 3.0.0-beta.32
@@ -1,2 +0,2 @@ | ||
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"),s=n.n(i),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),y=n("W8MJ"),d=n.n(y),b=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 d()(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 s=r;0===s.length?s=i:s+="."+i,"function"==typeof n[i]?this[i]=new b(e,n[i],s):this[i]=new t(e,n[i],s)}this.reset()}return d()(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)&&!1===this[e].observed)return!1;return!0}},{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),a=0;a<r;a++)i[a]=arguments[a];n=s()(this,(t=u()(e)).call.apply(t,[this].concat(i)));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 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)},w=function(t){return function(e){return void 0!==this.target[t]&&this.target[t]===e}},j=function(t){return function(e){return"string"==typeof e&&e.length>=t}},x=function(t){return function(e){return"string"==typeof e&&e.length<=t}};var S=function(t){return"string"==typeof t&&""!==t};n.d(e,"validationMixin",(function(){return g})),n.d(e,"isAllDigits",(function(){return P})),n.d(e,"isEqual",(function(){return w})),n.d(e,"isRequired",(function(){return S})),n.d(e,"minLength",(function(){return j})),n.d(e,"maxLength",(function(){return x}))},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}},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")}}}); | ||
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"),s=n.n(i),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),y=n("W8MJ"),d=n.n(y),b=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 d()(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 s=r;0===s.length?s=i:s+="."+i,"function"==typeof n[i]?this[i]=new b(e,n[i],s):this[i]=new t(e,n[i],s)}this.reset()}return d()(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)&&!1===this[e].observed)return!1;return!0}},{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),a=0;a<r;a++)i[a]=arguments[a];n=s()(this,(t=u()(e)).call.apply(t,[this].concat(i)));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 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)},w=function(t){return function(e){return void 0!==this.target[t]&&this.target[t]===e}},j=function(t){return function(e){return"string"==typeof e&&e.length>=t}},x=function(t){return function(e){return"string"==typeof e&&e.length<=t}};function S(t){return"string"==typeof t&&""!==t}n.d(e,"validationMixin",(function(){return g})),n.d(e,"isAllDigits",(function(){return P})),n.d(e,"isEqual",(function(){return w})),n.d(e,"isRequired",(function(){return S})),n.d(e,"minLength",(function(){return j})),n.d(e,"maxLength",(function(){return x}))},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}},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 |
@@ -10,7 +10,7 @@ /** | ||
import validationMixin from './modules/validation-mixin'; | ||
import isAllDigits from './modules/is-all-digits'; | ||
import isEqual from './modules/is-equal'; | ||
import {validationMixin} from './modules/validation-mixin'; | ||
import {isAllDigits} from './modules/is-all-digits'; | ||
import {isEqual} from './modules/is-equal'; | ||
import {minLength, maxLength} from './modules/length'; | ||
import isRequired from './modules/is-required'; | ||
import {isRequired} from './modules/is-required'; | ||
@@ -17,0 +17,0 @@ export { |
@@ -31,2 +31,4 @@ /** | ||
export default isAllDigits; | ||
export { | ||
isAllDigits | ||
}; |
@@ -8,3 +8,2 @@ /** | ||
*/ | ||
/* eslint no-invalid-this: "off" */ | ||
@@ -22,3 +21,3 @@ /** | ||
const isEqual = (propName) => { | ||
return function isEqualValidator(value) { | ||
return /** @this HTMLElement */ function isEqualValidator(value) { | ||
if (typeof this.target[propName] === 'undefined') { return false; } | ||
@@ -29,2 +28,4 @@ return this.target[propName] === value; | ||
export default isEqual; | ||
export { | ||
isEqual | ||
}; |
@@ -21,2 +21,4 @@ /** | ||
export default isRequired; | ||
export { | ||
isRequired | ||
}; |
@@ -134,2 +134,4 @@ /** | ||
export default ValidationFunction; | ||
export { | ||
ValidationFunction | ||
}; |
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
import ValidationProperty from './validation-property'; | ||
import {ValidationProperty} from './validation-property'; | ||
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
export default ((superClass) => { | ||
const validationMixin = ((superClass) => { | ||
/** | ||
@@ -54,1 +54,5 @@ * Mixes the superClass with the form validatin functionality. | ||
}); | ||
export { | ||
validationMixin | ||
}; |
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
import ValidationFunction from './validation-function'; | ||
import {ValidationFunction} from './validation-function'; | ||
@@ -201,2 +201,4 @@ /** | ||
export default ValidationProperty; | ||
export { | ||
ValidationProperty | ||
}; |
{ | ||
"name": "@aofl/form-validate", | ||
"version": "3.0.0-beta.30", | ||
"version": "3.0.0-beta.32", | ||
"description": "Form validation mixin for AoflElement", | ||
@@ -40,3 +40,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@aofl/cli": "^3.0.0-beta.30", | ||
"@aofl/cli": "^3.0.0-beta.32", | ||
"cross-env": "^6.0.3", | ||
@@ -46,4 +46,3 @@ "jsdoc": "^3.6.3", | ||
"tsd-jsdoc": "^2.4.0" | ||
}, | ||
"gitHead": "7bb6b9b6e2c1d77cf7e65680aeb6a4c60e0300f4" | ||
} | ||
} |
/* eslint no-invalid-this: "off", require-jsdoc: "off" */ | ||
import {validationMixin, isRequired, minLength} from '../'; | ||
import {minLength} from '../modules/length'; | ||
import {validationMixin} from '../modules/validation-mixin'; | ||
import {isRequired} from '../modules/is-required'; | ||
@@ -4,0 +6,0 @@ describe('@aofl/aofl-validate/validationMixin', function() { |
/* eslint no-invalid-this: "off", require-jsdoc: "off" */ | ||
import {isAllDigits} from '../'; | ||
import {isAllDigits} from '../modules/is-all-digits'; | ||
@@ -4,0 +4,0 @@ describe('@aofl/aofl-validate/is-all-digit', function() { |
/* eslint no-invalid-this: "off", require-jsdoc: "off" */ | ||
import {validationMixin, isEqual} from '../'; | ||
import {isEqual} from '../modules/is-equal'; | ||
import {validationMixin} from '../modules/validation-mixin'; | ||
@@ -4,0 +5,0 @@ describe('@aofl/aofl-validate/is-equal', function() { |
/* eslint no-invalid-this: "off", require-jsdoc: "off" */ | ||
import {isRequired} from '../'; | ||
import {isRequired} from '../modules/is-required'; | ||
@@ -4,0 +4,0 @@ describe('@aofl/aofl-validate/is-required', function() { |
/* eslint no-invalid-this: "off", require-jsdoc: "off" */ | ||
import {maxLength, minLength} from '../'; | ||
import {maxLength, minLength} from '../modules/length'; | ||
@@ -4,0 +4,0 @@ describe('@aofl/aofl-validate/max-length', function() { |
/* eslint no-invalid-this: "off", require-jsdoc: "off" */ | ||
import {validationMixin} from '../'; | ||
import {validationMixin} from '../modules/validation-mixin'; | ||
@@ -4,0 +4,0 @@ describe('@aofl/aofl-validate/validationMixin', function() { |
@@ -96,3 +96,3 @@ /** | ||
*/ | ||
function module.exports(superClass: any): ValidationMixin; | ||
function validationMixin(superClass: any): ValidationMixin; | ||
/** | ||
@@ -99,0 +99,0 @@ * Creates an instance of ValidationMixin. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1332
62068
22