import { DesignSystem } from '@ni/fast-foundation';
import { template } from '../../text-base/cell-view/template';
import { styles } from '../../text-base/cell-view/styles';
import { TableColumnTextCellViewBase } from '../../text-base/cell-view';
import { TableColumnAlignment } from '../../../table/types';
/**
 * A cell view for displaying number fields as text
 */
export class TableColumnNumberTextCellView extends TableColumnTextCellViewBase {
    columnConfigChanged() {
        super.columnConfigChanged();
        this.alignment = this.columnConfig?.alignment ?? TableColumnAlignment.left;
    }
    updateText() {
        this.text = this.columnConfig?.formatter?.format(this.cellRecord?.value) ?? '';
    }
}
const numberTextCellView = TableColumnNumberTextCellView.compose({
    baseName: 'table-column-number-text-cell-view',
    template,
    styles
});
DesignSystem.getOrCreate().withPrefix('nimble').register(numberTextCellView());
export const tableColumnNumberTextCellViewTag = 'nimble-table-column-number-text-cell-view';
//# sourceMappingURL=index.js.map