@odoo/o-spreadsheet 17.1.1 → 17.1.3
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 +154 -115
- package/dist/o-spreadsheet.d.ts +18 -6
- package/dist/o-spreadsheet.esm.js +154 -115
- package/dist/o-spreadsheet.iife.js +154 -115
- package/dist/o-spreadsheet.iife.min.js +258 -265
- package/dist/o_spreadsheet.xml +5 -5
- package/package.json +1 -1
|
@@ -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 17.1.
|
|
6
|
-
* @date 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.1.3
|
|
6
|
+
* @date 2024-02-02T13:46:54.332Z
|
|
7
|
+
* @hash 798f979
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -2061,6 +2061,7 @@
|
|
|
2061
2061
|
CommandResult["BlockingValidationRule"] = "BlockingValidationRule";
|
|
2062
2062
|
CommandResult["InvalidCopyPasteSelection"] = "InvalidCopyPasteSelection";
|
|
2063
2063
|
CommandResult["NoChanges"] = "NoChanges";
|
|
2064
|
+
CommandResult["InvalidInputId"] = "InvalidInputId";
|
|
2064
2065
|
})(exports.CommandResult || (exports.CommandResult = {}));
|
|
2065
2066
|
|
|
2066
2067
|
const PLAIN_TEXT_FORMAT = "@"; // see OpenXML spec §18.8.31
|
|
@@ -2122,34 +2123,34 @@
|
|
|
2122
2123
|
const errorTypes = new Set(Object.values(CellErrorType));
|
|
2123
2124
|
class EvaluationError extends Error {
|
|
2124
2125
|
value;
|
|
2125
|
-
constructor(message, value = CellErrorType.GenericError) {
|
|
2126
|
-
super(message
|
|
2126
|
+
constructor(message = _t("Error"), value = CellErrorType.GenericError) {
|
|
2127
|
+
super(message);
|
|
2127
2128
|
this.value = value;
|
|
2128
2129
|
}
|
|
2129
2130
|
}
|
|
2130
2131
|
class BadExpressionError extends EvaluationError {
|
|
2131
|
-
constructor(message) {
|
|
2132
|
-
super(message
|
|
2132
|
+
constructor(message = _t("Invalid expression")) {
|
|
2133
|
+
super(message, CellErrorType.BadExpression);
|
|
2133
2134
|
}
|
|
2134
2135
|
}
|
|
2135
2136
|
class CircularDependencyError extends EvaluationError {
|
|
2136
|
-
constructor(message) {
|
|
2137
|
-
super(message
|
|
2137
|
+
constructor(message = _t("Circular reference")) {
|
|
2138
|
+
super(message, CellErrorType.CircularDependency);
|
|
2138
2139
|
}
|
|
2139
2140
|
}
|
|
2140
2141
|
class InvalidReferenceError extends EvaluationError {
|
|
2141
|
-
constructor(message) {
|
|
2142
|
-
super(message
|
|
2142
|
+
constructor(message = _t("Invalid reference")) {
|
|
2143
|
+
super(message, CellErrorType.InvalidReference);
|
|
2143
2144
|
}
|
|
2144
2145
|
}
|
|
2145
2146
|
class NotAvailableError extends EvaluationError {
|
|
2146
|
-
constructor(message) {
|
|
2147
|
-
super(message
|
|
2147
|
+
constructor(message = _t("Data not available")) {
|
|
2148
|
+
super(message, CellErrorType.NotAvailable);
|
|
2148
2149
|
}
|
|
2149
2150
|
}
|
|
2150
2151
|
class UnknownFunctionError extends EvaluationError {
|
|
2151
|
-
constructor(message) {
|
|
2152
|
-
super(message
|
|
2152
|
+
constructor(message = _t("Unknown function")) {
|
|
2153
|
+
super(message, CellErrorType.UnknownFunction);
|
|
2153
2154
|
}
|
|
2154
2155
|
}
|
|
2155
2156
|
|
|
@@ -3315,27 +3316,30 @@
|
|
|
3315
3316
|
}
|
|
3316
3317
|
function createLargeNumberFormat(format, magnitude, postFix, locale) {
|
|
3317
3318
|
const internalFormat = parseFormat(format || "#,##0");
|
|
3318
|
-
const largeNumberFormat =
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
format: {
|
|
3325
|
-
...formatPart.format,
|
|
3326
|
-
magnitude,
|
|
3327
|
-
decimalPart: undefined,
|
|
3328
|
-
},
|
|
3329
|
-
},
|
|
3330
|
-
{
|
|
3331
|
-
type: "STRING",
|
|
3332
|
-
format: postFix,
|
|
3333
|
-
},
|
|
3334
|
-
];
|
|
3319
|
+
const largeNumberFormat = [];
|
|
3320
|
+
for (let i = 0; i < internalFormat.length; i++) {
|
|
3321
|
+
const formatPart = internalFormat[i];
|
|
3322
|
+
if (formatPart.type !== "NUMBER") {
|
|
3323
|
+
largeNumberFormat.push(formatPart);
|
|
3324
|
+
continue;
|
|
3335
3325
|
}
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3326
|
+
largeNumberFormat.push({
|
|
3327
|
+
...formatPart,
|
|
3328
|
+
format: {
|
|
3329
|
+
...formatPart.format,
|
|
3330
|
+
magnitude,
|
|
3331
|
+
decimalPart: undefined,
|
|
3332
|
+
},
|
|
3333
|
+
});
|
|
3334
|
+
largeNumberFormat.push({
|
|
3335
|
+
type: "STRING",
|
|
3336
|
+
format: postFix,
|
|
3337
|
+
});
|
|
3338
|
+
const nextFormatPart = internalFormat[i + 1];
|
|
3339
|
+
if (nextFormatPart?.type === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
|
|
3340
|
+
i++;
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3339
3343
|
return convertInternalFormatToFormat(largeNumberFormat);
|
|
3340
3344
|
}
|
|
3341
3345
|
function changeDecimalPlaces(format, step, locale) {
|
|
@@ -5044,8 +5048,10 @@
|
|
|
5044
5048
|
}
|
|
5045
5049
|
const dataRange = ds.dataRange.clone({ zone: dataZone });
|
|
5046
5050
|
return {
|
|
5047
|
-
label: ds.labelCell
|
|
5048
|
-
|
|
5051
|
+
label: ds.labelCell
|
|
5052
|
+
? getters.getRangeString(ds.labelCell, "forceSheetReference", { useFixedReference: true })
|
|
5053
|
+
: undefined,
|
|
5054
|
+
range: getters.getRangeString(dataRange, "forceSheetReference", { useFixedReference: true }),
|
|
5049
5055
|
};
|
|
5050
5056
|
}
|
|
5051
5057
|
function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
|
|
@@ -5058,7 +5064,7 @@
|
|
|
5058
5064
|
zone.top = zone.top + 1;
|
|
5059
5065
|
}
|
|
5060
5066
|
const range = labelRange.clone({ zone });
|
|
5061
|
-
return getters.getRangeString(range, "forceSheetReference");
|
|
5067
|
+
return getters.getRangeString(range, "forceSheetReference", { useFixedReference: true });
|
|
5062
5068
|
}
|
|
5063
5069
|
/**
|
|
5064
5070
|
* Transform a chart definition which supports dataSets (dataSets and LabelRange)
|
|
@@ -6693,6 +6699,7 @@
|
|
|
6693
6699
|
};
|
|
6694
6700
|
|
|
6695
6701
|
const macRegex = /Mac/i;
|
|
6702
|
+
const MODIFIER_KEYS = ["Shift", "Control", "Alt", "Meta"];
|
|
6696
6703
|
/**
|
|
6697
6704
|
* Return true if the event was triggered from
|
|
6698
6705
|
* a child element.
|
|
@@ -6744,14 +6751,14 @@
|
|
|
6744
6751
|
*/
|
|
6745
6752
|
function keyboardEventToShortcutString(ev, mode = "key") {
|
|
6746
6753
|
let keyDownString = "";
|
|
6747
|
-
if (
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6754
|
+
if (!MODIFIER_KEYS.includes(ev.key)) {
|
|
6755
|
+
if (isCtrlKey(ev))
|
|
6756
|
+
keyDownString += "Ctrl+";
|
|
6757
|
+
if (ev.altKey)
|
|
6758
|
+
keyDownString += "Alt+";
|
|
6759
|
+
if (ev.shiftKey)
|
|
6760
|
+
keyDownString += "Shift+";
|
|
6761
|
+
}
|
|
6755
6762
|
const key = mode === "key" ? ev.key : ev.code;
|
|
6756
6763
|
keyDownString += letterRegex.test(key) ? key.toUpperCase() : key;
|
|
6757
6764
|
return keyDownString;
|
|
@@ -20203,19 +20210,20 @@
|
|
|
20203
20210
|
const formatNumberCurrency = createFormatActionSpec({
|
|
20204
20211
|
name: _t("Currency"),
|
|
20205
20212
|
descriptionValue: 1000.12,
|
|
20206
|
-
format: (env) => env.model.config.defaultCurrencyFormat,
|
|
20213
|
+
format: (env) => env.model.config.defaultCurrencyFormat ?? DEFAULT_CURRENCY_FORMAT,
|
|
20207
20214
|
});
|
|
20208
20215
|
const formatNumberCurrencyRounded = {
|
|
20209
20216
|
...createFormatActionSpec({
|
|
20210
20217
|
name: _t("Currency rounded"),
|
|
20211
20218
|
descriptionValue: 1000,
|
|
20212
|
-
format: (env) => roundFormat(env.model.config.defaultCurrencyFormat),
|
|
20219
|
+
format: (env) => roundFormat(env.model.config.defaultCurrencyFormat ?? DEFAULT_CURRENCY_FORMAT),
|
|
20213
20220
|
}),
|
|
20214
20221
|
isVisible: (env) => {
|
|
20215
20222
|
const currencyFormat = env.model.config.defaultCurrencyFormat;
|
|
20216
|
-
return currencyFormat !== roundFormat(currencyFormat);
|
|
20223
|
+
return currencyFormat !== roundFormat(currencyFormat ?? DEFAULT_CURRENCY_FORMAT);
|
|
20217
20224
|
},
|
|
20218
20225
|
};
|
|
20226
|
+
const DEFAULT_CURRENCY_FORMAT = "[$$]#,##0.00";
|
|
20219
20227
|
const EXAMPLE_DATE = parseLiteral("2023/09/26 10:43:00 PM", DEFAULT_LOCALE);
|
|
20220
20228
|
const formatCustomCurrency = {
|
|
20221
20229
|
name: _t("Custom currency"),
|
|
@@ -27287,6 +27295,9 @@
|
|
|
27287
27295
|
const token = tokens.filter((token) => token.value.includes(currentSelectedText) &&
|
|
27288
27296
|
token.start <= currentSelection.start &&
|
|
27289
27297
|
token.end >= currentSelection.end)[0];
|
|
27298
|
+
if (!token) {
|
|
27299
|
+
return;
|
|
27300
|
+
}
|
|
27290
27301
|
if (token.type === "REFERENCE") {
|
|
27291
27302
|
this.env.model.dispatch("CHANGE_COMPOSER_CURSOR_SELECTION", {
|
|
27292
27303
|
start: token.start,
|
|
@@ -36022,6 +36033,9 @@
|
|
|
36022
36033
|
format: cell.format ? getItemId(cell.format, formats) : undefined,
|
|
36023
36034
|
content: cell.content || undefined,
|
|
36024
36035
|
};
|
|
36036
|
+
if (cell instanceof FormulaCellWithDependencies) {
|
|
36037
|
+
cells[xc].content = cell.contentWithFixedReferences || undefined;
|
|
36038
|
+
}
|
|
36025
36039
|
}
|
|
36026
36040
|
_sheet.cells = cells;
|
|
36027
36041
|
}
|
|
@@ -36065,12 +36079,12 @@
|
|
|
36065
36079
|
/*
|
|
36066
36080
|
* Reconstructs the original formula string based on a normalized form and its dependencies
|
|
36067
36081
|
*/
|
|
36068
|
-
getFormulaCellContent(sheetId, compiledFormula, dependencies) {
|
|
36082
|
+
getFormulaCellContent(sheetId, compiledFormula, dependencies, useFixedReference = false) {
|
|
36069
36083
|
let rangeIndex = 0;
|
|
36070
36084
|
return concat(compiledFormula.tokens.map((token) => {
|
|
36071
36085
|
if (token.type === "REFERENCE") {
|
|
36072
36086
|
const range = dependencies[rangeIndex++];
|
|
36073
|
-
return this.getters.getRangeString(range, sheetId);
|
|
36087
|
+
return this.getters.getRangeString(range, sheetId, { useFixedReference });
|
|
36074
36088
|
}
|
|
36075
36089
|
return token.value;
|
|
36076
36090
|
}));
|
|
@@ -36341,6 +36355,18 @@
|
|
|
36341
36355
|
get content() {
|
|
36342
36356
|
return concat(this.compiledFormula.tokens.map((token) => token.value));
|
|
36343
36357
|
}
|
|
36358
|
+
get contentWithFixedReferences() {
|
|
36359
|
+
let rangeIndex = 0;
|
|
36360
|
+
return concat(this.compiledFormula.tokens.map((token) => {
|
|
36361
|
+
if (token.type === "REFERENCE") {
|
|
36362
|
+
const index = rangeIndex++;
|
|
36363
|
+
return this.getRangeString(this.compiledFormula.dependencies[index], this.sheetId, {
|
|
36364
|
+
useFixedReference: true,
|
|
36365
|
+
});
|
|
36366
|
+
}
|
|
36367
|
+
return token.value;
|
|
36368
|
+
}));
|
|
36369
|
+
}
|
|
36344
36370
|
}
|
|
36345
36371
|
class RangeReferenceToken {
|
|
36346
36372
|
getValue;
|
|
@@ -36645,7 +36671,13 @@
|
|
|
36645
36671
|
}
|
|
36646
36672
|
}
|
|
36647
36673
|
exportForExcel(data) {
|
|
36648
|
-
|
|
36674
|
+
if (data.sheets) {
|
|
36675
|
+
for (let sheet of data.sheets) {
|
|
36676
|
+
if (this.cfRules[sheet.id]) {
|
|
36677
|
+
sheet.conditionalFormats = this.cfRules[sheet.id].map((rule) => this.mapToConditionalFormat(sheet.id, rule, { useFixedReference: true }));
|
|
36678
|
+
}
|
|
36679
|
+
}
|
|
36680
|
+
}
|
|
36649
36681
|
}
|
|
36650
36682
|
// ---------------------------------------------------------------------------
|
|
36651
36683
|
// Getters
|
|
@@ -36710,11 +36742,11 @@
|
|
|
36710
36742
|
// ---------------------------------------------------------------------------
|
|
36711
36743
|
// Private
|
|
36712
36744
|
// ---------------------------------------------------------------------------
|
|
36713
|
-
mapToConditionalFormat(sheetId, cf) {
|
|
36745
|
+
mapToConditionalFormat(sheetId, cf, { useFixedReference } = { useFixedReference: false }) {
|
|
36714
36746
|
return {
|
|
36715
36747
|
...cf,
|
|
36716
36748
|
ranges: cf.ranges.map((range) => {
|
|
36717
|
-
return this.getters.getRangeString(range, sheetId);
|
|
36749
|
+
return this.getters.getRangeString(range, sheetId, { useFixedReference });
|
|
36718
36750
|
}),
|
|
36719
36751
|
};
|
|
36720
36752
|
}
|
|
@@ -38782,8 +38814,10 @@
|
|
|
38782
38814
|
*
|
|
38783
38815
|
* @param range the range (received from getRangeFromXC or getRangeFromZone)
|
|
38784
38816
|
* @param forSheetId the id of the sheet where the range string is supposed to be used.
|
|
38817
|
+
* @param options
|
|
38818
|
+
* @param options.useFixedReference if true, the range will be returned with fixed row and column
|
|
38785
38819
|
*/
|
|
38786
|
-
getRangeString(range, forSheetId) {
|
|
38820
|
+
getRangeString(range, forSheetId, options = { useFixedReference: false }) {
|
|
38787
38821
|
if (!range) {
|
|
38788
38822
|
return CellErrorType.InvalidReference;
|
|
38789
38823
|
}
|
|
@@ -38810,7 +38844,7 @@
|
|
|
38810
38844
|
if (prefixSheet && !sheetName) {
|
|
38811
38845
|
return CellErrorType.InvalidReference;
|
|
38812
38846
|
}
|
|
38813
|
-
let rangeString = this.getRangePartString(rangeImpl, 0);
|
|
38847
|
+
let rangeString = this.getRangePartString(rangeImpl, 0, options);
|
|
38814
38848
|
if (rangeImpl.parts && rangeImpl.parts.length === 2) {
|
|
38815
38849
|
// this if converts A2:A2 into A2 except if any part of the original range had fixed row or column (with $)
|
|
38816
38850
|
if (rangeImpl.zone.top !== rangeImpl.zone.bottom ||
|
|
@@ -38820,7 +38854,7 @@
|
|
|
38820
38854
|
rangeImpl.parts[1].rowFixed ||
|
|
38821
38855
|
rangeImpl.parts[1].colFixed) {
|
|
38822
38856
|
rangeString += ":";
|
|
38823
|
-
rangeString += this.getRangePartString(rangeImpl, 1);
|
|
38857
|
+
rangeString += this.getRangePartString(rangeImpl, 1, options);
|
|
38824
38858
|
}
|
|
38825
38859
|
}
|
|
38826
38860
|
return `${prefixSheet ? sheetName + "!" : ""}${rangeString}`;
|
|
@@ -38861,13 +38895,13 @@
|
|
|
38861
38895
|
/**
|
|
38862
38896
|
* Get a Xc string that represent a part of a range
|
|
38863
38897
|
*/
|
|
38864
|
-
getRangePartString(range, part) {
|
|
38898
|
+
getRangePartString(range, part, options = { useFixedReference: false }) {
|
|
38865
38899
|
const colFixed = range.parts && range.parts[part]?.colFixed ? "$" : "";
|
|
38866
38900
|
const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
|
|
38867
38901
|
const rowFixed = range.parts && range.parts[part]?.rowFixed ? "$" : "";
|
|
38868
38902
|
const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
|
|
38869
38903
|
let str = "";
|
|
38870
|
-
if (range.isFullCol) {
|
|
38904
|
+
if (range.isFullCol && !options.useFixedReference) {
|
|
38871
38905
|
if (part === 0 && range.unboundedZone.hasHeader) {
|
|
38872
38906
|
str = colFixed + col + rowFixed + row;
|
|
38873
38907
|
}
|
|
@@ -38875,7 +38909,7 @@
|
|
|
38875
38909
|
str = colFixed + col;
|
|
38876
38910
|
}
|
|
38877
38911
|
}
|
|
38878
|
-
else if (range.isFullRow) {
|
|
38912
|
+
else if (range.isFullRow && !options.useFixedReference) {
|
|
38879
38913
|
if (part === 0 && range.unboundedZone.hasHeader) {
|
|
38880
38914
|
str = colFixed + col + rowFixed + row;
|
|
38881
38915
|
}
|
|
@@ -40296,23 +40330,18 @@
|
|
|
40296
40330
|
* The `compute` of the formula's function must process it completely
|
|
40297
40331
|
*/
|
|
40298
40332
|
refFn(range, isMeta, functionName, paramNumber) {
|
|
40333
|
+
this.assertRangeValid(range);
|
|
40299
40334
|
if (isMeta) {
|
|
40300
40335
|
// Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
|
|
40301
40336
|
const sheetName = this.getters.getSheetName(range.sheetId);
|
|
40302
40337
|
return { value: getFullReference(sheetName, zoneToXc(range.zone)) };
|
|
40303
40338
|
}
|
|
40304
|
-
if (!isZoneValid(range.zone)) {
|
|
40305
|
-
throw new InvalidReferenceError();
|
|
40306
|
-
}
|
|
40307
40339
|
// if the formula definition could have accepted a range, we would pass through the _range function and not here
|
|
40308
40340
|
if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
|
|
40309
40341
|
throw new EvaluationError(paramNumber
|
|
40310
40342
|
? _t("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
|
|
40311
40343
|
: _t("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
|
|
40312
40344
|
}
|
|
40313
|
-
if (range.invalidSheetName) {
|
|
40314
|
-
throw new EvaluationError(_t("Invalid sheet name: %s", range.invalidSheetName));
|
|
40315
|
-
}
|
|
40316
40345
|
const position = { sheetId: range.sheetId, col: range.zone.left, row: range.zone.top };
|
|
40317
40346
|
return this.readCell(position);
|
|
40318
40347
|
}
|
|
@@ -40344,10 +40373,10 @@
|
|
|
40344
40373
|
* Note that each col is possibly sparse: it only contain the values of cells
|
|
40345
40374
|
* that are actually present in the grid.
|
|
40346
40375
|
*/
|
|
40347
|
-
range(
|
|
40348
|
-
|
|
40349
|
-
|
|
40350
|
-
|
|
40376
|
+
range(range) {
|
|
40377
|
+
this.assertRangeValid(range);
|
|
40378
|
+
const sheetId = range.sheetId;
|
|
40379
|
+
const zone = range.zone;
|
|
40351
40380
|
// Performance issue: Avoid fetching data on positions that are out of the spreadsheet
|
|
40352
40381
|
// e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
|
|
40353
40382
|
const sheetZone = this.getters.getSheetZone(sheetId);
|
|
@@ -40375,6 +40404,14 @@
|
|
|
40375
40404
|
this.rangeCache[cacheKey] = matrix;
|
|
40376
40405
|
return matrix;
|
|
40377
40406
|
}
|
|
40407
|
+
assertRangeValid(range) {
|
|
40408
|
+
if (!isZoneValid(range.zone)) {
|
|
40409
|
+
throw new InvalidReferenceError();
|
|
40410
|
+
}
|
|
40411
|
+
if (range.invalidSheetName) {
|
|
40412
|
+
throw new EvaluationError(_t("Invalid sheet name: %s", range.invalidSheetName));
|
|
40413
|
+
}
|
|
40414
|
+
}
|
|
40378
40415
|
}
|
|
40379
40416
|
|
|
40380
40417
|
function quickselect(arr, k, left, right, compare) {
|
|
@@ -45367,12 +45404,8 @@
|
|
|
45367
45404
|
case "ADD_COLUMNS_ROWS":
|
|
45368
45405
|
case "EVALUATE_CELLS":
|
|
45369
45406
|
case "UPDATE_CELL":
|
|
45370
|
-
this.isSearchDirty = true;
|
|
45371
|
-
break;
|
|
45372
45407
|
case "ACTIVATE_SHEET":
|
|
45373
|
-
|
|
45374
|
-
this.isSearchDirty = true;
|
|
45375
|
-
}
|
|
45408
|
+
this.isSearchDirty = true;
|
|
45376
45409
|
break;
|
|
45377
45410
|
}
|
|
45378
45411
|
}
|
|
@@ -46536,27 +46569,6 @@
|
|
|
46536
46569
|
// ---------------------------------------------------------------------------
|
|
46537
46570
|
// Command Handling
|
|
46538
46571
|
// ---------------------------------------------------------------------------
|
|
46539
|
-
allowDispatch(cmd) {
|
|
46540
|
-
switch (cmd.type) {
|
|
46541
|
-
case "ADD_RANGE":
|
|
46542
|
-
case "ADD_EMPTY_RANGE":
|
|
46543
|
-
if (this.inputHasSingleRange && this.ranges.length === 1) {
|
|
46544
|
-
return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
|
|
46545
|
-
}
|
|
46546
|
-
break;
|
|
46547
|
-
case "REMOVE_RANGE":
|
|
46548
|
-
if (this.ranges.length === 1) {
|
|
46549
|
-
return "MinimumRangesReached" /* CommandResult.MinimumRangesReached */;
|
|
46550
|
-
}
|
|
46551
|
-
break;
|
|
46552
|
-
case "CHANGE_RANGE":
|
|
46553
|
-
if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
46554
|
-
return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
|
|
46555
|
-
}
|
|
46556
|
-
break;
|
|
46557
|
-
}
|
|
46558
|
-
return "Success" /* CommandResult.Success */;
|
|
46559
|
-
}
|
|
46560
46572
|
handleEvent(event) {
|
|
46561
46573
|
if (this.focusedRangeIndex === null) {
|
|
46562
46574
|
return;
|
|
@@ -46794,6 +46806,15 @@
|
|
|
46794
46806
|
// Command Handling
|
|
46795
46807
|
// ---------------------------------------------------------------------------
|
|
46796
46808
|
allowDispatch(cmd) {
|
|
46809
|
+
switch (cmd.type) {
|
|
46810
|
+
case "FOCUS_RANGE":
|
|
46811
|
+
case "CHANGE_RANGE":
|
|
46812
|
+
case "ADD_EMPTY_RANGE":
|
|
46813
|
+
case "REMOVE_RANGE":
|
|
46814
|
+
if (!this.inputs[cmd.id]) {
|
|
46815
|
+
return "InvalidInputId" /* CommandResult.InvalidInputId */;
|
|
46816
|
+
}
|
|
46817
|
+
}
|
|
46797
46818
|
switch (cmd.type) {
|
|
46798
46819
|
case "FOCUS_RANGE":
|
|
46799
46820
|
const index = this.currentInput?.getIndex(cmd.rangeId);
|
|
@@ -46801,9 +46822,25 @@
|
|
|
46801
46822
|
return "InputAlreadyFocused" /* CommandResult.InputAlreadyFocused */;
|
|
46802
46823
|
}
|
|
46803
46824
|
break;
|
|
46804
|
-
|
|
46805
|
-
|
|
46806
|
-
|
|
46825
|
+
case "ADD_RANGE":
|
|
46826
|
+
case "ADD_EMPTY_RANGE":
|
|
46827
|
+
const input = this.inputs[cmd.id];
|
|
46828
|
+
if (input.inputHasSingleRange && input.ranges.length === 1) {
|
|
46829
|
+
return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
|
|
46830
|
+
}
|
|
46831
|
+
break;
|
|
46832
|
+
case "REMOVE_RANGE":
|
|
46833
|
+
if (this.inputs[cmd.id].ranges.length === 1) {
|
|
46834
|
+
return "MinimumRangesReached" /* CommandResult.MinimumRangesReached */;
|
|
46835
|
+
}
|
|
46836
|
+
break;
|
|
46837
|
+
case "CHANGE_RANGE": {
|
|
46838
|
+
const input = this.inputs[cmd.id];
|
|
46839
|
+
if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
|
|
46840
|
+
return "MaximumRangesReached" /* CommandResult.MaximumRangesReached */;
|
|
46841
|
+
}
|
|
46842
|
+
break;
|
|
46843
|
+
}
|
|
46807
46844
|
}
|
|
46808
46845
|
return "Success" /* CommandResult.Success */;
|
|
46809
46846
|
}
|
|
@@ -48933,9 +48970,10 @@
|
|
|
48933
48970
|
*/
|
|
48934
48971
|
getReferencedRanges() {
|
|
48935
48972
|
const editionSheetId = this.getters.getCurrentEditedCell().sheetId;
|
|
48936
|
-
|
|
48973
|
+
const referenceRanges = this.currentTokens
|
|
48937
48974
|
.filter((token) => token.type === "REFERENCE")
|
|
48938
48975
|
.map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
|
|
48976
|
+
return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
|
|
48939
48977
|
}
|
|
48940
48978
|
getAutoCompleteDataValidationValues() {
|
|
48941
48979
|
if (this.mode === "inactive") {
|
|
@@ -55223,12 +55261,7 @@
|
|
|
55223
55261
|
attrs.push(["t", "str"]);
|
|
55224
55262
|
cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
|
|
55225
55263
|
}
|
|
55226
|
-
node = escapeXml /*xml*/
|
|
55227
|
-
<f>
|
|
55228
|
-
${XlsxFormula}
|
|
55229
|
-
</f>
|
|
55230
|
-
${cycle}
|
|
55231
|
-
`;
|
|
55264
|
+
node = escapeXml /*xml*/ `<f>${XlsxFormula}</f>${cycle}`;
|
|
55232
55265
|
return { attrs, node };
|
|
55233
55266
|
}
|
|
55234
55267
|
function addContent(content, sharedStrings, forceString = false) {
|
|
@@ -56048,11 +56081,10 @@
|
|
|
56048
56081
|
({ attrs: additionalAttrs, node: cellNode } = addContent(cell.content, construct.sharedStrings, isTableHeader || isPlainText));
|
|
56049
56082
|
}
|
|
56050
56083
|
attributes.push(...additionalAttrs);
|
|
56051
|
-
|
|
56052
|
-
|
|
56053
|
-
|
|
56054
|
-
|
|
56055
|
-
`);
|
|
56084
|
+
// prettier-ignore
|
|
56085
|
+
cellNodes.push(escapeXml /*xml*/ `<c ${formatAttributes(attributes)}>
|
|
56086
|
+
${cellNode}
|
|
56087
|
+
</c>`);
|
|
56056
56088
|
}
|
|
56057
56089
|
}
|
|
56058
56090
|
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden) {
|
|
@@ -56648,7 +56680,6 @@
|
|
|
56648
56680
|
...config,
|
|
56649
56681
|
mode: config.mode || "normal",
|
|
56650
56682
|
custom: config.custom || {},
|
|
56651
|
-
defaultCurrencyFormat: config.defaultCurrencyFormat || "[$$]#,##0.00",
|
|
56652
56683
|
external: this.setupExternalConfig(config.external || {}),
|
|
56653
56684
|
transportService,
|
|
56654
56685
|
client,
|
|
@@ -56686,6 +56717,7 @@
|
|
|
56686
56717
|
custom: this.config.custom,
|
|
56687
56718
|
uiActions: this.config,
|
|
56688
56719
|
session: this.session,
|
|
56720
|
+
defaultCurrencyFormat: this.config.defaultCurrencyFormat,
|
|
56689
56721
|
};
|
|
56690
56722
|
}
|
|
56691
56723
|
// ---------------------------------------------------------------------------
|
|
@@ -56989,6 +57021,13 @@
|
|
|
56989
57021
|
urlRepresentation,
|
|
56990
57022
|
};
|
|
56991
57023
|
const components = {
|
|
57024
|
+
Checkbox,
|
|
57025
|
+
Section,
|
|
57026
|
+
ChartColor,
|
|
57027
|
+
ChartDataSeries,
|
|
57028
|
+
ChartErrorSection,
|
|
57029
|
+
ChartLabelRange,
|
|
57030
|
+
ChartTitle,
|
|
56992
57031
|
ChartPanel,
|
|
56993
57032
|
ChartFigure,
|
|
56994
57033
|
ChartJsComponent,
|
|
@@ -57060,9 +57099,9 @@
|
|
|
57060
57099
|
exports.tokenize = tokenize;
|
|
57061
57100
|
|
|
57062
57101
|
|
|
57063
|
-
__info__.version = "17.1.
|
|
57064
|
-
__info__.date = "2024-
|
|
57065
|
-
__info__.hash = "
|
|
57102
|
+
__info__.version = "17.1.3";
|
|
57103
|
+
__info__.date = "2024-02-02T13:46:54.332Z";
|
|
57104
|
+
__info__.hash = "798f979";
|
|
57066
57105
|
|
|
57067
57106
|
|
|
57068
57107
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|