Debian Codegraph @

node/@patternfly/react-table/src/components/Table/utils/transformers.tsx

raw
1 import { IFormatterValueType, IExtra, ITransform } from '../TableTypes';
2
3 export const emptyTD: ITransform = () => ({
4 component: 'td'
5 });
6
7 export const scopeColTransformer: ITransform = () => ({
8 scope: 'col'
9 });
10
11 export const emptyCol: ITransform = (label: IFormatterValueType) => ({
12 ...(label ? {} : { scope: '' })
13 });
14
15 export const parentId: ITransform = (_value: IFormatterValueType, { rowData }: IExtra) => ({
16 parentId: rowData.parent
17 });
18
19 export const mapProps: ITransform = (_label: IFormatterValueType, { property, rowData }: IExtra) => ({
20 ...(rowData[property] && rowData[property].props)
21 });