@etsoo/materialui 1.5.73 → 1.5.74
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/lib/cjs/MobileListItemRenderer.d.ts +1 -1
- package/lib/cjs/MobileListItemRenderer.js +2 -2
- package/lib/cjs/ScrollerListEx.js +4 -4
- package/lib/mjs/MobileListItemRenderer.d.ts +1 -1
- package/lib/mjs/MobileListItemRenderer.js +2 -2
- package/lib/mjs/ScrollerListEx.js +4 -4
- package/package.json +1 -1
- package/src/MobileListItemRenderer.tsx +1 -2
- package/src/ScrollerListEx.tsx +3 -4
|
@@ -8,7 +8,7 @@ import { ScrollerListExItemRendererProps } from "./ScrollerListEx";
|
|
|
8
8
|
* @param renderer Renderer for card content
|
|
9
9
|
* @returns Component
|
|
10
10
|
*/
|
|
11
|
-
export declare function MobileListItemRenderer<T>({ data, margins
|
|
11
|
+
export declare function MobileListItemRenderer<T>({ data, margins }: ScrollerListExItemRendererProps<T>, renderer: (data: T) => [
|
|
12
12
|
string,
|
|
13
13
|
string | undefined,
|
|
14
14
|
React.ReactNode | (ListItemReact | boolean)[],
|
|
@@ -17,7 +17,7 @@ const CardContent_1 = __importDefault(require("@mui/material/CardContent"));
|
|
|
17
17
|
* @param renderer Renderer for card content
|
|
18
18
|
* @returns Component
|
|
19
19
|
*/
|
|
20
|
-
function MobileListItemRenderer({ data, margins
|
|
20
|
+
function MobileListItemRenderer({ data, margins }, renderer) {
|
|
21
21
|
// Loading
|
|
22
22
|
if (data == null)
|
|
23
23
|
return (0, jsx_runtime_1.jsx)(LinearProgress_1.default, {});
|
|
@@ -25,7 +25,7 @@ function MobileListItemRenderer({ data, margins, style }, renderer) {
|
|
|
25
25
|
const [title, subheader, actions, children, cardActions] = renderer(data);
|
|
26
26
|
return ((0, jsx_runtime_1.jsxs)(Card_1.default, { sx: {
|
|
27
27
|
...margins
|
|
28
|
-
},
|
|
28
|
+
}, children: [(0, jsx_runtime_1.jsx)(CardHeader_1.default, { sx: { paddingBottom: 0.5 }, action: Array.isArray(actions) ? ((0, jsx_runtime_1.jsx)(MoreFab_1.MoreFab, { iconButton: true, size: "small", anchorOrigin: {
|
|
29
29
|
vertical: "bottom",
|
|
30
30
|
horizontal: "right"
|
|
31
31
|
}, transformOrigin: {
|
|
@@ -51,8 +51,8 @@ const createGridStyle = (alternatingColors, selectedColor) => {
|
|
|
51
51
|
const defaultMargins = () => {
|
|
52
52
|
const half = MUGlobal_1.MUGlobal.half(MUGlobal_1.MUGlobal.pagePaddings);
|
|
53
53
|
return {
|
|
54
|
-
marginLeft:
|
|
55
|
-
marginRight:
|
|
54
|
+
marginLeft: 0,
|
|
55
|
+
marginRight: 0,
|
|
56
56
|
marginTop: half,
|
|
57
57
|
marginBottom: half
|
|
58
58
|
};
|
|
@@ -84,9 +84,9 @@ function ScrollerListEx(props) {
|
|
|
84
84
|
return selected;
|
|
85
85
|
};
|
|
86
86
|
// Destruct
|
|
87
|
-
const { alternatingColors = [undefined, undefined], className, cacheKey, cacheMinutes = 15, cellMargins = defaultMargins(), idField = "id", itemRenderer = ({ data, margins
|
|
87
|
+
const { alternatingColors = [undefined, undefined], className, cacheKey, cacheMinutes = 15, cellMargins = defaultMargins(), idField = "id", itemRenderer = ({ data, margins }) => ((0, jsx_runtime_1.jsx)(Box_1.default, { component: "pre", sx: {
|
|
88
88
|
...margins
|
|
89
|
-
},
|
|
89
|
+
}, children: JSON.stringify(data) })), onClick, onDoubleClick, onUpdateRows, onSelectChange, rowHeight = 116, selectedColor = "#edf4fb", ...rest } = props;
|
|
90
90
|
// Init handler
|
|
91
91
|
const initHandler = (0, useListCacheInitLoad_1.useListCacheInitLoad)(cacheKey, cacheMinutes);
|
|
92
92
|
const onUpdateRowsHandler = react_2.default.useCallback((rows, state) => {
|
|
@@ -8,7 +8,7 @@ import { ScrollerListExItemRendererProps } from "./ScrollerListEx";
|
|
|
8
8
|
* @param renderer Renderer for card content
|
|
9
9
|
* @returns Component
|
|
10
10
|
*/
|
|
11
|
-
export declare function MobileListItemRenderer<T>({ data, margins
|
|
11
|
+
export declare function MobileListItemRenderer<T>({ data, margins }: ScrollerListExItemRendererProps<T>, renderer: (data: T) => [
|
|
12
12
|
string,
|
|
13
13
|
string | undefined,
|
|
14
14
|
React.ReactNode | (ListItemReact | boolean)[],
|
|
@@ -11,7 +11,7 @@ import CardContent from "@mui/material/CardContent";
|
|
|
11
11
|
* @param renderer Renderer for card content
|
|
12
12
|
* @returns Component
|
|
13
13
|
*/
|
|
14
|
-
export function MobileListItemRenderer({ data, margins
|
|
14
|
+
export function MobileListItemRenderer({ data, margins }, renderer) {
|
|
15
15
|
// Loading
|
|
16
16
|
if (data == null)
|
|
17
17
|
return _jsx(LinearProgress, {});
|
|
@@ -19,7 +19,7 @@ export function MobileListItemRenderer({ data, margins, style }, renderer) {
|
|
|
19
19
|
const [title, subheader, actions, children, cardActions] = renderer(data);
|
|
20
20
|
return (_jsxs(Card, { sx: {
|
|
21
21
|
...margins
|
|
22
|
-
},
|
|
22
|
+
}, children: [_jsx(CardHeader, { sx: { paddingBottom: 0.5 }, action: Array.isArray(actions) ? (_jsx(MoreFab, { iconButton: true, size: "small", anchorOrigin: {
|
|
23
23
|
vertical: "bottom",
|
|
24
24
|
horizontal: "right"
|
|
25
25
|
}, transformOrigin: {
|
|
@@ -45,8 +45,8 @@ const createGridStyle = (alternatingColors, selectedColor) => {
|
|
|
45
45
|
const defaultMargins = () => {
|
|
46
46
|
const half = MUGlobal.half(MUGlobal.pagePaddings);
|
|
47
47
|
return {
|
|
48
|
-
marginLeft:
|
|
49
|
-
marginRight:
|
|
48
|
+
marginLeft: 0,
|
|
49
|
+
marginRight: 0,
|
|
50
50
|
marginTop: half,
|
|
51
51
|
marginBottom: half
|
|
52
52
|
};
|
|
@@ -78,9 +78,9 @@ export function ScrollerListEx(props) {
|
|
|
78
78
|
return selected;
|
|
79
79
|
};
|
|
80
80
|
// Destruct
|
|
81
|
-
const { alternatingColors = [undefined, undefined], className, cacheKey, cacheMinutes = 15, cellMargins = defaultMargins(), idField = "id", itemRenderer = ({ data, margins
|
|
81
|
+
const { alternatingColors = [undefined, undefined], className, cacheKey, cacheMinutes = 15, cellMargins = defaultMargins(), idField = "id", itemRenderer = ({ data, margins }) => (_jsx(Box, { component: "pre", sx: {
|
|
82
82
|
...margins
|
|
83
|
-
},
|
|
83
|
+
}, children: JSON.stringify(data) })), onClick, onDoubleClick, onUpdateRows, onSelectChange, rowHeight = 116, selectedColor = "#edf4fb", ...rest } = props;
|
|
84
84
|
// Init handler
|
|
85
85
|
const initHandler = useListCacheInitLoad(cacheKey, cacheMinutes);
|
|
86
86
|
const onUpdateRowsHandler = React.useCallback((rows, state) => {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ import { ScrollerListExItemRendererProps } from "./ScrollerListEx";
|
|
|
15
15
|
* @returns Component
|
|
16
16
|
*/
|
|
17
17
|
export function MobileListItemRenderer<T>(
|
|
18
|
-
{ data, margins
|
|
18
|
+
{ data, margins }: ScrollerListExItemRendererProps<T>,
|
|
19
19
|
renderer: (
|
|
20
20
|
data: T
|
|
21
21
|
) => [
|
|
@@ -37,7 +37,6 @@ export function MobileListItemRenderer<T>(
|
|
|
37
37
|
sx={{
|
|
38
38
|
...margins
|
|
39
39
|
}}
|
|
40
|
-
style={style}
|
|
41
40
|
>
|
|
42
41
|
<CardHeader
|
|
43
42
|
sx={{ paddingBottom: 0.5 }}
|
package/src/ScrollerListEx.tsx
CHANGED
|
@@ -56,8 +56,8 @@ const defaultMargins = () => {
|
|
|
56
56
|
const half = MUGlobal.half(MUGlobal.pagePaddings);
|
|
57
57
|
|
|
58
58
|
return {
|
|
59
|
-
marginLeft:
|
|
60
|
-
marginRight:
|
|
59
|
+
marginLeft: 0,
|
|
60
|
+
marginRight: 0,
|
|
61
61
|
marginTop: half,
|
|
62
62
|
marginBottom: half
|
|
63
63
|
};
|
|
@@ -192,13 +192,12 @@ export function ScrollerListEx<T extends object>(
|
|
|
192
192
|
cacheMinutes = 15,
|
|
193
193
|
cellMargins = defaultMargins(),
|
|
194
194
|
idField = "id" as DataTypes.Keys<T>,
|
|
195
|
-
itemRenderer = ({ data, margins
|
|
195
|
+
itemRenderer = ({ data, margins }) => (
|
|
196
196
|
<Box
|
|
197
197
|
component="pre"
|
|
198
198
|
sx={{
|
|
199
199
|
...margins
|
|
200
200
|
}}
|
|
201
|
-
style={style}
|
|
202
201
|
>
|
|
203
202
|
{JSON.stringify(data)}
|
|
204
203
|
</Box>
|