Skip to content

Commit

Permalink
[DataTable]: added docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaroslav Kuznietsov committed Nov 4, 2024
1 parent 070b31f commit 0bb9f60
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions uui-core/src/types/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export type ICanBeFixed = {
fix?: 'left' | 'right';
};

/**
* Columns group configuration.
*/
export interface DataColumnGroupProps extends IHasCX, IClickable {
/**
* Unique key to identify the columns group. Used to reference columns group.
Expand Down Expand Up @@ -70,6 +73,9 @@ export interface DataColumnProps<TItem = any, TId = any, TFilter = any> extends
*/
key: string;

/**
* A unique identifier for a group of columns that establishes a connection between the column and the group of columns.
*/
group?: string;

/** Column caption. Can be a plain text, or any React Component */
Expand Down Expand Up @@ -193,10 +199,26 @@ export interface DataTableHeaderCellProps<TItem = any, TId = any> extends IEdita
renderFilter?: (dropdownProps: IDropdownBodyProps) => React.ReactNode;
}

/**
* DataTable columns group header cell props.
*/
export interface DataTableHeaderGroupCellProps extends IHasCX, IEditable<DataTableState> {
/**
* A unique identifier for a group.
*/
key: string;
/**
* Columns group configuration.
*/
group: DataColumnGroupProps;
/**
* Defines if first column of the group is the first one in the table header.
*/
isFirstCell: boolean;

/**
* Defines if last column of the group is the last one in the table header.
*/
isLastCell: boolean;
}

Expand All @@ -207,6 +229,9 @@ export type DataTableConfigModalParams = IEditable<DataSourceState> & {

export interface DataTableHeaderRowProps<TItem = any, TId = any> extends IEditable<DataTableState>, IHasCX, DataTableColumnsConfigOptions {
columns: DataColumnProps<TItem, TId>[];
/**
* Columns group configuration.
*/
columnGroups?: DataColumnGroupProps[];
selectAll?: ICheckable;
/**
Expand All @@ -215,6 +240,9 @@ export interface DataTableHeaderRowProps<TItem = any, TId = any> extends IEditab
showFoldAll?: boolean;
onConfigButtonClick?: (params: DataTableConfigModalParams) => any;
renderCell?: (props: DataTableHeaderCellProps<TItem, TId>) => React.ReactNode;
/**
* Columns group cell render function.
*/
renderGroupCell?: (props: DataTableHeaderGroupCellProps) => React.ReactNode;
renderConfigButton?: () => React.ReactNode;
}
Expand Down

0 comments on commit 0bb9f60

Please sign in to comment.