MCPcopy Create free account
hub / github.com/Autodesk/react-base-table / TableHeaderRow

Function TableHeaderRow

src/TableHeaderRow.js:9–40  ·  view source on GitHub ↗
({
  className,
  style,
  columns,
  headerIndex,
  cellRenderer,
  headerRenderer,
  expandColumnKey,
  expandIcon: ExpandIcon,
  tagName: Tag,
  ...rest
})

Source from the content-addressed store, hash-verified

7 * HeaderRow component for BaseTable
8 */
9const TableHeaderRow = ({
10 className,
11 style,
12 columns,
13 headerIndex,
14 cellRenderer,
15 headerRenderer,
16 expandColumnKey,
17 expandIcon: ExpandIcon,
18 tagName: Tag,
19 ...rest
20}) => {
21 let cells = columns.map((column, columnIndex) =>
22 cellRenderer({
23 columns,
24 column,
25 columnIndex,
26 headerIndex,
27 expandIcon: column.key === expandColumnKey && <ExpandIcon />,
28 })
29 );
30
31 if (headerRenderer) {
32 cells = renderElement(headerRenderer, { cells, columns, headerIndex });
33 }
34
35 return (
36 <Tag {...rest} className={className} style={style}>
37 {cells}
38 </Tag>
39 );
40};
41
42TableHeaderRow.defaultProps = {
43 tagName: 'div',

Callers

nothing calls this directly

Calls 1

renderElementFunction · 0.90

Tested by

no test coverage detected