@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
|
(function (exports, owl) {
|
|
@@ -818,6 +818,7 @@
|
|
|
818
818
|
];
|
|
819
819
|
const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
|
|
820
820
|
const newLineRegexp = /(\r\n|\r)/g;
|
|
821
|
+
const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
|
|
821
822
|
/**
|
|
822
823
|
* Replace all different newlines characters by \n
|
|
823
824
|
*/
|
|
@@ -2661,8 +2662,9 @@
|
|
|
2661
2662
|
const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
|
|
2662
2663
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
2663
2664
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
2664
|
-
const
|
|
2665
|
-
const
|
|
2665
|
+
const whiteSpaceChars = whiteSpaceCharacters.join("");
|
|
2666
|
+
const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
|
|
2667
|
+
const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
|
|
2666
2668
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
2667
2669
|
/** Convert a value number representing a date, or return undefined if it isn't possible */
|
|
2668
2670
|
function valueToDateNumber(value, locale) {
|
|
@@ -6365,6 +6367,8 @@
|
|
|
6365
6367
|
function splitTextToWidth(ctx, text, style, width) {
|
|
6366
6368
|
if (!style)
|
|
6367
6369
|
style = {};
|
|
6370
|
+
if (isMarkdownLink(text))
|
|
6371
|
+
text = parseMarkdownLink(text).label;
|
|
6368
6372
|
const brokenText = [];
|
|
6369
6373
|
// Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
|
|
6370
6374
|
// but 5-10x faster if it doesn't
|
|
@@ -8318,6 +8322,10 @@
|
|
|
8318
8322
|
if (groupValue === null || groupValue === "null") {
|
|
8319
8323
|
return null;
|
|
8320
8324
|
}
|
|
8325
|
+
const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
|
|
8326
|
+
if (isEvaluationError(extractedGroupValue)) {
|
|
8327
|
+
return extractedGroupValue;
|
|
8328
|
+
}
|
|
8321
8329
|
const groupValueString = typeof groupValue === "boolean"
|
|
8322
8330
|
? toString(groupValue).toLocaleLowerCase()
|
|
8323
8331
|
: toString(groupValue);
|
|
@@ -12965,38 +12973,111 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
12965
12973
|
* In all the sheets, replace the table-only references in the formula cells with standard references.
|
|
12966
12974
|
*/
|
|
12967
12975
|
function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
|
|
12976
|
+
let deconstructedSheets = null;
|
|
12968
12977
|
for (let tableSheet of convertedSheets) {
|
|
12969
12978
|
const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
|
|
12979
|
+
if (!tables || tables.length === 0) {
|
|
12980
|
+
continue;
|
|
12981
|
+
}
|
|
12982
|
+
// Only deconstruct sheets if we are sure there are tables to process
|
|
12983
|
+
if (!deconstructedSheets) {
|
|
12984
|
+
deconstructedSheets = deconstructSheets(convertedSheets);
|
|
12985
|
+
}
|
|
12970
12986
|
for (let table of tables) {
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
for (let xc in
|
|
12974
|
-
const
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
let openBrackets = 1;
|
|
12980
|
-
while (openBrackets > 0 && endIndex < cell.content.length) {
|
|
12981
|
-
if (cell.content[endIndex] === "[") {
|
|
12982
|
-
openBrackets++;
|
|
12983
|
-
}
|
|
12984
|
-
else if (cell.content[endIndex] === "]") {
|
|
12985
|
-
openBrackets--;
|
|
12986
|
-
}
|
|
12987
|
-
endIndex++;
|
|
12988
|
-
}
|
|
12989
|
-
let reference = cell.content.slice(refIndex + tabRef.length, endIndex - 1);
|
|
12990
|
-
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
12991
|
-
const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
|
|
12992
|
-
cell.content =
|
|
12993
|
-
cell.content.slice(0, refIndex) + convertedRef + cell.content.slice(endIndex);
|
|
12987
|
+
for (let sheetId in deconstructedSheets) {
|
|
12988
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
12989
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
12990
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
12991
|
+
for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
|
|
12992
|
+
const possibleTable = deconstructedSheets[sheetId][xc][i];
|
|
12993
|
+
if (!possibleTable.endsWith(table.name)) {
|
|
12994
|
+
continue;
|
|
12994
12995
|
}
|
|
12996
|
+
const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
|
|
12997
|
+
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
12998
|
+
const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
|
|
12999
|
+
deconstructedSheets[sheetId][xc][i + 2] =
|
|
13000
|
+
possibleTable.slice(0, possibleTable.indexOf(table.name)) +
|
|
13001
|
+
convertedRef +
|
|
13002
|
+
deconstructedSheets[sheetId][xc][i + 2];
|
|
13003
|
+
deconstructedSheets[sheetId][xc].splice(i, 2);
|
|
12995
13004
|
}
|
|
12996
13005
|
}
|
|
12997
13006
|
}
|
|
12998
13007
|
}
|
|
12999
13008
|
}
|
|
13009
|
+
if (!deconstructedSheets) {
|
|
13010
|
+
return;
|
|
13011
|
+
}
|
|
13012
|
+
for (let sheetId in deconstructedSheets) {
|
|
13013
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
13014
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
13015
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
13016
|
+
if (deconstructedCell.length === 1) {
|
|
13017
|
+
sheet.cells[xc].content = deconstructedCell[0];
|
|
13018
|
+
continue;
|
|
13019
|
+
}
|
|
13020
|
+
let newContent = "";
|
|
13021
|
+
for (let i = 0; i < deconstructedCell.length; i += 2) {
|
|
13022
|
+
newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
|
|
13023
|
+
}
|
|
13024
|
+
newContent += deconstructedCell[deconstructedCell.length - 1];
|
|
13025
|
+
sheet.cells[xc].content = newContent;
|
|
13026
|
+
}
|
|
13027
|
+
}
|
|
13028
|
+
}
|
|
13029
|
+
/**
|
|
13030
|
+
* Deconstruct the content of the cells in the sheets to extract possible table references.
|
|
13031
|
+
* Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
|
|
13032
|
+
* return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
|
|
13033
|
+
*/
|
|
13034
|
+
function deconstructSheets(convertedSheets) {
|
|
13035
|
+
const deconstructedSheets = {};
|
|
13036
|
+
for (let sheet of convertedSheets) {
|
|
13037
|
+
for (let xc in sheet.cells) {
|
|
13038
|
+
const cellContent = sheet.cells[xc]?.content;
|
|
13039
|
+
if (!cellContent || !cellContent.startsWith("=")) {
|
|
13040
|
+
continue;
|
|
13041
|
+
}
|
|
13042
|
+
const startIndex = cellContent.indexOf("[");
|
|
13043
|
+
if (startIndex === -1) {
|
|
13044
|
+
continue;
|
|
13045
|
+
}
|
|
13046
|
+
const deconstructedCell = [];
|
|
13047
|
+
let possibleTable = cellContent.slice(0, startIndex);
|
|
13048
|
+
let possibleRef = "";
|
|
13049
|
+
let openBrackets = 1;
|
|
13050
|
+
let mainPossibleTableIndex = 0;
|
|
13051
|
+
let mainOpenBracketIndex = startIndex;
|
|
13052
|
+
for (let index = startIndex + 1; index < cellContent.length; index++) {
|
|
13053
|
+
if (cellContent[index] === "[") {
|
|
13054
|
+
if (openBrackets === 0) {
|
|
13055
|
+
possibleTable = cellContent.slice(mainPossibleTableIndex, index);
|
|
13056
|
+
mainOpenBracketIndex = index;
|
|
13057
|
+
}
|
|
13058
|
+
openBrackets++;
|
|
13059
|
+
continue;
|
|
13060
|
+
}
|
|
13061
|
+
if (cellContent[index] === "]") {
|
|
13062
|
+
openBrackets--;
|
|
13063
|
+
if (openBrackets === 0) {
|
|
13064
|
+
possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
|
|
13065
|
+
deconstructedCell.push(possibleTable);
|
|
13066
|
+
deconstructedCell.push(possibleRef);
|
|
13067
|
+
mainPossibleTableIndex = index + 1;
|
|
13068
|
+
}
|
|
13069
|
+
}
|
|
13070
|
+
}
|
|
13071
|
+
if (deconstructedCell.length) {
|
|
13072
|
+
if (!deconstructedSheets[sheet.id]) {
|
|
13073
|
+
deconstructedSheets[sheet.id] = {};
|
|
13074
|
+
}
|
|
13075
|
+
deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
|
|
13076
|
+
deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
|
|
13077
|
+
}
|
|
13078
|
+
}
|
|
13079
|
+
}
|
|
13080
|
+
return deconstructedSheets;
|
|
13000
13081
|
}
|
|
13001
13082
|
/**
|
|
13002
13083
|
* Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
|
|
@@ -17295,6 +17376,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
17295
17376
|
|
|
17296
17377
|
autoCompleteProviders.add("dataValidation", {
|
|
17297
17378
|
displayAllOnInitialContent: true,
|
|
17379
|
+
canBeToggled: false,
|
|
17298
17380
|
getProposals(tokenAtCursor, content) {
|
|
17299
17381
|
if (content.startsWith("=")) {
|
|
17300
17382
|
return [];
|
|
@@ -24950,11 +25032,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24950
25032
|
if (isEvaluationError(cellReference?.value)) {
|
|
24951
25033
|
return cellReference;
|
|
24952
25034
|
}
|
|
24953
|
-
|
|
24954
|
-
|
|
24955
|
-
|
|
24956
|
-
|
|
24957
|
-
|
|
25035
|
+
if (cellReference === undefined) {
|
|
25036
|
+
assert(() => this.__originCellPosition?.col !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25037
|
+
return this.__originCellPosition.col + 1;
|
|
25038
|
+
}
|
|
25039
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25040
|
+
if (zone.left === zone.right) {
|
|
25041
|
+
return zone.left + 1;
|
|
25042
|
+
}
|
|
25043
|
+
return generateMatrix(zone.right - zone.left + 1, 1, (col, row) => ({
|
|
25044
|
+
value: zone.left + col + 1,
|
|
25045
|
+
}));
|
|
24958
25046
|
},
|
|
24959
25047
|
isExported: true,
|
|
24960
25048
|
};
|
|
@@ -25173,11 +25261,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25173
25261
|
if (isEvaluationError(cellReference?.value)) {
|
|
25174
25262
|
return cellReference;
|
|
25175
25263
|
}
|
|
25176
|
-
|
|
25177
|
-
|
|
25178
|
-
|
|
25179
|
-
|
|
25180
|
-
|
|
25264
|
+
if (cellReference === undefined) {
|
|
25265
|
+
assert(() => this.__originCellPosition?.row !== undefined, "In this context, the function [[FUNCTION_NAME]] needs to have a cell or range in parameter.");
|
|
25266
|
+
return this.__originCellPosition.row + 1;
|
|
25267
|
+
}
|
|
25268
|
+
const zone = this.getters.getRangeFromSheetXC(this.getters.getActiveSheetId(), cellReference.value).zone;
|
|
25269
|
+
if (zone.top === zone.bottom) {
|
|
25270
|
+
return zone.top + 1;
|
|
25271
|
+
}
|
|
25272
|
+
return generateMatrix(1, zone.bottom - zone.top + 1, (col, row) => ({
|
|
25273
|
+
value: zone.top + row + 1,
|
|
25274
|
+
}));
|
|
25181
25275
|
},
|
|
25182
25276
|
isExported: true,
|
|
25183
25277
|
};
|
|
@@ -27833,9 +27927,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27833
27927
|
}
|
|
27834
27928
|
}
|
|
27835
27929
|
closeAssistant() {
|
|
27930
|
+
if (!this.canBeToggled)
|
|
27931
|
+
return;
|
|
27836
27932
|
this.assistant.forcedClosed = true;
|
|
27837
27933
|
}
|
|
27838
27934
|
openAssistant() {
|
|
27935
|
+
if (!this.canBeToggled)
|
|
27936
|
+
return;
|
|
27839
27937
|
this.assistant.forcedClosed = false;
|
|
27840
27938
|
}
|
|
27841
27939
|
onWheel(event) {
|
|
@@ -27845,6 +27943,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27845
27943
|
event.stopPropagation();
|
|
27846
27944
|
}
|
|
27847
27945
|
}
|
|
27946
|
+
get canBeToggled() {
|
|
27947
|
+
return this.autoCompleteState.provider?.canBeToggled ?? true;
|
|
27948
|
+
}
|
|
27848
27949
|
// ---------------------------------------------------------------------------
|
|
27849
27950
|
// Private
|
|
27850
27951
|
// ---------------------------------------------------------------------------
|
|
@@ -28027,7 +28128,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28027
28128
|
}
|
|
28028
28129
|
}
|
|
28029
28130
|
autoComplete(value) {
|
|
28030
|
-
if (!value || this.assistant.forcedClosed) {
|
|
28131
|
+
if (!value || (this.assistant.forcedClosed && this.canBeToggled)) {
|
|
28031
28132
|
return;
|
|
28032
28133
|
}
|
|
28033
28134
|
this.autoCompleteState.provider?.selectProposal(value);
|
|
@@ -39599,6 +39700,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39599
39700
|
proposals,
|
|
39600
39701
|
selectProposal: provider.selectProposal,
|
|
39601
39702
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39703
|
+
canBeToggled: provider.canBeToggled,
|
|
39602
39704
|
};
|
|
39603
39705
|
}
|
|
39604
39706
|
if (exactMatch && this._currentContent !== this.initialContent) {
|
|
@@ -39621,6 +39723,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39621
39723
|
proposals,
|
|
39622
39724
|
selectProposal: provider.selectProposal,
|
|
39623
39725
|
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
39726
|
+
canBeToggled: provider.canBeToggled,
|
|
39624
39727
|
};
|
|
39625
39728
|
}
|
|
39626
39729
|
}
|
|
@@ -44567,10 +44670,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44567
44670
|
if (finalCell.value === null) {
|
|
44568
44671
|
return { value: _t("(Undefined)") };
|
|
44569
44672
|
}
|
|
44570
|
-
return
|
|
44571
|
-
value: finalCell.value,
|
|
44572
|
-
format: finalCell.format,
|
|
44573
|
-
};
|
|
44673
|
+
return finalCell;
|
|
44574
44674
|
}
|
|
44575
44675
|
getPivotCellValueAndFormat(measureId, domain) {
|
|
44576
44676
|
const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
|
|
@@ -44663,9 +44763,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44663
44763
|
return domain.reduce((current, acc) => this.filterDataEntriesFromDomainNode(current, acc), dataEntries);
|
|
44664
44764
|
}
|
|
44665
44765
|
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
44666
|
-
const { field, value } = domain;
|
|
44766
|
+
const { field, value, type } = domain;
|
|
44667
44767
|
const { nameWithGranularity } = this.getDimension(field);
|
|
44668
|
-
return dataEntries.filter((entry) =>
|
|
44768
|
+
return dataEntries.filter((entry) => {
|
|
44769
|
+
const cellValue = entry[nameWithGranularity]?.value;
|
|
44770
|
+
if (type === "char") {
|
|
44771
|
+
return String(cellValue) === String(value);
|
|
44772
|
+
}
|
|
44773
|
+
return cellValue === value;
|
|
44774
|
+
});
|
|
44669
44775
|
}
|
|
44670
44776
|
getDimension(nameWithGranularity) {
|
|
44671
44777
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -44801,7 +44907,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44801
44907
|
ui: SpreadsheetPivot,
|
|
44802
44908
|
definition: SpreadsheetPivotRuntimeDefinition,
|
|
44803
44909
|
externalData: false,
|
|
44804
|
-
onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
|
|
44805
44910
|
dateGranularities: [...dateGranularities],
|
|
44806
44911
|
datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
|
|
44807
44912
|
isMeasureCandidate: (field) => !["datetime", "boolean"].includes(field.type),
|
|
@@ -47141,6 +47246,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47141
47246
|
rect = this.defaultRect;
|
|
47142
47247
|
isEditing = false;
|
|
47143
47248
|
isCellReferenceVisible = false;
|
|
47249
|
+
currentEditedCell = {
|
|
47250
|
+
col: 0,
|
|
47251
|
+
row: 0,
|
|
47252
|
+
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
47253
|
+
};
|
|
47144
47254
|
composerStore;
|
|
47145
47255
|
composerFocusStore;
|
|
47146
47256
|
composerInterface;
|
|
@@ -47170,7 +47280,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47170
47280
|
return this.isCellReferenceVisible;
|
|
47171
47281
|
}
|
|
47172
47282
|
get cellReference() {
|
|
47173
|
-
const { col, row, sheetId } = this.
|
|
47283
|
+
const { col, row, sheetId } = this.currentEditedCell;
|
|
47174
47284
|
const prefixSheet = sheetId !== this.env.model.getters.getActiveSheetId();
|
|
47175
47285
|
return getFullReference(prefixSheet ? this.env.model.getters.getSheetName(sheetId) : undefined, toXC(col, row));
|
|
47176
47286
|
}
|
|
@@ -47263,12 +47373,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47263
47373
|
if (!isEditing && this.composerFocusStore.activeComposer !== this.composerInterface) {
|
|
47264
47374
|
this.composerFocusStore.focusComposer(this.composerInterface, { focusMode: "inactive" });
|
|
47265
47375
|
}
|
|
47376
|
+
let shouldRecomputeRect = isEditing && !deepEquals(this.currentEditedCell, this.composerStore.currentEditedCell);
|
|
47266
47377
|
if (this.isEditing !== isEditing) {
|
|
47267
47378
|
this.isEditing = isEditing;
|
|
47268
47379
|
if (!isEditing) {
|
|
47269
47380
|
this.rect = this.defaultRect;
|
|
47270
47381
|
return;
|
|
47271
47382
|
}
|
|
47383
|
+
this.currentEditedCell = this.composerStore.currentEditedCell;
|
|
47384
|
+
shouldRecomputeRect = true;
|
|
47385
|
+
}
|
|
47386
|
+
if (shouldRecomputeRect) {
|
|
47272
47387
|
const position = this.env.model.getters.getActivePosition();
|
|
47273
47388
|
const zone = this.env.model.getters.expandZone(position.sheetId, positionToZone(position));
|
|
47274
47389
|
this.rect = this.env.model.getters.getVisibleRect(zone);
|
|
@@ -57472,7 +57587,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57472
57587
|
onIterationEndEvaluationRegistry.add("pivots", (getters) => {
|
|
57473
57588
|
for (const pivotId of getters.getPivotIds()) {
|
|
57474
57589
|
const pivot = getters.getPivot(pivotId);
|
|
57475
|
-
|
|
57590
|
+
pivot.markAsDirtyForEvaluation?.();
|
|
57476
57591
|
}
|
|
57477
57592
|
});
|
|
57478
57593
|
|
|
@@ -60335,6 +60450,23 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60335
60450
|
static getters = ["getRowSize", "getHeaderSize"];
|
|
60336
60451
|
tallestCellInRow = {};
|
|
60337
60452
|
ctx = document.createElement("canvas").getContext("2d");
|
|
60453
|
+
beforeHandle(cmd) {
|
|
60454
|
+
switch (cmd.type) {
|
|
60455
|
+
// Ensure rows are updated before "UPDATE_CELL" is dispatched from cell plugin.
|
|
60456
|
+
// "UPDATE_CELL" uses the Sheet core plugin to access row data.
|
|
60457
|
+
// If "ADD_COLUMNS_ROWS" has not been processed yet by header_sizes_ui,
|
|
60458
|
+
// size updates may apply to incorrect (pre-insert) rows.
|
|
60459
|
+
case "ADD_COLUMNS_ROWS":
|
|
60460
|
+
if (cmd.dimension === "COL") {
|
|
60461
|
+
return;
|
|
60462
|
+
}
|
|
60463
|
+
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60464
|
+
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60465
|
+
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60466
|
+
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60467
|
+
break;
|
|
60468
|
+
}
|
|
60469
|
+
}
|
|
60338
60470
|
handle(cmd) {
|
|
60339
60471
|
switch (cmd.type) {
|
|
60340
60472
|
case "START":
|
|
@@ -60364,16 +60496,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60364
60496
|
this.history.update("tallestCellInRow", cmd.sheetId, tallestCells);
|
|
60365
60497
|
break;
|
|
60366
60498
|
}
|
|
60367
|
-
case "ADD_COLUMNS_ROWS": {
|
|
60368
|
-
if (cmd.dimension === "COL") {
|
|
60369
|
-
return;
|
|
60370
|
-
}
|
|
60371
|
-
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
60372
|
-
const newCells = Array(cmd.quantity).fill(undefined);
|
|
60373
|
-
const newTallestCells = insertItemsAtIndex(this.tallestCellInRow[cmd.sheetId], newCells, addIndex);
|
|
60374
|
-
this.history.update("tallestCellInRow", cmd.sheetId, newTallestCells);
|
|
60375
|
-
break;
|
|
60376
|
-
}
|
|
60377
60499
|
case "RESIZE_COLUMNS_ROWS":
|
|
60378
60500
|
{
|
|
60379
60501
|
const sheetId = cmd.sheetId;
|
|
@@ -60509,13 +60631,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60509
60631
|
super(custom, params);
|
|
60510
60632
|
this.getters = params.getters;
|
|
60511
60633
|
}
|
|
60512
|
-
|
|
60634
|
+
markAsDirtyForEvaluation() {
|
|
60513
60635
|
this.cache = {};
|
|
60514
60636
|
this.rankAsc = {};
|
|
60515
60637
|
this.rankDesc = {};
|
|
60516
60638
|
this.runningTotal = {};
|
|
60517
60639
|
this.runningTotalInPercent = {};
|
|
60518
|
-
super.
|
|
60640
|
+
super.markAsDirtyForEvaluation?.();
|
|
60519
60641
|
}
|
|
60520
60642
|
getPivotCellValueAndFormat(measureName, domain) {
|
|
60521
60643
|
return this.getMeasureDisplayValue(measureName, domain);
|
|
@@ -60640,7 +60762,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60640
60762
|
return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
|
|
60641
60763
|
}
|
|
60642
60764
|
}
|
|
60643
|
-
return
|
|
60765
|
+
return [];
|
|
60644
60766
|
}
|
|
60645
60767
|
treeToLeafDomains(tree, parentDomain = []) {
|
|
60646
60768
|
const domains = [];
|
|
@@ -66062,6 +66184,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66062
66184
|
const isBasedBefore = cmd.base < start;
|
|
66063
66185
|
const deltaCol = isBasedBefore && isCol ? thickness : 0;
|
|
66064
66186
|
const deltaRow = isBasedBefore && !isCol ? thickness : 0;
|
|
66187
|
+
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66188
|
+
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
66189
|
+
const size = isCol
|
|
66190
|
+
? this.getters.getColSize(cmd.sheetId, element)
|
|
66191
|
+
: this.getters.getUserRowSize(cmd.sheetId, element);
|
|
66192
|
+
const isDefaultCol = isCol && size === DEFAULT_CELL_WIDTH;
|
|
66193
|
+
return [element, isDefaultCol || size === undefined ? null : size];
|
|
66194
|
+
}));
|
|
66065
66195
|
const target = [
|
|
66066
66196
|
{
|
|
66067
66197
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -66092,14 +66222,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66092
66222
|
const col = selection.left;
|
|
66093
66223
|
const row = selection.top;
|
|
66094
66224
|
this.setSelectionMixin({ zone: selection, cell: { col, row } }, [selection]);
|
|
66095
|
-
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
66096
66225
|
let currentIndex = isBasedBefore ? cmd.base : cmd.base + 1;
|
|
66097
66226
|
for (const element of toRemove) {
|
|
66098
|
-
const size = this.getters.getHeaderSize(cmd.sheetId, cmd.dimension, element);
|
|
66099
66227
|
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
66100
66228
|
dimension: cmd.dimension,
|
|
66101
66229
|
sheetId: cmd.sheetId,
|
|
66102
|
-
size,
|
|
66230
|
+
size: originalSize[element],
|
|
66103
66231
|
elements: [currentIndex],
|
|
66104
66232
|
});
|
|
66105
66233
|
currentIndex += 1;
|
|
@@ -67811,14 +67939,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
67811
67939
|
this.editionState = "initializing";
|
|
67812
67940
|
}
|
|
67813
67941
|
stopEdition() {
|
|
67814
|
-
|
|
67815
|
-
if (!this.state.isEditing || !input)
|
|
67942
|
+
if (!this.state.isEditing || !this.sheetNameRef.el)
|
|
67816
67943
|
return;
|
|
67817
67944
|
this.state.isEditing = false;
|
|
67818
67945
|
this.editionState = "initializing";
|
|
67819
|
-
|
|
67946
|
+
this.sheetNameRef.el.blur();
|
|
67820
67947
|
const inputValue = this.getInputContent() || "";
|
|
67821
|
-
input.innerText = inputValue;
|
|
67822
67948
|
interactiveRenameSheet(this.env, this.props.sheetId, inputValue, () => this.startEdition());
|
|
67823
67949
|
}
|
|
67824
67950
|
cancelEdition() {
|
|
@@ -74513,9 +74639,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
74513
74639
|
exports.tokenize = tokenize;
|
|
74514
74640
|
|
|
74515
74641
|
|
|
74516
|
-
__info__.version = "18.0.
|
|
74517
|
-
__info__.date = "2025-
|
|
74518
|
-
__info__.hash = "
|
|
74642
|
+
__info__.version = "18.0.38";
|
|
74643
|
+
__info__.date = "2025-07-28T13:29:40.841Z";
|
|
74644
|
+
__info__.hash = "0f3b11a";
|
|
74519
74645
|
|
|
74520
74646
|
|
|
74521
74647
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|