Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
1506e70
chore: Add test page and interface change for table
NathanZlion Apr 30, 2026
8e87c40
feat: Implement Table column groups
NathanZlion May 4, 2026
6a9814b
feat: Add test util
NathanZlion May 4, 2026
ba99a9d
chore: Update snapshots
NathanZlion May 4, 2026
4ff22a9
chore: Add more tests
NathanZlion May 5, 2026
f3a60b6
fix: Removed unused styles, Fix tracker stop moving at min width
NathanZlion May 5, 2026
ba6b142
fix: Test page bug and group resize tracker
NathanZlion May 5, 2026
e089bad
fix: Remove unused props
NathanZlion May 5, 2026
554dfc0
chore: Cleanup
NathanZlion May 5, 2026
791a980
chore: Add tests for test coverage
NathanZlion May 5, 2026
d2fdb0a
chore: Add tests for test coverage
NathanZlion May 5, 2026
96b1fc8
chore: Add more tests
NathanZlion May 5, 2026
dcc1245
chore: Ignore uncoverable guard lines
NathanZlion May 5, 2026
2ed6144
fix: Dry run failures
NathanZlion May 5, 2026
cb59ac4
fix: Dry run failures
NathanZlion May 5, 2026
aa4ac79
chore: Fix Dry run failures
NathanZlion May 5, 2026
a977f23
chore: Dry run failures pass
NathanZlion May 6, 2026
5308478
Revert "chore: Dry run failures pass"
NathanZlion May 6, 2026
b9ef14f
Reapply "chore: Dry run failures pass"
NathanZlion May 6, 2026
c46fc26
fix: Visual paddings and border color inconsistencies
NathanZlion May 8, 2026
c1c4a38
fix: Clean up
NathanZlion May 8, 2026
ffe9040
fix: Sticky column syncColumnHeaderWidths height use full thead
NathanZlion May 10, 2026
02b9d70
chore: Update snapshot
NathanZlion May 10, 2026
fd9a635
fix: Column Width sync to hidden issue
NathanZlion May 10, 2026
82a1e73
fix: Add istanbul ignore
NathanZlion May 11, 2026
5fc3420
chore: Update snapshots
NathanZlion May 11, 2026
b144325
fix: Failing tests unconditional width update
NathanZlion May 11, 2026
3655736
fix: Remove div for dir wrapper and move configuration to settings slot
NathanZlion May 13, 2026
25d3f7c
fix: Clean Groups test
NathanZlion May 13, 2026
266d8dc
fix: Better naming add Metadata for analytics
NathanZlion May 15, 2026
fcdaa09
fix: Move grouopLeafMap into the useColumnGroups hook
NathanZlion May 15, 2026
7fbf736
fix: Add explanatory comments in utils.ts, remove istanbul ignore for…
NathanZlion May 15, 2026
e1170d1
fix: Typing issue
NathanZlion May 15, 2026
da0c0f7
chore: Refactor to extract common props for header cells, Remove dead…
NathanZlion May 15, 2026
9d93a67
chore: Pass isLast prop to Resizer, remove parent selector and stylel…
NathanZlion May 15, 2026
0f9f7d1
fix: Remove unused classOnly prop from UseStickyCellStylesProps
NathanZlion May 15, 2026
627d7d3
chore: Extract findNextCell utility, simplify grid-navigation colspan…
NathanZlion May 15, 2026
5cc0a20
fix: Call utils onluy when table is not null
NathanZlion May 18, 2026
25371f2
chore: Unify TableColGroup for the primary header and the sticky head…
NathanZlion May 18, 2026
b54c930
chore: Remove Istanbul ignore
NathanZlion May 18, 2026
754c38d
fix: Add grouped flag to findColumnResizer/findColumnSortingArea for …
NathanZlion May 19, 2026
b93c546
chore: Update snapshots
NathanZlion May 19, 2026
561df26
fix: Skip imperative width updates before columnWidths initialization
NathanZlion May 19, 2026
518fe7d
chore: Make optionals required in props for test coverage
NathanZlion May 19, 2026
5f5b334
Revert "fix: Skip imperative width updates before columnWidths initia…
NathanZlion May 19, 2026
0178aae
chore: Remove unnecessary check
NathanZlion May 19, 2026
b14792d
chore: Avoid string| number typing by just casting to string
NathanZlion May 21, 2026
bb91149
chore: Rename leaf to Column to make it clear
NathanZlion May 21, 2026
2dc6d09
chore: Fix string cast
NathanZlion May 21, 2026
8882faf
chore: Add unit tests for column group resize width distribution
NathanZlion May 21, 2026
0b334b4
chore: Add unit tests for grid-nav utility functions
NathanZlion Jun 1, 2026
c346d68
chore: Add more tests for thead tetst cov
NathanZlion Jun 1, 2026
2391ad4
test: Add unit tests for use-column-widths context defaults and updat…
NathanZlion Jun 1, 2026
dd5064d
fix: Revert selection control vertical alignment changes
NathanZlion Jun 1, 2026
f610d45
chore: Use more items per page instead of emptyh space for sticky hea…
NathanZlion Jun 4, 2026
936200f
fix: mock WarnOnce for testing
NathanZlion Jun 4, 2026
b13b32c
chore: Avoid remaking the visibleColumn Ids,
NathanZlion Jun 4, 2026
d0481d8
chore: Avoid the terminology leaf, use only Column and Group
NathanZlion Jun 4, 2026
e00cab5
chore: Organize common repetitive peops into shared var
NathanZlion Jun 4, 2026
5231540
chore: Remove misleading comments
NathanZlion Jun 4, 2026
5ec35b4
chore: Move test to file it belongs in
NathanZlion Jun 4, 2026
0ae35f1
fix: Test utility remove 'grouped' optional tags
NathanZlion Jun 5, 2026
639a438
refactor: extract TableColGroup into column-groups/col-group.tsx
NathanZlion Jun 5, 2026
3fa138d
chore: Remove useMemo since it won't work due to changeing visibleCol…
NathanZlion Jun 5, 2026
2e234c7
chore: Update snapsots
NathanZlion Jun 5, 2026
7bc4124
fix: Fix failing test selector due to test util change
NathanZlion Jun 5, 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
440 changes: 440 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 @@ -27809,7 +27809,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 @@ -28031,6 +28042,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 @@ -43148,8 +43173,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 @@ -43184,9 +43223,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 @@ -52495,8 +52536,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 @@ -52526,9 +52581,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(
'column resizer works within grouped table',
setupTest(async page => {
const resizerSelector = tableWrapper.findColumnResizer(3, { grouped: true }).toSelector();
await expect(page.isExisting(resizerSelector)).resolves.toBe(true);
await page.dragAndDrop(resizerSelector, 30);
})
);
});
Loading
Loading