@odoo/o-spreadsheet 18.0.67 → 18.0.69
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 +787 -776
- package/dist/o-spreadsheet.esm.js +787 -776
- package/dist/o-spreadsheet.iife.js +788 -777
- package/dist/o-spreadsheet.iife.min.js +414 -414
- package/dist/o_spreadsheet.xml +3 -3
- package/dist/types/helpers/pivot/pivot_composer_helpers.d.ts +4 -0
- package/dist/types/plugins/ui_core_views/pivot_ui.d.ts +16 -8
- package/package.json +21 -21
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.0.
|
|
6
|
-
* @date 2026-05-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.69
|
|
6
|
+
* @date 2026-05-27T05:57:08.710Z
|
|
7
|
+
* @hash 50b85ba
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Component, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, xml } from "@odoo/owl";
|
|
@@ -16,7 +16,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
16
16
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
17
17
|
var __getProtoOf = Object.getPrototypeOf;
|
|
18
18
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
19
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
19
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
20
20
|
var __exportAll = (all, no_symbols) => {
|
|
21
21
|
let target = {};
|
|
22
22
|
for (var name in all) {
|
|
@@ -336,22 +336,6 @@ const FORBIDDEN_SHEETNAME_CHARS = [
|
|
|
336
336
|
"]"
|
|
337
337
|
];
|
|
338
338
|
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
339
|
-
let ComponentsImportance = /* @__PURE__ */ function(ComponentsImportance) {
|
|
340
|
-
ComponentsImportance[ComponentsImportance["Grid"] = 0] = "Grid";
|
|
341
|
-
ComponentsImportance[ComponentsImportance["Highlight"] = 5] = "Highlight";
|
|
342
|
-
ComponentsImportance[ComponentsImportance["HeaderGroupingButton"] = 6] = "HeaderGroupingButton";
|
|
343
|
-
ComponentsImportance[ComponentsImportance["Figure"] = 10] = "Figure";
|
|
344
|
-
ComponentsImportance[ComponentsImportance["ScrollBar"] = 15] = "ScrollBar";
|
|
345
|
-
ComponentsImportance[ComponentsImportance["GridPopover"] = 19] = "GridPopover";
|
|
346
|
-
ComponentsImportance[ComponentsImportance["GridComposer"] = 20] = "GridComposer";
|
|
347
|
-
ComponentsImportance[ComponentsImportance["Dropdown"] = 21] = "Dropdown";
|
|
348
|
-
ComponentsImportance[ComponentsImportance["IconPicker"] = 25] = "IconPicker";
|
|
349
|
-
ComponentsImportance[ComponentsImportance["TopBarComposer"] = 30] = "TopBarComposer";
|
|
350
|
-
ComponentsImportance[ComponentsImportance["Popover"] = 35] = "Popover";
|
|
351
|
-
ComponentsImportance[ComponentsImportance["FigureAnchor"] = 1e3] = "FigureAnchor";
|
|
352
|
-
ComponentsImportance[ComponentsImportance["FigureSnapLine"] = 1001] = "FigureSnapLine";
|
|
353
|
-
return ComponentsImportance;
|
|
354
|
-
}({});
|
|
355
339
|
let DEFAULT_SHEETVIEW_SIZE = 0;
|
|
356
340
|
function getDefaultSheetViewSize() {
|
|
357
341
|
return DEFAULT_SHEETVIEW_SIZE;
|
|
@@ -832,7 +816,8 @@ var TokenizingChars = class {
|
|
|
832
816
|
}
|
|
833
817
|
shift() {
|
|
834
818
|
const current = this.current;
|
|
835
|
-
|
|
819
|
+
const next = this.text[++this.currentIndex];
|
|
820
|
+
this.current = next;
|
|
836
821
|
return current;
|
|
837
822
|
}
|
|
838
823
|
advanceBy(length) {
|
|
@@ -1267,6 +1252,7 @@ function getColorsPalette(quantity) {
|
|
|
1267
1252
|
else return COLORS_XL;
|
|
1268
1253
|
}
|
|
1269
1254
|
var ColorGenerator = class {
|
|
1255
|
+
preferredColors;
|
|
1270
1256
|
currentColorIndex = 0;
|
|
1271
1257
|
palette;
|
|
1272
1258
|
constructor(paletteSize, preferredColors = []) {
|
|
@@ -1684,6 +1670,7 @@ const _t = function(s, ...values) {
|
|
|
1684
1670
|
return sprintf(_translate(s), ...values);
|
|
1685
1671
|
};
|
|
1686
1672
|
var LazyTranslatedString = class extends String {
|
|
1673
|
+
values;
|
|
1687
1674
|
constructor(str, values) {
|
|
1688
1675
|
super(str);
|
|
1689
1676
|
this.values = values;
|
|
@@ -2784,25 +2771,6 @@ function percentile(values, percent, isInclusive) {
|
|
|
2784
2771
|
return sortedValues[indexSup] * (percentIndex - indexLow) + sortedValues[indexLow] * (indexSup - percentIndex);
|
|
2785
2772
|
}
|
|
2786
2773
|
|
|
2787
|
-
//#endregion
|
|
2788
|
-
//#region src/types/cells.ts
|
|
2789
|
-
let CellValueType = /* @__PURE__ */ function(CellValueType) {
|
|
2790
|
-
CellValueType["boolean"] = "boolean";
|
|
2791
|
-
CellValueType["number"] = "number";
|
|
2792
|
-
CellValueType["text"] = "text";
|
|
2793
|
-
CellValueType["empty"] = "empty";
|
|
2794
|
-
CellValueType["error"] = "error";
|
|
2795
|
-
return CellValueType;
|
|
2796
|
-
}({});
|
|
2797
|
-
|
|
2798
|
-
//#endregion
|
|
2799
|
-
//#region src/types/clipboard.ts
|
|
2800
|
-
let ClipboardMIMEType = /* @__PURE__ */ function(ClipboardMIMEType) {
|
|
2801
|
-
ClipboardMIMEType["PlainText"] = "text/plain";
|
|
2802
|
-
ClipboardMIMEType["Html"] = "text/html";
|
|
2803
|
-
return ClipboardMIMEType;
|
|
2804
|
-
}({});
|
|
2805
|
-
|
|
2806
2774
|
//#endregion
|
|
2807
2775
|
//#region src/types/commands.ts
|
|
2808
2776
|
function isSheetDependent(cmd) {
|
|
@@ -2964,7 +2932,7 @@ var DispatchResult = class {
|
|
|
2964
2932
|
constructor(results = []) {
|
|
2965
2933
|
if (!Array.isArray(results)) results = [results];
|
|
2966
2934
|
results = [...new Set(results)];
|
|
2967
|
-
this.reasons = results.filter((result) => result !==
|
|
2935
|
+
this.reasons = results.filter((result) => result !== "Success");
|
|
2968
2936
|
}
|
|
2969
2937
|
/**
|
|
2970
2938
|
* Static helper which returns a successful DispatchResult
|
|
@@ -3148,13 +3116,6 @@ const borderStyles = [
|
|
|
3148
3116
|
function isMatrix(x) {
|
|
3149
3117
|
return Array.isArray(x) && Array.isArray(x[0]);
|
|
3150
3118
|
}
|
|
3151
|
-
let DIRECTION = /* @__PURE__ */ function(DIRECTION) {
|
|
3152
|
-
DIRECTION["UP"] = "up";
|
|
3153
|
-
DIRECTION["DOWN"] = "down";
|
|
3154
|
-
DIRECTION["LEFT"] = "left";
|
|
3155
|
-
DIRECTION["RIGHT"] = "right";
|
|
3156
|
-
return DIRECTION;
|
|
3157
|
-
}({});
|
|
3158
3119
|
|
|
3159
3120
|
//#endregion
|
|
3160
3121
|
//#region src/types/rendering.ts
|
|
@@ -3193,6 +3154,8 @@ const CellErrorType = {
|
|
|
3193
3154
|
};
|
|
3194
3155
|
const errorTypes = new Set(Object.values(CellErrorType));
|
|
3195
3156
|
var EvaluationError = class {
|
|
3157
|
+
message;
|
|
3158
|
+
value;
|
|
3196
3159
|
constructor(message = _t("Error"), value = CellErrorType.GenericError) {
|
|
3197
3160
|
this.message = message;
|
|
3198
3161
|
this.value = value;
|
|
@@ -3891,7 +3854,7 @@ urlRegistry.add("sheet_URL", {
|
|
|
3891
3854
|
if (env.model.dispatch("ACTIVATE_SHEET", {
|
|
3892
3855
|
sheetIdFrom: env.model.getters.getActiveSheetId(),
|
|
3893
3856
|
sheetIdTo: sheetId
|
|
3894
|
-
}).isCancelledBecause(
|
|
3857
|
+
}).isCancelledBecause("SheetIsHidden")) env.notifyUser({
|
|
3895
3858
|
type: "warning",
|
|
3896
3859
|
sticky: false,
|
|
3897
3860
|
text: _t("Cannot open the link because the linked sheet is hidden.")
|
|
@@ -4863,7 +4826,7 @@ function textCell(value, format, formattedValue) {
|
|
|
4863
4826
|
value,
|
|
4864
4827
|
format,
|
|
4865
4828
|
formattedValue,
|
|
4866
|
-
type:
|
|
4829
|
+
type: "text",
|
|
4867
4830
|
isAutoSummable: true,
|
|
4868
4831
|
defaultAlign: "left"
|
|
4869
4832
|
};
|
|
@@ -4873,7 +4836,7 @@ function numberCell(value, format, formattedValue) {
|
|
|
4873
4836
|
value: value || 0,
|
|
4874
4837
|
format,
|
|
4875
4838
|
formattedValue,
|
|
4876
|
-
type:
|
|
4839
|
+
type: "number",
|
|
4877
4840
|
isAutoSummable: true,
|
|
4878
4841
|
defaultAlign: "right"
|
|
4879
4842
|
};
|
|
@@ -4883,7 +4846,7 @@ const emptyCell = memoize(function emptyCell(format) {
|
|
|
4883
4846
|
value: null,
|
|
4884
4847
|
format,
|
|
4885
4848
|
formattedValue: "",
|
|
4886
|
-
type:
|
|
4849
|
+
type: "empty",
|
|
4887
4850
|
isAutoSummable: true,
|
|
4888
4851
|
defaultAlign: "left"
|
|
4889
4852
|
};
|
|
@@ -4893,7 +4856,7 @@ function dateTimeCell(value, format, formattedValue) {
|
|
|
4893
4856
|
value,
|
|
4894
4857
|
format,
|
|
4895
4858
|
formattedValue,
|
|
4896
|
-
type:
|
|
4859
|
+
type: "number",
|
|
4897
4860
|
isAutoSummable: false,
|
|
4898
4861
|
defaultAlign: "right"
|
|
4899
4862
|
};
|
|
@@ -4903,7 +4866,7 @@ function booleanCell(value, format, formattedValue) {
|
|
|
4903
4866
|
value,
|
|
4904
4867
|
format,
|
|
4905
4868
|
formattedValue,
|
|
4906
|
-
type:
|
|
4869
|
+
type: "boolean",
|
|
4907
4870
|
isAutoSummable: false,
|
|
4908
4871
|
defaultAlign: "center"
|
|
4909
4872
|
};
|
|
@@ -4913,7 +4876,7 @@ function errorCell(value, message) {
|
|
|
4913
4876
|
value,
|
|
4914
4877
|
formattedValue: value,
|
|
4915
4878
|
message,
|
|
4916
|
-
type:
|
|
4879
|
+
type: "error",
|
|
4917
4880
|
isAutoSummable: false,
|
|
4918
4881
|
defaultAlign: "center"
|
|
4919
4882
|
};
|
|
@@ -5056,6 +5019,7 @@ function getFullReference(sheetName, xc) {
|
|
|
5056
5019
|
//#endregion
|
|
5057
5020
|
//#region src/helpers/range.ts
|
|
5058
5021
|
var RangeImpl = class RangeImpl {
|
|
5022
|
+
getSheetSize;
|
|
5059
5023
|
_zone;
|
|
5060
5024
|
parts;
|
|
5061
5025
|
invalidXc;
|
|
@@ -5687,10 +5651,10 @@ function getPasteZones(target, content) {
|
|
|
5687
5651
|
return target.map((t) => splitZoneForPaste(t, width, height)).flat();
|
|
5688
5652
|
}
|
|
5689
5653
|
function parseOSClipboardContent(content) {
|
|
5690
|
-
if (!content[
|
|
5691
|
-
const htmlDocument = new DOMParser().parseFromString(content[
|
|
5654
|
+
if (!content["text/html"]) return { text: content["text/plain"] };
|
|
5655
|
+
const htmlDocument = new DOMParser().parseFromString(content["text/html"], "text/html");
|
|
5692
5656
|
return {
|
|
5693
|
-
text: content[
|
|
5657
|
+
text: content["text/plain"],
|
|
5694
5658
|
data: getOSheetDataFromHTML(htmlDocument)
|
|
5695
5659
|
};
|
|
5696
5660
|
}
|
|
@@ -5757,6 +5721,8 @@ const selectPastedZone = (selection, sourceZones, pastedZones) => {
|
|
|
5757
5721
|
//#endregion
|
|
5758
5722
|
//#region src/clipboard_handlers/abstract_clipboard_handler.ts
|
|
5759
5723
|
var ClipboardHandler = class {
|
|
5724
|
+
getters;
|
|
5725
|
+
dispatch;
|
|
5760
5726
|
constructor(getters, dispatch) {
|
|
5761
5727
|
this.getters = getters;
|
|
5762
5728
|
this.dispatch = dispatch;
|
|
@@ -5764,10 +5730,10 @@ var ClipboardHandler = class {
|
|
|
5764
5730
|
copy(data, mode = "copyPaste") {}
|
|
5765
5731
|
paste(target, clippedContent, options) {}
|
|
5766
5732
|
isPasteAllowed(sheetId, target, content, option) {
|
|
5767
|
-
return
|
|
5733
|
+
return "Success";
|
|
5768
5734
|
}
|
|
5769
5735
|
isCutAllowed(data) {
|
|
5770
|
-
return
|
|
5736
|
+
return "Success";
|
|
5771
5737
|
}
|
|
5772
5738
|
getPasteTarget(sheetId, target, content, options) {
|
|
5773
5739
|
return {
|
|
@@ -7218,8 +7184,8 @@ function addIndentAndAlignToPivotHeader(pivot, domain, functionResult) {
|
|
|
7218
7184
|
//#region src/clipboard_handlers/cell_clipboard.ts
|
|
7219
7185
|
var CellClipboardHandler = class extends AbstractCellClipboardHandler {
|
|
7220
7186
|
isCutAllowed(data) {
|
|
7221
|
-
if (data.zones.length !== 1) return
|
|
7222
|
-
return
|
|
7187
|
+
if (data.zones.length !== 1) return "WrongCutSelection";
|
|
7188
|
+
return "Success";
|
|
7223
7189
|
}
|
|
7224
7190
|
copy(data, mode = "copyPaste") {
|
|
7225
7191
|
const sheetId = data.sheetId;
|
|
@@ -7287,17 +7253,17 @@ var CellClipboardHandler = class extends AbstractCellClipboardHandler {
|
|
|
7287
7253
|
};
|
|
7288
7254
|
}
|
|
7289
7255
|
isPasteAllowed(sheetId, target, content, clipboardOptions) {
|
|
7290
|
-
if (!content.cells) return
|
|
7291
|
-
if (clipboardOptions?.isCutOperation && clipboardOptions?.pasteOption !== void 0) return
|
|
7256
|
+
if (!content.cells) return "Success";
|
|
7257
|
+
if (clipboardOptions?.isCutOperation && clipboardOptions?.pasteOption !== void 0) return "WrongPasteOption";
|
|
7292
7258
|
if (target.length > 1) {
|
|
7293
|
-
if (content.cells.length > 1 || content.cells[0].length > 1) return
|
|
7259
|
+
if (content.cells.length > 1 || content.cells[0].length > 1) return "WrongPasteSelection";
|
|
7294
7260
|
}
|
|
7295
7261
|
const clipboardHeight = content.cells.length;
|
|
7296
7262
|
const clipboardWidth = content.cells[0].length;
|
|
7297
7263
|
for (const zone of getPasteZones(target, content.cells)) if (this.getters.doesIntersectMerge(sheetId, zone)) {
|
|
7298
|
-
if (target.length > 1 || !this.getters.isSingleCellOrMerge(sheetId, target[0]) || clipboardHeight * clipboardWidth !== 1) return
|
|
7264
|
+
if (target.length > 1 || !this.getters.isSingleCellOrMerge(sheetId, target[0]) || clipboardHeight * clipboardWidth !== 1) return "WillRemoveExistingMerge";
|
|
7299
7265
|
}
|
|
7300
|
-
return
|
|
7266
|
+
return "Success";
|
|
7301
7267
|
}
|
|
7302
7268
|
/**
|
|
7303
7269
|
* Paste the clipboard content in the given target
|
|
@@ -7479,9 +7445,9 @@ var ChartClipboardHandler = class extends AbstractFigureClipboardHandler {
|
|
|
7479
7445
|
this.dispatch("SELECT_FIGURE", { id: figureId });
|
|
7480
7446
|
}
|
|
7481
7447
|
isPasteAllowed(sheetId, target, content, option) {
|
|
7482
|
-
if (target.length === 0) return
|
|
7483
|
-
if (option?.pasteOption !== void 0) return
|
|
7484
|
-
return
|
|
7448
|
+
if (target.length === 0) return "EmptyTarget";
|
|
7449
|
+
if (option?.pasteOption !== void 0) return "WrongFigurePasteOption";
|
|
7450
|
+
return "Success";
|
|
7485
7451
|
}
|
|
7486
7452
|
};
|
|
7487
7453
|
|
|
@@ -7780,9 +7746,9 @@ var ImageClipboardHandler = class extends AbstractFigureClipboardHandler {
|
|
|
7780
7746
|
this.dispatch("SELECT_FIGURE", { id: figureId });
|
|
7781
7747
|
}
|
|
7782
7748
|
isPasteAllowed(sheetId, target, content, option) {
|
|
7783
|
-
if (target.length === 0) return
|
|
7784
|
-
if (option?.pasteOption !== void 0) return
|
|
7785
|
-
return
|
|
7749
|
+
if (target.length === 0) return "EmptyTarget";
|
|
7750
|
+
if (option?.pasteOption !== void 0) return "WrongFigurePasteOption";
|
|
7751
|
+
return "Success";
|
|
7786
7752
|
}
|
|
7787
7753
|
};
|
|
7788
7754
|
|
|
@@ -7877,10 +7843,10 @@ var ReferenceClipboardHandler = class extends AbstractCellClipboardHandler {
|
|
|
7877
7843
|
//#region src/clipboard_handlers/sheet_clipboard.ts
|
|
7878
7844
|
var SheetClipboardHandler = class extends AbstractCellClipboardHandler {
|
|
7879
7845
|
isPasteAllowed(sheetId, target, content, options) {
|
|
7880
|
-
if (!("cells" in content)) return
|
|
7846
|
+
if (!("cells" in content)) return "Success";
|
|
7881
7847
|
const { xSplit, ySplit } = this.getters.getPaneDivisions(sheetId);
|
|
7882
|
-
for (const zone of getPasteZones(target, content.cells)) if (zone.left < xSplit && zone.right >= xSplit || zone.top < ySplit && zone.bottom >= ySplit) return
|
|
7883
|
-
return
|
|
7848
|
+
for (const zone of getPasteZones(target, content.cells)) if (zone.left < xSplit && zone.right >= xSplit || zone.top < ySplit && zone.bottom >= ySplit) return "FrozenPaneOverlap";
|
|
7849
|
+
return "Success";
|
|
7884
7850
|
}
|
|
7885
7851
|
};
|
|
7886
7852
|
|
|
@@ -8132,6 +8098,7 @@ var DependencyContainer = class extends EventBus {
|
|
|
8132
8098
|
}
|
|
8133
8099
|
};
|
|
8134
8100
|
var StoreFactory = class {
|
|
8101
|
+
get;
|
|
8135
8102
|
pendingBuilds = /* @__PURE__ */ new Set();
|
|
8136
8103
|
constructor(get) {
|
|
8137
8104
|
this.get = get;
|
|
@@ -8176,6 +8143,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8176
8143
|
return MetaStore;
|
|
8177
8144
|
}
|
|
8178
8145
|
var DisposableStore = class {
|
|
8146
|
+
get;
|
|
8179
8147
|
disposeCallbacks = [];
|
|
8180
8148
|
constructor(get) {
|
|
8181
8149
|
this.get = get;
|
|
@@ -8553,16 +8521,16 @@ function chartFontColor(backgroundColor) {
|
|
|
8553
8521
|
}
|
|
8554
8522
|
function checkDataset(definition) {
|
|
8555
8523
|
if (definition.dataSets) {
|
|
8556
|
-
if (definition.dataSets.find((range) => !rangeReference.test(range.dataRange)) !== void 0) return
|
|
8557
|
-
if (definition.dataSets.map((ds) => toUnboundedZone(ds.dataRange)).some((zone) => zone.top !== zone.bottom && isFullRow(zone))) return
|
|
8524
|
+
if (definition.dataSets.find((range) => !rangeReference.test(range.dataRange)) !== void 0) return "InvalidDataSet";
|
|
8525
|
+
if (definition.dataSets.map((ds) => toUnboundedZone(ds.dataRange)).some((zone) => zone.top !== zone.bottom && isFullRow(zone))) return "InvalidDataSet";
|
|
8558
8526
|
}
|
|
8559
|
-
return
|
|
8527
|
+
return "Success";
|
|
8560
8528
|
}
|
|
8561
8529
|
function checkLabelRange(definition) {
|
|
8562
8530
|
if (definition.labelRange) {
|
|
8563
|
-
if (!rangeReference.test(definition.labelRange || "")) return
|
|
8531
|
+
if (!rangeReference.test(definition.labelRange || "")) return "InvalidLabelRange";
|
|
8564
8532
|
}
|
|
8565
|
-
return
|
|
8533
|
+
return "Success";
|
|
8566
8534
|
}
|
|
8567
8535
|
function shouldRemoveFirstLabel(labelRange, dataset, dataSetsHaveTitle) {
|
|
8568
8536
|
if (!dataSetsHaveTitle) return false;
|
|
@@ -8879,6 +8847,7 @@ function getNextNonEmptyBar(bars, startIndex) {
|
|
|
8879
8847
|
* Represent a raw XML string
|
|
8880
8848
|
*/
|
|
8881
8849
|
var XMLString = class {
|
|
8850
|
+
xmlString;
|
|
8882
8851
|
/**
|
|
8883
8852
|
* @param xmlString should be a well formed, properly escaped XML string
|
|
8884
8853
|
*/
|
|
@@ -8992,6 +8961,10 @@ const FORCE_DEFAULT_ARGS_FUNCTIONS = {
|
|
|
8992
8961
|
ROUNDDOWN: [{
|
|
8993
8962
|
type: "NUMBER",
|
|
8994
8963
|
value: 0
|
|
8964
|
+
}],
|
|
8965
|
+
IFERROR: [{
|
|
8966
|
+
type: "NUMBER",
|
|
8967
|
+
value: 0
|
|
8995
8968
|
}]
|
|
8996
8969
|
};
|
|
8997
8970
|
/**
|
|
@@ -9432,30 +9405,6 @@ function prefixFormulaWithEqual(formula) {
|
|
|
9432
9405
|
|
|
9433
9406
|
//#endregion
|
|
9434
9407
|
//#region src/xlsx/helpers/xlsx_parser_error_manager.ts
|
|
9435
|
-
/**
|
|
9436
|
-
* Map of the different types of conversions warnings and their name in error messages
|
|
9437
|
-
*/
|
|
9438
|
-
let WarningTypes = /* @__PURE__ */ function(WarningTypes) {
|
|
9439
|
-
WarningTypes["DiagonalBorderNotSupported"] = "Diagonal Borders";
|
|
9440
|
-
WarningTypes["BorderStyleNotSupported"] = "Border style";
|
|
9441
|
-
WarningTypes["FillStyleNotSupported"] = "Fill Style";
|
|
9442
|
-
WarningTypes["FontNotSupported"] = "Font";
|
|
9443
|
-
WarningTypes["HorizontalAlignmentNotSupported"] = "Horizontal Alignment";
|
|
9444
|
-
WarningTypes["VerticalAlignmentNotSupported"] = "Vertical Alignments";
|
|
9445
|
-
WarningTypes["MultipleRulesCfNotSupported"] = "Multiple rules conditional formats";
|
|
9446
|
-
WarningTypes["CfTypeNotSupported"] = "Conditional format type";
|
|
9447
|
-
WarningTypes["CfFormatBorderNotSupported"] = "Borders in conditional formats";
|
|
9448
|
-
WarningTypes["CfFormatAlignmentNotSupported"] = "Alignment in conditional formats";
|
|
9449
|
-
WarningTypes["CfFormatNumFmtNotSupported"] = "Num formats in conditional formats";
|
|
9450
|
-
WarningTypes["CfIconSetEmptyIconNotSupported"] = "IconSets with empty icons";
|
|
9451
|
-
WarningTypes["BadlyFormattedHyperlink"] = "Badly formatted hyperlink";
|
|
9452
|
-
WarningTypes["NumFmtIdNotSupported"] = "Number format";
|
|
9453
|
-
WarningTypes["TimeDataValidationNotSupported"] = "Time data validation rules";
|
|
9454
|
-
WarningTypes["TextLengthDataValidationNotSupported"] = "Text length data validation rules";
|
|
9455
|
-
WarningTypes["WholeNumberDataValidationNotSupported"] = "Whole number data validation rules";
|
|
9456
|
-
WarningTypes["NotEqualDateDataValidationNotSupported"] = "Not equal date data validation rules";
|
|
9457
|
-
return WarningTypes;
|
|
9458
|
-
}({});
|
|
9459
9408
|
var XLSXImportWarningManager = class {
|
|
9460
9409
|
_parsingWarnings = /* @__PURE__ */ new Set();
|
|
9461
9410
|
_conversionWarnings = /* @__PURE__ */ new Set();
|
|
@@ -9944,7 +9893,7 @@ function convertXlsxFormat(numFmtId, formats, warningManager) {
|
|
|
9944
9893
|
if (isXlsxDateFormat(convertedFormat)) convertedFormat = convertDateFormat$1(convertedFormat);
|
|
9945
9894
|
if (isFormatSupported(convertedFormat)) return convertedFormat;
|
|
9946
9895
|
} catch (e) {}
|
|
9947
|
-
warningManager.generateNotSupportedWarning(
|
|
9896
|
+
warningManager.generateNotSupportedWarning("Number format", format || `nmFmtId ${numFmtId}`);
|
|
9948
9897
|
}
|
|
9949
9898
|
function isFormatSupported(format) {
|
|
9950
9899
|
try {
|
|
@@ -10028,20 +9977,20 @@ function convertFormats(data, warningManager) {
|
|
|
10028
9977
|
return arrayToObject(formats, 1);
|
|
10029
9978
|
}
|
|
10030
9979
|
function addStyleWarnings(font, fill, warningManager) {
|
|
10031
|
-
if (font && font.name && !SUPPORTED_FONTS.includes(font.name)) warningManager.generateNotSupportedWarning(
|
|
10032
|
-
if (fill && fill.patternType && !SUPPORTED_FILL_PATTERNS.includes(fill.patternType)) warningManager.generateNotSupportedWarning(
|
|
9980
|
+
if (font && font.name && !SUPPORTED_FONTS.includes(font.name)) warningManager.generateNotSupportedWarning("Font", font.name, SUPPORTED_FONTS);
|
|
9981
|
+
if (fill && fill.patternType && !SUPPORTED_FILL_PATTERNS.includes(fill.patternType)) warningManager.generateNotSupportedWarning("Fill Style", fill.patternType, SUPPORTED_FILL_PATTERNS);
|
|
10033
9982
|
}
|
|
10034
9983
|
function addBorderDescrWarnings(borderDescr, warningManager) {
|
|
10035
|
-
if (!SUPPORTED_BORDER_STYLES.includes(borderDescr.style)) warningManager.generateNotSupportedWarning(
|
|
9984
|
+
if (!SUPPORTED_BORDER_STYLES.includes(borderDescr.style)) warningManager.generateNotSupportedWarning("Border style", borderDescr.style, SUPPORTED_BORDER_STYLES);
|
|
10036
9985
|
}
|
|
10037
9986
|
function addBorderWarnings(border, warningManager) {
|
|
10038
|
-
if (border.diagonal) warningManager.generateNotSupportedWarning(
|
|
9987
|
+
if (border.diagonal) warningManager.generateNotSupportedWarning("Diagonal Borders");
|
|
10039
9988
|
}
|
|
10040
9989
|
function addHorizontalAlignmentWarnings(alignment, warningManager) {
|
|
10041
|
-
if (alignment && !SUPPORTED_HORIZONTAL_ALIGNMENTS.includes(alignment)) warningManager.generateNotSupportedWarning(
|
|
9990
|
+
if (alignment && !SUPPORTED_HORIZONTAL_ALIGNMENTS.includes(alignment)) warningManager.generateNotSupportedWarning("Horizontal Alignment", alignment, SUPPORTED_HORIZONTAL_ALIGNMENTS);
|
|
10042
9991
|
}
|
|
10043
9992
|
function addVerticalAlignmentWarnings(alignment, warningManager) {
|
|
10044
|
-
if (alignment && !SUPPORTED_VERTICAL_ALIGNMENTS.includes(alignment)) warningManager.generateNotSupportedWarning(
|
|
9993
|
+
if (alignment && !SUPPORTED_VERTICAL_ALIGNMENTS.includes(alignment)) warningManager.generateNotSupportedWarning("Vertical Alignments", alignment, SUPPORTED_VERTICAL_ALIGNMENTS);
|
|
10045
9994
|
}
|
|
10046
9995
|
|
|
10047
9996
|
//#endregion
|
|
@@ -10181,7 +10130,7 @@ function convertIconSet(id, xlsxCf, warningManager) {
|
|
|
10181
10130
|
lower: icons.upper
|
|
10182
10131
|
};
|
|
10183
10132
|
for (const key of Object.keys(icons)) if (!icons[key]) {
|
|
10184
|
-
warningManager.generateNotSupportedWarning(
|
|
10133
|
+
warningManager.generateNotSupportedWarning("IconSets with empty icons");
|
|
10185
10134
|
switch (key) {
|
|
10186
10135
|
case "upper":
|
|
10187
10136
|
icons[key] = ICON_SETS.dots.good;
|
|
@@ -10217,13 +10166,13 @@ function convertIcons(xlsxIconSet, index) {
|
|
|
10217
10166
|
return index === 0 ? ICON_SETS[iconSet].bad : index === 1 ? ICON_SETS[iconSet].neutral : ICON_SETS[iconSet].good;
|
|
10218
10167
|
}
|
|
10219
10168
|
function addCfConversionWarnings(cf, dxfs, warningManager) {
|
|
10220
|
-
if (cf.cfRules.length > 1) warningManager.generateNotSupportedWarning(
|
|
10221
|
-
if (!SUPPORTED_CF_TYPES.includes(cf.cfRules[0].type)) warningManager.generateNotSupportedWarning(
|
|
10169
|
+
if (cf.cfRules.length > 1) warningManager.generateNotSupportedWarning("Multiple rules conditional formats");
|
|
10170
|
+
if (!SUPPORTED_CF_TYPES.includes(cf.cfRules[0].type)) warningManager.generateNotSupportedWarning("Conditional format type", cf.cfRules[0].type);
|
|
10222
10171
|
if (cf.cfRules[0].dxfId) {
|
|
10223
10172
|
const dxf = dxfs[cf.cfRules[0].dxfId];
|
|
10224
|
-
if (dxf.border) warningManager.generateNotSupportedWarning(
|
|
10225
|
-
if (dxf.alignment) warningManager.generateNotSupportedWarning(
|
|
10226
|
-
if (dxf.numFmt) warningManager.generateNotSupportedWarning(
|
|
10173
|
+
if (dxf.border) warningManager.generateNotSupportedWarning("Borders in conditional formats");
|
|
10174
|
+
if (dxf.alignment) warningManager.generateNotSupportedWarning("Alignment in conditional formats");
|
|
10175
|
+
if (dxf.numFmt) warningManager.generateNotSupportedWarning("Num formats in conditional formats");
|
|
10227
10176
|
}
|
|
10228
10177
|
}
|
|
10229
10178
|
|
|
@@ -10563,13 +10512,13 @@ function convertDataValidationRules(xlsxDataValidations, warningManager) {
|
|
|
10563
10512
|
if (!dv) continue;
|
|
10564
10513
|
switch (dv.type) {
|
|
10565
10514
|
case "time":
|
|
10566
|
-
warningManager.generateNotSupportedWarning(
|
|
10515
|
+
warningManager.generateNotSupportedWarning("Time data validation rules");
|
|
10567
10516
|
break;
|
|
10568
10517
|
case "textLength":
|
|
10569
|
-
warningManager.generateNotSupportedWarning(
|
|
10518
|
+
warningManager.generateNotSupportedWarning("Text length data validation rules");
|
|
10570
10519
|
break;
|
|
10571
10520
|
case "whole":
|
|
10572
|
-
warningManager.generateNotSupportedWarning(
|
|
10521
|
+
warningManager.generateNotSupportedWarning("Whole number data validation rules");
|
|
10573
10522
|
break;
|
|
10574
10523
|
case "decimal":
|
|
10575
10524
|
const decimalRule = convertDecimalRule(dvId++, dv);
|
|
@@ -10581,7 +10530,7 @@ function convertDataValidationRules(xlsxDataValidations, warningManager) {
|
|
|
10581
10530
|
break;
|
|
10582
10531
|
case "date":
|
|
10583
10532
|
if (dv.operator === "notEqual") {
|
|
10584
|
-
warningManager.generateNotSupportedWarning(
|
|
10533
|
+
warningManager.generateNotSupportedWarning("Not equal date data validation rules");
|
|
10585
10534
|
break;
|
|
10586
10535
|
}
|
|
10587
10536
|
const dateRule = convertDateRule(dvId++, dv);
|
|
@@ -10887,7 +10836,7 @@ function getCellValue(cell, hyperLinksMap, sharedStrings, warningManager) {
|
|
|
10887
10836
|
}
|
|
10888
10837
|
function convertHyperlink(link, cellValue, warningManager) {
|
|
10889
10838
|
const label = link.display || cellValue;
|
|
10890
|
-
if (!link.relTarget && !link.location) warningManager.generateNotSupportedWarning(
|
|
10839
|
+
if (!link.relTarget && !link.location) warningManager.generateNotSupportedWarning("Badly formatted hyperlink");
|
|
10891
10840
|
return markdownLink(label, link.relTarget ? link.relTarget : buildSheetLink(splitReference(link.location).sheetName));
|
|
10892
10841
|
}
|
|
10893
10842
|
function getSheetDims(sheet) {
|
|
@@ -13172,46 +13121,6 @@ var XlsxReader = class {
|
|
|
13172
13121
|
|
|
13173
13122
|
//#endregion
|
|
13174
13123
|
//#region src/formulas/range_tokenizer.ts
|
|
13175
|
-
var State = /* @__PURE__ */ function(State) {
|
|
13176
|
-
/**
|
|
13177
|
-
* Initial state.
|
|
13178
|
-
* Expecting any reference for the left part of a range
|
|
13179
|
-
* e.g. "A1", "1", "A", "Sheet1!A1", "Sheet1!A"
|
|
13180
|
-
*/
|
|
13181
|
-
State[State["LeftRef"] = 0] = "LeftRef";
|
|
13182
|
-
/**
|
|
13183
|
-
* Expecting any reference for the right part of a range
|
|
13184
|
-
* e.g. "A1", "1", "A", "Sheet1!A1", "Sheet1!A"
|
|
13185
|
-
*/
|
|
13186
|
-
State[State["RightRef"] = 1] = "RightRef";
|
|
13187
|
-
/**
|
|
13188
|
-
* Expecting the separator without any constraint on the right part
|
|
13189
|
-
*/
|
|
13190
|
-
State[State["Separator"] = 2] = "Separator";
|
|
13191
|
-
/**
|
|
13192
|
-
* Expecting the separator for a full column range
|
|
13193
|
-
*/
|
|
13194
|
-
State[State["FullColumnSeparator"] = 3] = "FullColumnSeparator";
|
|
13195
|
-
/**
|
|
13196
|
-
* Expecting the separator for a full row range
|
|
13197
|
-
*/
|
|
13198
|
-
State[State["FullRowSeparator"] = 4] = "FullRowSeparator";
|
|
13199
|
-
/**
|
|
13200
|
-
* Expecting the right part of a full column range
|
|
13201
|
-
* e.g. "1", "A1"
|
|
13202
|
-
*/
|
|
13203
|
-
State[State["RightColumnRef"] = 5] = "RightColumnRef";
|
|
13204
|
-
/**
|
|
13205
|
-
* Expecting the right part of a full row range
|
|
13206
|
-
* e.g. "A", "A1"
|
|
13207
|
-
*/
|
|
13208
|
-
State[State["RightRowRef"] = 6] = "RightRowRef";
|
|
13209
|
-
/**
|
|
13210
|
-
* Final state. A range has been matched
|
|
13211
|
-
*/
|
|
13212
|
-
State[State["Found"] = 7] = "Found";
|
|
13213
|
-
return State;
|
|
13214
|
-
}(State || {});
|
|
13215
13124
|
const goTo = (state, guard = () => true) => [{
|
|
13216
13125
|
goTo: state,
|
|
13217
13126
|
guard
|
|
@@ -13221,41 +13130,41 @@ const goToMulti = (state, guard = () => true) => ({
|
|
|
13221
13130
|
guard
|
|
13222
13131
|
});
|
|
13223
13132
|
const machine = {
|
|
13224
|
-
[
|
|
13225
|
-
REFERENCE: goTo(
|
|
13226
|
-
NUMBER: goTo(
|
|
13227
|
-
SYMBOL: [goToMulti(
|
|
13228
|
-
},
|
|
13229
|
-
[
|
|
13230
|
-
SPACE: goTo(
|
|
13231
|
-
OPERATOR: goTo(
|
|
13232
|
-
},
|
|
13233
|
-
[
|
|
13234
|
-
SPACE: goTo(
|
|
13235
|
-
OPERATOR: goTo(
|
|
13236
|
-
},
|
|
13237
|
-
[
|
|
13238
|
-
SPACE: goTo(
|
|
13239
|
-
OPERATOR: goTo(
|
|
13240
|
-
},
|
|
13241
|
-
[
|
|
13242
|
-
SPACE: goTo(
|
|
13243
|
-
NUMBER: goTo(
|
|
13244
|
-
REFERENCE: goTo(
|
|
13245
|
-
SYMBOL: goTo(
|
|
13246
|
-
},
|
|
13247
|
-
[
|
|
13248
|
-
SPACE: goTo(
|
|
13249
|
-
SYMBOL: goTo(
|
|
13250
|
-
REFERENCE: goTo(
|
|
13251
|
-
},
|
|
13252
|
-
[
|
|
13253
|
-
SPACE: goTo(
|
|
13254
|
-
NUMBER: goTo(
|
|
13255
|
-
REFERENCE: goTo(
|
|
13256
|
-
SYMBOL: goTo(
|
|
13257
|
-
},
|
|
13258
|
-
[
|
|
13133
|
+
[0]: {
|
|
13134
|
+
REFERENCE: goTo(2),
|
|
13135
|
+
NUMBER: goTo(4),
|
|
13136
|
+
SYMBOL: [goToMulti(3, (token) => isColReference(token.value)), goToMulti(4, (token) => isRowReference(token.value))]
|
|
13137
|
+
},
|
|
13138
|
+
[3]: {
|
|
13139
|
+
SPACE: goTo(3),
|
|
13140
|
+
OPERATOR: goTo(5, (token) => token.value === ":")
|
|
13141
|
+
},
|
|
13142
|
+
[4]: {
|
|
13143
|
+
SPACE: goTo(4),
|
|
13144
|
+
OPERATOR: goTo(6, (token) => token.value === ":")
|
|
13145
|
+
},
|
|
13146
|
+
[2]: {
|
|
13147
|
+
SPACE: goTo(2),
|
|
13148
|
+
OPERATOR: goTo(1, (token) => token.value === ":")
|
|
13149
|
+
},
|
|
13150
|
+
[1]: {
|
|
13151
|
+
SPACE: goTo(1),
|
|
13152
|
+
NUMBER: goTo(7),
|
|
13153
|
+
REFERENCE: goTo(7, (token) => isSingleCellReference(token.value)),
|
|
13154
|
+
SYMBOL: goTo(7, (token) => isColHeader(token.value) || isRowHeader(token.value))
|
|
13155
|
+
},
|
|
13156
|
+
[5]: {
|
|
13157
|
+
SPACE: goTo(5),
|
|
13158
|
+
SYMBOL: goTo(7, (token) => isColHeader(token.value)),
|
|
13159
|
+
REFERENCE: goTo(7, (token) => isSingleCellReference(token.value))
|
|
13160
|
+
},
|
|
13161
|
+
[6]: {
|
|
13162
|
+
SPACE: goTo(6),
|
|
13163
|
+
NUMBER: goTo(7),
|
|
13164
|
+
REFERENCE: goTo(7, (token) => isSingleCellReference(token.value)),
|
|
13165
|
+
SYMBOL: goTo(7, (token) => isRowHeader(token.value))
|
|
13166
|
+
},
|
|
13167
|
+
[7]: {}
|
|
13259
13168
|
};
|
|
13260
13169
|
/**
|
|
13261
13170
|
* Check if the list of tokens starts with a sequence of tokens representing
|
|
@@ -13265,7 +13174,7 @@ const machine = {
|
|
|
13265
13174
|
*/
|
|
13266
13175
|
function matchReference(tokens) {
|
|
13267
13176
|
let head = 0;
|
|
13268
|
-
let transitions = machine[
|
|
13177
|
+
let transitions = machine[0];
|
|
13269
13178
|
let matchedTokens = "";
|
|
13270
13179
|
while (transitions !== void 0) {
|
|
13271
13180
|
const token = tokens[head++];
|
|
@@ -13274,7 +13183,7 @@ function matchReference(tokens) {
|
|
|
13274
13183
|
const nextState = transition ? transition.goTo : void 0;
|
|
13275
13184
|
switch (nextState) {
|
|
13276
13185
|
case void 0: return null;
|
|
13277
|
-
case
|
|
13186
|
+
case 7:
|
|
13278
13187
|
matchedTokens += token.value;
|
|
13279
13188
|
tokens.splice(0, head);
|
|
13280
13189
|
return {
|
|
@@ -13979,10 +13888,10 @@ const PasteInteractiveContent = {
|
|
|
13979
13888
|
};
|
|
13980
13889
|
function handlePasteResult(env, result) {
|
|
13981
13890
|
if (!result.isSuccessful) {
|
|
13982
|
-
if (result.reasons.includes(
|
|
13983
|
-
else if (result.reasons.includes(
|
|
13984
|
-
else if (result.reasons.includes(
|
|
13985
|
-
else if (result.reasons.includes(
|
|
13891
|
+
if (result.reasons.includes("WrongPasteSelection")) env.raiseError(PasteInteractiveContent.wrongPasteSelection);
|
|
13892
|
+
else if (result.reasons.includes("WillRemoveExistingMerge")) env.raiseError(PasteInteractiveContent.willRemoveExistingMerge);
|
|
13893
|
+
else if (result.reasons.includes("WrongFigurePasteOption")) env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
|
|
13894
|
+
else if (result.reasons.includes("FrozenPaneOverlap")) env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
|
|
13986
13895
|
}
|
|
13987
13896
|
}
|
|
13988
13897
|
function interactivePaste(env, target, pasteOption) {
|
|
@@ -14008,25 +13917,25 @@ function interactivePasteFromOS(env, target, clipboardContent, pasteOption) {
|
|
|
14008
13917
|
//#region src/components/translations_terms.ts
|
|
14009
13918
|
const CfTerms = {
|
|
14010
13919
|
Errors: {
|
|
14011
|
-
[
|
|
14012
|
-
[
|
|
14013
|
-
[
|
|
14014
|
-
[
|
|
14015
|
-
[
|
|
14016
|
-
[
|
|
14017
|
-
[
|
|
14018
|
-
[
|
|
14019
|
-
[
|
|
14020
|
-
[
|
|
14021
|
-
[
|
|
14022
|
-
[
|
|
14023
|
-
[
|
|
14024
|
-
[
|
|
14025
|
-
[
|
|
14026
|
-
[
|
|
14027
|
-
[
|
|
14028
|
-
[
|
|
14029
|
-
[
|
|
13920
|
+
["InvalidRange"]: _t("The range is invalid"),
|
|
13921
|
+
["FirstArgMissing"]: _t("The argument is missing. Please provide a value"),
|
|
13922
|
+
["SecondArgMissing"]: _t("The second argument is missing. Please provide a value"),
|
|
13923
|
+
["MinNaN"]: _t("The minpoint must be a number"),
|
|
13924
|
+
["MidNaN"]: _t("The midpoint must be a number"),
|
|
13925
|
+
["MaxNaN"]: _t("The maxpoint must be a number"),
|
|
13926
|
+
["ValueUpperInflectionNaN"]: _t("The first value must be a number"),
|
|
13927
|
+
["ValueLowerInflectionNaN"]: _t("The second value must be a number"),
|
|
13928
|
+
["MinBiggerThanMax"]: _t("Minimum must be smaller then Maximum"),
|
|
13929
|
+
["MinBiggerThanMid"]: _t("Minimum must be smaller then Midpoint"),
|
|
13930
|
+
["MidBiggerThanMax"]: _t("Midpoint must be smaller then Maximum"),
|
|
13931
|
+
["LowerBiggerThanUpper"]: _t("Lower inflection point must be smaller than upper inflection point"),
|
|
13932
|
+
["MinInvalidFormula"]: _t("Invalid Minpoint formula"),
|
|
13933
|
+
["MaxInvalidFormula"]: _t("Invalid Maxpoint formula"),
|
|
13934
|
+
["MidInvalidFormula"]: _t("Invalid Midpoint formula"),
|
|
13935
|
+
["ValueUpperInvalidFormula"]: _t("Invalid upper inflection point formula"),
|
|
13936
|
+
["ValueLowerInvalidFormula"]: _t("Invalid lower inflection point formula"),
|
|
13937
|
+
["EmptyRange"]: _t("A range needs to be defined"),
|
|
13938
|
+
["ValueCellIsInvalidFormula"]: _t("At least one of the provided values is an invalid formula"),
|
|
14030
13939
|
Unexpected: _t("The rule is invalid for an unknown reason")
|
|
14031
13940
|
},
|
|
14032
13941
|
ColorScale: _t("Color scale"),
|
|
@@ -14061,18 +13970,18 @@ const ChartTerms = {
|
|
|
14061
13970
|
AggregatedChart: _t("Aggregate"),
|
|
14062
13971
|
Errors: {
|
|
14063
13972
|
Unexpected: _t("The chart definition is invalid for an unknown reason"),
|
|
14064
|
-
[
|
|
14065
|
-
[
|
|
14066
|
-
[
|
|
14067
|
-
[
|
|
14068
|
-
[
|
|
14069
|
-
[
|
|
14070
|
-
[
|
|
14071
|
-
[
|
|
14072
|
-
[
|
|
14073
|
-
[
|
|
14074
|
-
[
|
|
14075
|
-
[
|
|
13973
|
+
["InvalidDataSet"]: _t("The dataset is invalid"),
|
|
13974
|
+
["InvalidLabelRange"]: _t("Labels are invalid"),
|
|
13975
|
+
["InvalidScorecardKeyValue"]: _t("The key value is invalid"),
|
|
13976
|
+
["InvalidScorecardBaseline"]: _t("The baseline value is invalid"),
|
|
13977
|
+
["InvalidGaugeDataRange"]: _t("The data range is invalid"),
|
|
13978
|
+
["EmptyGaugeRangeMin"]: _t("A minimum range limit value is needed"),
|
|
13979
|
+
["GaugeRangeMinNaN"]: _t("The minimum range limit value must be a number"),
|
|
13980
|
+
["EmptyGaugeRangeMax"]: _t("A maximum range limit value is needed"),
|
|
13981
|
+
["GaugeRangeMaxNaN"]: _t("The maximum range limit value must be a number"),
|
|
13982
|
+
["GaugeRangeMinBiggerThanRangeMax"]: _t("Minimum range limit must be smaller than maximum range limit"),
|
|
13983
|
+
["GaugeLowerInflectionPointNaN"]: _t("The lower inflection point value must be a number"),
|
|
13984
|
+
["GaugeUpperInflectionPointNaN"]: _t("The upper inflection point value must be a number")
|
|
14076
13985
|
}
|
|
14077
13986
|
};
|
|
14078
13987
|
const CustomCurrencyTerms = { Custom: _t("Custom") };
|
|
@@ -14080,16 +13989,16 @@ const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerg
|
|
|
14080
13989
|
const TableHeaderMoveErrorMessage = _t("The header row of a table can't be moved.");
|
|
14081
13990
|
const SplitToColumnsTerms = { Errors: {
|
|
14082
13991
|
Unexpected: _t("Cannot split the selection for an unknown reason"),
|
|
14083
|
-
[
|
|
14084
|
-
[
|
|
14085
|
-
[
|
|
13992
|
+
["NoSplitSeparatorInSelection"]: _t("There is no match for the selected separator in the selection"),
|
|
13993
|
+
["MoreThanOneColumnSelected"]: _t("Only a selection from a single column can be split"),
|
|
13994
|
+
["SplitWillOverwriteContent"]: _t("Splitting will overwrite existing content")
|
|
14086
13995
|
} };
|
|
14087
13996
|
const RemoveDuplicateTerms = { Errors: {
|
|
14088
13997
|
Unexpected: _t("Cannot remove duplicates for an unknown reason"),
|
|
14089
|
-
[
|
|
14090
|
-
[
|
|
14091
|
-
[
|
|
14092
|
-
[
|
|
13998
|
+
["MoreThanOneRangeSelected"]: _t("Please select only one range of cells"),
|
|
13999
|
+
["EmptyTarget"]: _t("Please select a range of cells containing values."),
|
|
14000
|
+
["NoColumnsProvided"]: _t("Please select at latest one column to analyze."),
|
|
14001
|
+
["WillRemoveExistingMerge"]: PasteInteractiveContent.willRemoveExistingMerge
|
|
14093
14002
|
} };
|
|
14094
14003
|
const DVTerms = {
|
|
14095
14004
|
DateIs: {
|
|
@@ -14118,10 +14027,10 @@ const DVTerms = {
|
|
|
14118
14027
|
const TableTerms = {
|
|
14119
14028
|
Errors: {
|
|
14120
14029
|
Unexpected: _t("The table zone is invalid for an unknown reason"),
|
|
14121
|
-
[
|
|
14122
|
-
[
|
|
14123
|
-
[
|
|
14124
|
-
[
|
|
14030
|
+
["TableOverlap"]: _t("You cannot create overlapping tables."),
|
|
14031
|
+
["NonContinuousTargets"]: _t("A table can only be created on a continuous selection."),
|
|
14032
|
+
["InvalidRange"]: _t("The range is invalid"),
|
|
14033
|
+
["TargetOutOfSheet"]: _t("The range is out of the sheet")
|
|
14125
14034
|
},
|
|
14126
14035
|
Checkboxes: {
|
|
14127
14036
|
hasFilters: _t("Filter button"),
|
|
@@ -14565,7 +14474,7 @@ var AbstractChart = class {
|
|
|
14565
14474
|
//#region src/helpers/figures/charts/scorecard_chart.ts
|
|
14566
14475
|
function getBaselineText(baseline, keyValue, baselineMode, humanize, locale) {
|
|
14567
14476
|
if (!baseline) return "";
|
|
14568
|
-
else if (baselineMode === "text" || keyValue?.type !==
|
|
14477
|
+
else if (baselineMode === "text" || keyValue?.type !== "number" || baseline.type !== "number") {
|
|
14569
14478
|
if (humanize) return humanizeNumber(baseline, locale);
|
|
14570
14479
|
return baseline.formattedValue;
|
|
14571
14480
|
}
|
|
@@ -14594,23 +14503,23 @@ function getKeyValueText(keyValueCell, humanize, locale) {
|
|
|
14594
14503
|
return keyValueCell.formattedValue ?? String(keyValueCell.value ?? "");
|
|
14595
14504
|
}
|
|
14596
14505
|
function getBaselineColor(baseline, baselineMode, keyValue, colorUp, colorDown) {
|
|
14597
|
-
if (baselineMode === "text" || baselineMode === "progress" || baseline?.type !==
|
|
14506
|
+
if (baselineMode === "text" || baselineMode === "progress" || baseline?.type !== "number" || keyValue?.type !== "number") return;
|
|
14598
14507
|
const diff = keyValue.value - baseline.value;
|
|
14599
14508
|
if (diff > 0) return colorUp;
|
|
14600
14509
|
else if (diff < 0) return colorDown;
|
|
14601
14510
|
}
|
|
14602
14511
|
function getBaselineArrowDirection(baseline, keyValue, baselineMode) {
|
|
14603
|
-
if (baselineMode === "text" || baseline?.type !==
|
|
14512
|
+
if (baselineMode === "text" || baseline?.type !== "number" || keyValue?.type !== "number") return "neutral";
|
|
14604
14513
|
const diff = keyValue.value - baseline.value;
|
|
14605
14514
|
if (diff > 0) return "up";
|
|
14606
14515
|
else if (diff < 0) return "down";
|
|
14607
14516
|
return "neutral";
|
|
14608
14517
|
}
|
|
14609
14518
|
function checkKeyValue(definition) {
|
|
14610
|
-
return definition.keyValue && !rangeReference.test(definition.keyValue) ?
|
|
14519
|
+
return definition.keyValue && !rangeReference.test(definition.keyValue) ? "InvalidScorecardKeyValue" : "Success";
|
|
14611
14520
|
}
|
|
14612
14521
|
function checkBaseline(definition) {
|
|
14613
|
-
return definition.baseline && !rangeReference.test(definition.baseline) ?
|
|
14522
|
+
return definition.baseline && !rangeReference.test(definition.baseline) ? "InvalidScorecardBaseline" : "Success";
|
|
14614
14523
|
}
|
|
14615
14524
|
const arrowDownPath = new window.Path2D("M8.6 4.8a.5.5 0 0 1 0 .75l-3.9 3.9a.5 .5 0 0 1 -.75 0l-3.8 -3.9a.5 .5 0 0 1 0 -.75l.4-.4a.5.5 0 0 1 .75 0l2.3 2.4v-5.7c0-.25.25-.5.5-.5h.6c.25 0 .5.25.5.5v5.8l2.3 -2.4a.5.5 0 0 1 .75 0z");
|
|
14616
14525
|
const arrowUpPath = new window.Path2D("M8.7 5.5a.5.5 0 0 0 0-.75l-3.8-4a.5.5 0 0 0-.75 0l-3.8 4a.5.5 0 0 0 0 .75l.4.4a.5.5 0 0 0 .75 0l2.3-2.4v5.8c0 .25.25.5.5.5h.6c.25 0 .5-.25.5-.5v-5.8l2.2 2.4a.5.5 0 0 0 .75 0z");
|
|
@@ -14840,6 +14749,7 @@ function getScorecardConfiguration({ width, height }, runtime) {
|
|
|
14840
14749
|
}, runtime).computeDesign();
|
|
14841
14750
|
}
|
|
14842
14751
|
var ScorecardChartConfigBuilder = class {
|
|
14752
|
+
runtime;
|
|
14843
14753
|
context;
|
|
14844
14754
|
width;
|
|
14845
14755
|
height;
|
|
@@ -15320,7 +15230,8 @@ var ChartJsComponent = class extends Component {
|
|
|
15320
15230
|
}
|
|
15321
15231
|
createChart(chartData) {
|
|
15322
15232
|
const ctx = this.canvas.el.getContext("2d");
|
|
15323
|
-
|
|
15233
|
+
const Chart = getChartJSConstructor();
|
|
15234
|
+
this.chart = new Chart(ctx, chartData);
|
|
15324
15235
|
}
|
|
15325
15236
|
updateChartJs(chartRuntime) {
|
|
15326
15237
|
const chartData = chartRuntime.chartJsConfig;
|
|
@@ -17907,15 +17818,15 @@ const DATEDIF = {
|
|
|
17907
17818
|
const jsEndDate = numberToJsDate(_endDate);
|
|
17908
17819
|
assert(() => _endDate >= _startDate, _t("start_date (%s) should be on or before end_date (%s).", jsStartDate.toLocaleDateString(), jsEndDate.toLocaleDateString()));
|
|
17909
17820
|
switch (_unit) {
|
|
17910
|
-
case
|
|
17911
|
-
case
|
|
17912
|
-
case
|
|
17913
|
-
case
|
|
17914
|
-
case
|
|
17821
|
+
case "Y": return getTimeDifferenceInWholeYears(jsStartDate, jsEndDate);
|
|
17822
|
+
case "M": return getTimeDifferenceInWholeMonths(jsStartDate, jsEndDate);
|
|
17823
|
+
case "D": return getTimeDifferenceInWholeDays(jsStartDate, jsEndDate);
|
|
17824
|
+
case "YM": return getTimeDifferenceInWholeMonths(jsStartDate, jsEndDate) - getTimeDifferenceInWholeYears(jsStartDate, jsEndDate) * 12;
|
|
17825
|
+
case "MD":
|
|
17915
17826
|
let days = jsEndDate.getDate() - jsStartDate.getDate();
|
|
17916
17827
|
if (days < 0) days = getDaysInMonth(new DateTime(jsEndDate.getFullYear(), jsEndDate.getMonth() - 1, 1)) - Math.abs(days);
|
|
17917
17828
|
return days;
|
|
17918
|
-
case
|
|
17829
|
+
case "YD": {
|
|
17919
17830
|
if (areTwoDatesWithinOneYear(_startDate, _endDate)) return getTimeDifferenceInWholeDays(jsStartDate, jsEndDate);
|
|
17920
17831
|
const endDateWithinOneYear = new DateTime(jsStartDate.getFullYear(), jsEndDate.getMonth(), jsEndDate.getDate());
|
|
17921
17832
|
let days = getTimeDifferenceInWholeDays(jsStartDate, endDateWithinOneYear);
|
|
@@ -18411,18 +18322,18 @@ const DELTA = {
|
|
|
18411
18322
|
//#endregion
|
|
18412
18323
|
//#region src/helpers/sort.ts
|
|
18413
18324
|
const SORT_TYPES = [
|
|
18414
|
-
|
|
18415
|
-
|
|
18416
|
-
|
|
18417
|
-
|
|
18325
|
+
"number",
|
|
18326
|
+
"error",
|
|
18327
|
+
"text",
|
|
18328
|
+
"boolean"
|
|
18418
18329
|
];
|
|
18419
18330
|
function cellsSortingCriterion(sortingOrder) {
|
|
18420
18331
|
const inverse = sortingOrder === "ascending" ? 1 : -1;
|
|
18421
18332
|
return (left, right) => {
|
|
18422
|
-
if (left.type ===
|
|
18423
|
-
else if (right.type ===
|
|
18333
|
+
if (left.type === "empty") return right.type === "empty" ? 0 : 1;
|
|
18334
|
+
else if (right.type === "empty") return -1;
|
|
18424
18335
|
let typeOrder = SORT_TYPES.indexOf(left.type) - SORT_TYPES.indexOf(right.type);
|
|
18425
|
-
if (typeOrder === 0) if (left.type ===
|
|
18336
|
+
if (typeOrder === 0) if (left.type === "text" || left.type === "error") typeOrder = left.value.localeCompare(right.value);
|
|
18426
18337
|
else typeOrder = left.value - right.value;
|
|
18427
18338
|
return inverse * typeOrder;
|
|
18428
18339
|
};
|
|
@@ -18433,9 +18344,9 @@ function sortCells(cells, sortDirection, emptyCellAsZero) {
|
|
|
18433
18344
|
type: cell.type,
|
|
18434
18345
|
value: cell.value
|
|
18435
18346
|
}));
|
|
18436
|
-
return (emptyCellAsZero ? cellsWithIndex.map((cell) => cell.type ===
|
|
18347
|
+
return (emptyCellAsZero ? cellsWithIndex.map((cell) => cell.type === "empty" ? {
|
|
18437
18348
|
...cell,
|
|
18438
|
-
type:
|
|
18349
|
+
type: "number",
|
|
18439
18350
|
value: 0
|
|
18440
18351
|
} : cell) : cellsWithIndex).sort(cellsSortingCriterion(sortDirection));
|
|
18441
18352
|
}
|
|
@@ -18497,7 +18408,7 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
|
|
|
18497
18408
|
});
|
|
18498
18409
|
});
|
|
18499
18410
|
}
|
|
18500
|
-
if (result.isCancelledBecause(
|
|
18411
|
+
if (result.isCancelledBecause("InvalidSortZone")) {
|
|
18501
18412
|
const { col, row } = anchor;
|
|
18502
18413
|
env.model.selection.selectZone({
|
|
18503
18414
|
cell: {
|
|
@@ -18550,11 +18461,11 @@ function sortMatrix(matrix, locale, ...criteria) {
|
|
|
18550
18461
|
const right = sortColumn[b];
|
|
18551
18462
|
const leftCell = {
|
|
18552
18463
|
value: left,
|
|
18553
|
-
type: left === null ?
|
|
18464
|
+
type: left === null ? "empty" : typeof left === "string" ? "text" : typeof left
|
|
18554
18465
|
};
|
|
18555
18466
|
const rightCell = {
|
|
18556
18467
|
value: right,
|
|
18557
|
-
type: right === null ?
|
|
18468
|
+
type: right === null ? "empty" : typeof right === "string" ? "text" : typeof right
|
|
18558
18469
|
};
|
|
18559
18470
|
const result = sortingCriteria[sortingOrders[i]](leftCell, rightCell);
|
|
18560
18471
|
if (result !== 0) return result;
|
|
@@ -20968,8 +20879,8 @@ const CELL = {
|
|
|
20968
20879
|
row: range.zone.top
|
|
20969
20880
|
};
|
|
20970
20881
|
const type = this.getters.getEvaluatedCell(position).type;
|
|
20971
|
-
if (type ===
|
|
20972
|
-
else if (type ===
|
|
20882
|
+
if (type === "empty") return "b";
|
|
20883
|
+
else if (type === "text") return "l";
|
|
20973
20884
|
else return "v";
|
|
20974
20885
|
}
|
|
20975
20886
|
}
|
|
@@ -24173,6 +24084,7 @@ var Composer = class extends Component {
|
|
|
24173
24084
|
//#endregion
|
|
24174
24085
|
//#region src/formulas/code_builder.ts
|
|
24175
24086
|
var FunctionCodeBuilder = class {
|
|
24087
|
+
scope;
|
|
24176
24088
|
code = "";
|
|
24177
24089
|
constructor(scope = new Scope()) {
|
|
24178
24090
|
this.scope = scope;
|
|
@@ -24188,6 +24100,8 @@ var FunctionCodeBuilder = class {
|
|
|
24188
24100
|
}
|
|
24189
24101
|
};
|
|
24190
24102
|
var FunctionCodeImpl = class {
|
|
24103
|
+
scope;
|
|
24104
|
+
returnExpression;
|
|
24191
24105
|
code;
|
|
24192
24106
|
constructor(scope, code, returnExpression) {
|
|
24193
24107
|
this.scope = scope;
|
|
@@ -24563,6 +24477,9 @@ function extractFormulaIdFromToken(tokenAtCursor) {
|
|
|
24563
24477
|
function getFirstPivotFunction(tokens) {
|
|
24564
24478
|
return getFunctionsFromTokens(tokens, PIVOT_FUNCTIONS)[0];
|
|
24565
24479
|
}
|
|
24480
|
+
function getPivotFunctions(tokens) {
|
|
24481
|
+
return getFunctionsFromTokens(tokens, PIVOT_FUNCTIONS);
|
|
24482
|
+
}
|
|
24566
24483
|
/**
|
|
24567
24484
|
* Parse a spreadsheet formula and detect the number of PIVOT functions that are
|
|
24568
24485
|
* present in the given formula.
|
|
@@ -24934,19 +24851,19 @@ autofillModifiersRegistry.add("ALPHANUMERIC_INCREMENT_MODIFIER", { apply: (rule,
|
|
|
24934
24851
|
let x = 0;
|
|
24935
24852
|
let y = 0;
|
|
24936
24853
|
switch (direction) {
|
|
24937
|
-
case
|
|
24854
|
+
case "up":
|
|
24938
24855
|
x = 0;
|
|
24939
24856
|
y = -rule.current;
|
|
24940
24857
|
break;
|
|
24941
|
-
case
|
|
24858
|
+
case "down":
|
|
24942
24859
|
x = 0;
|
|
24943
24860
|
y = rule.current;
|
|
24944
24861
|
break;
|
|
24945
|
-
case
|
|
24862
|
+
case "left":
|
|
24946
24863
|
x = -rule.current;
|
|
24947
24864
|
y = 0;
|
|
24948
24865
|
break;
|
|
24949
|
-
case
|
|
24866
|
+
case "right":
|
|
24950
24867
|
x = rule.current;
|
|
24951
24868
|
y = 0;
|
|
24952
24869
|
break;
|
|
@@ -25072,12 +24989,12 @@ autofillRulesRegistry.add("simple_value_copy", {
|
|
|
25072
24989
|
},
|
|
25073
24990
|
sequence: 10
|
|
25074
24991
|
}).add("increment_alphanumeric_value", {
|
|
25075
|
-
condition: (cell) => !cell.isFormula && evaluateLiteral(cell, { locale: DEFAULT_LOCALE }).type ===
|
|
24992
|
+
condition: (cell) => !cell.isFormula && evaluateLiteral(cell, { locale: DEFAULT_LOCALE }).type === "text" && alphaNumericValueRegExp.test(cell.content),
|
|
25076
24993
|
generateRule: (cell, cells, direction) => {
|
|
25077
24994
|
const numberPostfix = parseInt(cell.content.match(numberPostfixRegExp)[0]);
|
|
25078
24995
|
const prefix = cell.content.match(stringPrefixRegExp)[0];
|
|
25079
24996
|
const numberPostfixLength = cell.content.length - prefix.length;
|
|
25080
|
-
const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type ===
|
|
24997
|
+
const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type === "text" && alphaNumericValueRegExp.test(evaluatedCell.value)).filter((cell) => prefix === (cell.value ?? "").toString().match(stringPrefixRegExp)[0]).map((cell) => parseInt((cell.value ?? "").toString().match(numberPostfixRegExp)[0]));
|
|
25081
24998
|
let increment = calculateIncrementBasedOnGroup(group);
|
|
25082
24999
|
if (["up", "left"].includes(direction) && group.length === 1) increment = -increment;
|
|
25083
25000
|
return {
|
|
@@ -25090,7 +25007,7 @@ autofillRulesRegistry.add("simple_value_copy", {
|
|
|
25090
25007
|
},
|
|
25091
25008
|
sequence: 15
|
|
25092
25009
|
}).add("copy_text", {
|
|
25093
|
-
condition: (cell) => !cell.isFormula && evaluateLiteral(cell, { locale: DEFAULT_LOCALE }).type ===
|
|
25010
|
+
condition: (cell) => !cell.isFormula && evaluateLiteral(cell, { locale: DEFAULT_LOCALE }).type === "text",
|
|
25094
25011
|
generateRule: () => {
|
|
25095
25012
|
return { type: "COPY_MODIFIER" };
|
|
25096
25013
|
},
|
|
@@ -25107,10 +25024,10 @@ autofillRulesRegistry.add("simple_value_copy", {
|
|
|
25107
25024
|
sequence: 30
|
|
25108
25025
|
}).add("increment_dates", {
|
|
25109
25026
|
condition: (cell, cells) => {
|
|
25110
|
-
return !cell.isFormula && evaluateLiteral(cell, { locale: DEFAULT_LOCALE }).type ===
|
|
25027
|
+
return !cell.isFormula && evaluateLiteral(cell, { locale: DEFAULT_LOCALE }).type === "number" && !!cell.format && isDateTimeFormat(cell.format);
|
|
25111
25028
|
},
|
|
25112
25029
|
generateRule: (cell, cells) => {
|
|
25113
|
-
const increment = calculateDateIncrementBasedOnGroup(getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type ===
|
|
25030
|
+
const increment = calculateDateIncrementBasedOnGroup(getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type === "number" && !!evaluatedCell.format && isDateTimeFormat(evaluatedCell.format)).map((cell) => Number(cell.value)));
|
|
25114
25031
|
if (increment === void 0) return { type: "COPY_MODIFIER" };
|
|
25115
25032
|
/** requires to detect the current date (requires to be an integer value with the right format)
|
|
25116
25033
|
* detect if year or if month or if day then extrapolate increment required (+1 month, +1 year + 1 day)
|
|
@@ -25119,26 +25036,26 @@ autofillRulesRegistry.add("simple_value_copy", {
|
|
|
25119
25036
|
if (typeof increment === "object") return {
|
|
25120
25037
|
type: "DATE_INCREMENT_MODIFIER",
|
|
25121
25038
|
increment,
|
|
25122
|
-
current: evaluation.type ===
|
|
25039
|
+
current: evaluation.type === "number" ? evaluation.value : 0
|
|
25123
25040
|
};
|
|
25124
25041
|
return {
|
|
25125
25042
|
type: "INCREMENT_MODIFIER",
|
|
25126
25043
|
increment,
|
|
25127
|
-
current: evaluation.type ===
|
|
25044
|
+
current: evaluation.type === "number" ? evaluation.value : 0
|
|
25128
25045
|
};
|
|
25129
25046
|
},
|
|
25130
25047
|
sequence: 25
|
|
25131
25048
|
}).add("increment_number", {
|
|
25132
|
-
condition: (cell) => !cell.isFormula && evaluateLiteral(cell, { locale: DEFAULT_LOCALE }).type ===
|
|
25049
|
+
condition: (cell) => !cell.isFormula && evaluateLiteral(cell, { locale: DEFAULT_LOCALE }).type === "number",
|
|
25133
25050
|
generateRule: (cell, cells, direction) => {
|
|
25134
|
-
const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type ===
|
|
25051
|
+
const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type === "number" && !isDateTimeFormat(evaluatedCell.format || "")).map((cell) => Number(cell.value));
|
|
25135
25052
|
let increment = calculateIncrementBasedOnGroup(group);
|
|
25136
25053
|
if (["up", "left"].includes(direction) && group.length === 1) increment = -increment;
|
|
25137
25054
|
const evaluation = evaluateLiteral(cell, { locale: DEFAULT_LOCALE });
|
|
25138
25055
|
return {
|
|
25139
25056
|
type: "INCREMENT_MODIFIER",
|
|
25140
25057
|
increment,
|
|
25141
|
-
current: evaluation.type ===
|
|
25058
|
+
current: evaluation.type === "number" ? evaluation.value : 0
|
|
25142
25059
|
};
|
|
25143
25060
|
},
|
|
25144
25061
|
sequence: 40
|
|
@@ -26042,47 +25959,47 @@ function createComboChartRuntime(chart, getters) {
|
|
|
26042
25959
|
//#endregion
|
|
26043
25960
|
//#region src/helpers/figures/charts/gauge_chart.ts
|
|
26044
25961
|
function isDataRangeValid(definition) {
|
|
26045
|
-
return definition.dataRange && !rangeReference.test(definition.dataRange) ?
|
|
25962
|
+
return definition.dataRange && !rangeReference.test(definition.dataRange) ? "InvalidGaugeDataRange" : "Success";
|
|
26046
25963
|
}
|
|
26047
25964
|
function checkRangeLimits(check, batchValidations) {
|
|
26048
25965
|
return batchValidations((definition) => {
|
|
26049
25966
|
if (definition.sectionRule) return check(definition.sectionRule.rangeMin, "rangeMin");
|
|
26050
|
-
return
|
|
25967
|
+
return "Success";
|
|
26051
25968
|
}, (definition) => {
|
|
26052
25969
|
if (definition.sectionRule) return check(definition.sectionRule.rangeMax, "rangeMax");
|
|
26053
|
-
return
|
|
25970
|
+
return "Success";
|
|
26054
25971
|
});
|
|
26055
25972
|
}
|
|
26056
25973
|
function checkInflectionPointsValue(check, batchValidations) {
|
|
26057
25974
|
return batchValidations((definition) => {
|
|
26058
25975
|
if (definition.sectionRule) return check(definition.sectionRule.lowerInflectionPoint.value, "lowerInflectionPointValue");
|
|
26059
|
-
return
|
|
25976
|
+
return "Success";
|
|
26060
25977
|
}, (definition) => {
|
|
26061
25978
|
if (definition.sectionRule) return check(definition.sectionRule.upperInflectionPoint.value, "upperInflectionPointValue");
|
|
26062
|
-
return
|
|
25979
|
+
return "Success";
|
|
26063
25980
|
});
|
|
26064
25981
|
}
|
|
26065
25982
|
function checkRangeMinBiggerThanRangeMax(definition) {
|
|
26066
25983
|
if (definition.sectionRule) {
|
|
26067
|
-
if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) return
|
|
25984
|
+
if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) return "GaugeRangeMinBiggerThanRangeMax";
|
|
26068
25985
|
}
|
|
26069
|
-
return
|
|
25986
|
+
return "Success";
|
|
26070
25987
|
}
|
|
26071
25988
|
function checkEmpty(value, valueName) {
|
|
26072
25989
|
if (value === "") switch (valueName) {
|
|
26073
|
-
case "rangeMin": return
|
|
26074
|
-
case "rangeMax": return
|
|
25990
|
+
case "rangeMin": return "EmptyGaugeRangeMin";
|
|
25991
|
+
case "rangeMax": return "EmptyGaugeRangeMax";
|
|
26075
25992
|
}
|
|
26076
|
-
return
|
|
25993
|
+
return "Success";
|
|
26077
25994
|
}
|
|
26078
25995
|
function checkNaN(value, valueName) {
|
|
26079
25996
|
if (isNaN(value)) switch (valueName) {
|
|
26080
|
-
case "rangeMin": return
|
|
26081
|
-
case "rangeMax": return
|
|
26082
|
-
case "lowerInflectionPointValue": return
|
|
26083
|
-
case "upperInflectionPointValue": return
|
|
25997
|
+
case "rangeMin": return "GaugeRangeMinNaN";
|
|
25998
|
+
case "rangeMax": return "GaugeRangeMaxNaN";
|
|
25999
|
+
case "lowerInflectionPointValue": return "GaugeLowerInflectionPointNaN";
|
|
26000
|
+
case "upperInflectionPointValue": return "GaugeUpperInflectionPointNaN";
|
|
26084
26001
|
}
|
|
26085
|
-
return
|
|
26002
|
+
return "Success";
|
|
26086
26003
|
}
|
|
26087
26004
|
var GaugeChart = class GaugeChart extends AbstractChart {
|
|
26088
26005
|
dataRange;
|
|
@@ -26178,7 +26095,7 @@ function createGaugeChartRuntime(chart, getters) {
|
|
|
26178
26095
|
col: dataRange.zone.left,
|
|
26179
26096
|
row: dataRange.zone.top
|
|
26180
26097
|
});
|
|
26181
|
-
if (cell.type ===
|
|
26098
|
+
if (cell.type === "number") {
|
|
26182
26099
|
gaugeValue = cell.value;
|
|
26183
26100
|
formattedValue = cell.formattedValue;
|
|
26184
26101
|
format = cell.format;
|
|
@@ -27687,7 +27604,7 @@ var MenuItemRegistry = class extends Registry {
|
|
|
27687
27604
|
function interactiveCut(env) {
|
|
27688
27605
|
const result = env.model.dispatch("CUT");
|
|
27689
27606
|
if (!result.isSuccessful) {
|
|
27690
|
-
if (result.isCancelledBecause(
|
|
27607
|
+
if (result.isCancelledBecause("WrongCutSelection")) env.raiseError(_t("This operation is not allowed with multiple selections."));
|
|
27691
27608
|
}
|
|
27692
27609
|
}
|
|
27693
27610
|
|
|
@@ -27702,8 +27619,8 @@ function interactiveAddMerge(env, sheetId, target) {
|
|
|
27702
27619
|
sheetId,
|
|
27703
27620
|
target
|
|
27704
27621
|
});
|
|
27705
|
-
if (result.isCancelledBecause(
|
|
27706
|
-
else if (result.isCancelledBecause(
|
|
27622
|
+
if (result.isCancelledBecause("MergeInTable")) env.raiseError(AddMergeInteractiveContent.MergeInFilter);
|
|
27623
|
+
else if (result.isCancelledBecause("MergeIsDestructive")) env.askConfirmation(AddMergeInteractiveContent.MergeIsDestructive, () => {
|
|
27707
27624
|
env.model.dispatch("ADD_MERGE", {
|
|
27708
27625
|
sheetId,
|
|
27709
27626
|
target,
|
|
@@ -27744,7 +27661,7 @@ var ErrorToolTip = class extends Component {
|
|
|
27744
27661
|
const ErrorToolTipPopoverBuilder = { onHover: (position, getters) => {
|
|
27745
27662
|
const cell = getters.getEvaluatedCell(position);
|
|
27746
27663
|
const errors = [];
|
|
27747
|
-
if (cell.type ===
|
|
27664
|
+
if (cell.type === "error" && !!cell.message) errors.push({
|
|
27748
27665
|
title: _t("Error"),
|
|
27749
27666
|
message: cell.message
|
|
27750
27667
|
});
|
|
@@ -28453,7 +28370,7 @@ function zoneToRect(zone) {
|
|
|
28453
28370
|
css`
|
|
28454
28371
|
.o-popover {
|
|
28455
28372
|
position: absolute;
|
|
28456
|
-
z-index: ${
|
|
28373
|
+
z-index: ${35};
|
|
28457
28374
|
overflow: auto;
|
|
28458
28375
|
box-shadow: 1px 2px 5px 2px rgb(51 51 51 / 15%);
|
|
28459
28376
|
width: fit-content;
|
|
@@ -28508,7 +28425,7 @@ var Popover = class extends Component {
|
|
|
28508
28425
|
onMouseWheel: () => {},
|
|
28509
28426
|
onPopoverMoved: () => {},
|
|
28510
28427
|
onPopoverHidden: () => {},
|
|
28511
|
-
zIndex:
|
|
28428
|
+
zIndex: 35
|
|
28512
28429
|
};
|
|
28513
28430
|
popoverRef = useRef("popover");
|
|
28514
28431
|
currentPosition = void 0;
|
|
@@ -28554,6 +28471,10 @@ var Popover = class extends Component {
|
|
|
28554
28471
|
}
|
|
28555
28472
|
};
|
|
28556
28473
|
var PopoverPositionContext = class {
|
|
28474
|
+
anchorRect;
|
|
28475
|
+
containerRect;
|
|
28476
|
+
propsMaxSize;
|
|
28477
|
+
spreadsheetOffset;
|
|
28557
28478
|
constructor(anchorRect, containerRect, propsMaxSize, spreadsheetOffset) {
|
|
28558
28479
|
this.anchorRect = anchorRect;
|
|
28559
28480
|
this.containerRect = containerRect;
|
|
@@ -29128,7 +29049,7 @@ function getSmartChartDefinition(zone, getters) {
|
|
|
29128
29049
|
const dataSetsHaveTitle = !!getters.getEvaluatedCellsInZone(sheetId, {
|
|
29129
29050
|
...dataSetZone,
|
|
29130
29051
|
bottom: dataSetZone.top
|
|
29131
|
-
}).find((cell) => cell.type !==
|
|
29052
|
+
}).find((cell) => cell.type !== "empty" && cell.type !== "number");
|
|
29132
29053
|
let labelRangeXc;
|
|
29133
29054
|
if (!singleColumn) labelRangeXc = zoneToXc({
|
|
29134
29055
|
...zone,
|
|
@@ -29191,8 +29112,8 @@ function interactiveCreateTable(env, sheetId, tableConfig) {
|
|
|
29191
29112
|
config: tableConfig,
|
|
29192
29113
|
tableType: isDynamic ? "dynamic" : "static"
|
|
29193
29114
|
});
|
|
29194
|
-
if (result.isCancelledBecause(
|
|
29195
|
-
else if (result.isCancelledBecause(
|
|
29115
|
+
if (result.isCancelledBecause("TableOverlap")) env.raiseError(TableTerms.Errors.TableOverlap);
|
|
29116
|
+
else if (result.isCancelledBecause("NonContinuousTargets")) env.raiseError(TableTerms.Errors.NonContinuousTargets);
|
|
29196
29117
|
return result;
|
|
29197
29118
|
}
|
|
29198
29119
|
|
|
@@ -29223,7 +29144,7 @@ async function paste$1(env, pasteOption) {
|
|
|
29223
29144
|
const target = env.model.getters.getSelectedZones();
|
|
29224
29145
|
if (env.model.getters.getClipboardId() !== clipboardId) interactivePasteFromOS(env, target, clipboardContent, pasteOption);
|
|
29225
29146
|
else interactivePaste(env, target, pasteOption);
|
|
29226
|
-
if (env.model.getters.isCutOperation() && pasteOption !== "asValue") await env.clipboard.write({ [
|
|
29147
|
+
if (env.model.getters.isCutOperation() && pasteOption !== "asValue") await env.clipboard.write({ ["text/plain"]: "" });
|
|
29227
29148
|
break;
|
|
29228
29149
|
case "notImplemented":
|
|
29229
29150
|
env.raiseError(_t("Pasting from the context menu is not supported in this browser. Use keyboard shortcuts ctrl+c / ctrl+v instead."));
|
|
@@ -30163,7 +30084,7 @@ const FIX_FORMULAS = {
|
|
|
30163
30084
|
if (!pivotId) return false;
|
|
30164
30085
|
const pivot = env.model.getters.getPivot(pivotId);
|
|
30165
30086
|
const cell = env.model.getters.getEvaluatedCell(position);
|
|
30166
|
-
return pivot.isValid() && env.model.getters.isSpillPivotFormula(position) && cell.type !==
|
|
30087
|
+
return pivot.isValid() && env.model.getters.isSpillPivotFormula(position) && cell.type !== "error";
|
|
30167
30088
|
},
|
|
30168
30089
|
icon: "o-spreadsheet-Icon.PIVOT"
|
|
30169
30090
|
};
|
|
@@ -30748,7 +30669,7 @@ function interactiveFreezeColumnsRows(env, dimension, base) {
|
|
|
30748
30669
|
if (env.model.dispatch(cmd, {
|
|
30749
30670
|
sheetId,
|
|
30750
30671
|
quantity: base
|
|
30751
|
-
}).isCancelledBecause(
|
|
30672
|
+
}).isCancelledBecause("MergeOverlap")) env.raiseError(MergeErrorMessage);
|
|
30752
30673
|
}
|
|
30753
30674
|
|
|
30754
30675
|
//#endregion
|
|
@@ -31274,7 +31195,7 @@ function getVisiblePivotCellPositions(getters, pivotId) {
|
|
|
31274
31195
|
col,
|
|
31275
31196
|
row
|
|
31276
31197
|
};
|
|
31277
|
-
if (
|
|
31198
|
+
if (getters.getPivotIdsFromPosition(position).includes(pivotId)) positions.push(position);
|
|
31278
31199
|
}
|
|
31279
31200
|
return positions;
|
|
31280
31201
|
}
|
|
@@ -31840,6 +31761,9 @@ var FocusStore = class {
|
|
|
31840
31761
|
* This plugin handles this internal state.
|
|
31841
31762
|
*/
|
|
31842
31763
|
var SelectionInputStore = class extends SpreadsheetStore {
|
|
31764
|
+
initialRanges;
|
|
31765
|
+
inputHasSingleRange;
|
|
31766
|
+
colors;
|
|
31843
31767
|
mutators = [
|
|
31844
31768
|
"resetWithRanges",
|
|
31845
31769
|
"focusById",
|
|
@@ -32436,10 +32360,10 @@ var GenericChartConfigPanel = class extends Component {
|
|
|
32436
32360
|
return [...this.state.datasetDispatchResult?.reasons || [], ...this.state.labelsDispatchResult?.reasons || []].map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
32437
32361
|
}
|
|
32438
32362
|
get isDatasetInvalid() {
|
|
32439
|
-
return !!this.state.datasetDispatchResult?.isCancelledBecause(
|
|
32363
|
+
return !!this.state.datasetDispatchResult?.isCancelledBecause("InvalidDataSet");
|
|
32440
32364
|
}
|
|
32441
32365
|
get isLabelInvalid() {
|
|
32442
|
-
return !!this.state.labelsDispatchResult?.isCancelledBecause(
|
|
32366
|
+
return !!this.state.labelsDispatchResult?.isCancelledBecause("InvalidLabelRange");
|
|
32443
32367
|
}
|
|
32444
32368
|
get dataSetsHaveTitleLabel() {
|
|
32445
32369
|
return _t("Use row %s as headers", this.calculateHeaderPosition() || "");
|
|
@@ -33776,7 +33700,7 @@ var GaugeChartConfigPanel = class extends Component {
|
|
|
33776
33700
|
return [...this.state.dataRangeDispatchResult?.reasons || []].map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
33777
33701
|
}
|
|
33778
33702
|
get isDataRangeInvalid() {
|
|
33779
|
-
return !!this.state.dataRangeDispatchResult?.isCancelledBecause(
|
|
33703
|
+
return !!this.state.dataRangeDispatchResult?.isCancelledBecause("InvalidGaugeDataRange");
|
|
33780
33704
|
}
|
|
33781
33705
|
onDataRangeChanged(ranges) {
|
|
33782
33706
|
this.dataRange = ranges[0];
|
|
@@ -33862,16 +33786,16 @@ var GaugeChartDesignPanel = class extends Component {
|
|
|
33862
33786
|
return [...this.state.sectionRuleDispatchResult?.reasons || []].map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
33863
33787
|
}
|
|
33864
33788
|
isRangeMinInvalid() {
|
|
33865
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
33789
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("EmptyGaugeRangeMin") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeRangeMinNaN") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeRangeMinBiggerThanRangeMax"));
|
|
33866
33790
|
}
|
|
33867
33791
|
isRangeMaxInvalid() {
|
|
33868
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
33792
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("EmptyGaugeRangeMax") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeRangeMaxNaN") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeRangeMinBiggerThanRangeMax"));
|
|
33869
33793
|
}
|
|
33870
33794
|
get isLowerInflectionPointInvalid() {
|
|
33871
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
33795
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeLowerInflectionPointNaN") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeLowerBiggerThanUpper"));
|
|
33872
33796
|
}
|
|
33873
33797
|
get isUpperInflectionPointInvalid() {
|
|
33874
|
-
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(
|
|
33798
|
+
return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeUpperInflectionPointNaN") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeLowerBiggerThanUpper"));
|
|
33875
33799
|
}
|
|
33876
33800
|
updateSectionColor(target, color) {
|
|
33877
33801
|
const sectionRule = deepCopy(this.state.sectionRule);
|
|
@@ -33995,10 +33919,10 @@ var ScorecardChartConfigPanel = class extends Component {
|
|
|
33995
33919
|
return [...this.state.keyValueDispatchResult?.reasons || [], ...this.state.baselineDispatchResult?.reasons || []].map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
33996
33920
|
}
|
|
33997
33921
|
get isKeyValueInvalid() {
|
|
33998
|
-
return !!this.state.keyValueDispatchResult?.isCancelledBecause(
|
|
33922
|
+
return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardKeyValue");
|
|
33999
33923
|
}
|
|
34000
33924
|
get isBaselineInvalid() {
|
|
34001
|
-
return !!this.state.keyValueDispatchResult?.isCancelledBecause(
|
|
33925
|
+
return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
|
|
34002
33926
|
}
|
|
34003
33927
|
onKeyValueRangeChanged(ranges) {
|
|
34004
33928
|
this.keyValue = ranges[0];
|
|
@@ -34887,6 +34811,7 @@ var AbstractComposerStore = class extends SpreadsheetStore {
|
|
|
34887
34811
|
//#endregion
|
|
34888
34812
|
//#region src/components/composer/standalone_composer/standalone_composer_store.ts
|
|
34889
34813
|
var StandaloneComposerStore = class extends AbstractComposerStore {
|
|
34814
|
+
args;
|
|
34890
34815
|
constructor(get, args) {
|
|
34891
34816
|
super(get);
|
|
34892
34817
|
this.args = args;
|
|
@@ -35024,7 +34949,7 @@ var StandaloneComposer = class extends Component {
|
|
|
35024
34949
|
css`
|
|
35025
34950
|
.o-icon-picker {
|
|
35026
34951
|
position: absolute;
|
|
35027
|
-
z-index: ${
|
|
34952
|
+
z-index: ${25};
|
|
35028
34953
|
box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);
|
|
35029
34954
|
background-color: white;
|
|
35030
34955
|
padding: 2px 1px;
|
|
@@ -35276,6 +35201,7 @@ var DOMDndHelper = class {
|
|
|
35276
35201
|
}
|
|
35277
35202
|
};
|
|
35278
35203
|
var ContainerWrapper = class {
|
|
35204
|
+
el;
|
|
35279
35205
|
constructor(el) {
|
|
35280
35206
|
this.el = el;
|
|
35281
35207
|
}
|
|
@@ -35655,11 +35581,12 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
35655
35581
|
colorNumberString = colorNumberString;
|
|
35656
35582
|
state;
|
|
35657
35583
|
setup() {
|
|
35584
|
+
const cf = this.props.editedCf || {
|
|
35585
|
+
id: this.env.model.uuidGenerator.smallUuid(),
|
|
35586
|
+
ranges: this.env.model.getters.getSelectedZones().map((zone) => this.env.model.getters.zoneToXC(this.env.model.getters.getActiveSheetId(), zone))
|
|
35587
|
+
};
|
|
35658
35588
|
this.state = useState({
|
|
35659
|
-
currentCF:
|
|
35660
|
-
id: this.env.model.uuidGenerator.smallUuid(),
|
|
35661
|
-
ranges: this.env.model.getters.getSelectedZones().map((zone) => this.env.model.getters.zoneToXC(this.env.model.getters.getActiveSheetId(), zone))
|
|
35662
|
-
},
|
|
35589
|
+
currentCF: cf,
|
|
35663
35590
|
currentCFType: this.props.editedCf?.rule.type || "CellIsRule",
|
|
35664
35591
|
errors: [],
|
|
35665
35592
|
rules: this.getDefaultRules()
|
|
@@ -35681,7 +35608,7 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
35681
35608
|
useExternalListener(window, "click", this.closeMenus);
|
|
35682
35609
|
}
|
|
35683
35610
|
get isRangeValid() {
|
|
35684
|
-
return this.state.errors.includes(
|
|
35611
|
+
return this.state.errors.includes("EmptyRange");
|
|
35685
35612
|
}
|
|
35686
35613
|
get errorMessages() {
|
|
35687
35614
|
return this.state.errors.map((error) => CfTerms.Errors[error] || CfTerms.Errors.Unexpected);
|
|
@@ -35709,7 +35636,7 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
35709
35636
|
saveConditionalFormat() {
|
|
35710
35637
|
if (this.state.currentCF) {
|
|
35711
35638
|
if (this.state.currentCF.ranges.some((xc) => !xc.match(rangeReference))) {
|
|
35712
|
-
this.state.errors = [
|
|
35639
|
+
this.state.errors = ["InvalidRange"];
|
|
35713
35640
|
return;
|
|
35714
35641
|
}
|
|
35715
35642
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -35804,10 +35731,10 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
35804
35731
|
* Cell Is Rule
|
|
35805
35732
|
****************************************************************************/
|
|
35806
35733
|
get isValue1Invalid() {
|
|
35807
|
-
return this.state.errors.includes(
|
|
35734
|
+
return this.state.errors.includes("FirstArgMissing") || this.state.errors.includes("ValueCellIsInvalidFormula");
|
|
35808
35735
|
}
|
|
35809
35736
|
get isValue2Invalid() {
|
|
35810
|
-
return this.state.errors.includes(
|
|
35737
|
+
return this.state.errors.includes("SecondArgMissing");
|
|
35811
35738
|
}
|
|
35812
35739
|
toggleStyle(tool) {
|
|
35813
35740
|
const style = this.state.rules.cellIs.style;
|
|
@@ -35836,9 +35763,9 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
35836
35763
|
****************************************************************************/
|
|
35837
35764
|
isValueInvalid(threshold) {
|
|
35838
35765
|
switch (threshold) {
|
|
35839
|
-
case "minimum": return this.state.errors.includes(
|
|
35840
|
-
case "midpoint": return this.state.errors.includes(
|
|
35841
|
-
case "maximum": return this.state.errors.includes(
|
|
35766
|
+
case "minimum": return this.state.errors.includes("MinInvalidFormula") || this.state.errors.includes("MinBiggerThanMid") || this.state.errors.includes("MinBiggerThanMax") || this.state.errors.includes("MinNaN");
|
|
35767
|
+
case "midpoint": return this.state.errors.includes("MidInvalidFormula") || this.state.errors.includes("MidNaN") || this.state.errors.includes("MidBiggerThanMax");
|
|
35768
|
+
case "maximum": return this.state.errors.includes("MaxInvalidFormula") || this.state.errors.includes("MaxNaN");
|
|
35842
35769
|
default: return false;
|
|
35843
35770
|
}
|
|
35844
35771
|
}
|
|
@@ -35875,8 +35802,8 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
35875
35802
|
****************************************************************************/
|
|
35876
35803
|
isInflectionPointInvalid(inflectionPoint) {
|
|
35877
35804
|
switch (inflectionPoint) {
|
|
35878
|
-
case "lowerInflectionPoint": return this.state.errors.includes(
|
|
35879
|
-
case "upperInflectionPoint": return this.state.errors.includes(
|
|
35805
|
+
case "lowerInflectionPoint": return this.state.errors.includes("ValueLowerInflectionNaN") || this.state.errors.includes("ValueLowerInvalidFormula") || this.state.errors.includes("LowerBiggerThanUpper");
|
|
35806
|
+
case "upperInflectionPoint": return this.state.errors.includes("ValueUpperInflectionNaN") || this.state.errors.includes("ValueUpperInvalidFormula") || this.state.errors.includes("LowerBiggerThanUpper");
|
|
35880
35807
|
default: return true;
|
|
35881
35808
|
}
|
|
35882
35809
|
}
|
|
@@ -36123,13 +36050,14 @@ var CustomCurrencyPanel = class extends Component {
|
|
|
36123
36050
|
if (currenciesRegistry.getAll().length === 0) (await this.env.loadCurrencies?.() || []).forEach((currency, index) => {
|
|
36124
36051
|
currenciesRegistry.add(index.toString(), currency);
|
|
36125
36052
|
});
|
|
36126
|
-
|
|
36053
|
+
const emptyCurrency = {
|
|
36127
36054
|
name: _t(CustomCurrencyTerms.Custom),
|
|
36128
36055
|
code: "",
|
|
36129
36056
|
symbol: "",
|
|
36130
36057
|
decimalPlaces: 2,
|
|
36131
36058
|
position: "after"
|
|
36132
|
-
}
|
|
36059
|
+
};
|
|
36060
|
+
this.availableCurrencies = [emptyCurrency, ...currenciesRegistry.getAll()];
|
|
36133
36061
|
}
|
|
36134
36062
|
updateSelectCurrency(ev) {
|
|
36135
36063
|
const target = ev.target;
|
|
@@ -37277,12 +37205,6 @@ var DataValidationPanel = class extends Component {
|
|
|
37277
37205
|
//#endregion
|
|
37278
37206
|
//#region src/components/side_panel/find_and_replace/find_and_replace_store.ts
|
|
37279
37207
|
const FIND_AND_REPLACE_HIGHLIGHT_COLOR = "#8B008B";
|
|
37280
|
-
var Direction = /* @__PURE__ */ function(Direction) {
|
|
37281
|
-
Direction[Direction["previous"] = -1] = "previous";
|
|
37282
|
-
Direction[Direction["current"] = 0] = "current";
|
|
37283
|
-
Direction[Direction["next"] = 1] = "next";
|
|
37284
|
-
return Direction;
|
|
37285
|
-
}(Direction || {});
|
|
37286
37208
|
var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
37287
37209
|
mutators = [
|
|
37288
37210
|
"updateSearchOptions",
|
|
@@ -37343,10 +37265,10 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
37343
37265
|
this.updateSearchOptions({ searchFormulas: showFormula });
|
|
37344
37266
|
}
|
|
37345
37267
|
selectPreviousMatch() {
|
|
37346
|
-
this.selectNextCell(
|
|
37268
|
+
this.selectNextCell(-1);
|
|
37347
37269
|
}
|
|
37348
37270
|
selectNextMatch() {
|
|
37349
|
-
this.selectNextCell(
|
|
37271
|
+
this.selectNextCell(1);
|
|
37350
37272
|
}
|
|
37351
37273
|
handle(cmd) {
|
|
37352
37274
|
switch (cmd.type) {
|
|
@@ -37413,7 +37335,7 @@ var FindAndReplaceStore = class extends SpreadsheetStore {
|
|
|
37413
37335
|
refreshSearch(jumpToMatchSheet = true) {
|
|
37414
37336
|
if (!this.preserveSelectedMatchIndex) this.selectedMatchIndex = null;
|
|
37415
37337
|
this.findMatches();
|
|
37416
|
-
this.selectNextCell(
|
|
37338
|
+
this.selectNextCell(0, jumpToMatchSheet);
|
|
37417
37339
|
}
|
|
37418
37340
|
getSheetsInSearchOrder() {
|
|
37419
37341
|
switch (this.searchOptions.searchScope) {
|
|
@@ -37783,6 +37705,8 @@ var MoreFormatsPanel = class extends Component {
|
|
|
37783
37705
|
//#endregion
|
|
37784
37706
|
//#region src/components/side_panel/pivot/pivot_measure_display_panel/pivot_measure_display_panel_store.ts
|
|
37785
37707
|
var PivotMeasureDisplayPanelStore = class extends SpreadsheetStore {
|
|
37708
|
+
pivotId;
|
|
37709
|
+
initialMeasure;
|
|
37786
37710
|
mutators = [
|
|
37787
37711
|
"cancelMeasureDisplayEdition",
|
|
37788
37712
|
"updateMeasureDisplayType",
|
|
@@ -38687,7 +38611,7 @@ var PivotTitleSection = class extends Component {
|
|
|
38687
38611
|
});
|
|
38688
38612
|
let text;
|
|
38689
38613
|
if (result.isSuccessful) text = _t("Pivot duplicated.");
|
|
38690
|
-
else if (result.isCancelledBecause(
|
|
38614
|
+
else if (result.isCancelledBecause("PivotInError")) text = _t("Cannot duplicate a pivot in error.");
|
|
38691
38615
|
else text = _t("Pivot duplication failed.");
|
|
38692
38616
|
const type = result.isSuccessful ? "success" : "danger";
|
|
38693
38617
|
this.env.notifyUser({
|
|
@@ -38751,13 +38675,30 @@ function createMeasure(fields, measure) {
|
|
|
38751
38675
|
} : fields[fieldName];
|
|
38752
38676
|
const aggregator = measure.aggregator;
|
|
38753
38677
|
return {
|
|
38678
|
+
/**
|
|
38679
|
+
* Get the id of the measure, as it is stored in the pivot formula
|
|
38680
|
+
*/
|
|
38754
38681
|
id: measure.id,
|
|
38682
|
+
/**
|
|
38683
|
+
* Display name of the measure
|
|
38684
|
+
* e.g. "__count" -> "Count", "amount_total" -> "Total Amount"
|
|
38685
|
+
*/
|
|
38755
38686
|
get displayName() {
|
|
38756
38687
|
return measure.userDefinedName ?? field?.string ?? measure.fieldName;
|
|
38757
38688
|
},
|
|
38758
38689
|
userDefinedName: measure.userDefinedName,
|
|
38690
|
+
/**
|
|
38691
|
+
* Get the name of the field of the measure
|
|
38692
|
+
*/
|
|
38759
38693
|
fieldName,
|
|
38694
|
+
/**
|
|
38695
|
+
* Get the aggregator of the measure
|
|
38696
|
+
*/
|
|
38760
38697
|
aggregator,
|
|
38698
|
+
/**
|
|
38699
|
+
* Get the type of the measure field
|
|
38700
|
+
* e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
|
|
38701
|
+
*/
|
|
38761
38702
|
type: fieldName === "__count" ? "integer" : field?.type ?? "integer",
|
|
38762
38703
|
isValid: !!(field || measure.computedBy),
|
|
38763
38704
|
isHidden: measure.isHidden,
|
|
@@ -38771,10 +38712,30 @@ function createPivotDimension(fields, dimension) {
|
|
|
38771
38712
|
const type = field?.type ?? "integer";
|
|
38772
38713
|
const granularity = field && isDateOrDatetimeField(field) ? dimension.granularity : void 0;
|
|
38773
38714
|
return {
|
|
38715
|
+
/**
|
|
38716
|
+
* Get the display name of the dimension
|
|
38717
|
+
* e.g. "stage_id" -> "Stage", "create_date:month" -> "Create Date"
|
|
38718
|
+
*/
|
|
38774
38719
|
displayName: field?.string ?? dimension.fieldName,
|
|
38720
|
+
/**
|
|
38721
|
+
* Get the name of the dimension, as it is stored in the pivot formula
|
|
38722
|
+
* e.g. "stage_id", "create_date:month"
|
|
38723
|
+
*/
|
|
38775
38724
|
nameWithGranularity: dimension.fieldName + (granularity ? `:${granularity}` : ""),
|
|
38725
|
+
/**
|
|
38726
|
+
* Get the name of the field of the dimension
|
|
38727
|
+
* e.g. "stage_id" -> "stage_id", "create_date:month" -> "create_date"
|
|
38728
|
+
*/
|
|
38776
38729
|
fieldName: dimension.fieldName,
|
|
38730
|
+
/**
|
|
38731
|
+
* Get the aggregate operator of the dimension
|
|
38732
|
+
* e.g. "stage_id" -> undefined, "create_date:month" -> "month"
|
|
38733
|
+
*/
|
|
38777
38734
|
granularity,
|
|
38735
|
+
/**
|
|
38736
|
+
* Get the type of the field of the dimension
|
|
38737
|
+
* e.g. "stage_id" -> "many2one", "create_date:month" -> "date"
|
|
38738
|
+
*/
|
|
38778
38739
|
type,
|
|
38779
38740
|
order: dimension.order,
|
|
38780
38741
|
isValid: !!field
|
|
@@ -39396,14 +39357,6 @@ function resetMapValueDimensionDate() {
|
|
|
39396
39357
|
|
|
39397
39358
|
//#endregion
|
|
39398
39359
|
//#region src/helpers/pivot/spreadsheet_pivot/spreadsheet_pivot.ts
|
|
39399
|
-
var ReloadType = /* @__PURE__ */ function(ReloadType) {
|
|
39400
|
-
ReloadType[ReloadType["NONE"] = 0] = "NONE";
|
|
39401
|
-
ReloadType[ReloadType["TABLE"] = 1] = "TABLE";
|
|
39402
|
-
ReloadType[ReloadType["DATA"] = 2] = "DATA";
|
|
39403
|
-
ReloadType[ReloadType["DEFINITION"] = 3] = "DEFINITION";
|
|
39404
|
-
ReloadType[ReloadType["ALL"] = 4] = "ALL";
|
|
39405
|
-
return ReloadType;
|
|
39406
|
-
}(ReloadType || {});
|
|
39407
39360
|
/**
|
|
39408
39361
|
* This class represents a pivot table that is created from a range of cells.
|
|
39409
39362
|
* It will extract the fields from the first row of the range and the data from
|
|
@@ -39445,27 +39398,27 @@ var SpreadsheetPivot = class {
|
|
|
39445
39398
|
}
|
|
39446
39399
|
init(params = {}) {
|
|
39447
39400
|
if (!this._definition || params.reload) {
|
|
39448
|
-
this.reload(
|
|
39401
|
+
this.reload(4);
|
|
39449
39402
|
this.needsReevaluation = false;
|
|
39450
39403
|
}
|
|
39451
39404
|
}
|
|
39452
39405
|
reload(type) {
|
|
39453
|
-
if (type ===
|
|
39454
|
-
if (type >=
|
|
39455
|
-
if (type >=
|
|
39456
|
-
if (type >=
|
|
39406
|
+
if (type === 4) this.metaData = this.loadMetaData();
|
|
39407
|
+
if (type >= 3) this._definition = this.loadRuntimeDefinition();
|
|
39408
|
+
if (type >= 2) this.dataEntries = this.loadData();
|
|
39409
|
+
if (type >= 1) this.table = void 0;
|
|
39457
39410
|
}
|
|
39458
39411
|
onDefinitionChange(nextDefinition) {
|
|
39459
39412
|
const actualDefinition = this.coreDefinition;
|
|
39460
39413
|
this.coreDefinition = nextDefinition;
|
|
39461
39414
|
if (this._definition) {
|
|
39462
|
-
const reloadType = Math.max(this.computeShouldReload(actualDefinition, nextDefinition),
|
|
39415
|
+
const reloadType = Math.max(this.computeShouldReload(actualDefinition, nextDefinition), 0);
|
|
39463
39416
|
this.reload(reloadType);
|
|
39464
39417
|
}
|
|
39465
39418
|
}
|
|
39466
39419
|
computeShouldReload(actualDefinition, nextDefinition) {
|
|
39467
|
-
if (deepEquals(actualDefinition.dataSet, nextDefinition.dataSet)) return
|
|
39468
|
-
return
|
|
39420
|
+
if (deepEquals(actualDefinition.dataSet, nextDefinition.dataSet)) return 3;
|
|
39421
|
+
return 4;
|
|
39469
39422
|
}
|
|
39470
39423
|
get isInvalidRange() {
|
|
39471
39424
|
return !!this.invalidRangeError;
|
|
@@ -39538,7 +39491,7 @@ var SpreadsheetPivot = class {
|
|
|
39538
39491
|
if (dataEntries.length === 0) return { value: "" };
|
|
39539
39492
|
const measure = this.getMeasure(measureId);
|
|
39540
39493
|
const allValues = dataEntries.map((value) => value[measure.fieldName]).filter(isDefined);
|
|
39541
|
-
const values = allValues.filter((cell) => cell.type !==
|
|
39494
|
+
const values = allValues.filter((cell) => cell.type !== "empty");
|
|
39542
39495
|
const aggregator = measure.aggregator;
|
|
39543
39496
|
const operator = AGGREGATORS_FN[aggregator];
|
|
39544
39497
|
if (!operator) throw new Error(`Aggregator ${aggregator} does not exist`);
|
|
@@ -39626,16 +39579,16 @@ var SpreadsheetPivot = class {
|
|
|
39626
39579
|
return this.definition.getDimension(nameWithGranularity);
|
|
39627
39580
|
}
|
|
39628
39581
|
getTypeFromZone(sheetId, zone) {
|
|
39629
|
-
const nonEmptyCells = this.getters.getEvaluatedCellsInZone(sheetId, zone).filter((cell) => !(cell.type ===
|
|
39582
|
+
const nonEmptyCells = this.getters.getEvaluatedCellsInZone(sheetId, zone).filter((cell) => !(cell.type === "empty" || cell.value === ""));
|
|
39630
39583
|
if (nonEmptyCells.length === 0) return "integer";
|
|
39631
|
-
if (nonEmptyCells.every((cell) => cell.type ===
|
|
39632
|
-
if (nonEmptyCells.every((cell) => cell.type ===
|
|
39633
|
-
if (nonEmptyCells.every((cell) => cell.type ===
|
|
39584
|
+
if (nonEmptyCells.every((cell) => cell.type === "number" && cell.format && isDateTimeFormat(cell.format))) return "datetime";
|
|
39585
|
+
if (nonEmptyCells.every((cell) => cell.type === "boolean")) return "boolean";
|
|
39586
|
+
if (nonEmptyCells.every((cell) => cell.type === "number")) return "integer";
|
|
39634
39587
|
return "char";
|
|
39635
39588
|
}
|
|
39636
39589
|
assertCellIsValidField(col, row, cell) {
|
|
39637
|
-
if (cell.type ===
|
|
39638
|
-
if (cell.type ===
|
|
39590
|
+
if (cell.type === "error") throw new EvaluationError(_t("The pivot cannot be created because cell %s contains an error", toXC(col, row)));
|
|
39591
|
+
if (cell.type === "empty" || cell.value === "") throw new EvaluationError(_t("The pivot cannot be created because cell %s is empty", toXC(col, row)));
|
|
39639
39592
|
if (cell.value === "__count") throw new EvaluationError(_t("The pivot cannot be created because cell %s contains a reserved value", toXC(col, row)));
|
|
39640
39593
|
}
|
|
39641
39594
|
/**
|
|
@@ -39703,14 +39656,14 @@ var SpreadsheetPivot = class {
|
|
|
39703
39656
|
if (!field) throw new Error(`Field ${this.metaData.fieldKeys[index]} does not exist`);
|
|
39704
39657
|
if (cell.value === "") entry[field.name] = {
|
|
39705
39658
|
value: null,
|
|
39706
|
-
type:
|
|
39659
|
+
type: "empty",
|
|
39707
39660
|
formattedValue: ""
|
|
39708
39661
|
};
|
|
39709
39662
|
else entry[field.name] = cell;
|
|
39710
39663
|
}
|
|
39711
39664
|
entry["__count"] = {
|
|
39712
39665
|
value: 1,
|
|
39713
|
-
type:
|
|
39666
|
+
type: "number",
|
|
39714
39667
|
formattedValue: "1"
|
|
39715
39668
|
};
|
|
39716
39669
|
dataEntries.push(entry);
|
|
@@ -39723,7 +39676,7 @@ var SpreadsheetPivot = class {
|
|
|
39723
39676
|
const { format, value: valueToFormat } = pivotTimeAdapter(dimension.granularity || "month").toValueAndFormat(value, locale);
|
|
39724
39677
|
entry[dimension.nameWithGranularity] = {
|
|
39725
39678
|
value,
|
|
39726
|
-
type: entry[dimension.fieldName]?.type ||
|
|
39679
|
+
type: entry[dimension.fieldName]?.type || "empty",
|
|
39727
39680
|
format: entry[dimension.fieldName]?.format,
|
|
39728
39681
|
formattedValue: formatValue(valueToFormat, {
|
|
39729
39682
|
locale,
|
|
@@ -39791,6 +39744,7 @@ function adaptPivotRange(range, applyChange) {
|
|
|
39791
39744
|
//#endregion
|
|
39792
39745
|
//#region src/components/side_panel/pivot/pivot_side_panel/pivot_side_panel_store.ts
|
|
39793
39746
|
var PivotSidePanelStore = class extends SpreadsheetStore {
|
|
39747
|
+
pivotId;
|
|
39794
39748
|
mutators = [
|
|
39795
39749
|
"reset",
|
|
39796
39750
|
"deferUpdates",
|
|
@@ -39925,7 +39879,8 @@ var PivotSidePanelStore = class extends SpreadsheetStore {
|
|
|
39925
39879
|
}))
|
|
39926
39880
|
};
|
|
39927
39881
|
if (!this.draft && deepEquals(coreDefinition, cleanedDefinition)) return;
|
|
39928
|
-
|
|
39882
|
+
const cleanedWithGranularity = this.addDefaultDateTimeGranularity(this.fields, cleanedDefinition);
|
|
39883
|
+
this.draft = cleanedWithGranularity;
|
|
39929
39884
|
if (!this.updatesAreDeferred) this.applyUpdate();
|
|
39930
39885
|
}
|
|
39931
39886
|
/**
|
|
@@ -40242,7 +40197,7 @@ function interactiveSplitToColumns(env, separator, addNewColumns) {
|
|
|
40242
40197
|
separator,
|
|
40243
40198
|
addNewColumns
|
|
40244
40199
|
});
|
|
40245
|
-
if (result.isCancelledBecause(
|
|
40200
|
+
if (result.isCancelledBecause("SplitWillOverwriteContent")) env.askConfirmation(SplitToColumnsInteractiveContent.SplitIsDestructive, () => {
|
|
40246
40201
|
result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", {
|
|
40247
40202
|
separator,
|
|
40248
40203
|
addNewColumns,
|
|
@@ -40323,8 +40278,8 @@ var SplitIntoColumnsPanel = class extends Component {
|
|
|
40323
40278
|
}).reasons;
|
|
40324
40279
|
const errors = /* @__PURE__ */ new Set();
|
|
40325
40280
|
for (const reason of cancelledReasons) switch (reason) {
|
|
40326
|
-
case
|
|
40327
|
-
case
|
|
40281
|
+
case "SplitWillOverwriteContent":
|
|
40282
|
+
case "EmptySplitSeparator": break;
|
|
40328
40283
|
default: errors.add(SplitToColumnsTerms.Errors[reason] || SplitToColumnsTerms.Errors.Unexpected);
|
|
40329
40284
|
}
|
|
40330
40285
|
return Array.from(errors);
|
|
@@ -40335,7 +40290,7 @@ var SplitIntoColumnsPanel = class extends Component {
|
|
|
40335
40290
|
separator: this.separatorValue,
|
|
40336
40291
|
addNewColumns: this.state.addNewColumns,
|
|
40337
40292
|
force: false
|
|
40338
|
-
}).reasons.includes(
|
|
40293
|
+
}).reasons.includes("SplitWillOverwriteContent")) warnings.push(SplitToColumnsTerms.Errors["SplitWillOverwriteContent"]);
|
|
40339
40294
|
return warnings;
|
|
40340
40295
|
}
|
|
40341
40296
|
get separatorValue() {
|
|
@@ -41327,7 +41282,7 @@ css`
|
|
|
41327
41282
|
box-sizing: content-box;
|
|
41328
41283
|
|
|
41329
41284
|
.o-fig-anchor {
|
|
41330
|
-
z-index: ${
|
|
41285
|
+
z-index: ${1e3};
|
|
41331
41286
|
position: absolute;
|
|
41332
41287
|
width: ${ANCHOR_SIZE}px;
|
|
41333
41288
|
height: ${ANCHOR_SIZE}px;
|
|
@@ -41429,7 +41384,7 @@ var FigureComponent = class extends Component {
|
|
|
41429
41384
|
top: `${y}px`,
|
|
41430
41385
|
width: `${width}px`,
|
|
41431
41386
|
height: `${height}px`,
|
|
41432
|
-
"z-index": String(
|
|
41387
|
+
"z-index": String(10 + (this.isSelected ? 1 : 0))
|
|
41433
41388
|
});
|
|
41434
41389
|
}
|
|
41435
41390
|
getResizerPosition(resizer) {
|
|
@@ -41554,7 +41509,7 @@ function interactiveToggleGroup(env, sheetId, dimension, start, end) {
|
|
|
41554
41509
|
end: group.end
|
|
41555
41510
|
});
|
|
41556
41511
|
if (!result.isSuccessful) {
|
|
41557
|
-
if (result.isCancelledBecause(
|
|
41512
|
+
if (result.isCancelledBecause("NotEnoughElements")) {
|
|
41558
41513
|
const errorMessage = dimension === "ROW" ? ToggleGroupInteractiveContent.CannotHideAllRows : ToggleGroupInteractiveContent.CannotHideAllColumns;
|
|
41559
41514
|
env.raiseError(errorMessage);
|
|
41560
41515
|
}
|
|
@@ -41964,11 +41919,11 @@ var CellComposerStore = class extends AbstractComposerStore {
|
|
|
41964
41919
|
if (this.model.getters.getArrayFormulaSpreadingOn(position)) return "";
|
|
41965
41920
|
const { format, value, type, formattedValue } = this.getters.getEvaluatedCell(position);
|
|
41966
41921
|
switch (type) {
|
|
41967
|
-
case
|
|
41968
|
-
case
|
|
41969
|
-
case
|
|
41970
|
-
case
|
|
41971
|
-
case
|
|
41922
|
+
case "empty": return "";
|
|
41923
|
+
case "text":
|
|
41924
|
+
case "error": return value;
|
|
41925
|
+
case "boolean": return formattedValue;
|
|
41926
|
+
case "number":
|
|
41972
41927
|
if (format && isDateTimeFormat(format)) {
|
|
41973
41928
|
if (parseDateTime(formattedValue, locale) !== null) return formattedValue;
|
|
41974
41929
|
return formatValue(value, {
|
|
@@ -42032,7 +41987,7 @@ const COMPOSER_BORDER_WIDTH = 3 * .4 * window.devicePixelRatio || 1;
|
|
|
42032
41987
|
const GRID_CELL_REFERENCE_TOP_OFFSET = 28;
|
|
42033
41988
|
css`
|
|
42034
41989
|
div.o-grid-composer {
|
|
42035
|
-
z-index: ${
|
|
41990
|
+
z-index: ${20};
|
|
42036
41991
|
box-sizing: border-box;
|
|
42037
41992
|
position: absolute;
|
|
42038
41993
|
border: ${COMPOSER_BORDER_WIDTH}px solid ${SELECTION_BORDER_COLOR};
|
|
@@ -42044,7 +41999,7 @@ css`
|
|
|
42044
41999
|
|
|
42045
42000
|
div.o-cell-reference {
|
|
42046
42001
|
position: absolute;
|
|
42047
|
-
z-index: ${
|
|
42002
|
+
z-index: ${20};
|
|
42048
42003
|
background: ${SELECTION_BORDER_COLOR};
|
|
42049
42004
|
color: white;
|
|
42050
42005
|
font-size: 12px;
|
|
@@ -42659,7 +42614,7 @@ function getAxis(fig, axisType) {
|
|
|
42659
42614
|
css`
|
|
42660
42615
|
.o-figure-snap-line {
|
|
42661
42616
|
position: relative;
|
|
42662
|
-
z-index: ${
|
|
42617
|
+
z-index: ${1001};
|
|
42663
42618
|
&.vertical {
|
|
42664
42619
|
width: 0px;
|
|
42665
42620
|
border-left: 1px dashed black;
|
|
@@ -43420,7 +43375,7 @@ var GridPopover = class extends Component {
|
|
|
43420
43375
|
};
|
|
43421
43376
|
static components = { Popover };
|
|
43422
43377
|
cellPopovers;
|
|
43423
|
-
zIndex =
|
|
43378
|
+
zIndex = 19;
|
|
43424
43379
|
setup() {
|
|
43425
43380
|
this.cellPopovers = useStore(CellPopoverStore);
|
|
43426
43381
|
}
|
|
@@ -43665,7 +43620,7 @@ css`
|
|
|
43665
43620
|
color: ${ICONS_COLOR};
|
|
43666
43621
|
}
|
|
43667
43622
|
.o-unhide:hover {
|
|
43668
|
-
z-index: ${
|
|
43623
|
+
z-index: ${0 + 1};
|
|
43669
43624
|
background-color: lightgrey;
|
|
43670
43625
|
}
|
|
43671
43626
|
}
|
|
@@ -43737,7 +43692,7 @@ var ColResizer = class extends AbstractResizer {
|
|
|
43737
43692
|
elements,
|
|
43738
43693
|
position: this.state.position
|
|
43739
43694
|
});
|
|
43740
|
-
if (!result.isSuccessful && result.reasons.includes(
|
|
43695
|
+
if (!result.isSuccessful && result.reasons.includes("WillRemoveExistingMerge")) this.env.raiseError(MergeErrorMessage);
|
|
43741
43696
|
}
|
|
43742
43697
|
_selectElement(index, addDistinctHeader) {
|
|
43743
43698
|
this.env.model.selection.selectColumn(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
|
|
@@ -43821,7 +43776,7 @@ css`
|
|
|
43821
43776
|
color: ${ICONS_COLOR};
|
|
43822
43777
|
}
|
|
43823
43778
|
.o-unhide:hover {
|
|
43824
|
-
z-index: ${
|
|
43779
|
+
z-index: ${0 + 1};
|
|
43825
43780
|
background-color: lightgrey;
|
|
43826
43781
|
}
|
|
43827
43782
|
}
|
|
@@ -43894,8 +43849,8 @@ var RowResizer = class extends AbstractResizer {
|
|
|
43894
43849
|
position: this.state.position
|
|
43895
43850
|
});
|
|
43896
43851
|
if (!result.isSuccessful) {
|
|
43897
|
-
if (result.reasons.includes(
|
|
43898
|
-
else if (result.reasons.includes(
|
|
43852
|
+
if (result.reasons.includes("WillRemoveExistingMerge")) this.env.raiseError(MergeErrorMessage);
|
|
43853
|
+
else if (result.reasons.includes("CannotMoveTableHeader")) this.env.raiseError(TableHeaderMoveErrorMessage);
|
|
43899
43854
|
}
|
|
43900
43855
|
}
|
|
43901
43856
|
_selectElement(index, addDistinctHeader) {
|
|
@@ -44353,7 +44308,7 @@ var GridRenderer = class {
|
|
|
44353
44308
|
const nextCellBorder = this.getters.getCellComputedBorder(position);
|
|
44354
44309
|
const cellHasIcon = this.getters.doesCellHaveGridIcon(position);
|
|
44355
44310
|
const cellHasCheckbox = this.getters.isCellValidCheckbox(position);
|
|
44356
|
-
if (nextCell.type !==
|
|
44311
|
+
if (nextCell.type !== "empty" || this.getters.isInMerge(position) || nextCellBorder?.left || cellHasIcon || cellHasCheckbox) return col;
|
|
44357
44312
|
col++;
|
|
44358
44313
|
}
|
|
44359
44314
|
return col;
|
|
@@ -44371,7 +44326,7 @@ var GridRenderer = class {
|
|
|
44371
44326
|
const previousCellBorder = this.getters.getCellComputedBorder(position);
|
|
44372
44327
|
const cellHasIcon = this.getters.doesCellHaveGridIcon(position);
|
|
44373
44328
|
const cellHasCheckbox = this.getters.isCellValidCheckbox(position);
|
|
44374
|
-
if (previousCell.type !==
|
|
44329
|
+
if (previousCell.type !== "empty" || this.getters.isInMerge(position) || previousCellBorder?.right || cellHasIcon || cellHasCheckbox) return col;
|
|
44375
44330
|
col--;
|
|
44376
44331
|
}
|
|
44377
44332
|
return col;
|
|
@@ -44380,7 +44335,7 @@ var GridRenderer = class {
|
|
|
44380
44335
|
if (this.getters.getCell(position)?.isFormula && this.getters.shouldShowFormulas()) return "left";
|
|
44381
44336
|
const { align } = this.getters.getCellStyle(position);
|
|
44382
44337
|
const evaluatedCell = this.getters.getEvaluatedCell(position);
|
|
44383
|
-
if (isOverflowing && evaluatedCell.type ===
|
|
44338
|
+
if (isOverflowing && evaluatedCell.type === "number") return align !== "center" ? "left" : align;
|
|
44384
44339
|
return align || evaluatedCell.defaultAlign;
|
|
44385
44340
|
}
|
|
44386
44341
|
createZoneBox(sheetId, zone, viewport) {
|
|
@@ -44405,7 +44360,7 @@ var GridRenderer = class {
|
|
|
44405
44360
|
style: this.getters.getCellComputedStyle(position),
|
|
44406
44361
|
dataBarFill: this.getters.getConditionalDataBar(position),
|
|
44407
44362
|
verticalAlign,
|
|
44408
|
-
isError: cell.type ===
|
|
44363
|
+
isError: cell.type === "error" && !!cell.message || this.getters.isDataValidationInvalid(position)
|
|
44409
44364
|
};
|
|
44410
44365
|
/** Icon */
|
|
44411
44366
|
const iconSrc = this.getters.getCellIconSrc(position);
|
|
@@ -44425,7 +44380,7 @@ var GridRenderer = class {
|
|
|
44425
44380
|
image: imageHtmlElement
|
|
44426
44381
|
};
|
|
44427
44382
|
}
|
|
44428
|
-
if (cell.type ===
|
|
44383
|
+
if (cell.type === "empty" || this.getters.isCellValidCheckbox(position)) return box;
|
|
44429
44384
|
/** Filter Header or data validation icon */
|
|
44430
44385
|
box.hasIcon = this.getters.doesCellHaveGridIcon(position);
|
|
44431
44386
|
const headerIconWidth = box.hasIcon ? 17 + 2 : 0;
|
|
@@ -44813,7 +44768,7 @@ var Corner = class extends Component {
|
|
|
44813
44768
|
//#region src/components/highlight/highlight/highlight.ts
|
|
44814
44769
|
css`
|
|
44815
44770
|
.o-highlight {
|
|
44816
|
-
z-index: ${
|
|
44771
|
+
z-index: ${5};
|
|
44817
44772
|
}
|
|
44818
44773
|
`;
|
|
44819
44774
|
var Highlight = class extends Component {
|
|
@@ -44934,7 +44889,7 @@ css`
|
|
|
44934
44889
|
.o-scrollbar {
|
|
44935
44890
|
position: absolute;
|
|
44936
44891
|
overflow: auto;
|
|
44937
|
-
z-index: ${
|
|
44892
|
+
z-index: ${15};
|
|
44938
44893
|
background-color: ${BACKGROUND_GRAY_COLOR};
|
|
44939
44894
|
|
|
44940
44895
|
&.corner {
|
|
@@ -45330,12 +45285,12 @@ var Grid = class extends Component {
|
|
|
45330
45285
|
}
|
|
45331
45286
|
keyDownMapping = {
|
|
45332
45287
|
Enter: () => {
|
|
45333
|
-
this.env.model.getters.getActiveCell().type ===
|
|
45288
|
+
this.env.model.getters.getActiveCell().type === "empty" ? this.onComposerCellFocused() : this.onComposerContentFocused();
|
|
45334
45289
|
},
|
|
45335
45290
|
Tab: () => this.env.model.selection.moveAnchorCell("right", 1),
|
|
45336
45291
|
"Shift+Tab": () => this.env.model.selection.moveAnchorCell("left", 1),
|
|
45337
45292
|
F2: () => {
|
|
45338
|
-
this.env.model.getters.getActiveCell().type ===
|
|
45293
|
+
this.env.model.getters.getActiveCell().type === "empty" ? this.onComposerCellFocused() : this.onComposerContentFocused();
|
|
45339
45294
|
},
|
|
45340
45295
|
Delete: () => {
|
|
45341
45296
|
this.env.model.dispatch("DELETE_CONTENT", {
|
|
@@ -45566,7 +45521,7 @@ var Grid = class extends Component {
|
|
|
45566
45521
|
sheetId,
|
|
45567
45522
|
col,
|
|
45568
45523
|
row
|
|
45569
|
-
}).type ===
|
|
45524
|
+
}).type === "empty") this.onComposerCellFocused();
|
|
45570
45525
|
else this.onComposerContentFocused();
|
|
45571
45526
|
}
|
|
45572
45527
|
processArrows(ev) {
|
|
@@ -45638,8 +45593,8 @@ var Grid = class extends Component {
|
|
|
45638
45593
|
const clipboardData = ev.clipboardData;
|
|
45639
45594
|
if (!clipboardData) return;
|
|
45640
45595
|
const osClipboard = { content: {
|
|
45641
|
-
[
|
|
45642
|
-
[
|
|
45596
|
+
["text/plain"]: clipboardData?.getData("text/plain"),
|
|
45597
|
+
["text/html"]: clipboardData?.getData("text/html")
|
|
45643
45598
|
} };
|
|
45644
45599
|
const target = this.env.model.getters.getSelectedZones();
|
|
45645
45600
|
const isCutOperation = this.env.model.getters.isCutOperation();
|
|
@@ -45647,7 +45602,7 @@ var Grid = class extends Component {
|
|
|
45647
45602
|
const clipboardId = clipboardContent.data?.clipboardId;
|
|
45648
45603
|
if (this.env.model.getters.getClipboardId() === clipboardId) interactivePaste(this.env, target);
|
|
45649
45604
|
else interactivePasteFromOS(this.env, target, clipboardContent);
|
|
45650
|
-
if (isCutOperation) await this.env.clipboard.write({ [
|
|
45605
|
+
if (isCutOperation) await this.env.clipboard.write({ ["text/plain"]: "" });
|
|
45651
45606
|
}
|
|
45652
45607
|
clearFormatting() {
|
|
45653
45608
|
this.env.model.dispatch("CLEAR_FORMATTING", {
|
|
@@ -46114,7 +46069,7 @@ var BasePlugin = class {
|
|
|
46114
46069
|
* There should not be any side effects in this method.
|
|
46115
46070
|
*/
|
|
46116
46071
|
allowDispatch(command) {
|
|
46117
|
-
return
|
|
46072
|
+
return "Success";
|
|
46118
46073
|
}
|
|
46119
46074
|
/**
|
|
46120
46075
|
* This method is useful when a plugin need to perform some action before a
|
|
@@ -46150,10 +46105,10 @@ var BasePlugin = class {
|
|
|
46150
46105
|
for (const validation of validations) {
|
|
46151
46106
|
let results = validation.call(this, toValidate);
|
|
46152
46107
|
if (!Array.isArray(results)) results = [results];
|
|
46153
|
-
const cancelledReasons = results.filter((result) => result !==
|
|
46108
|
+
const cancelledReasons = results.filter((result) => result !== "Success");
|
|
46154
46109
|
if (cancelledReasons.length) return cancelledReasons;
|
|
46155
46110
|
}
|
|
46156
|
-
return
|
|
46111
|
+
return "Success";
|
|
46157
46112
|
};
|
|
46158
46113
|
}
|
|
46159
46114
|
checkValidations(command, ...validations) {
|
|
@@ -46212,7 +46167,7 @@ var BordersPlugin = class extends CorePlugin {
|
|
|
46212
46167
|
allowDispatch(cmd) {
|
|
46213
46168
|
switch (cmd.type) {
|
|
46214
46169
|
case "SET_BORDER": return this.checkBordersUnchanged(cmd);
|
|
46215
|
-
default: return
|
|
46170
|
+
default: return "Success";
|
|
46216
46171
|
}
|
|
46217
46172
|
}
|
|
46218
46173
|
handle(cmd) {
|
|
@@ -46584,8 +46539,8 @@ var BordersPlugin = class extends CorePlugin {
|
|
|
46584
46539
|
checkBordersUnchanged(cmd) {
|
|
46585
46540
|
const currentBorder = this.getCellBorder(cmd);
|
|
46586
46541
|
const areAllNewBordersUndefined = !cmd.border?.bottom && !cmd.border?.left && !cmd.border?.right && !cmd.border?.top;
|
|
46587
|
-
if (!currentBorder && areAllNewBordersUndefined || deepEquals(currentBorder, cmd.border)) return
|
|
46588
|
-
return
|
|
46542
|
+
if (!currentBorder && areAllNewBordersUndefined || deepEquals(currentBorder, cmd.border)) return "NoChanges";
|
|
46543
|
+
return "Success";
|
|
46589
46544
|
}
|
|
46590
46545
|
import(data) {
|
|
46591
46546
|
if (Object.keys(data.borders || {}).length) for (const sheet of data.sheets) for (const zoneXc in sheet.borders) {
|
|
@@ -46714,8 +46669,8 @@ var CellPlugin = class extends CorePlugin {
|
|
|
46714
46669
|
switch (cmd.type) {
|
|
46715
46670
|
case "UPDATE_CELL": return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
|
|
46716
46671
|
case "CLEAR_CELL": return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
|
|
46717
|
-
case "UPDATE_CELL_POSITION": return !cmd.cellId || this.cells[cmd.sheetId]?.[cmd.cellId] ?
|
|
46718
|
-
default: return
|
|
46672
|
+
case "UPDATE_CELL_POSITION": return !cmd.cellId || this.cells[cmd.sheetId]?.[cmd.cellId] ? "Success" : "InvalidCellId";
|
|
46673
|
+
default: return "Success";
|
|
46719
46674
|
}
|
|
46720
46675
|
}
|
|
46721
46676
|
handle(cmd) {
|
|
@@ -47138,25 +47093,30 @@ var CellPlugin = class extends CorePlugin {
|
|
|
47138
47093
|
}
|
|
47139
47094
|
checkCellOutOfSheet(cmd) {
|
|
47140
47095
|
const { sheetId, col, row } = cmd;
|
|
47141
|
-
if (!this.getters.tryGetSheet(sheetId)) return
|
|
47142
|
-
return isInside(col, row, this.getters.getSheetZone(sheetId)) ?
|
|
47096
|
+
if (!this.getters.tryGetSheet(sheetId)) return "InvalidSheetId";
|
|
47097
|
+
return isInside(col, row, this.getters.getSheetZone(sheetId)) ? "Success" : "TargetOutOfSheet";
|
|
47143
47098
|
}
|
|
47144
47099
|
checkUselessClearCell(cmd) {
|
|
47145
47100
|
const cell = this.getters.getCell(cmd);
|
|
47146
|
-
if (!cell) return
|
|
47147
|
-
if (!cell.content && !cell.style && !cell.format) return
|
|
47148
|
-
return
|
|
47101
|
+
if (!cell) return "NoChanges";
|
|
47102
|
+
if (!cell.content && !cell.style && !cell.format) return "NoChanges";
|
|
47103
|
+
return "Success";
|
|
47149
47104
|
}
|
|
47150
47105
|
checkUselessUpdateCell(cmd) {
|
|
47151
47106
|
const cell = this.getters.getCell(cmd);
|
|
47152
47107
|
const hasContent = "content" in cmd || "formula" in cmd;
|
|
47153
47108
|
const hasStyle = "style" in cmd;
|
|
47154
47109
|
const hasFormat = "format" in cmd;
|
|
47155
|
-
if ((!hasContent || cell?.content === cmd.content) && (!hasStyle || deepEquals(cell?.style, cmd.style)) && (!hasFormat || cell?.format === cmd.format)) return
|
|
47156
|
-
return
|
|
47110
|
+
if ((!hasContent || cell?.content === cmd.content) && (!hasStyle || deepEquals(cell?.style, cmd.style)) && (!hasFormat || cell?.format === cmd.format)) return "NoChanges";
|
|
47111
|
+
return "Success";
|
|
47157
47112
|
}
|
|
47158
47113
|
};
|
|
47159
47114
|
var FormulaCellWithDependencies = class {
|
|
47115
|
+
id;
|
|
47116
|
+
format;
|
|
47117
|
+
style;
|
|
47118
|
+
sheetId;
|
|
47119
|
+
getRangeString;
|
|
47160
47120
|
isFormula = true;
|
|
47161
47121
|
compiledFormula;
|
|
47162
47122
|
constructor(id, compiledFormula, format, style, dependencies, sheetId, getRangeString) {
|
|
@@ -47191,6 +47151,10 @@ var FormulaCellWithDependencies = class {
|
|
|
47191
47151
|
}
|
|
47192
47152
|
};
|
|
47193
47153
|
var RangeReferenceToken = class {
|
|
47154
|
+
ranges;
|
|
47155
|
+
rangeIndex;
|
|
47156
|
+
sheetId;
|
|
47157
|
+
getRangeString;
|
|
47194
47158
|
type = "REFERENCE";
|
|
47195
47159
|
constructor(ranges, rangeIndex, sheetId, getRangeString) {
|
|
47196
47160
|
this.ranges = ranges;
|
|
@@ -47225,7 +47189,7 @@ var ChartPlugin = class extends CorePlugin {
|
|
|
47225
47189
|
switch (cmd.type) {
|
|
47226
47190
|
case "CREATE_CHART": return this.checkValidations(cmd, this.chainValidations(this.validateChartDefinition, this.checkChartDuplicate));
|
|
47227
47191
|
case "UPDATE_CHART": return this.checkValidations(cmd, this.chainValidations(this.validateChartDefinition, this.checkChartExists));
|
|
47228
|
-
default: return
|
|
47192
|
+
default: return "Success";
|
|
47229
47193
|
}
|
|
47230
47194
|
}
|
|
47231
47195
|
handle(cmd) {
|
|
@@ -47344,10 +47308,10 @@ var ChartPlugin = class extends CorePlugin {
|
|
|
47344
47308
|
if (sheetId) this.history.update("charts", id, this.createChart(id, definition, sheetId));
|
|
47345
47309
|
}
|
|
47346
47310
|
checkChartDuplicate(cmd) {
|
|
47347
|
-
return this.getters.getFigureSheetId(cmd.id) ?
|
|
47311
|
+
return this.getters.getFigureSheetId(cmd.id) ? "DuplicatedChartId" : "Success";
|
|
47348
47312
|
}
|
|
47349
47313
|
checkChartExists(cmd) {
|
|
47350
|
-
return this.isChartDefined(cmd.id) ?
|
|
47314
|
+
return this.isChartDefined(cmd.id) ? "Success" : "ChartDoesNotExist";
|
|
47351
47315
|
}
|
|
47352
47316
|
};
|
|
47353
47317
|
|
|
@@ -47406,7 +47370,7 @@ var ConditionalFormatPlugin = class extends CorePlugin {
|
|
|
47406
47370
|
case "ADD_CONDITIONAL_FORMAT": return this.checkValidations(cmd, this.checkCFRule, this.checkEmptyRange);
|
|
47407
47371
|
case "CHANGE_CONDITIONAL_FORMAT_PRIORITY": return this.checkValidPriorityChange(cmd.cfId, cmd.delta, cmd.sheetId);
|
|
47408
47372
|
}
|
|
47409
|
-
return
|
|
47373
|
+
return "Success";
|
|
47410
47374
|
}
|
|
47411
47375
|
handle(cmd) {
|
|
47412
47376
|
switch (cmd.type) {
|
|
@@ -47539,21 +47503,21 @@ var ConditionalFormatPlugin = class extends CorePlugin {
|
|
|
47539
47503
|
this.history.update("cfRules", sheet, currentCF);
|
|
47540
47504
|
}
|
|
47541
47505
|
checkValidPriorityChange(cfId, delta, sheetId) {
|
|
47542
|
-
if (!this.cfRules[sheetId]) return
|
|
47506
|
+
if (!this.cfRules[sheetId]) return "InvalidSheetId";
|
|
47543
47507
|
const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
|
|
47544
|
-
if (ruleIndex === -1) return
|
|
47508
|
+
if (ruleIndex === -1) return "InvalidConditionalFormatId";
|
|
47545
47509
|
const cfIndex2 = ruleIndex - delta;
|
|
47546
|
-
if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) return
|
|
47547
|
-
return
|
|
47510
|
+
if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) return "InvalidConditionalFormatId";
|
|
47511
|
+
return "Success";
|
|
47548
47512
|
}
|
|
47549
47513
|
checkEmptyRange(cmd) {
|
|
47550
|
-
return cmd.ranges.length ?
|
|
47514
|
+
return cmd.ranges.length ? "Success" : "EmptyRange";
|
|
47551
47515
|
}
|
|
47552
47516
|
checkCFRule(cmd) {
|
|
47553
47517
|
const rule = cmd.cf.rule;
|
|
47554
47518
|
switch (rule.type) {
|
|
47555
47519
|
case "CellIsRule":
|
|
47556
|
-
if (!CellIsOperators[rule.operator]) return
|
|
47520
|
+
if (!CellIsOperators[rule.operator]) return "InvalidConditionalFormatType";
|
|
47557
47521
|
return this.checkValidations(rule, this.checkOperatorArgsNumber(2, ["Between", "NotBetween"]), this.checkOperatorArgsNumber(1, [
|
|
47558
47522
|
"BeginsWith",
|
|
47559
47523
|
"ContainsText",
|
|
@@ -47568,9 +47532,9 @@ var ConditionalFormatPlugin = class extends CorePlugin {
|
|
|
47568
47532
|
]), this.checkOperatorArgsNumber(0, ["IsEmpty", "IsNotEmpty"]), this.checkCFValues);
|
|
47569
47533
|
case "ColorScaleRule": return this.checkValidations(rule, this.chainValidations(this.checkThresholds(this.checkFormulaCompilation)), this.chainValidations(this.checkThresholds(this.checkNaN), this.batchValidations(this.checkMinBiggerThanMax, this.checkMinBiggerThanMid, this.checkMidBiggerThanMax)));
|
|
47570
47534
|
case "IconSetRule": return this.checkValidations(rule, this.chainValidations(this.checkInflectionPoints(this.checkNaN), this.checkLowerBiggerThanUpper), this.chainValidations(this.checkInflectionPoints(this.checkFormulaCompilation)));
|
|
47571
|
-
case "DataBarRule": return
|
|
47535
|
+
case "DataBarRule": return "Success";
|
|
47572
47536
|
}
|
|
47573
|
-
return
|
|
47537
|
+
return "InvalidConditionalFormatType";
|
|
47574
47538
|
}
|
|
47575
47539
|
checkOperatorArgsNumber(expectedNumber, operators) {
|
|
47576
47540
|
if (expectedNumber > 2) throw new Error("Checking more than 2 arguments is currently not supported. Add the appropriate CommandResult if you want to.");
|
|
@@ -47578,11 +47542,11 @@ var ConditionalFormatPlugin = class extends CorePlugin {
|
|
|
47578
47542
|
if (operators.includes(rule.operator)) {
|
|
47579
47543
|
const errors = [];
|
|
47580
47544
|
const isEmpty = (value) => value === void 0 || value === "";
|
|
47581
|
-
if (expectedNumber >= 1 && isEmpty(rule.values[0])) errors.push(
|
|
47582
|
-
if (expectedNumber >= 2 && isEmpty(rule.values[1])) errors.push(
|
|
47583
|
-
return errors.length ? errors :
|
|
47545
|
+
if (expectedNumber >= 1 && isEmpty(rule.values[0])) errors.push("FirstArgMissing");
|
|
47546
|
+
if (expectedNumber >= 2 && isEmpty(rule.values[1])) errors.push("SecondArgMissing");
|
|
47547
|
+
return errors.length ? errors : "Success";
|
|
47584
47548
|
}
|
|
47585
|
-
return
|
|
47549
|
+
return "Success";
|
|
47586
47550
|
};
|
|
47587
47551
|
}
|
|
47588
47552
|
checkNaN(threshold, thresholdName) {
|
|
@@ -47591,27 +47555,27 @@ var ConditionalFormatPlugin = class extends CorePlugin {
|
|
|
47591
47555
|
"percentage",
|
|
47592
47556
|
"percentile"
|
|
47593
47557
|
].includes(threshold.type) && (threshold.value === "" || isNaN(threshold.value))) switch (thresholdName) {
|
|
47594
|
-
case "min": return
|
|
47595
|
-
case "max": return
|
|
47596
|
-
case "mid": return
|
|
47597
|
-
case "upperInflectionPoint": return
|
|
47598
|
-
case "lowerInflectionPoint": return
|
|
47558
|
+
case "min": return "MinNaN";
|
|
47559
|
+
case "max": return "MaxNaN";
|
|
47560
|
+
case "mid": return "MidNaN";
|
|
47561
|
+
case "upperInflectionPoint": return "ValueUpperInflectionNaN";
|
|
47562
|
+
case "lowerInflectionPoint": return "ValueLowerInflectionNaN";
|
|
47599
47563
|
}
|
|
47600
|
-
return
|
|
47564
|
+
return "Success";
|
|
47601
47565
|
}
|
|
47602
47566
|
checkFormulaCompilation(threshold, thresholdName) {
|
|
47603
|
-
if (threshold.type !== "formula") return
|
|
47567
|
+
if (threshold.type !== "formula") return "Success";
|
|
47604
47568
|
if (compile(threshold.value || "").isBadExpression) switch (thresholdName) {
|
|
47605
|
-
case "min": return
|
|
47606
|
-
case "max": return
|
|
47607
|
-
case "mid": return
|
|
47608
|
-
case "upperInflectionPoint": return
|
|
47609
|
-
case "lowerInflectionPoint": return
|
|
47569
|
+
case "min": return "MinInvalidFormula";
|
|
47570
|
+
case "max": return "MaxInvalidFormula";
|
|
47571
|
+
case "mid": return "MidInvalidFormula";
|
|
47572
|
+
case "upperInflectionPoint": return "ValueUpperInvalidFormula";
|
|
47573
|
+
case "lowerInflectionPoint": return "ValueLowerInvalidFormula";
|
|
47610
47574
|
}
|
|
47611
|
-
return
|
|
47575
|
+
return "Success";
|
|
47612
47576
|
}
|
|
47613
47577
|
checkThresholds(check) {
|
|
47614
|
-
return this.batchValidations((rule) => check(rule.minimum, "min"), (rule) => check(rule.maximum, "max"), (rule) => rule.midpoint ? check(rule.midpoint, "mid") :
|
|
47578
|
+
return this.batchValidations((rule) => check(rule.minimum, "min"), (rule) => check(rule.maximum, "max"), (rule) => rule.midpoint ? check(rule.midpoint, "mid") : "Success");
|
|
47615
47579
|
}
|
|
47616
47580
|
checkInflectionPoints(check) {
|
|
47617
47581
|
return this.batchValidations((rule) => check(rule.lowerInflectionPoint, "lowerInflectionPoint"), (rule) => check(rule.upperInflectionPoint, "upperInflectionPoint"));
|
|
@@ -47623,8 +47587,8 @@ var ConditionalFormatPlugin = class extends CorePlugin {
|
|
|
47623
47587
|
"number",
|
|
47624
47588
|
"percentage",
|
|
47625
47589
|
"percentile"
|
|
47626
|
-
].includes(rule.lowerInflectionPoint.type) && rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type && Number(minValue) > Number(maxValue)) return
|
|
47627
|
-
return
|
|
47590
|
+
].includes(rule.lowerInflectionPoint.type) && rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type && Number(minValue) > Number(maxValue)) return "LowerBiggerThanUpper";
|
|
47591
|
+
return "Success";
|
|
47628
47592
|
}
|
|
47629
47593
|
checkMinBiggerThanMax(rule) {
|
|
47630
47594
|
const minValue = rule.minimum.value;
|
|
@@ -47633,8 +47597,8 @@ var ConditionalFormatPlugin = class extends CorePlugin {
|
|
|
47633
47597
|
"number",
|
|
47634
47598
|
"percentage",
|
|
47635
47599
|
"percentile"
|
|
47636
|
-
].includes(rule.minimum.type) && rule.minimum.type === rule.maximum.type && stringToNumber(minValue) >= stringToNumber(maxValue)) return
|
|
47637
|
-
return
|
|
47600
|
+
].includes(rule.minimum.type) && rule.minimum.type === rule.maximum.type && stringToNumber(minValue) >= stringToNumber(maxValue)) return "MinBiggerThanMax";
|
|
47601
|
+
return "Success";
|
|
47638
47602
|
}
|
|
47639
47603
|
checkMidBiggerThanMax(rule) {
|
|
47640
47604
|
const midValue = rule.midpoint?.value;
|
|
@@ -47643,8 +47607,8 @@ var ConditionalFormatPlugin = class extends CorePlugin {
|
|
|
47643
47607
|
"number",
|
|
47644
47608
|
"percentage",
|
|
47645
47609
|
"percentile"
|
|
47646
|
-
].includes(rule.midpoint.type) && rule.midpoint.type === rule.maximum.type && stringToNumber(midValue) >= stringToNumber(maxValue)) return
|
|
47647
|
-
return
|
|
47610
|
+
].includes(rule.midpoint.type) && rule.midpoint.type === rule.maximum.type && stringToNumber(midValue) >= stringToNumber(maxValue)) return "MidBiggerThanMax";
|
|
47611
|
+
return "Success";
|
|
47648
47612
|
}
|
|
47649
47613
|
checkMinBiggerThanMid(rule) {
|
|
47650
47614
|
const minValue = rule.minimum.value;
|
|
@@ -47653,15 +47617,15 @@ var ConditionalFormatPlugin = class extends CorePlugin {
|
|
|
47653
47617
|
"number",
|
|
47654
47618
|
"percentage",
|
|
47655
47619
|
"percentile"
|
|
47656
|
-
].includes(rule.midpoint.type) && rule.minimum.type === rule.midpoint.type && stringToNumber(minValue) >= stringToNumber(midValue)) return
|
|
47657
|
-
return
|
|
47620
|
+
].includes(rule.midpoint.type) && rule.minimum.type === rule.midpoint.type && stringToNumber(minValue) >= stringToNumber(midValue)) return "MinBiggerThanMid";
|
|
47621
|
+
return "Success";
|
|
47658
47622
|
}
|
|
47659
47623
|
checkCFValues(rule) {
|
|
47660
47624
|
for (const value of rule.values) {
|
|
47661
47625
|
if (!value.startsWith("=")) continue;
|
|
47662
|
-
if (compile(value || "").isBadExpression) return
|
|
47626
|
+
if (compile(value || "").isBadExpression) return "ValueCellIsInvalidFormula";
|
|
47663
47627
|
}
|
|
47664
|
-
return
|
|
47628
|
+
return "Success";
|
|
47665
47629
|
}
|
|
47666
47630
|
removeConditionalFormatting(id, sheet) {
|
|
47667
47631
|
const cfIndex = this.cfRules[sheet].findIndex((s) => s.id === id);
|
|
@@ -47724,14 +47688,14 @@ var DataValidationPlugin = class extends CorePlugin {
|
|
|
47724
47688
|
allowDispatch(cmd) {
|
|
47725
47689
|
switch (cmd.type) {
|
|
47726
47690
|
case "ADD_DATA_VALIDATION_RULE":
|
|
47727
|
-
if (!this.getters.tryGetSheet(cmd.sheetId)) return
|
|
47691
|
+
if (!this.getters.tryGetSheet(cmd.sheetId)) return "InvalidSheetId";
|
|
47728
47692
|
return this.checkValidations(cmd, this.chainValidations(this.checkEmptyRange, this.checkCriterionTypeIsValid, this.checkCriterionHasValidNumberOfValues, this.checkCriterionValuesAreValid));
|
|
47729
47693
|
case "REMOVE_DATA_VALIDATION_RULE":
|
|
47730
|
-
if (!this.getters.tryGetSheet(cmd.sheetId)) return
|
|
47731
|
-
if (!this.rules[cmd.sheetId].find((rule) => rule.id === cmd.id)) return
|
|
47694
|
+
if (!this.getters.tryGetSheet(cmd.sheetId)) return "InvalidSheetId";
|
|
47695
|
+
if (!this.rules[cmd.sheetId].find((rule) => rule.id === cmd.id)) return "UnknownDataValidationRule";
|
|
47732
47696
|
break;
|
|
47733
47697
|
}
|
|
47734
|
-
return
|
|
47698
|
+
return "Success";
|
|
47735
47699
|
}
|
|
47736
47700
|
handle(cmd) {
|
|
47737
47701
|
switch (cmd.type) {
|
|
@@ -47840,7 +47804,7 @@ var DataValidationPlugin = class extends CorePlugin {
|
|
|
47840
47804
|
}
|
|
47841
47805
|
}
|
|
47842
47806
|
checkEmptyRange(cmd) {
|
|
47843
|
-
return cmd.ranges.length ?
|
|
47807
|
+
return cmd.ranges.length ? "Success" : "EmptyRange";
|
|
47844
47808
|
}
|
|
47845
47809
|
import(data) {
|
|
47846
47810
|
for (const sheet of data.sheets) {
|
|
@@ -47883,13 +47847,13 @@ var DataValidationPlugin = class extends CorePlugin {
|
|
|
47883
47847
|
}
|
|
47884
47848
|
}
|
|
47885
47849
|
checkCriterionTypeIsValid(cmd) {
|
|
47886
|
-
return dataValidationEvaluatorRegistry.contains(cmd.rule.criterion.type) ?
|
|
47850
|
+
return dataValidationEvaluatorRegistry.contains(cmd.rule.criterion.type) ? "Success" : "UnknownDataValidationCriterionType";
|
|
47887
47851
|
}
|
|
47888
47852
|
checkCriterionHasValidNumberOfValues(cmd) {
|
|
47889
47853
|
const criterion = cmd.rule.criterion;
|
|
47890
47854
|
const expectedNumberOfValues = dataValidationEvaluatorRegistry.get(criterion.type).numberOfValues(criterion);
|
|
47891
|
-
if (expectedNumberOfValues !== void 0 && criterion.values.length !== expectedNumberOfValues) return
|
|
47892
|
-
return
|
|
47855
|
+
if (expectedNumberOfValues !== void 0 && criterion.values.length !== expectedNumberOfValues) return "InvalidNumberOfCriterionValues";
|
|
47856
|
+
return "Success";
|
|
47893
47857
|
}
|
|
47894
47858
|
checkCriterionValuesAreValid(cmd) {
|
|
47895
47859
|
const criterion = cmd.rule.criterion;
|
|
@@ -47898,8 +47862,8 @@ var DataValidationPlugin = class extends CorePlugin {
|
|
|
47898
47862
|
if (value.startsWith("=")) return evaluator.allowedValues === "onlyLiterals";
|
|
47899
47863
|
else if (evaluator.allowedValues === "onlyFormulas") return true;
|
|
47900
47864
|
else return !evaluator.isCriterionValueValid(value);
|
|
47901
|
-
})) return
|
|
47902
|
-
return
|
|
47865
|
+
})) return "InvalidDataValidationCriterionValue";
|
|
47866
|
+
return "Success";
|
|
47903
47867
|
}
|
|
47904
47868
|
};
|
|
47905
47869
|
|
|
@@ -47918,7 +47882,7 @@ var FigurePlugin = class extends CorePlugin {
|
|
|
47918
47882
|
case "CREATE_FIGURE": return this.checkFigureDuplicate(cmd.figure.id);
|
|
47919
47883
|
case "UPDATE_FIGURE":
|
|
47920
47884
|
case "DELETE_FIGURE": return this.checkFigureExists(cmd.sheetId, cmd.id);
|
|
47921
|
-
default: return
|
|
47885
|
+
default: return "Success";
|
|
47922
47886
|
}
|
|
47923
47887
|
}
|
|
47924
47888
|
beforeHandle(cmd) {
|
|
@@ -48012,12 +47976,12 @@ var FigurePlugin = class extends CorePlugin {
|
|
|
48012
47976
|
this.history.update("figures", sheetId, id, void 0);
|
|
48013
47977
|
}
|
|
48014
47978
|
checkFigureExists(sheetId, figureId) {
|
|
48015
|
-
if (this.figures[sheetId]?.[figureId] === void 0) return
|
|
48016
|
-
return
|
|
47979
|
+
if (this.figures[sheetId]?.[figureId] === void 0) return "FigureDoesNotExist";
|
|
47980
|
+
return "Success";
|
|
48017
47981
|
}
|
|
48018
47982
|
checkFigureDuplicate(figureId) {
|
|
48019
|
-
if (Object.values(this.figures).find((sheet) => sheet?.[figureId])) return
|
|
48020
|
-
return
|
|
47983
|
+
if (Object.values(this.figures).find((sheet) => sheet?.[figureId])) return "DuplicatedFigureId";
|
|
47984
|
+
return "Success";
|
|
48021
47985
|
}
|
|
48022
47986
|
getFigures(sheetId) {
|
|
48023
47987
|
const figures = [];
|
|
@@ -48151,19 +48115,19 @@ var HeaderVisibilityPlugin = class extends CorePlugin {
|
|
|
48151
48115
|
allowDispatch(cmd) {
|
|
48152
48116
|
switch (cmd.type) {
|
|
48153
48117
|
case "HIDE_COLUMNS_ROWS": {
|
|
48154
|
-
if (!this.getters.tryGetSheet(cmd.sheetId)) return
|
|
48118
|
+
if (!this.getters.tryGetSheet(cmd.sheetId)) return "InvalidSheetId";
|
|
48155
48119
|
const hiddenGroup = cmd.dimension === "COL" ? this.getHiddenColsGroups(cmd.sheetId) : this.getHiddenRowsGroups(cmd.sheetId);
|
|
48156
48120
|
const elements = cmd.dimension === "COL" ? this.getters.getNumberCols(cmd.sheetId) : this.getters.getNumberRows(cmd.sheetId);
|
|
48157
|
-
if (new Set((hiddenGroup || []).flat().concat(cmd.elements)).size >= elements) return
|
|
48158
|
-
else if (largeMin(cmd.elements) < 0 || largeMax(cmd.elements) > elements) return
|
|
48159
|
-
else return
|
|
48121
|
+
if (new Set((hiddenGroup || []).flat().concat(cmd.elements)).size >= elements) return "TooManyHiddenElements";
|
|
48122
|
+
else if (largeMin(cmd.elements) < 0 || largeMax(cmd.elements) > elements) return "InvalidHeaderIndex";
|
|
48123
|
+
else return "Success";
|
|
48160
48124
|
}
|
|
48161
48125
|
case "REMOVE_COLUMNS_ROWS":
|
|
48162
|
-
if (!this.getters.tryGetSheet(cmd.sheetId)) return
|
|
48163
|
-
if (this.checkElementsIncludeAllVisibleHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) return
|
|
48164
|
-
return
|
|
48126
|
+
if (!this.getters.tryGetSheet(cmd.sheetId)) return "InvalidSheetId";
|
|
48127
|
+
if (this.checkElementsIncludeAllVisibleHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) return "NotEnoughElements";
|
|
48128
|
+
return "Success";
|
|
48165
48129
|
}
|
|
48166
|
-
return
|
|
48130
|
+
return "Success";
|
|
48167
48131
|
}
|
|
48168
48132
|
handle(cmd) {
|
|
48169
48133
|
switch (cmd.type) {
|
|
@@ -48291,9 +48255,9 @@ var ImagePlugin = class extends CorePlugin {
|
|
|
48291
48255
|
allowDispatch(cmd) {
|
|
48292
48256
|
switch (cmd.type) {
|
|
48293
48257
|
case "CREATE_IMAGE":
|
|
48294
|
-
if (this.getters.getFigure(cmd.sheetId, cmd.figureId)) return
|
|
48295
|
-
return
|
|
48296
|
-
default: return
|
|
48258
|
+
if (this.getters.getFigure(cmd.sheetId, cmd.figureId)) return "InvalidFigureId";
|
|
48259
|
+
return "Success";
|
|
48260
|
+
default: return "Success";
|
|
48297
48261
|
}
|
|
48298
48262
|
}
|
|
48299
48263
|
handle(cmd) {
|
|
@@ -48434,7 +48398,7 @@ var MergePlugin = class extends CorePlugin {
|
|
|
48434
48398
|
return this.checkValidations(cmd, this.checkDestructiveMerge, this.checkOverlap, this.checkFrozenPanes);
|
|
48435
48399
|
case "UPDATE_CELL": return this.checkMergedContentUpdate(cmd);
|
|
48436
48400
|
case "REMOVE_MERGE": return this.checkMergeExists(cmd);
|
|
48437
|
-
default: return
|
|
48401
|
+
default: return "Success";
|
|
48438
48402
|
}
|
|
48439
48403
|
}
|
|
48440
48404
|
handle(cmd) {
|
|
@@ -48614,18 +48578,18 @@ var MergePlugin = class extends CorePlugin {
|
|
|
48614
48578
|
return range !== void 0 ? rangeToMerge(mergeId, range) : void 0;
|
|
48615
48579
|
}
|
|
48616
48580
|
checkDestructiveMerge({ sheetId, target }) {
|
|
48617
|
-
if (!this.getters.tryGetSheet(sheetId)) return
|
|
48618
|
-
return target.some((zone) => this.isMergeDestructive(sheetId, zone)) ?
|
|
48581
|
+
if (!this.getters.tryGetSheet(sheetId)) return "Success";
|
|
48582
|
+
return target.some((zone) => this.isMergeDestructive(sheetId, zone)) ? "MergeIsDestructive" : "Success";
|
|
48619
48583
|
}
|
|
48620
48584
|
checkOverlap({ target }) {
|
|
48621
|
-
for (const zone of target) for (const zone2 of target) if (zone !== zone2 && overlap(zone, zone2)) return
|
|
48622
|
-
return
|
|
48585
|
+
for (const zone of target) for (const zone2 of target) if (zone !== zone2 && overlap(zone, zone2)) return "MergeOverlap";
|
|
48586
|
+
return "Success";
|
|
48623
48587
|
}
|
|
48624
48588
|
checkFrozenPanes({ sheetId, target }) {
|
|
48625
|
-
if (!this.getters.tryGetSheet(sheetId)) return
|
|
48589
|
+
if (!this.getters.tryGetSheet(sheetId)) return "Success";
|
|
48626
48590
|
const { xSplit, ySplit } = this.getters.getPaneDivisions(sheetId);
|
|
48627
|
-
for (const zone of target) if (zone.left < xSplit && zone.right >= xSplit || zone.top < ySplit && zone.bottom >= ySplit) return
|
|
48628
|
-
return
|
|
48591
|
+
for (const zone of target) if (zone.left < xSplit && zone.right >= xSplit || zone.top < ySplit && zone.bottom >= ySplit) return "FrozenPaneOverlap";
|
|
48592
|
+
return "Success";
|
|
48629
48593
|
}
|
|
48630
48594
|
/**
|
|
48631
48595
|
* The content of a merged cell should always be empty.
|
|
@@ -48633,10 +48597,10 @@ var MergePlugin = class extends CorePlugin {
|
|
|
48633
48597
|
*/
|
|
48634
48598
|
checkMergedContentUpdate(cmd) {
|
|
48635
48599
|
const { col, row, content } = cmd;
|
|
48636
|
-
if (content === void 0) return
|
|
48600
|
+
if (content === void 0) return "Success";
|
|
48637
48601
|
const { col: mainCol, row: mainRow } = this.getMainCellPosition(cmd);
|
|
48638
|
-
if (mainCol === col && mainRow === row) return
|
|
48639
|
-
return
|
|
48602
|
+
if (mainCol === col && mainRow === row) return "Success";
|
|
48603
|
+
return "CellIsMerged";
|
|
48640
48604
|
}
|
|
48641
48605
|
checkMergeExists(cmd) {
|
|
48642
48606
|
const { sheetId, target } = cmd;
|
|
@@ -48647,9 +48611,9 @@ var MergePlugin = class extends CorePlugin {
|
|
|
48647
48611
|
col: left,
|
|
48648
48612
|
row: top
|
|
48649
48613
|
});
|
|
48650
|
-
if (merge === void 0 || !isEqual(zone, merge)) return
|
|
48614
|
+
if (merge === void 0 || !isEqual(zone, merge)) return "InvalidTarget";
|
|
48651
48615
|
}
|
|
48652
|
-
return
|
|
48616
|
+
return "Success";
|
|
48653
48617
|
}
|
|
48654
48618
|
/**
|
|
48655
48619
|
* Merge the current selection. Note that:
|
|
@@ -48797,8 +48761,8 @@ var RangeAdapter = class {
|
|
|
48797
48761
|
"removeRangesSheetPrefix"
|
|
48798
48762
|
];
|
|
48799
48763
|
allowDispatch(cmd) {
|
|
48800
|
-
if (cmd.type === "MOVE_RANGES") return cmd.target.length === 1 ?
|
|
48801
|
-
return
|
|
48764
|
+
if (cmd.type === "MOVE_RANGES") return cmd.target.length === 1 ? "Success" : "InvalidZones";
|
|
48765
|
+
return "Success";
|
|
48802
48766
|
}
|
|
48803
48767
|
beforeHandle(command) {}
|
|
48804
48768
|
handle(cmd) {
|
|
@@ -49207,40 +49171,40 @@ var SheetPlugin = class extends CorePlugin {
|
|
|
49207
49171
|
cellPosition = {};
|
|
49208
49172
|
allowDispatch(cmd) {
|
|
49209
49173
|
const genericChecks = this.chainValidations(this.checkSheetExists, this.checkZonesAreInSheet)(cmd);
|
|
49210
|
-
if (genericChecks !==
|
|
49174
|
+
if (genericChecks !== "Success") return genericChecks;
|
|
49211
49175
|
switch (cmd.type) {
|
|
49212
49176
|
case "HIDE_SHEET":
|
|
49213
|
-
if (this.getVisibleSheetIds().length === 1) return
|
|
49214
|
-
return
|
|
49177
|
+
if (this.getVisibleSheetIds().length === 1) return "NotEnoughSheets";
|
|
49178
|
+
return "Success";
|
|
49215
49179
|
case "CREATE_SHEET": return this.checkValidations(cmd, this.checkSheetName, this.checkSheetPosition);
|
|
49216
49180
|
case "DUPLICATE_SHEET":
|
|
49217
|
-
if (this.sheets[cmd.sheetIdTo]) return
|
|
49218
|
-
if (this.orderedSheetIds.map(this.getSheetName.bind(this)).includes(cmd.sheetNameTo)) return
|
|
49219
|
-
return
|
|
49181
|
+
if (this.sheets[cmd.sheetIdTo]) return "DuplicatedSheetId";
|
|
49182
|
+
if (this.orderedSheetIds.map(this.getSheetName.bind(this)).includes(cmd.sheetNameTo)) return "DuplicatedSheetName";
|
|
49183
|
+
return "Success";
|
|
49220
49184
|
case "MOVE_SHEET": try {
|
|
49221
49185
|
const currentIndex = this.orderedSheetIds.findIndex((id) => id === cmd.sheetId);
|
|
49222
49186
|
this.findIndexOfTargetSheet(currentIndex, cmd.delta);
|
|
49223
|
-
return
|
|
49187
|
+
return "Success";
|
|
49224
49188
|
} catch (e) {
|
|
49225
|
-
return
|
|
49189
|
+
return "WrongSheetMove";
|
|
49226
49190
|
}
|
|
49227
49191
|
case "RENAME_SHEET": return this.isRenameAllowed(cmd);
|
|
49228
|
-
case "COLOR_SHEET": return !cmd.color || isColorValid(cmd.color) ?
|
|
49229
|
-
case "DELETE_SHEET": return this.getVisibleSheetIds().length > 1 ?
|
|
49192
|
+
case "COLOR_SHEET": return !cmd.color || isColorValid(cmd.color) ? "Success" : "InvalidColor";
|
|
49193
|
+
case "DELETE_SHEET": return this.getVisibleSheetIds().length > 1 ? "Success" : "NotEnoughSheets";
|
|
49230
49194
|
case "ADD_COLUMNS_ROWS":
|
|
49231
|
-
if (!this.doesHeaderExist(cmd.sheetId, cmd.dimension, cmd.base)) return
|
|
49232
|
-
else if (cmd.quantity <= 0) return
|
|
49233
|
-
return
|
|
49195
|
+
if (!this.doesHeaderExist(cmd.sheetId, cmd.dimension, cmd.base)) return "InvalidHeaderIndex";
|
|
49196
|
+
else if (cmd.quantity <= 0) return "InvalidQuantity";
|
|
49197
|
+
return "Success";
|
|
49234
49198
|
case "REMOVE_COLUMNS_ROWS": {
|
|
49235
49199
|
const min = largeMin(cmd.elements);
|
|
49236
49200
|
const max = largeMax(cmd.elements);
|
|
49237
|
-
if (min < 0 || !this.doesHeaderExist(cmd.sheetId, cmd.dimension, max)) return
|
|
49238
|
-
else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) return
|
|
49239
|
-
else return
|
|
49201
|
+
if (min < 0 || !this.doesHeaderExist(cmd.sheetId, cmd.dimension, max)) return "InvalidHeaderIndex";
|
|
49202
|
+
else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) return "NotEnoughElements";
|
|
49203
|
+
else return "Success";
|
|
49240
49204
|
}
|
|
49241
49205
|
case "FREEZE_ROWS": return this.checkValidations(cmd, this.checkRowFreezeQuantity, this.checkRowFreezeOverlapMerge);
|
|
49242
49206
|
case "FREEZE_COLUMNS": return this.checkValidations(cmd, this.checkColFreezeQuantity, this.checkColFreezeOverlapMerge);
|
|
49243
|
-
default: return
|
|
49207
|
+
default: return "Success";
|
|
49244
49208
|
}
|
|
49245
49209
|
}
|
|
49246
49210
|
handle(cmd) {
|
|
@@ -49503,12 +49467,12 @@ var SheetPlugin = class extends CorePlugin {
|
|
|
49503
49467
|
* not outside the sheet.
|
|
49504
49468
|
*/
|
|
49505
49469
|
checkZonesExistInSheet(sheetId, zones) {
|
|
49506
|
-
if (!zones.every(isZoneValid)) return
|
|
49470
|
+
if (!zones.every(isZoneValid)) return "InvalidRange";
|
|
49507
49471
|
if (zones.length) {
|
|
49508
49472
|
const sheetZone = this.getSheetZone(sheetId);
|
|
49509
|
-
return zones.every((zone) => isZoneInside(zone, sheetZone)) ?
|
|
49473
|
+
return zones.every((zone) => isZoneInside(zone, sheetZone)) ? "Success" : "TargetOutOfSheet";
|
|
49510
49474
|
}
|
|
49511
|
-
return
|
|
49475
|
+
return "Success";
|
|
49512
49476
|
}
|
|
49513
49477
|
updateCellPosition(cmd) {
|
|
49514
49478
|
const { sheetId, cellId, col, row } = cmd;
|
|
@@ -49582,36 +49546,36 @@ var SheetPlugin = class extends CorePlugin {
|
|
|
49582
49546
|
}
|
|
49583
49547
|
checkSheetName(cmd) {
|
|
49584
49548
|
const originalSheetName = this.getters.tryGetSheetName(cmd.sheetId);
|
|
49585
|
-
if (originalSheetName !== void 0 && cmd.name === originalSheetName) return
|
|
49549
|
+
if (originalSheetName !== void 0 && cmd.name === originalSheetName) return "UnchangedSheetName";
|
|
49586
49550
|
const { orderedSheetIds, sheets } = this;
|
|
49587
49551
|
const name = cmd.name && cmd.name.trim().toLowerCase();
|
|
49588
|
-
if (orderedSheetIds.find((id) => isSheetNameEqual(sheets[id]?.name, name) && id !== cmd.sheetId)) return
|
|
49589
|
-
if (FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX.test(name)) return
|
|
49590
|
-
return
|
|
49552
|
+
if (orderedSheetIds.find((id) => isSheetNameEqual(sheets[id]?.name, name) && id !== cmd.sheetId)) return "DuplicatedSheetName";
|
|
49553
|
+
if (FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX.test(name)) return "ForbiddenCharactersInSheetName";
|
|
49554
|
+
return "Success";
|
|
49591
49555
|
}
|
|
49592
49556
|
checkSheetPosition(cmd) {
|
|
49593
49557
|
const { orderedSheetIds } = this;
|
|
49594
|
-
if (cmd.position > orderedSheetIds.length || cmd.position < 0) return
|
|
49595
|
-
return
|
|
49558
|
+
if (cmd.position > orderedSheetIds.length || cmd.position < 0) return "WrongSheetPosition";
|
|
49559
|
+
return "Success";
|
|
49596
49560
|
}
|
|
49597
49561
|
checkRowFreezeQuantity(cmd) {
|
|
49598
|
-
return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId) ?
|
|
49562
|
+
return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId) ? "Success" : "InvalidFreezeQuantity";
|
|
49599
49563
|
}
|
|
49600
49564
|
checkColFreezeQuantity(cmd) {
|
|
49601
|
-
return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId) ?
|
|
49565
|
+
return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId) ? "Success" : "InvalidFreezeQuantity";
|
|
49602
49566
|
}
|
|
49603
49567
|
checkRowFreezeOverlapMerge(cmd) {
|
|
49604
49568
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
49605
|
-
for (const merge of merges) if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) return
|
|
49606
|
-
return
|
|
49569
|
+
for (const merge of merges) if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) return "MergeOverlap";
|
|
49570
|
+
return "Success";
|
|
49607
49571
|
}
|
|
49608
49572
|
checkColFreezeOverlapMerge(cmd) {
|
|
49609
49573
|
const merges = this.getters.getMerges(cmd.sheetId);
|
|
49610
|
-
for (const merge of merges) if (merge.left < cmd.quantity && cmd.quantity <= merge.right) return
|
|
49611
|
-
return
|
|
49574
|
+
for (const merge of merges) if (merge.left < cmd.quantity && cmd.quantity <= merge.right) return "MergeOverlap";
|
|
49575
|
+
return "Success";
|
|
49612
49576
|
}
|
|
49613
49577
|
isRenameAllowed(cmd) {
|
|
49614
|
-
if (!(cmd.name && cmd.name.trim().toLowerCase())) return
|
|
49578
|
+
if (!(cmd.name && cmd.name.trim().toLowerCase())) return "MissingSheetName";
|
|
49615
49579
|
return this.checkSheetName(cmd);
|
|
49616
49580
|
}
|
|
49617
49581
|
renameSheet(sheet, name) {
|
|
@@ -49833,17 +49797,17 @@ var SheetPlugin = class extends CorePlugin {
|
|
|
49833
49797
|
* sheet.
|
|
49834
49798
|
*/
|
|
49835
49799
|
checkSheetExists(cmd) {
|
|
49836
|
-
if (cmd.type !== "CREATE_SHEET" && "sheetId" in cmd && this.sheets[cmd.sheetId] === void 0) return
|
|
49837
|
-
else if (cmd.type === "CREATE_SHEET" && this.sheets[cmd.sheetId] !== void 0) return
|
|
49838
|
-
return
|
|
49800
|
+
if (cmd.type !== "CREATE_SHEET" && "sheetId" in cmd && this.sheets[cmd.sheetId] === void 0) return "InvalidSheetId";
|
|
49801
|
+
else if (cmd.type === "CREATE_SHEET" && this.sheets[cmd.sheetId] !== void 0) return "DuplicatedSheetId";
|
|
49802
|
+
return "Success";
|
|
49839
49803
|
}
|
|
49840
49804
|
/**
|
|
49841
49805
|
* Check if zones in the command are well formed and
|
|
49842
49806
|
* not outside the sheet.
|
|
49843
49807
|
*/
|
|
49844
49808
|
checkZonesAreInSheet(cmd) {
|
|
49845
|
-
if (!("sheetId" in cmd)) return
|
|
49846
|
-
if ("ranges" in cmd && cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) return
|
|
49809
|
+
if (!("sheetId" in cmd)) return "Success";
|
|
49810
|
+
if ("ranges" in cmd && cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) return "InvalidSheetId";
|
|
49847
49811
|
return this.checkZonesExistInSheet(cmd.sheetId, this.getCommandZones(cmd));
|
|
49848
49812
|
}
|
|
49849
49813
|
};
|
|
@@ -49865,21 +49829,21 @@ var TablePlugin = class extends CorePlugin {
|
|
|
49865
49829
|
allowDispatch(cmd) {
|
|
49866
49830
|
switch (cmd.type) {
|
|
49867
49831
|
case "CREATE_TABLE":
|
|
49868
|
-
if (cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId) || rangeData._sheetId !== cmd.sheetId)) return
|
|
49832
|
+
if (cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId) || rangeData._sheetId !== cmd.sheetId)) return "InvalidSheetId";
|
|
49869
49833
|
const zones = cmd.ranges.map((rangeData) => this.getters.getRangeFromRangeData(rangeData).zone);
|
|
49870
|
-
if (!areZonesContinuous(zones)) return
|
|
49871
|
-
return this.checkValidations(cmd, (cmd) => this.getTablesOverlappingZones(cmd.sheetId, zones).length ?
|
|
49834
|
+
if (!areZonesContinuous(zones)) return "NonContinuousTargets";
|
|
49835
|
+
return this.checkValidations(cmd, (cmd) => this.getTablesOverlappingZones(cmd.sheetId, zones).length ? "TableOverlap" : "Success", (cmd) => this.checkTableConfigUpdateIsValid(cmd.config));
|
|
49872
49836
|
case "UPDATE_TABLE":
|
|
49873
|
-
if (!this.getCoreTableMatchingTopLeft(cmd.sheetId, cmd.zone)) return
|
|
49837
|
+
if (!this.getCoreTableMatchingTopLeft(cmd.sheetId, cmd.zone)) return "TableNotFound";
|
|
49874
49838
|
return this.checkValidations(cmd, this.checkUpdatedTableZoneIsValid, (cmd) => this.checkTableConfigUpdateIsValid(cmd.config));
|
|
49875
49839
|
case "ADD_MERGE":
|
|
49876
49840
|
for (const table of this.getCoreTables(cmd.sheetId)) {
|
|
49877
49841
|
const tableZone = table.range.zone;
|
|
49878
|
-
for (const merge of cmd.target) if (overlap(tableZone, merge)) return
|
|
49842
|
+
for (const merge of cmd.target) if (overlap(tableZone, merge)) return "MergeInTable";
|
|
49879
49843
|
}
|
|
49880
49844
|
break;
|
|
49881
49845
|
}
|
|
49882
|
-
return
|
|
49846
|
+
return "Success";
|
|
49883
49847
|
}
|
|
49884
49848
|
handle(cmd) {
|
|
49885
49849
|
switch (cmd.type) {
|
|
@@ -50017,19 +49981,19 @@ var TablePlugin = class extends CorePlugin {
|
|
|
50017
49981
|
}
|
|
50018
49982
|
}
|
|
50019
49983
|
checkUpdatedTableZoneIsValid(cmd) {
|
|
50020
|
-
if (!cmd.newTableRange) return
|
|
49984
|
+
if (!cmd.newTableRange) return "Success";
|
|
50021
49985
|
const newTableZone = this.getters.getRangeFromRangeData(cmd.newTableRange).zone;
|
|
50022
49986
|
const zoneIsInSheet = this.getters.checkZonesExistInSheet(cmd.sheetId, [newTableZone]);
|
|
50023
|
-
if (zoneIsInSheet !==
|
|
49987
|
+
if (zoneIsInSheet !== "Success") return zoneIsInSheet;
|
|
50024
49988
|
const updatedTable = this.getCoreTableMatchingTopLeft(cmd.sheetId, cmd.zone);
|
|
50025
|
-
if (!updatedTable) return
|
|
50026
|
-
return this.getTablesOverlappingZones(cmd.sheetId, [newTableZone]).filter((table) => table.id !== updatedTable.id).length ?
|
|
49989
|
+
if (!updatedTable) return "TableNotFound";
|
|
49990
|
+
return this.getTablesOverlappingZones(cmd.sheetId, [newTableZone]).filter((table) => table.id !== updatedTable.id).length ? "TableOverlap" : "Success";
|
|
50027
49991
|
}
|
|
50028
49992
|
checkTableConfigUpdateIsValid(config) {
|
|
50029
|
-
if (!config) return
|
|
50030
|
-
if (config.numberOfHeaders !== void 0 && config.numberOfHeaders < 0) return
|
|
50031
|
-
if (config.hasFilters && config.numberOfHeaders === 0) return
|
|
50032
|
-
return
|
|
49993
|
+
if (!config) return "Success";
|
|
49994
|
+
if (config.numberOfHeaders !== void 0 && config.numberOfHeaders < 0) return "InvalidTableConfig";
|
|
49995
|
+
if (config.hasFilters && config.numberOfHeaders === 0) return "InvalidTableConfig";
|
|
49996
|
+
return "Success";
|
|
50033
49997
|
}
|
|
50034
49998
|
createStaticTable(id, type, tableRange, config, filters) {
|
|
50035
49999
|
const zone = tableRange.zone;
|
|
@@ -50260,28 +50224,28 @@ var HeaderGroupingPlugin = class extends CorePlugin {
|
|
|
50260
50224
|
switch (cmd.type) {
|
|
50261
50225
|
case "GROUP_HEADERS": {
|
|
50262
50226
|
const { start, end, sheetId } = cmd;
|
|
50263
|
-
if (!this.getters.tryGetSheet(sheetId)) return
|
|
50264
|
-
if (!this.getters.doesHeadersExist(cmd.sheetId, cmd.dimension, [start, end])) return
|
|
50265
|
-
if (start > end) return
|
|
50266
|
-
if (this.findGroupWithStartEnd(cmd.sheetId, cmd.dimension, start, end)) return
|
|
50227
|
+
if (!this.getters.tryGetSheet(sheetId)) return "InvalidSheetId";
|
|
50228
|
+
if (!this.getters.doesHeadersExist(cmd.sheetId, cmd.dimension, [start, end])) return "InvalidHeaderGroupStartEnd";
|
|
50229
|
+
if (start > end) return "InvalidHeaderGroupStartEnd";
|
|
50230
|
+
if (this.findGroupWithStartEnd(cmd.sheetId, cmd.dimension, start, end)) return "HeaderGroupAlreadyExists";
|
|
50267
50231
|
break;
|
|
50268
50232
|
}
|
|
50269
50233
|
case "UNGROUP_HEADERS": {
|
|
50270
50234
|
const { start, end, sheetId } = cmd;
|
|
50271
|
-
if (!this.getters.tryGetSheet(sheetId)) return
|
|
50272
|
-
if (!this.getters.doesHeadersExist(cmd.sheetId, cmd.dimension, [start, end])) return
|
|
50273
|
-
if (start > end) return
|
|
50235
|
+
if (!this.getters.tryGetSheet(sheetId)) return "InvalidSheetId";
|
|
50236
|
+
if (!this.getters.doesHeadersExist(cmd.sheetId, cmd.dimension, [start, end])) return "InvalidHeaderGroupStartEnd";
|
|
50237
|
+
if (start > end) return "InvalidHeaderGroupStartEnd";
|
|
50274
50238
|
break;
|
|
50275
50239
|
}
|
|
50276
50240
|
case "UNFOLD_HEADER_GROUP":
|
|
50277
50241
|
case "FOLD_HEADER_GROUP":
|
|
50278
|
-
if (!this.getters.tryGetSheet(cmd.sheetId)) return
|
|
50242
|
+
if (!this.getters.tryGetSheet(cmd.sheetId)) return "InvalidSheetId";
|
|
50279
50243
|
const group = this.findGroupWithStartEnd(cmd.sheetId, cmd.dimension, cmd.start, cmd.end);
|
|
50280
|
-
if (!group) return
|
|
50281
|
-
if (range(0, this.getters.getNumberHeaders(cmd.sheetId, cmd.dimension)).every((i) => i >= group.start && i <= group.end || this.getters.isHeaderHiddenByUser(cmd.sheetId, cmd.dimension, i))) return
|
|
50244
|
+
if (!group) return "UnknownHeaderGroup";
|
|
50245
|
+
if (range(0, this.getters.getNumberHeaders(cmd.sheetId, cmd.dimension)).every((i) => i >= group.start && i <= group.end || this.getters.isHeaderHiddenByUser(cmd.sheetId, cmd.dimension, i))) return "NotEnoughElements";
|
|
50282
50246
|
break;
|
|
50283
50247
|
}
|
|
50284
|
-
return
|
|
50248
|
+
return "Success";
|
|
50285
50249
|
}
|
|
50286
50250
|
handle(cmd) {
|
|
50287
50251
|
switch (cmd.type) {
|
|
@@ -50610,22 +50574,22 @@ var PivotCorePlugin = class extends CorePlugin {
|
|
|
50610
50574
|
switch (cmd.type) {
|
|
50611
50575
|
case "ADD_PIVOT": return this.checkDuplicatedMeasureIds(cmd.pivot);
|
|
50612
50576
|
case "UPDATE_PIVOT":
|
|
50613
|
-
if (!(cmd.pivotId in this.pivots)) return
|
|
50614
|
-
if (deepEquals(cmd.pivot, this.pivots[cmd.pivotId]?.definition)) return
|
|
50615
|
-
if (cmd.pivot.name === "") return
|
|
50577
|
+
if (!(cmd.pivotId in this.pivots)) return "PivotIdNotFound";
|
|
50578
|
+
if (deepEquals(cmd.pivot, this.pivots[cmd.pivotId]?.definition)) return "NoChanges";
|
|
50579
|
+
if (cmd.pivot.name === "") return "EmptyName";
|
|
50616
50580
|
return this.checkDuplicatedMeasureIds(cmd.pivot);
|
|
50617
50581
|
case "RENAME_PIVOT":
|
|
50618
|
-
if (!(cmd.pivotId in this.pivots)) return
|
|
50619
|
-
if (cmd.name === "") return
|
|
50582
|
+
if (!(cmd.pivotId in this.pivots)) return "PivotIdNotFound";
|
|
50583
|
+
if (cmd.name === "") return "EmptyName";
|
|
50620
50584
|
break;
|
|
50621
50585
|
case "REMOVE_PIVOT":
|
|
50622
50586
|
case "DUPLICATE_PIVOT":
|
|
50623
50587
|
case "INSERT_PIVOT":
|
|
50624
|
-
if (!(cmd.pivotId in this.pivots)) return
|
|
50588
|
+
if (!(cmd.pivotId in this.pivots)) return "PivotIdNotFound";
|
|
50625
50589
|
break;
|
|
50626
|
-
case "DUPLICATE_PIVOT": if (!(cmd.pivotId in this.pivots)) return
|
|
50590
|
+
case "DUPLICATE_PIVOT": if (!(cmd.pivotId in this.pivots)) return "PivotIdNotFound";
|
|
50627
50591
|
}
|
|
50628
|
-
return
|
|
50592
|
+
return "Success";
|
|
50629
50593
|
}
|
|
50630
50594
|
handle(cmd) {
|
|
50631
50595
|
switch (cmd.type) {
|
|
@@ -50823,8 +50787,8 @@ var PivotCorePlugin = class extends CorePlugin {
|
|
|
50823
50787
|
}
|
|
50824
50788
|
checkDuplicatedMeasureIds(definition) {
|
|
50825
50789
|
const uniqueIds = new Set(definition.measures.map((m) => m.id));
|
|
50826
|
-
if (definition.measures.length !== uniqueIds.size) return
|
|
50827
|
-
return
|
|
50790
|
+
if (definition.measures.length !== uniqueIds.size) return "InvalidDefinition";
|
|
50791
|
+
return "Success";
|
|
50828
50792
|
}
|
|
50829
50793
|
/**
|
|
50830
50794
|
* Import the pivots
|
|
@@ -50853,9 +50817,9 @@ var SettingsPlugin = class extends CorePlugin {
|
|
|
50853
50817
|
locale = DEFAULT_LOCALE;
|
|
50854
50818
|
allowDispatch(cmd) {
|
|
50855
50819
|
switch (cmd.type) {
|
|
50856
|
-
case "UPDATE_LOCALE": return isValidLocale(cmd.locale) ?
|
|
50820
|
+
case "UPDATE_LOCALE": return isValidLocale(cmd.locale) ? "Success" : "InvalidLocale";
|
|
50857
50821
|
}
|
|
50858
|
-
return
|
|
50822
|
+
return "Success";
|
|
50859
50823
|
}
|
|
50860
50824
|
handle(cmd) {
|
|
50861
50825
|
switch (cmd.type) {
|
|
@@ -50905,15 +50869,15 @@ var SpreadsheetPivotCorePlugin = class extends CorePlugin {
|
|
|
50905
50869
|
const definition = cmd.pivot;
|
|
50906
50870
|
return this.checkDataSetValidity(definition);
|
|
50907
50871
|
}
|
|
50908
|
-
return
|
|
50872
|
+
return "Success";
|
|
50909
50873
|
}
|
|
50910
50874
|
checkDataSetValidity(definition) {
|
|
50911
50875
|
if (definition.type === "SPREADSHEET" && definition.dataSet) {
|
|
50912
50876
|
const { zone, sheetId } = definition.dataSet;
|
|
50913
|
-
if (!sheetId || !this.getters.tryGetSheet(sheetId) || !zone || !isZoneValid(zone)) return
|
|
50877
|
+
if (!sheetId || !this.getters.tryGetSheet(sheetId) || !zone || !isZoneValid(zone)) return "InvalidDataSet";
|
|
50914
50878
|
return this.getters.checkZonesExistInSheet(sheetId, [zone]);
|
|
50915
50879
|
}
|
|
50916
|
-
return
|
|
50880
|
+
return "Success";
|
|
50917
50881
|
}
|
|
50918
50882
|
};
|
|
50919
50883
|
|
|
@@ -50931,18 +50895,18 @@ var TableStylePlugin = class extends CorePlugin {
|
|
|
50931
50895
|
switch (cmd.type) {
|
|
50932
50896
|
case "CREATE_TABLE":
|
|
50933
50897
|
case "UPDATE_TABLE":
|
|
50934
|
-
if (cmd.config?.styleId && !this.styles[cmd.config.styleId]) return
|
|
50898
|
+
if (cmd.config?.styleId && !this.styles[cmd.config.styleId]) return "InvalidTableConfig";
|
|
50935
50899
|
break;
|
|
50936
50900
|
case "CREATE_TABLE_STYLE":
|
|
50937
|
-
if (!TABLE_STYLES_TEMPLATES[cmd.templateName]) return
|
|
50901
|
+
if (!TABLE_STYLES_TEMPLATES[cmd.templateName]) return "InvalidTableStyle";
|
|
50938
50902
|
try {
|
|
50939
50903
|
toHex(cmd.primaryColor);
|
|
50940
50904
|
} catch (e) {
|
|
50941
|
-
return
|
|
50905
|
+
return "InvalidTableStyle";
|
|
50942
50906
|
}
|
|
50943
50907
|
break;
|
|
50944
50908
|
}
|
|
50945
|
-
return
|
|
50909
|
+
return "Success";
|
|
50946
50910
|
}
|
|
50947
50911
|
handle(cmd) {
|
|
50948
50912
|
switch (cmd.type) {
|
|
@@ -51044,6 +51008,8 @@ function buildCompilationParameters(context, getters, computeCell) {
|
|
|
51044
51008
|
return new CompilationParametersBuilder(context, getters, computeCell).getParameters();
|
|
51045
51009
|
}
|
|
51046
51010
|
var CompilationParametersBuilder = class {
|
|
51011
|
+
getters;
|
|
51012
|
+
computeCell;
|
|
51047
51013
|
evalContext;
|
|
51048
51014
|
rangeCache = {};
|
|
51049
51015
|
constructor(context, getters, computeCell) {
|
|
@@ -51497,6 +51463,7 @@ var ZoneRBush = class extends import_rbush_min.default {
|
|
|
51497
51463
|
* It uses an R-Tree data structure to efficiently find dependent cells.
|
|
51498
51464
|
*/
|
|
51499
51465
|
var FormulaDependencyGraph = class {
|
|
51466
|
+
createEmptyPositionSet;
|
|
51500
51467
|
dependencies = new PositionMap();
|
|
51501
51468
|
rTree;
|
|
51502
51469
|
constructor(createEmptyPositionSet, data = []) {
|
|
@@ -51798,6 +51765,7 @@ const MAX_ITERATION = 30;
|
|
|
51798
51765
|
const ERROR_CYCLE_CELL = Object.freeze(createEvaluatedCell(new CircularDependencyError()));
|
|
51799
51766
|
const EMPTY_CELL = Object.freeze(createEvaluatedCell({ value: null }));
|
|
51800
51767
|
var Evaluator = class {
|
|
51768
|
+
context;
|
|
51801
51769
|
getters;
|
|
51802
51770
|
compilationParams;
|
|
51803
51771
|
evaluatedCells = new PositionMap();
|
|
@@ -51816,7 +51784,7 @@ var Evaluator = class {
|
|
|
51816
51784
|
const spreadZone = this.spreadingRelations.getArrayResultZone(position);
|
|
51817
51785
|
if (!spreadZone) return;
|
|
51818
51786
|
const evaluatedCell = this.evaluatedCells.get(position);
|
|
51819
|
-
if (evaluatedCell?.type ===
|
|
51787
|
+
if (evaluatedCell?.type === "error" && !(options.ignoreSpillError && evaluatedCell?.value === CellErrorType.SpilledBlocked)) return positionToZone(position);
|
|
51820
51788
|
return union(positionToZone(position), spreadZone);
|
|
51821
51789
|
}
|
|
51822
51790
|
getEvaluatedPositions() {
|
|
@@ -51826,7 +51794,7 @@ var Evaluator = class {
|
|
|
51826
51794
|
return this.evaluatedCells.keysForSheet(sheetId);
|
|
51827
51795
|
}
|
|
51828
51796
|
getArrayFormulaSpreadingOn(position) {
|
|
51829
|
-
if (this.getEvaluatedCell(position).type ===
|
|
51797
|
+
if (this.getEvaluatedCell(position).type === "empty") return;
|
|
51830
51798
|
const arrayFormulas = this.spreadingRelations.searchFormulaPositionsSpreadingOn(position.sheetId, positionToZone(position));
|
|
51831
51799
|
return Array.from(arrayFormulas).find((position) => !this.blockedArrayFormulas.has(position));
|
|
51832
51800
|
}
|
|
@@ -52059,7 +52027,7 @@ var Evaluator = class {
|
|
|
52059
52027
|
col: i + col,
|
|
52060
52028
|
row: j + row
|
|
52061
52029
|
};
|
|
52062
|
-
if (this.getters.getCell(position)?.content || this.getters.getEvaluatedCell(position).type !==
|
|
52030
|
+
if (this.getters.getCell(position)?.content || this.getters.getEvaluatedCell(position).type !== "empty") {
|
|
52063
52031
|
this.blockedArrayFormulas.add(formulaPosition);
|
|
52064
52032
|
throw new SplillBlockedError(_t("Array result was not expanded because it would overwrite data in %s.", toXC(position.col, position.row)));
|
|
52065
52033
|
}
|
|
@@ -52285,7 +52253,7 @@ var EvaluationPlugin = class extends UIPlugin {
|
|
|
52285
52253
|
sheetId,
|
|
52286
52254
|
col,
|
|
52287
52255
|
row
|
|
52288
|
-
})).every((cell) => cell.type ===
|
|
52256
|
+
})).every((cell) => cell.type === "empty");
|
|
52289
52257
|
}
|
|
52290
52258
|
/**
|
|
52291
52259
|
* Maps the visible positions of a range according to a provided callback
|
|
@@ -52739,7 +52707,7 @@ var EvaluationConditionalFormatPlugin = class extends UIPlugin {
|
|
|
52739
52707
|
return computedDataBars;
|
|
52740
52708
|
}
|
|
52741
52709
|
parsePoint(sheetId, range, threshold, functionName) {
|
|
52742
|
-
const rangeValues = this.getters.getEvaluatedCellsInZone(sheetId, this.getters.getRangeFromSheetXC(sheetId, range).zone).filter((cell) => cell.type ===
|
|
52710
|
+
const rangeValues = this.getters.getEvaluatedCellsInZone(sheetId, this.getters.getRangeFromSheetXC(sheetId, range).zone).filter((cell) => cell.type === "number").map((cell) => cell.value);
|
|
52743
52711
|
switch (threshold.type) {
|
|
52744
52712
|
case "value": return functionName === "max" ? largeMax(rangeValues) : largeMin(rangeValues);
|
|
52745
52713
|
case "number": return Number(threshold.value);
|
|
@@ -52770,7 +52738,7 @@ var EvaluationConditionalFormatPlugin = class extends UIPlugin {
|
|
|
52770
52738
|
col,
|
|
52771
52739
|
row
|
|
52772
52740
|
});
|
|
52773
|
-
if (cell.type !==
|
|
52741
|
+
if (cell.type !== "number") continue;
|
|
52774
52742
|
const icon = this.computeIcon(cell.value, upperInflectionPoint, rule.upperInflectionPoint.operator, lowerInflectionPoint, rule.lowerInflectionPoint.operator, iconSet);
|
|
52775
52743
|
if (!computedIcons[col]) computedIcons[col] = [];
|
|
52776
52744
|
computedIcons[col][row] = icon;
|
|
@@ -52783,7 +52751,7 @@ var EvaluationConditionalFormatPlugin = class extends UIPlugin {
|
|
|
52783
52751
|
}
|
|
52784
52752
|
applyDataBar(sheetId, range, rule, computedDataBars) {
|
|
52785
52753
|
const rangeValues = this.getters.getRangeFromSheetXC(sheetId, rule.rangeValues || range);
|
|
52786
|
-
const max = largeMax(this.getters.getEvaluatedCellsInZone(sheetId, rangeValues.zone).filter((cell) => cell.type ===
|
|
52754
|
+
const max = largeMax(this.getters.getEvaluatedCellsInZone(sheetId, rangeValues.zone).filter((cell) => cell.type === "number").map((cell) => cell.value));
|
|
52787
52755
|
if (max <= 0) return;
|
|
52788
52756
|
const color = rule.color;
|
|
52789
52757
|
const zone = this.getters.getRangeFromSheetXC(sheetId, range).zone;
|
|
@@ -52796,7 +52764,7 @@ var EvaluationConditionalFormatPlugin = class extends UIPlugin {
|
|
|
52796
52764
|
col: targetCol,
|
|
52797
52765
|
row: targetRow
|
|
52798
52766
|
});
|
|
52799
|
-
if (!isInside(targetCol, targetRow, zoneOfValues) || cell.type !==
|
|
52767
|
+
if (!isInside(targetCol, targetRow, zoneOfValues) || cell.type !== "number" || cell.value <= 0) continue;
|
|
52800
52768
|
if (!computedDataBars[col]) computedDataBars[col] = [];
|
|
52801
52769
|
computedDataBars[col][row] = {
|
|
52802
52770
|
color: colorNumberString(color),
|
|
@@ -52834,7 +52802,7 @@ var EvaluationConditionalFormatPlugin = class extends UIPlugin {
|
|
|
52834
52802
|
col,
|
|
52835
52803
|
row
|
|
52836
52804
|
});
|
|
52837
|
-
if (cell.type ===
|
|
52805
|
+
if (cell.type === "number") {
|
|
52838
52806
|
const value = clip(cell.value, minValue, maxValue);
|
|
52839
52807
|
let color;
|
|
52840
52808
|
if (colorCellArgs.length === 2 && midValue) color = value <= midValue ? this.colorCell(value, colorCellArgs[0].minValue, colorCellArgs[0].minColor, colorCellArgs[0].colorDiffUnit) : this.colorCell(value, colorCellArgs[1].minValue, colorCellArgs[1].minColor, colorCellArgs[1].colorDiffUnit);
|
|
@@ -52868,7 +52836,7 @@ var EvaluationConditionalFormatPlugin = class extends UIPlugin {
|
|
|
52868
52836
|
*/
|
|
52869
52837
|
rulePredicate = { CellIsRule: (target, rule) => {
|
|
52870
52838
|
const cell = this.getters.getEvaluatedCell(target);
|
|
52871
|
-
if (cell.type ===
|
|
52839
|
+
if (cell.type === "error") return false;
|
|
52872
52840
|
let [value0, value1] = rule.values.map((val) => {
|
|
52873
52841
|
if (val.startsWith("=")) return this.getters.evaluateFormula(target.sheetId, val) ?? "";
|
|
52874
52842
|
return parseLiteral(val, DEFAULT_LOCALE);
|
|
@@ -52978,7 +52946,7 @@ var EvaluationDataValidationPlugin = class extends UIPlugin {
|
|
|
52978
52946
|
if (!validationResults[col]) validationResults[col] = [];
|
|
52979
52947
|
validationResults[col][row] = lazy(() => {
|
|
52980
52948
|
const evaluatedCell = this.getters.getEvaluatedCell(cellPosition);
|
|
52981
|
-
if (evaluatedCell.type ===
|
|
52949
|
+
if (evaluatedCell.type === "empty") return VALID_RESULT;
|
|
52982
52950
|
return this.getValidationResultForCellValue(evaluatedCell.value, cellPosition);
|
|
52983
52951
|
});
|
|
52984
52952
|
}
|
|
@@ -53793,6 +53761,7 @@ var PivotUIPlugin = class extends UIPlugin {
|
|
|
53793
53761
|
"getPivot",
|
|
53794
53762
|
"getFirstPivotFunction",
|
|
53795
53763
|
"getPivotIdFromPosition",
|
|
53764
|
+
"getPivotIdsFromPosition",
|
|
53796
53765
|
"getPivotCellFromPosition",
|
|
53797
53766
|
"generateNewCalculatedMeasureName",
|
|
53798
53767
|
"isPivotUnused",
|
|
@@ -53850,37 +53819,52 @@ var PivotUIPlugin = class extends UIPlugin {
|
|
|
53850
53819
|
}
|
|
53851
53820
|
}
|
|
53852
53821
|
/**
|
|
53853
|
-
* Get the id of the pivot at the given position. Returns undefined if there
|
|
53822
|
+
* Get the id of the first pivot in the formula at the given position. Returns undefined if there
|
|
53854
53823
|
* is no pivot at this position
|
|
53855
53824
|
*/
|
|
53856
53825
|
getPivotIdFromPosition(position) {
|
|
53826
|
+
return this.getPivotIdsFromPosition(position)[0];
|
|
53827
|
+
}
|
|
53828
|
+
/**
|
|
53829
|
+
* Get all of the ids of the pivot present in the formula at the given position.
|
|
53830
|
+
*/
|
|
53831
|
+
getPivotIdsFromPosition(position) {
|
|
53857
53832
|
const cell = this.getters.getCorrespondingFormulaCell(position);
|
|
53858
|
-
if (cell && cell.isFormula)
|
|
53859
|
-
|
|
53860
|
-
|
|
53861
|
-
|
|
53862
|
-
|
|
53863
|
-
|
|
53864
|
-
|
|
53833
|
+
if (cell && cell.isFormula) return this.getPivotIdsFromFormula(position.sheetId, cell.compiledFormula);
|
|
53834
|
+
return [];
|
|
53835
|
+
}
|
|
53836
|
+
getPivotIdsFromFormula(sheetId, formula) {
|
|
53837
|
+
return this.getPivotFunctions(sheetId, formula.tokens).map((pivotFunction) => {
|
|
53838
|
+
const pivotId = pivotFunction.args[0]?.toString();
|
|
53839
|
+
return pivotId && this.getters.getPivotId(pivotId);
|
|
53840
|
+
}).filter(isDefined);
|
|
53865
53841
|
}
|
|
53866
53842
|
isSpillPivotFormula(position) {
|
|
53867
53843
|
const cell = this.getters.getCorrespondingFormulaCell(position);
|
|
53868
53844
|
if (cell && cell.isFormula) return this.getFirstPivotFunction(position.sheetId, cell.compiledFormula.tokens)?.functionName === "PIVOT";
|
|
53869
53845
|
return false;
|
|
53870
53846
|
}
|
|
53871
|
-
|
|
53872
|
-
const
|
|
53873
|
-
if (!
|
|
53874
|
-
const
|
|
53875
|
-
|
|
53876
|
-
functionName,
|
|
53877
|
-
|
|
53847
|
+
getPivotFunctions(sheetId, tokens) {
|
|
53848
|
+
const pivotFunctions = getPivotFunctions(tokens);
|
|
53849
|
+
if (!pivotFunctions.length) return [];
|
|
53850
|
+
const evaluatedPivotFunctions = [];
|
|
53851
|
+
for (const pivotFunction of pivotFunctions) {
|
|
53852
|
+
const { functionName, args } = pivotFunction;
|
|
53853
|
+
const evaluatedArgs = args.map((argAst) => {
|
|
53878
53854
|
if (argAst.type === "EMPTY") return;
|
|
53879
53855
|
else if (argAst.type === "STRING" || argAst.type === "BOOLEAN" || argAst.type === "NUMBER") return argAst.value;
|
|
53880
53856
|
const argsString = astToFormula(argAst);
|
|
53881
53857
|
return this.getters.evaluateFormula(sheetId, argsString);
|
|
53882
|
-
})
|
|
53883
|
-
|
|
53858
|
+
});
|
|
53859
|
+
evaluatedPivotFunctions.push({
|
|
53860
|
+
functionName,
|
|
53861
|
+
args: evaluatedArgs
|
|
53862
|
+
});
|
|
53863
|
+
}
|
|
53864
|
+
return evaluatedPivotFunctions;
|
|
53865
|
+
}
|
|
53866
|
+
getFirstPivotFunction(sheetId, tokens) {
|
|
53867
|
+
return this.getPivotFunctions(sheetId, tokens)[0];
|
|
53884
53868
|
}
|
|
53885
53869
|
/**
|
|
53886
53870
|
* Returns the domain args of a pivot formula from a position.
|
|
@@ -53980,8 +53964,8 @@ var PivotUIPlugin = class extends UIPlugin {
|
|
|
53980
53964
|
const unusedPivots = new Set(this.getters.getPivotIds());
|
|
53981
53965
|
for (const sheetId of this.getters.getSheetIds()) for (const cellId in this.getters.getCells(sheetId)) {
|
|
53982
53966
|
const position = this.getters.getCellPosition(cellId);
|
|
53983
|
-
const
|
|
53984
|
-
|
|
53967
|
+
const pivotIds = this.getPivotIdsFromPosition(position);
|
|
53968
|
+
for (const pivotId of pivotIds) {
|
|
53985
53969
|
unusedPivots.delete(pivotId);
|
|
53986
53970
|
if (!unusedPivots.size) {
|
|
53987
53971
|
this.unusedPivots = [];
|
|
@@ -53989,6 +53973,21 @@ var PivotUIPlugin = class extends UIPlugin {
|
|
|
53989
53973
|
}
|
|
53990
53974
|
}
|
|
53991
53975
|
}
|
|
53976
|
+
for (const pivotId of this.getters.getPivotIds()) {
|
|
53977
|
+
const pivot = this.getters.getPivot(pivotId);
|
|
53978
|
+
for (const measure of pivot.definition.measures) if (measure.computedBy) {
|
|
53979
|
+
const { sheetId } = measure.computedBy;
|
|
53980
|
+
const formula = this.getters.getMeasureCompiledFormula(pivotId, measure);
|
|
53981
|
+
const relatedPivotIds = this.getPivotIdsFromFormula(sheetId, formula);
|
|
53982
|
+
for (const relatedPivotId of relatedPivotIds) {
|
|
53983
|
+
unusedPivots.delete(relatedPivotId);
|
|
53984
|
+
if (!unusedPivots.size) {
|
|
53985
|
+
this.unusedPivots = [];
|
|
53986
|
+
return [];
|
|
53987
|
+
}
|
|
53988
|
+
}
|
|
53989
|
+
}
|
|
53990
|
+
}
|
|
53992
53991
|
this.unusedPivots = [...unusedPivots];
|
|
53993
53992
|
return this.unusedPivots;
|
|
53994
53993
|
}
|
|
@@ -54065,10 +54064,10 @@ var AutofillPlugin = class extends UIPlugin {
|
|
|
54065
54064
|
const sheetId = this.getters.getActiveSheetId();
|
|
54066
54065
|
this.lastCellSelected.col = cmd.col === -1 ? this.lastCellSelected.col : clip(cmd.col, 0, this.getters.getNumberCols(sheetId));
|
|
54067
54066
|
this.lastCellSelected.row = cmd.row === -1 ? this.lastCellSelected.row : clip(cmd.row, 0, this.getters.getNumberRows(sheetId));
|
|
54068
|
-
if (this.lastCellSelected.col !== void 0 && this.lastCellSelected.row !== void 0) return
|
|
54069
|
-
return
|
|
54067
|
+
if (this.lastCellSelected.col !== void 0 && this.lastCellSelected.row !== void 0) return "Success";
|
|
54068
|
+
return "InvalidAutofillSelection";
|
|
54070
54069
|
}
|
|
54071
|
-
return
|
|
54070
|
+
return "Success";
|
|
54072
54071
|
}
|
|
54073
54072
|
handle(cmd) {
|
|
54074
54073
|
switch (cmd.type) {
|
|
@@ -54100,7 +54099,7 @@ var AutofillPlugin = class extends UIPlugin {
|
|
|
54100
54099
|
const target = this.autofillZone;
|
|
54101
54100
|
const autofillCellsData = [];
|
|
54102
54101
|
switch (this.direction) {
|
|
54103
|
-
case
|
|
54102
|
+
case "down":
|
|
54104
54103
|
for (let col = source.left; col <= source.right; col++) {
|
|
54105
54104
|
const xcs = [];
|
|
54106
54105
|
for (let row = source.top; row <= source.bottom; row++) xcs.push(toXC(col, row));
|
|
@@ -54108,7 +54107,7 @@ var AutofillPlugin = class extends UIPlugin {
|
|
|
54108
54107
|
for (let row = target.top; row <= target.bottom; row++) autofillCellsData.push(this.computeNewCell(generator, col, row));
|
|
54109
54108
|
}
|
|
54110
54109
|
break;
|
|
54111
|
-
case
|
|
54110
|
+
case "up":
|
|
54112
54111
|
for (let col = source.left; col <= source.right; col++) {
|
|
54113
54112
|
const xcs = [];
|
|
54114
54113
|
for (let row = source.bottom; row >= source.top; row--) xcs.push(toXC(col, row));
|
|
@@ -54116,7 +54115,7 @@ var AutofillPlugin = class extends UIPlugin {
|
|
|
54116
54115
|
for (let row = target.bottom; row >= target.top; row--) autofillCellsData.push(this.computeNewCell(generator, col, row));
|
|
54117
54116
|
}
|
|
54118
54117
|
break;
|
|
54119
|
-
case
|
|
54118
|
+
case "left":
|
|
54120
54119
|
for (let row = source.top; row <= source.bottom; row++) {
|
|
54121
54120
|
const xcs = [];
|
|
54122
54121
|
for (let col = source.right; col >= source.left; col--) xcs.push(toXC(col, row));
|
|
@@ -54124,7 +54123,7 @@ var AutofillPlugin = class extends UIPlugin {
|
|
|
54124
54123
|
for (let col = target.right; col >= target.left; col--) autofillCellsData.push(this.computeNewCell(generator, col, row));
|
|
54125
54124
|
}
|
|
54126
54125
|
break;
|
|
54127
|
-
case
|
|
54126
|
+
case "right":
|
|
54128
54127
|
for (let row = source.top; row <= source.bottom; row++) {
|
|
54129
54128
|
const xcs = [];
|
|
54130
54129
|
for (let col = source.left; col <= source.right; col++) xcs.push(toXC(col, row));
|
|
@@ -54250,19 +54249,19 @@ var AutofillPlugin = class extends UIPlugin {
|
|
|
54250
54249
|
}
|
|
54251
54250
|
this.direction = this.getDirection(col, row);
|
|
54252
54251
|
switch (this.direction) {
|
|
54253
|
-
case
|
|
54252
|
+
case "up":
|
|
54254
54253
|
this.saveZone(row, source.top - 1, source.left, source.right);
|
|
54255
54254
|
this.steps = source.top - row;
|
|
54256
54255
|
break;
|
|
54257
|
-
case
|
|
54256
|
+
case "down":
|
|
54258
54257
|
this.saveZone(source.bottom + 1, row, source.left, source.right);
|
|
54259
54258
|
this.steps = row - source.bottom;
|
|
54260
54259
|
break;
|
|
54261
|
-
case
|
|
54260
|
+
case "left":
|
|
54262
54261
|
this.saveZone(source.top, source.bottom, col, source.left - 1);
|
|
54263
54262
|
this.steps = source.left - col;
|
|
54264
54263
|
break;
|
|
54265
|
-
case
|
|
54264
|
+
case "right":
|
|
54266
54265
|
this.saveZone(source.top, source.bottom, source.right + 1, col);
|
|
54267
54266
|
this.steps = col - source.right;
|
|
54268
54267
|
break;
|
|
@@ -54281,7 +54280,7 @@ var AutofillPlugin = class extends UIPlugin {
|
|
|
54281
54280
|
for (let row = selection.bottom + 1; row <= autofillRow; row++) if (this.getters.getEvaluatedCell({
|
|
54282
54281
|
...activePosition,
|
|
54283
54282
|
row
|
|
54284
|
-
}).type !==
|
|
54283
|
+
}).type !== "empty") {
|
|
54285
54284
|
autofillRow = row - 1;
|
|
54286
54285
|
break;
|
|
54287
54286
|
}
|
|
@@ -54301,7 +54300,7 @@ var AutofillPlugin = class extends UIPlugin {
|
|
|
54301
54300
|
col: col - 1,
|
|
54302
54301
|
row
|
|
54303
54302
|
};
|
|
54304
|
-
while (this.getters.getEvaluatedCell(leftPosition).type !==
|
|
54303
|
+
while (this.getters.getEvaluatedCell(leftPosition).type !== "empty") {
|
|
54305
54304
|
row += 1;
|
|
54306
54305
|
leftPosition = {
|
|
54307
54306
|
sheetId,
|
|
@@ -54318,7 +54317,7 @@ var AutofillPlugin = class extends UIPlugin {
|
|
|
54318
54317
|
col: col + 1,
|
|
54319
54318
|
row
|
|
54320
54319
|
};
|
|
54321
|
-
while (this.getters.getEvaluatedCell(rightPosition).type !==
|
|
54320
|
+
while (this.getters.getEvaluatedCell(rightPosition).type !== "empty") {
|
|
54322
54321
|
row += 1;
|
|
54323
54322
|
rightPosition = {
|
|
54324
54323
|
sheetId,
|
|
@@ -54408,19 +54407,19 @@ var AutofillPlugin = class extends UIPlugin {
|
|
|
54408
54407
|
const position = {
|
|
54409
54408
|
up: {
|
|
54410
54409
|
number: source.top - row,
|
|
54411
|
-
value:
|
|
54410
|
+
value: "up"
|
|
54412
54411
|
},
|
|
54413
54412
|
down: {
|
|
54414
54413
|
number: row - source.bottom,
|
|
54415
|
-
value:
|
|
54414
|
+
value: "down"
|
|
54416
54415
|
},
|
|
54417
54416
|
left: {
|
|
54418
54417
|
number: source.left - col,
|
|
54419
|
-
value:
|
|
54418
|
+
value: "left"
|
|
54420
54419
|
},
|
|
54421
54420
|
right: {
|
|
54422
54421
|
number: col - source.right,
|
|
54423
|
-
value:
|
|
54422
|
+
value: "right"
|
|
54424
54423
|
}
|
|
54425
54424
|
};
|
|
54426
54425
|
if (Object.values(position).map((x) => x.number > 0 ? 1 : 0).reduce((acc, value) => acc + value) === 1) return Object.values(position).find((x) => x.number > 0 ? 1 : 0).value;
|
|
@@ -54623,7 +54622,7 @@ var AutomaticSumPlugin = class extends UIPlugin {
|
|
|
54623
54622
|
return this.getters.isEmpty(sheetId, zone) || this.getters.isSingleCellOrMerge(sheetId, zone);
|
|
54624
54623
|
}
|
|
54625
54624
|
isNumber(cell) {
|
|
54626
|
-
return cell.type ===
|
|
54625
|
+
return cell.type === "number" && !(cell.format && isDateTimeFormat(cell.format));
|
|
54627
54626
|
}
|
|
54628
54627
|
isZoneValid(zone) {
|
|
54629
54628
|
return zone.bottom >= zone.top && zone.right >= zone.left;
|
|
@@ -55117,6 +55116,8 @@ function transformPositionWithMerge(toTransform, executed) {
|
|
|
55117
55116
|
//#endregion
|
|
55118
55117
|
//#region src/collaborative/revisions.ts
|
|
55119
55118
|
var Revision = class {
|
|
55119
|
+
rootCommand;
|
|
55120
|
+
timestamp;
|
|
55120
55121
|
id;
|
|
55121
55122
|
clientId;
|
|
55122
55123
|
_commands = [];
|
|
@@ -55153,6 +55154,9 @@ var Revision = class {
|
|
|
55153
55154
|
//#region src/collaborative/session.ts
|
|
55154
55155
|
var ClientDisconnectedError = class extends Error {};
|
|
55155
55156
|
var Session = class extends EventBus {
|
|
55157
|
+
revisions;
|
|
55158
|
+
transportService;
|
|
55159
|
+
serverRevisionId;
|
|
55156
55160
|
/**
|
|
55157
55161
|
* Positions of the others client.
|
|
55158
55162
|
*/
|
|
@@ -55618,7 +55622,7 @@ var DataCleanupPlugin = class extends UIPlugin {
|
|
|
55618
55622
|
switch (cmd.type) {
|
|
55619
55623
|
case "REMOVE_DUPLICATES": return this.checkValidations(cmd, this.chainValidations(this.checkSingleRangeSelected, this.checkNoMergeInZone, this.checkRangeContainsValues, this.checkColumnsIncludedInZone), this.chainValidations(this.checkNoColumnProvided, this.checkColumnsAreUnique));
|
|
55620
55624
|
}
|
|
55621
|
-
return
|
|
55625
|
+
return "Success";
|
|
55622
55626
|
}
|
|
55623
55627
|
handle(cmd) {
|
|
55624
55628
|
switch (cmd.type) {
|
|
@@ -55701,34 +55705,34 @@ var DataCleanupPlugin = class extends UIPlugin {
|
|
|
55701
55705
|
});
|
|
55702
55706
|
}
|
|
55703
55707
|
checkSingleRangeSelected() {
|
|
55704
|
-
if (this.getters.getSelectedZones().length !== 1) return
|
|
55705
|
-
return
|
|
55708
|
+
if (this.getters.getSelectedZones().length !== 1) return "MoreThanOneRangeSelected";
|
|
55709
|
+
return "Success";
|
|
55706
55710
|
}
|
|
55707
55711
|
checkNoMergeInZone() {
|
|
55708
55712
|
const sheetId = this.getters.getActiveSheetId();
|
|
55709
55713
|
const zone = this.getters.getSelectedZone();
|
|
55710
|
-
if (this.getters.getMergesInZone(sheetId, zone).length > 0) return
|
|
55711
|
-
return
|
|
55714
|
+
if (this.getters.getMergesInZone(sheetId, zone).length > 0) return "WillRemoveExistingMerge";
|
|
55715
|
+
return "Success";
|
|
55712
55716
|
}
|
|
55713
55717
|
checkRangeContainsValues(cmd) {
|
|
55714
55718
|
const sheetId = this.getters.getActiveSheetId();
|
|
55715
55719
|
const zone = this.getters.getSelectedZone();
|
|
55716
55720
|
if (cmd.hasHeader) zone.top += 1;
|
|
55717
|
-
if (this.getters.getEvaluatedCellsInZone(sheetId, zone).every((evaluatedCel) => evaluatedCel.type === "empty")) return
|
|
55718
|
-
return
|
|
55721
|
+
if (this.getters.getEvaluatedCellsInZone(sheetId, zone).every((evaluatedCel) => evaluatedCel.type === "empty")) return "EmptyTarget";
|
|
55722
|
+
return "Success";
|
|
55719
55723
|
}
|
|
55720
55724
|
checkNoColumnProvided(cmd) {
|
|
55721
|
-
if (cmd.columns.length === 0) return
|
|
55722
|
-
return
|
|
55725
|
+
if (cmd.columns.length === 0) return "NoColumnsProvided";
|
|
55726
|
+
return "Success";
|
|
55723
55727
|
}
|
|
55724
55728
|
checkColumnsIncludedInZone(cmd) {
|
|
55725
55729
|
const zone = this.getters.getSelectedZone();
|
|
55726
|
-
if (cmd.columns.some((colIndex) => colIndex < zone.left || colIndex > zone.right)) return
|
|
55727
|
-
return
|
|
55730
|
+
if (cmd.columns.some((colIndex) => colIndex < zone.left || colIndex > zone.right)) return "ColumnsNotIncludedInZone";
|
|
55731
|
+
return "Success";
|
|
55728
55732
|
}
|
|
55729
55733
|
checkColumnsAreUnique(cmd) {
|
|
55730
|
-
if (cmd.columns.length !== new Set(cmd.columns).size) return
|
|
55731
|
-
return
|
|
55734
|
+
if (cmd.columns.length !== new Set(cmd.columns).size) return "DuplicatesColumnsSelected";
|
|
55735
|
+
return "Success";
|
|
55732
55736
|
}
|
|
55733
55737
|
trimWhitespace() {
|
|
55734
55738
|
const zones = recomputeZones(this.getters.getSelectedZones());
|
|
@@ -55861,7 +55865,7 @@ var FormatPlugin = class extends UIPlugin {
|
|
|
55861
55865
|
getCellNumberFormat(position) {
|
|
55862
55866
|
for (const pos of [position]) {
|
|
55863
55867
|
const cell = this.getters.getEvaluatedCell(pos);
|
|
55864
|
-
if (cell.type ===
|
|
55868
|
+
if (cell.type === "number" && !(cell.format && isDateTimeFormat(cell.format))) return cell.format || createDefaultFormat(cell.value);
|
|
55865
55869
|
}
|
|
55866
55870
|
}
|
|
55867
55871
|
};
|
|
@@ -55929,11 +55933,11 @@ var InsertPivotPlugin = class extends UIPlugin {
|
|
|
55929
55933
|
allowDispatch(cmd) {
|
|
55930
55934
|
switch (cmd.type) {
|
|
55931
55935
|
case "DUPLICATE_PIVOT_IN_NEW_SHEET":
|
|
55932
|
-
if (!this.getters.isExistingPivot(cmd.pivotId)) return
|
|
55933
|
-
if (!this.getters.getPivot(cmd.pivotId).isValid()) return
|
|
55936
|
+
if (!this.getters.isExistingPivot(cmd.pivotId)) return "PivotIdNotFound";
|
|
55937
|
+
if (!this.getters.getPivot(cmd.pivotId).isValid()) return "PivotInError";
|
|
55934
55938
|
break;
|
|
55935
55939
|
}
|
|
55936
|
-
return
|
|
55940
|
+
return "Success";
|
|
55937
55941
|
}
|
|
55938
55942
|
handle(cmd) {
|
|
55939
55943
|
switch (cmd.type) {
|
|
@@ -56134,7 +56138,7 @@ var SortPlugin = class extends UIPlugin {
|
|
|
56134
56138
|
if (!isInside(cmd.col, cmd.row, cmd.zone)) throw new Error(_t("The anchor must be part of the provided zone"));
|
|
56135
56139
|
return this.checkValidations(cmd, this.checkMerge, this.checkMergeSizes);
|
|
56136
56140
|
}
|
|
56137
|
-
return
|
|
56141
|
+
return "Success";
|
|
56138
56142
|
}
|
|
56139
56143
|
handle(cmd) {
|
|
56140
56144
|
switch (cmd.type) {
|
|
@@ -56144,24 +56148,24 @@ var SortPlugin = class extends UIPlugin {
|
|
|
56144
56148
|
}
|
|
56145
56149
|
}
|
|
56146
56150
|
checkMerge({ sheetId, zone }) {
|
|
56147
|
-
if (!this.getters.doesIntersectMerge(sheetId, zone)) return
|
|
56151
|
+
if (!this.getters.doesIntersectMerge(sheetId, zone)) return "Success";
|
|
56148
56152
|
if (positions(zone).some(({ col, row }) => !this.getters.isInMerge({
|
|
56149
56153
|
sheetId,
|
|
56150
56154
|
col,
|
|
56151
56155
|
row
|
|
56152
|
-
}))) return
|
|
56153
|
-
return
|
|
56156
|
+
}))) return "InvalidSortZone";
|
|
56157
|
+
return "Success";
|
|
56154
56158
|
}
|
|
56155
56159
|
checkMergeSizes({ sheetId, zone }) {
|
|
56156
|
-
if (!this.getters.doesIntersectMerge(sheetId, zone)) return
|
|
56160
|
+
if (!this.getters.doesIntersectMerge(sheetId, zone)) return "Success";
|
|
56157
56161
|
const merges = this.getters.getMerges(sheetId).filter((merge) => overlap(merge, zone));
|
|
56158
56162
|
const mergeDimension = zoneToDimension(merges[0]);
|
|
56159
56163
|
const [widthFirst, heightFirst] = [mergeDimension.numberOfCols, mergeDimension.numberOfRows];
|
|
56160
56164
|
if (!merges.every((merge) => {
|
|
56161
56165
|
const [widthCurrent, heightCurrent] = [merge.right - merge.left + 1, merge.bottom - merge.top + 1];
|
|
56162
56166
|
return widthCurrent === widthFirst && heightCurrent === heightFirst;
|
|
56163
|
-
})) return
|
|
56164
|
-
return
|
|
56167
|
+
})) return "InvalidSortZone";
|
|
56168
|
+
return "Success";
|
|
56165
56169
|
}
|
|
56166
56170
|
/**
|
|
56167
56171
|
* This function evaluates if the top row of a provided zone can be considered as a `header`
|
|
@@ -56179,9 +56183,9 @@ var SortPlugin = class extends UIPlugin {
|
|
|
56179
56183
|
col,
|
|
56180
56184
|
row
|
|
56181
56185
|
}).type));
|
|
56182
|
-
if (cells[0][0] ===
|
|
56183
|
-
if (cells.some((item) => item[0] ===
|
|
56184
|
-
else if (cells.some((item) => item[1] !==
|
|
56186
|
+
if (cells[0][0] === "empty") cells = cells.slice(1);
|
|
56187
|
+
if (cells.some((item) => item[0] === "empty")) return false;
|
|
56188
|
+
else if (cells.some((item) => item[1] !== "empty" && item[0] !== item[1])) return true;
|
|
56185
56189
|
else return false;
|
|
56186
56190
|
}
|
|
56187
56191
|
sortZone(sheetId, anchor, zone, sortDirection, options) {
|
|
@@ -56439,7 +56443,7 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
56439
56443
|
*/
|
|
56440
56444
|
isCellEmpty(position) {
|
|
56441
56445
|
const mainPosition = this.getters.getMainCellPosition(position);
|
|
56442
|
-
return this.getters.getEvaluatedCell(mainPosition).type ===
|
|
56446
|
+
return this.getters.getEvaluatedCell(mainPosition).type === "empty";
|
|
56443
56447
|
}
|
|
56444
56448
|
getColMaxWidth(sheetId, index) {
|
|
56445
56449
|
const sizes = positions(this.getters.getColsZone(sheetId, index, index)).map((position) => this.getCellWidth({
|
|
@@ -56453,8 +56457,8 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
56453
56457
|
* sheet.
|
|
56454
56458
|
*/
|
|
56455
56459
|
checkSheetExists(cmd) {
|
|
56456
|
-
if ("sheetId" in cmd && this.getters.tryGetSheet(cmd.sheetId) === void 0) return
|
|
56457
|
-
return
|
|
56460
|
+
if ("sheetId" in cmd && this.getters.tryGetSheet(cmd.sheetId) === void 0) return "InvalidSheetId";
|
|
56461
|
+
return "Success";
|
|
56458
56462
|
}
|
|
56459
56463
|
/**
|
|
56460
56464
|
* Check if zones in the command are well formed and
|
|
@@ -56462,11 +56466,11 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
56462
56466
|
*/
|
|
56463
56467
|
checkZonesAreInSheet(cmd) {
|
|
56464
56468
|
const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.tryGetActiveSheetId();
|
|
56465
|
-
if ("ranges" in cmd && cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) return
|
|
56469
|
+
if ("ranges" in cmd && cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) return "InvalidSheetId";
|
|
56466
56470
|
const zones = this.getters.getCommandZones(cmd);
|
|
56467
|
-
if (!sheetId && zones.length > 0) return
|
|
56471
|
+
if (!sheetId && zones.length > 0) return "NoActiveSheet";
|
|
56468
56472
|
if (sheetId && zones.length > 0) return this.getters.checkZonesExistInSheet(sheetId, zones);
|
|
56469
|
-
return
|
|
56473
|
+
return "Success";
|
|
56470
56474
|
}
|
|
56471
56475
|
autoResizeRows(sheetId, rows) {
|
|
56472
56476
|
const rowSizes = [];
|
|
@@ -56714,7 +56718,7 @@ var DataValidationInsertionPlugin = class extends UIPlugin {
|
|
|
56714
56718
|
...position,
|
|
56715
56719
|
content: "FALSE"
|
|
56716
56720
|
});
|
|
56717
|
-
else if (cell?.content && evaluatedCell.type ===
|
|
56721
|
+
else if (cell?.content && evaluatedCell.type === "empty") {
|
|
56718
56722
|
let value;
|
|
56719
56723
|
if (cell.content.startsWith("=")) {
|
|
56720
56724
|
const result = this.getters.evaluateFormula(position.sheetId, cell.content);
|
|
@@ -56724,7 +56728,7 @@ var DataValidationInsertionPlugin = class extends UIPlugin {
|
|
|
56724
56728
|
...position,
|
|
56725
56729
|
content: "FALSE"
|
|
56726
56730
|
});
|
|
56727
|
-
} else if (evaluatedCell.type !==
|
|
56731
|
+
} else if (evaluatedCell.type !== "boolean") this.dispatch("UPDATE_CELL", {
|
|
56728
56732
|
...position,
|
|
56729
56733
|
content: "FALSE"
|
|
56730
56734
|
});
|
|
@@ -56977,13 +56981,13 @@ var HistoryPlugin = class extends UIPlugin {
|
|
|
56977
56981
|
allowDispatch(cmd) {
|
|
56978
56982
|
switch (cmd.type) {
|
|
56979
56983
|
case "REQUEST_UNDO":
|
|
56980
|
-
if (!this.canUndo()) return
|
|
56984
|
+
if (!this.canUndo()) return "EmptyUndoStack";
|
|
56981
56985
|
break;
|
|
56982
56986
|
case "REQUEST_REDO":
|
|
56983
|
-
if (!this.canRedo()) return
|
|
56987
|
+
if (!this.canRedo()) return "EmptyRedoStack";
|
|
56984
56988
|
break;
|
|
56985
56989
|
}
|
|
56986
|
-
return
|
|
56990
|
+
return "Success";
|
|
56987
56991
|
}
|
|
56988
56992
|
handle(cmd) {
|
|
56989
56993
|
switch (cmd.type) {
|
|
@@ -57100,7 +57104,7 @@ var SplitToColumnsPlugin = class extends UIPlugin {
|
|
|
57100
57104
|
switch (cmd.type) {
|
|
57101
57105
|
case "SPLIT_TEXT_INTO_COLUMNS": return this.chainValidations(this.batchValidations(this.checkSingleColSelected, this.checkNonEmptySelector), this.batchValidations(this.checkNotOverwritingContent, this.checkSeparatorInSelection))(cmd);
|
|
57102
57106
|
}
|
|
57103
|
-
return
|
|
57107
|
+
return "Success";
|
|
57104
57108
|
}
|
|
57105
57109
|
handle(cmd) {
|
|
57106
57110
|
switch (cmd.type) {
|
|
@@ -57111,7 +57115,7 @@ var SplitToColumnsPlugin = class extends UIPlugin {
|
|
|
57111
57115
|
}
|
|
57112
57116
|
getAutomaticSeparator() {
|
|
57113
57117
|
const cells = this.getters.getSelectedCells();
|
|
57114
|
-
for (const cell of cells) if (cell.value && cell.type ===
|
|
57118
|
+
for (const cell of cells) if (cell.value && cell.type === "text") {
|
|
57115
57119
|
const separator = this.getAutoSeparatorForString(cell.value);
|
|
57116
57120
|
if (separator) return separator;
|
|
57117
57121
|
}
|
|
@@ -57247,24 +57251,24 @@ var SplitToColumnsPlugin = class extends UIPlugin {
|
|
|
57247
57251
|
});
|
|
57248
57252
|
}
|
|
57249
57253
|
checkSingleColSelected() {
|
|
57250
|
-
if (!this.getters.isSingleColSelected()) return
|
|
57251
|
-
return
|
|
57254
|
+
if (!this.getters.isSingleColSelected()) return "MoreThanOneColumnSelected";
|
|
57255
|
+
return "Success";
|
|
57252
57256
|
}
|
|
57253
57257
|
checkNonEmptySelector(cmd) {
|
|
57254
|
-
if (cmd.separator === "") return
|
|
57255
|
-
return
|
|
57258
|
+
if (cmd.separator === "") return "EmptySplitSeparator";
|
|
57259
|
+
return "Success";
|
|
57256
57260
|
}
|
|
57257
57261
|
checkNotOverwritingContent(cmd) {
|
|
57258
|
-
if (cmd.addNewColumns || cmd.force) return
|
|
57262
|
+
if (cmd.addNewColumns || cmd.force) return "Success";
|
|
57259
57263
|
const selection = this.getters.getSelectedZones()[0];
|
|
57260
57264
|
const splitted = this.getSplittedCols(selection, cmd.separator);
|
|
57261
|
-
if (this.willSplittedColsOverwriteContent(selection, splitted)) return
|
|
57262
|
-
return
|
|
57265
|
+
if (this.willSplittedColsOverwriteContent(selection, splitted)) return "SplitWillOverwriteContent";
|
|
57266
|
+
return "Success";
|
|
57263
57267
|
}
|
|
57264
57268
|
checkSeparatorInSelection({ separator }) {
|
|
57265
57269
|
const cells = this.getters.getSelectedCells();
|
|
57266
|
-
for (const cell of cells) if (cell.formattedValue.includes(separator)) return
|
|
57267
|
-
return
|
|
57270
|
+
for (const cell of cells) if (cell.formattedValue.includes(separator)) return "Success";
|
|
57271
|
+
return "NoSplitSeparatorInSelection";
|
|
57268
57272
|
}
|
|
57269
57273
|
};
|
|
57270
57274
|
|
|
@@ -57301,7 +57305,7 @@ var TableAutofillPlugin = class extends UIPlugin {
|
|
|
57301
57305
|
col,
|
|
57302
57306
|
row: r,
|
|
57303
57307
|
sheetId
|
|
57304
|
-
}).type !==
|
|
57308
|
+
}).type !== "empty") return;
|
|
57305
57309
|
}
|
|
57306
57310
|
const oldSelection = {
|
|
57307
57311
|
zone: this.getters.getSelectedZone(),
|
|
@@ -57330,13 +57334,13 @@ var TableResizeUI = class extends UIPlugin {
|
|
|
57330
57334
|
switch (cmd.type) {
|
|
57331
57335
|
case "RESIZE_TABLE":
|
|
57332
57336
|
const table = this.getters.getCoreTableMatchingTopLeft(cmd.sheetId, cmd.zone);
|
|
57333
|
-
if (!table) return
|
|
57337
|
+
if (!table) return "TableNotFound";
|
|
57334
57338
|
const oldTableZone = table.range.zone;
|
|
57335
57339
|
const newTableZone = this.getters.getRangeFromRangeData(cmd.newTableRange).zone;
|
|
57336
|
-
if (newTableZone.top !== oldTableZone.top || newTableZone.left !== oldTableZone.left) return
|
|
57340
|
+
if (newTableZone.top !== oldTableZone.top || newTableZone.left !== oldTableZone.left) return "InvalidTableResize";
|
|
57337
57341
|
return this.canDispatch("UPDATE_TABLE", { ...cmd }).reasons;
|
|
57338
57342
|
}
|
|
57339
|
-
return
|
|
57343
|
+
return "Success";
|
|
57340
57344
|
}
|
|
57341
57345
|
handle(cmd) {
|
|
57342
57346
|
switch (cmd.type) {
|
|
@@ -57401,7 +57405,7 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
57401
57405
|
});
|
|
57402
57406
|
}
|
|
57403
57407
|
case "PASTE": {
|
|
57404
|
-
if (!this.copiedData) return
|
|
57408
|
+
if (!this.copiedData) return "EmptyClipboard";
|
|
57405
57409
|
const pasteOption = cmd.pasteOption;
|
|
57406
57410
|
return this.isPasteAllowed(cmd.target, this.copiedData, {
|
|
57407
57411
|
pasteOption,
|
|
@@ -57410,12 +57414,12 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
57410
57414
|
}
|
|
57411
57415
|
case "COPY_PASTE_CELLS_ABOVE": {
|
|
57412
57416
|
const zones = this.getters.getSelectedZones();
|
|
57413
|
-
if (zones.length > 1 || zones[0].top === 0 && zones[0].bottom === 0) return
|
|
57417
|
+
if (zones.length > 1 || zones[0].top === 0 && zones[0].bottom === 0) return "InvalidCopyPasteSelection";
|
|
57414
57418
|
break;
|
|
57415
57419
|
}
|
|
57416
57420
|
case "COPY_PASTE_CELLS_ON_LEFT": {
|
|
57417
57421
|
const zones = this.getters.getSelectedZones();
|
|
57418
|
-
if (zones.length > 1 || zones[0].left === 0 && zones[0].right === 0) return
|
|
57422
|
+
if (zones.length > 1 || zones[0].left === 0 && zones[0].right === 0) return "InvalidCopyPasteSelection";
|
|
57419
57423
|
break;
|
|
57420
57424
|
}
|
|
57421
57425
|
case "INSERT_CELL": {
|
|
@@ -57429,7 +57433,7 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
57429
57433
|
return this.isPasteAllowed(paste, copiedData, { isCutOperation: true });
|
|
57430
57434
|
}
|
|
57431
57435
|
}
|
|
57432
|
-
return
|
|
57436
|
+
return "Success";
|
|
57433
57437
|
}
|
|
57434
57438
|
handle(cmd) {
|
|
57435
57439
|
switch (cmd.type) {
|
|
@@ -57587,16 +57591,16 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
57587
57591
|
const clipboardData = this.getClipboardData(zones);
|
|
57588
57592
|
for (const { handler } of this.selectClipboardHandlers(clipboardData)) {
|
|
57589
57593
|
const result = handler.isCutAllowed(clipboardData);
|
|
57590
|
-
if (result !==
|
|
57594
|
+
if (result !== "Success") return result;
|
|
57591
57595
|
}
|
|
57592
|
-
return
|
|
57596
|
+
return "Success";
|
|
57593
57597
|
}
|
|
57594
57598
|
isPasteAllowed(target, copiedData, options) {
|
|
57595
57599
|
for (const { handler } of this.selectClipboardHandlers(copiedData)) {
|
|
57596
57600
|
const result = handler.isPasteAllowed(this.getters.getActiveSheetId(), target, copiedData, { ...options });
|
|
57597
|
-
if (result !==
|
|
57601
|
+
if (result !== "Success") return result;
|
|
57598
57602
|
}
|
|
57599
|
-
return
|
|
57603
|
+
return "Success";
|
|
57600
57604
|
}
|
|
57601
57605
|
isColRowDirtyingClipboard(position, dimension) {
|
|
57602
57606
|
if (!this.copiedData || !this.copiedData.zones) return false;
|
|
@@ -57673,8 +57677,8 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
57673
57677
|
}
|
|
57674
57678
|
getClipboardContent() {
|
|
57675
57679
|
return {
|
|
57676
|
-
[
|
|
57677
|
-
[
|
|
57680
|
+
["text/plain"]: this.getPlainTextContent(),
|
|
57681
|
+
["text/html"]: this.getHTMLContent()
|
|
57678
57682
|
};
|
|
57679
57683
|
}
|
|
57680
57684
|
getSheetData() {
|
|
@@ -57807,10 +57811,10 @@ var FilterEvaluationPlugin = class extends UIPlugin {
|
|
|
57807
57811
|
allowDispatch(cmd) {
|
|
57808
57812
|
switch (cmd.type) {
|
|
57809
57813
|
case "UPDATE_FILTER":
|
|
57810
|
-
if (!this.getters.getFilterId(cmd)) return
|
|
57814
|
+
if (!this.getters.getFilterId(cmd)) return "FilterNotFound";
|
|
57811
57815
|
break;
|
|
57812
57816
|
}
|
|
57813
|
-
return
|
|
57817
|
+
return "Success";
|
|
57814
57818
|
}
|
|
57815
57819
|
handle(cmd) {
|
|
57816
57820
|
switch (cmd.type) {
|
|
@@ -58024,14 +58028,14 @@ var GridSelectionPlugin = class extends UIPlugin {
|
|
|
58024
58028
|
allowDispatch(cmd) {
|
|
58025
58029
|
switch (cmd.type) {
|
|
58026
58030
|
case "ACTIVATE_SHEET": try {
|
|
58027
|
-
if (!this.getters.getSheet(cmd.sheetIdTo).isVisible) return
|
|
58031
|
+
if (!this.getters.getSheet(cmd.sheetIdTo).isVisible) return "SheetIsHidden";
|
|
58028
58032
|
break;
|
|
58029
58033
|
} catch (error) {
|
|
58030
|
-
return
|
|
58034
|
+
return "InvalidSheetId";
|
|
58031
58035
|
}
|
|
58032
58036
|
case "MOVE_COLUMNS_ROWS": return this.isMoveElementAllowed(cmd);
|
|
58033
58037
|
}
|
|
58034
|
-
return
|
|
58038
|
+
return "Success";
|
|
58035
58039
|
}
|
|
58036
58040
|
handleEvent(event) {
|
|
58037
58041
|
const anchor = event.anchor;
|
|
@@ -58320,7 +58324,8 @@ var GridSelectionPlugin = class extends UIPlugin {
|
|
|
58320
58324
|
}, [zone]);
|
|
58321
58325
|
}
|
|
58322
58326
|
setActiveSheet(id) {
|
|
58323
|
-
|
|
58327
|
+
const sheet = this.getters.getSheet(id);
|
|
58328
|
+
this.activeSheet = sheet;
|
|
58324
58329
|
}
|
|
58325
58330
|
activateNextSheet(direction) {
|
|
58326
58331
|
const sheetIds = this.getters.getSheetIds();
|
|
@@ -58458,12 +58463,12 @@ var GridSelectionPlugin = class extends UIPlugin {
|
|
|
58458
58463
|
const end = cmd.elements[cmd.elements.length - 1];
|
|
58459
58464
|
const id = cmd.sheetId;
|
|
58460
58465
|
const doesElementsHaveCommonMerges = isCol ? this.getters.doesColumnsHaveCommonMerges : this.getters.doesRowsHaveCommonMerges;
|
|
58461
|
-
if (doesElementsHaveCommonMerges(id, start - 1, start) || doesElementsHaveCommonMerges(id, end, end + 1) || doesElementsHaveCommonMerges(id, cmd.base - 1, cmd.base)) return
|
|
58466
|
+
if (doesElementsHaveCommonMerges(id, start - 1, start) || doesElementsHaveCommonMerges(id, end, end + 1) || doesElementsHaveCommonMerges(id, cmd.base - 1, cmd.base)) return "WillRemoveExistingMerge";
|
|
58462
58467
|
const headers = [cmd.base, ...cmd.elements];
|
|
58463
58468
|
const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
|
|
58464
|
-
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) return
|
|
58465
|
-
if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) return
|
|
58466
|
-
return
|
|
58469
|
+
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) return "InvalidHeaderIndex";
|
|
58470
|
+
if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) return "CannotMoveTableHeader";
|
|
58471
|
+
return "Success";
|
|
58467
58472
|
}
|
|
58468
58473
|
isTableRowMoveAllowed(sheetId, selectedRows) {
|
|
58469
58474
|
const tables = this.getters.getCoreTables(sheetId);
|
|
@@ -58556,6 +58561,9 @@ var GridSelectionPlugin = class extends UIPlugin {
|
|
|
58556
58561
|
//#endregion
|
|
58557
58562
|
//#region src/helpers/internal_viewport.ts
|
|
58558
58563
|
var InternalViewport = class {
|
|
58564
|
+
getters;
|
|
58565
|
+
sheetId;
|
|
58566
|
+
boundaries;
|
|
58559
58567
|
top;
|
|
58560
58568
|
bottom;
|
|
58561
58569
|
left;
|
|
@@ -58893,7 +58901,7 @@ var SheetViewPlugin = class extends UIPlugin {
|
|
|
58893
58901
|
switch (cmd.type) {
|
|
58894
58902
|
case "SET_VIEWPORT_OFFSET": return this.chainValidations(this.checkScrollingDirection, this.checkIfViewportsWillChange)(cmd);
|
|
58895
58903
|
case "RESIZE_SHEETVIEW": return this.chainValidations(this.checkValuesAreDifferent, this.checkPositiveDimension)(cmd);
|
|
58896
|
-
default: return
|
|
58904
|
+
default: return "Success";
|
|
58897
58905
|
}
|
|
58898
58906
|
}
|
|
58899
58907
|
handleEvent(event) {
|
|
@@ -59301,23 +59309,23 @@ var SheetViewPlugin = class extends UIPlugin {
|
|
|
59301
59309
|
return Object.values(this.viewports[sheetId]).filter(isDefined);
|
|
59302
59310
|
}
|
|
59303
59311
|
checkPositiveDimension(cmd) {
|
|
59304
|
-
if (cmd.width < 0 || cmd.height < 0) return
|
|
59305
|
-
return
|
|
59312
|
+
if (cmd.width < 0 || cmd.height < 0) return "InvalidViewportSize";
|
|
59313
|
+
return "Success";
|
|
59306
59314
|
}
|
|
59307
59315
|
checkValuesAreDifferent(cmd) {
|
|
59308
59316
|
const { height, width } = this.getSheetViewDimension();
|
|
59309
|
-
if (cmd.gridOffsetX === this.gridOffsetX && cmd.gridOffsetY === this.gridOffsetY && cmd.width === width && cmd.height === height) return
|
|
59310
|
-
return
|
|
59317
|
+
if (cmd.gridOffsetX === this.gridOffsetX && cmd.gridOffsetY === this.gridOffsetY && cmd.width === width && cmd.height === height) return "ValuesNotChanged";
|
|
59318
|
+
return "Success";
|
|
59311
59319
|
}
|
|
59312
59320
|
checkScrollingDirection({ offsetX, offsetY }) {
|
|
59313
59321
|
const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
|
|
59314
|
-
if (!pane.canScrollHorizontally && offsetX > 0 || !pane.canScrollVertically && offsetY > 0) return
|
|
59315
|
-
return
|
|
59322
|
+
if (!pane.canScrollHorizontally && offsetX > 0 || !pane.canScrollVertically && offsetY > 0) return "InvalidScrollingDirection";
|
|
59323
|
+
return "Success";
|
|
59316
59324
|
}
|
|
59317
59325
|
checkIfViewportsWillChange({ offsetX, offsetY }) {
|
|
59318
59326
|
const sheetId = this.getters.getActiveSheetId();
|
|
59319
59327
|
const { maxOffsetX, maxOffsetY } = this.getMaximumSheetOffset();
|
|
59320
|
-
return this.getSubViewports(sheetId).some((viewport) => viewport.willNewOffsetScrollViewport(clip(offsetX, 0, maxOffsetX), clip(offsetY, 0, maxOffsetY))) ?
|
|
59328
|
+
return this.getSubViewports(sheetId).some((viewport) => viewport.willNewOffsetScrollViewport(clip(offsetX, 0, maxOffsetX), clip(offsetY, 0, maxOffsetY))) ? "Success" : "ViewportScrollLimitsReached";
|
|
59321
59329
|
}
|
|
59322
59330
|
getMainViewport(sheetId) {
|
|
59323
59331
|
const viewport = this.getMainInternalViewport(sheetId);
|
|
@@ -59902,9 +59910,9 @@ function interactiveRenameSheet(env, sheetId, name, errorCallback) {
|
|
|
59902
59910
|
sheetId,
|
|
59903
59911
|
name
|
|
59904
59912
|
});
|
|
59905
|
-
if (result.reasons.includes(
|
|
59906
|
-
else if (result.reasons.includes(
|
|
59907
|
-
else if (result.reasons.includes(
|
|
59913
|
+
if (result.reasons.includes("MissingSheetName")) env.raiseError(_t("The sheet name cannot be empty."), errorCallback);
|
|
59914
|
+
else if (result.reasons.includes("DuplicatedSheetName")) env.raiseError(_t("A sheet with the name %s already exists. Please select another name.", name), errorCallback);
|
|
59915
|
+
else if (result.reasons.includes("ForbiddenCharactersInSheetName")) env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).", FORBIDDEN_SHEETNAME_CHARS.join(" ")), errorCallback);
|
|
59908
59916
|
}
|
|
59909
59917
|
|
|
59910
59918
|
//#endregion
|
|
@@ -60116,41 +60124,41 @@ var BottomBarSheet = class extends Component {
|
|
|
60116
60124
|
const selectionStatisticFunctions = [
|
|
60117
60125
|
{
|
|
60118
60126
|
name: _t("Sum"),
|
|
60119
|
-
types: [
|
|
60127
|
+
types: ["number"],
|
|
60120
60128
|
compute: (values, locale) => sum([[values]], locale)
|
|
60121
60129
|
},
|
|
60122
60130
|
{
|
|
60123
60131
|
name: _t("Avg"),
|
|
60124
|
-
types: [
|
|
60132
|
+
types: ["number"],
|
|
60125
60133
|
compute: (values, locale) => average([[values]], locale)
|
|
60126
60134
|
},
|
|
60127
60135
|
{
|
|
60128
60136
|
name: _t("Min"),
|
|
60129
|
-
types: [
|
|
60137
|
+
types: ["number"],
|
|
60130
60138
|
compute: (values, locale) => min([[values]], locale).value
|
|
60131
60139
|
},
|
|
60132
60140
|
{
|
|
60133
60141
|
name: _t("Max"),
|
|
60134
|
-
types: [
|
|
60142
|
+
types: ["number"],
|
|
60135
60143
|
compute: (values, locale) => max([[values]], locale).value
|
|
60136
60144
|
},
|
|
60137
60145
|
{
|
|
60138
60146
|
name: _t("Count"),
|
|
60139
60147
|
types: [
|
|
60140
|
-
|
|
60141
|
-
|
|
60142
|
-
|
|
60143
|
-
|
|
60148
|
+
"number",
|
|
60149
|
+
"text",
|
|
60150
|
+
"boolean",
|
|
60151
|
+
"error"
|
|
60144
60152
|
],
|
|
60145
60153
|
compute: (values) => countAny([[values]])
|
|
60146
60154
|
},
|
|
60147
60155
|
{
|
|
60148
60156
|
name: _t("Count Numbers"),
|
|
60149
60157
|
types: [
|
|
60150
|
-
|
|
60151
|
-
|
|
60152
|
-
|
|
60153
|
-
|
|
60158
|
+
"number",
|
|
60159
|
+
"text",
|
|
60160
|
+
"boolean",
|
|
60161
|
+
"error"
|
|
60154
60162
|
],
|
|
60155
60163
|
compute: (values, locale) => countNumbers([[values]], locale)
|
|
60156
60164
|
}
|
|
@@ -60200,7 +60208,7 @@ var AggregateStatisticsStore = class extends SpreadsheetStore {
|
|
|
60200
60208
|
col,
|
|
60201
60209
|
row
|
|
60202
60210
|
});
|
|
60203
|
-
if (evaluatedCell.type !==
|
|
60211
|
+
if (evaluatedCell.type !== "empty") cells.push(evaluatedCell);
|
|
60204
60212
|
}
|
|
60205
60213
|
const locale = getters.getLocale();
|
|
60206
60214
|
const statisticFnResults = {};
|
|
@@ -60685,7 +60693,7 @@ var SpreadsheetDashboard = class extends Component {
|
|
|
60685
60693
|
css`
|
|
60686
60694
|
.o-header-group {
|
|
60687
60695
|
.o-header-group-header {
|
|
60688
|
-
z-index: ${
|
|
60696
|
+
z-index: ${6};
|
|
60689
60697
|
.o-group-fold-button {
|
|
60690
60698
|
cursor: pointer;
|
|
60691
60699
|
width: 13px;
|
|
@@ -61471,7 +61479,7 @@ var TopBarComposer = class extends Component {
|
|
|
61471
61479
|
});
|
|
61472
61480
|
return cssPropertiesToCss({
|
|
61473
61481
|
"border-color": SELECTION_BORDER_COLOR,
|
|
61474
|
-
"z-index": String(
|
|
61482
|
+
"z-index": String(30)
|
|
61475
61483
|
});
|
|
61476
61484
|
}
|
|
61477
61485
|
onFocus(selection) {
|
|
@@ -61707,7 +61715,7 @@ css`
|
|
|
61707
61715
|
overflow-y: auto;
|
|
61708
61716
|
overflow-x: hidden;
|
|
61709
61717
|
padding: 2px;
|
|
61710
|
-
z-index: ${
|
|
61718
|
+
z-index: ${21};
|
|
61711
61719
|
box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);
|
|
61712
61720
|
background-color: white;
|
|
61713
61721
|
|
|
@@ -61846,6 +61854,7 @@ function instantiateClipboard() {
|
|
|
61846
61854
|
return new WebClipboardWrapper(navigator.clipboard);
|
|
61847
61855
|
}
|
|
61848
61856
|
var WebClipboardWrapper = class {
|
|
61857
|
+
clipboard;
|
|
61849
61858
|
constructor(clipboard) {
|
|
61850
61859
|
this.clipboard = clipboard;
|
|
61851
61860
|
}
|
|
@@ -61860,12 +61869,12 @@ var WebClipboardWrapper = class {
|
|
|
61860
61869
|
*/
|
|
61861
61870
|
try {
|
|
61862
61871
|
await this.clipboard?.write([new ClipboardItem({
|
|
61863
|
-
[
|
|
61864
|
-
[
|
|
61872
|
+
["text/plain"]: this.getBlob(clipboardContent, "text/plain"),
|
|
61873
|
+
["text/html"]: this.getBlob(clipboardContent, "text/html")
|
|
61865
61874
|
})]);
|
|
61866
61875
|
} catch (e) {}
|
|
61867
61876
|
}
|
|
61868
|
-
else await this.writeText(clipboardContent[
|
|
61877
|
+
else await this.writeText(clipboardContent["text/plain"] ?? "");
|
|
61869
61878
|
}
|
|
61870
61879
|
async writeText(text) {
|
|
61871
61880
|
try {
|
|
@@ -61890,13 +61899,13 @@ var WebClipboardWrapper = class {
|
|
|
61890
61899
|
}
|
|
61891
61900
|
else return {
|
|
61892
61901
|
status: "ok",
|
|
61893
|
-
content: { [
|
|
61902
|
+
content: { ["text/plain"]: await this.clipboard?.readText() }
|
|
61894
61903
|
};
|
|
61895
61904
|
}
|
|
61896
61905
|
getClipboardItems(content) {
|
|
61897
61906
|
const clipboardItemData = {
|
|
61898
|
-
[
|
|
61899
|
-
[
|
|
61907
|
+
["text/plain"]: this.getBlob(content, "text/plain"),
|
|
61908
|
+
["text/html"]: this.getBlob(content, "text/html")
|
|
61900
61909
|
};
|
|
61901
61910
|
return [new ClipboardItem(clipboardItemData)];
|
|
61902
61911
|
}
|
|
@@ -62354,6 +62363,8 @@ function inverseCommand(cmd) {
|
|
|
62354
62363
|
* @param operations initial operations
|
|
62355
62364
|
*/
|
|
62356
62365
|
var Branch = class Branch {
|
|
62366
|
+
buildTransformation;
|
|
62367
|
+
operations;
|
|
62357
62368
|
constructor(buildTransformation, operations = []) {
|
|
62358
62369
|
this.buildTransformation = buildTransformation;
|
|
62359
62370
|
this.operations = operations;
|
|
@@ -62470,6 +62481,8 @@ var Branch = class Branch {
|
|
|
62470
62481
|
* to revert it).
|
|
62471
62482
|
*/
|
|
62472
62483
|
var Operation = class {
|
|
62484
|
+
id;
|
|
62485
|
+
data;
|
|
62473
62486
|
constructor(id, data) {
|
|
62474
62487
|
this.id = id;
|
|
62475
62488
|
this.data = data;
|
|
@@ -62479,6 +62492,8 @@ var Operation = class {
|
|
|
62479
62492
|
}
|
|
62480
62493
|
};
|
|
62481
62494
|
var LazyOperation = class LazyOperation {
|
|
62495
|
+
id;
|
|
62496
|
+
lazyData;
|
|
62482
62497
|
constructor(id, lazyData) {
|
|
62483
62498
|
this.id = id;
|
|
62484
62499
|
this.lazyData = lazyData;
|
|
@@ -62504,6 +62519,7 @@ var LazyOperation = class LazyOperation {
|
|
|
62504
62519
|
* ```
|
|
62505
62520
|
*/
|
|
62506
62521
|
var OperationSequence = class OperationSequence {
|
|
62522
|
+
operations;
|
|
62507
62523
|
constructor(operations) {
|
|
62508
62524
|
this.operations = operations;
|
|
62509
62525
|
}
|
|
@@ -62579,6 +62595,7 @@ var OperationSequence = class OperationSequence {
|
|
|
62579
62595
|
*
|
|
62580
62596
|
*/
|
|
62581
62597
|
var Tree = class {
|
|
62598
|
+
buildTransformation;
|
|
62582
62599
|
branches;
|
|
62583
62600
|
branchingOperationIds = /* @__PURE__ */ new Map();
|
|
62584
62601
|
constructor(buildTransformation, initialBranch) {
|
|
@@ -63161,6 +63178,7 @@ var EventStream = class {
|
|
|
63161
63178
|
* with the new selected anchor
|
|
63162
63179
|
*/
|
|
63163
63180
|
var SelectionStreamProcessorImpl = class {
|
|
63181
|
+
getters;
|
|
63164
63182
|
stream;
|
|
63165
63183
|
/**
|
|
63166
63184
|
* "Active" anchor used as a reference to compute new anchors
|
|
@@ -63259,7 +63277,7 @@ var SelectionStreamProcessorImpl = class {
|
|
|
63259
63277
|
* Set the selection to one of the cells adjacent to the current anchor cell.
|
|
63260
63278
|
*/
|
|
63261
63279
|
moveAnchorCell(direction, step = 1) {
|
|
63262
|
-
if (step !== "end" && step <= 0) return new DispatchResult(
|
|
63280
|
+
if (step !== "end" && step <= 0) return new DispatchResult("InvalidSelectionStep");
|
|
63263
63281
|
const { col, row } = this.getNextAvailablePosition(direction, step);
|
|
63264
63282
|
return this.selectCell(col, row);
|
|
63265
63283
|
}
|
|
@@ -63321,7 +63339,7 @@ var SelectionStreamProcessorImpl = class {
|
|
|
63321
63339
|
* of the anchor zone which moves.
|
|
63322
63340
|
*/
|
|
63323
63341
|
resizeAnchorZone(direction, step = 1) {
|
|
63324
|
-
if (step !== "end" && step <= 0) return new DispatchResult(
|
|
63342
|
+
if (step !== "end" && step <= 0) return new DispatchResult("InvalidSelectionStep");
|
|
63325
63343
|
const sheetId = this.getters.getActiveSheetId();
|
|
63326
63344
|
const anchor = this.anchor;
|
|
63327
63345
|
const { col: anchorCol, row: anchorRow } = anchor.cell;
|
|
@@ -63568,7 +63586,7 @@ var SelectionStreamProcessorImpl = class {
|
|
|
63568
63586
|
previousAnchor: deepCopy(this.anchor)
|
|
63569
63587
|
};
|
|
63570
63588
|
const commandResult = this.checkEventAnchorZone(event);
|
|
63571
|
-
if (commandResult !==
|
|
63589
|
+
if (commandResult !== "Success") return new DispatchResult(commandResult);
|
|
63572
63590
|
this.anchor = event.anchor;
|
|
63573
63591
|
this.stream.send(event);
|
|
63574
63592
|
return DispatchResult.Success;
|
|
@@ -63578,15 +63596,15 @@ var SelectionStreamProcessorImpl = class {
|
|
|
63578
63596
|
}
|
|
63579
63597
|
checkAnchorZone(anchor) {
|
|
63580
63598
|
const { cell, zone } = anchor;
|
|
63581
|
-
if (!isInside(cell.col, cell.row, zone)) return
|
|
63599
|
+
if (!isInside(cell.col, cell.row, zone)) return "InvalidAnchorZone";
|
|
63582
63600
|
const { left, right, top, bottom } = zone;
|
|
63583
63601
|
const sheetId = this.getters.getActiveSheetId();
|
|
63584
63602
|
const refCol = this.getters.findVisibleHeader(sheetId, "COL", left, right);
|
|
63585
|
-
if (this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) === void 0 || refCol === void 0) return
|
|
63586
|
-
return
|
|
63603
|
+
if (this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) === void 0 || refCol === void 0) return "SelectionOutOfBound";
|
|
63604
|
+
return "Success";
|
|
63587
63605
|
}
|
|
63588
63606
|
checkAnchorZoneOrThrow(anchor) {
|
|
63589
|
-
if (this.checkAnchorZone(anchor) ===
|
|
63607
|
+
if (this.checkAnchorZone(anchor) === "InvalidAnchorZone") throw new Error(_t("The provided anchor is invalid. The cell must be part of the zone."));
|
|
63590
63608
|
}
|
|
63591
63609
|
/**
|
|
63592
63610
|
* ---- PRIVATE ----
|
|
@@ -63743,7 +63761,7 @@ var SelectionStreamProcessorImpl = class {
|
|
|
63743
63761
|
isCellSkippableInCluster(position) {
|
|
63744
63762
|
const mainPosition = this.getters.getMainCellPosition(position);
|
|
63745
63763
|
const cell = this.getters.getEvaluatedCell(mainPosition);
|
|
63746
|
-
return cell.type ===
|
|
63764
|
+
return cell.type === "empty" || cell.type === "text" && cell.value === "";
|
|
63747
63765
|
}
|
|
63748
63766
|
};
|
|
63749
63767
|
|
|
@@ -65666,13 +65684,6 @@ function purgeSingleRowTables(data) {
|
|
|
65666
65684
|
|
|
65667
65685
|
//#endregion
|
|
65668
65686
|
//#region src/model.ts
|
|
65669
|
-
var Status = /* @__PURE__ */ function(Status) {
|
|
65670
|
-
Status[Status["Ready"] = 0] = "Ready";
|
|
65671
|
-
Status[Status["Running"] = 1] = "Running";
|
|
65672
|
-
Status[Status["RunningCore"] = 2] = "RunningCore";
|
|
65673
|
-
Status[Status["Finalizing"] = 3] = "Finalizing";
|
|
65674
|
-
return Status;
|
|
65675
|
-
}(Status || {});
|
|
65676
65687
|
var Model = class extends EventBus {
|
|
65677
65688
|
corePlugins = [];
|
|
65678
65689
|
featurePlugins = [];
|
|
@@ -65696,7 +65707,7 @@ var Model = class extends EventBus {
|
|
|
65696
65707
|
/**
|
|
65697
65708
|
* Internal status of the model. Important for command handling coordination
|
|
65698
65709
|
*/
|
|
65699
|
-
status =
|
|
65710
|
+
status = 0;
|
|
65700
65711
|
/**
|
|
65701
65712
|
* The config object contains some configuration flag and callbacks
|
|
65702
65713
|
*/
|
|
@@ -65833,7 +65844,7 @@ var Model = class extends EventBus {
|
|
|
65833
65844
|
onRemoteRevisionReceived({ commands }) {
|
|
65834
65845
|
for (const command of commands) {
|
|
65835
65846
|
const previousStatus = this.status;
|
|
65836
|
-
this.status =
|
|
65847
|
+
this.status = 2;
|
|
65837
65848
|
this.dispatchToHandlers(this.statefulUIPlugins, command);
|
|
65838
65849
|
this.status = previousStatus;
|
|
65839
65850
|
}
|
|
@@ -65931,7 +65942,7 @@ var Model = class extends EventBus {
|
|
|
65931
65942
|
*/
|
|
65932
65943
|
checkDispatchAllowed(command) {
|
|
65933
65944
|
const results = isCoreCommand(command) ? this.checkDispatchAllowedCoreCommand(command) : this.checkDispatchAllowedLocalCommand(command);
|
|
65934
|
-
if (results.some((r) => r !==
|
|
65945
|
+
if (results.some((r) => r !== "Success")) return new DispatchResult(results.flat());
|
|
65935
65946
|
return DispatchResult.Success;
|
|
65936
65947
|
}
|
|
65937
65948
|
checkDispatchAllowedCoreCommand(command) {
|
|
@@ -65943,9 +65954,9 @@ var Model = class extends EventBus {
|
|
|
65943
65954
|
return this.uiHandlers.map((handler) => handler.allowDispatch(command));
|
|
65944
65955
|
}
|
|
65945
65956
|
finalize() {
|
|
65946
|
-
this.status =
|
|
65957
|
+
this.status = 3;
|
|
65947
65958
|
for (const h of this.handlers) h.finalize();
|
|
65948
|
-
this.status =
|
|
65959
|
+
this.status = 0;
|
|
65949
65960
|
this.trigger("command-finalized");
|
|
65950
65961
|
}
|
|
65951
65962
|
/**
|
|
@@ -65972,16 +65983,16 @@ var Model = class extends EventBus {
|
|
|
65972
65983
|
dispatch = (type, payload) => {
|
|
65973
65984
|
const command = createCommand(type, payload);
|
|
65974
65985
|
const status = this.status;
|
|
65975
|
-
if (this.getters.isReadonly() && !canExecuteInReadonly(command)) return new DispatchResult(
|
|
65976
|
-
if (!this.session.canApplyOptimisticUpdate()) return new DispatchResult(
|
|
65986
|
+
if (this.getters.isReadonly() && !canExecuteInReadonly(command)) return new DispatchResult("Readonly");
|
|
65987
|
+
if (!this.session.canApplyOptimisticUpdate()) return new DispatchResult("WaitingSessionConfirmation");
|
|
65977
65988
|
switch (status) {
|
|
65978
|
-
case
|
|
65989
|
+
case 0:
|
|
65979
65990
|
const result = this.checkDispatchAllowed(command);
|
|
65980
65991
|
if (!result.isSuccessful) {
|
|
65981
65992
|
this.trigger("update");
|
|
65982
65993
|
return result;
|
|
65983
65994
|
}
|
|
65984
|
-
this.status =
|
|
65995
|
+
this.status = 1;
|
|
65985
65996
|
const { changes, commands } = this.state.recordChanges(() => {
|
|
65986
65997
|
const start = performance.now();
|
|
65987
65998
|
if (isCoreCommand(command)) this.state.addCommand(command);
|
|
@@ -65991,10 +66002,10 @@ var Model = class extends EventBus {
|
|
|
65991
66002
|
if (time > 5) console.debug(type, time, "ms");
|
|
65992
66003
|
});
|
|
65993
66004
|
this.session.save(command, commands, changes);
|
|
65994
|
-
this.status =
|
|
66005
|
+
this.status = 0;
|
|
65995
66006
|
this.trigger("update");
|
|
65996
66007
|
break;
|
|
65997
|
-
case
|
|
66008
|
+
case 1:
|
|
65998
66009
|
if (isCoreCommand(command)) {
|
|
65999
66010
|
const dispatchResult = this.checkDispatchAllowed(command);
|
|
66000
66011
|
if (!dispatchResult.isSuccessful) return dispatchResult;
|
|
@@ -66002,8 +66013,8 @@ var Model = class extends EventBus {
|
|
|
66002
66013
|
}
|
|
66003
66014
|
this.dispatchToHandlers(this.handlers, command);
|
|
66004
66015
|
break;
|
|
66005
|
-
case
|
|
66006
|
-
case
|
|
66016
|
+
case 3: throw new Error("Cannot dispatch commands in the finalize state");
|
|
66017
|
+
case 2:
|
|
66007
66018
|
if (isCoreCommand(command)) throw new Error(`A UI plugin cannot dispatch ${type} while handling a core command`);
|
|
66008
66019
|
this.dispatchToHandlers(this.handlers, command);
|
|
66009
66020
|
}
|
|
@@ -66016,7 +66027,7 @@ var Model = class extends EventBus {
|
|
|
66016
66027
|
dispatchFromCorePlugin = (type, payload) => {
|
|
66017
66028
|
const command = createCommand(type, payload);
|
|
66018
66029
|
const previousStatus = this.status;
|
|
66019
|
-
this.status =
|
|
66030
|
+
this.status = 2;
|
|
66020
66031
|
const handlers = this.isReplayingCommand ? this.coreHandlers : this.handlers;
|
|
66021
66032
|
this.dispatchToHandlers(handlers, command);
|
|
66022
66033
|
this.status = previousStatus;
|
|
@@ -66316,6 +66327,6 @@ const constants = {
|
|
|
66316
66327
|
//#endregion
|
|
66317
66328
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
66318
66329
|
|
|
66319
|
-
__info__.version = "18.0.
|
|
66320
|
-
__info__.date = "2026-05-
|
|
66321
|
-
__info__.hash = "
|
|
66330
|
+
__info__.version = "18.0.69";
|
|
66331
|
+
__info__.date = "2026-05-27T05:57:08.710Z";
|
|
66332
|
+
__info__.hash = "50b85ba";
|