From 5cb78b9b3c8d60be7162a3ea5ab5ca8d0f3c2c45 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Fri, 3 May 2024 09:20:10 +0300 Subject: [PATCH] Refactor #5678 - TreeTable CSS and responsive structure improvements --- api-generator/components/treetable.js | 6 -- components/lib/treetable/BaseTreeTable.vue | 14 ++- components/lib/treetable/BodyCell.vue | 1 - components/lib/treetable/HeaderCell.vue | 1 - components/lib/treetable/TreeTable.d.ts | 18 ++-- components/lib/treetable/TreeTable.vue | 93 +++++++++++-------- .../lib/treetable/style/TreeTableStyle.js | 27 +++++- 7 files changed, 93 insertions(+), 67 deletions(-) diff --git a/api-generator/components/treetable.js b/api-generator/components/treetable.js index 80cf64b7b..c5c2ad785 100644 --- a/api-generator/components/treetable.js +++ b/api-generator/components/treetable.js @@ -210,12 +210,6 @@ const TreeTableProps = [ default: 'false', description: 'When specified, enables horizontal and/or vertical scrolling.' }, - { - name: 'scrollDirection', - type: 'string', - default: 'vertical', - description: 'Orientation of the scrolling, options are "vertical", "horizontal" and "both".' - }, { name: 'scrollHeight', type: 'string', diff --git a/components/lib/treetable/BaseTreeTable.vue b/components/lib/treetable/BaseTreeTable.vue index 40f08f115..8bf544090 100644 --- a/components/lib/treetable/BaseTreeTable.vue +++ b/components/lib/treetable/BaseTreeTable.vue @@ -150,22 +150,26 @@ export default { type: Boolean, default: false }, - scrollDirection: { - type: String, - default: 'vertical' - }, scrollHeight: { type: String, default: null }, responsiveLayout: { type: String, - default: null + default: 'scroll' }, size: { type: String, default: null }, + tableStyle: { + type: null, + default: null + }, + tableClass: { + type: [String, Object], + default: null + }, tableProps: { type: Object, default: null diff --git a/components/lib/treetable/BodyCell.vue b/components/lib/treetable/BodyCell.vue index fe05b3f8f..ab6492215 100644 --- a/components/lib/treetable/BodyCell.vue +++ b/components/lib/treetable/BodyCell.vue @@ -137,7 +137,6 @@ export default { selected: this.$parent.selected, frozen: this.columnProp('frozen'), scrollable: this.$parentInstance.scrollable, - scrollDirection: this.$parentInstance.scrollDirection, showGridlines: this.$parentInstance.showGridlines, size: this.$parentInstance?.size } diff --git a/components/lib/treetable/HeaderCell.vue b/components/lib/treetable/HeaderCell.vue index 887de11b1..8918be6a5 100644 --- a/components/lib/treetable/HeaderCell.vue +++ b/components/lib/treetable/HeaderCell.vue @@ -99,7 +99,6 @@ export default { frozen: this.$parentInstance.scrollable && this.columnProp('frozen'), resizable: this.resizableColumns, scrollable: this.$parentInstance.scrollable, - scrollDirection: this.$parentInstance.scrollDirection, showGridlines: this.$parentInstance.showGridlines, size: this.$parentInstance?.size } diff --git a/components/lib/treetable/TreeTable.d.ts b/components/lib/treetable/TreeTable.d.ts index f7b9c1c78..e53ff8960 100755 --- a/components/lib/treetable/TreeTable.d.ts +++ b/components/lib/treetable/TreeTable.d.ts @@ -586,20 +586,18 @@ export interface TreeTableProps { * Height of the scroll viewport in fixed pixels or the 'flex' keyword for a dynamic size. */ scrollHeight?: HintedString<'flex'> | undefined; - /** - * Orientation of the scrolling. - * @defaultValue vertical - */ - scrollDirection?: 'vertical' | 'horizontal' | 'both' | undefined; - /** - * Defines the responsive mode, currently only option is scroll. - * @defaultValue stack - */ - responsiveLayout?: 'stack' | 'scroll' | undefined; /** * Defines the size of the table. */ size?: 'small' | 'large' | undefined; + /** + * Inline style of the table element. + */ + tableStyle?: string | object | undefined; + /** + * Style class of the table element. + */ + tableClass?: string | object | undefined; /** * Props to pass to the table element. */ diff --git a/components/lib/treetable/TreeTable.vue b/components/lib/treetable/TreeTable.vue index 753c70d2e..f2dea75de 100755 --- a/components/lib/treetable/TreeTable.vue +++ b/components/lib/treetable/TreeTable.vue @@ -1,5 +1,5 @@ -
- - +
+
+