@odoo/o-spreadsheet 18.2.55 → 18.2.58
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.css +3 -3
- package/dist/o_spreadsheet.esm.js +79 -56
- package/dist/o_spreadsheet.iife.js +79 -56
- package/dist/o_spreadsheet.iife.min.js +223 -223
- package/dist/o_spreadsheet.xml +4 -4
- package/package.json +7 -2
- package/dist/o_spreadsheet.cjs.js +0 -69173
package/dist/o_spreadsheet.css
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/*
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.2.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.58
|
|
6
|
+
* @date 2026-07-01T05:02:56.953Z
|
|
7
|
+
* @hash 90648bf
|
|
8
8
|
*/
|
|
9
9
|
/* Originates from src/components/spreadsheet/spreadsheet.scss */
|
|
10
10
|
.o-spreadsheet {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.2.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.58
|
|
6
|
+
* @date 2026-07-01T05:02:55.458Z
|
|
7
|
+
* @hash 90648bf
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { App, Component, blockDom, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, xml } from "@odoo/owl";
|
|
@@ -314,7 +314,7 @@ const DEFAULT_NUMBER_STYLE = {
|
|
|
314
314
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
315
315
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
316
316
|
const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
|
|
317
|
-
const DEFAULT_FONT = "'Roboto', arial";
|
|
317
|
+
const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
|
|
318
318
|
const DEFAULT_BORDER_DESC = {
|
|
319
319
|
style: "thin",
|
|
320
320
|
color: "#000000"
|
|
@@ -7314,10 +7314,10 @@ function toNormalizedPivotValue(dimension, groupValue) {
|
|
|
7314
7314
|
type: dimension.type
|
|
7315
7315
|
}));
|
|
7316
7316
|
if (groupValueString.toLowerCase() === "false") return false;
|
|
7317
|
-
return pivotNormalizationValueRegistry.get(dimension.type)(groupValueString, dimension
|
|
7317
|
+
return pivotNormalizationValueRegistry.get(dimension.type)(groupValueString, dimension);
|
|
7318
7318
|
}
|
|
7319
|
-
function normalizeDateTime(value,
|
|
7320
|
-
return pivotTimeAdapter(granularity ?? "month").normalizeFunctionValue(value);
|
|
7319
|
+
function normalizeDateTime(value, dimension) {
|
|
7320
|
+
return pivotTimeAdapter(dimension.granularity ?? "month").normalizeFunctionValue(value);
|
|
7321
7321
|
}
|
|
7322
7322
|
function toFunctionPivotValue(value, dimension) {
|
|
7323
7323
|
if (value === null) return `"null"`;
|
|
@@ -39488,9 +39488,9 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
39488
39488
|
allSheetsMatches = [];
|
|
39489
39489
|
activeSheetMatches = [];
|
|
39490
39490
|
specificRangeMatches = [];
|
|
39491
|
+
selectedMatchPosition = null;
|
|
39491
39492
|
currentSearchRegex = null;
|
|
39492
39493
|
initialShowFormulaState;
|
|
39493
|
-
preserveSelectedMatchIndex = false;
|
|
39494
39494
|
irreplaceableMatchCount = 0;
|
|
39495
39495
|
isSearchDirty = false;
|
|
39496
39496
|
shouldFinalizeUpdateSelection = false;
|
|
@@ -39609,7 +39609,10 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
39609
39609
|
*/
|
|
39610
39610
|
_updateSearch(toSearch, searchOptions) {
|
|
39611
39611
|
this.searchOptions = searchOptions;
|
|
39612
|
-
if (toSearch !== this.toSearch)
|
|
39612
|
+
if (toSearch !== this.toSearch) {
|
|
39613
|
+
this.selectedMatchIndex = null;
|
|
39614
|
+
this.selectedMatchPosition = null;
|
|
39615
|
+
}
|
|
39613
39616
|
this.toSearch = toSearch;
|
|
39614
39617
|
this.currentSearchRegex = getSearchRegex(this.toSearch, this.searchOptions);
|
|
39615
39618
|
this.refreshSearch({
|
|
@@ -39621,8 +39624,14 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
39621
39624
|
* refresh the matches according to the current search options
|
|
39622
39625
|
*/
|
|
39623
39626
|
refreshSearch(options) {
|
|
39624
|
-
if (!this.preserveSelectedMatchIndex) this.selectedMatchIndex = null;
|
|
39625
39627
|
this.findMatches();
|
|
39628
|
+
if (this.selectedMatchPosition) if (this.selectedMatchPosition.sheetId !== this.getters.getActiveSheetId()) {
|
|
39629
|
+
this.selectedMatchIndex = null;
|
|
39630
|
+
this.selectedMatchPosition = null;
|
|
39631
|
+
} else {
|
|
39632
|
+
const index = this.searchMatches.findIndex((match) => match.sheetId === this.selectedMatchPosition?.sheetId && match.col === this.selectedMatchPosition?.col && match.row === this.selectedMatchPosition?.row);
|
|
39633
|
+
if (index !== -1) this.selectedMatchIndex = index;
|
|
39634
|
+
}
|
|
39626
39635
|
this.selectNextCell(0, options);
|
|
39627
39636
|
}
|
|
39628
39637
|
getSheetsInSearchOrder() {
|
|
@@ -39690,6 +39699,7 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
39690
39699
|
const matches = this.searchMatches;
|
|
39691
39700
|
if (!matches.length) {
|
|
39692
39701
|
this.selectedMatchIndex = null;
|
|
39702
|
+
this.selectedMatchPosition = null;
|
|
39693
39703
|
return;
|
|
39694
39704
|
}
|
|
39695
39705
|
let nextIndex;
|
|
@@ -39703,14 +39713,13 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
39703
39713
|
} else nextIndex = this.selectedMatchIndex + indexChange;
|
|
39704
39714
|
nextIndex = (nextIndex + matches.length) % matches.length;
|
|
39705
39715
|
this.selectedMatchIndex = nextIndex;
|
|
39716
|
+
this.selectedMatchPosition = matches[this.selectedMatchIndex];
|
|
39706
39717
|
const selectedMatch = matches[nextIndex];
|
|
39707
39718
|
if (options.jumpToMatchSheet && this.getters.getActiveSheetId() !== selectedMatch.sheetId) {
|
|
39708
|
-
this.preserveSelectedMatchIndex = true;
|
|
39709
39719
|
this.model.dispatch("ACTIVATE_SHEET", {
|
|
39710
39720
|
sheetIdFrom: this.getters.getActiveSheetId(),
|
|
39711
39721
|
sheetIdTo: selectedMatch.sheetId
|
|
39712
39722
|
});
|
|
39713
|
-
this.preserveSelectedMatchIndex = false;
|
|
39714
39723
|
this.isSearchDirty = false;
|
|
39715
39724
|
}
|
|
39716
39725
|
this.model.selection.getBackToDefault();
|
|
@@ -39721,7 +39730,6 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
39721
39730
|
*/
|
|
39722
39731
|
replace() {
|
|
39723
39732
|
if (this.selectedMatchIndex === null) return;
|
|
39724
|
-
this.preserveSelectedMatchIndex = true;
|
|
39725
39733
|
this.shouldFinalizeUpdateSelection = true;
|
|
39726
39734
|
this.model.dispatch("REPLACE_SEARCH", {
|
|
39727
39735
|
searchString: this.toSearch,
|
|
@@ -39729,7 +39737,6 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
39729
39737
|
matches: [this.searchMatches[this.selectedMatchIndex]],
|
|
39730
39738
|
searchOptions: this.searchOptions
|
|
39731
39739
|
});
|
|
39732
|
-
this.preserveSelectedMatchIndex = false;
|
|
39733
39740
|
}
|
|
39734
39741
|
/**
|
|
39735
39742
|
* Apply the replace function to all the matches one time.
|
|
@@ -41018,8 +41025,8 @@ var PivotRuntimeDefinition = class {
|
|
|
41018
41025
|
sortedColumn;
|
|
41019
41026
|
constructor(definition, fields) {
|
|
41020
41027
|
this.measures = definition.measures.map((measure) => createMeasure(fields, measure));
|
|
41021
|
-
this.columns = definition.columns.map((dimension) => createPivotDimension(fields, dimension));
|
|
41022
|
-
this.rows = definition.rows.map((dimension) => createPivotDimension(fields, dimension));
|
|
41028
|
+
this.columns = definition.columns.map((dimension) => this.createPivotDimension(fields, dimension));
|
|
41029
|
+
this.rows = definition.rows.map((dimension) => this.createPivotDimension(fields, dimension));
|
|
41023
41030
|
this.sortedColumn = definition.sortedColumn;
|
|
41024
41031
|
}
|
|
41025
41032
|
getDimension(nameWithGranularity) {
|
|
@@ -41032,6 +41039,40 @@ var PivotRuntimeDefinition = class {
|
|
|
41032
41039
|
if (!measure) throw new EvaluationError(_t("Field %s is not a measure", id));
|
|
41033
41040
|
return measure;
|
|
41034
41041
|
}
|
|
41042
|
+
createPivotDimension(fields, dimension) {
|
|
41043
|
+
const field = fields[dimension.fieldName];
|
|
41044
|
+
const type = field?.type ?? "integer";
|
|
41045
|
+
const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
|
|
41046
|
+
return {
|
|
41047
|
+
/**
|
|
41048
|
+
* Get the display name of the dimension
|
|
41049
|
+
* e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
|
|
41050
|
+
*/
|
|
41051
|
+
displayName: field?.string ?? dimension.fieldName,
|
|
41052
|
+
/**
|
|
41053
|
+
* Get the name of the dimension, as it is stored in the pivot formula
|
|
41054
|
+
* e.g. "stage_id", "create_date:month"
|
|
41055
|
+
*/
|
|
41056
|
+
nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
|
|
41057
|
+
/**
|
|
41058
|
+
* Get the name of the field of the dimension
|
|
41059
|
+
* e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
|
|
41060
|
+
*/
|
|
41061
|
+
fieldName: dimension.fieldName,
|
|
41062
|
+
/**
|
|
41063
|
+
* Get the aggregate operator of the dimension
|
|
41064
|
+
* e.g. "stage_id" -> undefined, "create_date:month" -> "month"
|
|
41065
|
+
*/
|
|
41066
|
+
granularity,
|
|
41067
|
+
/**
|
|
41068
|
+
* Get the type of the field of the dimension
|
|
41069
|
+
* e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
|
|
41070
|
+
*/
|
|
41071
|
+
type,
|
|
41072
|
+
order: dimension.order,
|
|
41073
|
+
isValid: !!field
|
|
41074
|
+
};
|
|
41075
|
+
}
|
|
41035
41076
|
};
|
|
41036
41077
|
function createMeasure(fields, measure) {
|
|
41037
41078
|
const fieldName = measure.fieldName;
|
|
@@ -41075,40 +41116,6 @@ function createMeasure(fields, measure) {
|
|
|
41075
41116
|
display: measure.display
|
|
41076
41117
|
};
|
|
41077
41118
|
}
|
|
41078
|
-
function createPivotDimension(fields, dimension) {
|
|
41079
|
-
const field = fields[dimension.fieldName];
|
|
41080
|
-
const type = field?.type ?? "integer";
|
|
41081
|
-
const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
|
|
41082
|
-
return {
|
|
41083
|
-
/**
|
|
41084
|
-
* Get the display name of the dimension
|
|
41085
|
-
* e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
|
|
41086
|
-
*/
|
|
41087
|
-
displayName: field?.string ?? dimension.fieldName,
|
|
41088
|
-
/**
|
|
41089
|
-
* Get the name of the dimension, as it is stored in the pivot formula
|
|
41090
|
-
* e.g. "stage_id", "create_date:month"
|
|
41091
|
-
*/
|
|
41092
|
-
nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
|
|
41093
|
-
/**
|
|
41094
|
-
* Get the name of the field of the dimension
|
|
41095
|
-
* e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
|
|
41096
|
-
*/
|
|
41097
|
-
fieldName: dimension.fieldName,
|
|
41098
|
-
/**
|
|
41099
|
-
* Get the aggregate operator of the dimension
|
|
41100
|
-
* e.g. "stage_id" -> undefined, "create_date:month" -> "month"
|
|
41101
|
-
*/
|
|
41102
|
-
granularity,
|
|
41103
|
-
/**
|
|
41104
|
-
* Get the type of the field of the dimension
|
|
41105
|
-
* e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
|
|
41106
|
-
*/
|
|
41107
|
-
type,
|
|
41108
|
-
order: dimension.order,
|
|
41109
|
-
isValid: !!field
|
|
41110
|
-
};
|
|
41111
|
-
}
|
|
41112
41119
|
|
|
41113
41120
|
//#endregion
|
|
41114
41121
|
//#region src/helpers/pivot/spreadsheet_pivot/runtime_definition_spreadsheet_pivot.ts
|
|
@@ -44192,8 +44199,12 @@ var CellComposerStore = class extends AbstractComposerStore {
|
|
|
44192
44199
|
}
|
|
44193
44200
|
stopEdition(direction) {
|
|
44194
44201
|
if (this.canStopEdition()) {
|
|
44202
|
+
const { col, row } = this.currentEditedCell;
|
|
44195
44203
|
this._stopEdition();
|
|
44196
|
-
if (direction)
|
|
44204
|
+
if (direction) {
|
|
44205
|
+
this.model.selection.selectCell(col, row);
|
|
44206
|
+
this.model.selection.moveAnchorCell(direction, 1);
|
|
44207
|
+
}
|
|
44197
44208
|
return;
|
|
44198
44209
|
}
|
|
44199
44210
|
const editedCell = this.currentEditedCell;
|
|
@@ -55003,6 +55014,9 @@ var CustomColorsPlugin = class extends CoreViewPlugin {
|
|
|
55003
55014
|
case "CREATE_CHART":
|
|
55004
55015
|
this.tryToAddColors(this.getChartColors(cmd.id));
|
|
55005
55016
|
break;
|
|
55017
|
+
case "COLOR_SHEET":
|
|
55018
|
+
if (cmd.color) this.tryToAddColors([cmd.color]);
|
|
55019
|
+
break;
|
|
55006
55020
|
case "UPDATE_CELL":
|
|
55007
55021
|
case "ADD_CONDITIONAL_FORMAT":
|
|
55008
55022
|
case "SET_BORDER":
|
|
@@ -55025,9 +55039,13 @@ var CustomColorsPlugin = class extends CoreViewPlugin {
|
|
|
55025
55039
|
}
|
|
55026
55040
|
computeCustomColors() {
|
|
55027
55041
|
let usedColors = [];
|
|
55028
|
-
for (const sheetId of this.getters.getSheetIds()) usedColors = usedColors.concat(this.getColorsFromCells(sheetId), this.getFormattingColors(sheetId), this.getTableColors(sheetId));
|
|
55042
|
+
for (const sheetId of this.getters.getSheetIds()) usedColors = usedColors.concat(this.getSheetColors(sheetId), this.getColorsFromCells(sheetId), this.getFormattingColors(sheetId), this.getTableColors(sheetId));
|
|
55029
55043
|
return [...new Set([...usedColors])];
|
|
55030
55044
|
}
|
|
55045
|
+
getSheetColors(sheetId) {
|
|
55046
|
+
const sheet = this.getters.getSheet(sheetId);
|
|
55047
|
+
return sheet.color ? [sheet.color] : [];
|
|
55048
|
+
}
|
|
55031
55049
|
getColorsFromCells(sheetId) {
|
|
55032
55050
|
const cells = Object.values(this.getters.getCells(sheetId));
|
|
55033
55051
|
const colors = /* @__PURE__ */ new Set();
|
|
@@ -62602,11 +62620,14 @@ var BottomBarSheet = class extends Component {
|
|
|
62602
62620
|
}
|
|
62603
62621
|
});
|
|
62604
62622
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
62605
|
-
useExternalListener(window, "click", ()
|
|
62623
|
+
useExternalListener(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
62606
62624
|
useEffect((sheetId) => {
|
|
62607
62625
|
if (this.props.sheetId === sheetId) this.scrollToSheet();
|
|
62608
62626
|
}, () => [this.env.model.getters.getActiveSheetId()]);
|
|
62609
62627
|
}
|
|
62628
|
+
onExternalClick(ev) {
|
|
62629
|
+
if (!ev.target.closest(".o-color-picker")) this.state.pickerOpened = false;
|
|
62630
|
+
}
|
|
62610
62631
|
focusInputAndSelectContent() {
|
|
62611
62632
|
if (!this.state.isEditing || !this.sheetNameRef.el) return;
|
|
62612
62633
|
this.sheetNameRef.el.focus();
|
|
@@ -62703,6 +62724,8 @@ var BottomBarSheet = class extends Component {
|
|
|
62703
62724
|
},
|
|
62704
62725
|
openSheetColorPickerCallback: () => {
|
|
62705
62726
|
this.state.pickerOpened = true;
|
|
62727
|
+
const sheet = this.env.model.getters.getSheet(this.props.sheetId);
|
|
62728
|
+
this.state.currentPickerColor = sheet.color;
|
|
62706
62729
|
}
|
|
62707
62730
|
});
|
|
62708
62731
|
}
|
|
@@ -68937,6 +68960,6 @@ const chartHelpers = {
|
|
|
68937
68960
|
//#endregion
|
|
68938
68961
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
68939
68962
|
|
|
68940
|
-
__info__.version = "18.2.
|
|
68941
|
-
__info__.date = "2026-
|
|
68942
|
-
__info__.hash = "
|
|
68963
|
+
__info__.version = "18.2.58";
|
|
68964
|
+
__info__.date = "2026-07-01T05:02:55.458Z";
|
|
68965
|
+
__info__.hash = "90648bf";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.2.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.58
|
|
6
|
+
* @date 2026-07-01T05:02:55.458Z
|
|
7
|
+
* @hash 90648bf
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function(exports, _odoo_owl) {
|
|
@@ -316,7 +316,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
316
316
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
317
317
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
318
318
|
const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
|
|
319
|
-
const DEFAULT_FONT = "'Roboto', arial";
|
|
319
|
+
const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
|
|
320
320
|
const DEFAULT_BORDER_DESC = {
|
|
321
321
|
style: "thin",
|
|
322
322
|
color: "#000000"
|
|
@@ -7316,10 +7316,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
7316
7316
|
type: dimension.type
|
|
7317
7317
|
}));
|
|
7318
7318
|
if (groupValueString.toLowerCase() === "false") return false;
|
|
7319
|
-
return pivotNormalizationValueRegistry.get(dimension.type)(groupValueString, dimension
|
|
7319
|
+
return pivotNormalizationValueRegistry.get(dimension.type)(groupValueString, dimension);
|
|
7320
7320
|
}
|
|
7321
|
-
function normalizeDateTime(value,
|
|
7322
|
-
return pivotTimeAdapter(granularity ?? "month").normalizeFunctionValue(value);
|
|
7321
|
+
function normalizeDateTime(value, dimension) {
|
|
7322
|
+
return pivotTimeAdapter(dimension.granularity ?? "month").normalizeFunctionValue(value);
|
|
7323
7323
|
}
|
|
7324
7324
|
function toFunctionPivotValue(value, dimension) {
|
|
7325
7325
|
if (value === null) return `"null"`;
|
|
@@ -39490,9 +39490,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39490
39490
|
allSheetsMatches = [];
|
|
39491
39491
|
activeSheetMatches = [];
|
|
39492
39492
|
specificRangeMatches = [];
|
|
39493
|
+
selectedMatchPosition = null;
|
|
39493
39494
|
currentSearchRegex = null;
|
|
39494
39495
|
initialShowFormulaState;
|
|
39495
|
-
preserveSelectedMatchIndex = false;
|
|
39496
39496
|
irreplaceableMatchCount = 0;
|
|
39497
39497
|
isSearchDirty = false;
|
|
39498
39498
|
shouldFinalizeUpdateSelection = false;
|
|
@@ -39611,7 +39611,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39611
39611
|
*/
|
|
39612
39612
|
_updateSearch(toSearch, searchOptions) {
|
|
39613
39613
|
this.searchOptions = searchOptions;
|
|
39614
|
-
if (toSearch !== this.toSearch)
|
|
39614
|
+
if (toSearch !== this.toSearch) {
|
|
39615
|
+
this.selectedMatchIndex = null;
|
|
39616
|
+
this.selectedMatchPosition = null;
|
|
39617
|
+
}
|
|
39615
39618
|
this.toSearch = toSearch;
|
|
39616
39619
|
this.currentSearchRegex = getSearchRegex(this.toSearch, this.searchOptions);
|
|
39617
39620
|
this.refreshSearch({
|
|
@@ -39623,8 +39626,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39623
39626
|
* refresh the matches according to the current search options
|
|
39624
39627
|
*/
|
|
39625
39628
|
refreshSearch(options) {
|
|
39626
|
-
if (!this.preserveSelectedMatchIndex) this.selectedMatchIndex = null;
|
|
39627
39629
|
this.findMatches();
|
|
39630
|
+
if (this.selectedMatchPosition) if (this.selectedMatchPosition.sheetId !== this.getters.getActiveSheetId()) {
|
|
39631
|
+
this.selectedMatchIndex = null;
|
|
39632
|
+
this.selectedMatchPosition = null;
|
|
39633
|
+
} else {
|
|
39634
|
+
const index = this.searchMatches.findIndex((match) => match.sheetId === this.selectedMatchPosition?.sheetId && match.col === this.selectedMatchPosition?.col && match.row === this.selectedMatchPosition?.row);
|
|
39635
|
+
if (index !== -1) this.selectedMatchIndex = index;
|
|
39636
|
+
}
|
|
39628
39637
|
this.selectNextCell(0, options);
|
|
39629
39638
|
}
|
|
39630
39639
|
getSheetsInSearchOrder() {
|
|
@@ -39692,6 +39701,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39692
39701
|
const matches = this.searchMatches;
|
|
39693
39702
|
if (!matches.length) {
|
|
39694
39703
|
this.selectedMatchIndex = null;
|
|
39704
|
+
this.selectedMatchPosition = null;
|
|
39695
39705
|
return;
|
|
39696
39706
|
}
|
|
39697
39707
|
let nextIndex;
|
|
@@ -39705,14 +39715,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39705
39715
|
} else nextIndex = this.selectedMatchIndex + indexChange;
|
|
39706
39716
|
nextIndex = (nextIndex + matches.length) % matches.length;
|
|
39707
39717
|
this.selectedMatchIndex = nextIndex;
|
|
39718
|
+
this.selectedMatchPosition = matches[this.selectedMatchIndex];
|
|
39708
39719
|
const selectedMatch = matches[nextIndex];
|
|
39709
39720
|
if (options.jumpToMatchSheet && this.getters.getActiveSheetId() !== selectedMatch.sheetId) {
|
|
39710
|
-
this.preserveSelectedMatchIndex = true;
|
|
39711
39721
|
this.model.dispatch("ACTIVATE_SHEET", {
|
|
39712
39722
|
sheetIdFrom: this.getters.getActiveSheetId(),
|
|
39713
39723
|
sheetIdTo: selectedMatch.sheetId
|
|
39714
39724
|
});
|
|
39715
|
-
this.preserveSelectedMatchIndex = false;
|
|
39716
39725
|
this.isSearchDirty = false;
|
|
39717
39726
|
}
|
|
39718
39727
|
this.model.selection.getBackToDefault();
|
|
@@ -39723,7 +39732,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39723
39732
|
*/
|
|
39724
39733
|
replace() {
|
|
39725
39734
|
if (this.selectedMatchIndex === null) return;
|
|
39726
|
-
this.preserveSelectedMatchIndex = true;
|
|
39727
39735
|
this.shouldFinalizeUpdateSelection = true;
|
|
39728
39736
|
this.model.dispatch("REPLACE_SEARCH", {
|
|
39729
39737
|
searchString: this.toSearch,
|
|
@@ -39731,7 +39739,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39731
39739
|
matches: [this.searchMatches[this.selectedMatchIndex]],
|
|
39732
39740
|
searchOptions: this.searchOptions
|
|
39733
39741
|
});
|
|
39734
|
-
this.preserveSelectedMatchIndex = false;
|
|
39735
39742
|
}
|
|
39736
39743
|
/**
|
|
39737
39744
|
* Apply the replace function to all the matches one time.
|
|
@@ -41020,8 +41027,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41020
41027
|
sortedColumn;
|
|
41021
41028
|
constructor(definition, fields) {
|
|
41022
41029
|
this.measures = definition.measures.map((measure) => createMeasure(fields, measure));
|
|
41023
|
-
this.columns = definition.columns.map((dimension) => createPivotDimension(fields, dimension));
|
|
41024
|
-
this.rows = definition.rows.map((dimension) => createPivotDimension(fields, dimension));
|
|
41030
|
+
this.columns = definition.columns.map((dimension) => this.createPivotDimension(fields, dimension));
|
|
41031
|
+
this.rows = definition.rows.map((dimension) => this.createPivotDimension(fields, dimension));
|
|
41025
41032
|
this.sortedColumn = definition.sortedColumn;
|
|
41026
41033
|
}
|
|
41027
41034
|
getDimension(nameWithGranularity) {
|
|
@@ -41034,6 +41041,40 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41034
41041
|
if (!measure) throw new EvaluationError(_t("Field %s is not a measure", id));
|
|
41035
41042
|
return measure;
|
|
41036
41043
|
}
|
|
41044
|
+
createPivotDimension(fields, dimension) {
|
|
41045
|
+
const field = fields[dimension.fieldName];
|
|
41046
|
+
const type = field?.type ?? "integer";
|
|
41047
|
+
const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
|
|
41048
|
+
return {
|
|
41049
|
+
/**
|
|
41050
|
+
* Get the display name of the dimension
|
|
41051
|
+
* e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
|
|
41052
|
+
*/
|
|
41053
|
+
displayName: field?.string ?? dimension.fieldName,
|
|
41054
|
+
/**
|
|
41055
|
+
* Get the name of the dimension, as it is stored in the pivot formula
|
|
41056
|
+
* e.g. "stage_id", "create_date:month"
|
|
41057
|
+
*/
|
|
41058
|
+
nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
|
|
41059
|
+
/**
|
|
41060
|
+
* Get the name of the field of the dimension
|
|
41061
|
+
* e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
|
|
41062
|
+
*/
|
|
41063
|
+
fieldName: dimension.fieldName,
|
|
41064
|
+
/**
|
|
41065
|
+
* Get the aggregate operator of the dimension
|
|
41066
|
+
* e.g. "stage_id" -> undefined, "create_date:month" -> "month"
|
|
41067
|
+
*/
|
|
41068
|
+
granularity,
|
|
41069
|
+
/**
|
|
41070
|
+
* Get the type of the field of the dimension
|
|
41071
|
+
* e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
|
|
41072
|
+
*/
|
|
41073
|
+
type,
|
|
41074
|
+
order: dimension.order,
|
|
41075
|
+
isValid: !!field
|
|
41076
|
+
};
|
|
41077
|
+
}
|
|
41037
41078
|
};
|
|
41038
41079
|
function createMeasure(fields, measure) {
|
|
41039
41080
|
const fieldName = measure.fieldName;
|
|
@@ -41077,40 +41118,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41077
41118
|
display: measure.display
|
|
41078
41119
|
};
|
|
41079
41120
|
}
|
|
41080
|
-
function createPivotDimension(fields, dimension) {
|
|
41081
|
-
const field = fields[dimension.fieldName];
|
|
41082
|
-
const type = field?.type ?? "integer";
|
|
41083
|
-
const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
|
|
41084
|
-
return {
|
|
41085
|
-
/**
|
|
41086
|
-
* Get the display name of the dimension
|
|
41087
|
-
* e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
|
|
41088
|
-
*/
|
|
41089
|
-
displayName: field?.string ?? dimension.fieldName,
|
|
41090
|
-
/**
|
|
41091
|
-
* Get the name of the dimension, as it is stored in the pivot formula
|
|
41092
|
-
* e.g. "stage_id", "create_date:month"
|
|
41093
|
-
*/
|
|
41094
|
-
nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
|
|
41095
|
-
/**
|
|
41096
|
-
* Get the name of the field of the dimension
|
|
41097
|
-
* e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
|
|
41098
|
-
*/
|
|
41099
|
-
fieldName: dimension.fieldName,
|
|
41100
|
-
/**
|
|
41101
|
-
* Get the aggregate operator of the dimension
|
|
41102
|
-
* e.g. "stage_id" -> undefined, "create_date:month" -> "month"
|
|
41103
|
-
*/
|
|
41104
|
-
granularity,
|
|
41105
|
-
/**
|
|
41106
|
-
* Get the type of the field of the dimension
|
|
41107
|
-
* e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
|
|
41108
|
-
*/
|
|
41109
|
-
type,
|
|
41110
|
-
order: dimension.order,
|
|
41111
|
-
isValid: !!field
|
|
41112
|
-
};
|
|
41113
|
-
}
|
|
41114
41121
|
|
|
41115
41122
|
//#endregion
|
|
41116
41123
|
//#region src/helpers/pivot/spreadsheet_pivot/runtime_definition_spreadsheet_pivot.ts
|
|
@@ -44194,8 +44201,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44194
44201
|
}
|
|
44195
44202
|
stopEdition(direction) {
|
|
44196
44203
|
if (this.canStopEdition()) {
|
|
44204
|
+
const { col, row } = this.currentEditedCell;
|
|
44197
44205
|
this._stopEdition();
|
|
44198
|
-
if (direction)
|
|
44206
|
+
if (direction) {
|
|
44207
|
+
this.model.selection.selectCell(col, row);
|
|
44208
|
+
this.model.selection.moveAnchorCell(direction, 1);
|
|
44209
|
+
}
|
|
44199
44210
|
return;
|
|
44200
44211
|
}
|
|
44201
44212
|
const editedCell = this.currentEditedCell;
|
|
@@ -55005,6 +55016,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55005
55016
|
case "CREATE_CHART":
|
|
55006
55017
|
this.tryToAddColors(this.getChartColors(cmd.id));
|
|
55007
55018
|
break;
|
|
55019
|
+
case "COLOR_SHEET":
|
|
55020
|
+
if (cmd.color) this.tryToAddColors([cmd.color]);
|
|
55021
|
+
break;
|
|
55008
55022
|
case "UPDATE_CELL":
|
|
55009
55023
|
case "ADD_CONDITIONAL_FORMAT":
|
|
55010
55024
|
case "SET_BORDER":
|
|
@@ -55027,9 +55041,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55027
55041
|
}
|
|
55028
55042
|
computeCustomColors() {
|
|
55029
55043
|
let usedColors = [];
|
|
55030
|
-
for (const sheetId of this.getters.getSheetIds()) usedColors = usedColors.concat(this.getColorsFromCells(sheetId), this.getFormattingColors(sheetId), this.getTableColors(sheetId));
|
|
55044
|
+
for (const sheetId of this.getters.getSheetIds()) usedColors = usedColors.concat(this.getSheetColors(sheetId), this.getColorsFromCells(sheetId), this.getFormattingColors(sheetId), this.getTableColors(sheetId));
|
|
55031
55045
|
return [...new Set([...usedColors])];
|
|
55032
55046
|
}
|
|
55047
|
+
getSheetColors(sheetId) {
|
|
55048
|
+
const sheet = this.getters.getSheet(sheetId);
|
|
55049
|
+
return sheet.color ? [sheet.color] : [];
|
|
55050
|
+
}
|
|
55033
55051
|
getColorsFromCells(sheetId) {
|
|
55034
55052
|
const cells = Object.values(this.getters.getCells(sheetId));
|
|
55035
55053
|
const colors = /* @__PURE__ */ new Set();
|
|
@@ -62604,11 +62622,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62604
62622
|
}
|
|
62605
62623
|
});
|
|
62606
62624
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
62607
|
-
(0, _odoo_owl.useExternalListener)(window, "click", ()
|
|
62625
|
+
(0, _odoo_owl.useExternalListener)(window, "click", this.onExternalClick.bind(this), { capture: true });
|
|
62608
62626
|
(0, _odoo_owl.useEffect)((sheetId) => {
|
|
62609
62627
|
if (this.props.sheetId === sheetId) this.scrollToSheet();
|
|
62610
62628
|
}, () => [this.env.model.getters.getActiveSheetId()]);
|
|
62611
62629
|
}
|
|
62630
|
+
onExternalClick(ev) {
|
|
62631
|
+
if (!ev.target.closest(".o-color-picker")) this.state.pickerOpened = false;
|
|
62632
|
+
}
|
|
62612
62633
|
focusInputAndSelectContent() {
|
|
62613
62634
|
if (!this.state.isEditing || !this.sheetNameRef.el) return;
|
|
62614
62635
|
this.sheetNameRef.el.focus();
|
|
@@ -62705,6 +62726,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62705
62726
|
},
|
|
62706
62727
|
openSheetColorPickerCallback: () => {
|
|
62707
62728
|
this.state.pickerOpened = true;
|
|
62729
|
+
const sheet = this.env.model.getters.getSheet(this.props.sheetId);
|
|
62730
|
+
this.state.currentPickerColor = sheet.color;
|
|
62708
62731
|
}
|
|
62709
62732
|
});
|
|
62710
62733
|
}
|
|
@@ -68985,8 +69008,8 @@ exports.stores = stores;
|
|
|
68985
69008
|
exports.tokenColors = tokenColors;
|
|
68986
69009
|
exports.tokenize = tokenize;
|
|
68987
69010
|
|
|
68988
|
-
__info__.version = "18.2.
|
|
68989
|
-
__info__.date = "2026-
|
|
68990
|
-
__info__.hash = "
|
|
69011
|
+
__info__.version = "18.2.58";
|
|
69012
|
+
__info__.date = "2026-07-01T05:02:55.458Z";
|
|
69013
|
+
__info__.hash = "90648bf";
|
|
68991
69014
|
|
|
68992
69015
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|