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 17, 2024
1 parent 8374088 commit 75b8fcb
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
"import": ["@taiga-ui/cspell-config/cspell.config.js"],
"files": ["*/*.*"],
"ignorePaths": ["**/projects/i18n/languages/**", "**/addon-commerce/utils/get-currency-symbol.ts"],
"ignoreWords": ["Wachovia", "bottomsheet", "appbar", "qwertypgj_", "antialiasing", "xxxs", "significand"],
"ignoreWords": [
"Wachovia",
"bottomsheet",
"appbar",
"qwertypgj_",
"antialiasing",
"xxxs",
"significand",
"undoubtable",
"Clintock",
"Bonorum"
],
"ignoreRegExpList": ["\\(https?://.*?\\)", "\\/{1}.+\\/{1}", "\\%2F.+", "\\%2C.+", "\\ɵ.+", "\\ыва.+"],
"overrides": [
{
Expand Down
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
31 changes: 31 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,31 @@
<table tuiTable>
<thead>
<tr tuiThGroup>
<th
tuiTh
[resizable]="true"
>
Name
</th>
<th
tuiTh
[resizable]="true"
>
Age
</th>
<th tuiTh>Description</th>
</tr>
</thead>
<tbody tuiTbody>
<tr *ngFor="let item of data">
<td tuiTd>{{ item.name }}</td>
<td tuiTd>{{ item.balance }}</td>
<td
tuiTd
[style.white-space]="'nowrap'"
>
{{ item.description }}
</td>
</tr>
</tbody>
</table>
29 changes: 29 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,29 @@
import {NgForOf} from '@angular/common';
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: [NgForOf, TuiTable],
templateUrl: './index.html',
encapsulation,
changeDetection,
})
export default class Example {
protected readonly data = [
{
name: 'Alex Inkin',
balance: 1323525,
description:
'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.',
},
{
name: 'Roman Sedov',
balance: 423242,
description:
'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.',
},
] as const;
}
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 a large table',
];
}

0 comments on commit 75b8fcb

Please sign in to comment.