Skip to content

Commit ac9d235

Browse files
committed
[ui-react] Extra cells
1 parent b725873 commit ac9d235

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

src/@types/ui-react-dom/docs.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,29 @@
7171
*/
7272
/// CustomResultCell.getComponentProps
7373
}
74+
/**
75+
* The ExtraCell object is used to configure the rendering of extra cells in an
76+
* HTML table, to the left or right of the regular data cells.
77+
* @category Configuration
78+
* @since v6.6.0
79+
*/
80+
/// ExtraCell
81+
{
82+
/**
83+
* A string that will be used as the label at the top of the table
84+
* column for this Cell.
85+
* @category Prop
86+
* @since v6.6.0
87+
*/
88+
/// ExtraCell.label
89+
/**
90+
* An custom component for rendering each extra Cell in the table, and which
91+
* will be passed props for the Row in which it is placed.
92+
* @category Prop
93+
* @since v6.6.0
94+
*/
95+
/// ExtraCell.component
96+
}
7497
/**
7598
* HtmlTableProps props are used for components that will render in an HTML
7699
* table, such as the TableInHtmlTable component or SortedTableInHtmlTable

src/@types/ui-react-dom/index.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type {
99
QueriesOrQueriesId,
1010
RelationshipsOrRelationshipsId,
1111
ResultCellProps,
12+
RowProps,
1213
StoreOrStoreId,
1314
ValueProps,
1415
} from '../ui-react/index.d.ts';
@@ -33,6 +34,14 @@ export type CustomResultCell = {
3334
getComponentProps?: (rowId: Id, cellId: Id) => ExtraProps;
3435
};
3536

37+
/// ExtraCell
38+
export type ExtraCell = {
39+
/// ExtraCell.label
40+
label: string;
41+
/// ExtraCell.component
42+
component: ComponentType<RowProps>;
43+
};
44+
3645
/// HtmlTableProps
3746
export type HtmlTableProps = {
3847
/// HtmlTableProps.className

src/@types/ui-react-dom/with-schemas/index.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type {
1313
QueriesOrQueriesId,
1414
RelationshipsOrRelationshipsId,
1515
ResultCellProps,
16+
RowProps,
1617
StoreOrStoreId,
1718
ValueProps,
1819
} from '../../_internal/ui-react/with-schemas/index.d.ts';
@@ -46,6 +47,17 @@ export type CustomResultCell<Schemas extends OptionalSchemas> = {
4647
getComponentProps?: (rowId: Id, cellId: Id) => ExtraProps;
4748
};
4849

50+
/// ExtraCell
51+
export type ExtraCell<
52+
Schemas extends OptionalSchemas,
53+
TableId extends TableIdFromSchema<Schemas[0]>,
54+
> = {
55+
/// ExtraCell.label
56+
label: string;
57+
/// ExtraCell.component
58+
component: ComponentType<RowProps<Schemas, TableId>>;
59+
};
60+
4961
/// HtmlTableProps
5062
export type HtmlTableProps = {
5163
/// HtmlTableProps.className

0 commit comments

Comments
 (0)