@aloudata/aloudata-design 1.9.11 → 1.9.12

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.
@@ -11,20 +11,29 @@ export function getTableColumns(_ref) {
11
11
  totalWidth = _ref.totalWidth;
12
12
  var columnWidths = getColumnWidths(columns, columnSizing, totalWidth);
13
13
  return _.map(columns, function (col, index) {
14
+ var title = col.title,
15
+ _col$dataIndex = col.dataIndex,
16
+ dataIndex = _col$dataIndex === void 0 ? "column-".concat(index) : _col$dataIndex,
17
+ _col$align = col.align,
18
+ align = _col$align === void 0 ? 'left' : _col$align,
19
+ _col$ellipsis = col.ellipsis,
20
+ ellipsis = _col$ellipsis === void 0 ? true : _col$ellipsis,
21
+ render = col.render;
14
22
  return {
15
- id: col.dataIndex || "column-".concat(index),
23
+ // 这里还需要排除掉空字符串的情况,id 不能为 ''
24
+ id: dataIndex || "column-".concat(index),
16
25
  accessor: col.dataIndex,
17
- Header: typeof col.title === 'string' ? /*#__PURE__*/React.createElement("div", {
18
- key: col.dataIndex,
19
- className: classnames(prefixCls('th-default'), prefixCls("align-".concat(col.align || 'left')), _defineProperty({}, prefixCls('td-ellipsis-content'), col.ellipsis))
20
- }, col.title) : col.title,
26
+ Header: typeof title === 'string' ? /*#__PURE__*/React.createElement("div", {
27
+ key: dataIndex,
28
+ className: classnames(prefixCls('th-default'), prefixCls("align-".concat(align)), _defineProperty({}, prefixCls('td-ellipsis-content'), ellipsis))
29
+ }, title) : title,
21
30
  Cell: function Cell(_ref2) {
22
31
  var row = _ref2.row;
23
- var colValue = _.get(row.original, col.dataIndex || '');
24
- var node = col.render ? col.render(colValue, row.original, row.index) : colValue;
32
+ var colValue = _.get(row.original, dataIndex || '');
33
+ var node = render ? render(colValue, row.original, row.index) : colValue;
25
34
  return /*#__PURE__*/React.createElement("div", {
26
- className: classnames(prefixCls('td-default'), prefixCls("align-".concat(col.align || 'left')))
27
- }, col.ellipsis ? /*#__PURE__*/React.createElement("div", {
35
+ className: classnames(prefixCls('td-default'), prefixCls("align-".concat(align)))
36
+ }, ellipsis ? /*#__PURE__*/React.createElement("div", {
28
37
  className: prefixCls('td-ellipsis-content')
29
38
  }, node) : node);
30
39
  },
@@ -48,6 +48,7 @@
48
48
 
49
49
  .ald-tmp-table-th {
50
50
  border-bottom: 1px solid #e8e8e8;
51
+ background-color: #fff;
51
52
  }
52
53
 
53
54
  .ald-tmp-table-th-default {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloudata/aloudata-design",
3
- "version": "1.9.11",
3
+ "version": "1.9.12",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",