|
|
@ -207,13 +207,24 @@ BI.Input = BI.inherit(BI.Single, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_checkValidationOnValueChange: function () { |
|
|
|
_checkValidationOnValueChange: function () { |
|
|
|
var o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
var v = this.getValue(); |
|
|
|
var v = this.getValue(); |
|
|
|
this.setValid( |
|
|
|
if (o.allowBlank === true && BI.trim(v) == "") { |
|
|
|
(o.allowBlank === true && BI.trim(v) == "") || ( |
|
|
|
this.setValid(true); |
|
|
|
BI.isNotEmptyString(BI.trim(v)) && o.validationChecker.apply(this, [BI.trim(v)]) !== false |
|
|
|
return; |
|
|
|
) |
|
|
|
} |
|
|
|
); |
|
|
|
if (BI.trim(v) == "") { |
|
|
|
|
|
|
|
this.setValid(false); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var checker = o.validationChecker.apply(this, [BI.trim(v)]); |
|
|
|
|
|
|
|
if (checker instanceof Promise) { |
|
|
|
|
|
|
|
checker.then(function (validate) { |
|
|
|
|
|
|
|
self.setValid(validate !== false); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.setValid(checker !== false); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
focus: function () { |
|
|
|
focus: function () { |
|
|
|