Skip to content

Commit 3dd7fba

Browse files
committed
docs(AnalyticalTable): explain highlightField
1 parent 73c60c7 commit 3dd7fba

File tree

1 file changed

+16
-3
lines changed
  • packages/main/src/components/AnalyticalTable

1 file changed

+16
-3
lines changed

packages/main/src/components/AnalyticalTable/index.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createComponentStyles } from '@ui5/webcomponents-react-base/lib/createC
22
import { usePassThroughHtmlProps } from '@ui5/webcomponents-react-base/lib/usePassThroughHtmlProps';
33
import { enrichEventWithDetails } from '@ui5/webcomponents-react-base/lib/Utils';
44
import { TableScaleWidthMode } from '@ui5/webcomponents-react/lib/TableScaleWidthMode';
5+
import { ValueState } from '@ui5/webcomponents-react/lib/ValueState';
56
import { TableSelectionBehavior } from '@ui5/webcomponents-react/lib/TableSelectionBehavior';
67
import { TableSelectionMode } from '@ui5/webcomponents-react/lib/TableSelectionMode';
78
import debounce from 'lodash.debounce';
@@ -56,7 +57,7 @@ export interface TableProps extends CommonProps {
5657
* Please look at the [AnalyticalTableColumnDefinition interface](#column-properties) for a full list of options.
5758
*/
5859
columns: AnalyticalTableColumnDefinition[];
59-
data: object[];
60+
data: Record<any, any>[];
6061

6162
/**
6263
* Component or text of title section of the Table (if not set it will be hidden)
@@ -75,8 +76,19 @@ export interface TableProps extends CommonProps {
7576
noDataText?: string;
7677
rowHeight?: number;
7778
alternateRowColor?: boolean;
79+
/**
80+
* Flag whether the table should add an extra column for displaying row highlights, based on the `highlightField` prop.
81+
*/
7882
withRowHighlight?: boolean;
79-
highlightField?: string;
83+
/**
84+
* Accessor for showing the row highlights. Only taken into account when `withRowHighlight` is set.
85+
*
86+
* Default Value: `status`.
87+
*
88+
* The value of this prop can either be a `string` pointing to a `ValueState` in your dataset
89+
* or an accessor function which should return a `ValueState`.
90+
*/
91+
highlightField?: string | ((row: Record<any, any>) => ValueState);
8092

8193
// features
8294
filterable?: boolean;
@@ -86,7 +98,7 @@ export interface TableProps extends CommonProps {
8698
selectionBehavior?: TableSelectionBehavior;
8799
selectionMode?: TableSelectionMode;
88100
scaleWidthMode?: TableScaleWidthMode;
89-
columnOrder?: object[];
101+
columnOrder?: string[];
90102
infiniteScroll?: boolean;
91103
infiniteScrollThreshold?: number;
92104

@@ -462,6 +474,7 @@ AnalyticalTable.defaultProps = {
462474
tableHooks: [],
463475
visibleRows: 15,
464476
subRowsKey: 'subRows',
477+
highlightField: 'status',
465478
selectedRowIds: {},
466479
onGroup: () => {},
467480
onRowExpandChange: () => {},

0 commit comments

Comments
 (0)