@fileverse-dev/fortune-react 1.2.96-scroll-2 → 1.2.96-scroll-4
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.
|
@@ -100,7 +100,7 @@ export var useSmoothScroll = function useSmoothScroll(scrollContainerRef) {
|
|
|
100
100
|
function onMouseDown(e) {
|
|
101
101
|
if (e.button !== 0) return;
|
|
102
102
|
var target = e.target;
|
|
103
|
-
if (target.tagName ===
|
|
103
|
+
if (target.tagName === "INPUT" || target.tagName === "BUTTON" || target.tagName === "SELECT" || target.tagName === "TEXTAREA" || target.closest("button") || target.closest("input")) {
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
isDragging = true;
|
|
@@ -108,7 +108,7 @@ export var useSmoothScroll = function useSmoothScroll(scrollContainerRef) {
|
|
|
108
108
|
lastY = e.clientY;
|
|
109
109
|
lastMoveTime = performance.now();
|
|
110
110
|
velocityY = 0;
|
|
111
|
-
containerEl.style.cursor =
|
|
111
|
+
containerEl.style.cursor = "grabbing";
|
|
112
112
|
e.preventDefault();
|
|
113
113
|
}
|
|
114
114
|
function onMouseMove(e) {
|
|
@@ -131,10 +131,11 @@ export var useSmoothScroll = function useSmoothScroll(scrollContainerRef) {
|
|
|
131
131
|
e.preventDefault();
|
|
132
132
|
}
|
|
133
133
|
function onMouseUp(e) {
|
|
134
|
+
console.log("Mouse up, stopping drag scroll", e);
|
|
134
135
|
if (!isDragging) return;
|
|
135
136
|
isDragging = false;
|
|
136
137
|
stopAutoScroll();
|
|
137
|
-
containerEl.style.cursor =
|
|
138
|
+
containerEl.style.cursor = "";
|
|
138
139
|
}
|
|
139
140
|
containerEl.addEventListener("mousedown", onMouseDown);
|
|
140
141
|
window.addEventListener("mousemove", onMouseMove);
|
|
@@ -156,9 +156,7 @@ var InputBox = function InputBox() {
|
|
|
156
156
|
delete refs.globalCache.doNotFocus;
|
|
157
157
|
}
|
|
158
158
|
}, [context.luckysheetCellUpdate, context.luckysheetfile, context.currentSheetId, firstSelection]);
|
|
159
|
-
var previousLuckyCellUpdate = usePrevious(context.luckysheetCellUpdate);
|
|
160
159
|
useEffect(function () {
|
|
161
|
-
console.log("inputbox luckysheetCellUpdate changed", previousLuckyCellUpdate, context.luckysheetCellUpdate);
|
|
162
160
|
if (_.isEmpty(context.luckysheetCellUpdate)) {
|
|
163
161
|
if (inputRef.current) {
|
|
164
162
|
inputRef.current.innerHTML = "";
|
|
@@ -107,7 +107,7 @@ var useSmoothScroll = exports.useSmoothScroll = function useSmoothScroll(scrollC
|
|
|
107
107
|
function onMouseDown(e) {
|
|
108
108
|
if (e.button !== 0) return;
|
|
109
109
|
var target = e.target;
|
|
110
|
-
if (target.tagName ===
|
|
110
|
+
if (target.tagName === "INPUT" || target.tagName === "BUTTON" || target.tagName === "SELECT" || target.tagName === "TEXTAREA" || target.closest("button") || target.closest("input")) {
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
isDragging = true;
|
|
@@ -115,7 +115,7 @@ var useSmoothScroll = exports.useSmoothScroll = function useSmoothScroll(scrollC
|
|
|
115
115
|
lastY = e.clientY;
|
|
116
116
|
lastMoveTime = performance.now();
|
|
117
117
|
velocityY = 0;
|
|
118
|
-
containerEl.style.cursor =
|
|
118
|
+
containerEl.style.cursor = "grabbing";
|
|
119
119
|
e.preventDefault();
|
|
120
120
|
}
|
|
121
121
|
function onMouseMove(e) {
|
|
@@ -138,10 +138,11 @@ var useSmoothScroll = exports.useSmoothScroll = function useSmoothScroll(scrollC
|
|
|
138
138
|
e.preventDefault();
|
|
139
139
|
}
|
|
140
140
|
function onMouseUp(e) {
|
|
141
|
+
console.log("Mouse up, stopping drag scroll", e);
|
|
141
142
|
if (!isDragging) return;
|
|
142
143
|
isDragging = false;
|
|
143
144
|
stopAutoScroll();
|
|
144
|
-
containerEl.style.cursor =
|
|
145
|
+
containerEl.style.cursor = "";
|
|
145
146
|
}
|
|
146
147
|
containerEl.addEventListener("mousedown", onMouseDown);
|
|
147
148
|
window.addEventListener("mousemove", onMouseMove);
|
|
@@ -165,9 +165,7 @@ var InputBox = function InputBox() {
|
|
|
165
165
|
delete refs.globalCache.doNotFocus;
|
|
166
166
|
}
|
|
167
167
|
}, [context.luckysheetCellUpdate, context.luckysheetfile, context.currentSheetId, firstSelection]);
|
|
168
|
-
var previousLuckyCellUpdate = (0, _usePrevious.default)(context.luckysheetCellUpdate);
|
|
169
168
|
(0, _react.useEffect)(function () {
|
|
170
|
-
console.log("inputbox luckysheetCellUpdate changed", previousLuckyCellUpdate, context.luckysheetCellUpdate);
|
|
171
169
|
if (_lodash.default.isEmpty(context.luckysheetCellUpdate)) {
|
|
172
170
|
if (inputRef.current) {
|
|
173
171
|
inputRef.current.innerHTML = "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.2.96-scroll-
|
|
3
|
+
"version": "1.2.96-scroll-4",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tsc": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@fileverse-dev/fortune-core": "1.2.96-scroll-
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.2.96-scroll-4",
|
|
20
20
|
"@fileverse/ui": "5.0.0",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|