Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1365ded
feat: Modify interfaces
NathanZlion Feb 19, 2026
9729e22
feat: Add Test Pages
NathanZlion Feb 19, 2026
646b48d
feat: Add column grouping util functions to create tree
NathanZlion Feb 19, 2026
791d85b
chore: Update snapshots
NathanZlion Feb 21, 2026
1dcf9f5
chore: Add colSpan, rowSpan, and scope to th-element
NathanZlion Feb 23, 2026
6fe44df
fix: Add SimplePage for test page
NathanZlion Feb 23, 2026
b376653
fix: Fix Axe violation for heading one availability, and AriaLabel vi…
NathanZlion Feb 23, 2026
35f3a2c
chore: Add fields for first and last for sticky
NathanZlion Feb 25, 2026
0ffe437
feat: Add column grouping support with nested headers, colspan/rowspa…
NathanZlion Feb 25, 2026
512fc79
fix: Fix failing unit tests for row count and single row render condi…
NathanZlion Feb 26, 2026
f8c56da
fix: Address some A11Y and codecov issues
NathanZlion Feb 26, 2026
ea026fb
feat: Add empty cells to push column down
NathanZlion Feb 26, 2026
e75812c
fix: Unit tests pass
NathanZlion Feb 26, 2026
6d7d8d2
chore: Make page easy to test
NathanZlion Feb 26, 2026
5a4db7e
feat: Implement Collection Preference for hierarchical lists
NathanZlion Feb 26, 2026
f97e430
fix: Ensure collection preference works for multi-depth
NathanZlion Feb 26, 2026
43bfcbd
test
NathanZlion Mar 3, 2026
508f8b9
chore: Minor design updates
NathanZlion Mar 6, 2026
f620cc4
chore: Add playground style controls and customer pages for demo
NathanZlion Mar 6, 2026
0786d89
chore: Minor changes to focus cell
NathanZlion Mar 6, 2026
a971aa6
fix: Focus ring issue
NathanZlion Mar 9, 2026
992739c
fix: Move selectin cell down to a single row span for grouped
NathanZlion Mar 9, 2026
6d75032
chore: default resizer block gap to 9 on each sizde
NathanZlion Mar 10, 2026
74a2cd0
chore: Modify API separate definitino from display
NathanZlion Mar 12, 2026
bdfd12f
chore: Modify pages to use new API
NathanZlion Mar 12, 2026
d94eaeb
chore: Modify tests
NathanZlion Mar 12, 2026
2dae3a3
fix: Fix linting error due to in operator
NathanZlion Mar 12, 2026
e22ea36
chore: Modify APIs for backwards compatibility
NathanZlion Mar 12, 2026
14e2d80
chore: API Change concepts
NathanZlion Mar 13, 2026
cad67fb
chore: Update test util
NathanZlion Mar 13, 2026
c49edd2
chore: Update documentor
NathanZlion Mar 13, 2026
06afcb7
chore: update table tests
NathanZlion Mar 17, 2026
3f3aaee
chore: Add visible api to ContentDisplayGroup for dry run purposes
NathanZlion Mar 17, 2026
b9bbd2e
fix: Typing issue with backwards compatibility
NathanZlion Mar 18, 2026
d212b89
feat: Stretch spanning header cells to full rowspan height with botto…
NathanZlion Mar 19, 2026
66022df
chore: Update snapshot
NathanZlion Mar 19, 2026
f2deb8f
chore: fix tests
NathanZlion Mar 19, 2026
d420ae4
chore: Modify test page
NathanZlion Mar 19, 2026
5637d80
chore: Update table resizer heights depending on cell type
NathanZlion Mar 23, 2026
0798fe3
chore: Update design, sticky first columns works now
NathanZlion Mar 24, 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
101 changes: 22 additions & 79 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

110 changes: 110 additions & 0 deletions pages/collection-preferences/multi-level-reorder.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import CollectionPreferences, { CollectionPreferencesProps } from '~components/collection-preferences';

import { contentDisplayPreferenceI18nStrings } from '../common/i18n-strings';
import {
baseProperties,
contentDensityPreference,
customPreference,
pageSizePreference,
wrapLinesPreference,
} from './shared-configs';

const columnOptions: CollectionPreferencesProps.ContentDisplayOption[] = [
// ungrouped
{ id: 'name', label: 'Name', alwaysVisible: true },
{ id: 'status', label: 'Status' },

// performance
{ id: 'cpuUtilization', label: 'CPU (%)' },
{ id: 'memoryUtilization', label: 'Memory (%)' },
{ id: 'networkIn', label: 'Network In (MB/s)' },
{ id: 'networkOut', label: 'Network Out (MB/s)' },

// config
{ id: 'instanceType', label: 'Instance Type' },
{ id: 'availabilityZone', label: 'Availability Zone' },
{ id: 'region', label: 'Region' },

// cost
{ id: 'monthlyCost', label: 'Monthly Cost ($)' },
{ id: 'spotPrice', label: 'Spot Price ($/hr)' },
{
id: 'reservedCost',
label:
'Reserved Instance Cost - Long text to verify wrapping behavior and ensure the reordering feature works correctly with extended content',
},
];

const columnGroups: CollectionPreferencesProps.ContentDisplayOptionGroup[] = [
{ id: 'performance', label: 'Performance' },
{ id: 'configuration', label: 'Configuration' },
{ id: 'cost', label: 'Cost' },
];

const defaultContentDisplay: CollectionPreferencesProps.ContentDisplayItem[] = [
{ id: 'name', visible: true },
{ id: 'status', visible: true },
{
type: 'group',
id: 'performance',
visible: true,
children: [
{ id: 'cpuUtilization', visible: true },
{ id: 'memoryUtilization', visible: true },
{ id: 'networkIn', visible: true },
{ id: 'networkOut', visible: true },
],
},
{
type: 'group',
id: 'configuration',
visible: true,
children: [
{ id: 'instanceType', visible: true },
{ id: 'availabilityZone', visible: true },
{ id: 'region', visible: true },
],
},
{
type: 'group',
id: 'cost',
visible: true,
children: [
{ id: 'monthlyCost', visible: true },
{ id: 'spotPrice', visible: true },
{ id: 'reservedCost', visible: true },
],
},
];

export default function App() {
const [preferences, setPreferences] = React.useState<CollectionPreferencesProps.Preferences>({
contentDisplay: defaultContentDisplay,
});

return (
<>
<h1>Multi-level Reorder Preferences</h1>
<CollectionPreferences
{...baseProperties}
pageSizePreference={pageSizePreference}
wrapLinesPreference={wrapLinesPreference}
contentDensityPreference={contentDensityPreference}
customPreference={customPreference}
preferences={preferences}
onConfirm={({ detail }) => setPreferences(detail)}
contentDisplayPreference={{
title: 'Column preferences',
description: 'Customize the columns visibility and order.',
options: columnOptions,
groups: columnGroups,
...contentDisplayPreferenceI18nStrings,
}}
/>
</>
);
}
Loading
Loading