@odoo/o-spreadsheet 16.3.4 → 16.3.6
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/o-spreadsheet.cjs.js +71 -49
- package/dist/o-spreadsheet.d.ts +6 -6
- package/dist/o-spreadsheet.esm.js +71 -49
- package/dist/o-spreadsheet.iife.js +71 -49
- package/dist/o-spreadsheet.iife.min.js +321 -316
- package/package.json +2 -2
|
@@ -112,8 +112,8 @@ const SELECTION_BORDER_COLOR = "#3266ca";
|
|
|
112
112
|
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
113
113
|
const CELL_BORDER_COLOR = "#E2E3E3";
|
|
114
114
|
const BACKGROUND_CHART_COLOR = "#FFFFFF";
|
|
115
|
-
const MENU_ITEM_DISABLED_COLOR = "#CACACA";
|
|
116
115
|
const BG_HOVER_COLOR = "#EBEBEB";
|
|
116
|
+
const DISABLED_TEXT_COLOR = "#CACACA";
|
|
117
117
|
const DEFAULT_COLOR_SCALE_MIDPOINT_COLOR = 0xb6d7a8;
|
|
118
118
|
const LINK_COLOR = "#01666b";
|
|
119
119
|
const FILTERS_COLOR = "#188038";
|
|
@@ -4222,7 +4222,6 @@ const readonlyAllowedCommands = new Set([
|
|
|
4222
4222
|
"SET_VIEWPORT_OFFSET",
|
|
4223
4223
|
"SELECT_SEARCH_NEXT_MATCH",
|
|
4224
4224
|
"SELECT_SEARCH_PREVIOUS_MATCH",
|
|
4225
|
-
"REFRESH_SEARCH",
|
|
4226
4225
|
"UPDATE_SEARCH",
|
|
4227
4226
|
"CLEAR_SEARCH",
|
|
4228
4227
|
"EVALUATE_CELLS",
|
|
@@ -5543,7 +5542,7 @@ css /* scss */ `
|
|
|
5543
5542
|
}
|
|
5544
5543
|
}
|
|
5545
5544
|
&.disabled {
|
|
5546
|
-
color: ${
|
|
5545
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
5547
5546
|
cursor: not-allowed;
|
|
5548
5547
|
}
|
|
5549
5548
|
}
|
|
@@ -16380,7 +16379,7 @@ const insertFunctionMin = {
|
|
|
16380
16379
|
};
|
|
16381
16380
|
const categorieFunctionAll = {
|
|
16382
16381
|
name: _lt("All"),
|
|
16383
|
-
children: allFunctionListMenuBuilder
|
|
16382
|
+
children: [allFunctionListMenuBuilder],
|
|
16384
16383
|
};
|
|
16385
16384
|
function allFunctionListMenuBuilder() {
|
|
16386
16385
|
const fnNames = functionRegistry.getKeys();
|
|
@@ -19647,6 +19646,7 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
19647
19646
|
state = owl.useState(this.initialState());
|
|
19648
19647
|
debounceTimeoutId;
|
|
19649
19648
|
showFormulaState = false;
|
|
19649
|
+
debouncedUpdateSearch;
|
|
19650
19650
|
findAndReplaceRef = owl.useRef("findAndReplace");
|
|
19651
19651
|
get hasSearchResult() {
|
|
19652
19652
|
return this.env.model.getters.getCurrentSelectedMatchIndex() !== null;
|
|
@@ -19656,11 +19656,16 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
19656
19656
|
}
|
|
19657
19657
|
setup() {
|
|
19658
19658
|
this.showFormulaState = this.env.model.getters.shouldShowFormulas();
|
|
19659
|
+
this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
|
|
19659
19660
|
owl.onMounted(() => this.focusInput());
|
|
19660
19661
|
owl.onWillUnmount(() => {
|
|
19661
19662
|
this.env.model.dispatch("CLEAR_SEARCH");
|
|
19662
19663
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
|
|
19663
19664
|
});
|
|
19665
|
+
owl.useEffect(() => {
|
|
19666
|
+
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
19667
|
+
this.searchFormulas();
|
|
19668
|
+
}, () => [this.env.model.getters.shouldShowFormulas()]);
|
|
19664
19669
|
}
|
|
19665
19670
|
onInput(ev) {
|
|
19666
19671
|
this.state.toSearch = ev.target.value;
|
|
@@ -19680,10 +19685,6 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
19680
19685
|
this.replace();
|
|
19681
19686
|
}
|
|
19682
19687
|
}
|
|
19683
|
-
onFocusSidePanel() {
|
|
19684
|
-
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
19685
|
-
this.env.model.dispatch("REFRESH_SEARCH");
|
|
19686
|
-
}
|
|
19687
19688
|
searchFormulas() {
|
|
19688
19689
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", {
|
|
19689
19690
|
show: this.state.searchOptions.searchFormulas,
|
|
@@ -19702,13 +19703,6 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
19702
19703
|
searchOptions: this.state.searchOptions,
|
|
19703
19704
|
});
|
|
19704
19705
|
}
|
|
19705
|
-
debouncedUpdateSearch() {
|
|
19706
|
-
clearTimeout(this.debounceTimeoutId);
|
|
19707
|
-
this.debounceTimeoutId = setTimeout(() => {
|
|
19708
|
-
this.updateSearch();
|
|
19709
|
-
this.debounceTimeoutId = undefined;
|
|
19710
|
-
}, 400);
|
|
19711
|
-
}
|
|
19712
19706
|
replace() {
|
|
19713
19707
|
this.env.model.dispatch("REPLACE_SEARCH", {
|
|
19714
19708
|
replaceWith: this.state.replaceWith,
|
|
@@ -21641,6 +21635,15 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
21641
21635
|
y = initialFigure.y - deltaY;
|
|
21642
21636
|
}
|
|
21643
21637
|
}
|
|
21638
|
+
// Restrict resizing if x or y reaches header boundaries
|
|
21639
|
+
if (x < 0) {
|
|
21640
|
+
width += x;
|
|
21641
|
+
x = 0;
|
|
21642
|
+
}
|
|
21643
|
+
if (y < 0) {
|
|
21644
|
+
height += y;
|
|
21645
|
+
y = 0;
|
|
21646
|
+
}
|
|
21644
21647
|
return { ...initialFigure, x, y, width, height };
|
|
21645
21648
|
}
|
|
21646
21649
|
|
|
@@ -30944,7 +30947,8 @@ class HeaderSizePlugin extends CorePlugin {
|
|
|
30944
30947
|
}
|
|
30945
30948
|
break;
|
|
30946
30949
|
case "UPDATE_CELL":
|
|
30947
|
-
|
|
30950
|
+
const row = this.sizes[cmd.sheetId]?.["ROW"]?.[cmd.row];
|
|
30951
|
+
if (row && !row.manualSize) {
|
|
30948
30952
|
const { sheetId, row } = cmd;
|
|
30949
30953
|
this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
|
|
30950
30954
|
}
|
|
@@ -36892,6 +36896,7 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
36892
36896
|
searchFormulas: false,
|
|
36893
36897
|
};
|
|
36894
36898
|
toSearch = "";
|
|
36899
|
+
isSearchDirty = false;
|
|
36895
36900
|
// ---------------------------------------------------------------------------
|
|
36896
36901
|
// Command Handling
|
|
36897
36902
|
// ---------------------------------------------------------------------------
|
|
@@ -36915,18 +36920,33 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
36915
36920
|
case "REPLACE_ALL_SEARCH":
|
|
36916
36921
|
this.replaceAll(cmd.replaceWith);
|
|
36917
36922
|
break;
|
|
36923
|
+
case "EVALUATE_CELLS":
|
|
36924
|
+
case "UPDATE_CELL":
|
|
36925
|
+
case "REMOVE_FILTER_TABLE":
|
|
36926
|
+
case "UPDATE_FILTER":
|
|
36927
|
+
this.isSearchDirty = true;
|
|
36928
|
+
break;
|
|
36918
36929
|
case "UNDO":
|
|
36919
36930
|
case "REDO":
|
|
36920
36931
|
case "REMOVE_COLUMNS_ROWS":
|
|
36932
|
+
case "HIDE_COLUMNS_ROWS":
|
|
36933
|
+
case "UNHIDE_COLUMNS_ROWS":
|
|
36921
36934
|
case "ADD_COLUMNS_ROWS":
|
|
36922
|
-
|
|
36935
|
+
case "EVALUATE_CELLS":
|
|
36936
|
+
case "UPDATE_CELL":
|
|
36937
|
+
this.isSearchDirty = true;
|
|
36923
36938
|
break;
|
|
36924
36939
|
case "ACTIVATE_SHEET":
|
|
36925
|
-
case "REFRESH_SEARCH":
|
|
36926
36940
|
this.refreshSearch();
|
|
36927
36941
|
break;
|
|
36928
36942
|
}
|
|
36929
36943
|
}
|
|
36944
|
+
finalize() {
|
|
36945
|
+
if (this.isSearchDirty) {
|
|
36946
|
+
this.refreshSearch();
|
|
36947
|
+
this.isSearchDirty = false;
|
|
36948
|
+
}
|
|
36949
|
+
}
|
|
36930
36950
|
// ---------------------------------------------------------------------------
|
|
36931
36951
|
// Getters
|
|
36932
36952
|
// ---------------------------------------------------------------------------
|
|
@@ -36982,6 +37002,11 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
36982
37002
|
if (this.toSearch) {
|
|
36983
37003
|
for (const cell of Object.values(cells)) {
|
|
36984
37004
|
const { col, row } = this.getters.getCellPosition(cell.id);
|
|
37005
|
+
const isColHidden = this.getters.isColHidden(sheetId, col);
|
|
37006
|
+
const isRowHidden = this.getters.isRowHidden(sheetId, row);
|
|
37007
|
+
if (isColHidden || isRowHidden) {
|
|
37008
|
+
continue;
|
|
37009
|
+
}
|
|
36985
37010
|
if (cell &&
|
|
36986
37011
|
this.currentSearchRegex &&
|
|
36987
37012
|
this.currentSearchRegex.test(this.getSearchableString({ sheetId, col, row }))) {
|
|
@@ -37041,37 +37066,31 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
37041
37066
|
// ---------------------------------------------------------------------------
|
|
37042
37067
|
// Replace
|
|
37043
37068
|
// ---------------------------------------------------------------------------
|
|
37044
|
-
|
|
37045
|
-
|
|
37046
|
-
*/
|
|
37047
|
-
replace(replaceWith) {
|
|
37048
|
-
if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
|
|
37069
|
+
replaceMatch(selectedMatch, replaceWith) {
|
|
37070
|
+
if (!this.currentSearchRegex) {
|
|
37049
37071
|
return;
|
|
37050
37072
|
}
|
|
37051
|
-
const matches = this.searchMatches;
|
|
37052
|
-
const selectedMatch = matches[this.selectedMatchIndex];
|
|
37053
37073
|
const sheetId = this.getters.getActiveSheetId();
|
|
37054
37074
|
const cell = this.getters.getCell({ sheetId, ...selectedMatch });
|
|
37075
|
+
const { col, row } = selectedMatch;
|
|
37055
37076
|
if (cell?.isFormula && !this.searchOptions.searchFormulas) {
|
|
37056
|
-
|
|
37077
|
+
return;
|
|
37057
37078
|
}
|
|
37058
|
-
|
|
37059
|
-
|
|
37060
|
-
|
|
37061
|
-
|
|
37062
|
-
|
|
37063
|
-
|
|
37064
|
-
|
|
37065
|
-
|
|
37066
|
-
|
|
37067
|
-
|
|
37068
|
-
|
|
37069
|
-
row: selectedMatch.row,
|
|
37070
|
-
content: newContent,
|
|
37071
|
-
});
|
|
37072
|
-
this.searchMatches.splice(this.selectedMatchIndex, 1);
|
|
37073
|
-
this.selectNextCell(Direction.current);
|
|
37079
|
+
const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
|
|
37080
|
+
const toReplace = this.getSearchableString({ sheetId, col, row });
|
|
37081
|
+
const content = toReplace.replace(replaceRegex, replaceWith);
|
|
37082
|
+
this.dispatch("UPDATE_CELL", { sheetId, col, row, content });
|
|
37083
|
+
}
|
|
37084
|
+
/**
|
|
37085
|
+
* Replace the value of the currently selected match
|
|
37086
|
+
*/
|
|
37087
|
+
replace(replaceWith) {
|
|
37088
|
+
if (this.selectedMatchIndex === null) {
|
|
37089
|
+
return;
|
|
37074
37090
|
}
|
|
37091
|
+
const selectedMatch = this.searchMatches[this.selectedMatchIndex];
|
|
37092
|
+
this.replaceMatch(selectedMatch, replaceWith);
|
|
37093
|
+
this.selectNextCell(Direction.next);
|
|
37075
37094
|
}
|
|
37076
37095
|
/**
|
|
37077
37096
|
* Apply the replace function to all the matches one time.
|
|
@@ -37079,7 +37098,7 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
37079
37098
|
replaceAll(replaceWith) {
|
|
37080
37099
|
const matchCount = this.searchMatches.length;
|
|
37081
37100
|
for (let i = 0; i < matchCount; i++) {
|
|
37082
|
-
this.
|
|
37101
|
+
this.replaceMatch(this.searchMatches[i], replaceWith);
|
|
37083
37102
|
}
|
|
37084
37103
|
}
|
|
37085
37104
|
getSearchableString(position) {
|
|
@@ -38619,10 +38638,8 @@ class SortPlugin extends UIPlugin {
|
|
|
38619
38638
|
}
|
|
38620
38639
|
updateCellCommands.push(newCellValues);
|
|
38621
38640
|
}
|
|
38622
|
-
for (const cmd of updateCellCommands) {
|
|
38623
|
-
this.dispatch("UPDATE_CELL", cmd);
|
|
38624
|
-
}
|
|
38625
38641
|
}
|
|
38642
|
+
updateCellCommands.forEach((cmdPayload) => this.dispatch("UPDATE_CELL", cmdPayload));
|
|
38626
38643
|
}
|
|
38627
38644
|
/**
|
|
38628
38645
|
* Return the distances between main merge cells in the zone.
|
|
@@ -42887,6 +42904,11 @@ css /* scss */ `
|
|
|
42887
42904
|
.o-sidePanelButton:enabled {
|
|
42888
42905
|
cursor: pointer;
|
|
42889
42906
|
}
|
|
42907
|
+
|
|
42908
|
+
.o-sidePanelButton:disabled {
|
|
42909
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
42910
|
+
}
|
|
42911
|
+
|
|
42890
42912
|
.o-sidePanelButton:last-child {
|
|
42891
42913
|
margin-right: 0px;
|
|
42892
42914
|
}
|
|
@@ -47633,6 +47655,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
47633
47655
|
exports.tokenize = tokenize;
|
|
47634
47656
|
|
|
47635
47657
|
|
|
47636
|
-
__info__.version = '16.3.
|
|
47637
|
-
__info__.date = '2023-
|
|
47638
|
-
__info__.hash = '
|
|
47658
|
+
__info__.version = '16.3.6';
|
|
47659
|
+
__info__.date = '2023-08-07T09:00:44.937Z';
|
|
47660
|
+
__info__.hash = '36bb0b8';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1415,7 +1415,9 @@ declare class FindAndReplacePlugin extends UIPlugin {
|
|
|
1415
1415
|
private currentSearchRegex;
|
|
1416
1416
|
private searchOptions;
|
|
1417
1417
|
private toSearch;
|
|
1418
|
+
private isSearchDirty;
|
|
1418
1419
|
handle(cmd: Command): void;
|
|
1420
|
+
finalize(): void;
|
|
1419
1421
|
getSearchMatches(): SearchMatch[];
|
|
1420
1422
|
getCurrentSelectedMatchIndex(): number | null;
|
|
1421
1423
|
/**
|
|
@@ -1447,6 +1449,7 @@ declare class FindAndReplacePlugin extends UIPlugin {
|
|
|
1447
1449
|
*/
|
|
1448
1450
|
private selectNextCell;
|
|
1449
1451
|
private clearSearch;
|
|
1452
|
+
private replaceMatch;
|
|
1450
1453
|
/**
|
|
1451
1454
|
* Replace the value of the currently selected match
|
|
1452
1455
|
*/
|
|
@@ -1673,8 +1676,8 @@ interface PositionDependentCommand {
|
|
|
1673
1676
|
col: number;
|
|
1674
1677
|
row: number;
|
|
1675
1678
|
}
|
|
1676
|
-
declare const invalidateEvaluationCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "
|
|
1677
|
-
declare const readonlyAllowedCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "
|
|
1679
|
+
declare const invalidateEvaluationCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
|
|
1680
|
+
declare const readonlyAllowedCommands: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "SORT_CELLS" | "SET_DECIMAL" | "REQUEST_UNDO" | "REQUEST_REDO" | "UNDO" | "REDO" | "ENABLE_NEW_SELECTION_INPUT" | "DISABLE_SELECTION_INPUT" | "UNFOCUS_SELECTION_INPUT" | "FOCUS_RANGE" | "ADD_EMPTY_RANGE" | "REMOVE_RANGE" | "CHANGE_RANGE" | "COPY" | "CUT" | "PASTE" | "REPEAT_PASTE" | "CLEAN_CLIPBOARD_HIGHLIGHT" | "AUTOFILL_CELL" | "PASTE_FROM_OS_CLIPBOARD" | "ACTIVATE_PAINT_FORMAT" | "PASTE_CONDITIONAL_FORMAT" | "AUTORESIZE_COLUMNS" | "AUTORESIZE_ROWS" | "MOVE_COLUMNS_ROWS" | "ACTIVATE_SHEET" | "PREPARE_SELECTION_INPUT_EXPANSION" | "STOP_SELECTION_INPUT" | "EVALUATE_CELLS" | "CHANGE_HIGHLIGHT" | "START_CHANGE_HIGHLIGHT" | "SET_HIGHLIGHT_COLOR" | "STOP_COMPOSER_RANGE_SELECTION" | "START_EDITION" | "STOP_EDITION" | "SET_CURRENT_CONTENT" | "CHANGE_COMPOSER_CURSOR_SELECTION" | "REPLACE_COMPOSER_CURSOR_SELECTION" | "CYCLE_EDITION_REFERENCES" | "START" | "AUTOFILL" | "AUTOFILL_SELECT" | "SET_FORMULA_VISIBILITY" | "AUTOFILL_AUTO" | "SELECT_FIGURE" | "UPDATE_SEARCH" | "CLEAR_SEARCH" | "SELECT_SEARCH_PREVIOUS_MATCH" | "SELECT_SEARCH_NEXT_MATCH" | "REPLACE_SEARCH" | "REPLACE_ALL_SEARCH" | "RESIZE_SHEETVIEW" | "SUM_SELECTION" | "DELETE_CELL" | "INSERT_CELL" | "SET_VIEWPORT_OFFSET" | "SHIFT_VIEWPORT_DOWN" | "SHIFT_VIEWPORT_UP" | "OPEN_CELL_POPOVER" | "CLOSE_CELL_POPOVER" | "ACTIVATE_NEXT_SHEET" | "ACTIVATE_PREVIOUS_SHEET" | "UPDATE_FILTER" | "SPLIT_TEXT_INTO_COLUMNS">;
|
|
1678
1681
|
declare const coreTypes: Set<"UPDATE_CELL" | "UPDATE_CELL_POSITION" | "CLEAR_CELL" | "DELETE_CONTENT" | "ADD_COLUMNS_ROWS" | "REMOVE_COLUMNS_ROWS" | "RESIZE_COLUMNS_ROWS" | "HIDE_COLUMNS_ROWS" | "UNHIDE_COLUMNS_ROWS" | "SET_GRID_LINES_VISIBILITY" | "FREEZE_COLUMNS" | "FREEZE_ROWS" | "UNFREEZE_COLUMNS_ROWS" | "UNFREEZE_COLUMNS" | "UNFREEZE_ROWS" | "ADD_MERGE" | "REMOVE_MERGE" | "CREATE_SHEET" | "DELETE_SHEET" | "DUPLICATE_SHEET" | "MOVE_SHEET" | "RENAME_SHEET" | "HIDE_SHEET" | "SHOW_SHEET" | "MOVE_RANGES" | "ADD_CONDITIONAL_FORMAT" | "REMOVE_CONDITIONAL_FORMAT" | "MOVE_CONDITIONAL_FORMAT" | "CREATE_FIGURE" | "DELETE_FIGURE" | "UPDATE_FIGURE" | "SET_FORMATTING" | "CLEAR_FORMATTING" | "SET_ZONE_BORDERS" | "SET_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_IMAGE" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE">;
|
|
1679
1682
|
interface UpdateCellCommand extends PositionDependentCommand {
|
|
1680
1683
|
type: "UPDATE_CELL";
|
|
@@ -2124,9 +2127,6 @@ interface UpdateSearchCommand {
|
|
|
2124
2127
|
interface ClearSearchCommand {
|
|
2125
2128
|
type: "CLEAR_SEARCH";
|
|
2126
2129
|
}
|
|
2127
|
-
interface RefreshSearchCommand {
|
|
2128
|
-
type: "REFRESH_SEARCH";
|
|
2129
|
-
}
|
|
2130
2130
|
interface SelectSearchPreviousCommand {
|
|
2131
2131
|
type: "SELECT_SEARCH_PREVIOUS_MATCH";
|
|
2132
2132
|
}
|
|
@@ -2242,7 +2242,7 @@ UpdateCellCommand | UpdateCellPositionCommand | ClearCellCommand | DeleteContent
|
|
|
2242
2242
|
| CreateImageOverCommand
|
|
2243
2243
|
/** FILTERS */
|
|
2244
2244
|
| CreateFilterTableCommand | RemoveFilterTableCommand;
|
|
2245
|
-
type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | RepeatPasteCommand | CleanClipBoardHighlightCommand | AutoFillCellCommand | PasteFromOSClipboardCommand | ActivatePaintFormatCommand | PasteCFCommand | AutoresizeColumnsCommand | AutoresizeRowsCommand | MoveColumnsRowsCommand | ActivateSheetCommand | PrepareExpansionCommand | StopSelectionCommand | EvaluateCellsCommand | ChangeHighlightCommand | StartChangeHighlightCommand | SetColorCommand | StopComposerSelectionCommand | StartEditionCommand | StopEditionCommand | SetCurrentContentCommand | ChangeComposerSelectionCommand | ReplaceComposerSelectionCommand | CycleEditionReferencesCommand | StartCommand | AutofillCommand | AutofillSelectCommand | ShowFormulaCommand | AutofillAutoCommand | SelectFigureCommand | UpdateSearchCommand |
|
|
2245
|
+
type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | RepeatPasteCommand | CleanClipBoardHighlightCommand | AutoFillCellCommand | PasteFromOSClipboardCommand | ActivatePaintFormatCommand | PasteCFCommand | AutoresizeColumnsCommand | AutoresizeRowsCommand | MoveColumnsRowsCommand | ActivateSheetCommand | PrepareExpansionCommand | StopSelectionCommand | EvaluateCellsCommand | ChangeHighlightCommand | StartChangeHighlightCommand | SetColorCommand | StopComposerSelectionCommand | StartEditionCommand | StopEditionCommand | SetCurrentContentCommand | ChangeComposerSelectionCommand | ReplaceComposerSelectionCommand | CycleEditionReferencesCommand | StartCommand | AutofillCommand | AutofillSelectCommand | ShowFormulaCommand | AutofillAutoCommand | SelectFigureCommand | UpdateSearchCommand | ClearSearchCommand | SelectSearchPreviousCommand | SelectSearchNextCommand | ReplaceSearchCommand | ReplaceAllSearchCommand | SortCommand | SetDecimalCommand | ResizeViewportCommand | SumSelectionCommand | DeleteCellCommand | InsertCellCommand | SetViewportOffsetCommand | MoveViewportDownCommand | MoveViewportUpCommand | OpenCellPopoverCommand | CloseCellPopoverCommand | ActivateNextSheetCommand | ActivatePreviousSheetCommand | UpdateFilterCommand | SplitTextIntoColumnsCommand;
|
|
2246
2246
|
type Command = CoreCommand | LocalCommand;
|
|
2247
2247
|
/**
|
|
2248
2248
|
* Holds the result of a command dispatch.
|
|
@@ -108,8 +108,8 @@ const SELECTION_BORDER_COLOR = "#3266ca";
|
|
|
108
108
|
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
109
109
|
const CELL_BORDER_COLOR = "#E2E3E3";
|
|
110
110
|
const BACKGROUND_CHART_COLOR = "#FFFFFF";
|
|
111
|
-
const MENU_ITEM_DISABLED_COLOR = "#CACACA";
|
|
112
111
|
const BG_HOVER_COLOR = "#EBEBEB";
|
|
112
|
+
const DISABLED_TEXT_COLOR = "#CACACA";
|
|
113
113
|
const DEFAULT_COLOR_SCALE_MIDPOINT_COLOR = 0xb6d7a8;
|
|
114
114
|
const LINK_COLOR = "#01666b";
|
|
115
115
|
const FILTERS_COLOR = "#188038";
|
|
@@ -4218,7 +4218,6 @@ const readonlyAllowedCommands = new Set([
|
|
|
4218
4218
|
"SET_VIEWPORT_OFFSET",
|
|
4219
4219
|
"SELECT_SEARCH_NEXT_MATCH",
|
|
4220
4220
|
"SELECT_SEARCH_PREVIOUS_MATCH",
|
|
4221
|
-
"REFRESH_SEARCH",
|
|
4222
4221
|
"UPDATE_SEARCH",
|
|
4223
4222
|
"CLEAR_SEARCH",
|
|
4224
4223
|
"EVALUATE_CELLS",
|
|
@@ -5539,7 +5538,7 @@ css /* scss */ `
|
|
|
5539
5538
|
}
|
|
5540
5539
|
}
|
|
5541
5540
|
&.disabled {
|
|
5542
|
-
color: ${
|
|
5541
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
5543
5542
|
cursor: not-allowed;
|
|
5544
5543
|
}
|
|
5545
5544
|
}
|
|
@@ -16376,7 +16375,7 @@ const insertFunctionMin = {
|
|
|
16376
16375
|
};
|
|
16377
16376
|
const categorieFunctionAll = {
|
|
16378
16377
|
name: _lt("All"),
|
|
16379
|
-
children: allFunctionListMenuBuilder
|
|
16378
|
+
children: [allFunctionListMenuBuilder],
|
|
16380
16379
|
};
|
|
16381
16380
|
function allFunctionListMenuBuilder() {
|
|
16382
16381
|
const fnNames = functionRegistry.getKeys();
|
|
@@ -19643,6 +19642,7 @@ class FindAndReplacePanel extends Component {
|
|
|
19643
19642
|
state = useState(this.initialState());
|
|
19644
19643
|
debounceTimeoutId;
|
|
19645
19644
|
showFormulaState = false;
|
|
19645
|
+
debouncedUpdateSearch;
|
|
19646
19646
|
findAndReplaceRef = useRef("findAndReplace");
|
|
19647
19647
|
get hasSearchResult() {
|
|
19648
19648
|
return this.env.model.getters.getCurrentSelectedMatchIndex() !== null;
|
|
@@ -19652,11 +19652,16 @@ class FindAndReplacePanel extends Component {
|
|
|
19652
19652
|
}
|
|
19653
19653
|
setup() {
|
|
19654
19654
|
this.showFormulaState = this.env.model.getters.shouldShowFormulas();
|
|
19655
|
+
this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
|
|
19655
19656
|
onMounted(() => this.focusInput());
|
|
19656
19657
|
onWillUnmount(() => {
|
|
19657
19658
|
this.env.model.dispatch("CLEAR_SEARCH");
|
|
19658
19659
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
|
|
19659
19660
|
});
|
|
19661
|
+
useEffect(() => {
|
|
19662
|
+
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
19663
|
+
this.searchFormulas();
|
|
19664
|
+
}, () => [this.env.model.getters.shouldShowFormulas()]);
|
|
19660
19665
|
}
|
|
19661
19666
|
onInput(ev) {
|
|
19662
19667
|
this.state.toSearch = ev.target.value;
|
|
@@ -19676,10 +19681,6 @@ class FindAndReplacePanel extends Component {
|
|
|
19676
19681
|
this.replace();
|
|
19677
19682
|
}
|
|
19678
19683
|
}
|
|
19679
|
-
onFocusSidePanel() {
|
|
19680
|
-
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
19681
|
-
this.env.model.dispatch("REFRESH_SEARCH");
|
|
19682
|
-
}
|
|
19683
19684
|
searchFormulas() {
|
|
19684
19685
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", {
|
|
19685
19686
|
show: this.state.searchOptions.searchFormulas,
|
|
@@ -19698,13 +19699,6 @@ class FindAndReplacePanel extends Component {
|
|
|
19698
19699
|
searchOptions: this.state.searchOptions,
|
|
19699
19700
|
});
|
|
19700
19701
|
}
|
|
19701
|
-
debouncedUpdateSearch() {
|
|
19702
|
-
clearTimeout(this.debounceTimeoutId);
|
|
19703
|
-
this.debounceTimeoutId = setTimeout(() => {
|
|
19704
|
-
this.updateSearch();
|
|
19705
|
-
this.debounceTimeoutId = undefined;
|
|
19706
|
-
}, 400);
|
|
19707
|
-
}
|
|
19708
19702
|
replace() {
|
|
19709
19703
|
this.env.model.dispatch("REPLACE_SEARCH", {
|
|
19710
19704
|
replaceWith: this.state.replaceWith,
|
|
@@ -21637,6 +21631,15 @@ function dragFigureForResize(initialFigure, dirX, dirY, { x: mouseX, y: mouseY }
|
|
|
21637
21631
|
y = initialFigure.y - deltaY;
|
|
21638
21632
|
}
|
|
21639
21633
|
}
|
|
21634
|
+
// Restrict resizing if x or y reaches header boundaries
|
|
21635
|
+
if (x < 0) {
|
|
21636
|
+
width += x;
|
|
21637
|
+
x = 0;
|
|
21638
|
+
}
|
|
21639
|
+
if (y < 0) {
|
|
21640
|
+
height += y;
|
|
21641
|
+
y = 0;
|
|
21642
|
+
}
|
|
21640
21643
|
return { ...initialFigure, x, y, width, height };
|
|
21641
21644
|
}
|
|
21642
21645
|
|
|
@@ -30940,7 +30943,8 @@ class HeaderSizePlugin extends CorePlugin {
|
|
|
30940
30943
|
}
|
|
30941
30944
|
break;
|
|
30942
30945
|
case "UPDATE_CELL":
|
|
30943
|
-
|
|
30946
|
+
const row = this.sizes[cmd.sheetId]?.["ROW"]?.[cmd.row];
|
|
30947
|
+
if (row && !row.manualSize) {
|
|
30944
30948
|
const { sheetId, row } = cmd;
|
|
30945
30949
|
this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
|
|
30946
30950
|
}
|
|
@@ -36888,6 +36892,7 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
36888
36892
|
searchFormulas: false,
|
|
36889
36893
|
};
|
|
36890
36894
|
toSearch = "";
|
|
36895
|
+
isSearchDirty = false;
|
|
36891
36896
|
// ---------------------------------------------------------------------------
|
|
36892
36897
|
// Command Handling
|
|
36893
36898
|
// ---------------------------------------------------------------------------
|
|
@@ -36911,18 +36916,33 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
36911
36916
|
case "REPLACE_ALL_SEARCH":
|
|
36912
36917
|
this.replaceAll(cmd.replaceWith);
|
|
36913
36918
|
break;
|
|
36919
|
+
case "EVALUATE_CELLS":
|
|
36920
|
+
case "UPDATE_CELL":
|
|
36921
|
+
case "REMOVE_FILTER_TABLE":
|
|
36922
|
+
case "UPDATE_FILTER":
|
|
36923
|
+
this.isSearchDirty = true;
|
|
36924
|
+
break;
|
|
36914
36925
|
case "UNDO":
|
|
36915
36926
|
case "REDO":
|
|
36916
36927
|
case "REMOVE_COLUMNS_ROWS":
|
|
36928
|
+
case "HIDE_COLUMNS_ROWS":
|
|
36929
|
+
case "UNHIDE_COLUMNS_ROWS":
|
|
36917
36930
|
case "ADD_COLUMNS_ROWS":
|
|
36918
|
-
|
|
36931
|
+
case "EVALUATE_CELLS":
|
|
36932
|
+
case "UPDATE_CELL":
|
|
36933
|
+
this.isSearchDirty = true;
|
|
36919
36934
|
break;
|
|
36920
36935
|
case "ACTIVATE_SHEET":
|
|
36921
|
-
case "REFRESH_SEARCH":
|
|
36922
36936
|
this.refreshSearch();
|
|
36923
36937
|
break;
|
|
36924
36938
|
}
|
|
36925
36939
|
}
|
|
36940
|
+
finalize() {
|
|
36941
|
+
if (this.isSearchDirty) {
|
|
36942
|
+
this.refreshSearch();
|
|
36943
|
+
this.isSearchDirty = false;
|
|
36944
|
+
}
|
|
36945
|
+
}
|
|
36926
36946
|
// ---------------------------------------------------------------------------
|
|
36927
36947
|
// Getters
|
|
36928
36948
|
// ---------------------------------------------------------------------------
|
|
@@ -36978,6 +36998,11 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
36978
36998
|
if (this.toSearch) {
|
|
36979
36999
|
for (const cell of Object.values(cells)) {
|
|
36980
37000
|
const { col, row } = this.getters.getCellPosition(cell.id);
|
|
37001
|
+
const isColHidden = this.getters.isColHidden(sheetId, col);
|
|
37002
|
+
const isRowHidden = this.getters.isRowHidden(sheetId, row);
|
|
37003
|
+
if (isColHidden || isRowHidden) {
|
|
37004
|
+
continue;
|
|
37005
|
+
}
|
|
36981
37006
|
if (cell &&
|
|
36982
37007
|
this.currentSearchRegex &&
|
|
36983
37008
|
this.currentSearchRegex.test(this.getSearchableString({ sheetId, col, row }))) {
|
|
@@ -37037,37 +37062,31 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
37037
37062
|
// ---------------------------------------------------------------------------
|
|
37038
37063
|
// Replace
|
|
37039
37064
|
// ---------------------------------------------------------------------------
|
|
37040
|
-
|
|
37041
|
-
|
|
37042
|
-
*/
|
|
37043
|
-
replace(replaceWith) {
|
|
37044
|
-
if (this.selectedMatchIndex === null || !this.currentSearchRegex) {
|
|
37065
|
+
replaceMatch(selectedMatch, replaceWith) {
|
|
37066
|
+
if (!this.currentSearchRegex) {
|
|
37045
37067
|
return;
|
|
37046
37068
|
}
|
|
37047
|
-
const matches = this.searchMatches;
|
|
37048
|
-
const selectedMatch = matches[this.selectedMatchIndex];
|
|
37049
37069
|
const sheetId = this.getters.getActiveSheetId();
|
|
37050
37070
|
const cell = this.getters.getCell({ sheetId, ...selectedMatch });
|
|
37071
|
+
const { col, row } = selectedMatch;
|
|
37051
37072
|
if (cell?.isFormula && !this.searchOptions.searchFormulas) {
|
|
37052
|
-
|
|
37073
|
+
return;
|
|
37053
37074
|
}
|
|
37054
|
-
|
|
37055
|
-
|
|
37056
|
-
|
|
37057
|
-
|
|
37058
|
-
|
|
37059
|
-
|
|
37060
|
-
|
|
37061
|
-
|
|
37062
|
-
|
|
37063
|
-
|
|
37064
|
-
|
|
37065
|
-
row: selectedMatch.row,
|
|
37066
|
-
content: newContent,
|
|
37067
|
-
});
|
|
37068
|
-
this.searchMatches.splice(this.selectedMatchIndex, 1);
|
|
37069
|
-
this.selectNextCell(Direction.current);
|
|
37075
|
+
const replaceRegex = new RegExp(this.currentSearchRegex.source, this.currentSearchRegex.flags + "g");
|
|
37076
|
+
const toReplace = this.getSearchableString({ sheetId, col, row });
|
|
37077
|
+
const content = toReplace.replace(replaceRegex, replaceWith);
|
|
37078
|
+
this.dispatch("UPDATE_CELL", { sheetId, col, row, content });
|
|
37079
|
+
}
|
|
37080
|
+
/**
|
|
37081
|
+
* Replace the value of the currently selected match
|
|
37082
|
+
*/
|
|
37083
|
+
replace(replaceWith) {
|
|
37084
|
+
if (this.selectedMatchIndex === null) {
|
|
37085
|
+
return;
|
|
37070
37086
|
}
|
|
37087
|
+
const selectedMatch = this.searchMatches[this.selectedMatchIndex];
|
|
37088
|
+
this.replaceMatch(selectedMatch, replaceWith);
|
|
37089
|
+
this.selectNextCell(Direction.next);
|
|
37071
37090
|
}
|
|
37072
37091
|
/**
|
|
37073
37092
|
* Apply the replace function to all the matches one time.
|
|
@@ -37075,7 +37094,7 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
37075
37094
|
replaceAll(replaceWith) {
|
|
37076
37095
|
const matchCount = this.searchMatches.length;
|
|
37077
37096
|
for (let i = 0; i < matchCount; i++) {
|
|
37078
|
-
this.
|
|
37097
|
+
this.replaceMatch(this.searchMatches[i], replaceWith);
|
|
37079
37098
|
}
|
|
37080
37099
|
}
|
|
37081
37100
|
getSearchableString(position) {
|
|
@@ -38615,10 +38634,8 @@ class SortPlugin extends UIPlugin {
|
|
|
38615
38634
|
}
|
|
38616
38635
|
updateCellCommands.push(newCellValues);
|
|
38617
38636
|
}
|
|
38618
|
-
for (const cmd of updateCellCommands) {
|
|
38619
|
-
this.dispatch("UPDATE_CELL", cmd);
|
|
38620
|
-
}
|
|
38621
38637
|
}
|
|
38638
|
+
updateCellCommands.forEach((cmdPayload) => this.dispatch("UPDATE_CELL", cmdPayload));
|
|
38622
38639
|
}
|
|
38623
38640
|
/**
|
|
38624
38641
|
* Return the distances between main merge cells in the zone.
|
|
@@ -42883,6 +42900,11 @@ css /* scss */ `
|
|
|
42883
42900
|
.o-sidePanelButton:enabled {
|
|
42884
42901
|
cursor: pointer;
|
|
42885
42902
|
}
|
|
42903
|
+
|
|
42904
|
+
.o-sidePanelButton:disabled {
|
|
42905
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
42906
|
+
}
|
|
42907
|
+
|
|
42886
42908
|
.o-sidePanelButton:last-child {
|
|
42887
42909
|
margin-right: 0px;
|
|
42888
42910
|
}
|
|
@@ -47601,6 +47623,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
47601
47623
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
47602
47624
|
|
|
47603
47625
|
|
|
47604
|
-
__info__.version = '16.3.
|
|
47605
|
-
__info__.date = '2023-
|
|
47606
|
-
__info__.hash = '
|
|
47626
|
+
__info__.version = '16.3.6';
|
|
47627
|
+
__info__.date = '2023-08-07T09:00:44.937Z';
|
|
47628
|
+
__info__.hash = '36bb0b8';
|