import { __decorate } from "tslib";
import { observable } from '@ni/fast-element';
import { Validator } from '../../../utilities/models/validator';
/**
 * Base column validator
 */
export class ColumnValidator extends Validator {
    constructor(configValidityKeys) {
        super(configValidityKeys);
        this.isColumnValid = true;
    }
    /**
     * @returns an object containing flags for various ways the configuation can be invalid
     */
    getValidity() {
        return this.getValidationFlags();
    }
    onTrackingChange() {
        super.onTrackingChange();
        this.isColumnValid = this.isValid();
    }
    /**
     * Sets a particular validity condition flag's value, e.g. "hasInvalidFooValue" = true
     */
    setConditionValue(name, isInvalid) {
        if (isInvalid) {
            this.track(name);
        }
        else {
            this.untrack(name);
        }
    }
}
__decorate([
    observable
], ColumnValidator.prototype, "isColumnValid", void 0);
//# sourceMappingURL=column-validator.js.map