From a94c58d79831c4343f74ca8662b5aed0b976e937 Mon Sep 17 00:00:00 2001 From: janvanderhaegen Date: Sun, 28 Jun 2015 14:33:10 -0500 Subject: [PATCH] chore(build): built latest for integration tests --- dist/amd/resources/bg-BG.js | 90 +++++++++++++++ dist/amd/resources/zh-CN.js | 96 ++++++++++++++++ .../validation/validation-rules-collection.js | 3 +- dist/commonjs/resources/bg-BG.js | 91 +++++++++++++++ dist/commonjs/resources/zh-CN.js | 97 ++++++++++++++++ .../validation/validation-rules-collection.js | 3 +- dist/es6/resources/bg-BG.js | 86 +++++++++++++++ dist/es6/resources/zh-CN.js | 92 ++++++++++++++++ .../validation/validation-rules-collection.js | 4 +- dist/system/resources/bg-BG.js | 98 +++++++++++++++++ dist/system/resources/zh-CN.js | 104 ++++++++++++++++++ .../validation/validation-rules-collection.js | 3 +- 12 files changed, 763 insertions(+), 4 deletions(-) create mode 100644 dist/amd/resources/bg-BG.js create mode 100644 dist/amd/resources/zh-CN.js create mode 100644 dist/commonjs/resources/bg-BG.js create mode 100644 dist/commonjs/resources/zh-CN.js create mode 100644 dist/es6/resources/bg-BG.js create mode 100644 dist/es6/resources/zh-CN.js create mode 100644 dist/system/resources/bg-BG.js create mode 100644 dist/system/resources/zh-CN.js diff --git a/dist/amd/resources/bg-BG.js b/dist/amd/resources/bg-BG.js new file mode 100644 index 00000000..c897e2f0 --- /dev/null +++ b/dist/amd/resources/bg-BG.js @@ -0,0 +1,90 @@ +define(['exports', '../validation/utilities'], function (exports, _validationUtilities) { + 'use strict'; + + exports.__esModule = true; + var data = { + settings: { + 'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/ + }, + messages: { + 'isRequired': 'е задължително', + 'onValidateCallback': 'невалидна стойност', + 'AlphaNumericOrWhitespaceValidationRule': function AlphaNumericOrWhitespaceValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви, цифри и интервали'; + }, + 'AlphaNumericValidationRule': function AlphaNumericValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви и цифри'; + }, + 'AlphaValidationRule': function AlphaValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви'; + }, + 'AlphaOrWhitespaceValidationRule': function AlphaOrWhitespaceValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви или интервали'; + }, + 'BetweenLengthValidationRule': function BetweenLengthValidationRule(newValue, threshold) { + return 'броят на символите трябва да бъде между ' + _validationUtilities.Utilities.getValue(threshold.minimumLength) + ' и ' + _validationUtilities.Utilities.getValue(threshold.maximumLength); + }, + 'BetweenValueValidationRule': function BetweenValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде между ' + _validationUtilities.Utilities.getValue(threshold.minimumValue) + ' и ' + _validationUtilities.Utilities.getValue(threshold.maximumValue); + }, + 'CustomFunctionValidationRule': function CustomFunctionValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'DigitValidationRule': function DigitValidationRule(newValue, threshold) { + return 'трябва да съдържа само цифри'; + }, + 'EmailValidationRule': function EmailValidationRule(newValue, threshold) { + return 'невалидна електронна поща'; + }, + 'EqualityValidationRule': function EqualityValidationRule(newValue, threshold) { + return 'стойността трябва да бъде ' + _validationUtilities.Utilities.getValue(threshold.otherValue); + }, + 'InEqualityValidationRule': function InEqualityValidationRule(newValue, threshold) { + return 'стойността не може да бъде ' + _validationUtilities.Utilities.getValue(threshold.otherValue); + }, + 'EqualityWithOtherLabelValidationRule': function EqualityWithOtherLabelValidationRule(newValue, threshold) { + return 'стойността не съвпада с ' + _validationUtilities.Utilities.getValue(threshold.otherValueLabel); + }, + 'InEqualityWithOtherLabelValidationRule': function InEqualityWithOtherLabelValidationRule(newValue, threshold) { + return 'стойността не може да съвпада с ' + _validationUtilities.Utilities.getValue(threshold.otherValueLabel); + }, + 'InCollectionValidationRule': function InCollectionValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'MinimumInclusiveValueValidationRule': function MinimumInclusiveValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде ' + _validationUtilities.Utilities.getValue(threshold) + ' или повече'; + }, + 'MinimumLengthValidationRule': function MinimumLengthValidationRule(newValue, threshold) { + return 'броят на символите трябва да бъде поне ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'MinimumValueValidationRule': function MinimumValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде повече от ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'MaximumInclusiveValueValidationRule': function MaximumInclusiveValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде ' + _validationUtilities.Utilities.getValue(threshold) + ' или по-малко'; + }, + 'MaximumLengthValidationRule': function MaximumLengthValidationRule(newValue, threshold) { + return 'броят на символите не може да бъде повече от ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'MaximumValueValidationRule': function MaximumValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде по-малко от ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'NumericValidationRule': function NumericValidationRule(newValue, threshold) { + return 'стойността на полето трябва да бъде число'; + }, + 'RegexValidationRule': function RegexValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'ContainsOnlyValidationRule': function ContainsOnlyValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'StrongPasswordValidationRule': function StrongPasswordValidationRule(newValue, threshold) { + return 'трябва да съдържа комбинация от малки и големи букви, цифри и специални знаци'; + }, + 'MediumPasswordValidationRule': function MediumPasswordValidationRule(newValue, threshold) { + return 'трябва да съдържа поне ' + _validationUtilities.Utilities.getValue(threshold) + ' от следните групи: малки и големи букви, цифри и специални знаци'; + } + } + }; + exports.data = data; +}); \ No newline at end of file diff --git a/dist/amd/resources/zh-CN.js b/dist/amd/resources/zh-CN.js new file mode 100644 index 00000000..0fe19998 --- /dev/null +++ b/dist/amd/resources/zh-CN.js @@ -0,0 +1,96 @@ +define(['exports', '../validation/utilities'], function (exports, _validationUtilities) { + 'use strict'; + + exports.__esModule = true; + var data = { + settings: { + 'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/ + }, + messages: { + 'isRequired': '必填字段', + 'onValidateCallback': '非法字段', + 'AlphaNumericOrWhitespaceValidationRule': function AlphaNumericOrWhitespaceValidationRule(newValue, threshold) { + return '不能使用特殊字符'; + }, + 'AlphaNumericValidationRule': function AlphaNumericValidationRule(newValue, threshold) { + return '只能包含字母数字字符'; + }, + 'AlphaValidationRule': function AlphaValidationRule(newValue, threshold) { + return '只能包含字母'; + }, + 'AlphaOrWhitespaceValidationRule': function AlphaOrWhitespaceValidationRule(newValue, threshold) { + return '只能包含字母或空格'; + }, + 'BetweenLengthValidationRule': function BetweenLengthValidationRule(newValue, threshold) { + return '字符长度应该在 ' + _validationUtilities.Utilities.getValue(threshold.minimumLength) + ' ~ ' + _validationUtilities.Utilities.getValue(threshold.maximumLength) + ' 之间'; + }, + 'BetweenValueValidationRule': function BetweenValueValidationRule(newValue, threshold) { + return '字符长度应该在 ' + _validationUtilities.Utilities.getValue(threshold.minimumValue) + ' ~ ' + _validationUtilities.Utilities.getValue(threshold.maximumValue) + ' 之间'; + }, + 'CustomFunctionValidationRule': function CustomFunctionValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'DigitValidationRule': function DigitValidationRule(newValue, threshold) { + return '只能包含数字'; + }, + 'EmailValidationRule': function EmailValidationRule(newValue, threshold) { + return '邮箱格式不正确'; + }, + 'EqualityValidationRule': function EqualityValidationRule(newValue, threshold) { + return '应该等于 ' + _validationUtilities.Utilities.getValue(threshold.otherValue); + }, + 'InEqualityValidationRule': function InEqualityValidationRule(newValue, threshold) { + return '不应该等于 ' + _validationUtilities.Utilities.getValue(threshold.otherValue); + }, + 'EqualityWithOtherLabelValidationRule': function EqualityWithOtherLabelValidationRule(newValue, threshold) { + return '与 ' + _validationUtilities.Utilities.getValue(threshold.otherValueLabel) + ' 不匹配'; + }, + 'InEqualityWithOtherLabelValidationRule': function InEqualityWithOtherLabelValidationRule(newValue, threshold) { + return '不应该和 ' + _validationUtilities.Utilities.getValue(threshold.otherValueLabel) + ' 相等'; + }, + 'InCollectionValidationRule': function InCollectionValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'MinimumInclusiveValueValidationRule': function MinimumInclusiveValueValidationRule(newValue, threshold) { + return '最小值为 ' + _validationUtilities.Utilities.getValue(threshold) + ' (包含)'; + }, + 'MinimumLengthValidationRule': function MinimumLengthValidationRule(newValue, threshold) { + return '最小字符长度为 ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'MinimumValueValidationRule': function MinimumValueValidationRule(newValue, threshold) { + return '最小值为 ' + _validationUtilities.Utilities.getValue(threshold) + '(不包含)'; + }, + 'MaximumInclusiveValueValidationRule': function MaximumInclusiveValueValidationRule(newValue, threshold) { + return '最大值为 ' + _validationUtilities.Utilities.getValue(threshold) + ' (包含)'; + }, + 'MaximumLengthValidationRule': function MaximumLengthValidationRule(newValue, threshold) { + return '最大字符长度为 ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'MaximumValueValidationRule': function MaximumValueValidationRule(newValue, threshold) { + return '最大值为 ' + _validationUtilities.Utilities.getValue(threshold) + '(不包含)'; + }, + 'NumericValidationRule': function NumericValidationRule(newValue, threshold) { + return '请输入一个数字'; + }, + 'NoSpacesValidationRule': function NoSpacesValidationRule(newValue, threshold) { + return '不能包含空字符'; + }, + 'RegexValidationRule': function RegexValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'ContainsOnlyValidationRule': function ContainsOnlyValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'StrongPasswordValidationRule': function StrongPasswordValidationRule(newValue, threshold) { + return '应包含大小字母,数字和特殊字符'; + }, + 'MediumPasswordValidationRule': function MediumPasswordValidationRule(newValue, threshold) { + return '至少包含 ' + _validationUtilities.Utilities.getValue(threshold) + ' 种以下组合:小写字母,大写字母,数字和特殊字符'; + }, + 'URLValidationRule': function URLValidationRule(newValue, threshold) { + return 'URL格式不正确'; + } + } + }; + exports.data = data; +}); \ No newline at end of file diff --git a/dist/amd/validation/validation-rules-collection.js b/dist/amd/validation/validation-rules-collection.js index e04b7576..1a18698c 100644 --- a/dist/amd/validation/validation-rules-collection.js +++ b/dist/amd/validation/validation-rules-collection.js @@ -9,7 +9,8 @@ define(['exports', '../validation/utilities', '../validation/validation-locale'] function ValidationRulesCollection(config) { _classCallCheck(this, ValidationRulesCollection); - this.isRequired = config.getValue('treatAllPropertiesAsMandatory'); + if (config) debugger; + this.isRequired = config ? config.getValue('allPropertiesAreMandatory') : false; this.validationRules = []; this.validationCollections = []; this.isRequiredMessage = null; diff --git a/dist/commonjs/resources/bg-BG.js b/dist/commonjs/resources/bg-BG.js new file mode 100644 index 00000000..e50ff325 --- /dev/null +++ b/dist/commonjs/resources/bg-BG.js @@ -0,0 +1,91 @@ +'use strict'; + +exports.__esModule = true; + +var _validationUtilities = require('../validation/utilities'); + +var data = { + settings: { + 'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/ + }, + messages: { + 'isRequired': 'е задължително', + 'onValidateCallback': 'невалидна стойност', + 'AlphaNumericOrWhitespaceValidationRule': function AlphaNumericOrWhitespaceValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви, цифри и интервали'; + }, + 'AlphaNumericValidationRule': function AlphaNumericValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви и цифри'; + }, + 'AlphaValidationRule': function AlphaValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви'; + }, + 'AlphaOrWhitespaceValidationRule': function AlphaOrWhitespaceValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви или интервали'; + }, + 'BetweenLengthValidationRule': function BetweenLengthValidationRule(newValue, threshold) { + return 'броят на символите трябва да бъде между ' + _validationUtilities.Utilities.getValue(threshold.minimumLength) + ' и ' + _validationUtilities.Utilities.getValue(threshold.maximumLength); + }, + 'BetweenValueValidationRule': function BetweenValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде между ' + _validationUtilities.Utilities.getValue(threshold.minimumValue) + ' и ' + _validationUtilities.Utilities.getValue(threshold.maximumValue); + }, + 'CustomFunctionValidationRule': function CustomFunctionValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'DigitValidationRule': function DigitValidationRule(newValue, threshold) { + return 'трябва да съдържа само цифри'; + }, + 'EmailValidationRule': function EmailValidationRule(newValue, threshold) { + return 'невалидна електронна поща'; + }, + 'EqualityValidationRule': function EqualityValidationRule(newValue, threshold) { + return 'стойността трябва да бъде ' + _validationUtilities.Utilities.getValue(threshold.otherValue); + }, + 'InEqualityValidationRule': function InEqualityValidationRule(newValue, threshold) { + return 'стойността не може да бъде ' + _validationUtilities.Utilities.getValue(threshold.otherValue); + }, + 'EqualityWithOtherLabelValidationRule': function EqualityWithOtherLabelValidationRule(newValue, threshold) { + return 'стойността не съвпада с ' + _validationUtilities.Utilities.getValue(threshold.otherValueLabel); + }, + 'InEqualityWithOtherLabelValidationRule': function InEqualityWithOtherLabelValidationRule(newValue, threshold) { + return 'стойността не може да съвпада с ' + _validationUtilities.Utilities.getValue(threshold.otherValueLabel); + }, + 'InCollectionValidationRule': function InCollectionValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'MinimumInclusiveValueValidationRule': function MinimumInclusiveValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде ' + _validationUtilities.Utilities.getValue(threshold) + ' или повече'; + }, + 'MinimumLengthValidationRule': function MinimumLengthValidationRule(newValue, threshold) { + return 'броят на символите трябва да бъде поне ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'MinimumValueValidationRule': function MinimumValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде повече от ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'MaximumInclusiveValueValidationRule': function MaximumInclusiveValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде ' + _validationUtilities.Utilities.getValue(threshold) + ' или по-малко'; + }, + 'MaximumLengthValidationRule': function MaximumLengthValidationRule(newValue, threshold) { + return 'броят на символите не може да бъде повече от ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'MaximumValueValidationRule': function MaximumValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде по-малко от ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'NumericValidationRule': function NumericValidationRule(newValue, threshold) { + return 'стойността на полето трябва да бъде число'; + }, + 'RegexValidationRule': function RegexValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'ContainsOnlyValidationRule': function ContainsOnlyValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'StrongPasswordValidationRule': function StrongPasswordValidationRule(newValue, threshold) { + return 'трябва да съдържа комбинация от малки и големи букви, цифри и специални знаци'; + }, + 'MediumPasswordValidationRule': function MediumPasswordValidationRule(newValue, threshold) { + return 'трябва да съдържа поне ' + _validationUtilities.Utilities.getValue(threshold) + ' от следните групи: малки и големи букви, цифри и специални знаци'; + } + } +}; +exports.data = data; \ No newline at end of file diff --git a/dist/commonjs/resources/zh-CN.js b/dist/commonjs/resources/zh-CN.js new file mode 100644 index 00000000..b285860d --- /dev/null +++ b/dist/commonjs/resources/zh-CN.js @@ -0,0 +1,97 @@ +'use strict'; + +exports.__esModule = true; + +var _validationUtilities = require('../validation/utilities'); + +var data = { + settings: { + 'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/ + }, + messages: { + 'isRequired': '必填字段', + 'onValidateCallback': '非法字段', + 'AlphaNumericOrWhitespaceValidationRule': function AlphaNumericOrWhitespaceValidationRule(newValue, threshold) { + return '不能使用特殊字符'; + }, + 'AlphaNumericValidationRule': function AlphaNumericValidationRule(newValue, threshold) { + return '只能包含字母数字字符'; + }, + 'AlphaValidationRule': function AlphaValidationRule(newValue, threshold) { + return '只能包含字母'; + }, + 'AlphaOrWhitespaceValidationRule': function AlphaOrWhitespaceValidationRule(newValue, threshold) { + return '只能包含字母或空格'; + }, + 'BetweenLengthValidationRule': function BetweenLengthValidationRule(newValue, threshold) { + return '字符长度应该在 ' + _validationUtilities.Utilities.getValue(threshold.minimumLength) + ' ~ ' + _validationUtilities.Utilities.getValue(threshold.maximumLength) + ' 之间'; + }, + 'BetweenValueValidationRule': function BetweenValueValidationRule(newValue, threshold) { + return '字符长度应该在 ' + _validationUtilities.Utilities.getValue(threshold.minimumValue) + ' ~ ' + _validationUtilities.Utilities.getValue(threshold.maximumValue) + ' 之间'; + }, + 'CustomFunctionValidationRule': function CustomFunctionValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'DigitValidationRule': function DigitValidationRule(newValue, threshold) { + return '只能包含数字'; + }, + 'EmailValidationRule': function EmailValidationRule(newValue, threshold) { + return '邮箱格式不正确'; + }, + 'EqualityValidationRule': function EqualityValidationRule(newValue, threshold) { + return '应该等于 ' + _validationUtilities.Utilities.getValue(threshold.otherValue); + }, + 'InEqualityValidationRule': function InEqualityValidationRule(newValue, threshold) { + return '不应该等于 ' + _validationUtilities.Utilities.getValue(threshold.otherValue); + }, + 'EqualityWithOtherLabelValidationRule': function EqualityWithOtherLabelValidationRule(newValue, threshold) { + return '与 ' + _validationUtilities.Utilities.getValue(threshold.otherValueLabel) + ' 不匹配'; + }, + 'InEqualityWithOtherLabelValidationRule': function InEqualityWithOtherLabelValidationRule(newValue, threshold) { + return '不应该和 ' + _validationUtilities.Utilities.getValue(threshold.otherValueLabel) + ' 相等'; + }, + 'InCollectionValidationRule': function InCollectionValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'MinimumInclusiveValueValidationRule': function MinimumInclusiveValueValidationRule(newValue, threshold) { + return '最小值为 ' + _validationUtilities.Utilities.getValue(threshold) + ' (包含)'; + }, + 'MinimumLengthValidationRule': function MinimumLengthValidationRule(newValue, threshold) { + return '最小字符长度为 ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'MinimumValueValidationRule': function MinimumValueValidationRule(newValue, threshold) { + return '最小值为 ' + _validationUtilities.Utilities.getValue(threshold) + '(不包含)'; + }, + 'MaximumInclusiveValueValidationRule': function MaximumInclusiveValueValidationRule(newValue, threshold) { + return '最大值为 ' + _validationUtilities.Utilities.getValue(threshold) + ' (包含)'; + }, + 'MaximumLengthValidationRule': function MaximumLengthValidationRule(newValue, threshold) { + return '最大字符长度为 ' + _validationUtilities.Utilities.getValue(threshold); + }, + 'MaximumValueValidationRule': function MaximumValueValidationRule(newValue, threshold) { + return '最大值为 ' + _validationUtilities.Utilities.getValue(threshold) + '(不包含)'; + }, + 'NumericValidationRule': function NumericValidationRule(newValue, threshold) { + return '请输入一个数字'; + }, + 'NoSpacesValidationRule': function NoSpacesValidationRule(newValue, threshold) { + return '不能包含空字符'; + }, + 'RegexValidationRule': function RegexValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'ContainsOnlyValidationRule': function ContainsOnlyValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'StrongPasswordValidationRule': function StrongPasswordValidationRule(newValue, threshold) { + return '应包含大小字母,数字和特殊字符'; + }, + 'MediumPasswordValidationRule': function MediumPasswordValidationRule(newValue, threshold) { + return '至少包含 ' + _validationUtilities.Utilities.getValue(threshold) + ' 种以下组合:小写字母,大写字母,数字和特殊字符'; + }, + 'URLValidationRule': function URLValidationRule(newValue, threshold) { + return 'URL格式不正确'; + } + } +}; +exports.data = data; \ No newline at end of file diff --git a/dist/commonjs/validation/validation-rules-collection.js b/dist/commonjs/validation/validation-rules-collection.js index 87666893..27158cc1 100644 --- a/dist/commonjs/validation/validation-rules-collection.js +++ b/dist/commonjs/validation/validation-rules-collection.js @@ -12,7 +12,8 @@ var ValidationRulesCollection = (function () { function ValidationRulesCollection(config) { _classCallCheck(this, ValidationRulesCollection); - this.isRequired = config.getValue('treatAllPropertiesAsMandatory'); + if (config) debugger; + this.isRequired = config ? config.getValue('allPropertiesAreMandatory') : false; this.validationRules = []; this.validationCollections = []; this.isRequiredMessage = null; diff --git a/dist/es6/resources/bg-BG.js b/dist/es6/resources/bg-BG.js new file mode 100644 index 00000000..3928fab0 --- /dev/null +++ b/dist/es6/resources/bg-BG.js @@ -0,0 +1,86 @@ +import {Utilities} from '../validation/utilities'; + +export let data = { + settings: { + 'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/ + }, + messages: { + 'isRequired': 'е задължително', + 'onValidateCallback' : 'невалидна стойност', + 'AlphaNumericOrWhitespaceValidationRule': (newValue, threshold) => { + return `трябва да съдържа само букви, цифри и интервали`; + }, + 'AlphaNumericValidationRule': (newValue, threshold) => { + return `трябва да съдържа само букви и цифри`; + }, + 'AlphaValidationRule' : (newValue, threshold) => { + return `трябва да съдържа само букви`; + }, + 'AlphaOrWhitespaceValidationRule' : (newValue, threshold) => { + return `трябва да съдържа само букви или интервали`; + }, + 'BetweenLengthValidationRule': (newValue, threshold) => { + return `броят на символите трябва да бъде между ${Utilities.getValue(threshold.minimumLength)} и ${Utilities.getValue(threshold.maximumLength)}`; + }, + 'BetweenValueValidationRule': (newValue, threshold) => { + return `стойността трябва да бъде между ${Utilities.getValue(threshold.minimumValue)} и ${Utilities.getValue(threshold.maximumValue)}`; + }, + 'CustomFunctionValidationRule': (newValue, threshold) => { + return `невалидна стойност` + }, + 'DigitValidationRule': (newValue, threshold) => { + return `трябва да съдържа само цифри`; + }, + 'EmailValidationRule': (newValue, threshold) => { + return `невалидна електронна поща`; + }, + 'EqualityValidationRule': (newValue, threshold) => { + return `стойността трябва да бъде ${Utilities.getValue(threshold.otherValue)}`; + }, + 'InEqualityValidationRule' : (newValue, threshold) => { + return `стойността не може да бъде ${Utilities.getValue(threshold.otherValue)}`; + }, + 'EqualityWithOtherLabelValidationRule': (newValue, threshold) => { + return `стойността не съвпада с ${Utilities.getValue(threshold.otherValueLabel)}`; + }, + 'InEqualityWithOtherLabelValidationRule' : (newValue, threshold) => { + return `стойността не може да съвпада с ${Utilities.getValue(threshold.otherValueLabel)}`; + }, + 'InCollectionValidationRule': (newValue, threshold) => { + return `невалидна стойност`; + }, + 'MinimumInclusiveValueValidationRule' : (newValue, threshold) => { + return `стойността трябва да бъде ${Utilities.getValue(threshold)} или повече`; + }, + 'MinimumLengthValidationRule': (newValue, threshold) => { + return `броят на символите трябва да бъде поне ${Utilities.getValue(threshold)}`; + }, + 'MinimumValueValidationRule': (newValue, threshold) => { + return `стойността трябва да бъде повече от ${Utilities.getValue(threshold)}`; + }, + 'MaximumInclusiveValueValidationRule' : (newValue, threshold) => { + return `стойността трябва да бъде ${Utilities.getValue(threshold)} или по-малко`; + }, + 'MaximumLengthValidationRule': (newValue, threshold) => { + return `броят на символите не може да бъде повече от ${Utilities.getValue(threshold)}`; + }, + 'MaximumValueValidationRule': (newValue, threshold) => { + return `стойността трябва да бъде по-малко от ${Utilities.getValue(threshold)}`; + }, + 'NumericValidationRule': (newValue, threshold) => { + return `стойността на полето трябва да бъде число`; + }, + 'RegexValidationRule': (newValue, threshold) => { + return `невалидна стойност`; + }, + 'ContainsOnlyValidationRule': (newValue, threshold) => { + return `невалидна стойност`; + }, + 'StrongPasswordValidationRule': (newValue, threshold) => { + return `трябва да съдържа комбинация от малки и големи букви, цифри и специални знаци`; + }, + 'MediumPasswordValidationRule' : (newValue, threshold) => { + return `трябва да съдържа поне ${Utilities.getValue(threshold)} от следните групи: малки и големи букви, цифри и специални знаци`; + } + } +}; diff --git a/dist/es6/resources/zh-CN.js b/dist/es6/resources/zh-CN.js new file mode 100644 index 00000000..747d3dac --- /dev/null +++ b/dist/es6/resources/zh-CN.js @@ -0,0 +1,92 @@ +import {Utilities} from '../validation/utilities'; + +export let data = { + settings: { + 'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/ + }, + messages: { + 'isRequired': '必填字段', + 'onValidateCallback' : '非法字段', + 'AlphaNumericOrWhitespaceValidationRule': (newValue, threshold) => { + return `不能使用特殊字符`; + }, + 'AlphaNumericValidationRule': (newValue, threshold) => { + return `只能包含字母数字字符`; + }, + 'AlphaValidationRule' : (newValue, threshold) => { + return `只能包含字母`; + }, + 'AlphaOrWhitespaceValidationRule' : (newValue, threshold) => { + return `只能包含字母或空格`; + }, + 'BetweenLengthValidationRule': (newValue, threshold) => { + return `字符长度应该在 ${Utilities.getValue(threshold.minimumLength)} ~ ${Utilities.getValue(threshold.maximumLength)} 之间`; + }, + 'BetweenValueValidationRule': (newValue, threshold) => { + return `字符长度应该在 ${Utilities.getValue(threshold.minimumValue)} ~ ${Utilities.getValue(threshold.maximumValue)} 之间`; + }, + 'CustomFunctionValidationRule': (newValue, threshold) => { + return `不合法的值` + }, + 'DigitValidationRule': (newValue, threshold) => { + return `只能包含数字`; + }, + 'EmailValidationRule': (newValue, threshold) => { + return `邮箱格式不正确`; + }, + 'EqualityValidationRule': (newValue, threshold) => { + return `应该等于 ${Utilities.getValue(threshold.otherValue)}`; + }, + 'InEqualityValidationRule' : (newValue, threshold) => { + return `不应该等于 ${Utilities.getValue(threshold.otherValue)}`; + }, + 'EqualityWithOtherLabelValidationRule': (newValue, threshold) => { + return `与 ${Utilities.getValue(threshold.otherValueLabel)} 不匹配`; + }, + 'InEqualityWithOtherLabelValidationRule' : (newValue, threshold) => { + return `不应该和 ${Utilities.getValue(threshold.otherValueLabel)} 相等`; + }, + 'InCollectionValidationRule': (newValue, threshold) => { + return `不合法的值`; + }, + 'MinimumInclusiveValueValidationRule' : (newValue, threshold) => { + return `最小值为 ${Utilities.getValue(threshold)} (包含)`; + }, + 'MinimumLengthValidationRule': (newValue, threshold) => { + return `最小字符长度为 ${Utilities.getValue(threshold)}`; + }, + 'MinimumValueValidationRule': (newValue, threshold) => { + return `最小值为 ${Utilities.getValue(threshold)}(不包含)`; + }, + 'MaximumInclusiveValueValidationRule' : (newValue, threshold) => { + return `最大值为 ${Utilities.getValue(threshold)} (包含)`; + }, + 'MaximumLengthValidationRule': (newValue, threshold) => { + return `最大字符长度为 ${Utilities.getValue(threshold)}`; + }, + 'MaximumValueValidationRule': (newValue, threshold) => { + return `最大值为 ${Utilities.getValue(threshold)}(不包含)`; + }, + 'NumericValidationRule': (newValue, threshold) => { + return `请输入一个数字`; + }, + 'NoSpacesValidationRule' : (newValue, threshold) => { + return `不能包含空字符`; + }, + 'RegexValidationRule': (newValue, threshold) => { + return `不合法的值`; + }, + 'ContainsOnlyValidationRule': (newValue, threshold) => { + return `不合法的值`; + }, + 'StrongPasswordValidationRule': (newValue, threshold) => { + return `应包含大小字母,数字和特殊字符`; + }, + 'MediumPasswordValidationRule' : (newValue, threshold) => { + return `至少包含 ${Utilities.getValue(threshold)} 种以下组合:小写字母,大写字母,数字和特殊字符`; + }, + 'URLValidationRule' : (newValue, threshold) =>{ + return `URL格式不正确` + } + } +}; diff --git a/dist/es6/validation/validation-rules-collection.js b/dist/es6/validation/validation-rules-collection.js index a2649e6a..8385da6e 100644 --- a/dist/es6/validation/validation-rules-collection.js +++ b/dist/es6/validation/validation-rules-collection.js @@ -3,7 +3,9 @@ import {ValidationLocale} from '../validation/validation-locale'; export class ValidationRulesCollection { constructor(config) { - this.isRequired = config.getValue('treatAllPropertiesAsMandatory'); + if(config) + debugger; + this.isRequired = config ? config.getValue('allPropertiesAreMandatory') : false; this.validationRules = []; this.validationCollections = []; this.isRequiredMessage = null; diff --git a/dist/system/resources/bg-BG.js b/dist/system/resources/bg-BG.js new file mode 100644 index 00000000..b5087b1e --- /dev/null +++ b/dist/system/resources/bg-BG.js @@ -0,0 +1,98 @@ +System.register(['../validation/utilities'], function (_export) { + 'use strict'; + + var Utilities, data; + return { + setters: [function (_validationUtilities) { + Utilities = _validationUtilities.Utilities; + }], + execute: function () { + data = { + settings: { + 'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/ + }, + messages: { + 'isRequired': 'е задължително', + 'onValidateCallback': 'невалидна стойност', + 'AlphaNumericOrWhitespaceValidationRule': function AlphaNumericOrWhitespaceValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви, цифри и интервали'; + }, + 'AlphaNumericValidationRule': function AlphaNumericValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви и цифри'; + }, + 'AlphaValidationRule': function AlphaValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви'; + }, + 'AlphaOrWhitespaceValidationRule': function AlphaOrWhitespaceValidationRule(newValue, threshold) { + return 'трябва да съдържа само букви или интервали'; + }, + 'BetweenLengthValidationRule': function BetweenLengthValidationRule(newValue, threshold) { + return 'броят на символите трябва да бъде между ' + Utilities.getValue(threshold.minimumLength) + ' и ' + Utilities.getValue(threshold.maximumLength); + }, + 'BetweenValueValidationRule': function BetweenValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде между ' + Utilities.getValue(threshold.minimumValue) + ' и ' + Utilities.getValue(threshold.maximumValue); + }, + 'CustomFunctionValidationRule': function CustomFunctionValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'DigitValidationRule': function DigitValidationRule(newValue, threshold) { + return 'трябва да съдържа само цифри'; + }, + 'EmailValidationRule': function EmailValidationRule(newValue, threshold) { + return 'невалидна електронна поща'; + }, + 'EqualityValidationRule': function EqualityValidationRule(newValue, threshold) { + return 'стойността трябва да бъде ' + Utilities.getValue(threshold.otherValue); + }, + 'InEqualityValidationRule': function InEqualityValidationRule(newValue, threshold) { + return 'стойността не може да бъде ' + Utilities.getValue(threshold.otherValue); + }, + 'EqualityWithOtherLabelValidationRule': function EqualityWithOtherLabelValidationRule(newValue, threshold) { + return 'стойността не съвпада с ' + Utilities.getValue(threshold.otherValueLabel); + }, + 'InEqualityWithOtherLabelValidationRule': function InEqualityWithOtherLabelValidationRule(newValue, threshold) { + return 'стойността не може да съвпада с ' + Utilities.getValue(threshold.otherValueLabel); + }, + 'InCollectionValidationRule': function InCollectionValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'MinimumInclusiveValueValidationRule': function MinimumInclusiveValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде ' + Utilities.getValue(threshold) + ' или повече'; + }, + 'MinimumLengthValidationRule': function MinimumLengthValidationRule(newValue, threshold) { + return 'броят на символите трябва да бъде поне ' + Utilities.getValue(threshold); + }, + 'MinimumValueValidationRule': function MinimumValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде повече от ' + Utilities.getValue(threshold); + }, + 'MaximumInclusiveValueValidationRule': function MaximumInclusiveValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде ' + Utilities.getValue(threshold) + ' или по-малко'; + }, + 'MaximumLengthValidationRule': function MaximumLengthValidationRule(newValue, threshold) { + return 'броят на символите не може да бъде повече от ' + Utilities.getValue(threshold); + }, + 'MaximumValueValidationRule': function MaximumValueValidationRule(newValue, threshold) { + return 'стойността трябва да бъде по-малко от ' + Utilities.getValue(threshold); + }, + 'NumericValidationRule': function NumericValidationRule(newValue, threshold) { + return 'стойността на полето трябва да бъде число'; + }, + 'RegexValidationRule': function RegexValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'ContainsOnlyValidationRule': function ContainsOnlyValidationRule(newValue, threshold) { + return 'невалидна стойност'; + }, + 'StrongPasswordValidationRule': function StrongPasswordValidationRule(newValue, threshold) { + return 'трябва да съдържа комбинация от малки и големи букви, цифри и специални знаци'; + }, + 'MediumPasswordValidationRule': function MediumPasswordValidationRule(newValue, threshold) { + return 'трябва да съдържа поне ' + Utilities.getValue(threshold) + ' от следните групи: малки и големи букви, цифри и специални знаци'; + } + } + }; + + _export('data', data); + } + }; +}); \ No newline at end of file diff --git a/dist/system/resources/zh-CN.js b/dist/system/resources/zh-CN.js new file mode 100644 index 00000000..53e86efe --- /dev/null +++ b/dist/system/resources/zh-CN.js @@ -0,0 +1,104 @@ +System.register(['../validation/utilities'], function (_export) { + 'use strict'; + + var Utilities, data; + return { + setters: [function (_validationUtilities) { + Utilities = _validationUtilities.Utilities; + }], + execute: function () { + data = { + settings: { + 'numericRegex': /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/ + }, + messages: { + 'isRequired': '必填字段', + 'onValidateCallback': '非法字段', + 'AlphaNumericOrWhitespaceValidationRule': function AlphaNumericOrWhitespaceValidationRule(newValue, threshold) { + return '不能使用特殊字符'; + }, + 'AlphaNumericValidationRule': function AlphaNumericValidationRule(newValue, threshold) { + return '只能包含字母数字字符'; + }, + 'AlphaValidationRule': function AlphaValidationRule(newValue, threshold) { + return '只能包含字母'; + }, + 'AlphaOrWhitespaceValidationRule': function AlphaOrWhitespaceValidationRule(newValue, threshold) { + return '只能包含字母或空格'; + }, + 'BetweenLengthValidationRule': function BetweenLengthValidationRule(newValue, threshold) { + return '字符长度应该在 ' + Utilities.getValue(threshold.minimumLength) + ' ~ ' + Utilities.getValue(threshold.maximumLength) + ' 之间'; + }, + 'BetweenValueValidationRule': function BetweenValueValidationRule(newValue, threshold) { + return '字符长度应该在 ' + Utilities.getValue(threshold.minimumValue) + ' ~ ' + Utilities.getValue(threshold.maximumValue) + ' 之间'; + }, + 'CustomFunctionValidationRule': function CustomFunctionValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'DigitValidationRule': function DigitValidationRule(newValue, threshold) { + return '只能包含数字'; + }, + 'EmailValidationRule': function EmailValidationRule(newValue, threshold) { + return '邮箱格式不正确'; + }, + 'EqualityValidationRule': function EqualityValidationRule(newValue, threshold) { + return '应该等于 ' + Utilities.getValue(threshold.otherValue); + }, + 'InEqualityValidationRule': function InEqualityValidationRule(newValue, threshold) { + return '不应该等于 ' + Utilities.getValue(threshold.otherValue); + }, + 'EqualityWithOtherLabelValidationRule': function EqualityWithOtherLabelValidationRule(newValue, threshold) { + return '与 ' + Utilities.getValue(threshold.otherValueLabel) + ' 不匹配'; + }, + 'InEqualityWithOtherLabelValidationRule': function InEqualityWithOtherLabelValidationRule(newValue, threshold) { + return '不应该和 ' + Utilities.getValue(threshold.otherValueLabel) + ' 相等'; + }, + 'InCollectionValidationRule': function InCollectionValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'MinimumInclusiveValueValidationRule': function MinimumInclusiveValueValidationRule(newValue, threshold) { + return '最小值为 ' + Utilities.getValue(threshold) + ' (包含)'; + }, + 'MinimumLengthValidationRule': function MinimumLengthValidationRule(newValue, threshold) { + return '最小字符长度为 ' + Utilities.getValue(threshold); + }, + 'MinimumValueValidationRule': function MinimumValueValidationRule(newValue, threshold) { + return '最小值为 ' + Utilities.getValue(threshold) + '(不包含)'; + }, + 'MaximumInclusiveValueValidationRule': function MaximumInclusiveValueValidationRule(newValue, threshold) { + return '最大值为 ' + Utilities.getValue(threshold) + ' (包含)'; + }, + 'MaximumLengthValidationRule': function MaximumLengthValidationRule(newValue, threshold) { + return '最大字符长度为 ' + Utilities.getValue(threshold); + }, + 'MaximumValueValidationRule': function MaximumValueValidationRule(newValue, threshold) { + return '最大值为 ' + Utilities.getValue(threshold) + '(不包含)'; + }, + 'NumericValidationRule': function NumericValidationRule(newValue, threshold) { + return '请输入一个数字'; + }, + 'NoSpacesValidationRule': function NoSpacesValidationRule(newValue, threshold) { + return '不能包含空字符'; + }, + 'RegexValidationRule': function RegexValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'ContainsOnlyValidationRule': function ContainsOnlyValidationRule(newValue, threshold) { + return '不合法的值'; + }, + 'StrongPasswordValidationRule': function StrongPasswordValidationRule(newValue, threshold) { + return '应包含大小字母,数字和特殊字符'; + }, + 'MediumPasswordValidationRule': function MediumPasswordValidationRule(newValue, threshold) { + return '至少包含 ' + Utilities.getValue(threshold) + ' 种以下组合:小写字母,大写字母,数字和特殊字符'; + }, + 'URLValidationRule': function URLValidationRule(newValue, threshold) { + return 'URL格式不正确'; + } + } + }; + + _export('data', data); + } + }; +}); \ No newline at end of file diff --git a/dist/system/validation/validation-rules-collection.js b/dist/system/validation/validation-rules-collection.js index 35cb2c20..bd89e7f1 100644 --- a/dist/system/validation/validation-rules-collection.js +++ b/dist/system/validation/validation-rules-collection.js @@ -16,7 +16,8 @@ System.register(['../validation/utilities', '../validation/validation-locale'], function ValidationRulesCollection(config) { _classCallCheck(this, ValidationRulesCollection); - this.isRequired = config.getValue('treatAllPropertiesAsMandatory'); + if (config) debugger; + this.isRequired = config ? config.getValue('allPropertiesAreMandatory') : false; this.validationRules = []; this.validationCollections = []; this.isRequiredMessage = null;