@mui/codemod 6.4.4 → 6.4.6
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 +85 -10
- package/node/deprecations/all/deprecations-all.js +14 -0
- package/node/deprecations/all/postcss.config.js +4 -1
- package/node/deprecations/drawer-props/drawer-props.js +67 -0
- package/node/deprecations/drawer-props/index.js +13 -0
- package/node/deprecations/drawer-props/test-cases/actual.js +73 -0
- package/node/deprecations/drawer-props/test-cases/expected.js +97 -0
- package/node/deprecations/drawer-props/test-cases/theme.actual.js +58 -0
- package/node/deprecations/drawer-props/test-cases/theme.expected.js +74 -0
- package/node/deprecations/input-base-classes/index.js +13 -0
- package/node/deprecations/input-base-classes/input-base-classes.js +69 -0
- package/node/deprecations/input-base-classes/postcss-plugin.js +42 -0
- package/node/deprecations/input-base-classes/postcss.config.js +8 -0
- package/node/deprecations/input-base-classes/test-cases/actual.js +13 -0
- package/node/deprecations/input-base-classes/test-cases/expected.js +13 -0
- package/node/deprecations/menu-props/index.js +13 -0
- package/node/deprecations/menu-props/menu-props.js +37 -0
- package/node/deprecations/menu-props/test-cases/actual.js +67 -0
- package/node/deprecations/menu-props/test-cases/expected.js +83 -0
- package/node/deprecations/menu-props/test-cases/theme.actual.js +33 -0
- package/node/deprecations/menu-props/test-cases/theme.expected.js +39 -0
- package/node/deprecations/popover-props/index.js +13 -0
- package/node/deprecations/popover-props/popover-props.js +49 -0
- package/node/deprecations/popover-props/test-cases/actual.js +73 -0
- package/node/deprecations/popover-props/test-cases/expected.js +89 -0
- package/node/deprecations/popover-props/test-cases/theme.actual.js +19 -0
- package/node/deprecations/popover-props/test-cases/theme.expected.js +23 -0
- package/node/deprecations/snackbar-props/index.js +13 -0
- package/node/deprecations/snackbar-props/snackbar-props.js +43 -0
- package/node/deprecations/snackbar-props/test-cases/actual.js +54 -0
- package/node/deprecations/snackbar-props/test-cases/expected.js +67 -0
- package/node/deprecations/snackbar-props/test-cases/theme.actual.js +39 -0
- package/node/deprecations/snackbar-props/test-cases/theme.expected.js +46 -0
- package/node/deprecations/speed-dial-action-props/index.js +13 -0
- package/node/deprecations/speed-dial-action-props/speed-dial-action-props.js +52 -0
- package/node/deprecations/speed-dial-action-props/test-cases/actual.js +56 -0
- package/node/deprecations/speed-dial-action-props/test-cases/expected.js +104 -0
- package/node/deprecations/speed-dial-action-props/test-cases/theme.actual.js +62 -0
- package/node/deprecations/speed-dial-action-props/test-cases/theme.expected.js +88 -0
- package/node/deprecations/tabs-classes/index.js +13 -0
- package/node/deprecations/tabs-classes/postcss-plugin.js +33 -0
- package/node/deprecations/tabs-classes/postcss.config.js +8 -0
- package/node/deprecations/tabs-classes/tabs-classes.js +77 -0
- package/node/deprecations/tabs-classes/test-cases/actual.js +7 -0
- package/node/deprecations/tabs-classes/test-cases/expected.js +7 -0
- package/node/deprecations/tabs-props/index.js +13 -0
- package/node/deprecations/tabs-props/tabs-props.js +37 -0
- package/node/deprecations/tabs-props/test-cases/actual.js +33 -0
- package/node/deprecations/tabs-props/test-cases/expected.js +41 -0
- package/node/deprecations/tabs-props/test-cases/theme.actual.js +15 -0
- package/node/deprecations/tabs-props/test-cases/theme.expected.js +19 -0
- package/node/deprecations/utils/movePropIntoSlotProps.js +44 -19
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const classes = [{
|
|
4
|
+
deprecatedClass: ' .MuiInputBase-inputSizeSmall',
|
|
5
|
+
replacementSelector: '.MuiInputBase-sizeSmall > .MuiInputBase-input'
|
|
6
|
+
}, {
|
|
7
|
+
deprecatedClass: ' .MuiInputBase-inputMultiline',
|
|
8
|
+
replacementSelector: '.MuiInputBase-multiline > .MuiInputBase-input'
|
|
9
|
+
}, {
|
|
10
|
+
deprecatedClass: ' .MuiInputBase-inputAdornedStart',
|
|
11
|
+
replacementSelector: '.MuiInputBase-adornedStart > .MuiInputBase-input'
|
|
12
|
+
}, {
|
|
13
|
+
deprecatedClass: ' .MuiInputBase-inputAdornedEnd',
|
|
14
|
+
replacementSelector: '.MuiInputBase-adornedEnd > .MuiInputBase-input'
|
|
15
|
+
}, {
|
|
16
|
+
deprecatedClass: ' .MuiInputBase-inputHiddenLabel',
|
|
17
|
+
replacementSelector: '.MuiInputBase-hiddenLabel > .MuiInputBase-input'
|
|
18
|
+
}];
|
|
19
|
+
const plugin = () => {
|
|
20
|
+
return {
|
|
21
|
+
postcssPlugin: `Replace deprecated InputBase classes with new classes`,
|
|
22
|
+
Rule(rule) {
|
|
23
|
+
const {
|
|
24
|
+
selector
|
|
25
|
+
} = rule;
|
|
26
|
+
classes.forEach(({
|
|
27
|
+
deprecatedClass,
|
|
28
|
+
replacementSelector
|
|
29
|
+
}) => {
|
|
30
|
+
const selectorRegex = new RegExp(`${deprecatedClass}`);
|
|
31
|
+
if (selector.match(selectorRegex)) {
|
|
32
|
+
rule.selector = selector.replace(selectorRegex, replacementSelector);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
plugin.postcss = true;
|
|
39
|
+
module.exports = {
|
|
40
|
+
plugin,
|
|
41
|
+
classes
|
|
42
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _InputBase = require("@mui/material/InputBase");
|
|
4
|
+
'& .MuiInputBase-inputHiddenLabel';
|
|
5
|
+
'& .MuiInputBase-inputMultiline';
|
|
6
|
+
'& .MuiInputBase-inputAdornedStart';
|
|
7
|
+
'& .MuiInputBase-inputAdornedEnd';
|
|
8
|
+
'& .MuiInputBase-inputSizeSmall';
|
|
9
|
+
`& .${_InputBase.inputBaseClasses.inputHiddenLabel}`;
|
|
10
|
+
`& .${_InputBase.inputBaseClasses.inputMultiline}`;
|
|
11
|
+
`& .${_InputBase.inputBaseClasses.inputAdornedStart}`;
|
|
12
|
+
`& .${_InputBase.inputBaseClasses.inputAdornedEnd}`;
|
|
13
|
+
`& .${_InputBase.inputBaseClasses.inputSizeSmall}`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _InputBase = require("@mui/material/InputBase");
|
|
4
|
+
"&.MuiInputBase-hiddenLabel > .MuiInputBase-input";
|
|
5
|
+
"&.MuiInputBase-multiline > .MuiInputBase-input";
|
|
6
|
+
"&.MuiInputBase-adornedStart > .MuiInputBase-input";
|
|
7
|
+
"&.MuiInputBase-adornedEnd > .MuiInputBase-input";
|
|
8
|
+
"&.MuiInputBase-sizeSmall > .MuiInputBase-input";
|
|
9
|
+
`&.${_InputBase.inputBaseClasses.hiddenLabel} > .${_InputBase.inputBaseClasses.input}`;
|
|
10
|
+
`&.${_InputBase.inputBaseClasses.multiline} > .${_InputBase.inputBaseClasses.input}`;
|
|
11
|
+
`&.${_InputBase.inputBaseClasses.adornedStart} > .${_InputBase.inputBaseClasses.input}`;
|
|
12
|
+
`&.${_InputBase.inputBaseClasses.adornedEnd} > .${_InputBase.inputBaseClasses.input}`;
|
|
13
|
+
`&.${_InputBase.inputBaseClasses.sizeSmall} > .${_InputBase.inputBaseClasses.input}`;
|
|
@@ -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 _menuProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _menuProps = _interopRequireDefault(require("./menu-props"));
|
|
@@ -0,0 +1,37 @@
|
|
|
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 _movePropIntoSlots = _interopRequireDefault(require("../utils/movePropIntoSlots"));
|
|
9
|
+
var _movePropIntoSlotProps = _interopRequireDefault(require("../utils/movePropIntoSlotProps"));
|
|
10
|
+
/**
|
|
11
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
12
|
+
* @param {import('jscodeshift').API} api
|
|
13
|
+
*/
|
|
14
|
+
function transformer(file, api, options) {
|
|
15
|
+
const j = api.jscodeshift;
|
|
16
|
+
const root = j(file.source);
|
|
17
|
+
const printOptions = options.printOptions;
|
|
18
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
19
|
+
root,
|
|
20
|
+
componentName: 'Menu',
|
|
21
|
+
propName: 'MenuListProps',
|
|
22
|
+
slotName: 'list'
|
|
23
|
+
});
|
|
24
|
+
(0, _movePropIntoSlots.default)(j, {
|
|
25
|
+
root,
|
|
26
|
+
componentName: 'Menu',
|
|
27
|
+
propName: 'TransitionComponent',
|
|
28
|
+
slotName: 'transition'
|
|
29
|
+
});
|
|
30
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
31
|
+
root,
|
|
32
|
+
componentName: 'Menu',
|
|
33
|
+
propName: 'TransitionProps',
|
|
34
|
+
slotName: 'transition'
|
|
35
|
+
});
|
|
36
|
+
return root.toSource(printOptions);
|
|
37
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
8
|
+
TransitionComponent: CustomTransition,
|
|
9
|
+
MenuListProps: {
|
|
10
|
+
disablePadding: true
|
|
11
|
+
},
|
|
12
|
+
TransitionProps: {
|
|
13
|
+
timeout: 200
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
17
|
+
TransitionComponent: CustomTransition,
|
|
18
|
+
MenuListProps: {
|
|
19
|
+
disablePadding: true
|
|
20
|
+
},
|
|
21
|
+
TransitionProps: {
|
|
22
|
+
timeout: 200
|
|
23
|
+
},
|
|
24
|
+
slotProps: {
|
|
25
|
+
root: {
|
|
26
|
+
disablePortal: true
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
31
|
+
TransitionComponent: CustomTransition,
|
|
32
|
+
MenuListProps: {
|
|
33
|
+
disablePadding: true
|
|
34
|
+
},
|
|
35
|
+
TransitionProps: {
|
|
36
|
+
timeout: 200
|
|
37
|
+
},
|
|
38
|
+
slotProps: {
|
|
39
|
+
root: {
|
|
40
|
+
disablePortal: true
|
|
41
|
+
},
|
|
42
|
+
list: {
|
|
43
|
+
disableListWrap: true
|
|
44
|
+
},
|
|
45
|
+
transition: {
|
|
46
|
+
'aria-hidden': true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Menu, {
|
|
51
|
+
TransitionComponent: CustomTransition,
|
|
52
|
+
MenuListProps: {
|
|
53
|
+
disablePadding: true
|
|
54
|
+
},
|
|
55
|
+
TransitionProps: {
|
|
56
|
+
timeout: 200
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomMenu, {
|
|
60
|
+
TransitionComponent: CustomTransition,
|
|
61
|
+
MenuListProps: {
|
|
62
|
+
disablePadding: true
|
|
63
|
+
},
|
|
64
|
+
TransitionProps: {
|
|
65
|
+
timeout: 200
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
8
|
+
slotProps: {
|
|
9
|
+
list: {
|
|
10
|
+
disablePadding: true
|
|
11
|
+
},
|
|
12
|
+
transition: {
|
|
13
|
+
timeout: 200
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
slots: {
|
|
17
|
+
transition: CustomTransition
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
21
|
+
slotProps: {
|
|
22
|
+
root: {
|
|
23
|
+
disablePortal: true
|
|
24
|
+
},
|
|
25
|
+
list: {
|
|
26
|
+
disablePadding: true
|
|
27
|
+
},
|
|
28
|
+
transition: {
|
|
29
|
+
timeout: 200
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
slots: {
|
|
33
|
+
transition: CustomTransition
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Menu.default, {
|
|
37
|
+
slotProps: {
|
|
38
|
+
root: {
|
|
39
|
+
disablePortal: true
|
|
40
|
+
},
|
|
41
|
+
list: {
|
|
42
|
+
...{
|
|
43
|
+
disablePadding: true
|
|
44
|
+
},
|
|
45
|
+
...{
|
|
46
|
+
disableListWrap: true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
transition: {
|
|
50
|
+
...{
|
|
51
|
+
timeout: 200
|
|
52
|
+
},
|
|
53
|
+
...{
|
|
54
|
+
'aria-hidden': true
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
slots: {
|
|
59
|
+
transition: CustomTransition
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Menu, {
|
|
63
|
+
slotProps: {
|
|
64
|
+
list: {
|
|
65
|
+
disablePadding: true
|
|
66
|
+
},
|
|
67
|
+
transition: {
|
|
68
|
+
timeout: 200
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
slots: {
|
|
72
|
+
transition: CustomTransition
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomMenu, {
|
|
76
|
+
TransitionComponent: CustomTransition,
|
|
77
|
+
MenuListProps: {
|
|
78
|
+
disablePadding: true
|
|
79
|
+
},
|
|
80
|
+
TransitionProps: {
|
|
81
|
+
timeout: 200
|
|
82
|
+
}
|
|
83
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiMenu: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
MenuListProps: {
|
|
7
|
+
disablePadding: true
|
|
8
|
+
},
|
|
9
|
+
TransitionComponent: CustomTransition,
|
|
10
|
+
TransitionProps: {
|
|
11
|
+
timeout: 200
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
fn({
|
|
17
|
+
MuiMenu: {
|
|
18
|
+
defaultProps: {
|
|
19
|
+
TransitionComponent: CustomTransition,
|
|
20
|
+
MenuListProps: {
|
|
21
|
+
disablePadding: true
|
|
22
|
+
},
|
|
23
|
+
TransitionProps: {
|
|
24
|
+
timeout: 200
|
|
25
|
+
},
|
|
26
|
+
slotProps: {
|
|
27
|
+
root: {
|
|
28
|
+
disablePortal: true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiMenu: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
slotProps: {
|
|
7
|
+
list: {
|
|
8
|
+
disablePadding: true
|
|
9
|
+
},
|
|
10
|
+
transition: {
|
|
11
|
+
timeout: 200
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
slots: {
|
|
15
|
+
transition: CustomTransition
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
fn({
|
|
21
|
+
MuiMenu: {
|
|
22
|
+
defaultProps: {
|
|
23
|
+
slotProps: {
|
|
24
|
+
root: {
|
|
25
|
+
disablePortal: true
|
|
26
|
+
},
|
|
27
|
+
list: {
|
|
28
|
+
disablePadding: true
|
|
29
|
+
},
|
|
30
|
+
transition: {
|
|
31
|
+
timeout: 200
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
slots: {
|
|
35
|
+
transition: CustomTransition
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -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 _popoverProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _popoverProps = _interopRequireDefault(require("./popover-props"));
|
|
@@ -0,0 +1,49 @@
|
|
|
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 _movePropIntoSlots = _interopRequireDefault(require("../utils/movePropIntoSlots"));
|
|
9
|
+
var _movePropIntoSlotProps = _interopRequireDefault(require("../utils/movePropIntoSlotProps"));
|
|
10
|
+
/**
|
|
11
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
12
|
+
* @param {import('jscodeshift').API} api
|
|
13
|
+
*/
|
|
14
|
+
function transformer(file, api, options) {
|
|
15
|
+
const j = api.jscodeshift;
|
|
16
|
+
const root = j(file.source);
|
|
17
|
+
const printOptions = options.printOptions;
|
|
18
|
+
(0, _movePropIntoSlots.default)(j, {
|
|
19
|
+
root,
|
|
20
|
+
componentName: 'Popover',
|
|
21
|
+
propName: 'BackdropComponent',
|
|
22
|
+
slotName: 'backdrop'
|
|
23
|
+
});
|
|
24
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
25
|
+
root,
|
|
26
|
+
componentName: 'Popover',
|
|
27
|
+
propName: 'BackdropProps',
|
|
28
|
+
slotName: 'backdrop'
|
|
29
|
+
});
|
|
30
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
31
|
+
root,
|
|
32
|
+
componentName: 'Popover',
|
|
33
|
+
propName: 'PaperProps',
|
|
34
|
+
slotName: 'paper'
|
|
35
|
+
});
|
|
36
|
+
(0, _movePropIntoSlots.default)(j, {
|
|
37
|
+
root,
|
|
38
|
+
componentName: 'Popover',
|
|
39
|
+
propName: 'TransitionComponent',
|
|
40
|
+
slotName: 'transition'
|
|
41
|
+
});
|
|
42
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
43
|
+
root,
|
|
44
|
+
componentName: 'Popover',
|
|
45
|
+
propName: 'TransitionProps',
|
|
46
|
+
slotName: 'transition'
|
|
47
|
+
});
|
|
48
|
+
return root.toSource(printOptions);
|
|
49
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Popover = _interopRequireDefault(require("@mui/material/Popover"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
|
|
8
|
+
BackdropComponent: CustomBackdrop,
|
|
9
|
+
BackdropProps: {
|
|
10
|
+
timeout: 200
|
|
11
|
+
},
|
|
12
|
+
PaperProps: {
|
|
13
|
+
elevation: 4
|
|
14
|
+
},
|
|
15
|
+
TransitionComponent: CustomTransition,
|
|
16
|
+
TransitionProps: {
|
|
17
|
+
timeout: 200
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
|
|
21
|
+
BackdropComponent: CustomBackdrop,
|
|
22
|
+
BackdropProps: {
|
|
23
|
+
timeout: 200
|
|
24
|
+
},
|
|
25
|
+
PaperProps: {
|
|
26
|
+
elevation: 4
|
|
27
|
+
},
|
|
28
|
+
TransitionComponent: CustomTransition,
|
|
29
|
+
TransitionProps: {
|
|
30
|
+
timeout: 200
|
|
31
|
+
},
|
|
32
|
+
slotProps: {
|
|
33
|
+
backdrop: {
|
|
34
|
+
sx: {
|
|
35
|
+
backgroundColor: 'red'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
paper: {
|
|
39
|
+
sx: {
|
|
40
|
+
backgroundColor: 'blue'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
transition: {
|
|
44
|
+
onEnter: () => {}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Popover, {
|
|
49
|
+
BackdropComponent: CustomBackdrop,
|
|
50
|
+
BackdropProps: {
|
|
51
|
+
timeout: 200
|
|
52
|
+
},
|
|
53
|
+
PaperProps: {
|
|
54
|
+
elevation: 4
|
|
55
|
+
},
|
|
56
|
+
TransitionComponent: CustomTransition,
|
|
57
|
+
TransitionProps: {
|
|
58
|
+
timeout: 200
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomPopover, {
|
|
62
|
+
BackdropComponent: CustomBackdrop,
|
|
63
|
+
BackdropProps: {
|
|
64
|
+
timeout: 200
|
|
65
|
+
},
|
|
66
|
+
PaperProps: {
|
|
67
|
+
elevation: 4
|
|
68
|
+
},
|
|
69
|
+
TransitionComponent: CustomTransition,
|
|
70
|
+
TransitionProps: {
|
|
71
|
+
timeout: 200
|
|
72
|
+
}
|
|
73
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _Popover = _interopRequireDefault(require("@mui/material/Popover"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
|
|
8
|
+
slots: {
|
|
9
|
+
backdrop: CustomBackdrop,
|
|
10
|
+
transition: CustomTransition
|
|
11
|
+
},
|
|
12
|
+
slotProps: {
|
|
13
|
+
backdrop: {
|
|
14
|
+
timeout: 200
|
|
15
|
+
},
|
|
16
|
+
paper: {
|
|
17
|
+
elevation: 4
|
|
18
|
+
},
|
|
19
|
+
transition: {
|
|
20
|
+
timeout: 200
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
|
|
25
|
+
slotProps: {
|
|
26
|
+
backdrop: {
|
|
27
|
+
...{
|
|
28
|
+
timeout: 200
|
|
29
|
+
},
|
|
30
|
+
...{
|
|
31
|
+
sx: {
|
|
32
|
+
backgroundColor: 'red'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
paper: {
|
|
37
|
+
...{
|
|
38
|
+
elevation: 4
|
|
39
|
+
},
|
|
40
|
+
...{
|
|
41
|
+
sx: {
|
|
42
|
+
backgroundColor: 'blue'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
transition: {
|
|
47
|
+
...{
|
|
48
|
+
timeout: 200
|
|
49
|
+
},
|
|
50
|
+
...{
|
|
51
|
+
onEnter: () => {}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
slots: {
|
|
56
|
+
backdrop: CustomBackdrop,
|
|
57
|
+
transition: CustomTransition
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Popover, {
|
|
61
|
+
slots: {
|
|
62
|
+
backdrop: CustomBackdrop,
|
|
63
|
+
transition: CustomTransition
|
|
64
|
+
},
|
|
65
|
+
slotProps: {
|
|
66
|
+
backdrop: {
|
|
67
|
+
timeout: 200
|
|
68
|
+
},
|
|
69
|
+
paper: {
|
|
70
|
+
elevation: 4
|
|
71
|
+
},
|
|
72
|
+
transition: {
|
|
73
|
+
timeout: 200
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(CustomPopover, {
|
|
78
|
+
BackdropComponent: CustomBackdrop,
|
|
79
|
+
BackdropProps: {
|
|
80
|
+
timeout: 200
|
|
81
|
+
},
|
|
82
|
+
PaperProps: {
|
|
83
|
+
elevation: 4
|
|
84
|
+
},
|
|
85
|
+
TransitionComponent: CustomTransition,
|
|
86
|
+
TransitionProps: {
|
|
87
|
+
timeout: 200
|
|
88
|
+
}
|
|
89
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiPopover: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
BackdropComponent: 'div',
|
|
7
|
+
BackdropProps: {
|
|
8
|
+
timeout: 200
|
|
9
|
+
},
|
|
10
|
+
PaperProps: {
|
|
11
|
+
elevation: 8
|
|
12
|
+
},
|
|
13
|
+
TransitionComponent: 'em',
|
|
14
|
+
TransitionProps: {
|
|
15
|
+
timeout: 200
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiPopover: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
slots: {
|
|
7
|
+
backdrop: 'div',
|
|
8
|
+
transition: 'em'
|
|
9
|
+
},
|
|
10
|
+
slotProps: {
|
|
11
|
+
backdrop: {
|
|
12
|
+
timeout: 200
|
|
13
|
+
},
|
|
14
|
+
paper: {
|
|
15
|
+
elevation: 8
|
|
16
|
+
},
|
|
17
|
+
transition: {
|
|
18
|
+
timeout: 200
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -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 _snackbarProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _snackbarProps = _interopRequireDefault(require("./snackbar-props"));
|
|
@@ -0,0 +1,43 @@
|
|
|
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 _movePropIntoSlots = _interopRequireDefault(require("../utils/movePropIntoSlots"));
|
|
9
|
+
var _movePropIntoSlotProps = _interopRequireDefault(require("../utils/movePropIntoSlotProps"));
|
|
10
|
+
/**
|
|
11
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
12
|
+
* @param {import('jscodeshift').API} api
|
|
13
|
+
*/
|
|
14
|
+
function transformer(file, api, options) {
|
|
15
|
+
const j = api.jscodeshift;
|
|
16
|
+
const root = j(file.source);
|
|
17
|
+
const printOptions = options.printOptions;
|
|
18
|
+
(0, _movePropIntoSlots.default)(j, {
|
|
19
|
+
root,
|
|
20
|
+
componentName: 'Snackbar',
|
|
21
|
+
propName: 'TransitionComponent',
|
|
22
|
+
slotName: 'transition'
|
|
23
|
+
});
|
|
24
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
25
|
+
root,
|
|
26
|
+
componentName: 'Snackbar',
|
|
27
|
+
propName: 'TransitionProps',
|
|
28
|
+
slotName: 'transition'
|
|
29
|
+
});
|
|
30
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
31
|
+
root,
|
|
32
|
+
componentName: 'Snackbar',
|
|
33
|
+
propName: 'ContentProps',
|
|
34
|
+
slotName: 'content'
|
|
35
|
+
});
|
|
36
|
+
(0, _movePropIntoSlotProps.default)(j, {
|
|
37
|
+
root,
|
|
38
|
+
componentName: 'Snackbar',
|
|
39
|
+
propName: 'ClickAwayListenerProps',
|
|
40
|
+
slotName: 'clickAwayListener'
|
|
41
|
+
});
|
|
42
|
+
return root.toSource(printOptions);
|
|
43
|
+
}
|