| 112 | |
| 113 | @customElement("ha-data-table") |
| 114 | export class HaDataTable extends LitElement { |
| 115 | @state() |
| 116 | @consume({ context: internationalizationContext, subscribe: true }) |
| 117 | private _i18n?: ContextType<typeof internationalizationContext>; |
| 118 | |
| 119 | @property({ type: Boolean }) public narrow = false; |
| 120 | |
| 121 | @property({ type: Object }) public columns: DataTableColumnContainer = {}; |
| 122 | |
| 123 | @property({ type: Array }) public data: DataTableRowData[] = []; |
| 124 | |
| 125 | @property({ type: Boolean }) public selectable = false; |
| 126 | |
| 127 | @property({ type: Boolean }) public clickable = false; |
| 128 | |
| 129 | /** |
| 130 | * Add an extra row at the bottom of the data table |
| 131 | * @type {TemplateResult} |
| 132 | */ |
| 133 | @property({ attribute: false }) public appendRow?; |
| 134 | |
| 135 | @property({ type: Boolean, attribute: "auto-height" }) |
| 136 | public autoHeight = false; |
| 137 | |
| 138 | // eslint-disable-next-line lit/no-native-attributes |
| 139 | @property({ type: String }) public id = "id"; |
| 140 | |
| 141 | @property({ attribute: false }) public noDataText?: string; |
| 142 | |
| 143 | @property({ attribute: false }) public searchLabel?: string; |
| 144 | |
| 145 | @property({ type: String }) public filter = ""; |
| 146 | |
| 147 | @property({ attribute: false }) public groupColumn?: string; |
| 148 | |
| 149 | @property({ attribute: false }) public groupOrder?: string[]; |
| 150 | |
| 151 | @property({ attribute: false }) public sortColumn?: string; |
| 152 | |
| 153 | @property({ attribute: false }) public sortDirection: SortingDirection = null; |
| 154 | |
| 155 | @property({ attribute: false }) public initialCollapsedGroups?: string[]; |
| 156 | |
| 157 | @property({ attribute: false }) public hiddenColumns?: string[]; |
| 158 | |
| 159 | @property({ attribute: false }) public columnOrder?: string[]; |
| 160 | |
| 161 | @state() private _filterable = false; |
| 162 | |
| 163 | @state() private _filter = ""; |
| 164 | |
| 165 | @state() private _filteredData?: DataTableRowData[]; |
| 166 | |
| 167 | @state() private _headerHeight = 0; |
| 168 | |
| 169 | @query("slot[name='header']") private _header!: HTMLSlotElement; |
| 170 | |
| 171 | @query(".mdc-data-table__header-row") private _headerRow?: HTMLDivElement; |
nothing calls this directly
no test coverage detected
searching dependent graphs…