Skip to content

Commit

Permalink
feat(addon-table): allow resize more than 100% width of table
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Dec 13, 2024
1 parent 17ec382 commit 1de71f1
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 2 deletions.
2 changes: 2 additions & 0 deletions projects/addon-table/components/table/th/th.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import {TUI_TABLE_OPTIONS, TuiSortDirection} from '../table.options';
styleUrls: ['./th.style.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {
'[style.min-width.px]': 'width',
'[style.width.px]': 'width',
'[style.max-width.px]': 'width',
'[class._sticky]': 'sticky',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
>
Name
</th>
<th tuiTh>Balance</th>
<th
tuiTh
[resizable]="true"
>
Balance
</th>
<th tuiTh>Country</th>
</tr>
</thead>
<tbody
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.table {
inline-size: 100%;
max-inline-size: 100%;
table-layout: fixed;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ export default class Example {
{
name: 'Alex Inkin',
balance: 1323525,
country: 'UAE',
},
{
name: 'Roman Sedov',
balance: 423242,
country: 'Russia',
},
] as const;

Expand Down
60 changes: 60 additions & 0 deletions projects/demo/src/modules/components/table/examples/8/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<table
tuiTable
[columns]="['a', 'b', 'c']"
>
<thead>
<tr tuiThGroup>
<th
*tuiHead="'a'"
tuiTh
[resizable]="true"
>
a
</th>
<th
*tuiHead="'b'"
tuiTh
[resizable]="true"
>
b
</th>
<th
*tuiHead="'c'"
tuiTh
>
c
</th>
</tr>
</thead>
<tbody
tuiTbody
[data]="[{a: 1, b: 2, c: 3}]"
>
<tr tuiTr>
<td
*tuiCell="'a'"
tuiTd
>
a
</td>
<td
*tuiCell="'b'"
tuiTd
>
b
</td>
<td
*tuiCell="'c'"
tuiTd
>
content content
ntcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcon
tentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontent
contentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentconten
tcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentconten
tcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentco
ntentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontentcontent
</td>
</tr>
</tbody>
</table>
13 changes: 13 additions & 0 deletions projects/demo/src/modules/components/table/examples/8/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {Component} from '@angular/core';
import {changeDetection} from '@demo/emulate/change-detection';
import {encapsulation} from '@demo/emulate/encapsulation';
import {TuiTable} from '@taiga-ui/addon-table';

@Component({
standalone: true,
imports: [TuiTable],
templateUrl: './index.html',
encapsulation,
changeDetection,
})
export default class Example {}
2 changes: 1 addition & 1 deletion projects/demo/src/modules/components/table/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[component]="index + 1 | tuiComponent"
[content]="index + 1 | tuiExample"
[description]="index === 4 ? cdkVirtualScrollDescription : null"
[fullsize]="index === 4 || index === 5"
[fullsize]="index === 0 || index === 4 || index === 5"
[heading]="example"
[id]="example | tuiKebab"
>
Expand Down
1 change: 1 addition & 0 deletions projects/demo/src/modules/components/table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ export default class Page {
'Virtual scroll',
'Dynamic columns',
'Footer',
'Resize columns',
];
}

0 comments on commit 1de71f1

Please sign in to comment.