@zhenliang/sheet 0.1.48 → 0.1.50
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SheetType } from "../../type";
|
|
2
|
-
export type SheetAction = 'change' | 'changes' | 'rowMove' | 'colMove' | 'editFinish' | 'pushHistory' | 'popHistory' | 'select' | 'clearSelect' | 'clearSelectIfNotSingleRow' | 'clearEdit' | 'mouseDown' | 'mouseOver' | 'mouseUp' | 'selectRow' | 'selectCol' | 'loseFocus' | 'doubleClick' | 'mouseLeaveInterval' | 'move' | 'selectAll' | 'escape' | 'reverse' | 'delete' | 'enter' | 'otherInput' | 'none';
|
|
2
|
+
export type SheetAction = 'change' | 'changes' | 'rowMove' | 'colMove' | 'editFinish' | 'pushHistory' | 'popHistory' | 'select' | 'selectOneRow' | 'clearSelect' | 'clearSelectIfNotSingleRow' | 'clearEdit' | 'mouseDown' | 'mouseOver' | 'mouseUp' | 'selectRow' | 'selectCol' | 'loseFocus' | 'doubleClick' | 'mouseLeaveInterval' | 'move' | 'selectAll' | 'escape' | 'reverse' | 'delete' | 'enter' | 'otherInput' | 'none';
|
|
3
3
|
export type reducerAction = (type: Partial<SheetType.UpdateStateType>, payload?: unknown) => Partial<SheetType.UpdateStateType>;
|
|
4
4
|
declare const sheetReducer: (state: Partial<SheetType.UpdateStateType>, action: {
|
|
5
5
|
type: SheetAction;
|
|
@@ -105,7 +105,7 @@ export var stateReducer = {
|
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
},
|
|
108
|
-
|
|
108
|
+
selectOneRow: function selectOneRow(state, payload) {
|
|
109
109
|
var _state$data4, _state$data$0$length, _state$data5, _state$data6;
|
|
110
110
|
var startCol = ((_state$data4 = state.data) === null || _state$data4 === void 0 || (_state$data4 = _state$data4[0]) === null || _state$data4 === void 0 ? void 0 : _state$data4.findIndex(function (item) {
|
|
111
111
|
return !item.fixed;
|
package/dist/core/sheet/index.js
CHANGED
|
@@ -101,6 +101,12 @@ export var DraggableShell = function DraggableShell(_ref) {
|
|
|
101
101
|
},
|
|
102
102
|
onMouseMove: function onMouseMove(e) {
|
|
103
103
|
var target = e.target;
|
|
104
|
+
if (target instanceof HTMLSpanElement) {
|
|
105
|
+
if (target.parentElement instanceof HTMLTableCellElement) {
|
|
106
|
+
target.parentElement.style.cursor = '';
|
|
107
|
+
}
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
104
110
|
if (e.nativeEvent.offsetX > target.offsetWidth - 8) {
|
|
105
111
|
target.style.cursor = 'col-resize';
|
|
106
112
|
} else {
|