@etsoo/materialui 1.0.90 → 1.0.91
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/pages/ViewPage.js +7 -5
- package/package.json +6 -6
- package/src/pages/ViewPage.tsx +11 -10
package/lib/pages/ViewPage.js
CHANGED
|
@@ -32,7 +32,7 @@ function getResp(singleRow) {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
function getItemField(field, data) {
|
|
35
|
-
var _a, _b
|
|
35
|
+
var _a, _b;
|
|
36
36
|
// Item data and label
|
|
37
37
|
let itemData, itemLabel, gridProps = {};
|
|
38
38
|
if (Array.isArray(field)) {
|
|
@@ -59,11 +59,13 @@ function getItemField(field, data) {
|
|
|
59
59
|
itemLabel =
|
|
60
60
|
typeof fieldLabel === 'function'
|
|
61
61
|
? fieldLabel()
|
|
62
|
-
:
|
|
62
|
+
: fieldLabel != null
|
|
63
|
+
? globalApp.get(fieldLabel)
|
|
64
|
+
: fieldLabel;
|
|
63
65
|
}
|
|
64
66
|
else {
|
|
65
67
|
itemData = formatItemData(data[field]);
|
|
66
|
-
itemLabel = (
|
|
68
|
+
itemLabel = (_b = globalApp.get(field)) !== null && _b !== void 0 ? _b : field;
|
|
67
69
|
}
|
|
68
70
|
return [itemData, itemLabel, gridProps];
|
|
69
71
|
}
|
|
@@ -104,9 +106,9 @@ export function ViewPage(props) {
|
|
|
104
106
|
return undefined;
|
|
105
107
|
// Layout
|
|
106
108
|
return (React.createElement(Grid, { item: true, ...gridProps, key: index },
|
|
107
|
-
React.createElement(Typography, { variant: "caption", component: "div" },
|
|
109
|
+
itemLabel != null && (React.createElement(Typography, { variant: "caption", component: "div" },
|
|
108
110
|
itemLabel,
|
|
109
|
-
":"),
|
|
111
|
+
":")),
|
|
110
112
|
typeof itemData === 'object' ? (itemData) : (React.createElement(Typography, { variant: "subtitle2" }, itemData))));
|
|
111
113
|
})),
|
|
112
114
|
React.createElement(Stack, { className: "ET-ViewPage-Actions", direction: "row", width: "100%", flexWrap: "wrap", justifyContent: "flex-end", paddingTop: actions == null ? undefined : paddings, paddingBottom: paddings, gap: paddings }, actions != null &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.91",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"@etsoo/notificationbase": "^1.1.18",
|
|
56
56
|
"@etsoo/react": "^1.6.32",
|
|
57
57
|
"@etsoo/shared": "^1.1.78",
|
|
58
|
-
"@mui/icons-material": "^5.10.
|
|
59
|
-
"@mui/material": "^5.10.
|
|
58
|
+
"@mui/icons-material": "^5.10.16",
|
|
59
|
+
"@mui/material": "^5.10.16",
|
|
60
60
|
"@types/pica": "^9.0.1",
|
|
61
61
|
"@types/pulltorefreshjs": "^0.1.5",
|
|
62
62
|
"@types/react": "^18.0.25",
|
|
@@ -79,12 +79,12 @@
|
|
|
79
79
|
"@babel/core": "^7.20.5",
|
|
80
80
|
"@babel/plugin-transform-runtime": "^7.19.6",
|
|
81
81
|
"@babel/preset-env": "^7.20.2",
|
|
82
|
-
"@babel/runtime-corejs3": "^7.20.
|
|
82
|
+
"@babel/runtime-corejs3": "^7.20.6",
|
|
83
83
|
"@testing-library/jest-dom": "^5.16.5",
|
|
84
84
|
"@testing-library/react": "^13.4.0",
|
|
85
85
|
"@types/jest": "^29.2.3",
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
87
|
-
"@typescript-eslint/parser": "^5.
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
87
|
+
"@typescript-eslint/parser": "^5.45.0",
|
|
88
88
|
"eslint": "^8.28.0",
|
|
89
89
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
90
90
|
"eslint-plugin-import": "^2.26.0",
|
package/src/pages/ViewPage.tsx
CHANGED
|
@@ -170,10 +170,9 @@ function getItemField<T extends object>(
|
|
|
170
170
|
itemLabel =
|
|
171
171
|
typeof fieldLabel === 'function'
|
|
172
172
|
? fieldLabel()
|
|
173
|
-
:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
) ?? fieldLabel;
|
|
173
|
+
: fieldLabel != null
|
|
174
|
+
? globalApp.get<string>(fieldLabel)
|
|
175
|
+
: fieldLabel;
|
|
177
176
|
} else {
|
|
178
177
|
itemData = formatItemData(data[field]);
|
|
179
178
|
itemLabel = globalApp.get<string>(field) ?? field;
|
|
@@ -263,12 +262,14 @@ export function ViewPage<T extends DataTypes.StringRecord>(
|
|
|
263
262
|
// Layout
|
|
264
263
|
return (
|
|
265
264
|
<Grid item {...gridProps} key={index}>
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
265
|
+
{itemLabel != null && (
|
|
266
|
+
<Typography
|
|
267
|
+
variant="caption"
|
|
268
|
+
component="div"
|
|
269
|
+
>
|
|
270
|
+
{itemLabel}:
|
|
271
|
+
</Typography>
|
|
272
|
+
)}
|
|
272
273
|
{typeof itemData === 'object' ? (
|
|
273
274
|
itemData
|
|
274
275
|
) : (
|