Skip to content

Commit 7d068b2

Browse files
authored
[fields] Remove enableAccessibleFieldDOMStructure behavior (#21966)
1 parent 1ecfce5 commit 7d068b2

254 files changed

Lines changed: 3061 additions & 5976 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ To generate `.js` files, run `pnpm docs:typescript:formatted`.
137137

138138
Codemods are run by consumers of the MUI X libraries to migrate to newer versions of the libraries.
139139

140+
When adding a new codemod, make sure to also document it in the `packages/x-codemod/README.md` following existing examples.
141+
You also need to create or expand the `preset-safe` preset to include the new codemod, document the preset in the `README.md` and also include the newly added changes to the `preset-safe` test.
142+
140143
### Versioning
141144

142145
When creating codemods, the code should be created in the directory of the target version. E.g., a codemod to migrate from v8 to v9 should be placed inside the `v9.0.0` directory.

docs/data/date-pickers/custom-field/BrowserV7Field.js renamed to docs/data/date-pickers/custom-field/BrowserField.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ function BrowserDateField(props) {
4242
const fieldResponse = useDateField(props);
4343

4444
const {
45-
// Should be ignored
46-
enableAccessibleFieldDOMStructure,
4745
// Should be passed to the PickersSectionList component
4846
elements,
4947
sectionListRef,
@@ -118,7 +116,7 @@ function BrowserDatePicker(props) {
118116
);
119117
}
120118

121-
export default function BrowserV7Field() {
119+
export default function BrowserField() {
122120
return (
123121
<LocalizationProvider dateAdapter={AdapterDayjs}>
124122
<BrowserDatePicker

docs/data/date-pickers/custom-field/BrowserV7Field.tsx renamed to docs/data/date-pickers/custom-field/BrowserField.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,9 @@ const BrowserIconButton = styled('button', {
4343
});
4444

4545
function BrowserDateField(props: DatePickerFieldProps) {
46-
const fieldResponse = useDateField<true, typeof props>(props);
46+
const fieldResponse = useDateField<typeof props>(props);
4747

4848
const {
49-
// Should be ignored
50-
enableAccessibleFieldDOMStructure,
51-
5249
// Should be passed to the PickersSectionList component
5350
elements,
5451
sectionListRef,
@@ -128,7 +125,7 @@ function BrowserDatePicker(props: DatePickerProps) {
128125
);
129126
}
130127

131-
export default function BrowserV7Field() {
128+
export default function BrowserField() {
132129
return (
133130
<LocalizationProvider dateAdapter={AdapterDayjs}>
134131
<BrowserDatePicker

docs/data/date-pickers/custom-field/BrowserV7Field.tsx.preview renamed to docs/data/date-pickers/custom-field/BrowserField.tsx.preview

File renamed without changes.

docs/data/date-pickers/custom-field/BrowserV7MultiInputRangeField.js renamed to docs/data/date-pickers/custom-field/BrowserMultiInputRangeField.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ const BrowserFieldContent = styled('div', { name: 'BrowserField', slot: 'Content
2727

2828
function BrowserTextField(props) {
2929
const {
30-
// Should be ignored
31-
enableAccessibleFieldDOMStructure,
3230
// Should be passed to the PickersSectionList component
3331
elements,
3432
sectionListRef,
@@ -127,7 +125,7 @@ function BrowserDateRangePicker(props) {
127125
);
128126
}
129127

130-
export default function BrowserV7MultiInputRangeField() {
128+
export default function BrowserMultiInputRangeField() {
131129
return (
132130
<LocalizationProvider dateAdapter={AdapterDayjs}>
133131
<BrowserDateRangePicker />

docs/data/date-pickers/custom-field/BrowserV7MultiInputRangeField.tsx renamed to docs/data/date-pickers/custom-field/BrowserMultiInputRangeField.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,13 @@ const BrowserFieldContent = styled('div', { name: 'BrowserField', slot: 'Content
3737
);
3838

3939
interface BrowserTextFieldProps extends UseMultiInputRangeFieldTextFieldProps<
40-
true,
4140
React.HTMLAttributes<HTMLDivElement>
4241
> {
4342
triggerRef?: React.Ref<HTMLDivElement>;
4443
}
4544

4645
function BrowserTextField(props: BrowserTextFieldProps) {
4746
const {
48-
// Should be ignored
49-
enableAccessibleFieldDOMStructure,
50-
5147
// Should be passed to the PickersSectionList component
5248
elements,
5349
sectionListRef,
@@ -161,7 +157,7 @@ function BrowserDateRangePicker(props: DateRangePickerProps) {
161157
);
162158
}
163159

164-
export default function BrowserV7MultiInputRangeField() {
160+
export default function BrowserMultiInputRangeField() {
165161
return (
166162
<LocalizationProvider dateAdapter={AdapterDayjs}>
167163
<BrowserDateRangePicker />

docs/data/date-pickers/custom-field/BrowserV7MultiInputRangeField.tsx.preview renamed to docs/data/date-pickers/custom-field/BrowserMultiInputRangeField.tsx.preview

File renamed without changes.

docs/data/date-pickers/custom-field/BrowserV7SingleInputRangeField.js renamed to docs/data/date-pickers/custom-field/BrowserSingleInputRangeField.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ function BrowserSingleInputDateRangeField(props) {
4242
const fieldResponse = useSingleInputDateRangeField(props);
4343

4444
const {
45-
// Should be ignored
46-
enableAccessibleFieldDOMStructure,
4745
// Should be passed to the PickersSectionList component
4846
elements,
4947
sectionListRef,
@@ -129,7 +127,7 @@ function BrowserSingleInputDateRangePicker(props) {
129127
);
130128
}
131129

132-
export default function BrowserV7SingleInputRangeField() {
130+
export default function BrowserSingleInputRangeField() {
133131
return (
134132
<LocalizationProvider dateAdapter={AdapterDayjs}>
135133
<BrowserSingleInputDateRangePicker

docs/data/date-pickers/custom-field/BrowserV7SingleInputRangeField.tsx renamed to docs/data/date-pickers/custom-field/BrowserSingleInputRangeField.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,9 @@ interface BrowserSingleInputDateRangeFieldProps extends DateRangePickerFieldProp
4747
function BrowserSingleInputDateRangeField(
4848
props: BrowserSingleInputDateRangeFieldProps,
4949
) {
50-
const fieldResponse = useSingleInputDateRangeField<true, typeof props>(props);
50+
const fieldResponse = useSingleInputDateRangeField<typeof props>(props);
5151

5252
const {
53-
// Should be ignored
54-
enableAccessibleFieldDOMStructure,
55-
5653
// Should be passed to the PickersSectionList component
5754
elements,
5855
sectionListRef,
@@ -143,7 +140,7 @@ function BrowserSingleInputDateRangePicker(props: DateRangePickerProps) {
143140
);
144141
}
145142

146-
export default function BrowserV7SingleInputRangeField() {
143+
export default function BrowserSingleInputRangeField() {
147144
return (
148145
<LocalizationProvider dateAdapter={AdapterDayjs}>
149146
<BrowserSingleInputDateRangePicker

docs/data/date-pickers/custom-field/BrowserV7SingleInputRangeField.tsx.preview renamed to docs/data/date-pickers/custom-field/BrowserSingleInputRangeField.tsx.preview

File renamed without changes.

0 commit comments

Comments
 (0)