@mui/codemod 6.0.0-alpha.8 → 6.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/README.md +609 -180
- package/codemod.js +0 -2
- package/node/deprecations/all/deprecations-all.js +34 -22
- package/node/deprecations/all/postcss.config.js +7 -1
- package/node/deprecations/autocomplete-props/autocomplete-props.js +0 -32
- package/node/deprecations/autocomplete-props/test-cases/actual.js +13 -35
- package/node/deprecations/autocomplete-props/test-cases/expected.js +13 -41
- package/node/deprecations/autocomplete-props/test-cases/theme.actual.js +0 -18
- package/node/deprecations/autocomplete-props/test-cases/theme.expected.js +0 -22
- package/node/deprecations/avatar-group-props/avatar-group-props.js +87 -0
- package/node/deprecations/avatar-group-props/index.js +13 -0
- package/node/deprecations/avatar-group-props/test-cases/actual.js +56 -0
- package/node/deprecations/avatar-group-props/test-cases/expected.js +58 -0
- package/node/deprecations/avatar-group-props/test-cases/theme.actual.js +48 -0
- package/node/deprecations/avatar-group-props/test-cases/theme.expected.js +50 -0
- package/node/deprecations/backdrop-props/backdrop-props.js +3 -5
- package/node/deprecations/backdrop-props/test-cases/actual.js +30 -14
- package/node/deprecations/backdrop-props/test-cases/expected.js +23 -13
- package/node/deprecations/backdrop-props/test-cases/theme.actual.js +32 -6
- package/node/deprecations/backdrop-props/test-cases/theme.expected.js +27 -5
- package/node/deprecations/filled-input-props/filled-input-props.js +22 -0
- package/node/deprecations/filled-input-props/index.js +13 -0
- package/node/deprecations/filled-input-props/test-cases/actual.js +60 -0
- package/node/deprecations/filled-input-props/test-cases/expected.js +52 -0
- package/node/deprecations/filled-input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/filled-input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/grid-props/grid-props.js +51 -0
- package/node/deprecations/grid-props/index.js +13 -0
- package/node/deprecations/grid-props/test-cases/actual.js +25 -0
- package/node/deprecations/grid-props/test-cases/expected.js +23 -0
- package/node/deprecations/grid-props/test-cases/theme.actual.js +24 -0
- package/node/deprecations/grid-props/test-cases/theme.expected.js +23 -0
- package/node/deprecations/input-base-props/index.js +13 -0
- package/node/deprecations/input-base-props/input-base-props.js +22 -0
- package/node/deprecations/input-base-props/test-cases/actual.js +60 -0
- package/node/deprecations/input-base-props/test-cases/expected.js +52 -0
- package/node/deprecations/input-base-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/input-base-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/input-props/index.js +13 -0
- package/node/deprecations/input-props/input-props.js +22 -0
- package/node/deprecations/input-props/test-cases/actual.js +60 -0
- package/node/deprecations/input-props/test-cases/expected.js +52 -0
- package/node/deprecations/input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/list-item-props/index.js +13 -0
- package/node/deprecations/list-item-props/list-item-props.js +22 -0
- package/node/deprecations/list-item-props/test-cases/actual.js +43 -0
- package/node/deprecations/list-item-props/test-cases/expected.js +40 -0
- package/node/deprecations/list-item-props/test-cases/theme.actual.js +56 -0
- package/node/deprecations/list-item-props/test-cases/theme.expected.js +53 -0
- package/node/deprecations/modal-props/index.js +13 -0
- package/node/deprecations/modal-props/modal-props.js +22 -0
- package/node/deprecations/modal-props/test-cases/actual.js +43 -0
- package/node/deprecations/modal-props/test-cases/expected.js +40 -0
- package/node/deprecations/modal-props/test-cases/theme.actual.js +56 -0
- package/node/deprecations/modal-props/test-cases/theme.expected.js +53 -0
- package/node/deprecations/outlined-input-props/index.js +13 -0
- package/node/deprecations/outlined-input-props/outlined-input-props.js +22 -0
- package/node/deprecations/outlined-input-props/test-cases/actual.js +60 -0
- package/node/deprecations/outlined-input-props/test-cases/expected.js +52 -0
- package/node/deprecations/outlined-input-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/outlined-input-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/popper-props/index.js +13 -0
- package/node/deprecations/popper-props/popper-props.js +22 -0
- package/node/deprecations/popper-props/test-cases/actual.js +27 -0
- package/node/deprecations/popper-props/test-cases/expected.js +24 -0
- package/node/deprecations/popper-props/test-cases/theme.actual.js +32 -0
- package/node/deprecations/popper-props/test-cases/theme.expected.js +29 -0
- package/node/deprecations/step-label-props/step-label-props.js +0 -14
- package/node/deprecations/step-label-props/test-cases/actual.js +0 -23
- package/node/deprecations/step-label-props/test-cases/expected.js +0 -27
- package/node/deprecations/step-label-props/test-cases/theme.actual.js +0 -22
- package/node/deprecations/step-label-props/test-cases/theme.expected.js +0 -28
- package/node/deprecations/tab-classes/index.js +13 -0
- package/node/deprecations/tab-classes/postcss-plugin.js +30 -0
- package/node/deprecations/tab-classes/postcss.config.js +8 -0
- package/node/deprecations/tab-classes/tab-classes.js +53 -0
- package/node/deprecations/tab-classes/test-cases/actual.js +5 -0
- package/node/deprecations/tab-classes/test-cases/expected.js +5 -0
- package/node/deprecations/table-sort-label-classes/index.js +13 -0
- package/node/deprecations/table-sort-label-classes/postcss-plugin.js +33 -0
- package/node/deprecations/table-sort-label-classes/postcss.config.js +8 -0
- package/node/deprecations/table-sort-label-classes/table-sort-label-classes.js +77 -0
- package/node/deprecations/table-sort-label-classes/test-cases/actual.js +7 -0
- package/node/deprecations/table-sort-label-classes/test-cases/expected.js +7 -0
- package/node/deprecations/tooltip-props/index.js +13 -0
- package/node/deprecations/tooltip-props/test-cases/actual.js +92 -0
- package/node/deprecations/tooltip-props/test-cases/expected.js +84 -0
- package/node/deprecations/tooltip-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/tooltip-props/test-cases/theme.expected.js +65 -0
- package/node/deprecations/tooltip-props/tooltip-props.js +22 -0
- package/node/util/migrateToVariants.js +244 -138
- package/node/v5.0.0/theme-spacing.test/large-actual.js +1 -1
- package/node/v5.0.0/theme-spacing.test/large-expected.js +1 -1
- package/node/v6.0.0/grid-v2-props/grid-v2-props.js +149 -0
- package/node/v6.0.0/grid-v2-props/index.js +13 -0
- package/node/v6.0.0/grid-v2-props/test-cases/actual.js +85 -0
- package/node/v6.0.0/grid-v2-props/test-cases/custom-breakpoints.actual.js +18 -0
- package/node/v6.0.0/grid-v2-props/test-cases/custom-breakpoints.expected.js +22 -0
- package/node/v6.0.0/grid-v2-props/test-cases/expected.js +97 -0
- package/node/v6.0.0/styled/test-cases/ConditionalStyled.expected.js +9 -22
- package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.actual.js +39 -0
- package/node/v6.0.0/styled/test-cases/DynamicPropsStyled.expected.js +65 -0
- package/node/v6.0.0/styled/test-cases/LogicalStyled.actual.js +31 -1
- package/node/v6.0.0/styled/test-cases/LogicalStyled.expected.js +39 -1
- package/node/v6.0.0/styled/test-cases/NestedSpread.expected.js +11 -13
- package/node/v6.0.0/sx-prop/index.js +13 -0
- package/node/v6.0.0/sx-prop/sx-v6.js +405 -0
- package/node/v6.0.0/sx-prop/test-cases/basic-sx.actual.js +36 -0
- package/node/v6.0.0/sx-prop/test-cases/basic-sx.expected.js +46 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.actual.js +55 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-css-vars.expected.js +88 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.actual.js +107 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic.expected.js +120 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.actual.js +49 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-dynamic2.expected.js +64 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-line-break.actual.js +69 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-line-break.expected.js +69 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.actual.js +102 -0
- package/node/v6.0.0/sx-prop/test-cases/sx-value-callback.expected.js +111 -0
- package/node/v6.0.0/system-props/index.js +13 -0
- package/node/v6.0.0/system-props/removeSystemProps.js +242 -0
- package/node/v6.0.0/system-props/test-cases/system-props.actual.js +79 -0
- package/node/v6.0.0/system-props/test-cases/system-props.expected.js +92 -0
- package/node/v6.0.0/theme-v6/theme-v6.js +2 -2
- package/package.json +7 -7
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiAvatarGroup: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
slotProps: {
|
|
7
|
+
surplus: {
|
|
8
|
+
color: "red"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
fn({
|
|
15
|
+
MuiAvatarGroup: {
|
|
16
|
+
defaultProps: {
|
|
17
|
+
slotProps: {
|
|
18
|
+
surplus: {
|
|
19
|
+
...{
|
|
20
|
+
color: "red"
|
|
21
|
+
},
|
|
22
|
+
...{
|
|
23
|
+
color: "blue"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
fn({
|
|
31
|
+
MuiAvatarGroup: {
|
|
32
|
+
defaultProps: {
|
|
33
|
+
slotProps: {
|
|
34
|
+
surplus: {
|
|
35
|
+
...{
|
|
36
|
+
...{
|
|
37
|
+
color: "red"
|
|
38
|
+
},
|
|
39
|
+
...{
|
|
40
|
+
color: "blue"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
...{
|
|
44
|
+
color: "yellow"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = transformer;
|
|
8
|
-
var
|
|
8
|
+
var _replaceComponentsWithSlots = _interopRequireDefault(require("../utils/replaceComponentsWithSlots"));
|
|
9
9
|
/**
|
|
10
10
|
* @param {import('jscodeshift').FileInfo} file
|
|
11
11
|
* @param {import('jscodeshift').API} api
|
|
@@ -14,11 +14,9 @@ function transformer(file, api, options) {
|
|
|
14
14
|
const j = api.jscodeshift;
|
|
15
15
|
const root = j(file.source);
|
|
16
16
|
const printOptions = options.printOptions;
|
|
17
|
-
(0,
|
|
17
|
+
(0, _replaceComponentsWithSlots.default)(j, {
|
|
18
18
|
root,
|
|
19
|
-
componentName: 'Backdrop'
|
|
20
|
-
propName: 'TransitionComponent',
|
|
21
|
-
slotName: 'transition'
|
|
19
|
+
componentName: 'Backdrop'
|
|
22
20
|
});
|
|
23
21
|
return root.toSource(printOptions);
|
|
24
22
|
}
|
|
@@ -5,31 +5,47 @@ var _Backdrop = _interopRequireDefault(require("@mui/material/Backdrop"));
|
|
|
5
5
|
var _material = require("@mui/material");
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Backdrop.default, {
|
|
8
|
-
|
|
8
|
+
components: {
|
|
9
|
+
Root: ComponentsRoot
|
|
10
|
+
},
|
|
11
|
+
componentsProps: {
|
|
12
|
+
root: componentsRootProps
|
|
13
|
+
}
|
|
9
14
|
});
|
|
10
15
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Backdrop, {
|
|
11
|
-
|
|
16
|
+
components: {
|
|
17
|
+
Root: ComponentsRoot
|
|
18
|
+
},
|
|
19
|
+
slotProps: {
|
|
20
|
+
root: slotsRootProps
|
|
21
|
+
}
|
|
12
22
|
});
|
|
13
23
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Backdrop.default, {
|
|
14
|
-
TransitionComponent: CustomTransition,
|
|
15
24
|
slots: {
|
|
16
|
-
root:
|
|
25
|
+
root: SlotsRoot
|
|
26
|
+
},
|
|
27
|
+
componentsProps: {
|
|
28
|
+
root: componentsRootProps
|
|
17
29
|
}
|
|
18
30
|
});
|
|
19
31
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Backdrop, {
|
|
20
|
-
TransitionComponent: CustomTransition,
|
|
21
|
-
slots: {
|
|
22
|
-
...outerSlots
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Backdrop.default, {
|
|
26
|
-
TransitionComponent: ComponentTransition,
|
|
27
32
|
slots: {
|
|
28
|
-
root:
|
|
29
|
-
|
|
33
|
+
root: SlotsRoot
|
|
34
|
+
},
|
|
35
|
+
components: {
|
|
36
|
+
Root: ComponentsRoot
|
|
37
|
+
},
|
|
38
|
+
slotProps: {
|
|
39
|
+
root: slotsRootProps
|
|
40
|
+
},
|
|
41
|
+
componentsProps: {
|
|
42
|
+
root: componentsRootProps
|
|
30
43
|
}
|
|
31
44
|
});
|
|
45
|
+
|
|
32
46
|
// should skip non MUI components
|
|
33
47
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiBackdrop, {
|
|
34
|
-
|
|
48
|
+
components: {
|
|
49
|
+
Root: ComponentsRoot
|
|
50
|
+
}
|
|
35
51
|
});
|
|
@@ -6,33 +6,43 @@ var _material = require("@mui/material");
|
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Backdrop.default, {
|
|
8
8
|
slots: {
|
|
9
|
-
|
|
9
|
+
root: ComponentsRoot
|
|
10
|
+
},
|
|
11
|
+
slotProps: {
|
|
12
|
+
root: componentsRootProps
|
|
10
13
|
}
|
|
11
14
|
});
|
|
12
15
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Backdrop, {
|
|
16
|
+
slotProps: {
|
|
17
|
+
root: slotsRootProps
|
|
18
|
+
},
|
|
13
19
|
slots: {
|
|
14
|
-
|
|
20
|
+
root: ComponentsRoot
|
|
15
21
|
}
|
|
16
22
|
});
|
|
17
23
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Backdrop.default, {
|
|
18
24
|
slots: {
|
|
19
|
-
root:
|
|
20
|
-
|
|
25
|
+
root: SlotsRoot
|
|
26
|
+
},
|
|
27
|
+
slotProps: {
|
|
28
|
+
root: componentsRootProps
|
|
21
29
|
}
|
|
22
30
|
});
|
|
23
31
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Backdrop, {
|
|
24
32
|
slots: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
transition: SlotTransition
|
|
33
|
+
root: SlotsRoot
|
|
34
|
+
},
|
|
35
|
+
slotProps: {
|
|
36
|
+
root: {
|
|
37
|
+
...componentsRootProps,
|
|
38
|
+
...slotsRootProps
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
});
|
|
42
|
+
|
|
35
43
|
// should skip non MUI components
|
|
36
44
|
/*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiBackdrop, {
|
|
37
|
-
|
|
45
|
+
components: {
|
|
46
|
+
Root: ComponentsRoot
|
|
47
|
+
}
|
|
38
48
|
});
|
|
@@ -3,16 +3,35 @@
|
|
|
3
3
|
fn({
|
|
4
4
|
MuiBackdrop: {
|
|
5
5
|
defaultProps: {
|
|
6
|
-
|
|
6
|
+
components: {
|
|
7
|
+
Root: ComponentsRoot
|
|
8
|
+
},
|
|
9
|
+
componentsProps: {
|
|
10
|
+
root: componentsRootProps
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
fn({
|
|
16
|
+
MuiBackdrop: {
|
|
17
|
+
defaultProps: {
|
|
18
|
+
components: {
|
|
19
|
+
Root: ComponentsRoot
|
|
20
|
+
},
|
|
21
|
+
slotProps: {
|
|
22
|
+
root: slotsRootProps
|
|
23
|
+
}
|
|
7
24
|
}
|
|
8
25
|
}
|
|
9
26
|
});
|
|
10
27
|
fn({
|
|
11
28
|
MuiBackdrop: {
|
|
12
29
|
defaultProps: {
|
|
13
|
-
TransitionComponent: CustomTransition,
|
|
14
30
|
slots: {
|
|
15
|
-
root:
|
|
31
|
+
root: SlotsRoot
|
|
32
|
+
},
|
|
33
|
+
componentsProps: {
|
|
34
|
+
root: componentsRootProps
|
|
16
35
|
}
|
|
17
36
|
}
|
|
18
37
|
}
|
|
@@ -20,10 +39,17 @@ fn({
|
|
|
20
39
|
fn({
|
|
21
40
|
MuiBackdrop: {
|
|
22
41
|
defaultProps: {
|
|
23
|
-
TransitionComponent: ComponentTransition,
|
|
24
42
|
slots: {
|
|
25
|
-
root:
|
|
26
|
-
|
|
43
|
+
root: SlotsRoot
|
|
44
|
+
},
|
|
45
|
+
components: {
|
|
46
|
+
Root: ComponentsRoot
|
|
47
|
+
},
|
|
48
|
+
slotProps: {
|
|
49
|
+
root: slotsRootProps
|
|
50
|
+
},
|
|
51
|
+
componentsProps: {
|
|
52
|
+
root: componentsRootProps
|
|
27
53
|
}
|
|
28
54
|
}
|
|
29
55
|
}
|
|
@@ -4,7 +4,10 @@ fn({
|
|
|
4
4
|
MuiBackdrop: {
|
|
5
5
|
defaultProps: {
|
|
6
6
|
slots: {
|
|
7
|
-
|
|
7
|
+
root: ComponentsRoot
|
|
8
|
+
},
|
|
9
|
+
slotProps: {
|
|
10
|
+
root: componentsRootProps
|
|
8
11
|
}
|
|
9
12
|
}
|
|
10
13
|
}
|
|
@@ -12,9 +15,11 @@ fn({
|
|
|
12
15
|
fn({
|
|
13
16
|
MuiBackdrop: {
|
|
14
17
|
defaultProps: {
|
|
18
|
+
slotProps: {
|
|
19
|
+
root: slotsRootProps
|
|
20
|
+
},
|
|
15
21
|
slots: {
|
|
16
|
-
root:
|
|
17
|
-
transition: CustomTransition
|
|
22
|
+
root: ComponentsRoot
|
|
18
23
|
}
|
|
19
24
|
}
|
|
20
25
|
}
|
|
@@ -23,8 +28,25 @@ fn({
|
|
|
23
28
|
MuiBackdrop: {
|
|
24
29
|
defaultProps: {
|
|
25
30
|
slots: {
|
|
26
|
-
root:
|
|
27
|
-
|
|
31
|
+
root: SlotsRoot
|
|
32
|
+
},
|
|
33
|
+
slotProps: {
|
|
34
|
+
root: componentsRootProps
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
fn({
|
|
40
|
+
MuiBackdrop: {
|
|
41
|
+
defaultProps: {
|
|
42
|
+
slots: {
|
|
43
|
+
root: SlotsRoot
|
|
44
|
+
},
|
|
45
|
+
slotProps: {
|
|
46
|
+
root: {
|
|
47
|
+
...componentsRootProps,
|
|
48
|
+
...slotsRootProps
|
|
49
|
+
}
|
|
28
50
|
}
|
|
29
51
|
}
|
|
30
52
|
}
|
|
@@ -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: 'FilledInput'
|
|
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 _filledInputProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _filledInputProps = _interopRequireDefault(require("./filled-input-props"));
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _FilledInput = _interopRequireDefault(require("@mui/material/FilledInput"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FilledInput.default, {
|
|
7
|
+
components: {
|
|
8
|
+
Input: ComponentsInput
|
|
9
|
+
},
|
|
10
|
+
componentsProps: {
|
|
11
|
+
input: componentsInputProps
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FilledInput.default, {
|
|
15
|
+
slots: {
|
|
16
|
+
root: SlotsRoot
|
|
17
|
+
},
|
|
18
|
+
components: {
|
|
19
|
+
Input: ComponentsInput
|
|
20
|
+
},
|
|
21
|
+
slotProps: {
|
|
22
|
+
root: slotsRootProps
|
|
23
|
+
},
|
|
24
|
+
componentsProps: {
|
|
25
|
+
input: componentsInputProps
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FilledInput.default, {
|
|
29
|
+
slots: {
|
|
30
|
+
root: SlotsRoot,
|
|
31
|
+
input: SlotsInput
|
|
32
|
+
},
|
|
33
|
+
components: {
|
|
34
|
+
Input: ComponentsInput
|
|
35
|
+
},
|
|
36
|
+
slotProps: {
|
|
37
|
+
root: slotsRootProps,
|
|
38
|
+
input: slotsInputProps
|
|
39
|
+
},
|
|
40
|
+
componentsProps: {
|
|
41
|
+
input: componentsInputProps
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FilledInput.default, {
|
|
45
|
+
slots: {
|
|
46
|
+
root: SlotsRoot,
|
|
47
|
+
input: SlotsInput
|
|
48
|
+
},
|
|
49
|
+
components: {
|
|
50
|
+
Input: ComponentsInput
|
|
51
|
+
},
|
|
52
|
+
slotProps: {
|
|
53
|
+
root: slotsRootProps,
|
|
54
|
+
input: slotsInputProps
|
|
55
|
+
},
|
|
56
|
+
componentsProps: {
|
|
57
|
+
input: componentsInputProps,
|
|
58
|
+
root: componentsRootProps
|
|
59
|
+
}
|
|
60
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _FilledInput = _interopRequireDefault(require("@mui/material/FilledInput"));
|
|
5
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FilledInput.default, {
|
|
7
|
+
slots: {
|
|
8
|
+
input: ComponentsInput
|
|
9
|
+
},
|
|
10
|
+
slotProps: {
|
|
11
|
+
input: componentsInputProps
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FilledInput.default, {
|
|
15
|
+
slots: {
|
|
16
|
+
root: SlotsRoot,
|
|
17
|
+
input: ComponentsInput
|
|
18
|
+
},
|
|
19
|
+
slotProps: {
|
|
20
|
+
root: slotsRootProps,
|
|
21
|
+
input: componentsInputProps
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FilledInput.default, {
|
|
25
|
+
slots: {
|
|
26
|
+
root: SlotsRoot,
|
|
27
|
+
input: SlotsInput
|
|
28
|
+
},
|
|
29
|
+
slotProps: {
|
|
30
|
+
root: slotsRootProps,
|
|
31
|
+
input: {
|
|
32
|
+
...componentsInputProps,
|
|
33
|
+
...slotsInputProps
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_FilledInput.default, {
|
|
38
|
+
slots: {
|
|
39
|
+
root: SlotsRoot,
|
|
40
|
+
input: SlotsInput
|
|
41
|
+
},
|
|
42
|
+
slotProps: {
|
|
43
|
+
input: {
|
|
44
|
+
...componentsInputProps,
|
|
45
|
+
...slotsInputProps
|
|
46
|
+
},
|
|
47
|
+
root: {
|
|
48
|
+
...componentsRootProps,
|
|
49
|
+
...slotsRootProps
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiFilledInput: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
components: {
|
|
7
|
+
Input: ComponentsInput
|
|
8
|
+
},
|
|
9
|
+
componentsProps: {
|
|
10
|
+
input: componentsInputProps
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
fn({
|
|
16
|
+
MuiFilledInput: {
|
|
17
|
+
defaultProps: {
|
|
18
|
+
components: {
|
|
19
|
+
Input: ComponentsInput
|
|
20
|
+
},
|
|
21
|
+
slots: {
|
|
22
|
+
root: SlotsRoot
|
|
23
|
+
},
|
|
24
|
+
componentsProps: {
|
|
25
|
+
input: componentsInputProps
|
|
26
|
+
},
|
|
27
|
+
slotProps: {
|
|
28
|
+
root: slotsRootProps
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
fn({
|
|
34
|
+
MuiFilledInput: {
|
|
35
|
+
defaultProps: {
|
|
36
|
+
components: {
|
|
37
|
+
Input: ComponentsInput
|
|
38
|
+
},
|
|
39
|
+
slots: {
|
|
40
|
+
root: SlotsRoot,
|
|
41
|
+
input: SlotsInput
|
|
42
|
+
},
|
|
43
|
+
componentsProps: {
|
|
44
|
+
input: componentsInputProps
|
|
45
|
+
},
|
|
46
|
+
slotProps: {
|
|
47
|
+
root: slotsRootProps,
|
|
48
|
+
input: slotsInputProps
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
fn({
|
|
54
|
+
MuiFilledInput: {
|
|
55
|
+
defaultProps: {
|
|
56
|
+
components: {
|
|
57
|
+
Input: ComponentsInput
|
|
58
|
+
},
|
|
59
|
+
slots: {
|
|
60
|
+
root: SlotsRoot,
|
|
61
|
+
input: SlotsInput
|
|
62
|
+
},
|
|
63
|
+
componentsProps: {
|
|
64
|
+
input: componentsInputProps,
|
|
65
|
+
root: componentsRootProps
|
|
66
|
+
},
|
|
67
|
+
slotProps: {
|
|
68
|
+
root: slotsRootProps,
|
|
69
|
+
input: slotsInputProps
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiFilledInput: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
slots: {
|
|
7
|
+
input: ComponentsInput
|
|
8
|
+
},
|
|
9
|
+
slotProps: {
|
|
10
|
+
input: componentsInputProps
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
fn({
|
|
16
|
+
MuiFilledInput: {
|
|
17
|
+
defaultProps: {
|
|
18
|
+
slots: {
|
|
19
|
+
input: ComponentsInput,
|
|
20
|
+
root: SlotsRoot
|
|
21
|
+
},
|
|
22
|
+
slotProps: {
|
|
23
|
+
input: componentsInputProps,
|
|
24
|
+
root: slotsRootProps
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
fn({
|
|
30
|
+
MuiFilledInput: {
|
|
31
|
+
defaultProps: {
|
|
32
|
+
slots: {
|
|
33
|
+
input: SlotsInput,
|
|
34
|
+
root: SlotsRoot
|
|
35
|
+
},
|
|
36
|
+
slotProps: {
|
|
37
|
+
input: {
|
|
38
|
+
...componentsInputProps,
|
|
39
|
+
...slotsInputProps
|
|
40
|
+
},
|
|
41
|
+
root: slotsRootProps
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
fn({
|
|
47
|
+
MuiFilledInput: {
|
|
48
|
+
defaultProps: {
|
|
49
|
+
slots: {
|
|
50
|
+
input: SlotsInput,
|
|
51
|
+
root: SlotsRoot
|
|
52
|
+
},
|
|
53
|
+
slotProps: {
|
|
54
|
+
input: {
|
|
55
|
+
...componentsInputProps,
|
|
56
|
+
...slotsInputProps
|
|
57
|
+
},
|
|
58
|
+
root: {
|
|
59
|
+
...componentsRootProps,
|
|
60
|
+
...slotsRootProps
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
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 _findComponentJSX = _interopRequireDefault(require("../../util/findComponentJSX"));
|
|
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
|
+
const filterJSXAttr = (attr, name) => attr.type === 'JSXAttribute' && attr.name.name === name;
|
|
18
|
+
(0, _findComponentJSX.default)(j, {
|
|
19
|
+
root,
|
|
20
|
+
componentName: 'Grid'
|
|
21
|
+
}, gridElement => {
|
|
22
|
+
const attrs = gridElement.node.openingElement.attributes;
|
|
23
|
+
const wrapPropIndex = attrs.findIndex(attr => filterJSXAttr(attr, 'wrap'));
|
|
24
|
+
if (wrapPropIndex !== -1) {
|
|
25
|
+
if (attrs.findIndex(attr => filterJSXAttr(attr, 'flexWrap')) !== -1) {
|
|
26
|
+
attrs.splice(wrapPropIndex, 1);
|
|
27
|
+
} else {
|
|
28
|
+
attrs[wrapPropIndex].name.name = 'flexWrap';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
root.find(j.ObjectProperty, {
|
|
33
|
+
key: {
|
|
34
|
+
name: 'MuiGrid'
|
|
35
|
+
}
|
|
36
|
+
}).forEach(path => {
|
|
37
|
+
const defaultProps = path.value.value.properties.find(({
|
|
38
|
+
key
|
|
39
|
+
}) => key.name === 'defaultProps');
|
|
40
|
+
const props = defaultProps.value.properties;
|
|
41
|
+
const wrapPropIndex = props.findIndex(prop => prop.key.name === 'wrap');
|
|
42
|
+
if (wrapPropIndex !== -1) {
|
|
43
|
+
if (props.findIndex(prop => prop.key.name === 'flexWrap') !== -1) {
|
|
44
|
+
props.splice(wrapPropIndex, 1);
|
|
45
|
+
} else {
|
|
46
|
+
props[wrapPropIndex].key.name = 'flexWrap';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return root.toSource(printOptions);
|
|
51
|
+
}
|
|
@@ -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 _gridProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _gridProps = _interopRequireDefault(require("./grid-props"));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
8
|
+
wrap: "wrap-reverse"
|
|
9
|
+
});
|
|
10
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
11
|
+
wrap: "wrap-reverse"
|
|
12
|
+
});
|
|
13
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
14
|
+
wrap: "wrap-reverse",
|
|
15
|
+
flexWrap: "wrap"
|
|
16
|
+
});
|
|
17
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
18
|
+
wrap: "wrap-reverse",
|
|
19
|
+
flexWrap: "wrap"
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// should skip non MUI components
|
|
23
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(NonMuiGrid, {
|
|
24
|
+
wrap: "wrap-reverse"
|
|
25
|
+
});
|