Skip to content

Add <DataTable> component #10597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 59 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e95de26
Initial implementation
fzaninotto Mar 10, 2025
bcef07e
Add column id
fzaninotto Mar 11, 2025
665e0df
Rename to DataTable
fzaninotto Mar 11, 2025
4c967ca
Add columns selector
fzaninotto Mar 13, 2025
6823eb3
Add Columnsbutton
fzaninotto Mar 13, 2025
e28c076
Fix memory leak
fzaninotto Mar 13, 2025
ac2ae4b
Cleanup
fzaninotto Mar 13, 2025
b1a3b9e
sortBy and source are the same in DataTable.Col
fzaninotto Mar 13, 2025
6ae7ee4
Remove props injection
fzaninotto Mar 17, 2025
32642a2
use in PostList
fzaninotto Mar 17, 2025
5675bea
Fix expand all style
fzaninotto Mar 17, 2025
5ae2543
Split into smaller components
fzaninotto Mar 17, 2025
769c3fb
Split context for performance
fzaninotto Mar 17, 2025
6069b8e
Add memoization
fzaninotto Mar 17, 2025
970ae13
Introduce NumberColumn
fzaninotto Mar 17, 2025
3f75e81
Rename component to field
fzaninotto Mar 17, 2025
aa09ae0
Misc styles adjustments
fzaninotto Mar 17, 2025
e6fb257
Use in demos
fzaninotto Mar 17, 2025
244a08e
Add ability to omit columns
fzaninotto Mar 17, 2025
3ce3831
Regice expand margin
fzaninotto Mar 17, 2025
e302de8
migrate demo
fzaninotto Mar 17, 2025
d51a0cd
Fix style
fzaninotto Mar 17, 2025
bff4b8e
Do some renaming
fzaninotto Mar 17, 2025
13da449
use render context enum instead of multiple contexts
fzaninotto Mar 18, 2025
85ae049
[WIP] Add drag and drop
fzaninotto Mar 18, 2025
f5dd0ca
Working prototype
fzaninotto Mar 18, 2025
652fbef
Fix button items order
fzaninotto Mar 18, 2025
082f004
Improve story
fzaninotto Mar 18, 2025
9c6feef
Fix typechecking
fzaninotto Mar 18, 2025
a0570ec
Fix e2e tests
fzaninotto Mar 18, 2025
e7dcf33
Add more stories
fzaninotto Mar 21, 2025
5467c3c
Refactor for easier customization
fzaninotto Mar 22, 2025
e2ba624
Add story for footer
fzaninotto Mar 22, 2025
e8ac875
Add a few tests
fzaninotto Mar 23, 2025
89374e0
Fix jsdoc
fzaninotto Mar 23, 2025
d6fd6c7
Add transition to expand panel
fzaninotto Mar 28, 2025
89b4e01
Add doc (WIP)
fzaninotto Mar 28, 2025
49b591e
Add link to doc
fzaninotto Mar 28, 2025
83004e6
Add DataTable.Col cellSx
fzaninotto Mar 28, 2025
2d518f2
Remove temp file
fzaninotto Mar 28, 2025
b174dc2
Final touches for the first draft of the doc
fzaninotto Mar 28, 2025
55e8549
Migrate remaining demos, make NumberCol more potent
fzaninotto Mar 29, 2025
748e0c5
Fix spelling and grammar
fzaninotto Mar 29, 2025
bc997f6
Make column components generic
fzaninotto Apr 1, 2025
7105fc0
More type safety
fzaninotto Apr 1, 2025
2c7935d
Merge branch 'next' into datagrid-modern
fzaninotto Apr 1, 2025
239443e
Make standalone mode work without bulkActionButtons={false}
fzaninotto Apr 1, 2025
f16ca21
Fix too strong inference
fzaninotto Apr 1, 2025
5c55daf
Fix tests
fzaninotto Apr 2, 2025
372e66e
Fix warning
fzaninotto Apr 2, 2025
a521f8d
Add tests
fzaninotto Apr 2, 2025
9a71bd2
Update docs/DataTable.md
fzaninotto Apr 2, 2025
ac28f05
Review
fzaninotto Apr 3, 2025
0aa66fe
Rename and make configurable
fzaninotto Apr 3, 2025
33c8756
Introduce DataTableBase
fzaninotto Apr 3, 2025
cccc015
Move core datatable files to ra-core
fzaninotto Apr 3, 2025
827047e
Revert demo test change
fzaninotto Apr 3, 2025
c6d5f32
Add unit tests
fzaninotto Apr 3, 2025
9974182
Improve expand stories UI
djhi Apr 7, 2025
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
10 changes: 6 additions & 4 deletions cypress/e2e/list.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ describe('List Page', () => {
.should(el => expect(el).to.have.attr('aria-expanded', 'true'))
.should(el => expect(el).to.have.attr('aria-label', 'Close'));

cy.get('#13-expand').should(el =>
cy.get('#posts-13-expand').should(el =>
expect(el).to.contain(
'Curabitur eu odio ullamcorper, pretium sem at, blandit libero. Nulla sodales facilisis libero, eu gravida tellus ultrices nec. In ut gravida mi. Vivamus finibus tortor tempus egestas lacinia. Cras eu arcu nisl. Donec pretium dolor ipsum, eget feugiat urna iaculis ut.'
)
Expand All @@ -269,7 +269,7 @@ describe('List Page', () => {
.should(el => expect(el).to.have.attr('aria-expanded', 'true'))
.should(el => expect(el).to.have.attr('aria-label', 'Close'));

cy.get('#13-expand').should(el => expect(el).to.exist);
cy.get('#posts-13-expand').should(el => expect(el).to.exist);
cy.wait(500); // Ensure animations are done

cy.get('[aria-label="Expand"]')
Expand All @@ -278,7 +278,7 @@ describe('List Page', () => {
.should(el => expect(el).to.have.attr('aria-expanded', 'true'))
.should(el => expect(el).to.have.attr('aria-label', 'Close'));

cy.get('#12-expand').should(el => expect(el).to.exist);
cy.get('#posts-12-expand').should(el => expect(el).to.exist);

let all_labels = [13, 12, 11, 10, 9, 8, 7, 6, 4, 2];

Expand All @@ -294,7 +294,9 @@ describe('List Page', () => {
cy.get('[aria-label="Expand"]').eq(0).click();

all_labels.forEach(label => {
cy.get(`#${label}-expand`).should(el => expect(el).to.exist);
cy.get(`#posts-${label}-expand`).should(
el => expect(el).to.exist
);
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/ListPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export default url => ({
nextPage: "button[aria-label='Go to next page']",
previousPage: "button[aria-label='Go to previous page']",
pageNumber: n => `button[aria-label='Go to page ${n}']`,
recordRows: '.datagrid-body tr',
viewsColumn: '.datagrid-body tr td:nth-child(8)',
recordRows: '.datatable-body tr.RaDataTable-row',
viewsColumn: '.datatable-body tr td:nth-child(8)',
datagridHeaders: 'th',
sortBy: name => `th span[data-field="${name}"]`,
svg: (name, criteria = '') =>
Expand Down
Loading
Loading