@hw-component/table 1.9.47 → 1.9.49

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.
@@ -21,7 +21,12 @@ var Link = Typography.Link,
21
21
  var getTableVal = function getTableVal(config, itemData) {
22
22
  var dataIndex = config.dataIndex;
23
23
  var tableDataIndex = dataIndex;
24
- return itemData[tableDataIndex];
24
+ var val = itemData[tableDataIndex];
25
+ if (typeof val === "undefined" || val === null) {
26
+ return val;
27
+ }
28
+ var relVal = val === null || val === void 0 ? void 0 : val.toString();
29
+ return !!relVal ? relVal : null;
25
30
  };
26
31
  var dateRender = function dateRender(config, itemData) {
27
32
  var _config$valueTypeProp = config.valueTypeProps,
@@ -109,7 +114,9 @@ var textRender = function textRender(config, itemData) {
109
114
  var addonBefore = valueTypeProps.addonBefore,
110
115
  addonAfter = valueTypeProps.addonAfter,
111
116
  type = valueTypeProps.type,
112
- ellipsis = valueTypeProps.ellipsis;
117
+ ellipsis = valueTypeProps.ellipsis,
118
+ _valueTypeProps$empty = valueTypeProps.emptyNode,
119
+ emptyNode = _valueTypeProps$empty === void 0 ? "-" : _valueTypeProps$empty;
113
120
  var tableVal = getTableVal(config, itemData);
114
121
  return jsxs(Paragraph, {
115
122
  type: type,
@@ -119,7 +126,7 @@ var textRender = function textRender(config, itemData) {
119
126
  width: "100%",
120
127
  padding: 0
121
128
  },
122
- children: [addonBefore, tableVal, addonAfter]
129
+ children: [addonBefore, !tableVal ? emptyNode : tableVal, addonAfter]
123
130
  });
124
131
  };
125
132
  var imageRender = function imageRender(config, itemData) {
@@ -24,7 +24,12 @@ var Link = antd.Typography.Link,
24
24
  var getTableVal = function getTableVal(config, itemData) {
25
25
  var dataIndex = config.dataIndex;
26
26
  var tableDataIndex = dataIndex;
27
- return itemData[tableDataIndex];
27
+ var val = itemData[tableDataIndex];
28
+ if (typeof val === "undefined" || val === null) {
29
+ return val;
30
+ }
31
+ var relVal = val === null || val === void 0 ? void 0 : val.toString();
32
+ return !!relVal ? relVal : null;
28
33
  };
29
34
  var dateRender = function dateRender(config, itemData) {
30
35
  var _config$valueTypeProp = config.valueTypeProps,
@@ -112,7 +117,9 @@ var textRender = function textRender(config, itemData) {
112
117
  var addonBefore = valueTypeProps.addonBefore,
113
118
  addonAfter = valueTypeProps.addonAfter,
114
119
  type = valueTypeProps.type,
115
- ellipsis = valueTypeProps.ellipsis;
120
+ ellipsis = valueTypeProps.ellipsis,
121
+ _valueTypeProps$empty = valueTypeProps.emptyNode,
122
+ emptyNode = _valueTypeProps$empty === void 0 ? "-" : _valueTypeProps$empty;
116
123
  var tableVal = getTableVal(config, itemData);
117
124
  return jsxRuntime.jsxs(Paragraph, {
118
125
  type: type,
@@ -122,7 +129,7 @@ var textRender = function textRender(config, itemData) {
122
129
  width: "100%",
123
130
  padding: 0
124
131
  },
125
- children: [addonBefore, tableVal, addonAfter]
132
+ children: [addonBefore, !tableVal ? emptyNode : tableVal, addonAfter]
126
133
  });
127
134
  };
128
135
  var imageRender = function imageRender(config, itemData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/table",
3
- "version": "1.9.47",
3
+ "version": "1.9.49",
4
4
  "description": "基于antd二次开发table组件",
5
5
  "keywords": [
6
6
  "table"
@@ -8,7 +8,12 @@ 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
- return itemData[tableDataIndex];
11
+ const val=itemData[tableDataIndex];
12
+ if (typeof val==="undefined"||val===null){
13
+ return val;
14
+ }
15
+ const relVal=val?.toString();
16
+ return !!relVal?relVal:null;
12
17
  };
13
18
  const dateRender = (config: ConfigItemModal, itemData: any) => {
14
19
  const { valueTypeProps = {} } = config;
@@ -86,7 +91,7 @@ const linkRender = (config: ConfigItemModal, itemData: any) => {
86
91
  };
87
92
  const textRender = (config: ConfigItemModal, itemData: any) => {
88
93
  const { valueTypeProps = {} } = config;
89
- const { addonBefore, addonAfter, type, ellipsis } = valueTypeProps;
94
+ const { addonBefore, addonAfter, type, ellipsis ,emptyNode="-"} = valueTypeProps;
90
95
  const tableVal = getTableVal(config, itemData);
91
96
  return (
92
97
  <Paragraph
@@ -95,7 +100,7 @@ const textRender = (config: ConfigItemModal, itemData: any) => {
95
100
  style={{ margin: 0, width: "100%", padding: 0 }}
96
101
  >
97
102
  {addonBefore}
98
- {tableVal}
103
+ {!tableVal?emptyNode:tableVal}
99
104
  {addonAfter}
100
105
  </Paragraph>
101
106
  );