@leankylin-sheet/react 3.1.45 → 3.1.47
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 -0
- package/dist/index.js +23 -0
- package/dist/index.umd.js +133 -84
- package/dist/index.umd.min.js +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -723,6 +723,11 @@ var ContentEditable = function ContentEditable(_ref) {
|
|
|
723
723
|
var _settings$onClickCont;
|
|
724
724
|
e.stopPropagation();
|
|
725
725
|
(_settings$onClickCont = settings.onClickContentEditable) === null || _settings$onClickCont === void 0 ? void 0 : _settings$onClickCont.call(settings, e);
|
|
726
|
+
},
|
|
727
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
728
|
+
var _settings$onClickCont2;
|
|
729
|
+
e.stopPropagation();
|
|
730
|
+
(_settings$onClickCont2 = settings.onClickContentEditable) === null || _settings$onClickCont2 === void 0 ? void 0 : _settings$onClickCont2.call(settings, e);
|
|
726
731
|
}
|
|
727
732
|
}, _.omit(props, "innerRef", "onChange", "html", "onBlur", "autoFocus", "allowEdit", "initialContent")), {}, {
|
|
728
733
|
ref: function ref(e) {
|
|
@@ -920,6 +925,7 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
920
925
|
_useState2 = _slicedToArray(_useState, 2),
|
|
921
926
|
n = _useState2[0],
|
|
922
927
|
setN = _useState2[1];
|
|
928
|
+
var wrapperRf = useRef(null);
|
|
923
929
|
var nRef = useRef(n);
|
|
924
930
|
nRef.current = n;
|
|
925
931
|
useEffect(function () {
|
|
@@ -940,6 +946,16 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
940
946
|
refs.cellInput.current.innerHTML = functionHTMLGenerate(newText);
|
|
941
947
|
moveCursorToPosition(refs.cellInput.current, offsetIndex - replaceTextLength + fnName.length);
|
|
942
948
|
};
|
|
949
|
+
var viewActive = function viewActive() {
|
|
950
|
+
var _wrapperRf$current;
|
|
951
|
+
var aItem = (_wrapperRf$current = wrapperRf.current) === null || _wrapperRf$current === void 0 ? void 0 : _wrapperRf$current.querySelector(".luckysheet-formula-search-item-active");
|
|
952
|
+
if (aItem) {
|
|
953
|
+
aItem === null || aItem === void 0 ? void 0 : aItem.scrollIntoView({
|
|
954
|
+
block: "nearest",
|
|
955
|
+
behavior: "smooth"
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
};
|
|
943
959
|
useEffect(function () {
|
|
944
960
|
var _refs$cellInput$curre2;
|
|
945
961
|
var onChange = function onChange(e) {
|
|
@@ -956,6 +972,9 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
956
972
|
}), 0);
|
|
957
973
|
return (_fListRef$current3 = fListRef.current[(currentIndex + 1) % fListRef.current.length]) === null || _fListRef$current3 === void 0 ? void 0 : _fListRef$current3.n;
|
|
958
974
|
});
|
|
975
|
+
setTimeout(function () {
|
|
976
|
+
viewActive();
|
|
977
|
+
}, 200);
|
|
959
978
|
} else if (e.key === "ArrowUp") {
|
|
960
979
|
e.preventDefault();
|
|
961
980
|
setN(function (_n) {
|
|
@@ -965,6 +984,9 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
965
984
|
}), 0);
|
|
966
985
|
return (_fListRef$current5 = fListRef.current[(currentIndex - 1) % fListRef.current.length]) === null || _fListRef$current5 === void 0 ? void 0 : _fListRef$current5.n;
|
|
967
986
|
});
|
|
987
|
+
setTimeout(function () {
|
|
988
|
+
viewActive();
|
|
989
|
+
}, 200);
|
|
968
990
|
} else if (e.key === "Enter") {
|
|
969
991
|
e.preventDefault();
|
|
970
992
|
e.stopPropagation();
|
|
@@ -986,6 +1008,7 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
986
1008
|
return /*#__PURE__*/React.createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
987
1009
|
id: "luckysheet-formula-search-c",
|
|
988
1010
|
className: "luckysheet-formula-search-c",
|
|
1011
|
+
ref: wrapperRf,
|
|
989
1012
|
onWheel: function onWheel(e) {
|
|
990
1013
|
e.preventDefault();
|
|
991
1014
|
e.stopPropagation();
|
package/dist/index.js
CHANGED
|
@@ -733,6 +733,11 @@ var ContentEditable = function ContentEditable(_ref) {
|
|
|
733
733
|
var _settings$onClickCont;
|
|
734
734
|
e.stopPropagation();
|
|
735
735
|
(_settings$onClickCont = settings.onClickContentEditable) === null || _settings$onClickCont === void 0 ? void 0 : _settings$onClickCont.call(settings, e);
|
|
736
|
+
},
|
|
737
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
738
|
+
var _settings$onClickCont2;
|
|
739
|
+
e.stopPropagation();
|
|
740
|
+
(_settings$onClickCont2 = settings.onClickContentEditable) === null || _settings$onClickCont2 === void 0 ? void 0 : _settings$onClickCont2.call(settings, e);
|
|
736
741
|
}
|
|
737
742
|
}, ___default['default'].omit(props, "innerRef", "onChange", "html", "onBlur", "autoFocus", "allowEdit", "initialContent")), {}, {
|
|
738
743
|
ref: function ref(e) {
|
|
@@ -930,6 +935,7 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
930
935
|
_useState2 = _slicedToArray(_useState, 2),
|
|
931
936
|
n = _useState2[0],
|
|
932
937
|
setN = _useState2[1];
|
|
938
|
+
var wrapperRf = React.useRef(null);
|
|
933
939
|
var nRef = React.useRef(n);
|
|
934
940
|
nRef.current = n;
|
|
935
941
|
React.useEffect(function () {
|
|
@@ -950,6 +956,16 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
950
956
|
refs.cellInput.current.innerHTML = core.functionHTMLGenerate(newText);
|
|
951
957
|
moveCursorToPosition(refs.cellInput.current, offsetIndex - replaceTextLength + fnName.length);
|
|
952
958
|
};
|
|
959
|
+
var viewActive = function viewActive() {
|
|
960
|
+
var _wrapperRf$current;
|
|
961
|
+
var aItem = (_wrapperRf$current = wrapperRf.current) === null || _wrapperRf$current === void 0 ? void 0 : _wrapperRf$current.querySelector(".luckysheet-formula-search-item-active");
|
|
962
|
+
if (aItem) {
|
|
963
|
+
aItem === null || aItem === void 0 ? void 0 : aItem.scrollIntoView({
|
|
964
|
+
block: "nearest",
|
|
965
|
+
behavior: "smooth"
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
};
|
|
953
969
|
React.useEffect(function () {
|
|
954
970
|
var _refs$cellInput$curre2;
|
|
955
971
|
var onChange = function onChange(e) {
|
|
@@ -966,6 +982,9 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
966
982
|
}), 0);
|
|
967
983
|
return (_fListRef$current3 = fListRef.current[(currentIndex + 1) % fListRef.current.length]) === null || _fListRef$current3 === void 0 ? void 0 : _fListRef$current3.n;
|
|
968
984
|
});
|
|
985
|
+
setTimeout(function () {
|
|
986
|
+
viewActive();
|
|
987
|
+
}, 200);
|
|
969
988
|
} else if (e.key === "ArrowUp") {
|
|
970
989
|
e.preventDefault();
|
|
971
990
|
setN(function (_n) {
|
|
@@ -975,6 +994,9 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
975
994
|
}), 0);
|
|
976
995
|
return (_fListRef$current5 = fListRef.current[(currentIndex - 1) % fListRef.current.length]) === null || _fListRef$current5 === void 0 ? void 0 : _fListRef$current5.n;
|
|
977
996
|
});
|
|
997
|
+
setTimeout(function () {
|
|
998
|
+
viewActive();
|
|
999
|
+
}, 200);
|
|
978
1000
|
} else if (e.key === "Enter") {
|
|
979
1001
|
e.preventDefault();
|
|
980
1002
|
e.stopPropagation();
|
|
@@ -996,6 +1018,7 @@ var FormulaSearch = function FormulaSearch(props) {
|
|
|
996
1018
|
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
997
1019
|
id: "luckysheet-formula-search-c",
|
|
998
1020
|
className: "luckysheet-formula-search-c",
|
|
1021
|
+
ref: wrapperRf,
|
|
999
1022
|
onWheel: function onWheel(e) {
|
|
1000
1023
|
e.preventDefault();
|
|
1001
1024
|
e.stopPropagation();
|
package/dist/index.umd.js
CHANGED
|
@@ -34073,7 +34073,9 @@
|
|
|
34073
34073
|
return 5;
|
|
34074
34074
|
}
|
|
34075
34075
|
},
|
|
34076
|
-
rules: [/^(?:\s+)/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*'[^'!])/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9\.]+(?=[(]))/, /^(?:#[A-Z0-9\/]+(!|\?)?)/, ABSOLUTE_CELL, MIXED_CELL_COL, MIXED_CELL_ROW, RELATIVE_CELL, /^(?:[A-Za-z\.]+(?=[(]))/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/,
|
|
34076
|
+
rules: [/^(?:\s+)/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*'[^'!])/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9\.]+(?=[(]))/, /^(?:#[A-Z0-9\/]+(!|\?)?)/, ABSOLUTE_CELL, MIXED_CELL_COL, MIXED_CELL_ROW, RELATIVE_CELL, /^(?:[A-Za-z\.]+(?=[(]))/, /^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/,
|
|
34077
|
+
// /^(?:[A-Za-z_]+)/,
|
|
34078
|
+
/^(?:\{\{[^{}}]+\}\})/, /^(?:[0-9]+)/, /^(?:\[(.*)?\])/, /^(?:&)/, /^(?: )/, /^(?:[.])/, /^(?::)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\/)/, /^(?:-)/, /^(?:\+)/, /^(?:\^)/, /^(?:\()/, /^(?:\))/, /^(?:>)/, /^(?:<)/, /^(?:NOT\b)/, /^(?:")/, /^(?:')/, /^(?:!)/, /^(?:=)/, /^(?:%)/, /^(?:[#])/, /^(?:$)/],
|
|
34077
34079
|
conditions: {
|
|
34078
34080
|
INITIAL: {
|
|
34079
34081
|
rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36],
|
|
@@ -34305,7 +34307,11 @@
|
|
|
34305
34307
|
this.variables[name] = value;
|
|
34306
34308
|
return this;
|
|
34307
34309
|
}
|
|
34308
|
-
|
|
34310
|
+
}, {
|
|
34311
|
+
key: "replaceVariables",
|
|
34312
|
+
value: function replaceVariables(variables) {
|
|
34313
|
+
this.variables = variables;
|
|
34314
|
+
}
|
|
34309
34315
|
/**
|
|
34310
34316
|
* Get variable name.
|
|
34311
34317
|
*
|
|
@@ -71127,22 +71133,15 @@
|
|
|
71127
71133
|
var f = [];
|
|
71128
71134
|
var s = [];
|
|
71129
71135
|
var t = [];
|
|
71130
|
-
var result_i = 0;
|
|
71131
71136
|
for (var _i17 = 0; _i17 < functionlist.length; _i17 += 1) {
|
|
71132
71137
|
var item = functionlist[_i17];
|
|
71133
71138
|
var n = item.n;
|
|
71134
71139
|
if (n === searchtxt) {
|
|
71135
71140
|
f.unshift(item);
|
|
71136
|
-
result_i += 1;
|
|
71137
71141
|
} else if (lodash.startsWith(n, searchtxt)) {
|
|
71138
71142
|
s.unshift(item);
|
|
71139
|
-
result_i += 1;
|
|
71140
71143
|
} else if (n.indexOf(searchtxt) > -1) {
|
|
71141
71144
|
t.unshift(item);
|
|
71142
|
-
result_i += 1;
|
|
71143
|
-
}
|
|
71144
|
-
if (result_i >= 10) {
|
|
71145
|
-
break;
|
|
71146
71145
|
}
|
|
71147
71146
|
}
|
|
71148
71147
|
var list = [].concat(f, s, t);
|
|
@@ -71240,7 +71239,7 @@
|
|
|
71240
71239
|
function rangeHightlightselected(ctx, $editor) {
|
|
71241
71240
|
var currSelection = getrangeseleciton();
|
|
71242
71241
|
if (!currSelection) return;
|
|
71243
|
-
var currText = lodash.
|
|
71242
|
+
var currText = lodash.trimStart(currSelection.textContent || "");
|
|
71244
71243
|
if (currText === null || currText === void 0 ? void 0 : currText.match(/^[a-zA-Z_]+$/)) {
|
|
71245
71244
|
searchFunction(ctx, currText.toUpperCase());
|
|
71246
71245
|
ctx.functionHint = null;
|
|
@@ -71358,7 +71357,7 @@
|
|
|
71358
71357
|
} else if (matchConfig.dquote > 0) {
|
|
71359
71358
|
function_str += "".concat(str, "</span>");
|
|
71360
71359
|
} else if (str.indexOf("</span>") === -1 && str.length > 0) {
|
|
71361
|
-
var regx = /{.*?}/;
|
|
71360
|
+
var regx = /{{.*?}}/;
|
|
71362
71361
|
if (regx.test(lodash.trim(str))) {
|
|
71363
71362
|
var arraytxt = regx.exec(str)[0];
|
|
71364
71363
|
var arraystart = str.search(regx);
|
|
@@ -71366,7 +71365,7 @@
|
|
|
71366
71365
|
if (arraystart > 0) {
|
|
71367
71366
|
alltxt += "<span dir=\"auto\" class=\"luckysheet-formula-text-color\">".concat(str.substr(0, arraystart), "</span>");
|
|
71368
71367
|
}
|
|
71369
|
-
alltxt += "<span dir=\"auto\" style=\"color:#
|
|
71368
|
+
alltxt += "<span dir=\"auto\" style=\"color:#3b82f4\" class=\"luckysheet-formula-text-var\">".concat(arraytxt, "</span>");
|
|
71370
71369
|
if (arraystart + arraytxt.length < str.length) {
|
|
71371
71370
|
alltxt += "<span dir=\"auto\" class=\"luckysheet-formula-text-color\">".concat(str.substr(arraystart + arraytxt.length, str.length), "</span>");
|
|
71372
71371
|
}
|
|
@@ -71404,7 +71403,9 @@
|
|
|
71404
71403
|
var value1txt = preText !== null && preText !== void 0 ? preText : $editor.innerText;
|
|
71405
71404
|
var value = $editor.innerText;
|
|
71406
71405
|
value = escapeScriptTag(value);
|
|
71407
|
-
|
|
71406
|
+
var hasF = value.length > 0 && value.substring(0, 1) === "=" && (kcode !== 229 || value.length === 1);
|
|
71407
|
+
var lastHasF = lodash.startsWith(value1txt, "=") && !lodash.startsWith(value, "=");
|
|
71408
|
+
if (hasF) {
|
|
71408
71409
|
if (!refreshRangeSelect) rangeIndexes = getRangeIndexes($editor);
|
|
71409
71410
|
value = functionHTMLGenerate(value);
|
|
71410
71411
|
if (!refreshRangeSelect && functionHTMLIndex < rangeIndexes.length) refreshRangeSelect = true;
|
|
@@ -71429,19 +71430,10 @@
|
|
|
71429
71430
|
$editor.innerHTML = value;
|
|
71430
71431
|
if ($copyTo) $copyTo.innerHTML = value;
|
|
71431
71432
|
functionRange(ctx, $editor, value, value1);
|
|
71432
|
-
|
|
71433
|
-
cancelFunctionrangeSelected(ctx);
|
|
71434
|
-
if (kcode !== 46) {
|
|
71435
|
-
createRangeHightlight(ctx, value);
|
|
71436
|
-
}
|
|
71437
|
-
ctx.formulaCache.rangestart = false;
|
|
71438
|
-
ctx.formulaCache.rangedrag_column_start = false;
|
|
71439
|
-
ctx.formulaCache.rangedrag_row_start = false;
|
|
71440
|
-
rangeHightlightselected(ctx, $editor);
|
|
71441
|
-
}
|
|
71442
|
-
} else if (lodash.startsWith(value1txt, "=") && !lodash.startsWith(value, "=")) {
|
|
71433
|
+
} else if (lastHasF) {
|
|
71443
71434
|
if ($copyTo) $copyTo.innerHTML = value;
|
|
71444
71435
|
$editor.innerHTML = escapeHTMLTag(value);
|
|
71436
|
+
ctx.formulaCache.functionRangeIndex = [0, 1];
|
|
71445
71437
|
} else if (!lodash.startsWith(value1txt, "=")) {
|
|
71446
71438
|
if (!$copyTo) return;
|
|
71447
71439
|
if ($copyTo.id === "luckysheet-rich-text-editor") {
|
|
@@ -71452,6 +71444,18 @@
|
|
|
71452
71444
|
$copyTo.innerHTML = escapeHTMLTag(value);
|
|
71453
71445
|
}
|
|
71454
71446
|
}
|
|
71447
|
+
if (hasF || lastHasF) {
|
|
71448
|
+
if (refreshRangeSelect) {
|
|
71449
|
+
cancelFunctionrangeSelected(ctx);
|
|
71450
|
+
if (kcode !== 46) {
|
|
71451
|
+
createRangeHightlight(ctx, value);
|
|
71452
|
+
}
|
|
71453
|
+
ctx.formulaCache.rangestart = false;
|
|
71454
|
+
ctx.formulaCache.rangedrag_column_start = false;
|
|
71455
|
+
ctx.formulaCache.rangedrag_row_start = false;
|
|
71456
|
+
rangeHightlightselected(ctx, $editor);
|
|
71457
|
+
}
|
|
71458
|
+
}
|
|
71455
71459
|
}
|
|
71456
71460
|
function isfreezonFuc(txt) {
|
|
71457
71461
|
var row = txt.replace(/[^0-9]/g, "");
|
|
@@ -90167,6 +90171,19 @@
|
|
|
90167
90171
|
}
|
|
90168
90172
|
}
|
|
90169
90173
|
}
|
|
90174
|
+
function setCellValues(ctx, data, cellInput) {
|
|
90175
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
90176
|
+
if (data == null) {
|
|
90177
|
+
throw INVALID_PARAMS;
|
|
90178
|
+
}
|
|
90179
|
+
for (var j = 0; j < data.length; j += 1) {
|
|
90180
|
+
var _data$j = data[j],
|
|
90181
|
+
r = _data$j.r,
|
|
90182
|
+
c = _data$j.c,
|
|
90183
|
+
v = _data$j.v;
|
|
90184
|
+
setCellValue$1(ctx, r, c, v, cellInput, options);
|
|
90185
|
+
}
|
|
90186
|
+
}
|
|
90170
90187
|
function setCellFormatByRange(ctx, attr, value, range) {
|
|
90171
90188
|
var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
90172
90189
|
if (lodash.isPlainObject(range)) {
|
|
@@ -90291,6 +90308,7 @@
|
|
|
90291
90308
|
getHtmlByRange: getHtmlByRange,
|
|
90292
90309
|
setSelection: setSelection,
|
|
90293
90310
|
setCellValuesByRange: setCellValuesByRange,
|
|
90311
|
+
setCellValues: setCellValues,
|
|
90294
90312
|
setCellFormatByRange: setCellFormatByRange,
|
|
90295
90313
|
mergeCells: mergeCells$1,
|
|
90296
90314
|
cancelMerge: cancelMerge,
|
|
@@ -90311,8 +90329,12 @@
|
|
|
90311
90329
|
});
|
|
90312
90330
|
|
|
90313
90331
|
var defaultSettings = {
|
|
90332
|
+
toolbarRightRender: undefined,
|
|
90333
|
+
onClickContentEditable: undefined,
|
|
90334
|
+
renderCustomColor: undefined,
|
|
90314
90335
|
renderFormulaHint: undefined,
|
|
90315
90336
|
renderFormulaSearch: undefined,
|
|
90337
|
+
renderEditorSelector: undefined,
|
|
90316
90338
|
copyRich: false,
|
|
90317
90339
|
renderCalcInfo: undefined,
|
|
90318
90340
|
renderFreezeCol: undefined,
|
|
@@ -92602,14 +92624,32 @@
|
|
|
92602
92624
|
};
|
|
92603
92625
|
};
|
|
92604
92626
|
var getCellMcBorder = function getCellMcBorder(ctx, domStyle, row_index, col_index, mc) {
|
|
92605
|
-
var keys = [["border-left", "borderLeftWidth", "borderLeftColor", "borderLeftStyle"
|
|
92627
|
+
var keys = [["border-left", "borderLeftWidth", "borderLeftColor", "borderLeftStyle", function (curIndex, rs) {
|
|
92628
|
+
return [curIndex, curIndex + rs - 1];
|
|
92629
|
+
}, function (curIndex) {
|
|
92630
|
+
return [curIndex, curIndex];
|
|
92631
|
+
}], ["border-top", "borderTopWidth", "borderTopColor", "borderTopStyle", function (curIndex) {
|
|
92632
|
+
return [curIndex, curIndex];
|
|
92633
|
+
}, function (curIndex, cs) {
|
|
92634
|
+
return [curIndex, curIndex + cs - 1];
|
|
92635
|
+
}], ["border-right", "borderRightWidth", "borderRightColor", "borderRightStyle", function (curIndex, rs) {
|
|
92636
|
+
return [curIndex, curIndex + rs - 1];
|
|
92637
|
+
}, function (curIndex, cs) {
|
|
92638
|
+
return [curIndex + cs - 1, curIndex + cs - 1];
|
|
92639
|
+
}], ["border-bottom", "borderBottomWidth", "borderBottomColor", "borderBottomStyle", function (curIndex, cs) {
|
|
92640
|
+
return [curIndex + cs - 1, curIndex + cs - 1];
|
|
92641
|
+
}, function (curIndex, cs) {
|
|
92642
|
+
return [curIndex, curIndex + cs - 1];
|
|
92643
|
+
}]];
|
|
92606
92644
|
var result = [];
|
|
92607
92645
|
for (var index = 0; index < keys.length; index += 1) {
|
|
92608
|
-
var _keys$index2 = _slicedToArray$2(keys[index],
|
|
92646
|
+
var _keys$index2 = _slicedToArray$2(keys[index], 6),
|
|
92609
92647
|
p = _keys$index2[0],
|
|
92610
92648
|
w = _keys$index2[1],
|
|
92611
92649
|
c = _keys$index2[2],
|
|
92612
|
-
s = _keys$index2[3]
|
|
92650
|
+
s = _keys$index2[3],
|
|
92651
|
+
getRow = _keys$index2[4],
|
|
92652
|
+
getColumn = _keys$index2[5];
|
|
92613
92653
|
if (parseFloat(domStyle[w]) > 0 && domStyle[s] !== "inset") {
|
|
92614
92654
|
var _getQKBorder = getQKBorder(domStyle[w], domStyle[s], domStyle[c]),
|
|
92615
92655
|
_getQKBorder2 = _slicedToArray$2(_getQKBorder, 2),
|
|
@@ -92621,8 +92661,8 @@
|
|
|
92621
92661
|
color: color,
|
|
92622
92662
|
style: style,
|
|
92623
92663
|
range: normalizeSelection(ctx, [{
|
|
92624
|
-
row:
|
|
92625
|
-
column:
|
|
92664
|
+
row: getRow(row_index, mc.rs),
|
|
92665
|
+
column: getColumn(col_index, mc.cs)
|
|
92626
92666
|
}])
|
|
92627
92667
|
});
|
|
92628
92668
|
}
|
|
@@ -92669,13 +92709,17 @@
|
|
|
92669
92709
|
}
|
|
92670
92710
|
var result = [];
|
|
92671
92711
|
var borderInfo = [];
|
|
92712
|
+
var startOffColIndexMap = {};
|
|
92672
92713
|
for (var index = 0; index < (rows === null || rows === void 0 ? void 0 : rows.length); index += 1) {
|
|
92673
92714
|
var row = rows[index];
|
|
92715
|
+
var isFirstNoRs = false;
|
|
92674
92716
|
var cells = row.querySelectorAll("td");
|
|
92675
92717
|
if (!result[index]) {
|
|
92676
92718
|
result[index] = [];
|
|
92677
92719
|
}
|
|
92720
|
+
var offsetColIndex = 0;
|
|
92678
92721
|
for (var cIndex = 0; cIndex < cells.length; cIndex += 1) {
|
|
92722
|
+
var _colIndex = startCol + offsetColIndex + (startOffColIndexMap[index] || 0);
|
|
92679
92723
|
var cell = cells[cIndex];
|
|
92680
92724
|
var m = cell === null || cell === void 0 ? void 0 : cell.textContent;
|
|
92681
92725
|
var v = cell.getAttribute("x:num");
|
|
@@ -92690,13 +92734,46 @@
|
|
|
92690
92734
|
if (colspan > 1 || rowspan > 1) {
|
|
92691
92735
|
mainCell.mc = {
|
|
92692
92736
|
rs: rowspan,
|
|
92693
|
-
cs: colspan
|
|
92737
|
+
cs: colspan,
|
|
92738
|
+
r: index + startRow,
|
|
92739
|
+
c: _colIndex
|
|
92694
92740
|
};
|
|
92695
|
-
borderInfo.push.apply(borderInfo, _toConsumableArray$2(getCellMcBorder(ctx, style, index + startRow,
|
|
92741
|
+
borderInfo.push.apply(borderInfo, _toConsumableArray$2(getCellMcBorder(ctx, style, index + startRow, _colIndex, mainCell.mc)));
|
|
92696
92742
|
} else {
|
|
92697
|
-
|
|
92743
|
+
isFirstNoRs = true;
|
|
92744
|
+
borderInfo.push(getCellBorder(style, index + startRow, _colIndex));
|
|
92698
92745
|
}
|
|
92699
92746
|
result[index].push(mainCell);
|
|
92747
|
+
if (rowspan > 1) {
|
|
92748
|
+
for (var rs_index = 1; rs_index < rowspan; rs_index += 1) {
|
|
92749
|
+
if (!result[index + rs_index]) {
|
|
92750
|
+
result[index + rs_index] = [];
|
|
92751
|
+
}
|
|
92752
|
+
result[index + rs_index].push({
|
|
92753
|
+
mc: {
|
|
92754
|
+
r: index + startRow,
|
|
92755
|
+
c: _colIndex
|
|
92756
|
+
}
|
|
92757
|
+
});
|
|
92758
|
+
if (!isFirstNoRs) {
|
|
92759
|
+
if (!startOffColIndexMap[index + rs_index]) {
|
|
92760
|
+
startOffColIndexMap[index + rs_index] = 0;
|
|
92761
|
+
}
|
|
92762
|
+
startOffColIndexMap[index + rs_index] += colspan || 1;
|
|
92763
|
+
}
|
|
92764
|
+
}
|
|
92765
|
+
}
|
|
92766
|
+
if (colspan > 1) {
|
|
92767
|
+
for (var cs_index = 1; cs_index < colspan; cs_index += 1) {
|
|
92768
|
+
result[index].push({
|
|
92769
|
+
mc: {
|
|
92770
|
+
r: index + startRow,
|
|
92771
|
+
c: _colIndex
|
|
92772
|
+
}
|
|
92773
|
+
});
|
|
92774
|
+
}
|
|
92775
|
+
}
|
|
92776
|
+
offsetColIndex += colspan || 1;
|
|
92700
92777
|
} else {
|
|
92701
92778
|
result[index].push({
|
|
92702
92779
|
m: m,
|
|
@@ -92710,57 +92787,6 @@
|
|
|
92710
92787
|
borderInfo: borderInfo
|
|
92711
92788
|
};
|
|
92712
92789
|
}
|
|
92713
|
-
function expandMergedCells(mergedCells, startRow, startCol) {
|
|
92714
|
-
if (!mergedCells || mergedCells.length === 0) {
|
|
92715
|
-
return [];
|
|
92716
|
-
}
|
|
92717
|
-
var totalRows = mergedCells === null || mergedCells === void 0 ? void 0 : mergedCells.length;
|
|
92718
|
-
var totalCols = 0;
|
|
92719
|
-
for (var j = 0; j < mergedCells[0].length; j += 1) {
|
|
92720
|
-
var _mergedCells$0$j, _mergedCells$0$j$mc;
|
|
92721
|
-
totalCols += ((_mergedCells$0$j = mergedCells[0][j]) === null || _mergedCells$0$j === void 0 ? void 0 : (_mergedCells$0$j$mc = _mergedCells$0$j.mc) === null || _mergedCells$0$j$mc === void 0 ? void 0 : _mergedCells$0$j$mc.cs) || 1;
|
|
92722
|
-
}
|
|
92723
|
-
var result = Array.from({
|
|
92724
|
-
length: totalRows
|
|
92725
|
-
}, function () {
|
|
92726
|
-
return new Array(totalCols);
|
|
92727
|
-
});
|
|
92728
|
-
var currentRow = 0;
|
|
92729
|
-
for (var i = 0; i < mergedCells.length; i += 1) {
|
|
92730
|
-
var currentCol = 0;
|
|
92731
|
-
var rowHeight = 0;
|
|
92732
|
-
for (var _j7 = 0; _j7 < mergedCells[i].length; _j7 += 1) {
|
|
92733
|
-
var _cell$mc2, _cell$mc3;
|
|
92734
|
-
var cell = mergedCells[i][_j7];
|
|
92735
|
-
var rs = (cell === null || cell === void 0 ? void 0 : (_cell$mc2 = cell.mc) === null || _cell$mc2 === void 0 ? void 0 : _cell$mc2.rs) || 1;
|
|
92736
|
-
var cs = (cell === null || cell === void 0 ? void 0 : (_cell$mc3 = cell.mc) === null || _cell$mc3 === void 0 ? void 0 : _cell$mc3.cs) || 1;
|
|
92737
|
-
rowHeight = Math.max(rowHeight, rs);
|
|
92738
|
-
for (var r = 0; r < rs; r += 1) {
|
|
92739
|
-
for (var c = 0; c < cs; c += 1) {
|
|
92740
|
-
var mcR = currentRow + startRow;
|
|
92741
|
-
var mcC = currentCol + startCol;
|
|
92742
|
-
if (r === 0 && c === 0) {
|
|
92743
|
-
result[currentRow + r][currentCol + c] = _objectSpread2$1({}, cell);
|
|
92744
|
-
if (result[currentRow + r][currentCol + c].mc) {
|
|
92745
|
-
result[currentRow + r][currentCol + c].mc.r = mcR;
|
|
92746
|
-
result[currentRow + r][currentCol + c].mc.c = mcC;
|
|
92747
|
-
}
|
|
92748
|
-
} else {
|
|
92749
|
-
result[currentRow + r][currentCol + c] = {
|
|
92750
|
-
mc: {
|
|
92751
|
-
r: mcR,
|
|
92752
|
-
c: mcC
|
|
92753
|
-
}
|
|
92754
|
-
};
|
|
92755
|
-
}
|
|
92756
|
-
}
|
|
92757
|
-
}
|
|
92758
|
-
currentCol += cs;
|
|
92759
|
-
}
|
|
92760
|
-
currentRow += rowHeight;
|
|
92761
|
-
}
|
|
92762
|
-
return result;
|
|
92763
|
-
}
|
|
92764
92790
|
function handlePasteByLeanklin(_x2, _x3, _x4) {
|
|
92765
92791
|
return _handlePasteByLeanklin.apply(this, arguments);
|
|
92766
92792
|
}
|
|
@@ -92796,7 +92822,7 @@
|
|
|
92796
92822
|
}
|
|
92797
92823
|
index = getSheetIndex(ctx, ctx.currentSheetId);
|
|
92798
92824
|
ctx.luckysheetfile[index].config = ctx.config;
|
|
92799
|
-
data =
|
|
92825
|
+
data = copyData;
|
|
92800
92826
|
copyOne = data.length === 1 && data[0].length === 1 && !((_data$0$ = data[0][0]) === null || _data$0$ === void 0 ? void 0 : _data$0$.mc);
|
|
92801
92827
|
pasteData = copyOne ? [] : data;
|
|
92802
92828
|
if (copyOne) {
|
|
@@ -94045,6 +94071,11 @@
|
|
|
94045
94071
|
var _settings$onClickCont;
|
|
94046
94072
|
e.stopPropagation();
|
|
94047
94073
|
(_settings$onClickCont = settings.onClickContentEditable) === null || _settings$onClickCont === void 0 ? void 0 : _settings$onClickCont.call(settings, e);
|
|
94074
|
+
},
|
|
94075
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
94076
|
+
var _settings$onClickCont2;
|
|
94077
|
+
e.stopPropagation();
|
|
94078
|
+
(_settings$onClickCont2 = settings.onClickContentEditable) === null || _settings$onClickCont2 === void 0 ? void 0 : _settings$onClickCont2.call(settings, e);
|
|
94048
94079
|
}
|
|
94049
94080
|
}, lodash.omit(props, "innerRef", "onChange", "html", "onBlur", "autoFocus", "allowEdit", "initialContent")), {}, {
|
|
94050
94081
|
ref: function ref(e) {
|
|
@@ -94242,6 +94273,7 @@
|
|
|
94242
94273
|
_useState2 = _slicedToArray(_useState, 2),
|
|
94243
94274
|
n = _useState2[0],
|
|
94244
94275
|
setN = _useState2[1];
|
|
94276
|
+
var wrapperRf = React.useRef(null);
|
|
94245
94277
|
var nRef = React.useRef(n);
|
|
94246
94278
|
nRef.current = n;
|
|
94247
94279
|
React.useEffect(function () {
|
|
@@ -94262,6 +94294,16 @@
|
|
|
94262
94294
|
refs.cellInput.current.innerHTML = functionHTMLGenerate(newText);
|
|
94263
94295
|
moveCursorToPosition(refs.cellInput.current, offsetIndex - replaceTextLength + fnName.length);
|
|
94264
94296
|
};
|
|
94297
|
+
var viewActive = function viewActive() {
|
|
94298
|
+
var _wrapperRf$current;
|
|
94299
|
+
var aItem = (_wrapperRf$current = wrapperRf.current) === null || _wrapperRf$current === void 0 ? void 0 : _wrapperRf$current.querySelector(".luckysheet-formula-search-item-active");
|
|
94300
|
+
if (aItem) {
|
|
94301
|
+
aItem === null || aItem === void 0 ? void 0 : aItem.scrollIntoView({
|
|
94302
|
+
block: "nearest",
|
|
94303
|
+
behavior: "smooth"
|
|
94304
|
+
});
|
|
94305
|
+
}
|
|
94306
|
+
};
|
|
94265
94307
|
React.useEffect(function () {
|
|
94266
94308
|
var _refs$cellInput$curre2;
|
|
94267
94309
|
var onChange = function onChange(e) {
|
|
@@ -94278,6 +94320,9 @@
|
|
|
94278
94320
|
}), 0);
|
|
94279
94321
|
return (_fListRef$current3 = fListRef.current[(currentIndex + 1) % fListRef.current.length]) === null || _fListRef$current3 === void 0 ? void 0 : _fListRef$current3.n;
|
|
94280
94322
|
});
|
|
94323
|
+
setTimeout(function () {
|
|
94324
|
+
viewActive();
|
|
94325
|
+
}, 200);
|
|
94281
94326
|
} else if (e.key === "ArrowUp") {
|
|
94282
94327
|
e.preventDefault();
|
|
94283
94328
|
setN(function (_n) {
|
|
@@ -94287,6 +94332,9 @@
|
|
|
94287
94332
|
}), 0);
|
|
94288
94333
|
return (_fListRef$current5 = fListRef.current[(currentIndex - 1) % fListRef.current.length]) === null || _fListRef$current5 === void 0 ? void 0 : _fListRef$current5.n;
|
|
94289
94334
|
});
|
|
94335
|
+
setTimeout(function () {
|
|
94336
|
+
viewActive();
|
|
94337
|
+
}, 200);
|
|
94290
94338
|
} else if (e.key === "Enter") {
|
|
94291
94339
|
e.preventDefault();
|
|
94292
94340
|
e.stopPropagation();
|
|
@@ -94308,6 +94356,7 @@
|
|
|
94308
94356
|
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
94309
94357
|
id: "luckysheet-formula-search-c",
|
|
94310
94358
|
className: "luckysheet-formula-search-c",
|
|
94359
|
+
ref: wrapperRf,
|
|
94311
94360
|
onWheel: function onWheel(e) {
|
|
94312
94361
|
e.preventDefault();
|
|
94313
94362
|
e.stopPropagation();
|