diff --git a/doc/api/api.chm b/doc/api/api.chm index c6c0570..f1a9100 100644 Binary files a/doc/api/api.chm and b/doc/api/api.chm differ diff --git a/src/ExpressiveAnnotations/Properties/AssemblyInfo.cs b/src/ExpressiveAnnotations/Properties/AssemblyInfo.cs index 6bb7c86..6f3cd44 100644 --- a/src/ExpressiveAnnotations/Properties/AssemblyInfo.cs +++ b/src/ExpressiveAnnotations/Properties/AssemblyInfo.cs @@ -42,5 +42,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.5.0.0")] -[assembly: AssemblyFileVersion("2.5.0.0")] +[assembly: AssemblyVersion("2.5.1.0")] +[assembly: AssemblyFileVersion("2.5.1.0")] diff --git a/src/expressive.annotations.validate.js b/src/expressive.annotations.validate.js index 9568b30..be3c7ab 100644 --- a/src/expressive.annotations.validate.js +++ b/src/expressive.annotations.validate.js @@ -1,4 +1,4 @@ -/* expressive.annotations.validate.js - v2.6.7 +/* expressive.annotations.validate.js - v2.6.8 * Client-side component of ExpresiveAnnotations - annotation-based conditional validation library. * https://github.com/jwaliszko/ExpressiveAnnotations * diff --git a/src/expressive.annotations.validate.min.js b/src/expressive.annotations.validate.min.js index 92f28e6..9718182 100644 --- a/src/expressive.annotations.validate.min.js +++ b/src/expressive.annotations.validate.min.js @@ -1,7 +1,7 @@ -/* expressive.annotations.validate.js - v2.6.7 +/* expressive.annotations.validate.js - v2.6.8 * Client-side component of ExpresiveAnnotations - annotation-based conditional validation library. * https://github.com/jwaliszko/ExpressiveAnnotations * * Copyright (c) 2014 Jarosław Waliszko * Licensed MIT: http://opensource.org/licenses/MIT */ -!function(e,t){"use strict";var n=t.ea,r={settings:{debug:!1,dependencyTriggers:"change keyup",apply:function(t){function n(){if(!s.isBool(r.settings.debug))throw"debug value must be a boolean (true or false)";if(!s.isString(r.settings.dependencyTriggers)&&null!==r.settings.dependencyTriggers&&void 0!==r.settings.dependencyTriggers)throw"dependencyTriggers value must be a string (multiple event types can be bound at once by including each one separated by a space), null or undefined"}function i(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}i(r.settings,t),n(),e("form").each(function(){e(this).find("input, select, textarea").off(".expressive.annotations"),u.bindFields(this,!0)})}},addMethod:function(e,t){a.addMethod(e,t)},addValueParser:function(e,t){s.addValueParser(e,t)},noConflict:function(){return t.ea===this&&(t.ea=n),this}},i={dump:function(e){r.settings.debug&&console&&"function"==typeof console.log&&console.log(e)},warn:function(e){console&&"function"==typeof console.warn&&console.warn(e)},fail:function(e){console&&"function"==typeof console.error&&console.error(e)}},a={methods:{},addMethod:function(e,t){var n=this.methods[e];this.methods[e]=function(){return t.length===arguments.length?t.apply(this,arguments):"function"==typeof n?n.apply(this,arguments):t.apply(this,arguments)}},registerMethods:function(e){var t,n;this.initialize();for(t in this.methods)this.methods.hasOwnProperty(t)&&(n=this.methods[t],e[t]=n)},initialize:function(){this.addMethod("Now",function(){return Date.now()}),this.addMethod("Today",function(){return new Date((new Date).setHours(0,0,0,0)).getTime()}),this.addMethod("ToDate",function(e){return Date.parse(e)}),this.addMethod("Date",function(e,t,n){return new Date(new Date(e,t-1,n).setFullYear(e)).getTime()}),this.addMethod("Date",function(e,t,n,r,i,a){return new Date(new Date(e,t-1,n,r,i,a).setFullYear(e)).getTime()}),this.addMethod("TimeSpan",function(e,t,n,r){return 1e3*r+6e4*n+36e5*t+864e5*e}),this.addMethod("Length",function(e){return null!==e&&void 0!==e?e.length:0}),this.addMethod("Trim",function(t){return null!==t&&void 0!==t?e.trim(t):null}),this.addMethod("Concat",function(e,t){return[e,t].join("")}),this.addMethod("Concat",function(e,t,n){return[e,t,n].join("")}),this.addMethod("CompareOrdinal",function(e,t){return e===t?0:null!==e&&null===t?1:null===e&&null!==t?-1:e>t?1:-1}),this.addMethod("CompareOrdinalIgnoreCase",function(e,t){return e=null!==e&&void 0!==e?e.toLowerCase():null,t=null!==t&&void 0!==t?t.toLowerCase():null,this.CompareOrdinal(e,t)}),this.addMethod("StartsWith",function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t&&e.slice(0,t.length)===t}),this.addMethod("StartsWithIgnoreCase",function(e,t){return e=null!==e&&void 0!==e?e.toLowerCase():null,t=null!==t&&void 0!==t?t.toLowerCase():null,this.StartsWith(e,t)}),this.addMethod("EndsWith",function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t&&e.slice(-t.length)===t}),this.addMethod("EndsWithIgnoreCase",function(e,t){return e=null!==e&&void 0!==e?e.toLowerCase():null,t=null!==t&&void 0!==t?t.toLowerCase():null,this.EndsWith(e,t)}),this.addMethod("Contains",function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t&&e.indexOf(t)>-1}),this.addMethod("ContainsIgnoreCase",function(e,t){return e=null!==e&&void 0!==e?e.toLowerCase():null,t=null!==t&&void 0!==t?t.toLowerCase():null,this.Contains(e,t)}),this.addMethod("IsNullOrWhiteSpace",function(e){return null===e||!/\S/.test(e)}),this.addMethod("IsDigitChain",function(e){return/^[0-9]+$/.test(e)}),this.addMethod("IsNumber",function(e){return/^[+-]?(?:(?:[0-9]+)|(?:[0-9]+[eE][+-]?[0-9]+)|(?:[0-9]*\.[0-9]+(?:[eE][+-]?[0-9]+)?))$/.test(e)}),this.addMethod("IsEmail",function(e){return/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e)}),this.addMethod("IsUrl",function(e){return/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/i.test(e)}),this.addMethod("IsRegexMatch",function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t&&new RegExp(t).test(e)}),this.addMethod("Guid",function(e){var t=s.guid.tryParse(e);if(t.error)throw t.msg;return t}),this.addMethod("Min",function(e){if(0===arguments.length)throw"no arguments";return 1===arguments.length&&s.isArray(e)?Math.min.apply(null,e):Math.min.apply(null,arguments)}),this.addMethod("Max",function(e){if(0===arguments.length)throw"no arguments";return 1===arguments.length&&s.isArray(e)?Math.max.apply(null,e):Math.max.apply(null,arguments)}),this.addMethod("Sum",function(e){if(0===arguments.length)throw"no arguments";var t,n,r=0;if(1===arguments.length&&s.isArray(e)){for(t=0,n=e.length;n>t;t++)r+=parseFloat(e[t]);return r}for(t=0,n=arguments.length;n>t;t++)r+=parseFloat(arguments[t]);return r}),this.addMethod("Average",function(e){if(0===arguments.length)throw"no arguments";var t,n,r,i=new Array;if(1===arguments.length&&s.isArray(e))return t=this.Sum(e),t/e.length;for(n=0,r=arguments.length;r>n;n++)i.push(arguments[n]);return t=this.Sum(i),t/arguments.length})}},s={parsers:{},addValueParser:function(t,n){e.each(t.split(/\s+/),function(e,t){/\S/.test(t)&&(s.parsers[t]=n)})},array:{contains:function(e,t){for(var n=e.length;n--;)if(e[n]===t)return!0;return!1}},object:{keys:function(e){var t,n=[];for(t in e)e.hasOwnProperty(t)&&n.push(t);return n},tryParse:function(t){try{return e.parseJSON(t)}catch(n){return{error:!0,msg:"Given value was not recognized as a valid JSON. "+n}}}},string:{format:function(e,t){function n(e){return e=s.isObject(e)?JSON.stringify(e,null,4):e,e=s.isString(e)?e.replace(/\$/g,"$$$$"):e}function r(e,t,n){return e.replace(new RegExp("\\{"+n+"\\}","gm"),t)}var i;if(t instanceof Array){for(i=0;i2&&i.warn(s.string.format("DOM field {0} is ambiguous (unless custom value parser is provided).",e.attr("name"))),e.is(":checked");case"radio":return e.filter(":checked").val();default:return e.length>1&&i.warn(s.string.format("DOM field {0} is ambiguous (unless custom value parser is provided).",e.attr("name"))),e.val()}}var d,l,f,c;if(l=r+n,d=e(t).find(s.string.format(':input[name="{0}"]',l)),0===d.length)throw s.string.format("DOM field {0} not found.",l);if(f=u(d),null===f||void 0===f||""===f)return null;if(c=s.tryParse(f,a,l,o),null!==c&&void 0!==c&&c.error)throw s.string.format("DOM field {0} value conversion to {1} failed. {2}",l,a,c.msg);return c},deserializeObject:function(e,t,n,r,i){function a(e,t,n){var r,i,a,s,o;for(r=e.split("."),i=n,a=0;at?1:-1}),this.addMethod("CompareOrdinalIgnoreCase",function(e,t){return e=null!==e&&void 0!==e?e.toLowerCase():null,t=null!==t&&void 0!==t?t.toLowerCase():null,this.CompareOrdinal(e,t)}),this.addMethod("StartsWith",function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t&&e.slice(0,t.length)===t}),this.addMethod("StartsWithIgnoreCase",function(e,t){return e=null!==e&&void 0!==e?e.toLowerCase():null,t=null!==t&&void 0!==t?t.toLowerCase():null,this.StartsWith(e,t)}),this.addMethod("EndsWith",function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t&&e.slice(-t.length)===t}),this.addMethod("EndsWithIgnoreCase",function(e,t){return e=null!==e&&void 0!==e?e.toLowerCase():null,t=null!==t&&void 0!==t?t.toLowerCase():null,this.EndsWith(e,t)}),this.addMethod("Contains",function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t&&e.indexOf(t)>-1}),this.addMethod("ContainsIgnoreCase",function(e,t){return e=null!==e&&void 0!==e?e.toLowerCase():null,t=null!==t&&void 0!==t?t.toLowerCase():null,this.Contains(e,t)}),this.addMethod("IsNullOrWhiteSpace",function(e){return null===e||!/\S/.test(e)}),this.addMethod("IsDigitChain",function(e){return/^[0-9]+$/.test(e)}),this.addMethod("IsNumber",function(e){return/^[+-]?(?:(?:[0-9]+)|(?:[0-9]+[eE][+-]?[0-9]+)|(?:[0-9]*\.[0-9]+(?:[eE][+-]?[0-9]+)?))$/.test(e)}),this.addMethod("IsEmail",function(e){return/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e)}),this.addMethod("IsUrl",function(e){return/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/i.test(e)}),this.addMethod("IsRegexMatch",function(e,t){return null!==e&&void 0!==e&&null!==t&&void 0!==t&&new RegExp(t).test(e)}),this.addMethod("Guid",function(e){var t=s.guid.tryParse(e);if(t.error)throw t.msg;return t}),this.addMethod("Min",function(e){if(0===arguments.length)throw"no arguments";if(1===arguments.length&&s.isArray(e)){if(0===e.length)throw"empty sequence";return Math.min.apply(null,e)}return Math.min.apply(null,arguments)}),this.addMethod("Max",function(e){if(0===arguments.length)throw"no arguments";if(1===arguments.length&&s.isArray(e)){if(0===e.length)throw"empty sequence";return Math.max.apply(null,e)}return Math.max.apply(null,arguments)}),this.addMethod("Sum",function(e){if(0===arguments.length)throw"no arguments";var t,n,r=0;if(1===arguments.length&&s.isArray(e)){if(0===e.length)throw"empty sequence";for(t=0,n=e.length;n>t;t++)r+=parseFloat(e[t]);return r}for(t=0,n=arguments.length;n>t;t++)r+=parseFloat(arguments[t]);return r}),this.addMethod("Average",function(e){if(0===arguments.length)throw"no arguments";var t,n,r,i=new Array;if(1===arguments.length&&s.isArray(e)){if(0===e.length)throw"empty sequence";return t=this.Sum(e),t/e.length}for(n=0,r=arguments.length;r>n;n++)i.push(arguments[n]);return t=this.Sum(i),t/arguments.length})}},s={parsers:{},addValueParser:function(t,n){e.each(t.split(/\s+/),function(e,t){/\S/.test(t)&&(s.parsers[t]=n)})},array:{contains:function(e,t){for(var n=e.length;n--;)if(e[n]===t)return!0;return!1}},object:{keys:function(e){var t,n=[];for(t in e)e.hasOwnProperty(t)&&n.push(t);return n},tryParse:function(t){try{return e.parseJSON(t)}catch(n){return{error:!0,msg:"Given value was not recognized as a valid JSON. "+n}}}},string:{format:function(e,t){function n(e){return e=s.isObject(e)?JSON.stringify(e,null,4):e,e=s.isString(e)?e.replace(/\$/g,"$$$$"):e}function r(e,t,n){return e.replace(new RegExp("\\{"+n+"\\}","gm"),t)}var i;if(t instanceof Array){for(i=0;i2&&i.warn(s.string.format("DOM field {0} is ambiguous (unless custom value parser is provided).",e.attr("name"))),e.is(":checked");case"radio":return e.filter(":checked").val();default:return e.length>1&&i.warn(s.string.format("DOM field {0} is ambiguous (unless custom value parser is provided).",e.attr("name"))),e.val()}}var d,l,f,c;if(l=r+n,d=e(t).find(s.string.format(':input[name="{0}"]',l)),0===d.length)throw s.string.format("DOM field {0} not found.",l);if(f=u(d),null===f||void 0===f||""===f)return null;if(c=s.tryParse(f,a,l,o),null!==c&&void 0!==c&&c.error)throw s.string.format("DOM field {0} value conversion to {1} failed. {2}",l,a,c.msg);return c},deserializeObject:function(e,t,n,r,i){function a(e,t,n){var r,i,a,s,o;for(r=e.split("."),i=n,a=0;a