@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.
- package/dist/assets/arrow-mac-down.svg +19 -0
- package/dist/assets/arrow-mac-right.svg +17 -0
- package/dist/assets/arrow-windows-down.svg +17 -0
- package/dist/assets/arrow-windows-right.svg +17 -0
- package/dist/core/config.d.ts +3 -0
- package/dist/core/config.js +4 -1
- package/dist/core/editor/cascaderEditor/index.d.ts +1 -1
- package/dist/core/editor/cascaderEditor/index.js +10 -9
- package/dist/core/editor/cascaderEditor/index.less +14 -10
- package/dist/core/editor/dateEditor/index.js +29 -6
- package/dist/core/editor/dateEditor/index.less +9 -2
- package/dist/core/editor/numberEditor/index.d.ts +3 -1
- package/dist/core/editor/numberEditor/index.js +60 -25
- package/dist/core/editor/numberEditor/index.less +3 -2
- package/dist/core/editor/selectEditor/index.d.ts +1 -1
- package/dist/core/editor/selectEditor/index.js +17 -15
- package/dist/core/editor/selectEditor/index.less +15 -6
- package/dist/core/reducers/index.d.ts +2 -2
- package/dist/core/reducers/index.js +8 -1
- package/dist/core/reducers/keyboardReducer.js +40 -9
- package/dist/core/reducers/mouseReducer.js +123 -14
- package/dist/core/reducers/sideEffectReducer.d.ts +1 -1
- package/dist/core/reducers/sideEffectReducer.js +155 -49
- package/dist/core/reducers/stateReducer.d.ts +1 -0
- package/dist/core/reducers/stateReducer.js +126 -31
- package/dist/core/sheet/Cell.js +30 -21
- package/dist/core/sheet/Control.d.ts +21 -0
- package/dist/core/sheet/Control.js +83 -0
- package/dist/core/sheet/DataEditor.js +1 -1
- package/dist/core/sheet/DefaultCell.d.ts +8 -3
- package/dist/core/sheet/DefaultCell.js +11 -7
- package/dist/core/sheet/DefaultRow.js +1 -7
- package/dist/core/sheet/DefaultRowMapper.d.ts +3 -0
- package/dist/core/sheet/DefaultRowMapper.js +19 -3
- package/dist/core/sheet/Menu.d.ts +6 -0
- package/dist/core/sheet/Menu.js +21 -0
- package/dist/core/sheet/Remark.d.ts +9 -0
- package/dist/core/sheet/Remark.js +32 -0
- package/dist/core/sheet/index.js +328 -87
- package/dist/core/sheet/index.less +243 -107
- package/dist/core/sheet/searchInput.d.ts +16 -0
- package/dist/core/sheet/searchInput.js +105 -0
- package/dist/core/sheet/useContextMenu.d.ts +1 -1
- package/dist/core/sheet/useContextMenu.js +15 -12
- package/dist/core/sheet/useKeyBoardEvent.js +31 -7
- package/dist/core/sheet/useMouseEvent.js +37 -18
- package/dist/core/sheet/useRemarkContainer.d.ts +14 -0
- package/dist/core/sheet/useRemarkContainer.js +144 -0
- package/dist/core/sheet/useSearchInput.d.ts +11 -0
- package/dist/core/sheet/useSearchInput.js +75 -0
- package/dist/core/sheet/useSelectVisible.d.ts +1 -1
- package/dist/core/sheet/useSelectVisible.js +16 -6
- package/dist/core/sheet/useVirtualList.d.ts +10 -1
- package/dist/core/sheet/useVirtualList.js +44 -28
- package/dist/core/sheet/var.less +41 -34
- package/dist/core/shell/draggableShell/index.d.ts +3 -1
- package/dist/core/shell/draggableShell/index.js +136 -46
- package/dist/core/shell/tableShell.d.ts +4 -2
- package/dist/core/shell/tableShell.js +11 -107
- package/dist/core/table/addButton.d.ts +5 -0
- package/dist/core/table/addButton.js +102 -0
- package/dist/core/table/events.d.ts +0 -2
- package/dist/core/table/events.js +30 -32
- package/dist/core/table/index.d.ts +1 -0
- package/dist/core/table/index.js +266 -192
- package/dist/core/table/index.less +31 -0
- package/dist/core/table/remarkEvent.d.ts +5 -0
- package/dist/core/table/remarkEvent.js +9 -0
- package/dist/core/table/useGroupConfig.d.ts +4 -1
- package/dist/core/table/useGroupConfig.js +141 -10
- package/dist/core/table/useRowSelection.d.ts +3 -0
- package/dist/core/table/useRowSelection.js +71 -1
- package/dist/core/util.d.ts +16 -3
- package/dist/core/util.js +156 -64
- package/dist/core/viewer/cascaderViewer/index.js +6 -1
- package/dist/core/viewer/groupViewer/index.js +24 -8
- package/dist/core/viewer/switchViewer/index.js +8 -2
- package/dist/example/antComponent.js +72 -44
- package/dist/example/basic.js +15 -10
- package/dist/example/group.js +38 -15
- package/dist/example/selection.js +6 -6
- package/dist/example/sheet.js +18 -19
- package/dist/example/valuationAnalyze.d.ts +1 -0
- package/dist/example/valuationAnalyze.js +356 -14
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useEventBus.js +1 -1
- package/dist/hooks/useGroupConfig.d.ts +4 -0
- package/dist/hooks/useGroupConfig.js +5 -0
- package/dist/hooks/useKeyboard.d.ts +5 -2
- package/dist/hooks/useKeyboard.js +33 -9
- package/dist/hooks/useMiddlewareReducer.d.ts +5 -5
- package/dist/hooks/useMiddlewareReducer.js +2 -2
- package/dist/hooks/useMouse.d.ts +1 -1
- package/dist/hooks/useMouse.js +6 -6
- package/dist/hooks/useSetState.js +6 -6
- package/dist/hooks/useWidthConfig.d.ts +3 -3
- package/dist/standardUtils/index.d.ts +1 -1
- package/dist/standardUtils/index.js +1 -1
- package/dist/type/sheet.d.ts +89 -33
- package/dist/type/sheetTable.d.ts +38 -14
- 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(
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
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(
|
|
6
|
-
function _toPrimitive(
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
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(
|
|
6
|
-
function _toPrimitive(
|
|
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
|
|
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 ||
|
|
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 ||
|
|
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
|
-
|
|
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
|
|
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
|
-
//
|
|
157
|
-
if (data !== null && data !== void 0 && (_data$ = data[0]) !== null && _data$ !== void 0 && (_data
|
|
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
|
|
3
|
+
export type asyncActionType = (dispatch: (action: NormalAction | FunctionAction) => void, getState: () => SheetType.UpdateStateType) => void;
|
|
4
4
|
export declare const sideEffectReducer: Record<string, asyncActionType>;
|