Skip to content
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] New column management panel design #11770

Merged

Conversation

MBilalShafi
Copy link
Member

@MBilalShafi MBilalShafi commented Jan 21, 2024

Closes #8754

TODOs:

  • Fix failing tests
  • Fix broken demos
  • Update migration guide and (or) documentation
  • Add new tests
  • Localize no columns UI

Changelog

Extract columns management component

The columns management component (previously part of Columns Panel) has now been extracted as a separate component and slot with its dedicated slotProps. The motivation behind the change is to allow it to be reused in the newly proposed pivoting design (on the right side of the grid, in its dedicated space)

Design changes

The design of the columns management component now uses the new checkboxes-based design rather than the previous toggle button-based design.

image

Component API

The component API is almost the same as that of Columns Panel, with a few exceptions like:

  • Introduction of a new Reset button and its functionality, a new prop disableResetButton has been introduced.
  • Show all and Hide all are combined into one Show/Hide All checkbox, related props are also updated.

Breaking changes

  • The columns management component has been redesigned and the component is extracted from the ColumnsPanel which now only serves as a wrapper to display the component over the headers as a panel. As a result, a new slot columnsManagement, and corresponding prop slotProps.columnsManagement have been introduced. The props corresponding to the columns management component which were previously passed to the prop slotProps.columnsPanel should now be passed to slotProps.columnsManagement. slotProps.columnsPanel could still be used to override props corresponding to the Panel component used in ColumnsPanel which uses Popper component under the hood.

    <DataGrid
      slotProps={{
    -   columnsPanel: {
    +   columnsManagement: {
          sort: 'asc',
          autoFocusSearchField: false,
        },
      }}
  • Show all and Hide all buttons in the ColumnsPanel have been combined into one Show/Hide All checkbox in the new columns management component. The related props disableShowAllButton and disableHideAllButton have been replaced with a new prop disableShowHideToggle.

@MBilalShafi MBilalShafi added breaking change component: data grid This is the name of the generic UI component, not the React module! v7.x feature: Column visibility design This is about UI or UX design, please involve a designer labels Jan 21, 2024
@MBilalShafi MBilalShafi self-assigned this Jan 21, 2024
@mui-bot
Copy link

mui-bot commented Jan 21, 2024

Localization writing tips ✍️

Seems you are updating localization 🌍 files.

Thank you for contributing to the localization! 🎉 To make your PR perfect, here is a list of elements to check: ✔️

  • Verify if the PR title respects the release format. Here are two examples (depending if you update or add a locale file)

    [l10n] Improve Swedish (sv-SE) locale
    [l10n] Add Danish (da-DK) locale

  • Update the documentation of supported locales by running yarn l10n
  • Clean files with yarn prettier.

Deploy preview: https://deploy-preview-11770--material-ui-x.netlify.app/

Updated pages:

Generated by 🚫 dangerJS against becff43

@MBilalShafi MBilalShafi marked this pull request as ready for review January 23, 2024 20:14
@MBilalShafi MBilalShafi merged commit 25e8be7 into mui:next Jan 25, 2024
17 checks passed
@MBilalShafi MBilalShafi deleted the breaking-changes/columns-management-panel branch January 25, 2024 10:40
@joserodolfofreitas
Copy link
Member

Great work, Bilal!

thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: data grid This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer feature: Column visibility v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGrid] New columns panel with support for column visibility
4 participants