-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add the Tablepagination and structured data #1225
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
base: tanstack-table-poc
Are you sure you want to change the base?
feat: add the Tablepagination and structured data #1225
Conversation
Integrated TanStack Table's internal pagination model (getPaginationRowModel) for more robust state management. Created a standalone, reusable DataTablePagination component located within the DataTable module. Refactored the Structured View implementation: Merged TableStructuredCell logic into TableCell for a cleaner architecture. Moved the expand/collapse click handler to the root cell element to improve hit area. Added W3C ARIA accessibility attributes (aria-expanded, aria-level, role="row"). Enhanced component robustness by adding safe initializers for pageSize and handling empty data edge cases (e.g., "0-0" range display). Updated Storybook stories with comprehensive examples, including combined support for pagination, sorting, and structured views. Resolved linting issues and standardized flex layouts for better cross-browser consistency.
| export const DataTablePagination: React.FC<DataTablePaginationProps> = ({ | ||
| className, | ||
| label = { | ||
| rowsPerPage: 'Rows per page', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest displaying items instead of Rows per page to prevent to use row
- Move DataTablePagination to src/components/Pagination as standalone component - Rename row-based props to item-based (rowsPerPage → itemsPerPage, etc.) - Replace margin utility classes with CSS gap for layout - Remove deprecated Dropdown label prop - Change data-sel-role attributes to data-testid - Use type imports for TypeScript types - Update DataTable to consume new Pagination component - Export Pagination from main components index
| } | ||
|
|
||
| .moonstone-pagination_navigation { | ||
| display: flex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use helper classes flexRow, alignCenter to avoid to add them for each elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you added the helper classes, you can now clean up this CSS to remove unnecessary styles :)
| } | ||
|
|
||
| .moonstone-pagination_navigation { | ||
| display: flex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you added the helper classes, you can now clean up this CSS to remove unnecessary styles :)
No description provided.