@odoo/o-spreadsheet 16.3.22 → 16.3.24
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 +309 -298
- package/dist/o-spreadsheet.d.ts +68 -67
- package/dist/o-spreadsheet.esm.js +309 -298
- package/dist/o-spreadsheet.iife.js +309 -298
- package/dist/o-spreadsheet.iife.min.js +16 -23
- package/dist/o_spreadsheet.xml +5 -5
- package/package.json +1 -1
|
@@ -2077,27 +2077,30 @@ function detectFormat(content) {
|
|
|
2077
2077
|
}
|
|
2078
2078
|
function createLargeNumberFormat(format, magnitude, postFix) {
|
|
2079
2079
|
const internalFormat = parseFormat(format || "#,##0");
|
|
2080
|
-
const largeNumberFormat =
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
format: {
|
|
2087
|
-
...formatPart.format,
|
|
2088
|
-
magnitude,
|
|
2089
|
-
decimalPart: undefined,
|
|
2090
|
-
},
|
|
2091
|
-
},
|
|
2092
|
-
{
|
|
2093
|
-
type: "STRING",
|
|
2094
|
-
format: postFix,
|
|
2095
|
-
},
|
|
2096
|
-
];
|
|
2080
|
+
const largeNumberFormat = [];
|
|
2081
|
+
for (let i = 0; i < internalFormat.length; i++) {
|
|
2082
|
+
const formatPart = internalFormat[i];
|
|
2083
|
+
if (formatPart.type !== "NUMBER") {
|
|
2084
|
+
largeNumberFormat.push(formatPart);
|
|
2085
|
+
continue;
|
|
2097
2086
|
}
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2087
|
+
largeNumberFormat.push({
|
|
2088
|
+
...formatPart,
|
|
2089
|
+
format: {
|
|
2090
|
+
...formatPart.format,
|
|
2091
|
+
magnitude,
|
|
2092
|
+
decimalPart: undefined,
|
|
2093
|
+
},
|
|
2094
|
+
});
|
|
2095
|
+
largeNumberFormat.push({
|
|
2096
|
+
type: "STRING",
|
|
2097
|
+
format: postFix,
|
|
2098
|
+
});
|
|
2099
|
+
const nextFormatPart = internalFormat[i + 1];
|
|
2100
|
+
if (nextFormatPart?.type === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
|
|
2101
|
+
i++;
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2101
2104
|
return convertInternalFormatToFormat(largeNumberFormat);
|
|
2102
2105
|
}
|
|
2103
2106
|
function changeDecimalPlaces(format, step) {
|
|
@@ -4439,69 +4442,70 @@ exports.CommandResult = void 0;
|
|
|
4439
4442
|
CommandResult[CommandResult["InvalidFigureId"] = 28] = "InvalidFigureId";
|
|
4440
4443
|
CommandResult[CommandResult["InputAlreadyFocused"] = 29] = "InputAlreadyFocused";
|
|
4441
4444
|
CommandResult[CommandResult["MaximumRangesReached"] = 30] = "MaximumRangesReached";
|
|
4442
|
-
CommandResult[CommandResult["
|
|
4443
|
-
CommandResult[CommandResult["
|
|
4444
|
-
CommandResult[CommandResult["
|
|
4445
|
-
CommandResult[CommandResult["
|
|
4446
|
-
CommandResult[CommandResult["
|
|
4447
|
-
CommandResult[CommandResult["
|
|
4448
|
-
CommandResult[CommandResult["
|
|
4449
|
-
CommandResult[CommandResult["
|
|
4450
|
-
CommandResult[CommandResult["
|
|
4451
|
-
CommandResult[CommandResult["
|
|
4452
|
-
CommandResult[CommandResult["
|
|
4453
|
-
CommandResult[CommandResult["
|
|
4454
|
-
CommandResult[CommandResult["
|
|
4455
|
-
CommandResult[CommandResult["
|
|
4456
|
-
CommandResult[CommandResult["
|
|
4457
|
-
CommandResult[CommandResult["
|
|
4458
|
-
CommandResult[CommandResult["
|
|
4459
|
-
CommandResult[CommandResult["
|
|
4460
|
-
CommandResult[CommandResult["
|
|
4461
|
-
CommandResult[CommandResult["
|
|
4462
|
-
CommandResult[CommandResult["
|
|
4463
|
-
CommandResult[CommandResult["
|
|
4464
|
-
CommandResult[CommandResult["
|
|
4465
|
-
CommandResult[CommandResult["
|
|
4466
|
-
CommandResult[CommandResult["
|
|
4467
|
-
CommandResult[CommandResult["
|
|
4468
|
-
CommandResult[CommandResult["
|
|
4469
|
-
CommandResult[CommandResult["
|
|
4470
|
-
CommandResult[CommandResult["
|
|
4471
|
-
CommandResult[CommandResult["
|
|
4472
|
-
CommandResult[CommandResult["
|
|
4473
|
-
CommandResult[CommandResult["
|
|
4474
|
-
CommandResult[CommandResult["
|
|
4475
|
-
CommandResult[CommandResult["
|
|
4476
|
-
CommandResult[CommandResult["
|
|
4477
|
-
CommandResult[CommandResult["
|
|
4478
|
-
CommandResult[CommandResult["
|
|
4479
|
-
CommandResult[CommandResult["
|
|
4480
|
-
CommandResult[CommandResult["
|
|
4481
|
-
CommandResult[CommandResult["
|
|
4482
|
-
CommandResult[CommandResult["
|
|
4483
|
-
CommandResult[CommandResult["
|
|
4484
|
-
CommandResult[CommandResult["
|
|
4485
|
-
CommandResult[CommandResult["
|
|
4486
|
-
CommandResult[CommandResult["
|
|
4487
|
-
CommandResult[CommandResult["
|
|
4488
|
-
CommandResult[CommandResult["
|
|
4489
|
-
CommandResult[CommandResult["
|
|
4490
|
-
CommandResult[CommandResult["
|
|
4491
|
-
CommandResult[CommandResult["
|
|
4492
|
-
CommandResult[CommandResult["
|
|
4493
|
-
CommandResult[CommandResult["
|
|
4494
|
-
CommandResult[CommandResult["
|
|
4495
|
-
CommandResult[CommandResult["
|
|
4496
|
-
CommandResult[CommandResult["
|
|
4497
|
-
CommandResult[CommandResult["
|
|
4498
|
-
CommandResult[CommandResult["
|
|
4499
|
-
CommandResult[CommandResult["
|
|
4500
|
-
CommandResult[CommandResult["
|
|
4501
|
-
CommandResult[CommandResult["
|
|
4502
|
-
CommandResult[CommandResult["
|
|
4503
|
-
CommandResult[CommandResult["
|
|
4504
|
-
CommandResult[CommandResult["
|
|
4445
|
+
CommandResult[CommandResult["InvalidInputId"] = 31] = "InvalidInputId";
|
|
4446
|
+
CommandResult[CommandResult["InvalidChartDefinition"] = 32] = "InvalidChartDefinition";
|
|
4447
|
+
CommandResult[CommandResult["InvalidDataSet"] = 33] = "InvalidDataSet";
|
|
4448
|
+
CommandResult[CommandResult["InvalidLabelRange"] = 34] = "InvalidLabelRange";
|
|
4449
|
+
CommandResult[CommandResult["InvalidScorecardKeyValue"] = 35] = "InvalidScorecardKeyValue";
|
|
4450
|
+
CommandResult[CommandResult["InvalidScorecardBaseline"] = 36] = "InvalidScorecardBaseline";
|
|
4451
|
+
CommandResult[CommandResult["InvalidGaugeDataRange"] = 37] = "InvalidGaugeDataRange";
|
|
4452
|
+
CommandResult[CommandResult["EmptyGaugeRangeMin"] = 38] = "EmptyGaugeRangeMin";
|
|
4453
|
+
CommandResult[CommandResult["GaugeRangeMinNaN"] = 39] = "GaugeRangeMinNaN";
|
|
4454
|
+
CommandResult[CommandResult["EmptyGaugeRangeMax"] = 40] = "EmptyGaugeRangeMax";
|
|
4455
|
+
CommandResult[CommandResult["GaugeRangeMaxNaN"] = 41] = "GaugeRangeMaxNaN";
|
|
4456
|
+
CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 42] = "GaugeRangeMinBiggerThanRangeMax";
|
|
4457
|
+
CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 43] = "GaugeLowerInflectionPointNaN";
|
|
4458
|
+
CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 44] = "GaugeUpperInflectionPointNaN";
|
|
4459
|
+
CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 45] = "GaugeLowerBiggerThanUpper";
|
|
4460
|
+
CommandResult[CommandResult["InvalidAutofillSelection"] = 46] = "InvalidAutofillSelection";
|
|
4461
|
+
CommandResult[CommandResult["WrongComposerSelection"] = 47] = "WrongComposerSelection";
|
|
4462
|
+
CommandResult[CommandResult["MinBiggerThanMax"] = 48] = "MinBiggerThanMax";
|
|
4463
|
+
CommandResult[CommandResult["LowerBiggerThanUpper"] = 49] = "LowerBiggerThanUpper";
|
|
4464
|
+
CommandResult[CommandResult["MidBiggerThanMax"] = 50] = "MidBiggerThanMax";
|
|
4465
|
+
CommandResult[CommandResult["MinBiggerThanMid"] = 51] = "MinBiggerThanMid";
|
|
4466
|
+
CommandResult[CommandResult["FirstArgMissing"] = 52] = "FirstArgMissing";
|
|
4467
|
+
CommandResult[CommandResult["SecondArgMissing"] = 53] = "SecondArgMissing";
|
|
4468
|
+
CommandResult[CommandResult["MinNaN"] = 54] = "MinNaN";
|
|
4469
|
+
CommandResult[CommandResult["MidNaN"] = 55] = "MidNaN";
|
|
4470
|
+
CommandResult[CommandResult["MaxNaN"] = 56] = "MaxNaN";
|
|
4471
|
+
CommandResult[CommandResult["ValueUpperInflectionNaN"] = 57] = "ValueUpperInflectionNaN";
|
|
4472
|
+
CommandResult[CommandResult["ValueLowerInflectionNaN"] = 58] = "ValueLowerInflectionNaN";
|
|
4473
|
+
CommandResult[CommandResult["MinInvalidFormula"] = 59] = "MinInvalidFormula";
|
|
4474
|
+
CommandResult[CommandResult["MidInvalidFormula"] = 60] = "MidInvalidFormula";
|
|
4475
|
+
CommandResult[CommandResult["MaxInvalidFormula"] = 61] = "MaxInvalidFormula";
|
|
4476
|
+
CommandResult[CommandResult["ValueUpperInvalidFormula"] = 62] = "ValueUpperInvalidFormula";
|
|
4477
|
+
CommandResult[CommandResult["ValueLowerInvalidFormula"] = 63] = "ValueLowerInvalidFormula";
|
|
4478
|
+
CommandResult[CommandResult["InvalidSortZone"] = 64] = "InvalidSortZone";
|
|
4479
|
+
CommandResult[CommandResult["WaitingSessionConfirmation"] = 65] = "WaitingSessionConfirmation";
|
|
4480
|
+
CommandResult[CommandResult["MergeOverlap"] = 66] = "MergeOverlap";
|
|
4481
|
+
CommandResult[CommandResult["TooManyHiddenElements"] = 67] = "TooManyHiddenElements";
|
|
4482
|
+
CommandResult[CommandResult["Readonly"] = 68] = "Readonly";
|
|
4483
|
+
CommandResult[CommandResult["InvalidViewportSize"] = 69] = "InvalidViewportSize";
|
|
4484
|
+
CommandResult[CommandResult["InvalidScrollingDirection"] = 70] = "InvalidScrollingDirection";
|
|
4485
|
+
CommandResult[CommandResult["FigureDoesNotExist"] = 71] = "FigureDoesNotExist";
|
|
4486
|
+
CommandResult[CommandResult["InvalidConditionalFormatId"] = 72] = "InvalidConditionalFormatId";
|
|
4487
|
+
CommandResult[CommandResult["InvalidCellPopover"] = 73] = "InvalidCellPopover";
|
|
4488
|
+
CommandResult[CommandResult["EmptyTarget"] = 74] = "EmptyTarget";
|
|
4489
|
+
CommandResult[CommandResult["InvalidFreezeQuantity"] = 75] = "InvalidFreezeQuantity";
|
|
4490
|
+
CommandResult[CommandResult["FrozenPaneOverlap"] = 76] = "FrozenPaneOverlap";
|
|
4491
|
+
CommandResult[CommandResult["ValuesNotChanged"] = 77] = "ValuesNotChanged";
|
|
4492
|
+
CommandResult[CommandResult["InvalidFilterZone"] = 78] = "InvalidFilterZone";
|
|
4493
|
+
CommandResult[CommandResult["FilterOverlap"] = 79] = "FilterOverlap";
|
|
4494
|
+
CommandResult[CommandResult["FilterNotFound"] = 80] = "FilterNotFound";
|
|
4495
|
+
CommandResult[CommandResult["MergeInFilter"] = 81] = "MergeInFilter";
|
|
4496
|
+
CommandResult[CommandResult["NonContinuousTargets"] = 82] = "NonContinuousTargets";
|
|
4497
|
+
CommandResult[CommandResult["DuplicatedFigureId"] = 83] = "DuplicatedFigureId";
|
|
4498
|
+
CommandResult[CommandResult["InvalidSelectionStep"] = 84] = "InvalidSelectionStep";
|
|
4499
|
+
CommandResult[CommandResult["DuplicatedChartId"] = 85] = "DuplicatedChartId";
|
|
4500
|
+
CommandResult[CommandResult["ChartDoesNotExist"] = 86] = "ChartDoesNotExist";
|
|
4501
|
+
CommandResult[CommandResult["InvalidHeaderIndex"] = 87] = "InvalidHeaderIndex";
|
|
4502
|
+
CommandResult[CommandResult["InvalidQuantity"] = 88] = "InvalidQuantity";
|
|
4503
|
+
CommandResult[CommandResult["MoreThanOneColumnSelected"] = 89] = "MoreThanOneColumnSelected";
|
|
4504
|
+
CommandResult[CommandResult["EmptySplitSeparator"] = 90] = "EmptySplitSeparator";
|
|
4505
|
+
CommandResult[CommandResult["SplitWillOverwriteContent"] = 91] = "SplitWillOverwriteContent";
|
|
4506
|
+
CommandResult[CommandResult["NoSplitSeparatorInSelection"] = 92] = "NoSplitSeparatorInSelection";
|
|
4507
|
+
CommandResult[CommandResult["NoActiveSheet"] = 93] = "NoActiveSheet";
|
|
4508
|
+
CommandResult[CommandResult["NoChanges"] = 94] = "NoChanges";
|
|
4505
4509
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
4506
4510
|
|
|
4507
4511
|
const borderStyles = ["thin", "medium", "thick", "dashed", "dotted"];
|
|
@@ -6461,14 +6465,8 @@ function createDataSets(getters, dataSetsString, sheetId, dataSetsHaveTitle) {
|
|
|
6461
6465
|
: undefined));
|
|
6462
6466
|
}
|
|
6463
6467
|
}
|
|
6464
|
-
else if (zone.left === zone.right && zone.top === zone.bottom) {
|
|
6465
|
-
// A single cell. If it's only the title, the dataset is not added.
|
|
6466
|
-
if (!dataSetsHaveTitle) {
|
|
6467
|
-
dataSets.push(createDataSet(getters, dataSetSheetId, zone, undefined));
|
|
6468
|
-
}
|
|
6469
|
-
}
|
|
6470
6468
|
else {
|
|
6471
|
-
/* 1 row or 1 column */
|
|
6469
|
+
/* 1 cell, 1 row or 1 column */
|
|
6472
6470
|
dataSets.push(createDataSet(getters, dataSetSheetId, zone, dataSetsHaveTitle
|
|
6473
6471
|
? {
|
|
6474
6472
|
top: zone.top,
|
|
@@ -6517,8 +6515,10 @@ function toExcelDataset(getters, ds) {
|
|
|
6517
6515
|
}
|
|
6518
6516
|
const dataRange = ds.dataRange.clone({ zone: dataZone });
|
|
6519
6517
|
return {
|
|
6520
|
-
label: ds.labelCell
|
|
6521
|
-
|
|
6518
|
+
label: ds.labelCell
|
|
6519
|
+
? getters.getRangeString(ds.labelCell, "forceSheetReference", true)
|
|
6520
|
+
: undefined,
|
|
6521
|
+
range: getters.getRangeString(dataRange, "forceSheetReference", true),
|
|
6522
6522
|
};
|
|
6523
6523
|
}
|
|
6524
6524
|
function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
@@ -6531,7 +6531,7 @@ function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
|
6531
6531
|
zone.top = zone.top + 1;
|
|
6532
6532
|
}
|
|
6533
6533
|
const range = labelRange.clone({ zone });
|
|
6534
|
-
return getters.getRangeString(range, "forceSheetReference");
|
|
6534
|
+
return getters.getRangeString(range, "forceSheetReference", true);
|
|
6535
6535
|
}
|
|
6536
6536
|
/**
|
|
6537
6537
|
* Transform a chart definition which supports dataSets (dataSets and LabelRange)
|
|
@@ -6597,11 +6597,11 @@ function checkDataset(definition) {
|
|
|
6597
6597
|
if (definition.dataSets) {
|
|
6598
6598
|
const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
|
|
6599
6599
|
if (invalidRanges) {
|
|
6600
|
-
return
|
|
6600
|
+
return 33 /* CommandResult.InvalidDataSet */;
|
|
6601
6601
|
}
|
|
6602
6602
|
const zones = definition.dataSets.map(toUnboundedZone);
|
|
6603
6603
|
if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
|
|
6604
|
-
return
|
|
6604
|
+
return 33 /* CommandResult.InvalidDataSet */;
|
|
6605
6605
|
}
|
|
6606
6606
|
}
|
|
6607
6607
|
return 0 /* CommandResult.Success */;
|
|
@@ -6610,7 +6610,7 @@ function checkLabelRange(definition) {
|
|
|
6610
6610
|
if (definition.labelRange) {
|
|
6611
6611
|
const invalidLabels = !rangeReference.test(definition.labelRange || "");
|
|
6612
6612
|
if (invalidLabels) {
|
|
6613
|
-
return
|
|
6613
|
+
return 34 /* CommandResult.InvalidLabelRange */;
|
|
6614
6614
|
}
|
|
6615
6615
|
}
|
|
6616
6616
|
return 0 /* CommandResult.Success */;
|
|
@@ -6697,22 +6697,22 @@ function getChartPositionAtCenterOfViewport(getters, chartSize) {
|
|
|
6697
6697
|
const CfTerms = {
|
|
6698
6698
|
Errors: {
|
|
6699
6699
|
[25 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
|
|
6700
|
-
[
|
|
6701
|
-
[
|
|
6702
|
-
[
|
|
6703
|
-
[
|
|
6704
|
-
[
|
|
6705
|
-
[
|
|
6706
|
-
[
|
|
6707
|
-
[
|
|
6708
|
-
[
|
|
6709
|
-
[
|
|
6710
|
-
[
|
|
6711
|
-
[
|
|
6712
|
-
[
|
|
6713
|
-
[
|
|
6714
|
-
[
|
|
6715
|
-
[
|
|
6700
|
+
[52 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
|
|
6701
|
+
[53 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
|
|
6702
|
+
[54 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
|
|
6703
|
+
[55 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
|
|
6704
|
+
[56 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
|
|
6705
|
+
[57 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
|
|
6706
|
+
[58 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
|
|
6707
|
+
[48 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
|
|
6708
|
+
[51 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
|
|
6709
|
+
[50 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
|
|
6710
|
+
[49 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
|
|
6711
|
+
[59 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
|
|
6712
|
+
[61 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
|
|
6713
|
+
[60 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
|
|
6714
|
+
[62 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
|
|
6715
|
+
[63 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
|
|
6716
6716
|
[24 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
|
|
6717
6717
|
Unexpected: _lt("The rule is invalid for an unknown reason"),
|
|
6718
6718
|
},
|
|
@@ -6740,20 +6740,20 @@ const ChartTerms = {
|
|
|
6740
6740
|
Errors: {
|
|
6741
6741
|
Unexpected: _lt("The chart definition is invalid for an unknown reason"),
|
|
6742
6742
|
// BASIC CHART ERRORS (LINE | BAR | PIE)
|
|
6743
|
-
[
|
|
6744
|
-
[
|
|
6743
|
+
[33 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
|
|
6744
|
+
[34 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
|
|
6745
6745
|
// SCORECARD CHART ERRORS
|
|
6746
|
-
[
|
|
6747
|
-
[
|
|
6746
|
+
[35 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
|
|
6747
|
+
[36 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
|
|
6748
6748
|
// GAUGE CHART ERRORS
|
|
6749
|
-
[
|
|
6750
|
-
[
|
|
6751
|
-
[
|
|
6752
|
-
[
|
|
6753
|
-
[
|
|
6754
|
-
[
|
|
6755
|
-
[
|
|
6756
|
-
[
|
|
6749
|
+
[37 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
|
|
6750
|
+
[38 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
|
|
6751
|
+
[39 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
|
|
6752
|
+
[40 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
|
|
6753
|
+
[41 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
|
|
6754
|
+
[42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
|
|
6755
|
+
[43 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
|
|
6756
|
+
[44 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
|
|
6757
6757
|
},
|
|
6758
6758
|
};
|
|
6759
6759
|
const CustomCurrencyTerms = {
|
|
@@ -6763,9 +6763,9 @@ const MergeErrorMessage = _lt("Merged cells are preventing this operation. Unmer
|
|
|
6763
6763
|
const SplitToColumnsTerms = {
|
|
6764
6764
|
Errors: {
|
|
6765
6765
|
Unexpected: _lt("Cannot split the selection for an unknown reason"),
|
|
6766
|
-
[
|
|
6767
|
-
[
|
|
6768
|
-
[
|
|
6766
|
+
[92 /* CommandResult.NoSplitSeparatorInSelection */]: _lt("There is no match for the selected separator in the selection"),
|
|
6767
|
+
[89 /* CommandResult.MoreThanOneColumnSelected */]: _lt("Only a selection from a single column can be split"),
|
|
6768
|
+
[91 /* CommandResult.SplitWillOverwriteContent */]: _lt("Splitting will overwrite existing content"),
|
|
6769
6769
|
},
|
|
6770
6770
|
};
|
|
6771
6771
|
|
|
@@ -7068,7 +7068,7 @@ class BarChart extends AbstractChart {
|
|
|
7068
7068
|
return undefined;
|
|
7069
7069
|
const dataSets = this.dataSets
|
|
7070
7070
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
7071
|
-
.filter((ds) => ds.range !== ""
|
|
7071
|
+
.filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
|
|
7072
7072
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
7073
7073
|
return {
|
|
7074
7074
|
...this.getDefinition(),
|
|
@@ -7169,7 +7169,7 @@ function createBarChartRuntime(chart, getters) {
|
|
|
7169
7169
|
|
|
7170
7170
|
function isDataRangeValid(definition) {
|
|
7171
7171
|
return definition.dataRange && !rangeReference.test(definition.dataRange)
|
|
7172
|
-
?
|
|
7172
|
+
? 37 /* CommandResult.InvalidGaugeDataRange */
|
|
7173
7173
|
: 0 /* CommandResult.Success */;
|
|
7174
7174
|
}
|
|
7175
7175
|
function checkRangeLimits(check, batchValidations) {
|
|
@@ -7201,7 +7201,7 @@ function checkInflectionPointsValue(check, batchValidations) {
|
|
|
7201
7201
|
function checkRangeMinBiggerThanRangeMax(definition) {
|
|
7202
7202
|
if (definition.sectionRule) {
|
|
7203
7203
|
if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
|
|
7204
|
-
return
|
|
7204
|
+
return 42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
|
|
7205
7205
|
}
|
|
7206
7206
|
}
|
|
7207
7207
|
return 0 /* CommandResult.Success */;
|
|
@@ -7210,9 +7210,9 @@ function checkEmpty(value, valueName) {
|
|
|
7210
7210
|
if (value === "") {
|
|
7211
7211
|
switch (valueName) {
|
|
7212
7212
|
case "rangeMin":
|
|
7213
|
-
return
|
|
7213
|
+
return 38 /* CommandResult.EmptyGaugeRangeMin */;
|
|
7214
7214
|
case "rangeMax":
|
|
7215
|
-
return
|
|
7215
|
+
return 40 /* CommandResult.EmptyGaugeRangeMax */;
|
|
7216
7216
|
}
|
|
7217
7217
|
}
|
|
7218
7218
|
return 0 /* CommandResult.Success */;
|
|
@@ -7221,13 +7221,13 @@ function checkNaN(value, valueName) {
|
|
|
7221
7221
|
if (isNaN(value)) {
|
|
7222
7222
|
switch (valueName) {
|
|
7223
7223
|
case "rangeMin":
|
|
7224
|
-
return
|
|
7224
|
+
return 39 /* CommandResult.GaugeRangeMinNaN */;
|
|
7225
7225
|
case "rangeMax":
|
|
7226
|
-
return
|
|
7226
|
+
return 41 /* CommandResult.GaugeRangeMaxNaN */;
|
|
7227
7227
|
case "lowerInflectionPointValue":
|
|
7228
|
-
return
|
|
7228
|
+
return 43 /* CommandResult.GaugeLowerInflectionPointNaN */;
|
|
7229
7229
|
case "upperInflectionPointValue":
|
|
7230
|
-
return
|
|
7230
|
+
return 44 /* CommandResult.GaugeUpperInflectionPointNaN */;
|
|
7231
7231
|
}
|
|
7232
7232
|
}
|
|
7233
7233
|
return 0 /* CommandResult.Success */;
|
|
@@ -7652,7 +7652,7 @@ class LineChart extends AbstractChart {
|
|
|
7652
7652
|
return undefined;
|
|
7653
7653
|
const dataSets = this.dataSets
|
|
7654
7654
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
7655
|
-
.filter((ds) => ds.range !== ""
|
|
7655
|
+
.filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
|
|
7656
7656
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
7657
7657
|
return {
|
|
7658
7658
|
...this.getDefinition(),
|
|
@@ -7937,7 +7937,7 @@ class PieChart extends AbstractChart {
|
|
|
7937
7937
|
return undefined;
|
|
7938
7938
|
const dataSets = this.dataSets
|
|
7939
7939
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
7940
|
-
.filter((ds) => ds.range !== ""
|
|
7940
|
+
.filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
|
|
7941
7941
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
7942
7942
|
return {
|
|
7943
7943
|
...this.getDefinition(),
|
|
@@ -8017,12 +8017,12 @@ function createPieChartRuntime(chart, getters) {
|
|
|
8017
8017
|
|
|
8018
8018
|
function checkKeyValue(definition) {
|
|
8019
8019
|
return definition.keyValue && !rangeReference.test(definition.keyValue)
|
|
8020
|
-
?
|
|
8020
|
+
? 35 /* CommandResult.InvalidScorecardKeyValue */
|
|
8021
8021
|
: 0 /* CommandResult.Success */;
|
|
8022
8022
|
}
|
|
8023
8023
|
function checkBaseline(definition) {
|
|
8024
8024
|
return definition.baseline && !rangeReference.test(definition.baseline)
|
|
8025
|
-
?
|
|
8025
|
+
? 36 /* CommandResult.InvalidScorecardBaseline */
|
|
8026
8026
|
: 0 /* CommandResult.Success */;
|
|
8027
8027
|
}
|
|
8028
8028
|
class ScorecardChart extends AbstractChart {
|
|
@@ -8528,7 +8528,7 @@ const AddMergeInteractiveContent = {
|
|
|
8528
8528
|
};
|
|
8529
8529
|
function interactiveAddMerge(env, sheetId, target) {
|
|
8530
8530
|
const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
|
|
8531
|
-
if (result.isCancelledBecause(
|
|
8531
|
+
if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
|
|
8532
8532
|
env.raiseError(AddMergeInteractiveContent.MergeInFilter);
|
|
8533
8533
|
}
|
|
8534
8534
|
else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
|
|
@@ -8778,7 +8778,7 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
|
8778
8778
|
});
|
|
8779
8779
|
}
|
|
8780
8780
|
}
|
|
8781
|
-
if (result.isCancelledBecause(
|
|
8781
|
+
if (result.isCancelledBecause(64 /* CommandResult.InvalidSortZone */)) {
|
|
8782
8782
|
const { col, row } = anchor;
|
|
8783
8783
|
env.model.selection.selectZone({ cell: { col, row }, zone });
|
|
8784
8784
|
env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
|
|
@@ -8801,13 +8801,13 @@ const AddFilterInteractiveContent = {
|
|
|
8801
8801
|
};
|
|
8802
8802
|
function interactiveAddFilter(env, sheetId, target) {
|
|
8803
8803
|
const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
|
|
8804
|
-
if (result.isCancelledBecause(
|
|
8804
|
+
if (result.isCancelledBecause(79 /* CommandResult.FilterOverlap */)) {
|
|
8805
8805
|
env.raiseError(AddFilterInteractiveContent.filterOverlap);
|
|
8806
8806
|
}
|
|
8807
|
-
else if (result.isCancelledBecause(
|
|
8807
|
+
else if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
|
|
8808
8808
|
env.raiseError(AddFilterInteractiveContent.mergeInFilter);
|
|
8809
8809
|
}
|
|
8810
|
-
else if (result.isCancelledBecause(
|
|
8810
|
+
else if (result.isCancelledBecause(82 /* CommandResult.NonContinuousTargets */)) {
|
|
8811
8811
|
env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
|
|
8812
8812
|
}
|
|
8813
8813
|
}
|
|
@@ -8829,7 +8829,7 @@ function handlePasteResult(env, result) {
|
|
|
8829
8829
|
else if (result.reasons.includes(22 /* CommandResult.WrongFigurePasteOption */)) {
|
|
8830
8830
|
env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
|
|
8831
8831
|
}
|
|
8832
|
-
else if (result.reasons.includes(
|
|
8832
|
+
else if (result.reasons.includes(76 /* CommandResult.FrozenPaneOverlap */)) {
|
|
8833
8833
|
env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
|
|
8834
8834
|
}
|
|
8835
8835
|
}
|
|
@@ -16987,7 +16987,7 @@ function interactiveFreezeColumnsRows(env, dimension, base) {
|
|
|
16987
16987
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
16988
16988
|
const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
|
|
16989
16989
|
const result = env.model.dispatch(cmd, { sheetId, quantity: base });
|
|
16990
|
-
if (result.isCancelledBecause(
|
|
16990
|
+
if (result.isCancelledBecause(66 /* CommandResult.MergeOverlap */)) {
|
|
16991
16991
|
env.raiseError(MergeErrorMessage);
|
|
16992
16992
|
}
|
|
16993
16993
|
}
|
|
@@ -18010,10 +18010,10 @@ class LineBarPieConfigPanel extends owl.Component {
|
|
|
18010
18010
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
18011
18011
|
}
|
|
18012
18012
|
get isDatasetInvalid() {
|
|
18013
|
-
return !!this.state.datasetDispatchResult?.isCancelledBecause(
|
|
18013
|
+
return !!this.state.datasetDispatchResult?.isCancelledBecause(33 /* CommandResult.InvalidDataSet */);
|
|
18014
18014
|
}
|
|
18015
18015
|
get isLabelInvalid() {
|
|
18016
|
-
return !!this.state.labelsDispatchResult?.isCancelledBecause(
|
|
18016
|
+
return !!this.state.labelsDispatchResult?.isCancelledBecause(34 /* CommandResult.InvalidLabelRange */);
|
|
18017
18017
|
}
|
|
18018
18018
|
onUpdateDataSetsHaveTitle(ev) {
|
|
18019
18019
|
this.props.updateChart(this.props.figureId, {
|
|
@@ -18455,7 +18455,7 @@ class GaugeChartConfigPanel extends owl.Component {
|
|
|
18455
18455
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
18456
18456
|
}
|
|
18457
18457
|
get isDataRangeInvalid() {
|
|
18458
|
-
return !!this.state.dataRangeDispatchResult?.isCancelledBecause(
|
|
18458
|
+
return !!this.state.dataRangeDispatchResult?.isCancelledBecause(37 /* CommandResult.InvalidGaugeDataRange */);
|
|
18459
18459
|
}
|
|
18460
18460
|
onDataRangeChanged(ranges) {
|
|
18461
18461
|
this.dataRange = ranges[0];
|
|
@@ -18529,25 +18529,25 @@ class GaugeChartDesignPanel extends owl.Component {
|
|
|
18529
18529
|
});
|
|
18530
18530
|
}
|
|
18531
18531
|
isRangeMinInvalid() {
|
|
18532
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18533
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18534
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18532
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(38 /* CommandResult.EmptyGaugeRangeMin */) ||
|
|
18533
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(39 /* CommandResult.GaugeRangeMinNaN */) ||
|
|
18534
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
|
|
18535
18535
|
}
|
|
18536
18536
|
isRangeMaxInvalid() {
|
|
18537
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18538
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18539
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18537
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMax */) ||
|
|
18538
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(41 /* CommandResult.GaugeRangeMaxNaN */) ||
|
|
18539
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
|
|
18540
18540
|
}
|
|
18541
18541
|
// ---------------------------------------------------------------------------
|
|
18542
18542
|
// COLOR_SECTION_TEMPLATE
|
|
18543
18543
|
// ---------------------------------------------------------------------------
|
|
18544
18544
|
get isLowerInflectionPointInvalid() {
|
|
18545
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18546
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18545
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(43 /* CommandResult.GaugeLowerInflectionPointNaN */) ||
|
|
18546
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */));
|
|
18547
18547
|
}
|
|
18548
18548
|
get isUpperInflectionPointInvalid() {
|
|
18549
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18550
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18549
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(44 /* CommandResult.GaugeUpperInflectionPointNaN */) ||
|
|
18550
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */));
|
|
18551
18551
|
}
|
|
18552
18552
|
updateInflectionPointValue(attr, ev) {
|
|
18553
18553
|
const sectionRule = deepCopy(this.props.definition.sectionRule);
|
|
@@ -18655,10 +18655,10 @@ class ScorecardChartConfigPanel extends owl.Component {
|
|
|
18655
18655
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
18656
18656
|
}
|
|
18657
18657
|
get isKeyValueInvalid() {
|
|
18658
|
-
return !!this.state.keyValueDispatchResult?.isCancelledBecause(
|
|
18658
|
+
return !!this.state.keyValueDispatchResult?.isCancelledBecause(35 /* CommandResult.InvalidScorecardKeyValue */);
|
|
18659
18659
|
}
|
|
18660
18660
|
get isBaselineInvalid() {
|
|
18661
|
-
return !!this.state.keyValueDispatchResult?.isCancelledBecause(
|
|
18661
|
+
return !!this.state.keyValueDispatchResult?.isCancelledBecause(36 /* CommandResult.InvalidScorecardBaseline */);
|
|
18662
18662
|
}
|
|
18663
18663
|
onKeyValueRangeChanged(ranges) {
|
|
18664
18664
|
this.keyValue = ranges[0];
|
|
@@ -19518,10 +19518,10 @@ class ConditionalFormattingPanel extends owl.Component {
|
|
|
19518
19518
|
* Cell Is Rule
|
|
19519
19519
|
****************************************************************************/
|
|
19520
19520
|
get isValue1Invalid() {
|
|
19521
|
-
return !!this.state.errors?.includes(
|
|
19521
|
+
return !!this.state.errors?.includes(52 /* CommandResult.FirstArgMissing */);
|
|
19522
19522
|
}
|
|
19523
19523
|
get isValue2Invalid() {
|
|
19524
|
-
return !!this.state.errors?.includes(
|
|
19524
|
+
return !!this.state.errors?.includes(53 /* CommandResult.SecondArgMissing */);
|
|
19525
19525
|
}
|
|
19526
19526
|
toggleStyle(tool) {
|
|
19527
19527
|
const style = this.state.rules.cellIs.style;
|
|
@@ -19538,17 +19538,17 @@ class ConditionalFormattingPanel extends owl.Component {
|
|
|
19538
19538
|
isValueInvalid(threshold) {
|
|
19539
19539
|
switch (threshold) {
|
|
19540
19540
|
case "minimum":
|
|
19541
|
-
return (this.state.errors.includes(
|
|
19542
|
-
this.state.errors.includes(
|
|
19543
|
-
this.state.errors.includes(
|
|
19544
|
-
this.state.errors.includes(
|
|
19541
|
+
return (this.state.errors.includes(59 /* CommandResult.MinInvalidFormula */) ||
|
|
19542
|
+
this.state.errors.includes(51 /* CommandResult.MinBiggerThanMid */) ||
|
|
19543
|
+
this.state.errors.includes(48 /* CommandResult.MinBiggerThanMax */) ||
|
|
19544
|
+
this.state.errors.includes(54 /* CommandResult.MinNaN */));
|
|
19545
19545
|
case "midpoint":
|
|
19546
|
-
return (this.state.errors.includes(
|
|
19547
|
-
this.state.errors.includes(
|
|
19548
|
-
this.state.errors.includes(
|
|
19546
|
+
return (this.state.errors.includes(60 /* CommandResult.MidInvalidFormula */) ||
|
|
19547
|
+
this.state.errors.includes(55 /* CommandResult.MidNaN */) ||
|
|
19548
|
+
this.state.errors.includes(50 /* CommandResult.MidBiggerThanMax */));
|
|
19549
19549
|
case "maximum":
|
|
19550
|
-
return (this.state.errors.includes(
|
|
19551
|
-
this.state.errors.includes(
|
|
19550
|
+
return (this.state.errors.includes(61 /* CommandResult.MaxInvalidFormula */) ||
|
|
19551
|
+
this.state.errors.includes(56 /* CommandResult.MaxNaN */));
|
|
19552
19552
|
default:
|
|
19553
19553
|
return false;
|
|
19554
19554
|
}
|
|
@@ -19596,13 +19596,13 @@ class ConditionalFormattingPanel extends owl.Component {
|
|
|
19596
19596
|
isInflectionPointInvalid(inflectionPoint) {
|
|
19597
19597
|
switch (inflectionPoint) {
|
|
19598
19598
|
case "lowerInflectionPoint":
|
|
19599
|
-
return (this.state.errors.includes(
|
|
19600
|
-
this.state.errors.includes(
|
|
19601
|
-
this.state.errors.includes(
|
|
19599
|
+
return (this.state.errors.includes(58 /* CommandResult.ValueLowerInflectionNaN */) ||
|
|
19600
|
+
this.state.errors.includes(63 /* CommandResult.ValueLowerInvalidFormula */) ||
|
|
19601
|
+
this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
|
|
19602
19602
|
case "upperInflectionPoint":
|
|
19603
|
-
return (this.state.errors.includes(
|
|
19604
|
-
this.state.errors.includes(
|
|
19605
|
-
this.state.errors.includes(
|
|
19603
|
+
return (this.state.errors.includes(57 /* CommandResult.ValueUpperInflectionNaN */) ||
|
|
19604
|
+
this.state.errors.includes(62 /* CommandResult.ValueUpperInvalidFormula */) ||
|
|
19605
|
+
this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
|
|
19606
19606
|
default:
|
|
19607
19607
|
return true;
|
|
19608
19608
|
}
|
|
@@ -19913,7 +19913,7 @@ const SplitToColumnsInteractiveContent = {
|
|
|
19913
19913
|
};
|
|
19914
19914
|
function interactiveSplitToColumns(env, separator, addNewColumns) {
|
|
19915
19915
|
let result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", { separator, addNewColumns });
|
|
19916
|
-
if (result.isCancelledBecause(
|
|
19916
|
+
if (result.isCancelledBecause(91 /* CommandResult.SplitWillOverwriteContent */)) {
|
|
19917
19917
|
env.askConfirmation(SplitToColumnsInteractiveContent.SplitIsDestructive, () => {
|
|
19918
19918
|
result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", {
|
|
19919
19919
|
separator,
|
|
@@ -19976,8 +19976,8 @@ class SplitIntoColumnsPanel extends owl.Component {
|
|
|
19976
19976
|
const errors = new Set();
|
|
19977
19977
|
for (const reason of cancelledReasons) {
|
|
19978
19978
|
switch (reason) {
|
|
19979
|
-
case
|
|
19980
|
-
case
|
|
19979
|
+
case 91 /* CommandResult.SplitWillOverwriteContent */:
|
|
19980
|
+
case 90 /* CommandResult.EmptySplitSeparator */:
|
|
19981
19981
|
break;
|
|
19982
19982
|
default:
|
|
19983
19983
|
errors.add(SplitToColumnsTerms.Errors[reason] || SplitToColumnsTerms.Errors.Unexpected);
|
|
@@ -19992,8 +19992,8 @@ class SplitIntoColumnsPanel extends owl.Component {
|
|
|
19992
19992
|
addNewColumns: this.state.addNewColumns,
|
|
19993
19993
|
force: false,
|
|
19994
19994
|
}).reasons;
|
|
19995
|
-
if (cancelledReasons.includes(
|
|
19996
|
-
warnings.push(SplitToColumnsTerms.Errors[
|
|
19995
|
+
if (cancelledReasons.includes(91 /* CommandResult.SplitWillOverwriteContent */)) {
|
|
19996
|
+
warnings.push(SplitToColumnsTerms.Errors[91 /* CommandResult.SplitWillOverwriteContent */]);
|
|
19997
19997
|
}
|
|
19998
19998
|
return warnings;
|
|
19999
19999
|
}
|
|
@@ -29519,7 +29519,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
29519
29519
|
const currentBorder = this.getCellBorder(cmd);
|
|
29520
29520
|
const areAllNewBordersUndefined = !cmd.border?.bottom && !cmd.border?.left && !cmd.border?.right && !cmd.border?.top;
|
|
29521
29521
|
if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
|
|
29522
|
-
return
|
|
29522
|
+
return 94 /* CommandResult.NoChanges */;
|
|
29523
29523
|
}
|
|
29524
29524
|
return 0 /* CommandResult.Success */;
|
|
29525
29525
|
}
|
|
@@ -29764,6 +29764,10 @@ class CellPlugin extends CorePlugin {
|
|
|
29764
29764
|
format: cell.format ? getItemId(cell.format, formats) : undefined,
|
|
29765
29765
|
content: cell.content || undefined,
|
|
29766
29766
|
};
|
|
29767
|
+
// if there is a formula but no dependencies (maybe because the cell is in error), no need to recompute the formula text
|
|
29768
|
+
if (cell.isFormula && cell.dependencies.length) {
|
|
29769
|
+
cells[xc].content = this.buildFormulaContent(_sheet.id, cell, cell.dependencies, true);
|
|
29770
|
+
}
|
|
29767
29771
|
}
|
|
29768
29772
|
_sheet.cells = cells;
|
|
29769
29773
|
}
|
|
@@ -29798,13 +29802,13 @@ class CellPlugin extends CorePlugin {
|
|
|
29798
29802
|
/*
|
|
29799
29803
|
* Reconstructs the original formula string based on a normalized form and its dependencies
|
|
29800
29804
|
*/
|
|
29801
|
-
buildFormulaContent(sheetId, cell, dependencies) {
|
|
29805
|
+
buildFormulaContent(sheetId, cell, dependencies, useFixedZone = false) {
|
|
29802
29806
|
const ranges = dependencies || cell.dependencies;
|
|
29803
29807
|
let rangeIndex = 0;
|
|
29804
29808
|
return concat(cell.compiledFormula.tokens.map((token) => {
|
|
29805
29809
|
if (token.type === "REFERENCE") {
|
|
29806
29810
|
const range = ranges[rangeIndex++];
|
|
29807
|
-
return this.getters.getRangeString(range, sheetId);
|
|
29811
|
+
return this.getters.getRangeString(range, sheetId, useFixedZone);
|
|
29808
29812
|
}
|
|
29809
29813
|
return token.value;
|
|
29810
29814
|
}));
|
|
@@ -30041,9 +30045,9 @@ class CellPlugin extends CorePlugin {
|
|
|
30041
30045
|
checkUselessClearCell(cmd) {
|
|
30042
30046
|
const cell = this.getters.getCell(cmd);
|
|
30043
30047
|
if (!cell)
|
|
30044
|
-
return
|
|
30048
|
+
return 94 /* CommandResult.NoChanges */;
|
|
30045
30049
|
if (!cell.content && !cell.style && !cell.format) {
|
|
30046
|
-
return
|
|
30050
|
+
return 94 /* CommandResult.NoChanges */;
|
|
30047
30051
|
}
|
|
30048
30052
|
return 0 /* CommandResult.Success */;
|
|
30049
30053
|
}
|
|
@@ -30243,13 +30247,13 @@ class ChartPlugin extends CorePlugin {
|
|
|
30243
30247
|
}
|
|
30244
30248
|
checkChartDuplicate(cmd) {
|
|
30245
30249
|
return this.getters.getFigureSheetId(cmd.id)
|
|
30246
|
-
?
|
|
30250
|
+
? 85 /* CommandResult.DuplicatedChartId */
|
|
30247
30251
|
: 0 /* CommandResult.Success */;
|
|
30248
30252
|
}
|
|
30249
30253
|
checkChartExists(cmd) {
|
|
30250
30254
|
return this.getters.getFigureSheetId(cmd.id)
|
|
30251
30255
|
? 0 /* CommandResult.Success */
|
|
30252
|
-
:
|
|
30256
|
+
: 86 /* CommandResult.ChartDoesNotExist */;
|
|
30253
30257
|
}
|
|
30254
30258
|
}
|
|
30255
30259
|
|
|
@@ -30354,7 +30358,13 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30354
30358
|
}
|
|
30355
30359
|
}
|
|
30356
30360
|
exportForExcel(data) {
|
|
30357
|
-
|
|
30361
|
+
if (data.sheets) {
|
|
30362
|
+
for (let sheet of data.sheets) {
|
|
30363
|
+
if (this.cfRules[sheet.id]) {
|
|
30364
|
+
sheet.conditionalFormats = this.cfRules[sheet.id].map((rule) => this.mapToConditionalFormat(sheet.id, rule, { useFixedReference: true }));
|
|
30365
|
+
}
|
|
30366
|
+
}
|
|
30367
|
+
}
|
|
30358
30368
|
}
|
|
30359
30369
|
// ---------------------------------------------------------------------------
|
|
30360
30370
|
// Getters
|
|
@@ -30403,11 +30413,11 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30403
30413
|
// ---------------------------------------------------------------------------
|
|
30404
30414
|
// Private
|
|
30405
30415
|
// ---------------------------------------------------------------------------
|
|
30406
|
-
mapToConditionalFormat(sheetId, cf) {
|
|
30416
|
+
mapToConditionalFormat(sheetId, cf, options = { useFixedReference: false }) {
|
|
30407
30417
|
return {
|
|
30408
30418
|
...cf,
|
|
30409
30419
|
ranges: cf.ranges.map((range) => {
|
|
30410
|
-
return this.getters.getRangeString(range, sheetId);
|
|
30420
|
+
return this.getters.getRangeString(range, sheetId, options.useFixedReference);
|
|
30411
30421
|
}),
|
|
30412
30422
|
};
|
|
30413
30423
|
}
|
|
@@ -30440,10 +30450,10 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30440
30450
|
return 27 /* CommandResult.InvalidSheetId */;
|
|
30441
30451
|
const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
|
|
30442
30452
|
if (ruleIndex === -1)
|
|
30443
|
-
return
|
|
30453
|
+
return 72 /* CommandResult.InvalidConditionalFormatId */;
|
|
30444
30454
|
const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
|
|
30445
30455
|
if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
|
|
30446
|
-
return
|
|
30456
|
+
return 72 /* CommandResult.InvalidConditionalFormatId */;
|
|
30447
30457
|
}
|
|
30448
30458
|
return 0 /* CommandResult.Success */;
|
|
30449
30459
|
}
|
|
@@ -30484,10 +30494,10 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30484
30494
|
const errors = [];
|
|
30485
30495
|
const isEmpty = (value) => value === undefined || value === "";
|
|
30486
30496
|
if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
|
|
30487
|
-
errors.push(
|
|
30497
|
+
errors.push(52 /* CommandResult.FirstArgMissing */);
|
|
30488
30498
|
}
|
|
30489
30499
|
if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
|
|
30490
|
-
errors.push(
|
|
30500
|
+
errors.push(53 /* CommandResult.SecondArgMissing */);
|
|
30491
30501
|
}
|
|
30492
30502
|
return errors.length ? errors : 0 /* CommandResult.Success */;
|
|
30493
30503
|
}
|
|
@@ -30499,15 +30509,15 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30499
30509
|
(threshold.value === "" || isNaN(threshold.value))) {
|
|
30500
30510
|
switch (thresholdName) {
|
|
30501
30511
|
case "min":
|
|
30502
|
-
return
|
|
30512
|
+
return 54 /* CommandResult.MinNaN */;
|
|
30503
30513
|
case "max":
|
|
30504
|
-
return
|
|
30514
|
+
return 56 /* CommandResult.MaxNaN */;
|
|
30505
30515
|
case "mid":
|
|
30506
|
-
return
|
|
30516
|
+
return 55 /* CommandResult.MidNaN */;
|
|
30507
30517
|
case "upperInflectionPoint":
|
|
30508
|
-
return
|
|
30518
|
+
return 57 /* CommandResult.ValueUpperInflectionNaN */;
|
|
30509
30519
|
case "lowerInflectionPoint":
|
|
30510
|
-
return
|
|
30520
|
+
return 58 /* CommandResult.ValueLowerInflectionNaN */;
|
|
30511
30521
|
}
|
|
30512
30522
|
}
|
|
30513
30523
|
return 0 /* CommandResult.Success */;
|
|
@@ -30521,15 +30531,15 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30521
30531
|
catch (error) {
|
|
30522
30532
|
switch (thresholdName) {
|
|
30523
30533
|
case "min":
|
|
30524
|
-
return
|
|
30534
|
+
return 59 /* CommandResult.MinInvalidFormula */;
|
|
30525
30535
|
case "max":
|
|
30526
|
-
return
|
|
30536
|
+
return 61 /* CommandResult.MaxInvalidFormula */;
|
|
30527
30537
|
case "mid":
|
|
30528
|
-
return
|
|
30538
|
+
return 60 /* CommandResult.MidInvalidFormula */;
|
|
30529
30539
|
case "upperInflectionPoint":
|
|
30530
|
-
return
|
|
30540
|
+
return 62 /* CommandResult.ValueUpperInvalidFormula */;
|
|
30531
30541
|
case "lowerInflectionPoint":
|
|
30532
|
-
return
|
|
30542
|
+
return 63 /* CommandResult.ValueLowerInvalidFormula */;
|
|
30533
30543
|
}
|
|
30534
30544
|
}
|
|
30535
30545
|
return 0 /* CommandResult.Success */;
|
|
@@ -30546,7 +30556,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30546
30556
|
if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
|
|
30547
30557
|
rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
|
|
30548
30558
|
Number(minValue) > Number(maxValue)) {
|
|
30549
|
-
return
|
|
30559
|
+
return 49 /* CommandResult.LowerBiggerThanUpper */;
|
|
30550
30560
|
}
|
|
30551
30561
|
return 0 /* CommandResult.Success */;
|
|
30552
30562
|
}
|
|
@@ -30556,7 +30566,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30556
30566
|
if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
|
|
30557
30567
|
rule.minimum.type === rule.maximum.type &&
|
|
30558
30568
|
stringToNumber(minValue) >= stringToNumber(maxValue)) {
|
|
30559
|
-
return
|
|
30569
|
+
return 48 /* CommandResult.MinBiggerThanMax */;
|
|
30560
30570
|
}
|
|
30561
30571
|
return 0 /* CommandResult.Success */;
|
|
30562
30572
|
}
|
|
@@ -30567,7 +30577,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30567
30577
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
30568
30578
|
rule.midpoint.type === rule.maximum.type &&
|
|
30569
30579
|
stringToNumber(midValue) >= stringToNumber(maxValue)) {
|
|
30570
|
-
return
|
|
30580
|
+
return 50 /* CommandResult.MidBiggerThanMax */;
|
|
30571
30581
|
}
|
|
30572
30582
|
return 0 /* CommandResult.Success */;
|
|
30573
30583
|
}
|
|
@@ -30578,7 +30588,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30578
30588
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
30579
30589
|
rule.minimum.type === rule.midpoint.type &&
|
|
30580
30590
|
stringToNumber(minValue) >= stringToNumber(midValue)) {
|
|
30581
|
-
return
|
|
30591
|
+
return 51 /* CommandResult.MinBiggerThanMid */;
|
|
30582
30592
|
}
|
|
30583
30593
|
return 0 /* CommandResult.Success */;
|
|
30584
30594
|
}
|
|
@@ -30708,13 +30718,13 @@ class FigurePlugin extends CorePlugin {
|
|
|
30708
30718
|
}
|
|
30709
30719
|
checkFigureExists(sheetId, figureId) {
|
|
30710
30720
|
if (this.figures[sheetId]?.[figureId] === undefined) {
|
|
30711
|
-
return
|
|
30721
|
+
return 71 /* CommandResult.FigureDoesNotExist */;
|
|
30712
30722
|
}
|
|
30713
30723
|
return 0 /* CommandResult.Success */;
|
|
30714
30724
|
}
|
|
30715
30725
|
checkFigureDuplicate(figureId) {
|
|
30716
30726
|
if (Object.values(this.figures).find((sheet) => sheet?.[figureId])) {
|
|
30717
|
-
return
|
|
30727
|
+
return 83 /* CommandResult.DuplicatedFigureId */;
|
|
30718
30728
|
}
|
|
30719
30729
|
return 0 /* CommandResult.Success */;
|
|
30720
30730
|
}
|
|
@@ -30824,12 +30834,12 @@ class FiltersPlugin extends CorePlugin {
|
|
|
30824
30834
|
switch (cmd.type) {
|
|
30825
30835
|
case "CREATE_FILTER_TABLE":
|
|
30826
30836
|
if (!areZonesContinuous(...cmd.target)) {
|
|
30827
|
-
return
|
|
30837
|
+
return 82 /* CommandResult.NonContinuousTargets */;
|
|
30828
30838
|
}
|
|
30829
30839
|
const zone = union(...cmd.target);
|
|
30830
30840
|
const checkFilterOverlap = () => {
|
|
30831
30841
|
if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
|
|
30832
|
-
return
|
|
30842
|
+
return 79 /* CommandResult.FilterOverlap */;
|
|
30833
30843
|
}
|
|
30834
30844
|
return 0 /* CommandResult.Success */;
|
|
30835
30845
|
};
|
|
@@ -30837,7 +30847,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
30837
30847
|
const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
|
|
30838
30848
|
for (let merge of mergesInTarget) {
|
|
30839
30849
|
if (overlap(zone, merge)) {
|
|
30840
|
-
return
|
|
30850
|
+
return 81 /* CommandResult.MergeInFilter */;
|
|
30841
30851
|
}
|
|
30842
30852
|
}
|
|
30843
30853
|
return 0 /* CommandResult.Success */;
|
|
@@ -30847,7 +30857,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
30847
30857
|
for (let merge of cmd.target) {
|
|
30848
30858
|
for (let filterTable of this.getFilterTables(cmd.sheetId)) {
|
|
30849
30859
|
if (overlap(filterTable.zone, merge)) {
|
|
30850
|
-
return
|
|
30860
|
+
return 81 /* CommandResult.MergeInFilter */;
|
|
30851
30861
|
}
|
|
30852
30862
|
}
|
|
30853
30863
|
}
|
|
@@ -31332,10 +31342,10 @@ class HeaderVisibilityPlugin extends CorePlugin {
|
|
|
31332
31342
|
: this.getters.getNumberRows(cmd.sheetId);
|
|
31333
31343
|
const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
|
|
31334
31344
|
if (hiddenElements.size >= elements) {
|
|
31335
|
-
return
|
|
31345
|
+
return 67 /* CommandResult.TooManyHiddenElements */;
|
|
31336
31346
|
}
|
|
31337
31347
|
else if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
|
|
31338
|
-
return
|
|
31348
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
31339
31349
|
}
|
|
31340
31350
|
else {
|
|
31341
31351
|
return 0 /* CommandResult.Success */;
|
|
@@ -31878,7 +31888,7 @@ class MergePlugin extends CorePlugin {
|
|
|
31878
31888
|
for (const zone of target) {
|
|
31879
31889
|
for (const zone2 of target) {
|
|
31880
31890
|
if (zone !== zone2 && overlap(zone, zone2)) {
|
|
31881
|
-
return
|
|
31891
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
31882
31892
|
}
|
|
31883
31893
|
}
|
|
31884
31894
|
}
|
|
@@ -31892,7 +31902,7 @@ class MergePlugin extends CorePlugin {
|
|
|
31892
31902
|
for (const zone of target) {
|
|
31893
31903
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
31894
31904
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
31895
|
-
return
|
|
31905
|
+
return 76 /* CommandResult.FrozenPaneOverlap */;
|
|
31896
31906
|
}
|
|
31897
31907
|
}
|
|
31898
31908
|
return 0 /* CommandResult.Success */;
|
|
@@ -32350,8 +32360,9 @@ class RangeAdapter {
|
|
|
32350
32360
|
*
|
|
32351
32361
|
* @param range the range (received from getRangeFromXC or getRangeFromZone)
|
|
32352
32362
|
* @param forSheetId the id of the sheet where the range string is supposed to be used.
|
|
32363
|
+
* @param [useFixedZone=false] if true, the range will be returned with fixed row and column
|
|
32353
32364
|
*/
|
|
32354
|
-
getRangeString(range, forSheetId) {
|
|
32365
|
+
getRangeString(range, forSheetId, useFixedZone = false) {
|
|
32355
32366
|
if (!range) {
|
|
32356
32367
|
return INCORRECT_RANGE_STRING;
|
|
32357
32368
|
}
|
|
@@ -32378,7 +32389,7 @@ class RangeAdapter {
|
|
|
32378
32389
|
if (prefixSheet && !sheetName) {
|
|
32379
32390
|
return INCORRECT_RANGE_STRING;
|
|
32380
32391
|
}
|
|
32381
|
-
let rangeString = this.getRangePartString(rangeImpl, 0);
|
|
32392
|
+
let rangeString = this.getRangePartString(rangeImpl, 0, useFixedZone);
|
|
32382
32393
|
if (rangeImpl.parts && rangeImpl.parts.length === 2) {
|
|
32383
32394
|
// this if converts A2:A2 into A2 except if any part of the original range had fixed row or column (with $)
|
|
32384
32395
|
if (rangeImpl.zone.top !== rangeImpl.zone.bottom ||
|
|
@@ -32388,7 +32399,7 @@ class RangeAdapter {
|
|
|
32388
32399
|
rangeImpl.parts[1].rowFixed ||
|
|
32389
32400
|
rangeImpl.parts[1].colFixed) {
|
|
32390
32401
|
rangeString += ":";
|
|
32391
|
-
rangeString += this.getRangePartString(rangeImpl, 1);
|
|
32402
|
+
rangeString += this.getRangePartString(rangeImpl, 1, useFixedZone);
|
|
32392
32403
|
}
|
|
32393
32404
|
}
|
|
32394
32405
|
return `${prefixSheet ? sheetName + "!" : ""}${rangeString}`;
|
|
@@ -32418,13 +32429,13 @@ class RangeAdapter {
|
|
|
32418
32429
|
/**
|
|
32419
32430
|
* Get a Xc string that represent a part of a range
|
|
32420
32431
|
*/
|
|
32421
|
-
getRangePartString(range, part) {
|
|
32422
|
-
const colFixed = range.parts && range.parts[part]
|
|
32432
|
+
getRangePartString(range, part, useFixedZone = false) {
|
|
32433
|
+
const colFixed = range.parts && range.parts[part]?.colFixed ? "$" : "";
|
|
32423
32434
|
const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
|
|
32424
|
-
const rowFixed = range.parts && range.parts[part]
|
|
32435
|
+
const rowFixed = range.parts && range.parts[part]?.rowFixed ? "$" : "";
|
|
32425
32436
|
const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
|
|
32426
32437
|
let str = "";
|
|
32427
|
-
if (range.isFullCol) {
|
|
32438
|
+
if (range.isFullCol && !useFixedZone) {
|
|
32428
32439
|
if (part === 0 && range.unboundedZone.hasHeader) {
|
|
32429
32440
|
str = colFixed + col + rowFixed + row;
|
|
32430
32441
|
}
|
|
@@ -32432,7 +32443,7 @@ class RangeAdapter {
|
|
|
32432
32443
|
str = colFixed + col;
|
|
32433
32444
|
}
|
|
32434
32445
|
}
|
|
32435
|
-
else if (range.isFullRow) {
|
|
32446
|
+
else if (range.isFullRow && !useFixedZone) {
|
|
32436
32447
|
if (part === 0 && range.unboundedZone.hasHeader) {
|
|
32437
32448
|
str = colFixed + col + rowFixed + row;
|
|
32438
32449
|
}
|
|
@@ -32528,10 +32539,10 @@ class SheetPlugin extends CorePlugin {
|
|
|
32528
32539
|
? this.getNumberCols(cmd.sheetId)
|
|
32529
32540
|
: this.getNumberRows(cmd.sheetId);
|
|
32530
32541
|
if (cmd.base < 0 || cmd.base >= elements) {
|
|
32531
|
-
return
|
|
32542
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
32532
32543
|
}
|
|
32533
32544
|
else if (cmd.quantity <= 0) {
|
|
32534
|
-
return
|
|
32545
|
+
return 88 /* CommandResult.InvalidQuantity */;
|
|
32535
32546
|
}
|
|
32536
32547
|
return 0 /* CommandResult.Success */;
|
|
32537
32548
|
case "REMOVE_COLUMNS_ROWS": {
|
|
@@ -32539,7 +32550,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
32539
32550
|
? this.getNumberCols(cmd.sheetId)
|
|
32540
32551
|
: this.getNumberRows(cmd.sheetId);
|
|
32541
32552
|
if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
|
|
32542
|
-
return
|
|
32553
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
32543
32554
|
}
|
|
32544
32555
|
else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
|
|
32545
32556
|
return 8 /* CommandResult.NotEnoughElements */;
|
|
@@ -33005,18 +33016,18 @@ class SheetPlugin extends CorePlugin {
|
|
|
33005
33016
|
checkRowFreezeQuantity(cmd) {
|
|
33006
33017
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
|
|
33007
33018
|
? 0 /* CommandResult.Success */
|
|
33008
|
-
:
|
|
33019
|
+
: 75 /* CommandResult.InvalidFreezeQuantity */;
|
|
33009
33020
|
}
|
|
33010
33021
|
checkColFreezeQuantity(cmd) {
|
|
33011
33022
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
|
|
33012
33023
|
? 0 /* CommandResult.Success */
|
|
33013
|
-
:
|
|
33024
|
+
: 75 /* CommandResult.InvalidFreezeQuantity */;
|
|
33014
33025
|
}
|
|
33015
33026
|
checkRowFreezeOverlapMerge(cmd) {
|
|
33016
33027
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
33017
33028
|
for (let merge of merges) {
|
|
33018
33029
|
if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
|
|
33019
|
-
return
|
|
33030
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
33020
33031
|
}
|
|
33021
33032
|
}
|
|
33022
33033
|
return 0 /* CommandResult.Success */;
|
|
@@ -33025,7 +33036,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
33025
33036
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
33026
33037
|
for (let merge of merges) {
|
|
33027
33038
|
if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
|
|
33028
|
-
return
|
|
33039
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
33029
33040
|
}
|
|
33030
33041
|
}
|
|
33031
33042
|
return 0 /* CommandResult.Success */;
|
|
@@ -33756,10 +33767,8 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
33756
33767
|
* that are actually present in the grid.
|
|
33757
33768
|
*/
|
|
33758
33769
|
function range(range) {
|
|
33770
|
+
assertRangeValid(range);
|
|
33759
33771
|
const sheetId = range.sheetId;
|
|
33760
|
-
if (!isZoneValid(range.zone)) {
|
|
33761
|
-
throw new InvalidReferenceError();
|
|
33762
|
-
}
|
|
33763
33772
|
// Performance issue: Avoid fetching data on positions that are out of the spreadsheet
|
|
33764
33773
|
// e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
|
|
33765
33774
|
const sheetZone = getters.getSheetZone(sheetId);
|
|
@@ -33794,23 +33803,26 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
33794
33803
|
* The `compute` of the formula's function must process it completely
|
|
33795
33804
|
*/
|
|
33796
33805
|
function refFn(range, isMeta, functionName, paramNumber) {
|
|
33806
|
+
assertRangeValid(range);
|
|
33797
33807
|
if (isMeta) {
|
|
33798
33808
|
// Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
|
|
33799
33809
|
return { value: zoneToXc(range.zone) };
|
|
33800
33810
|
}
|
|
33801
|
-
if (!isZoneValid(range.zone)) {
|
|
33802
|
-
throw new InvalidReferenceError();
|
|
33803
|
-
}
|
|
33804
33811
|
// if the formula definition could have accepted a range, we would pass through the _range function and not here
|
|
33805
33812
|
if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
|
|
33806
33813
|
throw new Error(paramNumber
|
|
33807
33814
|
? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
|
|
33808
33815
|
: _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
|
|
33809
33816
|
}
|
|
33817
|
+
return readCell(range);
|
|
33818
|
+
}
|
|
33819
|
+
function assertRangeValid(range) {
|
|
33820
|
+
if (!isZoneValid(range.zone)) {
|
|
33821
|
+
throw new InvalidReferenceError();
|
|
33822
|
+
}
|
|
33810
33823
|
if (range.invalidSheetName) {
|
|
33811
33824
|
throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
|
|
33812
33825
|
}
|
|
33813
|
-
return readCell(range);
|
|
33814
33826
|
}
|
|
33815
33827
|
return [refFn, range, evalContext];
|
|
33816
33828
|
}
|
|
@@ -34295,7 +34307,7 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
34295
34307
|
switch (cmd.type) {
|
|
34296
34308
|
case "UPDATE_FILTER":
|
|
34297
34309
|
if (!this.getters.getFilterId(cmd)) {
|
|
34298
|
-
return
|
|
34310
|
+
return 80 /* CommandResult.FilterNotFound */;
|
|
34299
34311
|
}
|
|
34300
34312
|
break;
|
|
34301
34313
|
}
|
|
@@ -35265,7 +35277,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
35265
35277
|
}
|
|
35266
35278
|
checkPositiveDimension(cmd) {
|
|
35267
35279
|
if (cmd.width < 0 || cmd.height < 0) {
|
|
35268
|
-
return
|
|
35280
|
+
return 69 /* CommandResult.InvalidViewportSize */;
|
|
35269
35281
|
}
|
|
35270
35282
|
return 0 /* CommandResult.Success */;
|
|
35271
35283
|
}
|
|
@@ -35275,7 +35287,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
35275
35287
|
cmd.gridOffsetY === this.gridOffsetY &&
|
|
35276
35288
|
cmd.width === width &&
|
|
35277
35289
|
cmd.height === height) {
|
|
35278
|
-
return
|
|
35290
|
+
return 77 /* CommandResult.ValuesNotChanged */;
|
|
35279
35291
|
}
|
|
35280
35292
|
return 0 /* CommandResult.Success */;
|
|
35281
35293
|
}
|
|
@@ -35283,7 +35295,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
35283
35295
|
const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
|
|
35284
35296
|
if ((!pane.canScrollHorizontally && offsetX > 0) ||
|
|
35285
35297
|
(!pane.canScrollVertically && offsetY > 0)) {
|
|
35286
|
-
return
|
|
35298
|
+
return 70 /* CommandResult.InvalidScrollingDirection */;
|
|
35287
35299
|
}
|
|
35288
35300
|
return 0 /* CommandResult.Success */;
|
|
35289
35301
|
}
|
|
@@ -35538,7 +35550,7 @@ class AutofillPlugin extends UIPlugin {
|
|
|
35538
35550
|
if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
|
|
35539
35551
|
return 0 /* CommandResult.Success */;
|
|
35540
35552
|
}
|
|
35541
|
-
return
|
|
35553
|
+
return 46 /* CommandResult.InvalidAutofillSelection */;
|
|
35542
35554
|
case "AUTOFILL_AUTO":
|
|
35543
35555
|
const zone = this.getters.getSelectedZone();
|
|
35544
35556
|
return zone.top === zone.bottom
|
|
@@ -36142,7 +36154,7 @@ class CellPopoverPlugin extends UIPlugin {
|
|
|
36142
36154
|
cellPopoverRegistry.get(cmd.popoverType);
|
|
36143
36155
|
}
|
|
36144
36156
|
catch (error) {
|
|
36145
|
-
return
|
|
36157
|
+
return 73 /* CommandResult.InvalidCellPopover */;
|
|
36146
36158
|
}
|
|
36147
36159
|
return 0 /* CommandResult.Success */;
|
|
36148
36160
|
default:
|
|
@@ -38278,21 +38290,6 @@ class SelectionInputPlugin extends UIPlugin {
|
|
|
38278
38290
|
// ---------------------------------------------------------------------------
|
|
38279
38291
|
// Command Handling
|
|
38280
38292
|
// ---------------------------------------------------------------------------
|
|
38281
|
-
allowDispatch(cmd) {
|
|
38282
|
-
switch (cmd.type) {
|
|
38283
|
-
case "ADD_EMPTY_RANGE":
|
|
38284
|
-
if (this.inputHasSingleRange && this.ranges.length === 1) {
|
|
38285
|
-
return 30 /* CommandResult.MaximumRangesReached */;
|
|
38286
|
-
}
|
|
38287
|
-
break;
|
|
38288
|
-
case "CHANGE_RANGE":
|
|
38289
|
-
if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
38290
|
-
return 30 /* CommandResult.MaximumRangesReached */;
|
|
38291
|
-
}
|
|
38292
|
-
break;
|
|
38293
|
-
}
|
|
38294
|
-
return 0 /* CommandResult.Success */;
|
|
38295
|
-
}
|
|
38296
38293
|
handleEvent(event) {
|
|
38297
38294
|
const xc = zoneToXc(event.anchor.zone);
|
|
38298
38295
|
const inputSheetId = this.activeSheet;
|
|
@@ -38508,6 +38505,15 @@ class SelectionInputsManagerPlugin extends UIPlugin {
|
|
|
38508
38505
|
// Command Handling
|
|
38509
38506
|
// ---------------------------------------------------------------------------
|
|
38510
38507
|
allowDispatch(cmd) {
|
|
38508
|
+
switch (cmd.type) {
|
|
38509
|
+
case "FOCUS_RANGE":
|
|
38510
|
+
case "CHANGE_RANGE":
|
|
38511
|
+
case "ADD_EMPTY_RANGE":
|
|
38512
|
+
case "REMOVE_RANGE":
|
|
38513
|
+
if (!this.inputs[cmd.id]) {
|
|
38514
|
+
return 31 /* CommandResult.InvalidInputId */;
|
|
38515
|
+
}
|
|
38516
|
+
}
|
|
38511
38517
|
switch (cmd.type) {
|
|
38512
38518
|
case "FOCUS_RANGE":
|
|
38513
38519
|
const index = this.currentInput?.getIndex(cmd.rangeId);
|
|
@@ -38515,9 +38521,19 @@ class SelectionInputsManagerPlugin extends UIPlugin {
|
|
|
38515
38521
|
return 29 /* CommandResult.InputAlreadyFocused */;
|
|
38516
38522
|
}
|
|
38517
38523
|
break;
|
|
38518
|
-
|
|
38519
|
-
|
|
38520
|
-
|
|
38524
|
+
case "ADD_EMPTY_RANGE":
|
|
38525
|
+
const input = this.inputs[cmd.id];
|
|
38526
|
+
if (input.inputHasSingleRange && input.ranges.length === 1) {
|
|
38527
|
+
return 30 /* CommandResult.MaximumRangesReached */;
|
|
38528
|
+
}
|
|
38529
|
+
break;
|
|
38530
|
+
case "CHANGE_RANGE": {
|
|
38531
|
+
const input = this.inputs[cmd.id];
|
|
38532
|
+
if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
38533
|
+
return 30 /* CommandResult.MaximumRangesReached */;
|
|
38534
|
+
}
|
|
38535
|
+
break;
|
|
38536
|
+
}
|
|
38521
38537
|
}
|
|
38522
38538
|
return 0 /* CommandResult.Success */;
|
|
38523
38539
|
}
|
|
@@ -38641,7 +38657,7 @@ class SortPlugin extends UIPlugin {
|
|
|
38641
38657
|
/*Test the presence of single cells*/
|
|
38642
38658
|
const singleCells = positions(zone).some(({ col, row }) => !this.getters.isInMerge({ sheetId, col, row }));
|
|
38643
38659
|
if (singleCells) {
|
|
38644
|
-
return
|
|
38660
|
+
return 64 /* CommandResult.InvalidSortZone */;
|
|
38645
38661
|
}
|
|
38646
38662
|
return 0 /* CommandResult.Success */;
|
|
38647
38663
|
}
|
|
@@ -38660,7 +38676,7 @@ class SortPlugin extends UIPlugin {
|
|
|
38660
38676
|
];
|
|
38661
38677
|
return widthCurrent === widthFirst && heightCurrent === heightFirst;
|
|
38662
38678
|
})) {
|
|
38663
|
-
return
|
|
38679
|
+
return 64 /* CommandResult.InvalidSortZone */;
|
|
38664
38680
|
}
|
|
38665
38681
|
return 0 /* CommandResult.Success */;
|
|
38666
38682
|
}
|
|
@@ -39163,7 +39179,7 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
39163
39179
|
const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.tryGetActiveSheetId();
|
|
39164
39180
|
const zones = this.getters.getCommandZones(cmd);
|
|
39165
39181
|
if (!sheetId && zones.length > 0) {
|
|
39166
|
-
return
|
|
39182
|
+
return 93 /* CommandResult.NoActiveSheet */;
|
|
39167
39183
|
}
|
|
39168
39184
|
if (sheetId && zones.length > 0) {
|
|
39169
39185
|
return this.getters.checkZonesExistInSheet(sheetId, zones);
|
|
@@ -39645,13 +39661,13 @@ class SplitToColumnsPlugin extends UIPlugin {
|
|
|
39645
39661
|
}
|
|
39646
39662
|
checkSingleColSelected() {
|
|
39647
39663
|
if (!this.getters.isSingleColSelected()) {
|
|
39648
|
-
return
|
|
39664
|
+
return 89 /* CommandResult.MoreThanOneColumnSelected */;
|
|
39649
39665
|
}
|
|
39650
39666
|
return 0 /* CommandResult.Success */;
|
|
39651
39667
|
}
|
|
39652
39668
|
checkNonEmptySelector(cmd) {
|
|
39653
39669
|
if (cmd.separator === "") {
|
|
39654
|
-
return
|
|
39670
|
+
return 90 /* CommandResult.EmptySplitSeparator */;
|
|
39655
39671
|
}
|
|
39656
39672
|
return 0 /* CommandResult.Success */;
|
|
39657
39673
|
}
|
|
@@ -39662,7 +39678,7 @@ class SplitToColumnsPlugin extends UIPlugin {
|
|
|
39662
39678
|
const selection = this.getters.getSelectedZones()[0];
|
|
39663
39679
|
const splitted = this.getSplittedCols(selection, cmd.separator);
|
|
39664
39680
|
if (this.willSplittedColsOverwriteContent(selection, splitted)) {
|
|
39665
|
-
return
|
|
39681
|
+
return 91 /* CommandResult.SplitWillOverwriteContent */;
|
|
39666
39682
|
}
|
|
39667
39683
|
return 0 /* CommandResult.Success */;
|
|
39668
39684
|
}
|
|
@@ -39673,7 +39689,7 @@ class SplitToColumnsPlugin extends UIPlugin {
|
|
|
39673
39689
|
return 0 /* CommandResult.Success */;
|
|
39674
39690
|
}
|
|
39675
39691
|
}
|
|
39676
|
-
return
|
|
39692
|
+
return 92 /* CommandResult.NoSplitSeparatorInSelection */;
|
|
39677
39693
|
}
|
|
39678
39694
|
}
|
|
39679
39695
|
|
|
@@ -39820,7 +39836,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
|
|
|
39820
39836
|
for (const zone of this.getPasteZones(target)) {
|
|
39821
39837
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
39822
39838
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
39823
|
-
return
|
|
39839
|
+
return 76 /* CommandResult.FrozenPaneOverlap */;
|
|
39824
39840
|
}
|
|
39825
39841
|
}
|
|
39826
39842
|
return 0 /* CommandResult.Success */;
|
|
@@ -40214,7 +40230,7 @@ class ClipboardFigureState {
|
|
|
40214
40230
|
}
|
|
40215
40231
|
isPasteAllowed(target, option) {
|
|
40216
40232
|
if (target.length === 0) {
|
|
40217
|
-
return
|
|
40233
|
+
return 74 /* CommandResult.EmptyTarget */;
|
|
40218
40234
|
}
|
|
40219
40235
|
if (option?.pasteOption !== undefined) {
|
|
40220
40236
|
return 22 /* CommandResult.WrongFigurePasteOption */;
|
|
@@ -40955,7 +40971,7 @@ class EditionPlugin extends UIPlugin {
|
|
|
40955
40971
|
validateSelection(length, start, end) {
|
|
40956
40972
|
return start >= 0 && start <= length && end >= 0 && end <= length
|
|
40957
40973
|
? 0 /* CommandResult.Success */
|
|
40958
|
-
:
|
|
40974
|
+
: 47 /* CommandResult.WrongComposerSelection */;
|
|
40959
40975
|
}
|
|
40960
40976
|
onColumnsRemoved(cmd) {
|
|
40961
40977
|
if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
|
|
@@ -41266,9 +41282,10 @@ class EditionPlugin extends UIPlugin {
|
|
|
41266
41282
|
*/
|
|
41267
41283
|
getReferencedRanges() {
|
|
41268
41284
|
const editionSheetId = this.getters.getCurrentEditedCell().sheetId;
|
|
41269
|
-
|
|
41285
|
+
const referenceRanges = this.currentTokens
|
|
41270
41286
|
.filter((token) => token.type === "REFERENCE")
|
|
41271
41287
|
.map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
|
|
41288
|
+
return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
|
|
41272
41289
|
}
|
|
41273
41290
|
/**
|
|
41274
41291
|
* Function used to determine when composer selection can start.
|
|
@@ -41907,7 +41924,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
41907
41924
|
const headers = [cmd.base, ...cmd.elements];
|
|
41908
41925
|
const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
|
|
41909
41926
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
41910
|
-
return
|
|
41927
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
41911
41928
|
}
|
|
41912
41929
|
return 0 /* CommandResult.Success */;
|
|
41913
41930
|
}
|
|
@@ -45256,7 +45273,7 @@ class SelectionStreamProcessorImpl {
|
|
|
45256
45273
|
*/
|
|
45257
45274
|
moveAnchorCell(direction, step = 1) {
|
|
45258
45275
|
if (step !== "end" && step <= 0) {
|
|
45259
|
-
return new DispatchResult(
|
|
45276
|
+
return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
|
|
45260
45277
|
}
|
|
45261
45278
|
const { col, row } = this.getNextAvailablePosition(direction, step);
|
|
45262
45279
|
return this.selectCell(col, row);
|
|
@@ -45302,7 +45319,7 @@ class SelectionStreamProcessorImpl {
|
|
|
45302
45319
|
*/
|
|
45303
45320
|
resizeAnchorZone(direction, step = 1) {
|
|
45304
45321
|
if (step !== "end" && step <= 0) {
|
|
45305
|
-
return new DispatchResult(
|
|
45322
|
+
return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
|
|
45306
45323
|
}
|
|
45307
45324
|
const sheetId = this.getters.getActiveSheetId();
|
|
45308
45325
|
const anchor = this.anchor;
|
|
@@ -46129,12 +46146,7 @@ function addFormula(cell) {
|
|
|
46129
46146
|
attrs.push(["t", "str"]);
|
|
46130
46147
|
cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
46131
46148
|
}
|
|
46132
|
-
node = escapeXml /*xml*/
|
|
46133
|
-
<f>
|
|
46134
|
-
${XlsxFormula}
|
|
46135
|
-
</f>
|
|
46136
|
-
${cycle}
|
|
46137
|
-
`;
|
|
46149
|
+
node = escapeXml /*xml*/ `<f> ${XlsxFormula} </f> ${cycle}`;
|
|
46138
46150
|
return { attrs, node };
|
|
46139
46151
|
}
|
|
46140
46152
|
else {
|
|
@@ -46956,11 +46968,10 @@ function addRows(construct, data, sheet) {
|
|
|
46956
46968
|
({ attrs: additionalAttrs, node: cellNode } = addContent(cell.content, construct.sharedStrings, isTableHeader));
|
|
46957
46969
|
}
|
|
46958
46970
|
attributes.push(...additionalAttrs);
|
|
46959
|
-
|
|
46960
|
-
|
|
46961
|
-
|
|
46962
|
-
|
|
46963
|
-
`);
|
|
46971
|
+
// prettier-ignore
|
|
46972
|
+
cellNodes.push(escapeXml /*xml*/ `<c ${formatAttributes(attributes)}>
|
|
46973
|
+
${cellNode}
|
|
46974
|
+
</c>`);
|
|
46964
46975
|
}
|
|
46965
46976
|
}
|
|
46966
46977
|
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden) {
|
|
@@ -47645,10 +47656,10 @@ class Model extends EventBus {
|
|
|
47645
47656
|
const command = createCommand(type, payload);
|
|
47646
47657
|
let status = this.status;
|
|
47647
47658
|
if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
|
|
47648
|
-
return new DispatchResult(
|
|
47659
|
+
return new DispatchResult(68 /* CommandResult.Readonly */);
|
|
47649
47660
|
}
|
|
47650
47661
|
if (!this.session.canApplyOptimisticUpdate()) {
|
|
47651
|
-
return new DispatchResult(
|
|
47662
|
+
return new DispatchResult(65 /* CommandResult.WaitingSessionConfirmation */);
|
|
47652
47663
|
}
|
|
47653
47664
|
switch (status) {
|
|
47654
47665
|
case 0 /* Status.Ready */:
|
|
@@ -47927,6 +47938,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
47927
47938
|
exports.tokenize = tokenize;
|
|
47928
47939
|
|
|
47929
47940
|
|
|
47930
|
-
__info__.version = '16.3.
|
|
47931
|
-
__info__.date = '2024-
|
|
47932
|
-
__info__.hash = '
|
|
47941
|
+
__info__.version = '16.3.24';
|
|
47942
|
+
__info__.date = '2024-02-02T13:45:48.440Z';
|
|
47943
|
+
__info__.hash = '0bf5f45';
|