From 347694b4b5e69c6b3e703729aba2ce9984d999f0 Mon Sep 17 00:00:00 2001
From: J-Michalek <71264422+J-Michalek@users.noreply.github.com>
Date: Mon, 30 Jun 2025 12:33:11 +0200
Subject: [PATCH] fix(Table): add `scope` attribute to headers (#4417)
---
src/runtime/components/Table.vue | 1 +
.../__snapshots__/Table-vue.spec.ts.snap | 234 +++++++++---------
.../__snapshots__/Table.spec.ts.snap | 234 +++++++++---------
3 files changed, 235 insertions(+), 234 deletions(-)
diff --git a/src/runtime/components/Table.vue b/src/runtime/components/Table.vue
index 1c7d6081..af85b513 100644
--- a/src/runtime/components/Table.vue
+++ b/src/runtime/components/Table.vue
@@ -354,6 +354,7 @@ defineExpose({
v-for="header in headerGroup.headers"
:key="header.id"
:data-pinned="header.column.getIsPinned()"
+ :scope="header.colSpan > 1 ? 'colgroup' : 'col'"
:colspan="header.colSpan > 1 ? header.colSpan : undefined"
:class="ui.th({
class: [
diff --git a/test/components/__snapshots__/Table-vue.spec.ts.snap b/test/components/__snapshots__/Table-vue.spec.ts.snap
index d6505c4f..44103171 100644
--- a/test/components/__snapshots__/Table-vue.spec.ts.snap
+++ b/test/components/__snapshots__/Table-vue.spec.ts.snap
@@ -6,10 +6,10 @@ exports[`Table > renders with as correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -60,10 +60,10 @@ exports[`Table > renders with body-bottom slot correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -114,10 +114,10 @@ exports[`Table > renders with body-top slot correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -167,10 +167,10 @@ exports[`Table > renders with caption correctly 1`] = `
Table caption
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -221,10 +221,10 @@ exports[`Table > renders with caption slot correctly 1`] = `
Caption slot
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -275,10 +275,10 @@ exports[`Table > renders with cell slot correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -329,10 +329,10 @@ exports[`Table > renders with class correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -383,7 +383,7 @@ exports[`Table > renders with columns correctly 1`] = `
- |
+ |
|
- # |
- Date |
- Status |
- |
@@ -574,10 +574,10 @@ exports[`Table > renders with data correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -645,7 +645,7 @@ exports[`Table > renders with empty slot correctly 1`] = `
- |
+ |
@@ -654,16 +654,16 @@ exports[`Table > renders with empty slot correctly 1`] = `
|
- # |
- Date |
- Status |
- Email
+ | # |
+ Date |
+ Status |
+ Email
|
-
+ |
Amount
|
-
+ |
|
|
@@ -684,10 +684,10 @@ exports[`Table > renders with expanded slot correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -738,10 +738,10 @@ exports[`Table > renders with header slot correctly 1`] = `
- | ID Header slot |
- Amount |
- Status |
- Email |
+ ID Header slot |
+ Amount |
+ Status |
+ Email |
@@ -792,10 +792,10 @@ exports[`Table > renders with loading animation carousel correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -846,10 +846,10 @@ exports[`Table > renders with loading animation carousel-inverse correctly 1`] =
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -900,10 +900,10 @@ exports[`Table > renders with loading animation elastic correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -954,10 +954,10 @@ exports[`Table > renders with loading animation swing correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1008,10 +1008,10 @@ exports[`Table > renders with loading color error correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1062,10 +1062,10 @@ exports[`Table > renders with loading color info correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1116,10 +1116,10 @@ exports[`Table > renders with loading color neutral correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1170,10 +1170,10 @@ exports[`Table > renders with loading color primary correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1224,10 +1224,10 @@ exports[`Table > renders with loading color secondary correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1278,10 +1278,10 @@ exports[`Table > renders with loading color success correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1332,10 +1332,10 @@ exports[`Table > renders with loading color warning correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1386,10 +1386,10 @@ exports[`Table > renders with loading correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1440,7 +1440,7 @@ exports[`Table > renders with loading slot correctly 1`] = `
- |
+ |
@@ -1449,16 +1449,16 @@ exports[`Table > renders with loading slot correctly 1`] = `
|
- # |
- Date |
- Status |
- Email
+ | # |
+ Date |
+ Status |
+ Email
|
-
+ |
Amount
|
-
+ |
|
|
@@ -1479,10 +1479,10 @@ exports[`Table > renders with sticky correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1533,10 +1533,10 @@ exports[`Table > renders with ui correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
diff --git a/test/components/__snapshots__/Table.spec.ts.snap b/test/components/__snapshots__/Table.spec.ts.snap
index 0238ed89..5df99bd2 100644
--- a/test/components/__snapshots__/Table.spec.ts.snap
+++ b/test/components/__snapshots__/Table.spec.ts.snap
@@ -6,10 +6,10 @@ exports[`Table > renders with as correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -60,10 +60,10 @@ exports[`Table > renders with body-bottom slot correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -114,10 +114,10 @@ exports[`Table > renders with body-top slot correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -167,10 +167,10 @@ exports[`Table > renders with caption correctly 1`] = `
Table caption
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -221,10 +221,10 @@ exports[`Table > renders with caption slot correctly 1`] = `
Caption slot
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -275,10 +275,10 @@ exports[`Table > renders with cell slot correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -329,10 +329,10 @@ exports[`Table > renders with class correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -383,7 +383,7 @@ exports[`Table > renders with columns correctly 1`] = `
- |
+ |
@@ -392,16 +392,16 @@ exports[`Table > renders with columns correctly 1`] = `
|
- # |
- Date |
- Status |
- Email
+ | # |
+ Date |
+ Status |
+ Email
|
-
+ |
Amount
|
-
+ |
|
|
@@ -574,10 +574,10 @@ exports[`Table > renders with data correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -645,7 +645,7 @@ exports[`Table > renders with empty slot correctly 1`] = `
- |
+ |
@@ -654,16 +654,16 @@ exports[`Table > renders with empty slot correctly 1`] = `
|
- # |
- Date |
- Status |
- Email
+ | # |
+ Date |
+ Status |
+ Email
|
-
+ |
Amount
|
-
+ |
|
|
@@ -684,10 +684,10 @@ exports[`Table > renders with expanded slot correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -738,10 +738,10 @@ exports[`Table > renders with header slot correctly 1`] = `
- | ID Header slot |
- Amount |
- Status |
- Email |
+ ID Header slot |
+ Amount |
+ Status |
+ Email |
@@ -792,10 +792,10 @@ exports[`Table > renders with loading animation carousel correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -846,10 +846,10 @@ exports[`Table > renders with loading animation carousel-inverse correctly 1`] =
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -900,10 +900,10 @@ exports[`Table > renders with loading animation elastic correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -954,10 +954,10 @@ exports[`Table > renders with loading animation swing correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1008,10 +1008,10 @@ exports[`Table > renders with loading color error correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1062,10 +1062,10 @@ exports[`Table > renders with loading color info correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1116,10 +1116,10 @@ exports[`Table > renders with loading color neutral correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1170,10 +1170,10 @@ exports[`Table > renders with loading color primary correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1224,10 +1224,10 @@ exports[`Table > renders with loading color secondary correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1278,10 +1278,10 @@ exports[`Table > renders with loading color success correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1332,10 +1332,10 @@ exports[`Table > renders with loading color warning correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1386,10 +1386,10 @@ exports[`Table > renders with loading correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1440,7 +1440,7 @@ exports[`Table > renders with loading slot correctly 1`] = `
- |
+ |
@@ -1449,16 +1449,16 @@ exports[`Table > renders with loading slot correctly 1`] = `
|
- # |
- Date |
- Status |
- Email
+ | # |
+ Date |
+ Status |
+ Email
|
-
+ |
Amount
|
-
+ |
|
|
@@ -1479,10 +1479,10 @@ exports[`Table > renders with sticky correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |
@@ -1533,10 +1533,10 @@ exports[`Table > renders with ui correctly 1`] = `
- | Id |
- Amount |
- Status |
- Email |
+ Id |
+ Amount |
+ Status |
+ Email |