@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
|
@@ -2073,27 +2073,30 @@ function detectFormat(content) {
|
|
|
2073
2073
|
}
|
|
2074
2074
|
function createLargeNumberFormat(format, magnitude, postFix) {
|
|
2075
2075
|
const internalFormat = parseFormat(format || "#,##0");
|
|
2076
|
-
const largeNumberFormat =
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
format: {
|
|
2083
|
-
...formatPart.format,
|
|
2084
|
-
magnitude,
|
|
2085
|
-
decimalPart: undefined,
|
|
2086
|
-
},
|
|
2087
|
-
},
|
|
2088
|
-
{
|
|
2089
|
-
type: "STRING",
|
|
2090
|
-
format: postFix,
|
|
2091
|
-
},
|
|
2092
|
-
];
|
|
2076
|
+
const largeNumberFormat = [];
|
|
2077
|
+
for (let i = 0; i < internalFormat.length; i++) {
|
|
2078
|
+
const formatPart = internalFormat[i];
|
|
2079
|
+
if (formatPart.type !== "NUMBER") {
|
|
2080
|
+
largeNumberFormat.push(formatPart);
|
|
2081
|
+
continue;
|
|
2093
2082
|
}
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2083
|
+
largeNumberFormat.push({
|
|
2084
|
+
...formatPart,
|
|
2085
|
+
format: {
|
|
2086
|
+
...formatPart.format,
|
|
2087
|
+
magnitude,
|
|
2088
|
+
decimalPart: undefined,
|
|
2089
|
+
},
|
|
2090
|
+
});
|
|
2091
|
+
largeNumberFormat.push({
|
|
2092
|
+
type: "STRING",
|
|
2093
|
+
format: postFix,
|
|
2094
|
+
});
|
|
2095
|
+
const nextFormatPart = internalFormat[i + 1];
|
|
2096
|
+
if (nextFormatPart?.type === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
|
|
2097
|
+
i++;
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2097
2100
|
return convertInternalFormatToFormat(largeNumberFormat);
|
|
2098
2101
|
}
|
|
2099
2102
|
function changeDecimalPlaces(format, step) {
|
|
@@ -4435,69 +4438,70 @@ var CommandResult;
|
|
|
4435
4438
|
CommandResult[CommandResult["InvalidFigureId"] = 28] = "InvalidFigureId";
|
|
4436
4439
|
CommandResult[CommandResult["InputAlreadyFocused"] = 29] = "InputAlreadyFocused";
|
|
4437
4440
|
CommandResult[CommandResult["MaximumRangesReached"] = 30] = "MaximumRangesReached";
|
|
4438
|
-
CommandResult[CommandResult["
|
|
4439
|
-
CommandResult[CommandResult["
|
|
4440
|
-
CommandResult[CommandResult["
|
|
4441
|
-
CommandResult[CommandResult["
|
|
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["
|
|
4441
|
+
CommandResult[CommandResult["InvalidInputId"] = 31] = "InvalidInputId";
|
|
4442
|
+
CommandResult[CommandResult["InvalidChartDefinition"] = 32] = "InvalidChartDefinition";
|
|
4443
|
+
CommandResult[CommandResult["InvalidDataSet"] = 33] = "InvalidDataSet";
|
|
4444
|
+
CommandResult[CommandResult["InvalidLabelRange"] = 34] = "InvalidLabelRange";
|
|
4445
|
+
CommandResult[CommandResult["InvalidScorecardKeyValue"] = 35] = "InvalidScorecardKeyValue";
|
|
4446
|
+
CommandResult[CommandResult["InvalidScorecardBaseline"] = 36] = "InvalidScorecardBaseline";
|
|
4447
|
+
CommandResult[CommandResult["InvalidGaugeDataRange"] = 37] = "InvalidGaugeDataRange";
|
|
4448
|
+
CommandResult[CommandResult["EmptyGaugeRangeMin"] = 38] = "EmptyGaugeRangeMin";
|
|
4449
|
+
CommandResult[CommandResult["GaugeRangeMinNaN"] = 39] = "GaugeRangeMinNaN";
|
|
4450
|
+
CommandResult[CommandResult["EmptyGaugeRangeMax"] = 40] = "EmptyGaugeRangeMax";
|
|
4451
|
+
CommandResult[CommandResult["GaugeRangeMaxNaN"] = 41] = "GaugeRangeMaxNaN";
|
|
4452
|
+
CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 42] = "GaugeRangeMinBiggerThanRangeMax";
|
|
4453
|
+
CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 43] = "GaugeLowerInflectionPointNaN";
|
|
4454
|
+
CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 44] = "GaugeUpperInflectionPointNaN";
|
|
4455
|
+
CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 45] = "GaugeLowerBiggerThanUpper";
|
|
4456
|
+
CommandResult[CommandResult["InvalidAutofillSelection"] = 46] = "InvalidAutofillSelection";
|
|
4457
|
+
CommandResult[CommandResult["WrongComposerSelection"] = 47] = "WrongComposerSelection";
|
|
4458
|
+
CommandResult[CommandResult["MinBiggerThanMax"] = 48] = "MinBiggerThanMax";
|
|
4459
|
+
CommandResult[CommandResult["LowerBiggerThanUpper"] = 49] = "LowerBiggerThanUpper";
|
|
4460
|
+
CommandResult[CommandResult["MidBiggerThanMax"] = 50] = "MidBiggerThanMax";
|
|
4461
|
+
CommandResult[CommandResult["MinBiggerThanMid"] = 51] = "MinBiggerThanMid";
|
|
4462
|
+
CommandResult[CommandResult["FirstArgMissing"] = 52] = "FirstArgMissing";
|
|
4463
|
+
CommandResult[CommandResult["SecondArgMissing"] = 53] = "SecondArgMissing";
|
|
4464
|
+
CommandResult[CommandResult["MinNaN"] = 54] = "MinNaN";
|
|
4465
|
+
CommandResult[CommandResult["MidNaN"] = 55] = "MidNaN";
|
|
4466
|
+
CommandResult[CommandResult["MaxNaN"] = 56] = "MaxNaN";
|
|
4467
|
+
CommandResult[CommandResult["ValueUpperInflectionNaN"] = 57] = "ValueUpperInflectionNaN";
|
|
4468
|
+
CommandResult[CommandResult["ValueLowerInflectionNaN"] = 58] = "ValueLowerInflectionNaN";
|
|
4469
|
+
CommandResult[CommandResult["MinInvalidFormula"] = 59] = "MinInvalidFormula";
|
|
4470
|
+
CommandResult[CommandResult["MidInvalidFormula"] = 60] = "MidInvalidFormula";
|
|
4471
|
+
CommandResult[CommandResult["MaxInvalidFormula"] = 61] = "MaxInvalidFormula";
|
|
4472
|
+
CommandResult[CommandResult["ValueUpperInvalidFormula"] = 62] = "ValueUpperInvalidFormula";
|
|
4473
|
+
CommandResult[CommandResult["ValueLowerInvalidFormula"] = 63] = "ValueLowerInvalidFormula";
|
|
4474
|
+
CommandResult[CommandResult["InvalidSortZone"] = 64] = "InvalidSortZone";
|
|
4475
|
+
CommandResult[CommandResult["WaitingSessionConfirmation"] = 65] = "WaitingSessionConfirmation";
|
|
4476
|
+
CommandResult[CommandResult["MergeOverlap"] = 66] = "MergeOverlap";
|
|
4477
|
+
CommandResult[CommandResult["TooManyHiddenElements"] = 67] = "TooManyHiddenElements";
|
|
4478
|
+
CommandResult[CommandResult["Readonly"] = 68] = "Readonly";
|
|
4479
|
+
CommandResult[CommandResult["InvalidViewportSize"] = 69] = "InvalidViewportSize";
|
|
4480
|
+
CommandResult[CommandResult["InvalidScrollingDirection"] = 70] = "InvalidScrollingDirection";
|
|
4481
|
+
CommandResult[CommandResult["FigureDoesNotExist"] = 71] = "FigureDoesNotExist";
|
|
4482
|
+
CommandResult[CommandResult["InvalidConditionalFormatId"] = 72] = "InvalidConditionalFormatId";
|
|
4483
|
+
CommandResult[CommandResult["InvalidCellPopover"] = 73] = "InvalidCellPopover";
|
|
4484
|
+
CommandResult[CommandResult["EmptyTarget"] = 74] = "EmptyTarget";
|
|
4485
|
+
CommandResult[CommandResult["InvalidFreezeQuantity"] = 75] = "InvalidFreezeQuantity";
|
|
4486
|
+
CommandResult[CommandResult["FrozenPaneOverlap"] = 76] = "FrozenPaneOverlap";
|
|
4487
|
+
CommandResult[CommandResult["ValuesNotChanged"] = 77] = "ValuesNotChanged";
|
|
4488
|
+
CommandResult[CommandResult["InvalidFilterZone"] = 78] = "InvalidFilterZone";
|
|
4489
|
+
CommandResult[CommandResult["FilterOverlap"] = 79] = "FilterOverlap";
|
|
4490
|
+
CommandResult[CommandResult["FilterNotFound"] = 80] = "FilterNotFound";
|
|
4491
|
+
CommandResult[CommandResult["MergeInFilter"] = 81] = "MergeInFilter";
|
|
4492
|
+
CommandResult[CommandResult["NonContinuousTargets"] = 82] = "NonContinuousTargets";
|
|
4493
|
+
CommandResult[CommandResult["DuplicatedFigureId"] = 83] = "DuplicatedFigureId";
|
|
4494
|
+
CommandResult[CommandResult["InvalidSelectionStep"] = 84] = "InvalidSelectionStep";
|
|
4495
|
+
CommandResult[CommandResult["DuplicatedChartId"] = 85] = "DuplicatedChartId";
|
|
4496
|
+
CommandResult[CommandResult["ChartDoesNotExist"] = 86] = "ChartDoesNotExist";
|
|
4497
|
+
CommandResult[CommandResult["InvalidHeaderIndex"] = 87] = "InvalidHeaderIndex";
|
|
4498
|
+
CommandResult[CommandResult["InvalidQuantity"] = 88] = "InvalidQuantity";
|
|
4499
|
+
CommandResult[CommandResult["MoreThanOneColumnSelected"] = 89] = "MoreThanOneColumnSelected";
|
|
4500
|
+
CommandResult[CommandResult["EmptySplitSeparator"] = 90] = "EmptySplitSeparator";
|
|
4501
|
+
CommandResult[CommandResult["SplitWillOverwriteContent"] = 91] = "SplitWillOverwriteContent";
|
|
4502
|
+
CommandResult[CommandResult["NoSplitSeparatorInSelection"] = 92] = "NoSplitSeparatorInSelection";
|
|
4503
|
+
CommandResult[CommandResult["NoActiveSheet"] = 93] = "NoActiveSheet";
|
|
4504
|
+
CommandResult[CommandResult["NoChanges"] = 94] = "NoChanges";
|
|
4501
4505
|
})(CommandResult || (CommandResult = {}));
|
|
4502
4506
|
|
|
4503
4507
|
const borderStyles = ["thin", "medium", "thick", "dashed", "dotted"];
|
|
@@ -6457,14 +6461,8 @@ function createDataSets(getters, dataSetsString, sheetId, dataSetsHaveTitle) {
|
|
|
6457
6461
|
: undefined));
|
|
6458
6462
|
}
|
|
6459
6463
|
}
|
|
6460
|
-
else if (zone.left === zone.right && zone.top === zone.bottom) {
|
|
6461
|
-
// A single cell. If it's only the title, the dataset is not added.
|
|
6462
|
-
if (!dataSetsHaveTitle) {
|
|
6463
|
-
dataSets.push(createDataSet(getters, dataSetSheetId, zone, undefined));
|
|
6464
|
-
}
|
|
6465
|
-
}
|
|
6466
6464
|
else {
|
|
6467
|
-
/* 1 row or 1 column */
|
|
6465
|
+
/* 1 cell, 1 row or 1 column */
|
|
6468
6466
|
dataSets.push(createDataSet(getters, dataSetSheetId, zone, dataSetsHaveTitle
|
|
6469
6467
|
? {
|
|
6470
6468
|
top: zone.top,
|
|
@@ -6513,8 +6511,10 @@ function toExcelDataset(getters, ds) {
|
|
|
6513
6511
|
}
|
|
6514
6512
|
const dataRange = ds.dataRange.clone({ zone: dataZone });
|
|
6515
6513
|
return {
|
|
6516
|
-
label: ds.labelCell
|
|
6517
|
-
|
|
6514
|
+
label: ds.labelCell
|
|
6515
|
+
? getters.getRangeString(ds.labelCell, "forceSheetReference", true)
|
|
6516
|
+
: undefined,
|
|
6517
|
+
range: getters.getRangeString(dataRange, "forceSheetReference", true),
|
|
6518
6518
|
};
|
|
6519
6519
|
}
|
|
6520
6520
|
function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
@@ -6527,7 +6527,7 @@ function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
|
6527
6527
|
zone.top = zone.top + 1;
|
|
6528
6528
|
}
|
|
6529
6529
|
const range = labelRange.clone({ zone });
|
|
6530
|
-
return getters.getRangeString(range, "forceSheetReference");
|
|
6530
|
+
return getters.getRangeString(range, "forceSheetReference", true);
|
|
6531
6531
|
}
|
|
6532
6532
|
/**
|
|
6533
6533
|
* Transform a chart definition which supports dataSets (dataSets and LabelRange)
|
|
@@ -6593,11 +6593,11 @@ function checkDataset(definition) {
|
|
|
6593
6593
|
if (definition.dataSets) {
|
|
6594
6594
|
const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
|
|
6595
6595
|
if (invalidRanges) {
|
|
6596
|
-
return
|
|
6596
|
+
return 33 /* CommandResult.InvalidDataSet */;
|
|
6597
6597
|
}
|
|
6598
6598
|
const zones = definition.dataSets.map(toUnboundedZone);
|
|
6599
6599
|
if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
|
|
6600
|
-
return
|
|
6600
|
+
return 33 /* CommandResult.InvalidDataSet */;
|
|
6601
6601
|
}
|
|
6602
6602
|
}
|
|
6603
6603
|
return 0 /* CommandResult.Success */;
|
|
@@ -6606,7 +6606,7 @@ function checkLabelRange(definition) {
|
|
|
6606
6606
|
if (definition.labelRange) {
|
|
6607
6607
|
const invalidLabels = !rangeReference.test(definition.labelRange || "");
|
|
6608
6608
|
if (invalidLabels) {
|
|
6609
|
-
return
|
|
6609
|
+
return 34 /* CommandResult.InvalidLabelRange */;
|
|
6610
6610
|
}
|
|
6611
6611
|
}
|
|
6612
6612
|
return 0 /* CommandResult.Success */;
|
|
@@ -6693,22 +6693,22 @@ function getChartPositionAtCenterOfViewport(getters, chartSize) {
|
|
|
6693
6693
|
const CfTerms = {
|
|
6694
6694
|
Errors: {
|
|
6695
6695
|
[25 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
|
|
6696
|
-
[
|
|
6697
|
-
[
|
|
6698
|
-
[
|
|
6699
|
-
[
|
|
6700
|
-
[
|
|
6701
|
-
[
|
|
6702
|
-
[
|
|
6703
|
-
[
|
|
6704
|
-
[
|
|
6705
|
-
[
|
|
6706
|
-
[
|
|
6707
|
-
[
|
|
6708
|
-
[
|
|
6709
|
-
[
|
|
6710
|
-
[
|
|
6711
|
-
[
|
|
6696
|
+
[52 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
|
|
6697
|
+
[53 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
|
|
6698
|
+
[54 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
|
|
6699
|
+
[55 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
|
|
6700
|
+
[56 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
|
|
6701
|
+
[57 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
|
|
6702
|
+
[58 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
|
|
6703
|
+
[48 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
|
|
6704
|
+
[51 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
|
|
6705
|
+
[50 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
|
|
6706
|
+
[49 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
|
|
6707
|
+
[59 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
|
|
6708
|
+
[61 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
|
|
6709
|
+
[60 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
|
|
6710
|
+
[62 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
|
|
6711
|
+
[63 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
|
|
6712
6712
|
[24 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
|
|
6713
6713
|
Unexpected: _lt("The rule is invalid for an unknown reason"),
|
|
6714
6714
|
},
|
|
@@ -6736,20 +6736,20 @@ const ChartTerms = {
|
|
|
6736
6736
|
Errors: {
|
|
6737
6737
|
Unexpected: _lt("The chart definition is invalid for an unknown reason"),
|
|
6738
6738
|
// BASIC CHART ERRORS (LINE | BAR | PIE)
|
|
6739
|
-
[
|
|
6740
|
-
[
|
|
6739
|
+
[33 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
|
|
6740
|
+
[34 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
|
|
6741
6741
|
// SCORECARD CHART ERRORS
|
|
6742
|
-
[
|
|
6743
|
-
[
|
|
6742
|
+
[35 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
|
|
6743
|
+
[36 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
|
|
6744
6744
|
// GAUGE CHART ERRORS
|
|
6745
|
-
[
|
|
6746
|
-
[
|
|
6747
|
-
[
|
|
6748
|
-
[
|
|
6749
|
-
[
|
|
6750
|
-
[
|
|
6751
|
-
[
|
|
6752
|
-
[
|
|
6745
|
+
[37 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
|
|
6746
|
+
[38 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
|
|
6747
|
+
[39 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
|
|
6748
|
+
[40 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
|
|
6749
|
+
[41 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
|
|
6750
|
+
[42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
|
|
6751
|
+
[43 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
|
|
6752
|
+
[44 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
|
|
6753
6753
|
},
|
|
6754
6754
|
};
|
|
6755
6755
|
const CustomCurrencyTerms = {
|
|
@@ -6759,9 +6759,9 @@ const MergeErrorMessage = _lt("Merged cells are preventing this operation. Unmer
|
|
|
6759
6759
|
const SplitToColumnsTerms = {
|
|
6760
6760
|
Errors: {
|
|
6761
6761
|
Unexpected: _lt("Cannot split the selection for an unknown reason"),
|
|
6762
|
-
[
|
|
6763
|
-
[
|
|
6764
|
-
[
|
|
6762
|
+
[92 /* CommandResult.NoSplitSeparatorInSelection */]: _lt("There is no match for the selected separator in the selection"),
|
|
6763
|
+
[89 /* CommandResult.MoreThanOneColumnSelected */]: _lt("Only a selection from a single column can be split"),
|
|
6764
|
+
[91 /* CommandResult.SplitWillOverwriteContent */]: _lt("Splitting will overwrite existing content"),
|
|
6765
6765
|
},
|
|
6766
6766
|
};
|
|
6767
6767
|
|
|
@@ -7064,7 +7064,7 @@ class BarChart extends AbstractChart {
|
|
|
7064
7064
|
return undefined;
|
|
7065
7065
|
const dataSets = this.dataSets
|
|
7066
7066
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
7067
|
-
.filter((ds) => ds.range !== ""
|
|
7067
|
+
.filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
|
|
7068
7068
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
7069
7069
|
return {
|
|
7070
7070
|
...this.getDefinition(),
|
|
@@ -7165,7 +7165,7 @@ function createBarChartRuntime(chart, getters) {
|
|
|
7165
7165
|
|
|
7166
7166
|
function isDataRangeValid(definition) {
|
|
7167
7167
|
return definition.dataRange && !rangeReference.test(definition.dataRange)
|
|
7168
|
-
?
|
|
7168
|
+
? 37 /* CommandResult.InvalidGaugeDataRange */
|
|
7169
7169
|
: 0 /* CommandResult.Success */;
|
|
7170
7170
|
}
|
|
7171
7171
|
function checkRangeLimits(check, batchValidations) {
|
|
@@ -7197,7 +7197,7 @@ function checkInflectionPointsValue(check, batchValidations) {
|
|
|
7197
7197
|
function checkRangeMinBiggerThanRangeMax(definition) {
|
|
7198
7198
|
if (definition.sectionRule) {
|
|
7199
7199
|
if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
|
|
7200
|
-
return
|
|
7200
|
+
return 42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
|
|
7201
7201
|
}
|
|
7202
7202
|
}
|
|
7203
7203
|
return 0 /* CommandResult.Success */;
|
|
@@ -7206,9 +7206,9 @@ function checkEmpty(value, valueName) {
|
|
|
7206
7206
|
if (value === "") {
|
|
7207
7207
|
switch (valueName) {
|
|
7208
7208
|
case "rangeMin":
|
|
7209
|
-
return
|
|
7209
|
+
return 38 /* CommandResult.EmptyGaugeRangeMin */;
|
|
7210
7210
|
case "rangeMax":
|
|
7211
|
-
return
|
|
7211
|
+
return 40 /* CommandResult.EmptyGaugeRangeMax */;
|
|
7212
7212
|
}
|
|
7213
7213
|
}
|
|
7214
7214
|
return 0 /* CommandResult.Success */;
|
|
@@ -7217,13 +7217,13 @@ function checkNaN(value, valueName) {
|
|
|
7217
7217
|
if (isNaN(value)) {
|
|
7218
7218
|
switch (valueName) {
|
|
7219
7219
|
case "rangeMin":
|
|
7220
|
-
return
|
|
7220
|
+
return 39 /* CommandResult.GaugeRangeMinNaN */;
|
|
7221
7221
|
case "rangeMax":
|
|
7222
|
-
return
|
|
7222
|
+
return 41 /* CommandResult.GaugeRangeMaxNaN */;
|
|
7223
7223
|
case "lowerInflectionPointValue":
|
|
7224
|
-
return
|
|
7224
|
+
return 43 /* CommandResult.GaugeLowerInflectionPointNaN */;
|
|
7225
7225
|
case "upperInflectionPointValue":
|
|
7226
|
-
return
|
|
7226
|
+
return 44 /* CommandResult.GaugeUpperInflectionPointNaN */;
|
|
7227
7227
|
}
|
|
7228
7228
|
}
|
|
7229
7229
|
return 0 /* CommandResult.Success */;
|
|
@@ -7648,7 +7648,7 @@ class LineChart extends AbstractChart {
|
|
|
7648
7648
|
return undefined;
|
|
7649
7649
|
const dataSets = this.dataSets
|
|
7650
7650
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
7651
|
-
.filter((ds) => ds.range !== ""
|
|
7651
|
+
.filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
|
|
7652
7652
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
7653
7653
|
return {
|
|
7654
7654
|
...this.getDefinition(),
|
|
@@ -7933,7 +7933,7 @@ class PieChart extends AbstractChart {
|
|
|
7933
7933
|
return undefined;
|
|
7934
7934
|
const dataSets = this.dataSets
|
|
7935
7935
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
7936
|
-
.filter((ds) => ds.range !== ""
|
|
7936
|
+
.filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
|
|
7937
7937
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
7938
7938
|
return {
|
|
7939
7939
|
...this.getDefinition(),
|
|
@@ -8013,12 +8013,12 @@ function createPieChartRuntime(chart, getters) {
|
|
|
8013
8013
|
|
|
8014
8014
|
function checkKeyValue(definition) {
|
|
8015
8015
|
return definition.keyValue && !rangeReference.test(definition.keyValue)
|
|
8016
|
-
?
|
|
8016
|
+
? 35 /* CommandResult.InvalidScorecardKeyValue */
|
|
8017
8017
|
: 0 /* CommandResult.Success */;
|
|
8018
8018
|
}
|
|
8019
8019
|
function checkBaseline(definition) {
|
|
8020
8020
|
return definition.baseline && !rangeReference.test(definition.baseline)
|
|
8021
|
-
?
|
|
8021
|
+
? 36 /* CommandResult.InvalidScorecardBaseline */
|
|
8022
8022
|
: 0 /* CommandResult.Success */;
|
|
8023
8023
|
}
|
|
8024
8024
|
class ScorecardChart extends AbstractChart {
|
|
@@ -8524,7 +8524,7 @@ const AddMergeInteractiveContent = {
|
|
|
8524
8524
|
};
|
|
8525
8525
|
function interactiveAddMerge(env, sheetId, target) {
|
|
8526
8526
|
const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
|
|
8527
|
-
if (result.isCancelledBecause(
|
|
8527
|
+
if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
|
|
8528
8528
|
env.raiseError(AddMergeInteractiveContent.MergeInFilter);
|
|
8529
8529
|
}
|
|
8530
8530
|
else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
|
|
@@ -8774,7 +8774,7 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
|
8774
8774
|
});
|
|
8775
8775
|
}
|
|
8776
8776
|
}
|
|
8777
|
-
if (result.isCancelledBecause(
|
|
8777
|
+
if (result.isCancelledBecause(64 /* CommandResult.InvalidSortZone */)) {
|
|
8778
8778
|
const { col, row } = anchor;
|
|
8779
8779
|
env.model.selection.selectZone({ cell: { col, row }, zone });
|
|
8780
8780
|
env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
|
|
@@ -8797,13 +8797,13 @@ const AddFilterInteractiveContent = {
|
|
|
8797
8797
|
};
|
|
8798
8798
|
function interactiveAddFilter(env, sheetId, target) {
|
|
8799
8799
|
const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
|
|
8800
|
-
if (result.isCancelledBecause(
|
|
8800
|
+
if (result.isCancelledBecause(79 /* CommandResult.FilterOverlap */)) {
|
|
8801
8801
|
env.raiseError(AddFilterInteractiveContent.filterOverlap);
|
|
8802
8802
|
}
|
|
8803
|
-
else if (result.isCancelledBecause(
|
|
8803
|
+
else if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
|
|
8804
8804
|
env.raiseError(AddFilterInteractiveContent.mergeInFilter);
|
|
8805
8805
|
}
|
|
8806
|
-
else if (result.isCancelledBecause(
|
|
8806
|
+
else if (result.isCancelledBecause(82 /* CommandResult.NonContinuousTargets */)) {
|
|
8807
8807
|
env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
|
|
8808
8808
|
}
|
|
8809
8809
|
}
|
|
@@ -8825,7 +8825,7 @@ function handlePasteResult(env, result) {
|
|
|
8825
8825
|
else if (result.reasons.includes(22 /* CommandResult.WrongFigurePasteOption */)) {
|
|
8826
8826
|
env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
|
|
8827
8827
|
}
|
|
8828
|
-
else if (result.reasons.includes(
|
|
8828
|
+
else if (result.reasons.includes(76 /* CommandResult.FrozenPaneOverlap */)) {
|
|
8829
8829
|
env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
|
|
8830
8830
|
}
|
|
8831
8831
|
}
|
|
@@ -16983,7 +16983,7 @@ function interactiveFreezeColumnsRows(env, dimension, base) {
|
|
|
16983
16983
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
16984
16984
|
const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
|
|
16985
16985
|
const result = env.model.dispatch(cmd, { sheetId, quantity: base });
|
|
16986
|
-
if (result.isCancelledBecause(
|
|
16986
|
+
if (result.isCancelledBecause(66 /* CommandResult.MergeOverlap */)) {
|
|
16987
16987
|
env.raiseError(MergeErrorMessage);
|
|
16988
16988
|
}
|
|
16989
16989
|
}
|
|
@@ -18006,10 +18006,10 @@ class LineBarPieConfigPanel extends Component {
|
|
|
18006
18006
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
18007
18007
|
}
|
|
18008
18008
|
get isDatasetInvalid() {
|
|
18009
|
-
return !!this.state.datasetDispatchResult?.isCancelledBecause(
|
|
18009
|
+
return !!this.state.datasetDispatchResult?.isCancelledBecause(33 /* CommandResult.InvalidDataSet */);
|
|
18010
18010
|
}
|
|
18011
18011
|
get isLabelInvalid() {
|
|
18012
|
-
return !!this.state.labelsDispatchResult?.isCancelledBecause(
|
|
18012
|
+
return !!this.state.labelsDispatchResult?.isCancelledBecause(34 /* CommandResult.InvalidLabelRange */);
|
|
18013
18013
|
}
|
|
18014
18014
|
onUpdateDataSetsHaveTitle(ev) {
|
|
18015
18015
|
this.props.updateChart(this.props.figureId, {
|
|
@@ -18451,7 +18451,7 @@ class GaugeChartConfigPanel extends Component {
|
|
|
18451
18451
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
18452
18452
|
}
|
|
18453
18453
|
get isDataRangeInvalid() {
|
|
18454
|
-
return !!this.state.dataRangeDispatchResult?.isCancelledBecause(
|
|
18454
|
+
return !!this.state.dataRangeDispatchResult?.isCancelledBecause(37 /* CommandResult.InvalidGaugeDataRange */);
|
|
18455
18455
|
}
|
|
18456
18456
|
onDataRangeChanged(ranges) {
|
|
18457
18457
|
this.dataRange = ranges[0];
|
|
@@ -18525,25 +18525,25 @@ class GaugeChartDesignPanel extends Component {
|
|
|
18525
18525
|
});
|
|
18526
18526
|
}
|
|
18527
18527
|
isRangeMinInvalid() {
|
|
18528
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18529
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18530
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18528
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(38 /* CommandResult.EmptyGaugeRangeMin */) ||
|
|
18529
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(39 /* CommandResult.GaugeRangeMinNaN */) ||
|
|
18530
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
|
|
18531
18531
|
}
|
|
18532
18532
|
isRangeMaxInvalid() {
|
|
18533
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18534
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18535
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18533
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMax */) ||
|
|
18534
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(41 /* CommandResult.GaugeRangeMaxNaN */) ||
|
|
18535
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
|
|
18536
18536
|
}
|
|
18537
18537
|
// ---------------------------------------------------------------------------
|
|
18538
18538
|
// COLOR_SECTION_TEMPLATE
|
|
18539
18539
|
// ---------------------------------------------------------------------------
|
|
18540
18540
|
get isLowerInflectionPointInvalid() {
|
|
18541
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18542
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18541
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(43 /* CommandResult.GaugeLowerInflectionPointNaN */) ||
|
|
18542
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */));
|
|
18543
18543
|
}
|
|
18544
18544
|
get isUpperInflectionPointInvalid() {
|
|
18545
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18546
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
18545
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(44 /* CommandResult.GaugeUpperInflectionPointNaN */) ||
|
|
18546
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */));
|
|
18547
18547
|
}
|
|
18548
18548
|
updateInflectionPointValue(attr, ev) {
|
|
18549
18549
|
const sectionRule = deepCopy(this.props.definition.sectionRule);
|
|
@@ -18651,10 +18651,10 @@ class ScorecardChartConfigPanel extends Component {
|
|
|
18651
18651
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
18652
18652
|
}
|
|
18653
18653
|
get isKeyValueInvalid() {
|
|
18654
|
-
return !!this.state.keyValueDispatchResult?.isCancelledBecause(
|
|
18654
|
+
return !!this.state.keyValueDispatchResult?.isCancelledBecause(35 /* CommandResult.InvalidScorecardKeyValue */);
|
|
18655
18655
|
}
|
|
18656
18656
|
get isBaselineInvalid() {
|
|
18657
|
-
return !!this.state.keyValueDispatchResult?.isCancelledBecause(
|
|
18657
|
+
return !!this.state.keyValueDispatchResult?.isCancelledBecause(36 /* CommandResult.InvalidScorecardBaseline */);
|
|
18658
18658
|
}
|
|
18659
18659
|
onKeyValueRangeChanged(ranges) {
|
|
18660
18660
|
this.keyValue = ranges[0];
|
|
@@ -19514,10 +19514,10 @@ class ConditionalFormattingPanel extends Component {
|
|
|
19514
19514
|
* Cell Is Rule
|
|
19515
19515
|
****************************************************************************/
|
|
19516
19516
|
get isValue1Invalid() {
|
|
19517
|
-
return !!this.state.errors?.includes(
|
|
19517
|
+
return !!this.state.errors?.includes(52 /* CommandResult.FirstArgMissing */);
|
|
19518
19518
|
}
|
|
19519
19519
|
get isValue2Invalid() {
|
|
19520
|
-
return !!this.state.errors?.includes(
|
|
19520
|
+
return !!this.state.errors?.includes(53 /* CommandResult.SecondArgMissing */);
|
|
19521
19521
|
}
|
|
19522
19522
|
toggleStyle(tool) {
|
|
19523
19523
|
const style = this.state.rules.cellIs.style;
|
|
@@ -19534,17 +19534,17 @@ class ConditionalFormattingPanel extends Component {
|
|
|
19534
19534
|
isValueInvalid(threshold) {
|
|
19535
19535
|
switch (threshold) {
|
|
19536
19536
|
case "minimum":
|
|
19537
|
-
return (this.state.errors.includes(
|
|
19538
|
-
this.state.errors.includes(
|
|
19539
|
-
this.state.errors.includes(
|
|
19540
|
-
this.state.errors.includes(
|
|
19537
|
+
return (this.state.errors.includes(59 /* CommandResult.MinInvalidFormula */) ||
|
|
19538
|
+
this.state.errors.includes(51 /* CommandResult.MinBiggerThanMid */) ||
|
|
19539
|
+
this.state.errors.includes(48 /* CommandResult.MinBiggerThanMax */) ||
|
|
19540
|
+
this.state.errors.includes(54 /* CommandResult.MinNaN */));
|
|
19541
19541
|
case "midpoint":
|
|
19542
|
-
return (this.state.errors.includes(
|
|
19543
|
-
this.state.errors.includes(
|
|
19544
|
-
this.state.errors.includes(
|
|
19542
|
+
return (this.state.errors.includes(60 /* CommandResult.MidInvalidFormula */) ||
|
|
19543
|
+
this.state.errors.includes(55 /* CommandResult.MidNaN */) ||
|
|
19544
|
+
this.state.errors.includes(50 /* CommandResult.MidBiggerThanMax */));
|
|
19545
19545
|
case "maximum":
|
|
19546
|
-
return (this.state.errors.includes(
|
|
19547
|
-
this.state.errors.includes(
|
|
19546
|
+
return (this.state.errors.includes(61 /* CommandResult.MaxInvalidFormula */) ||
|
|
19547
|
+
this.state.errors.includes(56 /* CommandResult.MaxNaN */));
|
|
19548
19548
|
default:
|
|
19549
19549
|
return false;
|
|
19550
19550
|
}
|
|
@@ -19592,13 +19592,13 @@ class ConditionalFormattingPanel extends Component {
|
|
|
19592
19592
|
isInflectionPointInvalid(inflectionPoint) {
|
|
19593
19593
|
switch (inflectionPoint) {
|
|
19594
19594
|
case "lowerInflectionPoint":
|
|
19595
|
-
return (this.state.errors.includes(
|
|
19596
|
-
this.state.errors.includes(
|
|
19597
|
-
this.state.errors.includes(
|
|
19595
|
+
return (this.state.errors.includes(58 /* CommandResult.ValueLowerInflectionNaN */) ||
|
|
19596
|
+
this.state.errors.includes(63 /* CommandResult.ValueLowerInvalidFormula */) ||
|
|
19597
|
+
this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
|
|
19598
19598
|
case "upperInflectionPoint":
|
|
19599
|
-
return (this.state.errors.includes(
|
|
19600
|
-
this.state.errors.includes(
|
|
19601
|
-
this.state.errors.includes(
|
|
19599
|
+
return (this.state.errors.includes(57 /* CommandResult.ValueUpperInflectionNaN */) ||
|
|
19600
|
+
this.state.errors.includes(62 /* CommandResult.ValueUpperInvalidFormula */) ||
|
|
19601
|
+
this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
|
|
19602
19602
|
default:
|
|
19603
19603
|
return true;
|
|
19604
19604
|
}
|
|
@@ -19909,7 +19909,7 @@ const SplitToColumnsInteractiveContent = {
|
|
|
19909
19909
|
};
|
|
19910
19910
|
function interactiveSplitToColumns(env, separator, addNewColumns) {
|
|
19911
19911
|
let result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", { separator, addNewColumns });
|
|
19912
|
-
if (result.isCancelledBecause(
|
|
19912
|
+
if (result.isCancelledBecause(91 /* CommandResult.SplitWillOverwriteContent */)) {
|
|
19913
19913
|
env.askConfirmation(SplitToColumnsInteractiveContent.SplitIsDestructive, () => {
|
|
19914
19914
|
result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", {
|
|
19915
19915
|
separator,
|
|
@@ -19972,8 +19972,8 @@ class SplitIntoColumnsPanel extends Component {
|
|
|
19972
19972
|
const errors = new Set();
|
|
19973
19973
|
for (const reason of cancelledReasons) {
|
|
19974
19974
|
switch (reason) {
|
|
19975
|
-
case
|
|
19976
|
-
case
|
|
19975
|
+
case 91 /* CommandResult.SplitWillOverwriteContent */:
|
|
19976
|
+
case 90 /* CommandResult.EmptySplitSeparator */:
|
|
19977
19977
|
break;
|
|
19978
19978
|
default:
|
|
19979
19979
|
errors.add(SplitToColumnsTerms.Errors[reason] || SplitToColumnsTerms.Errors.Unexpected);
|
|
@@ -19988,8 +19988,8 @@ class SplitIntoColumnsPanel extends Component {
|
|
|
19988
19988
|
addNewColumns: this.state.addNewColumns,
|
|
19989
19989
|
force: false,
|
|
19990
19990
|
}).reasons;
|
|
19991
|
-
if (cancelledReasons.includes(
|
|
19992
|
-
warnings.push(SplitToColumnsTerms.Errors[
|
|
19991
|
+
if (cancelledReasons.includes(91 /* CommandResult.SplitWillOverwriteContent */)) {
|
|
19992
|
+
warnings.push(SplitToColumnsTerms.Errors[91 /* CommandResult.SplitWillOverwriteContent */]);
|
|
19993
19993
|
}
|
|
19994
19994
|
return warnings;
|
|
19995
19995
|
}
|
|
@@ -29515,7 +29515,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
29515
29515
|
const currentBorder = this.getCellBorder(cmd);
|
|
29516
29516
|
const areAllNewBordersUndefined = !cmd.border?.bottom && !cmd.border?.left && !cmd.border?.right && !cmd.border?.top;
|
|
29517
29517
|
if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
|
|
29518
|
-
return
|
|
29518
|
+
return 94 /* CommandResult.NoChanges */;
|
|
29519
29519
|
}
|
|
29520
29520
|
return 0 /* CommandResult.Success */;
|
|
29521
29521
|
}
|
|
@@ -29760,6 +29760,10 @@ class CellPlugin extends CorePlugin {
|
|
|
29760
29760
|
format: cell.format ? getItemId(cell.format, formats) : undefined,
|
|
29761
29761
|
content: cell.content || undefined,
|
|
29762
29762
|
};
|
|
29763
|
+
// if there is a formula but no dependencies (maybe because the cell is in error), no need to recompute the formula text
|
|
29764
|
+
if (cell.isFormula && cell.dependencies.length) {
|
|
29765
|
+
cells[xc].content = this.buildFormulaContent(_sheet.id, cell, cell.dependencies, true);
|
|
29766
|
+
}
|
|
29763
29767
|
}
|
|
29764
29768
|
_sheet.cells = cells;
|
|
29765
29769
|
}
|
|
@@ -29794,13 +29798,13 @@ class CellPlugin extends CorePlugin {
|
|
|
29794
29798
|
/*
|
|
29795
29799
|
* Reconstructs the original formula string based on a normalized form and its dependencies
|
|
29796
29800
|
*/
|
|
29797
|
-
buildFormulaContent(sheetId, cell, dependencies) {
|
|
29801
|
+
buildFormulaContent(sheetId, cell, dependencies, useFixedZone = false) {
|
|
29798
29802
|
const ranges = dependencies || cell.dependencies;
|
|
29799
29803
|
let rangeIndex = 0;
|
|
29800
29804
|
return concat(cell.compiledFormula.tokens.map((token) => {
|
|
29801
29805
|
if (token.type === "REFERENCE") {
|
|
29802
29806
|
const range = ranges[rangeIndex++];
|
|
29803
|
-
return this.getters.getRangeString(range, sheetId);
|
|
29807
|
+
return this.getters.getRangeString(range, sheetId, useFixedZone);
|
|
29804
29808
|
}
|
|
29805
29809
|
return token.value;
|
|
29806
29810
|
}));
|
|
@@ -30037,9 +30041,9 @@ class CellPlugin extends CorePlugin {
|
|
|
30037
30041
|
checkUselessClearCell(cmd) {
|
|
30038
30042
|
const cell = this.getters.getCell(cmd);
|
|
30039
30043
|
if (!cell)
|
|
30040
|
-
return
|
|
30044
|
+
return 94 /* CommandResult.NoChanges */;
|
|
30041
30045
|
if (!cell.content && !cell.style && !cell.format) {
|
|
30042
|
-
return
|
|
30046
|
+
return 94 /* CommandResult.NoChanges */;
|
|
30043
30047
|
}
|
|
30044
30048
|
return 0 /* CommandResult.Success */;
|
|
30045
30049
|
}
|
|
@@ -30239,13 +30243,13 @@ class ChartPlugin extends CorePlugin {
|
|
|
30239
30243
|
}
|
|
30240
30244
|
checkChartDuplicate(cmd) {
|
|
30241
30245
|
return this.getters.getFigureSheetId(cmd.id)
|
|
30242
|
-
?
|
|
30246
|
+
? 85 /* CommandResult.DuplicatedChartId */
|
|
30243
30247
|
: 0 /* CommandResult.Success */;
|
|
30244
30248
|
}
|
|
30245
30249
|
checkChartExists(cmd) {
|
|
30246
30250
|
return this.getters.getFigureSheetId(cmd.id)
|
|
30247
30251
|
? 0 /* CommandResult.Success */
|
|
30248
|
-
:
|
|
30252
|
+
: 86 /* CommandResult.ChartDoesNotExist */;
|
|
30249
30253
|
}
|
|
30250
30254
|
}
|
|
30251
30255
|
|
|
@@ -30350,7 +30354,13 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30350
30354
|
}
|
|
30351
30355
|
}
|
|
30352
30356
|
exportForExcel(data) {
|
|
30353
|
-
|
|
30357
|
+
if (data.sheets) {
|
|
30358
|
+
for (let sheet of data.sheets) {
|
|
30359
|
+
if (this.cfRules[sheet.id]) {
|
|
30360
|
+
sheet.conditionalFormats = this.cfRules[sheet.id].map((rule) => this.mapToConditionalFormat(sheet.id, rule, { useFixedReference: true }));
|
|
30361
|
+
}
|
|
30362
|
+
}
|
|
30363
|
+
}
|
|
30354
30364
|
}
|
|
30355
30365
|
// ---------------------------------------------------------------------------
|
|
30356
30366
|
// Getters
|
|
@@ -30399,11 +30409,11 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30399
30409
|
// ---------------------------------------------------------------------------
|
|
30400
30410
|
// Private
|
|
30401
30411
|
// ---------------------------------------------------------------------------
|
|
30402
|
-
mapToConditionalFormat(sheetId, cf) {
|
|
30412
|
+
mapToConditionalFormat(sheetId, cf, options = { useFixedReference: false }) {
|
|
30403
30413
|
return {
|
|
30404
30414
|
...cf,
|
|
30405
30415
|
ranges: cf.ranges.map((range) => {
|
|
30406
|
-
return this.getters.getRangeString(range, sheetId);
|
|
30416
|
+
return this.getters.getRangeString(range, sheetId, options.useFixedReference);
|
|
30407
30417
|
}),
|
|
30408
30418
|
};
|
|
30409
30419
|
}
|
|
@@ -30436,10 +30446,10 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30436
30446
|
return 27 /* CommandResult.InvalidSheetId */;
|
|
30437
30447
|
const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
|
|
30438
30448
|
if (ruleIndex === -1)
|
|
30439
|
-
return
|
|
30449
|
+
return 72 /* CommandResult.InvalidConditionalFormatId */;
|
|
30440
30450
|
const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
|
|
30441
30451
|
if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
|
|
30442
|
-
return
|
|
30452
|
+
return 72 /* CommandResult.InvalidConditionalFormatId */;
|
|
30443
30453
|
}
|
|
30444
30454
|
return 0 /* CommandResult.Success */;
|
|
30445
30455
|
}
|
|
@@ -30480,10 +30490,10 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30480
30490
|
const errors = [];
|
|
30481
30491
|
const isEmpty = (value) => value === undefined || value === "";
|
|
30482
30492
|
if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
|
|
30483
|
-
errors.push(
|
|
30493
|
+
errors.push(52 /* CommandResult.FirstArgMissing */);
|
|
30484
30494
|
}
|
|
30485
30495
|
if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
|
|
30486
|
-
errors.push(
|
|
30496
|
+
errors.push(53 /* CommandResult.SecondArgMissing */);
|
|
30487
30497
|
}
|
|
30488
30498
|
return errors.length ? errors : 0 /* CommandResult.Success */;
|
|
30489
30499
|
}
|
|
@@ -30495,15 +30505,15 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30495
30505
|
(threshold.value === "" || isNaN(threshold.value))) {
|
|
30496
30506
|
switch (thresholdName) {
|
|
30497
30507
|
case "min":
|
|
30498
|
-
return
|
|
30508
|
+
return 54 /* CommandResult.MinNaN */;
|
|
30499
30509
|
case "max":
|
|
30500
|
-
return
|
|
30510
|
+
return 56 /* CommandResult.MaxNaN */;
|
|
30501
30511
|
case "mid":
|
|
30502
|
-
return
|
|
30512
|
+
return 55 /* CommandResult.MidNaN */;
|
|
30503
30513
|
case "upperInflectionPoint":
|
|
30504
|
-
return
|
|
30514
|
+
return 57 /* CommandResult.ValueUpperInflectionNaN */;
|
|
30505
30515
|
case "lowerInflectionPoint":
|
|
30506
|
-
return
|
|
30516
|
+
return 58 /* CommandResult.ValueLowerInflectionNaN */;
|
|
30507
30517
|
}
|
|
30508
30518
|
}
|
|
30509
30519
|
return 0 /* CommandResult.Success */;
|
|
@@ -30517,15 +30527,15 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30517
30527
|
catch (error) {
|
|
30518
30528
|
switch (thresholdName) {
|
|
30519
30529
|
case "min":
|
|
30520
|
-
return
|
|
30530
|
+
return 59 /* CommandResult.MinInvalidFormula */;
|
|
30521
30531
|
case "max":
|
|
30522
|
-
return
|
|
30532
|
+
return 61 /* CommandResult.MaxInvalidFormula */;
|
|
30523
30533
|
case "mid":
|
|
30524
|
-
return
|
|
30534
|
+
return 60 /* CommandResult.MidInvalidFormula */;
|
|
30525
30535
|
case "upperInflectionPoint":
|
|
30526
|
-
return
|
|
30536
|
+
return 62 /* CommandResult.ValueUpperInvalidFormula */;
|
|
30527
30537
|
case "lowerInflectionPoint":
|
|
30528
|
-
return
|
|
30538
|
+
return 63 /* CommandResult.ValueLowerInvalidFormula */;
|
|
30529
30539
|
}
|
|
30530
30540
|
}
|
|
30531
30541
|
return 0 /* CommandResult.Success */;
|
|
@@ -30542,7 +30552,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30542
30552
|
if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
|
|
30543
30553
|
rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
|
|
30544
30554
|
Number(minValue) > Number(maxValue)) {
|
|
30545
|
-
return
|
|
30555
|
+
return 49 /* CommandResult.LowerBiggerThanUpper */;
|
|
30546
30556
|
}
|
|
30547
30557
|
return 0 /* CommandResult.Success */;
|
|
30548
30558
|
}
|
|
@@ -30552,7 +30562,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30552
30562
|
if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
|
|
30553
30563
|
rule.minimum.type === rule.maximum.type &&
|
|
30554
30564
|
stringToNumber(minValue) >= stringToNumber(maxValue)) {
|
|
30555
|
-
return
|
|
30565
|
+
return 48 /* CommandResult.MinBiggerThanMax */;
|
|
30556
30566
|
}
|
|
30557
30567
|
return 0 /* CommandResult.Success */;
|
|
30558
30568
|
}
|
|
@@ -30563,7 +30573,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30563
30573
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
30564
30574
|
rule.midpoint.type === rule.maximum.type &&
|
|
30565
30575
|
stringToNumber(midValue) >= stringToNumber(maxValue)) {
|
|
30566
|
-
return
|
|
30576
|
+
return 50 /* CommandResult.MidBiggerThanMax */;
|
|
30567
30577
|
}
|
|
30568
30578
|
return 0 /* CommandResult.Success */;
|
|
30569
30579
|
}
|
|
@@ -30574,7 +30584,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
30574
30584
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
30575
30585
|
rule.minimum.type === rule.midpoint.type &&
|
|
30576
30586
|
stringToNumber(minValue) >= stringToNumber(midValue)) {
|
|
30577
|
-
return
|
|
30587
|
+
return 51 /* CommandResult.MinBiggerThanMid */;
|
|
30578
30588
|
}
|
|
30579
30589
|
return 0 /* CommandResult.Success */;
|
|
30580
30590
|
}
|
|
@@ -30704,13 +30714,13 @@ class FigurePlugin extends CorePlugin {
|
|
|
30704
30714
|
}
|
|
30705
30715
|
checkFigureExists(sheetId, figureId) {
|
|
30706
30716
|
if (this.figures[sheetId]?.[figureId] === undefined) {
|
|
30707
|
-
return
|
|
30717
|
+
return 71 /* CommandResult.FigureDoesNotExist */;
|
|
30708
30718
|
}
|
|
30709
30719
|
return 0 /* CommandResult.Success */;
|
|
30710
30720
|
}
|
|
30711
30721
|
checkFigureDuplicate(figureId) {
|
|
30712
30722
|
if (Object.values(this.figures).find((sheet) => sheet?.[figureId])) {
|
|
30713
|
-
return
|
|
30723
|
+
return 83 /* CommandResult.DuplicatedFigureId */;
|
|
30714
30724
|
}
|
|
30715
30725
|
return 0 /* CommandResult.Success */;
|
|
30716
30726
|
}
|
|
@@ -30820,12 +30830,12 @@ class FiltersPlugin extends CorePlugin {
|
|
|
30820
30830
|
switch (cmd.type) {
|
|
30821
30831
|
case "CREATE_FILTER_TABLE":
|
|
30822
30832
|
if (!areZonesContinuous(...cmd.target)) {
|
|
30823
|
-
return
|
|
30833
|
+
return 82 /* CommandResult.NonContinuousTargets */;
|
|
30824
30834
|
}
|
|
30825
30835
|
const zone = union(...cmd.target);
|
|
30826
30836
|
const checkFilterOverlap = () => {
|
|
30827
30837
|
if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
|
|
30828
|
-
return
|
|
30838
|
+
return 79 /* CommandResult.FilterOverlap */;
|
|
30829
30839
|
}
|
|
30830
30840
|
return 0 /* CommandResult.Success */;
|
|
30831
30841
|
};
|
|
@@ -30833,7 +30843,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
30833
30843
|
const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
|
|
30834
30844
|
for (let merge of mergesInTarget) {
|
|
30835
30845
|
if (overlap(zone, merge)) {
|
|
30836
|
-
return
|
|
30846
|
+
return 81 /* CommandResult.MergeInFilter */;
|
|
30837
30847
|
}
|
|
30838
30848
|
}
|
|
30839
30849
|
return 0 /* CommandResult.Success */;
|
|
@@ -30843,7 +30853,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
30843
30853
|
for (let merge of cmd.target) {
|
|
30844
30854
|
for (let filterTable of this.getFilterTables(cmd.sheetId)) {
|
|
30845
30855
|
if (overlap(filterTable.zone, merge)) {
|
|
30846
|
-
return
|
|
30856
|
+
return 81 /* CommandResult.MergeInFilter */;
|
|
30847
30857
|
}
|
|
30848
30858
|
}
|
|
30849
30859
|
}
|
|
@@ -31328,10 +31338,10 @@ class HeaderVisibilityPlugin extends CorePlugin {
|
|
|
31328
31338
|
: this.getters.getNumberRows(cmd.sheetId);
|
|
31329
31339
|
const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
|
|
31330
31340
|
if (hiddenElements.size >= elements) {
|
|
31331
|
-
return
|
|
31341
|
+
return 67 /* CommandResult.TooManyHiddenElements */;
|
|
31332
31342
|
}
|
|
31333
31343
|
else if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
|
|
31334
|
-
return
|
|
31344
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
31335
31345
|
}
|
|
31336
31346
|
else {
|
|
31337
31347
|
return 0 /* CommandResult.Success */;
|
|
@@ -31874,7 +31884,7 @@ class MergePlugin extends CorePlugin {
|
|
|
31874
31884
|
for (const zone of target) {
|
|
31875
31885
|
for (const zone2 of target) {
|
|
31876
31886
|
if (zone !== zone2 && overlap(zone, zone2)) {
|
|
31877
|
-
return
|
|
31887
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
31878
31888
|
}
|
|
31879
31889
|
}
|
|
31880
31890
|
}
|
|
@@ -31888,7 +31898,7 @@ class MergePlugin extends CorePlugin {
|
|
|
31888
31898
|
for (const zone of target) {
|
|
31889
31899
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
31890
31900
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
31891
|
-
return
|
|
31901
|
+
return 76 /* CommandResult.FrozenPaneOverlap */;
|
|
31892
31902
|
}
|
|
31893
31903
|
}
|
|
31894
31904
|
return 0 /* CommandResult.Success */;
|
|
@@ -32346,8 +32356,9 @@ class RangeAdapter {
|
|
|
32346
32356
|
*
|
|
32347
32357
|
* @param range the range (received from getRangeFromXC or getRangeFromZone)
|
|
32348
32358
|
* @param forSheetId the id of the sheet where the range string is supposed to be used.
|
|
32359
|
+
* @param [useFixedZone=false] if true, the range will be returned with fixed row and column
|
|
32349
32360
|
*/
|
|
32350
|
-
getRangeString(range, forSheetId) {
|
|
32361
|
+
getRangeString(range, forSheetId, useFixedZone = false) {
|
|
32351
32362
|
if (!range) {
|
|
32352
32363
|
return INCORRECT_RANGE_STRING;
|
|
32353
32364
|
}
|
|
@@ -32374,7 +32385,7 @@ class RangeAdapter {
|
|
|
32374
32385
|
if (prefixSheet && !sheetName) {
|
|
32375
32386
|
return INCORRECT_RANGE_STRING;
|
|
32376
32387
|
}
|
|
32377
|
-
let rangeString = this.getRangePartString(rangeImpl, 0);
|
|
32388
|
+
let rangeString = this.getRangePartString(rangeImpl, 0, useFixedZone);
|
|
32378
32389
|
if (rangeImpl.parts && rangeImpl.parts.length === 2) {
|
|
32379
32390
|
// this if converts A2:A2 into A2 except if any part of the original range had fixed row or column (with $)
|
|
32380
32391
|
if (rangeImpl.zone.top !== rangeImpl.zone.bottom ||
|
|
@@ -32384,7 +32395,7 @@ class RangeAdapter {
|
|
|
32384
32395
|
rangeImpl.parts[1].rowFixed ||
|
|
32385
32396
|
rangeImpl.parts[1].colFixed) {
|
|
32386
32397
|
rangeString += ":";
|
|
32387
|
-
rangeString += this.getRangePartString(rangeImpl, 1);
|
|
32398
|
+
rangeString += this.getRangePartString(rangeImpl, 1, useFixedZone);
|
|
32388
32399
|
}
|
|
32389
32400
|
}
|
|
32390
32401
|
return `${prefixSheet ? sheetName + "!" : ""}${rangeString}`;
|
|
@@ -32414,13 +32425,13 @@ class RangeAdapter {
|
|
|
32414
32425
|
/**
|
|
32415
32426
|
* Get a Xc string that represent a part of a range
|
|
32416
32427
|
*/
|
|
32417
|
-
getRangePartString(range, part) {
|
|
32418
|
-
const colFixed = range.parts && range.parts[part]
|
|
32428
|
+
getRangePartString(range, part, useFixedZone = false) {
|
|
32429
|
+
const colFixed = range.parts && range.parts[part]?.colFixed ? "$" : "";
|
|
32419
32430
|
const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
|
|
32420
|
-
const rowFixed = range.parts && range.parts[part]
|
|
32431
|
+
const rowFixed = range.parts && range.parts[part]?.rowFixed ? "$" : "";
|
|
32421
32432
|
const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
|
|
32422
32433
|
let str = "";
|
|
32423
|
-
if (range.isFullCol) {
|
|
32434
|
+
if (range.isFullCol && !useFixedZone) {
|
|
32424
32435
|
if (part === 0 && range.unboundedZone.hasHeader) {
|
|
32425
32436
|
str = colFixed + col + rowFixed + row;
|
|
32426
32437
|
}
|
|
@@ -32428,7 +32439,7 @@ class RangeAdapter {
|
|
|
32428
32439
|
str = colFixed + col;
|
|
32429
32440
|
}
|
|
32430
32441
|
}
|
|
32431
|
-
else if (range.isFullRow) {
|
|
32442
|
+
else if (range.isFullRow && !useFixedZone) {
|
|
32432
32443
|
if (part === 0 && range.unboundedZone.hasHeader) {
|
|
32433
32444
|
str = colFixed + col + rowFixed + row;
|
|
32434
32445
|
}
|
|
@@ -32524,10 +32535,10 @@ class SheetPlugin extends CorePlugin {
|
|
|
32524
32535
|
? this.getNumberCols(cmd.sheetId)
|
|
32525
32536
|
: this.getNumberRows(cmd.sheetId);
|
|
32526
32537
|
if (cmd.base < 0 || cmd.base >= elements) {
|
|
32527
|
-
return
|
|
32538
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
32528
32539
|
}
|
|
32529
32540
|
else if (cmd.quantity <= 0) {
|
|
32530
|
-
return
|
|
32541
|
+
return 88 /* CommandResult.InvalidQuantity */;
|
|
32531
32542
|
}
|
|
32532
32543
|
return 0 /* CommandResult.Success */;
|
|
32533
32544
|
case "REMOVE_COLUMNS_ROWS": {
|
|
@@ -32535,7 +32546,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
32535
32546
|
? this.getNumberCols(cmd.sheetId)
|
|
32536
32547
|
: this.getNumberRows(cmd.sheetId);
|
|
32537
32548
|
if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
|
|
32538
|
-
return
|
|
32549
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
32539
32550
|
}
|
|
32540
32551
|
else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
|
|
32541
32552
|
return 8 /* CommandResult.NotEnoughElements */;
|
|
@@ -33001,18 +33012,18 @@ class SheetPlugin extends CorePlugin {
|
|
|
33001
33012
|
checkRowFreezeQuantity(cmd) {
|
|
33002
33013
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
|
|
33003
33014
|
? 0 /* CommandResult.Success */
|
|
33004
|
-
:
|
|
33015
|
+
: 75 /* CommandResult.InvalidFreezeQuantity */;
|
|
33005
33016
|
}
|
|
33006
33017
|
checkColFreezeQuantity(cmd) {
|
|
33007
33018
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
|
|
33008
33019
|
? 0 /* CommandResult.Success */
|
|
33009
|
-
:
|
|
33020
|
+
: 75 /* CommandResult.InvalidFreezeQuantity */;
|
|
33010
33021
|
}
|
|
33011
33022
|
checkRowFreezeOverlapMerge(cmd) {
|
|
33012
33023
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
33013
33024
|
for (let merge of merges) {
|
|
33014
33025
|
if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
|
|
33015
|
-
return
|
|
33026
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
33016
33027
|
}
|
|
33017
33028
|
}
|
|
33018
33029
|
return 0 /* CommandResult.Success */;
|
|
@@ -33021,7 +33032,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
33021
33032
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
33022
33033
|
for (let merge of merges) {
|
|
33023
33034
|
if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
|
|
33024
|
-
return
|
|
33035
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
33025
33036
|
}
|
|
33026
33037
|
}
|
|
33027
33038
|
return 0 /* CommandResult.Success */;
|
|
@@ -33752,10 +33763,8 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
33752
33763
|
* that are actually present in the grid.
|
|
33753
33764
|
*/
|
|
33754
33765
|
function range(range) {
|
|
33766
|
+
assertRangeValid(range);
|
|
33755
33767
|
const sheetId = range.sheetId;
|
|
33756
|
-
if (!isZoneValid(range.zone)) {
|
|
33757
|
-
throw new InvalidReferenceError();
|
|
33758
|
-
}
|
|
33759
33768
|
// Performance issue: Avoid fetching data on positions that are out of the spreadsheet
|
|
33760
33769
|
// e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
|
|
33761
33770
|
const sheetZone = getters.getSheetZone(sheetId);
|
|
@@ -33790,23 +33799,26 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
33790
33799
|
* The `compute` of the formula's function must process it completely
|
|
33791
33800
|
*/
|
|
33792
33801
|
function refFn(range, isMeta, functionName, paramNumber) {
|
|
33802
|
+
assertRangeValid(range);
|
|
33793
33803
|
if (isMeta) {
|
|
33794
33804
|
// Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
|
|
33795
33805
|
return { value: zoneToXc(range.zone) };
|
|
33796
33806
|
}
|
|
33797
|
-
if (!isZoneValid(range.zone)) {
|
|
33798
|
-
throw new InvalidReferenceError();
|
|
33799
|
-
}
|
|
33800
33807
|
// if the formula definition could have accepted a range, we would pass through the _range function and not here
|
|
33801
33808
|
if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
|
|
33802
33809
|
throw new Error(paramNumber
|
|
33803
33810
|
? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
|
|
33804
33811
|
: _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
|
|
33805
33812
|
}
|
|
33813
|
+
return readCell(range);
|
|
33814
|
+
}
|
|
33815
|
+
function assertRangeValid(range) {
|
|
33816
|
+
if (!isZoneValid(range.zone)) {
|
|
33817
|
+
throw new InvalidReferenceError();
|
|
33818
|
+
}
|
|
33806
33819
|
if (range.invalidSheetName) {
|
|
33807
33820
|
throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
|
|
33808
33821
|
}
|
|
33809
|
-
return readCell(range);
|
|
33810
33822
|
}
|
|
33811
33823
|
return [refFn, range, evalContext];
|
|
33812
33824
|
}
|
|
@@ -34291,7 +34303,7 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
34291
34303
|
switch (cmd.type) {
|
|
34292
34304
|
case "UPDATE_FILTER":
|
|
34293
34305
|
if (!this.getters.getFilterId(cmd)) {
|
|
34294
|
-
return
|
|
34306
|
+
return 80 /* CommandResult.FilterNotFound */;
|
|
34295
34307
|
}
|
|
34296
34308
|
break;
|
|
34297
34309
|
}
|
|
@@ -35261,7 +35273,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
35261
35273
|
}
|
|
35262
35274
|
checkPositiveDimension(cmd) {
|
|
35263
35275
|
if (cmd.width < 0 || cmd.height < 0) {
|
|
35264
|
-
return
|
|
35276
|
+
return 69 /* CommandResult.InvalidViewportSize */;
|
|
35265
35277
|
}
|
|
35266
35278
|
return 0 /* CommandResult.Success */;
|
|
35267
35279
|
}
|
|
@@ -35271,7 +35283,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
35271
35283
|
cmd.gridOffsetY === this.gridOffsetY &&
|
|
35272
35284
|
cmd.width === width &&
|
|
35273
35285
|
cmd.height === height) {
|
|
35274
|
-
return
|
|
35286
|
+
return 77 /* CommandResult.ValuesNotChanged */;
|
|
35275
35287
|
}
|
|
35276
35288
|
return 0 /* CommandResult.Success */;
|
|
35277
35289
|
}
|
|
@@ -35279,7 +35291,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
35279
35291
|
const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
|
|
35280
35292
|
if ((!pane.canScrollHorizontally && offsetX > 0) ||
|
|
35281
35293
|
(!pane.canScrollVertically && offsetY > 0)) {
|
|
35282
|
-
return
|
|
35294
|
+
return 70 /* CommandResult.InvalidScrollingDirection */;
|
|
35283
35295
|
}
|
|
35284
35296
|
return 0 /* CommandResult.Success */;
|
|
35285
35297
|
}
|
|
@@ -35534,7 +35546,7 @@ class AutofillPlugin extends UIPlugin {
|
|
|
35534
35546
|
if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
|
|
35535
35547
|
return 0 /* CommandResult.Success */;
|
|
35536
35548
|
}
|
|
35537
|
-
return
|
|
35549
|
+
return 46 /* CommandResult.InvalidAutofillSelection */;
|
|
35538
35550
|
case "AUTOFILL_AUTO":
|
|
35539
35551
|
const zone = this.getters.getSelectedZone();
|
|
35540
35552
|
return zone.top === zone.bottom
|
|
@@ -36138,7 +36150,7 @@ class CellPopoverPlugin extends UIPlugin {
|
|
|
36138
36150
|
cellPopoverRegistry.get(cmd.popoverType);
|
|
36139
36151
|
}
|
|
36140
36152
|
catch (error) {
|
|
36141
|
-
return
|
|
36153
|
+
return 73 /* CommandResult.InvalidCellPopover */;
|
|
36142
36154
|
}
|
|
36143
36155
|
return 0 /* CommandResult.Success */;
|
|
36144
36156
|
default:
|
|
@@ -38274,21 +38286,6 @@ class SelectionInputPlugin extends UIPlugin {
|
|
|
38274
38286
|
// ---------------------------------------------------------------------------
|
|
38275
38287
|
// Command Handling
|
|
38276
38288
|
// ---------------------------------------------------------------------------
|
|
38277
|
-
allowDispatch(cmd) {
|
|
38278
|
-
switch (cmd.type) {
|
|
38279
|
-
case "ADD_EMPTY_RANGE":
|
|
38280
|
-
if (this.inputHasSingleRange && this.ranges.length === 1) {
|
|
38281
|
-
return 30 /* CommandResult.MaximumRangesReached */;
|
|
38282
|
-
}
|
|
38283
|
-
break;
|
|
38284
|
-
case "CHANGE_RANGE":
|
|
38285
|
-
if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
38286
|
-
return 30 /* CommandResult.MaximumRangesReached */;
|
|
38287
|
-
}
|
|
38288
|
-
break;
|
|
38289
|
-
}
|
|
38290
|
-
return 0 /* CommandResult.Success */;
|
|
38291
|
-
}
|
|
38292
38289
|
handleEvent(event) {
|
|
38293
38290
|
const xc = zoneToXc(event.anchor.zone);
|
|
38294
38291
|
const inputSheetId = this.activeSheet;
|
|
@@ -38504,6 +38501,15 @@ class SelectionInputsManagerPlugin extends UIPlugin {
|
|
|
38504
38501
|
// Command Handling
|
|
38505
38502
|
// ---------------------------------------------------------------------------
|
|
38506
38503
|
allowDispatch(cmd) {
|
|
38504
|
+
switch (cmd.type) {
|
|
38505
|
+
case "FOCUS_RANGE":
|
|
38506
|
+
case "CHANGE_RANGE":
|
|
38507
|
+
case "ADD_EMPTY_RANGE":
|
|
38508
|
+
case "REMOVE_RANGE":
|
|
38509
|
+
if (!this.inputs[cmd.id]) {
|
|
38510
|
+
return 31 /* CommandResult.InvalidInputId */;
|
|
38511
|
+
}
|
|
38512
|
+
}
|
|
38507
38513
|
switch (cmd.type) {
|
|
38508
38514
|
case "FOCUS_RANGE":
|
|
38509
38515
|
const index = this.currentInput?.getIndex(cmd.rangeId);
|
|
@@ -38511,9 +38517,19 @@ class SelectionInputsManagerPlugin extends UIPlugin {
|
|
|
38511
38517
|
return 29 /* CommandResult.InputAlreadyFocused */;
|
|
38512
38518
|
}
|
|
38513
38519
|
break;
|
|
38514
|
-
|
|
38515
|
-
|
|
38516
|
-
|
|
38520
|
+
case "ADD_EMPTY_RANGE":
|
|
38521
|
+
const input = this.inputs[cmd.id];
|
|
38522
|
+
if (input.inputHasSingleRange && input.ranges.length === 1) {
|
|
38523
|
+
return 30 /* CommandResult.MaximumRangesReached */;
|
|
38524
|
+
}
|
|
38525
|
+
break;
|
|
38526
|
+
case "CHANGE_RANGE": {
|
|
38527
|
+
const input = this.inputs[cmd.id];
|
|
38528
|
+
if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
38529
|
+
return 30 /* CommandResult.MaximumRangesReached */;
|
|
38530
|
+
}
|
|
38531
|
+
break;
|
|
38532
|
+
}
|
|
38517
38533
|
}
|
|
38518
38534
|
return 0 /* CommandResult.Success */;
|
|
38519
38535
|
}
|
|
@@ -38637,7 +38653,7 @@ class SortPlugin extends UIPlugin {
|
|
|
38637
38653
|
/*Test the presence of single cells*/
|
|
38638
38654
|
const singleCells = positions(zone).some(({ col, row }) => !this.getters.isInMerge({ sheetId, col, row }));
|
|
38639
38655
|
if (singleCells) {
|
|
38640
|
-
return
|
|
38656
|
+
return 64 /* CommandResult.InvalidSortZone */;
|
|
38641
38657
|
}
|
|
38642
38658
|
return 0 /* CommandResult.Success */;
|
|
38643
38659
|
}
|
|
@@ -38656,7 +38672,7 @@ class SortPlugin extends UIPlugin {
|
|
|
38656
38672
|
];
|
|
38657
38673
|
return widthCurrent === widthFirst && heightCurrent === heightFirst;
|
|
38658
38674
|
})) {
|
|
38659
|
-
return
|
|
38675
|
+
return 64 /* CommandResult.InvalidSortZone */;
|
|
38660
38676
|
}
|
|
38661
38677
|
return 0 /* CommandResult.Success */;
|
|
38662
38678
|
}
|
|
@@ -39159,7 +39175,7 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
39159
39175
|
const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.tryGetActiveSheetId();
|
|
39160
39176
|
const zones = this.getters.getCommandZones(cmd);
|
|
39161
39177
|
if (!sheetId && zones.length > 0) {
|
|
39162
|
-
return
|
|
39178
|
+
return 93 /* CommandResult.NoActiveSheet */;
|
|
39163
39179
|
}
|
|
39164
39180
|
if (sheetId && zones.length > 0) {
|
|
39165
39181
|
return this.getters.checkZonesExistInSheet(sheetId, zones);
|
|
@@ -39641,13 +39657,13 @@ class SplitToColumnsPlugin extends UIPlugin {
|
|
|
39641
39657
|
}
|
|
39642
39658
|
checkSingleColSelected() {
|
|
39643
39659
|
if (!this.getters.isSingleColSelected()) {
|
|
39644
|
-
return
|
|
39660
|
+
return 89 /* CommandResult.MoreThanOneColumnSelected */;
|
|
39645
39661
|
}
|
|
39646
39662
|
return 0 /* CommandResult.Success */;
|
|
39647
39663
|
}
|
|
39648
39664
|
checkNonEmptySelector(cmd) {
|
|
39649
39665
|
if (cmd.separator === "") {
|
|
39650
|
-
return
|
|
39666
|
+
return 90 /* CommandResult.EmptySplitSeparator */;
|
|
39651
39667
|
}
|
|
39652
39668
|
return 0 /* CommandResult.Success */;
|
|
39653
39669
|
}
|
|
@@ -39658,7 +39674,7 @@ class SplitToColumnsPlugin extends UIPlugin {
|
|
|
39658
39674
|
const selection = this.getters.getSelectedZones()[0];
|
|
39659
39675
|
const splitted = this.getSplittedCols(selection, cmd.separator);
|
|
39660
39676
|
if (this.willSplittedColsOverwriteContent(selection, splitted)) {
|
|
39661
|
-
return
|
|
39677
|
+
return 91 /* CommandResult.SplitWillOverwriteContent */;
|
|
39662
39678
|
}
|
|
39663
39679
|
return 0 /* CommandResult.Success */;
|
|
39664
39680
|
}
|
|
@@ -39669,7 +39685,7 @@ class SplitToColumnsPlugin extends UIPlugin {
|
|
|
39669
39685
|
return 0 /* CommandResult.Success */;
|
|
39670
39686
|
}
|
|
39671
39687
|
}
|
|
39672
|
-
return
|
|
39688
|
+
return 92 /* CommandResult.NoSplitSeparatorInSelection */;
|
|
39673
39689
|
}
|
|
39674
39690
|
}
|
|
39675
39691
|
|
|
@@ -39816,7 +39832,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
|
|
|
39816
39832
|
for (const zone of this.getPasteZones(target)) {
|
|
39817
39833
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
39818
39834
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
39819
|
-
return
|
|
39835
|
+
return 76 /* CommandResult.FrozenPaneOverlap */;
|
|
39820
39836
|
}
|
|
39821
39837
|
}
|
|
39822
39838
|
return 0 /* CommandResult.Success */;
|
|
@@ -40210,7 +40226,7 @@ class ClipboardFigureState {
|
|
|
40210
40226
|
}
|
|
40211
40227
|
isPasteAllowed(target, option) {
|
|
40212
40228
|
if (target.length === 0) {
|
|
40213
|
-
return
|
|
40229
|
+
return 74 /* CommandResult.EmptyTarget */;
|
|
40214
40230
|
}
|
|
40215
40231
|
if (option?.pasteOption !== undefined) {
|
|
40216
40232
|
return 22 /* CommandResult.WrongFigurePasteOption */;
|
|
@@ -40951,7 +40967,7 @@ class EditionPlugin extends UIPlugin {
|
|
|
40951
40967
|
validateSelection(length, start, end) {
|
|
40952
40968
|
return start >= 0 && start <= length && end >= 0 && end <= length
|
|
40953
40969
|
? 0 /* CommandResult.Success */
|
|
40954
|
-
:
|
|
40970
|
+
: 47 /* CommandResult.WrongComposerSelection */;
|
|
40955
40971
|
}
|
|
40956
40972
|
onColumnsRemoved(cmd) {
|
|
40957
40973
|
if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
|
|
@@ -41262,9 +41278,10 @@ class EditionPlugin extends UIPlugin {
|
|
|
41262
41278
|
*/
|
|
41263
41279
|
getReferencedRanges() {
|
|
41264
41280
|
const editionSheetId = this.getters.getCurrentEditedCell().sheetId;
|
|
41265
|
-
|
|
41281
|
+
const referenceRanges = this.currentTokens
|
|
41266
41282
|
.filter((token) => token.type === "REFERENCE")
|
|
41267
41283
|
.map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
|
|
41284
|
+
return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
|
|
41268
41285
|
}
|
|
41269
41286
|
/**
|
|
41270
41287
|
* Function used to determine when composer selection can start.
|
|
@@ -41903,7 +41920,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
41903
41920
|
const headers = [cmd.base, ...cmd.elements];
|
|
41904
41921
|
const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
|
|
41905
41922
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
41906
|
-
return
|
|
41923
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
41907
41924
|
}
|
|
41908
41925
|
return 0 /* CommandResult.Success */;
|
|
41909
41926
|
}
|
|
@@ -45252,7 +45269,7 @@ class SelectionStreamProcessorImpl {
|
|
|
45252
45269
|
*/
|
|
45253
45270
|
moveAnchorCell(direction, step = 1) {
|
|
45254
45271
|
if (step !== "end" && step <= 0) {
|
|
45255
|
-
return new DispatchResult(
|
|
45272
|
+
return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
|
|
45256
45273
|
}
|
|
45257
45274
|
const { col, row } = this.getNextAvailablePosition(direction, step);
|
|
45258
45275
|
return this.selectCell(col, row);
|
|
@@ -45298,7 +45315,7 @@ class SelectionStreamProcessorImpl {
|
|
|
45298
45315
|
*/
|
|
45299
45316
|
resizeAnchorZone(direction, step = 1) {
|
|
45300
45317
|
if (step !== "end" && step <= 0) {
|
|
45301
|
-
return new DispatchResult(
|
|
45318
|
+
return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
|
|
45302
45319
|
}
|
|
45303
45320
|
const sheetId = this.getters.getActiveSheetId();
|
|
45304
45321
|
const anchor = this.anchor;
|
|
@@ -46125,12 +46142,7 @@ function addFormula(cell) {
|
|
|
46125
46142
|
attrs.push(["t", "str"]);
|
|
46126
46143
|
cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
46127
46144
|
}
|
|
46128
|
-
node = escapeXml /*xml*/
|
|
46129
|
-
<f>
|
|
46130
|
-
${XlsxFormula}
|
|
46131
|
-
</f>
|
|
46132
|
-
${cycle}
|
|
46133
|
-
`;
|
|
46145
|
+
node = escapeXml /*xml*/ `<f> ${XlsxFormula} </f> ${cycle}`;
|
|
46134
46146
|
return { attrs, node };
|
|
46135
46147
|
}
|
|
46136
46148
|
else {
|
|
@@ -46952,11 +46964,10 @@ function addRows(construct, data, sheet) {
|
|
|
46952
46964
|
({ attrs: additionalAttrs, node: cellNode } = addContent(cell.content, construct.sharedStrings, isTableHeader));
|
|
46953
46965
|
}
|
|
46954
46966
|
attributes.push(...additionalAttrs);
|
|
46955
|
-
|
|
46956
|
-
|
|
46957
|
-
|
|
46958
|
-
|
|
46959
|
-
`);
|
|
46967
|
+
// prettier-ignore
|
|
46968
|
+
cellNodes.push(escapeXml /*xml*/ `<c ${formatAttributes(attributes)}>
|
|
46969
|
+
${cellNode}
|
|
46970
|
+
</c>`);
|
|
46960
46971
|
}
|
|
46961
46972
|
}
|
|
46962
46973
|
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden) {
|
|
@@ -47641,10 +47652,10 @@ class Model extends EventBus {
|
|
|
47641
47652
|
const command = createCommand(type, payload);
|
|
47642
47653
|
let status = this.status;
|
|
47643
47654
|
if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
|
|
47644
|
-
return new DispatchResult(
|
|
47655
|
+
return new DispatchResult(68 /* CommandResult.Readonly */);
|
|
47645
47656
|
}
|
|
47646
47657
|
if (!this.session.canApplyOptimisticUpdate()) {
|
|
47647
|
-
return new DispatchResult(
|
|
47658
|
+
return new DispatchResult(65 /* CommandResult.WaitingSessionConfirmation */);
|
|
47648
47659
|
}
|
|
47649
47660
|
switch (status) {
|
|
47650
47661
|
case 0 /* Status.Ready */:
|
|
@@ -47895,6 +47906,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
47895
47906
|
export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
|
|
47896
47907
|
|
|
47897
47908
|
|
|
47898
|
-
__info__.version = '16.3.
|
|
47899
|
-
__info__.date = '2024-
|
|
47900
|
-
__info__.hash = '
|
|
47909
|
+
__info__.version = '16.3.24';
|
|
47910
|
+
__info__.date = '2024-02-02T13:45:48.440Z';
|
|
47911
|
+
__info__.hash = '0bf5f45';
|