diff --git a/dist/locale/el.js b/dist/locale/el.js index f48f6de..121cd57 100644 --- a/dist/locale/el.js +++ b/dist/locale/el.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/locale/es.js b/dist/locale/es.js index f25b83b..72934e6 100644 --- a/dist/locale/es.js +++ b/dist/locale/es.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/locale/fa.js b/dist/locale/fa.js index 42f2d12..57d7a6e 100644 --- a/dist/locale/fa.js +++ b/dist/locale/fa.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/locale/fr.js b/dist/locale/fr.js index 4772276..a44fbf4 100644 --- a/dist/locale/fr.js +++ b/dist/locale/fr.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/locale/id.js b/dist/locale/id.js index 1c77495..704a390 100644 --- a/dist/locale/id.js +++ b/dist/locale/id.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/locale/it.js b/dist/locale/it.js index 2ff8a9c..6938a68 100644 --- a/dist/locale/it.js +++ b/dist/locale/it.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/locale/ja.js b/dist/locale/ja.js new file mode 100644 index 0000000..568635f --- /dev/null +++ b/dist/locale/ja.js @@ -0,0 +1,51 @@ +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { + define(['simple-react-validator'], factory); + } else if (typeof exports === 'object') { + module.exports = factory(require('simple-react-validator')); + } else { + root.SimpleReactValidatorLocaleJa = factory(root.SimpleReactValidator); + } +}(this, function(SimpleReactValidator) { +"use strict"; + +// Japanese +SimpleReactValidator.addLocale('ja', { + accepted: ':attributeを受け入れる必要があります。', + after: ':attributeは:dateより後でなければなりません。', + after_or_equal: ':attributeは:date以降である必要があります。', + alpha: ':attributeには文字のみを含めることができます。', + alpha_space: ':attributeには文字とスペースのみを含めることができます。', + alpha_num: ':attributeには文字と数字のみを含めることができます。', + alpha_num_space: ':attributeには文字、数字、およびスペースのみを含めることができます。', + alpha_num_dash: ':attributeには文字、数字、ダッシュ、およびアンダースコアのみを含めることができます。', + alpha_num_dash_space: ':attributeには文字、数字、ダッシュ、アンダースコア、およびスペースのみを含めることができます。', + array: ':attributeは配列でなければなりません。', + before: ':attributeは:dateより前でなければなりません。', + before_or_equal: ':attributeは:dateより前か:dateである必要があります。', + between: ':attributeは:minと:max:typeの間でなければなりません。', + "boolean": ':attributeはブール値である必要があります。', + card_exp: ':attributeは有効な有効期限である必要があります。', + card_num: ':attributeは有効なクレジットカード番号である必要があります。', + currency: ':attributeは有効な通貨である必要があります。', + date: ':attributeは日付でなければなりません。', + date_equals: ':attributeは:dateである必要があります。', + email: ':attributeは有効なメールアドレスである必要があります。', + "in": ':attributeは:valuesのいずれかと一致する必要があります。', + integer: ':attributeは整数でなければなりません。', + max: ':attributeは:max:typeを超えてはなりません。', + min: ':attributeは:min:type未満であってはなりません。', + not_in: ':attributeは:valuesのいずれかと一致してはなりません。', + not_regex: ':attributeは形式が無効です。', + numeric: ':attributeは数値でなければなりません。', + phone: ':attributeは有効な電話番号である必要があります。', + regex: ':attributeは形式が無効です。', + required: ':attributeは必須です。', + size: ':attributeは:size:typeである必要があります。', + string: ':attributeは文字列でなければなりません。', + "typeof": ':attributeは:typeの正しいタイプではありません。', + url: ':attributeは有効なURLである必要があります。' +}); +return null; +})); diff --git a/dist/locale/min/el.min.js b/dist/locale/min/el.min.js index 6d7ba73..40c3979 100644 --- a/dist/locale/min/el.min.js +++ b/dist/locale/min/el.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(t,e){"function"==typeof define&&define.amd?define(["simple-react-validator"],e):"object"==typeof exports?module.exports=e(require("simple-react-validator")):t.SimpleReactValidatorLocaleEl=e(t.SimpleReactValidator)}(this,function(t){"use strict";return t.addLocale("el",{accepted:"Πρέπει να αποδεχετείτε το πεδίο :attribute",after:"Η ημ/νία :attribute πρέπει να είναι μετά από :date.",after_or_equal:"Η ημ/νία :attribute πρέπει να είναι ίση με ή μετά από :date.",alpha:"Το πεδίο :attribute μπορεί να περιέχει μόνο γράμματα",alpha_space:"Το πεδίο :attribute μπορεί να περιέχει μόνο γράμματα και κενά.",alpha_num:"Το πεδίο :attribute μπορεί να περιέχει μόνο γράμματα και αριθμούς.",alpha_num_space:"Το πεδίο :attribute μπορεί να περιέχει μόνο γράμματα, κενά και αριθμούς.",alpha_num_dash:"Το πεδίο :attribute μπορεί να περιέχει μόνο γράμματα, κενά και παύλες(-).",alpha_num_dash_space:"Το πεδίο :attribute μπορεί να περιέχει μόνο αριθμούς, κενά και παύλες(-).",array:"Το πεδίο :attribute πρέπει να είναι array.",before:"Η ημ/νία πρέπει να είναι πριν από :date.",before_or_equal:"Η ημ/νία πρέπει να είναι πριν ή ίση με :date.",between:"Η τιμή του πεδίου :attribute πρέπει να βρίσκεται ανάμεσα από :min - :max:type.",boolean:"Το πεδίο :attribute πρέπει να είναι boolean",card_exp:"To πεδίο :attribute πρέπει να είναι μια έγκυρη ημ/νία.",card_num:"Το πεδίο :attribute πρέπει να είναι ένας έγκυρος αριθμός κάρτας.",currency:"Το πεδίο :attribute πρέπει να έιναι ένα έγκυρο ποσό",date:"Το πεδίο :attribute πρέπει να είναι μια έγκυρη ημ/νία.",date_equals:"Η ημ/νία :attribute πρέπει να είναι ίδια με :date.",email:"Το πεδίο :attribute πρέπει να είναι ένα έγκυρο email.",in:"To πεδίο :attribute πρέπει να περιέχει τις τιμές :values.",integer:"Το πεδίο :attribute πρέπει να είναι ένας ακέραιος αριθμός.",max:"Η τιμή του πεδίου :attribute δεν μπορεί να είναι μεγαλύτερη απο :max:type.",min:"Η τιμή του πεδίου :attribute πρέπει να είναι τουλάχιστον :min:type.",not_in:"Η επιλεγμένη τιμή :attribute δεν πρέπει να περιέχει :values.",not_regex:"Η τιμή :attribute δεν πρέπει να ταιριάζει με το υπόδειγμα.",numeric:"Η τιμή :attribute πρέπει να είναι αριθμός.",phone:"Το πεδίο :attribute πρέπει να είναι ένας έγκυρος τηλεφωνικός αριθμός.",regex:"Η τιμή του πεδίου :attribute πρέπει να ταιριάζει στο υπόδειγμα.",required:"Το πεδίο :attribute είναι υποχρεωτικό.",size:"Η τιμή του πεδίου :attribute πρέπει να ισούται με :size:type.",string:"Ο τύπος του πεδίου :attribute πρέπει να ειναι string",typeof:"Η τιμή του πεδίου :attribute δεν ταιρίαζει με τον τύπο :type.",url:"Η τιμή του πεδίου :attribute πρέπει να είναι της μορφής λινκ(url)."}),null}); \ No newline at end of file diff --git a/dist/locale/min/es.min.js b/dist/locale/min/es.min.js index fdbf45e..5b805fc 100644 --- a/dist/locale/min/es.min.js +++ b/dist/locale/min/es.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(e,t){"function"==typeof define&&define.amd?define(["simple-react-validator"],t):"object"==typeof exports?module.exports=t(require("simple-react-validator")):e.SimpleReactValidatorLocaleEs=t(e.SimpleReactValidator)}(this,function(e){"use strict";return e.addLocale("es",{accepted:":attribute debe ser aceptado.",after:":attribute debe ser una fecha posterior a :date.",after_or_equal:":attribute debe ser una fecha posterior o igual a :date.",alpha:":attribute sólo debe contener letras.",array:":attribute debe ser un conjunto.",before:":attribute debe ser una fecha anterior a :date.",before_or_equal:":attribute debe ser una fecha anterior o igual a :date.",between:":attribute tiene que estar entre :min - :max:type.",boolean:"El campo :attribute debe tener un valor verdadero o falso.",date:":attribute no es una fecha válida.",date_equals:":attribute debe ser una fecha igual a :date.",email:":attribute no es un correo válido",in:":attribute es inválido :values.",integer:":attribute debe ser un número entero.",max:":attribute no debe ser mayor a :max:type.",min:"El tamaño de :attribute debe ser de al menos :min:type.",not_in:":attribute es inválido :values.",not_regex:"El formato del campo :attribute no es válido.",numeric:":attribute debe ser numérico.",regex:"El formato de :attribute es inválido.",required:"El campo :attribute es obligatorio.",size:"El tamaño de :attribute debe ser :size:type.",string:"El campo :attribute debe ser una cadena de caracteres.",url:"El formato :attribute es inválido."}),null}); \ No newline at end of file diff --git a/dist/locale/min/fa.min.js b/dist/locale/min/fa.min.js index 6c097e9..ccd8a9b 100644 --- a/dist/locale/min/fa.min.js +++ b/dist/locale/min/fa.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(t,e){"function"==typeof define&&define.amd?define(["simple-react-validator"],e):"object"==typeof exports?module.exports=e(require("simple-react-validator")):t.SimpleReactValidatorLocaleFa=e(t.SimpleReactValidator)}(this,function(t){"use strict";return t.addLocale("fa",{accepted:":attribute مورد قبول قرار نگرفت",after:":attribute باید تاریخی بعد از :date باشد.",after_or_equal:":attribute باید تاریخی برابر یا بعد از :date باشد.",alpha:":attribute باید شامل حروف انگلیسی باشد.",alpha_space:":attribute باید شامل حروف انگلیسی و فاصله باشد.",alpha_num:":attribute باید شامل اعداد و حروف انگلیسی باشد.",alpha_num_space:":attribute باید شامل اعداد و حروف انگلیسی و فاصله باشد.",alpha_num_dash:":attribute باید شامل اعداد و حروف انگلیسی و خط تیره.",alpha_num_dash_space:":attribute باید شامل اعداد و حروف انگلیسی، خط تیره و فاصله باشد.",array:":attribute باید یک آرایه باشد.",before:":attribute باید قبل از :date باشد.",before_or_equal:":attribute باید قبل یا برابر با :date باشد.",between:":attribute باید بین :min و :max:type باشد.",boolean:":attribute باید یک بول باشد.",card_exp:":attribute باید یک تاریخ انقضا معتبر باشد.",card_num:":attribute باید یک شماره کارت اعتباری معتبر باشد.",currency:":attribute باید یک ارز معتبر باشد.",date:":attribute باید تاریخ باشد.",date_equals:":attribute باید در :date بازه باشد.",email:":attribute بایدآدرس ایمیل معتبر باشد.",in:":attribute باید یکی از :values باشد.",integer:":attribute باید یک عدد صحیح باشد.",max:":attribute باید کمتر از :max:type باشد.",min:":attribute باید بیشتر از :min:type باشد.",not_in:":attribute نباید مشابه با :values باشد.",not_regex:":attribute نباید با الگوی مورد نیاز مطابقت داشته باشد.",numeric:":attribute باید عدد باشد.",phone:":attribute باید یک شماره تلفن معتبر باشد.",regex:":attribute باید با الگوی مورد نیاز مطابقت داشته باشد.",required:"قسمت :attribute الزامی است.",size:":attribute باید تبدیل شود به size:type:.",string:":attribute باید یک رشته باشد.",typeof:":attribute نوع صحیح :type نوع نیست.",url:":attribute باید یک آدرس اینترنتی باشد."}),null}); \ No newline at end of file diff --git a/dist/locale/min/fr.min.js b/dist/locale/min/fr.min.js index 7c6db65..f79a414 100644 --- a/dist/locale/min/fr.min.js +++ b/dist/locale/min/fr.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(e,t){"function"==typeof define&&define.amd?define(["simple-react-validator"],t):"object"==typeof exports?module.exports=t(require("simple-react-validator")):e.SimpleReactValidatorLocaleFr=t(e.SimpleReactValidator)}(this,function(e){"use strict";return e.addLocale("fr",{accepted:"Le champ :attribute doit être accepté.",after:"Le champ :attribute doit être après :date.",after_or_equal:"Le champ :attribute doit correspondre ou bien être après :date.",alpha:"Le champ :attribute ne peut contenir que des lettres.",alpha_space:"Le champ :attribute ne peut contenir que des lettres et des espaces.",alpha_num:"Le champ :attribute ne peut contenir que des lettres et des chiffres.",alpha_num_space:"Le champ :attribute ne peut contenir que des lettres, chiffres, et espaces.",alpha_num_dash:"Le champ :attribute ne peut contenir que des lettres, chiffres, et tirets.",alpha_num_dash_space:"Le champ :attribute ne peut contenir que des lettres, chiffres, tirets, et espaces.",array:"Le champ :attribute doit êttre un tableau.",before:"Le champ :attribute doit être avant :date.",before_or_equal:"Le champ :attribute doit correspondre ou bien être avant :date.",between:"Le champ :attribute doit être entre :min et :max:type.",boolean:"Le champ :attribute doit être booléen.",card_exp:"Le champ :attribute doit être une date d'expiration valide.",card_num:"Le champ :attribute doit être un numéro valide de carte de crédit .",currency:"Le champ :attribute doit être une devise valide.",date:"Le champ :attribute doit être une date.",date_equals:"Le champ :attribute doit correspondre à :date.",email:"Le champ :attribute doit êre une adresse email valide.",in:"Le champ selectionné :attribute doit être :values.",integer:"Le champ :attribute doit être un entier.",max:"Le champ :attribute ne doit pas dépasser :max:type.",min:"Le champ :attribute doit au moins être :min:type.",not_in:"Le champ selectionné :attribute ne doit pas être :values.",not_regex:"Le champ :attribute ne doit pas correspondre au motif requis.",numeric:"Le champ :attribute doit être un chiffre.",phone:"Le champ :attribute doit être un numéro de téléphone valide.",regex:"Le champ :attribute doit correspondre au motif requis.",required:"Le champ :attribute est requis.",size:"Le champ :attribute doit être :size:type.",string:"Le champ :attribute doit être une chaîne.",typeof:"Le champ :attribute n'est pas le type correcte de :type.",url:"Le champ :attribute doit être un url."}),null}); \ No newline at end of file diff --git a/dist/locale/min/id.min.js b/dist/locale/min/id.min.js index 07b78a9..aead56c 100644 --- a/dist/locale/min/id.min.js +++ b/dist/locale/min/id.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(a,t){"function"==typeof define&&define.amd?define(["simple-react-validator"],t):"object"==typeof exports?module.exports=t(require("simple-react-validator")):a.SimpleReactValidatorLocaleId=t(a.SimpleReactValidator)}(this,function(a){"use strict";return a.addLocale("id",{accepted:":attribute harus diterima.",after:":attribute harus lebih dari :date.",after_or_equal:":attribute harus lebih dari atau sama dengan :date.",alpha:":attribute hanya boleh berisikan teks.",alpha_space:":attribute hanya boleh berisikan teks dan spasi.",alpha_num:":attribute hanya boleh berisikan teks dan angka.",alpha_num_space:":attribute hanya boleh berisikan teks, angka, dan spasi.",alpha_num_dash:":attribute hanya boleh berisikan teks, angka, dan garis datar.",alpha_num_dash_space:":attribute hanya boleh berisikan teks, angka, garis datar dan spasi.",array:":attribute harus berupa array.",before:":attribute harus kurang dari :date.",before_or_equal:":attribute harus kurang dari atau sama dengan :date.",between:":attribute harus diantara :min dan :max:type.",boolean:":attribute harus berupa boolean.",card_exp:":attribute harus berupa tanggal expire yang valid valid expiration date.",card_num:":attribute harus berupa nomor kartu kredit.",currency:":attribute harus berupa mata uang yang valid.",date:":attribute harus berupa tanggal.",date_equals:":attribute harus sama dengan :date.",email:":attribute harus berupa alamat email yang valid.",in:":attribute terpilih harus :values.",integer:":attribute harus berupa integer.",max:":attribute harus kurang dari :max:type.",min:":attribute harus lebih dari :min:type.",not_in:":attribute terpilih tidak boleh sama dengan :values.",not_regex:":attribute tidak boleh cocok dengan pola yang ditentukan.",numeric:":attribute harus berupa angka.",phone:":attribute harus berupa nomor ponsel yang valid.",regex:":attribute harus cocok dengan pola yang ditentukan.",required:":attribute tidak boleh kosong.",size:":attribute harus :size:type.",string:":attribute harus berupa string.",typeof:":attribute tidak cocok dengan tipe :type.",url:":attribute harus berupa url."}),null}); \ No newline at end of file diff --git a/dist/locale/min/it.min.js b/dist/locale/min/it.min.js index cbd9f02..9a427b5 100644 --- a/dist/locale/min/it.min.js +++ b/dist/locale/min/it.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(e,t){"function"==typeof define&&define.amd?define(["simple-react-validator"],t):"object"==typeof exports?module.exports=t(require("simple-react-validator")):e.SimpleReactValidatorLocaleIt=t(e.SimpleReactValidator)}(this,function(e){"use strict";return e.addLocale("it",{accepted:":attribute deve essere accettato.",after:":attribute deve essere successiva a :date.",after_or_equal:":attribute deve essere successiva o uguale a :date.",alpha:":attribute deve contenere solo lettere.",alpha_space:"Il campo :attribute può contenere solo spazi e lettere.",alpha_num:"Il campo :attribute può contenere solo numeri e lettere.",alpha_num_space:"Il campo :attribute può contenere solo spazi, numeri e lettere.",alpha_num_dash:"Il campo :attribute può contenere solo trattini, numeri e lettere.",alpha_num_dash_space:"Il campo :attribute può contenere solo lettere, numeri, spazi e trattini.",array:"Il campo :attribute deve essere un array.",before:"Il campo :attribute deve essere precedente a :date.",before_or_equal:"Il campo :attribute deve essere precedente o uguale a :date.",between:"Il campo :attribute deve essere compreso tra :min - :max:type.",boolean:"Il campo :attribute deve essere un booleano.",card_exp:"Il campo :attribute deve essere una data di scadenza valida.",card_num:"Il campo :attribute deve essere un numero di carta di credito valido.",currency:"Il campo :attribute deve essere un importo.",date:"Il campo :attribute deve essere una data valida.",date_equals:"Il campo :attribute deve essere una data uguale a :date.",email:"Il campo :attribute deve essere un indirizzo email valido.",in:"Il campo :attribute deve essere uno dei seguenti valori :values.",integer:"Il campo :attribute deve essere un numero intero.",max:"Il campo :attribute non deve superare :max:type.",min:"Il campo :attribute non deve essere inferiore a :min:type.",not_in:"Il campo :attribute non deve essere uno dei seguenti valori :values.",not_regex:"Il formato di :attribute non è valido.",numeric:"Il campo :attribute deve essere un numero.",phone:"Il campo :attribute deve essere un numero di telefono.",regex:"Il formato di :attribute non è corretto.",required:"Il campo :attribute è obbligatorio.",size:"La dimensione di :attribute non deve superare :size:type.",string:"Il campo :attribute deve essere una stringa.",typeof:"Il campo :attribute deve essere di tipo :type.",url:"Il campo :attribute deve essere un url web."}),null}); \ No newline at end of file diff --git a/dist/locale/min/ja.min.js b/dist/locale/min/ja.min.js new file mode 100644 index 0000000..3ee9959 --- /dev/null +++ b/dist/locale/min/ja.min.js @@ -0,0 +1,2 @@ +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present +!function(t,e){"function"==typeof define&&define.amd?define(["simple-react-validator"],e):"object"==typeof exports?module.exports=e(require("simple-react-validator")):t.SimpleReactValidatorLocaleJa=e(t.SimpleReactValidator)}(this,function(t){"use strict";return t.addLocale("ja",{accepted:":attributeを受け入れる必要があります。",after:":attributeは:dateより後でなければなりません。",after_or_equal:":attributeは:date以降である必要があります。",alpha:":attributeには文字のみを含めることができます。",alpha_space:":attributeには文字とスペースのみを含めることができます。",alpha_num:":attributeには文字と数字のみを含めることができます。",alpha_num_space:":attributeには文字、数字、およびスペースのみを含めることができます。",alpha_num_dash:":attributeには文字、数字、ダッシュ、およびアンダースコアのみを含めることができます。",alpha_num_dash_space:":attributeには文字、数字、ダッシュ、アンダースコア、およびスペースのみを含めることができます。",array:":attributeは配列でなければなりません。",before:":attributeは:dateより前でなければなりません。",before_or_equal:":attributeは:dateより前か:dateである必要があります。",between:":attributeは:minと:max:typeの間でなければなりません。",boolean:":attributeはブール値である必要があります。",card_exp:":attributeは有効な有効期限である必要があります。",card_num:":attributeは有効なクレジットカード番号である必要があります。",currency:":attributeは有効な通貨である必要があります。",date:":attributeは日付でなければなりません。",date_equals:":attributeは:dateである必要があります。",email:":attributeは有効なメールアドレスである必要があります。",in:":attributeは:valuesのいずれかと一致する必要があります。",integer:":attributeは整数でなければなりません。",max:":attributeは:max:typeを超えてはなりません。",min:":attributeは:min:type未満であってはなりません。",not_in:":attributeは:valuesのいずれかと一致してはなりません。",not_regex:":attributeは形式が無効です。",numeric:":attributeは数値でなければなりません。",phone:":attributeは有効な電話番号である必要があります。",regex:":attributeは形式が無効です。",required:":attributeは必須です。",size:":attributeは:size:typeである必要があります。",string:":attributeは文字列でなければなりません。",typeof:":attributeは:typeの正しいタイプではありません。",url:":attributeは有効なURLである必要があります。"}),null}); \ No newline at end of file diff --git a/dist/locale/min/nl.min.js b/dist/locale/min/nl.min.js index 03768d0..d6a957a 100644 --- a/dist/locale/min/nl.min.js +++ b/dist/locale/min/nl.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(e,t){"function"==typeof define&&define.amd?define(["simple-react-validator"],t):"object"==typeof exports?module.exports=t(require("simple-react-validator")):e.SimpleReactValidatorLocaleNl=t(e.SimpleReactValidator)}(this,function(e){"use strict";return e.addLocale("nl",{accepted:":attribute moet geaccepteerd zijn.",after:":attribute moet een datum na :date zijn.",after_or_equal:":attribute moet een datum na of gelijk aan :date zijn.",alpha:":attribute mag alleen letters bevatten.",alpha_space:":attribute mag alleen letters en spaties bevatten.",alpha_num:":attribute mag alleen letters en nummers bevatten.",alpha_num_space:":attribute mag alleen letters, nummers, en spaties bevatten.",alpha_num_dash:":attribute mag alleen letters, nummers, underscores (_) en streepjes (-) bevatten.",alpha_num_dash_space:":attribute mag alleen letters, nummers, spaties, underscores (_) en streepjes (-) bevatten.",array:":attribute moet geselecteerde elementen bevatten.",before:":attribute moet een datum voor :date zijn.",before_or_equal:":attribute moet een datum voor of gelijk aan :date zijn.",between:":attribute moet tussen :min en :max:type zijn.",boolean:":attribute moet ja of nee zijn.",card_exp:":attribute moet een geldige vervaldatum zijn.",card_num:":attribute moet een geldig credit card nummer zijn .",currency:":attribute moet een geldige valuta zijn.",date:":attribute moet een datum bevatten.",date_equals:":attribute moet een datum gelijk aan :date zijn.",email:":attribute is geen geldig e-mailadres.",in:":attribute moet een van :values zijn.",integer:":attribute moet een getal zijn.",max:":attribute mag niet hoger dan :max:type zijn.",min:":attribute moet minimaal :min:type zijn.",not_in:"Het formaat van :attribute is ongeldig.",not_regex:":attribute formaat is ongeldig.",numeric:":attribute moet een nummer zijn.",phone:":attribute moet een geldig telefoonnummer zijn",regex:":attribute formaat is ongeldig.",required:":attribute is verplicht.",size:":attribute moet :size:type zijn.",string:":attribute moet een tekst zijn.",typeof:":attribute is niet het correcte type voor :type.",url:":attribute moet een geldig URL zijn."}),null}); \ No newline at end of file diff --git a/dist/locale/min/pt.min.js b/dist/locale/min/pt.min.js index 18cc402..e89b1ee 100644 --- a/dist/locale/min/pt.min.js +++ b/dist/locale/min/pt.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(e,t){"function"==typeof define&&define.amd?define(["simple-react-validator"],t):"object"==typeof exports?module.exports=t(require("simple-react-validator")):e.SimpleReactValidatorLocalePt=t(e.SimpleReactValidator)}(this,function(e){"use strict";return e.addLocale("pt",{accepted:":attribute devem ser aceitos.",after:":attribute deve ser depois de :date.",after_or_equal:":attribute deve ser depois ou igual à :date.",alpha:":attribute deve conter apenas letras.",alpha_space:":attribute deve conter apenas letras e espaços.",alpha_num:":attribute deve conter apenas letras e números.",alpha_num_space:":attribute deve conter apenas letras, números e espaços.",alpha_num_dash:":attribute deve conter apenas letras, números e hífens.",alpha_num_dash_space:":attribute deve conter apenas letras, números, hífens e espaços.",array:":attribute deve ser uma matriz.",before:":attribute deve ser antes de :date.",before_or_equal:":attribute deve ser antes ou igual à :date.",between:":attribute deve ser entre :min e :max:type.",boolean:":attribute deve ser boleano.",card_exp:":attribute deve ser uma data de validade válida.",card_num:":attribute deve ser um número de cartão válido.",currency:":attribute deve ser uma moeda válida.",date:":attribute deve ser uma data.",date_equals:":attribute deve ser :date.",email:":attribute deve ser um endereço de email válido.",in:":attribute deve ser :values.",integer:":attribute deve ser um valor inteiro.",max:":attribute não deve ser maior que :max:type.",min:":attribute deve ser ao menos :min:type.",not_in:":attribute não deve ser :values.",not_regex:":attribute não é válido.",numeric:":attribute deve ser um número.",phone:":attribute deve ser um número de telefone válido.",regex:":attribute não é válido.",required:":attribute é obrigatório.",size:":attribute deve ser :size:type.",string:":attribute deve ser um conjunto de caracteres.",typeof:":attribute deve ser do tipo :type.",url:":attribute deve ser uma url."}),null}); \ No newline at end of file diff --git a/dist/locale/min/sl.min.js b/dist/locale/min/sl.min.js index 3ea9707..93a5da6 100644 --- a/dist/locale/min/sl.min.js +++ b/dist/locale/min/sl.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(e,t){"function"==typeof define&&define.amd?define(["simple-react-validator"],t):"object"==typeof exports?module.exports=t(require("simple-react-validator")):e.SimpleReactValidatorLocaleSl=t(e.SimpleReactValidator)}(this,function(e){"use strict";return e.addLocale("sl",{accepted:"Polje :attribute mora biti izbrano.",after:"Polje :attribute mora biti večje od :date.",after_or_equal:"Polje :attribute mora biti večje ali enako :date.",alpha:"Polje :attribute lahko vsebuje samo črke.",alpha_space:"Polje :attribute lahko vsebuje samo črke in presledke.",alpha_num:"Polje :attribute lahko vsebuje samo črke in številke.",alpha_num_space:"Polje :attribute lahko vsebuje samo, številke in presledke.",alpha_num_dash:"Polje :attribute lahko vsebuje samo črke, številke in vezaje.",alpha_num_dash_space:"Polje :attribute lahko vsebuje samo črke, številke, vezaje in presledke.",array:"Polje :attribute mora biti niz.",before:"Polje :attribute mora biti manjše od :date.",before_or_equal:"Polje :attribute mora biti manjše ali enako :date.",between:"Polje :attribute mora biti med :min in :max:type.",boolean:"Polje :attribute mora biti logična spremenljivka.",card_exp:"Polje :attribute mora biti veljaven datum poteka kreditne kartice.",card_num:"Polje :attribute mora biti veljavna številka kreditne kartice.",currency:"Polje :attribute mora biti veljavna valuta.",date:"Polje :attribute mora biti datum.",date_equals:"Polje :attribute mora biti enak :date.",email:"Polje :attribute mora biti veljaven e-poštni naslov.",in:"Izbrano polje :attribute mora biti :values.",integer:"Polje :attribute mora biti celo število.",max:"Polje :attribute ne sme biti večje od :max:type.",min:"Polje :attribute mora biti večje od :min:type.",not_in:"Izbrano polje :attribute ne sme biti :values.",not_regex:"Polje :attribute ne sme biti v tem formatu.",numeric:"Polje :attribute mora biti število.",phone:"Polje :attribute mora biti veljavna telefonska številka.",regex:"Polje :attribute mora biti v tem formatu.",required:"Polje :attribute je obvezno.",size:"Polje :attribute mora biti :size:type.",string:"Polje :attribute mora biti beseda.",typeof:"Polje :attribute mora biti tipa :type.",url:"Polje :attribute mora biti URL povezava."}),null}); \ No newline at end of file diff --git a/dist/locale/min/sr.min.js b/dist/locale/min/sr.min.js index 701986e..b27c279 100644 --- a/dist/locale/min/sr.min.js +++ b/dist/locale/min/sr.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(e,t){"function"==typeof define&&define.amd?define(["simple-react-validator"],t):"object"==typeof exports?module.exports=t(require("simple-react-validator")):e.SimpleReactValidatorLocaleSr=t(e.SimpleReactValidator)}(this,function(e){"use strict";return e.addLocale("sr",{accepted:"Polje :attribute mora biti prihvaćeno.",after:"Polje :attribute mora biti nakon :date.",after_or_equal:"Polje :attribute mora biti nakon ili na :date.",alpha:"Polje :attribute može sadržati samo slova.",alpha_space:"Polje :attribute može sadržati samo slova i razmake.",alpha_num:"Polje :attribute može sadržati samo slova i brojeve.",alpha_num_space:"Polje :attribute može sadržati samo slova, brojeve i razmake.",alpha_num_dash:"Polje :attribute može sadržati samo slova, brojeve i crte.",alpha_num_dash_space:"Polje :attribute može sadržati samo slova, brojeve, crte i razmake.",array:"Polje :attribute mora biti niz.",before:"Polje :attribute mora biti pre :date.",before_or_equal:"Polje :attribute mora biti pre ili na :date.",between:"Polje :attribute mora biti između :min i :max:type.",boolean:"Polje :attribute mora biti istinitosna vrednost.",card_exp:"Polje :attribute mora biti validan datum isteka.",card_num:"Polje :attribute mora biti validan broj kreditne kartice.",currency:"Polje :attribute mora biti validna valuta.",date:"Polje :attribute mora biti datum.",date_equals:"Polje :attribute mora biti na :date.",email:"Polje :attribute mora biti validna email adresa.",in:"Izabrano polje :attribute mora biti :values.",integer:"Polje :attribute mora biti ceo broj.",max:"Polje :attribute ne sme biti veće od :max:type.",min:"Polje :attribute mora biti veće od :min:type.",not_in:"Izabrano polje :attribute ne sme biti :values.",not_regex:"Polje :attribute ne sme biti u određenom formatu.",numeric:"Polje :attribute mora biti broj.",phone:"Polje :attribute mora biti validan broj telefona.",regex:"Polje :attribute mora biti u određenom formatu.",required:"Polje :attribute je obavezno.",size:"Polje :attribute mora biti :size:type.",string:"Polje :attribute mora biti niska.",typeof:"Polje :attribute nije ispravan tip :type.",url:"Polje :attribute mora biti URL."}),null}); \ No newline at end of file diff --git a/dist/locale/min/tr.min.js b/dist/locale/min/tr.min.js index cdf2642..c70f09a 100644 --- a/dist/locale/min/tr.min.js +++ b/dist/locale/min/tr.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present !function(a,e){"function"==typeof define&&define.amd?define(["simple-react-validator"],e):"object"==typeof exports?module.exports=e(require("simple-react-validator")):a.SimpleReactValidatorLocaleTr=e(a.SimpleReactValidator)}(this,function(a){"use strict";return a.addLocale("tr",{accepted:":attribute onaylanmalıdır.",after:":attribute :date tarihinden sonra olmalıdır.",after_or_equal:":attribute :date tarihinde veya sonra olmalıdır.",alpha:":attribute sadece harf içerebilir.",alpha_space:":attribute sadece harf, ve boşluk karakteri içerebilir.",alpha_num:":attribute sadece harf, ve rakam içerebilir.",alpha_num_space:":attribute sadece harf, rakam, ve boşluk karakteri içerebilir.",alpha_num_dash:":attribute sadece harf, rakam, ve tire karakteri içerebilir.",alpha_num_dash_space:":attribute sadece harf, rakam, tire, ve boşluk karakteri içerebilir.",array:":attribute dizi tipinde olmalıdır.",before:":attribute :date tarihinden önce olmalıdır.",before_or_equal:":attribute :date tarihinde veya daha önce olmalıdır.",between:":attribute :min - :max:type aralığında olmalıdır.",boolean:":attribute geçerli bir mantıksal değer olmalıdır.",card_exp:":attribute geçerli bir sonlanma tarihi olmalıdır.",card_num:":attribute geçerli bir kredi kartı numarası olmalıdır.",currency:":attribute geçerli bir para tipi olmalıdır.",date:":attribute tarih formatında olmalıdır.",date_equals:":attribute :date tarihli olmalıdır.",email:":attribute geçerli bir e-posta adresi olmalıdır.",in:"Seçilen :attribute :values olmalıdır.",integer:":attribute sayı olmalıdır.",max:":attribute :max:type dan büyük olamaz.",min:":attribute en az :min:type olmalıdır.",not_in:"Seçilen :attribute :values olamaz.",not_regex:":attribute gerekli formattan farklı olmalıdır.",numeric:":attribute sayı olmalıdır.",phone:":attribute geçerli bir telefon numarası olmalıdır.",regex:":attribute gerekli formatla uyumlu olmalıdır.",required:":attribute alanı doldurulmalıdır.",size:":attribute :size:type tipinde olmalıdır.",string:":attribute karakter dizisi olmalıdır.",typeof:":attribute :type tipinde olmalıdır.",url:":attribute url olmalıdır."}),null}); \ No newline at end of file diff --git a/dist/locale/nl.js b/dist/locale/nl.js index 8496c97..d4a48a2 100644 --- a/dist/locale/nl.js +++ b/dist/locale/nl.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/locale/pt.js b/dist/locale/pt.js index 3704d79..c66f400 100644 --- a/dist/locale/pt.js +++ b/dist/locale/pt.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/locale/sl.js b/dist/locale/sl.js index bb5cc07..9d07293 100644 --- a/dist/locale/sl.js +++ b/dist/locale/sl.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/locale/sr.js b/dist/locale/sr.js index 840d79a..c5f65ab 100644 --- a/dist/locale/sr.js +++ b/dist/locale/sr.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/locale/tr.js b/dist/locale/tr.js index f7dbeac..16094bc 100644 --- a/dist/locale/tr.js +++ b/dist/locale/tr.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['simple-react-validator'], factory); diff --git a/dist/simple-react-validator.js b/dist/simple-react-validator.js index d0f78db..0f3895b 100644 --- a/dist/simple-react-validator.js +++ b/dist/simple-react-validator.js @@ -1,4 +1,4 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present +// Simple React Validator v1.6.1 | Created By Dockwa | MIT License | 2017 - Present ;(function(root, factory) { if (typeof define === 'function' && define.amd) { define(['react'], factory); @@ -14,11 +14,11 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } @@ -26,7 +26,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } @@ -39,13 +39,6 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d 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; } var SimpleReactValidator = /*#__PURE__*/function () { - _createClass(SimpleReactValidator, null, [{ - key: "addLocale", - value: function addLocale(lang, messages) { - this.locales[lang] = messages; - } - }]); - function SimpleReactValidator() { var _this = this; @@ -408,7 +401,7 @@ var SimpleReactValidator = /*#__PURE__*/function () { url: { message: 'The :attribute must be a url.', rule: function rule(val) { - return _this.helpers.testRegex(val, /^https?:\/\/[-a-z0-9@:%._\+~#=]{1,256}\.[a-z0-9()]{2,6}\b([-a-z0-9()@:%_\+.~#?&//=]*)$/i); + return _this.helpers.testRegex(val, /^https?:\/\/[-a-z0-9@:%._\+~#=]{1,256}\.[a-z0-9()]{2,13}\b([-a-z0-9()@:%_\+.~#?&//=]*)$/i); } } }, _options.validators || {}); // apply language @@ -586,6 +579,11 @@ var SimpleReactValidator = /*#__PURE__*/function () { _iterator2.f(); } } + }], [{ + key: "addLocale", + value: function addLocale(lang, messages) { + this.locales[lang] = messages; + } }]); return SimpleReactValidator; diff --git a/dist/simple-react-validator.min.js b/dist/simple-react-validator.min.js index 6d48020..dc0362f 100644 --- a/dist/simple-react-validator.min.js +++ b/dist/simple-react-validator.min.js @@ -1,2 +1,2 @@ -// Simple React Validator v1.6.0 | Created By Dockwa | MIT License | 2017 - Present -!function(e,t){"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?module.exports=t(require("react")):e.SimpleReactValidator=t(e.React)}(this,function(s){"use strict";function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,s=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){s=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(s)throw a}}return r}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=o(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,s=function(){};return{s:s,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function o(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=parseFloat(t[0])&&r.helpers.size(e,t[2])<=parseFloat(t[1])},messageReplace:function(e,t){return e.replace(":min",t[0]).replace(":max",t[1]).replace(":type",r.helpers.sizeText(t[2]))}},boolean:{message:"The :attribute must be a boolean.",rule:function(e){return!1===e||!0===e}},card_exp:{message:"The :attribute must be a valid expiration date.",rule:function(e){return r.helpers.testRegex(e,/^(([0]?[1-9]{1})|([1]{1}[0-2]{1}))\s?\/\s?(\d{2}|\d{4})$/)}},card_num:{message:"The :attribute must be a valid credit card number.",rule:function(e){return r.helpers.testRegex(e,/^\d{4}\s?\d{4,6}\s?\d{4,5}\s?\d{0,8}$/)}},currency:{message:"The :attribute must be a valid currency.",rule:function(e){return r.helpers.testRegex(e,/^\$?(\d{1,3})(\,?\d{3})*\.?\d{0,2}$/)}},date:{message:"The :attribute must be a date.",rule:function(e){return r.helpers.momentInstalled()&&moment.isMoment(e)}},date_equals:{message:"The :attribute must be on :date.",rule:function(e,t){return r.helpers.momentInstalled()&&moment.isMoment(e)&&e.isSame(t[0],"day")},messageReplace:function(e,t){return e.replace(":date",t[0].format("MM/DD/YYYY"))}},email:{message:"The :attribute must be a valid email address.",rule:function(e){return r.helpers.testRegex(e,/^[A-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i)}},in:{message:"The selected :attribute must be :values.",rule:function(e,t){return t.includes(e)},messageReplace:function(e,t){return e.replace(":values",r.helpers.toSentence(t))}},integer:{message:"The :attribute must be an integer.",rule:function(e){return r.helpers.testRegex(e,/^\-?\d*$/)}},max:{message:"The :attribute may not be greater than :max:type.",rule:function(e,t){return r.helpers.size(e,t[1])<=parseFloat(t[0])},messageReplace:function(e,t){return e.replace(":max",t[0]).replace(":type",r.helpers.sizeText(t[1]))}},min:{message:"The :attribute must be at least :min:type.",rule:function(e,t){return r.helpers.size(e,t[1])>=parseFloat(t[0])},messageReplace:function(e,t){return e.replace(":min",t[0]).replace(":type",r.helpers.sizeText(t[1]))}},not_in:{message:"The selected :attribute must not be :values.",rule:function(e,t){return!t.includes(e)},messageReplace:function(e,t){return e.replace(":values",r.helpers.toSentence(t))}},not_regex:{message:"The :attribute must not match the required pattern.",rule:function(e,t){return!r.helpers.testRegex(e,"string"==typeof t[0]||t[0]instanceof String?new RegExp(t[0]):t[0])}},numeric:{message:"The :attribute must be a number.",rule:function(e){return r.helpers.testRegex(e,/^\-?\d*\.?\d+$/)}},phone:{message:"The :attribute must be a valid phone number.",rule:function(e){return r.helpers.testRegex(e,/^(\+?\d{0,4})?\s?-?\s?(\(?\d{3}\)?)\s?-?\s?(\(?\d{3}\)?)\s?-?\s?(\(?\d{4}\)?)$/)&&!r.helpers.testRegex(e,/^\b(\d)\1{8,}\b$/)}},regex:{message:"The :attribute must match the required pattern.",rule:function(e,t){return r.helpers.testRegex(e,"string"==typeof t[0]||t[0]instanceof String?new RegExp(t[0]):t[0])}},required:{message:"The :attribute field is required.",rule:function(e){return!r.helpers.isBlank(e)},required:!0},size:{message:"The :attribute must be :size:type.",rule:function(e,t){return r.helpers.size(e,t[1])==parseFloat(t[0])},messageReplace:function(e,t){return e.replace(":size",t[0]).replace(":type",r.helpers.sizeText(t[1]))}},string:{message:"The :attribute must be a string.",rule:function(e){return a(e)===a("string")}},typeof:{message:"The :attribute is not the correct type of :type.",rule:function(e,t){return a(e)===a(t[0])},messageReplace:function(e,t){return e.replace(":type",a(t[0]))}},url:{message:"The :attribute must be a url.",rule:function(e){return r.helpers.testRegex(e,/^https?:\/\/[-a-z0-9@:%._\+~#=]{1,256}\.[a-z0-9()]{2,6}\b([-a-z0-9()@:%_\+.~#?&//=]*)$/i)}}},e.validators||{}),e.locale&&!n.locales.hasOwnProperty(e.locale)&&console.warn("Locale not found! Make sure it is spelled correctly and the locale file is loaded.");var t=n.locales[e.locale]||{};Object.keys(this.rules).forEach(function(e){r.rules[e].message=t[e]||r.rules[e].message}),this.messages=e.messages||{},this.className=e.className,this.autoForceUpdate=e.autoForceUpdate||!1,!1===e.element?this.element=function(e){return e}:e.hasOwnProperty("element")?this.element=e.element:"object"===("undefined"==typeof navigator?"undefined":a(navigator))&&"ReactNative"===navigator.product?this.element=function(e){return e}:this.element=function(e,t){return s.createElement("div",{className:t||r.className||"srv-validation-message"},e)}}return e(n,null,[{key:"addLocale",value:function(e,t){this.locales[e]=t}}]),e(n,[{key:"getErrorMessages",value:function(){return this.errorMessages}},{key:"showMessages",value:function(){this.messagesShown=!0,this.helpers.forceUpdateIfNeeded()}},{key:"hideMessages",value:function(){this.messagesShown=!1,this.helpers.forceUpdateIfNeeded()}},{key:"allValid",value:function(){for(var e in this.fields)if(!1===this.fieldValid(e))return!1;return!0}},{key:"fieldValid",value:function(e){return this.fields.hasOwnProperty(e)&&!0===this.fields[e]}},{key:"purgeFields",value:function(){this.fields={},this.errorMessages={}}},{key:"messageWhenPresent",value:function(e){var t=1=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function l(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=parseFloat(t[0])&&r.helpers.size(e,t[2])<=parseFloat(t[1])},messageReplace:function(e,t){return e.replace(":min",t[0]).replace(":max",t[1]).replace(":type",r.helpers.sizeText(t[2]))}},boolean:{message:"The :attribute must be a boolean.",rule:function(e){return!1===e||!0===e}},card_exp:{message:"The :attribute must be a valid expiration date.",rule:function(e){return r.helpers.testRegex(e,/^(([0]?[1-9]{1})|([1]{1}[0-2]{1}))\s?\/\s?(\d{2}|\d{4})$/)}},card_num:{message:"The :attribute must be a valid credit card number.",rule:function(e){return r.helpers.testRegex(e,/^\d{4}\s?\d{4,6}\s?\d{4,5}\s?\d{0,8}$/)}},currency:{message:"The :attribute must be a valid currency.",rule:function(e){return r.helpers.testRegex(e,/^\$?(\d{1,3})(\,?\d{3})*\.?\d{0,2}$/)}},date:{message:"The :attribute must be a date.",rule:function(e){return r.helpers.momentInstalled()&&moment.isMoment(e)}},date_equals:{message:"The :attribute must be on :date.",rule:function(e,t){return r.helpers.momentInstalled()&&moment.isMoment(e)&&e.isSame(t[0],"day")},messageReplace:function(e,t){return e.replace(":date",t[0].format("MM/DD/YYYY"))}},email:{message:"The :attribute must be a valid email address.",rule:function(e){return r.helpers.testRegex(e,/^[A-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i)}},in:{message:"The selected :attribute must be :values.",rule:function(e,t){return t.includes(e)},messageReplace:function(e,t){return e.replace(":values",r.helpers.toSentence(t))}},integer:{message:"The :attribute must be an integer.",rule:function(e){return r.helpers.testRegex(e,/^\-?\d*$/)}},max:{message:"The :attribute may not be greater than :max:type.",rule:function(e,t){return r.helpers.size(e,t[1])<=parseFloat(t[0])},messageReplace:function(e,t){return e.replace(":max",t[0]).replace(":type",r.helpers.sizeText(t[1]))}},min:{message:"The :attribute must be at least :min:type.",rule:function(e,t){return r.helpers.size(e,t[1])>=parseFloat(t[0])},messageReplace:function(e,t){return e.replace(":min",t[0]).replace(":type",r.helpers.sizeText(t[1]))}},not_in:{message:"The selected :attribute must not be :values.",rule:function(e,t){return!t.includes(e)},messageReplace:function(e,t){return e.replace(":values",r.helpers.toSentence(t))}},not_regex:{message:"The :attribute must not match the required pattern.",rule:function(e,t){return!r.helpers.testRegex(e,"string"==typeof t[0]||t[0]instanceof String?new RegExp(t[0]):t[0])}},numeric:{message:"The :attribute must be a number.",rule:function(e){return r.helpers.testRegex(e,/^\-?\d*\.?\d+$/)}},phone:{message:"The :attribute must be a valid phone number.",rule:function(e){return r.helpers.testRegex(e,/^(\+?\d{0,4})?\s?-?\s?(\(?\d{3}\)?)\s?-?\s?(\(?\d{3}\)?)\s?-?\s?(\(?\d{4}\)?)$/)&&!r.helpers.testRegex(e,/^\b(\d)\1{8,}\b$/)}},regex:{message:"The :attribute must match the required pattern.",rule:function(e,t){return r.helpers.testRegex(e,"string"==typeof t[0]||t[0]instanceof String?new RegExp(t[0]):t[0])}},required:{message:"The :attribute field is required.",rule:function(e){return!r.helpers.isBlank(e)},required:!0},size:{message:"The :attribute must be :size:type.",rule:function(e,t){return r.helpers.size(e,t[1])==parseFloat(t[0])},messageReplace:function(e,t){return e.replace(":size",t[0]).replace(":type",r.helpers.sizeText(t[1]))}},string:{message:"The :attribute must be a string.",rule:function(e){return a(e)===a("string")}},typeof:{message:"The :attribute is not the correct type of :type.",rule:function(e,t){return a(e)===a(t[0])},messageReplace:function(e,t){return e.replace(":type",a(t[0]))}},url:{message:"The :attribute must be a url.",rule:function(e){return r.helpers.testRegex(e,/^https?:\/\/[-a-z0-9@:%._\+~#=]{1,256}\.[a-z0-9()]{2,13}\b([-a-z0-9()@:%_\+.~#?&//=]*)$/i)}}},e.validators||{}),e.locale&&!n.locales.hasOwnProperty(e.locale)&&console.warn("Locale not found! Make sure it is spelled correctly and the locale file is loaded.");var t=n.locales[e.locale]||{};Object.keys(this.rules).forEach(function(e){r.rules[e].message=t[e]||r.rules[e].message}),this.messages=e.messages||{},this.className=e.className,this.autoForceUpdate=e.autoForceUpdate||!1,!1===e.element?this.element=function(e){return e}:e.hasOwnProperty("element")?this.element=e.element:"object"===("undefined"==typeof navigator?"undefined":a(navigator))&&"ReactNative"===navigator.product?this.element=function(e){return e}:this.element=function(e,t){return s.createElement("div",{className:t||r.className||"srv-validation-message"},e)}}var e,t,r;return e=n,r=[{key:"addLocale",value:function(e,t){this.locales[e]=t}}],(t=[{key:"getErrorMessages",value:function(){return this.errorMessages}},{key:"showMessages",value:function(){this.messagesShown=!0,this.helpers.forceUpdateIfNeeded()}},{key:"hideMessages",value:function(){this.messagesShown=!1,this.helpers.forceUpdateIfNeeded()}},{key:"allValid",value:function(){for(var e in this.fields)if(!1===this.fieldValid(e))return!1;return!0}},{key:"fieldValid",value:function(e){return this.fields.hasOwnProperty(e)&&!0===this.fields[e]}},{key:"purgeFields",value:function(){this.fields={},this.errorMessages={}}},{key:"messageWhenPresent",value:function(e){var t=1