@etsoo/react 1.4.36 → 1.4.37
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.
|
@@ -25,30 +25,26 @@ export function MobileListItemRenderer({ data, itemHeight }, margin, renderer) {
|
|
|
25
25
|
return React.createElement(LinearProgress, null);
|
|
26
26
|
// Elements
|
|
27
27
|
const [title, subheader, actions, children] = renderer(data);
|
|
28
|
-
//
|
|
29
|
-
//const halfMargin = MUGlobal.half(margin);
|
|
30
|
-
//const nMargin = MUGlobal.reverse(margin);
|
|
28
|
+
// Calculate margin
|
|
31
29
|
const calculateMargin = () => {
|
|
32
30
|
if (typeof margin === 'function')
|
|
33
31
|
return margin();
|
|
34
32
|
if (Array.isArray(margin)) {
|
|
35
33
|
const marginValue = margin[0];
|
|
36
34
|
const isNarrow = margin[1];
|
|
37
|
-
const nMargin = MUGlobal.reverse(marginValue);
|
|
38
35
|
const half = MUGlobal.half(marginValue);
|
|
39
36
|
if (isNarrow) {
|
|
40
|
-
const nHalf = MUGlobal.reverse(half);
|
|
41
37
|
return {
|
|
42
|
-
marginLeft:
|
|
43
|
-
marginRight:
|
|
38
|
+
marginLeft: 0,
|
|
39
|
+
marginRight: 0,
|
|
44
40
|
marginTop: half,
|
|
45
41
|
marginBottom: half
|
|
46
42
|
};
|
|
47
43
|
}
|
|
48
44
|
else {
|
|
49
45
|
return {
|
|
50
|
-
marginLeft:
|
|
51
|
-
marginRight:
|
|
46
|
+
marginLeft: half,
|
|
47
|
+
marginRight: half,
|
|
52
48
|
marginTop: half,
|
|
53
49
|
marginBottom: half
|
|
54
50
|
};
|
|
@@ -98,5 +94,10 @@ export function MobileListItemRenderer({ data, itemHeight }, margin, renderer) {
|
|
|
98
94
|
}
|
|
99
95
|
}
|
|
100
96
|
} })) : (actions), title: title, titleTypographyProps: { variant: 'body2' }, subheader: subheader, subheaderTypographyProps: { variant: 'caption' } }),
|
|
101
|
-
React.createElement(CardContent, { sx: {
|
|
97
|
+
React.createElement(CardContent, { sx: {
|
|
98
|
+
paddingTop: 0,
|
|
99
|
+
'&:last-child': {
|
|
100
|
+
paddingBottom: 0 // default 24px
|
|
101
|
+
}
|
|
102
|
+
} }, children)));
|
|
102
103
|
}
|
package/package.json
CHANGED
|
@@ -47,28 +47,24 @@ export function MobileListItemRenderer<T>(
|
|
|
47
47
|
// Elements
|
|
48
48
|
const [title, subheader, actions, children] = renderer(data);
|
|
49
49
|
|
|
50
|
-
//
|
|
51
|
-
//const halfMargin = MUGlobal.half(margin);
|
|
52
|
-
//const nMargin = MUGlobal.reverse(margin);
|
|
50
|
+
// Calculate margin
|
|
53
51
|
const calculateMargin = () => {
|
|
54
52
|
if (typeof margin === 'function') return margin();
|
|
55
53
|
if (Array.isArray(margin)) {
|
|
56
54
|
const marginValue = margin[0];
|
|
57
55
|
const isNarrow = margin[1];
|
|
58
|
-
const nMargin = MUGlobal.reverse(marginValue);
|
|
59
56
|
const half = MUGlobal.half(marginValue);
|
|
60
57
|
if (isNarrow) {
|
|
61
|
-
const nHalf = MUGlobal.reverse(half);
|
|
62
58
|
return {
|
|
63
|
-
marginLeft:
|
|
64
|
-
marginRight:
|
|
59
|
+
marginLeft: 0,
|
|
60
|
+
marginRight: 0,
|
|
65
61
|
marginTop: half,
|
|
66
62
|
marginBottom: half
|
|
67
63
|
};
|
|
68
64
|
} else {
|
|
69
65
|
return {
|
|
70
|
-
marginLeft:
|
|
71
|
-
marginRight:
|
|
66
|
+
marginLeft: half,
|
|
67
|
+
marginRight: half,
|
|
72
68
|
marginTop: half,
|
|
73
69
|
marginBottom: half
|
|
74
70
|
};
|
|
@@ -145,7 +141,16 @@ export function MobileListItemRenderer<T>(
|
|
|
145
141
|
subheader={subheader}
|
|
146
142
|
subheaderTypographyProps={{ variant: 'caption' }}
|
|
147
143
|
/>
|
|
148
|
-
<CardContent
|
|
144
|
+
<CardContent
|
|
145
|
+
sx={{
|
|
146
|
+
paddingTop: 0,
|
|
147
|
+
'&:last-child': {
|
|
148
|
+
paddingBottom: 0 // default 24px
|
|
149
|
+
}
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
{children}
|
|
153
|
+
</CardContent>
|
|
149
154
|
</Card>
|
|
150
155
|
);
|
|
151
156
|
}
|