@odoo/o-spreadsheet 16.2.28 → 16.2.29
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 +256 -245
- package/dist/o-spreadsheet.d.ts +60 -60
- package/dist/o-spreadsheet.esm.js +256 -245
- package/dist/o-spreadsheet.iife.js +256 -245
- package/dist/o-spreadsheet.iife.min.js +12 -12
- package/dist/o_spreadsheet.xml +4 -4
- package/package.json +1 -1
|
@@ -2024,27 +2024,30 @@ function detectFormat(content) {
|
|
|
2024
2024
|
}
|
|
2025
2025
|
function createLargeNumberFormat(format, magnitude, postFix) {
|
|
2026
2026
|
const internalFormat = parseFormat(format || "#,##0");
|
|
2027
|
-
const largeNumberFormat =
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
format: {
|
|
2034
|
-
...formatPart.format,
|
|
2035
|
-
magnitude,
|
|
2036
|
-
decimalPart: undefined,
|
|
2037
|
-
},
|
|
2038
|
-
},
|
|
2039
|
-
{
|
|
2040
|
-
type: "STRING",
|
|
2041
|
-
format: postFix,
|
|
2042
|
-
},
|
|
2043
|
-
];
|
|
2027
|
+
const largeNumberFormat = [];
|
|
2028
|
+
for (let i = 0; i < internalFormat.length; i++) {
|
|
2029
|
+
const formatPart = internalFormat[i];
|
|
2030
|
+
if (formatPart.type !== "NUMBER") {
|
|
2031
|
+
largeNumberFormat.push(formatPart);
|
|
2032
|
+
continue;
|
|
2044
2033
|
}
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2034
|
+
largeNumberFormat.push({
|
|
2035
|
+
...formatPart,
|
|
2036
|
+
format: {
|
|
2037
|
+
...formatPart.format,
|
|
2038
|
+
magnitude,
|
|
2039
|
+
decimalPart: undefined,
|
|
2040
|
+
},
|
|
2041
|
+
});
|
|
2042
|
+
largeNumberFormat.push({
|
|
2043
|
+
type: "STRING",
|
|
2044
|
+
format: postFix,
|
|
2045
|
+
});
|
|
2046
|
+
const nextFormatPart = internalFormat[i + 1];
|
|
2047
|
+
if ((nextFormatPart === null || nextFormatPart === void 0 ? void 0 : nextFormatPart.type) === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
|
|
2048
|
+
i++;
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2048
2051
|
return convertInternalFormatToFormat(largeNumberFormat);
|
|
2049
2052
|
}
|
|
2050
2053
|
function changeDecimalPlaces(format, step) {
|
|
@@ -4315,64 +4318,65 @@ exports.CommandResult = void 0;
|
|
|
4315
4318
|
CommandResult[CommandResult["InvalidFigureId"] = 28] = "InvalidFigureId";
|
|
4316
4319
|
CommandResult[CommandResult["InputAlreadyFocused"] = 29] = "InputAlreadyFocused";
|
|
4317
4320
|
CommandResult[CommandResult["MaximumRangesReached"] = 30] = "MaximumRangesReached";
|
|
4318
|
-
CommandResult[CommandResult["
|
|
4319
|
-
CommandResult[CommandResult["
|
|
4320
|
-
CommandResult[CommandResult["
|
|
4321
|
-
CommandResult[CommandResult["
|
|
4322
|
-
CommandResult[CommandResult["
|
|
4323
|
-
CommandResult[CommandResult["
|
|
4324
|
-
CommandResult[CommandResult["
|
|
4325
|
-
CommandResult[CommandResult["
|
|
4326
|
-
CommandResult[CommandResult["
|
|
4327
|
-
CommandResult[CommandResult["
|
|
4328
|
-
CommandResult[CommandResult["
|
|
4329
|
-
CommandResult[CommandResult["
|
|
4330
|
-
CommandResult[CommandResult["
|
|
4331
|
-
CommandResult[CommandResult["
|
|
4332
|
-
CommandResult[CommandResult["
|
|
4333
|
-
CommandResult[CommandResult["
|
|
4334
|
-
CommandResult[CommandResult["
|
|
4335
|
-
CommandResult[CommandResult["
|
|
4336
|
-
CommandResult[CommandResult["
|
|
4337
|
-
CommandResult[CommandResult["
|
|
4338
|
-
CommandResult[CommandResult["
|
|
4339
|
-
CommandResult[CommandResult["
|
|
4340
|
-
CommandResult[CommandResult["
|
|
4341
|
-
CommandResult[CommandResult["
|
|
4342
|
-
CommandResult[CommandResult["
|
|
4343
|
-
CommandResult[CommandResult["
|
|
4344
|
-
CommandResult[CommandResult["
|
|
4345
|
-
CommandResult[CommandResult["
|
|
4346
|
-
CommandResult[CommandResult["
|
|
4347
|
-
CommandResult[CommandResult["
|
|
4348
|
-
CommandResult[CommandResult["
|
|
4349
|
-
CommandResult[CommandResult["
|
|
4350
|
-
CommandResult[CommandResult["
|
|
4351
|
-
CommandResult[CommandResult["
|
|
4352
|
-
CommandResult[CommandResult["
|
|
4353
|
-
CommandResult[CommandResult["
|
|
4354
|
-
CommandResult[CommandResult["
|
|
4355
|
-
CommandResult[CommandResult["
|
|
4356
|
-
CommandResult[CommandResult["
|
|
4357
|
-
CommandResult[CommandResult["
|
|
4358
|
-
CommandResult[CommandResult["
|
|
4359
|
-
CommandResult[CommandResult["
|
|
4360
|
-
CommandResult[CommandResult["
|
|
4361
|
-
CommandResult[CommandResult["
|
|
4362
|
-
CommandResult[CommandResult["
|
|
4363
|
-
CommandResult[CommandResult["
|
|
4364
|
-
CommandResult[CommandResult["
|
|
4365
|
-
CommandResult[CommandResult["
|
|
4366
|
-
CommandResult[CommandResult["
|
|
4367
|
-
CommandResult[CommandResult["
|
|
4368
|
-
CommandResult[CommandResult["
|
|
4369
|
-
CommandResult[CommandResult["
|
|
4370
|
-
CommandResult[CommandResult["
|
|
4371
|
-
CommandResult[CommandResult["
|
|
4372
|
-
CommandResult[CommandResult["
|
|
4373
|
-
CommandResult[CommandResult["
|
|
4374
|
-
CommandResult[CommandResult["
|
|
4375
|
-
CommandResult[CommandResult["
|
|
4321
|
+
CommandResult[CommandResult["InvalidInputId"] = 31] = "InvalidInputId";
|
|
4322
|
+
CommandResult[CommandResult["InvalidChartDefinition"] = 32] = "InvalidChartDefinition";
|
|
4323
|
+
CommandResult[CommandResult["InvalidDataSet"] = 33] = "InvalidDataSet";
|
|
4324
|
+
CommandResult[CommandResult["InvalidLabelRange"] = 34] = "InvalidLabelRange";
|
|
4325
|
+
CommandResult[CommandResult["InvalidScorecardKeyValue"] = 35] = "InvalidScorecardKeyValue";
|
|
4326
|
+
CommandResult[CommandResult["InvalidScorecardBaseline"] = 36] = "InvalidScorecardBaseline";
|
|
4327
|
+
CommandResult[CommandResult["InvalidGaugeDataRange"] = 37] = "InvalidGaugeDataRange";
|
|
4328
|
+
CommandResult[CommandResult["EmptyGaugeRangeMin"] = 38] = "EmptyGaugeRangeMin";
|
|
4329
|
+
CommandResult[CommandResult["GaugeRangeMinNaN"] = 39] = "GaugeRangeMinNaN";
|
|
4330
|
+
CommandResult[CommandResult["EmptyGaugeRangeMax"] = 40] = "EmptyGaugeRangeMax";
|
|
4331
|
+
CommandResult[CommandResult["GaugeRangeMaxNaN"] = 41] = "GaugeRangeMaxNaN";
|
|
4332
|
+
CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 42] = "GaugeRangeMinBiggerThanRangeMax";
|
|
4333
|
+
CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 43] = "GaugeLowerInflectionPointNaN";
|
|
4334
|
+
CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 44] = "GaugeUpperInflectionPointNaN";
|
|
4335
|
+
CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 45] = "GaugeLowerBiggerThanUpper";
|
|
4336
|
+
CommandResult[CommandResult["InvalidAutofillSelection"] = 46] = "InvalidAutofillSelection";
|
|
4337
|
+
CommandResult[CommandResult["WrongComposerSelection"] = 47] = "WrongComposerSelection";
|
|
4338
|
+
CommandResult[CommandResult["MinBiggerThanMax"] = 48] = "MinBiggerThanMax";
|
|
4339
|
+
CommandResult[CommandResult["LowerBiggerThanUpper"] = 49] = "LowerBiggerThanUpper";
|
|
4340
|
+
CommandResult[CommandResult["MidBiggerThanMax"] = 50] = "MidBiggerThanMax";
|
|
4341
|
+
CommandResult[CommandResult["MinBiggerThanMid"] = 51] = "MinBiggerThanMid";
|
|
4342
|
+
CommandResult[CommandResult["FirstArgMissing"] = 52] = "FirstArgMissing";
|
|
4343
|
+
CommandResult[CommandResult["SecondArgMissing"] = 53] = "SecondArgMissing";
|
|
4344
|
+
CommandResult[CommandResult["MinNaN"] = 54] = "MinNaN";
|
|
4345
|
+
CommandResult[CommandResult["MidNaN"] = 55] = "MidNaN";
|
|
4346
|
+
CommandResult[CommandResult["MaxNaN"] = 56] = "MaxNaN";
|
|
4347
|
+
CommandResult[CommandResult["ValueUpperInflectionNaN"] = 57] = "ValueUpperInflectionNaN";
|
|
4348
|
+
CommandResult[CommandResult["ValueLowerInflectionNaN"] = 58] = "ValueLowerInflectionNaN";
|
|
4349
|
+
CommandResult[CommandResult["MinInvalidFormula"] = 59] = "MinInvalidFormula";
|
|
4350
|
+
CommandResult[CommandResult["MidInvalidFormula"] = 60] = "MidInvalidFormula";
|
|
4351
|
+
CommandResult[CommandResult["MaxInvalidFormula"] = 61] = "MaxInvalidFormula";
|
|
4352
|
+
CommandResult[CommandResult["ValueUpperInvalidFormula"] = 62] = "ValueUpperInvalidFormula";
|
|
4353
|
+
CommandResult[CommandResult["ValueLowerInvalidFormula"] = 63] = "ValueLowerInvalidFormula";
|
|
4354
|
+
CommandResult[CommandResult["InvalidSortZone"] = 64] = "InvalidSortZone";
|
|
4355
|
+
CommandResult[CommandResult["WaitingSessionConfirmation"] = 65] = "WaitingSessionConfirmation";
|
|
4356
|
+
CommandResult[CommandResult["MergeOverlap"] = 66] = "MergeOverlap";
|
|
4357
|
+
CommandResult[CommandResult["TooManyHiddenElements"] = 67] = "TooManyHiddenElements";
|
|
4358
|
+
CommandResult[CommandResult["Readonly"] = 68] = "Readonly";
|
|
4359
|
+
CommandResult[CommandResult["InvalidViewportSize"] = 69] = "InvalidViewportSize";
|
|
4360
|
+
CommandResult[CommandResult["InvalidScrollingDirection"] = 70] = "InvalidScrollingDirection";
|
|
4361
|
+
CommandResult[CommandResult["FigureDoesNotExist"] = 71] = "FigureDoesNotExist";
|
|
4362
|
+
CommandResult[CommandResult["InvalidConditionalFormatId"] = 72] = "InvalidConditionalFormatId";
|
|
4363
|
+
CommandResult[CommandResult["InvalidCellPopover"] = 73] = "InvalidCellPopover";
|
|
4364
|
+
CommandResult[CommandResult["EmptyTarget"] = 74] = "EmptyTarget";
|
|
4365
|
+
CommandResult[CommandResult["InvalidFreezeQuantity"] = 75] = "InvalidFreezeQuantity";
|
|
4366
|
+
CommandResult[CommandResult["FrozenPaneOverlap"] = 76] = "FrozenPaneOverlap";
|
|
4367
|
+
CommandResult[CommandResult["ValuesNotChanged"] = 77] = "ValuesNotChanged";
|
|
4368
|
+
CommandResult[CommandResult["InvalidFilterZone"] = 78] = "InvalidFilterZone";
|
|
4369
|
+
CommandResult[CommandResult["FilterOverlap"] = 79] = "FilterOverlap";
|
|
4370
|
+
CommandResult[CommandResult["FilterNotFound"] = 80] = "FilterNotFound";
|
|
4371
|
+
CommandResult[CommandResult["MergeInFilter"] = 81] = "MergeInFilter";
|
|
4372
|
+
CommandResult[CommandResult["NonContinuousTargets"] = 82] = "NonContinuousTargets";
|
|
4373
|
+
CommandResult[CommandResult["DuplicatedFigureId"] = 83] = "DuplicatedFigureId";
|
|
4374
|
+
CommandResult[CommandResult["InvalidSelectionStep"] = 84] = "InvalidSelectionStep";
|
|
4375
|
+
CommandResult[CommandResult["DuplicatedChartId"] = 85] = "DuplicatedChartId";
|
|
4376
|
+
CommandResult[CommandResult["ChartDoesNotExist"] = 86] = "ChartDoesNotExist";
|
|
4377
|
+
CommandResult[CommandResult["InvalidHeaderIndex"] = 87] = "InvalidHeaderIndex";
|
|
4378
|
+
CommandResult[CommandResult["InvalidQuantity"] = 88] = "InvalidQuantity";
|
|
4379
|
+
CommandResult[CommandResult["NoChanges"] = 89] = "NoChanges";
|
|
4376
4380
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
4377
4381
|
|
|
4378
4382
|
function isMatrix(x) {
|
|
@@ -6398,11 +6402,11 @@ function checkDataset(definition) {
|
|
|
6398
6402
|
if (definition.dataSets) {
|
|
6399
6403
|
const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
|
|
6400
6404
|
if (invalidRanges) {
|
|
6401
|
-
return
|
|
6405
|
+
return 33 /* CommandResult.InvalidDataSet */;
|
|
6402
6406
|
}
|
|
6403
6407
|
const zones = definition.dataSets.map(toUnboundedZone);
|
|
6404
6408
|
if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
|
|
6405
|
-
return
|
|
6409
|
+
return 33 /* CommandResult.InvalidDataSet */;
|
|
6406
6410
|
}
|
|
6407
6411
|
}
|
|
6408
6412
|
return 0 /* CommandResult.Success */;
|
|
@@ -6411,7 +6415,7 @@ function checkLabelRange(definition) {
|
|
|
6411
6415
|
if (definition.labelRange) {
|
|
6412
6416
|
const invalidLabels = !rangeReference.test(definition.labelRange || "");
|
|
6413
6417
|
if (invalidLabels) {
|
|
6414
|
-
return
|
|
6418
|
+
return 34 /* CommandResult.InvalidLabelRange */;
|
|
6415
6419
|
}
|
|
6416
6420
|
}
|
|
6417
6421
|
return 0 /* CommandResult.Success */;
|
|
@@ -6484,22 +6488,22 @@ function getChartPositionAtCenterOfViewport(getters, chartSize) {
|
|
|
6484
6488
|
const CfTerms = {
|
|
6485
6489
|
Errors: {
|
|
6486
6490
|
[25 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
|
|
6487
|
-
[
|
|
6488
|
-
[
|
|
6489
|
-
[
|
|
6490
|
-
[
|
|
6491
|
-
[
|
|
6492
|
-
[
|
|
6493
|
-
[
|
|
6494
|
-
[
|
|
6495
|
-
[
|
|
6496
|
-
[
|
|
6497
|
-
[
|
|
6498
|
-
[
|
|
6499
|
-
[
|
|
6500
|
-
[
|
|
6501
|
-
[
|
|
6502
|
-
[
|
|
6491
|
+
[52 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
|
|
6492
|
+
[53 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
|
|
6493
|
+
[54 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
|
|
6494
|
+
[55 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
|
|
6495
|
+
[56 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
|
|
6496
|
+
[57 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
|
|
6497
|
+
[58 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
|
|
6498
|
+
[48 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
|
|
6499
|
+
[51 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
|
|
6500
|
+
[50 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
|
|
6501
|
+
[49 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
|
|
6502
|
+
[59 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
|
|
6503
|
+
[61 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
|
|
6504
|
+
[60 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
|
|
6505
|
+
[62 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
|
|
6506
|
+
[63 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
|
|
6503
6507
|
[24 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
|
|
6504
6508
|
Unexpected: _lt("The rule is invalid for an unknown reason"),
|
|
6505
6509
|
},
|
|
@@ -6527,20 +6531,20 @@ const ChartTerms = {
|
|
|
6527
6531
|
Errors: {
|
|
6528
6532
|
Unexpected: _lt("The chart definition is invalid for an unknown reason"),
|
|
6529
6533
|
// BASIC CHART ERRORS (LINE | BAR | PIE)
|
|
6530
|
-
[
|
|
6531
|
-
[
|
|
6534
|
+
[33 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
|
|
6535
|
+
[34 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
|
|
6532
6536
|
// SCORECARD CHART ERRORS
|
|
6533
|
-
[
|
|
6534
|
-
[
|
|
6537
|
+
[35 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
|
|
6538
|
+
[36 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
|
|
6535
6539
|
// GAUGE CHART ERRORS
|
|
6536
|
-
[
|
|
6537
|
-
[
|
|
6538
|
-
[
|
|
6539
|
-
[
|
|
6540
|
-
[
|
|
6541
|
-
[
|
|
6542
|
-
[
|
|
6543
|
-
[
|
|
6540
|
+
[37 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
|
|
6541
|
+
[38 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
|
|
6542
|
+
[39 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
|
|
6543
|
+
[40 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
|
|
6544
|
+
[41 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
|
|
6545
|
+
[42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
|
|
6546
|
+
[43 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
|
|
6547
|
+
[44 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
|
|
6544
6548
|
},
|
|
6545
6549
|
};
|
|
6546
6550
|
const NumberFormatTerms = {
|
|
@@ -6946,7 +6950,7 @@ function createBarChartRuntime(chart, getters) {
|
|
|
6946
6950
|
|
|
6947
6951
|
function isDataRangeValid(definition) {
|
|
6948
6952
|
return definition.dataRange && !rangeReference.test(definition.dataRange)
|
|
6949
|
-
?
|
|
6953
|
+
? 37 /* CommandResult.InvalidGaugeDataRange */
|
|
6950
6954
|
: 0 /* CommandResult.Success */;
|
|
6951
6955
|
}
|
|
6952
6956
|
function checkRangeLimits(check, batchValidations) {
|
|
@@ -6978,7 +6982,7 @@ function checkInflectionPointsValue(check, batchValidations) {
|
|
|
6978
6982
|
function checkRangeMinBiggerThanRangeMax(definition) {
|
|
6979
6983
|
if (definition.sectionRule) {
|
|
6980
6984
|
if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
|
|
6981
|
-
return
|
|
6985
|
+
return 42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
|
|
6982
6986
|
}
|
|
6983
6987
|
}
|
|
6984
6988
|
return 0 /* CommandResult.Success */;
|
|
@@ -6987,9 +6991,9 @@ function checkEmpty(value, valueName) {
|
|
|
6987
6991
|
if (value === "") {
|
|
6988
6992
|
switch (valueName) {
|
|
6989
6993
|
case "rangeMin":
|
|
6990
|
-
return
|
|
6994
|
+
return 38 /* CommandResult.EmptyGaugeRangeMin */;
|
|
6991
6995
|
case "rangeMax":
|
|
6992
|
-
return
|
|
6996
|
+
return 40 /* CommandResult.EmptyGaugeRangeMax */;
|
|
6993
6997
|
}
|
|
6994
6998
|
}
|
|
6995
6999
|
return 0 /* CommandResult.Success */;
|
|
@@ -6998,13 +7002,13 @@ function checkNaN(value, valueName) {
|
|
|
6998
7002
|
if (isNaN(value)) {
|
|
6999
7003
|
switch (valueName) {
|
|
7000
7004
|
case "rangeMin":
|
|
7001
|
-
return
|
|
7005
|
+
return 39 /* CommandResult.GaugeRangeMinNaN */;
|
|
7002
7006
|
case "rangeMax":
|
|
7003
|
-
return
|
|
7007
|
+
return 41 /* CommandResult.GaugeRangeMaxNaN */;
|
|
7004
7008
|
case "lowerInflectionPointValue":
|
|
7005
|
-
return
|
|
7009
|
+
return 43 /* CommandResult.GaugeLowerInflectionPointNaN */;
|
|
7006
7010
|
case "upperInflectionPointValue":
|
|
7007
|
-
return
|
|
7011
|
+
return 44 /* CommandResult.GaugeUpperInflectionPointNaN */;
|
|
7008
7012
|
}
|
|
7009
7013
|
}
|
|
7010
7014
|
return 0 /* CommandResult.Success */;
|
|
@@ -7762,12 +7766,12 @@ function createPieChartRuntime(chart, getters) {
|
|
|
7762
7766
|
|
|
7763
7767
|
function checkKeyValue(definition) {
|
|
7764
7768
|
return definition.keyValue && !rangeReference.test(definition.keyValue)
|
|
7765
|
-
?
|
|
7769
|
+
? 35 /* CommandResult.InvalidScorecardKeyValue */
|
|
7766
7770
|
: 0 /* CommandResult.Success */;
|
|
7767
7771
|
}
|
|
7768
7772
|
function checkBaseline(definition) {
|
|
7769
7773
|
return definition.baseline && !rangeReference.test(definition.baseline)
|
|
7770
|
-
?
|
|
7774
|
+
? 36 /* CommandResult.InvalidScorecardBaseline */
|
|
7771
7775
|
: 0 /* CommandResult.Success */;
|
|
7772
7776
|
}
|
|
7773
7777
|
class ScorecardChart extends AbstractChart {
|
|
@@ -8497,7 +8501,7 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
|
8497
8501
|
});
|
|
8498
8502
|
}
|
|
8499
8503
|
}
|
|
8500
|
-
if (result.isCancelledBecause(
|
|
8504
|
+
if (result.isCancelledBecause(64 /* CommandResult.InvalidSortZone */)) {
|
|
8501
8505
|
const { col, row } = anchor;
|
|
8502
8506
|
env.model.selection.selectZone({ cell: { col, row }, zone });
|
|
8503
8507
|
env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
|
|
@@ -8520,13 +8524,13 @@ const AddFilterInteractiveContent = {
|
|
|
8520
8524
|
};
|
|
8521
8525
|
function interactiveAddFilter(env, sheetId, target) {
|
|
8522
8526
|
const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
|
|
8523
|
-
if (result.isCancelledBecause(
|
|
8527
|
+
if (result.isCancelledBecause(79 /* CommandResult.FilterOverlap */)) {
|
|
8524
8528
|
env.raiseError(AddFilterInteractiveContent.filterOverlap);
|
|
8525
8529
|
}
|
|
8526
|
-
else if (result.isCancelledBecause(
|
|
8530
|
+
else if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
|
|
8527
8531
|
env.raiseError(AddFilterInteractiveContent.mergeInFilter);
|
|
8528
8532
|
}
|
|
8529
|
-
else if (result.isCancelledBecause(
|
|
8533
|
+
else if (result.isCancelledBecause(82 /* CommandResult.NonContinuousTargets */)) {
|
|
8530
8534
|
env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
|
|
8531
8535
|
}
|
|
8532
8536
|
}
|
|
@@ -8548,7 +8552,7 @@ function handlePasteResult(env, result) {
|
|
|
8548
8552
|
else if (result.reasons.includes(22 /* CommandResult.WrongFigurePasteOption */)) {
|
|
8549
8553
|
env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
|
|
8550
8554
|
}
|
|
8551
|
-
else if (result.reasons.includes(
|
|
8555
|
+
else if (result.reasons.includes(76 /* CommandResult.FrozenPaneOverlap */)) {
|
|
8552
8556
|
env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
|
|
8553
8557
|
}
|
|
8554
8558
|
}
|
|
@@ -16225,7 +16229,7 @@ function interactiveFreezeColumnsRows(env, dimension, base) {
|
|
|
16225
16229
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
16226
16230
|
const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
|
|
16227
16231
|
const result = env.model.dispatch(cmd, { sheetId, quantity: base });
|
|
16228
|
-
if (result.isCancelledBecause(
|
|
16232
|
+
if (result.isCancelledBecause(66 /* CommandResult.MergeOverlap */)) {
|
|
16229
16233
|
env.raiseError(MergeErrorMessage);
|
|
16230
16234
|
}
|
|
16231
16235
|
}
|
|
@@ -17021,11 +17025,11 @@ class LineBarPieConfigPanel extends owl.Component {
|
|
|
17021
17025
|
}
|
|
17022
17026
|
get isDatasetInvalid() {
|
|
17023
17027
|
var _a;
|
|
17024
|
-
return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
17028
|
+
return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidDataSet */));
|
|
17025
17029
|
}
|
|
17026
17030
|
get isLabelInvalid() {
|
|
17027
17031
|
var _a;
|
|
17028
|
-
return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
17032
|
+
return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidLabelRange */));
|
|
17029
17033
|
}
|
|
17030
17034
|
onUpdateDataSetsHaveTitle(ev) {
|
|
17031
17035
|
this.props.updateChart(this.props.figureId, {
|
|
@@ -17463,7 +17467,7 @@ class GaugeChartConfigPanel extends owl.Component {
|
|
|
17463
17467
|
}
|
|
17464
17468
|
get isDataRangeInvalid() {
|
|
17465
17469
|
var _a;
|
|
17466
|
-
return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
17470
|
+
return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.InvalidGaugeDataRange */));
|
|
17467
17471
|
}
|
|
17468
17472
|
onDataRangeChanged(ranges) {
|
|
17469
17473
|
this.dataRange = ranges[0];
|
|
@@ -17542,28 +17546,28 @@ class GaugeChartDesignPanel extends owl.Component {
|
|
|
17542
17546
|
}
|
|
17543
17547
|
isRangeMinInvalid() {
|
|
17544
17548
|
var _a, _b, _c;
|
|
17545
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
17546
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
17547
|
-
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(
|
|
17549
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(38 /* CommandResult.EmptyGaugeRangeMin */)) ||
|
|
17550
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(39 /* CommandResult.GaugeRangeMinNaN */)) ||
|
|
17551
|
+
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
|
|
17548
17552
|
}
|
|
17549
17553
|
isRangeMaxInvalid() {
|
|
17550
17554
|
var _a, _b, _c;
|
|
17551
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
17552
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
17553
|
-
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(
|
|
17555
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMax */)) ||
|
|
17556
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(41 /* CommandResult.GaugeRangeMaxNaN */)) ||
|
|
17557
|
+
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
|
|
17554
17558
|
}
|
|
17555
17559
|
// ---------------------------------------------------------------------------
|
|
17556
17560
|
// COLOR_SECTION_TEMPLATE
|
|
17557
17561
|
// ---------------------------------------------------------------------------
|
|
17558
17562
|
get isLowerInflectionPointInvalid() {
|
|
17559
17563
|
var _a, _b;
|
|
17560
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
17561
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
17564
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
|
|
17565
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
|
|
17562
17566
|
}
|
|
17563
17567
|
get isUpperInflectionPointInvalid() {
|
|
17564
17568
|
var _a, _b;
|
|
17565
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
17566
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
17569
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(44 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
|
|
17570
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
|
|
17567
17571
|
}
|
|
17568
17572
|
updateInflectionPointValue(attr, ev) {
|
|
17569
17573
|
const sectionRule = deepCopy(this.props.definition.sectionRule);
|
|
@@ -17676,11 +17680,11 @@ class ScorecardChartConfigPanel extends owl.Component {
|
|
|
17676
17680
|
}
|
|
17677
17681
|
get isKeyValueInvalid() {
|
|
17678
17682
|
var _a;
|
|
17679
|
-
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
17683
|
+
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardKeyValue */));
|
|
17680
17684
|
}
|
|
17681
17685
|
get isBaselineInvalid() {
|
|
17682
17686
|
var _a;
|
|
17683
|
-
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
17687
|
+
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidScorecardBaseline */));
|
|
17684
17688
|
}
|
|
17685
17689
|
onKeyValueRangeChanged(ranges) {
|
|
17686
17690
|
this.keyValue = ranges[0];
|
|
@@ -18534,11 +18538,11 @@ class ConditionalFormattingPanel extends owl.Component {
|
|
|
18534
18538
|
****************************************************************************/
|
|
18535
18539
|
get isValue1Invalid() {
|
|
18536
18540
|
var _a;
|
|
18537
|
-
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(
|
|
18541
|
+
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.FirstArgMissing */));
|
|
18538
18542
|
}
|
|
18539
18543
|
get isValue2Invalid() {
|
|
18540
18544
|
var _a;
|
|
18541
|
-
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(
|
|
18545
|
+
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(53 /* CommandResult.SecondArgMissing */));
|
|
18542
18546
|
}
|
|
18543
18547
|
toggleStyle(tool) {
|
|
18544
18548
|
const style = this.state.rules.cellIs.style;
|
|
@@ -18555,17 +18559,17 @@ class ConditionalFormattingPanel extends owl.Component {
|
|
|
18555
18559
|
isValueInvalid(threshold) {
|
|
18556
18560
|
switch (threshold) {
|
|
18557
18561
|
case "minimum":
|
|
18558
|
-
return (this.state.errors.includes(
|
|
18559
|
-
this.state.errors.includes(
|
|
18560
|
-
this.state.errors.includes(
|
|
18561
|
-
this.state.errors.includes(
|
|
18562
|
+
return (this.state.errors.includes(59 /* CommandResult.MinInvalidFormula */) ||
|
|
18563
|
+
this.state.errors.includes(51 /* CommandResult.MinBiggerThanMid */) ||
|
|
18564
|
+
this.state.errors.includes(48 /* CommandResult.MinBiggerThanMax */) ||
|
|
18565
|
+
this.state.errors.includes(54 /* CommandResult.MinNaN */));
|
|
18562
18566
|
case "midpoint":
|
|
18563
|
-
return (this.state.errors.includes(
|
|
18564
|
-
this.state.errors.includes(
|
|
18565
|
-
this.state.errors.includes(
|
|
18567
|
+
return (this.state.errors.includes(60 /* CommandResult.MidInvalidFormula */) ||
|
|
18568
|
+
this.state.errors.includes(55 /* CommandResult.MidNaN */) ||
|
|
18569
|
+
this.state.errors.includes(50 /* CommandResult.MidBiggerThanMax */));
|
|
18566
18570
|
case "maximum":
|
|
18567
|
-
return (this.state.errors.includes(
|
|
18568
|
-
this.state.errors.includes(
|
|
18571
|
+
return (this.state.errors.includes(61 /* CommandResult.MaxInvalidFormula */) ||
|
|
18572
|
+
this.state.errors.includes(56 /* CommandResult.MaxNaN */));
|
|
18569
18573
|
default:
|
|
18570
18574
|
return false;
|
|
18571
18575
|
}
|
|
@@ -18614,13 +18618,13 @@ class ConditionalFormattingPanel extends owl.Component {
|
|
|
18614
18618
|
isInflectionPointInvalid(inflectionPoint) {
|
|
18615
18619
|
switch (inflectionPoint) {
|
|
18616
18620
|
case "lowerInflectionPoint":
|
|
18617
|
-
return (this.state.errors.includes(
|
|
18618
|
-
this.state.errors.includes(
|
|
18619
|
-
this.state.errors.includes(
|
|
18621
|
+
return (this.state.errors.includes(58 /* CommandResult.ValueLowerInflectionNaN */) ||
|
|
18622
|
+
this.state.errors.includes(63 /* CommandResult.ValueLowerInvalidFormula */) ||
|
|
18623
|
+
this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
|
|
18620
18624
|
case "upperInflectionPoint":
|
|
18621
|
-
return (this.state.errors.includes(
|
|
18622
|
-
this.state.errors.includes(
|
|
18623
|
-
this.state.errors.includes(
|
|
18625
|
+
return (this.state.errors.includes(57 /* CommandResult.ValueUpperInflectionNaN */) ||
|
|
18626
|
+
this.state.errors.includes(62 /* CommandResult.ValueUpperInvalidFormula */) ||
|
|
18627
|
+
this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
|
|
18624
18628
|
default:
|
|
18625
18629
|
return true;
|
|
18626
18630
|
}
|
|
@@ -28017,7 +28021,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
28017
28021
|
const currentBorder = this.getCellBorder(cmd);
|
|
28018
28022
|
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);
|
|
28019
28023
|
if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
|
|
28020
|
-
return
|
|
28024
|
+
return 89 /* CommandResult.NoChanges */;
|
|
28021
28025
|
}
|
|
28022
28026
|
return 0 /* CommandResult.Success */;
|
|
28023
28027
|
}
|
|
@@ -28535,9 +28539,9 @@ class CellPlugin extends CorePlugin {
|
|
|
28535
28539
|
checkUselessClearCell(cmd) {
|
|
28536
28540
|
const cell = this.getters.getCell(cmd);
|
|
28537
28541
|
if (!cell)
|
|
28538
|
-
return
|
|
28542
|
+
return 89 /* CommandResult.NoChanges */;
|
|
28539
28543
|
if (!cell.content && !cell.style && !cell.format) {
|
|
28540
|
-
return
|
|
28544
|
+
return 89 /* CommandResult.NoChanges */;
|
|
28541
28545
|
}
|
|
28542
28546
|
return 0 /* CommandResult.Success */;
|
|
28543
28547
|
}
|
|
@@ -28746,13 +28750,13 @@ class ChartPlugin extends CorePlugin {
|
|
|
28746
28750
|
}
|
|
28747
28751
|
checkChartDuplicate(cmd) {
|
|
28748
28752
|
return this.getters.getFigureSheetId(cmd.id)
|
|
28749
|
-
?
|
|
28753
|
+
? 85 /* CommandResult.DuplicatedChartId */
|
|
28750
28754
|
: 0 /* CommandResult.Success */;
|
|
28751
28755
|
}
|
|
28752
28756
|
checkChartExists(cmd) {
|
|
28753
28757
|
return this.getters.getFigureSheetId(cmd.id)
|
|
28754
28758
|
? 0 /* CommandResult.Success */
|
|
28755
|
-
:
|
|
28759
|
+
: 86 /* CommandResult.ChartDoesNotExist */;
|
|
28756
28760
|
}
|
|
28757
28761
|
}
|
|
28758
28762
|
ChartPlugin.getters = [
|
|
@@ -28954,10 +28958,10 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
28954
28958
|
return 27 /* CommandResult.InvalidSheetId */;
|
|
28955
28959
|
const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
|
|
28956
28960
|
if (ruleIndex === -1)
|
|
28957
|
-
return
|
|
28961
|
+
return 72 /* CommandResult.InvalidConditionalFormatId */;
|
|
28958
28962
|
const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
|
|
28959
28963
|
if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
|
|
28960
|
-
return
|
|
28964
|
+
return 72 /* CommandResult.InvalidConditionalFormatId */;
|
|
28961
28965
|
}
|
|
28962
28966
|
return 0 /* CommandResult.Success */;
|
|
28963
28967
|
}
|
|
@@ -28998,10 +29002,10 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
28998
29002
|
const errors = [];
|
|
28999
29003
|
const isEmpty = (value) => value === undefined || value === "";
|
|
29000
29004
|
if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
|
|
29001
|
-
errors.push(
|
|
29005
|
+
errors.push(52 /* CommandResult.FirstArgMissing */);
|
|
29002
29006
|
}
|
|
29003
29007
|
if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
|
|
29004
|
-
errors.push(
|
|
29008
|
+
errors.push(53 /* CommandResult.SecondArgMissing */);
|
|
29005
29009
|
}
|
|
29006
29010
|
return errors.length ? errors : 0 /* CommandResult.Success */;
|
|
29007
29011
|
}
|
|
@@ -29013,15 +29017,15 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29013
29017
|
(threshold.value === "" || isNaN(threshold.value))) {
|
|
29014
29018
|
switch (thresholdName) {
|
|
29015
29019
|
case "min":
|
|
29016
|
-
return
|
|
29020
|
+
return 54 /* CommandResult.MinNaN */;
|
|
29017
29021
|
case "max":
|
|
29018
|
-
return
|
|
29022
|
+
return 56 /* CommandResult.MaxNaN */;
|
|
29019
29023
|
case "mid":
|
|
29020
|
-
return
|
|
29024
|
+
return 55 /* CommandResult.MidNaN */;
|
|
29021
29025
|
case "upperInflectionPoint":
|
|
29022
|
-
return
|
|
29026
|
+
return 57 /* CommandResult.ValueUpperInflectionNaN */;
|
|
29023
29027
|
case "lowerInflectionPoint":
|
|
29024
|
-
return
|
|
29028
|
+
return 58 /* CommandResult.ValueLowerInflectionNaN */;
|
|
29025
29029
|
}
|
|
29026
29030
|
}
|
|
29027
29031
|
return 0 /* CommandResult.Success */;
|
|
@@ -29035,15 +29039,15 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29035
29039
|
catch (error) {
|
|
29036
29040
|
switch (thresholdName) {
|
|
29037
29041
|
case "min":
|
|
29038
|
-
return
|
|
29042
|
+
return 59 /* CommandResult.MinInvalidFormula */;
|
|
29039
29043
|
case "max":
|
|
29040
|
-
return
|
|
29044
|
+
return 61 /* CommandResult.MaxInvalidFormula */;
|
|
29041
29045
|
case "mid":
|
|
29042
|
-
return
|
|
29046
|
+
return 60 /* CommandResult.MidInvalidFormula */;
|
|
29043
29047
|
case "upperInflectionPoint":
|
|
29044
|
-
return
|
|
29048
|
+
return 62 /* CommandResult.ValueUpperInvalidFormula */;
|
|
29045
29049
|
case "lowerInflectionPoint":
|
|
29046
|
-
return
|
|
29050
|
+
return 63 /* CommandResult.ValueLowerInvalidFormula */;
|
|
29047
29051
|
}
|
|
29048
29052
|
}
|
|
29049
29053
|
return 0 /* CommandResult.Success */;
|
|
@@ -29060,7 +29064,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29060
29064
|
if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
|
|
29061
29065
|
rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
|
|
29062
29066
|
Number(minValue) > Number(maxValue)) {
|
|
29063
|
-
return
|
|
29067
|
+
return 49 /* CommandResult.LowerBiggerThanUpper */;
|
|
29064
29068
|
}
|
|
29065
29069
|
return 0 /* CommandResult.Success */;
|
|
29066
29070
|
}
|
|
@@ -29070,7 +29074,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29070
29074
|
if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
|
|
29071
29075
|
rule.minimum.type === rule.maximum.type &&
|
|
29072
29076
|
stringToNumber(minValue) >= stringToNumber(maxValue)) {
|
|
29073
|
-
return
|
|
29077
|
+
return 48 /* CommandResult.MinBiggerThanMax */;
|
|
29074
29078
|
}
|
|
29075
29079
|
return 0 /* CommandResult.Success */;
|
|
29076
29080
|
}
|
|
@@ -29082,7 +29086,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29082
29086
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
29083
29087
|
rule.midpoint.type === rule.maximum.type &&
|
|
29084
29088
|
stringToNumber(midValue) >= stringToNumber(maxValue)) {
|
|
29085
|
-
return
|
|
29089
|
+
return 50 /* CommandResult.MidBiggerThanMax */;
|
|
29086
29090
|
}
|
|
29087
29091
|
return 0 /* CommandResult.Success */;
|
|
29088
29092
|
}
|
|
@@ -29094,7 +29098,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
29094
29098
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
29095
29099
|
rule.minimum.type === rule.midpoint.type &&
|
|
29096
29100
|
stringToNumber(minValue) >= stringToNumber(midValue)) {
|
|
29097
|
-
return
|
|
29101
|
+
return 51 /* CommandResult.MinBiggerThanMid */;
|
|
29098
29102
|
}
|
|
29099
29103
|
return 0 /* CommandResult.Success */;
|
|
29100
29104
|
}
|
|
@@ -29195,13 +29199,13 @@ class FigurePlugin extends CorePlugin {
|
|
|
29195
29199
|
checkFigureExists(sheetId, figureId) {
|
|
29196
29200
|
var _a;
|
|
29197
29201
|
if (((_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === undefined) {
|
|
29198
|
-
return
|
|
29202
|
+
return 71 /* CommandResult.FigureDoesNotExist */;
|
|
29199
29203
|
}
|
|
29200
29204
|
return 0 /* CommandResult.Success */;
|
|
29201
29205
|
}
|
|
29202
29206
|
checkFigureDuplicate(figureId) {
|
|
29203
29207
|
if (Object.values(this.figures).find((sheet) => sheet === null || sheet === void 0 ? void 0 : sheet[figureId])) {
|
|
29204
|
-
return
|
|
29208
|
+
return 83 /* CommandResult.DuplicatedFigureId */;
|
|
29205
29209
|
}
|
|
29206
29210
|
return 0 /* CommandResult.Success */;
|
|
29207
29211
|
}
|
|
@@ -29303,12 +29307,12 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29303
29307
|
switch (cmd.type) {
|
|
29304
29308
|
case "CREATE_FILTER_TABLE":
|
|
29305
29309
|
if (!areZonesContinuous(...cmd.target)) {
|
|
29306
|
-
return
|
|
29310
|
+
return 82 /* CommandResult.NonContinuousTargets */;
|
|
29307
29311
|
}
|
|
29308
29312
|
const zone = union(...cmd.target);
|
|
29309
29313
|
const checkFilterOverlap = () => {
|
|
29310
29314
|
if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
|
|
29311
|
-
return
|
|
29315
|
+
return 79 /* CommandResult.FilterOverlap */;
|
|
29312
29316
|
}
|
|
29313
29317
|
return 0 /* CommandResult.Success */;
|
|
29314
29318
|
};
|
|
@@ -29316,7 +29320,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29316
29320
|
const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
|
|
29317
29321
|
for (let merge of mergesInTarget) {
|
|
29318
29322
|
if (overlap(zone, merge)) {
|
|
29319
|
-
return
|
|
29323
|
+
return 81 /* CommandResult.MergeInFilter */;
|
|
29320
29324
|
}
|
|
29321
29325
|
}
|
|
29322
29326
|
return 0 /* CommandResult.Success */;
|
|
@@ -29326,7 +29330,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29326
29330
|
for (let merge of cmd.target) {
|
|
29327
29331
|
for (let filterTable of this.getFilterTables(cmd.sheetId)) {
|
|
29328
29332
|
if (overlap(filterTable.zone, merge)) {
|
|
29329
|
-
return
|
|
29333
|
+
return 81 /* CommandResult.MergeInFilter */;
|
|
29330
29334
|
}
|
|
29331
29335
|
}
|
|
29332
29336
|
}
|
|
@@ -29826,10 +29830,10 @@ class HeaderVisibilityPlugin extends CorePlugin {
|
|
|
29826
29830
|
: this.getters.getNumberRows(cmd.sheetId);
|
|
29827
29831
|
const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
|
|
29828
29832
|
if (hiddenElements.size >= elements) {
|
|
29829
|
-
return
|
|
29833
|
+
return 67 /* CommandResult.TooManyHiddenElements */;
|
|
29830
29834
|
}
|
|
29831
29835
|
else if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
|
|
29832
|
-
return
|
|
29836
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
29833
29837
|
}
|
|
29834
29838
|
else {
|
|
29835
29839
|
return 0 /* CommandResult.Success */;
|
|
@@ -30373,7 +30377,7 @@ class MergePlugin extends CorePlugin {
|
|
|
30373
30377
|
for (const zone of target) {
|
|
30374
30378
|
for (const zone2 of target) {
|
|
30375
30379
|
if (zone !== zone2 && overlap(zone, zone2)) {
|
|
30376
|
-
return
|
|
30380
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
30377
30381
|
}
|
|
30378
30382
|
}
|
|
30379
30383
|
}
|
|
@@ -30387,7 +30391,7 @@ class MergePlugin extends CorePlugin {
|
|
|
30387
30391
|
for (const zone of target) {
|
|
30388
30392
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
30389
30393
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
30390
|
-
return
|
|
30394
|
+
return 76 /* CommandResult.FrozenPaneOverlap */;
|
|
30391
30395
|
}
|
|
30392
30396
|
}
|
|
30393
30397
|
return 0 /* CommandResult.Success */;
|
|
@@ -30919,9 +30923,10 @@ class RangeAdapter {
|
|
|
30919
30923
|
* Get a Xc string that represent a part of a range
|
|
30920
30924
|
*/
|
|
30921
30925
|
getRangePartString(range, part) {
|
|
30922
|
-
|
|
30926
|
+
var _a, _b;
|
|
30927
|
+
const colFixed = range.parts && ((_a = range.parts[part]) === null || _a === void 0 ? void 0 : _a.colFixed) ? "$" : "";
|
|
30923
30928
|
const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
|
|
30924
|
-
const rowFixed = range.parts && range.parts[part].rowFixed ? "$" : "";
|
|
30929
|
+
const rowFixed = range.parts && ((_b = range.parts[part]) === null || _b === void 0 ? void 0 : _b.rowFixed) ? "$" : "";
|
|
30925
30930
|
const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
|
|
30926
30931
|
let str = "";
|
|
30927
30932
|
if (range.isFullCol) {
|
|
@@ -31011,10 +31016,10 @@ class SheetPlugin extends CorePlugin {
|
|
|
31011
31016
|
? this.getNumberCols(cmd.sheetId)
|
|
31012
31017
|
: this.getNumberRows(cmd.sheetId);
|
|
31013
31018
|
if (cmd.base < 0 || cmd.base >= elements) {
|
|
31014
|
-
return
|
|
31019
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
31015
31020
|
}
|
|
31016
31021
|
else if (cmd.quantity <= 0) {
|
|
31017
|
-
return
|
|
31022
|
+
return 88 /* CommandResult.InvalidQuantity */;
|
|
31018
31023
|
}
|
|
31019
31024
|
return 0 /* CommandResult.Success */;
|
|
31020
31025
|
case "REMOVE_COLUMNS_ROWS": {
|
|
@@ -31022,7 +31027,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
31022
31027
|
? this.getNumberCols(cmd.sheetId)
|
|
31023
31028
|
: this.getNumberRows(cmd.sheetId);
|
|
31024
31029
|
if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
|
|
31025
|
-
return
|
|
31030
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
31026
31031
|
}
|
|
31027
31032
|
else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
|
|
31028
31033
|
return 8 /* CommandResult.NotEnoughElements */;
|
|
@@ -31462,18 +31467,18 @@ class SheetPlugin extends CorePlugin {
|
|
|
31462
31467
|
checkRowFreezeQuantity(cmd) {
|
|
31463
31468
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
|
|
31464
31469
|
? 0 /* CommandResult.Success */
|
|
31465
|
-
:
|
|
31470
|
+
: 75 /* CommandResult.InvalidFreezeQuantity */;
|
|
31466
31471
|
}
|
|
31467
31472
|
checkColFreezeQuantity(cmd) {
|
|
31468
31473
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
|
|
31469
31474
|
? 0 /* CommandResult.Success */
|
|
31470
|
-
:
|
|
31475
|
+
: 75 /* CommandResult.InvalidFreezeQuantity */;
|
|
31471
31476
|
}
|
|
31472
31477
|
checkRowFreezeOverlapMerge(cmd) {
|
|
31473
31478
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
31474
31479
|
for (let merge of merges) {
|
|
31475
31480
|
if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
|
|
31476
|
-
return
|
|
31481
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
31477
31482
|
}
|
|
31478
31483
|
}
|
|
31479
31484
|
return 0 /* CommandResult.Success */;
|
|
@@ -31482,7 +31487,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
31482
31487
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
31483
31488
|
for (let merge of merges) {
|
|
31484
31489
|
if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
|
|
31485
|
-
return
|
|
31490
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
31486
31491
|
}
|
|
31487
31492
|
}
|
|
31488
31493
|
return 0 /* CommandResult.Success */;
|
|
@@ -32246,10 +32251,8 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
32246
32251
|
* that are actually present in the grid.
|
|
32247
32252
|
*/
|
|
32248
32253
|
function range(range) {
|
|
32254
|
+
assertRangeValid(range);
|
|
32249
32255
|
const sheetId = range.sheetId;
|
|
32250
|
-
if (!isZoneValid(range.zone)) {
|
|
32251
|
-
throw new InvalidReferenceError();
|
|
32252
|
-
}
|
|
32253
32256
|
// Performance issue: Avoid fetching data on positions that are out of the spreadsheet
|
|
32254
32257
|
// e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
|
|
32255
32258
|
const sheetZone = getters.getSheetZone(sheetId);
|
|
@@ -32284,23 +32287,26 @@ class EvaluationPlugin extends UIPlugin {
|
|
|
32284
32287
|
* The `compute` of the formula's function must process it completely
|
|
32285
32288
|
*/
|
|
32286
32289
|
function refFn(range, isMeta, functionName, paramNumber) {
|
|
32290
|
+
assertRangeValid(range);
|
|
32287
32291
|
if (isMeta) {
|
|
32288
32292
|
// Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
|
|
32289
32293
|
return { value: zoneToXc(range.zone) };
|
|
32290
32294
|
}
|
|
32291
|
-
if (!isZoneValid(range.zone)) {
|
|
32292
|
-
throw new InvalidReferenceError();
|
|
32293
|
-
}
|
|
32294
32295
|
// if the formula definition could have accepted a range, we would pass through the _range function and not here
|
|
32295
32296
|
if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
|
|
32296
32297
|
throw new Error(paramNumber
|
|
32297
32298
|
? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
|
|
32298
32299
|
: _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
|
|
32299
32300
|
}
|
|
32301
|
+
return readCell(range);
|
|
32302
|
+
}
|
|
32303
|
+
function assertRangeValid(range) {
|
|
32304
|
+
if (!isZoneValid(range.zone)) {
|
|
32305
|
+
throw new InvalidReferenceError();
|
|
32306
|
+
}
|
|
32300
32307
|
if (range.invalidSheetName) {
|
|
32301
32308
|
throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
|
|
32302
32309
|
}
|
|
32303
|
-
return readCell(range);
|
|
32304
32310
|
}
|
|
32305
32311
|
return [refFn, range, evalContext];
|
|
32306
32312
|
}
|
|
@@ -32800,7 +32806,7 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
32800
32806
|
switch (cmd.type) {
|
|
32801
32807
|
case "UPDATE_FILTER":
|
|
32802
32808
|
if (!this.getters.getFilterId(cmd)) {
|
|
32803
|
-
return
|
|
32809
|
+
return 80 /* CommandResult.FilterNotFound */;
|
|
32804
32810
|
}
|
|
32805
32811
|
break;
|
|
32806
32812
|
}
|
|
@@ -33747,7 +33753,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
33747
33753
|
}
|
|
33748
33754
|
checkPositiveDimension(cmd) {
|
|
33749
33755
|
if (cmd.width < 0 || cmd.height < 0) {
|
|
33750
|
-
return
|
|
33756
|
+
return 69 /* CommandResult.InvalidViewportSize */;
|
|
33751
33757
|
}
|
|
33752
33758
|
return 0 /* CommandResult.Success */;
|
|
33753
33759
|
}
|
|
@@ -33757,7 +33763,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
33757
33763
|
cmd.gridOffsetY === this.gridOffsetY &&
|
|
33758
33764
|
cmd.width === width &&
|
|
33759
33765
|
cmd.height === height) {
|
|
33760
|
-
return
|
|
33766
|
+
return 77 /* CommandResult.ValuesNotChanged */;
|
|
33761
33767
|
}
|
|
33762
33768
|
return 0 /* CommandResult.Success */;
|
|
33763
33769
|
}
|
|
@@ -33765,7 +33771,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
33765
33771
|
const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
|
|
33766
33772
|
if ((!pane.canScrollHorizontally && offsetX > 0) ||
|
|
33767
33773
|
(!pane.canScrollVertically && offsetY > 0)) {
|
|
33768
|
-
return
|
|
33774
|
+
return 70 /* CommandResult.InvalidScrollingDirection */;
|
|
33769
33775
|
}
|
|
33770
33776
|
return 0 /* CommandResult.Success */;
|
|
33771
33777
|
}
|
|
@@ -34021,7 +34027,7 @@ class AutofillPlugin extends UIPlugin {
|
|
|
34021
34027
|
if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
|
|
34022
34028
|
return 0 /* CommandResult.Success */;
|
|
34023
34029
|
}
|
|
34024
|
-
return
|
|
34030
|
+
return 46 /* CommandResult.InvalidAutofillSelection */;
|
|
34025
34031
|
case "AUTOFILL_AUTO":
|
|
34026
34032
|
const zone = this.getters.getSelectedZone();
|
|
34027
34033
|
return zone.top === zone.bottom
|
|
@@ -34623,7 +34629,7 @@ class CellPopoverPlugin extends UIPlugin {
|
|
|
34623
34629
|
cellPopoverRegistry.get(cmd.popoverType);
|
|
34624
34630
|
}
|
|
34625
34631
|
catch (error) {
|
|
34626
|
-
return
|
|
34632
|
+
return 73 /* CommandResult.InvalidCellPopover */;
|
|
34627
34633
|
}
|
|
34628
34634
|
return 0 /* CommandResult.Success */;
|
|
34629
34635
|
default:
|
|
@@ -35826,21 +35832,6 @@ class SelectionInputPlugin extends UIPlugin {
|
|
|
35826
35832
|
// ---------------------------------------------------------------------------
|
|
35827
35833
|
// Command Handling
|
|
35828
35834
|
// ---------------------------------------------------------------------------
|
|
35829
|
-
allowDispatch(cmd) {
|
|
35830
|
-
switch (cmd.type) {
|
|
35831
|
-
case "ADD_EMPTY_RANGE":
|
|
35832
|
-
if (this.inputHasSingleRange && this.ranges.length === 1) {
|
|
35833
|
-
return 30 /* CommandResult.MaximumRangesReached */;
|
|
35834
|
-
}
|
|
35835
|
-
break;
|
|
35836
|
-
case "CHANGE_RANGE":
|
|
35837
|
-
if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
35838
|
-
return 30 /* CommandResult.MaximumRangesReached */;
|
|
35839
|
-
}
|
|
35840
|
-
break;
|
|
35841
|
-
}
|
|
35842
|
-
return 0 /* CommandResult.Success */;
|
|
35843
|
-
}
|
|
35844
35835
|
handleEvent(event) {
|
|
35845
35836
|
const xc = zoneToXc(event.anchor.zone);
|
|
35846
35837
|
const inputSheetId = this.activeSheet;
|
|
@@ -36051,6 +36042,15 @@ class SelectionInputsManagerPlugin extends UIPlugin {
|
|
|
36051
36042
|
// ---------------------------------------------------------------------------
|
|
36052
36043
|
allowDispatch(cmd) {
|
|
36053
36044
|
var _a, _b;
|
|
36045
|
+
switch (cmd.type) {
|
|
36046
|
+
case "FOCUS_RANGE":
|
|
36047
|
+
case "CHANGE_RANGE":
|
|
36048
|
+
case "ADD_EMPTY_RANGE":
|
|
36049
|
+
case "REMOVE_RANGE":
|
|
36050
|
+
if (!this.inputs[cmd.id]) {
|
|
36051
|
+
return 31 /* CommandResult.InvalidInputId */;
|
|
36052
|
+
}
|
|
36053
|
+
}
|
|
36054
36054
|
switch (cmd.type) {
|
|
36055
36055
|
case "FOCUS_RANGE":
|
|
36056
36056
|
const index = (_a = this.currentInput) === null || _a === void 0 ? void 0 : _a.getIndex(cmd.rangeId);
|
|
@@ -36058,9 +36058,19 @@ class SelectionInputsManagerPlugin extends UIPlugin {
|
|
|
36058
36058
|
return 29 /* CommandResult.InputAlreadyFocused */;
|
|
36059
36059
|
}
|
|
36060
36060
|
break;
|
|
36061
|
-
|
|
36062
|
-
|
|
36063
|
-
|
|
36061
|
+
case "ADD_EMPTY_RANGE":
|
|
36062
|
+
const input = this.inputs[cmd.id];
|
|
36063
|
+
if (input.inputHasSingleRange && input.ranges.length === 1) {
|
|
36064
|
+
return 30 /* CommandResult.MaximumRangesReached */;
|
|
36065
|
+
}
|
|
36066
|
+
break;
|
|
36067
|
+
case "CHANGE_RANGE": {
|
|
36068
|
+
const input = this.inputs[cmd.id];
|
|
36069
|
+
if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
36070
|
+
return 30 /* CommandResult.MaximumRangesReached */;
|
|
36071
|
+
}
|
|
36072
|
+
break;
|
|
36073
|
+
}
|
|
36064
36074
|
}
|
|
36065
36075
|
return 0 /* CommandResult.Success */;
|
|
36066
36076
|
}
|
|
@@ -37040,7 +37050,7 @@ class SortPlugin extends UIPlugin {
|
|
|
37040
37050
|
/*Test the presence of single cells*/
|
|
37041
37051
|
const singleCells = positions(zone).some(({ col, row }) => !this.getters.isInMerge({ sheetId, col, row }));
|
|
37042
37052
|
if (singleCells) {
|
|
37043
|
-
return
|
|
37053
|
+
return 64 /* CommandResult.InvalidSortZone */;
|
|
37044
37054
|
}
|
|
37045
37055
|
return 0 /* CommandResult.Success */;
|
|
37046
37056
|
}
|
|
@@ -37059,7 +37069,7 @@ class SortPlugin extends UIPlugin {
|
|
|
37059
37069
|
];
|
|
37060
37070
|
return widthCurrent === widthFirst && heightCurrent === heightFirst;
|
|
37061
37071
|
})) {
|
|
37062
|
-
return
|
|
37072
|
+
return 64 /* CommandResult.InvalidSortZone */;
|
|
37063
37073
|
}
|
|
37064
37074
|
return 0 /* CommandResult.Success */;
|
|
37065
37075
|
}
|
|
@@ -37699,7 +37709,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
|
|
|
37699
37709
|
for (const zone of this.getPasteZones(target)) {
|
|
37700
37710
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
37701
37711
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
37702
|
-
return
|
|
37712
|
+
return 76 /* CommandResult.FrozenPaneOverlap */;
|
|
37703
37713
|
}
|
|
37704
37714
|
}
|
|
37705
37715
|
return 0 /* CommandResult.Success */;
|
|
@@ -38087,7 +38097,7 @@ class ClipboardFigureState {
|
|
|
38087
38097
|
}
|
|
38088
38098
|
isPasteAllowed(target, option) {
|
|
38089
38099
|
if (target.length === 0) {
|
|
38090
|
-
return
|
|
38100
|
+
return 74 /* CommandResult.EmptyTarget */;
|
|
38091
38101
|
}
|
|
38092
38102
|
if ((option === null || option === void 0 ? void 0 : option.pasteOption) !== undefined) {
|
|
38093
38103
|
return 22 /* CommandResult.WrongFigurePasteOption */;
|
|
@@ -38804,7 +38814,7 @@ class EditionPlugin extends UIPlugin {
|
|
|
38804
38814
|
validateSelection(length, start, end) {
|
|
38805
38815
|
return start >= 0 && start <= length && end >= 0 && end <= length
|
|
38806
38816
|
? 0 /* CommandResult.Success */
|
|
38807
|
-
:
|
|
38817
|
+
: 47 /* CommandResult.WrongComposerSelection */;
|
|
38808
38818
|
}
|
|
38809
38819
|
onColumnsRemoved(cmd) {
|
|
38810
38820
|
if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
|
|
@@ -39116,9 +39126,10 @@ class EditionPlugin extends UIPlugin {
|
|
|
39116
39126
|
*/
|
|
39117
39127
|
getReferencedRanges() {
|
|
39118
39128
|
const editionSheetId = this.getters.getEditionSheet();
|
|
39119
|
-
|
|
39129
|
+
const referenceRanges = this.currentTokens
|
|
39120
39130
|
.filter((token) => token.type === "REFERENCE")
|
|
39121
39131
|
.map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
|
|
39132
|
+
return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
|
|
39122
39133
|
}
|
|
39123
39134
|
/**
|
|
39124
39135
|
* Function used to determine when composer selection can start.
|
|
@@ -39721,7 +39732,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
39721
39732
|
const headers = [cmd.base, ...cmd.elements];
|
|
39722
39733
|
const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
|
|
39723
39734
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
39724
|
-
return
|
|
39735
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
39725
39736
|
}
|
|
39726
39737
|
return 0 /* CommandResult.Success */;
|
|
39727
39738
|
}
|
|
@@ -41096,7 +41107,7 @@ const AddMergeInteractiveContent = {
|
|
|
41096
41107
|
};
|
|
41097
41108
|
function interactiveAddMerge(env, sheetId, target) {
|
|
41098
41109
|
const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
|
|
41099
|
-
if (result.isCancelledBecause(
|
|
41110
|
+
if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
|
|
41100
41111
|
env.raiseError(AddMergeInteractiveContent.MergeInFilter);
|
|
41101
41112
|
}
|
|
41102
41113
|
else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
|
|
@@ -43090,7 +43101,7 @@ class SelectionStreamProcessorImpl {
|
|
|
43090
43101
|
*/
|
|
43091
43102
|
moveAnchorCell(direction, step = 1) {
|
|
43092
43103
|
if (step !== "end" && step <= 0) {
|
|
43093
|
-
return new DispatchResult(
|
|
43104
|
+
return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
|
|
43094
43105
|
}
|
|
43095
43106
|
const { col, row } = this.getNextAvailablePosition(direction, step);
|
|
43096
43107
|
return this.selectCell(col, row);
|
|
@@ -43136,7 +43147,7 @@ class SelectionStreamProcessorImpl {
|
|
|
43136
43147
|
*/
|
|
43137
43148
|
resizeAnchorZone(direction, step = 1) {
|
|
43138
43149
|
if (step !== "end" && step <= 0) {
|
|
43139
|
-
return new DispatchResult(
|
|
43150
|
+
return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
|
|
43140
43151
|
}
|
|
43141
43152
|
const sheetId = this.getters.getActiveSheetId();
|
|
43142
43153
|
const anchor = this.anchor;
|
|
@@ -45174,10 +45185,10 @@ class Model extends EventBus {
|
|
|
45174
45185
|
const command = { ...payload, type };
|
|
45175
45186
|
let status = this.status;
|
|
45176
45187
|
if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
|
|
45177
|
-
return new DispatchResult(
|
|
45188
|
+
return new DispatchResult(68 /* CommandResult.Readonly */);
|
|
45178
45189
|
}
|
|
45179
45190
|
if (!this.session.canApplyOptimisticUpdate()) {
|
|
45180
|
-
return new DispatchResult(
|
|
45191
|
+
return new DispatchResult(65 /* CommandResult.WaitingSessionConfirmation */);
|
|
45181
45192
|
}
|
|
45182
45193
|
switch (status) {
|
|
45183
45194
|
case 0 /* Status.Ready */:
|
|
@@ -45664,6 +45675,6 @@ exports.setTranslationMethod = setTranslationMethod;
|
|
|
45664
45675
|
exports.tokenize = tokenize;
|
|
45665
45676
|
|
|
45666
45677
|
|
|
45667
|
-
__info__.version = '16.2.
|
|
45668
|
-
__info__.date = '2024-01-
|
|
45669
|
-
__info__.hash = '
|
|
45678
|
+
__info__.version = '16.2.29';
|
|
45679
|
+
__info__.date = '2024-01-29T13:49:36.240Z';
|
|
45680
|
+
__info__.hash = '27b2ec1';
|