-
Notifications
You must be signed in to change notification settings - Fork 113
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
[sparkle] - feature: enhance DataTable with interactive row elements #6617
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add functionality to DataTable rows for additional interactivity, enabling click events on the entire row - Introduce a 'showMore' option with its corresponding 'onMoreClick' callback to handle secondary actions within rows
- Update @dust-tt/sparkle package version for release
flvndvd
approved these changes
Aug 1, 2024
sparkle/src/components/DataTable.tsx
Outdated
@@ -58,7 +58,7 @@ export function DataTable<TData, TValue>({ | |||
<DataTable.Root className={className}> | |||
<DataTable.Header> | |||
{table.getHeaderGroups().map((headerGroup) => ( | |||
<DataTable.Row key={headerGroup.id}> | |||
<DataTable.Row key={headerGroup.id} > |
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.
Suggested change
<DataTable.Row key={headerGroup.id} > | |
<DataTable.Row key={headerGroup.id}> |
sparkle/src/components/DataTable.tsx
Outdated
Comment on lines
102
to
103
showMore={row.original.showMore} | ||
onMoreClick={row.original.onMoreClick} |
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.
Can we infer the showMore from onMoreClick
existence?
- Removed `clickable` and `showMore` boolean flags to simplify Row component's API and usage - Adjusted conditional class and event handling logic to depend on the presence of event handlers directly, enhancing readability and maintainability of the code
…ponent - Removed unnecessary `clickable` and `showMore` props from DataTable.Row to simplify the component interface - Retained `onClick` and `onMoreClick` handlers for row interactions
- Change the margin and width of the sorting icons for better alignment within table headers
albandum
pushed a commit
that referenced
this pull request
Aug 28, 2024
…6617) * [sparkle] - feature: enhance DataTable with interactive row elements - Add functionality to DataTable rows for additional interactivity, enabling click events on the entire row - Introduce a 'showMore' option with its corresponding 'onMoreClick' callback to handle secondary actions within rows * [sparkle] - feature: bump package version to 0.2.198 - Update @dust-tt/sparkle package version for release * [sparkle] - refactor: streamline DataTable Row props and behavior - Removed `clickable` and `showMore` boolean flags to simplify Row component's API and usage - Adjusted conditional class and event handling logic to depend on the presence of event handlers directly, enhancing readability and maintainability of the code * [sparkle] - refactor: streamline DataTable.Row props in DataTable component - Removed unnecessary `clickable` and `showMore` props from DataTable.Row to simplify the component interface - Retained `onClick` and `onMoreClick` handlers for row interactions * [sparkle] - fix: adjust sorting icon position in DataTable - Change the margin and width of the sorting icons for better alignment within table headers --------- Co-authored-by: Jules <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR aims at enhancing the
DataTable
component in sparkle. Main changes include:Risk
None
Deploy Plan
sparkle