diff --git a/api-generator/components/treetable.js b/api-generator/components/treetable.js index 4d3be6134..08a56d04d 100644 --- a/api-generator/components/treetable.js +++ b/api-generator/components/treetable.js @@ -443,23 +443,39 @@ const TreeTableEvents = [ const TreeTableSlots = [ { name: 'header', - description: "Custom content for the component's header" + description: "Custom content for the component's header." }, { name: 'paginatorstart', - description: "Custom content for the component paginator's left side" + description: "Custom content for the component paginator's left side." }, { name: 'paginatorend', - description: "Custom content for the component paginator's right side" + description: "Custom content for the component paginator's right side." }, { name: 'empty', - description: 'Custom content when there is no data to display' + description: 'Custom content when there is no data to display.' }, { name: 'footer', - description: "Custom content for the component's footer" + description: "Custom content for the component's footer." + }, + { + name: 'loadingicon', + description: 'Custom loading icon template.' + }, + { + name: 'togglericon', + description: 'Custom toggler icon template.' + }, + { + name: 'checkboxicon', + description: 'Custom checkbox icon template.' + }, + { + name: 'sorticon', + description: 'Custom sort icon template.' } ]; diff --git a/components/lib/treetable/BodyCell.vue b/components/lib/treetable/BodyCell.vue index a5e93ac35..4c5045e80 100644 --- a/components/lib/treetable/BodyCell.vue +++ b/components/lib/treetable/BodyCell.vue @@ -1,24 +1,28 @@ diff --git a/components/lib/treetable/TreeTable.d.ts b/components/lib/treetable/TreeTable.d.ts index 849f94b61..bab6c818f 100755 --- a/components/lib/treetable/TreeTable.d.ts +++ b/components/lib/treetable/TreeTable.d.ts @@ -382,6 +382,31 @@ export interface TreeTableSlots { * Custom empty template. */ empty(): VNode[]; + /** + * Custom loading icon template. + */ + loadingicon(): VNode[]; + /** + * Custom toggler icon template. + */ + togglericon(): VNode[]; + /** + * Custom checkbox icon template. + */ + checkboxicon(): VNode[]; + /** + * Custom sort icon template. + */ + sorticon(scope: { + /** + * Whether or not column is sorted + */ + sorted: TreeNode; + /** + * Current sort order + */ + sortOrder: boolean; + }): VNode[]; } /** diff --git a/components/lib/treetable/TreeTable.vue b/components/lib/treetable/TreeTable.vue index 27447025d..a00f23a0c 100755 --- a/components/lib/treetable/TreeTable.vue +++ b/components/lib/treetable/TreeTable.vue @@ -2,7 +2,9 @@
- + + +
@@ -41,6 +43,7 @@ :sortOrder="d_sortOrder" :multiSortMeta="d_multiSortMeta" :sortMode="sortMode" + :templates="$slots['sorticon']" @column-click="onColumnHeaderClick" @column-resizestart="onColumnResizeStart" > @@ -69,6 +72,7 @@ :ariaSetSize="dataToRender.length" :ariaPosInset="index + 1" :tabindex="setTabindex(node, index)" + :templates="$slots" @node-toggle="onNodeToggle" @node-click="onNodeClick" @checkbox-change="onCheckboxChange" @@ -118,6 +122,7 @@ diff --git a/components/lib/treetable/TreeTableRow.vue b/components/lib/treetable/TreeTableRow.vue index 13c8f09f2..a2deab432 100755 --- a/components/lib/treetable/TreeTableRow.vue +++ b/components/lib/treetable/TreeTableRow.vue @@ -27,6 +27,7 @@ :selectionMode="selectionMode" :checked="checked" :partialChecked="partialChecked" + :templates="templates" @node-toggle="$emit('node-toggle', $event)" @checkbox-toggle="toggleCheckbox" > @@ -46,6 +47,7 @@ :indentation="indentation" :ariaPosInset="node.children.indexOf(childNode) + 1" :ariaSetSize="node.children.length" + :templates="templates" @node-toggle="$emit('node-toggle', $event)" @node-click="$emit('node-click', $event)" @checkbox-change="onCheckboxChange" @@ -104,6 +106,10 @@ export default { ariaPosInset: { type: Number, default: null + }, + templates: { + type: null, + default: null } }, nodeTouched: false,