From 71553180294c53024c28de9bbebf4ea69f616da7 Mon Sep 17 00:00:00 2001 From: Everton <54149497+EvertonWingert@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:43:39 -0300 Subject: [PATCH] feat(Table): expand row (#1036) Co-authored-by: Benjamin Canac --- .../examples/TableExampleExpandable.vue | 49 ++++++++++++++ docs/content/2.components/table.md | 13 ++++ src/runtime/components/data/Table.vue | 64 +++++++++++++++---- src/runtime/ui.config/data/table.ts | 10 +++ 4 files changed, 125 insertions(+), 11 deletions(-) create mode 100644 docs/components/content/examples/TableExampleExpandable.vue diff --git a/docs/components/content/examples/TableExampleExpandable.vue b/docs/components/content/examples/TableExampleExpandable.vue new file mode 100644 index 00000000..90f1adf2 --- /dev/null +++ b/docs/components/content/examples/TableExampleExpandable.vue @@ -0,0 +1,49 @@ + + + diff --git a/docs/content/2.components/table.md b/docs/content/2.components/table.md index 117e9530..fa9776d9 100644 --- a/docs/content/2.components/table.md +++ b/docs/content/2.components/table.md @@ -301,6 +301,19 @@ componentProps: --- :: +### Expandable :u-badge{label="New" class="align-middle ml-2 !rounded-full" variant="subtle"} + +You can use the `expand` slot to display extra information about a row. You will have access to the `row` property in the slot scope. + +::component-example{class="grid"} +--- +padding: false +component: 'table-example-expandable' +componentProps: + class: 'flex-1' +--- +:: + ### Loading Use the `loading` prop to indicate that data is currently loading with an indeterminate [Progress](/components/progress#indeterminate) bar. diff --git a/src/runtime/components/data/Table.vue b/src/runtime/components/data/Table.vue index 093643fb..6be9c4a7 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -12,6 +12,10 @@ + + Expand + + @@ -84,7 +110,7 @@