@odoo/o-spreadsheet 16.0.14 → 16.0.16
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 +52 -24
- package/dist/o-spreadsheet.d.ts +5 -6
- package/dist/o-spreadsheet.esm.js +53 -25
- package/dist/o-spreadsheet.iife.js +52 -24
- package/dist/o-spreadsheet.iife.min.js +284 -279
- package/package.json +1 -1
|
@@ -109,7 +109,7 @@ const SELECTION_BORDER_COLOR = "#3266ca";
|
|
|
109
109
|
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
110
110
|
const CELL_BORDER_COLOR = "#E2E3E3";
|
|
111
111
|
const BACKGROUND_CHART_COLOR = "#FFFFFF";
|
|
112
|
-
const
|
|
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";
|
|
@@ -3107,7 +3107,6 @@ const readonlyAllowedCommands = new Set([
|
|
|
3107
3107
|
"SET_VIEWPORT_OFFSET",
|
|
3108
3108
|
"SELECT_SEARCH_NEXT_MATCH",
|
|
3109
3109
|
"SELECT_SEARCH_PREVIOUS_MATCH",
|
|
3110
|
-
"REFRESH_SEARCH",
|
|
3111
3110
|
"UPDATE_SEARCH",
|
|
3112
3111
|
"CLEAR_SEARCH",
|
|
3113
3112
|
"EVALUATE_CELLS",
|
|
@@ -4034,7 +4033,7 @@ css /* scss */ `
|
|
|
4034
4033
|
}
|
|
4035
4034
|
}
|
|
4036
4035
|
&.disabled {
|
|
4037
|
-
color: ${
|
|
4036
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
4038
4037
|
cursor: not-allowed;
|
|
4039
4038
|
}
|
|
4040
4039
|
}
|
|
@@ -9988,11 +9987,16 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
9988
9987
|
}
|
|
9989
9988
|
setup() {
|
|
9990
9989
|
this.showFormulaState = this.env.model.getters.shouldShowFormulas();
|
|
9990
|
+
this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
|
|
9991
9991
|
owl.onMounted(() => this.focusInput());
|
|
9992
9992
|
owl.onWillUnmount(() => {
|
|
9993
9993
|
this.env.model.dispatch("CLEAR_SEARCH");
|
|
9994
9994
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
|
|
9995
9995
|
});
|
|
9996
|
+
owl.useEffect(() => {
|
|
9997
|
+
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
9998
|
+
this.searchFormulas();
|
|
9999
|
+
}, () => [this.env.model.getters.shouldShowFormulas()]);
|
|
9996
10000
|
}
|
|
9997
10001
|
onInput(ev) {
|
|
9998
10002
|
this.state.toSearch = ev.target.value;
|
|
@@ -10010,10 +10014,6 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
10010
10014
|
this.replace();
|
|
10011
10015
|
}
|
|
10012
10016
|
}
|
|
10013
|
-
onFocusSidePanel() {
|
|
10014
|
-
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
10015
|
-
this.env.model.dispatch("REFRESH_SEARCH");
|
|
10016
|
-
}
|
|
10017
10017
|
searchFormulas() {
|
|
10018
10018
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", {
|
|
10019
10019
|
show: this.state.searchOptions.searchFormulas,
|
|
@@ -10032,10 +10032,6 @@ class FindAndReplacePanel extends owl.Component {
|
|
|
10032
10032
|
searchOptions: this.state.searchOptions,
|
|
10033
10033
|
});
|
|
10034
10034
|
}
|
|
10035
|
-
debouncedUpdateSearch() {
|
|
10036
|
-
clearTimeout(this.inDebounce);
|
|
10037
|
-
this.inDebounce = setTimeout(() => this.updateSearch.call(this), 400);
|
|
10038
|
-
}
|
|
10039
10035
|
replace() {
|
|
10040
10036
|
this.env.model.dispatch("REPLACE_SEARCH", {
|
|
10041
10037
|
replaceWith: this.state.replaceWith,
|
|
@@ -21163,6 +21159,14 @@ class FiguresContainer extends owl.Component {
|
|
|
21163
21159
|
if (dirY < 0) {
|
|
21164
21160
|
this.dnd.y = dndInitialY - deltaY;
|
|
21165
21161
|
}
|
|
21162
|
+
if (this.dnd.x < 0) {
|
|
21163
|
+
this.dnd.width += this.dnd.x;
|
|
21164
|
+
this.dnd.x = 0;
|
|
21165
|
+
}
|
|
21166
|
+
if (this.dnd.y < 0) {
|
|
21167
|
+
this.dnd.height += this.dnd.y;
|
|
21168
|
+
this.dnd.y = 0;
|
|
21169
|
+
}
|
|
21166
21170
|
};
|
|
21167
21171
|
const onMouseUp = (ev) => {
|
|
21168
21172
|
if (!this.dnd.figId) {
|
|
@@ -28866,7 +28870,7 @@ class HeaderSizePlugin extends CorePlugin {
|
|
|
28866
28870
|
this.sizes = {};
|
|
28867
28871
|
}
|
|
28868
28872
|
handle(cmd) {
|
|
28869
|
-
var _a, _b
|
|
28873
|
+
var _a, _b;
|
|
28870
28874
|
switch (cmd.type) {
|
|
28871
28875
|
case "CREATE_SHEET": {
|
|
28872
28876
|
const computedSizes = this.computeSheetSizes(cmd.sheetId);
|
|
@@ -28954,7 +28958,8 @@ class HeaderSizePlugin extends CorePlugin {
|
|
|
28954
28958
|
}
|
|
28955
28959
|
break;
|
|
28956
28960
|
case "UPDATE_CELL":
|
|
28957
|
-
|
|
28961
|
+
const row = (_b = (_a = this.sizes[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a["ROW"]) === null || _b === void 0 ? void 0 : _b[cmd.row];
|
|
28962
|
+
if (row && !row.manualSize) {
|
|
28958
28963
|
const { sheetId, row } = cmd;
|
|
28959
28964
|
this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
|
|
28960
28965
|
}
|
|
@@ -33294,6 +33299,7 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
33294
33299
|
searchFormulas: false,
|
|
33295
33300
|
};
|
|
33296
33301
|
this.toSearch = "";
|
|
33302
|
+
this.isSearchDirty = false;
|
|
33297
33303
|
}
|
|
33298
33304
|
// ---------------------------------------------------------------------------
|
|
33299
33305
|
// Command Handling
|
|
@@ -33318,18 +33324,29 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
33318
33324
|
case "REPLACE_ALL_SEARCH":
|
|
33319
33325
|
this.replaceAll(cmd.replaceWith);
|
|
33320
33326
|
break;
|
|
33327
|
+
case "EVALUATE_CELLS":
|
|
33328
|
+
case "UPDATE_CELL":
|
|
33329
|
+
case "REMOVE_FILTER_TABLE":
|
|
33330
|
+
case "UPDATE_FILTER":
|
|
33331
|
+
this.isSearchDirty = true;
|
|
33332
|
+
break;
|
|
33321
33333
|
case "UNDO":
|
|
33322
33334
|
case "REDO":
|
|
33323
33335
|
case "REMOVE_COLUMNS_ROWS":
|
|
33336
|
+
case "HIDE_COLUMNS_ROWS":
|
|
33337
|
+
case "UNHIDE_COLUMNS_ROWS":
|
|
33324
33338
|
case "ADD_COLUMNS_ROWS":
|
|
33325
|
-
this.clearSearch();
|
|
33326
|
-
break;
|
|
33327
33339
|
case "ACTIVATE_SHEET":
|
|
33328
|
-
case "REFRESH_SEARCH":
|
|
33329
33340
|
this.refreshSearch();
|
|
33330
33341
|
break;
|
|
33331
33342
|
}
|
|
33332
33343
|
}
|
|
33344
|
+
finalize() {
|
|
33345
|
+
if (this.isSearchDirty) {
|
|
33346
|
+
this.refreshSearch();
|
|
33347
|
+
this.isSearchDirty = false;
|
|
33348
|
+
}
|
|
33349
|
+
}
|
|
33333
33350
|
// ---------------------------------------------------------------------------
|
|
33334
33351
|
// Getters
|
|
33335
33352
|
// ---------------------------------------------------------------------------
|
|
@@ -33379,11 +33396,17 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
33379
33396
|
* Find matches using the current regex
|
|
33380
33397
|
*/
|
|
33381
33398
|
findMatches() {
|
|
33382
|
-
const
|
|
33383
|
-
const cells = this.getters.getCells(
|
|
33399
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
33400
|
+
const cells = this.getters.getCells(sheetId);
|
|
33384
33401
|
const matches = [];
|
|
33385
33402
|
if (this.toSearch) {
|
|
33386
33403
|
for (const cell of Object.values(cells)) {
|
|
33404
|
+
const { col, row } = this.getters.getCellPosition(cell.id);
|
|
33405
|
+
const isColHidden = this.getters.isColHidden(sheetId, col);
|
|
33406
|
+
const isRowHidden = this.getters.isRowHidden(sheetId, row);
|
|
33407
|
+
if (isColHidden || isRowHidden) {
|
|
33408
|
+
continue;
|
|
33409
|
+
}
|
|
33387
33410
|
if (cell &&
|
|
33388
33411
|
this.currentSearchRegex &&
|
|
33389
33412
|
this.currentSearchRegex.test(this.searchOptions.searchFormulas
|
|
@@ -37271,6 +37294,7 @@ class SortPlugin extends UIPlugin {
|
|
|
37271
37294
|
const sortedIndexOfSortTypeCells = sortCells(sortingCells, sortDirection, Boolean(options.emptyCellAsZero));
|
|
37272
37295
|
const sortedIndex = sortedIndexOfSortTypeCells.map((x) => x.index);
|
|
37273
37296
|
const [width, height] = [cells.length, cells[0].length];
|
|
37297
|
+
const cellUpdates = [];
|
|
37274
37298
|
for (let c = 0; c < width; c++) {
|
|
37275
37299
|
for (let r = 0; r < height; r++) {
|
|
37276
37300
|
let cell = cells[c][sortedIndex[r]];
|
|
@@ -37281,7 +37305,6 @@ class SortPlugin extends UIPlugin {
|
|
|
37281
37305
|
col: newCol,
|
|
37282
37306
|
row: newRow,
|
|
37283
37307
|
content: "",
|
|
37284
|
-
value: "",
|
|
37285
37308
|
};
|
|
37286
37309
|
if (cell) {
|
|
37287
37310
|
let content = cell.content;
|
|
@@ -37295,11 +37318,11 @@ class SortPlugin extends UIPlugin {
|
|
|
37295
37318
|
newCellValues.style = cell.style;
|
|
37296
37319
|
newCellValues.content = content;
|
|
37297
37320
|
newCellValues.format = cell.format;
|
|
37298
|
-
newCellValues.value = cell.evaluated.value;
|
|
37299
37321
|
}
|
|
37300
|
-
|
|
37322
|
+
cellUpdates.push(newCellValues);
|
|
37301
37323
|
}
|
|
37302
37324
|
}
|
|
37325
|
+
cellUpdates.forEach((cmdPayload) => this.dispatch("UPDATE_CELL", cmdPayload));
|
|
37303
37326
|
}
|
|
37304
37327
|
/**
|
|
37305
37328
|
* Return the distances between main merge cells in the zone.
|
|
@@ -38061,6 +38084,11 @@ css /* scss */ `
|
|
|
38061
38084
|
.o-sidePanelButton:enabled {
|
|
38062
38085
|
cursor: pointer;
|
|
38063
38086
|
}
|
|
38087
|
+
|
|
38088
|
+
.o-sidePanelButton:disabled {
|
|
38089
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
38090
|
+
}
|
|
38091
|
+
|
|
38064
38092
|
.o-sidePanelButton:last-child {
|
|
38065
38093
|
margin-right: 0px;
|
|
38066
38094
|
}
|
|
@@ -42832,6 +42860,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
42832
42860
|
exports.tokenize = tokenize;
|
|
42833
42861
|
|
|
42834
42862
|
|
|
42835
|
-
__info__.version = '16.0.
|
|
42836
|
-
__info__.date = '2023-
|
|
42837
|
-
__info__.hash = '
|
|
42863
|
+
__info__.version = '16.0.16';
|
|
42864
|
+
__info__.date = '2023-08-07T09:01:50.801Z';
|
|
42865
|
+
__info__.hash = '2b5ecd8';
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1368,7 +1368,9 @@ declare class FindAndReplacePlugin extends UIPlugin {
|
|
|
1368
1368
|
private currentSearchRegex;
|
|
1369
1369
|
private searchOptions;
|
|
1370
1370
|
private toSearch;
|
|
1371
|
+
private isSearchDirty;
|
|
1371
1372
|
handle(cmd: Command): void;
|
|
1373
|
+
finalize(): void;
|
|
1372
1374
|
getSearchMatches(): SearchMatch[];
|
|
1373
1375
|
getCurrentSelectedMatchIndex(): number | null;
|
|
1374
1376
|
/**
|
|
@@ -1526,8 +1528,8 @@ interface PositionDependentCommand {
|
|
|
1526
1528
|
col: number;
|
|
1527
1529
|
row: number;
|
|
1528
1530
|
}
|
|
1529
|
-
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_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "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" | "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" | "
|
|
1530
|
-
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_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "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" | "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" | "
|
|
1531
|
+
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_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "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" | "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" | "SORT_CELLS" | "SET_DECIMAL" | "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">;
|
|
1532
|
+
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_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE" | "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" | "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" | "SORT_CELLS" | "SET_DECIMAL" | "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">;
|
|
1531
1533
|
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_BORDER" | "CREATE_CHART" | "UPDATE_CHART" | "CREATE_FILTER_TABLE" | "REMOVE_FILTER_TABLE">;
|
|
1532
1534
|
interface UpdateCellCommand extends PositionDependentCommand {
|
|
1533
1535
|
type: "UPDATE_CELL";
|
|
@@ -1962,9 +1964,6 @@ interface UpdateSearchCommand {
|
|
|
1962
1964
|
interface ClearSearchCommand {
|
|
1963
1965
|
type: "CLEAR_SEARCH";
|
|
1964
1966
|
}
|
|
1965
|
-
interface RefreshSearchCommand {
|
|
1966
|
-
type: "REFRESH_SEARCH";
|
|
1967
|
-
}
|
|
1968
1967
|
interface SelectSearchPreviousCommand {
|
|
1969
1968
|
type: "SELECT_SEARCH_PREVIOUS_MATCH";
|
|
1970
1969
|
}
|
|
@@ -2072,7 +2071,7 @@ UpdateCellCommand | UpdateCellPositionCommand | ClearCellCommand | DeleteContent
|
|
|
2072
2071
|
| CreateChartCommand | UpdateChartCommand
|
|
2073
2072
|
/** FILTERS */
|
|
2074
2073
|
| CreateFilterTableCommand | RemoveFilterTableCommand;
|
|
2075
|
-
type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | 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 |
|
|
2074
|
+
type LocalCommand = RequestUndoCommand | RequestRedoCommand | UndoCommand | RedoCommand | NewInputCommand | RemoveInputCommand | UnfocusInputCommand | FocusInputCommand | AddEmptyRangeCommand | RemoveRangeCommand | ChangeRangeCommand | CopyCommand | CutCommand | PasteCommand | 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;
|
|
2076
2075
|
type Command = CoreCommand | LocalCommand;
|
|
2077
2076
|
/**
|
|
2078
2077
|
* Holds the result of a command dispatch.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, useRef, onMounted, onPatched, onWillPatch, useState, onWillUpdateProps, useExternalListener, onWillUnmount, onWillStart,
|
|
1
|
+
import { Component, useRef, onMounted, onPatched, onWillPatch, useState, onWillUpdateProps, useExternalListener, onWillUnmount, onWillStart, useEffect, xml, useSubEnv, EventBus as EventBus$1, markRaw } from '@odoo/owl';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* usage: every string should be translated either with _lt if they are registered with a registry at
|
|
@@ -105,7 +105,7 @@ const SELECTION_BORDER_COLOR = "#3266ca";
|
|
|
105
105
|
const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
106
106
|
const CELL_BORDER_COLOR = "#E2E3E3";
|
|
107
107
|
const BACKGROUND_CHART_COLOR = "#FFFFFF";
|
|
108
|
-
const
|
|
108
|
+
const DISABLED_TEXT_COLOR = "#CACACA";
|
|
109
109
|
const DEFAULT_COLOR_SCALE_MIDPOINT_COLOR = 0xb6d7a8;
|
|
110
110
|
const LINK_COLOR = "#01666b";
|
|
111
111
|
const FILTERS_COLOR = "#188038";
|
|
@@ -3103,7 +3103,6 @@ const readonlyAllowedCommands = new Set([
|
|
|
3103
3103
|
"SET_VIEWPORT_OFFSET",
|
|
3104
3104
|
"SELECT_SEARCH_NEXT_MATCH",
|
|
3105
3105
|
"SELECT_SEARCH_PREVIOUS_MATCH",
|
|
3106
|
-
"REFRESH_SEARCH",
|
|
3107
3106
|
"UPDATE_SEARCH",
|
|
3108
3107
|
"CLEAR_SEARCH",
|
|
3109
3108
|
"EVALUATE_CELLS",
|
|
@@ -4030,7 +4029,7 @@ css /* scss */ `
|
|
|
4030
4029
|
}
|
|
4031
4030
|
}
|
|
4032
4031
|
&.disabled {
|
|
4033
|
-
color: ${
|
|
4032
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
4034
4033
|
cursor: not-allowed;
|
|
4035
4034
|
}
|
|
4036
4035
|
}
|
|
@@ -9984,11 +9983,16 @@ class FindAndReplacePanel extends Component {
|
|
|
9984
9983
|
}
|
|
9985
9984
|
setup() {
|
|
9986
9985
|
this.showFormulaState = this.env.model.getters.shouldShowFormulas();
|
|
9986
|
+
this.debouncedUpdateSearch = debounce(this.updateSearch.bind(this), 200);
|
|
9987
9987
|
onMounted(() => this.focusInput());
|
|
9988
9988
|
onWillUnmount(() => {
|
|
9989
9989
|
this.env.model.dispatch("CLEAR_SEARCH");
|
|
9990
9990
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", { show: this.showFormulaState });
|
|
9991
9991
|
});
|
|
9992
|
+
useEffect(() => {
|
|
9993
|
+
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
9994
|
+
this.searchFormulas();
|
|
9995
|
+
}, () => [this.env.model.getters.shouldShowFormulas()]);
|
|
9992
9996
|
}
|
|
9993
9997
|
onInput(ev) {
|
|
9994
9998
|
this.state.toSearch = ev.target.value;
|
|
@@ -10006,10 +10010,6 @@ class FindAndReplacePanel extends Component {
|
|
|
10006
10010
|
this.replace();
|
|
10007
10011
|
}
|
|
10008
10012
|
}
|
|
10009
|
-
onFocusSidePanel() {
|
|
10010
|
-
this.state.searchOptions.searchFormulas = this.env.model.getters.shouldShowFormulas();
|
|
10011
|
-
this.env.model.dispatch("REFRESH_SEARCH");
|
|
10012
|
-
}
|
|
10013
10013
|
searchFormulas() {
|
|
10014
10014
|
this.env.model.dispatch("SET_FORMULA_VISIBILITY", {
|
|
10015
10015
|
show: this.state.searchOptions.searchFormulas,
|
|
@@ -10028,10 +10028,6 @@ class FindAndReplacePanel extends Component {
|
|
|
10028
10028
|
searchOptions: this.state.searchOptions,
|
|
10029
10029
|
});
|
|
10030
10030
|
}
|
|
10031
|
-
debouncedUpdateSearch() {
|
|
10032
|
-
clearTimeout(this.inDebounce);
|
|
10033
|
-
this.inDebounce = setTimeout(() => this.updateSearch.call(this), 400);
|
|
10034
|
-
}
|
|
10035
10031
|
replace() {
|
|
10036
10032
|
this.env.model.dispatch("REPLACE_SEARCH", {
|
|
10037
10033
|
replaceWith: this.state.replaceWith,
|
|
@@ -21159,6 +21155,14 @@ class FiguresContainer extends Component {
|
|
|
21159
21155
|
if (dirY < 0) {
|
|
21160
21156
|
this.dnd.y = dndInitialY - deltaY;
|
|
21161
21157
|
}
|
|
21158
|
+
if (this.dnd.x < 0) {
|
|
21159
|
+
this.dnd.width += this.dnd.x;
|
|
21160
|
+
this.dnd.x = 0;
|
|
21161
|
+
}
|
|
21162
|
+
if (this.dnd.y < 0) {
|
|
21163
|
+
this.dnd.height += this.dnd.y;
|
|
21164
|
+
this.dnd.y = 0;
|
|
21165
|
+
}
|
|
21162
21166
|
};
|
|
21163
21167
|
const onMouseUp = (ev) => {
|
|
21164
21168
|
if (!this.dnd.figId) {
|
|
@@ -28862,7 +28866,7 @@ class HeaderSizePlugin extends CorePlugin {
|
|
|
28862
28866
|
this.sizes = {};
|
|
28863
28867
|
}
|
|
28864
28868
|
handle(cmd) {
|
|
28865
|
-
var _a, _b
|
|
28869
|
+
var _a, _b;
|
|
28866
28870
|
switch (cmd.type) {
|
|
28867
28871
|
case "CREATE_SHEET": {
|
|
28868
28872
|
const computedSizes = this.computeSheetSizes(cmd.sheetId);
|
|
@@ -28950,7 +28954,8 @@ class HeaderSizePlugin extends CorePlugin {
|
|
|
28950
28954
|
}
|
|
28951
28955
|
break;
|
|
28952
28956
|
case "UPDATE_CELL":
|
|
28953
|
-
|
|
28957
|
+
const row = (_b = (_a = this.sizes[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a["ROW"]) === null || _b === void 0 ? void 0 : _b[cmd.row];
|
|
28958
|
+
if (row && !row.manualSize) {
|
|
28954
28959
|
const { sheetId, row } = cmd;
|
|
28955
28960
|
this.history.update("sizes", sheetId, "ROW", row, "computedSize", lazy(() => this.getRowTallestCellSize(sheetId, row)));
|
|
28956
28961
|
}
|
|
@@ -33290,6 +33295,7 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
33290
33295
|
searchFormulas: false,
|
|
33291
33296
|
};
|
|
33292
33297
|
this.toSearch = "";
|
|
33298
|
+
this.isSearchDirty = false;
|
|
33293
33299
|
}
|
|
33294
33300
|
// ---------------------------------------------------------------------------
|
|
33295
33301
|
// Command Handling
|
|
@@ -33314,18 +33320,29 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
33314
33320
|
case "REPLACE_ALL_SEARCH":
|
|
33315
33321
|
this.replaceAll(cmd.replaceWith);
|
|
33316
33322
|
break;
|
|
33323
|
+
case "EVALUATE_CELLS":
|
|
33324
|
+
case "UPDATE_CELL":
|
|
33325
|
+
case "REMOVE_FILTER_TABLE":
|
|
33326
|
+
case "UPDATE_FILTER":
|
|
33327
|
+
this.isSearchDirty = true;
|
|
33328
|
+
break;
|
|
33317
33329
|
case "UNDO":
|
|
33318
33330
|
case "REDO":
|
|
33319
33331
|
case "REMOVE_COLUMNS_ROWS":
|
|
33332
|
+
case "HIDE_COLUMNS_ROWS":
|
|
33333
|
+
case "UNHIDE_COLUMNS_ROWS":
|
|
33320
33334
|
case "ADD_COLUMNS_ROWS":
|
|
33321
|
-
this.clearSearch();
|
|
33322
|
-
break;
|
|
33323
33335
|
case "ACTIVATE_SHEET":
|
|
33324
|
-
case "REFRESH_SEARCH":
|
|
33325
33336
|
this.refreshSearch();
|
|
33326
33337
|
break;
|
|
33327
33338
|
}
|
|
33328
33339
|
}
|
|
33340
|
+
finalize() {
|
|
33341
|
+
if (this.isSearchDirty) {
|
|
33342
|
+
this.refreshSearch();
|
|
33343
|
+
this.isSearchDirty = false;
|
|
33344
|
+
}
|
|
33345
|
+
}
|
|
33329
33346
|
// ---------------------------------------------------------------------------
|
|
33330
33347
|
// Getters
|
|
33331
33348
|
// ---------------------------------------------------------------------------
|
|
@@ -33375,11 +33392,17 @@ class FindAndReplacePlugin extends UIPlugin {
|
|
|
33375
33392
|
* Find matches using the current regex
|
|
33376
33393
|
*/
|
|
33377
33394
|
findMatches() {
|
|
33378
|
-
const
|
|
33379
|
-
const cells = this.getters.getCells(
|
|
33395
|
+
const sheetId = this.getters.getActiveSheetId();
|
|
33396
|
+
const cells = this.getters.getCells(sheetId);
|
|
33380
33397
|
const matches = [];
|
|
33381
33398
|
if (this.toSearch) {
|
|
33382
33399
|
for (const cell of Object.values(cells)) {
|
|
33400
|
+
const { col, row } = this.getters.getCellPosition(cell.id);
|
|
33401
|
+
const isColHidden = this.getters.isColHidden(sheetId, col);
|
|
33402
|
+
const isRowHidden = this.getters.isRowHidden(sheetId, row);
|
|
33403
|
+
if (isColHidden || isRowHidden) {
|
|
33404
|
+
continue;
|
|
33405
|
+
}
|
|
33383
33406
|
if (cell &&
|
|
33384
33407
|
this.currentSearchRegex &&
|
|
33385
33408
|
this.currentSearchRegex.test(this.searchOptions.searchFormulas
|
|
@@ -37267,6 +37290,7 @@ class SortPlugin extends UIPlugin {
|
|
|
37267
37290
|
const sortedIndexOfSortTypeCells = sortCells(sortingCells, sortDirection, Boolean(options.emptyCellAsZero));
|
|
37268
37291
|
const sortedIndex = sortedIndexOfSortTypeCells.map((x) => x.index);
|
|
37269
37292
|
const [width, height] = [cells.length, cells[0].length];
|
|
37293
|
+
const cellUpdates = [];
|
|
37270
37294
|
for (let c = 0; c < width; c++) {
|
|
37271
37295
|
for (let r = 0; r < height; r++) {
|
|
37272
37296
|
let cell = cells[c][sortedIndex[r]];
|
|
@@ -37277,7 +37301,6 @@ class SortPlugin extends UIPlugin {
|
|
|
37277
37301
|
col: newCol,
|
|
37278
37302
|
row: newRow,
|
|
37279
37303
|
content: "",
|
|
37280
|
-
value: "",
|
|
37281
37304
|
};
|
|
37282
37305
|
if (cell) {
|
|
37283
37306
|
let content = cell.content;
|
|
@@ -37291,11 +37314,11 @@ class SortPlugin extends UIPlugin {
|
|
|
37291
37314
|
newCellValues.style = cell.style;
|
|
37292
37315
|
newCellValues.content = content;
|
|
37293
37316
|
newCellValues.format = cell.format;
|
|
37294
|
-
newCellValues.value = cell.evaluated.value;
|
|
37295
37317
|
}
|
|
37296
|
-
|
|
37318
|
+
cellUpdates.push(newCellValues);
|
|
37297
37319
|
}
|
|
37298
37320
|
}
|
|
37321
|
+
cellUpdates.forEach((cmdPayload) => this.dispatch("UPDATE_CELL", cmdPayload));
|
|
37299
37322
|
}
|
|
37300
37323
|
/**
|
|
37301
37324
|
* Return the distances between main merge cells in the zone.
|
|
@@ -38057,6 +38080,11 @@ css /* scss */ `
|
|
|
38057
38080
|
.o-sidePanelButton:enabled {
|
|
38058
38081
|
cursor: pointer;
|
|
38059
38082
|
}
|
|
38083
|
+
|
|
38084
|
+
.o-sidePanelButton:disabled {
|
|
38085
|
+
color: ${DISABLED_TEXT_COLOR};
|
|
38086
|
+
}
|
|
38087
|
+
|
|
38060
38088
|
.o-sidePanelButton:last-child {
|
|
38061
38089
|
margin-right: 0px;
|
|
38062
38090
|
}
|
|
@@ -42800,6 +42828,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
42800
42828
|
export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
|
|
42801
42829
|
|
|
42802
42830
|
|
|
42803
|
-
__info__.version = '16.0.
|
|
42804
|
-
__info__.date = '2023-
|
|
42805
|
-
__info__.hash = '
|
|
42831
|
+
__info__.version = '16.0.16';
|
|
42832
|
+
__info__.date = '2023-08-07T09:01:50.801Z';
|
|
42833
|
+
__info__.hash = '2b5ecd8';
|