@odoo/o-spreadsheet 18.3.11 → 18.3.12
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 +121 -42
- package/dist/o-spreadsheet.d.ts +2 -2
- package/dist/o-spreadsheet.esm.js +121 -42
- package/dist/o-spreadsheet.iife.js +121 -42
- package/dist/o-spreadsheet.iife.min.js +384 -384
- package/dist/o_spreadsheet.xml +3 -3
- 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.3.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.12
|
|
6
|
+
* @date 2025-07-11T11:11:58.998Z
|
|
7
|
+
* @hash d14dc96
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -827,6 +827,7 @@ const specialWhiteSpaceSpecialCharacters = [
|
|
|
827
827
|
];
|
|
828
828
|
const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
|
|
829
829
|
const newLineRegexp = /(\r\n|\r)/g;
|
|
830
|
+
const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
|
|
830
831
|
/**
|
|
831
832
|
* Replace all different newlines characters by \n
|
|
832
833
|
*/
|
|
@@ -2802,8 +2803,9 @@ const INITIAL_JS_DAY = DateTime.fromTimestamp(0);
|
|
|
2802
2803
|
const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
|
|
2803
2804
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
2804
2805
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
2805
|
-
const
|
|
2806
|
-
const
|
|
2806
|
+
const whiteSpaceChars = whiteSpaceCharacters.join("");
|
|
2807
|
+
const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
|
|
2808
|
+
const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
|
|
2807
2809
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
2808
2810
|
/** Convert a value number representing a date, or return undefined if it isn't possible */
|
|
2809
2811
|
function valueToDateNumber(value, locale) {
|
|
@@ -6795,6 +6797,8 @@ function splitWordToSpecificWidth(ctx, word, width, style) {
|
|
|
6795
6797
|
function splitTextToWidth(ctx, text, style, width) {
|
|
6796
6798
|
if (!style)
|
|
6797
6799
|
style = {};
|
|
6800
|
+
if (isMarkdownLink(text))
|
|
6801
|
+
text = parseMarkdownLink(text).label;
|
|
6798
6802
|
const brokenText = [];
|
|
6799
6803
|
// Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
|
|
6800
6804
|
// but 5-10x faster if it doesn't
|
|
@@ -8809,6 +8813,10 @@ function toNormalizedPivotValue(dimension, groupValue) {
|
|
|
8809
8813
|
if (groupValue === null || groupValue === "null") {
|
|
8810
8814
|
return null;
|
|
8811
8815
|
}
|
|
8816
|
+
const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
|
|
8817
|
+
if (isEvaluationError(extractedGroupValue)) {
|
|
8818
|
+
return extractedGroupValue;
|
|
8819
|
+
}
|
|
8812
8820
|
const groupValueString = typeof groupValue === "boolean"
|
|
8813
8821
|
? toString(groupValue).toLocaleLowerCase()
|
|
8814
8822
|
: toString(groupValue);
|
|
@@ -32905,40 +32913,112 @@ function convertPivotTableConfig(pivotTable) {
|
|
|
32905
32913
|
* In all the sheets, replace the table-only references in the formula cells with standard references.
|
|
32906
32914
|
*/
|
|
32907
32915
|
function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
|
|
32916
|
+
let deconstructedSheets = null;
|
|
32908
32917
|
for (let tableSheet of convertedSheets) {
|
|
32909
32918
|
const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
|
|
32919
|
+
if (!tables || tables.length === 0) {
|
|
32920
|
+
continue;
|
|
32921
|
+
}
|
|
32922
|
+
// Only deconstruct sheets if we are sure there are tables to process
|
|
32923
|
+
if (!deconstructedSheets) {
|
|
32924
|
+
deconstructedSheets = deconstructSheets(convertedSheets);
|
|
32925
|
+
}
|
|
32910
32926
|
for (let table of tables) {
|
|
32911
|
-
|
|
32912
|
-
|
|
32913
|
-
for (let xc in
|
|
32914
|
-
const
|
|
32915
|
-
let
|
|
32916
|
-
|
|
32917
|
-
|
|
32918
|
-
|
|
32919
|
-
let endIndex = refIndex + tabRef.length;
|
|
32920
|
-
let openBrackets = 1;
|
|
32921
|
-
while (openBrackets > 0 && endIndex < cellContent.length) {
|
|
32922
|
-
if (cellContent[endIndex] === "[") {
|
|
32923
|
-
openBrackets++;
|
|
32924
|
-
}
|
|
32925
|
-
else if (cellContent[endIndex] === "]") {
|
|
32926
|
-
openBrackets--;
|
|
32927
|
-
}
|
|
32928
|
-
endIndex++;
|
|
32929
|
-
}
|
|
32930
|
-
let reference = cellContent.slice(refIndex + tabRef.length, endIndex - 1);
|
|
32931
|
-
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
32932
|
-
const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
|
|
32933
|
-
cellContent =
|
|
32934
|
-
cellContent.slice(0, refIndex) + convertedRef + cellContent.slice(endIndex);
|
|
32927
|
+
for (let sheetId in deconstructedSheets) {
|
|
32928
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
32929
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
32930
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
32931
|
+
for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
|
|
32932
|
+
const possibleTable = deconstructedSheets[sheetId][xc][i];
|
|
32933
|
+
if (!possibleTable.endsWith(table.name)) {
|
|
32934
|
+
continue;
|
|
32935
32935
|
}
|
|
32936
|
+
const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
|
|
32937
|
+
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
32938
|
+
const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
|
|
32939
|
+
deconstructedSheets[sheetId][xc][i + 2] =
|
|
32940
|
+
possibleTable.slice(0, possibleTable.indexOf(table.name)) +
|
|
32941
|
+
convertedRef +
|
|
32942
|
+
deconstructedSheets[sheetId][xc][i + 2];
|
|
32943
|
+
deconstructedSheets[sheetId][xc].splice(i, 2);
|
|
32936
32944
|
}
|
|
32937
|
-
sheet.cells[xc] = cellContent;
|
|
32945
|
+
// sheet.cells[xc] = cellContent;
|
|
32938
32946
|
}
|
|
32939
32947
|
}
|
|
32940
32948
|
}
|
|
32941
32949
|
}
|
|
32950
|
+
if (!deconstructedSheets) {
|
|
32951
|
+
return;
|
|
32952
|
+
}
|
|
32953
|
+
for (let sheetId in deconstructedSheets) {
|
|
32954
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
32955
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
32956
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
32957
|
+
if (deconstructedCell.length === 1) {
|
|
32958
|
+
sheet.cells[xc] = deconstructedCell[0];
|
|
32959
|
+
continue;
|
|
32960
|
+
}
|
|
32961
|
+
let newContent = "";
|
|
32962
|
+
for (let i = 0; i < deconstructedCell.length; i += 2) {
|
|
32963
|
+
newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
|
|
32964
|
+
}
|
|
32965
|
+
newContent += deconstructedCell[deconstructedCell.length - 1];
|
|
32966
|
+
sheet.cells[xc] = newContent;
|
|
32967
|
+
}
|
|
32968
|
+
}
|
|
32969
|
+
}
|
|
32970
|
+
/**
|
|
32971
|
+
* Deconstruct the content of the cells in the sheets to extract possible table references.
|
|
32972
|
+
* Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
|
|
32973
|
+
* return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
|
|
32974
|
+
*/
|
|
32975
|
+
function deconstructSheets(convertedSheets) {
|
|
32976
|
+
const deconstructedSheets = {};
|
|
32977
|
+
for (let sheet of convertedSheets) {
|
|
32978
|
+
for (let xc in sheet.cells) {
|
|
32979
|
+
const cellContent = sheet.cells[xc];
|
|
32980
|
+
if (!cellContent || !cellContent.startsWith("=")) {
|
|
32981
|
+
continue;
|
|
32982
|
+
}
|
|
32983
|
+
const startIndex = cellContent.indexOf("[");
|
|
32984
|
+
if (startIndex === -1) {
|
|
32985
|
+
continue;
|
|
32986
|
+
}
|
|
32987
|
+
const deconstructedCell = [];
|
|
32988
|
+
let possibleTable = cellContent.slice(0, startIndex);
|
|
32989
|
+
let possibleRef = "";
|
|
32990
|
+
let openBrackets = 1;
|
|
32991
|
+
let mainPossibleTableIndex = 0;
|
|
32992
|
+
let mainOpenBracketIndex = startIndex;
|
|
32993
|
+
for (let index = startIndex + 1; index < cellContent.length; index++) {
|
|
32994
|
+
if (cellContent[index] === "[") {
|
|
32995
|
+
if (openBrackets === 0) {
|
|
32996
|
+
possibleTable = cellContent.slice(mainPossibleTableIndex, index);
|
|
32997
|
+
mainOpenBracketIndex = index;
|
|
32998
|
+
}
|
|
32999
|
+
openBrackets++;
|
|
33000
|
+
continue;
|
|
33001
|
+
}
|
|
33002
|
+
if (cellContent[index] === "]") {
|
|
33003
|
+
openBrackets--;
|
|
33004
|
+
if (openBrackets === 0) {
|
|
33005
|
+
possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
|
|
33006
|
+
deconstructedCell.push(possibleTable);
|
|
33007
|
+
deconstructedCell.push(possibleRef);
|
|
33008
|
+
mainPossibleTableIndex = index + 1;
|
|
33009
|
+
}
|
|
33010
|
+
}
|
|
33011
|
+
}
|
|
33012
|
+
if (deconstructedCell.length) {
|
|
33013
|
+
if (!deconstructedSheets[sheet.id]) {
|
|
33014
|
+
deconstructedSheets[sheet.id] = {};
|
|
33015
|
+
}
|
|
33016
|
+
deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
|
|
33017
|
+
deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
|
|
33018
|
+
}
|
|
33019
|
+
}
|
|
33020
|
+
}
|
|
33021
|
+
return deconstructedSheets;
|
|
32942
33022
|
}
|
|
32943
33023
|
/**
|
|
32944
33024
|
* Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
|
|
@@ -36000,6 +36080,9 @@ class ErrorToolTip extends owl.Component {
|
|
|
36000
36080
|
return undefined;
|
|
36001
36081
|
}
|
|
36002
36082
|
get errorOriginPositionString() {
|
|
36083
|
+
if (this.env.model.getters.isDashboard()) {
|
|
36084
|
+
return "";
|
|
36085
|
+
}
|
|
36003
36086
|
const evaluationError = this.evaluationError;
|
|
36004
36087
|
const position = evaluationError?.errorOriginPosition;
|
|
36005
36088
|
if (!position || deepEquals(position, this.props.cellPosition)) {
|
|
@@ -49779,10 +49862,7 @@ class SpreadsheetPivot {
|
|
|
49779
49862
|
if (finalCell.value === null) {
|
|
49780
49863
|
return { value: _t("(Undefined)") };
|
|
49781
49864
|
}
|
|
49782
|
-
return
|
|
49783
|
-
value: finalCell.value,
|
|
49784
|
-
format: finalCell.format,
|
|
49785
|
-
};
|
|
49865
|
+
return finalCell;
|
|
49786
49866
|
}
|
|
49787
49867
|
getPivotCellValueAndFormat(measureId, domain) {
|
|
49788
49868
|
const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
|
|
@@ -50011,7 +50091,6 @@ pivotRegistry.add("SPREADSHEET", {
|
|
|
50011
50091
|
ui: SpreadsheetPivot,
|
|
50012
50092
|
definition: SpreadsheetPivotRuntimeDefinition,
|
|
50013
50093
|
externalData: false,
|
|
50014
|
-
onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
|
|
50015
50094
|
dateGranularities: [...dateGranularities],
|
|
50016
50095
|
datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
|
|
50017
50096
|
isMeasureCandidate: (field) => field.type !== "boolean",
|
|
@@ -62965,7 +63044,7 @@ const onIterationEndEvaluationRegistry = new Registry();
|
|
|
62965
63044
|
onIterationEndEvaluationRegistry.add("pivots", (getters) => {
|
|
62966
63045
|
for (const pivotId of getters.getPivotIds()) {
|
|
62967
63046
|
const pivot = getters.getPivot(pivotId);
|
|
62968
|
-
|
|
63047
|
+
pivot.markAsDirtyForEvaluation?.();
|
|
62969
63048
|
}
|
|
62970
63049
|
});
|
|
62971
63050
|
|
|
@@ -65987,13 +66066,13 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
65987
66066
|
super(custom, params);
|
|
65988
66067
|
this.getters = params.getters;
|
|
65989
66068
|
}
|
|
65990
|
-
|
|
66069
|
+
markAsDirtyForEvaluation() {
|
|
65991
66070
|
this.cache = {};
|
|
65992
66071
|
this.rankAsc = {};
|
|
65993
66072
|
this.rankDesc = {};
|
|
65994
66073
|
this.runningTotal = {};
|
|
65995
66074
|
this.runningTotalInPercent = {};
|
|
65996
|
-
super.
|
|
66075
|
+
super.markAsDirtyForEvaluation?.();
|
|
65997
66076
|
}
|
|
65998
66077
|
getPivotCellValueAndFormat(measureName, domain) {
|
|
65999
66078
|
return this.getMeasureDisplayValue(measureName, domain);
|
|
@@ -66118,7 +66197,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
66118
66197
|
return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
|
|
66119
66198
|
}
|
|
66120
66199
|
}
|
|
66121
|
-
return
|
|
66200
|
+
return [];
|
|
66122
66201
|
}
|
|
66123
66202
|
treeToLeafDomains(tree, parentDomain = []) {
|
|
66124
66203
|
const domains = [];
|
|
@@ -80771,6 +80850,6 @@ exports.tokenColors = tokenColors;
|
|
|
80771
80850
|
exports.tokenize = tokenize;
|
|
80772
80851
|
|
|
80773
80852
|
|
|
80774
|
-
__info__.version = "18.3.
|
|
80775
|
-
__info__.date = "2025-
|
|
80776
|
-
__info__.hash = "
|
|
80853
|
+
__info__.version = "18.3.12";
|
|
80854
|
+
__info__.date = "2025-07-11T11:11:58.998Z";
|
|
80855
|
+
__info__.hash = "d14dc96";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -5684,6 +5684,7 @@ interface Pivot<T = PivotRuntimeDefinition> {
|
|
|
5684
5684
|
label: string;
|
|
5685
5685
|
}[];
|
|
5686
5686
|
needsReevaluation: boolean;
|
|
5687
|
+
markAsDirtyForEvaluation?(): void;
|
|
5687
5688
|
}
|
|
5688
5689
|
|
|
5689
5690
|
declare class PivotUIPlugin extends CoreViewPlugin {
|
|
@@ -6603,7 +6604,6 @@ interface PivotRegistryItem {
|
|
|
6603
6604
|
ui: PivotUIConstructor;
|
|
6604
6605
|
definition: PivotDefinitionConstructor;
|
|
6605
6606
|
externalData: boolean;
|
|
6606
|
-
onIterationEndEvaluation: (pivot: Pivot) => void;
|
|
6607
6607
|
dateGranularities: string[];
|
|
6608
6608
|
datetimeGranularities: string[];
|
|
6609
6609
|
isMeasureCandidate: (field: PivotField) => boolean;
|
|
@@ -10494,7 +10494,7 @@ declare function createPivotFormula(formulaId: string, cell: PivotTableCell): st
|
|
|
10494
10494
|
* e.g. given the following formula PIVOT.VALUE("1", "stage_id", "42", "status", "won"),
|
|
10495
10495
|
* the two group values are "42" and "won".
|
|
10496
10496
|
*/
|
|
10497
|
-
declare function toNormalizedPivotValue(dimension: Pick<PivotDimension$1, "type" | "displayName" | "granularity">, groupValue:
|
|
10497
|
+
declare function toNormalizedPivotValue(dimension: Pick<PivotDimension$1, "type" | "displayName" | "granularity">, groupValue: Maybe<CellValue | FunctionResultObject>): CellValue;
|
|
10498
10498
|
declare function toFunctionPivotValue(value: CellValue, dimension: Pick<PivotDimension$1, "type" | "granularity">): string;
|
|
10499
10499
|
|
|
10500
10500
|
interface Props$h {
|
|
@@ -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.3.
|
|
6
|
-
* @date 2025-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.3.12
|
|
6
|
+
* @date 2025-07-11T11:11:58.998Z
|
|
7
|
+
* @hash d14dc96
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -825,6 +825,7 @@ const specialWhiteSpaceSpecialCharacters = [
|
|
|
825
825
|
];
|
|
826
826
|
const specialWhiteSpaceRegexp = new RegExp(specialWhiteSpaceSpecialCharacters.join("|"), "g");
|
|
827
827
|
const newLineRegexp = /(\r\n|\r)/g;
|
|
828
|
+
const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
|
|
828
829
|
/**
|
|
829
830
|
* Replace all different newlines characters by \n
|
|
830
831
|
*/
|
|
@@ -2800,8 +2801,9 @@ const INITIAL_JS_DAY = DateTime.fromTimestamp(0);
|
|
|
2800
2801
|
const DATE_JS_1900_OFFSET = INITIAL_JS_DAY.getTime() - INITIAL_1900_DAY.getTime();
|
|
2801
2802
|
const mdyDateRegexp = /^\d{1,2}(\/|-|\s)\d{1,2}((\/|-|\s)\d{1,4})?$/;
|
|
2802
2803
|
const ymdDateRegexp = /^\d{3,4}(\/|-|\s)\d{1,2}(\/|-|\s)\d{1,2}$/;
|
|
2803
|
-
const
|
|
2804
|
-
const
|
|
2804
|
+
const whiteSpaceChars = whiteSpaceCharacters.join("");
|
|
2805
|
+
const dateSeparatorsRegex = new RegExp(`\/|-|${whiteSpaceCharacters.join("|")}`);
|
|
2806
|
+
const dateRegexp = new RegExp(`^(\\d{1,4})[\/${whiteSpaceChars}\-](\\d{1,4})([\/${whiteSpaceChars}\-](\\d{1,4}))?$`);
|
|
2805
2807
|
const timeRegexp = /((\d+(:\d+)?(:\d+)?\s*(AM|PM))|(\d+:\d+(:\d+)?))$/;
|
|
2806
2808
|
/** Convert a value number representing a date, or return undefined if it isn't possible */
|
|
2807
2809
|
function valueToDateNumber(value, locale) {
|
|
@@ -6793,6 +6795,8 @@ function splitWordToSpecificWidth(ctx, word, width, style) {
|
|
|
6793
6795
|
function splitTextToWidth(ctx, text, style, width) {
|
|
6794
6796
|
if (!style)
|
|
6795
6797
|
style = {};
|
|
6798
|
+
if (isMarkdownLink(text))
|
|
6799
|
+
text = parseMarkdownLink(text).label;
|
|
6796
6800
|
const brokenText = [];
|
|
6797
6801
|
// Checking if text contains NEWLINE before split makes it very slightly slower if text contains it,
|
|
6798
6802
|
// but 5-10x faster if it doesn't
|
|
@@ -8807,6 +8811,10 @@ function toNormalizedPivotValue(dimension, groupValue) {
|
|
|
8807
8811
|
if (groupValue === null || groupValue === "null") {
|
|
8808
8812
|
return null;
|
|
8809
8813
|
}
|
|
8814
|
+
const extractedGroupValue = typeof groupValue === "object" ? groupValue.value : groupValue;
|
|
8815
|
+
if (isEvaluationError(extractedGroupValue)) {
|
|
8816
|
+
return extractedGroupValue;
|
|
8817
|
+
}
|
|
8810
8818
|
const groupValueString = typeof groupValue === "boolean"
|
|
8811
8819
|
? toString(groupValue).toLocaleLowerCase()
|
|
8812
8820
|
: toString(groupValue);
|
|
@@ -32903,40 +32911,112 @@ function convertPivotTableConfig(pivotTable) {
|
|
|
32903
32911
|
* In all the sheets, replace the table-only references in the formula cells with standard references.
|
|
32904
32912
|
*/
|
|
32905
32913
|
function convertTableFormulaReferences(convertedSheets, xlsxSheets) {
|
|
32914
|
+
let deconstructedSheets = null;
|
|
32906
32915
|
for (let tableSheet of convertedSheets) {
|
|
32907
32916
|
const tables = xlsxSheets.find((s) => isSheetNameEqual(s.sheetName, tableSheet.name)).tables;
|
|
32917
|
+
if (!tables || tables.length === 0) {
|
|
32918
|
+
continue;
|
|
32919
|
+
}
|
|
32920
|
+
// Only deconstruct sheets if we are sure there are tables to process
|
|
32921
|
+
if (!deconstructedSheets) {
|
|
32922
|
+
deconstructedSheets = deconstructSheets(convertedSheets);
|
|
32923
|
+
}
|
|
32908
32924
|
for (let table of tables) {
|
|
32909
|
-
|
|
32910
|
-
|
|
32911
|
-
for (let xc in
|
|
32912
|
-
const
|
|
32913
|
-
let
|
|
32914
|
-
|
|
32915
|
-
|
|
32916
|
-
|
|
32917
|
-
let endIndex = refIndex + tabRef.length;
|
|
32918
|
-
let openBrackets = 1;
|
|
32919
|
-
while (openBrackets > 0 && endIndex < cellContent.length) {
|
|
32920
|
-
if (cellContent[endIndex] === "[") {
|
|
32921
|
-
openBrackets++;
|
|
32922
|
-
}
|
|
32923
|
-
else if (cellContent[endIndex] === "]") {
|
|
32924
|
-
openBrackets--;
|
|
32925
|
-
}
|
|
32926
|
-
endIndex++;
|
|
32927
|
-
}
|
|
32928
|
-
let reference = cellContent.slice(refIndex + tabRef.length, endIndex - 1);
|
|
32929
|
-
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
32930
|
-
const convertedRef = convertTableReference(sheetPrefix, reference, table, xc);
|
|
32931
|
-
cellContent =
|
|
32932
|
-
cellContent.slice(0, refIndex) + convertedRef + cellContent.slice(endIndex);
|
|
32925
|
+
for (let sheetId in deconstructedSheets) {
|
|
32926
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
32927
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
32928
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
32929
|
+
for (let i = deconstructedCell.length - 3; i >= 0; i -= 2) {
|
|
32930
|
+
const possibleTable = deconstructedSheets[sheetId][xc][i];
|
|
32931
|
+
if (!possibleTable.endsWith(table.name)) {
|
|
32932
|
+
continue;
|
|
32933
32933
|
}
|
|
32934
|
+
const possibleRef = deconstructedSheets[sheetId][xc][i + 1];
|
|
32935
|
+
const sheetPrefix = tableSheet.id === sheet.id ? "" : tableSheet.name + "!";
|
|
32936
|
+
const convertedRef = convertTableReference(sheetPrefix, possibleRef, table, xc);
|
|
32937
|
+
deconstructedSheets[sheetId][xc][i + 2] =
|
|
32938
|
+
possibleTable.slice(0, possibleTable.indexOf(table.name)) +
|
|
32939
|
+
convertedRef +
|
|
32940
|
+
deconstructedSheets[sheetId][xc][i + 2];
|
|
32941
|
+
deconstructedSheets[sheetId][xc].splice(i, 2);
|
|
32934
32942
|
}
|
|
32935
|
-
sheet.cells[xc] = cellContent;
|
|
32943
|
+
// sheet.cells[xc] = cellContent;
|
|
32936
32944
|
}
|
|
32937
32945
|
}
|
|
32938
32946
|
}
|
|
32939
32947
|
}
|
|
32948
|
+
if (!deconstructedSheets) {
|
|
32949
|
+
return;
|
|
32950
|
+
}
|
|
32951
|
+
for (let sheetId in deconstructedSheets) {
|
|
32952
|
+
const sheet = convertedSheets.find((s) => s.id === sheetId);
|
|
32953
|
+
for (let xc in deconstructedSheets[sheetId]) {
|
|
32954
|
+
const deconstructedCell = deconstructedSheets[sheetId][xc];
|
|
32955
|
+
if (deconstructedCell.length === 1) {
|
|
32956
|
+
sheet.cells[xc] = deconstructedCell[0];
|
|
32957
|
+
continue;
|
|
32958
|
+
}
|
|
32959
|
+
let newContent = "";
|
|
32960
|
+
for (let i = 0; i < deconstructedCell.length; i += 2) {
|
|
32961
|
+
newContent += deconstructedCell[i] + "[" + deconstructedCell[i + 1] + "]";
|
|
32962
|
+
}
|
|
32963
|
+
newContent += deconstructedCell[deconstructedCell.length - 1];
|
|
32964
|
+
sheet.cells[xc] = newContent;
|
|
32965
|
+
}
|
|
32966
|
+
}
|
|
32967
|
+
}
|
|
32968
|
+
/**
|
|
32969
|
+
* Deconstruct the content of the cells in the sheets to extract possible table references.
|
|
32970
|
+
* Example from "=AVERAGE(Table1[colName1])-AVERAGE(Table2[colName2])":
|
|
32971
|
+
* return --> ["=AVERAGE(Table1", "colName1", ")-AVERAGE(Table2", "colName2", ")"]
|
|
32972
|
+
*/
|
|
32973
|
+
function deconstructSheets(convertedSheets) {
|
|
32974
|
+
const deconstructedSheets = {};
|
|
32975
|
+
for (let sheet of convertedSheets) {
|
|
32976
|
+
for (let xc in sheet.cells) {
|
|
32977
|
+
const cellContent = sheet.cells[xc];
|
|
32978
|
+
if (!cellContent || !cellContent.startsWith("=")) {
|
|
32979
|
+
continue;
|
|
32980
|
+
}
|
|
32981
|
+
const startIndex = cellContent.indexOf("[");
|
|
32982
|
+
if (startIndex === -1) {
|
|
32983
|
+
continue;
|
|
32984
|
+
}
|
|
32985
|
+
const deconstructedCell = [];
|
|
32986
|
+
let possibleTable = cellContent.slice(0, startIndex);
|
|
32987
|
+
let possibleRef = "";
|
|
32988
|
+
let openBrackets = 1;
|
|
32989
|
+
let mainPossibleTableIndex = 0;
|
|
32990
|
+
let mainOpenBracketIndex = startIndex;
|
|
32991
|
+
for (let index = startIndex + 1; index < cellContent.length; index++) {
|
|
32992
|
+
if (cellContent[index] === "[") {
|
|
32993
|
+
if (openBrackets === 0) {
|
|
32994
|
+
possibleTable = cellContent.slice(mainPossibleTableIndex, index);
|
|
32995
|
+
mainOpenBracketIndex = index;
|
|
32996
|
+
}
|
|
32997
|
+
openBrackets++;
|
|
32998
|
+
continue;
|
|
32999
|
+
}
|
|
33000
|
+
if (cellContent[index] === "]") {
|
|
33001
|
+
openBrackets--;
|
|
33002
|
+
if (openBrackets === 0) {
|
|
33003
|
+
possibleRef = cellContent.slice(mainOpenBracketIndex + 1, index);
|
|
33004
|
+
deconstructedCell.push(possibleTable);
|
|
33005
|
+
deconstructedCell.push(possibleRef);
|
|
33006
|
+
mainPossibleTableIndex = index + 1;
|
|
33007
|
+
}
|
|
33008
|
+
}
|
|
33009
|
+
}
|
|
33010
|
+
if (deconstructedCell.length) {
|
|
33011
|
+
if (!deconstructedSheets[sheet.id]) {
|
|
33012
|
+
deconstructedSheets[sheet.id] = {};
|
|
33013
|
+
}
|
|
33014
|
+
deconstructedCell.push(cellContent.slice(mainPossibleTableIndex));
|
|
33015
|
+
deconstructedSheets[sheet.id][xc] = [...deconstructedCell];
|
|
33016
|
+
}
|
|
33017
|
+
}
|
|
33018
|
+
}
|
|
33019
|
+
return deconstructedSheets;
|
|
32940
33020
|
}
|
|
32941
33021
|
/**
|
|
32942
33022
|
* Convert table-specific references in formulas into standard references. A table reference is composed of columns names,
|
|
@@ -35998,6 +36078,9 @@ class ErrorToolTip extends Component {
|
|
|
35998
36078
|
return undefined;
|
|
35999
36079
|
}
|
|
36000
36080
|
get errorOriginPositionString() {
|
|
36081
|
+
if (this.env.model.getters.isDashboard()) {
|
|
36082
|
+
return "";
|
|
36083
|
+
}
|
|
36001
36084
|
const evaluationError = this.evaluationError;
|
|
36002
36085
|
const position = evaluationError?.errorOriginPosition;
|
|
36003
36086
|
if (!position || deepEquals(position, this.props.cellPosition)) {
|
|
@@ -49777,10 +49860,7 @@ class SpreadsheetPivot {
|
|
|
49777
49860
|
if (finalCell.value === null) {
|
|
49778
49861
|
return { value: _t("(Undefined)") };
|
|
49779
49862
|
}
|
|
49780
|
-
return
|
|
49781
|
-
value: finalCell.value,
|
|
49782
|
-
format: finalCell.format,
|
|
49783
|
-
};
|
|
49863
|
+
return finalCell;
|
|
49784
49864
|
}
|
|
49785
49865
|
getPivotCellValueAndFormat(measureId, domain) {
|
|
49786
49866
|
const dataEntries = this.filterDataEntriesFromDomain(this.dataEntries, domain);
|
|
@@ -50009,7 +50089,6 @@ pivotRegistry.add("SPREADSHEET", {
|
|
|
50009
50089
|
ui: SpreadsheetPivot,
|
|
50010
50090
|
definition: SpreadsheetPivotRuntimeDefinition,
|
|
50011
50091
|
externalData: false,
|
|
50012
|
-
onIterationEndEvaluation: (pivot) => pivot.markAsDirtyForEvaluation(),
|
|
50013
50092
|
dateGranularities: [...dateGranularities],
|
|
50014
50093
|
datetimeGranularities: [...dateGranularities, "hour_number", "minute_number", "second_number"],
|
|
50015
50094
|
isMeasureCandidate: (field) => field.type !== "boolean",
|
|
@@ -62963,7 +63042,7 @@ const onIterationEndEvaluationRegistry = new Registry();
|
|
|
62963
63042
|
onIterationEndEvaluationRegistry.add("pivots", (getters) => {
|
|
62964
63043
|
for (const pivotId of getters.getPivotIds()) {
|
|
62965
63044
|
const pivot = getters.getPivot(pivotId);
|
|
62966
|
-
|
|
63045
|
+
pivot.markAsDirtyForEvaluation?.();
|
|
62967
63046
|
}
|
|
62968
63047
|
});
|
|
62969
63048
|
|
|
@@ -65985,13 +66064,13 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
65985
66064
|
super(custom, params);
|
|
65986
66065
|
this.getters = params.getters;
|
|
65987
66066
|
}
|
|
65988
|
-
|
|
66067
|
+
markAsDirtyForEvaluation() {
|
|
65989
66068
|
this.cache = {};
|
|
65990
66069
|
this.rankAsc = {};
|
|
65991
66070
|
this.rankDesc = {};
|
|
65992
66071
|
this.runningTotal = {};
|
|
65993
66072
|
this.runningTotalInPercent = {};
|
|
65994
|
-
super.
|
|
66073
|
+
super.markAsDirtyForEvaluation?.();
|
|
65995
66074
|
}
|
|
65996
66075
|
getPivotCellValueAndFormat(measureName, domain) {
|
|
65997
66076
|
return this.getMeasureDisplayValue(measureName, domain);
|
|
@@ -66116,7 +66195,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
66116
66195
|
return this.getSubTreeMatchingDomain(node.children, domain, domainLevel + 1);
|
|
66117
66196
|
}
|
|
66118
66197
|
}
|
|
66119
|
-
return
|
|
66198
|
+
return [];
|
|
66120
66199
|
}
|
|
66121
66200
|
treeToLeafDomains(tree, parentDomain = []) {
|
|
66122
66201
|
const domains = [];
|
|
@@ -80723,6 +80802,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
80723
80802
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, 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, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
80724
80803
|
|
|
80725
80804
|
|
|
80726
|
-
__info__.version = "18.3.
|
|
80727
|
-
__info__.date = "2025-
|
|
80728
|
-
__info__.hash = "
|
|
80805
|
+
__info__.version = "18.3.12";
|
|
80806
|
+
__info__.date = "2025-07-11T11:11:58.998Z";
|
|
80807
|
+
__info__.hash = "d14dc96";
|