yarn @mui/x-date-pickers 5.0.1

latest releases: 7.22.2, 7.22.1, 7.22.0...
2 years ago

Nov 23, 2021

A big thanks to the 3 contributors who made this release possible. Here are some highlights ✨:

  • 🎁 New API to validate the editing values (#3006) @m4theushw

    You can now use the preProcessEditCellProps key in GridColDef to synchronously or asynchronously validate the values committed.

    const columns: GridColDef[] = [
      {
        field: 'firstName',
        preProcessEditCellProps: (params: GridEditCellPropsChangeParams) => {
          const hasError = params.props.value.length < 3;
          return { ...params.props, error: hasError };
        },
      },
      {
        field: 'email',
        preProcessEditCellProps: async (params: GridEditCellPropsChangeParams) => {
          const userWithEmail = await fetchUserByEmail(params.value);
          const hasError = !!userWithEmail;
          return { ...params.props, error: hasError };
        }
      }
    ];
  • ✨ New method getRootDimensions to access the size of the grid (#3007) @flaviendelangle

    It contains the size of the viewport (which is the scrollable container containing the rows and columns) considering scrollbars or not.

    const dimensions = apiRef.current.getRootDimensions();

@mui/x-data-grid@v5.0.1 / @mui/x-data-grid-pro@v5.0.1

Changes

Core

Docs

Don't miss a new x-date-pickers release

NewReleases is sending notifications on new releases.