@odoo/o-spreadsheet 16.1.31 → 16.1.33
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 +257 -246
- package/dist/o-spreadsheet.d.ts +60 -60
- package/dist/o-spreadsheet.esm.js +257 -246
- package/dist/o-spreadsheet.iife.js +257 -246
- package/dist/o-spreadsheet.iife.min.js +13 -13
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -913,7 +913,7 @@ function isBoolean(str) {
|
|
|
913
913
|
function isDateTime(str) {
|
|
914
914
|
return parseDateTime(str) !== null;
|
|
915
915
|
}
|
|
916
|
-
const MARKDOWN_LINK_REGEX = /^\[(
|
|
916
|
+
const MARKDOWN_LINK_REGEX = /^\[(.+)\]\((.+)\)$/;
|
|
917
917
|
//link must start with http or https
|
|
918
918
|
//https://stackoverflow.com/a/3809435/4760614
|
|
919
919
|
const WEB_LINK_REGEX = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
|
|
@@ -2005,27 +2005,30 @@ function detectFormat(content) {
|
|
|
2005
2005
|
}
|
|
2006
2006
|
function createLargeNumberFormat(format, magnitude, postFix) {
|
|
2007
2007
|
const internalFormat = parseFormat(format || "#,##0");
|
|
2008
|
-
const largeNumberFormat =
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
format: {
|
|
2015
|
-
...formatPart.format,
|
|
2016
|
-
magnitude,
|
|
2017
|
-
decimalPart: undefined,
|
|
2018
|
-
},
|
|
2019
|
-
},
|
|
2020
|
-
{
|
|
2021
|
-
type: "STRING",
|
|
2022
|
-
format: postFix,
|
|
2023
|
-
},
|
|
2024
|
-
];
|
|
2008
|
+
const largeNumberFormat = [];
|
|
2009
|
+
for (let i = 0; i < internalFormat.length; i++) {
|
|
2010
|
+
const formatPart = internalFormat[i];
|
|
2011
|
+
if (formatPart.type !== "NUMBER") {
|
|
2012
|
+
largeNumberFormat.push(formatPart);
|
|
2013
|
+
continue;
|
|
2025
2014
|
}
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2015
|
+
largeNumberFormat.push({
|
|
2016
|
+
...formatPart,
|
|
2017
|
+
format: {
|
|
2018
|
+
...formatPart.format,
|
|
2019
|
+
magnitude,
|
|
2020
|
+
decimalPart: undefined,
|
|
2021
|
+
},
|
|
2022
|
+
});
|
|
2023
|
+
largeNumberFormat.push({
|
|
2024
|
+
type: "STRING",
|
|
2025
|
+
format: postFix,
|
|
2026
|
+
});
|
|
2027
|
+
const nextFormatPart = internalFormat[i + 1];
|
|
2028
|
+
if ((nextFormatPart === null || nextFormatPart === void 0 ? void 0 : nextFormatPart.type) === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
|
|
2029
|
+
i++;
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2029
2032
|
return convertInternalFormatToFormat(largeNumberFormat);
|
|
2030
2033
|
}
|
|
2031
2034
|
function changeDecimalPlaces(format, step) {
|
|
@@ -3670,64 +3673,65 @@ exports.CommandResult = void 0;
|
|
|
3670
3673
|
CommandResult[CommandResult["InvalidFigureId"] = 28] = "InvalidFigureId";
|
|
3671
3674
|
CommandResult[CommandResult["InputAlreadyFocused"] = 29] = "InputAlreadyFocused";
|
|
3672
3675
|
CommandResult[CommandResult["MaximumRangesReached"] = 30] = "MaximumRangesReached";
|
|
3673
|
-
CommandResult[CommandResult["
|
|
3674
|
-
CommandResult[CommandResult["
|
|
3675
|
-
CommandResult[CommandResult["
|
|
3676
|
-
CommandResult[CommandResult["
|
|
3677
|
-
CommandResult[CommandResult["
|
|
3678
|
-
CommandResult[CommandResult["
|
|
3679
|
-
CommandResult[CommandResult["
|
|
3680
|
-
CommandResult[CommandResult["
|
|
3681
|
-
CommandResult[CommandResult["
|
|
3682
|
-
CommandResult[CommandResult["
|
|
3683
|
-
CommandResult[CommandResult["
|
|
3684
|
-
CommandResult[CommandResult["
|
|
3685
|
-
CommandResult[CommandResult["
|
|
3686
|
-
CommandResult[CommandResult["
|
|
3687
|
-
CommandResult[CommandResult["
|
|
3688
|
-
CommandResult[CommandResult["
|
|
3689
|
-
CommandResult[CommandResult["
|
|
3690
|
-
CommandResult[CommandResult["
|
|
3691
|
-
CommandResult[CommandResult["
|
|
3692
|
-
CommandResult[CommandResult["
|
|
3693
|
-
CommandResult[CommandResult["
|
|
3694
|
-
CommandResult[CommandResult["
|
|
3695
|
-
CommandResult[CommandResult["
|
|
3696
|
-
CommandResult[CommandResult["
|
|
3697
|
-
CommandResult[CommandResult["
|
|
3698
|
-
CommandResult[CommandResult["
|
|
3699
|
-
CommandResult[CommandResult["
|
|
3700
|
-
CommandResult[CommandResult["
|
|
3701
|
-
CommandResult[CommandResult["
|
|
3702
|
-
CommandResult[CommandResult["
|
|
3703
|
-
CommandResult[CommandResult["
|
|
3704
|
-
CommandResult[CommandResult["
|
|
3705
|
-
CommandResult[CommandResult["
|
|
3706
|
-
CommandResult[CommandResult["
|
|
3707
|
-
CommandResult[CommandResult["
|
|
3708
|
-
CommandResult[CommandResult["
|
|
3709
|
-
CommandResult[CommandResult["
|
|
3710
|
-
CommandResult[CommandResult["
|
|
3711
|
-
CommandResult[CommandResult["
|
|
3712
|
-
CommandResult[CommandResult["
|
|
3713
|
-
CommandResult[CommandResult["
|
|
3714
|
-
CommandResult[CommandResult["
|
|
3715
|
-
CommandResult[CommandResult["
|
|
3716
|
-
CommandResult[CommandResult["
|
|
3717
|
-
CommandResult[CommandResult["
|
|
3718
|
-
CommandResult[CommandResult["
|
|
3719
|
-
CommandResult[CommandResult["
|
|
3720
|
-
CommandResult[CommandResult["
|
|
3721
|
-
CommandResult[CommandResult["
|
|
3722
|
-
CommandResult[CommandResult["
|
|
3723
|
-
CommandResult[CommandResult["
|
|
3724
|
-
CommandResult[CommandResult["
|
|
3725
|
-
CommandResult[CommandResult["
|
|
3726
|
-
CommandResult[CommandResult["
|
|
3727
|
-
CommandResult[CommandResult["
|
|
3728
|
-
CommandResult[CommandResult["
|
|
3729
|
-
CommandResult[CommandResult["
|
|
3730
|
-
CommandResult[CommandResult["
|
|
3676
|
+
CommandResult[CommandResult["InvalidInputId"] = 31] = "InvalidInputId";
|
|
3677
|
+
CommandResult[CommandResult["InvalidChartDefinition"] = 32] = "InvalidChartDefinition";
|
|
3678
|
+
CommandResult[CommandResult["InvalidDataSet"] = 33] = "InvalidDataSet";
|
|
3679
|
+
CommandResult[CommandResult["InvalidLabelRange"] = 34] = "InvalidLabelRange";
|
|
3680
|
+
CommandResult[CommandResult["InvalidScorecardKeyValue"] = 35] = "InvalidScorecardKeyValue";
|
|
3681
|
+
CommandResult[CommandResult["InvalidScorecardBaseline"] = 36] = "InvalidScorecardBaseline";
|
|
3682
|
+
CommandResult[CommandResult["InvalidGaugeDataRange"] = 37] = "InvalidGaugeDataRange";
|
|
3683
|
+
CommandResult[CommandResult["EmptyGaugeRangeMin"] = 38] = "EmptyGaugeRangeMin";
|
|
3684
|
+
CommandResult[CommandResult["GaugeRangeMinNaN"] = 39] = "GaugeRangeMinNaN";
|
|
3685
|
+
CommandResult[CommandResult["EmptyGaugeRangeMax"] = 40] = "EmptyGaugeRangeMax";
|
|
3686
|
+
CommandResult[CommandResult["GaugeRangeMaxNaN"] = 41] = "GaugeRangeMaxNaN";
|
|
3687
|
+
CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 42] = "GaugeRangeMinBiggerThanRangeMax";
|
|
3688
|
+
CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 43] = "GaugeLowerInflectionPointNaN";
|
|
3689
|
+
CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 44] = "GaugeUpperInflectionPointNaN";
|
|
3690
|
+
CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 45] = "GaugeLowerBiggerThanUpper";
|
|
3691
|
+
CommandResult[CommandResult["InvalidAutofillSelection"] = 46] = "InvalidAutofillSelection";
|
|
3692
|
+
CommandResult[CommandResult["WrongComposerSelection"] = 47] = "WrongComposerSelection";
|
|
3693
|
+
CommandResult[CommandResult["MinBiggerThanMax"] = 48] = "MinBiggerThanMax";
|
|
3694
|
+
CommandResult[CommandResult["LowerBiggerThanUpper"] = 49] = "LowerBiggerThanUpper";
|
|
3695
|
+
CommandResult[CommandResult["MidBiggerThanMax"] = 50] = "MidBiggerThanMax";
|
|
3696
|
+
CommandResult[CommandResult["MinBiggerThanMid"] = 51] = "MinBiggerThanMid";
|
|
3697
|
+
CommandResult[CommandResult["FirstArgMissing"] = 52] = "FirstArgMissing";
|
|
3698
|
+
CommandResult[CommandResult["SecondArgMissing"] = 53] = "SecondArgMissing";
|
|
3699
|
+
CommandResult[CommandResult["MinNaN"] = 54] = "MinNaN";
|
|
3700
|
+
CommandResult[CommandResult["MidNaN"] = 55] = "MidNaN";
|
|
3701
|
+
CommandResult[CommandResult["MaxNaN"] = 56] = "MaxNaN";
|
|
3702
|
+
CommandResult[CommandResult["ValueUpperInflectionNaN"] = 57] = "ValueUpperInflectionNaN";
|
|
3703
|
+
CommandResult[CommandResult["ValueLowerInflectionNaN"] = 58] = "ValueLowerInflectionNaN";
|
|
3704
|
+
CommandResult[CommandResult["MinInvalidFormula"] = 59] = "MinInvalidFormula";
|
|
3705
|
+
CommandResult[CommandResult["MidInvalidFormula"] = 60] = "MidInvalidFormula";
|
|
3706
|
+
CommandResult[CommandResult["MaxInvalidFormula"] = 61] = "MaxInvalidFormula";
|
|
3707
|
+
CommandResult[CommandResult["ValueUpperInvalidFormula"] = 62] = "ValueUpperInvalidFormula";
|
|
3708
|
+
CommandResult[CommandResult["ValueLowerInvalidFormula"] = 63] = "ValueLowerInvalidFormula";
|
|
3709
|
+
CommandResult[CommandResult["InvalidSortZone"] = 64] = "InvalidSortZone";
|
|
3710
|
+
CommandResult[CommandResult["WaitingSessionConfirmation"] = 65] = "WaitingSessionConfirmation";
|
|
3711
|
+
CommandResult[CommandResult["MergeOverlap"] = 66] = "MergeOverlap";
|
|
3712
|
+
CommandResult[CommandResult["TooManyHiddenElements"] = 67] = "TooManyHiddenElements";
|
|
3713
|
+
CommandResult[CommandResult["Readonly"] = 68] = "Readonly";
|
|
3714
|
+
CommandResult[CommandResult["InvalidViewportSize"] = 69] = "InvalidViewportSize";
|
|
3715
|
+
CommandResult[CommandResult["InvalidScrollingDirection"] = 70] = "InvalidScrollingDirection";
|
|
3716
|
+
CommandResult[CommandResult["FigureDoesNotExist"] = 71] = "FigureDoesNotExist";
|
|
3717
|
+
CommandResult[CommandResult["InvalidConditionalFormatId"] = 72] = "InvalidConditionalFormatId";
|
|
3718
|
+
CommandResult[CommandResult["InvalidCellPopover"] = 73] = "InvalidCellPopover";
|
|
3719
|
+
CommandResult[CommandResult["EmptyTarget"] = 74] = "EmptyTarget";
|
|
3720
|
+
CommandResult[CommandResult["InvalidFreezeQuantity"] = 75] = "InvalidFreezeQuantity";
|
|
3721
|
+
CommandResult[CommandResult["FrozenPaneOverlap"] = 76] = "FrozenPaneOverlap";
|
|
3722
|
+
CommandResult[CommandResult["ValuesNotChanged"] = 77] = "ValuesNotChanged";
|
|
3723
|
+
CommandResult[CommandResult["InvalidFilterZone"] = 78] = "InvalidFilterZone";
|
|
3724
|
+
CommandResult[CommandResult["FilterOverlap"] = 79] = "FilterOverlap";
|
|
3725
|
+
CommandResult[CommandResult["FilterNotFound"] = 80] = "FilterNotFound";
|
|
3726
|
+
CommandResult[CommandResult["MergeInFilter"] = 81] = "MergeInFilter";
|
|
3727
|
+
CommandResult[CommandResult["NonContinuousTargets"] = 82] = "NonContinuousTargets";
|
|
3728
|
+
CommandResult[CommandResult["DuplicatedFigureId"] = 83] = "DuplicatedFigureId";
|
|
3729
|
+
CommandResult[CommandResult["InvalidSelectionStep"] = 84] = "InvalidSelectionStep";
|
|
3730
|
+
CommandResult[CommandResult["DuplicatedChartId"] = 85] = "DuplicatedChartId";
|
|
3731
|
+
CommandResult[CommandResult["ChartDoesNotExist"] = 86] = "ChartDoesNotExist";
|
|
3732
|
+
CommandResult[CommandResult["InvalidHeaderIndex"] = 87] = "InvalidHeaderIndex";
|
|
3733
|
+
CommandResult[CommandResult["InvalidQuantity"] = 88] = "InvalidQuantity";
|
|
3734
|
+
CommandResult[CommandResult["NoChanges"] = 89] = "NoChanges";
|
|
3731
3735
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
3732
3736
|
|
|
3733
3737
|
function isMatrix(x) {
|
|
@@ -4001,11 +4005,11 @@ function checkDataset(definition) {
|
|
|
4001
4005
|
if (definition.dataSets) {
|
|
4002
4006
|
const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
|
|
4003
4007
|
if (invalidRanges) {
|
|
4004
|
-
return
|
|
4008
|
+
return 33 /* CommandResult.InvalidDataSet */;
|
|
4005
4009
|
}
|
|
4006
4010
|
const zones = definition.dataSets.map(toUnboundedZone);
|
|
4007
4011
|
if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
|
|
4008
|
-
return
|
|
4012
|
+
return 33 /* CommandResult.InvalidDataSet */;
|
|
4009
4013
|
}
|
|
4010
4014
|
}
|
|
4011
4015
|
return 0 /* CommandResult.Success */;
|
|
@@ -4014,7 +4018,7 @@ function checkLabelRange(definition) {
|
|
|
4014
4018
|
if (definition.labelRange) {
|
|
4015
4019
|
const invalidLabels = !rangeReference.test(definition.labelRange || "");
|
|
4016
4020
|
if (invalidLabels) {
|
|
4017
|
-
return
|
|
4021
|
+
return 34 /* CommandResult.InvalidLabelRange */;
|
|
4018
4022
|
}
|
|
4019
4023
|
}
|
|
4020
4024
|
return 0 /* CommandResult.Success */;
|
|
@@ -4087,22 +4091,22 @@ function getChartPositionAtCenterOfViewport(getters, chartSize) {
|
|
|
4087
4091
|
const CfTerms = {
|
|
4088
4092
|
Errors: {
|
|
4089
4093
|
[25 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
|
|
4090
|
-
[
|
|
4091
|
-
[
|
|
4092
|
-
[
|
|
4093
|
-
[
|
|
4094
|
-
[
|
|
4095
|
-
[
|
|
4096
|
-
[
|
|
4097
|
-
[
|
|
4098
|
-
[
|
|
4099
|
-
[
|
|
4100
|
-
[
|
|
4101
|
-
[
|
|
4102
|
-
[
|
|
4103
|
-
[
|
|
4104
|
-
[
|
|
4105
|
-
[
|
|
4094
|
+
[52 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
|
|
4095
|
+
[53 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
|
|
4096
|
+
[54 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
|
|
4097
|
+
[55 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
|
|
4098
|
+
[56 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
|
|
4099
|
+
[57 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
|
|
4100
|
+
[58 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
|
|
4101
|
+
[48 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
|
|
4102
|
+
[51 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
|
|
4103
|
+
[50 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
|
|
4104
|
+
[49 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
|
|
4105
|
+
[59 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
|
|
4106
|
+
[61 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
|
|
4107
|
+
[60 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
|
|
4108
|
+
[62 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
|
|
4109
|
+
[63 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
|
|
4106
4110
|
[24 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
|
|
4107
4111
|
Unexpected: _lt("The rule is invalid for an unknown reason"),
|
|
4108
4112
|
},
|
|
@@ -4130,20 +4134,20 @@ const ChartTerms = {
|
|
|
4130
4134
|
Errors: {
|
|
4131
4135
|
Unexpected: _lt("The chart definition is invalid for an unknown reason"),
|
|
4132
4136
|
// BASIC CHART ERRORS (LINE | BAR | PIE)
|
|
4133
|
-
[
|
|
4134
|
-
[
|
|
4137
|
+
[33 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
|
|
4138
|
+
[34 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
|
|
4135
4139
|
// SCORECARD CHART ERRORS
|
|
4136
|
-
[
|
|
4137
|
-
[
|
|
4140
|
+
[35 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
|
|
4141
|
+
[36 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
|
|
4138
4142
|
// GAUGE CHART ERRORS
|
|
4139
|
-
[
|
|
4140
|
-
[
|
|
4141
|
-
[
|
|
4142
|
-
[
|
|
4143
|
-
[
|
|
4144
|
-
[
|
|
4145
|
-
[
|
|
4146
|
-
[
|
|
4143
|
+
[37 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
|
|
4144
|
+
[38 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
|
|
4145
|
+
[39 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
|
|
4146
|
+
[40 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
|
|
4147
|
+
[41 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
|
|
4148
|
+
[42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
|
|
4149
|
+
[43 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
|
|
4150
|
+
[44 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
|
|
4147
4151
|
},
|
|
4148
4152
|
};
|
|
4149
4153
|
const NumberFormatTerms = {
|
|
@@ -4515,7 +4519,7 @@ function createBarChartRuntime(chart, getters) {
|
|
|
4515
4519
|
|
|
4516
4520
|
function isDataRangeValid(definition) {
|
|
4517
4521
|
return definition.dataRange && !rangeReference.test(definition.dataRange)
|
|
4518
|
-
?
|
|
4522
|
+
? 37 /* CommandResult.InvalidGaugeDataRange */
|
|
4519
4523
|
: 0 /* CommandResult.Success */;
|
|
4520
4524
|
}
|
|
4521
4525
|
function checkRangeLimits(check, batchValidations) {
|
|
@@ -4547,7 +4551,7 @@ function checkInflectionPointsValue(check, batchValidations) {
|
|
|
4547
4551
|
function checkRangeMinBiggerThanRangeMax(definition) {
|
|
4548
4552
|
if (definition.sectionRule) {
|
|
4549
4553
|
if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
|
|
4550
|
-
return
|
|
4554
|
+
return 42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
|
|
4551
4555
|
}
|
|
4552
4556
|
}
|
|
4553
4557
|
return 0 /* CommandResult.Success */;
|
|
@@ -4556,9 +4560,9 @@ function checkEmpty(value, valueName) {
|
|
|
4556
4560
|
if (value === "") {
|
|
4557
4561
|
switch (valueName) {
|
|
4558
4562
|
case "rangeMin":
|
|
4559
|
-
return
|
|
4563
|
+
return 38 /* CommandResult.EmptyGaugeRangeMin */;
|
|
4560
4564
|
case "rangeMax":
|
|
4561
|
-
return
|
|
4565
|
+
return 40 /* CommandResult.EmptyGaugeRangeMax */;
|
|
4562
4566
|
}
|
|
4563
4567
|
}
|
|
4564
4568
|
return 0 /* CommandResult.Success */;
|
|
@@ -4567,13 +4571,13 @@ function checkNaN(value, valueName) {
|
|
|
4567
4571
|
if (isNaN(value)) {
|
|
4568
4572
|
switch (valueName) {
|
|
4569
4573
|
case "rangeMin":
|
|
4570
|
-
return
|
|
4574
|
+
return 39 /* CommandResult.GaugeRangeMinNaN */;
|
|
4571
4575
|
case "rangeMax":
|
|
4572
|
-
return
|
|
4576
|
+
return 41 /* CommandResult.GaugeRangeMaxNaN */;
|
|
4573
4577
|
case "lowerInflectionPointValue":
|
|
4574
|
-
return
|
|
4578
|
+
return 43 /* CommandResult.GaugeLowerInflectionPointNaN */;
|
|
4575
4579
|
case "upperInflectionPointValue":
|
|
4576
|
-
return
|
|
4580
|
+
return 44 /* CommandResult.GaugeUpperInflectionPointNaN */;
|
|
4577
4581
|
}
|
|
4578
4582
|
}
|
|
4579
4583
|
return 0 /* CommandResult.Success */;
|
|
@@ -5324,12 +5328,12 @@ function createPieChartRuntime(chart, getters) {
|
|
|
5324
5328
|
|
|
5325
5329
|
function checkKeyValue(definition) {
|
|
5326
5330
|
return definition.keyValue && !rangeReference.test(definition.keyValue)
|
|
5327
|
-
?
|
|
5331
|
+
? 35 /* CommandResult.InvalidScorecardKeyValue */
|
|
5328
5332
|
: 0 /* CommandResult.Success */;
|
|
5329
5333
|
}
|
|
5330
5334
|
function checkBaseline(definition) {
|
|
5331
5335
|
return definition.baseline && !rangeReference.test(definition.baseline)
|
|
5332
|
-
?
|
|
5336
|
+
? 36 /* CommandResult.InvalidScorecardBaseline */
|
|
5333
5337
|
: 0 /* CommandResult.Success */;
|
|
5334
5338
|
}
|
|
5335
5339
|
class ScorecardChart extends AbstractChart {
|
|
@@ -6371,7 +6375,7 @@ function handlePasteResult(env, result) {
|
|
|
6371
6375
|
else if (result.reasons.includes(22 /* CommandResult.WrongFigurePasteOption */)) {
|
|
6372
6376
|
env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
|
|
6373
6377
|
}
|
|
6374
|
-
else if (result.reasons.includes(
|
|
6378
|
+
else if (result.reasons.includes(76 /* CommandResult.FrozenPaneOverlap */)) {
|
|
6375
6379
|
env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
|
|
6376
6380
|
}
|
|
6377
6381
|
}
|
|
@@ -6658,7 +6662,7 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
|
6658
6662
|
});
|
|
6659
6663
|
}
|
|
6660
6664
|
}
|
|
6661
|
-
if (result.isCancelledBecause(
|
|
6665
|
+
if (result.isCancelledBecause(64 /* CommandResult.InvalidSortZone */)) {
|
|
6662
6666
|
const { col, row } = anchor;
|
|
6663
6667
|
env.model.selection.selectZone({ cell: { col, row }, zone });
|
|
6664
6668
|
env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
|
|
@@ -6672,13 +6676,13 @@ const AddFilterInteractiveContent = {
|
|
|
6672
6676
|
};
|
|
6673
6677
|
function interactiveAddFilter(env, sheetId, target) {
|
|
6674
6678
|
const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
|
|
6675
|
-
if (result.isCancelledBecause(
|
|
6679
|
+
if (result.isCancelledBecause(79 /* CommandResult.FilterOverlap */)) {
|
|
6676
6680
|
env.raiseError(AddFilterInteractiveContent.filterOverlap);
|
|
6677
6681
|
}
|
|
6678
|
-
else if (result.isCancelledBecause(
|
|
6682
|
+
else if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
|
|
6679
6683
|
env.raiseError(AddFilterInteractiveContent.mergeInFilter);
|
|
6680
6684
|
}
|
|
6681
|
-
else if (result.isCancelledBecause(
|
|
6685
|
+
else if (result.isCancelledBecause(82 /* CommandResult.NonContinuousTargets */)) {
|
|
6682
6686
|
env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
|
|
6683
6687
|
}
|
|
6684
6688
|
}
|
|
@@ -16629,7 +16633,7 @@ class EditionPlugin extends UIPlugin {
|
|
|
16629
16633
|
validateSelection(length, start, end) {
|
|
16630
16634
|
return start >= 0 && start <= length && end >= 0 && end <= length
|
|
16631
16635
|
? 0 /* CommandResult.Success */
|
|
16632
|
-
:
|
|
16636
|
+
: 47 /* CommandResult.WrongComposerSelection */;
|
|
16633
16637
|
}
|
|
16634
16638
|
onColumnsRemoved(cmd) {
|
|
16635
16639
|
if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
|
|
@@ -16943,9 +16947,10 @@ class EditionPlugin extends UIPlugin {
|
|
|
16943
16947
|
*/
|
|
16944
16948
|
getReferencedRanges() {
|
|
16945
16949
|
const editionSheetId = this.getters.getEditionSheet();
|
|
16946
|
-
|
|
16950
|
+
const referenceRanges = this.currentTokens
|
|
16947
16951
|
.filter((token) => token.type === "REFERENCE")
|
|
16948
16952
|
.map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
|
|
16953
|
+
return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
|
|
16949
16954
|
}
|
|
16950
16955
|
/**
|
|
16951
16956
|
* Function used to determine when composer selection can start.
|
|
@@ -19383,7 +19388,7 @@ function interactiveFreezeColumnsRows(env, dimension, base) {
|
|
|
19383
19388
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
19384
19389
|
const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
|
|
19385
19390
|
const result = env.model.dispatch(cmd, { sheetId, quantity: base });
|
|
19386
|
-
if (result.isCancelledBecause(
|
|
19391
|
+
if (result.isCancelledBecause(66 /* CommandResult.MergeOverlap */)) {
|
|
19387
19392
|
env.raiseError(MergeErrorMessage);
|
|
19388
19393
|
}
|
|
19389
19394
|
}
|
|
@@ -20098,11 +20103,11 @@ class LineBarPieConfigPanel extends owl.Component {
|
|
|
20098
20103
|
}
|
|
20099
20104
|
get isDatasetInvalid() {
|
|
20100
20105
|
var _a;
|
|
20101
|
-
return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
20106
|
+
return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidDataSet */));
|
|
20102
20107
|
}
|
|
20103
20108
|
get isLabelInvalid() {
|
|
20104
20109
|
var _a;
|
|
20105
|
-
return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
20110
|
+
return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidLabelRange */));
|
|
20106
20111
|
}
|
|
20107
20112
|
onUpdateDataSetsHaveTitle(ev) {
|
|
20108
20113
|
this.props.updateChart(this.props.figureId, {
|
|
@@ -20475,7 +20480,7 @@ class GaugeChartConfigPanel extends owl.Component {
|
|
|
20475
20480
|
}
|
|
20476
20481
|
get isDataRangeInvalid() {
|
|
20477
20482
|
var _a;
|
|
20478
|
-
return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
20483
|
+
return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.InvalidGaugeDataRange */));
|
|
20479
20484
|
}
|
|
20480
20485
|
onDataRangeChanged(ranges) {
|
|
20481
20486
|
this.dataRange = ranges[0];
|
|
@@ -20567,28 +20572,28 @@ class GaugeChartDesignPanel extends owl.Component {
|
|
|
20567
20572
|
}
|
|
20568
20573
|
isRangeMinInvalid() {
|
|
20569
20574
|
var _a, _b, _c;
|
|
20570
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
20571
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
20572
|
-
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(
|
|
20575
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(38 /* CommandResult.EmptyGaugeRangeMin */)) ||
|
|
20576
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(39 /* CommandResult.GaugeRangeMinNaN */)) ||
|
|
20577
|
+
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
|
|
20573
20578
|
}
|
|
20574
20579
|
isRangeMaxInvalid() {
|
|
20575
20580
|
var _a, _b, _c;
|
|
20576
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
20577
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
20578
|
-
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(
|
|
20581
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMax */)) ||
|
|
20582
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(41 /* CommandResult.GaugeRangeMaxNaN */)) ||
|
|
20583
|
+
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
|
|
20579
20584
|
}
|
|
20580
20585
|
// ---------------------------------------------------------------------------
|
|
20581
20586
|
// COLOR_SECTION_TEMPLATE
|
|
20582
20587
|
// ---------------------------------------------------------------------------
|
|
20583
20588
|
get isLowerInflectionPointInvalid() {
|
|
20584
20589
|
var _a, _b;
|
|
20585
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
20586
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
20590
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
|
|
20591
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
|
|
20587
20592
|
}
|
|
20588
20593
|
get isUpperInflectionPointInvalid() {
|
|
20589
20594
|
var _a, _b;
|
|
20590
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
20591
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
20595
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(44 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
|
|
20596
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
|
|
20592
20597
|
}
|
|
20593
20598
|
updateInflectionPointValue(attr, ev) {
|
|
20594
20599
|
const sectionRule = deepCopy(this.props.definition.sectionRule);
|
|
@@ -20701,11 +20706,11 @@ class ScorecardChartConfigPanel extends owl.Component {
|
|
|
20701
20706
|
}
|
|
20702
20707
|
get isKeyValueInvalid() {
|
|
20703
20708
|
var _a;
|
|
20704
|
-
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
20709
|
+
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardKeyValue */));
|
|
20705
20710
|
}
|
|
20706
20711
|
get isBaselineInvalid() {
|
|
20707
20712
|
var _a;
|
|
20708
|
-
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
20713
|
+
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidScorecardBaseline */));
|
|
20709
20714
|
}
|
|
20710
20715
|
onKeyValueRangeChanged(ranges) {
|
|
20711
20716
|
this.keyValue = ranges[0];
|
|
@@ -21561,11 +21566,11 @@ class ConditionalFormattingPanel extends owl.Component {
|
|
|
21561
21566
|
****************************************************************************/
|
|
21562
21567
|
get isValue1Invalid() {
|
|
21563
21568
|
var _a;
|
|
21564
|
-
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(
|
|
21569
|
+
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.FirstArgMissing */));
|
|
21565
21570
|
}
|
|
21566
21571
|
get isValue2Invalid() {
|
|
21567
21572
|
var _a;
|
|
21568
|
-
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(
|
|
21573
|
+
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(53 /* CommandResult.SecondArgMissing */));
|
|
21569
21574
|
}
|
|
21570
21575
|
toggleStyle(tool) {
|
|
21571
21576
|
const style = this.state.rules.cellIs.style;
|
|
@@ -21582,17 +21587,17 @@ class ConditionalFormattingPanel extends owl.Component {
|
|
|
21582
21587
|
isValueInvalid(threshold) {
|
|
21583
21588
|
switch (threshold) {
|
|
21584
21589
|
case "minimum":
|
|
21585
|
-
return (this.state.errors.includes(
|
|
21586
|
-
this.state.errors.includes(
|
|
21587
|
-
this.state.errors.includes(
|
|
21588
|
-
this.state.errors.includes(
|
|
21590
|
+
return (this.state.errors.includes(59 /* CommandResult.MinInvalidFormula */) ||
|
|
21591
|
+
this.state.errors.includes(51 /* CommandResult.MinBiggerThanMid */) ||
|
|
21592
|
+
this.state.errors.includes(48 /* CommandResult.MinBiggerThanMax */) ||
|
|
21593
|
+
this.state.errors.includes(54 /* CommandResult.MinNaN */));
|
|
21589
21594
|
case "midpoint":
|
|
21590
|
-
return (this.state.errors.includes(
|
|
21591
|
-
this.state.errors.includes(
|
|
21592
|
-
this.state.errors.includes(
|
|
21595
|
+
return (this.state.errors.includes(60 /* CommandResult.MidInvalidFormula */) ||
|
|
21596
|
+
this.state.errors.includes(55 /* CommandResult.MidNaN */) ||
|
|
21597
|
+
this.state.errors.includes(50 /* CommandResult.MidBiggerThanMax */));
|
|
21593
21598
|
case "maximum":
|
|
21594
|
-
return (this.state.errors.includes(
|
|
21595
|
-
this.state.errors.includes(
|
|
21599
|
+
return (this.state.errors.includes(61 /* CommandResult.MaxInvalidFormula */) ||
|
|
21600
|
+
this.state.errors.includes(56 /* CommandResult.MaxNaN */));
|
|
21596
21601
|
default:
|
|
21597
21602
|
return false;
|
|
21598
21603
|
}
|
|
@@ -21641,13 +21646,13 @@ class ConditionalFormattingPanel extends owl.Component {
|
|
|
21641
21646
|
isInflectionPointInvalid(inflectionPoint) {
|
|
21642
21647
|
switch (inflectionPoint) {
|
|
21643
21648
|
case "lowerInflectionPoint":
|
|
21644
|
-
return (this.state.errors.includes(
|
|
21645
|
-
this.state.errors.includes(
|
|
21646
|
-
this.state.errors.includes(
|
|
21649
|
+
return (this.state.errors.includes(58 /* CommandResult.ValueLowerInflectionNaN */) ||
|
|
21650
|
+
this.state.errors.includes(63 /* CommandResult.ValueLowerInvalidFormula */) ||
|
|
21651
|
+
this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
|
|
21647
21652
|
case "upperInflectionPoint":
|
|
21648
|
-
return (this.state.errors.includes(
|
|
21649
|
-
this.state.errors.includes(
|
|
21650
|
-
this.state.errors.includes(
|
|
21653
|
+
return (this.state.errors.includes(57 /* CommandResult.ValueUpperInflectionNaN */) ||
|
|
21654
|
+
this.state.errors.includes(62 /* CommandResult.ValueUpperInvalidFormula */) ||
|
|
21655
|
+
this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
|
|
21651
21656
|
default:
|
|
21652
21657
|
return true;
|
|
21653
21658
|
}
|
|
@@ -28443,7 +28448,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
28443
28448
|
const currentBorder = this.getCellBorder(cmd);
|
|
28444
28449
|
const areAllNewBordersUndefined = !((_a = cmd.border) === null || _a === void 0 ? void 0 : _a.bottom) && !((_b = cmd.border) === null || _b === void 0 ? void 0 : _b.left) && !((_c = cmd.border) === null || _c === void 0 ? void 0 : _c.right) && !((_d = cmd.border) === null || _d === void 0 ? void 0 : _d.top);
|
|
28445
28450
|
if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
|
|
28446
|
-
return
|
|
28451
|
+
return 89 /* CommandResult.NoChanges */;
|
|
28447
28452
|
}
|
|
28448
28453
|
return 0 /* CommandResult.Success */;
|
|
28449
28454
|
}
|
|
@@ -28965,9 +28970,9 @@ class CellPlugin extends CorePlugin {
|
|
|
28965
28970
|
checkUselessClearCell(cmd) {
|
|
28966
28971
|
const cell = this.getters.getCell(cmd);
|
|
28967
28972
|
if (!cell)
|
|
28968
|
-
return
|
|
28973
|
+
return 89 /* CommandResult.NoChanges */;
|
|
28969
28974
|
if (!cell.content && !cell.style && !cell.format) {
|
|
28970
|
-
return
|
|
28975
|
+
return 89 /* CommandResult.NoChanges */;
|
|
28971
28976
|
}
|
|
28972
28977
|
return 0 /* CommandResult.Success */;
|
|
28973
28978
|
}
|
|
@@ -29176,13 +29181,13 @@ class ChartPlugin extends CorePlugin {
|
|
|
29176
29181
|
}
|
|
29177
29182
|
checkChartDuplicate(cmd) {
|
|
29178
29183
|
return this.getters.getFigureSheetId(cmd.id)
|
|
29179
|
-
?
|
|
29184
|
+
? 85 /* CommandResult.DuplicatedChartId */
|
|
29180
29185
|
: 0 /* CommandResult.Success */;
|
|
29181
29186
|
}
|
|
29182
29187
|
checkChartExists(cmd) {
|
|
29183
29188
|
return this.getters.getFigureSheetId(cmd.id)
|
|
29184
29189
|
? 0 /* CommandResult.Success */
|
|
29185
|
-
:
|
|
29190
|
+
: 86 /* CommandResult.ChartDoesNotExist */;
|
|
29186
29191
|
}
|
|
29187
29192
|
}
|
|
29188
29193
|
ChartPlugin.getters = [
|
|
@@ -29384,10 +29389,10 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29384
29389
|
return 27 /* CommandResult.InvalidSheetId */;
|
|
29385
29390
|
const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
|
|
29386
29391
|
if (ruleIndex === -1)
|
|
29387
|
-
return
|
|
29392
|
+
return 72 /* CommandResult.InvalidConditionalFormatId */;
|
|
29388
29393
|
const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
|
|
29389
29394
|
if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
|
|
29390
|
-
return
|
|
29395
|
+
return 72 /* CommandResult.InvalidConditionalFormatId */;
|
|
29391
29396
|
}
|
|
29392
29397
|
return 0 /* CommandResult.Success */;
|
|
29393
29398
|
}
|
|
@@ -29428,10 +29433,10 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29428
29433
|
const errors = [];
|
|
29429
29434
|
const isEmpty = (value) => value === undefined || value === "";
|
|
29430
29435
|
if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
|
|
29431
|
-
errors.push(
|
|
29436
|
+
errors.push(52 /* CommandResult.FirstArgMissing */);
|
|
29432
29437
|
}
|
|
29433
29438
|
if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
|
|
29434
|
-
errors.push(
|
|
29439
|
+
errors.push(53 /* CommandResult.SecondArgMissing */);
|
|
29435
29440
|
}
|
|
29436
29441
|
return errors.length ? errors : 0 /* CommandResult.Success */;
|
|
29437
29442
|
}
|
|
@@ -29443,15 +29448,15 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29443
29448
|
(threshold.value === "" || isNaN(threshold.value))) {
|
|
29444
29449
|
switch (thresholdName) {
|
|
29445
29450
|
case "min":
|
|
29446
|
-
return
|
|
29451
|
+
return 54 /* CommandResult.MinNaN */;
|
|
29447
29452
|
case "max":
|
|
29448
|
-
return
|
|
29453
|
+
return 56 /* CommandResult.MaxNaN */;
|
|
29449
29454
|
case "mid":
|
|
29450
|
-
return
|
|
29455
|
+
return 55 /* CommandResult.MidNaN */;
|
|
29451
29456
|
case "upperInflectionPoint":
|
|
29452
|
-
return
|
|
29457
|
+
return 57 /* CommandResult.ValueUpperInflectionNaN */;
|
|
29453
29458
|
case "lowerInflectionPoint":
|
|
29454
|
-
return
|
|
29459
|
+
return 58 /* CommandResult.ValueLowerInflectionNaN */;
|
|
29455
29460
|
}
|
|
29456
29461
|
}
|
|
29457
29462
|
return 0 /* CommandResult.Success */;
|
|
@@ -29465,15 +29470,15 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29465
29470
|
catch (error) {
|
|
29466
29471
|
switch (thresholdName) {
|
|
29467
29472
|
case "min":
|
|
29468
|
-
return
|
|
29473
|
+
return 59 /* CommandResult.MinInvalidFormula */;
|
|
29469
29474
|
case "max":
|
|
29470
|
-
return
|
|
29475
|
+
return 61 /* CommandResult.MaxInvalidFormula */;
|
|
29471
29476
|
case "mid":
|
|
29472
|
-
return
|
|
29477
|
+
return 60 /* CommandResult.MidInvalidFormula */;
|
|
29473
29478
|
case "upperInflectionPoint":
|
|
29474
|
-
return
|
|
29479
|
+
return 62 /* CommandResult.ValueUpperInvalidFormula */;
|
|
29475
29480
|
case "lowerInflectionPoint":
|
|
29476
|
-
return
|
|
29481
|
+
return 63 /* CommandResult.ValueLowerInvalidFormula */;
|
|
29477
29482
|
}
|
|
29478
29483
|
}
|
|
29479
29484
|
return 0 /* CommandResult.Success */;
|
|
@@ -29490,7 +29495,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29490
29495
|
if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
|
|
29491
29496
|
rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
|
|
29492
29497
|
Number(minValue) > Number(maxValue)) {
|
|
29493
|
-
return
|
|
29498
|
+
return 49 /* CommandResult.LowerBiggerThanUpper */;
|
|
29494
29499
|
}
|
|
29495
29500
|
return 0 /* CommandResult.Success */;
|
|
29496
29501
|
}
|
|
@@ -29500,7 +29505,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29500
29505
|
if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
|
|
29501
29506
|
rule.minimum.type === rule.maximum.type &&
|
|
29502
29507
|
stringToNumber(minValue) >= stringToNumber(maxValue)) {
|
|
29503
|
-
return
|
|
29508
|
+
return 48 /* CommandResult.MinBiggerThanMax */;
|
|
29504
29509
|
}
|
|
29505
29510
|
return 0 /* CommandResult.Success */;
|
|
29506
29511
|
}
|
|
@@ -29512,7 +29517,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29512
29517
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
29513
29518
|
rule.midpoint.type === rule.maximum.type &&
|
|
29514
29519
|
stringToNumber(midValue) >= stringToNumber(maxValue)) {
|
|
29515
|
-
return
|
|
29520
|
+
return 50 /* CommandResult.MidBiggerThanMax */;
|
|
29516
29521
|
}
|
|
29517
29522
|
return 0 /* CommandResult.Success */;
|
|
29518
29523
|
}
|
|
@@ -29524,7 +29529,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29524
29529
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
29525
29530
|
rule.minimum.type === rule.midpoint.type &&
|
|
29526
29531
|
stringToNumber(minValue) >= stringToNumber(midValue)) {
|
|
29527
|
-
return
|
|
29532
|
+
return 51 /* CommandResult.MinBiggerThanMid */;
|
|
29528
29533
|
}
|
|
29529
29534
|
return 0 /* CommandResult.Success */;
|
|
29530
29535
|
}
|
|
@@ -29625,13 +29630,13 @@ class FigurePlugin extends CorePlugin {
|
|
|
29625
29630
|
checkFigureExists(sheetId, figureId) {
|
|
29626
29631
|
var _a;
|
|
29627
29632
|
if (((_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === undefined) {
|
|
29628
|
-
return
|
|
29633
|
+
return 71 /* CommandResult.FigureDoesNotExist */;
|
|
29629
29634
|
}
|
|
29630
29635
|
return 0 /* CommandResult.Success */;
|
|
29631
29636
|
}
|
|
29632
29637
|
checkFigureDuplicate(figureId) {
|
|
29633
29638
|
if (Object.values(this.figures).find((sheet) => sheet === null || sheet === void 0 ? void 0 : sheet[figureId])) {
|
|
29634
|
-
return
|
|
29639
|
+
return 83 /* CommandResult.DuplicatedFigureId */;
|
|
29635
29640
|
}
|
|
29636
29641
|
return 0 /* CommandResult.Success */;
|
|
29637
29642
|
}
|
|
@@ -29733,12 +29738,12 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29733
29738
|
switch (cmd.type) {
|
|
29734
29739
|
case "CREATE_FILTER_TABLE":
|
|
29735
29740
|
if (!areZonesContinuous(...cmd.target)) {
|
|
29736
|
-
return
|
|
29741
|
+
return 82 /* CommandResult.NonContinuousTargets */;
|
|
29737
29742
|
}
|
|
29738
29743
|
const zone = union(...cmd.target);
|
|
29739
29744
|
const checkFilterOverlap = () => {
|
|
29740
29745
|
if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
|
|
29741
|
-
return
|
|
29746
|
+
return 79 /* CommandResult.FilterOverlap */;
|
|
29742
29747
|
}
|
|
29743
29748
|
return 0 /* CommandResult.Success */;
|
|
29744
29749
|
};
|
|
@@ -29746,7 +29751,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29746
29751
|
const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
|
|
29747
29752
|
for (let merge of mergesInTarget) {
|
|
29748
29753
|
if (overlap(zone, merge)) {
|
|
29749
|
-
return
|
|
29754
|
+
return 81 /* CommandResult.MergeInFilter */;
|
|
29750
29755
|
}
|
|
29751
29756
|
}
|
|
29752
29757
|
return 0 /* CommandResult.Success */;
|
|
@@ -29756,7 +29761,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29756
29761
|
for (let merge of cmd.target) {
|
|
29757
29762
|
for (let filterTable of this.getFilterTables(cmd.sheetId)) {
|
|
29758
29763
|
if (overlap(filterTable.zone, merge)) {
|
|
29759
|
-
return
|
|
29764
|
+
return 81 /* CommandResult.MergeInFilter */;
|
|
29760
29765
|
}
|
|
29761
29766
|
}
|
|
29762
29767
|
}
|
|
@@ -30256,10 +30261,10 @@ class HeaderVisibilityPlugin extends CorePlugin {
|
|
|
30256
30261
|
: this.getters.getNumberRows(cmd.sheetId);
|
|
30257
30262
|
const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
|
|
30258
30263
|
if (hiddenElements.size >= elements) {
|
|
30259
|
-
return
|
|
30264
|
+
return 67 /* CommandResult.TooManyHiddenElements */;
|
|
30260
30265
|
}
|
|
30261
30266
|
else if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
|
|
30262
|
-
return
|
|
30267
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
30263
30268
|
}
|
|
30264
30269
|
else {
|
|
30265
30270
|
return 0 /* CommandResult.Success */;
|
|
@@ -30785,7 +30790,7 @@ class MergePlugin extends CorePlugin {
|
|
|
30785
30790
|
for (const zone of target) {
|
|
30786
30791
|
for (const zone2 of target) {
|
|
30787
30792
|
if (zone !== zone2 && overlap(zone, zone2)) {
|
|
30788
|
-
return
|
|
30793
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
30789
30794
|
}
|
|
30790
30795
|
}
|
|
30791
30796
|
}
|
|
@@ -30799,7 +30804,7 @@ class MergePlugin extends CorePlugin {
|
|
|
30799
30804
|
for (const zone of target) {
|
|
30800
30805
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
30801
30806
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
30802
|
-
return
|
|
30807
|
+
return 76 /* CommandResult.FrozenPaneOverlap */;
|
|
30803
30808
|
}
|
|
30804
30809
|
}
|
|
30805
30810
|
return 0 /* CommandResult.Success */;
|
|
@@ -31331,9 +31336,10 @@ class RangeAdapter {
|
|
|
31331
31336
|
* Get a Xc string that represent a part of a range
|
|
31332
31337
|
*/
|
|
31333
31338
|
getRangePartString(range, part) {
|
|
31334
|
-
|
|
31339
|
+
var _a, _b;
|
|
31340
|
+
const colFixed = range.parts && ((_a = range.parts[part]) === null || _a === void 0 ? void 0 : _a.colFixed) ? "$" : "";
|
|
31335
31341
|
const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
|
|
31336
|
-
const rowFixed = range.parts && range.parts[part].rowFixed ? "$" : "";
|
|
31342
|
+
const rowFixed = range.parts && ((_b = range.parts[part]) === null || _b === void 0 ? void 0 : _b.rowFixed) ? "$" : "";
|
|
31337
31343
|
const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
|
|
31338
31344
|
let str = "";
|
|
31339
31345
|
if (range.isFullCol) {
|
|
@@ -31432,10 +31438,10 @@ class SheetPlugin extends CorePlugin {
|
|
|
31432
31438
|
? this.getNumberCols(cmd.sheetId)
|
|
31433
31439
|
: this.getNumberRows(cmd.sheetId);
|
|
31434
31440
|
if (cmd.base < 0 || cmd.base >= elements) {
|
|
31435
|
-
return
|
|
31441
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
31436
31442
|
}
|
|
31437
31443
|
else if (cmd.quantity <= 0) {
|
|
31438
|
-
return
|
|
31444
|
+
return 88 /* CommandResult.InvalidQuantity */;
|
|
31439
31445
|
}
|
|
31440
31446
|
return 0 /* CommandResult.Success */;
|
|
31441
31447
|
case "REMOVE_COLUMNS_ROWS": {
|
|
@@ -31443,7 +31449,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
31443
31449
|
? this.getNumberCols(cmd.sheetId)
|
|
31444
31450
|
: this.getNumberRows(cmd.sheetId);
|
|
31445
31451
|
if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
|
|
31446
|
-
return
|
|
31452
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
31447
31453
|
}
|
|
31448
31454
|
else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
|
|
31449
31455
|
return 8 /* CommandResult.NotEnoughElements */;
|
|
@@ -31887,18 +31893,18 @@ class SheetPlugin extends CorePlugin {
|
|
|
31887
31893
|
checkRowFreezeQuantity(cmd) {
|
|
31888
31894
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
|
|
31889
31895
|
? 0 /* CommandResult.Success */
|
|
31890
|
-
:
|
|
31896
|
+
: 75 /* CommandResult.InvalidFreezeQuantity */;
|
|
31891
31897
|
}
|
|
31892
31898
|
checkColFreezeQuantity(cmd) {
|
|
31893
31899
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
|
|
31894
31900
|
? 0 /* CommandResult.Success */
|
|
31895
|
-
:
|
|
31901
|
+
: 75 /* CommandResult.InvalidFreezeQuantity */;
|
|
31896
31902
|
}
|
|
31897
31903
|
checkRowFreezeOverlapMerge(cmd) {
|
|
31898
31904
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
31899
31905
|
for (let merge of merges) {
|
|
31900
31906
|
if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
|
|
31901
|
-
return
|
|
31907
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
31902
31908
|
}
|
|
31903
31909
|
}
|
|
31904
31910
|
return 0 /* CommandResult.Success */;
|
|
@@ -31907,7 +31913,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
31907
31913
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
31908
31914
|
for (let merge of merges) {
|
|
31909
31915
|
if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
|
|
31910
|
-
return
|
|
31916
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
31911
31917
|
}
|
|
31912
31918
|
}
|
|
31913
31919
|
return 0 /* CommandResult.Success */;
|
|
@@ -32644,10 +32650,8 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
32644
32650
|
* that are actually present in the grid.
|
|
32645
32651
|
*/
|
|
32646
32652
|
function range(range) {
|
|
32653
|
+
assertRangeValid(range);
|
|
32647
32654
|
const sheetId = range.sheetId;
|
|
32648
|
-
if (!isZoneValid(range.zone)) {
|
|
32649
|
-
throw new InvalidReferenceError();
|
|
32650
|
-
}
|
|
32651
32655
|
// Performance issue: Avoid fetching data on positions that are out of the spreadsheet
|
|
32652
32656
|
// e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
|
|
32653
32657
|
const sheetZone = getters.getSheetZone(sheetId);
|
|
@@ -32682,23 +32686,26 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
32682
32686
|
* The `compute` of the formula's function must process it completely
|
|
32683
32687
|
*/
|
|
32684
32688
|
function refFn(range, isMeta, functionName, paramNumber) {
|
|
32689
|
+
assertRangeValid(range);
|
|
32685
32690
|
if (isMeta) {
|
|
32686
32691
|
// Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
|
|
32687
32692
|
return { value: zoneToXc(range.zone) };
|
|
32688
32693
|
}
|
|
32689
|
-
if (!isZoneValid(range.zone)) {
|
|
32690
|
-
throw new InvalidReferenceError();
|
|
32691
|
-
}
|
|
32692
32694
|
// if the formula definition could have accepted a range, we would pass through the _range function and not here
|
|
32693
32695
|
if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
|
|
32694
32696
|
throw new Error(paramNumber
|
|
32695
32697
|
? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
|
|
32696
32698
|
: _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
|
|
32697
32699
|
}
|
|
32700
|
+
return readCell(range);
|
|
32701
|
+
}
|
|
32702
|
+
function assertRangeValid(range) {
|
|
32703
|
+
if (!isZoneValid(range.zone)) {
|
|
32704
|
+
throw new InvalidReferenceError();
|
|
32705
|
+
}
|
|
32698
32706
|
if (range.invalidSheetName) {
|
|
32699
32707
|
throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
|
|
32700
32708
|
}
|
|
32701
|
-
return readCell(range);
|
|
32702
32709
|
}
|
|
32703
32710
|
return [refFn, range, evalContext];
|
|
32704
32711
|
}
|
|
@@ -33197,7 +33204,7 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
33197
33204
|
switch (cmd.type) {
|
|
33198
33205
|
case "UPDATE_FILTER":
|
|
33199
33206
|
if (!this.getters.getFilterId(cmd)) {
|
|
33200
|
-
return
|
|
33207
|
+
return 80 /* CommandResult.FilterNotFound */;
|
|
33201
33208
|
}
|
|
33202
33209
|
break;
|
|
33203
33210
|
}
|
|
@@ -34143,7 +34150,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
34143
34150
|
}
|
|
34144
34151
|
checkPositiveDimension(cmd) {
|
|
34145
34152
|
if (cmd.width < 0 || cmd.height < 0) {
|
|
34146
|
-
return
|
|
34153
|
+
return 69 /* CommandResult.InvalidViewportSize */;
|
|
34147
34154
|
}
|
|
34148
34155
|
return 0 /* CommandResult.Success */;
|
|
34149
34156
|
}
|
|
@@ -34153,7 +34160,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
34153
34160
|
cmd.gridOffsetY === this.gridOffsetY &&
|
|
34154
34161
|
cmd.width === width &&
|
|
34155
34162
|
cmd.height === height) {
|
|
34156
|
-
return
|
|
34163
|
+
return 77 /* CommandResult.ValuesNotChanged */;
|
|
34157
34164
|
}
|
|
34158
34165
|
return 0 /* CommandResult.Success */;
|
|
34159
34166
|
}
|
|
@@ -34161,7 +34168,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
34161
34168
|
const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
|
|
34162
34169
|
if ((!pane.canScrollHorizontally && offsetX > 0) ||
|
|
34163
34170
|
(!pane.canScrollVertically && offsetY > 0)) {
|
|
34164
|
-
return
|
|
34171
|
+
return 70 /* CommandResult.InvalidScrollingDirection */;
|
|
34165
34172
|
}
|
|
34166
34173
|
return 0 /* CommandResult.Success */;
|
|
34167
34174
|
}
|
|
@@ -34417,7 +34424,7 @@ class AutofillPlugin extends UIPlugin {
|
|
|
34417
34424
|
if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
|
|
34418
34425
|
return 0 /* CommandResult.Success */;
|
|
34419
34426
|
}
|
|
34420
|
-
return
|
|
34427
|
+
return 46 /* CommandResult.InvalidAutofillSelection */;
|
|
34421
34428
|
case "AUTOFILL_AUTO":
|
|
34422
34429
|
const zone = this.getters.getSelectedZone();
|
|
34423
34430
|
return zone.top === zone.bottom
|
|
@@ -35019,7 +35026,7 @@ class CellPopoverPlugin extends UIPlugin {
|
|
|
35019
35026
|
cellPopoverRegistry.get(cmd.popoverType);
|
|
35020
35027
|
}
|
|
35021
35028
|
catch (error) {
|
|
35022
|
-
return
|
|
35029
|
+
return 73 /* CommandResult.InvalidCellPopover */;
|
|
35023
35030
|
}
|
|
35024
35031
|
return 0 /* CommandResult.Success */;
|
|
35025
35032
|
default:
|
|
@@ -36222,21 +36229,6 @@ class SelectionInputPlugin extends UIPlugin {
|
|
|
36222
36229
|
// ---------------------------------------------------------------------------
|
|
36223
36230
|
// Command Handling
|
|
36224
36231
|
// ---------------------------------------------------------------------------
|
|
36225
|
-
allowDispatch(cmd) {
|
|
36226
|
-
switch (cmd.type) {
|
|
36227
|
-
case "ADD_EMPTY_RANGE":
|
|
36228
|
-
if (this.inputHasSingleRange && this.ranges.length === 1) {
|
|
36229
|
-
return 30 /* CommandResult.MaximumRangesReached */;
|
|
36230
|
-
}
|
|
36231
|
-
break;
|
|
36232
|
-
case "CHANGE_RANGE":
|
|
36233
|
-
if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
36234
|
-
return 30 /* CommandResult.MaximumRangesReached */;
|
|
36235
|
-
}
|
|
36236
|
-
break;
|
|
36237
|
-
}
|
|
36238
|
-
return 0 /* CommandResult.Success */;
|
|
36239
|
-
}
|
|
36240
36232
|
handleEvent(event) {
|
|
36241
36233
|
const xc = zoneToXc(event.anchor.zone);
|
|
36242
36234
|
const inputSheetId = this.activeSheet;
|
|
@@ -36448,6 +36440,15 @@ class SelectionInputsManagerPlugin extends UIPlugin {
|
|
|
36448
36440
|
// ---------------------------------------------------------------------------
|
|
36449
36441
|
allowDispatch(cmd) {
|
|
36450
36442
|
var _a, _b;
|
|
36443
|
+
switch (cmd.type) {
|
|
36444
|
+
case "FOCUS_RANGE":
|
|
36445
|
+
case "CHANGE_RANGE":
|
|
36446
|
+
case "ADD_EMPTY_RANGE":
|
|
36447
|
+
case "REMOVE_RANGE":
|
|
36448
|
+
if (!this.inputs[cmd.id]) {
|
|
36449
|
+
return 31 /* CommandResult.InvalidInputId */;
|
|
36450
|
+
}
|
|
36451
|
+
}
|
|
36451
36452
|
switch (cmd.type) {
|
|
36452
36453
|
case "FOCUS_RANGE":
|
|
36453
36454
|
const index = (_a = this.currentInput) === null || _a === void 0 ? void 0 : _a.getIndex(cmd.rangeId);
|
|
@@ -36455,9 +36456,19 @@ class SelectionInputsManagerPlugin extends UIPlugin {
|
|
|
36455
36456
|
return 29 /* CommandResult.InputAlreadyFocused */;
|
|
36456
36457
|
}
|
|
36457
36458
|
break;
|
|
36458
|
-
|
|
36459
|
-
|
|
36460
|
-
|
|
36459
|
+
case "ADD_EMPTY_RANGE":
|
|
36460
|
+
const input = this.inputs[cmd.id];
|
|
36461
|
+
if (input.inputHasSingleRange && input.ranges.length === 1) {
|
|
36462
|
+
return 30 /* CommandResult.MaximumRangesReached */;
|
|
36463
|
+
}
|
|
36464
|
+
break;
|
|
36465
|
+
case "CHANGE_RANGE": {
|
|
36466
|
+
const input = this.inputs[cmd.id];
|
|
36467
|
+
if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
36468
|
+
return 30 /* CommandResult.MaximumRangesReached */;
|
|
36469
|
+
}
|
|
36470
|
+
break;
|
|
36471
|
+
}
|
|
36461
36472
|
}
|
|
36462
36473
|
return 0 /* CommandResult.Success */;
|
|
36463
36474
|
}
|
|
@@ -37440,7 +37451,7 @@ class SortPlugin extends UIPlugin {
|
|
|
37440
37451
|
/*Test the presence of single cells*/
|
|
37441
37452
|
const singleCells = positions(zone).some(({ col, row }) => !this.getters.isInMerge({ sheetId, col, row }));
|
|
37442
37453
|
if (singleCells) {
|
|
37443
|
-
return
|
|
37454
|
+
return 64 /* CommandResult.InvalidSortZone */;
|
|
37444
37455
|
}
|
|
37445
37456
|
return 0 /* CommandResult.Success */;
|
|
37446
37457
|
}
|
|
@@ -37459,7 +37470,7 @@ class SortPlugin extends UIPlugin {
|
|
|
37459
37470
|
];
|
|
37460
37471
|
return widthCurrent === widthFirst && heightCurrent === heightFirst;
|
|
37461
37472
|
})) {
|
|
37462
|
-
return
|
|
37473
|
+
return 64 /* CommandResult.InvalidSortZone */;
|
|
37463
37474
|
}
|
|
37464
37475
|
return 0 /* CommandResult.Success */;
|
|
37465
37476
|
}
|
|
@@ -38087,7 +38098,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
|
|
|
38087
38098
|
for (const zone of this.getPasteZones(target)) {
|
|
38088
38099
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
38089
38100
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
38090
|
-
return
|
|
38101
|
+
return 76 /* CommandResult.FrozenPaneOverlap */;
|
|
38091
38102
|
}
|
|
38092
38103
|
}
|
|
38093
38104
|
return 0 /* CommandResult.Success */;
|
|
@@ -38475,7 +38486,7 @@ class ClipboardFigureState {
|
|
|
38475
38486
|
}
|
|
38476
38487
|
isPasteAllowed(target, option) {
|
|
38477
38488
|
if (target.length === 0) {
|
|
38478
|
-
return
|
|
38489
|
+
return 74 /* CommandResult.EmptyTarget */;
|
|
38479
38490
|
}
|
|
38480
38491
|
if ((option === null || option === void 0 ? void 0 : option.pasteOption) !== undefined) {
|
|
38481
38492
|
return 22 /* CommandResult.WrongFigurePasteOption */;
|
|
@@ -39386,7 +39397,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
39386
39397
|
const headers = [cmd.base, ...cmd.elements];
|
|
39387
39398
|
const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
|
|
39388
39399
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
39389
|
-
return
|
|
39400
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
39390
39401
|
}
|
|
39391
39402
|
return 0 /* CommandResult.Success */;
|
|
39392
39403
|
}
|
|
@@ -40194,7 +40205,7 @@ const AddMergeInteractiveContent = {
|
|
|
40194
40205
|
};
|
|
40195
40206
|
function interactiveAddMerge(env, sheetId, target) {
|
|
40196
40207
|
const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
|
|
40197
|
-
if (result.isCancelledBecause(
|
|
40208
|
+
if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
|
|
40198
40209
|
env.raiseError(AddMergeInteractiveContent.MergeInFilter);
|
|
40199
40210
|
}
|
|
40200
40211
|
else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
|
|
@@ -42069,7 +42080,7 @@ class SelectionStreamProcessor {
|
|
|
42069
42080
|
*/
|
|
42070
42081
|
moveAnchorCell(direction, step = 1) {
|
|
42071
42082
|
if (step !== "end" && step <= 0) {
|
|
42072
|
-
return new DispatchResult(
|
|
42083
|
+
return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
|
|
42073
42084
|
}
|
|
42074
42085
|
const { col, row } = this.getNextAvailablePosition(direction, step);
|
|
42075
42086
|
return this.selectCell(col, row);
|
|
@@ -42115,7 +42126,7 @@ class SelectionStreamProcessor {
|
|
|
42115
42126
|
*/
|
|
42116
42127
|
resizeAnchorZone(direction, step = 1) {
|
|
42117
42128
|
if (step !== "end" && step <= 0) {
|
|
42118
|
-
return new DispatchResult(
|
|
42129
|
+
return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
|
|
42119
42130
|
}
|
|
42120
42131
|
const sheetId = this.getters.getActiveSheetId();
|
|
42121
42132
|
const anchor = this.anchor;
|
|
@@ -44075,10 +44086,10 @@ class Model extends EventBus {
|
|
|
44075
44086
|
const command = { ...payload, type };
|
|
44076
44087
|
let status = this.status;
|
|
44077
44088
|
if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
|
|
44078
|
-
return new DispatchResult(
|
|
44089
|
+
return new DispatchResult(68 /* CommandResult.Readonly */);
|
|
44079
44090
|
}
|
|
44080
44091
|
if (!this.session.canApplyOptimisticUpdate()) {
|
|
44081
|
-
return new DispatchResult(
|
|
44092
|
+
return new DispatchResult(65 /* CommandResult.WaitingSessionConfirmation */);
|
|
44082
44093
|
}
|
|
44083
44094
|
switch (status) {
|
|
44084
44095
|
case 0 /* Status.Ready */:
|
|
@@ -44566,6 +44577,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
44566
44577
|
exports.tokenize = tokenize;
|
|
44567
44578
|
|
|
44568
44579
|
|
|
44569
|
-
__info__.version = '16.1.
|
|
44570
|
-
__info__.date = '2024-01-
|
|
44571
|
-
__info__.hash = '
|
|
44580
|
+
__info__.version = '16.1.33';
|
|
44581
|
+
__info__.date = '2024-01-29T13:49:43.259Z';
|
|
44582
|
+
__info__.hash = 'd3b27dd';
|