Skip to content

Commit

Permalink
fix: Custom passthrough options for bodyRow (#6902)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpajon authored Jul 18, 2024
1 parent d1955a3 commit 678b78c
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
81 changes: 81 additions & 0 deletions components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -19460,6 +19460,87 @@
],
"callbacks": []
},
"DataTableBodyRowContext": {
"description": "Defines current options in DataTable bodyRow.",
"relatedProp": "",
"props": [
{
"name": "selected",
"optional": false,
"readonly": false,
"type": "boolean"
},
{
"name": "selectable",
"optional": false,
"readonly": false,
"type": "boolean"
},
{
"name": "stripedRows",
"optional": false,
"readonly": false,
"type": "boolean"
},
{
"name": "index",
"optional": false,
"readonly": false,
"type": "number"
}
],
"callbacks": []
},
"DataTableBodyRowState": {
"description": "Defines current inline state in DataTable bodyRow.",
"relatedProp": "",
"props": [
{
"name": "editing",
"optional": false,
"readonly": false,
"type": "boolean"
}
],
"callbacks": []
},
"DataTableBodyRowPassThroughMethodOptions": {
"description": "Custom passthrough(pt) option method for bodyRow.",
"relatedProp": "",
"props": [
{
"name": "hostName",
"optional": false,
"readonly": false,
"type": "string"
},
{
"name": "context",
"optional": false,
"readonly": false,
"type": "DataTableBodyRowContext"
},
{
"name": "parent",
"optional": false,
"readonly": false,
"type": "DataTablePassThroughMethodOptions<TValue>"
},
{
"name": "props",
"optional": false,
"readonly": false,
"type": "DataTableBaseProps<TValue>"
},
{
"name": "state",
"optional": false,
"readonly": false,
"type": "DataTableBodyRowState"
}
],
"callbacks": []
},
"DataTableBaseProps": {
"description": "Defines valid properties in DataTable component. In addition to these, all properties of HTMLDivElement can be used in this component.",
"relatedProp": "",
Expand Down
28 changes: 28 additions & 0 deletions components/lib/datatable/datatable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,34 @@ export interface DataTablePassThroughOptions {
hooks?: ComponentHooks;
}

/**
* Defines current options in DataTable bodyRow.
*/
export interface DataTableBodyRowContext {
selected: boolean;
selectable: boolean;
stripedRows: boolean;
index: number;
}

/**
* Defines current inline state in DataTable bodyRow.
*/
export interface DataTableBodyRowState {
editing: boolean;
}

/**
* Custom passthrough(pt) option method for bodyRow.
*/
export interface DataTableBodyRowPassThroughMethodOptions<TValue extends DataTableValueArray> {
hostName: string;
context: DataTableBodyRowContext;
parent: DataTablePassThroughMethodOptions<TValue>;
props: DataTableBaseProps<TValue>;
state: DataTableBodyRowState;
}

type SortOrder = 1 | 0 | -1 | null | undefined;

/**
Expand Down

0 comments on commit 678b78c

Please sign in to comment.