@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
|
(function (exports, owl) {
|
|
@@ -821,6 +821,7 @@
|
|
|
821
821
|
];
|
|
822
822
|
const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
|
|
823
823
|
const newLineRegexp = /(\r\n|\r)/g;
|
|
824
|
+
const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
|
|
824
825
|
/**
|
|
825
826
|
* Replace all different newlines characters by \n
|
|
826
827
|
*/
|
|
@@ -2827,8 +2828,9 @@
|
|
|
2827
2828
|
const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
|
|
2828
2829
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
2829
2830
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
2830
|
-
const
|
|
2831
|
-
const
|
|
2831
|
+
const whiteSpaceChars = whiteSpaceCharacters.join("");
|
|
2832
|
+
const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
|
|
2833
|
+
const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
|
|
2832
2834
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
2833
2835
|
/** Convert a value number representing a date, or return undefined if it isn't possible */
|
|
2834
2836
|
function valueToDateNumber(value, locale) {
|
|
@@ -6533,6 +6535,8 @@
|
|
|
6533
6535
|
function splitTextToWidth(ctx, text, style, width) {
|
|
6534
6536
|
if (!style)
|
|
6535
6537
|
style = {};
|
|
6538
|
+
if (isMarkdownLink(text))
|
|
6539
|
+
text = parseMarkdownLink(text).label;
|
|
6536
6540
|
const brokenText = [];
|
|
6537
6541
|
// Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
|
|
6538
6542
|
// but 5-10x faster if it doesn't
|
|
@@ -8496,6 +8500,10 @@
|
|
|
8496
8500
|
if (groupValue === null || groupValue === "null") {
|
|
8497
8501
|
return null;
|
|
8498
8502
|
}
|
|
8503
|
+
const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
|
|
8504
|
+
if (isEvaluationError(extractedGroupValue)) {
|
|
8505
|
+
return extractedGroupValue;
|
|
8506
|
+
}
|
|
8499
8507
|
const groupValueString = typeof groupValue === "boolean"
|
|
8500
8508
|
? toString(groupValue).toLocaleLowerCase()
|
|
8501
8509
|
: toString(groupValue);
|
|
@@ -11127,6 +11135,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11127
11135
|
|
|
11128
11136
|
autoCompleteProviders.add("dataValidation", {
|
|
11129
11137
|
displayAllOnInitialContent: true,
|
|
11138
|
+
canBeToggled: false,
|
|
11130
11139
|
getProposals(tokenAtCursor, content) {
|
|
11131
11140
|
if (content.startsWith("=")) {
|
|
11132
11141
|
return [];
|
|
@@ -18929,11 +18938,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18929
18938
|
if (isEvaluationError(cellReference?.value)) {
|
|
18930
18939
|
return cellReference;
|
|
18931
18940
|
}
|
|
18932
|
-
|
|
18933
|
-
|
|
18934
|
-
|
|
18935
|
-
|
|
18936
|
-
|
|
18941
|
+
if (cellReference === undefined) {
|
|
18942
|
+
assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
18943
|
+
return this.__originCellPosition.col + 1;
|
|
18944
|
+
}
|
|
18945
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
18946
|
+
if (zone.left === zone.right) {
|
|
18947
|
+
return zone.left + 1;
|
|
18948
|
+
}
|
|
18949
|
+
return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
|
|
18950
|
+
value: zone.left + col + 1,
|
|
18951
|
+
}));
|
|
18937
18952
|
},
|
|
18938
18953
|
isExported: true,
|
|
18939
18954
|
};
|
|
@@ -19152,11 +19167,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19152
19167
|
if (isEvaluationError(cellReference?.value)) {
|
|
19153
19168
|
return cellReference;
|
|
19154
19169
|
}
|
|
19155
|
-
|
|
19156
|
-
|
|
19157
|
-
|
|
19158
|
-
|
|
19159
|
-
|
|
19170
|
+
if (cellReference === undefined) {
|
|
19171
|
+
assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
19172
|
+
return this.__originCellPosition.row + 1;
|
|
19173
|
+
}
|
|
19174
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
19175
|
+
if (zone.top === zone.bottom) {
|
|
19176
|
+
return zone.top + 1;
|
|
19177
|
+
}
|
|
19178
|
+
return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
|
|
19179
|
+
value: zone.top + row + 1,
|
|
19180
|
+
}));
|
|
19160
19181
|
},
|
|
19161
19182
|
isExported: true,
|
|
19162
19183
|
};
|
|
@@ -21432,6 +21453,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
21432
21453
|
proposals,
|
|
21433
21454
|
selectProposal: provider.selectProposal,
|
|
21434
21455
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
21456
|
+
canBeToggled: provider.canBeToggled,
|
|
21435
21457
|
};
|
|
21436
21458
|
}
|
|
21437
21459
|
if (exactMatch && this._currentContent !== this.initialContent) {
|
|
@@ -21454,6 +21476,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
21454
21476
|
proposals,
|
|
21455
21477
|
selectProposal: provider.selectProposal,
|
|
21456
21478
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
21479
|
+
canBeToggled: provider.canBeToggled,
|
|
21457
21480
|
};
|
|
21458
21481
|
}
|
|
21459
21482
|
}
|
|
@@ -25786,40 +25809,112 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25786
25809
|
* In all the sheets, replace the table-only references in the formula cells with standard references.
|
|
25787
25810
|
*/
|
|
25788
25811
|
function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
|
|
25812
|
+
let deconstructedSheets = null;
|
|
25789
25813
|
for (let tableSheet of convertedSheets) {
|
|
25790
25814
|
const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
|
|
25815
|
+
if (!tables || tables.length === 0) {
|
|
25816
|
+
continue;
|
|
25817
|
+
}
|
|
25818
|
+
// Only deconstruct sheets if we are sure there are tables to process
|
|
25819
|
+
if (!deconstructedSheets) {
|
|
25820
|
+
deconstructedSheets = deconstructSheets(convertedSheets);
|
|
25821
|
+
}
|
|
25791
25822
|
for (let table of tables) {
|
|
25792
|
-
|
|
25793
|
-
|
|
25794
|
-
for (let xc in
|
|
25795
|
-
const
|
|
25796
|
-
let
|
|
25797
|
-
|
|
25798
|
-
|
|
25799
|
-
|
|
25800
|
-
let endIndex = refIndex + tabRef.length;
|
|
25801
|
-
let openBrackets = 1;
|
|
25802
|
-
while (openBrackets > 0 && endIndex < cellContent.length) {
|
|
25803
|
-
if (cellContent[endIndex] === "[") {
|
|
25804
|
-
openBrackets++;
|
|
25805
|
-
}
|
|
25806
|
-
else if (cellContent[endIndex] === "]") {
|
|
25807
|
-
openBrackets--;
|
|
25808
|
-
}
|
|
25809
|
-
endIndex++;
|
|
25810
|
-
}
|
|
25811
|
-
let reference = cellContent.slice(refIndex + tabRef.length, endIndex - 1);
|
|
25812
|
-
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
25813
|
-
const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
|
|
25814
|
-
cellContent =
|
|
25815
|
-
cellContent.slice(0, refIndex) + convertedRef + cellContent.slice(endIndex);
|
|
25823
|
+
for (let sheetId in deconstructedSheets) {
|
|
25824
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
25825
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
25826
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
25827
|
+
for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
|
|
25828
|
+
const possibleTable = deconstructedSheets[sheetId][xc][i];
|
|
25829
|
+
if (!possibleTable.endsWith(table.name)) {
|
|
25830
|
+
continue;
|
|
25816
25831
|
}
|
|
25832
|
+
const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
|
|
25833
|
+
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
25834
|
+
const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
|
|
25835
|
+
deconstructedSheets[sheetId][xc][i + 2] =
|
|
25836
|
+
possibleTable.slice(0, possibleTable.indexOf(table.name)) +
|
|
25837
|
+
convertedRef +
|
|
25838
|
+
deconstructedSheets[sheetId][xc][i + 2];
|
|
25839
|
+
deconstructedSheets[sheetId][xc].splice(i, 2);
|
|
25840
|
+
}
|
|
25841
|
+
// sheet.cells[xc] = cellContent;
|
|
25842
|
+
}
|
|
25843
|
+
}
|
|
25844
|
+
}
|
|
25845
|
+
}
|
|
25846
|
+
if (!deconstructedSheets) {
|
|
25847
|
+
return;
|
|
25848
|
+
}
|
|
25849
|
+
for (let sheetId in deconstructedSheets) {
|
|
25850
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
25851
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
25852
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
25853
|
+
if (deconstructedCell.length === 1) {
|
|
25854
|
+
sheet.cells[xc] = deconstructedCell[0];
|
|
25855
|
+
continue;
|
|
25856
|
+
}
|
|
25857
|
+
let newContent = "";
|
|
25858
|
+
for (let i = 0; i < deconstructedCell.length; i += 2) {
|
|
25859
|
+
newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
|
|
25860
|
+
}
|
|
25861
|
+
newContent += deconstructedCell[deconstructedCell.length - 1];
|
|
25862
|
+
sheet.cells[xc] = newContent;
|
|
25863
|
+
}
|
|
25864
|
+
}
|
|
25865
|
+
}
|
|
25866
|
+
/**
|
|
25867
|
+
* Deconstruct the content of the cells in the sheets to extract possible table references.
|
|
25868
|
+
* Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
|
|
25869
|
+
* return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
|
|
25870
|
+
*/
|
|
25871
|
+
function deconstructSheets(convertedSheets) {
|
|
25872
|
+
const deconstructedSheets = {};
|
|
25873
|
+
for (let sheet of convertedSheets) {
|
|
25874
|
+
for (let xc in sheet.cells) {
|
|
25875
|
+
const cellContent = sheet.cells[xc];
|
|
25876
|
+
if (!cellContent || !cellContent.startsWith("=")) {
|
|
25877
|
+
continue;
|
|
25878
|
+
}
|
|
25879
|
+
const startIndex = cellContent.indexOf("[");
|
|
25880
|
+
if (startIndex === -1) {
|
|
25881
|
+
continue;
|
|
25882
|
+
}
|
|
25883
|
+
const deconstructedCell = [];
|
|
25884
|
+
let possibleTable = cellContent.slice(0, startIndex);
|
|
25885
|
+
let possibleRef = "";
|
|
25886
|
+
let openBrackets = 1;
|
|
25887
|
+
let mainPossibleTableIndex = 0;
|
|
25888
|
+
let mainOpenBracketIndex = startIndex;
|
|
25889
|
+
for (let index = startIndex + 1; index < cellContent.length; index++) {
|
|
25890
|
+
if (cellContent[index] === "[") {
|
|
25891
|
+
if (openBrackets === 0) {
|
|
25892
|
+
possibleTable = cellContent.slice(mainPossibleTableIndex, index);
|
|
25893
|
+
mainOpenBracketIndex = index;
|
|
25817
25894
|
}
|
|
25818
|
-
|
|
25895
|
+
openBrackets++;
|
|
25896
|
+
continue;
|
|
25897
|
+
}
|
|
25898
|
+
if (cellContent[index] === "]") {
|
|
25899
|
+
openBrackets--;
|
|
25900
|
+
if (openBrackets === 0) {
|
|
25901
|
+
possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
|
|
25902
|
+
deconstructedCell.push(possibleTable);
|
|
25903
|
+
deconstructedCell.push(possibleRef);
|
|
25904
|
+
mainPossibleTableIndex = index + 1;
|
|
25905
|
+
}
|
|
25906
|
+
}
|
|
25907
|
+
}
|
|
25908
|
+
if (deconstructedCell.length) {
|
|
25909
|
+
if (!deconstructedSheets[sheet.id]) {
|
|
25910
|
+
deconstructedSheets[sheet.id] = {};
|
|
25819
25911
|
}
|
|
25912
|
+
deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
|
|
25913
|
+
deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
|
|
25820
25914
|
}
|
|
25821
25915
|
}
|
|
25822
25916
|
}
|
|
25917
|
+
return deconstructedSheets;
|
|
25823
25918
|
}
|
|
25824
25919
|
/**
|
|
25825
25920
|
* Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
|
|
@@ -41420,9 +41515,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41420
41515
|
}
|
|
41421
41516
|
}
|
|
41422
41517
|
closeAssistant() {
|
|
41518
|
+
if (!this.canBeToggled)
|
|
41519
|
+
return;
|
|
41423
41520
|
this.assistant.forcedClosed = true;
|
|
41424
41521
|
}
|
|
41425
41522
|
openAssistant() {
|
|
41523
|
+
if (!this.canBeToggled)
|
|
41524
|
+
return;
|
|
41426
41525
|
this.assistant.forcedClosed = false;
|
|
41427
41526
|
}
|
|
41428
41527
|
onWheel(event) {
|
|
@@ -41432,6 +41531,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41432
41531
|
event.stopPropagation();
|
|
41433
41532
|
}
|
|
41434
41533
|
}
|
|
41534
|
+
get canBeToggled() {
|
|
41535
|
+
return this.autoCompleteState.provider?.canBeToggled ?? true;
|
|
41536
|
+
}
|
|
41435
41537
|
// ---------------------------------------------------------------------------
|
|
41436
41538
|
// Private
|
|
41437
41539
|
// ---------------------------------------------------------------------------
|
|
@@ -41567,7 +41669,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41567
41669
|
}
|
|
41568
41670
|
}
|
|
41569
41671
|
autoComplete(value) {
|
|
41570
|
-
if (!value || this.assistant.forcedClosed) {
|
|
41672
|
+
if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
|
|
41571
41673
|
return;
|
|
41572
41674
|
}
|
|
41573
41675
|
this.autoCompleteState.provider?.selectProposal(value);
|
|
@@ -46719,10 +46821,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46719
46821
|
if (finalCell.value === null) {
|
|
46720
46822
|
return { value: _t("(Undefined)") };
|
|
46721
46823
|
}
|
|
46722
|
-
return
|
|
46723
|
-
value: finalCell.value,
|
|
46724
|
-
format: finalCell.format,
|
|
46725
|
-
};
|
|
46824
|
+
return finalCell;
|
|
46726
46825
|
}
|
|
46727
46826
|
getPivotCellValueAndFormat(measureId, domain) {
|
|
46728
46827
|
const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
|
|
@@ -46815,9 +46914,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46815
46914
|
return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
|
|
46816
46915
|
}
|
|
46817
46916
|
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
46818
|
-
const { field, value } = domain;
|
|
46917
|
+
const { field, value, type } = domain;
|
|
46819
46918
|
const { nameWithGranularity } = this.getDimension(field);
|
|
46820
|
-
return dataEntries.filter((entry) =>
|
|
46919
|
+
return dataEntries.filter((entry) => {
|
|
46920
|
+
const cellValue = entry[nameWithGranularity]?.value;
|
|
46921
|
+
if (type === "char") {
|
|
46922
|
+
return String(cellValue) === String(value);
|
|
46923
|
+
}
|
|
46924
|
+
return cellValue === value;
|
|
46925
|
+
});
|
|
46821
46926
|
}
|
|
46822
46927
|
getDimension(nameWithGranularity) {
|
|
46823
46928
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -46953,7 +47058,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46953
47058
|
ui: SpreadsheetPivot,
|
|
46954
47059
|
definition: SpreadsheetPivotRuntimeDefinition,
|
|
46955
47060
|
externalData: false,
|
|
46956
|
-
onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
|
|
46957
47061
|
dateGranularities: [...dateGranularities],
|
|
46958
47062
|
datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
|
|
46959
47063
|
isMeasureCandidate: (field) => !["datetime", "boolean"].includes(field.type),
|
|
@@ -49318,6 +49422,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49318
49422
|
rect = this.defaultRect;
|
|
49319
49423
|
isEditing = false;
|
|
49320
49424
|
isCellReferenceVisible = false;
|
|
49425
|
+
currentEditedCell = {
|
|
49426
|
+
col: 0,
|
|
49427
|
+
row: 0,
|
|
49428
|
+
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
49429
|
+
};
|
|
49321
49430
|
composerStore;
|
|
49322
49431
|
composerFocusStore;
|
|
49323
49432
|
composerInterface;
|
|
@@ -49347,7 +49456,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49347
49456
|
return this.isCellReferenceVisible;
|
|
49348
49457
|
}
|
|
49349
49458
|
get cellReference() {
|
|
49350
|
-
const { col, row, sheetId } = this.
|
|
49459
|
+
const { col, row, sheetId } = this.currentEditedCell;
|
|
49351
49460
|
const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
|
|
49352
49461
|
return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
|
|
49353
49462
|
}
|
|
@@ -49439,12 +49548,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49439
49548
|
if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
|
|
49440
49549
|
this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
|
|
49441
49550
|
}
|
|
49551
|
+
let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
|
|
49442
49552
|
if (this.isEditing !== isEditing) {
|
|
49443
49553
|
this.isEditing = isEditing;
|
|
49444
49554
|
if (!isEditing) {
|
|
49445
49555
|
this.rect = this.defaultRect;
|
|
49446
49556
|
return;
|
|
49447
49557
|
}
|
|
49558
|
+
this.currentEditedCell = this.composerStore.currentEditedCell;
|
|
49559
|
+
shouldRecomputeRect = true;
|
|
49560
|
+
}
|
|
49561
|
+
if (shouldRecomputeRect) {
|
|
49448
49562
|
const position = this.env.model.getters.getActivePosition();
|
|
49449
49563
|
const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
|
|
49450
49564
|
this.rect = this.env.model.getters.getVisibleRect(zone);
|
|
@@ -59587,7 +59701,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59587
59701
|
onIterationEndEvaluationRegistry.add("pivots", (getters) => {
|
|
59588
59702
|
for (const pivotId of getters.getPivotIds()) {
|
|
59589
59703
|
const pivot = getters.getPivot(pivotId);
|
|
59590
|
-
|
|
59704
|
+
pivot.markAsDirtyForEvaluation?.();
|
|
59591
59705
|
}
|
|
59592
59706
|
});
|
|
59593
59707
|
|
|
@@ -62412,6 +62526,23 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62412
62526
|
static getters = ["getRowSize", "getHeaderSize"];
|
|
62413
62527
|
tallestCellInRow = {};
|
|
62414
62528
|
ctx = document.createElement("canvas").getContext("2d");
|
|
62529
|
+
beforeHandle(cmd) {
|
|
62530
|
+
switch (cmd.type) {
|
|
62531
|
+
// Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
|
|
62532
|
+
// "UPDATE_CELL" uses the Sheet core plugin to access row data.
|
|
62533
|
+
// If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
|
|
62534
|
+
// size updates may apply to incorrect (pre-insert) rows.
|
|
62535
|
+
case "ADD_COLUMNS_ROWS":
|
|
62536
|
+
if (cmd.dimension === "COL") {
|
|
62537
|
+
return;
|
|
62538
|
+
}
|
|
62539
|
+
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
62540
|
+
const newCells = Array(cmd.quantity).fill(undefined);
|
|
62541
|
+
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
62542
|
+
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
62543
|
+
break;
|
|
62544
|
+
}
|
|
62545
|
+
}
|
|
62415
62546
|
handle(cmd) {
|
|
62416
62547
|
switch (cmd.type) {
|
|
62417
62548
|
case "START":
|
|
@@ -62441,16 +62572,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62441
62572
|
this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
|
|
62442
62573
|
break;
|
|
62443
62574
|
}
|
|
62444
|
-
case "ADD_COLUMNS_ROWS": {
|
|
62445
|
-
if (cmd.dimension === "COL") {
|
|
62446
|
-
return;
|
|
62447
|
-
}
|
|
62448
|
-
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
62449
|
-
const newCells = Array(cmd.quantity).fill(undefined);
|
|
62450
|
-
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
62451
|
-
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
62452
|
-
break;
|
|
62453
|
-
}
|
|
62454
62575
|
case "RESIZE_COLUMNS_ROWS":
|
|
62455
62576
|
{
|
|
62456
62577
|
const sheetId = cmd.sheetId;
|
|
@@ -62586,13 +62707,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62586
62707
|
super(custom, params);
|
|
62587
62708
|
this.getters = params.getters;
|
|
62588
62709
|
}
|
|
62589
|
-
|
|
62710
|
+
markAsDirtyForEvaluation() {
|
|
62590
62711
|
this.cache = {};
|
|
62591
62712
|
this.rankAsc = {};
|
|
62592
62713
|
this.rankDesc = {};
|
|
62593
62714
|
this.runningTotal = {};
|
|
62594
62715
|
this.runningTotalInPercent = {};
|
|
62595
|
-
super.
|
|
62716
|
+
super.markAsDirtyForEvaluation?.();
|
|
62596
62717
|
}
|
|
62597
62718
|
getPivotCellValueAndFormat(measureName, domain) {
|
|
62598
62719
|
return this.getMeasureDisplayValue(measureName, domain);
|
|
@@ -62717,7 +62838,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62717
62838
|
return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
|
|
62718
62839
|
}
|
|
62719
62840
|
}
|
|
62720
|
-
return
|
|
62841
|
+
return [];
|
|
62721
62842
|
}
|
|
62722
62843
|
treeToLeafDomains(tree, parentDomain = []) {
|
|
62723
62844
|
const domains = [];
|
|
@@ -68191,6 +68312,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68191
68312
|
const isBasedBefore = cmd.base < start;
|
|
68192
68313
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
68193
68314
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
68315
|
+
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
68316
|
+
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
68317
|
+
const size = isCol
|
|
68318
|
+
? this.getters.getColSize(cmd.sheetId, element)
|
|
68319
|
+
: this.getters.getUserRowSize(cmd.sheetId, element);
|
|
68320
|
+
const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
|
|
68321
|
+
return [element, isDefaultCol ? undefined : size];
|
|
68322
|
+
}));
|
|
68194
68323
|
const target = [
|
|
68195
68324
|
{
|
|
68196
68325
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -68221,13 +68350,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68221
68350
|
const col = selection.left;
|
|
68222
68351
|
const row = selection.top;
|
|
68223
68352
|
this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
|
|
68224
|
-
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
68225
68353
|
let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
68226
68354
|
const resizingGroups = {};
|
|
68227
68355
|
for (const element of toRemove) {
|
|
68228
|
-
const size =
|
|
68356
|
+
const size = originalSize[element];
|
|
68229
68357
|
const currentSize = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, currentIndex);
|
|
68230
|
-
if (size != currentSize) {
|
|
68358
|
+
if (size && size != currentSize) {
|
|
68231
68359
|
resizingGroups[size] ??= [];
|
|
68232
68360
|
resizingGroups[size].push(currentIndex);
|
|
68233
68361
|
currentIndex += 1;
|
|
@@ -69946,14 +70074,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
69946
70074
|
this.editionState = "initializing";
|
|
69947
70075
|
}
|
|
69948
70076
|
stopEdition() {
|
|
69949
|
-
|
|
69950
|
-
if (!this.state.isEditing || !input)
|
|
70077
|
+
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
69951
70078
|
return;
|
|
69952
70079
|
this.state.isEditing = false;
|
|
69953
70080
|
this.editionState = "initializing";
|
|
69954
|
-
|
|
70081
|
+
this.sheetNameRef.el.blur();
|
|
69955
70082
|
const inputValue = this.getInputContent() || "";
|
|
69956
|
-
input.innerText = inputValue;
|
|
69957
70083
|
interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
|
|
69958
70084
|
}
|
|
69959
70085
|
cancelEdition() {
|
|
@@ -76629,9 +76755,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
76629
76755
|
exports.tokenize = tokenize;
|
|
76630
76756
|
|
|
76631
76757
|
|
|
76632
|
-
__info__.version = "18.1.
|
|
76633
|
-
__info__.date = "2025-
|
|
76634
|
-
__info__.hash = "
|
|
76758
|
+
__info__.version = "18.1.30";
|
|
76759
|
+
__info__.date = "2025-07-28T13:37:30.885Z";
|
|
76760
|
+
__info__.hash = "d42e484";
|
|
76635
76761
|
|
|
76636
76762
|
|
|
76637
76763
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|