diff --git a/components/lib/column/Column.d.ts b/components/lib/column/Column.d.ts index 7cbe89a5b..5d11ee453 100755 --- a/components/lib/column/Column.d.ts +++ b/components/lib/column/Column.d.ts @@ -23,9 +23,8 @@ export declare type ColumnPassThroughOptionType = ColumnPassThroughAttributes | */ export interface ColumnPassThroughMethodOptions { props: ColumnProps; - state: ColumnState; - context: ColumnContext; parent: DataTablePassThroughOptions; + context: ColumnContext; } /** @@ -348,27 +347,6 @@ export interface ColumnState { rowGroupHeaderStyleObject: object; } -/** - * Defines current options in Column component. - */ -export interface ColumnContext { - /** - * Current checked state of row as a boolean. - * @defaultValue false - */ - checked: boolean; - /** - * Current focused state of row as a boolean. - * @defaultValue false - */ - focused: boolean; - /** - * Current disabled state of row as a boolean. - * @defaultValue false - */ - disabled: boolean; -} - /** * Defines valid properties in Column component. */ @@ -579,6 +557,31 @@ export interface ColumnProps { unstyled?: boolean; } +/** + * Defines current options in Column component. + */ +export interface ColumnContext { + /** + * Current index of the column. + */ + index: number; + /** + * Current checked state of row as a boolean. + * @defaultValue false + */ + checked: boolean; + /** + * Current focused state of row as a boolean. + * @defaultValue false + */ + focused: boolean; + /** + * Current disabled state of row as a boolean. + * @defaultValue false + */ + disabled: boolean; +} + /** * Defines valid slots in Column component. */ diff --git a/components/lib/columngroup/ColumnGroup.d.ts b/components/lib/columngroup/ColumnGroup.d.ts index 443c3c055..65360f7cf 100755 --- a/components/lib/columngroup/ColumnGroup.d.ts +++ b/components/lib/columngroup/ColumnGroup.d.ts @@ -16,6 +16,7 @@ export declare type ColumnGroupPassThroughOptionType = ColumnGroupPassThroughAtt export interface ColumnGroupPassThroughMethodOptions { props: ColumnGroupProps; parent: DataTablePassThroughOptions; + context: ColumnGroupContext; } /** @@ -56,6 +57,16 @@ export interface ColumnGroupProps { unstyled?: boolean; } +/** + * Defines current options in ColumnGroup component. + */ +export interface ColumnGroupContext { + /** + * Current type of the column group. + */ + type: string; +} + /** * Defines valid slots in ColumnGroup component. */ diff --git a/components/lib/datatable/BodyCell.vue b/components/lib/datatable/BodyCell.vue index 2aacba596..7dba51f84 100755 --- a/components/lib/datatable/BodyCell.vue +++ b/components/lib/datatable/BodyCell.vue @@ -1,5 +1,5 @@ @@ -202,17 +202,22 @@ export default { columnProp(prop) { return ObjectUtils.getVNodeProp(this.column, prop); }, - getColumnPTOptions(column, key) { - return this.ptmo(this.getColumnProp(column), key, { - props: column.props, + getColumnPT(key) { + const columnMetaData = { + props: this.column.props, parent: { props: this.$props, state: this.$data + }, + context: { + index: this.index } - }); + }; + + return { ...this.ptm(`column.${key}`, { column: columnMetaData }), ...this.ptmo(this.getColumnProp(), key, columnMetaData) }; }, - getColumnProp(column) { - return column.props && column.props.pt ? column.props.pt : undefined; //@todo + getColumnProp() { + return this.column.props && this.column.props.pt ? this.column.props.pt : undefined; }, resolveFieldData() { return ObjectUtils.resolveFieldData(this.rowData, this.field); diff --git a/components/lib/datatable/DataTable.d.ts b/components/lib/datatable/DataTable.d.ts index 486cec708..278f921d7 100755 --- a/components/lib/datatable/DataTable.d.ts +++ b/components/lib/datatable/DataTable.d.ts @@ -596,9 +596,9 @@ export interface DataTablePassThroughOptions { */ rowgroupHeader?: DataTablePassThroughOptionType; /** - * Uses to pass attributes to the row's DOM element. + * Uses to pass attributes to the body row's DOM element. */ - row?: DataTablePassThroughOptionType; + bodyRow?: DataTablePassThroughOptionType; /** * Uses to pass attributes to the row expansion's DOM element. */ diff --git a/components/lib/datatable/FooterCell.vue b/components/lib/datatable/FooterCell.vue index 19907519e..5d9bf4def 100644 --- a/components/lib/datatable/FooterCell.vue +++ b/components/lib/datatable/FooterCell.vue @@ -1,5 +1,5 @@