@leankylin-sheet/react 3.1.27 → 3.1.28
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/index.esm.js +23 -16
- package/dist/index.js +23 -16
- package/dist/index.umd.js +23 -16
- package/dist/index.umd.min.js +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -2087,8 +2087,10 @@ var NotationBoxes = function NotationBoxes() {
|
|
|
2087
2087
|
});
|
|
2088
2088
|
}
|
|
2089
2089
|
}, [flowdata, setContext, length]);
|
|
2090
|
+
var ref = useRef(null);
|
|
2090
2091
|
return /*#__PURE__*/React.createElement("div", {
|
|
2091
|
-
id: "luckysheet-postil-showBoxs"
|
|
2092
|
+
id: "luckysheet-postil-showBoxs",
|
|
2093
|
+
ref: ref
|
|
2092
2094
|
}, _.concat((_context$commentBoxes = context.commentBoxes) === null || _context$commentBoxes === void 0 ? void 0 : _context$commentBoxes.filter(function (v) {
|
|
2093
2095
|
var _context$editingComme;
|
|
2094
2096
|
return (v === null || v === void 0 ? void 0 : v.rc) !== ((_context$editingComme = context.editingCommentBox) === null || _context$editingComme === void 0 ? void 0 : _context$editingComme.rc);
|
|
@@ -2200,19 +2202,22 @@ var NotationBoxes = function NotationBoxes() {
|
|
|
2200
2202
|
return e.stopPropagation();
|
|
2201
2203
|
},
|
|
2202
2204
|
id: "".concat(commentId, "-editor"),
|
|
2203
|
-
onMouseUp: function onMouseUp(
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
if (
|
|
2209
|
-
var
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2205
|
+
onMouseUp: function onMouseUp() {
|
|
2206
|
+
if (ref.current) {
|
|
2207
|
+
var sEl = ref.current.querySelector("#".concat(commentId, "-editor"));
|
|
2208
|
+
var el = sEl.querySelector(".luckysheet-comment-editor");
|
|
2209
|
+
sEl.scrollTop = sEl.scrollHeight;
|
|
2210
|
+
if (el) {
|
|
2211
|
+
var selection = window.getSelection();
|
|
2212
|
+
if (selection) {
|
|
2213
|
+
var range = document.createRange();
|
|
2214
|
+
range.setStartAfter(el.lastChild || el);
|
|
2215
|
+
range.setEndAfter(el.lastChild || el);
|
|
2216
|
+
selection.removeAllRanges();
|
|
2217
|
+
selection.addRange(range);
|
|
2218
|
+
}
|
|
2219
|
+
el.focus();
|
|
2214
2220
|
}
|
|
2215
|
-
el.focus();
|
|
2216
2221
|
}
|
|
2217
2222
|
}
|
|
2218
2223
|
}, (_context$hooks$commen = (_context$hooks = context.hooks).commentsPreRender) === null || _context$hooks$commen === void 0 ? void 0 : _context$hooks$commen.call(_context$hooks, r, c), /*#__PURE__*/React.createElement(ContentEditable, {
|
|
@@ -2236,9 +2241,11 @@ var NotationBoxes = function NotationBoxes() {
|
|
|
2236
2241
|
},
|
|
2237
2242
|
onBlur: function onBlur() {
|
|
2238
2243
|
var _context$hooks$afterU2, _context$hooks3, _flowdata$r2, _flowdata$r2$c;
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
el
|
|
2244
|
+
if (ref.current) {
|
|
2245
|
+
var el = ref.current.querySelector("#".concat(commentId, "-editor"));
|
|
2246
|
+
if (el) {
|
|
2247
|
+
el.scrollTop = 0;
|
|
2248
|
+
}
|
|
2242
2249
|
}
|
|
2243
2250
|
(_context$hooks$afterU2 = (_context$hooks3 = context.hooks).afterUpdateComment) === null || _context$hooks$afterU2 === void 0 ? void 0 : _context$hooks$afterU2.call(_context$hooks3, r, c, flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r2 = flowdata[r]) === null || _flowdata$r2 === void 0 ? void 0 : (_flowdata$r2$c = _flowdata$r2[c]) === null || _flowdata$r2$c === void 0 ? void 0 : _flowdata$r2$c.ps, true);
|
|
2244
2251
|
},
|
package/dist/index.js
CHANGED
|
@@ -2097,8 +2097,10 @@ var NotationBoxes = function NotationBoxes() {
|
|
|
2097
2097
|
});
|
|
2098
2098
|
}
|
|
2099
2099
|
}, [flowdata, setContext, length]);
|
|
2100
|
+
var ref = React.useRef(null);
|
|
2100
2101
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
2101
|
-
id: "luckysheet-postil-showBoxs"
|
|
2102
|
+
id: "luckysheet-postil-showBoxs",
|
|
2103
|
+
ref: ref
|
|
2102
2104
|
}, ___default['default'].concat((_context$commentBoxes = context.commentBoxes) === null || _context$commentBoxes === void 0 ? void 0 : _context$commentBoxes.filter(function (v) {
|
|
2103
2105
|
var _context$editingComme;
|
|
2104
2106
|
return (v === null || v === void 0 ? void 0 : v.rc) !== ((_context$editingComme = context.editingCommentBox) === null || _context$editingComme === void 0 ? void 0 : _context$editingComme.rc);
|
|
@@ -2210,19 +2212,22 @@ var NotationBoxes = function NotationBoxes() {
|
|
|
2210
2212
|
return e.stopPropagation();
|
|
2211
2213
|
},
|
|
2212
2214
|
id: "".concat(commentId, "-editor"),
|
|
2213
|
-
onMouseUp: function onMouseUp(
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
if (
|
|
2219
|
-
var
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2215
|
+
onMouseUp: function onMouseUp() {
|
|
2216
|
+
if (ref.current) {
|
|
2217
|
+
var sEl = ref.current.querySelector("#".concat(commentId, "-editor"));
|
|
2218
|
+
var el = sEl.querySelector(".luckysheet-comment-editor");
|
|
2219
|
+
sEl.scrollTop = sEl.scrollHeight;
|
|
2220
|
+
if (el) {
|
|
2221
|
+
var selection = window.getSelection();
|
|
2222
|
+
if (selection) {
|
|
2223
|
+
var range = document.createRange();
|
|
2224
|
+
range.setStartAfter(el.lastChild || el);
|
|
2225
|
+
range.setEndAfter(el.lastChild || el);
|
|
2226
|
+
selection.removeAllRanges();
|
|
2227
|
+
selection.addRange(range);
|
|
2228
|
+
}
|
|
2229
|
+
el.focus();
|
|
2224
2230
|
}
|
|
2225
|
-
el.focus();
|
|
2226
2231
|
}
|
|
2227
2232
|
}
|
|
2228
2233
|
}, (_context$hooks$commen = (_context$hooks = context.hooks).commentsPreRender) === null || _context$hooks$commen === void 0 ? void 0 : _context$hooks$commen.call(_context$hooks, r, c), /*#__PURE__*/React__default['default'].createElement(ContentEditable, {
|
|
@@ -2246,9 +2251,11 @@ var NotationBoxes = function NotationBoxes() {
|
|
|
2246
2251
|
},
|
|
2247
2252
|
onBlur: function onBlur() {
|
|
2248
2253
|
var _context$hooks$afterU2, _context$hooks3, _flowdata$r2, _flowdata$r2$c;
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
el
|
|
2254
|
+
if (ref.current) {
|
|
2255
|
+
var el = ref.current.querySelector("#".concat(commentId, "-editor"));
|
|
2256
|
+
if (el) {
|
|
2257
|
+
el.scrollTop = 0;
|
|
2258
|
+
}
|
|
2252
2259
|
}
|
|
2253
2260
|
(_context$hooks$afterU2 = (_context$hooks3 = context.hooks).afterUpdateComment) === null || _context$hooks$afterU2 === void 0 ? void 0 : _context$hooks$afterU2.call(_context$hooks3, r, c, flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r2 = flowdata[r]) === null || _flowdata$r2 === void 0 ? void 0 : (_flowdata$r2$c = _flowdata$r2[c]) === null || _flowdata$r2$c === void 0 ? void 0 : _flowdata$r2$c.ps, true);
|
|
2254
2261
|
},
|
package/dist/index.umd.js
CHANGED
|
@@ -105133,8 +105133,10 @@
|
|
|
105133
105133
|
});
|
|
105134
105134
|
}
|
|
105135
105135
|
}, [flowdata, setContext, length]);
|
|
105136
|
+
var ref = React.useRef(null);
|
|
105136
105137
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
105137
|
-
id: "luckysheet-postil-showBoxs"
|
|
105138
|
+
id: "luckysheet-postil-showBoxs",
|
|
105139
|
+
ref: ref
|
|
105138
105140
|
}, lodash.concat((_context$commentBoxes = context.commentBoxes) === null || _context$commentBoxes === void 0 ? void 0 : _context$commentBoxes.filter(function (v) {
|
|
105139
105141
|
var _context$editingComme;
|
|
105140
105142
|
return (v === null || v === void 0 ? void 0 : v.rc) !== ((_context$editingComme = context.editingCommentBox) === null || _context$editingComme === void 0 ? void 0 : _context$editingComme.rc);
|
|
@@ -105246,19 +105248,22 @@
|
|
|
105246
105248
|
return e.stopPropagation();
|
|
105247
105249
|
},
|
|
105248
105250
|
id: "".concat(commentId, "-editor"),
|
|
105249
|
-
onMouseUp: function onMouseUp(
|
|
105250
|
-
|
|
105251
|
-
|
|
105252
|
-
|
|
105253
|
-
|
|
105254
|
-
if (
|
|
105255
|
-
var
|
|
105256
|
-
|
|
105257
|
-
|
|
105258
|
-
|
|
105259
|
-
|
|
105251
|
+
onMouseUp: function onMouseUp() {
|
|
105252
|
+
if (ref.current) {
|
|
105253
|
+
var sEl = ref.current.querySelector("#".concat(commentId, "-editor"));
|
|
105254
|
+
var el = sEl.querySelector(".luckysheet-comment-editor");
|
|
105255
|
+
sEl.scrollTop = sEl.scrollHeight;
|
|
105256
|
+
if (el) {
|
|
105257
|
+
var selection = window.getSelection();
|
|
105258
|
+
if (selection) {
|
|
105259
|
+
var range = document.createRange();
|
|
105260
|
+
range.setStartAfter(el.lastChild || el);
|
|
105261
|
+
range.setEndAfter(el.lastChild || el);
|
|
105262
|
+
selection.removeAllRanges();
|
|
105263
|
+
selection.addRange(range);
|
|
105264
|
+
}
|
|
105265
|
+
el.focus();
|
|
105260
105266
|
}
|
|
105261
|
-
el.focus();
|
|
105262
105267
|
}
|
|
105263
105268
|
}
|
|
105264
105269
|
}, (_context$hooks$commen = (_context$hooks = context.hooks).commentsPreRender) === null || _context$hooks$commen === void 0 ? void 0 : _context$hooks$commen.call(_context$hooks, r, c), /*#__PURE__*/React__default['default'].createElement(ContentEditable, {
|
|
@@ -105282,9 +105287,11 @@
|
|
|
105282
105287
|
},
|
|
105283
105288
|
onBlur: function onBlur() {
|
|
105284
105289
|
var _context$hooks$afterU2, _context$hooks3, _flowdata$r2, _flowdata$r2$c;
|
|
105285
|
-
|
|
105286
|
-
|
|
105287
|
-
el
|
|
105290
|
+
if (ref.current) {
|
|
105291
|
+
var el = ref.current.querySelector("#".concat(commentId, "-editor"));
|
|
105292
|
+
if (el) {
|
|
105293
|
+
el.scrollTop = 0;
|
|
105294
|
+
}
|
|
105288
105295
|
}
|
|
105289
105296
|
(_context$hooks$afterU2 = (_context$hooks3 = context.hooks).afterUpdateComment) === null || _context$hooks$afterU2 === void 0 ? void 0 : _context$hooks$afterU2.call(_context$hooks3, r, c, flowdata === null || flowdata === void 0 ? void 0 : (_flowdata$r2 = flowdata[r]) === null || _flowdata$r2 === void 0 ? void 0 : (_flowdata$r2$c = _flowdata$r2[c]) === null || _flowdata$r2$c === void 0 ? void 0 : _flowdata$r2$c.ps, true);
|
|
105290
105297
|
},
|