@odoo/o-spreadsheet 18.0.36 → 18.0.38
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 +197 -71
- package/dist/o-spreadsheet.d.ts +7 -2
- package/dist/o-spreadsheet.esm.js +197 -71
- package/dist/o-spreadsheet.iife.js +197 -71
- package/dist/o-spreadsheet.iife.min.js +370 -370
- package/dist/o_spreadsheet.xml +8 -7
- package/package.json +1 -3
|
@@ -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.0.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.38
|
|
6
|
+
* @date 2025-07-28T13:29:40.841Z
|
|
7
|
+
* @hash 0f3b11a
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -819,6 +819,7 @@ const specialWhiteSpaceSpecialCharacters = [
|
|
|
819
819
|
];
|
|
820
820
|
const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
|
|
821
821
|
const newLineRegexp = /(\r\n|\r)/g;
|
|
822
|
+
const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
|
|
822
823
|
/**
|
|
823
824
|
* Replace all different newlines characters by \n
|
|
824
825
|
*/
|
|
@@ -2662,8 +2663,9 @@ const INITIAL_JS_DAY = DateTime.fromTimestamp(0);
|
|
|
2662
2663
|
const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
|
|
2663
2664
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
2664
2665
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
2665
|
-
const
|
|
2666
|
-
const
|
|
2666
|
+
const whiteSpaceChars = whiteSpaceCharacters.join("");
|
|
2667
|
+
const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
|
|
2668
|
+
const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
|
|
2667
2669
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
2668
2670
|
/** Convert a value number representing a date, or return undefined if it isn't possible */
|
|
2669
2671
|
function valueToDateNumber(value, locale) {
|
|
@@ -6366,6 +6368,8 @@ function splitWordToSpecificWidth(ctx, word, width, style) {
|
|
|
6366
6368
|
function splitTextToWidth(ctx, text, style, width) {
|
|
6367
6369
|
if (!style)
|
|
6368
6370
|
style = {};
|
|
6371
|
+
if (isMarkdownLink(text))
|
|
6372
|
+
text = parseMarkdownLink(text).label;
|
|
6369
6373
|
const brokenText = [];
|
|
6370
6374
|
// Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
|
|
6371
6375
|
// but 5-10x faster if it doesn't
|
|
@@ -8319,6 +8323,10 @@ function toNormalizedPivotValue(dimension, groupValue) {
|
|
|
8319
8323
|
if (groupValue === null || groupValue === "null") {
|
|
8320
8324
|
return null;
|
|
8321
8325
|
}
|
|
8326
|
+
const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
|
|
8327
|
+
if (isEvaluationError(extractedGroupValue)) {
|
|
8328
|
+
return extractedGroupValue;
|
|
8329
|
+
}
|
|
8322
8330
|
const groupValueString = typeof groupValue === "boolean"
|
|
8323
8331
|
? toString(groupValue).toLocaleLowerCase()
|
|
8324
8332
|
: toString(groupValue);
|
|
@@ -12966,38 +12974,111 @@ function convertPivotTableConfig(pivotTable) {
|
|
|
12966
12974
|
* In all the sheets, replace the table-only references in the formula cells with standard references.
|
|
12967
12975
|
*/
|
|
12968
12976
|
function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
|
|
12977
|
+
let deconstructedSheets = null;
|
|
12969
12978
|
for (let tableSheet of convertedSheets) {
|
|
12970
12979
|
const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
|
|
12980
|
+
if (!tables || tables.length === 0) {
|
|
12981
|
+
continue;
|
|
12982
|
+
}
|
|
12983
|
+
// Only deconstruct sheets if we are sure there are tables to process
|
|
12984
|
+
if (!deconstructedSheets) {
|
|
12985
|
+
deconstructedSheets = deconstructSheets(convertedSheets);
|
|
12986
|
+
}
|
|
12971
12987
|
for (let table of tables) {
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
for (let xc in
|
|
12975
|
-
const
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
let openBrackets = 1;
|
|
12981
|
-
while (openBrackets > 0 && endIndex < cell.content.length) {
|
|
12982
|
-
if (cell.content[endIndex] === "[") {
|
|
12983
|
-
openBrackets++;
|
|
12984
|
-
}
|
|
12985
|
-
else if (cell.content[endIndex] === "]") {
|
|
12986
|
-
openBrackets--;
|
|
12987
|
-
}
|
|
12988
|
-
endIndex++;
|
|
12989
|
-
}
|
|
12990
|
-
let reference = cell.content.slice(refIndex + tabRef.length, endIndex - 1);
|
|
12991
|
-
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
12992
|
-
const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
|
|
12993
|
-
cell.content =
|
|
12994
|
-
cell.content.slice(0, refIndex) + convertedRef + cell.content.slice(endIndex);
|
|
12988
|
+
for (let sheetId in deconstructedSheets) {
|
|
12989
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
12990
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
12991
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
12992
|
+
for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
|
|
12993
|
+
const possibleTable = deconstructedSheets[sheetId][xc][i];
|
|
12994
|
+
if (!possibleTable.endsWith(table.name)) {
|
|
12995
|
+
continue;
|
|
12995
12996
|
}
|
|
12997
|
+
const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
|
|
12998
|
+
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
12999
|
+
const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
|
|
13000
|
+
deconstructedSheets[sheetId][xc][i + 2] =
|
|
13001
|
+
possibleTable.slice(0, possibleTable.indexOf(table.name)) +
|
|
13002
|
+
convertedRef +
|
|
13003
|
+
deconstructedSheets[sheetId][xc][i + 2];
|
|
13004
|
+
deconstructedSheets[sheetId][xc].splice(i, 2);
|
|
12996
13005
|
}
|
|
12997
13006
|
}
|
|
12998
13007
|
}
|
|
12999
13008
|
}
|
|
13000
13009
|
}
|
|
13010
|
+
if (!deconstructedSheets) {
|
|
13011
|
+
return;
|
|
13012
|
+
}
|
|
13013
|
+
for (let sheetId in deconstructedSheets) {
|
|
13014
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
13015
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
13016
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
13017
|
+
if (deconstructedCell.length === 1) {
|
|
13018
|
+
sheet.cells[xc].content = deconstructedCell[0];
|
|
13019
|
+
continue;
|
|
13020
|
+
}
|
|
13021
|
+
let newContent = "";
|
|
13022
|
+
for (let i = 0; i < deconstructedCell.length; i += 2) {
|
|
13023
|
+
newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
|
|
13024
|
+
}
|
|
13025
|
+
newContent += deconstructedCell[deconstructedCell.length - 1];
|
|
13026
|
+
sheet.cells[xc].content = newContent;
|
|
13027
|
+
}
|
|
13028
|
+
}
|
|
13029
|
+
}
|
|
13030
|
+
/**
|
|
13031
|
+
* Deconstruct the content of the cells in the sheets to extract possible table references.
|
|
13032
|
+
* Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
|
|
13033
|
+
* return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
|
|
13034
|
+
*/
|
|
13035
|
+
function deconstructSheets(convertedSheets) {
|
|
13036
|
+
const deconstructedSheets = {};
|
|
13037
|
+
for (let sheet of convertedSheets) {
|
|
13038
|
+
for (let xc in sheet.cells) {
|
|
13039
|
+
const cellContent = sheet.cells[xc]?.content;
|
|
13040
|
+
if (!cellContent || !cellContent.startsWith("=")) {
|
|
13041
|
+
continue;
|
|
13042
|
+
}
|
|
13043
|
+
const startIndex = cellContent.indexOf("[");
|
|
13044
|
+
if (startIndex === -1) {
|
|
13045
|
+
continue;
|
|
13046
|
+
}
|
|
13047
|
+
const deconstructedCell = [];
|
|
13048
|
+
let possibleTable = cellContent.slice(0, startIndex);
|
|
13049
|
+
let possibleRef = "";
|
|
13050
|
+
let openBrackets = 1;
|
|
13051
|
+
let mainPossibleTableIndex = 0;
|
|
13052
|
+
let mainOpenBracketIndex = startIndex;
|
|
13053
|
+
for (let index = startIndex + 1; index < cellContent.length; index++) {
|
|
13054
|
+
if (cellContent[index] === "[") {
|
|
13055
|
+
if (openBrackets === 0) {
|
|
13056
|
+
possibleTable = cellContent.slice(mainPossibleTableIndex, index);
|
|
13057
|
+
mainOpenBracketIndex = index;
|
|
13058
|
+
}
|
|
13059
|
+
openBrackets++;
|
|
13060
|
+
continue;
|
|
13061
|
+
}
|
|
13062
|
+
if (cellContent[index] === "]") {
|
|
13063
|
+
openBrackets--;
|
|
13064
|
+
if (openBrackets === 0) {
|
|
13065
|
+
possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
|
|
13066
|
+
deconstructedCell.push(possibleTable);
|
|
13067
|
+
deconstructedCell.push(possibleRef);
|
|
13068
|
+
mainPossibleTableIndex = index + 1;
|
|
13069
|
+
}
|
|
13070
|
+
}
|
|
13071
|
+
}
|
|
13072
|
+
if (deconstructedCell.length) {
|
|
13073
|
+
if (!deconstructedSheets[sheet.id]) {
|
|
13074
|
+
deconstructedSheets[sheet.id] = {};
|
|
13075
|
+
}
|
|
13076
|
+
deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
|
|
13077
|
+
deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
|
|
13078
|
+
}
|
|
13079
|
+
}
|
|
13080
|
+
}
|
|
13081
|
+
return deconstructedSheets;
|
|
13001
13082
|
}
|
|
13002
13083
|
/**
|
|
13003
13084
|
* Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
|
|
@@ -17296,6 +17377,7 @@ const autoCompleteProviders = new Registry();
|
|
|
17296
17377
|
|
|
17297
17378
|
autoCompleteProviders.add("dataValidation", {
|
|
17298
17379
|
displayAllOnInitialContent: true,
|
|
17380
|
+
canBeToggled: false,
|
|
17299
17381
|
getProposals(tokenAtCursor, content) {
|
|
17300
17382
|
if (content.startsWith("=")) {
|
|
17301
17383
|
return [];
|
|
@@ -24951,11 +25033,17 @@ const COLUMN = {
|
|
|
24951
25033
|
if (isEvaluationError(cellReference?.value)) {
|
|
24952
25034
|
return cellReference;
|
|
24953
25035
|
}
|
|
24954
|
-
|
|
24955
|
-
|
|
24956
|
-
|
|
24957
|
-
|
|
24958
|
-
|
|
25036
|
+
if (cellReference === undefined) {
|
|
25037
|
+
assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25038
|
+
return this.__originCellPosition.col + 1;
|
|
25039
|
+
}
|
|
25040
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25041
|
+
if (zone.left === zone.right) {
|
|
25042
|
+
return zone.left + 1;
|
|
25043
|
+
}
|
|
25044
|
+
return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
|
|
25045
|
+
value: zone.left + col + 1,
|
|
25046
|
+
}));
|
|
24959
25047
|
},
|
|
24960
25048
|
isExported: true,
|
|
24961
25049
|
};
|
|
@@ -25174,11 +25262,17 @@ const ROW = {
|
|
|
25174
25262
|
if (isEvaluationError(cellReference?.value)) {
|
|
25175
25263
|
return cellReference;
|
|
25176
25264
|
}
|
|
25177
|
-
|
|
25178
|
-
|
|
25179
|
-
|
|
25180
|
-
|
|
25181
|
-
|
|
25265
|
+
if (cellReference === undefined) {
|
|
25266
|
+
assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25267
|
+
return this.__originCellPosition.row + 1;
|
|
25268
|
+
}
|
|
25269
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25270
|
+
if (zone.top === zone.bottom) {
|
|
25271
|
+
return zone.top + 1;
|
|
25272
|
+
}
|
|
25273
|
+
return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
|
|
25274
|
+
value: zone.top + row + 1,
|
|
25275
|
+
}));
|
|
25182
25276
|
},
|
|
25183
25277
|
isExported: true,
|
|
25184
25278
|
};
|
|
@@ -27834,9 +27928,13 @@ class Composer extends owl.Component {
|
|
|
27834
27928
|
}
|
|
27835
27929
|
}
|
|
27836
27930
|
closeAssistant() {
|
|
27931
|
+
if (!this.canBeToggled)
|
|
27932
|
+
return;
|
|
27837
27933
|
this.assistant.forcedClosed = true;
|
|
27838
27934
|
}
|
|
27839
27935
|
openAssistant() {
|
|
27936
|
+
if (!this.canBeToggled)
|
|
27937
|
+
return;
|
|
27840
27938
|
this.assistant.forcedClosed = false;
|
|
27841
27939
|
}
|
|
27842
27940
|
onWheel(event) {
|
|
@@ -27846,6 +27944,9 @@ class Composer extends owl.Component {
|
|
|
27846
27944
|
event.stopPropagation();
|
|
27847
27945
|
}
|
|
27848
27946
|
}
|
|
27947
|
+
get canBeToggled() {
|
|
27948
|
+
return this.autoCompleteState.provider?.canBeToggled ?? true;
|
|
27949
|
+
}
|
|
27849
27950
|
// ---------------------------------------------------------------------------
|
|
27850
27951
|
// Private
|
|
27851
27952
|
// ---------------------------------------------------------------------------
|
|
@@ -28028,7 +28129,7 @@ class Composer extends owl.Component {
|
|
|
28028
28129
|
}
|
|
28029
28130
|
}
|
|
28030
28131
|
autoComplete(value) {
|
|
28031
|
-
if (!value || this.assistant.forcedClosed) {
|
|
28132
|
+
if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
|
|
28032
28133
|
return;
|
|
28033
28134
|
}
|
|
28034
28135
|
this.autoCompleteState.provider?.selectProposal(value);
|
|
@@ -39600,6 +39701,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
39600
39701
|
proposals,
|
|
39601
39702
|
selectProposal: provider.selectProposal,
|
|
39602
39703
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39704
|
+
canBeToggled: provider.canBeToggled,
|
|
39603
39705
|
};
|
|
39604
39706
|
}
|
|
39605
39707
|
if (exactMatch && this._currentContent !== this.initialContent) {
|
|
@@ -39622,6 +39724,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
39622
39724
|
proposals,
|
|
39623
39725
|
selectProposal: provider.selectProposal,
|
|
39624
39726
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39727
|
+
canBeToggled: provider.canBeToggled,
|
|
39625
39728
|
};
|
|
39626
39729
|
}
|
|
39627
39730
|
}
|
|
@@ -44568,10 +44671,7 @@ class SpreadsheetPivot {
|
|
|
44568
44671
|
if (finalCell.value === null) {
|
|
44569
44672
|
return { value: _t("(Undefined)") };
|
|
44570
44673
|
}
|
|
44571
|
-
return
|
|
44572
|
-
value: finalCell.value,
|
|
44573
|
-
format: finalCell.format,
|
|
44574
|
-
};
|
|
44674
|
+
return finalCell;
|
|
44575
44675
|
}
|
|
44576
44676
|
getPivotCellValueAndFormat(measureId, domain) {
|
|
44577
44677
|
const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
|
|
@@ -44664,9 +44764,15 @@ class SpreadsheetPivot {
|
|
|
44664
44764
|
return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
|
|
44665
44765
|
}
|
|
44666
44766
|
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
44667
|
-
const { field, value } = domain;
|
|
44767
|
+
const { field, value, type } = domain;
|
|
44668
44768
|
const { nameWithGranularity } = this.getDimension(field);
|
|
44669
|
-
return dataEntries.filter((entry) =>
|
|
44769
|
+
return dataEntries.filter((entry) => {
|
|
44770
|
+
const cellValue = entry[nameWithGranularity]?.value;
|
|
44771
|
+
if (type === "char") {
|
|
44772
|
+
return String(cellValue) === String(value);
|
|
44773
|
+
}
|
|
44774
|
+
return cellValue === value;
|
|
44775
|
+
});
|
|
44670
44776
|
}
|
|
44671
44777
|
getDimension(nameWithGranularity) {
|
|
44672
44778
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -44802,7 +44908,6 @@ pivotRegistry.add("SPREADSHEET", {
|
|
|
44802
44908
|
ui: SpreadsheetPivot,
|
|
44803
44909
|
definition: SpreadsheetPivotRuntimeDefinition,
|
|
44804
44910
|
externalData: false,
|
|
44805
|
-
onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
|
|
44806
44911
|
dateGranularities: [...dateGranularities],
|
|
44807
44912
|
datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
|
|
44808
44913
|
isMeasureCandidate: (field) => !["datetime", "boolean"].includes(field.type),
|
|
@@ -47142,6 +47247,11 @@ class GridComposer extends owl.Component {
|
|
|
47142
47247
|
rect = this.defaultRect;
|
|
47143
47248
|
isEditing = false;
|
|
47144
47249
|
isCellReferenceVisible = false;
|
|
47250
|
+
currentEditedCell = {
|
|
47251
|
+
col: 0,
|
|
47252
|
+
row: 0,
|
|
47253
|
+
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
47254
|
+
};
|
|
47145
47255
|
composerStore;
|
|
47146
47256
|
composerFocusStore;
|
|
47147
47257
|
composerInterface;
|
|
@@ -47171,7 +47281,7 @@ class GridComposer extends owl.Component {
|
|
|
47171
47281
|
return this.isCellReferenceVisible;
|
|
47172
47282
|
}
|
|
47173
47283
|
get cellReference() {
|
|
47174
|
-
const { col, row, sheetId } = this.
|
|
47284
|
+
const { col, row, sheetId } = this.currentEditedCell;
|
|
47175
47285
|
const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
|
|
47176
47286
|
return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
|
|
47177
47287
|
}
|
|
@@ -47264,12 +47374,17 @@ class GridComposer extends owl.Component {
|
|
|
47264
47374
|
if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
|
|
47265
47375
|
this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
|
|
47266
47376
|
}
|
|
47377
|
+
let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
|
|
47267
47378
|
if (this.isEditing !== isEditing) {
|
|
47268
47379
|
this.isEditing = isEditing;
|
|
47269
47380
|
if (!isEditing) {
|
|
47270
47381
|
this.rect = this.defaultRect;
|
|
47271
47382
|
return;
|
|
47272
47383
|
}
|
|
47384
|
+
this.currentEditedCell = this.composerStore.currentEditedCell;
|
|
47385
|
+
shouldRecomputeRect = true;
|
|
47386
|
+
}
|
|
47387
|
+
if (shouldRecomputeRect) {
|
|
47273
47388
|
const position = this.env.model.getters.getActivePosition();
|
|
47274
47389
|
const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
|
|
47275
47390
|
this.rect = this.env.model.getters.getVisibleRect(zone);
|
|
@@ -57473,7 +57588,7 @@ const onIterationEndEvaluationRegistry = new Registry();
|
|
|
57473
57588
|
onIterationEndEvaluationRegistry.add("pivots", (getters) => {
|
|
57474
57589
|
for (const pivotId of getters.getPivotIds()) {
|
|
57475
57590
|
const pivot = getters.getPivot(pivotId);
|
|
57476
|
-
|
|
57591
|
+
pivot.markAsDirtyForEvaluation?.();
|
|
57477
57592
|
}
|
|
57478
57593
|
});
|
|
57479
57594
|
|
|
@@ -60336,6 +60451,23 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
60336
60451
|
static getters = ["getRowSize", "getHeaderSize"];
|
|
60337
60452
|
tallestCellInRow = {};
|
|
60338
60453
|
ctx = document.createElement("canvas").getContext("2d");
|
|
60454
|
+
beforeHandle(cmd) {
|
|
60455
|
+
switch (cmd.type) {
|
|
60456
|
+
// Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
|
|
60457
|
+
// "UPDATE_CELL" uses the Sheet core plugin to access row data.
|
|
60458
|
+
// If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
|
|
60459
|
+
// size updates may apply to incorrect (pre-insert) rows.
|
|
60460
|
+
case "ADD_COLUMNS_ROWS":
|
|
60461
|
+
if (cmd.dimension === "COL") {
|
|
60462
|
+
return;
|
|
60463
|
+
}
|
|
60464
|
+
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60465
|
+
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60466
|
+
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60467
|
+
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60468
|
+
break;
|
|
60469
|
+
}
|
|
60470
|
+
}
|
|
60339
60471
|
handle(cmd) {
|
|
60340
60472
|
switch (cmd.type) {
|
|
60341
60473
|
case "START":
|
|
@@ -60365,16 +60497,6 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
60365
60497
|
this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
|
|
60366
60498
|
break;
|
|
60367
60499
|
}
|
|
60368
|
-
case "ADD_COLUMNS_ROWS": {
|
|
60369
|
-
if (cmd.dimension === "COL") {
|
|
60370
|
-
return;
|
|
60371
|
-
}
|
|
60372
|
-
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60373
|
-
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60374
|
-
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60375
|
-
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60376
|
-
break;
|
|
60377
|
-
}
|
|
60378
60500
|
case "RESIZE_COLUMNS_ROWS":
|
|
60379
60501
|
{
|
|
60380
60502
|
const sheetId = cmd.sheetId;
|
|
@@ -60510,13 +60632,13 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
60510
60632
|
super(custom, params);
|
|
60511
60633
|
this.getters = params.getters;
|
|
60512
60634
|
}
|
|
60513
|
-
|
|
60635
|
+
markAsDirtyForEvaluation() {
|
|
60514
60636
|
this.cache = {};
|
|
60515
60637
|
this.rankAsc = {};
|
|
60516
60638
|
this.rankDesc = {};
|
|
60517
60639
|
this.runningTotal = {};
|
|
60518
60640
|
this.runningTotalInPercent = {};
|
|
60519
|
-
super.
|
|
60641
|
+
super.markAsDirtyForEvaluation?.();
|
|
60520
60642
|
}
|
|
60521
60643
|
getPivotCellValueAndFormat(measureName, domain) {
|
|
60522
60644
|
return this.getMeasureDisplayValue(measureName, domain);
|
|
@@ -60641,7 +60763,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
60641
60763
|
return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
|
|
60642
60764
|
}
|
|
60643
60765
|
}
|
|
60644
|
-
return
|
|
60766
|
+
return [];
|
|
60645
60767
|
}
|
|
60646
60768
|
treeToLeafDomains(tree, parentDomain = []) {
|
|
60647
60769
|
const domains = [];
|
|
@@ -66063,6 +66185,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66063
66185
|
const isBasedBefore = cmd.base < start;
|
|
66064
66186
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
66065
66187
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
66188
|
+
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66189
|
+
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
66190
|
+
const size = isCol
|
|
66191
|
+
? this.getters.getColSize(cmd.sheetId, element)
|
|
66192
|
+
: this.getters.getUserRowSize(cmd.sheetId, element);
|
|
66193
|
+
const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
|
|
66194
|
+
return [element, isDefaultCol || size === undefined ? null : size];
|
|
66195
|
+
}));
|
|
66066
66196
|
const target = [
|
|
66067
66197
|
{
|
|
66068
66198
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -66093,14 +66223,12 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66093
66223
|
const col = selection.left;
|
|
66094
66224
|
const row = selection.top;
|
|
66095
66225
|
this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
|
|
66096
|
-
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66097
66226
|
let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
66098
66227
|
for (const element of toRemove) {
|
|
66099
|
-
const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
|
|
66100
66228
|
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
66101
66229
|
dimension: cmd.dimension,
|
|
66102
66230
|
sheetId: cmd.sheetId,
|
|
66103
|
-
size,
|
|
66231
|
+
size: originalSize[element],
|
|
66104
66232
|
elements: [currentIndex],
|
|
66105
66233
|
});
|
|
66106
66234
|
currentIndex += 1;
|
|
@@ -67812,14 +67940,12 @@ class BottomBarSheet extends owl.Component {
|
|
|
67812
67940
|
this.editionState = "initializing";
|
|
67813
67941
|
}
|
|
67814
67942
|
stopEdition() {
|
|
67815
|
-
|
|
67816
|
-
if (!this.state.isEditing || !input)
|
|
67943
|
+
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
67817
67944
|
return;
|
|
67818
67945
|
this.state.isEditing = false;
|
|
67819
67946
|
this.editionState = "initializing";
|
|
67820
|
-
|
|
67947
|
+
this.sheetNameRef.el.blur();
|
|
67821
67948
|
const inputValue = this.getInputContent() || "";
|
|
67822
|
-
input.innerText = inputValue;
|
|
67823
67949
|
interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
|
|
67824
67950
|
}
|
|
67825
67951
|
cancelEdition() {
|
|
@@ -74514,6 +74640,6 @@ exports.tokenColors = tokenColors;
|
|
|
74514
74640
|
exports.tokenize = tokenize;
|
|
74515
74641
|
|
|
74516
74642
|
|
|
74517
|
-
__info__.version = "18.0.
|
|
74518
|
-
__info__.date = "2025-
|
|
74519
|
-
__info__.hash = "
|
|
74643
|
+
__info__.version = "18.0.38";
|
|
74644
|
+
__info__.date = "2025-07-28T13:29:40.841Z";
|
|
74645
|
+
__info__.hash = "0f3b11a";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -4750,6 +4750,7 @@ declare class HeaderSizeUIPlugin extends UIPlugin<HeaderSizeState> implements He
|
|
|
4750
4750
|
static getters: readonly ["getRowSize", "getHeaderSize"];
|
|
4751
4751
|
readonly tallestCellInRow: Immutable<Record<UID, Array<CellWithSize | undefined>>>;
|
|
4752
4752
|
private ctx;
|
|
4753
|
+
beforeHandle(cmd: Command): void;
|
|
4753
4754
|
handle(cmd: Command): void;
|
|
4754
4755
|
getRowSize(sheetId: UID, row: HeaderIndex): Pixel;
|
|
4755
4756
|
getHeaderSize(sheetId: UID, dimension: Dimension, index: HeaderIndex): Pixel;
|
|
@@ -4883,6 +4884,7 @@ interface Pivot<T = PivotRuntimeDefinition> {
|
|
|
4883
4884
|
label: string;
|
|
4884
4885
|
}[];
|
|
4885
4886
|
needsReevaluation: boolean;
|
|
4887
|
+
markAsDirtyForEvaluation?(): void;
|
|
4886
4888
|
}
|
|
4887
4889
|
|
|
4888
4890
|
declare class PivotUIPlugin extends UIPlugin {
|
|
@@ -6185,7 +6187,6 @@ interface PivotRegistryItem {
|
|
|
6185
6187
|
ui: PivotUIConstructor;
|
|
6186
6188
|
definition: PivotDefinitionConstructor;
|
|
6187
6189
|
externalData: boolean;
|
|
6188
|
-
onIterationEndEvaluation: (pivot: Pivot) => void;
|
|
6189
6190
|
dateGranularities: string[];
|
|
6190
6191
|
datetimeGranularities: string[];
|
|
6191
6192
|
isMeasureCandidate: (field: PivotField) => boolean;
|
|
@@ -8193,6 +8194,7 @@ declare class Composer extends Component<CellComposerProps, SpreadsheetChildEnv>
|
|
|
8193
8194
|
closeAssistant(): void;
|
|
8194
8195
|
openAssistant(): void;
|
|
8195
8196
|
onWheel(event: WheelEvent): void;
|
|
8197
|
+
get canBeToggled(): boolean;
|
|
8196
8198
|
private processContent;
|
|
8197
8199
|
/**
|
|
8198
8200
|
* Get the HTML content corresponding to the current composer token, divided by lines.
|
|
@@ -8234,6 +8236,7 @@ interface AutoCompleteProvider {
|
|
|
8234
8236
|
proposals: AutoCompleteProposal[];
|
|
8235
8237
|
selectProposal(text: string): void;
|
|
8236
8238
|
autoSelectFirstProposal: boolean;
|
|
8239
|
+
canBeToggled?: boolean;
|
|
8237
8240
|
}
|
|
8238
8241
|
interface ComposerStoreInterface {
|
|
8239
8242
|
currentEditedCell?: CellPosition;
|
|
@@ -8253,6 +8256,7 @@ interface ComposerStoreInterface {
|
|
|
8253
8256
|
interface AutoCompleteProviderDefinition {
|
|
8254
8257
|
sequence?: number;
|
|
8255
8258
|
autoSelectFirstProposal?: boolean;
|
|
8259
|
+
canBeToggled?: boolean;
|
|
8256
8260
|
displayAllOnInitialContent?: boolean;
|
|
8257
8261
|
maxDisplayedProposals?: number;
|
|
8258
8262
|
getProposals(this: {
|
|
@@ -8560,6 +8564,7 @@ declare class GridComposer extends Component<Props$H, SpreadsheetChildEnv> {
|
|
|
8560
8564
|
private rect;
|
|
8561
8565
|
private isEditing;
|
|
8562
8566
|
private isCellReferenceVisible;
|
|
8567
|
+
private currentEditedCell;
|
|
8563
8568
|
private composerStore;
|
|
8564
8569
|
composerFocusStore: Store<ComposerFocusStore>;
|
|
8565
8570
|
private composerInterface;
|
|
@@ -9761,7 +9766,7 @@ declare function createPivotFormula(formulaId: string, cell: PivotTableCell): st
|
|
|
9761
9766
|
* e.g. given the following formula PIVOT.VALUE("1", "stage_id", "42", "status", "won"),
|
|
9762
9767
|
* the two group values are "42" and "won".
|
|
9763
9768
|
*/
|
|
9764
|
-
declare function toNormalizedPivotValue(dimension: Pick<PivotDimension$1, "type" | "displayName" | "granularity">, groupValue:
|
|
9769
|
+
declare function toNormalizedPivotValue(dimension: Pick<PivotDimension$1, "type" | "displayName" | "granularity">, groupValue: Maybe<CellValue | FunctionResultObject>): CellValue;
|
|
9765
9770
|
|
|
9766
9771
|
interface Props$g {
|
|
9767
9772
|
onConfirm: (content: string) => void;
|