@etsoo/react 1.4.60 → 1.4.61
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.
|
@@ -12,7 +12,7 @@ export interface ViewPageField<T extends {}> extends GridProps {
|
|
|
12
12
|
/**
|
|
13
13
|
* Label field
|
|
14
14
|
*/
|
|
15
|
-
label
|
|
15
|
+
label: string | (() => React.ReactNode);
|
|
16
16
|
}
|
|
17
17
|
declare type ViewPageFieldType<T> = (string & keyof T) | ViewPageField<T>;
|
|
18
18
|
/**
|
package/lib/mu/pages/ViewPage.js
CHANGED
|
@@ -14,8 +14,6 @@ function getItemField(field, data) {
|
|
|
14
14
|
let itemData, itemLabel, gridProps;
|
|
15
15
|
if (typeof field === 'object') {
|
|
16
16
|
// Destruct
|
|
17
|
-
if (field.label == null && typeof field.data === 'string')
|
|
18
|
-
field.label = field.data;
|
|
19
17
|
const { data: fieldData, label: fieldLabel, ...rest } = field;
|
|
20
18
|
gridProps = rest;
|
|
21
19
|
// Field data
|
|
@@ -27,9 +25,7 @@ function getItemField(field, data) {
|
|
|
27
25
|
itemLabel =
|
|
28
26
|
typeof fieldLabel === 'function'
|
|
29
27
|
? fieldLabel()
|
|
30
|
-
: fieldLabel
|
|
31
|
-
? 'No Label'
|
|
32
|
-
: (_a = globalApp.get(fieldLabel)) !== null && _a !== void 0 ? _a : fieldLabel;
|
|
28
|
+
: (_a = globalApp.get(fieldLabel)) !== null && _a !== void 0 ? _a : fieldLabel;
|
|
33
29
|
}
|
|
34
30
|
else {
|
|
35
31
|
itemData = formatItemData(data[field]);
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ export interface ViewPageField<T extends {}> extends GridProps {
|
|
|
17
17
|
/**
|
|
18
18
|
* Label field
|
|
19
19
|
*/
|
|
20
|
-
label
|
|
20
|
+
label: string | (() => React.ReactNode);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
type ViewPageFieldType<T> = (string & keyof T) | ViewPageField<T>;
|
|
@@ -58,8 +58,6 @@ function getItemField<T>(
|
|
|
58
58
|
|
|
59
59
|
if (typeof field === 'object') {
|
|
60
60
|
// Destruct
|
|
61
|
-
if (field.label == null && typeof field.data === 'string')
|
|
62
|
-
field.label = field.data;
|
|
63
61
|
const { data: fieldData, label: fieldLabel, ...rest } = field;
|
|
64
62
|
gridProps = rest;
|
|
65
63
|
|
|
@@ -71,8 +69,6 @@ function getItemField<T>(
|
|
|
71
69
|
itemLabel =
|
|
72
70
|
typeof fieldLabel === 'function'
|
|
73
71
|
? fieldLabel()
|
|
74
|
-
: fieldLabel == null
|
|
75
|
-
? 'No Label'
|
|
76
72
|
: globalApp.get<string>(fieldLabel) ?? fieldLabel;
|
|
77
73
|
} else {
|
|
78
74
|
itemData = formatItemData(data[field]);
|