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