Skip to content

Commit

Permalink
fix(tree-table): Fixes overflow when info-group contains long texts
Browse files Browse the repository at this point in the history
  • Loading branch information
rowa-audil authored and lukasholzer committed Sep 8, 2020
1 parent e85bcb0 commit c9f1413
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
5 changes: 3 additions & 2 deletions apps/dev/src/tree-table/tree-table-demo.component.ts
Expand Up @@ -27,7 +27,8 @@ import {

const TESTDATA: ThreadNode[] = [
{
name: 'hz.hzInstance_1_cluster.thread',
name:
'hz.hzInstance_1_cluster.threadhz.hzInstance_1_cluster.threadhz.hzInstance_1_cluster.threadhz.hzInstance_1_cluster.thread',
icon: 'airplane',
threadlevel: 'S0',
totalTimeConsumption: 150,
Expand All @@ -49,7 +50,7 @@ const TESTDATA: ThreadNode[] = [
children: [
{
name:
'hz.hzInstance_1_cluster.thread_1_hz.hzInstance_1_cluster.thread-1',
'hz.hzInstance_1_cluster.thread_1_hz.hzInstance_1_cluster.thread-1hz.hzInstance_1_cluster.thread_1_hz.hzInstance_1_cluster.thread-1hz.hzInstance_1_cluster.thread_1_hz.hzInstance_1_cluster.thread-1',
icon: 'airplane',
threadlevel: 'S1',
totalTimeConsumption: 150,
Expand Down
4 changes: 3 additions & 1 deletion libs/barista-components/tree-table/README.md
Expand Up @@ -166,7 +166,9 @@ You want to add the table header by adding a `<dt-header-row>` inside the
The next step is to add the row where the columns get rendered. You can do this
by adding the `<dt-tree-table-row>` inside the `<dt-tree-table>` tag. You can
specify the columns that should be rendered and don't forget to bind the row's
data to the `<dt-tree-table-row>`s data input `[data]="row"`.
data to the `<dt-tree-table-row>`s data input `[data]="row"`. The text contained
will be cut to preserve the width correctly. Hovering over the cell/text will
reveal the whole text.

```html
<dt-tree-table-row
Expand Down
12 changes: 12 additions & 0 deletions libs/barista-components/tree-table/src/tree-table-row.scss
Expand Up @@ -35,6 +35,18 @@
&:nth-child(odd) ::ng-deep .dt-tree-toggle-cell {
border-left: solid 1px $dt-table-row-color-odd;
}

&::ng-deep .dt-tree-toggle-cell {
max-width: 24vw;
}

&::ng-deep .dt-tree-toggle-cell:hover {
max-width: 100vw;
}

&::ng-deep .dt-info-group-title {
text-overflow: ellipsis;
}
}

:host.dt-table-row-indicator ::ng-deep .dt-tree-table-toggle-cell-wrap::before {
Expand Down
Expand Up @@ -45,7 +45,8 @@ const TESTDATA: ThreadNode[] = [
blocked: 0,
},
{
name: 'hz.hzInstance_1_cluster.thread-2',
name:
'hz.hzInstance_1_cluster.thread-2 hz.hzInstance_2_cluster.thread-1 hz.hzInstance_2_cluster.thread-2 hz.hzInstance_3_cluster.thread-1',
icon: 'process',
threadlevel: 'S1',
totalTimeConsumption: 150,
Expand Down

0 comments on commit c9f1413

Please sign in to comment.