@odoo/o-spreadsheet 16.4.19 → 16.4.21
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 +325 -309
- package/dist/o-spreadsheet.d.ts +70 -69
- package/dist/o-spreadsheet.esm.js +325 -309
- package/dist/o-spreadsheet.iife.js +325 -309
- package/dist/o-spreadsheet.iife.min.js +17 -24
- package/dist/o_spreadsheet.xml +5 -5
- package/package.json +1 -1
|
@@ -2216,27 +2216,30 @@
|
|
|
2216
2216
|
}
|
|
2217
2217
|
function createLargeNumberFormat(format, magnitude, postFix, locale) {
|
|
2218
2218
|
const internalFormat = parseFormat(format || "#,##0");
|
|
2219
|
-
const largeNumberFormat =
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
format: {
|
|
2226
|
-
...formatPart.format,
|
|
2227
|
-
magnitude,
|
|
2228
|
-
decimalPart: undefined,
|
|
2229
|
-
},
|
|
2230
|
-
},
|
|
2231
|
-
{
|
|
2232
|
-
type: "STRING",
|
|
2233
|
-
format: postFix,
|
|
2234
|
-
},
|
|
2235
|
-
];
|
|
2219
|
+
const largeNumberFormat = [];
|
|
2220
|
+
for (let i = 0; i < internalFormat.length; i++) {
|
|
2221
|
+
const formatPart = internalFormat[i];
|
|
2222
|
+
if (formatPart.type !== "NUMBER") {
|
|
2223
|
+
largeNumberFormat.push(formatPart);
|
|
2224
|
+
continue;
|
|
2236
2225
|
}
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2226
|
+
largeNumberFormat.push({
|
|
2227
|
+
...formatPart,
|
|
2228
|
+
format: {
|
|
2229
|
+
...formatPart.format,
|
|
2230
|
+
magnitude,
|
|
2231
|
+
decimalPart: undefined,
|
|
2232
|
+
},
|
|
2233
|
+
});
|
|
2234
|
+
largeNumberFormat.push({
|
|
2235
|
+
type: "STRING",
|
|
2236
|
+
format: postFix,
|
|
2237
|
+
});
|
|
2238
|
+
const nextFormatPart = internalFormat[i + 1];
|
|
2239
|
+
if (nextFormatPart?.type === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
|
|
2240
|
+
i++;
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2240
2243
|
return convertInternalFormatToFormat(largeNumberFormat);
|
|
2241
2244
|
}
|
|
2242
2245
|
function changeDecimalPlaces(format, step, locale) {
|
|
@@ -4255,71 +4258,72 @@
|
|
|
4255
4258
|
CommandResult[CommandResult["InputAlreadyFocused"] = 30] = "InputAlreadyFocused";
|
|
4256
4259
|
CommandResult[CommandResult["MaximumRangesReached"] = 31] = "MaximumRangesReached";
|
|
4257
4260
|
CommandResult[CommandResult["MinimumRangesReached"] = 32] = "MinimumRangesReached";
|
|
4258
|
-
CommandResult[CommandResult["
|
|
4259
|
-
CommandResult[CommandResult["
|
|
4260
|
-
CommandResult[CommandResult["
|
|
4261
|
-
CommandResult[CommandResult["
|
|
4262
|
-
CommandResult[CommandResult["
|
|
4263
|
-
CommandResult[CommandResult["
|
|
4264
|
-
CommandResult[CommandResult["
|
|
4265
|
-
CommandResult[CommandResult["
|
|
4266
|
-
CommandResult[CommandResult["
|
|
4267
|
-
CommandResult[CommandResult["
|
|
4268
|
-
CommandResult[CommandResult["
|
|
4269
|
-
CommandResult[CommandResult["
|
|
4270
|
-
CommandResult[CommandResult["
|
|
4271
|
-
CommandResult[CommandResult["
|
|
4272
|
-
CommandResult[CommandResult["
|
|
4273
|
-
CommandResult[CommandResult["
|
|
4274
|
-
CommandResult[CommandResult["
|
|
4275
|
-
CommandResult[CommandResult["
|
|
4276
|
-
CommandResult[CommandResult["
|
|
4277
|
-
CommandResult[CommandResult["
|
|
4278
|
-
CommandResult[CommandResult["
|
|
4279
|
-
CommandResult[CommandResult["
|
|
4280
|
-
CommandResult[CommandResult["
|
|
4281
|
-
CommandResult[CommandResult["
|
|
4282
|
-
CommandResult[CommandResult["
|
|
4283
|
-
CommandResult[CommandResult["
|
|
4284
|
-
CommandResult[CommandResult["
|
|
4285
|
-
CommandResult[CommandResult["
|
|
4286
|
-
CommandResult[CommandResult["
|
|
4287
|
-
CommandResult[CommandResult["
|
|
4288
|
-
CommandResult[CommandResult["
|
|
4289
|
-
CommandResult[CommandResult["
|
|
4290
|
-
CommandResult[CommandResult["
|
|
4291
|
-
CommandResult[CommandResult["
|
|
4292
|
-
CommandResult[CommandResult["
|
|
4293
|
-
CommandResult[CommandResult["
|
|
4294
|
-
CommandResult[CommandResult["
|
|
4295
|
-
CommandResult[CommandResult["
|
|
4296
|
-
CommandResult[CommandResult["
|
|
4297
|
-
CommandResult[CommandResult["
|
|
4298
|
-
CommandResult[CommandResult["
|
|
4299
|
-
CommandResult[CommandResult["
|
|
4300
|
-
CommandResult[CommandResult["
|
|
4301
|
-
CommandResult[CommandResult["
|
|
4302
|
-
CommandResult[CommandResult["
|
|
4303
|
-
CommandResult[CommandResult["
|
|
4304
|
-
CommandResult[CommandResult["
|
|
4305
|
-
CommandResult[CommandResult["
|
|
4306
|
-
CommandResult[CommandResult["
|
|
4307
|
-
CommandResult[CommandResult["
|
|
4308
|
-
CommandResult[CommandResult["
|
|
4309
|
-
CommandResult[CommandResult["
|
|
4310
|
-
CommandResult[CommandResult["
|
|
4311
|
-
CommandResult[CommandResult["
|
|
4312
|
-
CommandResult[CommandResult["
|
|
4313
|
-
CommandResult[CommandResult["
|
|
4314
|
-
CommandResult[CommandResult["
|
|
4315
|
-
CommandResult[CommandResult["
|
|
4316
|
-
CommandResult[CommandResult["
|
|
4317
|
-
CommandResult[CommandResult["
|
|
4318
|
-
CommandResult[CommandResult["
|
|
4319
|
-
CommandResult[CommandResult["
|
|
4320
|
-
CommandResult[CommandResult["
|
|
4321
|
-
CommandResult[CommandResult["
|
|
4322
|
-
CommandResult[CommandResult["
|
|
4261
|
+
CommandResult[CommandResult["InvalidInputId"] = 33] = "InvalidInputId";
|
|
4262
|
+
CommandResult[CommandResult["InvalidChartDefinition"] = 34] = "InvalidChartDefinition";
|
|
4263
|
+
CommandResult[CommandResult["InvalidDataSet"] = 35] = "InvalidDataSet";
|
|
4264
|
+
CommandResult[CommandResult["InvalidLabelRange"] = 36] = "InvalidLabelRange";
|
|
4265
|
+
CommandResult[CommandResult["InvalidScorecardKeyValue"] = 37] = "InvalidScorecardKeyValue";
|
|
4266
|
+
CommandResult[CommandResult["InvalidScorecardBaseline"] = 38] = "InvalidScorecardBaseline";
|
|
4267
|
+
CommandResult[CommandResult["InvalidGaugeDataRange"] = 39] = "InvalidGaugeDataRange";
|
|
4268
|
+
CommandResult[CommandResult["EmptyGaugeRangeMin"] = 40] = "EmptyGaugeRangeMin";
|
|
4269
|
+
CommandResult[CommandResult["GaugeRangeMinNaN"] = 41] = "GaugeRangeMinNaN";
|
|
4270
|
+
CommandResult[CommandResult["EmptyGaugeRangeMax"] = 42] = "EmptyGaugeRangeMax";
|
|
4271
|
+
CommandResult[CommandResult["GaugeRangeMaxNaN"] = 43] = "GaugeRangeMaxNaN";
|
|
4272
|
+
CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 44] = "GaugeRangeMinBiggerThanRangeMax";
|
|
4273
|
+
CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 45] = "GaugeLowerInflectionPointNaN";
|
|
4274
|
+
CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 46] = "GaugeUpperInflectionPointNaN";
|
|
4275
|
+
CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 47] = "GaugeLowerBiggerThanUpper";
|
|
4276
|
+
CommandResult[CommandResult["InvalidAutofillSelection"] = 48] = "InvalidAutofillSelection";
|
|
4277
|
+
CommandResult[CommandResult["WrongComposerSelection"] = 49] = "WrongComposerSelection";
|
|
4278
|
+
CommandResult[CommandResult["MinBiggerThanMax"] = 50] = "MinBiggerThanMax";
|
|
4279
|
+
CommandResult[CommandResult["LowerBiggerThanUpper"] = 51] = "LowerBiggerThanUpper";
|
|
4280
|
+
CommandResult[CommandResult["MidBiggerThanMax"] = 52] = "MidBiggerThanMax";
|
|
4281
|
+
CommandResult[CommandResult["MinBiggerThanMid"] = 53] = "MinBiggerThanMid";
|
|
4282
|
+
CommandResult[CommandResult["FirstArgMissing"] = 54] = "FirstArgMissing";
|
|
4283
|
+
CommandResult[CommandResult["SecondArgMissing"] = 55] = "SecondArgMissing";
|
|
4284
|
+
CommandResult[CommandResult["MinNaN"] = 56] = "MinNaN";
|
|
4285
|
+
CommandResult[CommandResult["MidNaN"] = 57] = "MidNaN";
|
|
4286
|
+
CommandResult[CommandResult["MaxNaN"] = 58] = "MaxNaN";
|
|
4287
|
+
CommandResult[CommandResult["ValueUpperInflectionNaN"] = 59] = "ValueUpperInflectionNaN";
|
|
4288
|
+
CommandResult[CommandResult["ValueLowerInflectionNaN"] = 60] = "ValueLowerInflectionNaN";
|
|
4289
|
+
CommandResult[CommandResult["MinInvalidFormula"] = 61] = "MinInvalidFormula";
|
|
4290
|
+
CommandResult[CommandResult["MidInvalidFormula"] = 62] = "MidInvalidFormula";
|
|
4291
|
+
CommandResult[CommandResult["MaxInvalidFormula"] = 63] = "MaxInvalidFormula";
|
|
4292
|
+
CommandResult[CommandResult["ValueUpperInvalidFormula"] = 64] = "ValueUpperInvalidFormula";
|
|
4293
|
+
CommandResult[CommandResult["ValueLowerInvalidFormula"] = 65] = "ValueLowerInvalidFormula";
|
|
4294
|
+
CommandResult[CommandResult["InvalidSortZone"] = 66] = "InvalidSortZone";
|
|
4295
|
+
CommandResult[CommandResult["WaitingSessionConfirmation"] = 67] = "WaitingSessionConfirmation";
|
|
4296
|
+
CommandResult[CommandResult["MergeOverlap"] = 68] = "MergeOverlap";
|
|
4297
|
+
CommandResult[CommandResult["TooManyHiddenElements"] = 69] = "TooManyHiddenElements";
|
|
4298
|
+
CommandResult[CommandResult["Readonly"] = 70] = "Readonly";
|
|
4299
|
+
CommandResult[CommandResult["InvalidViewportSize"] = 71] = "InvalidViewportSize";
|
|
4300
|
+
CommandResult[CommandResult["InvalidScrollingDirection"] = 72] = "InvalidScrollingDirection";
|
|
4301
|
+
CommandResult[CommandResult["FigureDoesNotExist"] = 73] = "FigureDoesNotExist";
|
|
4302
|
+
CommandResult[CommandResult["InvalidConditionalFormatId"] = 74] = "InvalidConditionalFormatId";
|
|
4303
|
+
CommandResult[CommandResult["InvalidCellPopover"] = 75] = "InvalidCellPopover";
|
|
4304
|
+
CommandResult[CommandResult["EmptyTarget"] = 76] = "EmptyTarget";
|
|
4305
|
+
CommandResult[CommandResult["InvalidFreezeQuantity"] = 77] = "InvalidFreezeQuantity";
|
|
4306
|
+
CommandResult[CommandResult["FrozenPaneOverlap"] = 78] = "FrozenPaneOverlap";
|
|
4307
|
+
CommandResult[CommandResult["ValuesNotChanged"] = 79] = "ValuesNotChanged";
|
|
4308
|
+
CommandResult[CommandResult["InvalidFilterZone"] = 80] = "InvalidFilterZone";
|
|
4309
|
+
CommandResult[CommandResult["FilterOverlap"] = 81] = "FilterOverlap";
|
|
4310
|
+
CommandResult[CommandResult["FilterNotFound"] = 82] = "FilterNotFound";
|
|
4311
|
+
CommandResult[CommandResult["MergeInFilter"] = 83] = "MergeInFilter";
|
|
4312
|
+
CommandResult[CommandResult["NonContinuousTargets"] = 84] = "NonContinuousTargets";
|
|
4313
|
+
CommandResult[CommandResult["DuplicatedFigureId"] = 85] = "DuplicatedFigureId";
|
|
4314
|
+
CommandResult[CommandResult["InvalidSelectionStep"] = 86] = "InvalidSelectionStep";
|
|
4315
|
+
CommandResult[CommandResult["DuplicatedChartId"] = 87] = "DuplicatedChartId";
|
|
4316
|
+
CommandResult[CommandResult["ChartDoesNotExist"] = 88] = "ChartDoesNotExist";
|
|
4317
|
+
CommandResult[CommandResult["InvalidHeaderIndex"] = 89] = "InvalidHeaderIndex";
|
|
4318
|
+
CommandResult[CommandResult["InvalidQuantity"] = 90] = "InvalidQuantity";
|
|
4319
|
+
CommandResult[CommandResult["MoreThanOneColumnSelected"] = 91] = "MoreThanOneColumnSelected";
|
|
4320
|
+
CommandResult[CommandResult["EmptySplitSeparator"] = 92] = "EmptySplitSeparator";
|
|
4321
|
+
CommandResult[CommandResult["SplitWillOverwriteContent"] = 93] = "SplitWillOverwriteContent";
|
|
4322
|
+
CommandResult[CommandResult["NoSplitSeparatorInSelection"] = 94] = "NoSplitSeparatorInSelection";
|
|
4323
|
+
CommandResult[CommandResult["NoActiveSheet"] = 95] = "NoActiveSheet";
|
|
4324
|
+
CommandResult[CommandResult["InvalidLocale"] = 96] = "InvalidLocale";
|
|
4325
|
+
CommandResult[CommandResult["AlreadyInPaintingFormatMode"] = 97] = "AlreadyInPaintingFormatMode";
|
|
4326
|
+
CommandResult[CommandResult["NoChanges"] = 98] = "NoChanges";
|
|
4323
4327
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
4324
4328
|
|
|
4325
4329
|
const borderStyles = ["thin", "medium", "thick", "dashed", "dotted"];
|
|
@@ -15968,14 +15972,8 @@
|
|
|
15968
15972
|
: undefined));
|
|
15969
15973
|
}
|
|
15970
15974
|
}
|
|
15971
|
-
else if (zone.left === zone.right && zone.top === zone.bottom) {
|
|
15972
|
-
// A single cell. If it's only the title, the dataset is not added.
|
|
15973
|
-
if (!dataSetsHaveTitle) {
|
|
15974
|
-
dataSets.push(createDataSet(getters, dataSetSheetId, zone, undefined));
|
|
15975
|
-
}
|
|
15976
|
-
}
|
|
15977
15975
|
else {
|
|
15978
|
-
/* 1 row or 1 column */
|
|
15976
|
+
/* 1 cell, 1 row or 1 column */
|
|
15979
15977
|
dataSets.push(createDataSet(getters, dataSetSheetId, zone, dataSetsHaveTitle
|
|
15980
15978
|
? {
|
|
15981
15979
|
top: zone.top,
|
|
@@ -16024,8 +16022,10 @@
|
|
|
16024
16022
|
}
|
|
16025
16023
|
const dataRange = ds.dataRange.clone({ zone: dataZone });
|
|
16026
16024
|
return {
|
|
16027
|
-
label: ds.labelCell
|
|
16028
|
-
|
|
16025
|
+
label: ds.labelCell
|
|
16026
|
+
? getters.getRangeString(ds.labelCell, "forceSheetReference", true)
|
|
16027
|
+
: undefined,
|
|
16028
|
+
range: getters.getRangeString(dataRange, "forceSheetReference", true),
|
|
16029
16029
|
};
|
|
16030
16030
|
}
|
|
16031
16031
|
function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
@@ -16038,7 +16038,7 @@
|
|
|
16038
16038
|
zone.top = zone.top + 1;
|
|
16039
16039
|
}
|
|
16040
16040
|
const range = labelRange.clone({ zone });
|
|
16041
|
-
return getters.getRangeString(range, "forceSheetReference");
|
|
16041
|
+
return getters.getRangeString(range, "forceSheetReference", true);
|
|
16042
16042
|
}
|
|
16043
16043
|
/**
|
|
16044
16044
|
* Transform a chart definition which supports dataSets (dataSets and LabelRange)
|
|
@@ -16104,11 +16104,11 @@
|
|
|
16104
16104
|
if (definition.dataSets) {
|
|
16105
16105
|
const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
|
|
16106
16106
|
if (invalidRanges) {
|
|
16107
|
-
return
|
|
16107
|
+
return 35 /* CommandResult.InvalidDataSet */;
|
|
16108
16108
|
}
|
|
16109
16109
|
const zones = definition.dataSets.map(toUnboundedZone);
|
|
16110
16110
|
if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
|
|
16111
|
-
return
|
|
16111
|
+
return 35 /* CommandResult.InvalidDataSet */;
|
|
16112
16112
|
}
|
|
16113
16113
|
}
|
|
16114
16114
|
return 0 /* CommandResult.Success */;
|
|
@@ -16117,7 +16117,7 @@
|
|
|
16117
16117
|
if (definition.labelRange) {
|
|
16118
16118
|
const invalidLabels = !rangeReference.test(definition.labelRange || "");
|
|
16119
16119
|
if (invalidLabels) {
|
|
16120
|
-
return
|
|
16120
|
+
return 36 /* CommandResult.InvalidLabelRange */;
|
|
16121
16121
|
}
|
|
16122
16122
|
}
|
|
16123
16123
|
return 0 /* CommandResult.Success */;
|
|
@@ -16204,22 +16204,22 @@
|
|
|
16204
16204
|
const CfTerms = {
|
|
16205
16205
|
Errors: {
|
|
16206
16206
|
[26 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
|
|
16207
|
-
[
|
|
16208
|
-
[
|
|
16209
|
-
[
|
|
16210
|
-
[
|
|
16211
|
-
[
|
|
16212
|
-
[
|
|
16213
|
-
[
|
|
16214
|
-
[
|
|
16215
|
-
[
|
|
16216
|
-
[
|
|
16217
|
-
[
|
|
16218
|
-
[
|
|
16219
|
-
[
|
|
16220
|
-
[
|
|
16221
|
-
[
|
|
16222
|
-
[
|
|
16207
|
+
[54 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
|
|
16208
|
+
[55 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
|
|
16209
|
+
[56 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
|
|
16210
|
+
[57 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
|
|
16211
|
+
[58 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
|
|
16212
|
+
[59 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
|
|
16213
|
+
[60 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
|
|
16214
|
+
[50 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
|
|
16215
|
+
[53 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
|
|
16216
|
+
[52 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
|
|
16217
|
+
[51 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
|
|
16218
|
+
[61 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
|
|
16219
|
+
[63 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
|
|
16220
|
+
[62 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
|
|
16221
|
+
[64 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
|
|
16222
|
+
[65 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
|
|
16223
16223
|
[25 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
|
|
16224
16224
|
Unexpected: _lt("The rule is invalid for an unknown reason"),
|
|
16225
16225
|
},
|
|
@@ -16247,20 +16247,20 @@
|
|
|
16247
16247
|
Errors: {
|
|
16248
16248
|
Unexpected: _lt("The chart definition is invalid for an unknown reason"),
|
|
16249
16249
|
// BASIC CHART ERRORS (LINE | BAR | PIE)
|
|
16250
|
-
[
|
|
16251
|
-
[
|
|
16250
|
+
[35 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
|
|
16251
|
+
[36 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
|
|
16252
16252
|
// SCORECARD CHART ERRORS
|
|
16253
|
-
[
|
|
16254
|
-
[
|
|
16253
|
+
[37 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
|
|
16254
|
+
[38 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
|
|
16255
16255
|
// GAUGE CHART ERRORS
|
|
16256
|
-
[
|
|
16257
|
-
[
|
|
16258
|
-
[
|
|
16259
|
-
[
|
|
16260
|
-
[
|
|
16261
|
-
[
|
|
16262
|
-
[
|
|
16263
|
-
[
|
|
16256
|
+
[39 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
|
|
16257
|
+
[40 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
|
|
16258
|
+
[41 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
|
|
16259
|
+
[42 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
|
|
16260
|
+
[43 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
|
|
16261
|
+
[44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
|
|
16262
|
+
[45 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
|
|
16263
|
+
[46 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
|
|
16264
16264
|
},
|
|
16265
16265
|
};
|
|
16266
16266
|
const CustomCurrencyTerms = {
|
|
@@ -16270,9 +16270,9 @@
|
|
|
16270
16270
|
const SplitToColumnsTerms = {
|
|
16271
16271
|
Errors: {
|
|
16272
16272
|
Unexpected: _lt("Cannot split the selection for an unknown reason"),
|
|
16273
|
-
[
|
|
16274
|
-
[
|
|
16275
|
-
[
|
|
16273
|
+
[94 /* CommandResult.NoSplitSeparatorInSelection */]: _lt("There is no match for the selected separator in the selection"),
|
|
16274
|
+
[91 /* CommandResult.MoreThanOneColumnSelected */]: _lt("Only a selection from a single column can be split"),
|
|
16275
|
+
[93 /* CommandResult.SplitWillOverwriteContent */]: _lt("Splitting will overwrite existing content"),
|
|
16276
16276
|
},
|
|
16277
16277
|
};
|
|
16278
16278
|
|
|
@@ -16575,7 +16575,7 @@
|
|
|
16575
16575
|
return undefined;
|
|
16576
16576
|
const dataSets = this.dataSets
|
|
16577
16577
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
16578
|
-
.filter((ds) => ds.range !== ""
|
|
16578
|
+
.filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
|
|
16579
16579
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
16580
16580
|
return {
|
|
16581
16581
|
...this.getDefinition(),
|
|
@@ -16677,7 +16677,7 @@
|
|
|
16677
16677
|
|
|
16678
16678
|
function isDataRangeValid(definition) {
|
|
16679
16679
|
return definition.dataRange && !rangeReference.test(definition.dataRange)
|
|
16680
|
-
?
|
|
16680
|
+
? 39 /* CommandResult.InvalidGaugeDataRange */
|
|
16681
16681
|
: 0 /* CommandResult.Success */;
|
|
16682
16682
|
}
|
|
16683
16683
|
function checkRangeLimits(check, batchValidations) {
|
|
@@ -16709,7 +16709,7 @@
|
|
|
16709
16709
|
function checkRangeMinBiggerThanRangeMax(definition) {
|
|
16710
16710
|
if (definition.sectionRule) {
|
|
16711
16711
|
if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
|
|
16712
|
-
return
|
|
16712
|
+
return 44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
|
|
16713
16713
|
}
|
|
16714
16714
|
}
|
|
16715
16715
|
return 0 /* CommandResult.Success */;
|
|
@@ -16718,9 +16718,9 @@
|
|
|
16718
16718
|
if (value === "") {
|
|
16719
16719
|
switch (valueName) {
|
|
16720
16720
|
case "rangeMin":
|
|
16721
|
-
return
|
|
16721
|
+
return 40 /* CommandResult.EmptyGaugeRangeMin */;
|
|
16722
16722
|
case "rangeMax":
|
|
16723
|
-
return
|
|
16723
|
+
return 42 /* CommandResult.EmptyGaugeRangeMax */;
|
|
16724
16724
|
}
|
|
16725
16725
|
}
|
|
16726
16726
|
return 0 /* CommandResult.Success */;
|
|
@@ -16729,13 +16729,13 @@
|
|
|
16729
16729
|
if (isNaN(value)) {
|
|
16730
16730
|
switch (valueName) {
|
|
16731
16731
|
case "rangeMin":
|
|
16732
|
-
return
|
|
16732
|
+
return 41 /* CommandResult.GaugeRangeMinNaN */;
|
|
16733
16733
|
case "rangeMax":
|
|
16734
|
-
return
|
|
16734
|
+
return 43 /* CommandResult.GaugeRangeMaxNaN */;
|
|
16735
16735
|
case "lowerInflectionPointValue":
|
|
16736
|
-
return
|
|
16736
|
+
return 45 /* CommandResult.GaugeLowerInflectionPointNaN */;
|
|
16737
16737
|
case "upperInflectionPointValue":
|
|
16738
|
-
return
|
|
16738
|
+
return 46 /* CommandResult.GaugeUpperInflectionPointNaN */;
|
|
16739
16739
|
}
|
|
16740
16740
|
}
|
|
16741
16741
|
return 0 /* CommandResult.Success */;
|
|
@@ -17163,7 +17163,7 @@
|
|
|
17163
17163
|
return undefined;
|
|
17164
17164
|
const dataSets = this.dataSets
|
|
17165
17165
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
17166
|
-
.filter((ds) => ds.range !== ""
|
|
17166
|
+
.filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
|
|
17167
17167
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
17168
17168
|
return {
|
|
17169
17169
|
...this.getDefinition(),
|
|
@@ -17450,7 +17450,7 @@
|
|
|
17450
17450
|
return undefined;
|
|
17451
17451
|
const dataSets = this.dataSets
|
|
17452
17452
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
17453
|
-
.filter((ds) => ds.range !== ""
|
|
17453
|
+
.filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
|
|
17454
17454
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
17455
17455
|
return {
|
|
17456
17456
|
...this.getDefinition(),
|
|
@@ -17531,12 +17531,12 @@
|
|
|
17531
17531
|
|
|
17532
17532
|
function checkKeyValue(definition) {
|
|
17533
17533
|
return definition.keyValue && !rangeReference.test(definition.keyValue)
|
|
17534
|
-
?
|
|
17534
|
+
? 37 /* CommandResult.InvalidScorecardKeyValue */
|
|
17535
17535
|
: 0 /* CommandResult.Success */;
|
|
17536
17536
|
}
|
|
17537
17537
|
function checkBaseline(definition) {
|
|
17538
17538
|
return definition.baseline && !rangeReference.test(definition.baseline)
|
|
17539
|
-
?
|
|
17539
|
+
? 38 /* CommandResult.InvalidScorecardBaseline */
|
|
17540
17540
|
: 0 /* CommandResult.Success */;
|
|
17541
17541
|
}
|
|
17542
17542
|
class ScorecardChart extends AbstractChart {
|
|
@@ -18063,7 +18063,7 @@
|
|
|
18063
18063
|
};
|
|
18064
18064
|
function interactiveAddMerge(env, sheetId, target) {
|
|
18065
18065
|
const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
|
|
18066
|
-
if (result.isCancelledBecause(
|
|
18066
|
+
if (result.isCancelledBecause(83 /* CommandResult.MergeInFilter */)) {
|
|
18067
18067
|
env.raiseError(AddMergeInteractiveContent.MergeInFilter);
|
|
18068
18068
|
}
|
|
18069
18069
|
else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
|
|
@@ -18090,7 +18090,7 @@
|
|
|
18090
18090
|
else if (result.reasons.includes(23 /* CommandResult.WrongFigurePasteOption */)) {
|
|
18091
18091
|
env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
|
|
18092
18092
|
}
|
|
18093
|
-
else if (result.reasons.includes(
|
|
18093
|
+
else if (result.reasons.includes(78 /* CommandResult.FrozenPaneOverlap */)) {
|
|
18094
18094
|
env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
|
|
18095
18095
|
}
|
|
18096
18096
|
}
|
|
@@ -19265,7 +19265,7 @@
|
|
|
19265
19265
|
});
|
|
19266
19266
|
}
|
|
19267
19267
|
}
|
|
19268
|
-
if (result.isCancelledBecause(
|
|
19268
|
+
if (result.isCancelledBecause(66 /* CommandResult.InvalidSortZone */)) {
|
|
19269
19269
|
const { col, row } = anchor;
|
|
19270
19270
|
env.model.selection.selectZone({ cell: { col, row }, zone });
|
|
19271
19271
|
env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
|
|
@@ -19279,13 +19279,13 @@
|
|
|
19279
19279
|
};
|
|
19280
19280
|
function interactiveAddFilter(env, sheetId, target) {
|
|
19281
19281
|
const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
|
|
19282
|
-
if (result.isCancelledBecause(
|
|
19282
|
+
if (result.isCancelledBecause(81 /* CommandResult.FilterOverlap */)) {
|
|
19283
19283
|
env.raiseError(AddFilterInteractiveContent.filterOverlap);
|
|
19284
19284
|
}
|
|
19285
|
-
else if (result.isCancelledBecause(
|
|
19285
|
+
else if (result.isCancelledBecause(83 /* CommandResult.MergeInFilter */)) {
|
|
19286
19286
|
env.raiseError(AddFilterInteractiveContent.mergeInFilter);
|
|
19287
19287
|
}
|
|
19288
|
-
else if (result.isCancelledBecause(
|
|
19288
|
+
else if (result.isCancelledBecause(84 /* CommandResult.NonContinuousTargets */)) {
|
|
19289
19289
|
env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
|
|
19290
19290
|
}
|
|
19291
19291
|
}
|
|
@@ -19722,7 +19722,7 @@
|
|
|
19722
19722
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
19723
19723
|
const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
|
|
19724
19724
|
const result = env.model.dispatch(cmd, { sheetId, quantity: base });
|
|
19725
|
-
if (result.isCancelledBecause(
|
|
19725
|
+
if (result.isCancelledBecause(68 /* CommandResult.MergeOverlap */)) {
|
|
19726
19726
|
env.raiseError(MergeErrorMessage);
|
|
19727
19727
|
}
|
|
19728
19728
|
}
|
|
@@ -20862,10 +20862,10 @@
|
|
|
20862
20862
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
20863
20863
|
}
|
|
20864
20864
|
get isDatasetInvalid() {
|
|
20865
|
-
return !!this.state.datasetDispatchResult?.isCancelledBecause(
|
|
20865
|
+
return !!this.state.datasetDispatchResult?.isCancelledBecause(35 /* CommandResult.InvalidDataSet */);
|
|
20866
20866
|
}
|
|
20867
20867
|
get isLabelInvalid() {
|
|
20868
|
-
return !!this.state.labelsDispatchResult?.isCancelledBecause(
|
|
20868
|
+
return !!this.state.labelsDispatchResult?.isCancelledBecause(36 /* CommandResult.InvalidLabelRange */);
|
|
20869
20869
|
}
|
|
20870
20870
|
onUpdateDataSetsHaveTitle(ev) {
|
|
20871
20871
|
this.props.updateChart(this.props.figureId, {
|
|
@@ -21539,7 +21539,7 @@
|
|
|
21539
21539
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
21540
21540
|
}
|
|
21541
21541
|
get isDataRangeInvalid() {
|
|
21542
|
-
return !!this.state.dataRangeDispatchResult?.isCancelledBecause(
|
|
21542
|
+
return !!this.state.dataRangeDispatchResult?.isCancelledBecause(39 /* CommandResult.InvalidGaugeDataRange */);
|
|
21543
21543
|
}
|
|
21544
21544
|
onDataRangeChanged(ranges) {
|
|
21545
21545
|
this.dataRange = ranges[0];
|
|
@@ -21623,25 +21623,25 @@
|
|
|
21623
21623
|
});
|
|
21624
21624
|
}
|
|
21625
21625
|
isRangeMinInvalid() {
|
|
21626
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
21627
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
21628
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
21626
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMin */) ||
|
|
21627
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(41 /* CommandResult.GaugeRangeMinNaN */) ||
|
|
21628
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
|
|
21629
21629
|
}
|
|
21630
21630
|
isRangeMaxInvalid() {
|
|
21631
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
21632
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
21633
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
21631
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(42 /* CommandResult.EmptyGaugeRangeMax */) ||
|
|
21632
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(43 /* CommandResult.GaugeRangeMaxNaN */) ||
|
|
21633
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
|
|
21634
21634
|
}
|
|
21635
21635
|
// ---------------------------------------------------------------------------
|
|
21636
21636
|
// COLOR_SECTION_TEMPLATE
|
|
21637
21637
|
// ---------------------------------------------------------------------------
|
|
21638
21638
|
get isLowerInflectionPointInvalid() {
|
|
21639
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
21640
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
21639
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(45 /* CommandResult.GaugeLowerInflectionPointNaN */) ||
|
|
21640
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(47 /* CommandResult.GaugeLowerBiggerThanUpper */));
|
|
21641
21641
|
}
|
|
21642
21642
|
get isUpperInflectionPointInvalid() {
|
|
21643
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
21644
|
-
this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
21643
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(46 /* CommandResult.GaugeUpperInflectionPointNaN */) ||
|
|
21644
|
+
this.state.sectionRuleDispatchResult?.isCancelledBecause(47 /* CommandResult.GaugeLowerBiggerThanUpper */));
|
|
21645
21645
|
}
|
|
21646
21646
|
updateSectionColor(target, color) {
|
|
21647
21647
|
const sectionRule = deepCopy(this.state.sectionRule);
|
|
@@ -21729,10 +21729,10 @@
|
|
|
21729
21729
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
21730
21730
|
}
|
|
21731
21731
|
get isKeyValueInvalid() {
|
|
21732
|
-
return !!this.state.keyValueDispatchResult?.isCancelledBecause(
|
|
21732
|
+
return !!this.state.keyValueDispatchResult?.isCancelledBecause(37 /* CommandResult.InvalidScorecardKeyValue */);
|
|
21733
21733
|
}
|
|
21734
21734
|
get isBaselineInvalid() {
|
|
21735
|
-
return !!this.state.keyValueDispatchResult?.isCancelledBecause(
|
|
21735
|
+
return !!this.state.keyValueDispatchResult?.isCancelledBecause(38 /* CommandResult.InvalidScorecardBaseline */);
|
|
21736
21736
|
}
|
|
21737
21737
|
onKeyValueRangeChanged(ranges) {
|
|
21738
21738
|
this.keyValue = ranges[0];
|
|
@@ -22627,10 +22627,10 @@
|
|
|
22627
22627
|
* Cell Is Rule
|
|
22628
22628
|
****************************************************************************/
|
|
22629
22629
|
get isValue1Invalid() {
|
|
22630
|
-
return !!this.state.errors?.includes(
|
|
22630
|
+
return !!this.state.errors?.includes(54 /* CommandResult.FirstArgMissing */);
|
|
22631
22631
|
}
|
|
22632
22632
|
get isValue2Invalid() {
|
|
22633
|
-
return !!this.state.errors?.includes(
|
|
22633
|
+
return !!this.state.errors?.includes(55 /* CommandResult.SecondArgMissing */);
|
|
22634
22634
|
}
|
|
22635
22635
|
toggleStyle(tool) {
|
|
22636
22636
|
const style = this.state.rules.cellIs.style;
|
|
@@ -22647,17 +22647,17 @@
|
|
|
22647
22647
|
isValueInvalid(threshold) {
|
|
22648
22648
|
switch (threshold) {
|
|
22649
22649
|
case "minimum":
|
|
22650
|
-
return (this.state.errors.includes(
|
|
22651
|
-
this.state.errors.includes(
|
|
22652
|
-
this.state.errors.includes(
|
|
22653
|
-
this.state.errors.includes(
|
|
22650
|
+
return (this.state.errors.includes(61 /* CommandResult.MinInvalidFormula */) ||
|
|
22651
|
+
this.state.errors.includes(53 /* CommandResult.MinBiggerThanMid */) ||
|
|
22652
|
+
this.state.errors.includes(50 /* CommandResult.MinBiggerThanMax */) ||
|
|
22653
|
+
this.state.errors.includes(56 /* CommandResult.MinNaN */));
|
|
22654
22654
|
case "midpoint":
|
|
22655
|
-
return (this.state.errors.includes(
|
|
22656
|
-
this.state.errors.includes(
|
|
22657
|
-
this.state.errors.includes(
|
|
22655
|
+
return (this.state.errors.includes(62 /* CommandResult.MidInvalidFormula */) ||
|
|
22656
|
+
this.state.errors.includes(57 /* CommandResult.MidNaN */) ||
|
|
22657
|
+
this.state.errors.includes(52 /* CommandResult.MidBiggerThanMax */));
|
|
22658
22658
|
case "maximum":
|
|
22659
|
-
return (this.state.errors.includes(
|
|
22660
|
-
this.state.errors.includes(
|
|
22659
|
+
return (this.state.errors.includes(63 /* CommandResult.MaxInvalidFormula */) ||
|
|
22660
|
+
this.state.errors.includes(58 /* CommandResult.MaxNaN */));
|
|
22661
22661
|
default:
|
|
22662
22662
|
return false;
|
|
22663
22663
|
}
|
|
@@ -22705,13 +22705,13 @@
|
|
|
22705
22705
|
isInflectionPointInvalid(inflectionPoint) {
|
|
22706
22706
|
switch (inflectionPoint) {
|
|
22707
22707
|
case "lowerInflectionPoint":
|
|
22708
|
-
return (this.state.errors.includes(
|
|
22709
|
-
this.state.errors.includes(
|
|
22710
|
-
this.state.errors.includes(
|
|
22708
|
+
return (this.state.errors.includes(60 /* CommandResult.ValueLowerInflectionNaN */) ||
|
|
22709
|
+
this.state.errors.includes(65 /* CommandResult.ValueLowerInvalidFormula */) ||
|
|
22710
|
+
this.state.errors.includes(51 /* CommandResult.LowerBiggerThanUpper */));
|
|
22711
22711
|
case "upperInflectionPoint":
|
|
22712
|
-
return (this.state.errors.includes(
|
|
22713
|
-
this.state.errors.includes(
|
|
22714
|
-
this.state.errors.includes(
|
|
22712
|
+
return (this.state.errors.includes(59 /* CommandResult.ValueUpperInflectionNaN */) ||
|
|
22713
|
+
this.state.errors.includes(64 /* CommandResult.ValueUpperInvalidFormula */) ||
|
|
22714
|
+
this.state.errors.includes(51 /* CommandResult.LowerBiggerThanUpper */));
|
|
22715
22715
|
default:
|
|
22716
22716
|
return true;
|
|
22717
22717
|
}
|
|
@@ -23074,7 +23074,7 @@
|
|
|
23074
23074
|
};
|
|
23075
23075
|
function interactiveSplitToColumns(env, separator, addNewColumns) {
|
|
23076
23076
|
let result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", { separator, addNewColumns });
|
|
23077
|
-
if (result.isCancelledBecause(
|
|
23077
|
+
if (result.isCancelledBecause(93 /* CommandResult.SplitWillOverwriteContent */)) {
|
|
23078
23078
|
env.askConfirmation(SplitToColumnsInteractiveContent.SplitIsDestructive, () => {
|
|
23079
23079
|
result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", {
|
|
23080
23080
|
separator,
|
|
@@ -23138,8 +23138,8 @@
|
|
|
23138
23138
|
const errors = new Set();
|
|
23139
23139
|
for (const reason of cancelledReasons) {
|
|
23140
23140
|
switch (reason) {
|
|
23141
|
-
case
|
|
23142
|
-
case
|
|
23141
|
+
case 93 /* CommandResult.SplitWillOverwriteContent */:
|
|
23142
|
+
case 92 /* CommandResult.EmptySplitSeparator */:
|
|
23143
23143
|
break;
|
|
23144
23144
|
default:
|
|
23145
23145
|
errors.add(SplitToColumnsTerms.Errors[reason] || SplitToColumnsTerms.Errors.Unexpected);
|
|
@@ -23154,8 +23154,8 @@
|
|
|
23154
23154
|
addNewColumns: this.state.addNewColumns,
|
|
23155
23155
|
force: false,
|
|
23156
23156
|
}).reasons;
|
|
23157
|
-
if (cancelledReasons.includes(
|
|
23158
|
-
warnings.push(SplitToColumnsTerms.Errors[
|
|
23157
|
+
if (cancelledReasons.includes(93 /* CommandResult.SplitWillOverwriteContent */)) {
|
|
23158
|
+
warnings.push(SplitToColumnsTerms.Errors[93 /* CommandResult.SplitWillOverwriteContent */]);
|
|
23159
23159
|
}
|
|
23160
23160
|
return warnings;
|
|
23161
23161
|
}
|
|
@@ -24375,6 +24375,9 @@
|
|
|
24375
24375
|
const token = tokens.filter((token) => token.value.includes(currentSelectedText) &&
|
|
24376
24376
|
token.start <= currentSelection.start &&
|
|
24377
24377
|
token.end >= currentSelection.end)[0];
|
|
24378
|
+
if (!token) {
|
|
24379
|
+
return;
|
|
24380
|
+
}
|
|
24378
24381
|
if (token.type === "REFERENCE") {
|
|
24379
24382
|
this.env.model.dispatch("CHANGE_COMPOSER_CURSOR_SELECTION", {
|
|
24380
24383
|
start: token.start,
|
|
@@ -31679,7 +31682,7 @@
|
|
|
31679
31682
|
const currentBorder = this.getCellBorder(cmd);
|
|
31680
31683
|
const areAllNewBordersUndefined = !cmd.border?.bottom && !cmd.border?.left && !cmd.border?.right && !cmd.border?.top;
|
|
31681
31684
|
if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
|
|
31682
|
-
return
|
|
31685
|
+
return 98 /* CommandResult.NoChanges */;
|
|
31683
31686
|
}
|
|
31684
31687
|
return 0 /* CommandResult.Success */;
|
|
31685
31688
|
}
|
|
@@ -31924,6 +31927,10 @@
|
|
|
31924
31927
|
format: cell.format ? getItemId(cell.format, formats) : undefined,
|
|
31925
31928
|
content: cell.content || undefined,
|
|
31926
31929
|
};
|
|
31930
|
+
// if there is a formula but no dependencies (maybe because the cell is in error), no need to recompute the formula text
|
|
31931
|
+
if (cell.isFormula && cell.dependencies.length) {
|
|
31932
|
+
cells[xc].content = this.buildFormulaContent(_sheet.id, cell, cell.dependencies, true);
|
|
31933
|
+
}
|
|
31927
31934
|
}
|
|
31928
31935
|
_sheet.cells = cells;
|
|
31929
31936
|
}
|
|
@@ -31958,13 +31965,13 @@
|
|
|
31958
31965
|
/*
|
|
31959
31966
|
* Reconstructs the original formula string based on a normalized form and its dependencies
|
|
31960
31967
|
*/
|
|
31961
|
-
buildFormulaContent(sheetId, cell, dependencies) {
|
|
31968
|
+
buildFormulaContent(sheetId, cell, dependencies, useFixedZone = false) {
|
|
31962
31969
|
const ranges = dependencies || cell.dependencies;
|
|
31963
31970
|
let rangeIndex = 0;
|
|
31964
31971
|
return concat(cell.compiledFormula.tokens.map((token) => {
|
|
31965
31972
|
if (token.type === "REFERENCE") {
|
|
31966
31973
|
const range = ranges[rangeIndex++];
|
|
31967
|
-
return this.getters.getRangeString(range, sheetId);
|
|
31974
|
+
return this.getters.getRangeString(range, sheetId, useFixedZone);
|
|
31968
31975
|
}
|
|
31969
31976
|
return token.value;
|
|
31970
31977
|
}));
|
|
@@ -32190,9 +32197,9 @@
|
|
|
32190
32197
|
checkUselessClearCell(cmd) {
|
|
32191
32198
|
const cell = this.getters.getCell(cmd);
|
|
32192
32199
|
if (!cell)
|
|
32193
|
-
return
|
|
32200
|
+
return 98 /* CommandResult.NoChanges */;
|
|
32194
32201
|
if (!cell.content && !cell.style && !cell.format) {
|
|
32195
|
-
return
|
|
32202
|
+
return 98 /* CommandResult.NoChanges */;
|
|
32196
32203
|
}
|
|
32197
32204
|
return 0 /* CommandResult.Success */;
|
|
32198
32205
|
}
|
|
@@ -32417,13 +32424,13 @@
|
|
|
32417
32424
|
}
|
|
32418
32425
|
checkChartDuplicate(cmd) {
|
|
32419
32426
|
return this.getters.getFigureSheetId(cmd.id)
|
|
32420
|
-
?
|
|
32427
|
+
? 87 /* CommandResult.DuplicatedChartId */
|
|
32421
32428
|
: 0 /* CommandResult.Success */;
|
|
32422
32429
|
}
|
|
32423
32430
|
checkChartExists(cmd) {
|
|
32424
32431
|
return this.getters.getFigureSheetId(cmd.id)
|
|
32425
32432
|
? 0 /* CommandResult.Success */
|
|
32426
|
-
:
|
|
32433
|
+
: 88 /* CommandResult.ChartDoesNotExist */;
|
|
32427
32434
|
}
|
|
32428
32435
|
}
|
|
32429
32436
|
|
|
@@ -32533,7 +32540,13 @@
|
|
|
32533
32540
|
}
|
|
32534
32541
|
}
|
|
32535
32542
|
exportForExcel(data) {
|
|
32536
|
-
|
|
32543
|
+
if (data.sheets) {
|
|
32544
|
+
for (let sheet of data.sheets) {
|
|
32545
|
+
if (this.cfRules[sheet.id]) {
|
|
32546
|
+
sheet.conditionalFormats = this.cfRules[sheet.id].map((rule) => this.mapToConditionalFormat(sheet.id, rule, { useFixedReference: true }));
|
|
32547
|
+
}
|
|
32548
|
+
}
|
|
32549
|
+
}
|
|
32537
32550
|
}
|
|
32538
32551
|
// ---------------------------------------------------------------------------
|
|
32539
32552
|
// Getters
|
|
@@ -32598,11 +32611,11 @@
|
|
|
32598
32611
|
// ---------------------------------------------------------------------------
|
|
32599
32612
|
// Private
|
|
32600
32613
|
// ---------------------------------------------------------------------------
|
|
32601
|
-
mapToConditionalFormat(sheetId, cf) {
|
|
32614
|
+
mapToConditionalFormat(sheetId, cf, options = { useFixedReference: false }) {
|
|
32602
32615
|
return {
|
|
32603
32616
|
...cf,
|
|
32604
32617
|
ranges: cf.ranges.map((range) => {
|
|
32605
|
-
return this.getters.getRangeString(range, sheetId);
|
|
32618
|
+
return this.getters.getRangeString(range, sheetId, options.useFixedReference);
|
|
32606
32619
|
}),
|
|
32607
32620
|
};
|
|
32608
32621
|
}
|
|
@@ -32635,10 +32648,10 @@
|
|
|
32635
32648
|
return 28 /* CommandResult.InvalidSheetId */;
|
|
32636
32649
|
const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
|
|
32637
32650
|
if (ruleIndex === -1)
|
|
32638
|
-
return
|
|
32651
|
+
return 74 /* CommandResult.InvalidConditionalFormatId */;
|
|
32639
32652
|
const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
|
|
32640
32653
|
if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
|
|
32641
|
-
return
|
|
32654
|
+
return 74 /* CommandResult.InvalidConditionalFormatId */;
|
|
32642
32655
|
}
|
|
32643
32656
|
return 0 /* CommandResult.Success */;
|
|
32644
32657
|
}
|
|
@@ -32679,10 +32692,10 @@
|
|
|
32679
32692
|
const errors = [];
|
|
32680
32693
|
const isEmpty = (value) => value === undefined || value === "";
|
|
32681
32694
|
if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
|
|
32682
|
-
errors.push(
|
|
32695
|
+
errors.push(54 /* CommandResult.FirstArgMissing */);
|
|
32683
32696
|
}
|
|
32684
32697
|
if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
|
|
32685
|
-
errors.push(
|
|
32698
|
+
errors.push(55 /* CommandResult.SecondArgMissing */);
|
|
32686
32699
|
}
|
|
32687
32700
|
return errors.length ? errors : 0 /* CommandResult.Success */;
|
|
32688
32701
|
}
|
|
@@ -32694,15 +32707,15 @@
|
|
|
32694
32707
|
(threshold.value === "" || isNaN(threshold.value))) {
|
|
32695
32708
|
switch (thresholdName) {
|
|
32696
32709
|
case "min":
|
|
32697
|
-
return
|
|
32710
|
+
return 56 /* CommandResult.MinNaN */;
|
|
32698
32711
|
case "max":
|
|
32699
|
-
return
|
|
32712
|
+
return 58 /* CommandResult.MaxNaN */;
|
|
32700
32713
|
case "mid":
|
|
32701
|
-
return
|
|
32714
|
+
return 57 /* CommandResult.MidNaN */;
|
|
32702
32715
|
case "upperInflectionPoint":
|
|
32703
|
-
return
|
|
32716
|
+
return 59 /* CommandResult.ValueUpperInflectionNaN */;
|
|
32704
32717
|
case "lowerInflectionPoint":
|
|
32705
|
-
return
|
|
32718
|
+
return 60 /* CommandResult.ValueLowerInflectionNaN */;
|
|
32706
32719
|
}
|
|
32707
32720
|
}
|
|
32708
32721
|
return 0 /* CommandResult.Success */;
|
|
@@ -32716,15 +32729,15 @@
|
|
|
32716
32729
|
catch (error) {
|
|
32717
32730
|
switch (thresholdName) {
|
|
32718
32731
|
case "min":
|
|
32719
|
-
return
|
|
32732
|
+
return 61 /* CommandResult.MinInvalidFormula */;
|
|
32720
32733
|
case "max":
|
|
32721
|
-
return
|
|
32734
|
+
return 63 /* CommandResult.MaxInvalidFormula */;
|
|
32722
32735
|
case "mid":
|
|
32723
|
-
return
|
|
32736
|
+
return 62 /* CommandResult.MidInvalidFormula */;
|
|
32724
32737
|
case "upperInflectionPoint":
|
|
32725
|
-
return
|
|
32738
|
+
return 64 /* CommandResult.ValueUpperInvalidFormula */;
|
|
32726
32739
|
case "lowerInflectionPoint":
|
|
32727
|
-
return
|
|
32740
|
+
return 65 /* CommandResult.ValueLowerInvalidFormula */;
|
|
32728
32741
|
}
|
|
32729
32742
|
}
|
|
32730
32743
|
return 0 /* CommandResult.Success */;
|
|
@@ -32741,7 +32754,7 @@
|
|
|
32741
32754
|
if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
|
|
32742
32755
|
rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
|
|
32743
32756
|
Number(minValue) > Number(maxValue)) {
|
|
32744
|
-
return
|
|
32757
|
+
return 51 /* CommandResult.LowerBiggerThanUpper */;
|
|
32745
32758
|
}
|
|
32746
32759
|
return 0 /* CommandResult.Success */;
|
|
32747
32760
|
}
|
|
@@ -32751,7 +32764,7 @@
|
|
|
32751
32764
|
if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
|
|
32752
32765
|
rule.minimum.type === rule.maximum.type &&
|
|
32753
32766
|
stringToNumber(minValue) >= stringToNumber(maxValue)) {
|
|
32754
|
-
return
|
|
32767
|
+
return 50 /* CommandResult.MinBiggerThanMax */;
|
|
32755
32768
|
}
|
|
32756
32769
|
return 0 /* CommandResult.Success */;
|
|
32757
32770
|
}
|
|
@@ -32762,7 +32775,7 @@
|
|
|
32762
32775
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
32763
32776
|
rule.midpoint.type === rule.maximum.type &&
|
|
32764
32777
|
stringToNumber(midValue) >= stringToNumber(maxValue)) {
|
|
32765
|
-
return
|
|
32778
|
+
return 52 /* CommandResult.MidBiggerThanMax */;
|
|
32766
32779
|
}
|
|
32767
32780
|
return 0 /* CommandResult.Success */;
|
|
32768
32781
|
}
|
|
@@ -32773,7 +32786,7 @@
|
|
|
32773
32786
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
32774
32787
|
rule.minimum.type === rule.midpoint.type &&
|
|
32775
32788
|
stringToNumber(minValue) >= stringToNumber(midValue)) {
|
|
32776
|
-
return
|
|
32789
|
+
return 53 /* CommandResult.MinBiggerThanMid */;
|
|
32777
32790
|
}
|
|
32778
32791
|
return 0 /* CommandResult.Success */;
|
|
32779
32792
|
}
|
|
@@ -32905,13 +32918,13 @@
|
|
|
32905
32918
|
}
|
|
32906
32919
|
checkFigureExists(sheetId, figureId) {
|
|
32907
32920
|
if (this.figures[sheetId]?.[figureId] === undefined) {
|
|
32908
|
-
return
|
|
32921
|
+
return 73 /* CommandResult.FigureDoesNotExist */;
|
|
32909
32922
|
}
|
|
32910
32923
|
return 0 /* CommandResult.Success */;
|
|
32911
32924
|
}
|
|
32912
32925
|
checkFigureDuplicate(figureId) {
|
|
32913
32926
|
if (Object.values(this.figures).find((sheet) => sheet?.[figureId])) {
|
|
32914
|
-
return
|
|
32927
|
+
return 85 /* CommandResult.DuplicatedFigureId */;
|
|
32915
32928
|
}
|
|
32916
32929
|
return 0 /* CommandResult.Success */;
|
|
32917
32930
|
}
|
|
@@ -33023,12 +33036,12 @@
|
|
|
33023
33036
|
switch (cmd.type) {
|
|
33024
33037
|
case "CREATE_FILTER_TABLE":
|
|
33025
33038
|
if (!areZonesContinuous(...cmd.target)) {
|
|
33026
|
-
return
|
|
33039
|
+
return 84 /* CommandResult.NonContinuousTargets */;
|
|
33027
33040
|
}
|
|
33028
33041
|
const zone = union(...cmd.target);
|
|
33029
33042
|
const checkFilterOverlap = () => {
|
|
33030
33043
|
if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
|
|
33031
|
-
return
|
|
33044
|
+
return 81 /* CommandResult.FilterOverlap */;
|
|
33032
33045
|
}
|
|
33033
33046
|
return 0 /* CommandResult.Success */;
|
|
33034
33047
|
};
|
|
@@ -33036,7 +33049,7 @@
|
|
|
33036
33049
|
const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
|
|
33037
33050
|
for (let merge of mergesInTarget) {
|
|
33038
33051
|
if (overlap(zone, merge)) {
|
|
33039
|
-
return
|
|
33052
|
+
return 83 /* CommandResult.MergeInFilter */;
|
|
33040
33053
|
}
|
|
33041
33054
|
}
|
|
33042
33055
|
return 0 /* CommandResult.Success */;
|
|
@@ -33046,7 +33059,7 @@
|
|
|
33046
33059
|
for (let merge of cmd.target) {
|
|
33047
33060
|
for (let filterTable of this.getFilterTables(cmd.sheetId)) {
|
|
33048
33061
|
if (overlap(filterTable.zone, merge)) {
|
|
33049
|
-
return
|
|
33062
|
+
return 83 /* CommandResult.MergeInFilter */;
|
|
33050
33063
|
}
|
|
33051
33064
|
}
|
|
33052
33065
|
}
|
|
@@ -33415,10 +33428,10 @@
|
|
|
33415
33428
|
: this.getters.getNumberRows(cmd.sheetId);
|
|
33416
33429
|
const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
|
|
33417
33430
|
if (hiddenElements.size >= elements) {
|
|
33418
|
-
return
|
|
33431
|
+
return 69 /* CommandResult.TooManyHiddenElements */;
|
|
33419
33432
|
}
|
|
33420
33433
|
else if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
|
|
33421
|
-
return
|
|
33434
|
+
return 89 /* CommandResult.InvalidHeaderIndex */;
|
|
33422
33435
|
}
|
|
33423
33436
|
else {
|
|
33424
33437
|
return 0 /* CommandResult.Success */;
|
|
@@ -33982,7 +33995,7 @@
|
|
|
33982
33995
|
for (const zone of target) {
|
|
33983
33996
|
for (const zone2 of target) {
|
|
33984
33997
|
if (zone !== zone2 && overlap(zone, zone2)) {
|
|
33985
|
-
return
|
|
33998
|
+
return 68 /* CommandResult.MergeOverlap */;
|
|
33986
33999
|
}
|
|
33987
34000
|
}
|
|
33988
34001
|
}
|
|
@@ -33996,7 +34009,7 @@
|
|
|
33996
34009
|
for (const zone of target) {
|
|
33997
34010
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
33998
34011
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
33999
|
-
return
|
|
34012
|
+
return 78 /* CommandResult.FrozenPaneOverlap */;
|
|
34000
34013
|
}
|
|
34001
34014
|
}
|
|
34002
34015
|
return 0 /* CommandResult.Success */;
|
|
@@ -34439,8 +34452,9 @@
|
|
|
34439
34452
|
*
|
|
34440
34453
|
* @param range the range (received from getRangeFromXC or getRangeFromZone)
|
|
34441
34454
|
* @param forSheetId the id of the sheet where the range string is supposed to be used.
|
|
34455
|
+
* @param [useFixedZone=false] if true, the range will be returned with fixed row and column
|
|
34442
34456
|
*/
|
|
34443
|
-
getRangeString(range, forSheetId) {
|
|
34457
|
+
getRangeString(range, forSheetId, useFixedZone = false) {
|
|
34444
34458
|
if (!range) {
|
|
34445
34459
|
return INCORRECT_RANGE_STRING;
|
|
34446
34460
|
}
|
|
@@ -34467,7 +34481,7 @@
|
|
|
34467
34481
|
if (prefixSheet && !sheetName) {
|
|
34468
34482
|
return INCORRECT_RANGE_STRING;
|
|
34469
34483
|
}
|
|
34470
|
-
let rangeString = this.getRangePartString(rangeImpl, 0);
|
|
34484
|
+
let rangeString = this.getRangePartString(rangeImpl, 0, useFixedZone);
|
|
34471
34485
|
if (rangeImpl.parts && rangeImpl.parts.length === 2) {
|
|
34472
34486
|
// this if converts A2:A2 into A2 except if any part of the original range had fixed row or column (with $)
|
|
34473
34487
|
if (rangeImpl.zone.top !== rangeImpl.zone.bottom ||
|
|
@@ -34477,7 +34491,7 @@
|
|
|
34477
34491
|
rangeImpl.parts[1].rowFixed ||
|
|
34478
34492
|
rangeImpl.parts[1].colFixed) {
|
|
34479
34493
|
rangeString += ":";
|
|
34480
|
-
rangeString += this.getRangePartString(rangeImpl, 1);
|
|
34494
|
+
rangeString += this.getRangePartString(rangeImpl, 1, useFixedZone);
|
|
34481
34495
|
}
|
|
34482
34496
|
}
|
|
34483
34497
|
return `${prefixSheet ? sheetName + "!" : ""}${rangeString}`;
|
|
@@ -34518,13 +34532,13 @@
|
|
|
34518
34532
|
/**
|
|
34519
34533
|
* Get a Xc string that represent a part of a range
|
|
34520
34534
|
*/
|
|
34521
|
-
getRangePartString(range, part) {
|
|
34535
|
+
getRangePartString(range, part, useFixedZone = false) {
|
|
34522
34536
|
const colFixed = range.parts && range.parts[part]?.colFixed ? "$" : "";
|
|
34523
34537
|
const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
|
|
34524
34538
|
const rowFixed = range.parts && range.parts[part]?.rowFixed ? "$" : "";
|
|
34525
34539
|
const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
|
|
34526
34540
|
let str = "";
|
|
34527
|
-
if (range.isFullCol) {
|
|
34541
|
+
if (range.isFullCol && !useFixedZone) {
|
|
34528
34542
|
if (part === 0 && range.unboundedZone.hasHeader) {
|
|
34529
34543
|
str = colFixed + col + rowFixed + row;
|
|
34530
34544
|
}
|
|
@@ -34532,7 +34546,7 @@
|
|
|
34532
34546
|
str = colFixed + col;
|
|
34533
34547
|
}
|
|
34534
34548
|
}
|
|
34535
|
-
else if (range.isFullRow) {
|
|
34549
|
+
else if (range.isFullRow && !useFixedZone) {
|
|
34536
34550
|
if (part === 0 && range.unboundedZone.hasHeader) {
|
|
34537
34551
|
str = colFixed + col + rowFixed + row;
|
|
34538
34552
|
}
|
|
@@ -34629,10 +34643,10 @@
|
|
|
34629
34643
|
? this.getNumberCols(cmd.sheetId)
|
|
34630
34644
|
: this.getNumberRows(cmd.sheetId);
|
|
34631
34645
|
if (cmd.base < 0 || cmd.base >= elements) {
|
|
34632
|
-
return
|
|
34646
|
+
return 89 /* CommandResult.InvalidHeaderIndex */;
|
|
34633
34647
|
}
|
|
34634
34648
|
else if (cmd.quantity <= 0) {
|
|
34635
|
-
return
|
|
34649
|
+
return 90 /* CommandResult.InvalidQuantity */;
|
|
34636
34650
|
}
|
|
34637
34651
|
return 0 /* CommandResult.Success */;
|
|
34638
34652
|
case "REMOVE_COLUMNS_ROWS": {
|
|
@@ -34640,7 +34654,7 @@
|
|
|
34640
34654
|
? this.getNumberCols(cmd.sheetId)
|
|
34641
34655
|
: this.getNumberRows(cmd.sheetId);
|
|
34642
34656
|
if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
|
|
34643
|
-
return
|
|
34657
|
+
return 89 /* CommandResult.InvalidHeaderIndex */;
|
|
34644
34658
|
}
|
|
34645
34659
|
else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
|
|
34646
34660
|
return 8 /* CommandResult.NotEnoughElements */;
|
|
@@ -35120,18 +35134,18 @@
|
|
|
35120
35134
|
checkRowFreezeQuantity(cmd) {
|
|
35121
35135
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
|
|
35122
35136
|
? 0 /* CommandResult.Success */
|
|
35123
|
-
:
|
|
35137
|
+
: 77 /* CommandResult.InvalidFreezeQuantity */;
|
|
35124
35138
|
}
|
|
35125
35139
|
checkColFreezeQuantity(cmd) {
|
|
35126
35140
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
|
|
35127
35141
|
? 0 /* CommandResult.Success */
|
|
35128
|
-
:
|
|
35142
|
+
: 77 /* CommandResult.InvalidFreezeQuantity */;
|
|
35129
35143
|
}
|
|
35130
35144
|
checkRowFreezeOverlapMerge(cmd) {
|
|
35131
35145
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
35132
35146
|
for (let merge of merges) {
|
|
35133
35147
|
if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
|
|
35134
|
-
return
|
|
35148
|
+
return 68 /* CommandResult.MergeOverlap */;
|
|
35135
35149
|
}
|
|
35136
35150
|
}
|
|
35137
35151
|
return 0 /* CommandResult.Success */;
|
|
@@ -35140,7 +35154,7 @@
|
|
|
35140
35154
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
35141
35155
|
for (let merge of merges) {
|
|
35142
35156
|
if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
|
|
35143
|
-
return
|
|
35157
|
+
return 68 /* CommandResult.MergeOverlap */;
|
|
35144
35158
|
}
|
|
35145
35159
|
}
|
|
35146
35160
|
return 0 /* CommandResult.Success */;
|
|
@@ -35461,7 +35475,7 @@
|
|
|
35461
35475
|
allowDispatch(cmd) {
|
|
35462
35476
|
switch (cmd.type) {
|
|
35463
35477
|
case "UPDATE_LOCALE":
|
|
35464
|
-
return isValidLocale(cmd.locale) ? 0 /* CommandResult.Success */ :
|
|
35478
|
+
return isValidLocale(cmd.locale) ? 0 /* CommandResult.Success */ : 96 /* CommandResult.InvalidLocale */;
|
|
35465
35479
|
}
|
|
35466
35480
|
return 0 /* CommandResult.Success */;
|
|
35467
35481
|
}
|
|
@@ -35542,22 +35556,17 @@
|
|
|
35542
35556
|
* The `compute` of the formula's function must process it completely
|
|
35543
35557
|
*/
|
|
35544
35558
|
refFn(range, isMeta, functionName, paramNumber) {
|
|
35559
|
+
this.assertRangeValid(range);
|
|
35545
35560
|
if (isMeta) {
|
|
35546
35561
|
// Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
|
|
35547
35562
|
return { value: zoneToXc(range.zone) };
|
|
35548
35563
|
}
|
|
35549
|
-
if (!isZoneValid(range.zone)) {
|
|
35550
|
-
throw new InvalidReferenceError();
|
|
35551
|
-
}
|
|
35552
35564
|
// if the formula definition could have accepted a range, we would pass through the _range function and not here
|
|
35553
35565
|
if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
|
|
35554
35566
|
throw new Error(paramNumber
|
|
35555
35567
|
? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
|
|
35556
35568
|
: _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
|
|
35557
35569
|
}
|
|
35558
|
-
if (range.invalidSheetName) {
|
|
35559
|
-
throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
|
|
35560
|
-
}
|
|
35561
35570
|
return this.readCell(range);
|
|
35562
35571
|
}
|
|
35563
35572
|
readCell(range) {
|
|
@@ -35592,10 +35601,10 @@
|
|
|
35592
35601
|
* Note that each col is possibly sparse: it only contain the values of cells
|
|
35593
35602
|
* that are actually present in the grid.
|
|
35594
35603
|
*/
|
|
35595
|
-
range(
|
|
35596
|
-
|
|
35597
|
-
|
|
35598
|
-
|
|
35604
|
+
range(range) {
|
|
35605
|
+
this.assertRangeValid(range);
|
|
35606
|
+
const sheetId = range.sheetId;
|
|
35607
|
+
const zone = range.zone;
|
|
35599
35608
|
// Performance issue: Avoid fetching data on positions that are out of the spreadsheet
|
|
35600
35609
|
// e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
|
|
35601
35610
|
const sheetZone = this.getters.getSheetZone(sheetId);
|
|
@@ -35638,6 +35647,14 @@
|
|
|
35638
35647
|
this.rangeCache[cacheKey] = result;
|
|
35639
35648
|
return result;
|
|
35640
35649
|
}
|
|
35650
|
+
assertRangeValid(range) {
|
|
35651
|
+
if (!isZoneValid(range.zone)) {
|
|
35652
|
+
throw new InvalidReferenceError();
|
|
35653
|
+
}
|
|
35654
|
+
if (range.invalidSheetName) {
|
|
35655
|
+
throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
|
|
35656
|
+
}
|
|
35657
|
+
}
|
|
35641
35658
|
}
|
|
35642
35659
|
|
|
35643
35660
|
function quickselect(arr, k, left, right, compare) {
|
|
@@ -37916,7 +37933,7 @@
|
|
|
37916
37933
|
if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
|
|
37917
37934
|
return 0 /* CommandResult.Success */;
|
|
37918
37935
|
}
|
|
37919
|
-
return
|
|
37936
|
+
return 48 /* CommandResult.InvalidAutofillSelection */;
|
|
37920
37937
|
case "AUTOFILL_AUTO":
|
|
37921
37938
|
const zone = this.getters.getSelectedZone();
|
|
37922
37939
|
return zone.top === zone.bottom
|
|
@@ -38535,7 +38552,7 @@
|
|
|
38535
38552
|
cellPopoverRegistry.get(cmd.popoverType);
|
|
38536
38553
|
}
|
|
38537
38554
|
catch (error) {
|
|
38538
|
-
return
|
|
38555
|
+
return 75 /* CommandResult.InvalidCellPopover */;
|
|
38539
38556
|
}
|
|
38540
38557
|
return 0 /* CommandResult.Success */;
|
|
38541
38558
|
default:
|
|
@@ -40675,27 +40692,6 @@
|
|
|
40675
40692
|
// ---------------------------------------------------------------------------
|
|
40676
40693
|
// Command Handling
|
|
40677
40694
|
// ---------------------------------------------------------------------------
|
|
40678
|
-
allowDispatch(cmd) {
|
|
40679
|
-
switch (cmd.type) {
|
|
40680
|
-
case "ADD_RANGE":
|
|
40681
|
-
case "ADD_EMPTY_RANGE":
|
|
40682
|
-
if (this.inputHasSingleRange && this.ranges.length === 1) {
|
|
40683
|
-
return 31 /* CommandResult.MaximumRangesReached */;
|
|
40684
|
-
}
|
|
40685
|
-
break;
|
|
40686
|
-
case "REMOVE_RANGE":
|
|
40687
|
-
if (this.ranges.length === 1) {
|
|
40688
|
-
return 32 /* CommandResult.MinimumRangesReached */;
|
|
40689
|
-
}
|
|
40690
|
-
break;
|
|
40691
|
-
case "CHANGE_RANGE":
|
|
40692
|
-
if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
40693
|
-
return 31 /* CommandResult.MaximumRangesReached */;
|
|
40694
|
-
}
|
|
40695
|
-
break;
|
|
40696
|
-
}
|
|
40697
|
-
return 0 /* CommandResult.Success */;
|
|
40698
|
-
}
|
|
40699
40695
|
handleEvent(event) {
|
|
40700
40696
|
const inputSheetId = this.activeSheet;
|
|
40701
40697
|
const sheetId = this.getters.getActiveSheetId();
|
|
@@ -40915,6 +40911,15 @@
|
|
|
40915
40911
|
// Command Handling
|
|
40916
40912
|
// ---------------------------------------------------------------------------
|
|
40917
40913
|
allowDispatch(cmd) {
|
|
40914
|
+
switch (cmd.type) {
|
|
40915
|
+
case "FOCUS_RANGE":
|
|
40916
|
+
case "CHANGE_RANGE":
|
|
40917
|
+
case "ADD_EMPTY_RANGE":
|
|
40918
|
+
case "REMOVE_RANGE":
|
|
40919
|
+
if (!this.inputs[cmd.id]) {
|
|
40920
|
+
return 33 /* CommandResult.InvalidInputId */;
|
|
40921
|
+
}
|
|
40922
|
+
}
|
|
40918
40923
|
switch (cmd.type) {
|
|
40919
40924
|
case "FOCUS_RANGE":
|
|
40920
40925
|
const index = this.currentInput?.getIndex(cmd.rangeId);
|
|
@@ -40922,9 +40927,25 @@
|
|
|
40922
40927
|
return 30 /* CommandResult.InputAlreadyFocused */;
|
|
40923
40928
|
}
|
|
40924
40929
|
break;
|
|
40925
|
-
|
|
40926
|
-
|
|
40927
|
-
|
|
40930
|
+
case "ADD_RANGE":
|
|
40931
|
+
case "ADD_EMPTY_RANGE":
|
|
40932
|
+
const input = this.inputs[cmd.id];
|
|
40933
|
+
if (input.inputHasSingleRange && input.ranges.length === 1) {
|
|
40934
|
+
return 31 /* CommandResult.MaximumRangesReached */;
|
|
40935
|
+
}
|
|
40936
|
+
break;
|
|
40937
|
+
case "REMOVE_RANGE":
|
|
40938
|
+
if (this.inputs[cmd.id].ranges.length === 1) {
|
|
40939
|
+
return 32 /* CommandResult.MinimumRangesReached */;
|
|
40940
|
+
}
|
|
40941
|
+
break;
|
|
40942
|
+
case "CHANGE_RANGE": {
|
|
40943
|
+
const input = this.inputs[cmd.id];
|
|
40944
|
+
if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
40945
|
+
return 31 /* CommandResult.MaximumRangesReached */;
|
|
40946
|
+
}
|
|
40947
|
+
break;
|
|
40948
|
+
}
|
|
40928
40949
|
}
|
|
40929
40950
|
return 0 /* CommandResult.Success */;
|
|
40930
40951
|
}
|
|
@@ -41054,7 +41075,7 @@
|
|
|
41054
41075
|
/*Test the presence of single cells*/
|
|
41055
41076
|
const singleCells = positions(zone).some(({ col, row }) => !this.getters.isInMerge({ sheetId, col, row }));
|
|
41056
41077
|
if (singleCells) {
|
|
41057
|
-
return
|
|
41078
|
+
return 66 /* CommandResult.InvalidSortZone */;
|
|
41058
41079
|
}
|
|
41059
41080
|
return 0 /* CommandResult.Success */;
|
|
41060
41081
|
}
|
|
@@ -41073,7 +41094,7 @@
|
|
|
41073
41094
|
];
|
|
41074
41095
|
return widthCurrent === widthFirst && heightCurrent === heightFirst;
|
|
41075
41096
|
})) {
|
|
41076
|
-
return
|
|
41097
|
+
return 66 /* CommandResult.InvalidSortZone */;
|
|
41077
41098
|
}
|
|
41078
41099
|
return 0 /* CommandResult.Success */;
|
|
41079
41100
|
}
|
|
@@ -41511,7 +41532,7 @@
|
|
|
41511
41532
|
const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.tryGetActiveSheetId();
|
|
41512
41533
|
const zones = this.getters.getCommandZones(cmd);
|
|
41513
41534
|
if (!sheetId && zones.length > 0) {
|
|
41514
|
-
return
|
|
41535
|
+
return 95 /* CommandResult.NoActiveSheet */;
|
|
41515
41536
|
}
|
|
41516
41537
|
if (sheetId && zones.length > 0) {
|
|
41517
41538
|
return this.getters.checkZonesExistInSheet(sheetId, zones);
|
|
@@ -41993,13 +42014,13 @@
|
|
|
41993
42014
|
}
|
|
41994
42015
|
checkSingleColSelected() {
|
|
41995
42016
|
if (!this.getters.isSingleColSelected()) {
|
|
41996
|
-
return
|
|
42017
|
+
return 91 /* CommandResult.MoreThanOneColumnSelected */;
|
|
41997
42018
|
}
|
|
41998
42019
|
return 0 /* CommandResult.Success */;
|
|
41999
42020
|
}
|
|
42000
42021
|
checkNonEmptySelector(cmd) {
|
|
42001
42022
|
if (cmd.separator === "") {
|
|
42002
|
-
return
|
|
42023
|
+
return 92 /* CommandResult.EmptySplitSeparator */;
|
|
42003
42024
|
}
|
|
42004
42025
|
return 0 /* CommandResult.Success */;
|
|
42005
42026
|
}
|
|
@@ -42010,7 +42031,7 @@
|
|
|
42010
42031
|
const selection = this.getters.getSelectedZones()[0];
|
|
42011
42032
|
const splitted = this.getSplittedCols(selection, cmd.separator);
|
|
42012
42033
|
if (this.willSplittedColsOverwriteContent(selection, splitted)) {
|
|
42013
|
-
return
|
|
42034
|
+
return 93 /* CommandResult.SplitWillOverwriteContent */;
|
|
42014
42035
|
}
|
|
42015
42036
|
return 0 /* CommandResult.Success */;
|
|
42016
42037
|
}
|
|
@@ -42021,7 +42042,7 @@
|
|
|
42021
42042
|
return 0 /* CommandResult.Success */;
|
|
42022
42043
|
}
|
|
42023
42044
|
}
|
|
42024
|
-
return
|
|
42045
|
+
return 94 /* CommandResult.NoSplitSeparatorInSelection */;
|
|
42025
42046
|
}
|
|
42026
42047
|
}
|
|
42027
42048
|
|
|
@@ -42169,7 +42190,7 @@
|
|
|
42169
42190
|
for (const zone of this.getPasteZones(target)) {
|
|
42170
42191
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
42171
42192
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
42172
|
-
return
|
|
42193
|
+
return 78 /* CommandResult.FrozenPaneOverlap */;
|
|
42173
42194
|
}
|
|
42174
42195
|
}
|
|
42175
42196
|
return 0 /* CommandResult.Success */;
|
|
@@ -42621,7 +42642,7 @@
|
|
|
42621
42642
|
}
|
|
42622
42643
|
isPasteAllowed(target, option) {
|
|
42623
42644
|
if (target.length === 0) {
|
|
42624
|
-
return
|
|
42645
|
+
return 76 /* CommandResult.EmptyTarget */;
|
|
42625
42646
|
}
|
|
42626
42647
|
if (option?.pasteOption !== undefined) {
|
|
42627
42648
|
return 23 /* CommandResult.WrongFigurePasteOption */;
|
|
@@ -42854,7 +42875,7 @@
|
|
|
42854
42875
|
}
|
|
42855
42876
|
case "ACTIVATE_PAINT_FORMAT": {
|
|
42856
42877
|
if (this.paintFormatStatus !== "inactive") {
|
|
42857
|
-
return
|
|
42878
|
+
return 97 /* CommandResult.AlreadyInPaintingFormatMode */;
|
|
42858
42879
|
}
|
|
42859
42880
|
}
|
|
42860
42881
|
}
|
|
@@ -43432,7 +43453,7 @@
|
|
|
43432
43453
|
validateSelection(length, start, end) {
|
|
43433
43454
|
return start >= 0 && start <= length && end >= 0 && end <= length
|
|
43434
43455
|
? 0 /* CommandResult.Success */
|
|
43435
|
-
:
|
|
43456
|
+
: 49 /* CommandResult.WrongComposerSelection */;
|
|
43436
43457
|
}
|
|
43437
43458
|
onColumnsRemoved(cmd) {
|
|
43438
43459
|
if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
|
|
@@ -43744,9 +43765,10 @@
|
|
|
43744
43765
|
*/
|
|
43745
43766
|
getReferencedRanges() {
|
|
43746
43767
|
const editionSheetId = this.getters.getCurrentEditedCell().sheetId;
|
|
43747
|
-
|
|
43768
|
+
const referenceRanges = this.currentTokens
|
|
43748
43769
|
.filter((token) => token.type === "REFERENCE")
|
|
43749
43770
|
.map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
|
|
43771
|
+
return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
|
|
43750
43772
|
}
|
|
43751
43773
|
/**
|
|
43752
43774
|
* Function used to determine when composer selection can start.
|
|
@@ -43813,7 +43835,7 @@
|
|
|
43813
43835
|
switch (cmd.type) {
|
|
43814
43836
|
case "UPDATE_FILTER":
|
|
43815
43837
|
if (!this.getters.getFilterId(cmd)) {
|
|
43816
|
-
return
|
|
43838
|
+
return 82 /* CommandResult.FilterNotFound */;
|
|
43817
43839
|
}
|
|
43818
43840
|
break;
|
|
43819
43841
|
}
|
|
@@ -44608,7 +44630,7 @@
|
|
|
44608
44630
|
const headers = [cmd.base, ...cmd.elements];
|
|
44609
44631
|
const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
|
|
44610
44632
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
44611
|
-
return
|
|
44633
|
+
return 89 /* CommandResult.InvalidHeaderIndex */;
|
|
44612
44634
|
}
|
|
44613
44635
|
return 0 /* CommandResult.Success */;
|
|
44614
44636
|
}
|
|
@@ -45424,7 +45446,7 @@
|
|
|
45424
45446
|
}
|
|
45425
45447
|
checkPositiveDimension(cmd) {
|
|
45426
45448
|
if (cmd.width < 0 || cmd.height < 0) {
|
|
45427
|
-
return
|
|
45449
|
+
return 71 /* CommandResult.InvalidViewportSize */;
|
|
45428
45450
|
}
|
|
45429
45451
|
return 0 /* CommandResult.Success */;
|
|
45430
45452
|
}
|
|
@@ -45434,7 +45456,7 @@
|
|
|
45434
45456
|
cmd.gridOffsetY === this.gridOffsetY &&
|
|
45435
45457
|
cmd.width === width &&
|
|
45436
45458
|
cmd.height === height) {
|
|
45437
|
-
return
|
|
45459
|
+
return 79 /* CommandResult.ValuesNotChanged */;
|
|
45438
45460
|
}
|
|
45439
45461
|
return 0 /* CommandResult.Success */;
|
|
45440
45462
|
}
|
|
@@ -45442,7 +45464,7 @@
|
|
|
45442
45464
|
const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
|
|
45443
45465
|
if ((!pane.canScrollHorizontally && offsetX > 0) ||
|
|
45444
45466
|
(!pane.canScrollVertically && offsetY > 0)) {
|
|
45445
|
-
return
|
|
45467
|
+
return 72 /* CommandResult.InvalidScrollingDirection */;
|
|
45446
45468
|
}
|
|
45447
45469
|
return 0 /* CommandResult.Success */;
|
|
45448
45470
|
}
|
|
@@ -48901,7 +48923,7 @@
|
|
|
48901
48923
|
*/
|
|
48902
48924
|
moveAnchorCell(direction, step = 1) {
|
|
48903
48925
|
if (step !== "end" && step <= 0) {
|
|
48904
|
-
return new DispatchResult(
|
|
48926
|
+
return new DispatchResult(86 /* CommandResult.InvalidSelectionStep */);
|
|
48905
48927
|
}
|
|
48906
48928
|
const { col, row } = this.getNextAvailablePosition(direction, step);
|
|
48907
48929
|
return this.selectCell(col, row);
|
|
@@ -48947,7 +48969,7 @@
|
|
|
48947
48969
|
*/
|
|
48948
48970
|
resizeAnchorZone(direction, step = 1) {
|
|
48949
48971
|
if (step !== "end" && step <= 0) {
|
|
48950
|
-
return new DispatchResult(
|
|
48972
|
+
return new DispatchResult(86 /* CommandResult.InvalidSelectionStep */);
|
|
48951
48973
|
}
|
|
48952
48974
|
const sheetId = this.getters.getActiveSheetId();
|
|
48953
48975
|
const anchor = this.anchor;
|
|
@@ -49785,12 +49807,7 @@
|
|
|
49785
49807
|
attrs.push(["t", "str"]);
|
|
49786
49808
|
cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
49787
49809
|
}
|
|
49788
|
-
node = escapeXml /*xml*/ `
|
|
49789
|
-
<f>
|
|
49790
|
-
${XlsxFormula}
|
|
49791
|
-
</f>
|
|
49792
|
-
${cycle}
|
|
49793
|
-
`;
|
|
49810
|
+
node = escapeXml /*xml*/ ` <f> ${XlsxFormula} </f> ${cycle} `;
|
|
49794
49811
|
return { attrs, node };
|
|
49795
49812
|
}
|
|
49796
49813
|
function addContent(content, sharedStrings, forceString = false) {
|
|
@@ -50609,11 +50626,10 @@
|
|
|
50609
50626
|
({ attrs: additionalAttrs, node: cellNode } = addContent(cell.content, construct.sharedStrings, isTableHeader));
|
|
50610
50627
|
}
|
|
50611
50628
|
attributes.push(...additionalAttrs);
|
|
50612
|
-
|
|
50613
|
-
|
|
50614
|
-
|
|
50615
|
-
|
|
50616
|
-
`);
|
|
50629
|
+
// prettier-ignore
|
|
50630
|
+
cellNodes.push(escapeXml /*xml*/ `<c ${formatAttributes(attributes)}>
|
|
50631
|
+
${cellNode}
|
|
50632
|
+
</c>`);
|
|
50617
50633
|
}
|
|
50618
50634
|
}
|
|
50619
50635
|
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden) {
|
|
@@ -51304,10 +51320,10 @@
|
|
|
51304
51320
|
const command = createCommand(type, payload);
|
|
51305
51321
|
let status = this.status;
|
|
51306
51322
|
if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
|
|
51307
|
-
return new DispatchResult(
|
|
51323
|
+
return new DispatchResult(70 /* CommandResult.Readonly */);
|
|
51308
51324
|
}
|
|
51309
51325
|
if (!this.session.canApplyOptimisticUpdate()) {
|
|
51310
|
-
return new DispatchResult(
|
|
51326
|
+
return new DispatchResult(67 /* CommandResult.WaitingSessionConfirmation */);
|
|
51311
51327
|
}
|
|
51312
51328
|
switch (status) {
|
|
51313
51329
|
case 0 /* Status.Ready */:
|
|
@@ -51596,9 +51612,9 @@
|
|
|
51596
51612
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
51597
51613
|
|
|
51598
51614
|
|
|
51599
|
-
__info__.version = '16.4.
|
|
51600
|
-
__info__.date = '2024-
|
|
51601
|
-
__info__.hash = '
|
|
51615
|
+
__info__.version = '16.4.21';
|
|
51616
|
+
__info__.date = '2024-02-02T13:45:48.276Z';
|
|
51617
|
+
__info__.hash = '73662b1';
|
|
51602
51618
|
|
|
51603
51619
|
|
|
51604
51620
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|