@etsoo/materialui 1.0.89 → 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.
@@ -32,7 +32,7 @@ function getResp(singleRow) {
32
32
  };
33
33
  }
34
34
  function getItemField(field, data) {
35
- var _a, _b, _c;
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
- : (_b = globalApp.get(fieldLabel !== null && fieldLabel !== void 0 ? fieldLabel : (typeof fieldData === 'string' ? fieldData : 'noData'))) !== null && _b !== void 0 ? _b : fieldLabel;
62
+ : fieldLabel != null
63
+ ? globalApp.get(fieldLabel)
64
+ : fieldLabel;
63
65
  }
64
66
  else {
65
67
  itemData = formatItemData(data[field]);
66
- itemLabel = (_c = globalApp.get(field)) !== null && _c !== void 0 ? _c : field;
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.89",
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",
@@ -53,10 +53,10 @@
53
53
  "@emotion/styled": "^11.10.5",
54
54
  "@etsoo/appscript": "^1.3.41",
55
55
  "@etsoo/notificationbase": "^1.1.18",
56
- "@etsoo/react": "^1.6.31",
56
+ "@etsoo/react": "^1.6.32",
57
57
  "@etsoo/shared": "^1.1.78",
58
- "@mui/icons-material": "^5.10.15",
59
- "@mui/material": "^5.10.15",
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",
@@ -76,15 +76,15 @@
76
76
  },
77
77
  "devDependencies": {
78
78
  "@babel/cli": "^7.19.3",
79
- "@babel/core": "^7.20.2",
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.1",
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.44.0",
87
- "@typescript-eslint/parser": "^5.44.0",
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",
@@ -170,10 +170,9 @@ function getItemField<T extends object>(
170
170
  itemLabel =
171
171
  typeof fieldLabel === 'function'
172
172
  ? fieldLabel()
173
- : globalApp.get<string>(
174
- fieldLabel ??
175
- (typeof fieldData === 'string' ? fieldData : 'noData')
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
- <Typography
267
- variant="caption"
268
- component="div"
269
- >
270
- {itemLabel}:
271
- </Typography>
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
  ) : (