@odoo/o-spreadsheet 18.0.44 → 18.0.46
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 +42 -23
- package/dist/o-spreadsheet.esm.js +42 -23
- package/dist/o-spreadsheet.iife.js +42 -23
- package/dist/o-spreadsheet.iife.min.js +6 -6
- package/dist/o_spreadsheet.xml +10 -3
- package/package.json +15 -2
|
@@ -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.46
|
|
6
|
+
* @date 2025-10-07T10:00:44.707Z
|
|
7
|
+
* @hash 67a1b4a
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -856,13 +856,22 @@ function memoize(func) {
|
|
|
856
856
|
},
|
|
857
857
|
}[funcName];
|
|
858
858
|
}
|
|
859
|
+
/**
|
|
860
|
+
* Removes the specified indexes from the array.
|
|
861
|
+
* Sparse (empty) elements are transformed to undefined (unless their index is explicitly removed).
|
|
862
|
+
*/
|
|
859
863
|
function removeIndexesFromArray(array, indexes) {
|
|
860
|
-
|
|
864
|
+
const toRemove = new Set(indexes);
|
|
865
|
+
const newArray = [];
|
|
866
|
+
for (let i = 0; i < array.length; i++) {
|
|
867
|
+
if (!toRemove.has(i)) {
|
|
868
|
+
newArray.push(array[i]);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
return newArray;
|
|
861
872
|
}
|
|
862
873
|
function insertItemsAtIndex(array, items, index) {
|
|
863
|
-
|
|
864
|
-
newArray.splice(index, 0, ...items);
|
|
865
|
-
return newArray;
|
|
874
|
+
return array.slice(0, index).concat(items).concat(array.slice(index));
|
|
866
875
|
}
|
|
867
876
|
function replaceItemAtIndex(array, newItem, index) {
|
|
868
877
|
const newArray = [...array];
|
|
@@ -4929,7 +4938,7 @@ function tokensToTextInternalFormat(tokens) {
|
|
|
4929
4938
|
* Replace in place tokens "mm" and "m" that denote minutes in date format with "MM" to avoid confusion with months.
|
|
4930
4939
|
*
|
|
4931
4940
|
* As per OpenXML specification, in date formats if a date token "m" or "mm" is followed by a date token "s" or
|
|
4932
|
-
* preceded by a data token "h", then it's not a month but
|
|
4941
|
+
* preceded by a data token "h", then it's not a month but a minute.
|
|
4933
4942
|
*/
|
|
4934
4943
|
function convertTokensToMinutesInDateFormat(tokens) {
|
|
4935
4944
|
const dateParts = tokens.filter((token) => token.type === "DATE_PART");
|
|
@@ -4972,6 +4981,9 @@ function internalFormatPartToFormat(internalFormat) {
|
|
|
4972
4981
|
case "REPEATED_CHAR":
|
|
4973
4982
|
format += "*" + token.value;
|
|
4974
4983
|
break;
|
|
4984
|
+
case "DATE_PART":
|
|
4985
|
+
format += token.value === "MM" ? "mm" : token.value; // Convert "MM" back to "mm" for minutes
|
|
4986
|
+
break;
|
|
4975
4987
|
default:
|
|
4976
4988
|
format += token.value;
|
|
4977
4989
|
}
|
|
@@ -15099,8 +15111,9 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
|
15099
15111
|
}
|
|
15100
15112
|
|
|
15101
15113
|
function sortMatrix(matrix, locale, ...criteria) {
|
|
15102
|
-
for (
|
|
15103
|
-
|
|
15114
|
+
for (let i = 0; i < criteria.length; i++) {
|
|
15115
|
+
const param = i % 2 === 0 ? "sort_column" : "is_ascending";
|
|
15116
|
+
assert(() => criteria[i] !== undefined, _t("Value for parameter %s is missing in [[FUNCTION_NAME]].", param));
|
|
15104
15117
|
}
|
|
15105
15118
|
const sortingOrders = [];
|
|
15106
15119
|
const sortColumns = [];
|
|
@@ -43465,7 +43478,7 @@ class PivotMeasureEditor extends owl.Component {
|
|
|
43465
43478
|
});
|
|
43466
43479
|
}
|
|
43467
43480
|
get isCalculatedMeasureInvalid() {
|
|
43468
|
-
return
|
|
43481
|
+
return compile(this.props.measure.computedBy?.formula ?? "").isBadExpression;
|
|
43469
43482
|
}
|
|
43470
43483
|
}
|
|
43471
43484
|
|
|
@@ -43660,12 +43673,13 @@ class PivotLayoutConfigurator extends owl.Component {
|
|
|
43660
43673
|
addCalculatedMeasure() {
|
|
43661
43674
|
const { measures } = this.props.definition;
|
|
43662
43675
|
const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
|
|
43676
|
+
const aggregator = "sum";
|
|
43663
43677
|
this.props.onDimensionsUpdated({
|
|
43664
43678
|
measures: measures.concat([
|
|
43665
43679
|
{
|
|
43666
|
-
id: this.getMeasureId(measureName),
|
|
43680
|
+
id: this.getMeasureId(measureName, aggregator),
|
|
43667
43681
|
fieldName: measureName,
|
|
43668
|
-
aggregator
|
|
43682
|
+
aggregator,
|
|
43669
43683
|
computedBy: {
|
|
43670
43684
|
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
43671
43685
|
formula: "=0",
|
|
@@ -54037,7 +54051,7 @@ class HeaderSizePlugin extends CorePlugin {
|
|
|
54037
54051
|
let sizes = [...this.sizes[cmd.sheetId][cmd.dimension]];
|
|
54038
54052
|
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
54039
54053
|
const baseSize = sizes[cmd.base];
|
|
54040
|
-
sizes
|
|
54054
|
+
sizes = insertItemsAtIndex(sizes, Array(cmd.quantity).fill(baseSize), addIndex);
|
|
54041
54055
|
this.history.update("sizes", cmd.sheetId, cmd.dimension, sizes);
|
|
54042
54056
|
break;
|
|
54043
54057
|
}
|
|
@@ -54189,9 +54203,8 @@ class HeaderVisibilityPlugin extends CorePlugin {
|
|
|
54189
54203
|
break;
|
|
54190
54204
|
}
|
|
54191
54205
|
case "ADD_COLUMNS_ROWS": {
|
|
54192
|
-
const hiddenHeaders = [...this.hiddenHeaders[cmd.sheetId][cmd.dimension]];
|
|
54193
54206
|
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
54194
|
-
hiddenHeaders.
|
|
54207
|
+
const hiddenHeaders = insertItemsAtIndex([...this.hiddenHeaders[cmd.sheetId][cmd.dimension]], Array(cmd.quantity).fill(false), addIndex);
|
|
54195
54208
|
this.history.update("hiddenHeaders", cmd.sheetId, cmd.dimension, hiddenHeaders);
|
|
54196
54209
|
break;
|
|
54197
54210
|
}
|
|
@@ -58448,12 +58461,12 @@ class SpreadsheetRTree {
|
|
|
58448
58461
|
this.rTrees[sheetId].remove(item, this.rtreeItemComparer);
|
|
58449
58462
|
}
|
|
58450
58463
|
rtreeItemComparer(left, right) {
|
|
58451
|
-
return (left.
|
|
58452
|
-
left.boundingBox.sheetId === right.boundingBox.sheetId &&
|
|
58464
|
+
return (left.boundingBox.sheetId === right.boundingBox.sheetId &&
|
|
58453
58465
|
left.boundingBox?.zone.left === right.boundingBox.zone.left &&
|
|
58454
58466
|
left.boundingBox?.zone.top === right.boundingBox.zone.top &&
|
|
58455
58467
|
left.boundingBox?.zone.right === right.boundingBox.zone.right &&
|
|
58456
|
-
left.boundingBox?.zone.bottom === right.boundingBox.zone.bottom
|
|
58468
|
+
left.boundingBox?.zone.bottom === right.boundingBox.zone.bottom &&
|
|
58469
|
+
deepEquals(left.data, right.data));
|
|
58457
58470
|
}
|
|
58458
58471
|
}
|
|
58459
58472
|
/**
|
|
@@ -60728,7 +60741,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
60728
60741
|
return { value: 0 };
|
|
60729
60742
|
}
|
|
60730
60743
|
const { columns, rows } = super.definition;
|
|
60731
|
-
if (columns.length + rows.length !== domain.length) {
|
|
60744
|
+
if (measure.aggregator && columns.length + rows.length !== domain.length) {
|
|
60732
60745
|
const values = this.getValuesToAggregate(measure, domain);
|
|
60733
60746
|
const aggregator = AGGREGATORS_FN[measure.aggregator];
|
|
60734
60747
|
if (!aggregator) {
|
|
@@ -60747,11 +60760,17 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
60747
60760
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
60748
60761
|
const { colDomain } = domainToColRowDomain(this, domain);
|
|
60749
60762
|
const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
|
|
60763
|
+
if (symbolIndex === -1) {
|
|
60764
|
+
return new NotAvailableError();
|
|
60765
|
+
}
|
|
60750
60766
|
return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
|
|
60751
60767
|
}
|
|
60752
60768
|
if (rows.find((row) => row.nameWithGranularity === symbolName)) {
|
|
60753
60769
|
const { rowDomain } = domainToColRowDomain(this, domain);
|
|
60754
60770
|
const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
|
|
60771
|
+
if (symbolIndex === -1) {
|
|
60772
|
+
return new NotAvailableError();
|
|
60773
|
+
}
|
|
60755
60774
|
return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
|
|
60756
60775
|
}
|
|
60757
60776
|
return this.getPivotCellValueAndFormat(symbolName, domain);
|
|
@@ -74729,6 +74748,6 @@ exports.tokenColors = tokenColors;
|
|
|
74729
74748
|
exports.tokenize = tokenize;
|
|
74730
74749
|
|
|
74731
74750
|
|
|
74732
|
-
__info__.version = "18.0.
|
|
74733
|
-
__info__.date = "2025-
|
|
74734
|
-
__info__.hash = "
|
|
74751
|
+
__info__.version = "18.0.46";
|
|
74752
|
+
__info__.date = "2025-10-07T10:00:44.707Z";
|
|
74753
|
+
__info__.hash = "67a1b4a";
|
|
@@ -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.46
|
|
6
|
+
* @date 2025-10-07T10:00:44.707Z
|
|
7
|
+
* @hash 67a1b4a
|
|
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';
|
|
@@ -854,13 +854,22 @@ function memoize(func) {
|
|
|
854
854
|
},
|
|
855
855
|
}[funcName];
|
|
856
856
|
}
|
|
857
|
+
/**
|
|
858
|
+
* Removes the specified indexes from the array.
|
|
859
|
+
* Sparse (empty) elements are transformed to undefined (unless their index is explicitly removed).
|
|
860
|
+
*/
|
|
857
861
|
function removeIndexesFromArray(array, indexes) {
|
|
858
|
-
|
|
862
|
+
const toRemove = new Set(indexes);
|
|
863
|
+
const newArray = [];
|
|
864
|
+
for (let i = 0; i < array.length; i++) {
|
|
865
|
+
if (!toRemove.has(i)) {
|
|
866
|
+
newArray.push(array[i]);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
return newArray;
|
|
859
870
|
}
|
|
860
871
|
function insertItemsAtIndex(array, items, index) {
|
|
861
|
-
|
|
862
|
-
newArray.splice(index, 0, ...items);
|
|
863
|
-
return newArray;
|
|
872
|
+
return array.slice(0, index).concat(items).concat(array.slice(index));
|
|
864
873
|
}
|
|
865
874
|
function replaceItemAtIndex(array, newItem, index) {
|
|
866
875
|
const newArray = [...array];
|
|
@@ -4927,7 +4936,7 @@ function tokensToTextInternalFormat(tokens) {
|
|
|
4927
4936
|
* Replace in place tokens "mm" and "m" that denote minutes in date format with "MM" to avoid confusion with months.
|
|
4928
4937
|
*
|
|
4929
4938
|
* As per OpenXML specification, in date formats if a date token "m" or "mm" is followed by a date token "s" or
|
|
4930
|
-
* preceded by a data token "h", then it's not a month but
|
|
4939
|
+
* preceded by a data token "h", then it's not a month but a minute.
|
|
4931
4940
|
*/
|
|
4932
4941
|
function convertTokensToMinutesInDateFormat(tokens) {
|
|
4933
4942
|
const dateParts = tokens.filter((token) => token.type === "DATE_PART");
|
|
@@ -4970,6 +4979,9 @@ function internalFormatPartToFormat(internalFormat) {
|
|
|
4970
4979
|
case "REPEATED_CHAR":
|
|
4971
4980
|
format += "*" + token.value;
|
|
4972
4981
|
break;
|
|
4982
|
+
case "DATE_PART":
|
|
4983
|
+
format += token.value === "MM" ? "mm" : token.value; // Convert "MM" back to "mm" for minutes
|
|
4984
|
+
break;
|
|
4973
4985
|
default:
|
|
4974
4986
|
format += token.value;
|
|
4975
4987
|
}
|
|
@@ -15097,8 +15109,9 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
|
15097
15109
|
}
|
|
15098
15110
|
|
|
15099
15111
|
function sortMatrix(matrix, locale, ...criteria) {
|
|
15100
|
-
for (
|
|
15101
|
-
|
|
15112
|
+
for (let i = 0; i < criteria.length; i++) {
|
|
15113
|
+
const param = i % 2 === 0 ? "sort_column" : "is_ascending";
|
|
15114
|
+
assert(() => criteria[i] !== undefined, _t("Value for parameter %s is missing in [[FUNCTION_NAME]].", param));
|
|
15102
15115
|
}
|
|
15103
15116
|
const sortingOrders = [];
|
|
15104
15117
|
const sortColumns = [];
|
|
@@ -43463,7 +43476,7 @@ class PivotMeasureEditor extends Component {
|
|
|
43463
43476
|
});
|
|
43464
43477
|
}
|
|
43465
43478
|
get isCalculatedMeasureInvalid() {
|
|
43466
|
-
return
|
|
43479
|
+
return compile(this.props.measure.computedBy?.formula ?? "").isBadExpression;
|
|
43467
43480
|
}
|
|
43468
43481
|
}
|
|
43469
43482
|
|
|
@@ -43658,12 +43671,13 @@ class PivotLayoutConfigurator extends Component {
|
|
|
43658
43671
|
addCalculatedMeasure() {
|
|
43659
43672
|
const { measures } = this.props.definition;
|
|
43660
43673
|
const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
|
|
43674
|
+
const aggregator = "sum";
|
|
43661
43675
|
this.props.onDimensionsUpdated({
|
|
43662
43676
|
measures: measures.concat([
|
|
43663
43677
|
{
|
|
43664
|
-
id: this.getMeasureId(measureName),
|
|
43678
|
+
id: this.getMeasureId(measureName, aggregator),
|
|
43665
43679
|
fieldName: measureName,
|
|
43666
|
-
aggregator
|
|
43680
|
+
aggregator,
|
|
43667
43681
|
computedBy: {
|
|
43668
43682
|
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
43669
43683
|
formula: "=0",
|
|
@@ -54035,7 +54049,7 @@ class HeaderSizePlugin extends CorePlugin {
|
|
|
54035
54049
|
let sizes = [...this.sizes[cmd.sheetId][cmd.dimension]];
|
|
54036
54050
|
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
54037
54051
|
const baseSize = sizes[cmd.base];
|
|
54038
|
-
sizes
|
|
54052
|
+
sizes = insertItemsAtIndex(sizes, Array(cmd.quantity).fill(baseSize), addIndex);
|
|
54039
54053
|
this.history.update("sizes", cmd.sheetId, cmd.dimension, sizes);
|
|
54040
54054
|
break;
|
|
54041
54055
|
}
|
|
@@ -54187,9 +54201,8 @@ class HeaderVisibilityPlugin extends CorePlugin {
|
|
|
54187
54201
|
break;
|
|
54188
54202
|
}
|
|
54189
54203
|
case "ADD_COLUMNS_ROWS": {
|
|
54190
|
-
const hiddenHeaders = [...this.hiddenHeaders[cmd.sheetId][cmd.dimension]];
|
|
54191
54204
|
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
54192
|
-
hiddenHeaders.
|
|
54205
|
+
const hiddenHeaders = insertItemsAtIndex([...this.hiddenHeaders[cmd.sheetId][cmd.dimension]], Array(cmd.quantity).fill(false), addIndex);
|
|
54193
54206
|
this.history.update("hiddenHeaders", cmd.sheetId, cmd.dimension, hiddenHeaders);
|
|
54194
54207
|
break;
|
|
54195
54208
|
}
|
|
@@ -58446,12 +58459,12 @@ class SpreadsheetRTree {
|
|
|
58446
58459
|
this.rTrees[sheetId].remove(item, this.rtreeItemComparer);
|
|
58447
58460
|
}
|
|
58448
58461
|
rtreeItemComparer(left, right) {
|
|
58449
|
-
return (left.
|
|
58450
|
-
left.boundingBox.sheetId === right.boundingBox.sheetId &&
|
|
58462
|
+
return (left.boundingBox.sheetId === right.boundingBox.sheetId &&
|
|
58451
58463
|
left.boundingBox?.zone.left === right.boundingBox.zone.left &&
|
|
58452
58464
|
left.boundingBox?.zone.top === right.boundingBox.zone.top &&
|
|
58453
58465
|
left.boundingBox?.zone.right === right.boundingBox.zone.right &&
|
|
58454
|
-
left.boundingBox?.zone.bottom === right.boundingBox.zone.bottom
|
|
58466
|
+
left.boundingBox?.zone.bottom === right.boundingBox.zone.bottom &&
|
|
58467
|
+
deepEquals(left.data, right.data));
|
|
58455
58468
|
}
|
|
58456
58469
|
}
|
|
58457
58470
|
/**
|
|
@@ -60726,7 +60739,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
60726
60739
|
return { value: 0 };
|
|
60727
60740
|
}
|
|
60728
60741
|
const { columns, rows } = super.definition;
|
|
60729
|
-
if (columns.length + rows.length !== domain.length) {
|
|
60742
|
+
if (measure.aggregator && columns.length + rows.length !== domain.length) {
|
|
60730
60743
|
const values = this.getValuesToAggregate(measure, domain);
|
|
60731
60744
|
const aggregator = AGGREGATORS_FN[measure.aggregator];
|
|
60732
60745
|
if (!aggregator) {
|
|
@@ -60745,11 +60758,17 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
60745
60758
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
60746
60759
|
const { colDomain } = domainToColRowDomain(this, domain);
|
|
60747
60760
|
const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
|
|
60761
|
+
if (symbolIndex === -1) {
|
|
60762
|
+
return new NotAvailableError();
|
|
60763
|
+
}
|
|
60748
60764
|
return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
|
|
60749
60765
|
}
|
|
60750
60766
|
if (rows.find((row) => row.nameWithGranularity === symbolName)) {
|
|
60751
60767
|
const { rowDomain } = domainToColRowDomain(this, domain);
|
|
60752
60768
|
const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
|
|
60769
|
+
if (symbolIndex === -1) {
|
|
60770
|
+
return new NotAvailableError();
|
|
60771
|
+
}
|
|
60753
60772
|
return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
|
|
60754
60773
|
}
|
|
60755
60774
|
return this.getPivotCellValueAndFormat(symbolName, domain);
|
|
@@ -74684,6 +74703,6 @@ const constants = {
|
|
|
74684
74703
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, 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 };
|
|
74685
74704
|
|
|
74686
74705
|
|
|
74687
|
-
__info__.version = "18.0.
|
|
74688
|
-
__info__.date = "2025-
|
|
74689
|
-
__info__.hash = "
|
|
74706
|
+
__info__.version = "18.0.46";
|
|
74707
|
+
__info__.date = "2025-10-07T10:00:44.707Z";
|
|
74708
|
+
__info__.hash = "67a1b4a";
|
|
@@ -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.46
|
|
6
|
+
* @date 2025-10-07T10:00:44.707Z
|
|
7
|
+
* @hash 67a1b4a
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -855,13 +855,22 @@
|
|
|
855
855
|
},
|
|
856
856
|
}[funcName];
|
|
857
857
|
}
|
|
858
|
+
/**
|
|
859
|
+
* Removes the specified indexes from the array.
|
|
860
|
+
* Sparse (empty) elements are transformed to undefined (unless their index is explicitly removed).
|
|
861
|
+
*/
|
|
858
862
|
function removeIndexesFromArray(array, indexes) {
|
|
859
|
-
|
|
863
|
+
const toRemove = new Set(indexes);
|
|
864
|
+
const newArray = [];
|
|
865
|
+
for (let i = 0; i < array.length; i++) {
|
|
866
|
+
if (!toRemove.has(i)) {
|
|
867
|
+
newArray.push(array[i]);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
return newArray;
|
|
860
871
|
}
|
|
861
872
|
function insertItemsAtIndex(array, items, index) {
|
|
862
|
-
|
|
863
|
-
newArray.splice(index, 0, ...items);
|
|
864
|
-
return newArray;
|
|
873
|
+
return array.slice(0, index).concat(items).concat(array.slice(index));
|
|
865
874
|
}
|
|
866
875
|
function replaceItemAtIndex(array, newItem, index) {
|
|
867
876
|
const newArray = [...array];
|
|
@@ -4928,7 +4937,7 @@
|
|
|
4928
4937
|
* Replace in place tokens "mm" and "m" that denote minutes in date format with "MM" to avoid confusion with months.
|
|
4929
4938
|
*
|
|
4930
4939
|
* As per OpenXML specification, in date formats if a date token "m" or "mm" is followed by a date token "s" or
|
|
4931
|
-
* preceded by a data token "h", then it's not a month but
|
|
4940
|
+
* preceded by a data token "h", then it's not a month but a minute.
|
|
4932
4941
|
*/
|
|
4933
4942
|
function convertTokensToMinutesInDateFormat(tokens) {
|
|
4934
4943
|
const dateParts = tokens.filter((token) => token.type === "DATE_PART");
|
|
@@ -4971,6 +4980,9 @@
|
|
|
4971
4980
|
case "REPEATED_CHAR":
|
|
4972
4981
|
format += "*" + token.value;
|
|
4973
4982
|
break;
|
|
4983
|
+
case "DATE_PART":
|
|
4984
|
+
format += token.value === "MM" ? "mm" : token.value; // Convert "MM" back to "mm" for minutes
|
|
4985
|
+
break;
|
|
4974
4986
|
default:
|
|
4975
4987
|
format += token.value;
|
|
4976
4988
|
}
|
|
@@ -15098,8 +15110,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15098
15110
|
}
|
|
15099
15111
|
|
|
15100
15112
|
function sortMatrix(matrix, locale, ...criteria) {
|
|
15101
|
-
for (
|
|
15102
|
-
|
|
15113
|
+
for (let i = 0; i < criteria.length; i++) {
|
|
15114
|
+
const param = i % 2 === 0 ? "sort_column" : "is_ascending";
|
|
15115
|
+
assert(() => criteria[i] !== undefined, _t("Value for parameter %s is missing in [[FUNCTION_NAME]].", param));
|
|
15103
15116
|
}
|
|
15104
15117
|
const sortingOrders = [];
|
|
15105
15118
|
const sortColumns = [];
|
|
@@ -43464,7 +43477,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43464
43477
|
});
|
|
43465
43478
|
}
|
|
43466
43479
|
get isCalculatedMeasureInvalid() {
|
|
43467
|
-
return
|
|
43480
|
+
return compile(this.props.measure.computedBy?.formula ?? "").isBadExpression;
|
|
43468
43481
|
}
|
|
43469
43482
|
}
|
|
43470
43483
|
|
|
@@ -43659,12 +43672,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43659
43672
|
addCalculatedMeasure() {
|
|
43660
43673
|
const { measures } = this.props.definition;
|
|
43661
43674
|
const measureName = this.env.model.getters.generateNewCalculatedMeasureName(measures);
|
|
43675
|
+
const aggregator = "sum";
|
|
43662
43676
|
this.props.onDimensionsUpdated({
|
|
43663
43677
|
measures: measures.concat([
|
|
43664
43678
|
{
|
|
43665
|
-
id: this.getMeasureId(measureName),
|
|
43679
|
+
id: this.getMeasureId(measureName, aggregator),
|
|
43666
43680
|
fieldName: measureName,
|
|
43667
|
-
aggregator
|
|
43681
|
+
aggregator,
|
|
43668
43682
|
computedBy: {
|
|
43669
43683
|
sheetId: this.env.model.getters.getActiveSheetId(),
|
|
43670
43684
|
formula: "=0",
|
|
@@ -54036,7 +54050,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
54036
54050
|
let sizes = [...this.sizes[cmd.sheetId][cmd.dimension]];
|
|
54037
54051
|
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
54038
54052
|
const baseSize = sizes[cmd.base];
|
|
54039
|
-
sizes
|
|
54053
|
+
sizes = insertItemsAtIndex(sizes, Array(cmd.quantity).fill(baseSize), addIndex);
|
|
54040
54054
|
this.history.update("sizes", cmd.sheetId, cmd.dimension, sizes);
|
|
54041
54055
|
break;
|
|
54042
54056
|
}
|
|
@@ -54188,9 +54202,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
54188
54202
|
break;
|
|
54189
54203
|
}
|
|
54190
54204
|
case "ADD_COLUMNS_ROWS": {
|
|
54191
|
-
const hiddenHeaders = [...this.hiddenHeaders[cmd.sheetId][cmd.dimension]];
|
|
54192
54205
|
const addIndex = getAddHeaderStartIndex(cmd.position, cmd.base);
|
|
54193
|
-
hiddenHeaders.
|
|
54206
|
+
const hiddenHeaders = insertItemsAtIndex([...this.hiddenHeaders[cmd.sheetId][cmd.dimension]], Array(cmd.quantity).fill(false), addIndex);
|
|
54194
54207
|
this.history.update("hiddenHeaders", cmd.sheetId, cmd.dimension, hiddenHeaders);
|
|
54195
54208
|
break;
|
|
54196
54209
|
}
|
|
@@ -58447,12 +58460,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
58447
58460
|
this.rTrees[sheetId].remove(item, this.rtreeItemComparer);
|
|
58448
58461
|
}
|
|
58449
58462
|
rtreeItemComparer(left, right) {
|
|
58450
|
-
return (left.
|
|
58451
|
-
left.boundingBox.sheetId === right.boundingBox.sheetId &&
|
|
58463
|
+
return (left.boundingBox.sheetId === right.boundingBox.sheetId &&
|
|
58452
58464
|
left.boundingBox?.zone.left === right.boundingBox.zone.left &&
|
|
58453
58465
|
left.boundingBox?.zone.top === right.boundingBox.zone.top &&
|
|
58454
58466
|
left.boundingBox?.zone.right === right.boundingBox.zone.right &&
|
|
58455
|
-
left.boundingBox?.zone.bottom === right.boundingBox.zone.bottom
|
|
58467
|
+
left.boundingBox?.zone.bottom === right.boundingBox.zone.bottom &&
|
|
58468
|
+
deepEquals(left.data, right.data));
|
|
58456
58469
|
}
|
|
58457
58470
|
}
|
|
58458
58471
|
/**
|
|
@@ -60727,7 +60740,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60727
60740
|
return { value: 0 };
|
|
60728
60741
|
}
|
|
60729
60742
|
const { columns, rows } = super.definition;
|
|
60730
|
-
if (columns.length + rows.length !== domain.length) {
|
|
60743
|
+
if (measure.aggregator && columns.length + rows.length !== domain.length) {
|
|
60731
60744
|
const values = this.getValuesToAggregate(measure, domain);
|
|
60732
60745
|
const aggregator = AGGREGATORS_FN[measure.aggregator];
|
|
60733
60746
|
if (!aggregator) {
|
|
@@ -60746,11 +60759,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60746
60759
|
if (columns.find((col) => col.nameWithGranularity === symbolName)) {
|
|
60747
60760
|
const { colDomain } = domainToColRowDomain(this, domain);
|
|
60748
60761
|
const symbolIndex = colDomain.findIndex((node) => node.field === symbolName);
|
|
60762
|
+
if (symbolIndex === -1) {
|
|
60763
|
+
return new NotAvailableError();
|
|
60764
|
+
}
|
|
60749
60765
|
return this.getPivotHeaderValueAndFormat(colDomain.slice(0, symbolIndex + 1));
|
|
60750
60766
|
}
|
|
60751
60767
|
if (rows.find((row) => row.nameWithGranularity === symbolName)) {
|
|
60752
60768
|
const { rowDomain } = domainToColRowDomain(this, domain);
|
|
60753
60769
|
const symbolIndex = rowDomain.findIndex((row) => row.field === symbolName);
|
|
60770
|
+
if (symbolIndex === -1) {
|
|
60771
|
+
return new NotAvailableError();
|
|
60772
|
+
}
|
|
60754
60773
|
return this.getPivotHeaderValueAndFormat(rowDomain.slice(0, symbolIndex + 1));
|
|
60755
60774
|
}
|
|
60756
60775
|
return this.getPivotCellValueAndFormat(symbolName, domain);
|
|
@@ -74728,9 +74747,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
74728
74747
|
exports.tokenize = tokenize;
|
|
74729
74748
|
|
|
74730
74749
|
|
|
74731
|
-
__info__.version = "18.0.
|
|
74732
|
-
__info__.date = "2025-
|
|
74733
|
-
__info__.hash = "
|
|
74750
|
+
__info__.version = "18.0.46";
|
|
74751
|
+
__info__.date = "2025-10-07T10:00:44.707Z";
|
|
74752
|
+
__info__.hash = "67a1b4a";
|
|
74734
74753
|
|
|
74735
74754
|
|
|
74736
74755
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|