@etsoo/materialui 1.5.65 → 1.5.66

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.
@@ -40,13 +40,16 @@ function getResp(singleRow) {
40
40
  : ViewPageSize.small;
41
41
  return size;
42
42
  }
43
+ function addLabelEnd(label) {
44
+ return label + ":";
45
+ }
43
46
  function getItemField(app, field, data) {
44
47
  // Item data and label
45
48
  let itemData, itemLabel, gridProps = {}, size, isHorizontal;
46
49
  if (Array.isArray(field)) {
47
50
  const [fieldData, fieldType, renderProps, singleRow = "small"] = field;
48
51
  itemData = (0, GridDataFormat_1.GridDataFormat)(data[fieldData], fieldType, renderProps);
49
- itemLabel = app.get(fieldData) ?? fieldData;
52
+ itemLabel = addLabelEnd(app.get(fieldData) ?? fieldData);
50
53
  size = getResp(singleRow);
51
54
  gridProps = { size };
52
55
  }
@@ -73,17 +76,17 @@ function getItemField(app, field, data) {
73
76
  fieldLabel === ""
74
77
  ? undefined
75
78
  : fieldLabel == null && typeof fieldData === "string"
76
- ? app.get(fieldData) ?? fieldData
79
+ ? addLabelEnd(app.get(fieldData) ?? fieldData)
77
80
  : typeof fieldLabel === "function"
78
81
  ? fieldLabel(data)
79
82
  : fieldLabel != null
80
- ? app.get(fieldLabel) ?? fieldLabel
83
+ ? addLabelEnd(app.get(fieldLabel) ?? fieldLabel)
81
84
  : undefined;
82
85
  }
83
86
  else {
84
87
  // Single field format
85
88
  itemData = formatItemData(app, data[field]);
86
- itemLabel = app.get(field) ?? field;
89
+ itemLabel = addLabelEnd(app.get(field) ?? field);
87
90
  size = ViewPageSize.small;
88
91
  gridProps = { size };
89
92
  }
@@ -161,7 +164,7 @@ function ViewPageGridItem(props) {
161
164
  options = getResp(singleRow ?? "small");
162
165
  }
163
166
  // Layout
164
- return ((0, jsx_runtime_1.jsxs)(Grid_1.default, { ...gridProps, ...options, children: [label != null && ((0, jsx_runtime_1.jsxs)(Typography_1.default, { variant: "caption", component: horizontal ? "span" : "div", children: [label, ":"] })), typeof data === "object" ? (data) : horizontal ? ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "subtitle2", component: "span", marginLeft: 0.5, children: data })) : ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "subtitle2", children: data }))] }));
167
+ return ((0, jsx_runtime_1.jsxs)(Grid_1.default, { ...gridProps, ...options, children: [label != null && ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "caption", component: horizontal ? "span" : "div", children: label })), typeof data === "object" ? (data) : horizontal ? ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "subtitle2", component: "span", marginLeft: 0.5, children: data })) : ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "subtitle2", children: data }))] }));
165
168
  }
166
169
  function ViewContainer(props) {
167
170
  // Global app
@@ -1,5 +1,5 @@
1
1
  import { createElement as _createElement } from "react";
2
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { MUGlobal } from "./MUGlobal";
5
5
  import { useCurrentBreakpoint } from "./useCurrentBreakpoint";
@@ -32,13 +32,16 @@ function getResp(singleRow) {
32
32
  : ViewPageSize.small;
33
33
  return size;
34
34
  }
35
+ function addLabelEnd(label) {
36
+ return label + ":";
37
+ }
35
38
  function getItemField(app, field, data) {
36
39
  // Item data and label
37
40
  let itemData, itemLabel, gridProps = {}, size, isHorizontal;
38
41
  if (Array.isArray(field)) {
39
42
  const [fieldData, fieldType, renderProps, singleRow = "small"] = field;
40
43
  itemData = GridDataFormat(data[fieldData], fieldType, renderProps);
41
- itemLabel = app.get(fieldData) ?? fieldData;
44
+ itemLabel = addLabelEnd(app.get(fieldData) ?? fieldData);
42
45
  size = getResp(singleRow);
43
46
  gridProps = { size };
44
47
  }
@@ -65,17 +68,17 @@ function getItemField(app, field, data) {
65
68
  fieldLabel === ""
66
69
  ? undefined
67
70
  : fieldLabel == null && typeof fieldData === "string"
68
- ? app.get(fieldData) ?? fieldData
71
+ ? addLabelEnd(app.get(fieldData) ?? fieldData)
69
72
  : typeof fieldLabel === "function"
70
73
  ? fieldLabel(data)
71
74
  : fieldLabel != null
72
- ? app.get(fieldLabel) ?? fieldLabel
75
+ ? addLabelEnd(app.get(fieldLabel) ?? fieldLabel)
73
76
  : undefined;
74
77
  }
75
78
  else {
76
79
  // Single field format
77
80
  itemData = formatItemData(app, data[field]);
78
- itemLabel = app.get(field) ?? field;
81
+ itemLabel = addLabelEnd(app.get(field) ?? field);
79
82
  size = ViewPageSize.small;
80
83
  gridProps = { size };
81
84
  }
@@ -153,7 +156,7 @@ export function ViewPageGridItem(props) {
153
156
  options = getResp(singleRow ?? "small");
154
157
  }
155
158
  // Layout
156
- return (_jsxs(Grid, { ...gridProps, ...options, children: [label != null && (_jsxs(Typography, { variant: "caption", component: horizontal ? "span" : "div", children: [label, ":"] })), typeof data === "object" ? (data) : horizontal ? (_jsx(Typography, { variant: "subtitle2", component: "span", marginLeft: 0.5, children: data })) : (_jsx(Typography, { variant: "subtitle2", children: data }))] }));
159
+ return (_jsxs(Grid, { ...gridProps, ...options, children: [label != null && (_jsx(Typography, { variant: "caption", component: horizontal ? "span" : "div", children: label })), typeof data === "object" ? (data) : horizontal ? (_jsx(Typography, { variant: "subtitle2", component: "span", marginLeft: 0.5, children: data })) : (_jsx(Typography, { variant: "subtitle2", children: data }))] }));
157
160
  }
158
161
  export function ViewContainer(props) {
159
162
  // Global app
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.5.65",
3
+ "version": "1.5.66",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -40,13 +40,13 @@
40
40
  "@dnd-kit/sortable": "^10.0.0",
41
41
  "@emotion/react": "^11.14.0",
42
42
  "@emotion/styled": "^11.14.1",
43
- "@etsoo/appscript": "^1.6.41",
43
+ "@etsoo/appscript": "^1.6.42",
44
44
  "@etsoo/notificationbase": "^1.1.63",
45
45
  "@etsoo/react": "^1.8.49",
46
46
  "@etsoo/shared": "^1.2.75",
47
47
  "@mui/icons-material": "^7.2.0",
48
48
  "@mui/material": "^7.2.0",
49
- "@mui/x-data-grid": "^8.7.0",
49
+ "@mui/x-data-grid": "^8.8.0",
50
50
  "chart.js": "^4.5.0",
51
51
  "chartjs-plugin-datalabels": "^2.2.0",
52
52
  "dompurify": "^3.2.6",
@@ -36,6 +36,10 @@ function getResp(singleRow: ViewPageRowType) {
36
36
  return size;
37
37
  }
38
38
 
39
+ function addLabelEnd(label: string) {
40
+ return label + ":";
41
+ }
42
+
39
43
  function getItemField<T extends object>(
40
44
  app: ReactAppType,
41
45
  field: ViewPageFieldTypeNarrow<T>,
@@ -51,7 +55,7 @@ function getItemField<T extends object>(
51
55
  if (Array.isArray(field)) {
52
56
  const [fieldData, fieldType, renderProps, singleRow = "small"] = field;
53
57
  itemData = GridDataFormat(data[fieldData], fieldType, renderProps);
54
- itemLabel = app.get<string>(fieldData) ?? fieldData;
58
+ itemLabel = addLabelEnd(app.get<string>(fieldData) ?? fieldData);
55
59
  size = getResp(singleRow);
56
60
  gridProps = { size };
57
61
  } else if (typeof field === "object") {
@@ -87,16 +91,16 @@ function getItemField<T extends object>(
87
91
  fieldLabel === ""
88
92
  ? undefined
89
93
  : fieldLabel == null && typeof fieldData === "string"
90
- ? app.get<string>(fieldData) ?? fieldData
94
+ ? addLabelEnd(app.get<string>(fieldData) ?? fieldData)
91
95
  : typeof fieldLabel === "function"
92
96
  ? fieldLabel(data)
93
97
  : fieldLabel != null
94
- ? app.get<string>(fieldLabel) ?? fieldLabel
98
+ ? addLabelEnd(app.get<string>(fieldLabel) ?? fieldLabel)
95
99
  : undefined;
96
100
  } else {
97
101
  // Single field format
98
102
  itemData = formatItemData(app, data[field]);
99
- itemLabel = app.get<string>(field) ?? field;
103
+ itemLabel = addLabelEnd(app.get<string>(field) ?? field);
100
104
  size = ViewPageSize.small;
101
105
  gridProps = { size };
102
106
  }
@@ -210,7 +214,7 @@ export function ViewPageGridItem(props: ViewPageGridItemProps) {
210
214
  <Grid {...gridProps} {...options}>
211
215
  {label != null && (
212
216
  <Typography variant="caption" component={horizontal ? "span" : "div"}>
213
- {label}:
217
+ {label}
214
218
  </Typography>
215
219
  )}
216
220
  {typeof data === "object" ? (