@odoo/o-spreadsheet 19.0.35 → 19.0.37
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 +84 -33
- package/dist/o_spreadsheet.css +3 -3
- package/dist/o_spreadsheet.esm.js +84 -33
- package/dist/o_spreadsheet.iife.js +84 -33
- package/dist/o_spreadsheet.iife.min.js +229 -229
- package/dist/o_spreadsheet.xml +5 -4
- package/package.json +1 -1
|
@@ -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 19.0.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.0.37
|
|
6
|
+
* @date 2026-06-06T06:22:21.404Z
|
|
7
|
+
* @hash 41aace0
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
@@ -3473,6 +3473,7 @@ function emptyDataErrorMessage(argName) {
|
|
|
3473
3473
|
//#endregion
|
|
3474
3474
|
//#region src/helpers/format/format_tokenizer.ts
|
|
3475
3475
|
function tokenizeFormat(str) {
|
|
3476
|
+
str = str.replace(/\s/g, " ");
|
|
3476
3477
|
const chars = new TokenizingChars(str);
|
|
3477
3478
|
const result = [];
|
|
3478
3479
|
let currentFormatPart = [];
|
|
@@ -5821,8 +5822,13 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
5821
5822
|
changeType: "NONE",
|
|
5822
5823
|
range
|
|
5823
5824
|
};
|
|
5825
|
+
const isUnboundedAtEnd = range.unboundedZone[end] === void 0;
|
|
5826
|
+
if (isUnboundedAtEnd && !range.unboundedZone.hasHeader) return {
|
|
5827
|
+
changeType: "RESIZE",
|
|
5828
|
+
range: createAdaptedRange(range, dimension, "RESIZE", cmd.quantity)
|
|
5829
|
+
};
|
|
5824
5830
|
if (cmd.position === "after") {
|
|
5825
|
-
if (range.zone[start] <= cmd.base && cmd.base < range.zone[end]) return {
|
|
5831
|
+
if (range.zone[start] <= cmd.base && (cmd.base < range.zone[end] || isUnboundedAtEnd)) return {
|
|
5826
5832
|
changeType: "RESIZE",
|
|
5827
5833
|
range: createAdaptedRange(range, dimension, "RESIZE", cmd.quantity)
|
|
5828
5834
|
};
|
|
@@ -9521,6 +9527,10 @@ const FORCE_DEFAULT_ARGS_FUNCTIONS = {
|
|
|
9521
9527
|
ROUNDDOWN: [{
|
|
9522
9528
|
type: "NUMBER",
|
|
9523
9529
|
value: 0
|
|
9530
|
+
}],
|
|
9531
|
+
IFERROR: [{
|
|
9532
|
+
type: "NUMBER",
|
|
9533
|
+
value: 0
|
|
9524
9534
|
}]
|
|
9525
9535
|
};
|
|
9526
9536
|
/**
|
|
@@ -39281,11 +39291,10 @@ const INSERT_TABLE = (env) => {
|
|
|
39281
39291
|
if (interactiveCreateTable(env, env.model.getters.getActiveSheetId()).isSuccessful) env.openSidePanel("TableSidePanel", {});
|
|
39282
39292
|
};
|
|
39283
39293
|
const DELETE_SELECTED_TABLE = (env) => {
|
|
39284
|
-
const
|
|
39285
|
-
const table = env.model.getters.getTable(position);
|
|
39294
|
+
const table = env.model.getters.getFirstTableInSelection();
|
|
39286
39295
|
if (!table) return;
|
|
39287
39296
|
env.model.dispatch("REMOVE_TABLE", {
|
|
39288
|
-
sheetId:
|
|
39297
|
+
sheetId: env.model.getters.getActiveSheetId(),
|
|
39289
39298
|
target: [table.range.zone]
|
|
39290
39299
|
});
|
|
39291
39300
|
};
|
|
@@ -52126,7 +52135,7 @@ function getVisiblePivotCellPositions(getters, pivotId) {
|
|
|
52126
52135
|
col,
|
|
52127
52136
|
row
|
|
52128
52137
|
};
|
|
52129
|
-
if (
|
|
52138
|
+
if (getters.getPivotIdsFromPosition(position).includes(pivotId)) positions.push(position);
|
|
52130
52139
|
}
|
|
52131
52140
|
return positions;
|
|
52132
52141
|
}
|
|
@@ -53012,6 +53021,9 @@ function extractFormulaIdFromToken(tokenAtCursor) {
|
|
|
53012
53021
|
function getFirstPivotFunction(tokens) {
|
|
53013
53022
|
return getFunctionsFromTokens(tokens, PIVOT_FUNCTIONS)[0];
|
|
53014
53023
|
}
|
|
53024
|
+
function getPivotFunctions(tokens) {
|
|
53025
|
+
return getFunctionsFromTokens(tokens, PIVOT_FUNCTIONS);
|
|
53026
|
+
}
|
|
53015
53027
|
/**
|
|
53016
53028
|
* Parse a spreadsheet formula and detect the number of PIVOT functions that are
|
|
53017
53029
|
* present in the given formula.
|
|
@@ -64011,6 +64023,7 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
64011
64023
|
"getFirstPivotFunction",
|
|
64012
64024
|
"getPivotCellSortDirection",
|
|
64013
64025
|
"getPivotIdFromPosition",
|
|
64026
|
+
"getPivotIdsFromPosition",
|
|
64014
64027
|
"getPivotCellFromPosition",
|
|
64015
64028
|
"generateNewCalculatedMeasureName",
|
|
64016
64029
|
"isPivotUnused",
|
|
@@ -64035,9 +64048,11 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
64035
64048
|
this.refreshPivot(cmd.id);
|
|
64036
64049
|
break;
|
|
64037
64050
|
case "ADD_PIVOT":
|
|
64051
|
+
this.unusedPivots?.push(cmd.pivotId);
|
|
64038
64052
|
this.setupPivot(cmd.pivotId);
|
|
64039
64053
|
break;
|
|
64040
64054
|
case "DUPLICATE_PIVOT":
|
|
64055
|
+
this.unusedPivots?.push(cmd.newPivotId);
|
|
64041
64056
|
this.setupPivot(cmd.newPivotId);
|
|
64042
64057
|
break;
|
|
64043
64058
|
case "UPDATE_PIVOT":
|
|
@@ -64068,37 +64083,52 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
64068
64083
|
}
|
|
64069
64084
|
}
|
|
64070
64085
|
/**
|
|
64071
|
-
* Get the id of the pivot at the given position. Returns undefined if there
|
|
64086
|
+
* Get the id of the first pivot in the formula at the given position. Returns undefined if there
|
|
64072
64087
|
* is no pivot at this position
|
|
64073
64088
|
*/
|
|
64074
64089
|
getPivotIdFromPosition(position) {
|
|
64090
|
+
return this.getPivotIdsFromPosition(position)[0];
|
|
64091
|
+
}
|
|
64092
|
+
/**
|
|
64093
|
+
* Get all of the ids of the pivot present in the formula at the given position.
|
|
64094
|
+
*/
|
|
64095
|
+
getPivotIdsFromPosition(position) {
|
|
64075
64096
|
const cell = this.getters.getCorrespondingFormulaCell(position);
|
|
64076
|
-
if (cell && cell.isFormula)
|
|
64077
|
-
|
|
64078
|
-
|
|
64079
|
-
|
|
64080
|
-
|
|
64081
|
-
|
|
64082
|
-
|
|
64097
|
+
if (cell && cell.isFormula) return this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
|
|
64098
|
+
return [];
|
|
64099
|
+
}
|
|
64100
|
+
getPivotIdsFromFormula(sheetId, formula) {
|
|
64101
|
+
return this.getPivotFunctions(sheetId, formula.tokens).map((pivotFunction) => {
|
|
64102
|
+
const pivotId = pivotFunction.args[0]?.toString();
|
|
64103
|
+
return pivotId && this.getters.getPivotId(pivotId);
|
|
64104
|
+
}).filter(isDefined);
|
|
64083
64105
|
}
|
|
64084
64106
|
isSpillPivotFormula(position) {
|
|
64085
64107
|
const cell = this.getters.getCorrespondingFormulaCell(position);
|
|
64086
64108
|
if (cell && cell.isFormula) return this.getFirstPivotFunction(position.sheetId, cell.compiledFormula.tokens)?.functionName === "PIVOT";
|
|
64087
64109
|
return false;
|
|
64088
64110
|
}
|
|
64089
|
-
|
|
64090
|
-
const
|
|
64091
|
-
if (!
|
|
64092
|
-
const
|
|
64093
|
-
|
|
64094
|
-
functionName,
|
|
64095
|
-
|
|
64111
|
+
getPivotFunctions(sheetId, tokens) {
|
|
64112
|
+
const pivotFunctions = getPivotFunctions(tokens);
|
|
64113
|
+
if (!pivotFunctions.length) return [];
|
|
64114
|
+
const evaluatedPivotFunctions = [];
|
|
64115
|
+
for (const pivotFunction of pivotFunctions) {
|
|
64116
|
+
const { functionName, args } = pivotFunction;
|
|
64117
|
+
const evaluatedArgs = args.map((argAst) => {
|
|
64096
64118
|
if (argAst.type === "EMPTY") return;
|
|
64097
64119
|
else if (argAst.type === "STRING" || argAst.type === "BOOLEAN" || argAst.type === "NUMBER") return argAst.value;
|
|
64098
64120
|
const argsString = astToFormula(argAst);
|
|
64099
64121
|
return this.getters.evaluateFormula(sheetId, argsString);
|
|
64100
|
-
})
|
|
64101
|
-
|
|
64122
|
+
});
|
|
64123
|
+
evaluatedPivotFunctions.push({
|
|
64124
|
+
functionName,
|
|
64125
|
+
args: evaluatedArgs
|
|
64126
|
+
});
|
|
64127
|
+
}
|
|
64128
|
+
return evaluatedPivotFunctions;
|
|
64129
|
+
}
|
|
64130
|
+
getFirstPivotFunction(sheetId, tokens) {
|
|
64131
|
+
return this.getPivotFunctions(sheetId, tokens)[0];
|
|
64102
64132
|
}
|
|
64103
64133
|
/**
|
|
64104
64134
|
* Returns the domain args of a pivot formula from a position.
|
|
@@ -64212,8 +64242,8 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
64212
64242
|
const unusedPivots = new Set(this.getters.getPivotIds());
|
|
64213
64243
|
for (const sheetId of this.getters.getSheetIds()) for (const cellId in this.getters.getCells(sheetId)) {
|
|
64214
64244
|
const position = this.getters.getCellPosition(cellId);
|
|
64215
|
-
const
|
|
64216
|
-
|
|
64245
|
+
const pivotIds = this.getPivotIdsFromPosition(position);
|
|
64246
|
+
for (const pivotId of pivotIds) {
|
|
64217
64247
|
unusedPivots.delete(pivotId);
|
|
64218
64248
|
if (!unusedPivots.size) {
|
|
64219
64249
|
this.unusedPivots = [];
|
|
@@ -64221,6 +64251,21 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
64221
64251
|
}
|
|
64222
64252
|
}
|
|
64223
64253
|
}
|
|
64254
|
+
for (const pivotId of this.getters.getPivotIds()) {
|
|
64255
|
+
const pivot = this.getters.getPivotCoreDefinition(pivotId);
|
|
64256
|
+
for (const measure of pivot.measures) if (measure.computedBy) {
|
|
64257
|
+
const { sheetId } = measure.computedBy;
|
|
64258
|
+
const formula = this.getters.getMeasureCompiledFormula(pivotId, measure);
|
|
64259
|
+
const relatedPivotIds = this.getPivotIdsFromFormula(sheetId, formula);
|
|
64260
|
+
for (const relatedPivotId of relatedPivotIds) {
|
|
64261
|
+
unusedPivots.delete(relatedPivotId);
|
|
64262
|
+
if (!unusedPivots.size) {
|
|
64263
|
+
this.unusedPivots = [];
|
|
64264
|
+
return [];
|
|
64265
|
+
}
|
|
64266
|
+
}
|
|
64267
|
+
}
|
|
64268
|
+
}
|
|
64224
64269
|
this.unusedPivots = [...unusedPivots];
|
|
64225
64270
|
return this.unusedPivots;
|
|
64226
64271
|
}
|
|
@@ -67416,7 +67461,8 @@ const invalidateTableStyleCommandsSet = new Set([
|
|
|
67416
67461
|
"REMOVE_TABLE",
|
|
67417
67462
|
"RESIZE_TABLE",
|
|
67418
67463
|
"CREATE_TABLE_STYLE",
|
|
67419
|
-
"REMOVE_TABLE_STYLE"
|
|
67464
|
+
"REMOVE_TABLE_STYLE",
|
|
67465
|
+
"DELETE_CONTENT"
|
|
67420
67466
|
]);
|
|
67421
67467
|
function doesCommandInvalidatesTableStyle(cmd) {
|
|
67422
67468
|
return invalidateTableStyleCommandsSet.has(cmd.type);
|
|
@@ -76806,6 +76852,11 @@ function lineAttributes(params) {
|
|
|
76806
76852
|
`;
|
|
76807
76853
|
}
|
|
76808
76854
|
function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
|
|
76855
|
+
const textProperties = [
|
|
76856
|
+
["b", style.bold ? "1" : "0"],
|
|
76857
|
+
["i", style.italic ? "1" : "0"],
|
|
76858
|
+
["sz", fontsize * 100]
|
|
76859
|
+
];
|
|
76809
76860
|
return escapeXml`
|
|
76810
76861
|
<c:tx>
|
|
76811
76862
|
<c:rich>
|
|
@@ -76813,13 +76864,13 @@ function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
|
|
|
76813
76864
|
<a:lstStyle />
|
|
76814
76865
|
<a:p>
|
|
76815
76866
|
<a:pPr lvl="0">
|
|
76816
|
-
<a:defRPr
|
|
76867
|
+
<a:defRPr ${formatAttributes(textProperties)}>
|
|
76817
76868
|
${solidFill(fontColor)}
|
|
76818
76869
|
<a:latin typeface="+mn-lt"/>
|
|
76819
76870
|
</a:defRPr>
|
|
76820
76871
|
</a:pPr>
|
|
76821
76872
|
<a:r> <!-- Runs -->
|
|
76822
|
-
<a:rPr
|
|
76873
|
+
<a:rPr ${formatAttributes(textProperties)}/>
|
|
76823
76874
|
<a:t>${text}</a:t>
|
|
76824
76875
|
</a:r>
|
|
76825
76876
|
</a:p>
|
|
@@ -79516,6 +79567,6 @@ exports.stores = stores;
|
|
|
79516
79567
|
exports.tokenColors = tokenColors;
|
|
79517
79568
|
exports.tokenize = tokenize;
|
|
79518
79569
|
|
|
79519
|
-
__info__.version = "19.0.
|
|
79520
|
-
__info__.date = "2026-
|
|
79521
|
-
__info__.hash = "
|
|
79570
|
+
__info__.version = "19.0.37";
|
|
79571
|
+
__info__.date = "2026-06-06T06:22:21.404Z";
|
|
79572
|
+
__info__.hash = "41aace0";
|
package/dist/o_spreadsheet.css
CHANGED
|
@@ -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 19.0.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.0.37
|
|
6
|
+
* @date 2026-06-06T06:22:23.027Z
|
|
7
|
+
* @hash 41aace0
|
|
8
8
|
*/
|
|
9
9
|
/* Originates from src/components/top_bar/top_bar.scss */
|
|
10
10
|
@media (max-width: 1200px) {
|
|
@@ -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 19.0.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.0.37
|
|
6
|
+
* @date 2026-06-06T06:22:21.404Z
|
|
7
|
+
* @hash 41aace0
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { App, Component, blockDom, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, xml } from "@odoo/owl";
|
|
@@ -3472,6 +3472,7 @@ function emptyDataErrorMessage(argName) {
|
|
|
3472
3472
|
//#endregion
|
|
3473
3473
|
//#region src/helpers/format/format_tokenizer.ts
|
|
3474
3474
|
function tokenizeFormat(str) {
|
|
3475
|
+
str = str.replace(/\s/g, " ");
|
|
3475
3476
|
const chars = new TokenizingChars(str);
|
|
3476
3477
|
const result = [];
|
|
3477
3478
|
let currentFormatPart = [];
|
|
@@ -5820,8 +5821,13 @@ function getApplyRangeChangeAddColRow(cmd) {
|
|
|
5820
5821
|
changeType: "NONE",
|
|
5821
5822
|
range
|
|
5822
5823
|
};
|
|
5824
|
+
const isUnboundedAtEnd = range.unboundedZone[end] === void 0;
|
|
5825
|
+
if (isUnboundedAtEnd && !range.unboundedZone.hasHeader) return {
|
|
5826
|
+
changeType: "RESIZE",
|
|
5827
|
+
range: createAdaptedRange(range, dimension, "RESIZE", cmd.quantity)
|
|
5828
|
+
};
|
|
5823
5829
|
if (cmd.position === "after") {
|
|
5824
|
-
if (range.zone[start] <= cmd.base && cmd.base < range.zone[end]) return {
|
|
5830
|
+
if (range.zone[start] <= cmd.base && (cmd.base < range.zone[end] || isUnboundedAtEnd)) return {
|
|
5825
5831
|
changeType: "RESIZE",
|
|
5826
5832
|
range: createAdaptedRange(range, dimension, "RESIZE", cmd.quantity)
|
|
5827
5833
|
};
|
|
@@ -9520,6 +9526,10 @@ const FORCE_DEFAULT_ARGS_FUNCTIONS = {
|
|
|
9520
9526
|
ROUNDDOWN: [{
|
|
9521
9527
|
type: "NUMBER",
|
|
9522
9528
|
value: 0
|
|
9529
|
+
}],
|
|
9530
|
+
IFERROR: [{
|
|
9531
|
+
type: "NUMBER",
|
|
9532
|
+
value: 0
|
|
9523
9533
|
}]
|
|
9524
9534
|
};
|
|
9525
9535
|
/**
|
|
@@ -39280,11 +39290,10 @@ const INSERT_TABLE = (env) => {
|
|
|
39280
39290
|
if (interactiveCreateTable(env, env.model.getters.getActiveSheetId()).isSuccessful) env.openSidePanel("TableSidePanel", {});
|
|
39281
39291
|
};
|
|
39282
39292
|
const DELETE_SELECTED_TABLE = (env) => {
|
|
39283
|
-
const
|
|
39284
|
-
const table = env.model.getters.getTable(position);
|
|
39293
|
+
const table = env.model.getters.getFirstTableInSelection();
|
|
39285
39294
|
if (!table) return;
|
|
39286
39295
|
env.model.dispatch("REMOVE_TABLE", {
|
|
39287
|
-
sheetId:
|
|
39296
|
+
sheetId: env.model.getters.getActiveSheetId(),
|
|
39288
39297
|
target: [table.range.zone]
|
|
39289
39298
|
});
|
|
39290
39299
|
};
|
|
@@ -52125,7 +52134,7 @@ function getVisiblePivotCellPositions(getters, pivotId) {
|
|
|
52125
52134
|
col,
|
|
52126
52135
|
row
|
|
52127
52136
|
};
|
|
52128
|
-
if (
|
|
52137
|
+
if (getters.getPivotIdsFromPosition(position).includes(pivotId)) positions.push(position);
|
|
52129
52138
|
}
|
|
52130
52139
|
return positions;
|
|
52131
52140
|
}
|
|
@@ -53011,6 +53020,9 @@ function extractFormulaIdFromToken(tokenAtCursor) {
|
|
|
53011
53020
|
function getFirstPivotFunction(tokens) {
|
|
53012
53021
|
return getFunctionsFromTokens(tokens, PIVOT_FUNCTIONS)[0];
|
|
53013
53022
|
}
|
|
53023
|
+
function getPivotFunctions(tokens) {
|
|
53024
|
+
return getFunctionsFromTokens(tokens, PIVOT_FUNCTIONS);
|
|
53025
|
+
}
|
|
53014
53026
|
/**
|
|
53015
53027
|
* Parse a spreadsheet formula and detect the number of PIVOT functions that are
|
|
53016
53028
|
* present in the given formula.
|
|
@@ -63826,6 +63838,7 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
63826
63838
|
"getFirstPivotFunction",
|
|
63827
63839
|
"getPivotCellSortDirection",
|
|
63828
63840
|
"getPivotIdFromPosition",
|
|
63841
|
+
"getPivotIdsFromPosition",
|
|
63829
63842
|
"getPivotCellFromPosition",
|
|
63830
63843
|
"generateNewCalculatedMeasureName",
|
|
63831
63844
|
"isPivotUnused",
|
|
@@ -63850,9 +63863,11 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
63850
63863
|
this.refreshPivot(cmd.id);
|
|
63851
63864
|
break;
|
|
63852
63865
|
case "ADD_PIVOT":
|
|
63866
|
+
this.unusedPivots?.push(cmd.pivotId);
|
|
63853
63867
|
this.setupPivot(cmd.pivotId);
|
|
63854
63868
|
break;
|
|
63855
63869
|
case "DUPLICATE_PIVOT":
|
|
63870
|
+
this.unusedPivots?.push(cmd.newPivotId);
|
|
63856
63871
|
this.setupPivot(cmd.newPivotId);
|
|
63857
63872
|
break;
|
|
63858
63873
|
case "UPDATE_PIVOT":
|
|
@@ -63883,37 +63898,52 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
63883
63898
|
}
|
|
63884
63899
|
}
|
|
63885
63900
|
/**
|
|
63886
|
-
* Get the id of the pivot at the given position. Returns undefined if there
|
|
63901
|
+
* Get the id of the first pivot in the formula at the given position. Returns undefined if there
|
|
63887
63902
|
* is no pivot at this position
|
|
63888
63903
|
*/
|
|
63889
63904
|
getPivotIdFromPosition(position) {
|
|
63905
|
+
return this.getPivotIdsFromPosition(position)[0];
|
|
63906
|
+
}
|
|
63907
|
+
/**
|
|
63908
|
+
* Get all of the ids of the pivot present in the formula at the given position.
|
|
63909
|
+
*/
|
|
63910
|
+
getPivotIdsFromPosition(position) {
|
|
63890
63911
|
const cell = this.getters.getCorrespondingFormulaCell(position);
|
|
63891
|
-
if (cell && cell.isFormula)
|
|
63892
|
-
|
|
63893
|
-
|
|
63894
|
-
|
|
63895
|
-
|
|
63896
|
-
|
|
63897
|
-
|
|
63912
|
+
if (cell && cell.isFormula) return this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
|
|
63913
|
+
return [];
|
|
63914
|
+
}
|
|
63915
|
+
getPivotIdsFromFormula(sheetId, formula) {
|
|
63916
|
+
return this.getPivotFunctions(sheetId, formula.tokens).map((pivotFunction) => {
|
|
63917
|
+
const pivotId = pivotFunction.args[0]?.toString();
|
|
63918
|
+
return pivotId && this.getters.getPivotId(pivotId);
|
|
63919
|
+
}).filter(isDefined);
|
|
63898
63920
|
}
|
|
63899
63921
|
isSpillPivotFormula(position) {
|
|
63900
63922
|
const cell = this.getters.getCorrespondingFormulaCell(position);
|
|
63901
63923
|
if (cell && cell.isFormula) return this.getFirstPivotFunction(position.sheetId, cell.compiledFormula.tokens)?.functionName === "PIVOT";
|
|
63902
63924
|
return false;
|
|
63903
63925
|
}
|
|
63904
|
-
|
|
63905
|
-
const
|
|
63906
|
-
if (!
|
|
63907
|
-
const
|
|
63908
|
-
|
|
63909
|
-
functionName,
|
|
63910
|
-
|
|
63926
|
+
getPivotFunctions(sheetId, tokens) {
|
|
63927
|
+
const pivotFunctions = getPivotFunctions(tokens);
|
|
63928
|
+
if (!pivotFunctions.length) return [];
|
|
63929
|
+
const evaluatedPivotFunctions = [];
|
|
63930
|
+
for (const pivotFunction of pivotFunctions) {
|
|
63931
|
+
const { functionName, args } = pivotFunction;
|
|
63932
|
+
const evaluatedArgs = args.map((argAst) => {
|
|
63911
63933
|
if (argAst.type === "EMPTY") return;
|
|
63912
63934
|
else if (argAst.type === "STRING" || argAst.type === "BOOLEAN" || argAst.type === "NUMBER") return argAst.value;
|
|
63913
63935
|
const argsString = astToFormula(argAst);
|
|
63914
63936
|
return this.getters.evaluateFormula(sheetId, argsString);
|
|
63915
|
-
})
|
|
63916
|
-
|
|
63937
|
+
});
|
|
63938
|
+
evaluatedPivotFunctions.push({
|
|
63939
|
+
functionName,
|
|
63940
|
+
args: evaluatedArgs
|
|
63941
|
+
});
|
|
63942
|
+
}
|
|
63943
|
+
return evaluatedPivotFunctions;
|
|
63944
|
+
}
|
|
63945
|
+
getFirstPivotFunction(sheetId, tokens) {
|
|
63946
|
+
return this.getPivotFunctions(sheetId, tokens)[0];
|
|
63917
63947
|
}
|
|
63918
63948
|
/**
|
|
63919
63949
|
* Returns the domain args of a pivot formula from a position.
|
|
@@ -64027,8 +64057,8 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
64027
64057
|
const unusedPivots = new Set(this.getters.getPivotIds());
|
|
64028
64058
|
for (const sheetId of this.getters.getSheetIds()) for (const cellId in this.getters.getCells(sheetId)) {
|
|
64029
64059
|
const position = this.getters.getCellPosition(cellId);
|
|
64030
|
-
const
|
|
64031
|
-
|
|
64060
|
+
const pivotIds = this.getPivotIdsFromPosition(position);
|
|
64061
|
+
for (const pivotId of pivotIds) {
|
|
64032
64062
|
unusedPivots.delete(pivotId);
|
|
64033
64063
|
if (!unusedPivots.size) {
|
|
64034
64064
|
this.unusedPivots = [];
|
|
@@ -64036,6 +64066,21 @@ var PivotUIPlugin = class extends CoreViewPlugin {
|
|
|
64036
64066
|
}
|
|
64037
64067
|
}
|
|
64038
64068
|
}
|
|
64069
|
+
for (const pivotId of this.getters.getPivotIds()) {
|
|
64070
|
+
const pivot = this.getters.getPivotCoreDefinition(pivotId);
|
|
64071
|
+
for (const measure of pivot.measures) if (measure.computedBy) {
|
|
64072
|
+
const { sheetId } = measure.computedBy;
|
|
64073
|
+
const formula = this.getters.getMeasureCompiledFormula(pivotId, measure);
|
|
64074
|
+
const relatedPivotIds = this.getPivotIdsFromFormula(sheetId, formula);
|
|
64075
|
+
for (const relatedPivotId of relatedPivotIds) {
|
|
64076
|
+
unusedPivots.delete(relatedPivotId);
|
|
64077
|
+
if (!unusedPivots.size) {
|
|
64078
|
+
this.unusedPivots = [];
|
|
64079
|
+
return [];
|
|
64080
|
+
}
|
|
64081
|
+
}
|
|
64082
|
+
}
|
|
64083
|
+
}
|
|
64039
64084
|
this.unusedPivots = [...unusedPivots];
|
|
64040
64085
|
return this.unusedPivots;
|
|
64041
64086
|
}
|
|
@@ -67231,7 +67276,8 @@ const invalidateTableStyleCommandsSet = new Set([
|
|
|
67231
67276
|
"REMOVE_TABLE",
|
|
67232
67277
|
"RESIZE_TABLE",
|
|
67233
67278
|
"CREATE_TABLE_STYLE",
|
|
67234
|
-
"REMOVE_TABLE_STYLE"
|
|
67279
|
+
"REMOVE_TABLE_STYLE",
|
|
67280
|
+
"DELETE_CONTENT"
|
|
67235
67281
|
]);
|
|
67236
67282
|
function doesCommandInvalidatesTableStyle(cmd) {
|
|
67237
67283
|
return invalidateTableStyleCommandsSet.has(cmd.type);
|
|
@@ -76621,6 +76667,11 @@ function lineAttributes(params) {
|
|
|
76621
76667
|
`;
|
|
76622
76668
|
}
|
|
76623
76669
|
function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
|
|
76670
|
+
const textProperties = [
|
|
76671
|
+
["b", style.bold ? "1" : "0"],
|
|
76672
|
+
["i", style.italic ? "1" : "0"],
|
|
76673
|
+
["sz", fontsize * 100]
|
|
76674
|
+
];
|
|
76624
76675
|
return escapeXml`
|
|
76625
76676
|
<c:tx>
|
|
76626
76677
|
<c:rich>
|
|
@@ -76628,13 +76679,13 @@ function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
|
|
|
76628
76679
|
<a:lstStyle />
|
|
76629
76680
|
<a:p>
|
|
76630
76681
|
<a:pPr lvl="0">
|
|
76631
|
-
<a:defRPr
|
|
76682
|
+
<a:defRPr ${formatAttributes(textProperties)}>
|
|
76632
76683
|
${solidFill(fontColor)}
|
|
76633
76684
|
<a:latin typeface="+mn-lt"/>
|
|
76634
76685
|
</a:defRPr>
|
|
76635
76686
|
</a:pPr>
|
|
76636
76687
|
<a:r> <!-- Runs -->
|
|
76637
|
-
<a:rPr
|
|
76688
|
+
<a:rPr ${formatAttributes(textProperties)}/>
|
|
76638
76689
|
<a:t>${text}</a:t>
|
|
76639
76690
|
</a:r>
|
|
76640
76691
|
</a:p>
|
|
@@ -79280,6 +79331,6 @@ const chartHelpers = {
|
|
|
79280
79331
|
//#endregion
|
|
79281
79332
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
79282
79333
|
|
|
79283
|
-
__info__.version = "19.0.
|
|
79284
|
-
__info__.date = "2026-
|
|
79285
|
-
__info__.hash = "
|
|
79334
|
+
__info__.version = "19.0.37";
|
|
79335
|
+
__info__.date = "2026-06-06T06:22:21.404Z";
|
|
79336
|
+
__info__.hash = "41aace0";
|