From 6f89780d1028995a571a31272fb5b68c820edcdc Mon Sep 17 00:00:00 2001 From: Armin Mehinovic Date: Mon, 2 Dec 2024 10:47:12 +0100 Subject: [PATCH] Remove flag. Add codemod --- .../row-grouping/RowGroupingAriaV8.js | 32 ------------- .../row-grouping/RowGroupingAriaV8.tsx | 32 ------------- .../RowGroupingAriaV8.tsx.preview | 6 --- .../row-grouping/RowGroupingFullExample.js | 1 - .../row-grouping/RowGroupingFullExample.tsx | 1 - .../RowGroupingFullExample.tsx.preview | 1 - .../data-grid/row-grouping/row-grouping.md | 16 ------- .../migration-data-grid-v7.md | 16 +++---- .../x/api/data-grid/data-grid-premium.json | 5 +- packages/x-codemod/README.md | 30 ++++++++++++ .../actual.spec.js | 23 +++++++++ .../expected.spec.js | 18 +++++++ .../index.ts | 22 +++++++++ ...ve-stabilized-experimentalFeatures.test.ts | 48 +++++++++++++++++++ .../ts-actual.spec.tsx | 25 ++++++++++ .../ts-expected.spec.tsx | 20 ++++++++ .../src/DataGridPremium/DataGridPremium.tsx | 1 - .../src/hooks/utils/useGridAriaAttributes.tsx | 7 +-- .../src/models/dataGridPremiumProps.ts | 9 +--- 19 files changed, 197 insertions(+), 116 deletions(-) delete mode 100644 docs/data/data-grid/row-grouping/RowGroupingAriaV8.js delete mode 100644 docs/data/data-grid/row-grouping/RowGroupingAriaV8.tsx delete mode 100644 docs/data/data-grid/row-grouping/RowGroupingAriaV8.tsx.preview create mode 100644 packages/x-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/actual.spec.js create mode 100644 packages/x-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/expected.spec.js create mode 100644 packages/x-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/index.ts create mode 100644 packages/x-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/remove-stabilized-experimentalFeatures.test.ts create mode 100644 packages/x-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/ts-actual.spec.tsx create mode 100644 packages/x-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/ts-expected.spec.tsx diff --git a/docs/data/data-grid/row-grouping/RowGroupingAriaV8.js b/docs/data/data-grid/row-grouping/RowGroupingAriaV8.js deleted file mode 100644 index 6689443db0822..0000000000000 --- a/docs/data/data-grid/row-grouping/RowGroupingAriaV8.js +++ /dev/null @@ -1,32 +0,0 @@ -import * as React from 'react'; -import { - DataGridPremium, - useGridApiRef, - useKeepGroupedColumnsHidden, -} from '@mui/x-data-grid-premium'; -import { useMovieData } from '@mui/x-data-grid-generator'; - -export default function RowGroupingAriaV8() { - const data = useMovieData(); - const apiRef = useGridApiRef(); - - const initialState = useKeepGroupedColumnsHidden({ - apiRef, - initialState: { - rowGrouping: { - model: ['company'], - }, - }, - }); - - return ( -
- -
- ); -} diff --git a/docs/data/data-grid/row-grouping/RowGroupingAriaV8.tsx b/docs/data/data-grid/row-grouping/RowGroupingAriaV8.tsx deleted file mode 100644 index 6689443db0822..0000000000000 --- a/docs/data/data-grid/row-grouping/RowGroupingAriaV8.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import * as React from 'react'; -import { - DataGridPremium, - useGridApiRef, - useKeepGroupedColumnsHidden, -} from '@mui/x-data-grid-premium'; -import { useMovieData } from '@mui/x-data-grid-generator'; - -export default function RowGroupingAriaV8() { - const data = useMovieData(); - const apiRef = useGridApiRef(); - - const initialState = useKeepGroupedColumnsHidden({ - apiRef, - initialState: { - rowGrouping: { - model: ['company'], - }, - }, - }); - - return ( -
- -
- ); -} diff --git a/docs/data/data-grid/row-grouping/RowGroupingAriaV8.tsx.preview b/docs/data/data-grid/row-grouping/RowGroupingAriaV8.tsx.preview deleted file mode 100644 index 303e3b3ef2367..0000000000000 --- a/docs/data/data-grid/row-grouping/RowGroupingAriaV8.tsx.preview +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/docs/data/data-grid/row-grouping/RowGroupingFullExample.js b/docs/data/data-grid/row-grouping/RowGroupingFullExample.js index 52040b1639af1..4deda985cbd8b 100644 --- a/docs/data/data-grid/row-grouping/RowGroupingFullExample.js +++ b/docs/data/data-grid/row-grouping/RowGroupingFullExample.js @@ -40,7 +40,6 @@ export default function RowGroupingFullExample() { groupingColDef={{ leafField: 'traderEmail', }} - experimentalFeatures={{ ariaV8: true }} /> ); diff --git a/docs/data/data-grid/row-grouping/RowGroupingFullExample.tsx b/docs/data/data-grid/row-grouping/RowGroupingFullExample.tsx index 52040b1639af1..4deda985cbd8b 100644 --- a/docs/data/data-grid/row-grouping/RowGroupingFullExample.tsx +++ b/docs/data/data-grid/row-grouping/RowGroupingFullExample.tsx @@ -40,7 +40,6 @@ export default function RowGroupingFullExample() { groupingColDef={{ leafField: 'traderEmail', }} - experimentalFeatures={{ ariaV8: true }} /> ); diff --git a/docs/data/data-grid/row-grouping/RowGroupingFullExample.tsx.preview b/docs/data/data-grid/row-grouping/RowGroupingFullExample.tsx.preview index 35a7dd3ccbcd0..b20dbc70dc3ad 100644 --- a/docs/data/data-grid/row-grouping/RowGroupingFullExample.tsx.preview +++ b/docs/data/data-grid/row-grouping/RowGroupingFullExample.tsx.preview @@ -7,5 +7,4 @@ groupingColDef={{ leafField: 'traderEmail', }} - experimentalFeatures={{ ariaV8: true }} /> \ No newline at end of file diff --git a/docs/data/data-grid/row-grouping/row-grouping.md b/docs/data/data-grid/row-grouping/row-grouping.md index cb24c6d9b785f..846c08b234395 100644 --- a/docs/data/data-grid/row-grouping/row-grouping.md +++ b/docs/data/data-grid/row-grouping/row-grouping.md @@ -396,22 +396,6 @@ Don't hesitate to leave a comment on the same issue to influence what gets built With this panel, your users will be able to control which columns are used for grouping just by dragging them inside the panel. -## Accessibility changes in v8 - -The Data Grid v8 with row grouping feature will improve the accessibility and will be more aligned with the WAI-ARIA authoring practices. - -You can start using the new accessibility features by enabling `ariaV8` experimental feature flag: - -```tsx - -``` - -:::warning -The value of `ariaV8` should be constant and not change during the lifetime of the Data Grid. -::: - -{{"demo": "RowGroupingAriaV8.js", "bg": "inline", "defaultCodeOpen": false}} - ## Full example {{"demo": "RowGroupingFullExample.js", "bg": "inline", "defaultCodeOpen": false}} diff --git a/docs/data/migration/migration-data-grid-v7/migration-data-grid-v7.md b/docs/data/migration/migration-data-grid-v7/migration-data-grid-v7.md index aa9969d472db8..5827d8c96f20b 100644 --- a/docs/data/migration/migration-data-grid-v7/migration-data-grid-v7.md +++ b/docs/data/migration/migration-data-grid-v7/migration-data-grid-v7.md @@ -39,25 +39,25 @@ Below are described the steps you need to make to migrate from v7 to v8. To revert to the previous behavior, pass `rowSelectionPropagation={{ parents: false, descendants: false }}`. - The prop `indeterminateCheckboxAction` has been removed. Clicking on an indeterminate checkbox "selects" the unselected descendants. -### Localization - -- If `estimatedRowCount` is used, the text provided to the [Table Pagination](/material-ui/api/table-pagination/) component from the Material UI library is updated and requires additional translations. Check the example at the end of [Index-based pagination section](/x/react-data-grid/pagination/#index-based-pagination). - ### Changes to the public API - The `apiRef.current.resize()` method was removed. - The `` component is not exported anymore. -