diff --git a/dist/knockout.validation-with-locales.js b/dist/knockout.validation-with-locales.js index aa5503e2..722de168 100644 --- a/dist/knockout.validation-with-locales.js +++ b/dist/knockout.validation-with-locales.js @@ -740,7 +740,7 @@ kv.rules['required'] = { validator: function (val, required) { var testVal; - if (val === undefined || val === null) { + if (val === undefined || val === null || val === false) { return !required; } diff --git a/dist/knockout.validation-with-locales.min.js b/dist/knockout.validation-with-locales.min.js index 3f915fad..abd29f3c 100644 --- a/dist/knockout.validation-with-locales.min.js +++ b/dist/knockout.validation-with-locales.min.js @@ -7,6 +7,6 @@ =============================================================================== */ -!function(a){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?a(require("knockout"),exports):"function"==typeof define&&define.amd?define(["knockout","exports"],a):a(ko,ko.validation={})}(function(a,b){function c(a){var b="max"===a;return function(c,d){if(f.utils.isEmptyVal(c))return!0;var e,g;void 0===d.typeAttr?(g="text",e=d):(g=d.typeAttr,e=d.value),isNaN(e)||e instanceof Date||(g="number");var h,i,j;switch(g.toLowerCase()){case"week":if(h=/^(\d{4})-W(\d{2})$/,i=c.match(h),null===i)throw new Error("Invalid value for "+a+" attribute for week input. Should look like '2000-W33' http://www.w3.org/TR/html-markup/input.week.html#input.week.attrs.min");return j=e.match(h),j?b?i[1]j[1]||i[1]===j[1]&&i[2]>=j[2]:!1;case"month":if(h=/^(\d{4})-(\d{2})$/,i=c.match(h),null===i)throw new Error("Invalid value for "+a+" attribute for month input. Should look like '2000-03' http://www.w3.org/TR/html-markup/input.month.html#input.month.attrs.min");return j=e.match(h),j?b?i[1]j[1]||i[1]===j[1]&&i[2]>=j[2]:!1;case"number":case"range":return b?!isNaN(c)&&parseFloat(c)<=parseFloat(e):!isNaN(c)&&parseFloat(c)>=parseFloat(e);default:return b?e>=c:c>=e}}}function d(a,b,c){return b.validator(a(),void 0===c.params?!0:h(c.params))?!0:(a.setError(f.formatMessage(c.message||b.message,h(c.params),a)),!1)}function e(a,b,c){a.isValidating(!0);var d=function(d){var e=!1,g="";return a.__valid__()?(d.message?(e=d.isValid,g=d.message):e=d,e||(a.error(f.formatMessage(g||c.message||b.message,h(c.params),a)),a.__valid__(e)),void a.isValidating(!1)):void a.isValidating(!1)};f.utils.async(function(){b.validator(a(),void 0===c.params?!0:h(c.params),d)})}if("undefined"==typeof a)throw new Error("Knockout is required, please ensure it is loaded before loading this validation plug-in");a.validation=b;var f=a.validation,g=a.utils,h=g.unwrapObservable,i=g.arrayForEach,j=g.extend,k={registerExtenders:!0,messagesOnModified:!0,errorsAsTitle:!0,errorsAsTitleOnModified:!1,messageTemplate:null,insertMessages:!0,parseInputAttributes:!1,writeInputAttributes:!1,decorateInputElement:!1,decorateElementOnModified:!0,errorClass:null,errorElementClass:"validationElement",errorMessageClass:"validationMessage",allowHtmlMessages:!1,grouping:{deep:!1,observable:!0,live:!1},validate:{}},l=j({},k);l.html5Attributes=["required","pattern","min","max","step","maxlength","minlength"],l.html5InputTypes=["email","number","date"],l.reset=function(){j(l,k)},f.configuration=l,f.utils=function(){var a=(new Date).getTime(),b={},c="__ko_validation__";return{isArray:function(a){return a.isArray||"[object Array]"===Object.prototype.toString.call(a)},isObject:function(a){return null!==a&&"object"==typeof a},isNumber:function(a){return!isNaN(a)},isObservableArray:function(a){return!!a&&"function"==typeof a.remove&&"function"==typeof a.removeAll&&"function"==typeof a.destroy&&"function"==typeof a.destroyAll&&"function"==typeof a.indexOf&&"function"==typeof a.replace},values:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(a[c]);return b},getValue:function(a){return"function"==typeof a?a():a},hasAttribute:function(a,b){return null!==a.getAttribute(b)},getAttribute:function(a,b){return a.getAttribute(b)},setAttribute:function(a,b,c){return a.setAttribute(b,c)},isValidatable:function(a){return!!(a&&a.rules&&a.isValid&&a.isModified)},insertAfter:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},newId:function(){return a+=1},getConfigOptions:function(a){var b=f.utils.contextFor(a);return b||f.configuration},setDomData:function(a,d){var e=a[c];e||(a[c]=e=f.utils.newId()),b[e]=d},getDomData:function(a){var d=a[c];return d?b[d]:void 0},contextFor:function(a){switch(a.nodeType){case 1:case 8:var b=f.utils.getDomData(a);if(b)return b;if(a.parentNode)return f.utils.contextFor(a.parentNode)}return void 0},isEmptyVal:function(a){return void 0===a?!0:null===a?!0:""===a?!0:void 0},getOriginalElementTitle:function(a){var b=f.utils.getAttribute(a,"data-orig-title"),c=a.title,d=f.utils.hasAttribute(a,"data-orig-title");return d?b:c},async:function(a){window.setImmediate?window.setImmediate(a):window.setTimeout(a,0)},forEach:function(a,b){if(f.utils.isArray(a))return i(a,b);for(var c in a)a.hasOwnProperty(c)&&b(a[c],c)}}}();var m=function(){function b(a){i(a.subscriptions,function(a){a.dispose()}),a.subscriptions=[]}function c(a){a.options.deep&&(i(a.flagged,function(a){delete a.__kv_traversed}),a.flagged.length=0),a.options.live||b(a)}function d(a,d){d.validatables=[],b(d),e(a,d),c(d)}function e(b,c,d){var f=[],g=b.peek?b.peek():b;b.__kv_traversed!==!0&&(c.options.deep&&(b.__kv_traversed=!0,c.flagged.push(b)),d=void 0!==d?d:c.options.deep?1:-1,a.isObservable(b)&&(b.errors||n.isValidatable(b)||b.extend({validatable:!0}),c.validatables.push(b),c.options.live&&n.isObservableArray(b)&&c.subscriptions.push(b.subscribe(function(){c.graphMonitor.valueHasMutated()}))),g&&!h(g._destroy)&&(n.isArray(g)?f=g:n.isObject(g)&&(f=n.values(g))),0!==d&&n.forEach(f,function(b){!b||b.nodeType||a.isComputed(b)&&!b.rules||e(b,c,d+1)}))}function k(a){var b=[];return i(a,function(a){n.isValidatable(a)&&!a.isValid()&&b.push(a.error.peek())}),b}var l=0,m=f.configuration,n=f.utils;return{init:function(a,b){l>0&&!b||(a=a||{},a.errorElementClass=a.errorElementClass||a.errorClass||m.errorElementClass,a.errorMessageClass=a.errorMessageClass||a.errorClass||m.errorMessageClass,j(m,a),m.registerExtenders&&f.registerExtenders(),l=1)},reset:f.configuration.reset,group:function(b,c){c=j(j({},m.grouping),c);var e={options:c,graphMonitor:a.observable(),flagged:[],subscriptions:[],validatables:[]},f=null;return f=c.observable?a.computed(function(){return e.graphMonitor(),d(b,e),k(e.validatables)}):function(){return d(b,e),k(e.validatables)},f.showAllMessages=function(a){void 0===a&&(a=!0),f.forEach(function(b){n.isValidatable(b)&&b.isModified(a)})},f.isAnyMessageShown=function(){var a;return a=!!f.find(function(a){return n.isValidatable(a)&&!a.isValid()&&a.isModified()})},f.filter=function(a){return a=a||function(){return!0},f(),g.arrayFilter(e.validatables,a)},f.find=function(a){return a=a||function(){return!0},f(),g.arrayFirst(e.validatables,a)},f.forEach=function(a){a=a||function(){},f(),i(e.validatables,a)},f.map=function(a){return a=a||function(a){return a},f(),g.arrayMap(e.validatables,a)},f._updateState=function(a){if(!n.isObject(a))throw new Error("An object is required.");return b=a,c.observable?void e.graphMonitor.valueHasMutated():(d(a,e),k(e.validatables))},f},formatMessage:function(a,b,c){if(n.isObject(b)&&b.typeAttr&&(b=b.value),"function"==typeof a)return a(b,c);var d=h(b);return null==d&&(d=[]),n.isArray(d)||(d=[d]),a.replace(/{(\d+)}/gi,function(a,b){return"undefined"!=typeof d[b]?d[b]:a})},addRule:function(a,b){a.extend({validatable:!0});var c=!!g.arrayFirst(a.rules.peek(),function(a){return a.rule&&a.rule===b.rule});return c||a.rules.push(b),a},addAnonymousRule:function(a,b){void 0===b.message&&(b.message="Error"),b.onlyIf&&(b.condition=b.onlyIf),f.addRule(a,b)},addExtender:function(b){a.extenders[b]=function(a,c){return c&&(c.params||c.message||c.onlyIf)?f.addRule(a,{rule:b,message:c.message,params:n.isEmptyVal(c.params)?!0:c.params,condition:c.onlyIf}):f.addRule(a,{rule:b,params:c})}},registerExtenders:function(){if(m.registerExtenders)for(var b in f.rules)f.rules.hasOwnProperty(b)&&(a.extenders[b]||f.addExtender(b))},insertValidationMessage:function(a){var b=document.createElement("SPAN");return b.className=n.getConfigOptions(a).errorMessageClass,n.insertAfter(a,b),b},parseInputValidationAttributes:function(a,b){i(f.configuration.html5Attributes,function(c){if(n.hasAttribute(a,c)){var d=a.getAttribute(c)||!0,e=c;if("min"===c||"max"===c){var g=a.getAttribute("type");"undefined"!=typeof g&&g||(g="text"),d={typeAttr:g,value:d}}else("minlength"===c||"maxlength"===c)&&(d=parseInt(d),e="minlength"===c?"minLength":"maxLength");f.addRule(b(),{rule:e,params:d})}});var c=a.getAttribute("type");i(f.configuration.html5InputTypes,function(a){a===c&&f.addRule(b(),{rule:"date"===a?"dateISO":a,params:!0})})},writeInputValidationAttributes:function(b,c){var d=c();if(d&&d.rules){var e=d.rules();i(f.configuration.html5Attributes,function(c){var d=g.arrayFirst(e,function(a){return a.rule&&a.rule.toLowerCase()===c.toLowerCase()});d&&a.computed({read:function(){var e=a.unwrap(d.params);"pattern"===d.rule&&e instanceof RegExp&&(e=e.source),b.setAttribute(c,e)},disposeWhenNodeIsRemoved:b})}),e=null}},makeBindingHandlerValidatable:function(b){var c=a.bindingHandlers[b].init;a.bindingHandlers[b].init=function(b,d,e,f,g){return c(b,d,e,f,g),a.bindingHandlers.validationCore.init(b,d,e,f,g)}},setRules:function(b,c){var d=function(b,c){if(b&&c)for(var e in c)if(c.hasOwnProperty(e)){var g=c[e];if(b[e]){var i=b[e],j=h(i),k={},l={};for(var m in g)g.hasOwnProperty(m)&&(f.rules[m]?k[m]=g[m]:l[m]=g[m]);if(a.isObservable(i)&&i.extend(k),j&&n.isArray(j))for(var o=0;o0:!0)},message:"This field is required."},f.rules.min={validator:c("min"),message:"Please enter a value greater than or equal to {0}."},f.rules.max={validator:c("max"),message:"Please enter a value less than or equal to {0}."},f.rules.minLength={validator:function(a,b){if(f.utils.isEmptyVal(a))return!0;var c=f.utils.isNumber(a)?""+a:a;return c.length>=b},message:"Please enter at least {0} characters."},f.rules.maxLength={validator:function(a,b){if(f.utils.isEmptyVal(a))return!0;var c=f.utils.isNumber(a)?""+a:a;return c.length<=b},message:"Please enter no more than {0} characters."},f.rules.pattern={validator:function(a,b){return f.utils.isEmptyVal(a)||null!==a.toString().match(b)},message:"Please check this value."},f.rules.step={validator:function(a,b){if(f.utils.isEmptyVal(a)||"any"===b)return!0;var c=100*a%(100*b);return Math.abs(c)<1e-5||Math.abs(1-c)<1e-5},message:"The value must increment by {0}."},f.rules.email={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a):!0},message:"Please enter a proper email address."},f.rules.date={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&!/Invalid|NaN/.test(new Date(a)):!0},message:"Please enter a proper date."},f.rules.dateISO={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^\d{4}[-\/](?:0?[1-9]|1[012])[-\/](?:0?[1-9]|[12][0-9]|3[01])$/.test(a):!0},message:"Please enter a proper date."},f.rules.number={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a):!0},message:"Please enter a number."},f.rules.digit={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^\d+$/.test(a):!0},message:"Please enter a digit."},f.rules.phoneUS={validator:function(a,b){return b?f.utils.isEmptyVal(a)?!0:"string"!=typeof a?!1:(a=a.replace(/\s+/g,""),b&&a.length>9&&a.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)):!0},message:"Please specify a valid phone number."},f.rules.equal={validator:function(a,b){var c=b;return a===f.utils.getValue(c)},message:"Values must equal."},f.rules.notEqual={validator:function(a,b){var c=b;return a!==f.utils.getValue(c)},message:"Please choose another value."},f.rules.unique={validator:function(a,b){var c=f.utils.getValue(b.collection),d=f.utils.getValue(b.externalValue),e=0;return a&&c?(g.arrayFilter(c,function(c){a===(b.valueAccessor?b.valueAccessor(c):c)&&e++}),(d?1:2)>e):!0},message:"Please make sure the value is unique."},function(){f.registerExtenders()}(),a.bindingHandlers.validationCore=function(){return{init:function(b,c){var d=f.utils.getConfigOptions(b),e=c();if(d.parseInputAttributes&&f.utils.async(function(){f.parseInputValidationAttributes(b,c)}),d.insertMessages&&f.utils.isValidatable(e)){var g=f.insertValidationMessage(b);d.messageTemplate?a.renderTemplate(d.messageTemplate,{field:e},null,g,"replaceNode"):a.applyBindingsToNode(g,{validationMessage:e})}d.writeInputAttributes&&f.utils.isValidatable(e)&&f.writeInputValidationAttributes(b,c),d.decorateInputElement&&f.utils.isValidatable(e)&&a.applyBindingsToNode(b,{validationElement:e})}}}(),f.makeBindingHandlerValidatable("value"),f.makeBindingHandlerValidatable("checked"),a.bindingHandlers.textInput&&f.makeBindingHandlerValidatable("textInput"),f.makeBindingHandlerValidatable("selectedOptions"),a.bindingHandlers.validationMessage={update:function(b,c){var d=c(),e=f.utils.getConfigOptions(b),i=(h(d),!1),j=!1;if(null===d||"undefined"==typeof d)throw new Error("Cannot bind validationMessage to undefined value. data-bind expression: "+b.getAttribute("data-bind"));i=d.isModified&&d.isModified(),j=d.isValid&&d.isValid();var k=null;(!e.messagesOnModified||i)&&(k=j?null:d.error);var l=!e.messagesOnModified||i?!j:!1,m="none"!==b.style.display;e.allowHtmlMessages?g.setHtml(b,k):a.bindingHandlers.text.update(b,function(){return k}),m&&!l?b.style.display="none":!m&&l&&(b.style.display="")}},a.bindingHandlers.validationElement={update:function(b,c,d){var e=c(),g=f.utils.getConfigOptions(b),i=(h(e),!1),j=!1;if(null===e||"undefined"==typeof e)throw new Error("Cannot bind validationElement to undefined value. data-bind expression: "+b.getAttribute("data-bind"));i=e.isModified&&e.isModified(),j=e.isValid&&e.isValid();var k=function(){var a={},b=!g.decorateElementOnModified||i?!j:!1;return a[g.errorElementClass]=b,a};a.bindingHandlers.css.update(b,k,d),g.errorsAsTitle&&a.bindingHandlers.attr.update(b,function(){var a=!g.errorsAsTitleOnModified||i,c=f.utils.getOriginalElementTitle(b);return a&&!j?{title:e.error,"data-orig-title":c}:!a||j?{title:c,"data-orig-title":null}:void 0})}},a.bindingHandlers.validationOptions=function(){return{init:function(a,b){var c=h(b());if(c){var d=j({},f.configuration);j(d,c),f.utils.setDomData(a,d)}}}}(),a.extenders.validation=function(a,b){return i(f.utils.isArray(b)?b:[b],function(b){f.addAnonymousRule(a,b)}),a},a.extenders.validatable=function(b,c){if(f.utils.isObject(c)||(c={enable:c}),"enable"in c||(c.enable=!0),c.enable&&!f.utils.isValidatable(b)){var d=f.configuration.validate||{},e={throttleEvaluation:c.throttle||d.throttle};b.error=a.observable(null),b.rules=a.observableArray(),b.isValidating=a.observable(!1),b.__valid__=a.observable(!0),b.isModified=a.observable(!1),b.isValid=a.computed(b.__valid__),b.setError=function(a){var c=b.error.peek(),d=b.__valid__.peek();b.error(a),b.__valid__(!1),c===a||d||b.isValid.notifySubscribers()},b.clearError=function(){return b.error(null),b.__valid__(!0),b};var g=b.subscribe(function(){b.isModified(!0)}),h=a.computed(j({read:function(){b(),b.rules();return f.validateObservable(b),!0}},e));j(h,e),b._disposeValidation=function(){b.isValid.dispose(),b.rules.removeAll(),g.dispose(),h.dispose(),delete b.rules,delete b.error,delete b.isValid,delete b.isValidating,delete b.__valid__,delete b.isModified,delete b.setError,delete b.clearError,delete b._disposeValidation}}else c.enable===!1&&b._disposeValidation&&b._disposeValidation();return b},f.validateObservable=function(a){for(var b,c,g=0,h=a.rules(),i=h.length;i>g;g++)if(c=h[g],!c.condition||c.condition())if(b=c.rule?f.rules[c.rule]:c,b.async||c.async)e(a,b,c);else if(!d(a,b,c))return!1;return a.clearError(),!0};var n,o={};f.defineLocale=function(a,b){return a&&b?(o[a.toLowerCase()]=b,b):null},f.locale=function(a){if(a){if(a=a.toLowerCase(),!o.hasOwnProperty(a))throw new Error("Localization "+a+" has not been loaded.");f.localize(o[a]),n=a}return n},f.localize=function(a){var b=f.rules;for(var c in a)b.hasOwnProperty(c)&&(b[c].message=a[c])},function(){var a={},b=f.rules;for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c].message);f.defineLocale("en-us",a)}(),n="en-us",a.applyBindingsWithValidation=function(b,c,d){var e,g=document.body;c&&c.nodeType?(g=c,e=d):e=c,f.init(),e&&(e=j(j({},f.configuration),e),f.utils.setDomData(g,e)),a.applyBindings(b,g)};var p=a.applyBindings;a.applyBindings=function(a,b){f.init(),p(a,b)},a.validatedObservable=function(b,c){if(!c&&!f.utils.isObject(b))return a.observable(b).extend({validatable:!0});var d=a.observable(b);return d.errors=f.group(f.utils.isObject(b)?b:{},c),d.isValid=a.observable(0===d.errors().length),a.isObservable(d.errors)?d.errors.subscribe(function(a){d.isValid(0===a.length)}):a.computed(d.errors).subscribe(function(a){d.isValid(0===a.length)}),d.subscribe(function(a){f.utils.isObject(a)||(a={}),d.errors._updateState(a),d.isValid(0===d.errors().length)}),d},function(b){b(a.validation)}(function(a){return a.defineLocale("ar-JO",{required:"مطلوب.",min:"أدخل قيمة اكبر من {0}.",max:"أدخل قيمة اقل من {0}.",minLength:"أدخل {0} احرف أو أكثر.",maxLength:"أدخل {0} أحرف أو أقل.",pattern:"قيمة غير صحيحة.",step:"يجب ان تضاف بمقدار {0}.",email:"صيغة البريد الالكتروني غير صحيحة.",date:"صيغة التاريخ غير صحيحة.",dateISO:"صيغة التاريخ غير صحيحة.",number:"يرجى إدخال رقم.",digit:"يرجى إدخال منزلة.",phoneUS:"صيغة رقم الهاتف غير صحيحة.",equal:"القيمة غير مساوية.",notEqual:"يرجى اختيار قيمة اخرى.",unique:"يرجى التحقق من عدم اختبار قيمة مشابهة."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("bg-BG",{required:"Моля, въведете стойност.",min:"Моля, въведете стойност по-голяма или равна на {0}.",max:"Моля, въведете стойност по-малка или равна на {0}.",minLength:"Моля, въведете поне {0} символа.",maxLength:"Моля, въведете по-малко от {0} символа.",pattern:"Моля, проверете тази стойност.",step:"Стойността трябва да се увеличава с {0}.",email:"Това не е валиден e-mail адрес.",date:"Моля, въведете валидна дата.",dateISO:"Моля, въведете валидна дата.",number:"Моля, въведете число.",digit:"Моля, въведете цифра.",phoneUS:"Моля, въведете валиден телефонен номер.",equal:"Стойностите трябва да са равни.",notEqual:"Моля, изберете различна стойност.",unique:"Моля, убедете се, че стойността е уникална."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("ca-ES",{required:"Aquest camp es obligatori",min:"Introduir un valor igual o major que {0}",max:"Introduir un valor menor o igual que {0}",minLength:"Ha de tenir un mínim de {0} caràcters",maxLength:"No pot tenir mes de {0} caràcters",pattern:"Si us plau, comproveu aquest campo",step:"El valor ha d'incrementar-se en {0}",email:"Aquesta no es una adreça de correu electrònic correcta",date:"Introduir una data correcta",dateISO:"Introduir una data correcta",number:"Ha de ser un nombre",digit:"Introduir un dígit",phoneUS:"Ha de ser un número de telèfon vàlid",equal:"Els valors han de ser iguals",notEqual:"Elegiu un altre valor",unique:"Ha de ser un valor únic"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("cs-CZ",{required:"Toto pole je povinné.",min:"Zadejte číslo větší nebo rovné {0}.",max:"Zadejte číslo menší nebo rovné {0}.",minLength:"Vložte alespoň {0} znaků.",maxLength:"Vložte nejvíce {0} znaků.",pattern:"Zkontrolujte formát pole.",step:"Hodnota musí být násobek {0}.",email:"Neplatná e-mailová adresa.",date:"Zadejte platné datum.",dateISO:"Zadejte platné datum.",number:"Zadejte číslo.",digit:"Zadejte číslice.",phoneUS:"Zadejte platné telefonní číslo.",equal:"Hodnoty musí být stejné.",notEqual:"Vyberte jinou hodnotu.",unique:"Zkontrolujte, zda hodnota je jedinečná."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("da-DK",{required:"Dette felt er påkrævet.",min:"Angiv en værdi der mindst er {0}.",max:"Angiv en værdi der højst er {0}.",minLength:"Indtast mindst {0} tegn.",maxLength:"Indtast højst {0} tegn.",pattern:"Tjek venligst denne værdi.",step:"Værdien skal stige med {0}",email:"Dette er ikke en gyldig e-mail-adresse",date:"Indtast en gyldig dato",dateISO:"Indtast en gyldig dato",number:"Indtast et tal",digit:"Indtast et ciffer",phoneUS:"Indtast et gyldigt telefonnummer",equal:"Indtast den samme værdi igen.",notEqual:"Indtast en anden værdi.",unique:"Sørg for at værdien er unik."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("de-DE",{required:"Dieses Feld ist erforderlich.",min:"Bitte geben Sie einen Wert größer oder gleich {0} ein.",max:"Bitte geben Sie einen Wert kleiner oder gleich {0} ein.",minLength:"Bitte geben Sie mindestens {0} Zeichen ein.",maxLength:"Bitte geben Sie nicht mehr als {0} Zeichen ein.",pattern:"Bitte überprüfen Sie diesen Wert.",step:"Der Wert muss um {0} erhöht werden.",email:"Das ist keine gültige Email-Adresse.",date:"Bitte geben Sie ein gültiges Datum ein.",dateISO:"Bitte geben Sie ein gültiges Datum ein.",number:"Bitte geben Sie eine Zahl ein.",digit:"Bitte geben Sie eine Ziffer ein.",phoneUS:"Bitte geben Sie eine gültige Telefonnummer ein.",equal:"Die Werte müssen übereinstimmen.",notEqual:"Bitte wählen Sie einen anderen Wert.",unique:"Bitte stellen Sie sicher, dass der Wert eindeutig ist."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("el-GR",{required:"Το πεδίο αυτό είναι υποχρεωτικό.",min:"Παρακαλώ εισάγετε μια τιμή μεγαλύτερη ή ίση από {0}.",max:"Παρακαλώ εισάγετε μια τιμή μικρότερη ή ίση από {0}.",minLength:"Παρακαλώ εισάγετε τουλάχιστον {0} χαρακτήρες.",maxLength:"Παρακαλώ εισάγετε το πολύ {0} χαρακτήρες.",pattern:"Παρακαλώ ελέγξτε την τιμή αυτή.",step:"Η τιμή πρέπει να αυξηθεί κατά {0}",email:"Η διεύθυνση email δεν έχει έγκυρη μορφή",date:"Παρακαλώ εισάγετε μια έγκυρη ημερομηνία",dateISO:"Παρακαλώ εισάγετε μια έγκυρη ημερομηνία",number:"Παρακαλώ εισάγετε έναν αριθμό",digit:"Παρακαλώ εισάγετε ένα ψηφίο",phoneUS:"Παρακαλώ εισάγετε έναν σωστό αριθμό τηλεφώνου",equal:"Οι τιμές πρέπει να είναι ίσες",notEqual:"Παρακαλώ επιλέξτε μια άλλη τιμή.",unique:"Παρακαλώ βεβαιωθείτε ότι η τιμή είναι μοναδική."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("es-ES",{required:"Este campo es obligatorio",min:"Por favor, introduzca un valor igual o mayor a {0}",max:"Por favor, introduzca un valor menor o igual a {0}",minLength:"Por favor, introduzca al menos {0} caracteres",maxLength:"Por favor, no introduzca más de {0} caracteres",pattern:"Por favor, compruebe este campo",step:"El valor debe incrementarse por {0}",email:"Este no es una dirección de email correcta",date:"Por favor, introduzca una fecha correcta",dateISO:"Por favor, introduzca una fecha correcta",number:"Por favor, introduzca un número",digit:"Por favor, introduzca un dígito",phoneUS:"Por favor, introduzca un número de teléfono válido para EEUU",equal:"Los valores deben ser iguales",notEqual:"Por favor, elija otro valor",unique:"Por favor, asegurese de que el valor sea único"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("fa-IR",{required:"تکمیل این فیلد اجباری است.",min:"لطفاً مقداری بزرگتر یا برابر {0} وارد نمائید.",max:"لطفاً مقداری کوچکتر یا برابر {0} وارد نمائید.",minLength:"لطفاً حداقل {0} حرف وارد نمائید.",maxLength:"لطفاً حداکثر {0} حرف وارد نمائید.",pattern:"لطفاً یک مقدار معتبر وارد نمائید.",step:"مقدار باید با {0} افزایش پبدا کند.",email:"لطفاً یک آدرس ایمیل معتبر وارد نمائید.",date:"لطفاً یک تاریخ معتبر وارد نمائید.",dateISO:"لطفاً یک تاریخ معتبر وارد نمائید.",number:"لطفاً یک عدد وارد نمائید.",digit:"لطفاً یک عدد وارد نمائید.",phoneUS:"لطفاً یک شماره تماس معتبر وارد نمائید.",equal:"مقدارها باید برابر باشند.",notEqual:"لطفاً یک مقدار دیگر وارد نمائید.",unique:"لطفاً یک مقدار منحصربه فرد وارد نمائید."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("fr-FR",{required:"Ce champ est obligatoire.",min:"Veuillez saisir une valeur supérieure ou égale à {0}.",max:"Veuillez saisir une valeur inférieure ou égale à {0}.",minLength:"Veuillez saisir au moins {0} caractères.",maxLength:"Veuillez saisir au plus {0} caractères.",pattern:"Veuillez corriger ce champ.",step:"Le pas d'incrémentation de la valeur doit être de {0}.",email:"Ceci n'est pas une adresse électronique valide.",date:"Veuillez saisir une date valide.",dateISO:"Veuillez saisir une date (ISO) valide.",number:"Veuillez saisir un nombre.",digit:"Veuillez saisir un chiffre.",phoneUS:"Veuillez saisir un numéro de téléphone valide.",equal:"Les valeurs doivent être égales.",notEqual:"Veuillez saisir une autre valeur.",unique:"Veuillez vérifier que la valeur est unique."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("he-IL",{required:"שדה נדרש",min:"אנא הכנס ערך גדול יותר או שווה ל- {0}",max:"אנא הכנס ערך קטן יותר או שווה ל- {0}",minLength:"אנא הכנס לפחות {0} תווים",maxLength:"אנא הכנס לא יותר מאשר {0} תווים",pattern:"אנא בדוק את הערך הזה",step:"הערך צריך להשתנות ב - {0}",email:'אנא הכנס כתובת דוא"ל חוקית',date:"אנא הכנס תאריך תקין",dateISO:"אנא הכנס תאריך תקין",number:"אנא הכנס מספר",digit:"אנא הכנס ספרה",phoneUS:"אנא הכנס מספר טלפון תקין",equal:"ערכים חייבים להיות שווים",notEqual:"אנא בחר ערך שונה",unique:"אנא וודא שהערך ייחודי"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("hr-HR",{required:"Ovo polje je obavezno.",min:"Unesena vrijednost mora biti jednaka ili veća od {0}.",max:"Unesena vrijednost mora biti jednaka ili manja od {0}.",minLength:"Minimalna dužina polja je {0} znakova.",maxLength:"Maksimalna dužina polja je {0} znakova.",pattern:"Unesena vrijednost nije ispravnog formata.",step:"Vrijednost se mora povećavati za {0}.",email:"Potrebno je unijeti ispravnu e-mail adresu.",date:"Potrebno je unijeti ispravan datum.",dateISO:"Potrebno je unijeti ispravan datum.",number:"Unesena vrijednost mora biti broj.",digit:"Unesena vrijednost mora biti znamenka.",phoneUS:"Potrebno je unijeti ispravan broj telefona.",equal:"Vrijednosti moraju biti jednake.",notEqual:"Unesite drugu vrijednost.",unique:"Unesena vrijednost mora biti jedinstvena."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("hu-HU",{required:"Kötelezõ megadni.",min:"Nem lehet kisebb, mint {0}.",max:"Nem lehet nagyobb, mint {0}.",minLength:"Legalább {0} karaktert adjon meg.",maxLength:"Legfeljebb {0} karaktert adjon meg.",pattern:"Kérem ellenõrizze ezt az értéket.",step:"Az értéknek {0} értékkel kell növekednie.",email:"A megadott email cím nem érvényes.",date:"A megadott dátum nem érvényes.",dateISO:"A megadott dátum nem érvényes.",number:"Kérem számot adjon meg.",digit:"Kérem számjegyet adjon meg.",phoneUS:"Kérem, hogy érvényes telefonszámot adjon meg.",equal:"Az értékeknek meg kel egyezniük.",notEqual:"Az értékeknek különbözniük kell.",unique:"Az értéknek egyedieknek kell lennie."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("it-IT",{required:"Il campo è obbligatorio.",min:"Inserire un valore superiore od uguale a {0}.",max:"Inserire un valore inferiore od uguale a {0}.",minLength:"Inserire almeno {0} caratteri.",maxLength:"Inserire al massimo {0} caratteri.",pattern:"Controllare il valore inserito.",step:"Il valore deve essere incrementato di {0}.",email:"Indirizzo email non valido.",date:"Inserire una data valida.",dateISO:"Inserire una data valida.",number:"Inserire un valore numerico.",digit:"Inserire una cifra.",phoneUS:"Specificare un numero di telefono valido.",equal:"I valori devono essere uguali.",notEqual:"Il valore deve essere differente.",unique:"Il valore deve essere univoco."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("ja-JP",{required:"このフィールドは必須入力項目です。",min:"{0}以上の値を入力してください。",max:"{0}以下の値を入力してください。",minLength:"{0}文字以上の文字を入力してください。",maxLength:"{0}文字以下の文字数にしてください。",pattern:"入力値を確認してください。",step:"この値は{0}で増加します。",email:"適切なe-mailアドレスではありません。",date:"適切な日付を入力してください。",dateISO:"適切な日付を入力してください。",number:"数字を入力してください。",digit:"数値を入力してください。",phoneUS:"有効な電話番号を指定してください。",equal:"同一の値にしてください。",notEqual:"他の値を選択してください。",unique:"一意の値であることを確認してください。"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("ko-KR",{required:"필수 입력항목입니다.",min:"{0}보다 큰 값을 입력해 주십시오.",max:"{0}보다 작은 값을 입력해 주십시오.",minLength:"{0}글자 이상으로 입력해 주십시오.",maxLength:"{0}글자 이하로 입력해 주십시오.",pattern:"입력한 값의 형식이 올바르지 않습니다.",step:"이 값은 반드시 {0}씩 증가해야 합니다.",email:"올바른 이메일 주소 형식이 아닙니다.",date:"올바른 날짜 형식이 아닙니다.",dateISO:"올바른 날짜 형식이 아닙니다.",number:"숫자를 입력해 주십시오.",digit:"숫자를 입력해 주십시오.",phoneUS:"올바른 전화번호 형식이 아닙니다.",equal:"같은 값을 입력해 주십시오.",notEqual:"다른 값을 선택해 주십시오.",unique:"고유한 값인지 확인해 주십시오."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("lv-LV",{required:"Lauks ir obligāts.",min:"Lūdzu, ievadiet vērtību lielāku vai vienādu ar {0}.",max:"Lūdzu, ievadiet vērtību mazāku vai vienādu par {0}.",minLength:"Lūdzu, ievadiet vismaz {0} simbolus.",maxLength:"Lūdzu, ievadiet ne vairāk kā {0} simbolus.",pattern:"Lūdzu, pārbaudiet norādītās vērtības formātu.",step:"Norādītām vērtībām jābūt pieaugošām ar soli {0}",email:"Norādītā e-pasta adrese neatbilst formātam",date:"Lūdzu, norādiet atbilstošu datuma formātu.",dateISO:"Lūdzu, norādiet atbilstošu datuma formātu.",number:"Lūdzu, ievadiet numuru.",digit:"Lūdzu, ievadiet ciparu.",phoneUS:"Lūdzu, norādiet formātam atbilstošu telefona numuru.",equal:"Norādītām vērtībām jābūt vienādām.",notEqual:"Norādītās vērtības nav vienādas.",unique:"Vērtībai jābūt unikālai."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("nb-NO",{required:"Dette feltet er obligatorisk",min:"Fyll inn en verdi som er større eller lik {0}",max:"Fyll inn en verdi som er mindre eller lik {0}",minLength:"Fyll inn minst {0} tegn",maxLength:"Fyll inn færre enn {0} tegn",pattern:"Vennligst kontrollér verdien",step:"Verdien må økes med {0}",email:"Dette er ikke en korrekt e-postadresse",date:"Fyll inn en korrekt dato",dateISO:"Fyll inn en korrekt dato",number:"Fyll inn ett nummer",digit:"Fyll inn ett siffer",phoneUS:"Vennlist spesifiser ett korrekt telefonnummer",equal:"Verdiene må være like",notEqual:"Vennligst velg en annen verdi",unique:"Vennligst sørg for at verdien er unik"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("nl-BE",{required:"Dit veld is verplicht.",min:"Vul een waarde in groter dan of gelijk aan {0}.",max:"Vul een waarde in kleiner dan of gelijk aan {0}.",minLength:"Vul ten minste {0} tekens in.",maxLength:"Vul ten hoogste {0} tekens in.",pattern:"Vul een correcte waarde in.",step:"Vul een waarde in die deelbaar is door {0}.",email:"Vul een correct e-mailadres in.",date:"Vul een correcte datum in.",dateISO:"Vul een correcte datum in.",number:"Vul een getal in.",digit:"Vul een cijfer in.",phoneUS:"Vul een geldig telefoonnummer in.",equal:"Waarden moeten gelijk zijn.",notEqual:"Vul een andere waarde in.",unique:"Vul een unieke waarde in."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("nl-NL",{required:"Dit veld is verplicht.",min:"Vul een waarde in groter of gelijk aan {0}.",max:"Vul een waarde in kleiner of gelijk aan {0}.",minLength:"Vul ten minste {0} tekens in.",maxLength:"Vul ten hoogste {0} tekens in.",pattern:"Vul een correcte waarde in.",step:"Vul een waarde in die deelbaar is door {0}.",email:"Vul een correct e-mailadres in.",date:"Vul een correcte datum in.",dateISO:"Vul een correcte datum in.",number:"Vul een getal in.",digit:"Vul een cijfer in.",phoneUS:"Vul een geldig telefoonnummer in.",equal:"Waarden moeten gelijk zijn.",notEqual:"Vul een andere waarde in.", +!function(a){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?a(require("knockout"),exports):"function"==typeof define&&define.amd?define(["knockout","exports"],a):a(ko,ko.validation={})}(function(a,b){function c(a){var b="max"===a;return function(c,d){if(f.utils.isEmptyVal(c))return!0;var e,g;void 0===d.typeAttr?(g="text",e=d):(g=d.typeAttr,e=d.value),isNaN(e)||e instanceof Date||(g="number");var h,i,j;switch(g.toLowerCase()){case"week":if(h=/^(\d{4})-W(\d{2})$/,i=c.match(h),null===i)throw new Error("Invalid value for "+a+" attribute for week input. Should look like '2000-W33' http://www.w3.org/TR/html-markup/input.week.html#input.week.attrs.min");return j=e.match(h),j?b?i[1]j[1]||i[1]===j[1]&&i[2]>=j[2]:!1;case"month":if(h=/^(\d{4})-(\d{2})$/,i=c.match(h),null===i)throw new Error("Invalid value for "+a+" attribute for month input. Should look like '2000-03' http://www.w3.org/TR/html-markup/input.month.html#input.month.attrs.min");return j=e.match(h),j?b?i[1]j[1]||i[1]===j[1]&&i[2]>=j[2]:!1;case"number":case"range":return b?!isNaN(c)&&parseFloat(c)<=parseFloat(e):!isNaN(c)&&parseFloat(c)>=parseFloat(e);default:return b?e>=c:c>=e}}}function d(a,b,c){return b.validator(a(),void 0===c.params?!0:h(c.params))?!0:(a.setError(f.formatMessage(c.message||b.message,h(c.params),a)),!1)}function e(a,b,c){a.isValidating(!0);var d=function(d){var e=!1,g="";return a.__valid__()?(d.message?(e=d.isValid,g=d.message):e=d,e||(a.error(f.formatMessage(g||c.message||b.message,h(c.params),a)),a.__valid__(e)),void a.isValidating(!1)):void a.isValidating(!1)};f.utils.async(function(){b.validator(a(),void 0===c.params?!0:h(c.params),d)})}if("undefined"==typeof a)throw new Error("Knockout is required, please ensure it is loaded before loading this validation plug-in");a.validation=b;var f=a.validation,g=a.utils,h=g.unwrapObservable,i=g.arrayForEach,j=g.extend,k={registerExtenders:!0,messagesOnModified:!0,errorsAsTitle:!0,errorsAsTitleOnModified:!1,messageTemplate:null,insertMessages:!0,parseInputAttributes:!1,writeInputAttributes:!1,decorateInputElement:!1,decorateElementOnModified:!0,errorClass:null,errorElementClass:"validationElement",errorMessageClass:"validationMessage",allowHtmlMessages:!1,grouping:{deep:!1,observable:!0,live:!1},validate:{}},l=j({},k);l.html5Attributes=["required","pattern","min","max","step","maxlength","minlength"],l.html5InputTypes=["email","number","date"],l.reset=function(){j(l,k)},f.configuration=l,f.utils=function(){var a=(new Date).getTime(),b={},c="__ko_validation__";return{isArray:function(a){return a.isArray||"[object Array]"===Object.prototype.toString.call(a)},isObject:function(a){return null!==a&&"object"==typeof a},isNumber:function(a){return!isNaN(a)},isObservableArray:function(a){return!!a&&"function"==typeof a.remove&&"function"==typeof a.removeAll&&"function"==typeof a.destroy&&"function"==typeof a.destroyAll&&"function"==typeof a.indexOf&&"function"==typeof a.replace},values:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(a[c]);return b},getValue:function(a){return"function"==typeof a?a():a},hasAttribute:function(a,b){return null!==a.getAttribute(b)},getAttribute:function(a,b){return a.getAttribute(b)},setAttribute:function(a,b,c){return a.setAttribute(b,c)},isValidatable:function(a){return!!(a&&a.rules&&a.isValid&&a.isModified)},insertAfter:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},newId:function(){return a+=1},getConfigOptions:function(a){var b=f.utils.contextFor(a);return b||f.configuration},setDomData:function(a,d){var e=a[c];e||(a[c]=e=f.utils.newId()),b[e]=d},getDomData:function(a){var d=a[c];return d?b[d]:void 0},contextFor:function(a){switch(a.nodeType){case 1:case 8:var b=f.utils.getDomData(a);if(b)return b;if(a.parentNode)return f.utils.contextFor(a.parentNode)}return void 0},isEmptyVal:function(a){return void 0===a?!0:null===a?!0:""===a?!0:void 0},getOriginalElementTitle:function(a){var b=f.utils.getAttribute(a,"data-orig-title"),c=a.title,d=f.utils.hasAttribute(a,"data-orig-title");return d?b:c},async:function(a){window.setImmediate?window.setImmediate(a):window.setTimeout(a,0)},forEach:function(a,b){if(f.utils.isArray(a))return i(a,b);for(var c in a)a.hasOwnProperty(c)&&b(a[c],c)}}}();var m=function(){function b(a){i(a.subscriptions,function(a){a.dispose()}),a.subscriptions=[]}function c(a){a.options.deep&&(i(a.flagged,function(a){delete a.__kv_traversed}),a.flagged.length=0),a.options.live||b(a)}function d(a,d){d.validatables=[],b(d),e(a,d),c(d)}function e(b,c,d){var f=[],g=b.peek?b.peek():b;b.__kv_traversed!==!0&&(c.options.deep&&(b.__kv_traversed=!0,c.flagged.push(b)),d=void 0!==d?d:c.options.deep?1:-1,a.isObservable(b)&&(b.errors||n.isValidatable(b)||b.extend({validatable:!0}),c.validatables.push(b),c.options.live&&n.isObservableArray(b)&&c.subscriptions.push(b.subscribe(function(){c.graphMonitor.valueHasMutated()}))),g&&!h(g._destroy)&&(n.isArray(g)?f=g:n.isObject(g)&&(f=n.values(g))),0!==d&&n.forEach(f,function(b){!b||b.nodeType||a.isComputed(b)&&!b.rules||e(b,c,d+1)}))}function k(a){var b=[];return i(a,function(a){n.isValidatable(a)&&!a.isValid()&&b.push(a.error.peek())}),b}var l=0,m=f.configuration,n=f.utils;return{init:function(a,b){l>0&&!b||(a=a||{},a.errorElementClass=a.errorElementClass||a.errorClass||m.errorElementClass,a.errorMessageClass=a.errorMessageClass||a.errorClass||m.errorMessageClass,j(m,a),m.registerExtenders&&f.registerExtenders(),l=1)},reset:f.configuration.reset,group:function(b,c){c=j(j({},m.grouping),c);var e={options:c,graphMonitor:a.observable(),flagged:[],subscriptions:[],validatables:[]},f=null;return f=c.observable?a.computed(function(){return e.graphMonitor(),d(b,e),k(e.validatables)}):function(){return d(b,e),k(e.validatables)},f.showAllMessages=function(a){void 0===a&&(a=!0),f.forEach(function(b){n.isValidatable(b)&&b.isModified(a)})},f.isAnyMessageShown=function(){var a;return a=!!f.find(function(a){return n.isValidatable(a)&&!a.isValid()&&a.isModified()})},f.filter=function(a){return a=a||function(){return!0},f(),g.arrayFilter(e.validatables,a)},f.find=function(a){return a=a||function(){return!0},f(),g.arrayFirst(e.validatables,a)},f.forEach=function(a){a=a||function(){},f(),i(e.validatables,a)},f.map=function(a){return a=a||function(a){return a},f(),g.arrayMap(e.validatables,a)},f._updateState=function(a){if(!n.isObject(a))throw new Error("An object is required.");return b=a,c.observable?void e.graphMonitor.valueHasMutated():(d(a,e),k(e.validatables))},f},formatMessage:function(a,b,c){if(n.isObject(b)&&b.typeAttr&&(b=b.value),"function"==typeof a)return a(b,c);var d=h(b);return null==d&&(d=[]),n.isArray(d)||(d=[d]),a.replace(/{(\d+)}/gi,function(a,b){return"undefined"!=typeof d[b]?d[b]:a})},addRule:function(a,b){a.extend({validatable:!0});var c=!!g.arrayFirst(a.rules.peek(),function(a){return a.rule&&a.rule===b.rule});return c||a.rules.push(b),a},addAnonymousRule:function(a,b){void 0===b.message&&(b.message="Error"),b.onlyIf&&(b.condition=b.onlyIf),f.addRule(a,b)},addExtender:function(b){a.extenders[b]=function(a,c){return c&&(c.params||c.message||c.onlyIf)?f.addRule(a,{rule:b,message:c.message,params:n.isEmptyVal(c.params)?!0:c.params,condition:c.onlyIf}):f.addRule(a,{rule:b,params:c})}},registerExtenders:function(){if(m.registerExtenders)for(var b in f.rules)f.rules.hasOwnProperty(b)&&(a.extenders[b]||f.addExtender(b))},insertValidationMessage:function(a){var b=document.createElement("SPAN");return b.className=n.getConfigOptions(a).errorMessageClass,n.insertAfter(a,b),b},parseInputValidationAttributes:function(a,b){i(f.configuration.html5Attributes,function(c){if(n.hasAttribute(a,c)){var d=a.getAttribute(c)||!0,e=c;if("min"===c||"max"===c){var g=a.getAttribute("type");"undefined"!=typeof g&&g||(g="text"),d={typeAttr:g,value:d}}else("minlength"===c||"maxlength"===c)&&(d=parseInt(d),e="minlength"===c?"minLength":"maxLength");f.addRule(b(),{rule:e,params:d})}});var c=a.getAttribute("type");i(f.configuration.html5InputTypes,function(a){a===c&&f.addRule(b(),{rule:"date"===a?"dateISO":a,params:!0})})},writeInputValidationAttributes:function(b,c){var d=c();if(d&&d.rules){var e=d.rules();i(f.configuration.html5Attributes,function(c){var d=g.arrayFirst(e,function(a){return a.rule&&a.rule.toLowerCase()===c.toLowerCase()});d&&a.computed({read:function(){var e=a.unwrap(d.params);"pattern"===d.rule&&e instanceof RegExp&&(e=e.source),b.setAttribute(c,e)},disposeWhenNodeIsRemoved:b})}),e=null}},makeBindingHandlerValidatable:function(b){var c=a.bindingHandlers[b].init;a.bindingHandlers[b].init=function(b,d,e,f,g){return c(b,d,e,f,g),a.bindingHandlers.validationCore.init(b,d,e,f,g)}},setRules:function(b,c){var d=function(b,c){if(b&&c)for(var e in c)if(c.hasOwnProperty(e)){var g=c[e];if(b[e]){var i=b[e],j=h(i),k={},l={};for(var m in g)g.hasOwnProperty(m)&&(f.rules[m]?k[m]=g[m]:l[m]=g[m]);if(a.isObservable(i)&&i.extend(k),j&&n.isArray(j))for(var o=0;o0:!0)},message:"This field is required."},f.rules.min={validator:c("min"),message:"Please enter a value greater than or equal to {0}."},f.rules.max={validator:c("max"),message:"Please enter a value less than or equal to {0}."},f.rules.minLength={validator:function(a,b){if(f.utils.isEmptyVal(a))return!0;var c=f.utils.isNumber(a)?""+a:a;return c.length>=b},message:"Please enter at least {0} characters."},f.rules.maxLength={validator:function(a,b){if(f.utils.isEmptyVal(a))return!0;var c=f.utils.isNumber(a)?""+a:a;return c.length<=b},message:"Please enter no more than {0} characters."},f.rules.pattern={validator:function(a,b){return f.utils.isEmptyVal(a)||null!==a.toString().match(b)},message:"Please check this value."},f.rules.step={validator:function(a,b){if(f.utils.isEmptyVal(a)||"any"===b)return!0;var c=100*a%(100*b);return Math.abs(c)<1e-5||Math.abs(1-c)<1e-5},message:"The value must increment by {0}."},f.rules.email={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a):!0},message:"Please enter a proper email address."},f.rules.date={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&!/Invalid|NaN/.test(new Date(a)):!0},message:"Please enter a proper date."},f.rules.dateISO={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^\d{4}[-\/](?:0?[1-9]|1[012])[-\/](?:0?[1-9]|[12][0-9]|3[01])$/.test(a):!0},message:"Please enter a proper date."},f.rules.number={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a):!0},message:"Please enter a number."},f.rules.digit={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^\d+$/.test(a):!0},message:"Please enter a digit."},f.rules.phoneUS={validator:function(a,b){return b?f.utils.isEmptyVal(a)?!0:"string"!=typeof a?!1:(a=a.replace(/\s+/g,""),b&&a.length>9&&a.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)):!0},message:"Please specify a valid phone number."},f.rules.equal={validator:function(a,b){var c=b;return a===f.utils.getValue(c)},message:"Values must equal."},f.rules.notEqual={validator:function(a,b){var c=b;return a!==f.utils.getValue(c)},message:"Please choose another value."},f.rules.unique={validator:function(a,b){var c=f.utils.getValue(b.collection),d=f.utils.getValue(b.externalValue),e=0;return a&&c?(g.arrayFilter(c,function(c){a===(b.valueAccessor?b.valueAccessor(c):c)&&e++}),(d?1:2)>e):!0},message:"Please make sure the value is unique."},function(){f.registerExtenders()}(),a.bindingHandlers.validationCore=function(){return{init:function(b,c){var d=f.utils.getConfigOptions(b),e=c();if(d.parseInputAttributes&&f.utils.async(function(){f.parseInputValidationAttributes(b,c)}),d.insertMessages&&f.utils.isValidatable(e)){var g=f.insertValidationMessage(b);d.messageTemplate?a.renderTemplate(d.messageTemplate,{field:e},null,g,"replaceNode"):a.applyBindingsToNode(g,{validationMessage:e})}d.writeInputAttributes&&f.utils.isValidatable(e)&&f.writeInputValidationAttributes(b,c),d.decorateInputElement&&f.utils.isValidatable(e)&&a.applyBindingsToNode(b,{validationElement:e})}}}(),f.makeBindingHandlerValidatable("value"),f.makeBindingHandlerValidatable("checked"),a.bindingHandlers.textInput&&f.makeBindingHandlerValidatable("textInput"),f.makeBindingHandlerValidatable("selectedOptions"),a.bindingHandlers.validationMessage={update:function(b,c){var d=c(),e=f.utils.getConfigOptions(b),i=(h(d),!1),j=!1;if(null===d||"undefined"==typeof d)throw new Error("Cannot bind validationMessage to undefined value. data-bind expression: "+b.getAttribute("data-bind"));i=d.isModified&&d.isModified(),j=d.isValid&&d.isValid();var k=null;(!e.messagesOnModified||i)&&(k=j?null:d.error);var l=!e.messagesOnModified||i?!j:!1,m="none"!==b.style.display;e.allowHtmlMessages?g.setHtml(b,k):a.bindingHandlers.text.update(b,function(){return k}),m&&!l?b.style.display="none":!m&&l&&(b.style.display="")}},a.bindingHandlers.validationElement={update:function(b,c,d){var e=c(),g=f.utils.getConfigOptions(b),i=(h(e),!1),j=!1;if(null===e||"undefined"==typeof e)throw new Error("Cannot bind validationElement to undefined value. data-bind expression: "+b.getAttribute("data-bind"));i=e.isModified&&e.isModified(),j=e.isValid&&e.isValid();var k=function(){var a={},b=!g.decorateElementOnModified||i?!j:!1;return a[g.errorElementClass]=b,a};a.bindingHandlers.css.update(b,k,d),g.errorsAsTitle&&a.bindingHandlers.attr.update(b,function(){var a=!g.errorsAsTitleOnModified||i,c=f.utils.getOriginalElementTitle(b);return a&&!j?{title:e.error,"data-orig-title":c}:!a||j?{title:c,"data-orig-title":null}:void 0})}},a.bindingHandlers.validationOptions=function(){return{init:function(a,b){var c=h(b());if(c){var d=j({},f.configuration);j(d,c),f.utils.setDomData(a,d)}}}}(),a.extenders.validation=function(a,b){return i(f.utils.isArray(b)?b:[b],function(b){f.addAnonymousRule(a,b)}),a},a.extenders.validatable=function(b,c){if(f.utils.isObject(c)||(c={enable:c}),"enable"in c||(c.enable=!0),c.enable&&!f.utils.isValidatable(b)){var d=f.configuration.validate||{},e={throttleEvaluation:c.throttle||d.throttle};b.error=a.observable(null),b.rules=a.observableArray(),b.isValidating=a.observable(!1),b.__valid__=a.observable(!0),b.isModified=a.observable(!1),b.isValid=a.computed(b.__valid__),b.setError=function(a){var c=b.error.peek(),d=b.__valid__.peek();b.error(a),b.__valid__(!1),c===a||d||b.isValid.notifySubscribers()},b.clearError=function(){return b.error(null),b.__valid__(!0),b};var g=b.subscribe(function(){b.isModified(!0)}),h=a.computed(j({read:function(){b(),b.rules();return f.validateObservable(b),!0}},e));j(h,e),b._disposeValidation=function(){b.isValid.dispose(),b.rules.removeAll(),g.dispose(),h.dispose(),delete b.rules,delete b.error,delete b.isValid,delete b.isValidating,delete b.__valid__,delete b.isModified,delete b.setError,delete b.clearError,delete b._disposeValidation}}else c.enable===!1&&b._disposeValidation&&b._disposeValidation();return b},f.validateObservable=function(a){for(var b,c,g=0,h=a.rules(),i=h.length;i>g;g++)if(c=h[g],!c.condition||c.condition())if(b=c.rule?f.rules[c.rule]:c,b.async||c.async)e(a,b,c);else if(!d(a,b,c))return!1;return a.clearError(),!0};var n,o={};f.defineLocale=function(a,b){return a&&b?(o[a.toLowerCase()]=b,b):null},f.locale=function(a){if(a){if(a=a.toLowerCase(),!o.hasOwnProperty(a))throw new Error("Localization "+a+" has not been loaded.");f.localize(o[a]),n=a}return n},f.localize=function(a){var b=f.rules;for(var c in a)b.hasOwnProperty(c)&&(b[c].message=a[c])},function(){var a={},b=f.rules;for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c].message);f.defineLocale("en-us",a)}(),n="en-us",a.applyBindingsWithValidation=function(b,c,d){var e,g=document.body;c&&c.nodeType?(g=c,e=d):e=c,f.init(),e&&(e=j(j({},f.configuration),e),f.utils.setDomData(g,e)),a.applyBindings(b,g)};var p=a.applyBindings;a.applyBindings=function(a,b){f.init(),p(a,b)},a.validatedObservable=function(b,c){if(!c&&!f.utils.isObject(b))return a.observable(b).extend({validatable:!0});var d=a.observable(b);return d.errors=f.group(f.utils.isObject(b)?b:{},c),d.isValid=a.observable(0===d.errors().length),a.isObservable(d.errors)?d.errors.subscribe(function(a){d.isValid(0===a.length)}):a.computed(d.errors).subscribe(function(a){d.isValid(0===a.length)}),d.subscribe(function(a){f.utils.isObject(a)||(a={}),d.errors._updateState(a),d.isValid(0===d.errors().length)}),d},function(b){b(a.validation)}(function(a){return a.defineLocale("ar-JO",{required:"مطلوب.",min:"أدخل قيمة اكبر من {0}.",max:"أدخل قيمة اقل من {0}.",minLength:"أدخل {0} احرف أو أكثر.",maxLength:"أدخل {0} أحرف أو أقل.",pattern:"قيمة غير صحيحة.",step:"يجب ان تضاف بمقدار {0}.",email:"صيغة البريد الالكتروني غير صحيحة.",date:"صيغة التاريخ غير صحيحة.",dateISO:"صيغة التاريخ غير صحيحة.",number:"يرجى إدخال رقم.",digit:"يرجى إدخال منزلة.",phoneUS:"صيغة رقم الهاتف غير صحيحة.",equal:"القيمة غير مساوية.",notEqual:"يرجى اختيار قيمة اخرى.",unique:"يرجى التحقق من عدم اختبار قيمة مشابهة."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("bg-BG",{required:"Моля, въведете стойност.",min:"Моля, въведете стойност по-голяма или равна на {0}.",max:"Моля, въведете стойност по-малка или равна на {0}.",minLength:"Моля, въведете поне {0} символа.",maxLength:"Моля, въведете по-малко от {0} символа.",pattern:"Моля, проверете тази стойност.",step:"Стойността трябва да се увеличава с {0}.",email:"Това не е валиден e-mail адрес.",date:"Моля, въведете валидна дата.",dateISO:"Моля, въведете валидна дата.",number:"Моля, въведете число.",digit:"Моля, въведете цифра.",phoneUS:"Моля, въведете валиден телефонен номер.",equal:"Стойностите трябва да са равни.",notEqual:"Моля, изберете различна стойност.",unique:"Моля, убедете се, че стойността е уникална."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("ca-ES",{required:"Aquest camp es obligatori",min:"Introduir un valor igual o major que {0}",max:"Introduir un valor menor o igual que {0}",minLength:"Ha de tenir un mínim de {0} caràcters",maxLength:"No pot tenir mes de {0} caràcters",pattern:"Si us plau, comproveu aquest campo",step:"El valor ha d'incrementar-se en {0}",email:"Aquesta no es una adreça de correu electrònic correcta",date:"Introduir una data correcta",dateISO:"Introduir una data correcta",number:"Ha de ser un nombre",digit:"Introduir un dígit",phoneUS:"Ha de ser un número de telèfon vàlid",equal:"Els valors han de ser iguals",notEqual:"Elegiu un altre valor",unique:"Ha de ser un valor únic"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("cs-CZ",{required:"Toto pole je povinné.",min:"Zadejte číslo větší nebo rovné {0}.",max:"Zadejte číslo menší nebo rovné {0}.",minLength:"Vložte alespoň {0} znaků.",maxLength:"Vložte nejvíce {0} znaků.",pattern:"Zkontrolujte formát pole.",step:"Hodnota musí být násobek {0}.",email:"Neplatná e-mailová adresa.",date:"Zadejte platné datum.",dateISO:"Zadejte platné datum.",number:"Zadejte číslo.",digit:"Zadejte číslice.",phoneUS:"Zadejte platné telefonní číslo.",equal:"Hodnoty musí být stejné.",notEqual:"Vyberte jinou hodnotu.",unique:"Zkontrolujte, zda hodnota je jedinečná."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("da-DK",{required:"Dette felt er påkrævet.",min:"Angiv en værdi der mindst er {0}.",max:"Angiv en værdi der højst er {0}.",minLength:"Indtast mindst {0} tegn.",maxLength:"Indtast højst {0} tegn.",pattern:"Tjek venligst denne værdi.",step:"Værdien skal stige med {0}",email:"Dette er ikke en gyldig e-mail-adresse",date:"Indtast en gyldig dato",dateISO:"Indtast en gyldig dato",number:"Indtast et tal",digit:"Indtast et ciffer",phoneUS:"Indtast et gyldigt telefonnummer",equal:"Indtast den samme værdi igen.",notEqual:"Indtast en anden værdi.",unique:"Sørg for at værdien er unik."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("de-DE",{required:"Dieses Feld ist erforderlich.",min:"Bitte geben Sie einen Wert größer oder gleich {0} ein.",max:"Bitte geben Sie einen Wert kleiner oder gleich {0} ein.",minLength:"Bitte geben Sie mindestens {0} Zeichen ein.",maxLength:"Bitte geben Sie nicht mehr als {0} Zeichen ein.",pattern:"Bitte überprüfen Sie diesen Wert.",step:"Der Wert muss um {0} erhöht werden.",email:"Das ist keine gültige Email-Adresse.",date:"Bitte geben Sie ein gültiges Datum ein.",dateISO:"Bitte geben Sie ein gültiges Datum ein.",number:"Bitte geben Sie eine Zahl ein.",digit:"Bitte geben Sie eine Ziffer ein.",phoneUS:"Bitte geben Sie eine gültige Telefonnummer ein.",equal:"Die Werte müssen übereinstimmen.",notEqual:"Bitte wählen Sie einen anderen Wert.",unique:"Bitte stellen Sie sicher, dass der Wert eindeutig ist."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("el-GR",{required:"Το πεδίο αυτό είναι υποχρεωτικό.",min:"Παρακαλώ εισάγετε μια τιμή μεγαλύτερη ή ίση από {0}.",max:"Παρακαλώ εισάγετε μια τιμή μικρότερη ή ίση από {0}.",minLength:"Παρακαλώ εισάγετε τουλάχιστον {0} χαρακτήρες.",maxLength:"Παρακαλώ εισάγετε το πολύ {0} χαρακτήρες.",pattern:"Παρακαλώ ελέγξτε την τιμή αυτή.",step:"Η τιμή πρέπει να αυξηθεί κατά {0}",email:"Η διεύθυνση email δεν έχει έγκυρη μορφή",date:"Παρακαλώ εισάγετε μια έγκυρη ημερομηνία",dateISO:"Παρακαλώ εισάγετε μια έγκυρη ημερομηνία",number:"Παρακαλώ εισάγετε έναν αριθμό",digit:"Παρακαλώ εισάγετε ένα ψηφίο",phoneUS:"Παρακαλώ εισάγετε έναν σωστό αριθμό τηλεφώνου",equal:"Οι τιμές πρέπει να είναι ίσες",notEqual:"Παρακαλώ επιλέξτε μια άλλη τιμή.",unique:"Παρακαλώ βεβαιωθείτε ότι η τιμή είναι μοναδική."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("es-ES",{required:"Este campo es obligatorio",min:"Por favor, introduzca un valor igual o mayor a {0}",max:"Por favor, introduzca un valor menor o igual a {0}",minLength:"Por favor, introduzca al menos {0} caracteres",maxLength:"Por favor, no introduzca más de {0} caracteres",pattern:"Por favor, compruebe este campo",step:"El valor debe incrementarse por {0}",email:"Este no es una dirección de email correcta",date:"Por favor, introduzca una fecha correcta",dateISO:"Por favor, introduzca una fecha correcta",number:"Por favor, introduzca un número",digit:"Por favor, introduzca un dígito",phoneUS:"Por favor, introduzca un número de teléfono válido para EEUU",equal:"Los valores deben ser iguales",notEqual:"Por favor, elija otro valor",unique:"Por favor, asegurese de que el valor sea único"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("fa-IR",{required:"تکمیل این فیلد اجباری است.",min:"لطفاً مقداری بزرگتر یا برابر {0} وارد نمائید.",max:"لطفاً مقداری کوچکتر یا برابر {0} وارد نمائید.",minLength:"لطفاً حداقل {0} حرف وارد نمائید.",maxLength:"لطفاً حداکثر {0} حرف وارد نمائید.",pattern:"لطفاً یک مقدار معتبر وارد نمائید.",step:"مقدار باید با {0} افزایش پبدا کند.",email:"لطفاً یک آدرس ایمیل معتبر وارد نمائید.",date:"لطفاً یک تاریخ معتبر وارد نمائید.",dateISO:"لطفاً یک تاریخ معتبر وارد نمائید.",number:"لطفاً یک عدد وارد نمائید.",digit:"لطفاً یک عدد وارد نمائید.",phoneUS:"لطفاً یک شماره تماس معتبر وارد نمائید.",equal:"مقدارها باید برابر باشند.",notEqual:"لطفاً یک مقدار دیگر وارد نمائید.",unique:"لطفاً یک مقدار منحصربه فرد وارد نمائید."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("fr-FR",{required:"Ce champ est obligatoire.",min:"Veuillez saisir une valeur supérieure ou égale à {0}.",max:"Veuillez saisir une valeur inférieure ou égale à {0}.",minLength:"Veuillez saisir au moins {0} caractères.",maxLength:"Veuillez saisir au plus {0} caractères.",pattern:"Veuillez corriger ce champ.",step:"Le pas d'incrémentation de la valeur doit être de {0}.",email:"Ceci n'est pas une adresse électronique valide.",date:"Veuillez saisir une date valide.",dateISO:"Veuillez saisir une date (ISO) valide.",number:"Veuillez saisir un nombre.",digit:"Veuillez saisir un chiffre.",phoneUS:"Veuillez saisir un numéro de téléphone valide.",equal:"Les valeurs doivent être égales.",notEqual:"Veuillez saisir une autre valeur.",unique:"Veuillez vérifier que la valeur est unique."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("he-IL",{required:"שדה נדרש",min:"אנא הכנס ערך גדול יותר או שווה ל- {0}",max:"אנא הכנס ערך קטן יותר או שווה ל- {0}",minLength:"אנא הכנס לפחות {0} תווים",maxLength:"אנא הכנס לא יותר מאשר {0} תווים",pattern:"אנא בדוק את הערך הזה",step:"הערך צריך להשתנות ב - {0}",email:'אנא הכנס כתובת דוא"ל חוקית',date:"אנא הכנס תאריך תקין",dateISO:"אנא הכנס תאריך תקין",number:"אנא הכנס מספר",digit:"אנא הכנס ספרה",phoneUS:"אנא הכנס מספר טלפון תקין",equal:"ערכים חייבים להיות שווים",notEqual:"אנא בחר ערך שונה",unique:"אנא וודא שהערך ייחודי"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("hr-HR",{required:"Ovo polje je obavezno.",min:"Unesena vrijednost mora biti jednaka ili veća od {0}.",max:"Unesena vrijednost mora biti jednaka ili manja od {0}.",minLength:"Minimalna dužina polja je {0} znakova.",maxLength:"Maksimalna dužina polja je {0} znakova.",pattern:"Unesena vrijednost nije ispravnog formata.",step:"Vrijednost se mora povećavati za {0}.",email:"Potrebno je unijeti ispravnu e-mail adresu.",date:"Potrebno je unijeti ispravan datum.",dateISO:"Potrebno je unijeti ispravan datum.",number:"Unesena vrijednost mora biti broj.",digit:"Unesena vrijednost mora biti znamenka.",phoneUS:"Potrebno je unijeti ispravan broj telefona.",equal:"Vrijednosti moraju biti jednake.",notEqual:"Unesite drugu vrijednost.",unique:"Unesena vrijednost mora biti jedinstvena."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("hu-HU",{required:"Kötelezõ megadni.",min:"Nem lehet kisebb, mint {0}.",max:"Nem lehet nagyobb, mint {0}.",minLength:"Legalább {0} karaktert adjon meg.",maxLength:"Legfeljebb {0} karaktert adjon meg.",pattern:"Kérem ellenõrizze ezt az értéket.",step:"Az értéknek {0} értékkel kell növekednie.",email:"A megadott email cím nem érvényes.",date:"A megadott dátum nem érvényes.",dateISO:"A megadott dátum nem érvényes.",number:"Kérem számot adjon meg.",digit:"Kérem számjegyet adjon meg.",phoneUS:"Kérem, hogy érvényes telefonszámot adjon meg.",equal:"Az értékeknek meg kel egyezniük.",notEqual:"Az értékeknek különbözniük kell.",unique:"Az értéknek egyedieknek kell lennie."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("it-IT",{required:"Il campo è obbligatorio.",min:"Inserire un valore superiore od uguale a {0}.",max:"Inserire un valore inferiore od uguale a {0}.",minLength:"Inserire almeno {0} caratteri.",maxLength:"Inserire al massimo {0} caratteri.",pattern:"Controllare il valore inserito.",step:"Il valore deve essere incrementato di {0}.",email:"Indirizzo email non valido.",date:"Inserire una data valida.",dateISO:"Inserire una data valida.",number:"Inserire un valore numerico.",digit:"Inserire una cifra.",phoneUS:"Specificare un numero di telefono valido.",equal:"I valori devono essere uguali.",notEqual:"Il valore deve essere differente.",unique:"Il valore deve essere univoco."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("ja-JP",{required:"このフィールドは必須入力項目です。",min:"{0}以上の値を入力してください。",max:"{0}以下の値を入力してください。",minLength:"{0}文字以上の文字を入力してください。",maxLength:"{0}文字以下の文字数にしてください。",pattern:"入力値を確認してください。",step:"この値は{0}で増加します。",email:"適切なe-mailアドレスではありません。",date:"適切な日付を入力してください。",dateISO:"適切な日付を入力してください。",number:"数字を入力してください。",digit:"数値を入力してください。",phoneUS:"有効な電話番号を指定してください。",equal:"同一の値にしてください。",notEqual:"他の値を選択してください。",unique:"一意の値であることを確認してください。"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("ko-KR",{required:"필수 입력항목입니다.",min:"{0}보다 큰 값을 입력해 주십시오.",max:"{0}보다 작은 값을 입력해 주십시오.",minLength:"{0}글자 이상으로 입력해 주십시오.",maxLength:"{0}글자 이하로 입력해 주십시오.",pattern:"입력한 값의 형식이 올바르지 않습니다.",step:"이 값은 반드시 {0}씩 증가해야 합니다.",email:"올바른 이메일 주소 형식이 아닙니다.",date:"올바른 날짜 형식이 아닙니다.",dateISO:"올바른 날짜 형식이 아닙니다.",number:"숫자를 입력해 주십시오.",digit:"숫자를 입력해 주십시오.",phoneUS:"올바른 전화번호 형식이 아닙니다.",equal:"같은 값을 입력해 주십시오.",notEqual:"다른 값을 선택해 주십시오.",unique:"고유한 값인지 확인해 주십시오."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("lv-LV",{required:"Lauks ir obligāts.",min:"Lūdzu, ievadiet vērtību lielāku vai vienādu ar {0}.",max:"Lūdzu, ievadiet vērtību mazāku vai vienādu par {0}.",minLength:"Lūdzu, ievadiet vismaz {0} simbolus.",maxLength:"Lūdzu, ievadiet ne vairāk kā {0} simbolus.",pattern:"Lūdzu, pārbaudiet norādītās vērtības formātu.",step:"Norādītām vērtībām jābūt pieaugošām ar soli {0}",email:"Norādītā e-pasta adrese neatbilst formātam",date:"Lūdzu, norādiet atbilstošu datuma formātu.",dateISO:"Lūdzu, norādiet atbilstošu datuma formātu.",number:"Lūdzu, ievadiet numuru.",digit:"Lūdzu, ievadiet ciparu.",phoneUS:"Lūdzu, norādiet formātam atbilstošu telefona numuru.",equal:"Norādītām vērtībām jābūt vienādām.",notEqual:"Norādītās vērtības nav vienādas.",unique:"Vērtībai jābūt unikālai."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("nb-NO",{required:"Dette feltet er obligatorisk",min:"Fyll inn en verdi som er større eller lik {0}",max:"Fyll inn en verdi som er mindre eller lik {0}",minLength:"Fyll inn minst {0} tegn",maxLength:"Fyll inn færre enn {0} tegn",pattern:"Vennligst kontrollér verdien",step:"Verdien må økes med {0}",email:"Dette er ikke en korrekt e-postadresse",date:"Fyll inn en korrekt dato",dateISO:"Fyll inn en korrekt dato",number:"Fyll inn ett nummer",digit:"Fyll inn ett siffer",phoneUS:"Vennlist spesifiser ett korrekt telefonnummer",equal:"Verdiene må være like",notEqual:"Vennligst velg en annen verdi",unique:"Vennligst sørg for at verdien er unik"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("nl-BE",{required:"Dit veld is verplicht.",min:"Vul een waarde in groter dan of gelijk aan {0}.",max:"Vul een waarde in kleiner dan of gelijk aan {0}.",minLength:"Vul ten minste {0} tekens in.",maxLength:"Vul ten hoogste {0} tekens in.",pattern:"Vul een correcte waarde in.",step:"Vul een waarde in die deelbaar is door {0}.",email:"Vul een correct e-mailadres in.",date:"Vul een correcte datum in.",dateISO:"Vul een correcte datum in.",number:"Vul een getal in.",digit:"Vul een cijfer in.",phoneUS:"Vul een geldig telefoonnummer in.",equal:"Waarden moeten gelijk zijn.",notEqual:"Vul een andere waarde in.",unique:"Vul een unieke waarde in."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("nl-NL",{required:"Dit veld is verplicht.",min:"Vul een waarde in groter of gelijk aan {0}.",max:"Vul een waarde in kleiner of gelijk aan {0}.",minLength:"Vul ten minste {0} tekens in.",maxLength:"Vul ten hoogste {0} tekens in.",pattern:"Vul een correcte waarde in.",step:"Vul een waarde in die deelbaar is door {0}.",email:"Vul een correct e-mailadres in.",date:"Vul een correcte datum in.",dateISO:"Vul een correcte datum in.",number:"Vul een getal in.",digit:"Vul een cijfer in.",phoneUS:"Vul een geldig telefoonnummer in.",equal:"Waarden moeten gelijk zijn.",notEqual:"Vul een andere waarde in.", unique:"Vul een unieke waarde in."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("pl-PL",{required:"To pole jest wymagane.",min:"Wprowadź liczbę więszką lub równą {0}.",max:"Wprowadź liczbę mniejszą lub równą {0}.",minLength:"Wprowadź co najmniej {0} znaków.",maxLength:"Wprowadź co najwyżej {0} znaków.",pattern:"Sprawdź to pole.",step:"Wartość musi być wielokrotnością {0}.",email:"Wprowadź poprawny adres e-mail.",date:"Wprowadź poprawną datę.",dateISO:"Wprowadź poprawną datę.",number:"Wprowadź liczbę.",digit:"Wprowadź cyfrę.",phoneUS:"Wprowadź poprawny numer telefonu.",equal:"Wartości muszą być równe.",notEqual:"Wybierz inną wartość.",unique:"Sprawdź czy wartość jest unikalna."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("pt-BR",{required:"Este campo é obrigatório.",min:"Por favor, informe um valor maior ou igual a {0}.",max:"Por favor, informe um valor menor ou igual a {0}.",minLength:"Por favor, informe ao menos {0} caracteres.",maxLength:"Por favor, informe no máximo {0} caracteres.",pattern:"Por favor, verifique este valor",step:"O valor deve ser incrementado por {0}",email:"Por favor, informe um e-mail válido.",date:"Por favor, informe uma data válida.",dateISO:"Por favor, informe uma data válida (ISO).",number:"Por favor, informe um número válido.",digit:"Por favor, utilize somente dígitos.",phoneUS:"Por favor, informe um telefone válido",equal:"Os valores devem ser iguais",notEqual:"Por favor, informe outro valor",unique:"Verifique se o valor é único"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("pt-PT",{required:"Este campo é obrigatório.",min:"Por favor, introduza um valor maior ou igual a {0}.",max:"Por favor, introduza um valor menor ou igual a {0}.",minLength:"Por favor, introduza pelo menos {0} caracteres.",maxLength:"Por favor, introduza no máximo {0} caracteres.",pattern:"Por favor, verifique este valor",step:"O valor deve ser incrementado por {0}",email:"Por favor, introduza um e-mail válido.",date:"Por favor, introduza uma data válida.",dateISO:"Por favor, introduza uma data válida (ISO).",number:"Por favor, introduza um número válido.",digit:"Por favor, utilize somente dígitos.",phoneUS:"Por favor, introduza um telefone válido",equal:"Os valores devem ser iguais",notEqual:"Por favor, introduza outro valor",unique:"Verifique se o valor é único"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("ro-RO",{required:"Acest câmp este obligatoriu.",min:"Introduceţi un număr mai mare sau egal cu {0}.",max:"Introduceţi un număr mai mic sau egal cu {0}.",minLength:"Introduceţi cel puţin {0} caractere.",maxLength:"Introduceţi maxim {0} caractere.",pattern:"Verificaţi această valoare.",step:"Valoarea trebuie să crească cu {0}.",email:"Adresa de email nu este validă.",date:"Vă rugăm introduceţi o dată validă.",dateISO:"Vă rugăm introduceţi o dată validă.",number:"Introduceţi un număr.",digit:"Introduceţi o cifră.",phoneUS:"Vă rugăm să specificați un număr de telefon valid.",equal:"Valorile trebuie să fie egale.",notEqual:"Vă rugăm să alegeți o altă valoare.",unique:"Vă rugăm să vă asigurați că valoarea este unică."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("ru-RU",{required:"Пожалуйста, заполните это поле.",min:"Пожалуйста, введите число большее или равное {0}.",max:"Пожалуйста, введите число меньшее или равное {0}.",minLength:"Пожалуйста, введите по крайней мере {0} символов.",maxLength:"Пожалуйста, введите не больше чем {0} символов.",pattern:"Пожалуйста, проверьте это поле.",step:"Значение должно быть кратным {0}",email:"Пожалуйста, укажите здесь правильный адрес электронной почты",date:"Пожалуйста, введите правильную дату",dateISO:"Пожалуйста, введите правильную дату в формате ISO",number:"Пожалуйста, введите число",digit:"Пожалуйста, введите цифры",phoneUS:"Пожалуйста, укажите правильный телефонный номер",equal:"Значения должны быть равны",notEqual:"Пожалуйста, выберите другое значение.",unique:"Пожалуйста, укажите уникальное значение."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("sv-SE",{required:"Detta fält är obligatoriskt",min:"Fyll i ett värde som är större än eller lika med {0}",max:"Fyll i ett värde som är mindre än eller lika med {0}",minLength:"Fyll i minst {0} tecken",maxLength:"Fyll inte i fler än {0} tecken",pattern:"Var god kontrollera värdet",step:"Värdet måste ökas med {0}",email:"Fyll i en korrekt e-postadress",date:"Fyll i ett korrekt datum",dateISO:"Fyll i ett korrekt datum",number:"Fyll i ett nummer",digit:"Fyll i en siffra",phoneUS:"Fyll i ett korrekt telefonnummer",equal:"Fyll i samma värde en gång till",notEqual:"Fyll i ett annat värde",unique:"Fyll i ett unikt värde"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("tr-TR",{required:"Bu alanın doldurulması zorunludur.",min:"Lütfen {0} veya daha yüksek değer giriniz.",max:"Lütfen {0} veya daha düşük değer giriniz.",minLength:"Lütfen en az {0} karakter giriniz.",maxLength:"Lütfen en fazla {0} karakter giriniz.",pattern:"Lütfen bu alanı kontrol ediniz.",step:"Değer {0} arttırılmalı.",email:"Bu geçerli bir E-Mail adresi değil.",date:"Lütfen geçerli bir tarih giriniz.",dateISO:"Lütfen geçerli bir tarih giriniz.",number:"Lütfen bir sayı değeri giriniz.",digit:"Lütfen bir rakam değeri giriniz.",phoneUS:"Lütfen geçerli bir telefon numarası giriniz.",equal:"Değerler eşit olmalıdır.",notEqual:"Lütfen farklı bir değer seçiniz.",unique:"Lütfen değerin farklı olduğunu kontrol ediniz."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("uk-UA",{required:"Будь ласка, заповніть це поле.",min:"Будь ласка, введіть число більше або рівне {0}.",max:"Будь ласка, введіть число менше або рівне {0}.",minLength:"Будь ласка, введіть принаймні {0} символів.",maxLength:"Будь ласка, введіть не більше як {0} символів.",pattern:"Будь ласка, перевірте це поле.",step:"Значення має бути кратним {0}",email:"Будь ласка, вкажіть тут правильну адресу електронної пошти",date:"Будь ласка, введіть правильну",dateISO:"Будь ласка, введіть правильну дату у форматі ISO",number:"Будь ласка, введіть число",digit:"Будь ласка, введіть цифри",phoneUS:"Будь ласка, вкажіть правильний телефонний номер",equal:"Значення повинні бути рівні",notEqual:"Будь ласка, виберіть інше значення.",unique:"Будь ласка, вкажіть унікальне значення."})}),function(b){b(a.validation)}(function(a){return a.defineLocale("zh-CN",{required:"必填字段",min:"输入值必须大于等于 {0}",max:"输入值必须小于等于 {0}",minLength:"至少输入 {0} 个字符",maxLength:"输入的字符数不能超过 {0} 个",pattern:"请检查此值",step:"每次步进值是 {0}",email:"email地址格式不正确",date:"日期格式不正确",dateISO:"日期格式不正确",number:"请输入一个数字",digit:"请输入一个数字",phoneUS:"请输入一个合法的手机号(US)",equal:"输入值不一样",notEqual:"请选择另一个值",unique:"此值应该是唯一的"})}),function(b){b(a.validation)}(function(a){return a.defineLocale("zh-TW",{required:"此欄位為必填欄位",min:"輸入值必須大於等於 {0}",max:"輸入值必須小於等於 {0}",minLength:"請至少輸入 {0} 個字元",maxLength:"最大長度為 {0} 個字元",pattern:"請檢查此值",step:"每次遞增值是 {0}",email:"email格式不正確",date:"日期格式不正確",dateISO:"日期格式不正確",number:"請輸入一組數字",digit:"請輸入一組數字",phoneUS:"請輸入一組有效的電話號碼(US)",equal:"兩次輸入值不相同",notEqual:"請選擇其他數值",unique:"請確認此值為唯一值"})})}); //# sourceMappingURL=knockout.validation-with-locales.min.js.map \ No newline at end of file diff --git a/dist/knockout.validation-with-locales.min.js.map b/dist/knockout.validation-with-locales.min.js.map index ae74887e..e41e5a06 100644 --- a/dist/knockout.validation-with-locales.min.js.map +++ b/dist/knockout.validation-with-locales.min.js.map @@ -1 +1 @@ -{"version":3,"file":"knockout.validation-with-locales.min.js","sources":["knockout.validation-with-locales.js"],"names":["factory","require","exports","module","define","ko","validation","minMaxValidatorFactory","validatorName","isMaxValidation","val","options","kv","utils","isEmptyVal","comparisonValue","type","undefined","typeAttr","value","isNaN","Date","regex","valMatches","comparisonValueMatches","toLowerCase","match","Error","parseFloat","validateSync","observable","rule","ctx","validator","params","unwrap","setError","formatMessage","message","validateAsync","isValidating","callBack","valObj","isValid","msg","__valid__","error","async","koUtils","unwrapObservable","forEach","arrayForEach","extend","defaults","registerExtenders","messagesOnModified","errorsAsTitle","errorsAsTitleOnModified","messageTemplate","insertMessages","parseInputAttributes","writeInputAttributes","decorateInputElement","decorateElementOnModified","errorClass","errorElementClass","errorMessageClass","allowHtmlMessages","grouping","deep","live","validate","configuration","html5Attributes","html5InputTypes","reset","seedId","getTime","domData","domDataKey","isArray","o","Object","prototype","toString","call","isObject","isNumber","isObservableArray","instance","values","r","i","hasOwnProperty","push","getValue","hasAttribute","node","attr","getAttribute","element","setAttribute","isValidatable","rules","isModified","insertAfter","newNode","parentNode","insertBefore","nextSibling","newId","getConfigOptions","contextFor","setDomData","data","key","getDomData","nodeType","context","getOriginalElementTitle","savedOriginalTitle","currentTitle","title","hasSavedOriginalTitle","expr","window","setImmediate","setTimeout","object","callback","prop","api","cleanUpSubscriptions","subscriptions","subscription","dispose","flagged","obj","__kv_traversed","length","runTraversal","validatables","traverseGraph","level","objValues","peek","isObservable","errors","validatable","subscribe","graphMonitor","valueHasMutated","_destroy","isComputed","collectErrors","array","isInitialized","init","force","group","result","computed","showAllMessages","show","isAnyMessageShown","invalidAndModifiedPresent","find","filter","predicate","arrayFilter","arrayFirst","map","mapping","item","arrayMap","_updateState","newValue","replacements","replace","index","addRule","hasRule","addAnonymousRule","ruleObj","onlyIf","condition","addExtender","ruleName","extenders","insertValidationMessage","span","document","createElement","className","parseInputValidationAttributes","valueAccessor","parseInt","currentType","writeInputValidationAttributes","contexts","read","RegExp","source","disposeWhenNodeIsRemoved","makeBindingHandlerValidatable","handlerName","bindingHandlers","allBindingsAccessor","viewModel","bindingContext","setRules","target","definition","ruleDefinitions","targetValue","unwrappedTargetValue","nonRules","required","testVal","String","trim","minLength","normalizedVal","maxLength","step","dif","Math","abs","test","phoneNumber","otherValue","c","collection","external","externalValue","counter","config","validationMessageElement","renderTemplate","field","applyBindingsToNode","validationMessage","validationElement","textInput","update","obsv","isVisible","isCurrentlyVisible","style","display","setHtml","text","cssSettingsAccessor","css","shouldShow","hasModification","data-orig-title","newConfig","enable","validationOptions","throttleEvaluation","throttle","observableArray","previousError","previousIsValid","notifySubscribers","clearError","h_change","h_obsValidationTrigger","validateObservable","_disposeValidation","removeAll","ruleContexts","len","_currentLocale","_locales","defineLocale","name","locale","localize","msgTranslations","localeData","applyBindingsWithValidation","rootNode","body","applyBindings","origApplyBindings","validatedObservable","initialValue","min","max","pattern","email","date","dateISO","number","digit","phoneUS","equal","notEqual","unique"],"mappings":";;;;;;;;;CAUC,SAAUA,GAGa,kBAAZC,UAA6C,gBAAZC,UAA0C,gBAAXC,QAE1EH,EAAQC,QAAQ,YAAaC,SACD,kBAAXE,SAAyBA,OAAY,IAEtDA,QAAQ,WAAY,WAAYJ,GAGhCA,EAAQK,GAAIA,GAAGC,gBAEf,SAAWD,EAAIH,GAsuBjB,QAASK,GAAuBC,GAC5B,GAAIC,GAAoC,QAAlBD,CAEtB,OAAO,UAAUE,EAAKC,GAClB,GAAIC,EAAGC,MAAMC,WAAWJ,GACpB,OAAO,CAGX,IAAIK,GAAiBC,CACIC,UAArBN,EAAQO,UAGRF,EAAO,OACPD,EAAkBJ,IAElBK,EAAOL,EAAQO,SACfH,EAAkBJ,EAAQQ,OAKzBC,MAAML,IAAsBA,YAA2BM,QACxDL,EAAO,SAGX,IAAIM,GAAOC,EAAYC,CACvB,QAAQR,EAAKS,eACT,IAAK,OAGD,GAFAH,EAAQ,qBACRC,EAAab,EAAIgB,MAAMJ,GACJ,OAAfC,EACA,KAAM,IAAII,OAAM,qBAAuBnB,EAAgB,gIAK3D,OAFAgB,GAAyBT,EAAgBW,MAAMJ,GAE1CE,EAIDf,EACQc,EAAW,GAAKC,EAAuB,IAEzCD,EAAW,KAAOC,EAAuB,IAAQD,EAAW,IAAMC,EAAuB,GAEvFD,EAAW,GAAKC,EAAuB,IAEzCD,EAAW,KAAOC,EA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UAAW,eACXE,UAAW,mBACXoE,QAAS,QACTnE,KAAM,aACNoE,MAAO,eACPC,KAAM,UACNC,QAAS,UACTC,OAAQ,UACRC,MAAO,UACPC,QAAS,kBACTC,MAAO,SACPC,SAAU,UACVC,OAAQ,eAMf,SAAS5S,GACNA,EAAQK,EAAGC,aACb,SAASM,GACP,MAAOA,GAAGwQ,aAAa,SACnB3D,SAAU,WACVwE,IAAK,gBACLC,IAAK,gBACLrE,UAAW,gBACXE,UAAW,gBACXoE,QAAS,QACTnE,KAAM,aACNoE,MAAO,aACPC,KAAM,UACNC,QAAS,UACTC,OAAQ,UACRC,MAAO,UACPC,QAAS,mBACTC,MAAO,WACPC,SAAU,UACVC,OAAQ"} \ No newline at end of file +{"version":3,"file":"knockout.validation-with-locales.min.js","sources":["knockout.validation-with-locales.js"],"names":["factory","require","exports","module","define","ko","validation","minMaxValidatorFactory","validatorName","isMaxValidation","val","options","kv","utils","isEmptyVal","comparisonValue","type","undefined","typeAttr","value","isNaN","Date","regex","valMatches","comparisonValueMatches","toLowerCase","match","Error","parseFloat","validateSync","observable","rule","ctx","validator","params","unwrap","setError","formatMessage","message","validateAsync","isValidating","callBack","valObj","isValid","msg","__valid__","error","async","koUtils","unwrapObservable","forEach","arrayForEach","extend","defaults","registerExtenders","messagesOnModified","errorsAsTitle","errorsAsTitleOnModified","messageTemplate","insertMessages","parseInputAttributes","writeInputAttributes","decorateInputElement","decorateElementOnModified","errorClass","errorElementClass","errorMessageClass","allowHtmlMessages","grouping","deep","live","validate","configuration","html5Attributes","html5InputTypes","reset","seedId","getTime","domData","domDataKey","isArray","o","Object","prototype","toString","call","isObject","isNumber","isObservableArray","instance","values","r","i","hasOwnProperty","push","getValue","hasAttribute","node","attr","getAttribute","element","setAttribute","isValidatable","rules","isModified","insertAfter","newNode","parentNode","insertBefore","nextSibling","newId","getConfigOptions","contextFor","setDomData","data","key","getDomData","nodeType","context","getOriginalElementTitle","savedOriginalTitle","currentTitle","title","hasSavedOriginalTitle","expr","window","setImmediate","setTimeout","object","callback","prop","api","cleanUpSubscriptions","subscriptions","subscription","dispose","flagged","obj","__kv_traversed","length","runTraversal","validatables","traverseGraph","level","objValues","peek","isObservable","errors","validatable","subscribe","graphMonitor","valueHasMutated","_destroy","isComputed","collectErrors","array","isInitialized","init","force","group","result","computed","showAllMessages","show","isAnyMessageShown","invalidAndModifiedPresent","find","filter","predicate","arrayFilter","arrayFirst","map","mapping","item","arrayMap","_updateState","newValue","replacements","replace","index","addRule","hasRule","addAnonymousRule","ruleObj","onlyIf","condition","addExtender","ruleName","extenders","insertValidationMessage","span","document","createElement","className","parseInputValidationAttributes","valueAccessor","parseInt","currentType","writeInputValidationAttributes","contexts","read","RegExp","source","disposeWhenNodeIsRemoved","makeBindingHandlerValidatable","handlerName","bindingHandlers","allBindingsAccessor","viewModel","bindingContext","setRules","target","definition","ruleDefinitions","targetValue","unwrappedTargetValue","nonRules","required","testVal","String","trim","minLength","normalizedVal","maxLength","step","dif","Math","abs","test","phoneNumber","otherValue","c","collection","external","externalValue","counter","config","validationMessageElement","renderTemplate","field","applyBindingsToNode","validationMessage","validationElement","textInput","update","obsv","isVisible","isCurrentlyVisible","style","display","setHtml","text","cssSettingsAccessor","css","shouldShow","hasModification","data-orig-title","newConfig","enable","validationOptions","throttleEvaluation","throttle","observableArray","previousError","previousIsValid","notifySubscribers","clearError","h_change","h_obsValidationTrigger","validateObservable","_disposeValidation","removeAll","ruleContexts","len","_currentLocale","_locales","defineLocale","name","locale","localize","msgTranslations","localeData","applyBindingsWithValidation","rootNode","body","applyBindings","origApplyBindings","validatedObservable","initialValue","min","max","pattern","email","date","dateISO","number","digit","phoneUS","equal","notEqual","unique"],"mappings":";;;;;;;;;CAUC,SAAUA,GAGa,kBAAZC,UAA6C,gBAAZC,UAA0C,gBAAXC,QAE1EH,EAAQC,QAAQ,YAAaC,SACD,kBAAXE,SAAyBA,OAAY,IAEtDA,QAAQ,WAAY,WAAYJ,GAGhCA,EAAQK,GAAIA,G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QK,EAAGC,aACb,SAASM,GACP,MAAOA,GAAGwQ,aAAa,SACnB3D,SAAU,qCACVwE,IAAK,6CACLC,IAAK,4CACLrE,UAAW,qCACXE,UAAW,wCACXoE,QAAS,kCACTnE,KAAM,0BACNoE,MAAO,sCACPC,KAAM,oCACNC,QAAS,oCACTC,OAAQ,kCACRC,MAAO,mCACPC,QAAS,+CACTC,MAAO,2BACPC,SAAU,mCACVC,OAAQ,qDAMf,SAAS5S,GACNA,EAAQK,EAAGC,aACb,SAASM,GACV,MAAOA,GAAGwQ,aAAa,SACnB3D,SAAU,iCACVwE,IAAK,kDACLC,IAAK,iDACLrE,UAAW,8CACXE,UAAW,iDACXoE,QAAS,iCACTnE,KAAM,gCACNoE,MAAO,6DACPC,KAAM,gCACNC,QAAS,mDACTC,OAAQ,4BACRC,MAAO,4BACPC,QAAS,kDACTC,MAAO,8BACPC,SAAU,sCACVC,OAAQ,8CAMZ,SAAS5S,GACNA,EAAQK,EAAGC,aACb,SAASM,GACP,MAAOA,GAAGwQ,aAAa,SACnB3D,SAAU,OACVwE,IAAK,gBACLC,IAAK,gBACLrE,UAAW,eACXE,UAAW,mBACXoE,QAAS,QACTnE,KAAM,aACNoE,MAAO,eACPC,KAAM,UACNC,QAAS,UACTC,OAAQ,UACRC,MAAO,UACPC,QAAS,kBACTC,MAAO,SACPC,SAAU,UACVC,OAAQ,eAMf,SAAS5S,GACNA,EAAQK,EAAGC,aACb,SAASM,GACP,MAAOA,GAAGwQ,aAAa,SACnB3D,SAAU,WACVwE,IAAK,gBACLC,IAAK,gBACLrE,UAAW,gBACXE,UAAW,gBACXoE,QAAS,QACTnE,KAAM,aACNoE,MAAO,aACPC,KAAM,UACNC,QAAS,UACTC,OAAQ,UACRC,MAAO,UACPC,QAAS,mBACTC,MAAO,WACPC,SAAU,UACVC,OAAQ"} \ No newline at end of file diff --git a/dist/knockout.validation.js b/dist/knockout.validation.js index d2ec54cf..730482ee 100644 --- a/dist/knockout.validation.js +++ b/dist/knockout.validation.js @@ -740,7 +740,7 @@ kv.rules['required'] = { validator: function (val, required) { var testVal; - if (val === undefined || val === null) { + if (val === undefined || val === null || val === false) { return !required; } diff --git a/dist/knockout.validation.min.js b/dist/knockout.validation.min.js index ca1cb2b0..c8c13f4c 100644 --- a/dist/knockout.validation.min.js +++ b/dist/knockout.validation.min.js @@ -7,5 +7,5 @@ =============================================================================== */ -!function(a){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?a(require("knockout"),exports):"function"==typeof define&&define.amd?define(["knockout","exports"],a):a(ko,ko.validation={})}(function(a,b){function c(a){var b="max"===a;return function(c,d){if(f.utils.isEmptyVal(c))return!0;var e,g;void 0===d.typeAttr?(g="text",e=d):(g=d.typeAttr,e=d.value),isNaN(e)||e instanceof Date||(g="number");var h,i,j;switch(g.toLowerCase()){case"week":if(h=/^(\d{4})-W(\d{2})$/,i=c.match(h),null===i)throw new Error("Invalid value for "+a+" attribute for week input. Should look like '2000-W33' http://www.w3.org/TR/html-markup/input.week.html#input.week.attrs.min");return j=e.match(h),j?b?i[1]j[1]||i[1]===j[1]&&i[2]>=j[2]:!1;case"month":if(h=/^(\d{4})-(\d{2})$/,i=c.match(h),null===i)throw new Error("Invalid value for "+a+" attribute for month input. Should look like '2000-03' http://www.w3.org/TR/html-markup/input.month.html#input.month.attrs.min");return j=e.match(h),j?b?i[1]j[1]||i[1]===j[1]&&i[2]>=j[2]:!1;case"number":case"range":return b?!isNaN(c)&&parseFloat(c)<=parseFloat(e):!isNaN(c)&&parseFloat(c)>=parseFloat(e);default:return b?e>=c:c>=e}}}function d(a,b,c){return b.validator(a(),void 0===c.params?!0:h(c.params))?!0:(a.setError(f.formatMessage(c.message||b.message,h(c.params),a)),!1)}function e(a,b,c){a.isValidating(!0);var d=function(d){var e=!1,g="";return a.__valid__()?(d.message?(e=d.isValid,g=d.message):e=d,e||(a.error(f.formatMessage(g||c.message||b.message,h(c.params),a)),a.__valid__(e)),void a.isValidating(!1)):void a.isValidating(!1)};f.utils.async(function(){b.validator(a(),void 0===c.params?!0:h(c.params),d)})}if("undefined"==typeof a)throw new Error("Knockout is required, please ensure it is loaded before loading this validation plug-in");a.validation=b;var f=a.validation,g=a.utils,h=g.unwrapObservable,i=g.arrayForEach,j=g.extend,k={registerExtenders:!0,messagesOnModified:!0,errorsAsTitle:!0,errorsAsTitleOnModified:!1,messageTemplate:null,insertMessages:!0,parseInputAttributes:!1,writeInputAttributes:!1,decorateInputElement:!1,decorateElementOnModified:!0,errorClass:null,errorElementClass:"validationElement",errorMessageClass:"validationMessage",allowHtmlMessages:!1,grouping:{deep:!1,observable:!0,live:!1},validate:{}},l=j({},k);l.html5Attributes=["required","pattern","min","max","step","maxlength","minlength"],l.html5InputTypes=["email","number","date"],l.reset=function(){j(l,k)},f.configuration=l,f.utils=function(){var a=(new Date).getTime(),b={},c="__ko_validation__";return{isArray:function(a){return a.isArray||"[object Array]"===Object.prototype.toString.call(a)},isObject:function(a){return null!==a&&"object"==typeof a},isNumber:function(a){return!isNaN(a)},isObservableArray:function(a){return!!a&&"function"==typeof a.remove&&"function"==typeof a.removeAll&&"function"==typeof a.destroy&&"function"==typeof a.destroyAll&&"function"==typeof a.indexOf&&"function"==typeof a.replace},values:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(a[c]);return b},getValue:function(a){return"function"==typeof a?a():a},hasAttribute:function(a,b){return null!==a.getAttribute(b)},getAttribute:function(a,b){return a.getAttribute(b)},setAttribute:function(a,b,c){return a.setAttribute(b,c)},isValidatable:function(a){return!!(a&&a.rules&&a.isValid&&a.isModified)},insertAfter:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},newId:function(){return a+=1},getConfigOptions:function(a){var b=f.utils.contextFor(a);return b||f.configuration},setDomData:function(a,d){var e=a[c];e||(a[c]=e=f.utils.newId()),b[e]=d},getDomData:function(a){var d=a[c];return d?b[d]:void 0},contextFor:function(a){switch(a.nodeType){case 1:case 8:var b=f.utils.getDomData(a);if(b)return b;if(a.parentNode)return f.utils.contextFor(a.parentNode)}return void 0},isEmptyVal:function(a){return void 0===a?!0:null===a?!0:""===a?!0:void 0},getOriginalElementTitle:function(a){var b=f.utils.getAttribute(a,"data-orig-title"),c=a.title,d=f.utils.hasAttribute(a,"data-orig-title");return d?b:c},async:function(a){window.setImmediate?window.setImmediate(a):window.setTimeout(a,0)},forEach:function(a,b){if(f.utils.isArray(a))return i(a,b);for(var c in a)a.hasOwnProperty(c)&&b(a[c],c)}}}();var m=function(){function b(a){i(a.subscriptions,function(a){a.dispose()}),a.subscriptions=[]}function c(a){a.options.deep&&(i(a.flagged,function(a){delete a.__kv_traversed}),a.flagged.length=0),a.options.live||b(a)}function d(a,d){d.validatables=[],b(d),e(a,d),c(d)}function e(b,c,d){var f=[],g=b.peek?b.peek():b;b.__kv_traversed!==!0&&(c.options.deep&&(b.__kv_traversed=!0,c.flagged.push(b)),d=void 0!==d?d:c.options.deep?1:-1,a.isObservable(b)&&(b.errors||n.isValidatable(b)||b.extend({validatable:!0}),c.validatables.push(b),c.options.live&&n.isObservableArray(b)&&c.subscriptions.push(b.subscribe(function(){c.graphMonitor.valueHasMutated()}))),g&&!h(g._destroy)&&(n.isArray(g)?f=g:n.isObject(g)&&(f=n.values(g))),0!==d&&n.forEach(f,function(b){!b||b.nodeType||a.isComputed(b)&&!b.rules||e(b,c,d+1)}))}function k(a){var b=[];return i(a,function(a){n.isValidatable(a)&&!a.isValid()&&b.push(a.error.peek())}),b}var l=0,m=f.configuration,n=f.utils;return{init:function(a,b){l>0&&!b||(a=a||{},a.errorElementClass=a.errorElementClass||a.errorClass||m.errorElementClass,a.errorMessageClass=a.errorMessageClass||a.errorClass||m.errorMessageClass,j(m,a),m.registerExtenders&&f.registerExtenders(),l=1)},reset:f.configuration.reset,group:function(b,c){c=j(j({},m.grouping),c);var e={options:c,graphMonitor:a.observable(),flagged:[],subscriptions:[],validatables:[]},f=null;return f=c.observable?a.computed(function(){return e.graphMonitor(),d(b,e),k(e.validatables)}):function(){return d(b,e),k(e.validatables)},f.showAllMessages=function(a){void 0===a&&(a=!0),f.forEach(function(b){n.isValidatable(b)&&b.isModified(a)})},f.isAnyMessageShown=function(){var a;return a=!!f.find(function(a){return n.isValidatable(a)&&!a.isValid()&&a.isModified()})},f.filter=function(a){return a=a||function(){return!0},f(),g.arrayFilter(e.validatables,a)},f.find=function(a){return a=a||function(){return!0},f(),g.arrayFirst(e.validatables,a)},f.forEach=function(a){a=a||function(){},f(),i(e.validatables,a)},f.map=function(a){return a=a||function(a){return a},f(),g.arrayMap(e.validatables,a)},f._updateState=function(a){if(!n.isObject(a))throw new Error("An object is required.");return b=a,c.observable?void e.graphMonitor.valueHasMutated():(d(a,e),k(e.validatables))},f},formatMessage:function(a,b,c){if(n.isObject(b)&&b.typeAttr&&(b=b.value),"function"==typeof a)return a(b,c);var d=h(b);return null==d&&(d=[]),n.isArray(d)||(d=[d]),a.replace(/{(\d+)}/gi,function(a,b){return"undefined"!=typeof d[b]?d[b]:a})},addRule:function(a,b){a.extend({validatable:!0});var c=!!g.arrayFirst(a.rules.peek(),function(a){return a.rule&&a.rule===b.rule});return c||a.rules.push(b),a},addAnonymousRule:function(a,b){void 0===b.message&&(b.message="Error"),b.onlyIf&&(b.condition=b.onlyIf),f.addRule(a,b)},addExtender:function(b){a.extenders[b]=function(a,c){return c&&(c.params||c.message||c.onlyIf)?f.addRule(a,{rule:b,message:c.message,params:n.isEmptyVal(c.params)?!0:c.params,condition:c.onlyIf}):f.addRule(a,{rule:b,params:c})}},registerExtenders:function(){if(m.registerExtenders)for(var b in f.rules)f.rules.hasOwnProperty(b)&&(a.extenders[b]||f.addExtender(b))},insertValidationMessage:function(a){var b=document.createElement("SPAN");return b.className=n.getConfigOptions(a).errorMessageClass,n.insertAfter(a,b),b},parseInputValidationAttributes:function(a,b){i(f.configuration.html5Attributes,function(c){if(n.hasAttribute(a,c)){var d=a.getAttribute(c)||!0,e=c;if("min"===c||"max"===c){var g=a.getAttribute("type");"undefined"!=typeof g&&g||(g="text"),d={typeAttr:g,value:d}}else("minlength"===c||"maxlength"===c)&&(d=parseInt(d),e="minlength"===c?"minLength":"maxLength");f.addRule(b(),{rule:e,params:d})}});var c=a.getAttribute("type");i(f.configuration.html5InputTypes,function(a){a===c&&f.addRule(b(),{rule:"date"===a?"dateISO":a,params:!0})})},writeInputValidationAttributes:function(b,c){var d=c();if(d&&d.rules){var e=d.rules();i(f.configuration.html5Attributes,function(c){var d=g.arrayFirst(e,function(a){return a.rule&&a.rule.toLowerCase()===c.toLowerCase()});d&&a.computed({read:function(){var e=a.unwrap(d.params);"pattern"===d.rule&&e instanceof RegExp&&(e=e.source),b.setAttribute(c,e)},disposeWhenNodeIsRemoved:b})}),e=null}},makeBindingHandlerValidatable:function(b){var c=a.bindingHandlers[b].init;a.bindingHandlers[b].init=function(b,d,e,f,g){return c(b,d,e,f,g),a.bindingHandlers.validationCore.init(b,d,e,f,g)}},setRules:function(b,c){var d=function(b,c){if(b&&c)for(var e in c)if(c.hasOwnProperty(e)){var g=c[e];if(b[e]){var i=b[e],j=h(i),k={},l={};for(var m in g)g.hasOwnProperty(m)&&(f.rules[m]?k[m]=g[m]:l[m]=g[m]);if(a.isObservable(i)&&i.extend(k),j&&n.isArray(j))for(var o=0;o0:!0)},message:"This field is required."},f.rules.min={validator:c("min"),message:"Please enter a value greater than or equal to {0}."},f.rules.max={validator:c("max"),message:"Please enter a value less than or equal to {0}."},f.rules.minLength={validator:function(a,b){if(f.utils.isEmptyVal(a))return!0;var c=f.utils.isNumber(a)?""+a:a;return c.length>=b},message:"Please enter at least {0} characters."},f.rules.maxLength={validator:function(a,b){if(f.utils.isEmptyVal(a))return!0;var c=f.utils.isNumber(a)?""+a:a;return c.length<=b},message:"Please enter no more than {0} characters."},f.rules.pattern={validator:function(a,b){return f.utils.isEmptyVal(a)||null!==a.toString().match(b)},message:"Please check this value."},f.rules.step={validator:function(a,b){if(f.utils.isEmptyVal(a)||"any"===b)return!0;var c=100*a%(100*b);return Math.abs(c)<1e-5||Math.abs(1-c)<1e-5},message:"The value must increment by {0}."},f.rules.email={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a):!0},message:"Please enter a proper email address."},f.rules.date={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&!/Invalid|NaN/.test(new Date(a)):!0},message:"Please enter a proper date."},f.rules.dateISO={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^\d{4}[-\/](?:0?[1-9]|1[012])[-\/](?:0?[1-9]|[12][0-9]|3[01])$/.test(a):!0},message:"Please enter a proper date."},f.rules.number={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a):!0},message:"Please enter a number."},f.rules.digit={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^\d+$/.test(a):!0},message:"Please enter a digit."},f.rules.phoneUS={validator:function(a,b){return b?f.utils.isEmptyVal(a)?!0:"string"!=typeof a?!1:(a=a.replace(/\s+/g,""),b&&a.length>9&&a.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)):!0},message:"Please specify a valid phone number."},f.rules.equal={validator:function(a,b){var c=b;return a===f.utils.getValue(c)},message:"Values must equal."},f.rules.notEqual={validator:function(a,b){var c=b;return a!==f.utils.getValue(c)},message:"Please choose another value."},f.rules.unique={validator:function(a,b){var c=f.utils.getValue(b.collection),d=f.utils.getValue(b.externalValue),e=0;return a&&c?(g.arrayFilter(c,function(c){a===(b.valueAccessor?b.valueAccessor(c):c)&&e++}),(d?1:2)>e):!0},message:"Please make sure the value is unique."},function(){f.registerExtenders()}(),a.bindingHandlers.validationCore=function(){return{init:function(b,c){var d=f.utils.getConfigOptions(b),e=c();if(d.parseInputAttributes&&f.utils.async(function(){f.parseInputValidationAttributes(b,c)}),d.insertMessages&&f.utils.isValidatable(e)){var g=f.insertValidationMessage(b);d.messageTemplate?a.renderTemplate(d.messageTemplate,{field:e},null,g,"replaceNode"):a.applyBindingsToNode(g,{validationMessage:e})}d.writeInputAttributes&&f.utils.isValidatable(e)&&f.writeInputValidationAttributes(b,c),d.decorateInputElement&&f.utils.isValidatable(e)&&a.applyBindingsToNode(b,{validationElement:e})}}}(),f.makeBindingHandlerValidatable("value"),f.makeBindingHandlerValidatable("checked"),a.bindingHandlers.textInput&&f.makeBindingHandlerValidatable("textInput"),f.makeBindingHandlerValidatable("selectedOptions"),a.bindingHandlers.validationMessage={update:function(b,c){var d=c(),e=f.utils.getConfigOptions(b),i=(h(d),!1),j=!1;if(null===d||"undefined"==typeof d)throw new Error("Cannot bind validationMessage to undefined value. data-bind expression: "+b.getAttribute("data-bind"));i=d.isModified&&d.isModified(),j=d.isValid&&d.isValid();var k=null;(!e.messagesOnModified||i)&&(k=j?null:d.error);var l=!e.messagesOnModified||i?!j:!1,m="none"!==b.style.display;e.allowHtmlMessages?g.setHtml(b,k):a.bindingHandlers.text.update(b,function(){return k}),m&&!l?b.style.display="none":!m&&l&&(b.style.display="")}},a.bindingHandlers.validationElement={update:function(b,c,d){var e=c(),g=f.utils.getConfigOptions(b),i=(h(e),!1),j=!1;if(null===e||"undefined"==typeof e)throw new Error("Cannot bind validationElement to undefined value. data-bind expression: "+b.getAttribute("data-bind"));i=e.isModified&&e.isModified(),j=e.isValid&&e.isValid();var k=function(){var a={},b=!g.decorateElementOnModified||i?!j:!1;return a[g.errorElementClass]=b,a};a.bindingHandlers.css.update(b,k,d),g.errorsAsTitle&&a.bindingHandlers.attr.update(b,function(){var a=!g.errorsAsTitleOnModified||i,c=f.utils.getOriginalElementTitle(b);return a&&!j?{title:e.error,"data-orig-title":c}:!a||j?{title:c,"data-orig-title":null}:void 0})}},a.bindingHandlers.validationOptions=function(){return{init:function(a,b){var c=h(b());if(c){var d=j({},f.configuration);j(d,c),f.utils.setDomData(a,d)}}}}(),a.extenders.validation=function(a,b){return i(f.utils.isArray(b)?b:[b],function(b){f.addAnonymousRule(a,b)}),a},a.extenders.validatable=function(b,c){if(f.utils.isObject(c)||(c={enable:c}),"enable"in c||(c.enable=!0),c.enable&&!f.utils.isValidatable(b)){var d=f.configuration.validate||{},e={throttleEvaluation:c.throttle||d.throttle};b.error=a.observable(null),b.rules=a.observableArray(),b.isValidating=a.observable(!1),b.__valid__=a.observable(!0),b.isModified=a.observable(!1),b.isValid=a.computed(b.__valid__),b.setError=function(a){var c=b.error.peek(),d=b.__valid__.peek();b.error(a),b.__valid__(!1),c===a||d||b.isValid.notifySubscribers()},b.clearError=function(){return b.error(null),b.__valid__(!0),b};var g=b.subscribe(function(){b.isModified(!0)}),h=a.computed(j({read:function(){b(),b.rules();return f.validateObservable(b),!0}},e));j(h,e),b._disposeValidation=function(){b.isValid.dispose(),b.rules.removeAll(),g.dispose(),h.dispose(),delete b.rules,delete b.error,delete b.isValid,delete b.isValidating,delete b.__valid__,delete b.isModified,delete b.setError,delete b.clearError,delete b._disposeValidation}}else c.enable===!1&&b._disposeValidation&&b._disposeValidation();return b},f.validateObservable=function(a){for(var b,c,g=0,h=a.rules(),i=h.length;i>g;g++)if(c=h[g],!c.condition||c.condition())if(b=c.rule?f.rules[c.rule]:c,b.async||c.async)e(a,b,c);else if(!d(a,b,c))return!1;return a.clearError(),!0};var n,o={};f.defineLocale=function(a,b){return a&&b?(o[a.toLowerCase()]=b,b):null},f.locale=function(a){if(a){if(a=a.toLowerCase(),!o.hasOwnProperty(a))throw new Error("Localization "+a+" has not been loaded.");f.localize(o[a]),n=a}return n},f.localize=function(a){var b=f.rules;for(var c in a)b.hasOwnProperty(c)&&(b[c].message=a[c])},function(){var a={},b=f.rules;for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c].message);f.defineLocale("en-us",a)}(),n="en-us",a.applyBindingsWithValidation=function(b,c,d){var e,g=document.body;c&&c.nodeType?(g=c,e=d):e=c,f.init(),e&&(e=j(j({},f.configuration),e),f.utils.setDomData(g,e)),a.applyBindings(b,g)};var p=a.applyBindings;a.applyBindings=function(a,b){f.init(),p(a,b)},a.validatedObservable=function(b,c){if(!c&&!f.utils.isObject(b))return a.observable(b).extend({validatable:!0});var d=a.observable(b);return d.errors=f.group(f.utils.isObject(b)?b:{},c),d.isValid=a.observable(0===d.errors().length),a.isObservable(d.errors)?d.errors.subscribe(function(a){d.isValid(0===a.length)}):a.computed(d.errors).subscribe(function(a){d.isValid(0===a.length)}),d.subscribe(function(a){f.utils.isObject(a)||(a={}),d.errors._updateState(a),d.isValid(0===d.errors().length)}),d}}); +!function(a){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?a(require("knockout"),exports):"function"==typeof define&&define.amd?define(["knockout","exports"],a):a(ko,ko.validation={})}(function(a,b){function c(a){var b="max"===a;return function(c,d){if(f.utils.isEmptyVal(c))return!0;var e,g;void 0===d.typeAttr?(g="text",e=d):(g=d.typeAttr,e=d.value),isNaN(e)||e instanceof Date||(g="number");var h,i,j;switch(g.toLowerCase()){case"week":if(h=/^(\d{4})-W(\d{2})$/,i=c.match(h),null===i)throw new Error("Invalid value for "+a+" attribute for week input. Should look like '2000-W33' http://www.w3.org/TR/html-markup/input.week.html#input.week.attrs.min");return j=e.match(h),j?b?i[1]j[1]||i[1]===j[1]&&i[2]>=j[2]:!1;case"month":if(h=/^(\d{4})-(\d{2})$/,i=c.match(h),null===i)throw new Error("Invalid value for "+a+" attribute for month input. Should look like '2000-03' http://www.w3.org/TR/html-markup/input.month.html#input.month.attrs.min");return j=e.match(h),j?b?i[1]j[1]||i[1]===j[1]&&i[2]>=j[2]:!1;case"number":case"range":return b?!isNaN(c)&&parseFloat(c)<=parseFloat(e):!isNaN(c)&&parseFloat(c)>=parseFloat(e);default:return b?e>=c:c>=e}}}function d(a,b,c){return b.validator(a(),void 0===c.params?!0:h(c.params))?!0:(a.setError(f.formatMessage(c.message||b.message,h(c.params),a)),!1)}function e(a,b,c){a.isValidating(!0);var d=function(d){var e=!1,g="";return a.__valid__()?(d.message?(e=d.isValid,g=d.message):e=d,e||(a.error(f.formatMessage(g||c.message||b.message,h(c.params),a)),a.__valid__(e)),void a.isValidating(!1)):void a.isValidating(!1)};f.utils.async(function(){b.validator(a(),void 0===c.params?!0:h(c.params),d)})}if("undefined"==typeof a)throw new Error("Knockout is required, please ensure it is loaded before loading this validation plug-in");a.validation=b;var f=a.validation,g=a.utils,h=g.unwrapObservable,i=g.arrayForEach,j=g.extend,k={registerExtenders:!0,messagesOnModified:!0,errorsAsTitle:!0,errorsAsTitleOnModified:!1,messageTemplate:null,insertMessages:!0,parseInputAttributes:!1,writeInputAttributes:!1,decorateInputElement:!1,decorateElementOnModified:!0,errorClass:null,errorElementClass:"validationElement",errorMessageClass:"validationMessage",allowHtmlMessages:!1,grouping:{deep:!1,observable:!0,live:!1},validate:{}},l=j({},k);l.html5Attributes=["required","pattern","min","max","step","maxlength","minlength"],l.html5InputTypes=["email","number","date"],l.reset=function(){j(l,k)},f.configuration=l,f.utils=function(){var a=(new Date).getTime(),b={},c="__ko_validation__";return{isArray:function(a){return a.isArray||"[object Array]"===Object.prototype.toString.call(a)},isObject:function(a){return null!==a&&"object"==typeof a},isNumber:function(a){return!isNaN(a)},isObservableArray:function(a){return!!a&&"function"==typeof a.remove&&"function"==typeof a.removeAll&&"function"==typeof a.destroy&&"function"==typeof a.destroyAll&&"function"==typeof a.indexOf&&"function"==typeof a.replace},values:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(a[c]);return b},getValue:function(a){return"function"==typeof a?a():a},hasAttribute:function(a,b){return null!==a.getAttribute(b)},getAttribute:function(a,b){return a.getAttribute(b)},setAttribute:function(a,b,c){return a.setAttribute(b,c)},isValidatable:function(a){return!!(a&&a.rules&&a.isValid&&a.isModified)},insertAfter:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},newId:function(){return a+=1},getConfigOptions:function(a){var b=f.utils.contextFor(a);return b||f.configuration},setDomData:function(a,d){var e=a[c];e||(a[c]=e=f.utils.newId()),b[e]=d},getDomData:function(a){var d=a[c];return d?b[d]:void 0},contextFor:function(a){switch(a.nodeType){case 1:case 8:var b=f.utils.getDomData(a);if(b)return b;if(a.parentNode)return f.utils.contextFor(a.parentNode)}return void 0},isEmptyVal:function(a){return void 0===a?!0:null===a?!0:""===a?!0:void 0},getOriginalElementTitle:function(a){var b=f.utils.getAttribute(a,"data-orig-title"),c=a.title,d=f.utils.hasAttribute(a,"data-orig-title");return d?b:c},async:function(a){window.setImmediate?window.setImmediate(a):window.setTimeout(a,0)},forEach:function(a,b){if(f.utils.isArray(a))return i(a,b);for(var c in a)a.hasOwnProperty(c)&&b(a[c],c)}}}();var m=function(){function b(a){i(a.subscriptions,function(a){a.dispose()}),a.subscriptions=[]}function c(a){a.options.deep&&(i(a.flagged,function(a){delete a.__kv_traversed}),a.flagged.length=0),a.options.live||b(a)}function d(a,d){d.validatables=[],b(d),e(a,d),c(d)}function e(b,c,d){var f=[],g=b.peek?b.peek():b;b.__kv_traversed!==!0&&(c.options.deep&&(b.__kv_traversed=!0,c.flagged.push(b)),d=void 0!==d?d:c.options.deep?1:-1,a.isObservable(b)&&(b.errors||n.isValidatable(b)||b.extend({validatable:!0}),c.validatables.push(b),c.options.live&&n.isObservableArray(b)&&c.subscriptions.push(b.subscribe(function(){c.graphMonitor.valueHasMutated()}))),g&&!h(g._destroy)&&(n.isArray(g)?f=g:n.isObject(g)&&(f=n.values(g))),0!==d&&n.forEach(f,function(b){!b||b.nodeType||a.isComputed(b)&&!b.rules||e(b,c,d+1)}))}function k(a){var b=[];return i(a,function(a){n.isValidatable(a)&&!a.isValid()&&b.push(a.error.peek())}),b}var l=0,m=f.configuration,n=f.utils;return{init:function(a,b){l>0&&!b||(a=a||{},a.errorElementClass=a.errorElementClass||a.errorClass||m.errorElementClass,a.errorMessageClass=a.errorMessageClass||a.errorClass||m.errorMessageClass,j(m,a),m.registerExtenders&&f.registerExtenders(),l=1)},reset:f.configuration.reset,group:function(b,c){c=j(j({},m.grouping),c);var e={options:c,graphMonitor:a.observable(),flagged:[],subscriptions:[],validatables:[]},f=null;return f=c.observable?a.computed(function(){return e.graphMonitor(),d(b,e),k(e.validatables)}):function(){return d(b,e),k(e.validatables)},f.showAllMessages=function(a){void 0===a&&(a=!0),f.forEach(function(b){n.isValidatable(b)&&b.isModified(a)})},f.isAnyMessageShown=function(){var a;return a=!!f.find(function(a){return n.isValidatable(a)&&!a.isValid()&&a.isModified()})},f.filter=function(a){return a=a||function(){return!0},f(),g.arrayFilter(e.validatables,a)},f.find=function(a){return a=a||function(){return!0},f(),g.arrayFirst(e.validatables,a)},f.forEach=function(a){a=a||function(){},f(),i(e.validatables,a)},f.map=function(a){return a=a||function(a){return a},f(),g.arrayMap(e.validatables,a)},f._updateState=function(a){if(!n.isObject(a))throw new Error("An object is required.");return b=a,c.observable?void e.graphMonitor.valueHasMutated():(d(a,e),k(e.validatables))},f},formatMessage:function(a,b,c){if(n.isObject(b)&&b.typeAttr&&(b=b.value),"function"==typeof a)return a(b,c);var d=h(b);return null==d&&(d=[]),n.isArray(d)||(d=[d]),a.replace(/{(\d+)}/gi,function(a,b){return"undefined"!=typeof d[b]?d[b]:a})},addRule:function(a,b){a.extend({validatable:!0});var c=!!g.arrayFirst(a.rules.peek(),function(a){return a.rule&&a.rule===b.rule});return c||a.rules.push(b),a},addAnonymousRule:function(a,b){void 0===b.message&&(b.message="Error"),b.onlyIf&&(b.condition=b.onlyIf),f.addRule(a,b)},addExtender:function(b){a.extenders[b]=function(a,c){return c&&(c.params||c.message||c.onlyIf)?f.addRule(a,{rule:b,message:c.message,params:n.isEmptyVal(c.params)?!0:c.params,condition:c.onlyIf}):f.addRule(a,{rule:b,params:c})}},registerExtenders:function(){if(m.registerExtenders)for(var b in f.rules)f.rules.hasOwnProperty(b)&&(a.extenders[b]||f.addExtender(b))},insertValidationMessage:function(a){var b=document.createElement("SPAN");return b.className=n.getConfigOptions(a).errorMessageClass,n.insertAfter(a,b),b},parseInputValidationAttributes:function(a,b){i(f.configuration.html5Attributes,function(c){if(n.hasAttribute(a,c)){var d=a.getAttribute(c)||!0,e=c;if("min"===c||"max"===c){var g=a.getAttribute("type");"undefined"!=typeof g&&g||(g="text"),d={typeAttr:g,value:d}}else("minlength"===c||"maxlength"===c)&&(d=parseInt(d),e="minlength"===c?"minLength":"maxLength");f.addRule(b(),{rule:e,params:d})}});var c=a.getAttribute("type");i(f.configuration.html5InputTypes,function(a){a===c&&f.addRule(b(),{rule:"date"===a?"dateISO":a,params:!0})})},writeInputValidationAttributes:function(b,c){var d=c();if(d&&d.rules){var e=d.rules();i(f.configuration.html5Attributes,function(c){var d=g.arrayFirst(e,function(a){return a.rule&&a.rule.toLowerCase()===c.toLowerCase()});d&&a.computed({read:function(){var e=a.unwrap(d.params);"pattern"===d.rule&&e instanceof RegExp&&(e=e.source),b.setAttribute(c,e)},disposeWhenNodeIsRemoved:b})}),e=null}},makeBindingHandlerValidatable:function(b){var c=a.bindingHandlers[b].init;a.bindingHandlers[b].init=function(b,d,e,f,g){return c(b,d,e,f,g),a.bindingHandlers.validationCore.init(b,d,e,f,g)}},setRules:function(b,c){var d=function(b,c){if(b&&c)for(var e in c)if(c.hasOwnProperty(e)){var g=c[e];if(b[e]){var i=b[e],j=h(i),k={},l={};for(var m in g)g.hasOwnProperty(m)&&(f.rules[m]?k[m]=g[m]:l[m]=g[m]);if(a.isObservable(i)&&i.extend(k),j&&n.isArray(j))for(var o=0;o0:!0)},message:"This field is required."},f.rules.min={validator:c("min"),message:"Please enter a value greater than or equal to {0}."},f.rules.max={validator:c("max"),message:"Please enter a value less than or equal to {0}."},f.rules.minLength={validator:function(a,b){if(f.utils.isEmptyVal(a))return!0;var c=f.utils.isNumber(a)?""+a:a;return c.length>=b},message:"Please enter at least {0} characters."},f.rules.maxLength={validator:function(a,b){if(f.utils.isEmptyVal(a))return!0;var c=f.utils.isNumber(a)?""+a:a;return c.length<=b},message:"Please enter no more than {0} characters."},f.rules.pattern={validator:function(a,b){return f.utils.isEmptyVal(a)||null!==a.toString().match(b)},message:"Please check this value."},f.rules.step={validator:function(a,b){if(f.utils.isEmptyVal(a)||"any"===b)return!0;var c=100*a%(100*b);return Math.abs(c)<1e-5||Math.abs(1-c)<1e-5},message:"The value must increment by {0}."},f.rules.email={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a):!0},message:"Please enter a proper email address."},f.rules.date={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&!/Invalid|NaN/.test(new Date(a)):!0},message:"Please enter a proper date."},f.rules.dateISO={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^\d{4}[-\/](?:0?[1-9]|1[012])[-\/](?:0?[1-9]|[12][0-9]|3[01])$/.test(a):!0},message:"Please enter a proper date."},f.rules.number={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a):!0},message:"Please enter a number."},f.rules.digit={validator:function(a,b){return b?f.utils.isEmptyVal(a)||b&&/^\d+$/.test(a):!0},message:"Please enter a digit."},f.rules.phoneUS={validator:function(a,b){return b?f.utils.isEmptyVal(a)?!0:"string"!=typeof a?!1:(a=a.replace(/\s+/g,""),b&&a.length>9&&a.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)):!0},message:"Please specify a valid phone number."},f.rules.equal={validator:function(a,b){var c=b;return a===f.utils.getValue(c)},message:"Values must equal."},f.rules.notEqual={validator:function(a,b){var c=b;return a!==f.utils.getValue(c)},message:"Please choose another value."},f.rules.unique={validator:function(a,b){var c=f.utils.getValue(b.collection),d=f.utils.getValue(b.externalValue),e=0;return a&&c?(g.arrayFilter(c,function(c){a===(b.valueAccessor?b.valueAccessor(c):c)&&e++}),(d?1:2)>e):!0},message:"Please make sure the value is unique."},function(){f.registerExtenders()}(),a.bindingHandlers.validationCore=function(){return{init:function(b,c){var d=f.utils.getConfigOptions(b),e=c();if(d.parseInputAttributes&&f.utils.async(function(){f.parseInputValidationAttributes(b,c)}),d.insertMessages&&f.utils.isValidatable(e)){var g=f.insertValidationMessage(b);d.messageTemplate?a.renderTemplate(d.messageTemplate,{field:e},null,g,"replaceNode"):a.applyBindingsToNode(g,{validationMessage:e})}d.writeInputAttributes&&f.utils.isValidatable(e)&&f.writeInputValidationAttributes(b,c),d.decorateInputElement&&f.utils.isValidatable(e)&&a.applyBindingsToNode(b,{validationElement:e})}}}(),f.makeBindingHandlerValidatable("value"),f.makeBindingHandlerValidatable("checked"),a.bindingHandlers.textInput&&f.makeBindingHandlerValidatable("textInput"),f.makeBindingHandlerValidatable("selectedOptions"),a.bindingHandlers.validationMessage={update:function(b,c){var d=c(),e=f.utils.getConfigOptions(b),i=(h(d),!1),j=!1;if(null===d||"undefined"==typeof d)throw new Error("Cannot bind validationMessage to undefined value. data-bind expression: "+b.getAttribute("data-bind"));i=d.isModified&&d.isModified(),j=d.isValid&&d.isValid();var k=null;(!e.messagesOnModified||i)&&(k=j?null:d.error);var l=!e.messagesOnModified||i?!j:!1,m="none"!==b.style.display;e.allowHtmlMessages?g.setHtml(b,k):a.bindingHandlers.text.update(b,function(){return k}),m&&!l?b.style.display="none":!m&&l&&(b.style.display="")}},a.bindingHandlers.validationElement={update:function(b,c,d){var e=c(),g=f.utils.getConfigOptions(b),i=(h(e),!1),j=!1;if(null===e||"undefined"==typeof e)throw new Error("Cannot bind validationElement to undefined value. data-bind expression: "+b.getAttribute("data-bind"));i=e.isModified&&e.isModified(),j=e.isValid&&e.isValid();var k=function(){var a={},b=!g.decorateElementOnModified||i?!j:!1;return a[g.errorElementClass]=b,a};a.bindingHandlers.css.update(b,k,d),g.errorsAsTitle&&a.bindingHandlers.attr.update(b,function(){var a=!g.errorsAsTitleOnModified||i,c=f.utils.getOriginalElementTitle(b);return a&&!j?{title:e.error,"data-orig-title":c}:!a||j?{title:c,"data-orig-title":null}:void 0})}},a.bindingHandlers.validationOptions=function(){return{init:function(a,b){var c=h(b());if(c){var d=j({},f.configuration);j(d,c),f.utils.setDomData(a,d)}}}}(),a.extenders.validation=function(a,b){return i(f.utils.isArray(b)?b:[b],function(b){f.addAnonymousRule(a,b)}),a},a.extenders.validatable=function(b,c){if(f.utils.isObject(c)||(c={enable:c}),"enable"in c||(c.enable=!0),c.enable&&!f.utils.isValidatable(b)){var d=f.configuration.validate||{},e={throttleEvaluation:c.throttle||d.throttle};b.error=a.observable(null),b.rules=a.observableArray(),b.isValidating=a.observable(!1),b.__valid__=a.observable(!0),b.isModified=a.observable(!1),b.isValid=a.computed(b.__valid__),b.setError=function(a){var c=b.error.peek(),d=b.__valid__.peek();b.error(a),b.__valid__(!1),c===a||d||b.isValid.notifySubscribers()},b.clearError=function(){return b.error(null),b.__valid__(!0),b};var g=b.subscribe(function(){b.isModified(!0)}),h=a.computed(j({read:function(){b(),b.rules();return f.validateObservable(b),!0}},e));j(h,e),b._disposeValidation=function(){b.isValid.dispose(),b.rules.removeAll(),g.dispose(),h.dispose(),delete b.rules,delete b.error,delete b.isValid,delete b.isValidating,delete b.__valid__,delete b.isModified,delete b.setError,delete b.clearError,delete b._disposeValidation}}else c.enable===!1&&b._disposeValidation&&b._disposeValidation();return b},f.validateObservable=function(a){for(var b,c,g=0,h=a.rules(),i=h.length;i>g;g++)if(c=h[g],!c.condition||c.condition())if(b=c.rule?f.rules[c.rule]:c,b.async||c.async)e(a,b,c);else if(!d(a,b,c))return!1;return a.clearError(),!0};var n,o={};f.defineLocale=function(a,b){return a&&b?(o[a.toLowerCase()]=b,b):null},f.locale=function(a){if(a){if(a=a.toLowerCase(),!o.hasOwnProperty(a))throw new Error("Localization "+a+" has not been loaded.");f.localize(o[a]),n=a}return n},f.localize=function(a){var b=f.rules;for(var c in a)b.hasOwnProperty(c)&&(b[c].message=a[c])},function(){var a={},b=f.rules;for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c].message);f.defineLocale("en-us",a)}(),n="en-us",a.applyBindingsWithValidation=function(b,c,d){var e,g=document.body;c&&c.nodeType?(g=c,e=d):e=c,f.init(),e&&(e=j(j({},f.configuration),e),f.utils.setDomData(g,e)),a.applyBindings(b,g)};var p=a.applyBindings;a.applyBindings=function(a,b){f.init(),p(a,b)},a.validatedObservable=function(b,c){if(!c&&!f.utils.isObject(b))return a.observable(b).extend({validatable:!0});var d=a.observable(b);return d.errors=f.group(f.utils.isObject(b)?b:{},c),d.isValid=a.observable(0===d.errors().length),a.isObservable(d.errors)?d.errors.subscribe(function(a){d.isValid(0===a.length)}):a.computed(d.errors).subscribe(function(a){d.isValid(0===a.length)}),d.subscribe(function(a){f.utils.isObject(a)||(a={}),d.errors._updateState(a),d.isValid(0===d.errors().length)}),d}}); //# sourceMappingURL=knockout.validation.min.js.map \ No newline at end of file diff --git a/dist/knockout.validation.min.js.map b/dist/knockout.validation.min.js.map index 19fc41db..15cc71b6 100644 --- a/dist/knockout.validation.min.js.map +++ b/dist/knockout.validation.min.js.map @@ -1 +1 @@ -{"version":3,"file":"knockout.validation.min.js","sources":["knockout.validation.js"],"names":["factory","require","exports","module","define","ko","validation","minMaxValidatorFactory","validatorName","isMaxValidation","val","options","kv","utils","isEmptyVal","comparisonValue","type","undefined","typeAttr","value","isNaN","Date","regex","valMatches","comparisonValueMatches","toLowerCase","match","Error","parseFloat","validateSync","observable","rule","ctx","validator","params","unwrap","setError","formatMessage","message","validateAsync","isValidating","callBack","valObj","isValid","msg","__valid__","error","async","koUtils","unwrapObservable","forEach","arrayForEach","extend","defaults","registerExtenders","messagesOnModified","errorsAsTitle","errorsAsTitleOnModified","messageTemplate","insertMessages","parseInputAttributes","writeInputAttributes","decorateInputElement","decorateElementOnModified","errorClass","errorElementClass","errorMessageClass","allowHtmlMessages","grouping","deep","live","validate","configuration","html5Attributes","html5InputTypes","reset","seedId","getTime","domData","domDataKey","isArray","o","Object","prototype","toString","call","isObject","isNumber","isObservableArray","instance","values","r","i","hasOwnProperty","push","getValue","hasAttribute","node","attr","getAttribute","element","setAttribute","isValidatable","rules","isModified","insertAfter","newNode","parentNode","insertBefore","nextSibling","newId","getConfigOptions","contextFor","setDomData","data","key","getDomData","nodeType","context","getOriginalElementTitle","savedOriginalTitle","currentTitle","title","hasSavedOriginalTitle","expr","window","setImmediate","setTimeout","object","callback","prop","api","cleanUpSubscriptions","subscriptions","subscription","dispose","flagged","obj","__kv_traversed","length","runTraversal","validatables","traverseGraph","level","objValues","peek","isObservable","errors","validatable","subscribe","graphMonitor","valueHasMutated","_destroy","isComputed","collectErrors","array","isInitialized","init","force","group","result","computed","showAllMessages","show","isAnyMessageShown","invalidAndModifiedPresent","find","filter","predicate","arrayFilter","arrayFirst","map","mapping","item","arrayMap","_updateState","newValue","replacements","replace","index","addRule","hasRule","addAnonymousRule","ruleObj","onlyIf","condition","addExtender","ruleName","extenders","insertValidationMessage","span","document","createElement","className","parseInputValidationAttributes","valueAccessor","parseInt","currentType","writeInputValidationAttributes","contexts","read","RegExp","source","disposeWhenNodeIsRemoved","makeBindingHandlerValidatable","handlerName","bindingHandlers","allBindingsAccessor","viewModel","bindingContext","setRules","target","definition","ruleDefinitions","targetValue","unwrappedTargetValue","nonRules","required","testVal","String","trim","minLength","normalizedVal","maxLength","step","dif","Math","abs","test","phoneNumber","otherValue","c","collection","external","externalValue","counter","config","validationMessageElement","renderTemplate","field","applyBindingsToNode","validationMessage","validationElement","textInput","update","obsv","isVisible","isCurrentlyVisible","style","display","setHtml","text","cssSettingsAccessor","css","shouldShow","hasModification","data-orig-title","newConfig","enable","validationOptions","throttleEvaluation","throttle","observableArray","previousError","previousIsValid","notifySubscribers","clearError","h_change","h_obsValidationTrigger","validateObservable","_disposeValidation","removeAll","ruleContexts","len","_currentLocale","_locales","defineLocale","name","locale","localize","msgTranslations","localeData","applyBindingsWithValidation","rootNode","body","applyBindings","origApplyBindings","validatedObservable","initialValue"],"mappings":";;;;;;;;;CAUC,SAAUA,GAGa,kBAAZC,UAA6C,gBAAZC,UAA0C,gBAAXC,QAE1EH,EAAQC,QAAQ,YAAaC,SACD,kBAAXE,SAAyBA,OAAY,IAEtDA,QAAQ,WAAY,WAAYJ,GAGhCA,EAAQK,GAAIA,GAAGC,gBAEf,SAAWD,EAAIH,GAsuBjB,QAASK,GAAuBC,GAC5B,GAAIC,GAAoC,QAAlBD,CAEtB,OAAO,UAAUE,EAAKC,GAClB,GAAIC,EAAGC,MAAMC,WAAWJ,GACpB,OAAO,CAGX,IAAIK,GAAiBC,CACIC,UAArBN,EAAQO,UAGRF,EAAO,OACPD,EAAkBJ,IAElBK,EAAOL,EAAQO,SACfH,EAAkBJ,EAAQQ,OAKzBC,MAAML,IAAsBA,YAA2BM,QACxDL,EAAO,SAGX,IAAIM,GAAOC,EAAYC,CACvB,QAAQR,EAAKS,eACT,IAAK,OAGD,GAFAH,EAAQ,qBACRC,EAAab,EAAIgB,MAAMJ,GACJ,OAAfC,EACA,KAAM,IAAII,OAAM,qBAAu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,EAAK1M,QAAUtC,EAAGyB,WAAoC,IAAzBuN,EAAKlG,SAASR,QAEvCtI,EAAG6I,aAAamG,EAAKlG,QACxBkG,EAAKlG,OAAOE,UAAU,SAASF,GAC9BkG,EAAK1M,QAA0B,IAAlBwG,EAAOR,UAIrBtI,EAAG4J,SAASoF,EAAKlG,QAAQE,UAAU,SAAUF,GAC5CkG,EAAK1M,QAA0B,IAAlBwG,EAAOR,UAItB0G,EAAKhG,UAAU,SAAS2B,GAClBpK,EAAGC,MAAMyE,SAAS0F,KAMtBA,MAGDqE,EAAKlG,OAAO4B,aAAaC,GACzBqE,EAAK1M,QAAiC,IAAzB0M,EAAKlG,SAASR,UAGrB0G"} \ No newline at end of file +{"version":3,"file":"knockout.validation.min.js","sources":["knockout.validation.js"],"names":["factory","require","exports","module","define","ko","validation","minMaxValidatorFactory","validatorName","isMaxValidation","val","options","kv","utils","isEmptyVal","comparisonValue","type","undefined","typeAttr","value","isNaN","Date","regex","valMatches","comparisonValueMatches","toLowerCase","match","Error","parseFloat","validateSync","observable","rule","ctx","validator","params","unwrap","setError","formatMessage","message","validateAsync","isValidating","callBack","valObj","isValid","msg","__valid__","error","async","koUtils","unwrapObservable","forEach","arrayForEach","extend","defaults","registerExtenders","messagesOnModified","errorsAsTitle","errorsAsTitleOnModified","messageTemplate","insertMessages","parseInputAttributes","writeInputAttributes","decorateInputElement","decorateElementOnModified","errorClass","errorElementClass","errorMessageClass","allowHtmlMessages","grouping","deep","live","validate","configuration","html5Attributes","html5InputTypes","reset","seedId","getTime","domData","domDataKey","isArray","o","Object","prototype","toString","call","isObject","isNumber","isObservableArray","instance","values","r","i","hasOwnProperty","push","getValue","hasAttribute","node","attr","getAttribute","element","setAttribute","isValidatable","rules","isModified","insertAfter","newNode","parentNode","insertBefore","nextSibling","newId","getConfigOptions","contextFor","setDomData","data","key","getDomData","nodeType","context","getOriginalElementTitle","savedOriginalTitle","currentTitle","title","hasSavedOriginalTitle","expr","window","setImmediate","setTimeout","object","callback","prop","api","cleanUpSubscriptions","subscriptions","subscription","dispose","flagged","obj","__kv_traversed","length","runTraversal","validatables","traverseGraph","level","objValues","peek","isObservable","errors","validatable","subscribe","graphMonitor","valueHasMutated","_destroy","isComputed","collectErrors","array","isInitialized","init","force","group","result","computed","showAllMessages","show","isAnyMessageShown","invalidAndModifiedPresent","find","filter","predicate","arrayFilter","arrayFirst","map","mapping","item","arrayMap","_updateState","newValue","replacements","replace","index","addRule","hasRule","addAnonymousRule","ruleObj","onlyIf","condition","addExtender","ruleName","extenders","insertValidationMessage","span","document","createElement","className","parseInputValidationAttributes","valueAccessor","parseInt","currentType","writeInputValidationAttributes","contexts","read","RegExp","source","disposeWhenNodeIsRemoved","makeBindingHandlerValidatable","handlerName","bindingHandlers","allBindingsAccessor","viewModel","bindingContext","setRules","target","definition","ruleDefinitions","targetValue","unwrappedTargetValue","nonRules","required","testVal","String","trim","minLength","normalizedVal","maxLength","step","dif","Math","abs","test","phoneNumber","otherValue","c","collection","external","externalValue","counter","config","validationMessageElement","renderTemplate","field","applyBindingsToNode","validationMessage","validationElement","textInput","update","obsv","isVisible","isCurrentlyVisible","style","display","setHtml","text","cssSettingsAccessor","css","shouldShow","hasModification","data-orig-title","newConfig","enable","validationOptions","throttleEvaluation","throttle","observableArray","previousError","previousIsValid","notifySubscribers","clearError","h_change","h_obsValidationTrigger","validateObservable","_disposeValidation","removeAll","ruleContexts","len","_currentLocale","_locales","defineLocale","name","locale","localize","msgTranslations","localeData","applyBindingsWithValidation","rootNode","body","applyBindings","origApplyBindings","validatedObservable","initialValue"],"mappings":";;;;;;;;;CAUC,SAAUA,GAGa,kBAAZC,UAA6C,gBAAZC,UAA0C,gBAAXC,QAE1EH,EAAQC,QAAQ,YAAaC,SACD,kBAAXE,SAAyBA,OAAY,IAEtDA,QAAQ,WAAY,WAAYJ,GAGhCA,EAAQK,GAAIA,GAAGC,gBAEf,SAAWD,EAAIH,GAsuBjB,QAASK,GAAuBC,GAC5B,GAAIC,GAAoC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W/G,GAI7B,IAAI6L,GAAoBzR,EAAGwR,aAC3BxR,GAAGwR,cAAgB,SAAU7E,EAAW2E,GAEvC/Q,EAAGiJ,OAEHiI,EAAkB9E,EAAW2E,IAG9BtR,EAAG0R,oBAAsB,SAAUC,EAAcrR,GAChD,IAAKA,IAAYC,EAAGC,MAAMyE,SAAS0M,GAClC,MAAO3R,GAAGyB,WAAWkQ,GAAc5O,QAASgG,aAAa,GAG1D,IAAIiG,GAAOhP,EAAGyB,WAAWkQ,EA6BzB,OA5BA3C,GAAKlG,OAASvI,EAAGmJ,MAAMnJ,EAAGC,MAAMyE,SAAS0M,GAAgBA,KAAmBrR,GAC5E0O,EAAK1M,QAAUtC,EAAGyB,WAAoC,IAAzBuN,EAAKlG,SAASR,QAEvCtI,EAAG6I,aAAamG,EAAKlG,QACxBkG,EAAKlG,OAAOE,UAAU,SAASF,GAC9BkG,EAAK1M,QAA0B,IAAlBwG,EAAOR,UAIrBtI,EAAG4J,SAASoF,EAAKlG,QAAQE,UAAU,SAAUF,GAC5CkG,EAAK1M,QAA0B,IAAlBwG,EAAOR,UAItB0G,EAAKhG,UAAU,SAAS2B,GAClBpK,EAAGC,MAAMyE,SAAS0F,KAMtBA,MAGDqE,EAAKlG,OAAO4B,aAAaC,GACzBqE,EAAK1M,QAAiC,IAAzB0M,EAAKlG,SAASR,UAGrB0G"} \ No newline at end of file diff --git a/src/rules.js b/src/rules.js index 14e3fb67..762c385c 100644 --- a/src/rules.js +++ b/src/rules.js @@ -24,7 +24,7 @@ ko.validation.rules['required'] = { validator: function (val, required) { var testVal; - if (val === undefined || val === null) { + if (val === undefined || val === null || val === false) { return !required; } diff --git a/test/rules-tests.js b/test/rules-tests.js index 3357b27d..e04017a8 100644 --- a/test/rules-tests.js +++ b/test/rules-tests.js @@ -16,6 +16,11 @@ QUnit.test('Object is NOT Valid and isValid returns False', function(assert) { assert.violatesRequiredRule(testObj, ''); }); +QUnit.test('Issue #598 - "false" is NOT valid and isValid returns false', function(assert) { + var testObj = ko.observable(false).extend({ required: true }); + assert.violatesRequiredRule(testObj, false); +}); + QUnit.test('Zero is a valid value for required', function(assert) { var testObj = ko.observable(0).extend({ required: true }); assert.observableIsValid(testObj, 0);