@hw-component/table 1.9.47 → 1.9.48
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/es/render/config.js
CHANGED
|
@@ -19,9 +19,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
19
19
|
var Link = Typography.Link,
|
|
20
20
|
Paragraph = Typography.Paragraph;
|
|
21
21
|
var getTableVal = function getTableVal(config, itemData) {
|
|
22
|
+
var _itemData$tableDataIn;
|
|
22
23
|
var dataIndex = config.dataIndex;
|
|
23
24
|
var tableDataIndex = dataIndex;
|
|
24
|
-
|
|
25
|
+
var val = (_itemData$tableDataIn = itemData[tableDataIndex]) === null || _itemData$tableDataIn === void 0 ? void 0 : _itemData$tableDataIn.toString();
|
|
26
|
+
return !!val ? val : null;
|
|
25
27
|
};
|
|
26
28
|
var dateRender = function dateRender(config, itemData) {
|
|
27
29
|
var _config$valueTypeProp = config.valueTypeProps,
|
|
@@ -109,7 +111,8 @@ var textRender = function textRender(config, itemData) {
|
|
|
109
111
|
var addonBefore = valueTypeProps.addonBefore,
|
|
110
112
|
addonAfter = valueTypeProps.addonAfter,
|
|
111
113
|
type = valueTypeProps.type,
|
|
112
|
-
ellipsis = valueTypeProps.ellipsis
|
|
114
|
+
ellipsis = valueTypeProps.ellipsis,
|
|
115
|
+
emptyNode = valueTypeProps.emptyNode;
|
|
113
116
|
var tableVal = getTableVal(config, itemData);
|
|
114
117
|
return jsxs(Paragraph, {
|
|
115
118
|
type: type,
|
|
@@ -119,7 +122,7 @@ var textRender = function textRender(config, itemData) {
|
|
|
119
122
|
width: "100%",
|
|
120
123
|
padding: 0
|
|
121
124
|
},
|
|
122
|
-
children: [addonBefore, tableVal, addonAfter]
|
|
125
|
+
children: [addonBefore, !tableVal ? emptyNode : tableVal, addonAfter]
|
|
123
126
|
});
|
|
124
127
|
};
|
|
125
128
|
var imageRender = function imageRender(config, itemData) {
|
package/lib/render/config.js
CHANGED
|
@@ -22,9 +22,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
|
|
|
22
22
|
var Link = antd.Typography.Link,
|
|
23
23
|
Paragraph = antd.Typography.Paragraph;
|
|
24
24
|
var getTableVal = function getTableVal(config, itemData) {
|
|
25
|
+
var _itemData$tableDataIn;
|
|
25
26
|
var dataIndex = config.dataIndex;
|
|
26
27
|
var tableDataIndex = dataIndex;
|
|
27
|
-
|
|
28
|
+
var val = (_itemData$tableDataIn = itemData[tableDataIndex]) === null || _itemData$tableDataIn === void 0 ? void 0 : _itemData$tableDataIn.toString();
|
|
29
|
+
return !!val ? val : null;
|
|
28
30
|
};
|
|
29
31
|
var dateRender = function dateRender(config, itemData) {
|
|
30
32
|
var _config$valueTypeProp = config.valueTypeProps,
|
|
@@ -112,7 +114,8 @@ var textRender = function textRender(config, itemData) {
|
|
|
112
114
|
var addonBefore = valueTypeProps.addonBefore,
|
|
113
115
|
addonAfter = valueTypeProps.addonAfter,
|
|
114
116
|
type = valueTypeProps.type,
|
|
115
|
-
ellipsis = valueTypeProps.ellipsis
|
|
117
|
+
ellipsis = valueTypeProps.ellipsis,
|
|
118
|
+
emptyNode = valueTypeProps.emptyNode;
|
|
116
119
|
var tableVal = getTableVal(config, itemData);
|
|
117
120
|
return jsxRuntime.jsxs(Paragraph, {
|
|
118
121
|
type: type,
|
|
@@ -122,7 +125,7 @@ var textRender = function textRender(config, itemData) {
|
|
|
122
125
|
width: "100%",
|
|
123
126
|
padding: 0
|
|
124
127
|
},
|
|
125
|
-
children: [addonBefore, tableVal, addonAfter]
|
|
128
|
+
children: [addonBefore, !tableVal ? emptyNode : tableVal, addonAfter]
|
|
126
129
|
});
|
|
127
130
|
};
|
|
128
131
|
var imageRender = function imageRender(config, itemData) {
|
package/package.json
CHANGED
|
@@ -8,7 +8,8 @@ const { Link, Paragraph } = Typography;
|
|
|
8
8
|
const getTableVal = (config: ConfigItemModal, itemData: any) => {
|
|
9
9
|
const { dataIndex } = config;
|
|
10
10
|
const tableDataIndex = dataIndex as string;
|
|
11
|
-
|
|
11
|
+
const val=itemData[tableDataIndex]?.toString();
|
|
12
|
+
return !!val?val:null;
|
|
12
13
|
};
|
|
13
14
|
const dateRender = (config: ConfigItemModal, itemData: any) => {
|
|
14
15
|
const { valueTypeProps = {} } = config;
|
|
@@ -86,7 +87,7 @@ const linkRender = (config: ConfigItemModal, itemData: any) => {
|
|
|
86
87
|
};
|
|
87
88
|
const textRender = (config: ConfigItemModal, itemData: any) => {
|
|
88
89
|
const { valueTypeProps = {} } = config;
|
|
89
|
-
const { addonBefore, addonAfter, type, ellipsis } = valueTypeProps;
|
|
90
|
+
const { addonBefore, addonAfter, type, ellipsis ,emptyNode} = valueTypeProps;
|
|
90
91
|
const tableVal = getTableVal(config, itemData);
|
|
91
92
|
return (
|
|
92
93
|
<Paragraph
|
|
@@ -95,7 +96,7 @@ const textRender = (config: ConfigItemModal, itemData: any) => {
|
|
|
95
96
|
style={{ margin: 0, width: "100%", padding: 0 }}
|
|
96
97
|
>
|
|
97
98
|
{addonBefore}
|
|
98
|
-
{tableVal}
|
|
99
|
+
{!tableVal?emptyNode:tableVal}
|
|
99
100
|
{addonAfter}
|
|
100
101
|
</Paragraph>
|
|
101
102
|
);
|