@leankylin-sheet/core 5.2.26 → 5.2.27
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 +98 -95
- package/dist/index.js +98 -95
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -53788,119 +53788,122 @@ function getSearchIndexArr(searchText, range, flowdata) {
|
|
|
53788
53788
|
}
|
|
53789
53789
|
return arr;
|
|
53790
53790
|
}
|
|
53791
|
+
function searchSheet(searchText, checkModes, sheet) {
|
|
53792
|
+
var searchType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "v";
|
|
53793
|
+
var flowdata = sheet.data;
|
|
53794
|
+
if (!flowdata || flowdata.length === 0 || flowdata[0].length === 0) {
|
|
53795
|
+
return [];
|
|
53796
|
+
}
|
|
53797
|
+
var range = [{
|
|
53798
|
+
row: [0, flowdata.length - 1],
|
|
53799
|
+
column: [0, flowdata[0].length - 1]
|
|
53800
|
+
}];
|
|
53801
|
+
return getSearchIndexArr(searchText, range, flowdata, checkModes, searchType);
|
|
53802
|
+
}
|
|
53791
53803
|
function searchNext(ctx, searchText, checkModes) {
|
|
53792
|
-
var
|
|
53804
|
+
var _getSheetIndex, _currentSelection$0$r, _currentSelection$, _currentSelection$0$c, _currentSelection$2;
|
|
53793
53805
|
var searchType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "v";
|
|
53794
53806
|
var _locale = locale(ctx),
|
|
53795
53807
|
findAndReplace = _locale.findAndReplace;
|
|
53796
|
-
|
|
53797
|
-
if (searchText === "" || searchText == null || flowdata == null) {
|
|
53808
|
+
if (searchText === "" || searchText == null) {
|
|
53798
53809
|
return findAndReplace.searchInputTip;
|
|
53799
53810
|
}
|
|
53800
|
-
var
|
|
53801
|
-
if (
|
|
53802
|
-
range = [{
|
|
53803
|
-
row: [0, flowdata.length - 1],
|
|
53804
|
-
column: [0, flowdata[0].length - 1],
|
|
53805
|
-
row_focus: 0,
|
|
53806
|
-
column_focus: 0
|
|
53807
|
-
}];
|
|
53808
|
-
} else {
|
|
53809
|
-
range = _.assign([], ctx.luckysheet_select_save);
|
|
53810
|
-
}
|
|
53811
|
-
var searchIndexArr = getSearchIndexArr(searchText, range, flowdata, checkModes, searchType);
|
|
53812
|
-
if (searchIndexArr.length === 0) {
|
|
53811
|
+
var sheets = ctx.luckysheetfile;
|
|
53812
|
+
if (!sheets || sheets.length === 0) {
|
|
53813
53813
|
return findAndReplace.noFindTip;
|
|
53814
53814
|
}
|
|
53815
|
-
var
|
|
53816
|
-
|
|
53817
|
-
|
|
53818
|
-
|
|
53819
|
-
|
|
53820
|
-
|
|
53821
|
-
|
|
53822
|
-
|
|
53823
|
-
|
|
53824
|
-
|
|
53825
|
-
|
|
53826
|
-
|
|
53815
|
+
var currentSheetIndex = (_getSheetIndex = getSheetIndex(ctx, ctx.currentSheetId)) !== null && _getSheetIndex !== void 0 ? _getSheetIndex : 0;
|
|
53816
|
+
var currentSelection = ctx.luckysheet_select_save;
|
|
53817
|
+
var currentR = (_currentSelection$0$r = currentSelection === null || currentSelection === void 0 ? void 0 : (_currentSelection$ = currentSelection[0]) === null || _currentSelection$ === void 0 ? void 0 : _currentSelection$.row_focus) !== null && _currentSelection$0$r !== void 0 ? _currentSelection$0$r : -1;
|
|
53818
|
+
var currentC = (_currentSelection$0$c = currentSelection === null || currentSelection === void 0 ? void 0 : (_currentSelection$2 = currentSelection[0]) === null || _currentSelection$2 === void 0 ? void 0 : _currentSelection$2.column_focus) !== null && _currentSelection$0$c !== void 0 ? _currentSelection$0$c : -1;
|
|
53819
|
+
var totalSheets = sheets.length;
|
|
53820
|
+
for (var offset = 0; offset < totalSheets; offset += 1) {
|
|
53821
|
+
var sheetIdx = (currentSheetIndex + offset) % totalSheets;
|
|
53822
|
+
var sheet = sheets[sheetIdx];
|
|
53823
|
+
var matches = searchSheet(searchText, checkModes, sheet, searchType);
|
|
53824
|
+
if (matches.length === 0) continue;
|
|
53825
|
+
var foundMatch = null;
|
|
53826
|
+
if (offset === 0 && currentR >= 0 && currentC >= 0) {
|
|
53827
|
+
for (var i = 0; i < matches.length; i += 1) {
|
|
53828
|
+
var m = matches[i];
|
|
53829
|
+
if (m.r > currentR || m.r === currentR && m.c > currentC) {
|
|
53830
|
+
foundMatch = m;
|
|
53827
53831
|
break;
|
|
53828
53832
|
}
|
|
53829
53833
|
}
|
|
53830
53834
|
}
|
|
53831
|
-
|
|
53832
|
-
|
|
53833
|
-
|
|
53834
|
-
}
|
|
53835
|
-
|
|
53836
|
-
|
|
53837
|
-
|
|
53838
|
-
|
|
53839
|
-
|
|
53840
|
-
if (_i === searchIndexArr.length - 1) {
|
|
53841
|
-
count = 0;
|
|
53842
|
-
} else {
|
|
53843
|
-
count = _i + 1;
|
|
53844
|
-
}
|
|
53845
|
-
break;
|
|
53835
|
+
if (!foundMatch && offset > 0) {
|
|
53836
|
+
var _matches = _slicedToArray(matches, 1);
|
|
53837
|
+
foundMatch = _matches[0];
|
|
53838
|
+
}
|
|
53839
|
+
if (!foundMatch && offset === 0 && matches.length > 0) {
|
|
53840
|
+
var _matches2 = _slicedToArray(matches, 1);
|
|
53841
|
+
foundMatch = _matches2[0];
|
|
53842
|
+
if (matches.length === 1 && matches[0].r === currentR && matches[0].c === currentC) {
|
|
53843
|
+
foundMatch = null;
|
|
53846
53844
|
}
|
|
53847
53845
|
}
|
|
53848
|
-
|
|
53849
|
-
|
|
53850
|
-
|
|
53851
|
-
var c1 = range[s].column[0];
|
|
53852
|
-
var c2 = range[s].column[1];
|
|
53853
|
-
if (searchIndexArr[count].r >= r1 && searchIndexArr[count].r <= r2 && searchIndexArr[count].c >= c1 && searchIndexArr[count].c <= c2) {
|
|
53854
|
-
var obj = range[s];
|
|
53855
|
-
obj.row_focus = searchIndexArr[count].r;
|
|
53856
|
-
obj.column_focus = searchIndexArr[count].c;
|
|
53857
|
-
range.splice(s, 1);
|
|
53858
|
-
range.push(obj);
|
|
53859
|
-
break;
|
|
53846
|
+
if (foundMatch) {
|
|
53847
|
+
if (sheetIdx !== currentSheetIndex) {
|
|
53848
|
+
changeSheet(ctx, sheet.id);
|
|
53860
53849
|
}
|
|
53850
|
+
ctx.luckysheet_select_save = normalizeSelection(ctx, [{
|
|
53851
|
+
row: [foundMatch.r, foundMatch.r],
|
|
53852
|
+
column: [foundMatch.c, foundMatch.c]
|
|
53853
|
+
}]);
|
|
53854
|
+
scrollToHighlightCell(ctx, foundMatch.r, foundMatch.c);
|
|
53855
|
+
return null;
|
|
53861
53856
|
}
|
|
53862
|
-
ctx.luckysheet_select_save = range;
|
|
53863
53857
|
}
|
|
53864
|
-
|
|
53865
|
-
return null;
|
|
53858
|
+
return findAndReplace.noFindTip;
|
|
53866
53859
|
}
|
|
53867
53860
|
function searchAll(ctx, searchText, checkModes) {
|
|
53868
|
-
var _ctx$luckysheet_selec3;
|
|
53869
53861
|
var searchType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "v";
|
|
53870
|
-
var flowdata = getFlowdata(ctx);
|
|
53871
53862
|
var searchResult = [];
|
|
53872
|
-
if (searchText === "" || searchText == null
|
|
53863
|
+
if (searchText === "" || searchText == null) {
|
|
53873
53864
|
return searchResult;
|
|
53874
53865
|
}
|
|
53875
|
-
var
|
|
53876
|
-
if (
|
|
53877
|
-
range = [{
|
|
53878
|
-
row: [0, flowdata.length - 1],
|
|
53879
|
-
column: [0, flowdata[0].length - 1]
|
|
53880
|
-
}];
|
|
53881
|
-
} else {
|
|
53882
|
-
range = _.assign([], ctx.luckysheet_select_save);
|
|
53883
|
-
}
|
|
53884
|
-
var searchIndexArr = getSearchIndexArr(searchText, range, flowdata, checkModes, searchType);
|
|
53885
|
-
if (searchIndexArr.length === 0) {
|
|
53866
|
+
var sheets = ctx.luckysheetfile;
|
|
53867
|
+
if (!sheets || sheets.length === 0) {
|
|
53886
53868
|
return searchResult;
|
|
53887
53869
|
}
|
|
53888
|
-
|
|
53889
|
-
|
|
53890
|
-
var
|
|
53891
|
-
|
|
53892
|
-
|
|
53893
|
-
|
|
53894
|
-
|
|
53895
|
-
|
|
53896
|
-
|
|
53897
|
-
|
|
53898
|
-
|
|
53870
|
+
var firstMatch = null;
|
|
53871
|
+
for (var sheetIdx = 0; sheetIdx < sheets.length; sheetIdx += 1) {
|
|
53872
|
+
var sheet = sheets[sheetIdx];
|
|
53873
|
+
var matches = searchSheet(searchText, checkModes, sheet, searchType);
|
|
53874
|
+
if (matches.length === 0) continue;
|
|
53875
|
+
var flowdata = sheet.data;
|
|
53876
|
+
if (!flowdata) continue;
|
|
53877
|
+
for (var i = 0; i < matches.length; i += 1) {
|
|
53878
|
+
var match = matches[i];
|
|
53879
|
+
var value_ShowEs = valueShowEs(match.r, match.c, flowdata).toString();
|
|
53880
|
+
searchResult.push({
|
|
53881
|
+
r: match.r,
|
|
53882
|
+
c: match.c,
|
|
53883
|
+
sheetName: sheet.name,
|
|
53884
|
+
sheetId: sheet.id,
|
|
53885
|
+
cellPosition: "".concat(chatatABC(match.c)).concat(match.r + 1),
|
|
53886
|
+
value: value_ShowEs
|
|
53887
|
+
});
|
|
53888
|
+
if (!firstMatch) {
|
|
53889
|
+
firstMatch = {
|
|
53890
|
+
r: match.r,
|
|
53891
|
+
c: match.c,
|
|
53892
|
+
sheetId: sheet.id
|
|
53893
|
+
};
|
|
53894
|
+
}
|
|
53895
|
+
}
|
|
53896
|
+
}
|
|
53897
|
+
if (firstMatch) {
|
|
53898
|
+
if (firstMatch.sheetId !== ctx.currentSheetId) {
|
|
53899
|
+
changeSheet(ctx, firstMatch.sheetId);
|
|
53900
|
+
}
|
|
53901
|
+
ctx.luckysheet_select_save = normalizeSelection(ctx, [{
|
|
53902
|
+
row: [firstMatch.r, firstMatch.r],
|
|
53903
|
+
column: [firstMatch.c, firstMatch.c]
|
|
53904
|
+
}]);
|
|
53905
|
+
scrollToHighlightCell(ctx, firstMatch.r, firstMatch.c);
|
|
53899
53906
|
}
|
|
53900
|
-
ctx.luckysheet_select_save = normalizeSelection(ctx, [{
|
|
53901
|
-
row: [searchIndexArr[0].r, searchIndexArr[0].r],
|
|
53902
|
-
column: [searchIndexArr[0].c, searchIndexArr[0].c]
|
|
53903
|
-
}]);
|
|
53904
53907
|
return searchResult;
|
|
53905
53908
|
}
|
|
53906
53909
|
function onSearchDialogMoveStart(globalCache, e, container) {
|
|
@@ -53949,7 +53952,7 @@ function onSearchDialogMoveEnd(globalCache) {
|
|
|
53949
53952
|
_.set(globalCache, "searchDialog.moveProps", undefined);
|
|
53950
53953
|
}
|
|
53951
53954
|
function replace(ctx, searchText, replaceText, checkModes) {
|
|
53952
|
-
var _ctx$
|
|
53955
|
+
var _ctx$luckysheet_selec, _ctx$luckysheet_selec2;
|
|
53953
53956
|
var searchType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "v";
|
|
53954
53957
|
var _locale2 = locale(ctx),
|
|
53955
53958
|
findAndReplace = _locale2.findAndReplace;
|
|
@@ -53962,7 +53965,7 @@ function replace(ctx, searchText, replaceText, checkModes) {
|
|
|
53962
53965
|
return findAndReplace.searchInputTip;
|
|
53963
53966
|
}
|
|
53964
53967
|
var range;
|
|
53965
|
-
if (_.size(ctx.luckysheet_select_save) === 0 || ((_ctx$
|
|
53968
|
+
if (_.size(ctx.luckysheet_select_save) === 0 || ((_ctx$luckysheet_selec = ctx.luckysheet_select_save) === null || _ctx$luckysheet_selec === void 0 ? void 0 : _ctx$luckysheet_selec.length) === 1 && ctx.luckysheet_select_save[0].row[0] === ctx.luckysheet_select_save[0].row[1] && ctx.luckysheet_select_save[0].column[0] === ctx.luckysheet_select_save[0].column[1]) {
|
|
53966
53969
|
range = [{
|
|
53967
53970
|
row: [0, flowdata.length - 1],
|
|
53968
53971
|
column: [0, flowdata[0].length - 1]
|
|
@@ -53975,7 +53978,7 @@ function replace(ctx, searchText, replaceText, checkModes) {
|
|
|
53975
53978
|
return findAndReplace.noReplceTip;
|
|
53976
53979
|
}
|
|
53977
53980
|
var count = null;
|
|
53978
|
-
var last = (_ctx$
|
|
53981
|
+
var last = (_ctx$luckysheet_selec2 = ctx.luckysheet_select_save) === null || _ctx$luckysheet_selec2 === void 0 ? void 0 : _ctx$luckysheet_selec2[ctx.luckysheet_select_save.length - 1];
|
|
53979
53982
|
var rf = last === null || last === void 0 ? void 0 : last.row_focus;
|
|
53980
53983
|
var cf = last === null || last === void 0 ? void 0 : last.column_focus;
|
|
53981
53984
|
for (var i = 0; i < searchIndexArr.length; i += 1) {
|
|
@@ -54018,7 +54021,7 @@ function replace(ctx, searchText, replaceText, checkModes) {
|
|
|
54018
54021
|
return null;
|
|
54019
54022
|
}
|
|
54020
54023
|
function replaceAll(ctx, searchText, replaceText, checkModes) {
|
|
54021
|
-
var _ctx$
|
|
54024
|
+
var _ctx$luckysheet_selec3;
|
|
54022
54025
|
var searchType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "v";
|
|
54023
54026
|
var _locale3 = locale(ctx),
|
|
54024
54027
|
findAndReplace = _locale3.findAndReplace;
|
|
@@ -54031,7 +54034,7 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
|
|
|
54031
54034
|
return findAndReplace.searchInputTip;
|
|
54032
54035
|
}
|
|
54033
54036
|
var range;
|
|
54034
|
-
if (_.size(ctx.luckysheet_select_save) === 0 || ((_ctx$
|
|
54037
|
+
if (_.size(ctx.luckysheet_select_save) === 0 || ((_ctx$luckysheet_selec3 = ctx.luckysheet_select_save) === null || _ctx$luckysheet_selec3 === void 0 ? void 0 : _ctx$luckysheet_selec3.length) === 1 && ctx.luckysheet_select_save[0].row[0] === ctx.luckysheet_select_save[0].row[1] && ctx.luckysheet_select_save[0].column[0] === ctx.luckysheet_select_save[0].column[1]) {
|
|
54035
54038
|
range = [{
|
|
54036
54039
|
row: [0, flowdata.length - 1],
|
|
54037
54040
|
column: [0, flowdata[0].length - 1]
|
|
@@ -54064,9 +54067,9 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
|
|
|
54064
54067
|
} else {
|
|
54065
54068
|
reg = new RegExp(getRegExpStr(searchText), "ig");
|
|
54066
54069
|
}
|
|
54067
|
-
for (var
|
|
54068
|
-
var _r = searchIndexArr[
|
|
54069
|
-
var _c = searchIndexArr[
|
|
54070
|
+
for (var _i = 0; _i < searchIndexArr.length; _i += 1) {
|
|
54071
|
+
var _r = searchIndexArr[_i].r;
|
|
54072
|
+
var _c = searchIndexArr[_i].c;
|
|
54070
54073
|
var _v2 = valueShowEs(_r, _c, d).toString().replace(reg, replaceText);
|
|
54071
54074
|
setCellValue(ctx, _r, _c, d, _v2);
|
|
54072
54075
|
range.push({
|
package/dist/index.js
CHANGED
|
@@ -53798,119 +53798,122 @@ function getSearchIndexArr(searchText, range, flowdata) {
|
|
|
53798
53798
|
}
|
|
53799
53799
|
return arr;
|
|
53800
53800
|
}
|
|
53801
|
+
function searchSheet(searchText, checkModes, sheet) {
|
|
53802
|
+
var searchType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "v";
|
|
53803
|
+
var flowdata = sheet.data;
|
|
53804
|
+
if (!flowdata || flowdata.length === 0 || flowdata[0].length === 0) {
|
|
53805
|
+
return [];
|
|
53806
|
+
}
|
|
53807
|
+
var range = [{
|
|
53808
|
+
row: [0, flowdata.length - 1],
|
|
53809
|
+
column: [0, flowdata[0].length - 1]
|
|
53810
|
+
}];
|
|
53811
|
+
return getSearchIndexArr(searchText, range, flowdata, checkModes, searchType);
|
|
53812
|
+
}
|
|
53801
53813
|
function searchNext(ctx, searchText, checkModes) {
|
|
53802
|
-
var
|
|
53814
|
+
var _getSheetIndex, _currentSelection$0$r, _currentSelection$, _currentSelection$0$c, _currentSelection$2;
|
|
53803
53815
|
var searchType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "v";
|
|
53804
53816
|
var _locale = locale(ctx),
|
|
53805
53817
|
findAndReplace = _locale.findAndReplace;
|
|
53806
|
-
|
|
53807
|
-
if (searchText === "" || searchText == null || flowdata == null) {
|
|
53818
|
+
if (searchText === "" || searchText == null) {
|
|
53808
53819
|
return findAndReplace.searchInputTip;
|
|
53809
53820
|
}
|
|
53810
|
-
var
|
|
53811
|
-
if (
|
|
53812
|
-
range = [{
|
|
53813
|
-
row: [0, flowdata.length - 1],
|
|
53814
|
-
column: [0, flowdata[0].length - 1],
|
|
53815
|
-
row_focus: 0,
|
|
53816
|
-
column_focus: 0
|
|
53817
|
-
}];
|
|
53818
|
-
} else {
|
|
53819
|
-
range = ___default['default'].assign([], ctx.luckysheet_select_save);
|
|
53820
|
-
}
|
|
53821
|
-
var searchIndexArr = getSearchIndexArr(searchText, range, flowdata, checkModes, searchType);
|
|
53822
|
-
if (searchIndexArr.length === 0) {
|
|
53821
|
+
var sheets = ctx.luckysheetfile;
|
|
53822
|
+
if (!sheets || sheets.length === 0) {
|
|
53823
53823
|
return findAndReplace.noFindTip;
|
|
53824
53824
|
}
|
|
53825
|
-
var
|
|
53826
|
-
|
|
53827
|
-
|
|
53828
|
-
|
|
53829
|
-
|
|
53830
|
-
|
|
53831
|
-
|
|
53832
|
-
|
|
53833
|
-
|
|
53834
|
-
|
|
53835
|
-
|
|
53836
|
-
|
|
53825
|
+
var currentSheetIndex = (_getSheetIndex = getSheetIndex(ctx, ctx.currentSheetId)) !== null && _getSheetIndex !== void 0 ? _getSheetIndex : 0;
|
|
53826
|
+
var currentSelection = ctx.luckysheet_select_save;
|
|
53827
|
+
var currentR = (_currentSelection$0$r = currentSelection === null || currentSelection === void 0 ? void 0 : (_currentSelection$ = currentSelection[0]) === null || _currentSelection$ === void 0 ? void 0 : _currentSelection$.row_focus) !== null && _currentSelection$0$r !== void 0 ? _currentSelection$0$r : -1;
|
|
53828
|
+
var currentC = (_currentSelection$0$c = currentSelection === null || currentSelection === void 0 ? void 0 : (_currentSelection$2 = currentSelection[0]) === null || _currentSelection$2 === void 0 ? void 0 : _currentSelection$2.column_focus) !== null && _currentSelection$0$c !== void 0 ? _currentSelection$0$c : -1;
|
|
53829
|
+
var totalSheets = sheets.length;
|
|
53830
|
+
for (var offset = 0; offset < totalSheets; offset += 1) {
|
|
53831
|
+
var sheetIdx = (currentSheetIndex + offset) % totalSheets;
|
|
53832
|
+
var sheet = sheets[sheetIdx];
|
|
53833
|
+
var matches = searchSheet(searchText, checkModes, sheet, searchType);
|
|
53834
|
+
if (matches.length === 0) continue;
|
|
53835
|
+
var foundMatch = null;
|
|
53836
|
+
if (offset === 0 && currentR >= 0 && currentC >= 0) {
|
|
53837
|
+
for (var i = 0; i < matches.length; i += 1) {
|
|
53838
|
+
var m = matches[i];
|
|
53839
|
+
if (m.r > currentR || m.r === currentR && m.c > currentC) {
|
|
53840
|
+
foundMatch = m;
|
|
53837
53841
|
break;
|
|
53838
53842
|
}
|
|
53839
53843
|
}
|
|
53840
53844
|
}
|
|
53841
|
-
|
|
53842
|
-
|
|
53843
|
-
|
|
53844
|
-
}
|
|
53845
|
-
|
|
53846
|
-
|
|
53847
|
-
|
|
53848
|
-
|
|
53849
|
-
|
|
53850
|
-
if (_i === searchIndexArr.length - 1) {
|
|
53851
|
-
count = 0;
|
|
53852
|
-
} else {
|
|
53853
|
-
count = _i + 1;
|
|
53854
|
-
}
|
|
53855
|
-
break;
|
|
53845
|
+
if (!foundMatch && offset > 0) {
|
|
53846
|
+
var _matches = _slicedToArray(matches, 1);
|
|
53847
|
+
foundMatch = _matches[0];
|
|
53848
|
+
}
|
|
53849
|
+
if (!foundMatch && offset === 0 && matches.length > 0) {
|
|
53850
|
+
var _matches2 = _slicedToArray(matches, 1);
|
|
53851
|
+
foundMatch = _matches2[0];
|
|
53852
|
+
if (matches.length === 1 && matches[0].r === currentR && matches[0].c === currentC) {
|
|
53853
|
+
foundMatch = null;
|
|
53856
53854
|
}
|
|
53857
53855
|
}
|
|
53858
|
-
|
|
53859
|
-
|
|
53860
|
-
|
|
53861
|
-
var c1 = range[s].column[0];
|
|
53862
|
-
var c2 = range[s].column[1];
|
|
53863
|
-
if (searchIndexArr[count].r >= r1 && searchIndexArr[count].r <= r2 && searchIndexArr[count].c >= c1 && searchIndexArr[count].c <= c2) {
|
|
53864
|
-
var obj = range[s];
|
|
53865
|
-
obj.row_focus = searchIndexArr[count].r;
|
|
53866
|
-
obj.column_focus = searchIndexArr[count].c;
|
|
53867
|
-
range.splice(s, 1);
|
|
53868
|
-
range.push(obj);
|
|
53869
|
-
break;
|
|
53856
|
+
if (foundMatch) {
|
|
53857
|
+
if (sheetIdx !== currentSheetIndex) {
|
|
53858
|
+
changeSheet(ctx, sheet.id);
|
|
53870
53859
|
}
|
|
53860
|
+
ctx.luckysheet_select_save = normalizeSelection(ctx, [{
|
|
53861
|
+
row: [foundMatch.r, foundMatch.r],
|
|
53862
|
+
column: [foundMatch.c, foundMatch.c]
|
|
53863
|
+
}]);
|
|
53864
|
+
scrollToHighlightCell(ctx, foundMatch.r, foundMatch.c);
|
|
53865
|
+
return null;
|
|
53871
53866
|
}
|
|
53872
|
-
ctx.luckysheet_select_save = range;
|
|
53873
53867
|
}
|
|
53874
|
-
|
|
53875
|
-
return null;
|
|
53868
|
+
return findAndReplace.noFindTip;
|
|
53876
53869
|
}
|
|
53877
53870
|
function searchAll(ctx, searchText, checkModes) {
|
|
53878
|
-
var _ctx$luckysheet_selec3;
|
|
53879
53871
|
var searchType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "v";
|
|
53880
|
-
var flowdata = getFlowdata(ctx);
|
|
53881
53872
|
var searchResult = [];
|
|
53882
|
-
if (searchText === "" || searchText == null
|
|
53873
|
+
if (searchText === "" || searchText == null) {
|
|
53883
53874
|
return searchResult;
|
|
53884
53875
|
}
|
|
53885
|
-
var
|
|
53886
|
-
if (
|
|
53887
|
-
range = [{
|
|
53888
|
-
row: [0, flowdata.length - 1],
|
|
53889
|
-
column: [0, flowdata[0].length - 1]
|
|
53890
|
-
}];
|
|
53891
|
-
} else {
|
|
53892
|
-
range = ___default['default'].assign([], ctx.luckysheet_select_save);
|
|
53893
|
-
}
|
|
53894
|
-
var searchIndexArr = getSearchIndexArr(searchText, range, flowdata, checkModes, searchType);
|
|
53895
|
-
if (searchIndexArr.length === 0) {
|
|
53876
|
+
var sheets = ctx.luckysheetfile;
|
|
53877
|
+
if (!sheets || sheets.length === 0) {
|
|
53896
53878
|
return searchResult;
|
|
53897
53879
|
}
|
|
53898
|
-
|
|
53899
|
-
|
|
53900
|
-
var
|
|
53901
|
-
|
|
53902
|
-
|
|
53903
|
-
|
|
53904
|
-
|
|
53905
|
-
|
|
53906
|
-
|
|
53907
|
-
|
|
53908
|
-
|
|
53880
|
+
var firstMatch = null;
|
|
53881
|
+
for (var sheetIdx = 0; sheetIdx < sheets.length; sheetIdx += 1) {
|
|
53882
|
+
var sheet = sheets[sheetIdx];
|
|
53883
|
+
var matches = searchSheet(searchText, checkModes, sheet, searchType);
|
|
53884
|
+
if (matches.length === 0) continue;
|
|
53885
|
+
var flowdata = sheet.data;
|
|
53886
|
+
if (!flowdata) continue;
|
|
53887
|
+
for (var i = 0; i < matches.length; i += 1) {
|
|
53888
|
+
var match = matches[i];
|
|
53889
|
+
var value_ShowEs = valueShowEs(match.r, match.c, flowdata).toString();
|
|
53890
|
+
searchResult.push({
|
|
53891
|
+
r: match.r,
|
|
53892
|
+
c: match.c,
|
|
53893
|
+
sheetName: sheet.name,
|
|
53894
|
+
sheetId: sheet.id,
|
|
53895
|
+
cellPosition: "".concat(chatatABC(match.c)).concat(match.r + 1),
|
|
53896
|
+
value: value_ShowEs
|
|
53897
|
+
});
|
|
53898
|
+
if (!firstMatch) {
|
|
53899
|
+
firstMatch = {
|
|
53900
|
+
r: match.r,
|
|
53901
|
+
c: match.c,
|
|
53902
|
+
sheetId: sheet.id
|
|
53903
|
+
};
|
|
53904
|
+
}
|
|
53905
|
+
}
|
|
53906
|
+
}
|
|
53907
|
+
if (firstMatch) {
|
|
53908
|
+
if (firstMatch.sheetId !== ctx.currentSheetId) {
|
|
53909
|
+
changeSheet(ctx, firstMatch.sheetId);
|
|
53910
|
+
}
|
|
53911
|
+
ctx.luckysheet_select_save = normalizeSelection(ctx, [{
|
|
53912
|
+
row: [firstMatch.r, firstMatch.r],
|
|
53913
|
+
column: [firstMatch.c, firstMatch.c]
|
|
53914
|
+
}]);
|
|
53915
|
+
scrollToHighlightCell(ctx, firstMatch.r, firstMatch.c);
|
|
53909
53916
|
}
|
|
53910
|
-
ctx.luckysheet_select_save = normalizeSelection(ctx, [{
|
|
53911
|
-
row: [searchIndexArr[0].r, searchIndexArr[0].r],
|
|
53912
|
-
column: [searchIndexArr[0].c, searchIndexArr[0].c]
|
|
53913
|
-
}]);
|
|
53914
53917
|
return searchResult;
|
|
53915
53918
|
}
|
|
53916
53919
|
function onSearchDialogMoveStart(globalCache, e, container) {
|
|
@@ -53959,7 +53962,7 @@ function onSearchDialogMoveEnd(globalCache) {
|
|
|
53959
53962
|
___default['default'].set(globalCache, "searchDialog.moveProps", undefined);
|
|
53960
53963
|
}
|
|
53961
53964
|
function replace(ctx, searchText, replaceText, checkModes) {
|
|
53962
|
-
var _ctx$
|
|
53965
|
+
var _ctx$luckysheet_selec, _ctx$luckysheet_selec2;
|
|
53963
53966
|
var searchType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "v";
|
|
53964
53967
|
var _locale2 = locale(ctx),
|
|
53965
53968
|
findAndReplace = _locale2.findAndReplace;
|
|
@@ -53972,7 +53975,7 @@ function replace(ctx, searchText, replaceText, checkModes) {
|
|
|
53972
53975
|
return findAndReplace.searchInputTip;
|
|
53973
53976
|
}
|
|
53974
53977
|
var range;
|
|
53975
|
-
if (___default['default'].size(ctx.luckysheet_select_save) === 0 || ((_ctx$
|
|
53978
|
+
if (___default['default'].size(ctx.luckysheet_select_save) === 0 || ((_ctx$luckysheet_selec = ctx.luckysheet_select_save) === null || _ctx$luckysheet_selec === void 0 ? void 0 : _ctx$luckysheet_selec.length) === 1 && ctx.luckysheet_select_save[0].row[0] === ctx.luckysheet_select_save[0].row[1] && ctx.luckysheet_select_save[0].column[0] === ctx.luckysheet_select_save[0].column[1]) {
|
|
53976
53979
|
range = [{
|
|
53977
53980
|
row: [0, flowdata.length - 1],
|
|
53978
53981
|
column: [0, flowdata[0].length - 1]
|
|
@@ -53985,7 +53988,7 @@ function replace(ctx, searchText, replaceText, checkModes) {
|
|
|
53985
53988
|
return findAndReplace.noReplceTip;
|
|
53986
53989
|
}
|
|
53987
53990
|
var count = null;
|
|
53988
|
-
var last = (_ctx$
|
|
53991
|
+
var last = (_ctx$luckysheet_selec2 = ctx.luckysheet_select_save) === null || _ctx$luckysheet_selec2 === void 0 ? void 0 : _ctx$luckysheet_selec2[ctx.luckysheet_select_save.length - 1];
|
|
53989
53992
|
var rf = last === null || last === void 0 ? void 0 : last.row_focus;
|
|
53990
53993
|
var cf = last === null || last === void 0 ? void 0 : last.column_focus;
|
|
53991
53994
|
for (var i = 0; i < searchIndexArr.length; i += 1) {
|
|
@@ -54028,7 +54031,7 @@ function replace(ctx, searchText, replaceText, checkModes) {
|
|
|
54028
54031
|
return null;
|
|
54029
54032
|
}
|
|
54030
54033
|
function replaceAll(ctx, searchText, replaceText, checkModes) {
|
|
54031
|
-
var _ctx$
|
|
54034
|
+
var _ctx$luckysheet_selec3;
|
|
54032
54035
|
var searchType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "v";
|
|
54033
54036
|
var _locale3 = locale(ctx),
|
|
54034
54037
|
findAndReplace = _locale3.findAndReplace;
|
|
@@ -54041,7 +54044,7 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
|
|
|
54041
54044
|
return findAndReplace.searchInputTip;
|
|
54042
54045
|
}
|
|
54043
54046
|
var range;
|
|
54044
|
-
if (___default['default'].size(ctx.luckysheet_select_save) === 0 || ((_ctx$
|
|
54047
|
+
if (___default['default'].size(ctx.luckysheet_select_save) === 0 || ((_ctx$luckysheet_selec3 = ctx.luckysheet_select_save) === null || _ctx$luckysheet_selec3 === void 0 ? void 0 : _ctx$luckysheet_selec3.length) === 1 && ctx.luckysheet_select_save[0].row[0] === ctx.luckysheet_select_save[0].row[1] && ctx.luckysheet_select_save[0].column[0] === ctx.luckysheet_select_save[0].column[1]) {
|
|
54045
54048
|
range = [{
|
|
54046
54049
|
row: [0, flowdata.length - 1],
|
|
54047
54050
|
column: [0, flowdata[0].length - 1]
|
|
@@ -54074,9 +54077,9 @@ function replaceAll(ctx, searchText, replaceText, checkModes) {
|
|
|
54074
54077
|
} else {
|
|
54075
54078
|
reg = new RegExp(getRegExpStr(searchText), "ig");
|
|
54076
54079
|
}
|
|
54077
|
-
for (var
|
|
54078
|
-
var _r = searchIndexArr[
|
|
54079
|
-
var _c = searchIndexArr[
|
|
54080
|
+
for (var _i = 0; _i < searchIndexArr.length; _i += 1) {
|
|
54081
|
+
var _r = searchIndexArr[_i].r;
|
|
54082
|
+
var _c = searchIndexArr[_i].c;
|
|
54080
54083
|
var _v2 = valueShowEs(_r, _c, d).toString().replace(reg, replaceText);
|
|
54081
54084
|
setCellValue(ctx, _r, _c, d, _v2);
|
|
54082
54085
|
range.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leankylin-sheet/core",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.27",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"build": "father-build"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@leankylin-sheet/formula-parser": "5.2.
|
|
16
|
+
"@leankylin-sheet/formula-parser": "5.2.27",
|
|
17
17
|
"dayjs": "^1.11.0",
|
|
18
18
|
"immer": "^9.0.12",
|
|
19
19
|
"lodash": "^4.17.21",
|