@mui/codemod 6.0.0-alpha.4 → 6.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/node/deprecations/all/deprecations-all.js +2 -0
- package/node/deprecations/form-control-label-props/form-control-label-props.js +22 -0
- package/node/deprecations/form-control-label-props/index.js +13 -0
- package/node/deprecations/form-control-label-props/test-cases/actual.js +21 -0
- package/node/deprecations/form-control-label-props/test-cases/expected.js +19 -0
- package/node/deprecations/form-control-label-props/test-cases/theme.actual.js +23 -0
- package/node/deprecations/form-control-label-props/test-cases/theme.expected.js +22 -0
- package/node/deprecations/pagination-item-props/index.js +13 -0
- package/node/deprecations/pagination-item-props/pagination-item-props.js +22 -0
- package/node/deprecations/pagination-item-props/test-cases/actual.js +27 -0
- package/node/deprecations/pagination-item-props/test-cases/expected.js +21 -0
- package/node/deprecations/pagination-item-props/test-cases/theme.actual.js +28 -0
- package/node/deprecations/pagination-item-props/test-cases/theme.expected.js +26 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -858,6 +858,29 @@ npx @mui/codemod@next deprecations/chip-classes <path>
|
|
|
858
858
|
npx @mui/codemod@next deprecations/divider-props <path>
|
|
859
859
|
```
|
|
860
860
|
|
|
861
|
+
#### `form-control-label-props`
|
|
862
|
+
|
|
863
|
+
```diff
|
|
864
|
+
<FormControlLabel
|
|
865
|
+
- componentsProps={{ typography: typographyProps }}
|
|
866
|
+
+ slotProps={{ typography: typographyProps }}
|
|
867
|
+
/>
|
|
868
|
+
```
|
|
869
|
+
|
|
870
|
+
```diff
|
|
871
|
+
MuiFormControlLabel: {
|
|
872
|
+
defaultProps: {
|
|
873
|
+
- componentsProps={{ typography: typographyProps }}
|
|
874
|
+
+ slotProps={{ typography: typographyProps }}
|
|
875
|
+
},
|
|
876
|
+
},
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
```bash
|
|
880
|
+
npx @mui/codemod@next deprecations/form-control-label-props <path>
|
|
881
|
+
|
|
882
|
+
```
|
|
883
|
+
|
|
861
884
|
#### `pagination-item-classes`
|
|
862
885
|
|
|
863
886
|
JS transforms:
|
|
@@ -922,6 +945,28 @@ CSS transforms:
|
|
|
922
945
|
npx @mui/codemod@next deprecations/pagination-item-classes <path>
|
|
923
946
|
```
|
|
924
947
|
|
|
948
|
+
#### `pagination-item-props`
|
|
949
|
+
|
|
950
|
+
```diff
|
|
951
|
+
<PaginationItem
|
|
952
|
+
- components={{ first: FirstIcon, last: LastIcon, next: NextIcon, previous: PreviousIcons }}
|
|
953
|
+
+ slots={{ first: FirstIcon, last: LastIcon, next: NextIcon, previous: PreviousIcons }}
|
|
954
|
+
/>
|
|
955
|
+
```
|
|
956
|
+
|
|
957
|
+
```diff
|
|
958
|
+
MuiPaginationItem: {
|
|
959
|
+
defaultProps: {
|
|
960
|
+
- components: { first: FirstIcon, last: LastIcon, next: NextIcon, previous: PreviousIcons }
|
|
961
|
+
+ slots: { first: FirstIcon, last: LastIcon, next: NextIcon, previous: PreviousIcons }
|
|
962
|
+
},
|
|
963
|
+
},
|
|
964
|
+
```
|
|
965
|
+
|
|
966
|
+
```bash
|
|
967
|
+
npx @mui/codemod@next deprecations/pagination-item-props <path>
|
|
968
|
+
```
|
|
969
|
+
|
|
925
970
|
#### `slider-props`
|
|
926
971
|
|
|
927
972
|
```diff
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = deprecationsAll;
|
|
8
8
|
var _accordionProps = _interopRequireDefault(require("../accordion-props"));
|
|
9
|
+
var _formControlLabelProps = _interopRequireDefault(require("../form-control-label-props"));
|
|
9
10
|
var _avatarProps = _interopRequireDefault(require("../avatar-props"));
|
|
10
11
|
var _dividerProps = _interopRequireDefault(require("../divider-props"));
|
|
11
12
|
var _accordionSummaryClasses = _interopRequireDefault(require("../accordion-summary-classes"));
|
|
@@ -24,6 +25,7 @@ var _stepConnectorClasses = _interopRequireDefault(require("../step-connector-cl
|
|
|
24
25
|
*/
|
|
25
26
|
function deprecationsAll(file, api, options) {
|
|
26
27
|
file.source = (0, _accordionProps.default)(file, api, options);
|
|
28
|
+
file.source = (0, _formControlLabelProps.default)(file, api, options);
|
|
27
29
|
file.source = (0, _avatarProps.default)(file, api, options);
|
|
28
30
|
file.source = (0, _dividerProps.default)(file, api, options);
|
|
29
31
|
file.source = (0, _accordionSummaryClasses.default)(file, api, options);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = transformer;
|
|
8
|
+
var _replaceComponentsWithSlots = _interopRequireDefault(require("../utils/replaceComponentsWithSlots"));
|
|
9
|
+
/**
|
|
10
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
11
|
+
* @param {import('jscodeshift').API} api
|
|
12
|
+
*/
|
|
13
|
+
function transformer(file, api, options) {
|
|
14
|
+
const j = api.jscodeshift;
|
|
15
|
+
const root = j(file.source);
|
|
16
|
+
const printOptions = options.printOptions;
|
|
17
|
+
(0, _replaceComponentsWithSlots.default)(j, {
|
|
18
|
+
root,
|
|
19
|
+
componentName: 'FormControlLabel'
|
|
20
|
+
});
|
|
21
|
+
return root.toSource(printOptions);
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _formControlLabelProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _formControlLabelProps = _interopRequireDefault(require("./form-control-label-props"));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlLabel.default, {
|
|
7
|
+
componentsProps: {
|
|
8
|
+
typography: componentsTypographyProps
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlLabel.default, {
|
|
12
|
+
slots: {
|
|
13
|
+
typography: SlotsTypography
|
|
14
|
+
},
|
|
15
|
+
slotProps: {
|
|
16
|
+
typography: slotsTypographyProps
|
|
17
|
+
},
|
|
18
|
+
componentsProps: {
|
|
19
|
+
typography: componentsTypographyProps
|
|
20
|
+
}
|
|
21
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
5
|
+
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlLabel.default, {
|
|
8
|
+
slotProps: {
|
|
9
|
+
typography: componentsTypographyProps
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FormControlLabel.default, {
|
|
13
|
+
slots: {
|
|
14
|
+
typography: SlotsTypography
|
|
15
|
+
},
|
|
16
|
+
slotProps: {
|
|
17
|
+
typography: (0, _extends2.default)({}, componentsTypographyProps, slotsTypographyProps)
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiFormControlLabel: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
componentsProps: {
|
|
7
|
+
typography: componentsTypographyProps
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
fn({
|
|
13
|
+
MuiFormControlLabel: {
|
|
14
|
+
defaultProps: {
|
|
15
|
+
componentsProps: {
|
|
16
|
+
typography: componentsTypographyProps
|
|
17
|
+
},
|
|
18
|
+
slotProps: {
|
|
19
|
+
typography: slotsTypographyProps
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
5
|
+
fn({
|
|
6
|
+
MuiFormControlLabel: {
|
|
7
|
+
defaultProps: {
|
|
8
|
+
slotProps: {
|
|
9
|
+
typography: componentsTypographyProps
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
fn({
|
|
15
|
+
MuiFormControlLabel: {
|
|
16
|
+
defaultProps: {
|
|
17
|
+
slotProps: {
|
|
18
|
+
typography: (0, _extends2.default)({}, componentsTypographyProps, slotsTypographyProps)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _paginationItemProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _paginationItemProps = _interopRequireDefault(require("./pagination-item-props"));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = transformer;
|
|
8
|
+
var _replaceComponentsWithSlots = _interopRequireDefault(require("../utils/replaceComponentsWithSlots"));
|
|
9
|
+
/**
|
|
10
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
11
|
+
* @param {import('jscodeshift').API} api
|
|
12
|
+
*/
|
|
13
|
+
function transformer(file, api, options) {
|
|
14
|
+
const j = api.jscodeshift;
|
|
15
|
+
const root = j(file.source);
|
|
16
|
+
const printOptions = options.printOptions;
|
|
17
|
+
(0, _replaceComponentsWithSlots.default)(j, {
|
|
18
|
+
root,
|
|
19
|
+
componentName: 'PaginationItem'
|
|
20
|
+
});
|
|
21
|
+
return root.toSource(printOptions);
|
|
22
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _PaginationItem = _interopRequireDefault(require("@mui/material/PaginationItem"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_PaginationItem.default, {
|
|
7
|
+
components: {
|
|
8
|
+
first: first,
|
|
9
|
+
last: last,
|
|
10
|
+
next: next,
|
|
11
|
+
previous: previous
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_PaginationItem.default, {
|
|
15
|
+
slots: {
|
|
16
|
+
first: slotFirst,
|
|
17
|
+
last: slotLast,
|
|
18
|
+
next: slotNext,
|
|
19
|
+
previous: slotPrevious
|
|
20
|
+
},
|
|
21
|
+
components: {
|
|
22
|
+
first: componentFirst,
|
|
23
|
+
last: componentLast,
|
|
24
|
+
next: componentNext,
|
|
25
|
+
previous: componentPrevious
|
|
26
|
+
}
|
|
27
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _PaginationItem = _interopRequireDefault(require("@mui/material/PaginationItem"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_PaginationItem.default, {
|
|
7
|
+
slots: {
|
|
8
|
+
first: first,
|
|
9
|
+
last: last,
|
|
10
|
+
next: next,
|
|
11
|
+
previous: previous
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_PaginationItem.default, {
|
|
15
|
+
slots: {
|
|
16
|
+
first: slotFirst,
|
|
17
|
+
last: slotLast,
|
|
18
|
+
next: slotNext,
|
|
19
|
+
previous: slotPrevious
|
|
20
|
+
}
|
|
21
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiPaginationItem: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
components: {
|
|
7
|
+
first: componentFirst,
|
|
8
|
+
last: componentLast,
|
|
9
|
+
next: componentNext,
|
|
10
|
+
previous: componentPrevious
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
fn({
|
|
16
|
+
MuiPaginationItem: {
|
|
17
|
+
defaultProps: {
|
|
18
|
+
components: {
|
|
19
|
+
first: componentFirst,
|
|
20
|
+
last: componentLast
|
|
21
|
+
},
|
|
22
|
+
slots: {
|
|
23
|
+
next: slotNext,
|
|
24
|
+
previous: slotPrevious
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiPaginationItem: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
slots: {
|
|
7
|
+
first: componentFirst,
|
|
8
|
+
last: componentLast,
|
|
9
|
+
next: componentNext,
|
|
10
|
+
previous: componentPrevious
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
fn({
|
|
16
|
+
MuiPaginationItem: {
|
|
17
|
+
defaultProps: {
|
|
18
|
+
slots: {
|
|
19
|
+
first: componentFirst,
|
|
20
|
+
last: componentLast,
|
|
21
|
+
next: slotNext,
|
|
22
|
+
previous: slotPrevious
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|