@etsoo/materialui 1.4.89 → 1.4.90

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.
@@ -88,13 +88,18 @@ function getItemField(app, field, data) {
88
88
  itemData = (0, GridDataFormat_1.GridDataFormat)(data[fieldData], dataType, renderProps);
89
89
  // Field label
90
90
  itemLabel =
91
- typeof fieldLabel === "function"
92
- ? fieldLabel(data)
93
- : fieldLabel != null
94
- ? app.get(fieldLabel) ?? fieldLabel
95
- : fieldLabel;
91
+ fieldLabel === ""
92
+ ? undefined
93
+ : fieldLabel == null && typeof fieldData === "string"
94
+ ? app.get(fieldData) ?? fieldData
95
+ : typeof fieldLabel === "function"
96
+ ? fieldLabel(data)
97
+ : fieldLabel != null
98
+ ? app.get(fieldLabel) ?? fieldLabel
99
+ : undefined;
96
100
  }
97
101
  else {
102
+ // Single field format
98
103
  itemData = formatItemData(app, data[field]);
99
104
  itemLabel = app.get(field) ?? field;
100
105
  }
@@ -81,13 +81,18 @@ function getItemField(app, field, data) {
81
81
  itemData = GridDataFormat(data[fieldData], dataType, renderProps);
82
82
  // Field label
83
83
  itemLabel =
84
- typeof fieldLabel === "function"
85
- ? fieldLabel(data)
86
- : fieldLabel != null
87
- ? app.get(fieldLabel) ?? fieldLabel
88
- : fieldLabel;
84
+ fieldLabel === ""
85
+ ? undefined
86
+ : fieldLabel == null && typeof fieldData === "string"
87
+ ? app.get(fieldData) ?? fieldData
88
+ : typeof fieldLabel === "function"
89
+ ? fieldLabel(data)
90
+ : fieldLabel != null
91
+ ? app.get(fieldLabel) ?? fieldLabel
92
+ : undefined;
89
93
  }
90
94
  else {
95
+ // Single field format
91
96
  itemData = formatItemData(app, data[field]);
92
97
  itemLabel = app.get(field) ?? field;
93
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.4.89",
3
+ "version": "1.4.90",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -236,12 +236,17 @@ function getItemField<T extends object>(
236
236
 
237
237
  // Field label
238
238
  itemLabel =
239
- typeof fieldLabel === "function"
239
+ fieldLabel === ""
240
+ ? undefined
241
+ : fieldLabel == null && typeof fieldData === "string"
242
+ ? app.get<string>(fieldData) ?? fieldData
243
+ : typeof fieldLabel === "function"
240
244
  ? fieldLabel(data)
241
245
  : fieldLabel != null
242
246
  ? app.get<string>(fieldLabel) ?? fieldLabel
243
- : fieldLabel;
247
+ : undefined;
244
248
  } else {
249
+ // Single field format
245
250
  itemData = formatItemData(app, data[field]);
246
251
  itemLabel = app.get<string>(field) ?? field;
247
252
  }