@dooboostore/dom-render
Version:
html view template engine
25 lines • 911 B
JavaScript
import { Validator } from './Validator';
export class MultipleValidator extends Validator {
constructor(validators, value, target, event, autoValid = true) {
super(value, target, event, autoValid);
this.validators = validators.map(it => {
it.setAutoValid(false);
it.setAutoValidAction(false);
return it;
});
this.validators.forEach(it => {
it.set(this.value, this.getTarget(), this.getEvent());
});
}
changeValue(value) {
this.validators.forEach(it => it.set(this.value, this.getTarget(), this.getEvent()));
}
validAction() {
return !(this.validators.filter(it => !it.validAction()).length > 0);
}
valid() {
// console.log('mm', this.validators)
return !(this.validators.filter(it => !it.valid()).length > 0);
}
}
//# sourceMappingURL=MultipleValidator.js.map