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