Skip to content

Commit

Permalink
Refactor #4024 - DataTable & TreeTable
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Jun 5, 2023
1 parent 0da0751 commit f52d1d9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 57 deletions.
17 changes: 12 additions & 5 deletions components/lib/column/Column.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ export interface ColumnPassThroughOptions {
*/
rowEditorInitIcon?: ColumnPassThroughOptionType;
/**
* Uses to pass attributes to the row editor edit button's DOM element.
* Uses to pass attributes to the row editor save button's DOM element.
*/
rowEditorEditButton?: ColumnPassThroughOptionType;
rowEditorSaveButton?: ColumnPassThroughOptionType;
/**
* Uses to pass attributes to the row editor edit icon's DOM element.
* Uses to pass attributes to the row editor save icon's DOM element.
*/
rowEditorEditIcon?: ColumnPassThroughOptionType;
rowEditorSaveIcon?: ColumnPassThroughOptionType;
/**
* Uses to pass attributes to the row editor cancel button's DOM element.
*/
Expand All @@ -289,7 +289,14 @@ export interface ColumnPassThroughOptions {
* Uses to pass attributes to the row editor cancel icon's DOM element.
*/
rowEditorCancelIcon?: ColumnPassThroughOptionType;

/**
* Uses to pass attributes to the footer cell's DOM element.
*/
footerCell?: ColumnPassThroughOptionType;
/**
* Uses to pass attributes to the body cell content's DOM element.
*/
bodyCellContent?: ColumnPassThroughOptionType;
/**
* Uses to pass attributes to the hidden input wrapper's DOM element.
*/
Expand Down
4 changes: 0 additions & 4 deletions components/lib/datatable/DataTable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,6 @@ export interface DataTablePassThroughOptions {
* Uses to pass attributes to the footerr ow's DOM element.
*/
footerRow?: DataTablePassThroughOptionType;
/**
* Uses to pass attributes to the footer cell's DOM element.
*/
footerCell?: DataTablePassThroughOptionType;
/**
* Uses to pass attributes to the resize helper's DOM element.
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/treetable/BodyCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</div>
<component v-if="column.children && column.children.body" :is="column.children.body" :node="node" :column="column" />
<template v-else>
<span v-bind="getColumnPT('cellContent')">{{ resolveFieldData(node.data, columnProp('field')) }}</span>
<span v-bind="getColumnPT('bodyCellContent')">{{ resolveFieldData(node.data, columnProp('field')) }}</span>
</template>
</td>
</template>
Expand Down
56 changes: 12 additions & 44 deletions components/lib/treetable/TreeTable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,21 +212,29 @@ export interface TreeTablePassThroughOptions {
*/
headerRow?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the header cell's DOM element.
* Uses to pass attributes to the header filter row's DOM element.
*/
headerCell?: TreeTablePassThroughOptionType;
headerFilterRow?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the header filter cell's DOM element.
*/
headerFilterCell?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the tbody's DOM element.
*/
tbody?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the row's DOM element.
*/
row?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the empty message's DOM element.
*/
emptyMessage?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the body cell's DOM element.
* Uses to pass attributes to the empty message cell's DOM element.
*/
bodyCell?: TreeTablePassThroughOptionType;
emptyMessageCell?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the tfoot's DOM element.
*/
Expand All @@ -243,46 +251,6 @@ export interface TreeTablePassThroughOptions {
* Uses to pass attributes to the resize helper's DOM element.
*/
resizeHelper?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the row toggler's DOM element.
*/
rowToggler?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the row toggler icon's DOM element.
*/
rowTogglerIcon?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the column resizer's DOM element.
*/
columnResizer?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the sort badge's DOM element.
*/
sortBadge?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the header title's DOM element.
*/
headerTitle?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the checkbox wrapper's DOM element.
*/
checkboxWrapper?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to checkbox's DOM element.
*/
checkbox?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the checkbox icon's DOM element.
*/
checkboxIcon?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the hidden input wrapper's DOM element.
*/
hiddenInputWrapper?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the hidden input's DOM element.
*/
hiddenInput?: TreeTablePassThroughOptionType;
/**
* Uses to pass attributes to the Column helper components.
*/
Expand Down
6 changes: 3 additions & 3 deletions components/lib/treetable/TreeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
></TTHeaderCell>
</template>
</tr>
<tr v-if="hasColumnFilter()" v-bind="ptm('headerRow')">
<tr v-if="hasColumnFilter()" v-bind="ptm('headerFilterRow')">
<template v-for="(col, i) of columns" :key="columnProp(col, 'columnKey') || columnProp(col, 'field') || i">
<th v-if="!columnProp(col, 'hidden')" :class="getFilterColumnHeaderClass(col)" :style="[columnProp(col, 'style'), columnProp(col, 'filterHeaderStyle')]" v-bind="ptm('headerCell')">
<th v-if="!columnProp(col, 'hidden')" :class="getFilterColumnHeaderClass(col)" :style="[columnProp(col, 'style'), columnProp(col, 'filterHeaderStyle')]" v-bind="ptm('headerFilterCell')">
<component v-if="col.children && col.children.filter" :is="col.children.filter" :column="col" :index="i" />
</th>
</template>
Expand Down Expand Up @@ -96,7 +96,7 @@
></TTRow>
</template>
<tr v-else :class="cx('emptyMessage')" v-bind="ptm('emptyMessage')">
<td :colspan="columns.length" v-bind="ptm('bodyCell')">
<td :colspan="columns.length" v-bind="ptm('emptyMessageCell')">
<slot name="empty"></slot>
</td>
</tr>
Expand Down

0 comments on commit f52d1d9

Please sign in to comment.