ui icon indicating copy to clipboard operation
ui copied to clipboard

feat(Table): expand row

Open EvertonWingert opened this issue 2 years ago โ€ข 5 comments

๐Ÿ”— Linked issue

The linked issue is about nested tables, but I think this would also solve. https://github.com/nuxt/ui/pull/746

โ“ Type of change

  • [x] ๐Ÿ“– Documentation (updates to the documentation or readme)
  • [ ] ๐Ÿž Bug fix (a non-breaking change that fixes an issue)
  • [ ] ๐Ÿ‘Œ Enhancement (improving an existing functionality)
  • [x] โœจ New feature (a non-breaking change that adds functionality)
  • [ ] ๐Ÿงน Chore (updates to the build process or auxiliary tools and libraries)
  • [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to change)

๐Ÿ“š Description

This is my interpretation of https://github.com/nuxt/ui/pull/746

Implementation of a table that can be expanded. Mainly used to show more details of a table row or related content.

Captura de tela 2023-11-28 214338

๐Ÿ“ Checklist

  • [x] I have linked an issue or discussion.
  • [x] I have updated the documentation accordingly.

EvertonWingert avatar Nov 29 '23 00:11 EvertonWingert

The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

Name Status Preview Updated (UTC)
ui โœ… Ready (Inspect) Visit Preview Jan 25, 2024 10:30am

vercel[bot] avatar Nov 29 '23 00:11 vercel[bot]

I second to this. I had to fallback to a Modal to show expanded info.

I also think I should be animated. Can Accordion be re-used?

DarkGhostHunter avatar Nov 30 '23 20:11 DarkGhostHunter

Would love to see this soon :)

richard-edwards avatar Mar 11 '24 03:03 richard-edwards

Any update on this?

shoaibsharif avatar Apr 06 '24 22:04 shoaibsharif

I would love to see this feature released

hoanghadu avatar Apr 29 '24 01:04 hoanghadu

any news about this?

zangetsu02 avatar May 28 '24 11:05 zangetsu02

any progress?

patrykskrzyniarz avatar Jun 04 '24 07:06 patrykskrzyniarz

@benjamincanac would be great to have this merged. This feature is so missing in NuxtUi tables at the moment. PR has been here for some time. At least, feedback would be appreciated. Thank you

husayt avatar Jun 10 '24 19:06 husayt

I'm so sorry for the delay! I've made a few changes to make the button configurable and to animate the icon ๐Ÿ˜Š

benjamincanac avatar Jul 23 '24 13:07 benjamincanac

This is great! Thanks!

AnthonyCVP avatar Jul 29 '24 13:07 AnthonyCVP

Great feature! However,

Not sure if I should post this here or as a separate bug, but if a table is set as expandable, and the table is empty at the same time, the emptyState will not take up the full width. See screenshot.

image

      <UTable
        :rows="selectedOrders"
        :columns="selectedOrdersColumns"
        class="w-full"
      >
        <template #id-data="{ row }">
          <span>{{ truncateUUID(row.id) }}</span>
        </template>
        <template #product-data="{ row }">
          <span>{{ row.product }}</span>
        </template>
        <template #expand="{ row }">
          <div class="p-4">
            <ul>
              <li>Bestelnummer: {{ row.id }}</li>
              <li>Aangemaakt op: {{ row.created_at }} door {{ row.created_by_full_name }}</li>
            </ul>
          </div>
        </template>
      </UTable>

simply removing the expand slot immediately solves it. any ui directives or making a custom empty state slot can not fix it.

rmbakker88 avatar Aug 16 '24 09:08 rmbakker88

@rmbakker88 could I ask you to open up a new issue with a reproduction link?

sandros94 avatar Aug 16 '24 09:08 sandros94

Expanding a row by clicking on it is currently not possible. That feature is definitely needed. Please make the openedRows value accessible externally.

kpouters avatar Sep 07 '24 10:09 kpouters