linkmore-design 1.0.78 → 1.0.79

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.
@@ -37,6 +37,8 @@ var _react = _interopRequireWildcard(require("react"));
37
37
 
38
38
  var _reactResizable = require("react-resizable");
39
39
 
40
+ var _immer = require("immer");
41
+
40
42
  var _reactSortableHoc = require("react-sortable-hoc");
41
43
 
42
44
  var _hooks = require("../hooks");
@@ -53,7 +55,7 @@ var _tableChartsModal = _interopRequireDefault(require("./components/tableCharts
53
55
 
54
56
  var _resetConfig = _interopRequireDefault(require("./resetConfig"));
55
57
 
56
- var _excluded = ["dataSource", "autoSize", "columns", "rowClick", "onDoubleClick", "checkConfig", "summary", "pagination", "hiddenPage", "loading", "virtual", "sortOpen", "colSortOpen", "resizeable", "customCheck", "components", "rowSelection", "columnsState", "onChange", "filterChange", "tableRowType", "size", "openSheet", "editSheet", "emptyProps"],
58
+ var _excluded = ["dataSource", "autoSize", "columns", "rowClick", "onDoubleClick", "checkConfig", "summary", "pagination", "hiddenPage", "loading", "virtual", "sortOpen", "colSortOpen", "resizeable", "customCheck", "components", "rowSelection", "columnsState", "onChange", "filterChange", "tableRowType", "size", "openSheet", "editSheet", "dataChange", "emptyProps"],
57
59
  _excluded2 = ["className", "style"],
58
60
  _excluded3 = ["onResize", "width", "onResizeStop"];
59
61
  var Summary = _proTable.default.Summary;
@@ -133,6 +135,7 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
133
135
  openSheet = _props$openSheet === void 0 ? false : _props$openSheet,
134
136
  _props$editSheet = props.editSheet,
135
137
  editSheet = _props$editSheet === void 0 ? false : _props$editSheet,
138
+ dataChange = props.dataChange,
136
139
  emptyProps = props.emptyProps,
137
140
  resetProps = (0, _objectWithoutProperties2.default)(props, _excluded);
138
141
  var _resetProps$rowKey = resetProps.rowKey,
@@ -158,6 +161,7 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
158
161
  setColumns = _useState6[1];
159
162
 
160
163
  var tableWarpRef = (0, _react.useRef)(null);
164
+ var dataSourceRef = (0, _react.useRef)(null);
161
165
  /** 右键的ref */
162
166
 
163
167
  var contentMenuRef = (0, _react.useRef)(null);
@@ -229,6 +233,12 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
229
233
  var SortContainer = (0, _reactSortableHoc.SortableContainer)(function (props) {
230
234
  return /*#__PURE__*/_react.default.createElement("tbody", props);
231
235
  });
236
+ (0, _react.useEffect)(function () {
237
+ dataSourceRef.current = dataSource;
238
+ }, [dataSource]);
239
+ var dataEffect = (0, _react.useMemo)(function () {
240
+ return openSheet ? [dataSource] : [];
241
+ }, [openSheet]);
232
242
 
233
243
  var onSortEnd = function onSortEnd(_ref) {
234
244
  var oldIndex = _ref.oldIndex,
@@ -294,19 +304,40 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
294
304
  filterChange === null || filterChange === void 0 ? void 0 : filterChange(useColumns);
295
305
  });
296
306
  };
307
+
308
+ var isSelected = function isSelected(i, j) {
309
+ var _shellStatusRef$curre = shellStatusRef.current,
310
+ start = _shellStatusRef$curre.start,
311
+ end = _shellStatusRef$curre.end,
312
+ editing = _shellStatusRef$curre.editing;
313
+ var maxi = Math.max(start === null || start === void 0 ? void 0 : start.i, end.i);
314
+ var mini = Math.min(start === null || start === void 0 ? void 0 : start.i, end.i);
315
+ var maxj = Math.max(start === null || start === void 0 ? void 0 : start.j, end.j);
316
+ var minj = Math.min(start === null || start === void 0 ? void 0 : start.j, end.j);
317
+ var posX = j >= start.j && j <= end.j;
318
+ var negX = j <= start.j && j >= end.j;
319
+ var posY = i >= start.i && i <= end.i;
320
+ var negY = i <= start.i && i >= end.i;
321
+ return {
322
+ isSelected: posX && posY || negX && posY || negX && negY || posX && negY,
323
+ isEnd: i === maxi && j >= minj && j <= maxj,
324
+ isRightEnd: j === maxj && i >= mini && i <= maxi,
325
+ isEditing: (editing === null || editing === void 0 ? void 0 : editing.i) === i && (editing === null || editing === void 0 ? void 0 : editing.j) === j
326
+ };
327
+ };
297
328
  /** 复制功能 */
298
329
 
299
330
 
300
331
  var handleCopy = function handleCopy(e) {
301
- var _shellStatusRef$curre;
332
+ var _shellStatusRef$curre2;
302
333
 
303
- if (isEmpty((_shellStatusRef$curre = shellStatusRef.current) === null || _shellStatusRef$curre === void 0 ? void 0 : _shellStatusRef$curre.editing)) {
334
+ if (isEmpty((_shellStatusRef$curre2 = shellStatusRef.current) === null || _shellStatusRef$curre2 === void 0 ? void 0 : _shellStatusRef$curre2.editing)) {
304
335
  var _e$clipboardData;
305
336
 
306
337
  e.preventDefault();
307
- var _shellStatusRef$curre2 = shellStatusRef.current,
308
- start = _shellStatusRef$curre2.start,
309
- end = _shellStatusRef$curre2.end;
338
+ var _shellStatusRef$curre3 = shellStatusRef.current,
339
+ start = _shellStatusRef$curre3.start,
340
+ end = _shellStatusRef$curre3.end;
310
341
  var text = range(start.i, end.i).map(function (i) {
311
342
  return range(start.j, end.j).map(function (j) {
312
343
  var _columns$j, _columns$j2;
@@ -342,9 +373,9 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
342
373
  };
343
374
 
344
375
  var onMouseOver = function onMouseOver(i, j) {
345
- var _shellStatusRef$curre3, _shellStatusRef$curre4;
376
+ var _shellStatusRef$curre4, _shellStatusRef$curre5;
346
377
 
347
- if (((_shellStatusRef$curre3 = shellStatusRef.current) === null || _shellStatusRef$curre3 === void 0 ? void 0 : _shellStatusRef$curre3.selecting) && isEmpty((_shellStatusRef$curre4 = shellStatusRef.current) === null || _shellStatusRef$curre4 === void 0 ? void 0 : _shellStatusRef$curre4.editing)) {
378
+ if (((_shellStatusRef$curre4 = shellStatusRef.current) === null || _shellStatusRef$curre4 === void 0 ? void 0 : _shellStatusRef$curre4.selecting) && isEmpty((_shellStatusRef$curre5 = shellStatusRef.current) === null || _shellStatusRef$curre5 === void 0 ? void 0 : _shellStatusRef$curre5.editing)) {
348
379
  shellStatusRef.current = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, shellStatusRef.current), {}, {
349
380
  end: {
350
381
  i: i,
@@ -375,23 +406,26 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
375
406
 
376
407
 
377
408
  var handleCut = function handleCut(e) {
378
- var _shellStatusRef$curre5;
409
+ var _shellStatusRef$curre6;
379
410
 
380
- if (isEmpty((_shellStatusRef$curre5 = shellStatusRef.current) === null || _shellStatusRef$curre5 === void 0 ? void 0 : _shellStatusRef$curre5.editing)) {
411
+ if (isEmpty((_shellStatusRef$curre6 = shellStatusRef.current) === null || _shellStatusRef$curre6 === void 0 ? void 0 : _shellStatusRef$curre6.editing)) {
381
412
  e.preventDefault();
382
413
  handleCopy(e);
383
- var _shellStatusRef$curre6 = shellStatusRef.current,
384
- start = _shellStatusRef$curre6.start,
385
- end = _shellStatusRef$curre6.end;
414
+ /** 暂时先不隐藏 */
415
+ // const { start, end } = shellStatusRef.current
416
+ // clearSelectedCells(start, end)
386
417
  }
387
418
  };
388
419
  /** 内容粘贴 */
389
420
 
390
421
 
391
422
  var handlePaste = function handlePaste(e) {
392
- if (isEmpty(sheelStataus.editing)) {
393
- var start = sheelStataus.start,
394
- end = sheelStataus.end;
423
+ var _shellStatusRef$curre7;
424
+
425
+ if (isEmpty((_shellStatusRef$curre7 = shellStatusRef.current) === null || _shellStatusRef$curre7 === void 0 ? void 0 : _shellStatusRef$curre7.editing)) {
426
+ var _shellStatusRef$curre8 = shellStatusRef.current,
427
+ start = _shellStatusRef$curre8.start,
428
+ end = _shellStatusRef$curre8.end;
395
429
  start = {
396
430
  i: Math.min(start.i, end.i),
397
431
  j: Math.min(start.j, end.j)
@@ -400,7 +434,7 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
400
434
  i: Math.max(start.i, end.i),
401
435
  j: Math.max(start.j, end.j)
402
436
  };
403
- var parse = props.parsePaste || defaultParsePaste;
437
+ var parse = defaultParsePaste;
404
438
  var changes = [];
405
439
  var pasteData = [];
406
440
 
@@ -409,50 +443,33 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
409
443
  pasteData = parse(window.clipboardData.getData('Text'));
410
444
  } else if (e.clipboardData && e.clipboardData.getData) {
411
445
  pasteData = parse(e.clipboardData.getData('text/plain'));
412
- } // in order of preference
413
- // const { data, onCellsChanged, onPaste, onChange } = this.props
414
- // if (onCellsChanged) {
415
- // const additions = []
416
- // pasteData.forEach((row, i) => {
417
- // row.forEach((value, j) => {
418
- // end = { i: start.i + i, j: start.j + j }
419
- // const cell = data[end.i] && data[end.i][end.j]
420
- // if (!cell) {
421
- // additions.push({ row: end.i, col: end.j, value })
422
- // } else if (!cell.readOnly) {
423
- // changes.push({ cell, row: end.i, col: end.j, value })
424
- // }
425
- // })
426
- // })
427
- // if (additions.length) {
428
- // onCellsChanged(changes, additions)
429
- // } else {
430
- // onCellsChanged(changes)
431
- // }
432
- // } else if (onPaste) {
433
- // pasteData.forEach((row, i) => {
434
- // const rowData = []
435
- // row.forEach((pastedData, j) => {
436
- // end = { i: start.i + i, j: start.j + j }
437
- // const cell = data[end.i] && data[end.i][end.j]
438
- // rowData.push({ cell: cell, data: pastedData })
439
- // })
440
- // changes.push(rowData)
441
- // })
442
- // onPaste(changes)
443
- // } else if (onChange) {
444
- // pasteData.forEach((row, i) => {
445
- // row.forEach((value, j) => {
446
- // end = { i: start.i + i, j: start.j + j }
447
- // const cell = data[end.i] && data[end.i][end.j]
448
- // if (cell && !cell.readOnly) {
449
- // onChange(cell, end.i, end.j, value)
450
- // }
451
- // })
452
- // })
453
- // }
454
- // this._setState({ end })
446
+ }
447
+
448
+ var data = dataSourceRef.current; // in order of preference
455
449
 
450
+ var resultEnd = [];
451
+ pasteData.forEach(function (row, i) {
452
+ row.forEach(function (value, j) {
453
+ resultEnd.push({
454
+ i: start.i + i,
455
+ j: start.j + j,
456
+ value: value
457
+ });
458
+ });
459
+ });
460
+ var columnsKeysList = columns.map(function (item) {
461
+ return item.dataIndex;
462
+ });
463
+ var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
464
+ resultEnd.forEach(function (item) {
465
+ var _isSelected;
466
+
467
+ if ((_isSelected = isSelected(item.i, item.j)) === null || _isSelected === void 0 ? void 0 : _isSelected.isSelected) {
468
+ draft[item.i][columnsKeysList[item.j]] = item.value;
469
+ }
470
+ });
471
+ });
472
+ dataChange === null || dataChange === void 0 ? void 0 : dataChange(res);
456
473
  }
457
474
  };
458
475
 
@@ -489,13 +506,13 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
489
506
 
490
507
 
491
508
  var sheelMouseDown = function sheelMouseDown(i, j, e) {
492
- var _shellStatusRef$curre7, _shellStatusRef$curre8, _shellStatusRef$curre9, _shellStatusRef$curre10, _shellStatusRef$curre11, _shellStatusRef$curre12, _shellStatusRef$curre13, _shellStatusRef$curre14, _shellStatusRef$curre15;
509
+ var _shellStatusRef$curre9, _shellStatusRef$curre10, _shellStatusRef$curre11, _shellStatusRef$curre12, _shellStatusRef$curre13, _shellStatusRef$curre14, _shellStatusRef$curre15, _shellStatusRef$curre16, _shellStatusRef$curre17;
493
510
 
494
- var isNowEditingSameCell = !isEmpty((_shellStatusRef$curre7 = shellStatusRef.current) === null || _shellStatusRef$curre7 === void 0 ? void 0 : _shellStatusRef$curre7.editing) && ((_shellStatusRef$curre8 = shellStatusRef.current) === null || _shellStatusRef$curre8 === void 0 ? void 0 : _shellStatusRef$curre8.editing.i) === i && ((_shellStatusRef$curre9 = shellStatusRef.current) === null || _shellStatusRef$curre9 === void 0 ? void 0 : _shellStatusRef$curre9.editing.j) === j;
495
- var editing = isEmpty((_shellStatusRef$curre10 = shellStatusRef.current) === null || _shellStatusRef$curre10 === void 0 ? void 0 : _shellStatusRef$curre10.editing) || ((_shellStatusRef$curre11 = shellStatusRef.current) === null || _shellStatusRef$curre11 === void 0 ? void 0 : _shellStatusRef$curre11.editing.i) !== i || ((_shellStatusRef$curre12 = shellStatusRef.current) === null || _shellStatusRef$curre12 === void 0 ? void 0 : _shellStatusRef$curre12.editing.j) !== j ? {} : (_shellStatusRef$curre13 = shellStatusRef.current) === null || _shellStatusRef$curre13 === void 0 ? void 0 : _shellStatusRef$curre13.editing;
511
+ var isNowEditingSameCell = !isEmpty((_shellStatusRef$curre9 = shellStatusRef.current) === null || _shellStatusRef$curre9 === void 0 ? void 0 : _shellStatusRef$curre9.editing) && ((_shellStatusRef$curre10 = shellStatusRef.current) === null || _shellStatusRef$curre10 === void 0 ? void 0 : _shellStatusRef$curre10.editing.i) === i && ((_shellStatusRef$curre11 = shellStatusRef.current) === null || _shellStatusRef$curre11 === void 0 ? void 0 : _shellStatusRef$curre11.editing.j) === j;
512
+ var editing = isEmpty((_shellStatusRef$curre12 = shellStatusRef.current) === null || _shellStatusRef$curre12 === void 0 ? void 0 : _shellStatusRef$curre12.editing) || ((_shellStatusRef$curre13 = shellStatusRef.current) === null || _shellStatusRef$curre13 === void 0 ? void 0 : _shellStatusRef$curre13.editing.i) !== i || ((_shellStatusRef$curre14 = shellStatusRef.current) === null || _shellStatusRef$curre14 === void 0 ? void 0 : _shellStatusRef$curre14.editing.j) !== j ? {} : (_shellStatusRef$curre15 = shellStatusRef.current) === null || _shellStatusRef$curre15 === void 0 ? void 0 : _shellStatusRef$curre15.editing;
496
513
  shellStatusRef.current = {
497
514
  selecting: !isNowEditingSameCell,
498
- start: (e === null || e === void 0 ? void 0 : e.shiftKey) ? (_shellStatusRef$curre14 = shellStatusRef.current) === null || _shellStatusRef$curre14 === void 0 ? void 0 : _shellStatusRef$curre14.start : {
515
+ start: (e === null || e === void 0 ? void 0 : e.shiftKey) ? (_shellStatusRef$curre16 = shellStatusRef.current) === null || _shellStatusRef$curre16 === void 0 ? void 0 : _shellStatusRef$curre16.start : {
499
516
  i: i,
500
517
  j: j
501
518
  },
@@ -508,7 +525,7 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
508
525
  };
509
526
  SetSelectIng(!isNowEditingSameCell);
510
527
 
511
- if (isEmpty((_shellStatusRef$curre15 = shellStatusRef.current) === null || _shellStatusRef$curre15 === void 0 ? void 0 : _shellStatusRef$curre15.editing)) {
528
+ if (isEmpty((_shellStatusRef$curre17 = shellStatusRef.current) === null || _shellStatusRef$curre17 === void 0 ? void 0 : _shellStatusRef$curre17.editing)) {
512
529
  setEditIng(false);
513
530
  }
514
531
 
@@ -521,9 +538,9 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
521
538
 
522
539
  var onContextMenu = function onContextMenu(evt, i, j) {
523
540
  evt.preventDefault();
524
- var _shellStatusRef$curre16 = shellStatusRef.current,
525
- start = _shellStatusRef$curre16.start,
526
- end = _shellStatusRef$curre16.end;
541
+ var _shellStatusRef$curre18 = shellStatusRef.current,
542
+ start = _shellStatusRef$curre18.start,
543
+ end = _shellStatusRef$curre18.end;
527
544
 
528
545
  if (isEmpty(start) && isEmpty(end)) {
529
546
  sheelMouseDown(i, j, evt);
@@ -568,7 +585,17 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
568
585
  }
569
586
  };
570
587
 
571
- var dataSourceChange = function dataSourceChange(i, j, newRecord) {};
588
+ var dataSourceChange = function dataSourceChange(i, j, newRecord) {
589
+ var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
590
+ draft[i] = newRecord;
591
+ });
592
+ dataChange === null || dataChange === void 0 ? void 0 : dataChange(res);
593
+ shellStatusRef.current = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, shellStatusRef.current), {}, {
594
+ editing: {},
595
+ forceEdit: false,
596
+ clear: {}
597
+ });
598
+ };
572
599
 
573
600
  (0, _react.useEffect)(function () {
574
601
  return function () {
@@ -579,28 +606,6 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
579
606
  document.removeEventListener('paste', handlePaste);
580
607
  };
581
608
  }, []);
582
-
583
- var isSelected = function isSelected(i, j) {
584
- var _shellStatusRef$curre17 = shellStatusRef.current,
585
- start = _shellStatusRef$curre17.start,
586
- end = _shellStatusRef$curre17.end,
587
- editing = _shellStatusRef$curre17.editing;
588
- var maxi = Math.max(start === null || start === void 0 ? void 0 : start.i, end.i);
589
- var mini = Math.min(start === null || start === void 0 ? void 0 : start.i, end.i);
590
- var maxj = Math.max(start === null || start === void 0 ? void 0 : start.j, end.j);
591
- var minj = Math.min(start === null || start === void 0 ? void 0 : start.j, end.j);
592
- var posX = j >= start.j && j <= end.j;
593
- var negX = j <= start.j && j >= end.j;
594
- var posY = i >= start.i && i <= end.i;
595
- var negY = i <= start.i && i >= end.i;
596
- return {
597
- isSelected: posX && posY || negX && posY || negX && negY || posX && negY,
598
- isEnd: i === maxi && j >= minj && j <= maxj,
599
- isRightEnd: j === maxj && i >= mini && i <= maxi,
600
- isEditing: (editing === null || editing === void 0 ? void 0 : editing.i) === i && (editing === null || editing === void 0 ? void 0 : editing.j) === j
601
- };
602
- };
603
-
604
609
  var resetColumns = (0, _react.useCallback)(function () {
605
610
  var result = useColumns.filter(function (item) {
606
611
  return item.show !== false;
@@ -640,7 +645,7 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
640
645
  return obj;
641
646
  });
642
647
  return sortOpen ? [sortDefaultColumnItem].concat((0, _toConsumableArray2.default)(result)) : result;
643
- }, [useColumns, sortOpen, selectIng]);
648
+ }, [useColumns, sortOpen, selectIng, dataSource]);
644
649
  (0, _react.useEffect)(function () {
645
650
  setColumns(columns);
646
651
  }, [columns]); // 行点击事件
@@ -23,6 +23,10 @@ var InputDataEdit = function InputDataEdit(props) {
23
23
 
24
24
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
25
25
  }, 150);
26
+ return function () {
27
+ console.log('unmounds');
28
+ handleSave === null || handleSave === void 0 ? void 0 : handleSave(inputRef.current);
29
+ };
26
30
  }, []);
27
31
 
28
32
  var handleChange = function handleChange(e) {
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.default = void 0;
11
11
 
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+
12
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
15
 
14
16
  var _react = _interopRequireWildcard(require("react"));
@@ -45,7 +47,8 @@ var SheelTabelCell = function SheelTabelCell(props) {
45
47
  selectIng = props.selectIng,
46
48
  onContextMenu = props.onContextMenu,
47
49
  onDoubleClick = props.onDoubleClick,
48
- restProps = __rest(props, ["record", "col", "rowKey", "children", "rowIndex", "colIndex", "onMouseDown", "onMouseOver", "isSelected", "selectIng", "onContextMenu", "onDoubleClick"]);
50
+ dataSourceChange = props.dataSourceChange,
51
+ restProps = __rest(props, ["record", "col", "rowKey", "children", "rowIndex", "colIndex", "onMouseDown", "onMouseOver", "isSelected", "selectIng", "onContextMenu", "onDoubleClick", "dataSourceChange"]);
49
52
 
50
53
  var onMouseEnter = restProps.onMouseEnter,
51
54
  onMouseLeave = restProps.onMouseLeave,
@@ -66,9 +69,16 @@ var SheelTabelCell = function SheelTabelCell(props) {
66
69
  value = _useState2[0],
67
70
  setValue = _useState2[1];
68
71
 
72
+ var valueRef = (0, _react.useRef)((record === null || record === void 0 ? void 0 : record[col === null || col === void 0 ? void 0 : col.dataIndex]) || '');
69
73
  (0, _ahooks.useUpdateEffect)(function () {
70
74
  console.log(value, '----changeValue');
75
+ valueRef.current = value;
71
76
  }, [value]);
77
+ (0, _ahooks.useUpdateEffect)(function () {
78
+ if (value !== (record === null || record === void 0 ? void 0 : record[col === null || col === void 0 ? void 0 : col.dataIndex])) {
79
+ setValue(record === null || record === void 0 ? void 0 : record[col === null || col === void 0 ? void 0 : col.dataIndex]);
80
+ }
81
+ }, [record]);
72
82
  /** 鼠标点击 */
73
83
 
74
84
  var handleMouseDown = function handleMouseDown(e) {
@@ -116,7 +126,9 @@ var SheelTabelCell = function SheelTabelCell(props) {
116
126
  };
117
127
 
118
128
  var saveRenderValue = function saveRenderValue() {
119
- console.log(value, rowIndex, colIndex, '222');
129
+ if (valueRef.current !== (record === null || record === void 0 ? void 0 : record[col === null || col === void 0 ? void 0 : col.dataIndex])) {
130
+ dataSourceChange === null || dataSourceChange === void 0 ? void 0 : dataSourceChange(rowIndex, colIndex, Object.assign(Object.assign({}, record), (0, _defineProperty2.default)({}, col.dataIndex, valueRef.current)));
131
+ }
120
132
  };
121
133
 
122
134
  var renderEditor = function renderEditor() {
@@ -119,6 +119,7 @@ var TableChartsModal = function TableChartsModal(props) {
119
119
  return /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Modal, {
120
120
  visible: !!type,
121
121
  title: "\u667A\u80FD\u62A5\u8868",
122
+ onOk: onCancel,
122
123
  onCancel: onCancel
123
124
  }, type === 'column' && /*#__PURE__*/_react.default.createElement(_plots.Column, Object.assign({}, config)), type === 'line' && /*#__PURE__*/_react.default.createElement(_plots.Line, Object.assign({}, config)), type === 'pie' && /*#__PURE__*/_react.default.createElement(_plots.Pie, Object.assign({}, config)));
124
125
  };
@@ -49,10 +49,12 @@ var CLMModal = function CLMModal(props) {
49
49
  width: size === 'default' ? 552 : 416,
50
50
  footer: [/*#__PURE__*/_react.default.createElement(_Button.default, {
51
51
  onClick: onCancel,
52
+ key: 'canncel_button',
52
53
  size: 'middle'
53
54
  }, cancelText), /*#__PURE__*/_react.default.createElement(_Button.default, {
54
55
  type: "primary",
55
56
  onClick: onOk,
57
+ key: 'ok_button',
56
58
  size: 'middle'
57
59
  }, okText)]
58
60
  }, other, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkmore-design",
3
- "version": "1.0.78",
3
+ "version": "1.0.79",
4
4
  "author": {
5
5
  "name": "nowthen",
6
6
  "email": "rnlvwyx@gmail.com"