@ucloud-fe/react-components 1.8.0 → 1.8.2

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.
@@ -180,10 +180,10 @@ var Modal = (_dec = (0, _localeConsumerDecorator.default)({
180
180
  key: "content",
181
181
  className: "".concat(_style.prefixCls, "-title-content")
182
182
  }, title), closable && /*#__PURE__*/_react.default.createElement("span", {
183
+ key: "close",
183
184
  className: "".concat(_style.prefixCls, "-close"),
184
185
  onClick: onClose
185
186
  }, /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
186
- key: "close",
187
187
  type: "cross-circle",
188
188
  className: "".concat(_style.prefixCls, "-close-svg")
189
189
  }))],
@@ -1319,7 +1319,7 @@ var Select = function Select(_ref19) {
1319
1319
 
1320
1320
  var _useState5 = (0, _react.useState)(function () {
1321
1321
  (0, _newArrowCheck2.default)(this, _this21);
1322
- return hasSubGroup || !!(search && (renderContent || renderSelector));
1322
+ return hasSubGroup || !!(search && renderSelector);
1323
1323
  }.bind(this)),
1324
1324
  _useState6 = (0, _slicedToArray2.default)(_useState5, 1),
1325
1325
  v1 = _useState6[0];
@@ -586,7 +586,7 @@ var Table = (_dec = (0, _localeConsumerDecorator.default)({
586
586
  array.forEach(function (record) {
587
587
  (0, _newArrowCheck2.default)(this, _this17);
588
588
 
589
- if (record[childrenName]) {
589
+ if (record && record[childrenName]) {
590
590
  var newRecord = _objectSpread({}, record);
591
591
 
592
592
  delete newRecord[childrenName];
@@ -656,7 +656,7 @@ var Table = (_dec = (0, _localeConsumerDecorator.default)({
656
656
  }.bind(this) : _columnInfo$filter$ha;
657
657
  return (0, _filter2.default)(dataSource, function (record) {
658
658
  (0, _newArrowCheck2.default)(this, _this19);
659
- return handleFilter(record[dataIndex], record, value, multiple);
659
+ return handleFilter(record && record[dataIndex], record, value, multiple);
660
660
  }.bind(this));
661
661
  }.bind(this);
662
662
 
@@ -757,7 +757,7 @@ var Table = (_dec = (0, _localeConsumerDecorator.default)({
757
757
  _this2.getRowKey = function (record, index) {
758
758
  (0, _newArrowCheck2.default)(this, _this3);
759
759
  var rowKey = _this2.props.rowKey;
760
- var key = typeof rowKey === 'function' ? rowKey(record, index) : record[rowKey];
760
+ var key = typeof rowKey === 'function' ? rowKey(record, index) : record && record[rowKey];
761
761
  return key === undefined ? index : key;
762
762
  }.bind(this);
763
763
 
@@ -1503,7 +1503,9 @@ var Table = (_dec = (0, _localeConsumerDecorator.default)({
1503
1503
  "data-table-id": this.tableId
1504
1504
  }, /*#__PURE__*/_react.default.createElement(_style.PopupContainer, {
1505
1505
  ref: this.savePopupContainer
1506
- }), /*#__PURE__*/_react.default.createElement(_rcTable.default, (0, _extends2.default)({}, defaultExpandAllRowsProps, {
1506
+ }), /*#__PURE__*/_react.default.createElement(_rcTable.default, (0, _extends2.default)({
1507
+ defaultExpandAllRows: defaultExpandAllRows
1508
+ }, defaultExpandAllRowsProps, {
1507
1509
  onExpand: this.onExpandHandler
1508
1510
  }, rest, {
1509
1511
  scroll: scroll,
@@ -146,7 +146,7 @@ var ExpandableRow = /*#__PURE__*/function (_React$Component) {
146
146
  fixed = _this$props5.fixed;
147
147
  this.expandIconAsCell = fixed !== 'right' ? this.props.expandIconAsCell : false;
148
148
  this.expandIconColumnIndex = fixed !== 'right' ? this.props.expandIconColumnIndex : -1;
149
- var childrenData = record[childrenColumnName];
149
+ var childrenData = record && record[childrenColumnName];
150
150
  this.expandable = !!(childrenData || expandedRowRender);
151
151
  var expandableRowProps = {
152
152
  indentSize: indentSize,
@@ -125,7 +125,7 @@ var ExpandableTable = /*#__PURE__*/function (_React$Component) {
125
125
  expandedRowClassName = _this$props3.expandedRowClassName,
126
126
  expandedRowRender = _this$props3.expandedRowRender,
127
127
  childrenColumnName = _this$props3.childrenColumnName;
128
- var childrenData = record[childrenColumnName];
128
+ var childrenData = record && record[childrenColumnName];
129
129
  var nextAncestorKeys = [].concat((0, _toConsumableArray2.default)(ancestorKeys), [parentKey]);
130
130
  var nextIndent = indent + 1;
131
131
 
@@ -250,7 +250,7 @@ var ExpandableTable = /*#__PURE__*/function (_React$Component) {
250
250
  children = _this$props5.children;
251
251
  var needIndentSpaced = data.some(function (record) {
252
252
  (0, _newArrowCheck2.default)(this, _this4);
253
- return record[childrenColumnName];
253
+ return record && record[childrenColumnName];
254
254
  }.bind(this));
255
255
  return children({
256
256
  props: this.props,
@@ -294,8 +294,12 @@ ExpandableTable.defaultProps = {
294
294
  defaultExpandedRowKeys: [],
295
295
  childrenColumnName: 'children',
296
296
  indentSize: 15,
297
- onExpand: function onExpand() {},
298
- onExpandedRowsChange: function onExpandedRowsChange() {}
297
+ onExpand: function onExpand() {
298
+ (0, _newArrowCheck2.default)(this, _this5);
299
+ }.bind(void 0),
300
+ onExpandedRowsChange: function onExpandedRowsChange() {
301
+ (0, _newArrowCheck2.default)(this, _this5);
302
+ }.bind(void 0)
299
303
  };
300
304
  (0, _reactLifecyclesCompat.polyfill)(ExpandableTable);
301
305
 
@@ -72,7 +72,7 @@ var Table = /*#__PURE__*/function (_React$Component) {
72
72
  _this.getRowKey = function (record, index) {
73
73
  (0, _newArrowCheck2.default)(this, _this2);
74
74
  var rowKey = _this.props.rowKey;
75
- var key = typeof rowKey === 'function' ? rowKey(record, index) : record[rowKey];
75
+ var key = typeof rowKey === 'function' ? rowKey(record, index) : record && record[rowKey];
76
76
  (0, _utils.warningOnce)(key !== undefined, 'Each record in table should have a unique `key` prop,' + 'or set `rowKey` to an unique primary key.');
77
77
  return key === undefined ? index : key;
78
78
  }.bind(this);
@@ -84,7 +84,7 @@ var TableCell = /*#__PURE__*/function (_React$Component) {
84
84
  var colSpan;
85
85
  var rowSpan;
86
86
 
87
- if (render) {
87
+ if (render && record) {
88
88
  text = render(text, record, index);
89
89
 
90
90
  if (isInvalidRenderCellText(text)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucloud-fe/react-components",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "title": "UCloud react components",
5
5
  "description": "UCloud react components",
6
6
  "keywords": [