@zhenliang/sheet 0.1.7 → 0.1.8-4.beta.1

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.
Files changed (102) hide show
  1. package/dist/assets/arrow-mac-down.svg +19 -0
  2. package/dist/assets/arrow-mac-right.svg +17 -0
  3. package/dist/assets/arrow-windows-down.svg +17 -0
  4. package/dist/assets/arrow-windows-right.svg +17 -0
  5. package/dist/core/config.d.ts +3 -0
  6. package/dist/core/config.js +4 -1
  7. package/dist/core/editor/cascaderEditor/index.d.ts +1 -1
  8. package/dist/core/editor/cascaderEditor/index.js +10 -9
  9. package/dist/core/editor/cascaderEditor/index.less +14 -10
  10. package/dist/core/editor/dateEditor/index.js +29 -6
  11. package/dist/core/editor/dateEditor/index.less +9 -2
  12. package/dist/core/editor/numberEditor/index.d.ts +3 -1
  13. package/dist/core/editor/numberEditor/index.js +60 -25
  14. package/dist/core/editor/numberEditor/index.less +3 -2
  15. package/dist/core/editor/selectEditor/index.d.ts +1 -1
  16. package/dist/core/editor/selectEditor/index.js +17 -15
  17. package/dist/core/editor/selectEditor/index.less +15 -6
  18. package/dist/core/reducers/index.d.ts +2 -2
  19. package/dist/core/reducers/index.js +8 -1
  20. package/dist/core/reducers/keyboardReducer.js +40 -9
  21. package/dist/core/reducers/mouseReducer.js +123 -14
  22. package/dist/core/reducers/sideEffectReducer.d.ts +1 -1
  23. package/dist/core/reducers/sideEffectReducer.js +155 -49
  24. package/dist/core/reducers/stateReducer.d.ts +1 -0
  25. package/dist/core/reducers/stateReducer.js +126 -31
  26. package/dist/core/sheet/Cell.js +30 -21
  27. package/dist/core/sheet/Control.d.ts +21 -0
  28. package/dist/core/sheet/Control.js +83 -0
  29. package/dist/core/sheet/DataEditor.js +1 -1
  30. package/dist/core/sheet/DefaultCell.d.ts +8 -3
  31. package/dist/core/sheet/DefaultCell.js +11 -7
  32. package/dist/core/sheet/DefaultRow.js +1 -7
  33. package/dist/core/sheet/DefaultRowMapper.d.ts +3 -0
  34. package/dist/core/sheet/DefaultRowMapper.js +19 -3
  35. package/dist/core/sheet/Menu.d.ts +6 -0
  36. package/dist/core/sheet/Menu.js +21 -0
  37. package/dist/core/sheet/Remark.d.ts +9 -0
  38. package/dist/core/sheet/Remark.js +32 -0
  39. package/dist/core/sheet/index.js +328 -87
  40. package/dist/core/sheet/index.less +243 -107
  41. package/dist/core/sheet/searchInput.d.ts +16 -0
  42. package/dist/core/sheet/searchInput.js +105 -0
  43. package/dist/core/sheet/useContextMenu.d.ts +1 -1
  44. package/dist/core/sheet/useContextMenu.js +15 -12
  45. package/dist/core/sheet/useKeyBoardEvent.js +31 -7
  46. package/dist/core/sheet/useMouseEvent.js +37 -18
  47. package/dist/core/sheet/useRemarkContainer.d.ts +14 -0
  48. package/dist/core/sheet/useRemarkContainer.js +144 -0
  49. package/dist/core/sheet/useSearchInput.d.ts +11 -0
  50. package/dist/core/sheet/useSearchInput.js +75 -0
  51. package/dist/core/sheet/useSelectVisible.d.ts +1 -1
  52. package/dist/core/sheet/useSelectVisible.js +16 -6
  53. package/dist/core/sheet/useVirtualList.d.ts +10 -1
  54. package/dist/core/sheet/useVirtualList.js +44 -28
  55. package/dist/core/sheet/var.less +41 -34
  56. package/dist/core/shell/draggableShell/index.d.ts +3 -1
  57. package/dist/core/shell/draggableShell/index.js +136 -46
  58. package/dist/core/shell/tableShell.d.ts +4 -2
  59. package/dist/core/shell/tableShell.js +11 -107
  60. package/dist/core/table/addButton.d.ts +5 -0
  61. package/dist/core/table/addButton.js +102 -0
  62. package/dist/core/table/events.d.ts +0 -2
  63. package/dist/core/table/events.js +30 -32
  64. package/dist/core/table/index.d.ts +1 -0
  65. package/dist/core/table/index.js +266 -192
  66. package/dist/core/table/index.less +31 -0
  67. package/dist/core/table/remarkEvent.d.ts +5 -0
  68. package/dist/core/table/remarkEvent.js +9 -0
  69. package/dist/core/table/useGroupConfig.d.ts +4 -1
  70. package/dist/core/table/useGroupConfig.js +141 -10
  71. package/dist/core/table/useRowSelection.d.ts +3 -0
  72. package/dist/core/table/useRowSelection.js +71 -1
  73. package/dist/core/util.d.ts +16 -3
  74. package/dist/core/util.js +156 -64
  75. package/dist/core/viewer/cascaderViewer/index.js +6 -1
  76. package/dist/core/viewer/groupViewer/index.js +24 -8
  77. package/dist/core/viewer/switchViewer/index.js +8 -2
  78. package/dist/example/antComponent.js +72 -44
  79. package/dist/example/basic.js +15 -10
  80. package/dist/example/group.js +38 -15
  81. package/dist/example/selection.js +6 -6
  82. package/dist/example/sheet.js +18 -19
  83. package/dist/example/valuationAnalyze.d.ts +1 -0
  84. package/dist/example/valuationAnalyze.js +356 -14
  85. package/dist/hooks/index.d.ts +1 -1
  86. package/dist/hooks/index.js +1 -1
  87. package/dist/hooks/useEventBus.js +1 -1
  88. package/dist/hooks/useGroupConfig.d.ts +4 -0
  89. package/dist/hooks/useGroupConfig.js +5 -0
  90. package/dist/hooks/useKeyboard.d.ts +5 -2
  91. package/dist/hooks/useKeyboard.js +33 -9
  92. package/dist/hooks/useMiddlewareReducer.d.ts +5 -5
  93. package/dist/hooks/useMiddlewareReducer.js +2 -2
  94. package/dist/hooks/useMouse.d.ts +1 -1
  95. package/dist/hooks/useMouse.js +6 -6
  96. package/dist/hooks/useSetState.js +6 -6
  97. package/dist/hooks/useWidthConfig.d.ts +3 -3
  98. package/dist/standardUtils/index.d.ts +1 -1
  99. package/dist/standardUtils/index.js +1 -1
  100. package/dist/type/sheet.d.ts +89 -33
  101. package/dist/type/sheetTable.d.ts +38 -14
  102. package/package.json +11 -5
@@ -10,11 +10,15 @@ var sheetReducer = function sheetReducer(state, action) {
10
10
  case 'editFinish':
11
11
  case 'pushHistory':
12
12
  case 'popHistory':
13
- case 'selectRow':
14
13
  case 'select':
14
+ case 'selectOneRow':
15
15
  case 'clearSelect':
16
16
  case 'clearSelectIfNotSingleRow':
17
17
  case 'clearEdit':
18
+ case 'changeSearch':
19
+ case 'closeSearch':
20
+ case 'openSearch':
21
+ case 'changeFixedPosition':
18
22
  return stateReducer[action.type](state, action.payload);
19
23
  case 'mouseDown':
20
24
  case 'mouseOver':
@@ -22,12 +26,15 @@ var sheetReducer = function sheetReducer(state, action) {
22
26
  case 'loseFocus':
23
27
  case 'doubleClick':
24
28
  case 'mouseLeaveInterval':
29
+ case 'selectRow':
30
+ case 'selectCol':
25
31
  return mouseReducer[action.type](state, action.payload);
26
32
  case 'move':
27
33
  case 'escape':
28
34
  case 'reverse':
29
35
  case 'delete':
30
36
  case 'enter':
37
+ case 'selectAll':
31
38
  case 'otherInput':
32
39
  return keyboardReducer[action.type](state, action.payload);
33
40
  default:
@@ -1,11 +1,11 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { isNil } from 'lodash';
8
- import { getNextVisibleRow, groupConfigToGroupMap } from "../util";
8
+ import { getNextVisibleRow, groupConfigToGroupMap, stripRowIndex } from "../util";
9
9
  export var keyboardReducer = {
10
10
  move: function move(state, payload) {
11
11
  var _state$start, _state$start2;
@@ -17,7 +17,8 @@ export var keyboardReducer = {
17
17
  data = _state$data === void 0 ? [] : _state$data;
18
18
  var newRow = (((_state$start = state.start) === null || _state$start === void 0 ? void 0 : _state$start.row) || 0) + row;
19
19
  if (groupConfig) {
20
- newRow = getNextVisibleRow(newRow, data.length, groupConfigToGroupMap(groupConfig), row < 0 ? -1 : 1);
20
+ var _data;
21
+ newRow = getNextVisibleRow(newRow, (data === null || data === void 0 || (_data = data[data.length - 1]) === null || _data === void 0 ? void 0 : _data[0].row) || data.length, groupConfigToGroupMap(groupConfig), row < 0 ? -1 : 1);
21
22
  }
22
23
  var currentPos = {
23
24
  row: newRow,
@@ -65,12 +66,13 @@ export var keyboardReducer = {
65
66
  return state;
66
67
  },
67
68
  enter: function enter(state, payload) {
68
- var _data$start$row;
69
+ var _data$start$row, _data$start$row2;
69
70
  var start = state.start,
70
71
  end = state.end,
71
72
  editing = state.editing,
72
73
  data = state.data;
73
- if (!start || !end || data !== null && data !== void 0 && (_data$start$row = data[start.row]) !== null && _data$start$row !== void 0 && _data$start$row[start.col].readonly) {
74
+ var freeze = state.freeze;
75
+ if (!start || !end || data !== null && data !== void 0 && (_data$start$row = data[start.row]) !== null && _data$start$row !== void 0 && _data$start$row[start.col].readonly || !(data !== null && data !== void 0 && (_data$start$row2 = data[start.row]) !== null && _data$start$row2 !== void 0 && _data$start$row2[start.col].editable) || freeze) {
74
76
  return state;
75
77
  }
76
78
  if (!editing) {
@@ -89,5 +91,34 @@ export var keyboardReducer = {
89
91
  otherInput: function otherInput(state, payload) {
90
92
  if (state.editing) return state;
91
93
  return keyboardReducer.enter(state, payload);
94
+ },
95
+ selectAll: function selectAll(state) {
96
+ var _state$data2 = state.data,
97
+ data = _state$data2 === void 0 ? [] : _state$data2;
98
+ var lastEditing;
99
+ if (state.editing) {
100
+ lastEditing = _objectSpread(_objectSpread({}, state.editing), {}, {
101
+ confirm: true
102
+ });
103
+ }
104
+ var _stripRowIndex = stripRowIndex(data),
105
+ startIndex = _stripRowIndex.startIndex,
106
+ endIndex = _stripRowIndex.endIndex;
107
+ return _objectSpread(_objectSpread({}, state), {}, {
108
+ start: {
109
+ row: 0,
110
+ col: startIndex
111
+ },
112
+ end: {
113
+ row: data.length - 1,
114
+ col: endIndex
115
+ },
116
+ lastSelected: {
117
+ start: state.start,
118
+ end: state.end
119
+ },
120
+ editing: undefined,
121
+ lastEditing: lastEditing
122
+ });
92
123
  }
93
124
  };
@@ -1,9 +1,10 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import { isFreezedCell, stripRowIndex } from "../util";
7
8
  export var mouseReducer = {
8
9
  mouseDown: function mouseDown(state, payload) {
9
10
  var _ref = payload,
@@ -14,7 +15,12 @@ export var mouseReducer = {
14
15
  var data = state.data,
15
16
  start = state.start,
16
17
  end = state.end;
17
- if (data !== null && data !== void 0 && data[row][col].fixed) {
18
+ if ((data === null || data === void 0 ? void 0 : data[row][col].dataIndex) === 'index') {
19
+ return mouseReducer.selectRow(state, {
20
+ row: row
21
+ });
22
+ }
23
+ if (isFreezedCell(row, col, data)) {
18
24
  return _objectSpread(_objectSpread({}, state), {}, {
19
25
  start: undefined,
20
26
  end: undefined,
@@ -70,7 +76,22 @@ export var mouseReducer = {
70
76
  row = _ref2.row,
71
77
  col = _ref2.col;
72
78
  var data = state.data;
73
- if (state.mouseDown === false || data !== null && data !== void 0 && data[row][col].fixed) return state;
79
+ if (state.mouseDown === false || isFreezedCell(row, col, data)) {
80
+ return state;
81
+ }
82
+ if (state.isIndex && state.start && state.end && (data === null || data === void 0 ? void 0 : data[row][col].dataIndex) === 'index') {
83
+ var _state$end;
84
+ return _objectSpread(_objectSpread({}, state), {}, {
85
+ end: {
86
+ row: row,
87
+ col: (_state$end = state.end) === null || _state$end === void 0 ? void 0 : _state$end.col
88
+ },
89
+ lastSelected: {
90
+ start: state.start,
91
+ end: state.end
92
+ }
93
+ });
94
+ }
74
95
  return _objectSpread(_objectSpread({}, state), {}, {
75
96
  end: {
76
97
  row: row,
@@ -87,9 +108,27 @@ export var mouseReducer = {
87
108
  row = _ref3.row,
88
109
  col = _ref3.col;
89
110
  var data = state.data;
90
- if (state.mouseDown === false || data !== null && data !== void 0 && data[row][col].fixed) return state;
111
+ if (state.mouseDown === false || isFreezedCell(row, col, data)) {
112
+ return state;
113
+ }
114
+ if (state.isIndex && state.end) {
115
+ var _state$end2;
116
+ return _objectSpread(_objectSpread({}, state), {}, {
117
+ mouseDown: false,
118
+ isIndex: false,
119
+ end: {
120
+ row: row,
121
+ col: (_state$end2 = state.end) === null || _state$end2 === void 0 ? void 0 : _state$end2.col
122
+ },
123
+ lastSelected: {
124
+ start: state.start,
125
+ end: state.end
126
+ }
127
+ });
128
+ }
91
129
  return _objectSpread(_objectSpread({}, state), {}, {
92
130
  mouseDown: false,
131
+ isIndex: false,
93
132
  end: {
94
133
  row: row,
95
134
  col: col
@@ -115,7 +154,13 @@ export var mouseReducer = {
115
154
  lastSelected: {
116
155
  start: state.start,
117
156
  end: state.end
118
- }
157
+ },
158
+ searchText: '',
159
+ showSearch: false,
160
+ searchTotal: 0,
161
+ searchCurrent: 0,
162
+ searchCalledCount: 0,
163
+ searchResultList: []
119
164
  });
120
165
  },
121
166
  doubleClick: function doubleClick(state, payload) {
@@ -123,12 +168,14 @@ export var mouseReducer = {
123
168
  var _ref4 = payload,
124
169
  row = _ref4.row,
125
170
  col = _ref4.col;
126
- var data = state.data;
127
- if (data !== null && data !== void 0 && (_data$row$col = data[row][col]) !== null && _data$row$col !== void 0 && _data$row$col.readonly) {
171
+ var data = state.data,
172
+ freeze = state.freeze;
173
+ if (data !== null && data !== void 0 && (_data$row$col = data[row][col]) !== null && _data$row$col !== void 0 && _data$row$col.readonly || freeze) {
128
174
  return state;
129
175
  }
130
176
  return _objectSpread(_objectSpread({}, state), {}, {
131
177
  mouseDown: false,
178
+ isIndex: false,
132
179
  editing: {
133
180
  row: row,
134
181
  col: col
@@ -149,16 +196,78 @@ export var mouseReducer = {
149
196
  });
150
197
  },
151
198
  mouseLeaveInterval: function mouseLeaveInterval(state, payload) {
152
- var _data$, _data$$end$col;
199
+ var _data$, _end$col, _data$2, _end$col2;
153
200
  var _ref5 = payload,
154
201
  end = _ref5.end;
155
202
  var data = state.data;
156
- // fixed 列不选中
157
- if (data !== null && data !== void 0 && (_data$ = data[0]) !== null && _data$ !== void 0 && (_data$$end$col = _data$[end.col]) !== null && _data$$end$col !== void 0 && _data$$end$col.fixed) {
203
+ //fixed 列不选中
204
+ if (data !== null && data !== void 0 && (_data$ = data[0]) !== null && _data$ !== void 0 && (_data$ = _data$[(_end$col = end.col) !== null && _end$col !== void 0 ? _end$col : 0]) !== null && _data$ !== void 0 && _data$.fixed && !(data !== null && data !== void 0 && (_data$2 = data[0]) !== null && _data$2 !== void 0 && (_data$2 = _data$2[(_end$col2 = end.col) !== null && _end$col2 !== void 0 ? _end$col2 : 0]) !== null && _data$2 !== void 0 && _data$2.fixedAllowSelect)) {
158
205
  return state;
159
206
  }
160
207
  return _objectSpread(_objectSpread({}, state), {}, {
161
208
  end: end
162
209
  });
210
+ },
211
+ selectRow: function selectRow(state, payload) {
212
+ var _ref6 = payload,
213
+ row = _ref6.row;
214
+ var _state$data = state.data,
215
+ data = _state$data === void 0 ? [] : _state$data;
216
+ var lastEditing;
217
+ var _stripRowIndex = stripRowIndex(data),
218
+ startIndex = _stripRowIndex.startIndex,
219
+ endIndex = _stripRowIndex.endIndex;
220
+ if (state.editing) {
221
+ lastEditing = _objectSpread(_objectSpread({}, state.editing), {}, {
222
+ confirm: true
223
+ });
224
+ }
225
+ return _objectSpread(_objectSpread({}, state), {}, {
226
+ start: {
227
+ row: row,
228
+ col: startIndex
229
+ },
230
+ end: {
231
+ row: row,
232
+ col: endIndex
233
+ },
234
+ lastSelected: {
235
+ start: state.start,
236
+ end: state.end
237
+ },
238
+ mouseDown: true,
239
+ isIndex: true,
240
+ editing: undefined,
241
+ lastEditing: lastEditing
242
+ });
243
+ },
244
+ selectCol: function selectCol(state, payload) {
245
+ var _ref7 = payload,
246
+ col = _ref7.col,
247
+ colSpan = _ref7.colSpan;
248
+ var _state$data2 = state.data,
249
+ data = _state$data2 === void 0 ? [] : _state$data2;
250
+ var lastEditing;
251
+ if (state.editing) {
252
+ lastEditing = _objectSpread(_objectSpread({}, state.editing), {}, {
253
+ confirm: true
254
+ });
255
+ }
256
+ return _objectSpread(_objectSpread({}, state), {}, {
257
+ start: {
258
+ row: 0,
259
+ col: col
260
+ },
261
+ end: {
262
+ row: data.length - 1,
263
+ col: col + (colSpan > 1 ? colSpan - 1 : 0)
264
+ },
265
+ lastSelected: {
266
+ start: state.start,
267
+ end: state.end
268
+ },
269
+ editing: undefined,
270
+ lastEditing: lastEditing
271
+ });
163
272
  }
164
273
  };
@@ -1,4 +1,4 @@
1
1
  import type { SheetType } from "../../type";
2
2
  import { FunctionAction, NormalAction } from '../../hooks';
3
- export declare type asyncActionType = (dispatch: (action: NormalAction | FunctionAction) => void, getState: () => SheetType.UpdateStateType) => void;
3
+ export type asyncActionType = (dispatch: (action: NormalAction | FunctionAction) => void, getState: () => SheetType.UpdateStateType) => void;
4
4
  export declare const sideEffectReducer: Record<string, asyncActionType>;