Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0bd37e0
chore: Add test page and interface change for table
NathanZlion Apr 30, 2026
0b30f49
feat: Implement Table column groups
NathanZlion May 4, 2026
385a255
feat: Add test util
NathanZlion May 4, 2026
5ff0774
chore: Update snapshots
NathanZlion May 4, 2026
c24e942
chore: Add more tests
NathanZlion May 5, 2026
5ba92b7
fix: Removed unused styles, Fix tracker stop moving at min width
NathanZlion May 5, 2026
9722987
fix: Test page bug and group resize tracker
NathanZlion May 5, 2026
976bf30
fix: Remove unused props
NathanZlion May 5, 2026
77e9a2d
chore: Cleanup
NathanZlion May 5, 2026
ee021ad
chore: Add tests for test coverage
NathanZlion May 5, 2026
c8eee6e
chore: Add tests for test coverage
NathanZlion May 5, 2026
358ec15
chore: Add more tests
NathanZlion May 5, 2026
b95966a
chore: Ignore uncoverable guard lines
NathanZlion May 5, 2026
9ddc4b8
fix: Dry run failures
NathanZlion May 5, 2026
9eb6f0d
fix: Dry run failures
NathanZlion May 5, 2026
5b78379
chore: Fix Dry run failures
NathanZlion May 5, 2026
e00f463
chore: Dry run failures pass
NathanZlion May 6, 2026
989d5cf
Revert "chore: Dry run failures pass"
NathanZlion May 6, 2026
5a5274c
Reapply "chore: Dry run failures pass"
NathanZlion May 6, 2026
42d5ed0
fix: Visual paddings and border color inconsistencies
NathanZlion May 8, 2026
8e9129e
fix: Clean up
NathanZlion May 8, 2026
9324288
fix: Sticky column syncColumnHeaderWidths height use full thead
NathanZlion May 10, 2026
b44aae7
chore: Update snapshot
NathanZlion May 10, 2026
eb97448
fix: Column Width sync to hidden issue
NathanZlion May 10, 2026
f8dabd7
fix: Add istanbul ignore
NathanZlion May 11, 2026
bac1e11
chore: Update snapshots
NathanZlion May 11, 2026
13e9d0e
fix: Failing tests unconditional width update
NathanZlion May 11, 2026
4b20775
fix: Remove div for dir wrapper and move configuration to settings slot
NathanZlion May 13, 2026
8a3d36a
fix: Clean Groups test
NathanZlion May 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
443 changes: 443 additions & 0 deletions pages/table/column-groups.page.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -27166,7 +27166,18 @@ To target individual cells use \`columnDefinitions.verticalAlign\`, that takes p

If not set, all columns are displayed and the order is dictated by the \`columnDefinitions\` property.

Use it in conjunction with the content display preference of the [collection preferences](/components/collection-preferences/) component.",
Use it in conjunction with the content display preference of the [collection preferences](/components/collection-preferences/) component.

Each entry is one of the following:
- \`ColumnDisplay\` - Represents a single column.
- \`type\` ('column') - (Optional) Identifies the entry as a column. Defaults to \`'column'\` when omitted.
- \`id\` (string) - The column identifier. Must match a column \`id\` from \`columnDefinitions\`.
- \`visible\` (boolean) - Whether the column is visible.
- \`GroupDisplay\` - Represents a column group.
- \`type\` ('group') - Identifies the entry as a group.
- \`id\` (string) - The group identifier. Must match a group \`id\` from \`groupDefinitions\`.
- \`visible\` (boolean) - Whether the group is visible.
- \`children\` (ReadonlyArray<ColumnDisplayProperties>) - The columns or nested groups within this group.",
"name": "columnDisplay",
"optional": true,
"type": "ReadonlyArray<TableProps.ColumnDisplayProperties>",
Expand Down Expand Up @@ -27388,6 +27399,20 @@ table with \`item=null\` and then for each expanded item. The function result is
"optional": true,
"type": "TableProps.GetLoadingStatus<T>",
},
{
"description": "Defines the column groups. Each group has an \`id\` and \`header\` used to label the group header cell.

When using grouped columns, you must also provide the \`columnDisplay\` property with \`{ type: 'group', id, children }\` entries
to assign columns to their respective groups and define the display hierarchy.

Each group definition contains the following:
- \`id\` (string) - A unique identifier for the group.
- \`header\` (ReactNode) - The content displayed in the group header cell.
- \`ariaLabel\` ((LabelData) => string) - (Optional) A function that provides an \`aria-label\` for the group header.",
"name": "groupDefinitions",
"optional": true,
"type": "ReadonlyArray<TableProps.GroupDefinition<T>>",
},
{
"deprecatedTag": "The usage of the \`id\` attribute is reserved for internal use cases. For testing and other use cases,
use [data attributes](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes). If you must
Expand Down Expand Up @@ -42421,8 +42446,22 @@ Returns the current value of the input.",
},
},
{
"description": "Returns column header cells from the table's header region.

By default, returns all leaf-column headers (\`scope="col"\`).
For tables without column grouping this is equivalent to the previous behavior.
For tables with column grouping this excludes group header cells.",
"name": "findColumnHeaders",
"parameters": [],
"parameters": [
{
"defaultValue": "{}",
"flags": {
"isOptional": false,
},
"name": "option",
"typeName": "{ groupId?: string | undefined; }",
},
],
"returnType": {
"isNullable": false,
"name": "Array",
Expand Down Expand Up @@ -42457,9 +42496,11 @@ Returns the current value of the input.",
},
},
{
"description": "Returns the clickable sorting area of a column header.",
"name": "findColumnSortingArea",
"parameters": [
{
"description": "1-based index of the column.",
"flags": {
"isOptional": false,
},
Expand Down Expand Up @@ -51721,8 +51762,22 @@ In this case, use findContentEditableElement() instead.",
},
},
{
"description": "Returns column header cells from the table's header region.

By default, returns all leaf-column headers (\`scope="col"\`).
For tables without column grouping this is equivalent to the previous behavior.
For tables with column grouping this excludes group header cells.",
"name": "findColumnHeaders",
"parameters": [],
"parameters": [
{
"defaultValue": "{}",
"flags": {
"isOptional": false,
},
"name": "option",
"typeName": "{ groupId?: string | undefined; }",
},
],
"returnType": {
"isNullable": false,
"name": "MultiElementWrapper",
Expand Down Expand Up @@ -51752,9 +51807,11 @@ In this case, use findContentEditableElement() instead.",
},
},
{
"description": "Returns the clickable sorting area of a column header.",
"name": "findColumnSortingArea",
"parameters": [
{
"description": "1-based index of the column.",
"flags": {
"isOptional": false,
},
Expand Down
38 changes: 38 additions & 0 deletions src/table/__integ__/resizable-columns-grouped.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { BasePageObject } from '@cloudscape-design/browser-test-tools/page-objects';
import useBrowser from '@cloudscape-design/browser-test-tools/use-browser';

import createWrapper from '../../../lib/components/test-utils/selectors';

const tableWrapper = createWrapper().findTable();
const defaultScreen = { width: 1680, height: 800 };

const setupTest = (testFn: (page: BasePageObject) => Promise<void>) => {
return useBrowser(async browser => {
const page = new BasePageObject(browser);
await browser.url('#/light/table/column-groups');
await page.setWindowSize(defaultScreen);
await testFn(page);
});
};

describe('Table - Grouped column resizing', () => {
test(
'group resizer changes group width on drag',
setupTest(async page => {
const groupResizerSelector = `${tableWrapper.toSelector()} thead th[scope="colgroup"] button`;
await expect(page.isExisting(groupResizerSelector)).resolves.toBe(true);
await page.dragAndDrop(groupResizerSelector, 50);
})
);

test(
'leaf column resizer works within grouped table',
setupTest(async page => {
const resizerSelector = tableWrapper.findColumnResizer(3).toSelector();
await expect(page.isExisting(resizerSelector)).resolves.toBe(true);
await page.dragAndDrop(resizerSelector, 30);
})
);
});
Loading
Loading