@etsoo/materialui 1.5.0 → 1.5.2
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/GridDataFormat.js +3 -0
- package/lib/cjs/ViewContainer.js +4 -2
- package/lib/cjs/pages/ViewPage.js +1 -5
- package/lib/mjs/GridDataFormat.js +3 -0
- package/lib/mjs/ViewContainer.js +4 -2
- package/lib/mjs/pages/ViewPage.js +1 -5
- package/package.json +2 -2
- package/src/GridDataFormat.tsx +3 -0
- package/src/ViewContainer.tsx +3 -3
- package/src/pages/ViewPage.tsx +1 -5
|
@@ -40,6 +40,9 @@ function GridDataFormat(data, type, renderProps) {
|
|
|
40
40
|
else
|
|
41
41
|
return shared_1.NumberUtils.format(data, renderProps?.culture, renderProps?.numberFormatOptions);
|
|
42
42
|
}
|
|
43
|
+
// Array
|
|
44
|
+
if (Array.isArray(data))
|
|
45
|
+
return data.join(", ");
|
|
43
46
|
if (typeof data === "string")
|
|
44
47
|
return data;
|
|
45
48
|
return `${data}`;
|
package/lib/cjs/ViewContainer.js
CHANGED
|
@@ -21,6 +21,8 @@ function formatItemData(app, fieldData) {
|
|
|
21
21
|
return fieldData;
|
|
22
22
|
if (fieldData instanceof Date)
|
|
23
23
|
return app.formatDate(fieldData, "d");
|
|
24
|
+
if (Array.isArray(fieldData))
|
|
25
|
+
return fieldData.join(", ");
|
|
24
26
|
return `${fieldData}`;
|
|
25
27
|
}
|
|
26
28
|
function getResp(singleRow) {
|
|
@@ -162,7 +164,7 @@ function ViewContainer(props) {
|
|
|
162
164
|
// Global app
|
|
163
165
|
const app = (0, ReactApp_1.useRequiredAppContext)();
|
|
164
166
|
// Destruct
|
|
165
|
-
const { data, fields, gridRef, leftContainer, leftContainerLines = 3, leftContainerProps = {}, refresh, spacing = MUGlobal_1.MUGlobal.half(MUGlobal_1.MUGlobal.pagePaddings)
|
|
167
|
+
const { data, fields, gridRef, leftContainer, leftContainerLines = 3, leftContainerProps = {}, refresh, spacing = MUGlobal_1.MUGlobal.half(MUGlobal_1.MUGlobal.pagePaddings) } = props;
|
|
166
168
|
// Left container
|
|
167
169
|
const { size = ViewPageSize.smallLine, ...leftContainerPropsRest } = leftContainerProps;
|
|
168
170
|
// Current breakpoint
|
|
@@ -226,5 +228,5 @@ function ViewContainer(props) {
|
|
|
226
228
|
}, [app, fields, data, bp]);
|
|
227
229
|
let leftResult;
|
|
228
230
|
// Layout
|
|
229
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Grid2, { container: true, justifyContent: "left", className: "ET-
|
|
231
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Grid2, { container: true, justifyContent: "left", className: "ET-ViewContainer", ref: gridRef, spacing: spacing, children: [leftContainer && (leftResult = leftContainer(data)) != null && ((0, jsx_runtime_1.jsxs)(react_2.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, className: "ET-ViewPage-LeftContainer", spacing: spacing, size: size, ...leftContainerPropsRest, children: leftResult }), (0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, className: "ET-ViewPage-LeftOthers", spacing: spacing, size: ViewPageSize.matchSize(size), children: createFields(data, leftContainerLines * (12 - getItemSize(bp, size))) })] })), createFields(data)] }));
|
|
230
232
|
}
|
|
@@ -44,11 +44,7 @@ function ViewPage(props) {
|
|
|
44
44
|
MessageUtils_1.MessageUtils.offRefresh(refreshHandler);
|
|
45
45
|
};
|
|
46
46
|
}, [refresh]);
|
|
47
|
-
return ((0, jsx_runtime_1.jsx)(CommonPage_1.CommonPage, { paddings: paddings, onRefresh: supportRefresh ? refresh : undefined, onUpdate: supportRefresh ? undefined : refresh,
|
|
48
|
-
".MuiTypography-subtitle2": {
|
|
49
|
-
fontWeight: "bold"
|
|
50
|
-
}
|
|
51
|
-
}, ...rest, scrollContainer: globalThis, fabColumnDirection: fabColumnDirection, fabTop: fabTop, supportBack: supportBack, children: data == null ? ((0, jsx_runtime_1.jsx)(material_1.LinearProgress, {})) : ((0, jsx_runtime_1.jsxs)(react_2.default.Fragment, { children: [operationMessageHandler && ((0, jsx_runtime_1.jsx)(OperationMessageContainer_1.OperationMessageContainer, { handler: "id" in operationMessageHandler
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(CommonPage_1.CommonPage, { paddings: paddings, onRefresh: supportRefresh ? refresh : undefined, onUpdate: supportRefresh ? undefined : refresh, className: "ET-ViewPage", ...rest, scrollContainer: globalThis, fabColumnDirection: fabColumnDirection, fabTop: fabTop, supportBack: supportBack, children: data == null ? ((0, jsx_runtime_1.jsx)(material_1.LinearProgress, {})) : ((0, jsx_runtime_1.jsxs)(react_2.default.Fragment, { children: [operationMessageHandler && ((0, jsx_runtime_1.jsx)(OperationMessageContainer_1.OperationMessageContainer, { handler: "id" in operationMessageHandler
|
|
52
48
|
? [
|
|
53
49
|
operationMessageHandler.types,
|
|
54
50
|
refresh,
|
|
@@ -37,6 +37,9 @@ export function GridDataFormat(data, type, renderProps) {
|
|
|
37
37
|
else
|
|
38
38
|
return NumberUtils.format(data, renderProps?.culture, renderProps?.numberFormatOptions);
|
|
39
39
|
}
|
|
40
|
+
// Array
|
|
41
|
+
if (Array.isArray(data))
|
|
42
|
+
return data.join(", ");
|
|
40
43
|
if (typeof data === "string")
|
|
41
44
|
return data;
|
|
42
45
|
return `${data}`;
|
package/lib/mjs/ViewContainer.js
CHANGED
|
@@ -13,6 +13,8 @@ function formatItemData(app, fieldData) {
|
|
|
13
13
|
return fieldData;
|
|
14
14
|
if (fieldData instanceof Date)
|
|
15
15
|
return app.formatDate(fieldData, "d");
|
|
16
|
+
if (Array.isArray(fieldData))
|
|
17
|
+
return fieldData.join(", ");
|
|
16
18
|
return `${fieldData}`;
|
|
17
19
|
}
|
|
18
20
|
function getResp(singleRow) {
|
|
@@ -154,7 +156,7 @@ export function ViewContainer(props) {
|
|
|
154
156
|
// Global app
|
|
155
157
|
const app = useRequiredAppContext();
|
|
156
158
|
// Destruct
|
|
157
|
-
const { data, fields, gridRef, leftContainer, leftContainerLines = 3, leftContainerProps = {}, refresh, spacing = MUGlobal.half(MUGlobal.pagePaddings)
|
|
159
|
+
const { data, fields, gridRef, leftContainer, leftContainerLines = 3, leftContainerProps = {}, refresh, spacing = MUGlobal.half(MUGlobal.pagePaddings) } = props;
|
|
158
160
|
// Left container
|
|
159
161
|
const { size = ViewPageSize.smallLine, ...leftContainerPropsRest } = leftContainerProps;
|
|
160
162
|
// Current breakpoint
|
|
@@ -218,5 +220,5 @@ export function ViewContainer(props) {
|
|
|
218
220
|
}, [app, fields, data, bp]);
|
|
219
221
|
let leftResult;
|
|
220
222
|
// Layout
|
|
221
|
-
return (_jsxs(Grid2, { container: true, justifyContent: "left", className: "ET-
|
|
223
|
+
return (_jsxs(Grid2, { container: true, justifyContent: "left", className: "ET-ViewContainer", ref: gridRef, spacing: spacing, children: [leftContainer && (leftResult = leftContainer(data)) != null && (_jsxs(React.Fragment, { children: [_jsx(Grid2, { container: true, className: "ET-ViewPage-LeftContainer", spacing: spacing, size: size, ...leftContainerPropsRest, children: leftResult }), _jsx(Grid2, { container: true, className: "ET-ViewPage-LeftOthers", spacing: spacing, size: ViewPageSize.matchSize(size), children: createFields(data, leftContainerLines * (12 - getItemSize(bp, size))) })] })), createFields(data)] }));
|
|
222
224
|
}
|
|
@@ -38,11 +38,7 @@ export function ViewPage(props) {
|
|
|
38
38
|
MessageUtils.offRefresh(refreshHandler);
|
|
39
39
|
};
|
|
40
40
|
}, [refresh]);
|
|
41
|
-
return (_jsx(CommonPage, { paddings: paddings, onRefresh: supportRefresh ? refresh : undefined, onUpdate: supportRefresh ? undefined : refresh,
|
|
42
|
-
".MuiTypography-subtitle2": {
|
|
43
|
-
fontWeight: "bold"
|
|
44
|
-
}
|
|
45
|
-
}, ...rest, scrollContainer: globalThis, fabColumnDirection: fabColumnDirection, fabTop: fabTop, supportBack: supportBack, children: data == null ? (_jsx(LinearProgress, {})) : (_jsxs(React.Fragment, { children: [operationMessageHandler && (_jsx(OperationMessageContainer, { handler: "id" in operationMessageHandler
|
|
41
|
+
return (_jsx(CommonPage, { paddings: paddings, onRefresh: supportRefresh ? refresh : undefined, onUpdate: supportRefresh ? undefined : refresh, className: "ET-ViewPage", ...rest, scrollContainer: globalThis, fabColumnDirection: fabColumnDirection, fabTop: fabTop, supportBack: supportBack, children: data == null ? (_jsx(LinearProgress, {})) : (_jsxs(React.Fragment, { children: [operationMessageHandler && (_jsx(OperationMessageContainer, { handler: "id" in operationMessageHandler
|
|
46
42
|
? [
|
|
47
43
|
operationMessageHandler.types,
|
|
48
44
|
refresh,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@etsoo/shared": "^1.2.63",
|
|
47
47
|
"@mui/icons-material": "^6.4.8",
|
|
48
48
|
"@mui/material": "^6.4.8",
|
|
49
|
-
"@mui/x-data-grid": "^7.28.
|
|
49
|
+
"@mui/x-data-grid": "^7.28.1",
|
|
50
50
|
"chart.js": "^4.4.8",
|
|
51
51
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
52
52
|
"eventemitter3": "^5.0.1",
|
package/src/GridDataFormat.tsx
CHANGED
package/src/ViewContainer.tsx
CHANGED
|
@@ -14,6 +14,7 @@ function formatItemData(
|
|
|
14
14
|
if (fieldData == null) return undefined;
|
|
15
15
|
if (typeof fieldData === "string") return fieldData;
|
|
16
16
|
if (fieldData instanceof Date) return app.formatDate(fieldData, "d");
|
|
17
|
+
if (Array.isArray(fieldData)) return fieldData.join(", ");
|
|
17
18
|
return `${fieldData}`;
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -315,8 +316,7 @@ export function ViewContainer<T extends DataTypes.StringRecord>(
|
|
|
315
316
|
leftContainerLines = 3,
|
|
316
317
|
leftContainerProps = {},
|
|
317
318
|
refresh,
|
|
318
|
-
spacing = MUGlobal.half(MUGlobal.pagePaddings)
|
|
319
|
-
...rest
|
|
319
|
+
spacing = MUGlobal.half(MUGlobal.pagePaddings)
|
|
320
320
|
} = props;
|
|
321
321
|
|
|
322
322
|
// Left container
|
|
@@ -403,7 +403,7 @@ export function ViewContainer<T extends DataTypes.StringRecord>(
|
|
|
403
403
|
<Grid2
|
|
404
404
|
container
|
|
405
405
|
justifyContent="left"
|
|
406
|
-
className="ET-
|
|
406
|
+
className="ET-ViewContainer"
|
|
407
407
|
ref={gridRef}
|
|
408
408
|
spacing={spacing}
|
|
409
409
|
>
|
package/src/pages/ViewPage.tsx
CHANGED
|
@@ -129,11 +129,7 @@ export function ViewPage<T extends DataTypes.StringRecord>(
|
|
|
129
129
|
paddings={paddings}
|
|
130
130
|
onRefresh={supportRefresh ? refresh : undefined}
|
|
131
131
|
onUpdate={supportRefresh ? undefined : refresh}
|
|
132
|
-
|
|
133
|
-
".MuiTypography-subtitle2": {
|
|
134
|
-
fontWeight: "bold"
|
|
135
|
-
}
|
|
136
|
-
}}
|
|
132
|
+
className="ET-ViewPage"
|
|
137
133
|
{...rest}
|
|
138
134
|
scrollContainer={globalThis}
|
|
139
135
|
fabColumnDirection={fabColumnDirection}
|