x25 17.0.11 → 17.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utility/others.js +1 -1
- package/utility/validation/common.js +16 -16
- package/utility/validation/index.js +2 -2
package/package.json
CHANGED
package/utility/others.js
CHANGED
|
@@ -11,7 +11,7 @@ var _react2 = _interopRequireDefault(_react);
|
|
|
11
11
|
|
|
12
12
|
var _immutable = require("redux-form/immutable");
|
|
13
13
|
|
|
14
|
-
var _words = require("
|
|
14
|
+
var _words = require("./words");
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
@@ -11,7 +11,7 @@ var _templateObject = _taggedTemplateLiteral([" ", " ", ""], [" ", " ", ""]);
|
|
|
11
11
|
|
|
12
12
|
var _validate = require("./validate");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _words = require("../../words");
|
|
15
15
|
|
|
16
16
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
17
|
|
|
@@ -26,7 +26,7 @@ var validateHumanNid = exports.validateHumanNid = function validateHumanNid() {
|
|
|
26
26
|
var optional = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
27
27
|
return function (value) {
|
|
28
28
|
var notValid = optional && typeof value !== "undefined" && value !== "" && !(0, _validate.isValidCNP)(value) || !optional && (typeof value === "undefined" || !(0, _validate.isValidCNP)(value)),
|
|
29
|
-
error = notValid ?
|
|
29
|
+
error = notValid ? _words.words.EnterValidPersonalID : null;
|
|
30
30
|
|
|
31
31
|
return {
|
|
32
32
|
notValid: notValid,
|
|
@@ -37,7 +37,7 @@ var validateHumanNid = exports.validateHumanNid = function validateHumanNid() {
|
|
|
37
37
|
|
|
38
38
|
var validateCif = exports.validateCif = function validateCif(value) {
|
|
39
39
|
var notValid = typeof value === "undefined" || !(0, _validate.isValidCIF)(value),
|
|
40
|
-
error = notValid ?
|
|
40
|
+
error = notValid ? _words.words.EnterAValidFiscalID : null;
|
|
41
41
|
|
|
42
42
|
return {
|
|
43
43
|
notValid: notValid,
|
|
@@ -47,7 +47,7 @@ var validateCif = exports.validateCif = function validateCif(value) {
|
|
|
47
47
|
|
|
48
48
|
var validateBankAccount = exports.validateBankAccount = function validateBankAccount(value) {
|
|
49
49
|
var notValid = typeof value !== "undefined" && value !== "" && !(0, _validate.isValidBankAccount)(value),
|
|
50
|
-
error = notValid ?
|
|
50
|
+
error = notValid ? _words.words.EnterValidBankAccount : null;
|
|
51
51
|
|
|
52
52
|
return {
|
|
53
53
|
notValid: notValid,
|
|
@@ -59,7 +59,7 @@ var validateEmail = exports.validateEmail = function validateEmail(_ref) {
|
|
|
59
59
|
var optional = _ref.optional;
|
|
60
60
|
return function (value) {
|
|
61
61
|
var notValid = optional && typeof value !== "undefined" && value !== "" && !(0, _validate.isValidEmail)(value) || !optional && (typeof value === "undefined" || !(0, _validate.isValidEmail)(value)),
|
|
62
|
-
error = notValid ?
|
|
62
|
+
error = notValid ? _words.words.EnterValidEmail : null;
|
|
63
63
|
|
|
64
64
|
return {
|
|
65
65
|
notValid: notValid,
|
|
@@ -70,7 +70,7 @@ var validateEmail = exports.validateEmail = function validateEmail(_ref) {
|
|
|
70
70
|
|
|
71
71
|
var validateOptionalDate = exports.validateOptionalDate = function validateOptionalDate(value) {
|
|
72
72
|
var notValid = !(typeof value === "undefined" || value === "" || value === null || (0, _validate.isValidDateStamp)(value)),
|
|
73
|
-
error = notValid ?
|
|
73
|
+
error = notValid ? _words.words.EnterValidDate : null;
|
|
74
74
|
|
|
75
75
|
return {
|
|
76
76
|
notValid: notValid,
|
|
@@ -80,7 +80,7 @@ var validateOptionalDate = exports.validateOptionalDate = function validateOptio
|
|
|
80
80
|
|
|
81
81
|
var validateDate = exports.validateDate = function validateDate(value) {
|
|
82
82
|
var notValid = !(typeof value !== "undefined" && (0, _validate.isValidDateStamp)(value)),
|
|
83
|
-
error = notValid ?
|
|
83
|
+
error = notValid ? _words.words.EnterValidDate : null;
|
|
84
84
|
|
|
85
85
|
return {
|
|
86
86
|
notValid: notValid,
|
|
@@ -117,9 +117,9 @@ var getNumberRangeError = function getNumberRangeError(_ref3) {
|
|
|
117
117
|
|
|
118
118
|
var minTense = typeof min === "number" ? getNumberTense(min) : "",
|
|
119
119
|
maxTense = typeof max === "number" ? getNumberTense(max) : "",
|
|
120
|
-
range = typeof min === "number" && typeof max === "number" ? " " +
|
|
120
|
+
range = typeof min === "number" && typeof max === "number" ? " " + _words.words.NumberBetween + " " + minTense + " " + _words.words.NumberAnd + " " + maxTense : typeof max === "number" ? " " + _words.words.NumberUpTo + " " + maxTense : typeof min === "number" ? " " + _words.words.NumberGreaterThan + " " + minTense : "";
|
|
121
121
|
|
|
122
|
-
return
|
|
122
|
+
return _words.words.NumberMustBe(_templateObject, integer ? _words.words.NumberInteger : _words.words.NumberFloat, range);
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
var validateFloat = exports.validateFloat = function validateFloat(props) {
|
|
@@ -164,9 +164,9 @@ var getStringTense = function getStringTense(_ref4) {
|
|
|
164
164
|
var maxTense = max ? getNumberTense(max) : "",
|
|
165
165
|
minTense = min ? getNumberTense(min) : "",
|
|
166
166
|
isBetween = typeof max === "number" && typeof min === "number",
|
|
167
|
-
rangeError = isBetween ?
|
|
167
|
+
rangeError = isBetween ? _words.words.NumberBetween + " " + minTense + " " + _words.words.NumberAnd + " " + maxTense : typeof max === "number" ? _words.words.NumberUpTo + " " + maxTense : typeof min === "number" ? _words.words.NumberGreaterThan + " " + minTense : "";
|
|
168
168
|
|
|
169
|
-
return what + " " +
|
|
169
|
+
return what + " " + _words.words.Has + " " + rangeError + " " + _words.words.Chars;
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
var validateStringRange = function validateStringRange(_ref5) {
|
|
@@ -188,7 +188,7 @@ var validateStringRange = function validateStringRange(_ref5) {
|
|
|
188
188
|
var validateString = exports.validateString = function validateString(props) {
|
|
189
189
|
return function (value) {
|
|
190
190
|
var _props$what = props.what,
|
|
191
|
-
what = _props$what === undefined ?
|
|
191
|
+
what = _props$what === undefined ? _words.words.TheField : _props$what,
|
|
192
192
|
min = props.min,
|
|
193
193
|
max = props.max,
|
|
194
194
|
optional = props.optional;
|
|
@@ -220,7 +220,7 @@ var validateString = exports.validateString = function validateString(props) {
|
|
|
220
220
|
var validateSelect = exports.validateSelect = function validateSelect(message) {
|
|
221
221
|
return function (value) {
|
|
222
222
|
var notValid = typeof value === "undefined" || value === null || value === "",
|
|
223
|
-
error = notValid ? typeof message === "undefined" ?
|
|
223
|
+
error = notValid ? typeof message === "undefined" ? _words.words.PleaseSelect : message : null;
|
|
224
224
|
|
|
225
225
|
return {
|
|
226
226
|
notValid: notValid,
|
|
@@ -232,7 +232,7 @@ var validateSelect = exports.validateSelect = function validateSelect(message) {
|
|
|
232
232
|
var validateID = exports.validateID = function validateID(message) {
|
|
233
233
|
return function (value) {
|
|
234
234
|
var notValid = !(typeof value === "number" && !isNaN(value)),
|
|
235
|
-
error = notValid ? typeof message === "undefined" ?
|
|
235
|
+
error = notValid ? typeof message === "undefined" ? _words.words.PleaseSelect : message : null;
|
|
236
236
|
|
|
237
237
|
return {
|
|
238
238
|
notValid: notValid,
|
|
@@ -244,7 +244,7 @@ var validateID = exports.validateID = function validateID(message) {
|
|
|
244
244
|
var validateCaptchaSolution = exports.validateCaptchaSolution = function validateCaptchaSolution(value) {
|
|
245
245
|
var pattern = /^[0-9]{6}$/,
|
|
246
246
|
notValid = typeof value !== "undefined" && !pattern.test(value),
|
|
247
|
-
error = notValid ?
|
|
247
|
+
error = notValid ? _words.words.Has6Digits : null;
|
|
248
248
|
|
|
249
249
|
return {
|
|
250
250
|
notValid: notValid,
|
|
@@ -255,7 +255,7 @@ var validateCaptchaSolution = exports.validateCaptchaSolution = function validat
|
|
|
255
255
|
var validateResetToken = exports.validateResetToken = function validateResetToken(value) {
|
|
256
256
|
var tokenSize = 64,
|
|
257
257
|
notValid = typeof value === "undefined" || String(value).length !== tokenSize,
|
|
258
|
-
error = notValid ?
|
|
258
|
+
error = notValid ? _words.words.CodeNotValid : null;
|
|
259
259
|
|
|
260
260
|
return {
|
|
261
261
|
notValid: notValid,
|
|
@@ -41,7 +41,7 @@ Object.keys(_validate).forEach(function (key) {
|
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _words = require("../../words");
|
|
45
45
|
|
|
46
46
|
var processErrors = function processErrors(_ref, _ref2) {
|
|
47
47
|
var error = _ref.error,
|
|
@@ -92,7 +92,7 @@ var performValidateRows = exports.performValidateRows = function performValidate
|
|
|
92
92
|
if (notValid) {
|
|
93
93
|
return {
|
|
94
94
|
notValid: notValid,
|
|
95
|
-
_error:
|
|
95
|
+
_error: _words.words.AddARow,
|
|
96
96
|
isArray: true
|
|
97
97
|
};
|
|
98
98
|
}
|