@altiore/form
Advanced tools
Comparing version 0.3.39 to 0.3.40
@@ -19,8 +19,7 @@ import React from 'react'; | ||
var onSubmit = _a.onSubmit; | ||
var lengthValidator = Joi.string().max(5).min(2).messages({ | ||
'string.min': 'Слишком коротко', | ||
}); | ||
return (React.createElement(Form, { onSubmit: onSubmit, defaultValues: { first: 'NOT DEFAULT' } }, | ||
React.createElement(Field, { name: "first", label: "First", defaultValue: 'DEFAULT', validators: [ | ||
Joi.string().max(5).min(2).messages({ | ||
'string.min': 'Слишком коротко', | ||
}).validate, | ||
] }), | ||
React.createElement(Field, { name: "first", label: "First", defaultValue: 'DEFAULT', validators: [lengthValidator.validate] }), | ||
React.createElement(Field, { name: "second", label: "Second", defaultValue: 'test', validators: [minLength(3)] }))); | ||
@@ -27,0 +26,0 @@ }; |
@@ -9,3 +9,3 @@ export var maxLength = function (length) { | ||
return { | ||
error: new Error("The length of the entered value should be no more than " + length + " characters"), | ||
error: new Error("\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0434\u043B\u0438\u043D\u0430 \u0432\u0432\u0435\u0434\u0435\u043D\u043D\u043E\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F - " + length), | ||
value: value, | ||
@@ -12,0 +12,0 @@ }; |
@@ -8,3 +8,3 @@ import { maxLength } from '..'; | ||
expect(maxLength(5)('text that more than 5 chars')).toEqual({ | ||
error: new Error('The length of the entered value should be no more than 5 characters'), | ||
error: new Error('Максимальная длина введенного значения - 5'), | ||
value: 'text that more than 5 chars', | ||
@@ -11,0 +11,0 @@ }); |
@@ -12,3 +12,3 @@ export var minLength = function (length) { | ||
return { | ||
error: new Error("The length of the entered value should be more than " + length + " characters"), | ||
error: new Error("\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0434\u043B\u0438\u043D\u0430 \u0432\u0432\u0435\u0434\u0435\u043D\u043D\u043E\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F - " + length), | ||
value: value, | ||
@@ -15,0 +15,0 @@ }; |
@@ -5,3 +5,3 @@ import { minLength } from '..'; | ||
expect(minLength(15)('wrong text')).toEqual({ | ||
error: new Error('The length of the entered value should be more than 15 characters'), | ||
error: new Error('Минимальная длина введенного значения - 15'), | ||
value: 'wrong text', | ||
@@ -8,0 +8,0 @@ }); |
{ | ||
"name": "@altiore/form", | ||
"version": "0.3.39", | ||
"version": "0.3.40", | ||
"description": "Form helper for building powerful forms", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78838
1543