linkmore-design 1.1.13-alpha.7 → 1.1.13-alpha.9

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.
@@ -664,7 +664,7 @@ var EditableCell = function EditableCell(props) {
664
664
  }
665
665
 
666
666
  return childNode;
667
- }, [col, isEdit, editing, getLength]); // 出现死循环找我
667
+ }, [col, isEdit, editing, getLength, record]); // 出现死循环找我
668
668
 
669
669
  useEffect(function () {
670
670
  var editable = col.editable,
@@ -710,10 +710,15 @@ var EditableCell = function EditableCell(props) {
710
710
  var MemoEditableCell = /*#__PURE__*/memo(EditableCell, function (prev, next) {
711
711
  var pickProps = ['record', 'colIndex'];
712
712
  var p = pick(prev, pickProps);
713
- var n = pick(next, pickProps); // console.log('333', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
713
+ var n = pick(next, pickProps);
714
+
715
+ if (next === null || next === void 0 ? void 0 : next.shouldUpdate) {
716
+ return false;
717
+ } // console.log('333', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
714
718
 
715
719
  /** TODO: 在record中带有children,子列表数据修改之后,会导致父级的record对比不一样 */
716
720
 
721
+
717
722
  if (!checkMemoShouldUploadSpecialFun(prev, next)) {
718
723
  return false;
719
724
  }
@@ -1170,7 +1175,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1170
1175
  fixed: 'left',
1171
1176
  render: function render(_, record) {
1172
1177
  return /*#__PURE__*/React.createElement(DragHandle, {
1173
- id: record[_rowKey] || (record === null || record === void 0 ? void 0 : record.id)
1178
+ id: (record === null || record === void 0 ? void 0 : record[_rowKey]) || (record === null || record === void 0 ? void 0 : record.id)
1174
1179
  });
1175
1180
  }
1176
1181
  } : null, indexCol ? isBoolean(indexCol) ? {
@@ -1255,6 +1260,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1255
1260
  editable: col.editable,
1256
1261
  dataIndex: col.dataIndex,
1257
1262
  itemProps: col.itemProps,
1263
+ shouldUpdate: shouldUpdate,
1258
1264
  setValid: setValid,
1259
1265
  isEdit: isEdit,
1260
1266
  isHoverEdit: isHoverEdit,
@@ -61,7 +61,7 @@ export function getExpandStatus(children) {
61
61
  return isExpandRow(children) ? (_e = (_d = (_c = (_b = (_a = children === null || children === void 0 ? void 0 : children[0]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c[1]) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e['aria-label'] : '';
62
62
  }
63
63
  export function checkMemoShouldUploadSpecialFun(prev, next) {
64
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
64
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
65
65
 
66
66
  var checkExpandStatus = getExpandStatus(prev.children) === getExpandStatus(next.children);
67
67
 
@@ -75,14 +75,14 @@ export function checkMemoShouldUploadSpecialFun(prev, next) {
75
75
 
76
76
  if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.render) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.render)) && !isEqual(pick(prev, ['colIndex', 'record', 'children']), pick(next, ['colIndex', 'record', 'children']))) {
77
77
  return false;
78
- } // console.log(22, prevCol?.editable === 'render', nextCol?.editable === 'render', prevCol?.componentProps, prevCol?.componentProps)
79
-
78
+ }
80
79
 
81
- if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.editable) === 'render' || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.editable) === 'render') && (((_a = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _a === void 0 ? void 0 : _a.render) || ((_b = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _b === void 0 ? void 0 : _b.render)) && !isEqual(omit(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, ['render']), omit(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps, ['render']))) {
80
+ if (prev.isEdit !== next.isEdit) {
82
81
  return false;
83
- }
82
+ } // console.log(22, prevCol?.editable === 'render', nextCol?.editable === 'render', prevCol?.componentProps, prevCol?.componentProps)
83
+
84
84
 
85
- if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.editable) === 'render' || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.editable) === 'render') && (((_c = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _c === void 0 ? void 0 : _c.render) || ((_d = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _d === void 0 ? void 0 : _d.render)) && !isEqual(pick(prev, ['colIndex', 'record', 'rowIndex']), pick(next, ['colIndex', 'record', 'rowIndex']))) {
85
+ if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.editable) === 'render' || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.editable) === 'render') && (((_a = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _a === void 0 ? void 0 : _a.render) || ((_b = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _b === void 0 ? void 0 : _b.render)) && (!isEqual(omit(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, ['render']), omit(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps, ['render'])) || !isEqual(pick(prev, ['colIndex', 'record', 'rowIndex']), pick(next, ['colIndex', 'record', 'rowIndex'])))) {
86
86
  return false;
87
87
  }
88
88
 
@@ -90,11 +90,11 @@ export function checkMemoShouldUploadSpecialFun(prev, next) {
90
90
  return false;
91
91
  }
92
92
 
93
- if ((((_e = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _e === void 0 ? void 0 : _e.optionOnly) || ((_f = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _f === void 0 ? void 0 : _f.optionOnly)) && !isEqual((_g = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _g === void 0 ? void 0 : _g.options, (_h = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _h === void 0 ? void 0 : _h.options)) {
93
+ if ((((_c = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _c === void 0 ? void 0 : _c.optionOnly) || ((_d = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _d === void 0 ? void 0 : _d.optionOnly)) && !isEqual((_e = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _e === void 0 ? void 0 : _e.options, (_f = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _f === void 0 ? void 0 : _f.options)) {
94
94
  return false;
95
95
  }
96
96
 
97
- if ((((_j = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _j === void 0 ? void 0 : _j.options) || ((_k = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _k === void 0 ? void 0 : _k.options)) && !isEqual((_l = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _l === void 0 ? void 0 : _l.options, (_m = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _m === void 0 ? void 0 : _m.options)) {
97
+ if ((((_g = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _g === void 0 ? void 0 : _g.options) || ((_h = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _h === void 0 ? void 0 : _h.options)) && !isEqual((_j = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _j === void 0 ? void 0 : _j.options, (_k = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _k === void 0 ? void 0 : _k.options)) {
98
98
  return false;
99
99
  }
100
100
 
@@ -112,12 +112,12 @@ export function checkMemoShouldUploadSpecialFun(prev, next) {
112
112
  }
113
113
 
114
114
  if (next.className.indexOf('ant-table-selection-column') > -1) {
115
- return isEqual((_p = (_o = prev.children) === null || _o === void 0 ? void 0 : _o[1]) === null || _p === void 0 ? void 0 : _p.props, (_r = (_q = next.children) === null || _q === void 0 ? void 0 : _q[1]) === null || _r === void 0 ? void 0 : _r.props);
115
+ return isEqual((_m = (_l = prev.children) === null || _l === void 0 ? void 0 : _l[1]) === null || _m === void 0 ? void 0 : _m.props, (_p = (_o = next.children) === null || _o === void 0 ? void 0 : _o[1]) === null || _p === void 0 ? void 0 : _p.props);
116
116
  }
117
117
  /** 如果启用了快速复制功能,需要实时判断rowIndex与getLength */
118
118
 
119
119
 
120
- if (((_s = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _s === void 0 ? void 0 : _s.quickcopy) || ((_t = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _t === void 0 ? void 0 : _t.quickcopy)) {
120
+ if (((_q = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _q === void 0 ? void 0 : _q.quickcopy) || ((_r = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _r === void 0 ? void 0 : _r.quickcopy)) {
121
121
  var pickProps = ['record', 'colIndex', 'rowIndex', 'getLength'];
122
122
  var p = pick(prev, pickProps);
123
123
  var n = pick(next, pickProps);
@@ -697,7 +697,7 @@ var EditableCell = function EditableCell(props) {
697
697
  }
698
698
 
699
699
  return childNode;
700
- }, [col, isEdit, editing, getLength]); // 出现死循环找我
700
+ }, [col, isEdit, editing, getLength, record]); // 出现死循环找我
701
701
 
702
702
  (0, _react.useEffect)(function () {
703
703
  var editable = col.editable,
@@ -743,10 +743,15 @@ var EditableCell = function EditableCell(props) {
743
743
  var MemoEditableCell = /*#__PURE__*/(0, _react.memo)(EditableCell, function (prev, next) {
744
744
  var pickProps = ['record', 'colIndex'];
745
745
  var p = (0, _lodash.pick)(prev, pickProps);
746
- var n = (0, _lodash.pick)(next, pickProps); // console.log('333', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
746
+ var n = (0, _lodash.pick)(next, pickProps);
747
+
748
+ if (next === null || next === void 0 ? void 0 : next.shouldUpdate) {
749
+ return false;
750
+ } // console.log('333', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
747
751
 
748
752
  /** TODO: 在record中带有children,子列表数据修改之后,会导致父级的record对比不一样 */
749
753
 
754
+
750
755
  if (!(0, _util.checkMemoShouldUploadSpecialFun)(prev, next)) {
751
756
  return false;
752
757
  }
@@ -1203,7 +1208,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
1203
1208
  fixed: 'left',
1204
1209
  render: function render(_, record) {
1205
1210
  return /*#__PURE__*/_react.default.createElement(_DragHandle.default, {
1206
- id: record[_rowKey] || (record === null || record === void 0 ? void 0 : record.id)
1211
+ id: (record === null || record === void 0 ? void 0 : record[_rowKey]) || (record === null || record === void 0 ? void 0 : record.id)
1207
1212
  });
1208
1213
  }
1209
1214
  } : null, indexCol ? (0, _lodash.isBoolean)(indexCol) ? {
@@ -1288,6 +1293,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
1288
1293
  editable: col.editable,
1289
1294
  dataIndex: col.dataIndex,
1290
1295
  itemProps: col.itemProps,
1296
+ shouldUpdate: shouldUpdate,
1291
1297
  setValid: setValid,
1292
1298
  isEdit: isEdit,
1293
1299
  isHoverEdit: isHoverEdit,
@@ -84,7 +84,7 @@ function getExpandStatus(children) {
84
84
  }
85
85
 
86
86
  function checkMemoShouldUploadSpecialFun(prev, next) {
87
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
87
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
88
88
 
89
89
  var checkExpandStatus = getExpandStatus(prev.children) === getExpandStatus(next.children);
90
90
 
@@ -98,14 +98,14 @@ function checkMemoShouldUploadSpecialFun(prev, next) {
98
98
 
99
99
  if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.render) || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.render)) && !(0, _lodash.isEqual)((0, _lodash.pick)(prev, ['colIndex', 'record', 'children']), (0, _lodash.pick)(next, ['colIndex', 'record', 'children']))) {
100
100
  return false;
101
- } // console.log(22, prevCol?.editable === 'render', nextCol?.editable === 'render', prevCol?.componentProps, prevCol?.componentProps)
102
-
101
+ }
103
102
 
104
- if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.editable) === 'render' || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.editable) === 'render') && (((_a = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _a === void 0 ? void 0 : _a.render) || ((_b = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _b === void 0 ? void 0 : _b.render)) && !(0, _lodash.isEqual)((0, _lodash.omit)(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, ['render']), (0, _lodash.omit)(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps, ['render']))) {
103
+ if (prev.isEdit !== next.isEdit) {
105
104
  return false;
106
- }
105
+ } // console.log(22, prevCol?.editable === 'render', nextCol?.editable === 'render', prevCol?.componentProps, prevCol?.componentProps)
106
+
107
107
 
108
- if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.editable) === 'render' || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.editable) === 'render') && (((_c = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _c === void 0 ? void 0 : _c.render) || ((_d = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _d === void 0 ? void 0 : _d.render)) && !(0, _lodash.isEqual)((0, _lodash.pick)(prev, ['colIndex', 'record', 'rowIndex']), (0, _lodash.pick)(next, ['colIndex', 'record', 'rowIndex']))) {
108
+ if (((prevCol === null || prevCol === void 0 ? void 0 : prevCol.editable) === 'render' || (nextCol === null || nextCol === void 0 ? void 0 : nextCol.editable) === 'render') && (((_a = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _a === void 0 ? void 0 : _a.render) || ((_b = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _b === void 0 ? void 0 : _b.render)) && (!(0, _lodash.isEqual)((0, _lodash.omit)(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, ['render']), (0, _lodash.omit)(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps, ['render'])) || !(0, _lodash.isEqual)((0, _lodash.pick)(prev, ['colIndex', 'record', 'rowIndex']), (0, _lodash.pick)(next, ['colIndex', 'record', 'rowIndex'])))) {
109
109
  return false;
110
110
  }
111
111
 
@@ -113,11 +113,11 @@ function checkMemoShouldUploadSpecialFun(prev, next) {
113
113
  return false;
114
114
  }
115
115
 
116
- if ((((_e = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _e === void 0 ? void 0 : _e.optionOnly) || ((_f = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _f === void 0 ? void 0 : _f.optionOnly)) && !(0, _lodash.isEqual)((_g = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _g === void 0 ? void 0 : _g.options, (_h = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _h === void 0 ? void 0 : _h.options)) {
116
+ if ((((_c = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _c === void 0 ? void 0 : _c.optionOnly) || ((_d = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _d === void 0 ? void 0 : _d.optionOnly)) && !(0, _lodash.isEqual)((_e = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _e === void 0 ? void 0 : _e.options, (_f = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _f === void 0 ? void 0 : _f.options)) {
117
117
  return false;
118
118
  }
119
119
 
120
- if ((((_j = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _j === void 0 ? void 0 : _j.options) || ((_k = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _k === void 0 ? void 0 : _k.options)) && !(0, _lodash.isEqual)((_l = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _l === void 0 ? void 0 : _l.options, (_m = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _m === void 0 ? void 0 : _m.options)) {
120
+ if ((((_g = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _g === void 0 ? void 0 : _g.options) || ((_h = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _h === void 0 ? void 0 : _h.options)) && !(0, _lodash.isEqual)((_j = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _j === void 0 ? void 0 : _j.options, (_k = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _k === void 0 ? void 0 : _k.options)) {
121
121
  return false;
122
122
  }
123
123
 
@@ -135,12 +135,12 @@ function checkMemoShouldUploadSpecialFun(prev, next) {
135
135
  }
136
136
 
137
137
  if (next.className.indexOf('ant-table-selection-column') > -1) {
138
- return (0, _lodash.isEqual)((_p = (_o = prev.children) === null || _o === void 0 ? void 0 : _o[1]) === null || _p === void 0 ? void 0 : _p.props, (_r = (_q = next.children) === null || _q === void 0 ? void 0 : _q[1]) === null || _r === void 0 ? void 0 : _r.props);
138
+ return (0, _lodash.isEqual)((_m = (_l = prev.children) === null || _l === void 0 ? void 0 : _l[1]) === null || _m === void 0 ? void 0 : _m.props, (_p = (_o = next.children) === null || _o === void 0 ? void 0 : _o[1]) === null || _p === void 0 ? void 0 : _p.props);
139
139
  }
140
140
  /** 如果启用了快速复制功能,需要实时判断rowIndex与getLength */
141
141
 
142
142
 
143
- if (((_s = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _s === void 0 ? void 0 : _s.quickcopy) || ((_t = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _t === void 0 ? void 0 : _t.quickcopy)) {
143
+ if (((_q = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _q === void 0 ? void 0 : _q.quickcopy) || ((_r = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _r === void 0 ? void 0 : _r.quickcopy)) {
144
144
  var pickProps = ['record', 'colIndex', 'rowIndex', 'getLength'];
145
145
  var p = (0, _lodash.pick)(prev, pickProps);
146
146
  var n = (0, _lodash.pick)(next, pickProps);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkmore-design",
3
- "version": "1.1.13-alpha.7",
3
+ "version": "1.1.13-alpha.9",
4
4
  "author": {
5
5
  "name": "nowthen",
6
6
  "email": "rnlvwyx@gmail.com"