import { __decorate } from "tslib";
import { attr, observable } from '@ni/fast-element';
import { FoundationElement } from '@ni/fast-foundation';
import { ColumnInternals } from './models/column-internals';
import { slotTextContent } from '../../utilities/models/slot-text-content';
/**
 * The base class for table columns
 */
export class TableColumn extends FoundationElement {
    constructor() {
        super(...arguments);
        /**
         * @internal
         *
         * Column properties configurable by plugin authors
         */
        this.columnInternals = new ColumnInternals(this.getColumnInternalsOptions());
        this.columnHidden = false;
        /** @internal */
        this.hasOverflow = false;
    }
    checkValidity() {
        return this.columnInternals.validator.isColumnValid;
    }
    get validity() {
        return this.columnInternals.validator.getValidity();
    }
    /** @internal */
    get headerTextContent() {
        return slotTextContent(this.contentSlot);
    }
    connectedCallback() {
        super.connectedCallback();
        // Done here to enforce consistency across headers as they may have custom templates
        this.setAttribute('slot', this.columnInternals.uniqueId);
    }
}
__decorate([
    attr({ attribute: 'column-id' })
], TableColumn.prototype, "columnId", void 0);
__decorate([
    attr({ attribute: 'action-menu-slot' })
], TableColumn.prototype, "actionMenuSlot", void 0);
__decorate([
    attr({ attribute: 'action-menu-label' })
], TableColumn.prototype, "actionMenuLabel", void 0);
__decorate([
    attr({ attribute: 'column-hidden', mode: 'boolean' })
], TableColumn.prototype, "columnHidden", void 0);
__decorate([
    observable
], TableColumn.prototype, "hasOverflow", void 0);
//# sourceMappingURL=index.js.map