import CwElement from '../../internal/cw-element.js'; import type { CSSResultGroup, TemplateResult } from 'lit'; /** * @summary Data table columns define the columns of a [data table](/components/data-table). * @documentation https://cordwainer.dev/components/data-table-column * @status experimental * @since 1.2 * * @slot - This element has no rendered output; it is a configuration element only. */ export default class CwDataTableColumn extends CwElement { static styles: CSSResultGroup; /** The key in each row data object that this column displays. Required. */ name: string; /** The column header label. Falls back to `name` if not set. */ label: string; /** Makes the column header clickable for sorting. */ sortable: boolean; /** A CSS width value for this column, e.g. "200px" or "20%". */ width: string; /** A CSS min-width value for this column. */ minWidth: string; /** Alignment of cell content within the column. */ align: 'start' | 'center' | 'end'; /** Hides the column without removing it from the DOM. */ hidden: boolean; /** * A custom cell renderer. Called once per row with the cell value, the full row object, * and this column element. Return a Lit `TemplateResult` or a plain string. * * @example * column.renderCell = (value, row) => html`${value}`; */ get renderCell(): ((value: unknown, row: Record, column: CwDataTableColumn) => TemplateResult | string) | undefined; set renderCell(fn: ((value: unknown, row: Record, column: CwDataTableColumn) => TemplateResult | string) | undefined); private _renderCell?; handlePropertyChange(): void; render(): TemplateResult<1>; }