@odoo/o-spreadsheet 16.0.60 → 16.0.62
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 +366 -267
- package/dist/o-spreadsheet.d.ts +80 -69
- package/dist/o-spreadsheet.esm.js +366 -267
- package/dist/o-spreadsheet.iife.js +366 -267
- package/dist/o-spreadsheet.iife.min.js +237 -237
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +2 -1
|
@@ -1098,9 +1098,16 @@ function deepEquals(o1, o2) {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
return true;
|
|
1100
1100
|
}
|
|
1101
|
-
/**
|
|
1101
|
+
/**
|
|
1102
|
+
* Check if the given array contains all the values of the other array.
|
|
1103
|
+
* It makes the assumption that both array do not contain duplicates.
|
|
1104
|
+
*/
|
|
1102
1105
|
function includesAll(arr, values) {
|
|
1103
|
-
|
|
1106
|
+
if (arr.length < values.length) {
|
|
1107
|
+
return false;
|
|
1108
|
+
}
|
|
1109
|
+
const set = new Set(arr);
|
|
1110
|
+
return values.every((value) => set.has(value));
|
|
1104
1111
|
}
|
|
1105
1112
|
/**
|
|
1106
1113
|
* Return an object with all the keys in the object that have a falsy value removed.
|
|
@@ -2375,6 +2382,37 @@ class UuidGenerator {
|
|
|
2375
2382
|
setIsFastStrategy(isFast) {
|
|
2376
2383
|
this.isFastIdStrategy = isFast;
|
|
2377
2384
|
}
|
|
2385
|
+
/**
|
|
2386
|
+
* Generates a custom UUID using a simple 26^8 method (8-character alphanumeric string with lowercase letters)
|
|
2387
|
+
* This has a higher chance of collision than a UUIDv4, but not only faster to generate than an UUIDV4,
|
|
2388
|
+
* it also has a smaller size, which is preferable to alleviate the overall data size.
|
|
2389
|
+
*
|
|
2390
|
+
* This method is preferable when generating uuids for the core data (sheetId, figureId, etc)
|
|
2391
|
+
* as they will appear several times in the revisions and local history.
|
|
2392
|
+
*
|
|
2393
|
+
*/
|
|
2394
|
+
smallUuid() {
|
|
2395
|
+
if (this.isFastIdStrategy) {
|
|
2396
|
+
this.fastIdStart++;
|
|
2397
|
+
return String(this.fastIdStart);
|
|
2398
|
+
//@ts-ignore
|
|
2399
|
+
}
|
|
2400
|
+
else if (window.crypto && window.crypto.getRandomValues) {
|
|
2401
|
+
//@ts-ignore
|
|
2402
|
+
return ([1e7] + -1e3).replace(/[018]/g, (c) => (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));
|
|
2403
|
+
}
|
|
2404
|
+
else {
|
|
2405
|
+
// mainly for jest and other browsers that do not have the crypto functionality
|
|
2406
|
+
return "xxxxxxxx-xxxx".replace(/[xy]/g, function (c) {
|
|
2407
|
+
var r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8;
|
|
2408
|
+
return v.toString(16);
|
|
2409
|
+
});
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
/**
|
|
2413
|
+
* Generates an UUIDV4, has astronomically low chance of collision, but is larger in size than the smallUuid.
|
|
2414
|
+
* This method should be used when you need to avoid collisions at all costs, like the id of a revision.
|
|
2415
|
+
*/
|
|
2378
2416
|
uuidv4() {
|
|
2379
2417
|
if (this.isFastIdStrategy) {
|
|
2380
2418
|
this.fastIdStart++;
|
|
@@ -2488,17 +2526,20 @@ function toZoneWithoutBoundaryChanges(xc) {
|
|
|
2488
2526
|
*/
|
|
2489
2527
|
function toUnboundedZone(xc) {
|
|
2490
2528
|
const zone = toZoneWithoutBoundaryChanges(xc);
|
|
2529
|
+
reorderZone(zone);
|
|
2530
|
+
return zone;
|
|
2531
|
+
}
|
|
2532
|
+
function reorderZone(zone) {
|
|
2491
2533
|
if (zone.right !== undefined && zone.right < zone.left) {
|
|
2492
|
-
const
|
|
2534
|
+
const right = zone.left;
|
|
2493
2535
|
zone.left = zone.right;
|
|
2494
|
-
zone.right =
|
|
2536
|
+
zone.right = right;
|
|
2495
2537
|
}
|
|
2496
2538
|
if (zone.bottom !== undefined && zone.bottom < zone.top) {
|
|
2497
|
-
const
|
|
2539
|
+
const bottom = zone.top;
|
|
2498
2540
|
zone.top = zone.bottom;
|
|
2499
|
-
zone.bottom =
|
|
2541
|
+
zone.bottom = bottom;
|
|
2500
2542
|
}
|
|
2501
|
-
return zone;
|
|
2502
2543
|
}
|
|
2503
2544
|
/**
|
|
2504
2545
|
* Convert from a cartesian reference to a Zone.
|
|
@@ -3386,67 +3427,68 @@ var CommandResult;
|
|
|
3386
3427
|
CommandResult[CommandResult["InvalidRange"] = 25] = "InvalidRange";
|
|
3387
3428
|
CommandResult[CommandResult["InvalidZones"] = 26] = "InvalidZones";
|
|
3388
3429
|
CommandResult[CommandResult["InvalidSheetId"] = 27] = "InvalidSheetId";
|
|
3389
|
-
CommandResult[CommandResult["
|
|
3390
|
-
CommandResult[CommandResult["
|
|
3391
|
-
CommandResult[CommandResult["
|
|
3392
|
-
CommandResult[CommandResult["
|
|
3393
|
-
CommandResult[CommandResult["
|
|
3394
|
-
CommandResult[CommandResult["
|
|
3395
|
-
CommandResult[CommandResult["
|
|
3396
|
-
CommandResult[CommandResult["
|
|
3397
|
-
CommandResult[CommandResult["
|
|
3398
|
-
CommandResult[CommandResult["
|
|
3399
|
-
CommandResult[CommandResult["
|
|
3400
|
-
CommandResult[CommandResult["
|
|
3401
|
-
CommandResult[CommandResult["
|
|
3402
|
-
CommandResult[CommandResult["
|
|
3403
|
-
CommandResult[CommandResult["
|
|
3404
|
-
CommandResult[CommandResult["
|
|
3405
|
-
CommandResult[CommandResult["
|
|
3406
|
-
CommandResult[CommandResult["
|
|
3407
|
-
CommandResult[CommandResult["
|
|
3408
|
-
CommandResult[CommandResult["
|
|
3409
|
-
CommandResult[CommandResult["
|
|
3410
|
-
CommandResult[CommandResult["
|
|
3411
|
-
CommandResult[CommandResult["
|
|
3412
|
-
CommandResult[CommandResult["
|
|
3413
|
-
CommandResult[CommandResult["
|
|
3414
|
-
CommandResult[CommandResult["
|
|
3415
|
-
CommandResult[CommandResult["
|
|
3416
|
-
CommandResult[CommandResult["
|
|
3417
|
-
CommandResult[CommandResult["
|
|
3418
|
-
CommandResult[CommandResult["
|
|
3419
|
-
CommandResult[CommandResult["
|
|
3420
|
-
CommandResult[CommandResult["
|
|
3421
|
-
CommandResult[CommandResult["
|
|
3422
|
-
CommandResult[CommandResult["
|
|
3423
|
-
CommandResult[CommandResult["
|
|
3424
|
-
CommandResult[CommandResult["
|
|
3425
|
-
CommandResult[CommandResult["
|
|
3426
|
-
CommandResult[CommandResult["
|
|
3427
|
-
CommandResult[CommandResult["
|
|
3428
|
-
CommandResult[CommandResult["
|
|
3429
|
-
CommandResult[CommandResult["
|
|
3430
|
-
CommandResult[CommandResult["
|
|
3431
|
-
CommandResult[CommandResult["
|
|
3432
|
-
CommandResult[CommandResult["
|
|
3433
|
-
CommandResult[CommandResult["
|
|
3434
|
-
CommandResult[CommandResult["
|
|
3435
|
-
CommandResult[CommandResult["
|
|
3436
|
-
CommandResult[CommandResult["
|
|
3437
|
-
CommandResult[CommandResult["
|
|
3438
|
-
CommandResult[CommandResult["
|
|
3439
|
-
CommandResult[CommandResult["
|
|
3440
|
-
CommandResult[CommandResult["
|
|
3441
|
-
CommandResult[CommandResult["
|
|
3442
|
-
CommandResult[CommandResult["
|
|
3443
|
-
CommandResult[CommandResult["
|
|
3444
|
-
CommandResult[CommandResult["
|
|
3445
|
-
CommandResult[CommandResult["
|
|
3446
|
-
CommandResult[CommandResult["
|
|
3447
|
-
CommandResult[CommandResult["
|
|
3448
|
-
CommandResult[CommandResult["
|
|
3449
|
-
CommandResult[CommandResult["
|
|
3430
|
+
CommandResult[CommandResult["InvalidCellId"] = 28] = "InvalidCellId";
|
|
3431
|
+
CommandResult[CommandResult["InputAlreadyFocused"] = 29] = "InputAlreadyFocused";
|
|
3432
|
+
CommandResult[CommandResult["MaximumRangesReached"] = 30] = "MaximumRangesReached";
|
|
3433
|
+
CommandResult[CommandResult["InvalidInputId"] = 31] = "InvalidInputId";
|
|
3434
|
+
CommandResult[CommandResult["InvalidChartDefinition"] = 32] = "InvalidChartDefinition";
|
|
3435
|
+
CommandResult[CommandResult["InvalidDataSet"] = 33] = "InvalidDataSet";
|
|
3436
|
+
CommandResult[CommandResult["InvalidLabelRange"] = 34] = "InvalidLabelRange";
|
|
3437
|
+
CommandResult[CommandResult["InvalidScorecardKeyValue"] = 35] = "InvalidScorecardKeyValue";
|
|
3438
|
+
CommandResult[CommandResult["InvalidScorecardBaseline"] = 36] = "InvalidScorecardBaseline";
|
|
3439
|
+
CommandResult[CommandResult["InvalidGaugeDataRange"] = 37] = "InvalidGaugeDataRange";
|
|
3440
|
+
CommandResult[CommandResult["EmptyGaugeRangeMin"] = 38] = "EmptyGaugeRangeMin";
|
|
3441
|
+
CommandResult[CommandResult["GaugeRangeMinNaN"] = 39] = "GaugeRangeMinNaN";
|
|
3442
|
+
CommandResult[CommandResult["EmptyGaugeRangeMax"] = 40] = "EmptyGaugeRangeMax";
|
|
3443
|
+
CommandResult[CommandResult["GaugeRangeMaxNaN"] = 41] = "GaugeRangeMaxNaN";
|
|
3444
|
+
CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 42] = "GaugeRangeMinBiggerThanRangeMax";
|
|
3445
|
+
CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 43] = "GaugeLowerInflectionPointNaN";
|
|
3446
|
+
CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 44] = "GaugeUpperInflectionPointNaN";
|
|
3447
|
+
CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 45] = "GaugeLowerBiggerThanUpper";
|
|
3448
|
+
CommandResult[CommandResult["InvalidAutofillSelection"] = 46] = "InvalidAutofillSelection";
|
|
3449
|
+
CommandResult[CommandResult["WrongComposerSelection"] = 47] = "WrongComposerSelection";
|
|
3450
|
+
CommandResult[CommandResult["MinBiggerThanMax"] = 48] = "MinBiggerThanMax";
|
|
3451
|
+
CommandResult[CommandResult["LowerBiggerThanUpper"] = 49] = "LowerBiggerThanUpper";
|
|
3452
|
+
CommandResult[CommandResult["MidBiggerThanMax"] = 50] = "MidBiggerThanMax";
|
|
3453
|
+
CommandResult[CommandResult["MinBiggerThanMid"] = 51] = "MinBiggerThanMid";
|
|
3454
|
+
CommandResult[CommandResult["FirstArgMissing"] = 52] = "FirstArgMissing";
|
|
3455
|
+
CommandResult[CommandResult["SecondArgMissing"] = 53] = "SecondArgMissing";
|
|
3456
|
+
CommandResult[CommandResult["MinNaN"] = 54] = "MinNaN";
|
|
3457
|
+
CommandResult[CommandResult["MidNaN"] = 55] = "MidNaN";
|
|
3458
|
+
CommandResult[CommandResult["MaxNaN"] = 56] = "MaxNaN";
|
|
3459
|
+
CommandResult[CommandResult["ValueUpperInflectionNaN"] = 57] = "ValueUpperInflectionNaN";
|
|
3460
|
+
CommandResult[CommandResult["ValueLowerInflectionNaN"] = 58] = "ValueLowerInflectionNaN";
|
|
3461
|
+
CommandResult[CommandResult["MinInvalidFormula"] = 59] = "MinInvalidFormula";
|
|
3462
|
+
CommandResult[CommandResult["MidInvalidFormula"] = 60] = "MidInvalidFormula";
|
|
3463
|
+
CommandResult[CommandResult["MaxInvalidFormula"] = 61] = "MaxInvalidFormula";
|
|
3464
|
+
CommandResult[CommandResult["ValueUpperInvalidFormula"] = 62] = "ValueUpperInvalidFormula";
|
|
3465
|
+
CommandResult[CommandResult["ValueLowerInvalidFormula"] = 63] = "ValueLowerInvalidFormula";
|
|
3466
|
+
CommandResult[CommandResult["InvalidSortZone"] = 64] = "InvalidSortZone";
|
|
3467
|
+
CommandResult[CommandResult["WaitingSessionConfirmation"] = 65] = "WaitingSessionConfirmation";
|
|
3468
|
+
CommandResult[CommandResult["MergeOverlap"] = 66] = "MergeOverlap";
|
|
3469
|
+
CommandResult[CommandResult["TooManyHiddenElements"] = 67] = "TooManyHiddenElements";
|
|
3470
|
+
CommandResult[CommandResult["Readonly"] = 68] = "Readonly";
|
|
3471
|
+
CommandResult[CommandResult["InvalidViewportSize"] = 69] = "InvalidViewportSize";
|
|
3472
|
+
CommandResult[CommandResult["InvalidScrollingDirection"] = 70] = "InvalidScrollingDirection";
|
|
3473
|
+
CommandResult[CommandResult["FigureDoesNotExist"] = 71] = "FigureDoesNotExist";
|
|
3474
|
+
CommandResult[CommandResult["InvalidConditionalFormatId"] = 72] = "InvalidConditionalFormatId";
|
|
3475
|
+
CommandResult[CommandResult["InvalidCellPopover"] = 73] = "InvalidCellPopover";
|
|
3476
|
+
CommandResult[CommandResult["EmptyTarget"] = 74] = "EmptyTarget";
|
|
3477
|
+
CommandResult[CommandResult["InvalidFreezeQuantity"] = 75] = "InvalidFreezeQuantity";
|
|
3478
|
+
CommandResult[CommandResult["FrozenPaneOverlap"] = 76] = "FrozenPaneOverlap";
|
|
3479
|
+
CommandResult[CommandResult["ValuesNotChanged"] = 77] = "ValuesNotChanged";
|
|
3480
|
+
CommandResult[CommandResult["InvalidFilterZone"] = 78] = "InvalidFilterZone";
|
|
3481
|
+
CommandResult[CommandResult["FilterOverlap"] = 79] = "FilterOverlap";
|
|
3482
|
+
CommandResult[CommandResult["FilterNotFound"] = 80] = "FilterNotFound";
|
|
3483
|
+
CommandResult[CommandResult["MergeInFilter"] = 81] = "MergeInFilter";
|
|
3484
|
+
CommandResult[CommandResult["NonContinuousTargets"] = 82] = "NonContinuousTargets";
|
|
3485
|
+
CommandResult[CommandResult["DuplicatedFigureId"] = 83] = "DuplicatedFigureId";
|
|
3486
|
+
CommandResult[CommandResult["InvalidSelectionStep"] = 84] = "InvalidSelectionStep";
|
|
3487
|
+
CommandResult[CommandResult["DuplicatedChartId"] = 85] = "DuplicatedChartId";
|
|
3488
|
+
CommandResult[CommandResult["ChartDoesNotExist"] = 86] = "ChartDoesNotExist";
|
|
3489
|
+
CommandResult[CommandResult["InvalidHeaderIndex"] = 87] = "InvalidHeaderIndex";
|
|
3490
|
+
CommandResult[CommandResult["InvalidQuantity"] = 88] = "InvalidQuantity";
|
|
3491
|
+
CommandResult[CommandResult["NoChanges"] = 89] = "NoChanges";
|
|
3450
3492
|
})(CommandResult || (CommandResult = {}));
|
|
3451
3493
|
|
|
3452
3494
|
function isMatrix(x) {
|
|
@@ -4976,7 +5018,7 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
|
4976
5018
|
});
|
|
4977
5019
|
}
|
|
4978
5020
|
}
|
|
4979
|
-
if (result.isCancelledBecause(
|
|
5021
|
+
if (result.isCancelledBecause(64 /* CommandResult.InvalidSortZone */)) {
|
|
4980
5022
|
const { col, row } = anchor;
|
|
4981
5023
|
env.model.selection.selectZone({ cell: { col, row }, zone });
|
|
4982
5024
|
env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
|
|
@@ -4999,13 +5041,13 @@ const AddFilterInteractiveContent = {
|
|
|
4999
5041
|
};
|
|
5000
5042
|
function interactiveAddFilter(env, sheetId, target) {
|
|
5001
5043
|
const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
|
|
5002
|
-
if (result.isCancelledBecause(
|
|
5044
|
+
if (result.isCancelledBecause(79 /* CommandResult.FilterOverlap */)) {
|
|
5003
5045
|
env.raiseError(AddFilterInteractiveContent.filterOverlap);
|
|
5004
5046
|
}
|
|
5005
|
-
else if (result.isCancelledBecause(
|
|
5047
|
+
else if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
|
|
5006
5048
|
env.raiseError(AddFilterInteractiveContent.mergeInFilter);
|
|
5007
5049
|
}
|
|
5008
|
-
else if (result.isCancelledBecause(
|
|
5050
|
+
else if (result.isCancelledBecause(82 /* CommandResult.NonContinuousTargets */)) {
|
|
5009
5051
|
env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
|
|
5010
5052
|
}
|
|
5011
5053
|
}
|
|
@@ -5027,7 +5069,7 @@ function handlePasteResult(env, result) {
|
|
|
5027
5069
|
else if (result.reasons.includes(22 /* CommandResult.WrongFigurePasteOption */)) {
|
|
5028
5070
|
env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
|
|
5029
5071
|
}
|
|
5030
|
-
else if (result.reasons.includes(
|
|
5072
|
+
else if (result.reasons.includes(76 /* CommandResult.FrozenPaneOverlap */)) {
|
|
5031
5073
|
env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
|
|
5032
5074
|
}
|
|
5033
5075
|
}
|
|
@@ -5532,7 +5574,7 @@ const UNHIDE_ROWS_ACTION = (env) => {
|
|
|
5532
5574
|
const CREATE_SHEET_ACTION = (env) => {
|
|
5533
5575
|
const activeSheetId = env.model.getters.getActiveSheetId();
|
|
5534
5576
|
const position = env.model.getters.getSheetIds().indexOf(activeSheetId) + 1;
|
|
5535
|
-
const sheetId = env.model.uuidGenerator.
|
|
5577
|
+
const sheetId = env.model.uuidGenerator.smallUuid();
|
|
5536
5578
|
env.model.dispatch("CREATE_SHEET", { sheetId, position });
|
|
5537
5579
|
env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
|
|
5538
5580
|
};
|
|
@@ -5543,7 +5585,7 @@ const CREATE_CHART = (env) => {
|
|
|
5543
5585
|
const getters = env.model.getters;
|
|
5544
5586
|
const zone = getters.getSelectedZone();
|
|
5545
5587
|
let dataSetZone = zone;
|
|
5546
|
-
const id = env.model.uuidGenerator.
|
|
5588
|
+
const id = env.model.uuidGenerator.smallUuid();
|
|
5547
5589
|
let labelRange;
|
|
5548
5590
|
if (zone.left !== zone.right) {
|
|
5549
5591
|
dataSetZone = { ...zone, left: zone.left + 1 };
|
|
@@ -6019,7 +6061,7 @@ sheetMenuRegistry
|
|
|
6019
6061
|
name: _lt("Delete"),
|
|
6020
6062
|
sequence: 10,
|
|
6021
6063
|
isVisible: (env) => {
|
|
6022
|
-
return env.model.getters.
|
|
6064
|
+
return env.model.getters.getVisibleSheetIds().length > 1;
|
|
6023
6065
|
},
|
|
6024
6066
|
action: (env) => env.askConfirmation(_lt("Are you sure you want to delete this sheet ?"), () => {
|
|
6025
6067
|
env.model.dispatch("DELETE_SHEET", { sheetId: env.model.getters.getActiveSheetId() });
|
|
@@ -6030,7 +6072,7 @@ sheetMenuRegistry
|
|
|
6030
6072
|
sequence: 20,
|
|
6031
6073
|
action: (env) => {
|
|
6032
6074
|
const sheetIdFrom = env.model.getters.getActiveSheetId();
|
|
6033
|
-
const sheetIdTo = env.model.uuidGenerator.
|
|
6075
|
+
const sheetIdTo = env.model.uuidGenerator.smallUuid();
|
|
6034
6076
|
env.model.dispatch("DUPLICATE_SHEET", {
|
|
6035
6077
|
sheetId: sheetIdFrom,
|
|
6036
6078
|
sheetIdTo,
|
|
@@ -6078,22 +6120,22 @@ sheetMenuRegistry
|
|
|
6078
6120
|
const CfTerms = {
|
|
6079
6121
|
Errors: {
|
|
6080
6122
|
[25 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
|
|
6081
|
-
[
|
|
6082
|
-
[
|
|
6083
|
-
[
|
|
6084
|
-
[
|
|
6085
|
-
[
|
|
6086
|
-
[
|
|
6087
|
-
[
|
|
6088
|
-
[
|
|
6089
|
-
[
|
|
6090
|
-
[
|
|
6091
|
-
[
|
|
6092
|
-
[
|
|
6093
|
-
[
|
|
6094
|
-
[
|
|
6095
|
-
[
|
|
6096
|
-
[
|
|
6123
|
+
[52 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
|
|
6124
|
+
[53 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
|
|
6125
|
+
[54 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
|
|
6126
|
+
[55 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
|
|
6127
|
+
[56 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
|
|
6128
|
+
[57 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
|
|
6129
|
+
[58 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
|
|
6130
|
+
[48 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
|
|
6131
|
+
[51 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
|
|
6132
|
+
[50 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
|
|
6133
|
+
[49 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
|
|
6134
|
+
[59 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
|
|
6135
|
+
[61 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
|
|
6136
|
+
[60 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
|
|
6137
|
+
[62 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
|
|
6138
|
+
[63 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
|
|
6097
6139
|
[24 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
|
|
6098
6140
|
Unexpected: _lt("The rule is invalid for an unknown reason"),
|
|
6099
6141
|
},
|
|
@@ -6121,20 +6163,20 @@ const ChartTerms = {
|
|
|
6121
6163
|
Errors: {
|
|
6122
6164
|
Unexpected: _lt("The chart definition is invalid for an unknown reason"),
|
|
6123
6165
|
// BASIC CHART ERRORS (LINE | BAR | PIE)
|
|
6124
|
-
[
|
|
6125
|
-
[
|
|
6166
|
+
[33 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
|
|
6167
|
+
[34 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
|
|
6126
6168
|
// SCORECARD CHART ERRORS
|
|
6127
|
-
[
|
|
6128
|
-
[
|
|
6169
|
+
[35 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
|
|
6170
|
+
[36 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
|
|
6129
6171
|
// GAUGE CHART ERRORS
|
|
6130
|
-
[
|
|
6131
|
-
[
|
|
6132
|
-
[
|
|
6133
|
-
[
|
|
6134
|
-
[
|
|
6135
|
-
[
|
|
6136
|
-
[
|
|
6137
|
-
[
|
|
6172
|
+
[37 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
|
|
6173
|
+
[38 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
|
|
6174
|
+
[39 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
|
|
6175
|
+
[40 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
|
|
6176
|
+
[41 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
|
|
6177
|
+
[42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
|
|
6178
|
+
[43 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
|
|
6179
|
+
[44 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
|
|
6138
6180
|
},
|
|
6139
6181
|
};
|
|
6140
6182
|
const NumberFormatTerms = {
|
|
@@ -6158,7 +6200,7 @@ function interactiveFreezeColumnsRows(env, dimension, base) {
|
|
|
6158
6200
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
6159
6201
|
const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
|
|
6160
6202
|
const result = env.model.dispatch(cmd, { sheetId, quantity: base });
|
|
6161
|
-
if (result.isCancelledBecause(
|
|
6203
|
+
if (result.isCancelledBecause(66 /* CommandResult.MergeOverlap */)) {
|
|
6162
6204
|
env.raiseError(MergeErrorMessage);
|
|
6163
6205
|
}
|
|
6164
6206
|
}
|
|
@@ -6669,7 +6711,7 @@ css /* scss */ `
|
|
|
6669
6711
|
class SelectionInput extends Component {
|
|
6670
6712
|
constructor() {
|
|
6671
6713
|
super(...arguments);
|
|
6672
|
-
this.id = uuidGenerator$1.
|
|
6714
|
+
this.id = uuidGenerator$1.smallUuid();
|
|
6673
6715
|
this.previousRanges = this.props.ranges || [];
|
|
6674
6716
|
this.originSheet = this.env.model.getters.getActiveSheetId();
|
|
6675
6717
|
this.state = useState({
|
|
@@ -6804,11 +6846,11 @@ class LineBarPieConfigPanel extends Component {
|
|
|
6804
6846
|
}
|
|
6805
6847
|
get isDatasetInvalid() {
|
|
6806
6848
|
var _a;
|
|
6807
|
-
return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
6849
|
+
return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidDataSet */));
|
|
6808
6850
|
}
|
|
6809
6851
|
get isLabelInvalid() {
|
|
6810
6852
|
var _a;
|
|
6811
|
-
return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
6853
|
+
return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidLabelRange */));
|
|
6812
6854
|
}
|
|
6813
6855
|
onUpdateDataSetsHaveTitle(ev) {
|
|
6814
6856
|
this.props.updateChart(this.props.figureId, {
|
|
@@ -7152,11 +7194,11 @@ function checkDataset(definition) {
|
|
|
7152
7194
|
if (definition.dataSets) {
|
|
7153
7195
|
const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
|
|
7154
7196
|
if (invalidRanges) {
|
|
7155
|
-
return
|
|
7197
|
+
return 33 /* CommandResult.InvalidDataSet */;
|
|
7156
7198
|
}
|
|
7157
7199
|
const zones = definition.dataSets.map(toUnboundedZone);
|
|
7158
7200
|
if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
|
|
7159
|
-
return
|
|
7201
|
+
return 33 /* CommandResult.InvalidDataSet */;
|
|
7160
7202
|
}
|
|
7161
7203
|
}
|
|
7162
7204
|
return 0 /* CommandResult.Success */;
|
|
@@ -7165,7 +7207,7 @@ function checkLabelRange(definition) {
|
|
|
7165
7207
|
if (definition.labelRange) {
|
|
7166
7208
|
const invalidLabels = !rangeReference.test(definition.labelRange || "");
|
|
7167
7209
|
if (invalidLabels) {
|
|
7168
|
-
return
|
|
7210
|
+
return 34 /* CommandResult.InvalidLabelRange */;
|
|
7169
7211
|
}
|
|
7170
7212
|
}
|
|
7171
7213
|
return 0 /* CommandResult.Success */;
|
|
@@ -7626,7 +7668,7 @@ chartRegistry.add("gauge", {
|
|
|
7626
7668
|
});
|
|
7627
7669
|
function isDataRangeValid(definition) {
|
|
7628
7670
|
return definition.dataRange && !rangeReference.test(definition.dataRange)
|
|
7629
|
-
?
|
|
7671
|
+
? 37 /* CommandResult.InvalidGaugeDataRange */
|
|
7630
7672
|
: 0 /* CommandResult.Success */;
|
|
7631
7673
|
}
|
|
7632
7674
|
function checkRangeLimits(check, batchValidations) {
|
|
@@ -7658,7 +7700,7 @@ function checkInflectionPointsValue(check, batchValidations) {
|
|
|
7658
7700
|
function checkRangeMinBiggerThanRangeMax(definition) {
|
|
7659
7701
|
if (definition.sectionRule) {
|
|
7660
7702
|
if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
|
|
7661
|
-
return
|
|
7703
|
+
return 42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
|
|
7662
7704
|
}
|
|
7663
7705
|
}
|
|
7664
7706
|
return 0 /* CommandResult.Success */;
|
|
@@ -7667,9 +7709,9 @@ function checkEmpty(value, valueName) {
|
|
|
7667
7709
|
if (value === "") {
|
|
7668
7710
|
switch (valueName) {
|
|
7669
7711
|
case "rangeMin":
|
|
7670
|
-
return
|
|
7712
|
+
return 38 /* CommandResult.EmptyGaugeRangeMin */;
|
|
7671
7713
|
case "rangeMax":
|
|
7672
|
-
return
|
|
7714
|
+
return 40 /* CommandResult.EmptyGaugeRangeMax */;
|
|
7673
7715
|
}
|
|
7674
7716
|
}
|
|
7675
7717
|
return 0 /* CommandResult.Success */;
|
|
@@ -7678,13 +7720,13 @@ function checkNaN(value, valueName) {
|
|
|
7678
7720
|
if (isNaN(value)) {
|
|
7679
7721
|
switch (valueName) {
|
|
7680
7722
|
case "rangeMin":
|
|
7681
|
-
return
|
|
7723
|
+
return 39 /* CommandResult.GaugeRangeMinNaN */;
|
|
7682
7724
|
case "rangeMax":
|
|
7683
|
-
return
|
|
7725
|
+
return 41 /* CommandResult.GaugeRangeMaxNaN */;
|
|
7684
7726
|
case "lowerInflectionPointValue":
|
|
7685
|
-
return
|
|
7727
|
+
return 43 /* CommandResult.GaugeLowerInflectionPointNaN */;
|
|
7686
7728
|
case "upperInflectionPointValue":
|
|
7687
|
-
return
|
|
7729
|
+
return 44 /* CommandResult.GaugeUpperInflectionPointNaN */;
|
|
7688
7730
|
}
|
|
7689
7731
|
}
|
|
7690
7732
|
return 0 /* CommandResult.Success */;
|
|
@@ -8425,7 +8467,7 @@ function createPieChartRuntime(chart, getters) {
|
|
|
8425
8467
|
const dataset = {
|
|
8426
8468
|
label,
|
|
8427
8469
|
data,
|
|
8428
|
-
borderColor: "#FFFFFF",
|
|
8470
|
+
borderColor: chart.background || "#FFFFFF",
|
|
8429
8471
|
backgroundColor,
|
|
8430
8472
|
};
|
|
8431
8473
|
config.data.datasets.push(dataset);
|
|
@@ -8444,12 +8486,12 @@ chartRegistry.add("scorecard", {
|
|
|
8444
8486
|
});
|
|
8445
8487
|
function checkKeyValue(definition) {
|
|
8446
8488
|
return definition.keyValue && !rangeReference.test(definition.keyValue)
|
|
8447
|
-
?
|
|
8489
|
+
? 35 /* CommandResult.InvalidScorecardKeyValue */
|
|
8448
8490
|
: 0 /* CommandResult.Success */;
|
|
8449
8491
|
}
|
|
8450
8492
|
function checkBaseline(definition) {
|
|
8451
8493
|
return definition.baseline && !rangeReference.test(definition.baseline)
|
|
8452
|
-
?
|
|
8494
|
+
? 36 /* CommandResult.InvalidScorecardBaseline */
|
|
8453
8495
|
: 0 /* CommandResult.Success */;
|
|
8454
8496
|
}
|
|
8455
8497
|
class ScorecardChart$1 extends AbstractChart {
|
|
@@ -8878,7 +8920,7 @@ class GaugeChartConfigPanel extends Component {
|
|
|
8878
8920
|
}
|
|
8879
8921
|
get isDataRangeInvalid() {
|
|
8880
8922
|
var _a;
|
|
8881
|
-
return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
8923
|
+
return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.InvalidGaugeDataRange */));
|
|
8882
8924
|
}
|
|
8883
8925
|
onDataRangeChanged(ranges) {
|
|
8884
8926
|
this.dataRange = ranges[0];
|
|
@@ -8965,28 +9007,28 @@ class GaugeChartDesignPanel extends Component {
|
|
|
8965
9007
|
}
|
|
8966
9008
|
isRangeMinInvalid() {
|
|
8967
9009
|
var _a, _b, _c;
|
|
8968
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
8969
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
8970
|
-
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(
|
|
9010
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(38 /* CommandResult.EmptyGaugeRangeMin */)) ||
|
|
9011
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(39 /* CommandResult.GaugeRangeMinNaN */)) ||
|
|
9012
|
+
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
|
|
8971
9013
|
}
|
|
8972
9014
|
isRangeMaxInvalid() {
|
|
8973
9015
|
var _a, _b, _c;
|
|
8974
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
8975
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
8976
|
-
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(
|
|
9016
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMax */)) ||
|
|
9017
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(41 /* CommandResult.GaugeRangeMaxNaN */)) ||
|
|
9018
|
+
((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
|
|
8977
9019
|
}
|
|
8978
9020
|
// ---------------------------------------------------------------------------
|
|
8979
9021
|
// COLOR_SECTION_TEMPLATE
|
|
8980
9022
|
// ---------------------------------------------------------------------------
|
|
8981
9023
|
get isLowerInflectionPointInvalid() {
|
|
8982
9024
|
var _a, _b;
|
|
8983
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
8984
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
9025
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
|
|
9026
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
|
|
8985
9027
|
}
|
|
8986
9028
|
get isUpperInflectionPointInvalid() {
|
|
8987
9029
|
var _a, _b;
|
|
8988
|
-
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
8989
|
-
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(
|
|
9030
|
+
return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(44 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
|
|
9031
|
+
((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
|
|
8990
9032
|
}
|
|
8991
9033
|
updateInflectionPointValue(attr, ev) {
|
|
8992
9034
|
const sectionRule = deepCopy(this.props.definition.sectionRule);
|
|
@@ -9089,11 +9131,11 @@ class ScorecardChartConfigPanel extends Component {
|
|
|
9089
9131
|
}
|
|
9090
9132
|
get isKeyValueInvalid() {
|
|
9091
9133
|
var _a;
|
|
9092
|
-
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
9134
|
+
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardKeyValue */));
|
|
9093
9135
|
}
|
|
9094
9136
|
get isBaselineInvalid() {
|
|
9095
9137
|
var _a;
|
|
9096
|
-
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(
|
|
9138
|
+
return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidScorecardBaseline */));
|
|
9097
9139
|
}
|
|
9098
9140
|
onKeyValueRangeChanged(ranges) {
|
|
9099
9141
|
this.keyValue = ranges[0];
|
|
@@ -9786,7 +9828,7 @@ class ConditionalFormattingPanel extends Component {
|
|
|
9786
9828
|
rule: this.getEditorRule(),
|
|
9787
9829
|
id: this.state.mode === "edit"
|
|
9788
9830
|
? this.state.currentCF.id
|
|
9789
|
-
: this.env.model.uuidGenerator.
|
|
9831
|
+
: this.env.model.uuidGenerator.smallUuid(),
|
|
9790
9832
|
},
|
|
9791
9833
|
ranges: this.state.currentCF.ranges.map((xc) => this.env.model.getters.getRangeDataFromXc(sheetId, xc)),
|
|
9792
9834
|
sheetId,
|
|
@@ -9854,7 +9896,7 @@ class ConditionalFormattingPanel extends Component {
|
|
|
9854
9896
|
this.state.mode = "add";
|
|
9855
9897
|
this.state.currentCFType = "CellIsRule";
|
|
9856
9898
|
this.state.currentCF = {
|
|
9857
|
-
id: this.env.model.uuidGenerator.
|
|
9899
|
+
id: this.env.model.uuidGenerator.smallUuid(),
|
|
9858
9900
|
ranges: this.env.model.getters
|
|
9859
9901
|
.getSelectedZones()
|
|
9860
9902
|
.map((zone) => this.env.model.getters.zoneToXC(this.env.model.getters.getActiveSheetId(), zone)),
|
|
@@ -9933,11 +9975,11 @@ class ConditionalFormattingPanel extends Component {
|
|
|
9933
9975
|
****************************************************************************/
|
|
9934
9976
|
get isValue1Invalid() {
|
|
9935
9977
|
var _a;
|
|
9936
|
-
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(
|
|
9978
|
+
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.FirstArgMissing */));
|
|
9937
9979
|
}
|
|
9938
9980
|
get isValue2Invalid() {
|
|
9939
9981
|
var _a;
|
|
9940
|
-
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(
|
|
9982
|
+
return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(53 /* CommandResult.SecondArgMissing */));
|
|
9941
9983
|
}
|
|
9942
9984
|
toggleStyle(tool) {
|
|
9943
9985
|
const style = this.state.rules.cellIs.style;
|
|
@@ -9954,17 +9996,17 @@ class ConditionalFormattingPanel extends Component {
|
|
|
9954
9996
|
isValueInvalid(threshold) {
|
|
9955
9997
|
switch (threshold) {
|
|
9956
9998
|
case "minimum":
|
|
9957
|
-
return (this.state.errors.includes(
|
|
9958
|
-
this.state.errors.includes(
|
|
9959
|
-
this.state.errors.includes(
|
|
9960
|
-
this.state.errors.includes(
|
|
9999
|
+
return (this.state.errors.includes(59 /* CommandResult.MinInvalidFormula */) ||
|
|
10000
|
+
this.state.errors.includes(51 /* CommandResult.MinBiggerThanMid */) ||
|
|
10001
|
+
this.state.errors.includes(48 /* CommandResult.MinBiggerThanMax */) ||
|
|
10002
|
+
this.state.errors.includes(54 /* CommandResult.MinNaN */));
|
|
9961
10003
|
case "midpoint":
|
|
9962
|
-
return (this.state.errors.includes(
|
|
9963
|
-
this.state.errors.includes(
|
|
9964
|
-
this.state.errors.includes(
|
|
10004
|
+
return (this.state.errors.includes(60 /* CommandResult.MidInvalidFormula */) ||
|
|
10005
|
+
this.state.errors.includes(55 /* CommandResult.MidNaN */) ||
|
|
10006
|
+
this.state.errors.includes(50 /* CommandResult.MidBiggerThanMax */));
|
|
9965
10007
|
case "maximum":
|
|
9966
|
-
return (this.state.errors.includes(
|
|
9967
|
-
this.state.errors.includes(
|
|
10008
|
+
return (this.state.errors.includes(61 /* CommandResult.MaxInvalidFormula */) ||
|
|
10009
|
+
this.state.errors.includes(56 /* CommandResult.MaxNaN */));
|
|
9968
10010
|
default:
|
|
9969
10011
|
return false;
|
|
9970
10012
|
}
|
|
@@ -10016,13 +10058,13 @@ class ConditionalFormattingPanel extends Component {
|
|
|
10016
10058
|
isInflectionPointInvalid(inflectionPoint) {
|
|
10017
10059
|
switch (inflectionPoint) {
|
|
10018
10060
|
case "lowerInflectionPoint":
|
|
10019
|
-
return (this.state.errors.includes(
|
|
10020
|
-
this.state.errors.includes(
|
|
10021
|
-
this.state.errors.includes(
|
|
10061
|
+
return (this.state.errors.includes(58 /* CommandResult.ValueLowerInflectionNaN */) ||
|
|
10062
|
+
this.state.errors.includes(63 /* CommandResult.ValueLowerInvalidFormula */) ||
|
|
10063
|
+
this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
|
|
10022
10064
|
case "upperInflectionPoint":
|
|
10023
|
-
return (this.state.errors.includes(
|
|
10024
|
-
this.state.errors.includes(
|
|
10025
|
-
this.state.errors.includes(
|
|
10065
|
+
return (this.state.errors.includes(57 /* CommandResult.ValueUpperInflectionNaN */) ||
|
|
10066
|
+
this.state.errors.includes(62 /* CommandResult.ValueUpperInvalidFormula */) ||
|
|
10067
|
+
this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
|
|
10026
10068
|
default:
|
|
10027
10069
|
return true;
|
|
10028
10070
|
}
|
|
@@ -10342,7 +10384,7 @@ class TopBarComponentRegistry extends Registry {
|
|
|
10342
10384
|
this.uuidGenerator = new UuidGenerator();
|
|
10343
10385
|
}
|
|
10344
10386
|
add(name, value) {
|
|
10345
|
-
const component = { ...value, id: this.uuidGenerator.
|
|
10387
|
+
const component = { ...value, id: this.uuidGenerator.smallUuid() };
|
|
10346
10388
|
return super.add(name, component);
|
|
10347
10389
|
}
|
|
10348
10390
|
}
|
|
@@ -12340,6 +12382,26 @@ const LN = {
|
|
|
12340
12382
|
isExported: true,
|
|
12341
12383
|
};
|
|
12342
12384
|
// -----------------------------------------------------------------------------
|
|
12385
|
+
// LOG
|
|
12386
|
+
// -----------------------------------------------------------------------------
|
|
12387
|
+
const LOG = {
|
|
12388
|
+
description: _lt("The logarithm of a number, for a given base."),
|
|
12389
|
+
args: args(`
|
|
12390
|
+
value (number) ${_lt("The value for which to calculate the logarithm, base e.")}
|
|
12391
|
+
base (number, default=10) ${_lt("The base of the logarithm.")}
|
|
12392
|
+
`),
|
|
12393
|
+
returns: ["NUMBER"],
|
|
12394
|
+
compute: function (value, base = 10) {
|
|
12395
|
+
const _value = toNumber(value);
|
|
12396
|
+
const _base = toNumber(base);
|
|
12397
|
+
assert(() => _value > 0, _lt("The value (%s) must be strictly positive.", _value.toString()));
|
|
12398
|
+
assert(() => _base > 0, _lt("The base (%s) must be strictly positive.", _base.toString()));
|
|
12399
|
+
assert(() => _base !== 1, _lt("The base must be different from 1."));
|
|
12400
|
+
return Math.log10(_value) / Math.log10(_base);
|
|
12401
|
+
},
|
|
12402
|
+
isExported: true,
|
|
12403
|
+
};
|
|
12404
|
+
// -----------------------------------------------------------------------------
|
|
12343
12405
|
// MOD
|
|
12344
12406
|
// -----------------------------------------------------------------------------
|
|
12345
12407
|
const MOD = {
|
|
@@ -12808,6 +12870,7 @@ var math = /*#__PURE__*/Object.freeze({
|
|
|
12808
12870
|
ISO_CEILING: ISO_CEILING,
|
|
12809
12871
|
ISODD: ISODD,
|
|
12810
12872
|
LN: LN,
|
|
12873
|
+
LOG: LOG,
|
|
12811
12874
|
MOD: MOD,
|
|
12812
12875
|
ODD: ODD,
|
|
12813
12876
|
PI: PI,
|
|
@@ -19684,7 +19747,7 @@ class EditionPlugin extends UIPlugin {
|
|
|
19684
19747
|
validateSelection(length, start, end) {
|
|
19685
19748
|
return start >= 0 && start <= length && end >= 0 && end <= length
|
|
19686
19749
|
? 0 /* CommandResult.Success */
|
|
19687
|
-
:
|
|
19750
|
+
: 47 /* CommandResult.WrongComposerSelection */;
|
|
19688
19751
|
}
|
|
19689
19752
|
onColumnsRemoved(cmd) {
|
|
19690
19753
|
if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
|
|
@@ -27244,7 +27307,7 @@ function forceUnicityOfFigure(data) {
|
|
|
27244
27307
|
for (const sheet of data.sheets || []) {
|
|
27245
27308
|
for (const figure of sheet.figures || []) {
|
|
27246
27309
|
if (figureIds.has(figure.id)) {
|
|
27247
|
-
figure.id += uuidGenerator.
|
|
27310
|
+
figure.id += uuidGenerator.smallUuid();
|
|
27248
27311
|
}
|
|
27249
27312
|
figureIds.add(figure.id);
|
|
27250
27313
|
}
|
|
@@ -27929,7 +27992,7 @@ class BordersPlugin extends CorePlugin {
|
|
|
27929
27992
|
const currentBorder = this.getCellBorder(cmd.sheetId, cmd.col, cmd.row);
|
|
27930
27993
|
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);
|
|
27931
27994
|
if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
|
|
27932
|
-
return
|
|
27995
|
+
return 89 /* CommandResult.NoChanges */;
|
|
27933
27996
|
}
|
|
27934
27997
|
return 0 /* CommandResult.Success */;
|
|
27935
27998
|
}
|
|
@@ -28035,11 +28098,16 @@ class CellPlugin extends CorePlugin {
|
|
|
28035
28098
|
// Command Handling
|
|
28036
28099
|
// ---------------------------------------------------------------------------
|
|
28037
28100
|
allowDispatch(cmd) {
|
|
28101
|
+
var _a;
|
|
28038
28102
|
switch (cmd.type) {
|
|
28039
28103
|
case "UPDATE_CELL":
|
|
28040
28104
|
return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
|
|
28041
28105
|
case "CLEAR_CELL":
|
|
28042
28106
|
return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
|
|
28107
|
+
case "UPDATE_CELL_POSITION":
|
|
28108
|
+
return !cmd.cellId || ((_a = this.cells[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a[cmd.cellId])
|
|
28109
|
+
? 0 /* CommandResult.Success */
|
|
28110
|
+
: 28 /* CommandResult.InvalidCellId */;
|
|
28043
28111
|
default:
|
|
28044
28112
|
return 0 /* CommandResult.Success */;
|
|
28045
28113
|
}
|
|
@@ -28078,6 +28146,9 @@ class CellPlugin extends CorePlugin {
|
|
|
28078
28146
|
format: "",
|
|
28079
28147
|
});
|
|
28080
28148
|
break;
|
|
28149
|
+
case "DELETE_SHEET": {
|
|
28150
|
+
this.history.update("cells", cmd.sheetId, undefined);
|
|
28151
|
+
}
|
|
28081
28152
|
}
|
|
28082
28153
|
}
|
|
28083
28154
|
/**
|
|
@@ -28393,9 +28464,9 @@ class CellPlugin extends CorePlugin {
|
|
|
28393
28464
|
checkUselessClearCell(cmd) {
|
|
28394
28465
|
const cell = this.getters.getCell(cmd.sheetId, cmd.col, cmd.row);
|
|
28395
28466
|
if (!cell)
|
|
28396
|
-
return
|
|
28467
|
+
return 89 /* CommandResult.NoChanges */;
|
|
28397
28468
|
if (!cell.content && !cell.style && !cell.format) {
|
|
28398
|
-
return
|
|
28469
|
+
return 89 /* CommandResult.NoChanges */;
|
|
28399
28470
|
}
|
|
28400
28471
|
return 0 /* CommandResult.Success */;
|
|
28401
28472
|
}
|
|
@@ -28407,7 +28478,7 @@ class CellPlugin extends CorePlugin {
|
|
|
28407
28478
|
if ((!hasContent || (cell === null || cell === void 0 ? void 0 : cell.content) === cmd.content) &&
|
|
28408
28479
|
(!hasStyle || deepEquals(cell === null || cell === void 0 ? void 0 : cell.style, cmd.style)) &&
|
|
28409
28480
|
(!hasFormat || (cell === null || cell === void 0 ? void 0 : cell.format) === cmd.format)) {
|
|
28410
|
-
return
|
|
28481
|
+
return 89 /* CommandResult.NoChanges */;
|
|
28411
28482
|
}
|
|
28412
28483
|
return 0 /* CommandResult.Success */;
|
|
28413
28484
|
}
|
|
@@ -28616,13 +28687,13 @@ class ChartPlugin extends CorePlugin {
|
|
|
28616
28687
|
}
|
|
28617
28688
|
checkChartDuplicate(cmd) {
|
|
28618
28689
|
return this.getters.getFigureSheetId(cmd.id)
|
|
28619
|
-
?
|
|
28690
|
+
? 85 /* CommandResult.DuplicatedChartId */
|
|
28620
28691
|
: 0 /* CommandResult.Success */;
|
|
28621
28692
|
}
|
|
28622
28693
|
checkChartExists(cmd) {
|
|
28623
28694
|
return this.getters.getFigureSheetId(cmd.id)
|
|
28624
28695
|
? 0 /* CommandResult.Success */
|
|
28625
|
-
:
|
|
28696
|
+
: 86 /* CommandResult.ChartDoesNotExist */;
|
|
28626
28697
|
}
|
|
28627
28698
|
}
|
|
28628
28699
|
ChartPlugin.getters = [
|
|
@@ -28830,10 +28901,10 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
28830
28901
|
return 27 /* CommandResult.InvalidSheetId */;
|
|
28831
28902
|
const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
|
|
28832
28903
|
if (ruleIndex === -1)
|
|
28833
|
-
return
|
|
28904
|
+
return 72 /* CommandResult.InvalidConditionalFormatId */;
|
|
28834
28905
|
const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
|
|
28835
28906
|
if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
|
|
28836
|
-
return
|
|
28907
|
+
return 72 /* CommandResult.InvalidConditionalFormatId */;
|
|
28837
28908
|
}
|
|
28838
28909
|
return 0 /* CommandResult.Success */;
|
|
28839
28910
|
}
|
|
@@ -28874,10 +28945,10 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
28874
28945
|
const errors = [];
|
|
28875
28946
|
const isEmpty = (value) => value === undefined || value === "";
|
|
28876
28947
|
if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
|
|
28877
|
-
errors.push(
|
|
28948
|
+
errors.push(52 /* CommandResult.FirstArgMissing */);
|
|
28878
28949
|
}
|
|
28879
28950
|
if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
|
|
28880
|
-
errors.push(
|
|
28951
|
+
errors.push(53 /* CommandResult.SecondArgMissing */);
|
|
28881
28952
|
}
|
|
28882
28953
|
return errors.length ? errors : 0 /* CommandResult.Success */;
|
|
28883
28954
|
}
|
|
@@ -28889,15 +28960,15 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
28889
28960
|
(threshold.value === "" || isNaN(threshold.value))) {
|
|
28890
28961
|
switch (thresholdName) {
|
|
28891
28962
|
case "min":
|
|
28892
|
-
return
|
|
28963
|
+
return 54 /* CommandResult.MinNaN */;
|
|
28893
28964
|
case "max":
|
|
28894
|
-
return
|
|
28965
|
+
return 56 /* CommandResult.MaxNaN */;
|
|
28895
28966
|
case "mid":
|
|
28896
|
-
return
|
|
28967
|
+
return 55 /* CommandResult.MidNaN */;
|
|
28897
28968
|
case "upperInflectionPoint":
|
|
28898
|
-
return
|
|
28969
|
+
return 57 /* CommandResult.ValueUpperInflectionNaN */;
|
|
28899
28970
|
case "lowerInflectionPoint":
|
|
28900
|
-
return
|
|
28971
|
+
return 58 /* CommandResult.ValueLowerInflectionNaN */;
|
|
28901
28972
|
}
|
|
28902
28973
|
}
|
|
28903
28974
|
return 0 /* CommandResult.Success */;
|
|
@@ -28911,15 +28982,15 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
28911
28982
|
catch (error) {
|
|
28912
28983
|
switch (thresholdName) {
|
|
28913
28984
|
case "min":
|
|
28914
|
-
return
|
|
28985
|
+
return 59 /* CommandResult.MinInvalidFormula */;
|
|
28915
28986
|
case "max":
|
|
28916
|
-
return
|
|
28987
|
+
return 61 /* CommandResult.MaxInvalidFormula */;
|
|
28917
28988
|
case "mid":
|
|
28918
|
-
return
|
|
28989
|
+
return 60 /* CommandResult.MidInvalidFormula */;
|
|
28919
28990
|
case "upperInflectionPoint":
|
|
28920
|
-
return
|
|
28991
|
+
return 62 /* CommandResult.ValueUpperInvalidFormula */;
|
|
28921
28992
|
case "lowerInflectionPoint":
|
|
28922
|
-
return
|
|
28993
|
+
return 63 /* CommandResult.ValueLowerInvalidFormula */;
|
|
28923
28994
|
}
|
|
28924
28995
|
}
|
|
28925
28996
|
return 0 /* CommandResult.Success */;
|
|
@@ -28936,7 +29007,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
28936
29007
|
if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
|
|
28937
29008
|
rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
|
|
28938
29009
|
Number(minValue) > Number(maxValue)) {
|
|
28939
|
-
return
|
|
29010
|
+
return 49 /* CommandResult.LowerBiggerThanUpper */;
|
|
28940
29011
|
}
|
|
28941
29012
|
return 0 /* CommandResult.Success */;
|
|
28942
29013
|
}
|
|
@@ -28946,7 +29017,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
28946
29017
|
if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
|
|
28947
29018
|
rule.minimum.type === rule.maximum.type &&
|
|
28948
29019
|
stringToNumber(minValue) >= stringToNumber(maxValue)) {
|
|
28949
|
-
return
|
|
29020
|
+
return 48 /* CommandResult.MinBiggerThanMax */;
|
|
28950
29021
|
}
|
|
28951
29022
|
return 0 /* CommandResult.Success */;
|
|
28952
29023
|
}
|
|
@@ -28958,7 +29029,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
28958
29029
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
28959
29030
|
rule.midpoint.type === rule.maximum.type &&
|
|
28960
29031
|
stringToNumber(midValue) >= stringToNumber(maxValue)) {
|
|
28961
|
-
return
|
|
29032
|
+
return 50 /* CommandResult.MidBiggerThanMax */;
|
|
28962
29033
|
}
|
|
28963
29034
|
return 0 /* CommandResult.Success */;
|
|
28964
29035
|
}
|
|
@@ -28970,7 +29041,7 @@ class ConditionalFormatPlugin extends CorePlugin {
|
|
|
28970
29041
|
["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
|
|
28971
29042
|
rule.minimum.type === rule.midpoint.type &&
|
|
28972
29043
|
stringToNumber(minValue) >= stringToNumber(midValue)) {
|
|
28973
|
-
return
|
|
29044
|
+
return 51 /* CommandResult.MinBiggerThanMid */;
|
|
28974
29045
|
}
|
|
28975
29046
|
return 0 /* CommandResult.Success */;
|
|
28976
29047
|
}
|
|
@@ -29080,13 +29151,13 @@ class FigurePlugin extends CorePlugin {
|
|
|
29080
29151
|
checkFigureExists(sheetId, figureId) {
|
|
29081
29152
|
var _a;
|
|
29082
29153
|
if (((_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === undefined) {
|
|
29083
|
-
return
|
|
29154
|
+
return 71 /* CommandResult.FigureDoesNotExist */;
|
|
29084
29155
|
}
|
|
29085
29156
|
return 0 /* CommandResult.Success */;
|
|
29086
29157
|
}
|
|
29087
29158
|
checkFigureDuplicate(figureId) {
|
|
29088
29159
|
if (Object.values(this.figures).find((sheet) => sheet === null || sheet === void 0 ? void 0 : sheet[figureId])) {
|
|
29089
|
-
return
|
|
29160
|
+
return 83 /* CommandResult.DuplicatedFigureId */;
|
|
29090
29161
|
}
|
|
29091
29162
|
return 0 /* CommandResult.Success */;
|
|
29092
29163
|
}
|
|
@@ -29134,10 +29205,10 @@ class FilterTable {
|
|
|
29134
29205
|
this.filters = [];
|
|
29135
29206
|
this.zone = zone;
|
|
29136
29207
|
const uuid = new UuidGenerator();
|
|
29137
|
-
this.id = uuid.
|
|
29208
|
+
this.id = uuid.smallUuid();
|
|
29138
29209
|
for (const i of range(zone.left, zone.right + 1)) {
|
|
29139
29210
|
const filterZone = { ...this.zone, left: i, right: i };
|
|
29140
|
-
this.filters.push(new Filter(uuid.
|
|
29211
|
+
this.filters.push(new Filter(uuid.smallUuid(), filterZone));
|
|
29141
29212
|
}
|
|
29142
29213
|
}
|
|
29143
29214
|
/** Get zone of the table without the headers */
|
|
@@ -29188,12 +29259,12 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29188
29259
|
switch (cmd.type) {
|
|
29189
29260
|
case "CREATE_FILTER_TABLE":
|
|
29190
29261
|
if (!areZonesContinuous(...cmd.target)) {
|
|
29191
|
-
return
|
|
29262
|
+
return 82 /* CommandResult.NonContinuousTargets */;
|
|
29192
29263
|
}
|
|
29193
29264
|
const zone = union(...cmd.target);
|
|
29194
29265
|
const checkFilterOverlap = () => {
|
|
29195
29266
|
if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
|
|
29196
|
-
return
|
|
29267
|
+
return 79 /* CommandResult.FilterOverlap */;
|
|
29197
29268
|
}
|
|
29198
29269
|
return 0 /* CommandResult.Success */;
|
|
29199
29270
|
};
|
|
@@ -29201,7 +29272,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29201
29272
|
const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
|
|
29202
29273
|
for (let merge of mergesInTarget) {
|
|
29203
29274
|
if (overlap(zone, merge)) {
|
|
29204
|
-
return
|
|
29275
|
+
return 81 /* CommandResult.MergeInFilter */;
|
|
29205
29276
|
}
|
|
29206
29277
|
}
|
|
29207
29278
|
return 0 /* CommandResult.Success */;
|
|
@@ -29211,7 +29282,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29211
29282
|
for (let merge of cmd.target) {
|
|
29212
29283
|
for (let filterTable of this.getFilterTables(cmd.sheetId)) {
|
|
29213
29284
|
if (overlap(filterTable.zone, merge)) {
|
|
29214
|
-
return
|
|
29285
|
+
return 81 /* CommandResult.MergeInFilter */;
|
|
29215
29286
|
}
|
|
29216
29287
|
}
|
|
29217
29288
|
}
|
|
@@ -29317,7 +29388,7 @@ class FiltersPlugin extends CorePlugin {
|
|
|
29317
29388
|
if (filters.length < zoneToDimension(zone).width) {
|
|
29318
29389
|
for (let col = zone.left; col <= zone.right; col++) {
|
|
29319
29390
|
if (!filters.find((filter) => filter.col === col)) {
|
|
29320
|
-
filters.push(new Filter(this.uuidGenerator.
|
|
29391
|
+
filters.push(new Filter(this.uuidGenerator.smallUuid(), { ...zone, left: col, right: col }));
|
|
29321
29392
|
}
|
|
29322
29393
|
}
|
|
29323
29394
|
filters.sort((f1, f2) => f1.col - f2.col);
|
|
@@ -29721,10 +29792,10 @@ class HeaderVisibilityPlugin extends CorePlugin {
|
|
|
29721
29792
|
: this.getters.getNumberRows(cmd.sheetId);
|
|
29722
29793
|
const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
|
|
29723
29794
|
if (hiddenElements.size >= elements) {
|
|
29724
|
-
return
|
|
29795
|
+
return 67 /* CommandResult.TooManyHiddenElements */;
|
|
29725
29796
|
}
|
|
29726
29797
|
else if (largeMin(cmd.elements) < 0 || largeMax(cmd.elements) > elements) {
|
|
29727
|
-
return
|
|
29798
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
29728
29799
|
}
|
|
29729
29800
|
else {
|
|
29730
29801
|
return 0 /* CommandResult.Success */;
|
|
@@ -30127,7 +30198,7 @@ class MergePlugin extends CorePlugin {
|
|
|
30127
30198
|
for (const zone of target) {
|
|
30128
30199
|
for (const zone2 of target) {
|
|
30129
30200
|
if (zone !== zone2 && overlap(zone, zone2)) {
|
|
30130
|
-
return
|
|
30201
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
30131
30202
|
}
|
|
30132
30203
|
}
|
|
30133
30204
|
}
|
|
@@ -30141,7 +30212,7 @@ class MergePlugin extends CorePlugin {
|
|
|
30141
30212
|
for (const zone of target) {
|
|
30142
30213
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
30143
30214
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
30144
|
-
return
|
|
30215
|
+
return 76 /* CommandResult.FrozenPaneOverlap */;
|
|
30145
30216
|
}
|
|
30146
30217
|
}
|
|
30147
30218
|
return 0 /* CommandResult.Success */;
|
|
@@ -30359,6 +30430,9 @@ class SheetPlugin extends CorePlugin {
|
|
|
30359
30430
|
case "CREATE_SHEET": {
|
|
30360
30431
|
return this.checkValidations(cmd, this.checkSheetName, this.checkSheetPosition);
|
|
30361
30432
|
}
|
|
30433
|
+
case "DUPLICATE_SHEET": {
|
|
30434
|
+
return this.sheets[cmd.sheetIdTo] ? 12 /* CommandResult.DuplicatedSheetId */ : 0 /* CommandResult.Success */;
|
|
30435
|
+
}
|
|
30362
30436
|
case "MOVE_SHEET":
|
|
30363
30437
|
const currentIndex = this.orderedSheetIds.indexOf(cmd.sheetId);
|
|
30364
30438
|
if (cmd.direction === "left") {
|
|
@@ -30380,7 +30454,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
30380
30454
|
case "RENAME_SHEET":
|
|
30381
30455
|
return this.isRenameAllowed(cmd);
|
|
30382
30456
|
case "DELETE_SHEET":
|
|
30383
|
-
return this.
|
|
30457
|
+
return this.getVisibleSheetIds().length > 1
|
|
30384
30458
|
? 0 /* CommandResult.Success */
|
|
30385
30459
|
: 9 /* CommandResult.NotEnoughSheets */;
|
|
30386
30460
|
case "ADD_COLUMNS_ROWS":
|
|
@@ -30388,10 +30462,10 @@ class SheetPlugin extends CorePlugin {
|
|
|
30388
30462
|
? this.getNumberCols(cmd.sheetId)
|
|
30389
30463
|
: this.getNumberRows(cmd.sheetId);
|
|
30390
30464
|
if (cmd.base < 0 || cmd.base >= elements) {
|
|
30391
|
-
return
|
|
30465
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
30392
30466
|
}
|
|
30393
30467
|
else if (cmd.quantity <= 0) {
|
|
30394
|
-
return
|
|
30468
|
+
return 88 /* CommandResult.InvalidQuantity */;
|
|
30395
30469
|
}
|
|
30396
30470
|
return 0 /* CommandResult.Success */;
|
|
30397
30471
|
case "REMOVE_COLUMNS_ROWS": {
|
|
@@ -30399,7 +30473,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
30399
30473
|
? this.getNumberCols(cmd.sheetId)
|
|
30400
30474
|
: this.getNumberRows(cmd.sheetId);
|
|
30401
30475
|
if (largeMin(cmd.elements) < 0 || largeMax(cmd.elements) > elements) {
|
|
30402
|
-
return
|
|
30476
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
30403
30477
|
}
|
|
30404
30478
|
else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
|
|
30405
30479
|
return 8 /* CommandResult.NotEnoughElements */;
|
|
@@ -30856,18 +30930,18 @@ class SheetPlugin extends CorePlugin {
|
|
|
30856
30930
|
checkRowFreezeQuantity(cmd) {
|
|
30857
30931
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
|
|
30858
30932
|
? 0 /* CommandResult.Success */
|
|
30859
|
-
:
|
|
30933
|
+
: 75 /* CommandResult.InvalidFreezeQuantity */;
|
|
30860
30934
|
}
|
|
30861
30935
|
checkColFreezeQuantity(cmd) {
|
|
30862
30936
|
return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
|
|
30863
30937
|
? 0 /* CommandResult.Success */
|
|
30864
|
-
:
|
|
30938
|
+
: 75 /* CommandResult.InvalidFreezeQuantity */;
|
|
30865
30939
|
}
|
|
30866
30940
|
checkRowFreezeOverlapMerge(cmd) {
|
|
30867
30941
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
30868
30942
|
for (let merge of merges) {
|
|
30869
30943
|
if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
|
|
30870
|
-
return
|
|
30944
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
30871
30945
|
}
|
|
30872
30946
|
}
|
|
30873
30947
|
return 0 /* CommandResult.Success */;
|
|
@@ -30876,7 +30950,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
30876
30950
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
30877
30951
|
for (let merge of merges) {
|
|
30878
30952
|
if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
|
|
30879
|
-
return
|
|
30953
|
+
return 66 /* CommandResult.MergeOverlap */;
|
|
30880
30954
|
}
|
|
30881
30955
|
}
|
|
30882
30956
|
return 0 /* CommandResult.Success */;
|
|
@@ -31186,6 +31260,9 @@ class SheetPlugin extends CorePlugin {
|
|
|
31186
31260
|
zones.push(...cmd.target);
|
|
31187
31261
|
}
|
|
31188
31262
|
if ("ranges" in cmd && Array.isArray(cmd.ranges)) {
|
|
31263
|
+
if (cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) {
|
|
31264
|
+
return 27 /* CommandResult.InvalidSheetId */;
|
|
31265
|
+
}
|
|
31189
31266
|
zones.push(...cmd.ranges.map((rangeData) => this.getters.getRangeFromRangeData(rangeData).zone));
|
|
31190
31267
|
}
|
|
31191
31268
|
if (!zones.every(isZoneValid)) {
|
|
@@ -31307,7 +31384,7 @@ class AutofillPlugin extends UIPlugin {
|
|
|
31307
31384
|
if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
|
|
31308
31385
|
return 0 /* CommandResult.Success */;
|
|
31309
31386
|
}
|
|
31310
|
-
return
|
|
31387
|
+
return 46 /* CommandResult.InvalidAutofillSelection */;
|
|
31311
31388
|
case "AUTOFILL_AUTO":
|
|
31312
31389
|
const zone = this.getters.getSelectedZone();
|
|
31313
31390
|
return zone.top === zone.bottom
|
|
@@ -31907,7 +31984,7 @@ class CellPopoverPlugin extends UIPlugin {
|
|
|
31907
31984
|
cellPopoverRegistry.get(cmd.popoverType);
|
|
31908
31985
|
}
|
|
31909
31986
|
catch (error) {
|
|
31910
|
-
return
|
|
31987
|
+
return 73 /* CommandResult.InvalidCellPopover */;
|
|
31911
31988
|
}
|
|
31912
31989
|
return 0 /* CommandResult.Success */;
|
|
31913
31990
|
default:
|
|
@@ -32131,7 +32208,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
|
|
|
32131
32208
|
for (const zone of this.getPasteZones(target)) {
|
|
32132
32209
|
if ((zone.left < xSplit && zone.right >= xSplit) ||
|
|
32133
32210
|
(zone.top < ySplit && zone.bottom >= ySplit)) {
|
|
32134
|
-
return
|
|
32211
|
+
return 76 /* CommandResult.FrozenPaneOverlap */;
|
|
32135
32212
|
}
|
|
32136
32213
|
}
|
|
32137
32214
|
return 0 /* CommandResult.Success */;
|
|
@@ -32491,7 +32568,7 @@ class ClipboardFigureState {
|
|
|
32491
32568
|
}
|
|
32492
32569
|
isPasteAllowed(target, option) {
|
|
32493
32570
|
if (target.length === 0) {
|
|
32494
|
-
return
|
|
32571
|
+
return 74 /* CommandResult.EmptyTarget */;
|
|
32495
32572
|
}
|
|
32496
32573
|
if ((option === null || option === void 0 ? void 0 : option.pasteOption) !== undefined) {
|
|
32497
32574
|
return 22 /* CommandResult.WrongFigurePasteOption */;
|
|
@@ -32508,7 +32585,7 @@ class ClipboardFigureState {
|
|
|
32508
32585
|
y: this.getters.getRowDimensions(sheetId, target[0].top).start,
|
|
32509
32586
|
};
|
|
32510
32587
|
const newChart = this.copiedChart.copyInSheetId(sheetId);
|
|
32511
|
-
const newId = new UuidGenerator().
|
|
32588
|
+
const newId = new UuidGenerator().smallUuid();
|
|
32512
32589
|
this.dispatch("CREATE_CHART", {
|
|
32513
32590
|
id: newId,
|
|
32514
32591
|
sheetId,
|
|
@@ -33638,7 +33715,9 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
|
|
|
33638
33715
|
const cfInTarget = this.getters
|
|
33639
33716
|
.getConditionalFormats(targetSheetId)
|
|
33640
33717
|
.find((cf) => cf.stopIfTrue === originCF.stopIfTrue && deepEquals(cf.rule, originCF.rule));
|
|
33641
|
-
return cfInTarget
|
|
33718
|
+
return cfInTarget
|
|
33719
|
+
? cfInTarget
|
|
33720
|
+
: { ...originCF, id: this.uuidGenerator.smallUuid(), ranges: [] };
|
|
33642
33721
|
}
|
|
33643
33722
|
}
|
|
33644
33723
|
EvaluationConditionalFormatPlugin.getters = ["getConditionalIcon", "getCellComputedStyle"];
|
|
@@ -33654,7 +33733,7 @@ class FilterEvaluationPlugin extends UIPlugin {
|
|
|
33654
33733
|
switch (cmd.type) {
|
|
33655
33734
|
case "UPDATE_FILTER":
|
|
33656
33735
|
if (!this.getters.getFilterId(cmd.sheetId, cmd.col, cmd.row)) {
|
|
33657
|
-
return
|
|
33736
|
+
return 80 /* CommandResult.FilterNotFound */;
|
|
33658
33737
|
}
|
|
33659
33738
|
break;
|
|
33660
33739
|
}
|
|
@@ -35160,23 +35239,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
35160
35239
|
gridSelection: deepCopy(gridSelection),
|
|
35161
35240
|
};
|
|
35162
35241
|
}
|
|
35163
|
-
|
|
35164
|
-
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
35165
|
-
this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
|
|
35166
|
-
if (this.activeSheet.id in this.sheetsData) {
|
|
35167
|
-
const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
|
|
35168
|
-
this.selectCell(anchor.cell.col, anchor.cell.row);
|
|
35169
|
-
}
|
|
35170
|
-
else {
|
|
35171
|
-
this.selectCell(0, 0);
|
|
35172
|
-
}
|
|
35173
|
-
const { col, row } = this.gridSelection.anchor.cell;
|
|
35174
|
-
this.moveClient({
|
|
35175
|
-
sheetId: this.getters.getActiveSheetId(),
|
|
35176
|
-
col,
|
|
35177
|
-
row,
|
|
35178
|
-
});
|
|
35179
|
-
}
|
|
35242
|
+
this.fallbackToVisibleSheet();
|
|
35180
35243
|
const sheetId = this.getters.getActiveSheetId();
|
|
35181
35244
|
this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
|
|
35182
35245
|
this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
|
|
@@ -35186,6 +35249,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
35186
35249
|
}
|
|
35187
35250
|
}
|
|
35188
35251
|
finalize() {
|
|
35252
|
+
this.fallbackToVisibleSheet();
|
|
35189
35253
|
/** Any change to the selection has to be reflected in the selection processor. */
|
|
35190
35254
|
this.selection.resetDefaultAnchor(this, deepCopy(this.gridSelection.anchor));
|
|
35191
35255
|
}
|
|
@@ -35484,10 +35548,29 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
35484
35548
|
const headers = [cmd.base, ...cmd.elements];
|
|
35485
35549
|
const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
|
|
35486
35550
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
35487
|
-
return
|
|
35551
|
+
return 87 /* CommandResult.InvalidHeaderIndex */;
|
|
35488
35552
|
}
|
|
35489
35553
|
return 0 /* CommandResult.Success */;
|
|
35490
35554
|
}
|
|
35555
|
+
fallbackToVisibleSheet() {
|
|
35556
|
+
if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
|
|
35557
|
+
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
35558
|
+
this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
|
|
35559
|
+
if (this.activeSheet.id in this.sheetsData) {
|
|
35560
|
+
const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
|
|
35561
|
+
this.selectCell(anchor.cell.col, anchor.cell.row);
|
|
35562
|
+
}
|
|
35563
|
+
else {
|
|
35564
|
+
this.selectCell(0, 0);
|
|
35565
|
+
}
|
|
35566
|
+
const { col, row } = this.gridSelection.anchor.cell;
|
|
35567
|
+
this.moveClient({
|
|
35568
|
+
sheetId: this.getters.getActiveSheetId(),
|
|
35569
|
+
col,
|
|
35570
|
+
row,
|
|
35571
|
+
});
|
|
35572
|
+
}
|
|
35573
|
+
}
|
|
35491
35574
|
//-------------------------------------------
|
|
35492
35575
|
// Helpers for extensions
|
|
35493
35576
|
// ------------------------------------------
|
|
@@ -35712,7 +35795,7 @@ class SelectionInputPlugin extends UIPlugin {
|
|
|
35712
35795
|
setContent(index, xc) {
|
|
35713
35796
|
this.ranges[index] = {
|
|
35714
35797
|
...this.ranges[index],
|
|
35715
|
-
id: uuidGenerator.
|
|
35798
|
+
id: uuidGenerator.smallUuid(),
|
|
35716
35799
|
xc,
|
|
35717
35800
|
};
|
|
35718
35801
|
}
|
|
@@ -35827,26 +35910,26 @@ class SelectionInputsManagerPlugin extends UIPlugin {
|
|
|
35827
35910
|
case "ADD_EMPTY_RANGE":
|
|
35828
35911
|
case "REMOVE_RANGE":
|
|
35829
35912
|
if (!this.inputs[cmd.id]) {
|
|
35830
|
-
return
|
|
35913
|
+
return 31 /* CommandResult.InvalidInputId */;
|
|
35831
35914
|
}
|
|
35832
35915
|
}
|
|
35833
35916
|
switch (cmd.type) {
|
|
35834
35917
|
case "FOCUS_RANGE":
|
|
35835
35918
|
const index = (_a = this.currentInput) === null || _a === void 0 ? void 0 : _a.getIndex(cmd.rangeId);
|
|
35836
35919
|
if (this.focusedInputId === cmd.id && ((_b = this.currentInput) === null || _b === void 0 ? void 0 : _b.focusedRangeIndex) === index) {
|
|
35837
|
-
return
|
|
35920
|
+
return 29 /* CommandResult.InputAlreadyFocused */;
|
|
35838
35921
|
}
|
|
35839
35922
|
break;
|
|
35840
35923
|
case "ADD_EMPTY_RANGE":
|
|
35841
35924
|
const input = this.inputs[cmd.id];
|
|
35842
35925
|
if (input.inputHasSingleRange && input.ranges.length === 1) {
|
|
35843
|
-
return
|
|
35926
|
+
return 30 /* CommandResult.MaximumRangesReached */;
|
|
35844
35927
|
}
|
|
35845
35928
|
break;
|
|
35846
35929
|
case "CHANGE_RANGE": {
|
|
35847
35930
|
const input = this.inputs[cmd.id];
|
|
35848
35931
|
if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
35849
|
-
return
|
|
35932
|
+
return 30 /* CommandResult.MaximumRangesReached */;
|
|
35850
35933
|
}
|
|
35851
35934
|
break;
|
|
35852
35935
|
}
|
|
@@ -36037,6 +36120,9 @@ function updateChartRangesTransformation(toTransform, executed) {
|
|
|
36037
36120
|
}
|
|
36038
36121
|
function createSheetTransformation(cmd, executed) {
|
|
36039
36122
|
var _a;
|
|
36123
|
+
if (cmd.sheetId === executed.sheetId) {
|
|
36124
|
+
cmd = { ...cmd, sheetId: `${cmd.sheetId}~` };
|
|
36125
|
+
}
|
|
36040
36126
|
if (cmd.name === executed.name) {
|
|
36041
36127
|
return {
|
|
36042
36128
|
...cmd,
|
|
@@ -36612,21 +36698,14 @@ class Session extends EventBus {
|
|
|
36612
36698
|
if (!message)
|
|
36613
36699
|
return;
|
|
36614
36700
|
if (message.type === "REMOTE_REVISION") {
|
|
36615
|
-
|
|
36701
|
+
let revision = this.revisions.get(message.nextRevisionId);
|
|
36616
36702
|
if (revision.commands.length === 0) {
|
|
36617
36703
|
/**
|
|
36618
|
-
* The command is empty, we have to
|
|
36704
|
+
* The command is empty, we have to rebase all the next local revisions
|
|
36619
36705
|
* to avoid issues with undo/redo
|
|
36620
36706
|
*/
|
|
36621
|
-
this.revisions.
|
|
36622
|
-
|
|
36623
|
-
.filter((message) => message.type === "REMOTE_REVISION")
|
|
36624
|
-
.map((message) => message.nextRevisionId);
|
|
36625
|
-
this.trigger("pending-revisions-dropped", { revisionIds });
|
|
36626
|
-
this.waitingAck = false;
|
|
36627
|
-
this.waitingUndoRedoAck = false;
|
|
36628
|
-
this.pendingMessages = [];
|
|
36629
|
-
return;
|
|
36707
|
+
this.revisions.rebase(revision.id);
|
|
36708
|
+
revision = this.revisions.get(message.nextRevisionId);
|
|
36630
36709
|
}
|
|
36631
36710
|
message = {
|
|
36632
36711
|
...message,
|
|
@@ -36650,7 +36729,6 @@ class Session extends EventBus {
|
|
|
36650
36729
|
switch (message.type) {
|
|
36651
36730
|
case "REMOTE_REVISION":
|
|
36652
36731
|
case "REVISION_REDONE":
|
|
36653
|
-
case "REVISION_UNDONE":
|
|
36654
36732
|
case "SNAPSHOT_CREATED":
|
|
36655
36733
|
this.waitingAck = false;
|
|
36656
36734
|
this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
|
|
@@ -36658,6 +36736,25 @@ class Session extends EventBus {
|
|
|
36658
36736
|
this.processedRevisions.add(message.nextRevisionId);
|
|
36659
36737
|
this.sendPendingMessage();
|
|
36660
36738
|
break;
|
|
36739
|
+
case "REVISION_UNDONE": {
|
|
36740
|
+
this.waitingAck = false;
|
|
36741
|
+
this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
|
|
36742
|
+
const firstPendingRevisionId = this.pendingMessages.findIndex((message) => message.type === "REMOTE_REVISION");
|
|
36743
|
+
if (firstPendingRevisionId !== -1) {
|
|
36744
|
+
/**
|
|
36745
|
+
* Some revisions undergo transformations that may cause issues with
|
|
36746
|
+
* undo/redo if the transformation is destructive (we don't get back
|
|
36747
|
+
* the original command by transforming it with the inverse).
|
|
36748
|
+
* To prevent these problems, we must rebase all subsequent local
|
|
36749
|
+
* revisions.
|
|
36750
|
+
*/
|
|
36751
|
+
this.revisions.rebase(this.pendingMessages[firstPendingRevisionId].nextRevisionId);
|
|
36752
|
+
}
|
|
36753
|
+
this.serverRevisionId = message.nextRevisionId;
|
|
36754
|
+
this.processedRevisions.add(message.nextRevisionId);
|
|
36755
|
+
this.sendPendingMessage();
|
|
36756
|
+
break;
|
|
36757
|
+
}
|
|
36661
36758
|
}
|
|
36662
36759
|
}
|
|
36663
36760
|
isAlreadyProcessed(message) {
|
|
@@ -37528,7 +37625,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
37528
37625
|
}
|
|
37529
37626
|
checkPositiveDimension(cmd) {
|
|
37530
37627
|
if (cmd.width < 0 || cmd.height < 0) {
|
|
37531
|
-
return
|
|
37628
|
+
return 69 /* CommandResult.InvalidViewportSize */;
|
|
37532
37629
|
}
|
|
37533
37630
|
return 0 /* CommandResult.Success */;
|
|
37534
37631
|
}
|
|
@@ -37538,7 +37635,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
37538
37635
|
cmd.gridOffsetY === this.gridOffsetY &&
|
|
37539
37636
|
cmd.width === width &&
|
|
37540
37637
|
cmd.height === height) {
|
|
37541
|
-
return
|
|
37638
|
+
return 77 /* CommandResult.ValuesNotChanged */;
|
|
37542
37639
|
}
|
|
37543
37640
|
return 0 /* CommandResult.Success */;
|
|
37544
37641
|
}
|
|
@@ -37546,7 +37643,7 @@ class SheetViewPlugin extends UIPlugin {
|
|
|
37546
37643
|
const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
|
|
37547
37644
|
if ((!pane.canScrollHorizontally && offsetX > 0) ||
|
|
37548
37645
|
(!pane.canScrollVertically && offsetY > 0)) {
|
|
37549
|
-
return
|
|
37646
|
+
return 70 /* CommandResult.InvalidScrollingDirection */;
|
|
37550
37647
|
}
|
|
37551
37648
|
return 0 /* CommandResult.Success */;
|
|
37552
37649
|
}
|
|
@@ -37773,7 +37870,7 @@ class SortPlugin extends UIPlugin {
|
|
|
37773
37870
|
for (let row = zone.top; row <= zone.bottom; row++) {
|
|
37774
37871
|
for (let col = zone.left; col <= zone.right; col++) {
|
|
37775
37872
|
if (!this.getters.isInMerge(sheetId, col, row)) {
|
|
37776
|
-
return
|
|
37873
|
+
return 64 /* CommandResult.InvalidSortZone */;
|
|
37777
37874
|
}
|
|
37778
37875
|
}
|
|
37779
37876
|
}
|
|
@@ -37794,7 +37891,7 @@ class SortPlugin extends UIPlugin {
|
|
|
37794
37891
|
];
|
|
37795
37892
|
return widthCurrent === widthFirst && heightCurrent === heightFirst;
|
|
37796
37893
|
})) {
|
|
37797
|
-
return
|
|
37894
|
+
return 64 /* CommandResult.InvalidSortZone */;
|
|
37798
37895
|
}
|
|
37799
37896
|
return 0 /* CommandResult.Success */;
|
|
37800
37897
|
}
|
|
@@ -38460,7 +38557,7 @@ class BottomBar extends Component {
|
|
|
38460
38557
|
addSheet() {
|
|
38461
38558
|
const activeSheetId = this.env.model.getters.getActiveSheetId();
|
|
38462
38559
|
const position = this.env.model.getters.getSheetIds().findIndex((sheetId) => sheetId === activeSheetId) + 1;
|
|
38463
|
-
const sheetId = this.env.model.uuidGenerator.
|
|
38560
|
+
const sheetId = this.env.model.uuidGenerator.smallUuid();
|
|
38464
38561
|
const name = this.env.model.getters.getNextSheetName(this.env._t("Sheet"));
|
|
38465
38562
|
this.env.model.dispatch("CREATE_SHEET", { sheetId, position, name });
|
|
38466
38563
|
this.env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
|
|
@@ -38949,7 +39046,7 @@ const AddMergeInteractiveContent = {
|
|
|
38949
39046
|
};
|
|
38950
39047
|
function interactiveAddMerge(env, sheetId, target) {
|
|
38951
39048
|
const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
|
|
38952
|
-
if (result.isCancelledBecause(
|
|
39049
|
+
if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
|
|
38953
39050
|
env.raiseError(AddMergeInteractiveContent.MergeInFilter);
|
|
38954
39051
|
}
|
|
38955
39052
|
else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
|
|
@@ -40082,7 +40179,7 @@ class Tree {
|
|
|
40082
40179
|
}
|
|
40083
40180
|
/**
|
|
40084
40181
|
* Drop the operation and all following operations in every
|
|
40085
|
-
*
|
|
40182
|
+
* branches
|
|
40086
40183
|
*/
|
|
40087
40184
|
drop(operationId) {
|
|
40088
40185
|
for (const branch of this.branches) {
|
|
@@ -40379,9 +40476,16 @@ class SelectiveHistory {
|
|
|
40379
40476
|
this.fastForward();
|
|
40380
40477
|
this.insert(redoId, this.buildEmpty(redoId), insertAfter);
|
|
40381
40478
|
}
|
|
40382
|
-
|
|
40479
|
+
rebase(operationId) {
|
|
40480
|
+
const operation = this.get(operationId);
|
|
40481
|
+
const execution = [...this.tree.execution(this.HEAD_BRANCH).startAfter(operationId)];
|
|
40383
40482
|
this.revertBefore(operationId);
|
|
40483
|
+
const baseId = this.HEAD_OPERATION.id;
|
|
40384
40484
|
this.tree.drop(operationId);
|
|
40485
|
+
this.insert(operationId, operation, baseId);
|
|
40486
|
+
for (const { operation } of execution) {
|
|
40487
|
+
this.insert(operation.id, operation.data, this.HEAD_OPERATION.id);
|
|
40488
|
+
}
|
|
40385
40489
|
}
|
|
40386
40490
|
/**
|
|
40387
40491
|
* Revert the state as it was *before* the given operation was executed.
|
|
@@ -40504,7 +40608,6 @@ class LocalHistory extends EventBus$1 {
|
|
|
40504
40608
|
this.session.on("new-local-state-update", this, this.onNewLocalStateUpdate);
|
|
40505
40609
|
this.session.on("revision-undone", this, ({ commands }) => this.selectiveUndo(commands));
|
|
40506
40610
|
this.session.on("revision-redone", this, ({ commands }) => this.selectiveRedo(commands));
|
|
40507
|
-
this.session.on("pending-revisions-dropped", this, ({ revisionIds }) => this.drop(revisionIds));
|
|
40508
40611
|
this.session.on("snapshot", this, () => {
|
|
40509
40612
|
this.undoStack = [];
|
|
40510
40613
|
this.redoStack = [];
|
|
@@ -40557,10 +40660,6 @@ class LocalHistory extends EventBus$1 {
|
|
|
40557
40660
|
canRedo() {
|
|
40558
40661
|
return this.redoStack.length > 0;
|
|
40559
40662
|
}
|
|
40560
|
-
drop(revisionIds) {
|
|
40561
|
-
this.undoStack = this.undoStack.filter((id) => !revisionIds.includes(id));
|
|
40562
|
-
this.redoStack = [];
|
|
40563
|
-
}
|
|
40564
40663
|
onNewLocalStateUpdate({ id }) {
|
|
40565
40664
|
this.undoStack.push(id);
|
|
40566
40665
|
this.redoStack = [];
|
|
@@ -41141,7 +41240,7 @@ class SelectionStreamProcessor {
|
|
|
41141
41240
|
*/
|
|
41142
41241
|
moveAnchorCell(direction, step = 1) {
|
|
41143
41242
|
if (step !== "end" && step <= 0) {
|
|
41144
|
-
return new DispatchResult(
|
|
41243
|
+
return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
|
|
41145
41244
|
}
|
|
41146
41245
|
const { col, row } = this.getNextAvailablePosition(direction, step);
|
|
41147
41246
|
return this.selectCell(col, row);
|
|
@@ -41187,7 +41286,7 @@ class SelectionStreamProcessor {
|
|
|
41187
41286
|
*/
|
|
41188
41287
|
resizeAnchorZone(direction, step = 1) {
|
|
41189
41288
|
if (step !== "end" && step <= 0) {
|
|
41190
|
-
return new DispatchResult(
|
|
41289
|
+
return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
|
|
41191
41290
|
}
|
|
41192
41291
|
const sheetId = this.getters.getActiveSheetId();
|
|
41193
41292
|
const anchor = this.anchor;
|
|
@@ -43133,10 +43232,10 @@ class Model extends EventBus {
|
|
|
43133
43232
|
const command = { type, ...payload };
|
|
43134
43233
|
let status = this.status;
|
|
43135
43234
|
if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
|
|
43136
|
-
return new DispatchResult(
|
|
43235
|
+
return new DispatchResult(68 /* CommandResult.Readonly */);
|
|
43137
43236
|
}
|
|
43138
43237
|
if (!this.session.canApplyOptimisticUpdate()) {
|
|
43139
|
-
return new DispatchResult(
|
|
43238
|
+
return new DispatchResult(65 /* CommandResult.WaitingSessionConfirmation */);
|
|
43140
43239
|
}
|
|
43141
43240
|
switch (status) {
|
|
43142
43241
|
case 0 /* Status.Ready */:
|
|
@@ -43338,7 +43437,7 @@ class Model extends EventBus {
|
|
|
43338
43437
|
}
|
|
43339
43438
|
setupConfig(config) {
|
|
43340
43439
|
const client = config.client || {
|
|
43341
|
-
id: this.uuidGenerator.
|
|
43440
|
+
id: this.uuidGenerator.smallUuid(),
|
|
43342
43441
|
name: _lt("Anonymous").toString(),
|
|
43343
43442
|
};
|
|
43344
43443
|
const transportService = config.transportService || new LocalTransportService();
|
|
@@ -43558,6 +43657,6 @@ function addFunction(functionName, functionDescription) {
|
|
|
43558
43657
|
export { AbstractChart, CommandResult, CorePlugin, DATETIME_FORMAT, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, cellTypes, compile, components, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateEvaluationCommands, load, parse, readonlyAllowedCommands, registries, setTranslationMethod, tokenize };
|
|
43559
43658
|
|
|
43560
43659
|
|
|
43561
|
-
__info__.version = '16.0.
|
|
43562
|
-
__info__.date = '2025-02-
|
|
43563
|
-
__info__.hash = '
|
|
43660
|
+
__info__.version = '16.0.62';
|
|
43661
|
+
__info__.date = '2025-02-14T08:36:41.388Z';
|
|
43662
|
+
__info__.hash = '34f2802';
|