@odoo/o-spreadsheet 18.1.28 → 18.1.30
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 +199 -73
- package/dist/o-spreadsheet.d.ts +7 -2
- package/dist/o-spreadsheet.esm.js +199 -73
- package/dist/o-spreadsheet.iife.js +199 -73
- package/dist/o-spreadsheet.iife.min.js +380 -380
- 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.1.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.1.30
|
|
6
|
+
* @date 2025-07-28T13:37:30.885Z
|
|
7
|
+
* @hash d42e484
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -822,6 +822,7 @@ const specialWhiteSpaceSpecialCharacters = [
|
|
|
822
822
|
];
|
|
823
823
|
const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
|
|
824
824
|
const newLineRegexp = /(\r\n|\r)/g;
|
|
825
|
+
const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
|
|
825
826
|
/**
|
|
826
827
|
* Replace all different newlines characters by \n
|
|
827
828
|
*/
|
|
@@ -2828,8 +2829,9 @@ const INITIAL_JS_DAY = DateTime.fromTimestamp(0);
|
|
|
2828
2829
|
const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
|
|
2829
2830
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
2830
2831
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
2831
|
-
const
|
|
2832
|
-
const
|
|
2832
|
+
const whiteSpaceChars = whiteSpaceCharacters.join("");
|
|
2833
|
+
const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
|
|
2834
|
+
const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
|
|
2833
2835
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
2834
2836
|
/** Convert a value number representing a date, or return undefined if it isn't possible */
|
|
2835
2837
|
function valueToDateNumber(value, locale) {
|
|
@@ -6534,6 +6536,8 @@ function splitWordToSpecificWidth(ctx, word, width, style) {
|
|
|
6534
6536
|
function splitTextToWidth(ctx, text, style, width) {
|
|
6535
6537
|
if (!style)
|
|
6536
6538
|
style = {};
|
|
6539
|
+
if (isMarkdownLink(text))
|
|
6540
|
+
text = parseMarkdownLink(text).label;
|
|
6537
6541
|
const brokenText = [];
|
|
6538
6542
|
// Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
|
|
6539
6543
|
// but 5-10x faster if it doesn't
|
|
@@ -8497,6 +8501,10 @@ function toNormalizedPivotValue(dimension, groupValue) {
|
|
|
8497
8501
|
if (groupValue === null || groupValue === "null") {
|
|
8498
8502
|
return null;
|
|
8499
8503
|
}
|
|
8504
|
+
const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
|
|
8505
|
+
if (isEvaluationError(extractedGroupValue)) {
|
|
8506
|
+
return extractedGroupValue;
|
|
8507
|
+
}
|
|
8500
8508
|
const groupValueString = typeof groupValue === "boolean"
|
|
8501
8509
|
? toString(groupValue).toLocaleLowerCase()
|
|
8502
8510
|
: toString(groupValue);
|
|
@@ -11128,6 +11136,7 @@ const autoCompleteProviders = new Registry();
|
|
|
11128
11136
|
|
|
11129
11137
|
autoCompleteProviders.add("dataValidation", {
|
|
11130
11138
|
displayAllOnInitialContent: true,
|
|
11139
|
+
canBeToggled: false,
|
|
11131
11140
|
getProposals(tokenAtCursor, content) {
|
|
11132
11141
|
if (content.startsWith("=")) {
|
|
11133
11142
|
return [];
|
|
@@ -18930,11 +18939,17 @@ const COLUMN = {
|
|
|
18930
18939
|
if (isEvaluationError(cellReference?.value)) {
|
|
18931
18940
|
return cellReference;
|
|
18932
18941
|
}
|
|
18933
|
-
|
|
18934
|
-
|
|
18935
|
-
|
|
18936
|
-
|
|
18937
|
-
|
|
18942
|
+
if (cellReference === undefined) {
|
|
18943
|
+
assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
18944
|
+
return this.__originCellPosition.col + 1;
|
|
18945
|
+
}
|
|
18946
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
18947
|
+
if (zone.left === zone.right) {
|
|
18948
|
+
return zone.left + 1;
|
|
18949
|
+
}
|
|
18950
|
+
return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
|
|
18951
|
+
value: zone.left + col + 1,
|
|
18952
|
+
}));
|
|
18938
18953
|
},
|
|
18939
18954
|
isExported: true,
|
|
18940
18955
|
};
|
|
@@ -19153,11 +19168,17 @@ const ROW = {
|
|
|
19153
19168
|
if (isEvaluationError(cellReference?.value)) {
|
|
19154
19169
|
return cellReference;
|
|
19155
19170
|
}
|
|
19156
|
-
|
|
19157
|
-
|
|
19158
|
-
|
|
19159
|
-
|
|
19160
|
-
|
|
19171
|
+
if (cellReference === undefined) {
|
|
19172
|
+
assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
19173
|
+
return this.__originCellPosition.row + 1;
|
|
19174
|
+
}
|
|
19175
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
19176
|
+
if (zone.top === zone.bottom) {
|
|
19177
|
+
return zone.top + 1;
|
|
19178
|
+
}
|
|
19179
|
+
return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
|
|
19180
|
+
value: zone.top + row + 1,
|
|
19181
|
+
}));
|
|
19161
19182
|
},
|
|
19162
19183
|
isExported: true,
|
|
19163
19184
|
};
|
|
@@ -21433,6 +21454,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
21433
21454
|
proposals,
|
|
21434
21455
|
selectProposal: provider.selectProposal,
|
|
21435
21456
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
21457
|
+
canBeToggled: provider.canBeToggled,
|
|
21436
21458
|
};
|
|
21437
21459
|
}
|
|
21438
21460
|
if (exactMatch && this._currentContent !== this.initialContent) {
|
|
@@ -21455,6 +21477,7 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
21455
21477
|
proposals,
|
|
21456
21478
|
selectProposal: provider.selectProposal,
|
|
21457
21479
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
21480
|
+
canBeToggled: provider.canBeToggled,
|
|
21458
21481
|
};
|
|
21459
21482
|
}
|
|
21460
21483
|
}
|
|
@@ -25787,40 +25810,112 @@ function convertPivotTableConfig(pivotTable) {
|
|
|
25787
25810
|
* In all the sheets, replace the table-only references in the formula cells with standard references.
|
|
25788
25811
|
*/
|
|
25789
25812
|
function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
|
|
25813
|
+
let deconstructedSheets = null;
|
|
25790
25814
|
for (let tableSheet of convertedSheets) {
|
|
25791
25815
|
const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
|
|
25816
|
+
if (!tables || tables.length === 0) {
|
|
25817
|
+
continue;
|
|
25818
|
+
}
|
|
25819
|
+
// Only deconstruct sheets if we are sure there are tables to process
|
|
25820
|
+
if (!deconstructedSheets) {
|
|
25821
|
+
deconstructedSheets = deconstructSheets(convertedSheets);
|
|
25822
|
+
}
|
|
25792
25823
|
for (let table of tables) {
|
|
25793
|
-
|
|
25794
|
-
|
|
25795
|
-
for (let xc in
|
|
25796
|
-
const
|
|
25797
|
-
let
|
|
25798
|
-
|
|
25799
|
-
|
|
25800
|
-
|
|
25801
|
-
let endIndex = refIndex + tabRef.length;
|
|
25802
|
-
let openBrackets = 1;
|
|
25803
|
-
while (openBrackets > 0 && endIndex < cellContent.length) {
|
|
25804
|
-
if (cellContent[endIndex] === "[") {
|
|
25805
|
-
openBrackets++;
|
|
25806
|
-
}
|
|
25807
|
-
else if (cellContent[endIndex] === "]") {
|
|
25808
|
-
openBrackets--;
|
|
25809
|
-
}
|
|
25810
|
-
endIndex++;
|
|
25811
|
-
}
|
|
25812
|
-
let reference = cellContent.slice(refIndex + tabRef.length, endIndex - 1);
|
|
25813
|
-
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
25814
|
-
const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
|
|
25815
|
-
cellContent =
|
|
25816
|
-
cellContent.slice(0, refIndex) + convertedRef + cellContent.slice(endIndex);
|
|
25824
|
+
for (let sheetId in deconstructedSheets) {
|
|
25825
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
25826
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
25827
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
25828
|
+
for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
|
|
25829
|
+
const possibleTable = deconstructedSheets[sheetId][xc][i];
|
|
25830
|
+
if (!possibleTable.endsWith(table.name)) {
|
|
25831
|
+
continue;
|
|
25817
25832
|
}
|
|
25833
|
+
const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
|
|
25834
|
+
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
25835
|
+
const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
|
|
25836
|
+
deconstructedSheets[sheetId][xc][i + 2] =
|
|
25837
|
+
possibleTable.slice(0, possibleTable.indexOf(table.name)) +
|
|
25838
|
+
convertedRef +
|
|
25839
|
+
deconstructedSheets[sheetId][xc][i + 2];
|
|
25840
|
+
deconstructedSheets[sheetId][xc].splice(i, 2);
|
|
25841
|
+
}
|
|
25842
|
+
// sheet.cells[xc] = cellContent;
|
|
25843
|
+
}
|
|
25844
|
+
}
|
|
25845
|
+
}
|
|
25846
|
+
}
|
|
25847
|
+
if (!deconstructedSheets) {
|
|
25848
|
+
return;
|
|
25849
|
+
}
|
|
25850
|
+
for (let sheetId in deconstructedSheets) {
|
|
25851
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
25852
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
25853
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
25854
|
+
if (deconstructedCell.length === 1) {
|
|
25855
|
+
sheet.cells[xc] = deconstructedCell[0];
|
|
25856
|
+
continue;
|
|
25857
|
+
}
|
|
25858
|
+
let newContent = "";
|
|
25859
|
+
for (let i = 0; i < deconstructedCell.length; i += 2) {
|
|
25860
|
+
newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
|
|
25861
|
+
}
|
|
25862
|
+
newContent += deconstructedCell[deconstructedCell.length - 1];
|
|
25863
|
+
sheet.cells[xc] = newContent;
|
|
25864
|
+
}
|
|
25865
|
+
}
|
|
25866
|
+
}
|
|
25867
|
+
/**
|
|
25868
|
+
* Deconstruct the content of the cells in the sheets to extract possible table references.
|
|
25869
|
+
* Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
|
|
25870
|
+
* return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
|
|
25871
|
+
*/
|
|
25872
|
+
function deconstructSheets(convertedSheets) {
|
|
25873
|
+
const deconstructedSheets = {};
|
|
25874
|
+
for (let sheet of convertedSheets) {
|
|
25875
|
+
for (let xc in sheet.cells) {
|
|
25876
|
+
const cellContent = sheet.cells[xc];
|
|
25877
|
+
if (!cellContent || !cellContent.startsWith("=")) {
|
|
25878
|
+
continue;
|
|
25879
|
+
}
|
|
25880
|
+
const startIndex = cellContent.indexOf("[");
|
|
25881
|
+
if (startIndex === -1) {
|
|
25882
|
+
continue;
|
|
25883
|
+
}
|
|
25884
|
+
const deconstructedCell = [];
|
|
25885
|
+
let possibleTable = cellContent.slice(0, startIndex);
|
|
25886
|
+
let possibleRef = "";
|
|
25887
|
+
let openBrackets = 1;
|
|
25888
|
+
let mainPossibleTableIndex = 0;
|
|
25889
|
+
let mainOpenBracketIndex = startIndex;
|
|
25890
|
+
for (let index = startIndex + 1; index < cellContent.length; index++) {
|
|
25891
|
+
if (cellContent[index] === "[") {
|
|
25892
|
+
if (openBrackets === 0) {
|
|
25893
|
+
possibleTable = cellContent.slice(mainPossibleTableIndex, index);
|
|
25894
|
+
mainOpenBracketIndex = index;
|
|
25818
25895
|
}
|
|
25819
|
-
|
|
25896
|
+
openBrackets++;
|
|
25897
|
+
continue;
|
|
25898
|
+
}
|
|
25899
|
+
if (cellContent[index] === "]") {
|
|
25900
|
+
openBrackets--;
|
|
25901
|
+
if (openBrackets === 0) {
|
|
25902
|
+
possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
|
|
25903
|
+
deconstructedCell.push(possibleTable);
|
|
25904
|
+
deconstructedCell.push(possibleRef);
|
|
25905
|
+
mainPossibleTableIndex = index + 1;
|
|
25906
|
+
}
|
|
25907
|
+
}
|
|
25908
|
+
}
|
|
25909
|
+
if (deconstructedCell.length) {
|
|
25910
|
+
if (!deconstructedSheets[sheet.id]) {
|
|
25911
|
+
deconstructedSheets[sheet.id] = {};
|
|
25820
25912
|
}
|
|
25913
|
+
deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
|
|
25914
|
+
deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
|
|
25821
25915
|
}
|
|
25822
25916
|
}
|
|
25823
25917
|
}
|
|
25918
|
+
return deconstructedSheets;
|
|
25824
25919
|
}
|
|
25825
25920
|
/**
|
|
25826
25921
|
* Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
|
|
@@ -41421,9 +41516,13 @@ class Composer extends owl.Component {
|
|
|
41421
41516
|
}
|
|
41422
41517
|
}
|
|
41423
41518
|
closeAssistant() {
|
|
41519
|
+
if (!this.canBeToggled)
|
|
41520
|
+
return;
|
|
41424
41521
|
this.assistant.forcedClosed = true;
|
|
41425
41522
|
}
|
|
41426
41523
|
openAssistant() {
|
|
41524
|
+
if (!this.canBeToggled)
|
|
41525
|
+
return;
|
|
41427
41526
|
this.assistant.forcedClosed = false;
|
|
41428
41527
|
}
|
|
41429
41528
|
onWheel(event) {
|
|
@@ -41433,6 +41532,9 @@ class Composer extends owl.Component {
|
|
|
41433
41532
|
event.stopPropagation();
|
|
41434
41533
|
}
|
|
41435
41534
|
}
|
|
41535
|
+
get canBeToggled() {
|
|
41536
|
+
return this.autoCompleteState.provider?.canBeToggled ?? true;
|
|
41537
|
+
}
|
|
41436
41538
|
// ---------------------------------------------------------------------------
|
|
41437
41539
|
// Private
|
|
41438
41540
|
// ---------------------------------------------------------------------------
|
|
@@ -41568,7 +41670,7 @@ class Composer extends owl.Component {
|
|
|
41568
41670
|
}
|
|
41569
41671
|
}
|
|
41570
41672
|
autoComplete(value) {
|
|
41571
|
-
if (!value || this.assistant.forcedClosed) {
|
|
41673
|
+
if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
|
|
41572
41674
|
return;
|
|
41573
41675
|
}
|
|
41574
41676
|
this.autoCompleteState.provider?.selectProposal(value);
|
|
@@ -46720,10 +46822,7 @@ class SpreadsheetPivot {
|
|
|
46720
46822
|
if (finalCell.value === null) {
|
|
46721
46823
|
return { value: _t("(Undefined)") };
|
|
46722
46824
|
}
|
|
46723
|
-
return
|
|
46724
|
-
value: finalCell.value,
|
|
46725
|
-
format: finalCell.format,
|
|
46726
|
-
};
|
|
46825
|
+
return finalCell;
|
|
46727
46826
|
}
|
|
46728
46827
|
getPivotCellValueAndFormat(measureId, domain) {
|
|
46729
46828
|
const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
|
|
@@ -46816,9 +46915,15 @@ class SpreadsheetPivot {
|
|
|
46816
46915
|
return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
|
|
46817
46916
|
}
|
|
46818
46917
|
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
46819
|
-
const { field, value } = domain;
|
|
46918
|
+
const { field, value, type } = domain;
|
|
46820
46919
|
const { nameWithGranularity } = this.getDimension(field);
|
|
46821
|
-
return dataEntries.filter((entry) =>
|
|
46920
|
+
return dataEntries.filter((entry) => {
|
|
46921
|
+
const cellValue = entry[nameWithGranularity]?.value;
|
|
46922
|
+
if (type === "char") {
|
|
46923
|
+
return String(cellValue) === String(value);
|
|
46924
|
+
}
|
|
46925
|
+
return cellValue === value;
|
|
46926
|
+
});
|
|
46822
46927
|
}
|
|
46823
46928
|
getDimension(nameWithGranularity) {
|
|
46824
46929
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -46954,7 +47059,6 @@ pivotRegistry.add("SPREADSHEET", {
|
|
|
46954
47059
|
ui: SpreadsheetPivot,
|
|
46955
47060
|
definition: SpreadsheetPivotRuntimeDefinition,
|
|
46956
47061
|
externalData: false,
|
|
46957
|
-
onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
|
|
46958
47062
|
dateGranularities: [...dateGranularities],
|
|
46959
47063
|
datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
|
|
46960
47064
|
isMeasureCandidate: (field) => !["datetime", "boolean"].includes(field.type),
|
|
@@ -49319,6 +49423,11 @@ class GridComposer extends owl.Component {
|
|
|
49319
49423
|
rect = this.defaultRect;
|
|
49320
49424
|
isEditing = false;
|
|
49321
49425
|
isCellReferenceVisible = false;
|
|
49426
|
+
currentEditedCell = {
|
|
49427
|
+
col: 0,
|
|
49428
|
+
row: 0,
|
|
49429
|
+
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
49430
|
+
};
|
|
49322
49431
|
composerStore;
|
|
49323
49432
|
composerFocusStore;
|
|
49324
49433
|
composerInterface;
|
|
@@ -49348,7 +49457,7 @@ class GridComposer extends owl.Component {
|
|
|
49348
49457
|
return this.isCellReferenceVisible;
|
|
49349
49458
|
}
|
|
49350
49459
|
get cellReference() {
|
|
49351
|
-
const { col, row, sheetId } = this.
|
|
49460
|
+
const { col, row, sheetId } = this.currentEditedCell;
|
|
49352
49461
|
const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
|
|
49353
49462
|
return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
|
|
49354
49463
|
}
|
|
@@ -49440,12 +49549,17 @@ class GridComposer extends owl.Component {
|
|
|
49440
49549
|
if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
|
|
49441
49550
|
this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
|
|
49442
49551
|
}
|
|
49552
|
+
let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
|
|
49443
49553
|
if (this.isEditing !== isEditing) {
|
|
49444
49554
|
this.isEditing = isEditing;
|
|
49445
49555
|
if (!isEditing) {
|
|
49446
49556
|
this.rect = this.defaultRect;
|
|
49447
49557
|
return;
|
|
49448
49558
|
}
|
|
49559
|
+
this.currentEditedCell = this.composerStore.currentEditedCell;
|
|
49560
|
+
shouldRecomputeRect = true;
|
|
49561
|
+
}
|
|
49562
|
+
if (shouldRecomputeRect) {
|
|
49449
49563
|
const position = this.env.model.getters.getActivePosition();
|
|
49450
49564
|
const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
|
|
49451
49565
|
this.rect = this.env.model.getters.getVisibleRect(zone);
|
|
@@ -59588,7 +59702,7 @@ const onIterationEndEvaluationRegistry = new Registry();
|
|
|
59588
59702
|
onIterationEndEvaluationRegistry.add("pivots", (getters) => {
|
|
59589
59703
|
for (const pivotId of getters.getPivotIds()) {
|
|
59590
59704
|
const pivot = getters.getPivot(pivotId);
|
|
59591
|
-
|
|
59705
|
+
pivot.markAsDirtyForEvaluation?.();
|
|
59592
59706
|
}
|
|
59593
59707
|
});
|
|
59594
59708
|
|
|
@@ -62413,6 +62527,23 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
62413
62527
|
static getters = ["getRowSize", "getHeaderSize"];
|
|
62414
62528
|
tallestCellInRow = {};
|
|
62415
62529
|
ctx = document.createElement("canvas").getContext("2d");
|
|
62530
|
+
beforeHandle(cmd) {
|
|
62531
|
+
switch (cmd.type) {
|
|
62532
|
+
// Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
|
|
62533
|
+
// "UPDATE_CELL" uses the Sheet core plugin to access row data.
|
|
62534
|
+
// If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
|
|
62535
|
+
// size updates may apply to incorrect (pre-insert) rows.
|
|
62536
|
+
case "ADD_COLUMNS_ROWS":
|
|
62537
|
+
if (cmd.dimension === "COL") {
|
|
62538
|
+
return;
|
|
62539
|
+
}
|
|
62540
|
+
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
62541
|
+
const newCells = Array(cmd.quantity).fill(undefined);
|
|
62542
|
+
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
62543
|
+
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
62544
|
+
break;
|
|
62545
|
+
}
|
|
62546
|
+
}
|
|
62416
62547
|
handle(cmd) {
|
|
62417
62548
|
switch (cmd.type) {
|
|
62418
62549
|
case "START":
|
|
@@ -62442,16 +62573,6 @@ class HeaderSizeUIPlugin extends UIPlugin {
|
|
|
62442
62573
|
this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
|
|
62443
62574
|
break;
|
|
62444
62575
|
}
|
|
62445
|
-
case "ADD_COLUMNS_ROWS": {
|
|
62446
|
-
if (cmd.dimension === "COL") {
|
|
62447
|
-
return;
|
|
62448
|
-
}
|
|
62449
|
-
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
62450
|
-
const newCells = Array(cmd.quantity).fill(undefined);
|
|
62451
|
-
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
62452
|
-
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
62453
|
-
break;
|
|
62454
|
-
}
|
|
62455
62576
|
case "RESIZE_COLUMNS_ROWS":
|
|
62456
62577
|
{
|
|
62457
62578
|
const sheetId = cmd.sheetId;
|
|
@@ -62587,13 +62708,13 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
62587
62708
|
super(custom, params);
|
|
62588
62709
|
this.getters = params.getters;
|
|
62589
62710
|
}
|
|
62590
|
-
|
|
62711
|
+
markAsDirtyForEvaluation() {
|
|
62591
62712
|
this.cache = {};
|
|
62592
62713
|
this.rankAsc = {};
|
|
62593
62714
|
this.rankDesc = {};
|
|
62594
62715
|
this.runningTotal = {};
|
|
62595
62716
|
this.runningTotalInPercent = {};
|
|
62596
|
-
super.
|
|
62717
|
+
super.markAsDirtyForEvaluation?.();
|
|
62597
62718
|
}
|
|
62598
62719
|
getPivotCellValueAndFormat(measureName, domain) {
|
|
62599
62720
|
return this.getMeasureDisplayValue(measureName, domain);
|
|
@@ -62718,7 +62839,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
62718
62839
|
return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
|
|
62719
62840
|
}
|
|
62720
62841
|
}
|
|
62721
|
-
return
|
|
62842
|
+
return [];
|
|
62722
62843
|
}
|
|
62723
62844
|
treeToLeafDomains(tree, parentDomain = []) {
|
|
62724
62845
|
const domains = [];
|
|
@@ -68192,6 +68313,14 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68192
68313
|
const isBasedBefore = cmd.base < start;
|
|
68193
68314
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
68194
68315
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
68316
|
+
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
68317
|
+
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
68318
|
+
const size = isCol
|
|
68319
|
+
? this.getters.getColSize(cmd.sheetId, element)
|
|
68320
|
+
: this.getters.getUserRowSize(cmd.sheetId, element);
|
|
68321
|
+
const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
|
|
68322
|
+
return [element, isDefaultCol ? undefined : size];
|
|
68323
|
+
}));
|
|
68195
68324
|
const target = [
|
|
68196
68325
|
{
|
|
68197
68326
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -68222,13 +68351,12 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68222
68351
|
const col = selection.left;
|
|
68223
68352
|
const row = selection.top;
|
|
68224
68353
|
this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
|
|
68225
|
-
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
68226
68354
|
let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
68227
68355
|
const resizingGroups = {};
|
|
68228
68356
|
for (const element of toRemove) {
|
|
68229
|
-
const size =
|
|
68357
|
+
const size = originalSize[element];
|
|
68230
68358
|
const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
|
|
68231
|
-
if (size != currentSize) {
|
|
68359
|
+
if (size && size != currentSize) {
|
|
68232
68360
|
resizingGroups[size] ??= [];
|
|
68233
68361
|
resizingGroups[size].push(currentIndex);
|
|
68234
68362
|
currentIndex += 1;
|
|
@@ -69947,14 +70075,12 @@ class BottomBarSheet extends owl.Component {
|
|
|
69947
70075
|
this.editionState = "initializing";
|
|
69948
70076
|
}
|
|
69949
70077
|
stopEdition() {
|
|
69950
|
-
|
|
69951
|
-
if (!this.state.isEditing || !input)
|
|
70078
|
+
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
69952
70079
|
return;
|
|
69953
70080
|
this.state.isEditing = false;
|
|
69954
70081
|
this.editionState = "initializing";
|
|
69955
|
-
|
|
70082
|
+
this.sheetNameRef.el.blur();
|
|
69956
70083
|
const inputValue = this.getInputContent() || "";
|
|
69957
|
-
input.innerText = inputValue;
|
|
69958
70084
|
interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
|
|
69959
70085
|
}
|
|
69960
70086
|
cancelEdition() {
|
|
@@ -76630,6 +76756,6 @@ exports.tokenColors = tokenColors;
|
|
|
76630
76756
|
exports.tokenize = tokenize;
|
|
76631
76757
|
|
|
76632
76758
|
|
|
76633
|
-
__info__.version = "18.1.
|
|
76634
|
-
__info__.date = "2025-
|
|
76635
|
-
__info__.hash = "
|
|
76759
|
+
__info__.version = "18.1.30";
|
|
76760
|
+
__info__.date = "2025-07-28T13:37:30.885Z";
|
|
76761
|
+
__info__.hash = "d42e484";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -5278,6 +5278,7 @@ declare class HeaderSizeUIPlugin extends UIPlugin<HeaderSizeState> implements He
|
|
|
5278
5278
|
static getters: readonly ["getRowSize", "getHeaderSize"];
|
|
5279
5279
|
readonly tallestCellInRow: Immutable<Record<UID, Array<CellWithSize | undefined>>>;
|
|
5280
5280
|
private ctx;
|
|
5281
|
+
beforeHandle(cmd: Command): void;
|
|
5281
5282
|
handle(cmd: Command): void;
|
|
5282
5283
|
getRowSize(sheetId: UID, row: HeaderIndex): Pixel;
|
|
5283
5284
|
getHeaderSize(sheetId: UID, dimension: Dimension, index: HeaderIndex): Pixel;
|
|
@@ -5415,6 +5416,7 @@ interface Pivot<T = PivotRuntimeDefinition> {
|
|
|
5415
5416
|
label: string;
|
|
5416
5417
|
}[];
|
|
5417
5418
|
needsReevaluation: boolean;
|
|
5419
|
+
markAsDirtyForEvaluation?(): void;
|
|
5418
5420
|
}
|
|
5419
5421
|
|
|
5420
5422
|
declare class PivotUIPlugin extends UIPlugin {
|
|
@@ -6335,7 +6337,6 @@ interface PivotRegistryItem {
|
|
|
6335
6337
|
ui: PivotUIConstructor;
|
|
6336
6338
|
definition: PivotDefinitionConstructor;
|
|
6337
6339
|
externalData: boolean;
|
|
6338
|
-
onIterationEndEvaluation: (pivot: Pivot) => void;
|
|
6339
6340
|
dateGranularities: string[];
|
|
6340
6341
|
datetimeGranularities: string[];
|
|
6341
6342
|
isMeasureCandidate: (field: PivotField) => boolean;
|
|
@@ -8476,6 +8477,7 @@ declare class Composer extends Component<CellComposerProps, SpreadsheetChildEnv>
|
|
|
8476
8477
|
closeAssistant(): void;
|
|
8477
8478
|
openAssistant(): void;
|
|
8478
8479
|
onWheel(event: WheelEvent): void;
|
|
8480
|
+
get canBeToggled(): boolean;
|
|
8479
8481
|
private processContent;
|
|
8480
8482
|
/**
|
|
8481
8483
|
* Get the HTML content corresponding to the current composer token, divided by lines.
|
|
@@ -8517,6 +8519,7 @@ interface AutoCompleteProvider {
|
|
|
8517
8519
|
proposals: AutoCompleteProposal[];
|
|
8518
8520
|
selectProposal(text: string): void;
|
|
8519
8521
|
autoSelectFirstProposal: boolean;
|
|
8522
|
+
canBeToggled?: boolean;
|
|
8520
8523
|
}
|
|
8521
8524
|
interface ComposerStoreInterface {
|
|
8522
8525
|
currentEditedCell?: CellPosition;
|
|
@@ -8536,6 +8539,7 @@ interface ComposerStoreInterface {
|
|
|
8536
8539
|
interface AutoCompleteProviderDefinition {
|
|
8537
8540
|
sequence?: number;
|
|
8538
8541
|
autoSelectFirstProposal?: boolean;
|
|
8542
|
+
canBeToggled?: boolean;
|
|
8539
8543
|
displayAllOnInitialContent?: boolean;
|
|
8540
8544
|
maxDisplayedProposals?: number;
|
|
8541
8545
|
getProposals(this: {
|
|
@@ -8843,6 +8847,7 @@ declare class GridComposer extends Component<Props$J, SpreadsheetChildEnv> {
|
|
|
8843
8847
|
private rect;
|
|
8844
8848
|
private isEditing;
|
|
8845
8849
|
private isCellReferenceVisible;
|
|
8850
|
+
private currentEditedCell;
|
|
8846
8851
|
private composerStore;
|
|
8847
8852
|
composerFocusStore: Store<ComposerFocusStore>;
|
|
8848
8853
|
private composerInterface;
|
|
@@ -10005,7 +10010,7 @@ declare function createPivotFormula(formulaId: string, cell: PivotTableCell): st
|
|
|
10005
10010
|
* e.g. given the following formula PIVOT.VALUE("1", "stage_id", "42", "status", "won"),
|
|
10006
10011
|
* the two group values are "42" and "won".
|
|
10007
10012
|
*/
|
|
10008
|
-
declare function toNormalizedPivotValue(dimension: Pick<PivotDimension$1, "type" | "displayName" | "granularity">, groupValue:
|
|
10013
|
+
declare function toNormalizedPivotValue(dimension: Pick<PivotDimension$1, "type" | "displayName" | "granularity">, groupValue: Maybe<CellValue | FunctionResultObject>): CellValue;
|
|
10009
10014
|
|
|
10010
10015
|
interface Props$j {
|
|
10011
10016
|
onConfirm: (content: string) => void;
|