From 91cfdb1c2b4b70f30aa610436caaa8bb90b9b5ba Mon Sep 17 00:00:00 2001 From: Blesilda Ramirez Date: Mon, 7 Oct 2024 18:35:49 +0800 Subject: [PATCH] Improve detection of no item rows in Table component (#421) * Improve detection of no item rows in Table component * Update how columnsCount are managed in TableColumn component --- src/components/Table/Table.stories.js | 42 +++++++++++++++++++++++++++ src/components/Table/TableBody.vue | 18 ++++++++---- src/components/Table/TableColumn.vue | 10 +++++-- src/components/Table/TableRow.vue | 18 +++++++++++- 4 files changed, 79 insertions(+), 9 deletions(-) diff --git a/src/components/Table/Table.stories.js b/src/components/Table/Table.stories.js index acb3219b3..6a2c12f43 100644 --- a/src/components/Table/Table.stories.js +++ b/src/components/Table/Table.stories.js @@ -282,3 +282,45 @@ export const WithTitleAndDescription = { args: {}, }; + +export const WithNoItems = { + render: (args) => ({ + components: { + PkpTable, + TableHeader, + TableBody, + TableRow, + TableColumn, + TableCell, + PkpButton, + }, + setup() { + return {args}; + }, + template: ` + + + + + ID + Title + Views + Downloads + Total + Action + + + + + + `, + }), + + args: {}, +}; diff --git a/src/components/Table/TableBody.vue b/src/components/Table/TableBody.vue index 52040ad5f..18a5d77da 100644 --- a/src/components/Table/TableBody.vue +++ b/src/components/Table/TableBody.vue @@ -1,7 +1,7 @@ - +