@mui/codemod 9.0.0-alpha.1 → 9.0.0-beta.0
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/CHANGELOG.md +288 -2
- package/README.md +393 -8
- package/deprecations/all/deprecations-all.js +6 -0
- package/deprecations/autocomplete-props/autocomplete-props.js +195 -0
- package/deprecations/autocomplete-props/test-cases/actual.js +31 -0
- package/deprecations/autocomplete-props/test-cases/expected.js +31 -0
- package/deprecations/autocomplete-props/test-cases/package.actual.js +11 -0
- package/deprecations/autocomplete-props/test-cases/package.expected.js +11 -0
- package/deprecations/autocomplete-props/test-cases/render-input-package.actual.js +34 -0
- package/deprecations/autocomplete-props/test-cases/render-input-package.expected.js +40 -0
- package/deprecations/autocomplete-props/test-cases/render-input.actual.js +81 -0
- package/deprecations/autocomplete-props/test-cases/render-input.expected.js +92 -0
- package/deprecations/autocomplete-props/test-cases/theme.actual.js +15 -0
- package/deprecations/autocomplete-props/test-cases/theme.expected.js +15 -0
- package/deprecations/checkbox-props/checkbox-props.js +33 -0
- package/deprecations/checkbox-props/index.js +13 -0
- package/deprecations/checkbox-props/test-cases/actual.js +45 -0
- package/deprecations/checkbox-props/test-cases/expected.js +61 -0
- package/deprecations/checkbox-props/test-cases/package.actual.js +34 -0
- package/deprecations/checkbox-props/test-cases/package.expected.js +50 -0
- package/deprecations/checkbox-props/test-cases/theme.actual.js +28 -0
- package/deprecations/checkbox-props/test-cases/theme.expected.js +36 -0
- package/deprecations/circular-progress-classes/circular-progress-classes.js +16 -1
- package/deprecations/circular-progress-classes/postcss-plugin.js +2 -2
- package/deprecations/circular-progress-classes/test-cases/expected.js +4 -4
- package/deprecations/circular-progress-classes/test-cases/package.expected.js +4 -4
- package/deprecations/dialog-props/dialog-props.js +14 -0
- package/deprecations/dialog-props/test-cases/actual.js +4 -0
- package/deprecations/dialog-props/test-cases/expected.js +4 -0
- package/deprecations/drawer-props/drawer-props.js +14 -0
- package/deprecations/drawer-props/test-cases/actual.js +10 -2
- package/deprecations/drawer-props/test-cases/expected.js +14 -2
- package/deprecations/radio-props/index.js +13 -0
- package/deprecations/radio-props/radio-props.js +33 -0
- package/deprecations/radio-props/test-cases/actual.js +45 -0
- package/deprecations/radio-props/test-cases/expected.js +61 -0
- package/deprecations/radio-props/test-cases/package.actual.js +34 -0
- package/deprecations/radio-props/test-cases/package.expected.js +50 -0
- package/deprecations/radio-props/test-cases/theme.actual.js +28 -0
- package/deprecations/radio-props/test-cases/theme.expected.js +36 -0
- package/deprecations/switch-props/index.js +13 -0
- package/deprecations/switch-props/switch-props.js +33 -0
- package/deprecations/switch-props/test-cases/actual.js +45 -0
- package/deprecations/switch-props/test-cases/expected.js +61 -0
- package/deprecations/switch-props/test-cases/package.actual.js +34 -0
- package/deprecations/switch-props/test-cases/package.expected.js +50 -0
- package/deprecations/switch-props/test-cases/theme.actual.js +28 -0
- package/deprecations/switch-props/test-cases/theme.expected.js +36 -0
- package/deprecations/tabs-props/tabs-props.js +44 -0
- package/deprecations/tabs-props/test-cases/actual.js +11 -0
- package/deprecations/tabs-props/test-cases/expected.js +11 -0
- package/deprecations/tabs-props/test-cases/package.actual.js +6 -0
- package/deprecations/tabs-props/test-cases/package.expected.js +6 -0
- package/deprecations/tabs-props/test-cases/theme.actual.js +10 -0
- package/deprecations/tabs-props/test-cases/theme.expected.js +10 -0
- package/package.json +3 -3
- package/v9.0.0/system-props/index.js +13 -0
- package/v9.0.0/system-props/removeSystemProps.js +243 -0
- package/v9.0.0/system-props/test-cases/system-props.actual.js +144 -0
- package/v9.0.0/system-props/test-cases/system-props.expected.js +175 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Radio = _interopRequireDefault(require("@org/ui/material/Radio"));
|
|
5
|
+
var _material = require("@org/ui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {
|
|
8
|
+
inputProps: {
|
|
9
|
+
'aria-label': 'Radio'
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {
|
|
13
|
+
inputRef: ref
|
|
14
|
+
});
|
|
15
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {
|
|
16
|
+
inputProps: {
|
|
17
|
+
'aria-label': 'Radio'
|
|
18
|
+
},
|
|
19
|
+
inputRef: ref
|
|
20
|
+
});
|
|
21
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {
|
|
22
|
+
inputProps: {
|
|
23
|
+
'aria-label': 'Radio'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {
|
|
27
|
+
inputRef: ref
|
|
28
|
+
});
|
|
29
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {
|
|
30
|
+
inputProps: {
|
|
31
|
+
'aria-label': 'Radio'
|
|
32
|
+
},
|
|
33
|
+
inputRef: ref
|
|
34
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Radio = _interopRequireDefault(require("@org/ui/material/Radio"));
|
|
5
|
+
var _material = require("@org/ui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {
|
|
8
|
+
slotProps: {
|
|
9
|
+
input: {
|
|
10
|
+
'aria-label': 'Radio'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {
|
|
15
|
+
slotProps: {
|
|
16
|
+
input: {
|
|
17
|
+
ref: ref
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {
|
|
22
|
+
slotProps: {
|
|
23
|
+
input: {
|
|
24
|
+
'aria-label': 'Radio',
|
|
25
|
+
ref: ref
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {
|
|
30
|
+
slotProps: {
|
|
31
|
+
input: {
|
|
32
|
+
'aria-label': 'Radio'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {
|
|
37
|
+
slotProps: {
|
|
38
|
+
input: {
|
|
39
|
+
ref: ref
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {
|
|
44
|
+
slotProps: {
|
|
45
|
+
input: {
|
|
46
|
+
'aria-label': 'Radio',
|
|
47
|
+
ref: ref
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiRadio: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
inputProps: {
|
|
7
|
+
'aria-label': 'Radio'
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
fn({
|
|
13
|
+
MuiRadio: {
|
|
14
|
+
defaultProps: {
|
|
15
|
+
inputRef: ref
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
fn({
|
|
20
|
+
MuiRadio: {
|
|
21
|
+
defaultProps: {
|
|
22
|
+
inputProps: {
|
|
23
|
+
'aria-label': 'Radio'
|
|
24
|
+
},
|
|
25
|
+
inputRef: ref
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiRadio: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
slotProps: {
|
|
7
|
+
input: {
|
|
8
|
+
'aria-label': 'Radio'
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
fn({
|
|
15
|
+
MuiRadio: {
|
|
16
|
+
defaultProps: {
|
|
17
|
+
slotProps: {
|
|
18
|
+
input: {
|
|
19
|
+
ref: ref
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
fn({
|
|
26
|
+
MuiRadio: {
|
|
27
|
+
defaultProps: {
|
|
28
|
+
slotProps: {
|
|
29
|
+
input: {
|
|
30
|
+
'aria-label': 'Radio',
|
|
31
|
+
ref: ref
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _switchProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _switchProps = _interopRequireDefault(require("./switch-props"));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = transformer;
|
|
8
|
+
var _movePropIntoSlotProps = _interopRequireDefault(require("../utils/movePropIntoSlotProps"));
|
|
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, _movePropIntoSlotProps.default)(j, {
|
|
18
|
+
root,
|
|
19
|
+
packageName: options.packageName,
|
|
20
|
+
componentName: 'Switch',
|
|
21
|
+
propName: 'inputProps',
|
|
22
|
+
slotName: 'input'
|
|
23
|
+
});
|
|
24
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
25
|
+
root,
|
|
26
|
+
packageName: options.packageName,
|
|
27
|
+
componentName: 'Switch',
|
|
28
|
+
propName: 'inputRef',
|
|
29
|
+
slotName: 'input',
|
|
30
|
+
slotPropName: 'ref'
|
|
31
|
+
});
|
|
32
|
+
return root.toSource(printOptions);
|
|
33
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
8
|
+
inputProps: {
|
|
9
|
+
'aria-label': 'Switch'
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
13
|
+
inputRef: ref
|
|
14
|
+
});
|
|
15
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
16
|
+
inputProps: {
|
|
17
|
+
'aria-label': 'Switch'
|
|
18
|
+
},
|
|
19
|
+
inputRef: ref
|
|
20
|
+
});
|
|
21
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
22
|
+
inputProps: {
|
|
23
|
+
'aria-label': 'Switch'
|
|
24
|
+
},
|
|
25
|
+
inputRef: ref,
|
|
26
|
+
slotProps: {
|
|
27
|
+
root: {
|
|
28
|
+
id: 'test'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
33
|
+
inputProps: {
|
|
34
|
+
'aria-label': 'Switch'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
38
|
+
inputRef: ref
|
|
39
|
+
});
|
|
40
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
41
|
+
inputProps: {
|
|
42
|
+
'aria-label': 'Switch'
|
|
43
|
+
},
|
|
44
|
+
inputRef: ref
|
|
45
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
8
|
+
slotProps: {
|
|
9
|
+
input: {
|
|
10
|
+
'aria-label': 'Switch'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
15
|
+
slotProps: {
|
|
16
|
+
input: {
|
|
17
|
+
ref: ref
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
22
|
+
slotProps: {
|
|
23
|
+
input: {
|
|
24
|
+
'aria-label': 'Switch',
|
|
25
|
+
ref: ref
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
30
|
+
slotProps: {
|
|
31
|
+
root: {
|
|
32
|
+
id: 'test'
|
|
33
|
+
},
|
|
34
|
+
input: {
|
|
35
|
+
'aria-label': 'Switch',
|
|
36
|
+
ref: ref
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
41
|
+
slotProps: {
|
|
42
|
+
input: {
|
|
43
|
+
'aria-label': 'Switch'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
48
|
+
slotProps: {
|
|
49
|
+
input: {
|
|
50
|
+
ref: ref
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
55
|
+
slotProps: {
|
|
56
|
+
input: {
|
|
57
|
+
'aria-label': 'Switch',
|
|
58
|
+
ref: ref
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Switch = _interopRequireDefault(require("@org/ui/material/Switch"));
|
|
5
|
+
var _material = require("@org/ui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
8
|
+
inputProps: {
|
|
9
|
+
'aria-label': 'Switch'
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
13
|
+
inputRef: ref
|
|
14
|
+
});
|
|
15
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
16
|
+
inputProps: {
|
|
17
|
+
'aria-label': 'Switch'
|
|
18
|
+
},
|
|
19
|
+
inputRef: ref
|
|
20
|
+
});
|
|
21
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
22
|
+
inputProps: {
|
|
23
|
+
'aria-label': 'Switch'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
27
|
+
inputRef: ref
|
|
28
|
+
});
|
|
29
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
30
|
+
inputProps: {
|
|
31
|
+
'aria-label': 'Switch'
|
|
32
|
+
},
|
|
33
|
+
inputRef: ref
|
|
34
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Switch = _interopRequireDefault(require("@org/ui/material/Switch"));
|
|
5
|
+
var _material = require("@org/ui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
8
|
+
slotProps: {
|
|
9
|
+
input: {
|
|
10
|
+
'aria-label': 'Switch'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
15
|
+
slotProps: {
|
|
16
|
+
input: {
|
|
17
|
+
ref: ref
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, {
|
|
22
|
+
slotProps: {
|
|
23
|
+
input: {
|
|
24
|
+
'aria-label': 'Switch',
|
|
25
|
+
ref: ref
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
30
|
+
slotProps: {
|
|
31
|
+
input: {
|
|
32
|
+
'aria-label': 'Switch'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
37
|
+
slotProps: {
|
|
38
|
+
input: {
|
|
39
|
+
ref: ref
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Switch, {
|
|
44
|
+
slotProps: {
|
|
45
|
+
input: {
|
|
46
|
+
'aria-label': 'Switch',
|
|
47
|
+
ref: ref
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiSwitch: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
inputProps: {
|
|
7
|
+
'aria-label': 'Switch'
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
fn({
|
|
13
|
+
MuiSwitch: {
|
|
14
|
+
defaultProps: {
|
|
15
|
+
inputRef: ref
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
fn({
|
|
20
|
+
MuiSwitch: {
|
|
21
|
+
defaultProps: {
|
|
22
|
+
inputProps: {
|
|
23
|
+
'aria-label': 'Switch'
|
|
24
|
+
},
|
|
25
|
+
inputRef: ref
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiSwitch: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
slotProps: {
|
|
7
|
+
input: {
|
|
8
|
+
'aria-label': 'Switch'
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
fn({
|
|
15
|
+
MuiSwitch: {
|
|
16
|
+
defaultProps: {
|
|
17
|
+
slotProps: {
|
|
18
|
+
input: {
|
|
19
|
+
ref: ref
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
fn({
|
|
26
|
+
MuiSwitch: {
|
|
27
|
+
defaultProps: {
|
|
28
|
+
slotProps: {
|
|
29
|
+
input: {
|
|
30
|
+
'aria-label': 'Switch',
|
|
31
|
+
ref: ref
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
@@ -7,6 +7,37 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = transformer;
|
|
8
8
|
var _movePropIntoSlots = _interopRequireDefault(require("../utils/movePropIntoSlots"));
|
|
9
9
|
var _movePropIntoSlotProps = _interopRequireDefault(require("../utils/movePropIntoSlotProps"));
|
|
10
|
+
var _findComponentJSX = _interopRequireDefault(require("../../util/findComponentJSX"));
|
|
11
|
+
var _findComponentDefaultProps = _interopRequireDefault(require("../../util/findComponentDefaultProps"));
|
|
12
|
+
const slotKeyRenames = {
|
|
13
|
+
StartScrollButtonIcon: 'startScrollButtonIcon',
|
|
14
|
+
EndScrollButtonIcon: 'endScrollButtonIcon'
|
|
15
|
+
};
|
|
16
|
+
function renameSlotKey(property) {
|
|
17
|
+
const name = property.key?.name || property.key?.value;
|
|
18
|
+
if (name && slotKeyRenames[name]) {
|
|
19
|
+
property.key.name = slotKeyRenames[name];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function renameJsxSlotKeys(j, element, attributeName) {
|
|
23
|
+
element.openingElement.attributes.forEach(attr => {
|
|
24
|
+
if (attr.type === 'JSXAttribute' && attr.name?.name === attributeName && attr.value?.expression?.type === 'ObjectExpression') {
|
|
25
|
+
attr.value.expression.properties.forEach(renameSlotKey);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function renameDefaultPropsSlotKeys(j, defaultPropsPathCollection, attributeName) {
|
|
30
|
+
defaultPropsPathCollection.find(j.ObjectProperty, {
|
|
31
|
+
key: {
|
|
32
|
+
name: attributeName
|
|
33
|
+
}
|
|
34
|
+
}).forEach(path => {
|
|
35
|
+
if (path.value.value.type === 'ObjectExpression') {
|
|
36
|
+
path.value.value.properties.forEach(renameSlotKey);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
10
41
|
/**
|
|
11
42
|
* @param {import('jscodeshift').FileInfo} file
|
|
12
43
|
* @param {import('jscodeshift').API} api
|
|
@@ -36,5 +67,18 @@ function transformer(file, api, options) {
|
|
|
36
67
|
propName: 'TabIndicatorProps',
|
|
37
68
|
slotName: 'indicator'
|
|
38
69
|
});
|
|
70
|
+
(0, _findComponentJSX.default)(j, {
|
|
71
|
+
root,
|
|
72
|
+
packageName: options.packageName,
|
|
73
|
+
componentName: 'Tabs'
|
|
74
|
+
}, elementPath => {
|
|
75
|
+
renameJsxSlotKeys(j, elementPath.node, 'slots');
|
|
76
|
+
});
|
|
77
|
+
const defaultPropsPathCollection = (0, _findComponentDefaultProps.default)(j, {
|
|
78
|
+
root,
|
|
79
|
+
packageName: options.packageName,
|
|
80
|
+
componentName: 'Tabs'
|
|
81
|
+
});
|
|
82
|
+
renameDefaultPropsSlotKeys(j, defaultPropsPathCollection, 'slots');
|
|
39
83
|
return root.toSource(printOptions);
|
|
40
84
|
}
|
|
@@ -22,6 +22,17 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
22
22
|
className: 'indicator'
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tabs.default, {
|
|
26
|
+
slots: {
|
|
27
|
+
StartScrollButtonIcon: CustomIcon,
|
|
28
|
+
EndScrollButtonIcon: CustomIcon2
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tabs, {
|
|
32
|
+
slots: {
|
|
33
|
+
StartScrollButtonIcon: CustomIcon
|
|
34
|
+
}
|
|
35
|
+
});
|
|
25
36
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomTabs, {
|
|
26
37
|
ScrollButtonComponent: CustomScrollButton,
|
|
27
38
|
TabScrollButtonProps: {
|
|
@@ -30,6 +30,17 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tabs.default, {
|
|
34
|
+
slots: {
|
|
35
|
+
startScrollButtonIcon: CustomIcon,
|
|
36
|
+
endScrollButtonIcon: CustomIcon2
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tabs, {
|
|
40
|
+
slots: {
|
|
41
|
+
startScrollButtonIcon: CustomIcon
|
|
42
|
+
}
|
|
43
|
+
});
|
|
33
44
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomTabs, {
|
|
34
45
|
ScrollButtonComponent: CustomScrollButton,
|
|
35
46
|
TabScrollButtonProps: {
|
|
@@ -22,6 +22,12 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
22
22
|
className: 'indicator'
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tabs.default, {
|
|
26
|
+
slots: {
|
|
27
|
+
StartScrollButtonIcon: CustomIcon,
|
|
28
|
+
EndScrollButtonIcon: CustomIcon2
|
|
29
|
+
}
|
|
30
|
+
});
|
|
25
31
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomTabs, {
|
|
26
32
|
ScrollButtonComponent: CustomScrollButton,
|
|
27
33
|
TabScrollButtonProps: {
|
|
@@ -30,6 +30,12 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Tabs.default, {
|
|
34
|
+
slots: {
|
|
35
|
+
startScrollButtonIcon: CustomIcon,
|
|
36
|
+
endScrollButtonIcon: CustomIcon2
|
|
37
|
+
}
|
|
38
|
+
});
|
|
33
39
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomTabs, {
|
|
34
40
|
ScrollButtonComponent: CustomScrollButton,
|
|
35
41
|
TabScrollButtonProps: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/codemod",
|
|
3
|
-
"version": "9.0.0-
|
|
3
|
+
"version": "9.0.0-beta.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Codemod scripts for Material UI.",
|
|
6
6
|
"keywords": [
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/core": "^7.29.0",
|
|
26
|
-
"@babel/runtime": "^7.
|
|
26
|
+
"@babel/runtime": "^7.29.2",
|
|
27
27
|
"@babel/traverse": "^7.29.0",
|
|
28
28
|
"@mui/material-v5": "npm:@mui/material@5.18.0",
|
|
29
29
|
"jscodeshift": "^17.1.2",
|
|
30
30
|
"jscodeshift-add-imports": "^1.0.11",
|
|
31
|
-
"postcss": "^8.5.
|
|
31
|
+
"postcss": "^8.5.8",
|
|
32
32
|
"postcss-cli": "^11.0.1",
|
|
33
33
|
"yargs": "^17.7.2"
|
|
34
34
|
},
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _removeSystemProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _removeSystemProps = _interopRequireDefault(require("./removeSystemProps"));
|