@odoo/o-spreadsheet 18.1.0-alpha.5 → 18.1.0-alpha.6
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 +59 -75
- package/dist/o-spreadsheet.d.ts +249 -132
- package/dist/o-spreadsheet.esm.js +59 -75
- package/dist/o-spreadsheet.iife.js +59 -75
- package/dist/o-spreadsheet.iife.min.js +373 -373
- package/dist/o_spreadsheet.xml +8 -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 18.1.0-alpha.
|
|
6
|
-
* @date 2024-11-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.1.0-alpha.6
|
|
6
|
+
* @date 2024-11-28T09:06:59.527Z
|
|
7
|
+
* @hash 875c901
|
|
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';
|
|
@@ -3496,7 +3496,9 @@ var CommandResult;
|
|
|
3496
3496
|
CommandResult["MaxInvalidFormula"] = "MaxInvalidFormula";
|
|
3497
3497
|
CommandResult["ValueUpperInvalidFormula"] = "ValueUpperInvalidFormula";
|
|
3498
3498
|
CommandResult["ValueLowerInvalidFormula"] = "ValueLowerInvalidFormula";
|
|
3499
|
+
CommandResult["InvalidSortAnchor"] = "InvalidSortAnchor";
|
|
3499
3500
|
CommandResult["InvalidSortZone"] = "InvalidSortZone";
|
|
3501
|
+
CommandResult["SortZoneWithArrayFormulas"] = "SortZoneWithArrayFormulas";
|
|
3500
3502
|
CommandResult["WaitingSessionConfirmation"] = "WaitingSessionConfirmation";
|
|
3501
3503
|
CommandResult["MergeOverlap"] = "MergeOverlap";
|
|
3502
3504
|
CommandResult["TooManyHiddenElements"] = "TooManyHiddenElements";
|
|
@@ -3552,7 +3554,6 @@ var CommandResult;
|
|
|
3552
3554
|
CommandResult["ValueCellIsInvalidFormula"] = "ValueCellIsInvalidFormula";
|
|
3553
3555
|
CommandResult["InvalidDefinition"] = "InvalidDefinition";
|
|
3554
3556
|
CommandResult["InvalidColor"] = "InvalidColor";
|
|
3555
|
-
CommandResult["DataBarRangeValuesMismatch"] = "DataBarRangeValuesMismatch";
|
|
3556
3557
|
})(CommandResult || (CommandResult = {}));
|
|
3557
3558
|
|
|
3558
3559
|
const DEFAULT_LOCALES = [
|
|
@@ -14669,7 +14670,6 @@ function sortCells(cells, sortDirection, emptyCellAsZero) {
|
|
|
14669
14670
|
return cellsToSort.sort(cellsSortingCriterion(sortDirection));
|
|
14670
14671
|
}
|
|
14671
14672
|
function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
14672
|
-
let result = DispatchResult.Success;
|
|
14673
14673
|
//several columns => bypass the contiguity check
|
|
14674
14674
|
let multiColumns = zone.right > zone.left;
|
|
14675
14675
|
if (env.model.getters.doesIntersectMerge(sheetId, zone)) {
|
|
@@ -14689,49 +14689,37 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
|
14689
14689
|
}
|
|
14690
14690
|
}
|
|
14691
14691
|
}
|
|
14692
|
-
const { col, row } = anchor;
|
|
14693
14692
|
if (multiColumns) {
|
|
14694
|
-
|
|
14693
|
+
interactiveSort(env, sheetId, anchor, zone, sortDirection);
|
|
14694
|
+
return;
|
|
14695
|
+
}
|
|
14696
|
+
const contiguousZone = env.model.getters.getContiguousZone(sheetId, zone);
|
|
14697
|
+
if (isEqual(contiguousZone, zone)) {
|
|
14698
|
+
interactiveSort(env, sheetId, anchor, zone, sortDirection);
|
|
14695
14699
|
}
|
|
14696
14700
|
else {
|
|
14697
|
-
|
|
14698
|
-
const contiguousZone = env.model.getters.getContiguousZone(sheetId, zone);
|
|
14699
|
-
if (isEqual(contiguousZone, zone)) {
|
|
14700
|
-
// merge as it is
|
|
14701
|
-
result = env.model.dispatch("SORT_CELLS", {
|
|
14702
|
-
sheetId,
|
|
14703
|
-
col,
|
|
14704
|
-
row,
|
|
14705
|
-
zone,
|
|
14706
|
-
sortDirection,
|
|
14707
|
-
});
|
|
14708
|
-
}
|
|
14709
|
-
else {
|
|
14710
|
-
env.askConfirmation(_t("We found data next to your selection. Since this data was not selected, it will not be sorted. Do you want to extend your selection?"), () => {
|
|
14711
|
-
zone = contiguousZone;
|
|
14712
|
-
result = env.model.dispatch("SORT_CELLS", {
|
|
14713
|
-
sheetId,
|
|
14714
|
-
col,
|
|
14715
|
-
row,
|
|
14716
|
-
zone,
|
|
14717
|
-
sortDirection,
|
|
14718
|
-
});
|
|
14719
|
-
}, () => {
|
|
14720
|
-
result = env.model.dispatch("SORT_CELLS", {
|
|
14721
|
-
sheetId,
|
|
14722
|
-
col,
|
|
14723
|
-
row,
|
|
14724
|
-
zone,
|
|
14725
|
-
sortDirection,
|
|
14726
|
-
});
|
|
14727
|
-
});
|
|
14728
|
-
}
|
|
14701
|
+
env.askConfirmation(_t("We found data next to your selection. Since this data was not selected, it will not be sorted. Do you want to extend your selection?"), () => interactiveSort(env, sheetId, anchor, contiguousZone, sortDirection), () => interactiveSort(env, sheetId, anchor, zone, sortDirection));
|
|
14729
14702
|
}
|
|
14703
|
+
}
|
|
14704
|
+
function interactiveSort(env, sheetId, anchor, zone, sortDirection, sortOptions) {
|
|
14705
|
+
const result = env.model.dispatch("SORT_CELLS", {
|
|
14706
|
+
sheetId,
|
|
14707
|
+
col: anchor.col,
|
|
14708
|
+
row: anchor.row,
|
|
14709
|
+
zone,
|
|
14710
|
+
sortDirection,
|
|
14711
|
+
sortOptions,
|
|
14712
|
+
});
|
|
14730
14713
|
if (result.isCancelledBecause("InvalidSortZone" /* CommandResult.InvalidSortZone */)) {
|
|
14731
14714
|
const { col, row } = anchor;
|
|
14732
14715
|
env.model.selection.selectZone({ cell: { col, row }, zone });
|
|
14733
14716
|
env.raiseError(_t("Cannot sort. To sort, select only cells or only merges that have the same size."));
|
|
14734
14717
|
}
|
|
14718
|
+
if (result.isCancelledBecause("SortZoneWithArrayFormulas" /* CommandResult.SortZoneWithArrayFormulas */)) {
|
|
14719
|
+
const { col, row } = anchor;
|
|
14720
|
+
env.model.selection.selectZone({ cell: { col, row }, zone });
|
|
14721
|
+
env.raiseError(_t("Cannot sort a zone with array formulas."));
|
|
14722
|
+
}
|
|
14735
14723
|
}
|
|
14736
14724
|
|
|
14737
14725
|
function sortMatrix(matrix, locale, ...criteria) {
|
|
@@ -27719,7 +27707,6 @@ const CfTerms = {
|
|
|
27719
27707
|
["ValueLowerInvalidFormula" /* CommandResult.ValueLowerInvalidFormula */]: _t("Invalid lower inflection point formula"),
|
|
27720
27708
|
["EmptyRange" /* CommandResult.EmptyRange */]: _t("A range needs to be defined"),
|
|
27721
27709
|
["ValueCellIsInvalidFormula" /* CommandResult.ValueCellIsInvalidFormula */]: _t("At least one of the provided values is an invalid formula"),
|
|
27722
|
-
["DataBarRangeValuesMismatch" /* CommandResult.DataBarRangeValuesMismatch */]: _t("All the ranges and the range values must have the same size"),
|
|
27723
27710
|
Unexpected: _t("The rule is invalid for an unknown reason"),
|
|
27724
27711
|
},
|
|
27725
27712
|
ColorScale: _t("Color scale"),
|
|
@@ -29093,20 +29080,27 @@ function getWaterfallChartScales(definition, args) {
|
|
|
29093
29080
|
return scales;
|
|
29094
29081
|
}
|
|
29095
29082
|
function getPyramidChartScales(definition, args) {
|
|
29083
|
+
const { dataSetsValues } = args;
|
|
29096
29084
|
const scales = getBarChartScales(definition, args);
|
|
29097
29085
|
const scalesXCallback = scales.x.ticks.callback;
|
|
29098
29086
|
scales.x.ticks.callback = (value) => scalesXCallback(Math.abs(value));
|
|
29087
|
+
const maxValue = Math.max(...dataSetsValues.map((dataSet) => Math.max(...dataSet.data.map(Math.abs))));
|
|
29088
|
+
scales.x.suggestedMin = -maxValue;
|
|
29089
|
+
scales.x.suggestedMax = maxValue;
|
|
29099
29090
|
return scales;
|
|
29100
29091
|
}
|
|
29101
29092
|
function getRadarChartScales(definition, args) {
|
|
29102
|
-
const { locale, axisFormats } = args;
|
|
29093
|
+
const { locale, axisFormats, dataSetsValues } = args;
|
|
29094
|
+
const minValue = Math.min(...dataSetsValues.map((ds) => Math.min(...ds.data.filter((x) => !isNaN(x)))));
|
|
29103
29095
|
return {
|
|
29104
29096
|
r: {
|
|
29097
|
+
beginAtZero: true,
|
|
29105
29098
|
ticks: {
|
|
29106
29099
|
callback: formatTickValue({ format: axisFormats?.r, locale }),
|
|
29107
29100
|
backdropColor: definition.background || "#FFFFFF",
|
|
29108
29101
|
},
|
|
29109
29102
|
pointLabels: { color: chartFontColor(definition.background) },
|
|
29103
|
+
suggestedMin: minValue < 0 ? minValue - 1 : 0,
|
|
29110
29104
|
},
|
|
29111
29105
|
};
|
|
29112
29106
|
}
|
|
@@ -32207,14 +32201,9 @@ class FilterMenu extends Component {
|
|
|
32207
32201
|
}
|
|
32208
32202
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
32209
32203
|
const contentZone = { ...tableZone, top: tableZone.top + 1 };
|
|
32210
|
-
|
|
32211
|
-
|
|
32212
|
-
|
|
32213
|
-
row: contentZone.top,
|
|
32214
|
-
zone: contentZone,
|
|
32215
|
-
sortDirection,
|
|
32216
|
-
sortOptions: { emptyCellAsZero: true, sortHeaders: true },
|
|
32217
|
-
});
|
|
32204
|
+
const sortAnchor = { col: filterPosition.col, row: contentZone.top };
|
|
32205
|
+
const sortOptions = { emptyCellAsZero: true, sortHeaders: true };
|
|
32206
|
+
interactiveSort(this.env, sheetId, sortAnchor, contentZone, sortDirection, sortOptions);
|
|
32218
32207
|
this.props.onClosed?.();
|
|
32219
32208
|
}
|
|
32220
32209
|
}
|
|
@@ -34230,6 +34219,7 @@ const pivotProperties = {
|
|
|
34230
34219
|
const pivotId = env.model.getters.getPivotIdFromPosition(position);
|
|
34231
34220
|
return (pivotId && env.model.getters.isExistingPivot(pivotId)) || false;
|
|
34232
34221
|
},
|
|
34222
|
+
isReadonlyAllowed: true,
|
|
34233
34223
|
icon: "o-spreadsheet-Icon.PIVOT",
|
|
34234
34224
|
};
|
|
34235
34225
|
const FIX_FORMULAS = {
|
|
@@ -35947,6 +35937,7 @@ topbarMenuRegistry
|
|
|
35947
35937
|
id: `item_pivot_${env.model.getters.getPivotFormulaId(pivotId)}`,
|
|
35948
35938
|
name: env.model.getters.getPivotDisplayName(pivotId),
|
|
35949
35939
|
sequence: sequence + index,
|
|
35940
|
+
isReadonlyAllowed: true,
|
|
35950
35941
|
execute: (env) => env.openSidePanel("PivotSidePanel", { pivotId }),
|
|
35951
35942
|
onStartHover: (env) => env.getStore(HighlightStore).register(highlightProvider),
|
|
35952
35943
|
onStopHover: (env) => env.getStore(HighlightStore).unRegister(highlightProvider),
|
|
@@ -52902,8 +52893,6 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
52902
52893
|
case "IconSetRule": {
|
|
52903
52894
|
return this.checkValidations(rule, this.chainValidations(this.checkInflectionPoints(this.checkNaN), this.checkLowerBiggerThanUpper), this.chainValidations(this.checkInflectionPoints(this.checkFormulaCompilation)));
|
|
52904
52895
|
}
|
|
52905
|
-
case "DataBarRule":
|
|
52906
|
-
return this.checkDataBarRangeValues(rule, cmd.ranges, cmd.sheetId);
|
|
52907
52896
|
}
|
|
52908
52897
|
return "Success" /* CommandResult.Success */;
|
|
52909
52898
|
}
|
|
@@ -53034,18 +53023,6 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
53034
53023
|
}
|
|
53035
53024
|
return "Success" /* CommandResult.Success */;
|
|
53036
53025
|
}
|
|
53037
|
-
checkDataBarRangeValues(rule, ranges, sheetId) {
|
|
53038
|
-
if (rule.rangeValues) {
|
|
53039
|
-
const { numberOfCols, numberOfRows } = zoneToDimension(this.getters.getRangeFromSheetXC(sheetId, rule.rangeValues).zone);
|
|
53040
|
-
for (const range of ranges) {
|
|
53041
|
-
const dimensions = zoneToDimension(this.getters.getRangeFromRangeData(range).zone);
|
|
53042
|
-
if (numberOfCols !== dimensions.numberOfCols || numberOfRows !== dimensions.numberOfRows) {
|
|
53043
|
-
return "DataBarRangeValuesMismatch" /* CommandResult.DataBarRangeValuesMismatch */;
|
|
53044
|
-
}
|
|
53045
|
-
}
|
|
53046
|
-
}
|
|
53047
|
-
return "Success" /* CommandResult.Success */;
|
|
53048
|
-
}
|
|
53049
53026
|
removeConditionalFormatting(id, sheet) {
|
|
53050
53027
|
const cfIndex = this.cfRules[sheet].findIndex((s) => s.id === id);
|
|
53051
53028
|
if (cfIndex !== -1) {
|
|
@@ -59450,8 +59427,12 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
59450
59427
|
const zoneOfValues = rangeValues.zone;
|
|
59451
59428
|
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
59452
59429
|
for (let col = zone.left; col <= zone.right; col++) {
|
|
59453
|
-
const
|
|
59454
|
-
|
|
59430
|
+
const targetCol = col - zone.left + zoneOfValues.left;
|
|
59431
|
+
const targetRow = row - zone.top + zoneOfValues.top;
|
|
59432
|
+
const cell = this.getters.getEvaluatedCell({ sheetId, col: targetCol, row: targetRow });
|
|
59433
|
+
if (!isInside(targetCol, targetRow, zoneOfValues) ||
|
|
59434
|
+
cell.type !== CellValueType.number ||
|
|
59435
|
+
cell.value <= 0) {
|
|
59455
59436
|
// values negatives or 0 are ignored
|
|
59456
59437
|
continue;
|
|
59457
59438
|
}
|
|
@@ -59464,11 +59445,6 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
59464
59445
|
}
|
|
59465
59446
|
}
|
|
59466
59447
|
}
|
|
59467
|
-
getEvaluatedCellInZone(sheetId, zone, col, row, targetZone) {
|
|
59468
|
-
const targetCol = col - zone.left + targetZone.left;
|
|
59469
|
-
const targetRow = row - zone.top + targetZone.top;
|
|
59470
|
-
return this.getters.getEvaluatedCell({ sheetId, col: targetCol, row: targetRow });
|
|
59471
|
-
}
|
|
59472
59448
|
/** Compute the color scale for the given range and CF rule, and apply in in the given computedStyle object */
|
|
59473
59449
|
applyColorScale(sheetId, range, rule, computedStyle) {
|
|
59474
59450
|
const minValue = this.parsePoint(sheetId, range, rule.minimum, "min");
|
|
@@ -63046,9 +63022,9 @@ class SortPlugin extends UIPlugin {
|
|
|
63046
63022
|
switch (cmd.type) {
|
|
63047
63023
|
case "SORT_CELLS":
|
|
63048
63024
|
if (!isInside(cmd.col, cmd.row, cmd.zone)) {
|
|
63049
|
-
|
|
63025
|
+
return "InvalidSortAnchor" /* CommandResult.InvalidSortAnchor */;
|
|
63050
63026
|
}
|
|
63051
|
-
return this.checkValidations(cmd, this.checkMerge, this.checkMergeSizes);
|
|
63027
|
+
return this.checkValidations(cmd, this.checkMerge, this.checkMergeSizes, this.checkArrayFormulaInSortZone);
|
|
63052
63028
|
}
|
|
63053
63029
|
return "Success" /* CommandResult.Success */;
|
|
63054
63030
|
}
|
|
@@ -63089,6 +63065,10 @@ class SortPlugin extends UIPlugin {
|
|
|
63089
63065
|
}
|
|
63090
63066
|
return "Success" /* CommandResult.Success */;
|
|
63091
63067
|
}
|
|
63068
|
+
checkArrayFormulaInSortZone({ sheetId, zone }) {
|
|
63069
|
+
const arrayFormulaInZone = positions(zone).some(({ col, row }) => this.getters.getArrayFormulaSpreadingOn({ sheetId, col, row }));
|
|
63070
|
+
return arrayFormulaInZone ? "SortZoneWithArrayFormulas" /* CommandResult.SortZoneWithArrayFormulas */ : "Success" /* CommandResult.Success */;
|
|
63071
|
+
}
|
|
63092
63072
|
/**
|
|
63093
63073
|
* This function evaluates if the top row of a provided zone can be considered as a `header`
|
|
63094
63074
|
* by checking the following criteria:
|
|
@@ -73690,6 +73670,9 @@ const components = {
|
|
|
73690
73670
|
GaugeChartDesignPanel,
|
|
73691
73671
|
ScorecardChartConfigPanel,
|
|
73692
73672
|
ScorecardChartDesignPanel,
|
|
73673
|
+
RadarChartDesignPanel,
|
|
73674
|
+
WaterfallChartDesignPanel,
|
|
73675
|
+
ComboChartDesignPanel,
|
|
73693
73676
|
ChartTypePicker,
|
|
73694
73677
|
FigureComponent,
|
|
73695
73678
|
Menu,
|
|
@@ -73743,12 +73726,13 @@ const constants = {
|
|
|
73743
73726
|
DEFAULT_LOCALE,
|
|
73744
73727
|
HIGHLIGHT_COLOR,
|
|
73745
73728
|
PIVOT_TABLE_CONFIG,
|
|
73729
|
+
ChartTerms,
|
|
73746
73730
|
};
|
|
73747
73731
|
const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
73748
73732
|
|
|
73749
73733
|
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 };
|
|
73750
73734
|
|
|
73751
73735
|
|
|
73752
|
-
__info__.version = "18.1.0-alpha.
|
|
73753
|
-
__info__.date = "2024-11-
|
|
73754
|
-
__info__.hash = "
|
|
73736
|
+
__info__.version = "18.1.0-alpha.6";
|
|
73737
|
+
__info__.date = "2024-11-28T09:06:59.527Z";
|
|
73738
|
+
__info__.hash = "875c901";
|
|
@@ -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.0-alpha.
|
|
6
|
-
* @date 2024-11-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.1.0-alpha.6
|
|
6
|
+
* @date 2024-11-28T09:06:59.527Z
|
|
7
|
+
* @hash 875c901
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -3497,7 +3497,9 @@
|
|
|
3497
3497
|
CommandResult["MaxInvalidFormula"] = "MaxInvalidFormula";
|
|
3498
3498
|
CommandResult["ValueUpperInvalidFormula"] = "ValueUpperInvalidFormula";
|
|
3499
3499
|
CommandResult["ValueLowerInvalidFormula"] = "ValueLowerInvalidFormula";
|
|
3500
|
+
CommandResult["InvalidSortAnchor"] = "InvalidSortAnchor";
|
|
3500
3501
|
CommandResult["InvalidSortZone"] = "InvalidSortZone";
|
|
3502
|
+
CommandResult["SortZoneWithArrayFormulas"] = "SortZoneWithArrayFormulas";
|
|
3501
3503
|
CommandResult["WaitingSessionConfirmation"] = "WaitingSessionConfirmation";
|
|
3502
3504
|
CommandResult["MergeOverlap"] = "MergeOverlap";
|
|
3503
3505
|
CommandResult["TooManyHiddenElements"] = "TooManyHiddenElements";
|
|
@@ -3553,7 +3555,6 @@
|
|
|
3553
3555
|
CommandResult["ValueCellIsInvalidFormula"] = "ValueCellIsInvalidFormula";
|
|
3554
3556
|
CommandResult["InvalidDefinition"] = "InvalidDefinition";
|
|
3555
3557
|
CommandResult["InvalidColor"] = "InvalidColor";
|
|
3556
|
-
CommandResult["DataBarRangeValuesMismatch"] = "DataBarRangeValuesMismatch";
|
|
3557
3558
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
3558
3559
|
|
|
3559
3560
|
const DEFAULT_LOCALES = [
|
|
@@ -14670,7 +14671,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14670
14671
|
return cellsToSort.sort(cellsSortingCriterion(sortDirection));
|
|
14671
14672
|
}
|
|
14672
14673
|
function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
14673
|
-
let result = DispatchResult.Success;
|
|
14674
14674
|
//several columns => bypass the contiguity check
|
|
14675
14675
|
let multiColumns = zone.right > zone.left;
|
|
14676
14676
|
if (env.model.getters.doesIntersectMerge(sheetId, zone)) {
|
|
@@ -14690,49 +14690,37 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14690
14690
|
}
|
|
14691
14691
|
}
|
|
14692
14692
|
}
|
|
14693
|
-
const { col, row } = anchor;
|
|
14694
14693
|
if (multiColumns) {
|
|
14695
|
-
|
|
14694
|
+
interactiveSort(env, sheetId, anchor, zone, sortDirection);
|
|
14695
|
+
return;
|
|
14696
|
+
}
|
|
14697
|
+
const contiguousZone = env.model.getters.getContiguousZone(sheetId, zone);
|
|
14698
|
+
if (isEqual(contiguousZone, zone)) {
|
|
14699
|
+
interactiveSort(env, sheetId, anchor, zone, sortDirection);
|
|
14696
14700
|
}
|
|
14697
14701
|
else {
|
|
14698
|
-
|
|
14699
|
-
const contiguousZone = env.model.getters.getContiguousZone(sheetId, zone);
|
|
14700
|
-
if (isEqual(contiguousZone, zone)) {
|
|
14701
|
-
// merge as it is
|
|
14702
|
-
result = env.model.dispatch("SORT_CELLS", {
|
|
14703
|
-
sheetId,
|
|
14704
|
-
col,
|
|
14705
|
-
row,
|
|
14706
|
-
zone,
|
|
14707
|
-
sortDirection,
|
|
14708
|
-
});
|
|
14709
|
-
}
|
|
14710
|
-
else {
|
|
14711
|
-
env.askConfirmation(_t("We found data next to your selection. Since this data was not selected, it will not be sorted. Do you want to extend your selection?"), () => {
|
|
14712
|
-
zone = contiguousZone;
|
|
14713
|
-
result = env.model.dispatch("SORT_CELLS", {
|
|
14714
|
-
sheetId,
|
|
14715
|
-
col,
|
|
14716
|
-
row,
|
|
14717
|
-
zone,
|
|
14718
|
-
sortDirection,
|
|
14719
|
-
});
|
|
14720
|
-
}, () => {
|
|
14721
|
-
result = env.model.dispatch("SORT_CELLS", {
|
|
14722
|
-
sheetId,
|
|
14723
|
-
col,
|
|
14724
|
-
row,
|
|
14725
|
-
zone,
|
|
14726
|
-
sortDirection,
|
|
14727
|
-
});
|
|
14728
|
-
});
|
|
14729
|
-
}
|
|
14702
|
+
env.askConfirmation(_t("We found data next to your selection. Since this data was not selected, it will not be sorted. Do you want to extend your selection?"), () => interactiveSort(env, sheetId, anchor, contiguousZone, sortDirection), () => interactiveSort(env, sheetId, anchor, zone, sortDirection));
|
|
14730
14703
|
}
|
|
14704
|
+
}
|
|
14705
|
+
function interactiveSort(env, sheetId, anchor, zone, sortDirection, sortOptions) {
|
|
14706
|
+
const result = env.model.dispatch("SORT_CELLS", {
|
|
14707
|
+
sheetId,
|
|
14708
|
+
col: anchor.col,
|
|
14709
|
+
row: anchor.row,
|
|
14710
|
+
zone,
|
|
14711
|
+
sortDirection,
|
|
14712
|
+
sortOptions,
|
|
14713
|
+
});
|
|
14731
14714
|
if (result.isCancelledBecause("InvalidSortZone" /* CommandResult.InvalidSortZone */)) {
|
|
14732
14715
|
const { col, row } = anchor;
|
|
14733
14716
|
env.model.selection.selectZone({ cell: { col, row }, zone });
|
|
14734
14717
|
env.raiseError(_t("Cannot sort. To sort, select only cells or only merges that have the same size."));
|
|
14735
14718
|
}
|
|
14719
|
+
if (result.isCancelledBecause("SortZoneWithArrayFormulas" /* CommandResult.SortZoneWithArrayFormulas */)) {
|
|
14720
|
+
const { col, row } = anchor;
|
|
14721
|
+
env.model.selection.selectZone({ cell: { col, row }, zone });
|
|
14722
|
+
env.raiseError(_t("Cannot sort a zone with array formulas."));
|
|
14723
|
+
}
|
|
14736
14724
|
}
|
|
14737
14725
|
|
|
14738
14726
|
function sortMatrix(matrix, locale, ...criteria) {
|
|
@@ -27720,7 +27708,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27720
27708
|
["ValueLowerInvalidFormula" /* CommandResult.ValueLowerInvalidFormula */]: _t("Invalid lower inflection point formula"),
|
|
27721
27709
|
["EmptyRange" /* CommandResult.EmptyRange */]: _t("A range needs to be defined"),
|
|
27722
27710
|
["ValueCellIsInvalidFormula" /* CommandResult.ValueCellIsInvalidFormula */]: _t("At least one of the provided values is an invalid formula"),
|
|
27723
|
-
["DataBarRangeValuesMismatch" /* CommandResult.DataBarRangeValuesMismatch */]: _t("All the ranges and the range values must have the same size"),
|
|
27724
27711
|
Unexpected: _t("The rule is invalid for an unknown reason"),
|
|
27725
27712
|
},
|
|
27726
27713
|
ColorScale: _t("Color scale"),
|
|
@@ -29094,20 +29081,27 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29094
29081
|
return scales;
|
|
29095
29082
|
}
|
|
29096
29083
|
function getPyramidChartScales(definition, args) {
|
|
29084
|
+
const { dataSetsValues } = args;
|
|
29097
29085
|
const scales = getBarChartScales(definition, args);
|
|
29098
29086
|
const scalesXCallback = scales.x.ticks.callback;
|
|
29099
29087
|
scales.x.ticks.callback = (value) => scalesXCallback(Math.abs(value));
|
|
29088
|
+
const maxValue = Math.max(...dataSetsValues.map((dataSet) => Math.max(...dataSet.data.map(Math.abs))));
|
|
29089
|
+
scales.x.suggestedMin = -maxValue;
|
|
29090
|
+
scales.x.suggestedMax = maxValue;
|
|
29100
29091
|
return scales;
|
|
29101
29092
|
}
|
|
29102
29093
|
function getRadarChartScales(definition, args) {
|
|
29103
|
-
const { locale, axisFormats } = args;
|
|
29094
|
+
const { locale, axisFormats, dataSetsValues } = args;
|
|
29095
|
+
const minValue = Math.min(...dataSetsValues.map((ds) => Math.min(...ds.data.filter((x) => !isNaN(x)))));
|
|
29104
29096
|
return {
|
|
29105
29097
|
r: {
|
|
29098
|
+
beginAtZero: true,
|
|
29106
29099
|
ticks: {
|
|
29107
29100
|
callback: formatTickValue({ format: axisFormats?.r, locale }),
|
|
29108
29101
|
backdropColor: definition.background || "#FFFFFF",
|
|
29109
29102
|
},
|
|
29110
29103
|
pointLabels: { color: chartFontColor(definition.background) },
|
|
29104
|
+
suggestedMin: minValue < 0 ? minValue - 1 : 0,
|
|
29111
29105
|
},
|
|
29112
29106
|
};
|
|
29113
29107
|
}
|
|
@@ -32208,14 +32202,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32208
32202
|
}
|
|
32209
32203
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
32210
32204
|
const contentZone = { ...tableZone, top: tableZone.top + 1 };
|
|
32211
|
-
|
|
32212
|
-
|
|
32213
|
-
|
|
32214
|
-
row: contentZone.top,
|
|
32215
|
-
zone: contentZone,
|
|
32216
|
-
sortDirection,
|
|
32217
|
-
sortOptions: { emptyCellAsZero: true, sortHeaders: true },
|
|
32218
|
-
});
|
|
32205
|
+
const sortAnchor = { col: filterPosition.col, row: contentZone.top };
|
|
32206
|
+
const sortOptions = { emptyCellAsZero: true, sortHeaders: true };
|
|
32207
|
+
interactiveSort(this.env, sheetId, sortAnchor, contentZone, sortDirection, sortOptions);
|
|
32219
32208
|
this.props.onClosed?.();
|
|
32220
32209
|
}
|
|
32221
32210
|
}
|
|
@@ -34231,6 +34220,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
34231
34220
|
const pivotId = env.model.getters.getPivotIdFromPosition(position);
|
|
34232
34221
|
return (pivotId && env.model.getters.isExistingPivot(pivotId)) || false;
|
|
34233
34222
|
},
|
|
34223
|
+
isReadonlyAllowed: true,
|
|
34234
34224
|
icon: "o-spreadsheet-Icon.PIVOT",
|
|
34235
34225
|
};
|
|
34236
34226
|
const FIX_FORMULAS = {
|
|
@@ -35948,6 +35938,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35948
35938
|
id: `item_pivot_${env.model.getters.getPivotFormulaId(pivotId)}`,
|
|
35949
35939
|
name: env.model.getters.getPivotDisplayName(pivotId),
|
|
35950
35940
|
sequence: sequence + index,
|
|
35941
|
+
isReadonlyAllowed: true,
|
|
35951
35942
|
execute: (env) => env.openSidePanel("PivotSidePanel", { pivotId }),
|
|
35952
35943
|
onStartHover: (env) => env.getStore(HighlightStore).register(highlightProvider),
|
|
35953
35944
|
onStopHover: (env) => env.getStore(HighlightStore).unRegister(highlightProvider),
|
|
@@ -52903,8 +52894,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52903
52894
|
case "IconSetRule": {
|
|
52904
52895
|
return this.checkValidations(rule, this.chainValidations(this.checkInflectionPoints(this.checkNaN), this.checkLowerBiggerThanUpper), this.chainValidations(this.checkInflectionPoints(this.checkFormulaCompilation)));
|
|
52905
52896
|
}
|
|
52906
|
-
case "DataBarRule":
|
|
52907
|
-
return this.checkDataBarRangeValues(rule, cmd.ranges, cmd.sheetId);
|
|
52908
52897
|
}
|
|
52909
52898
|
return "Success" /* CommandResult.Success */;
|
|
52910
52899
|
}
|
|
@@ -53035,18 +53024,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53035
53024
|
}
|
|
53036
53025
|
return "Success" /* CommandResult.Success */;
|
|
53037
53026
|
}
|
|
53038
|
-
checkDataBarRangeValues(rule, ranges, sheetId) {
|
|
53039
|
-
if (rule.rangeValues) {
|
|
53040
|
-
const { numberOfCols, numberOfRows } = zoneToDimension(this.getters.getRangeFromSheetXC(sheetId, rule.rangeValues).zone);
|
|
53041
|
-
for (const range of ranges) {
|
|
53042
|
-
const dimensions = zoneToDimension(this.getters.getRangeFromRangeData(range).zone);
|
|
53043
|
-
if (numberOfCols !== dimensions.numberOfCols || numberOfRows !== dimensions.numberOfRows) {
|
|
53044
|
-
return "DataBarRangeValuesMismatch" /* CommandResult.DataBarRangeValuesMismatch */;
|
|
53045
|
-
}
|
|
53046
|
-
}
|
|
53047
|
-
}
|
|
53048
|
-
return "Success" /* CommandResult.Success */;
|
|
53049
|
-
}
|
|
53050
53027
|
removeConditionalFormatting(id, sheet) {
|
|
53051
53028
|
const cfIndex = this.cfRules[sheet].findIndex((s) => s.id === id);
|
|
53052
53029
|
if (cfIndex !== -1) {
|
|
@@ -59451,8 +59428,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59451
59428
|
const zoneOfValues = rangeValues.zone;
|
|
59452
59429
|
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
59453
59430
|
for (let col = zone.left; col <= zone.right; col++) {
|
|
59454
|
-
const
|
|
59455
|
-
|
|
59431
|
+
const targetCol = col - zone.left + zoneOfValues.left;
|
|
59432
|
+
const targetRow = row - zone.top + zoneOfValues.top;
|
|
59433
|
+
const cell = this.getters.getEvaluatedCell({ sheetId, col: targetCol, row: targetRow });
|
|
59434
|
+
if (!isInside(targetCol, targetRow, zoneOfValues) ||
|
|
59435
|
+
cell.type !== CellValueType.number ||
|
|
59436
|
+
cell.value <= 0) {
|
|
59456
59437
|
// values negatives or 0 are ignored
|
|
59457
59438
|
continue;
|
|
59458
59439
|
}
|
|
@@ -59465,11 +59446,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
59465
59446
|
}
|
|
59466
59447
|
}
|
|
59467
59448
|
}
|
|
59468
|
-
getEvaluatedCellInZone(sheetId, zone, col, row, targetZone) {
|
|
59469
|
-
const targetCol = col - zone.left + targetZone.left;
|
|
59470
|
-
const targetRow = row - zone.top + targetZone.top;
|
|
59471
|
-
return this.getters.getEvaluatedCell({ sheetId, col: targetCol, row: targetRow });
|
|
59472
|
-
}
|
|
59473
59449
|
/** Compute the color scale for the given range and CF rule, and apply in in the given computedStyle object */
|
|
59474
59450
|
applyColorScale(sheetId, range, rule, computedStyle) {
|
|
59475
59451
|
const minValue = this.parsePoint(sheetId, range, rule.minimum, "min");
|
|
@@ -63047,9 +63023,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63047
63023
|
switch (cmd.type) {
|
|
63048
63024
|
case "SORT_CELLS":
|
|
63049
63025
|
if (!isInside(cmd.col, cmd.row, cmd.zone)) {
|
|
63050
|
-
|
|
63026
|
+
return "InvalidSortAnchor" /* CommandResult.InvalidSortAnchor */;
|
|
63051
63027
|
}
|
|
63052
|
-
return this.checkValidations(cmd, this.checkMerge, this.checkMergeSizes);
|
|
63028
|
+
return this.checkValidations(cmd, this.checkMerge, this.checkMergeSizes, this.checkArrayFormulaInSortZone);
|
|
63053
63029
|
}
|
|
63054
63030
|
return "Success" /* CommandResult.Success */;
|
|
63055
63031
|
}
|
|
@@ -63090,6 +63066,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63090
63066
|
}
|
|
63091
63067
|
return "Success" /* CommandResult.Success */;
|
|
63092
63068
|
}
|
|
63069
|
+
checkArrayFormulaInSortZone({ sheetId, zone }) {
|
|
63070
|
+
const arrayFormulaInZone = positions(zone).some(({ col, row }) => this.getters.getArrayFormulaSpreadingOn({ sheetId, col, row }));
|
|
63071
|
+
return arrayFormulaInZone ? "SortZoneWithArrayFormulas" /* CommandResult.SortZoneWithArrayFormulas */ : "Success" /* CommandResult.Success */;
|
|
63072
|
+
}
|
|
63093
63073
|
/**
|
|
63094
63074
|
* This function evaluates if the top row of a provided zone can be considered as a `header`
|
|
63095
63075
|
* by checking the following criteria:
|
|
@@ -73691,6 +73671,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73691
73671
|
GaugeChartDesignPanel,
|
|
73692
73672
|
ScorecardChartConfigPanel,
|
|
73693
73673
|
ScorecardChartDesignPanel,
|
|
73674
|
+
RadarChartDesignPanel,
|
|
73675
|
+
WaterfallChartDesignPanel,
|
|
73676
|
+
ComboChartDesignPanel,
|
|
73694
73677
|
ChartTypePicker,
|
|
73695
73678
|
FigureComponent,
|
|
73696
73679
|
Menu,
|
|
@@ -73744,6 +73727,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73744
73727
|
DEFAULT_LOCALE,
|
|
73745
73728
|
HIGHLIGHT_COLOR,
|
|
73746
73729
|
PIVOT_TABLE_CONFIG,
|
|
73730
|
+
ChartTerms,
|
|
73747
73731
|
};
|
|
73748
73732
|
const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
73749
73733
|
|
|
@@ -73794,9 +73778,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73794
73778
|
exports.tokenize = tokenize;
|
|
73795
73779
|
|
|
73796
73780
|
|
|
73797
|
-
__info__.version = "18.1.0-alpha.
|
|
73798
|
-
__info__.date = "2024-11-
|
|
73799
|
-
__info__.hash = "
|
|
73781
|
+
__info__.version = "18.1.0-alpha.6";
|
|
73782
|
+
__info__.date = "2024-11-28T09:06:59.527Z";
|
|
73783
|
+
__info__.hash = "875c901";
|
|
73800
73784
|
|
|
73801
73785
|
|
|
73802
73786
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|