import { ValidationIssue } from "../../../../Common/IDesignValidationProvider";
import { XExpressionDefinition } from "../../../../Expressions/XExpressionDefinition";
export class RuleTableCell {
    constructor(colId) {
        this._columnId = colId;
    }
    getStorageData() {
        var _a;
        let obj = {};
        Reflect.set(obj, "_columnId", this._columnId);
        Reflect.set(obj, "expression", (_a = this.expression) === null || _a === void 0 ? void 0 : _a.getStorageData());
        return obj;
    }
    setStorageData(data) {
        this._columnId = Reflect.get(data, "_columnId");
        let expressionData = Reflect.get(data, "expression");
        if (expressionData) {
            this.expression = new XExpressionDefinition();
            this.expression.setStorageData(expressionData);
        }
        else {
            this.expression = undefined;
        }
    }
    getDesignValidationIssues() {
        let issues = [];
        if (this.expression) {
            issues.push(...this.expression.getDesignValidationIssues());
        }
        else {
            issues.push(new ValidationIssue("Expression is required"));
        }
        return issues;
    }
}
//# sourceMappingURL=RuleTableCell.js.map