-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGrid] Add indexes relative to the filtered rows and the current page to the getRowClassName
and getRowSpacing
props
#3882
Conversation
…n engine to the Row component
These are the results for the performance tests:
|
packages/grid/_modules_/grid/hooks/features/virtualization/useGridVirtualScroller.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/virtualization/useGridVirtualScroller.tsx
Outdated
Show resolved
Hide resolved
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.
About naming, the xxxRows
let me expect an array, whereas it is a number.
Maybe indexes.visibleIndex
or indexes.fromVisibleRows
For the demo position, it looks good to me
@alexfauquette I went for |
[`& .${gridClasses.row}.even`]: { | ||
backgroundColor: '#EEEEEE', | ||
'&:hover, &.Mui-hovered': { | ||
backgroundColor: alpha(theme.palette.primary.main, ODD_OPACITY), |
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.
backgroundColor: alpha(theme.palette.primary.main, ODD_OPACITY), | |
backgroundColor: '#E0E0E0', |
The hover should move from light to darker gray. Here I propose the hover moves from grey-200 to grey-300 according to https://material.io/resources/color/#!/?view.left=0&view.right=0&primary.color=bcbcbc
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.
How do you make the hover and / or selected consistent with this color ?
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.
Should we? For now, we have two colors: palette.action.hover
for unselected rows (with hover), and palette.primary.main
for selected ones. The distinction between hover and not hover is done by managing opacity for the selected rows.
Here are the colors for each configuration, and the cell with a "?" is the one we are discussing.
For sure it should not be computed from palette.primary.main
which is reserved for selected rows. But how to get similar color variation on hover, I don't know
state | odd color | even color |
normal | white(undefined) | grey-200 |
hover | grey-100 | ? |
selected | main color & opacity | main color & opacity+ |
selected+hover | main color & opacity+ | main color & opacity++ |
👋 The migration PR has been merged. Please follow these steps to make sure that the contents are all updated. (Sorry for the inconvenience)
If you are struggle with the steps above, feel free to tag @siriwatknp |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
getRowClassName
callbackgetRowClassName
and getRowSpacing
props
getRowClassName
and getRowSpacing
propsgetRowClassName
and getRowSpacing
props
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.
Which problem indexRelativeToExpandedRows
is solving? I can't remember it.
Initially I did a prop so I kept the We can leave it, as it does not bring a lot of additional complexity. |
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
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.
LGTM. You can decide to keep or not indexRelativeToExpandedRows
.
I removed it |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…page to the `getRowClassName` and `getRowSpacing` props (mui#3882)
Fixes #2334
Add two params to
GridRowVisibilityParams
, which is passed toprops.getRowClassName
andprops.getRowSpacing
:indexRelativeToExpandedRows
indexRelativeToCurrentPage