Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(addon-table): allow resize more than 100% width of table #9961

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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',
];
}
Loading