Skip to content

Commit

Permalink
Merge branch 'CDEP-3490-Auto-collapse-expanded-row' of https://github…
Browse files Browse the repository at this point in the history
….com/scania-digital-design-system/tegel into CDEP-3490-Auto-collapse-expanded-row
  • Loading branch information
ckrook committed Oct 16, 2024
2 parents c0eb57b + 905269f commit b77bd1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ We recommend fitting your content within the table’s natural size whenever pos
| `overflow` | `overflow` | Controls the overflow behavior of the expandable row content | `"auto" \| "hidden"` | `'auto'` |
| `rowId` | `row-id` | ID for the table row. Randomly generated if not specified. | `string` | `generateUniqueId()` |


## Events

| Event | Description | Type |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ export default {
options: ['[5,10,15]', '[20,30,40]', '[100, 220, 303]'],
},
},
pages: {
name: 'Pages',
description: 'Number of pages',
control: {
type: 'number',
min: 1,
max: 1000,
},
},
rowsPerPage: {
name: 'Rows per page',
description: 'Show/hide rows per page dropdown in footer',
Expand Down Expand Up @@ -143,6 +152,7 @@ export default {
verticalDivider: false,
rowsPerPage: true,
rowsPerPageValues: '[10,25,50]',
pages: 4,
noMinWidth: false,
column1Width: '',
column2Width: '',
Expand All @@ -158,6 +168,7 @@ const PaginationTemplate = ({
verticalDivider,
rowsPerPage,
rowsPerPageValues,
pages,
noMinWidth,
column1Width,
column2Width,
Expand Down Expand Up @@ -225,7 +236,7 @@ const PaginationTemplate = ({
<tds-body-cell cell-value="Test value 8" cell-key="mileage"></tds-body-cell>
</tds-table-body-row>
</tds-table-body>
<tds-table-footer pages="4" pagination rowsperpage="${rowsPerPage}"></tds-table-footer>
<tds-table-footer pages="${pages}" pagination rowsperpage="${rowsPerPage}"></tds-table-footer>
</tds-table>
<!-- Note: Code below is just for demo purposes -->
<div class="tds-u-mt1" style="width: 500px; background-color: lightblue; padding: 16px;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ export class TdsTableFooter {

private rowsPerPageChange(event) {
this.rowsPerPageValue = parseInt(event.detail.value);
if (this.paginationValue > this.pages) {
this.paginationValue = this.pages;
}
this.emitTdsPagination();
}

Expand Down

0 comments on commit b77bd1d

Please sign in to comment.