Skip to content

Commit 8edf98d

Browse files
committed
version 1.2.4
1 parent ea2d438 commit 8edf98d

15 files changed

+79
-22
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "simple-react-validator",
33
"description": "A simple react form validator inspired by Laravel validation.",
44
"main": "dist/simple-react-validator.min.js",
5-
"version": "1.2.3",
5+
"version": "1.2.4",
66
"authors": [
77
"Stuart Yamartino"
88
],

dist/locale/es.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Simple React Validator v1.2.3 | Created By Dockwa | MIT License | 2017 - Present
1+
// Simple React Validator v1.2.4 | Created By Dockwa | MIT License | 2017 - Present
22
;(function(root, factory) {
33
if (typeof define === 'function' && define.amd) {
44
define(['simple-react-validator'], factory);

dist/locale/fr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Simple React Validator v1.2.3 | Created By Dockwa | MIT License | 2017 - Present
1+
// Simple React Validator v1.2.4 | Created By Dockwa | MIT License | 2017 - Present
22
;(function(root, factory) {
33
if (typeof define === 'function' && define.amd) {
44
define(['simple-react-validator'], factory);

dist/locale/min/es.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/locale/min/fr.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/locale/min/sr.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/locale/min/template-en.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/locale/sr.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Simple React Validator v1.2.4 | Created By Dockwa | MIT License | 2017 - Present
2+
;(function(root, factory) {
3+
if (typeof define === 'function' && define.amd) {
4+
define(['simple-react-validator'], factory);
5+
} else if (typeof exports === 'object') {
6+
module.exports = factory(require('simple-react-validator'));
7+
} else {
8+
root.SimpleReactValidatorLocaleSr = factory(root.SimpleReactValidator);
9+
}
10+
}(this, function(SimpleReactValidator) {
11+
"use strict";
12+
13+
var sr = {
14+
accepted: 'Polje :attribute mora biti prihvaćeno.',
15+
after: 'Polje :attribute mora biti nakon :date.',
16+
after_or_equal: 'Polje :attribute mora biti nakon ili na :date.',
17+
alpha: 'Polje :attribute može sadržati samo slova.',
18+
alpha_space: 'Polje :attribute može sadržati samo slova i razmake.',
19+
alpha_num: 'Polje :attribute može sadržati samo slova i brojeve.',
20+
alpha_num_space: 'Polje :attribute može sadržati samo slova, brojeve i razmake.',
21+
alpha_num_dash: 'Polje :attribute može sadržati samo slova, brojeve i crte.',
22+
alpha_num_dash_space: 'Polje :attribute može sadržati samo slova, brojeve, crte i razmake.',
23+
array: 'Polje :attribute mora biti niz.',
24+
before: 'Polje :attribute mora biti pre :date.',
25+
before_or_equal: 'Polje :attribute mora biti pre ili na :date.',
26+
between: 'Polje :attribute mora biti između :min i :max:type.',
27+
"boolean": 'Polje :attribute mora biti istinitosna vrednost.',
28+
card_exp: 'Polje :attribute mora biti validan datum isteka.',
29+
card_num: 'Polje :attribute mora biti validan broj kreditne kartice.',
30+
currency: 'Polje :attribute mora biti validna valuta.',
31+
date: 'Polje :attribute mora biti datum.',
32+
date_equals: 'Polje :attribute mora biti na :date.',
33+
email: 'Polje :attribute mora biti validna email adresa.',
34+
"in": 'Izabrano polje :attribute mora biti :values.',
35+
integer: 'Polje :attribute mora biti ceo broj.',
36+
max: 'Polje :attribute ne sme biti veće od :max:type.',
37+
min: 'Polje :attribute mora biti veće od :min:type.',
38+
not_in: 'Izabrano polje :attribute ne sme biti :values.',
39+
not_regex: 'Polje :attribute ne sme biti u određenom formatu.',
40+
numeric: 'Polje :attribute mora biti broj.',
41+
phone: 'Polje :attribute mora biti validan broj telefona.',
42+
regex: 'Polje :attribute mora biti u određenom formatu.',
43+
required: 'Polje :attribute je obavezno.',
44+
size: 'Polje :attribute mora biti :size:type.',
45+
string: 'Polje :attribute mora biti niska.',
46+
"typeof": 'Polje :attribute nije ispravan tip :type.',
47+
url: 'Polje :attribute mora biti URL.'
48+
};
49+
SimpleReactValidator.addLocale('sr', sr);
50+
return sr;
51+
}));

dist/locale/template-en.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Simple React Validator v1.2.3 | Created By Dockwa | MIT License | 2017 - Present
1+
// Simple React Validator v1.2.4 | Created By Dockwa | MIT License | 2017 - Present
22
;(function(root, factory) {
33
if (typeof define === 'function' && define.amd) {
44
define(['simple-react-validator'], factory);

dist/simple-react-validator.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Simple React Validator v1.2.3 | Created By Dockwa | MIT License | 2017 - Present
1+
// Simple React Validator v1.2.4 | Created By Dockwa | MIT License | 2017 - Present
22
;(function(root, factory) {
33
if (typeof define === 'function' && define.amd) {
44
define(['react'], factory);
@@ -14,7 +14,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
1414

1515
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
1616

17-
function _iterableToArrayLimit(arr, i) { 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; }
17+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { 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; }
1818

1919
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2020

@@ -50,7 +50,9 @@ function () {
5050
_classCallCheck(this, SimpleReactValidator);
5151

5252
_defineProperty(this, "showMessageFor", function (field) {
53-
_this.visibleFields.push(field);
53+
if (!_this.visibleFields.includes(field)) {
54+
_this.visibleFields.push(field);
55+
}
5456

5557
_this.helpers.forceUpdateIfNeeded();
5658
});
@@ -308,7 +310,7 @@ function () {
308310
"in": {
309311
message: 'The selected :attribute must be :values.',
310312
rule: function rule(val, params) {
311-
return params.indexOf(val) > -1;
313+
return params.includes(val);
312314
},
313315
messageReplace: function messageReplace(message, params) {
314316
return message.replace(':values', _this.helpers.toSentence(params));
@@ -341,7 +343,7 @@ function () {
341343
not_in: {
342344
message: 'The selected :attribute must not be :values.',
343345
rule: function rule(val, params) {
344-
return params.indexOf(val) === -1;
346+
return !params.includes(val);
345347
},
346348
messageReplace: function messageReplace(message, params) {
347349
return message.replace(':values', _this.helpers.toSentence(params));
@@ -561,7 +563,7 @@ function () {
561563
return SimpleReactValidator;
562564
}();
563565

564-
_defineProperty(SimpleReactValidator, "version", '1.2.0');
566+
_defineProperty(SimpleReactValidator, "version", '1.2.4');
565567

566568
_defineProperty(SimpleReactValidator, "locales", {
567569
'en': {}

0 commit comments

Comments
 (0)