@odoo/o-spreadsheet 18.0.6 → 18.0.7
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 +63 -90
- package/dist/o-spreadsheet.d.ts +3 -1
- package/dist/o-spreadsheet.esm.js +63 -90
- package/dist/o-spreadsheet.iife.js +63 -90
- package/dist/o-spreadsheet.iife.min.js +336 -336
- package/dist/o_spreadsheet.xml +3 -3
- 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 18.0.
|
|
6
|
-
* @date 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.7
|
|
6
|
+
* @date 2024-12-05T10:41:39.380Z
|
|
7
|
+
* @hash a2652c5
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -334,8 +334,8 @@ const LINE_FILL_TRANSPARENCY = 0.4;
|
|
|
334
334
|
const DEBOUNCE_TIME = 200;
|
|
335
335
|
const MESSAGE_VERSION = 1;
|
|
336
336
|
// Sheets
|
|
337
|
-
const
|
|
338
|
-
const
|
|
337
|
+
const FORBIDDEN_SHEETNAME_CHARS = ["'", "*", "?", "/", "\\", "[", "]"];
|
|
338
|
+
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
339
339
|
// Cells
|
|
340
340
|
const FORMULA_REF_IDENTIFIER = "|";
|
|
341
341
|
// Components
|
|
@@ -388,6 +388,7 @@ const DEFAULT_CURRENCY = {
|
|
|
388
388
|
//------------------------------------------------------------------------------
|
|
389
389
|
// Miscellaneous
|
|
390
390
|
//------------------------------------------------------------------------------
|
|
391
|
+
const sanitizeSheetNameRegex = new RegExp(FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX, "g");
|
|
391
392
|
/**
|
|
392
393
|
* Remove quotes from a quoted string
|
|
393
394
|
* ```js
|
|
@@ -483,6 +484,10 @@ function getCanonicalSymbolName(symbolName) {
|
|
|
483
484
|
}
|
|
484
485
|
return symbolName;
|
|
485
486
|
}
|
|
487
|
+
/** Replace the excel-excluded characters of a sheetName */
|
|
488
|
+
function sanitizeSheetName(sheetName, replacementChar = " ") {
|
|
489
|
+
return sheetName.replace(sanitizeSheetNameRegex, replacementChar);
|
|
490
|
+
}
|
|
486
491
|
function clip(val, min, max) {
|
|
487
492
|
return val < min ? min : val > max ? max : val;
|
|
488
493
|
}
|
|
@@ -9416,34 +9421,42 @@ function interpolateData(config, values, labels, newLabels) {
|
|
|
9416
9421
|
const labelRange = labelMax - labelMin;
|
|
9417
9422
|
const normalizedLabels = labels.map((v) => (v - labelMin) / labelRange);
|
|
9418
9423
|
const normalizedNewLabels = newLabels.map((v) => (v - labelMin) / labelRange);
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
|
|
9424
|
+
try {
|
|
9425
|
+
switch (config.type) {
|
|
9426
|
+
case "polynomial": {
|
|
9427
|
+
const order = config.order;
|
|
9428
|
+
if (!order) {
|
|
9429
|
+
return Array.from({ length: newLabels.length }, () => NaN);
|
|
9430
|
+
}
|
|
9431
|
+
if (order === 1) {
|
|
9432
|
+
return predictLinearValues([values], [normalizedLabels], [normalizedNewLabels], true)[0];
|
|
9433
|
+
}
|
|
9434
|
+
const coeffs = polynomialRegression(values, normalizedLabels, order, true).flat();
|
|
9435
|
+
return normalizedNewLabels.map((v) => evaluatePolynomial(coeffs, v, order));
|
|
9436
|
+
}
|
|
9437
|
+
case "exponential": {
|
|
9438
|
+
const positiveLogValues = [];
|
|
9439
|
+
const filteredLabels = [];
|
|
9440
|
+
for (let i = 0; i < values.length; i++) {
|
|
9441
|
+
if (values[i] > 0) {
|
|
9442
|
+
positiveLogValues.push(Math.log(values[i]));
|
|
9443
|
+
filteredLabels.push(normalizedLabels[i]);
|
|
9444
|
+
}
|
|
9435
9445
|
}
|
|
9446
|
+
if (!filteredLabels.length) {
|
|
9447
|
+
return Array.from({ length: newLabels.length }, () => NaN);
|
|
9448
|
+
}
|
|
9449
|
+
return expM(predictLinearValues([positiveLogValues], [filteredLabels], [normalizedNewLabels], true))[0];
|
|
9436
9450
|
}
|
|
9437
|
-
|
|
9438
|
-
return [];
|
|
9451
|
+
case "logarithmic": {
|
|
9452
|
+
return predictLinearValues([values], logM([normalizedLabels]), logM([normalizedNewLabels]), true)[0];
|
|
9439
9453
|
}
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
case "logarithmic": {
|
|
9443
|
-
return predictLinearValues([values], logM([normalizedLabels]), logM([normalizedNewLabels]), true)[0];
|
|
9454
|
+
default:
|
|
9455
|
+
return [];
|
|
9444
9456
|
}
|
|
9445
|
-
|
|
9446
|
-
|
|
9457
|
+
}
|
|
9458
|
+
catch (e) {
|
|
9459
|
+
return Array.from({ length: newLabels.length }, () => NaN);
|
|
9447
9460
|
}
|
|
9448
9461
|
}
|
|
9449
9462
|
function formatTickValue(localeFormat) {
|
|
@@ -27242,13 +27255,12 @@ migrationStepRegistry
|
|
|
27242
27255
|
versionFrom: "7",
|
|
27243
27256
|
migrate(data) {
|
|
27244
27257
|
const namesTaken = [];
|
|
27245
|
-
const globalForbiddenInExcel = new RegExp(FORBIDDEN_IN_EXCEL_REGEX, "g");
|
|
27246
27258
|
for (let sheet of data.sheets || []) {
|
|
27247
27259
|
if (!sheet.name) {
|
|
27248
27260
|
continue;
|
|
27249
27261
|
}
|
|
27250
27262
|
const oldName = sheet.name;
|
|
27251
|
-
const escapedName = oldName
|
|
27263
|
+
const escapedName = sanitizeSheetName(oldName, "_");
|
|
27252
27264
|
let i = 1;
|
|
27253
27265
|
let newName = escapedName;
|
|
27254
27266
|
while (namesTaken.includes(newName)) {
|
|
@@ -37462,7 +37474,7 @@ class ChartWithAxisDesignPanel extends owl.Component {
|
|
|
37462
37474
|
case "polynomial":
|
|
37463
37475
|
config = {
|
|
37464
37476
|
type: "polynomial",
|
|
37465
|
-
order: type === "linear" ? 1 :
|
|
37477
|
+
order: type === "linear" ? 1 : this.getMaxPolynomialDegree(),
|
|
37466
37478
|
};
|
|
37467
37479
|
break;
|
|
37468
37480
|
case "exponential":
|
|
@@ -38538,20 +38550,8 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
38538
38550
|
replaceSelectedRange(zone) {
|
|
38539
38551
|
const ref = this.getZoneReference(zone);
|
|
38540
38552
|
const currentToken = this.tokenAtCursor;
|
|
38541
|
-
|
|
38542
|
-
|
|
38543
|
-
replaceStart = currentToken.start;
|
|
38544
|
-
}
|
|
38545
|
-
else if (currentToken?.type === "RIGHT_PAREN") {
|
|
38546
|
-
// match left parenthesis
|
|
38547
|
-
const leftParenthesisIndex = this.currentTokens.findIndex((token) => token.type === "LEFT_PAREN" && token.parenIndex === currentToken.parenIndex);
|
|
38548
|
-
const functionToken = this.currentTokens[leftParenthesisIndex - 1];
|
|
38549
|
-
if (functionToken === undefined) {
|
|
38550
|
-
return;
|
|
38551
|
-
}
|
|
38552
|
-
replaceStart = functionToken.start;
|
|
38553
|
-
}
|
|
38554
|
-
this.replaceText(ref, replaceStart, this.selectionEnd);
|
|
38553
|
+
const start = currentToken?.type === "REFERENCE" ? currentToken.start : this.selectionStart;
|
|
38554
|
+
this.replaceText(ref, start, this.selectionEnd);
|
|
38555
38555
|
}
|
|
38556
38556
|
/**
|
|
38557
38557
|
* Replace the reference of the old zone by the new one.
|
|
@@ -38584,17 +38584,6 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
38584
38584
|
getZoneReference(zone) {
|
|
38585
38585
|
const inputSheetId = this.sheetId;
|
|
38586
38586
|
const sheetId = this.getters.getActiveSheetId();
|
|
38587
|
-
if (zone.top === zone.bottom && zone.left === zone.right) {
|
|
38588
|
-
const position = { sheetId, col: zone.left, row: zone.top };
|
|
38589
|
-
const pivotId = this.getters.getPivotIdFromPosition(position);
|
|
38590
|
-
const pivotCell = this.getters.getPivotCellFromPosition(position);
|
|
38591
|
-
const cell = this.getters.getCell(position);
|
|
38592
|
-
if (pivotId && pivotCell.type !== "EMPTY" && !cell?.isFormula) {
|
|
38593
|
-
const formulaPivotId = this.getters.getPivotFormulaId(pivotId);
|
|
38594
|
-
const formula = createPivotFormula(formulaPivotId, pivotCell);
|
|
38595
|
-
return localizeFormula(formula, this.getters.getLocale()).slice(1); // strip leading =
|
|
38596
|
-
}
|
|
38597
|
-
}
|
|
38598
38587
|
const range = this.getters.getRangeFromZone(sheetId, zone);
|
|
38599
38588
|
return this.getters.getSelectionRangeString(range, inputSheetId);
|
|
38600
38589
|
}
|
|
@@ -38665,35 +38654,19 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
38665
38654
|
const colorIndex = this.colorIndexByRange[rangeString];
|
|
38666
38655
|
return colors$1[colorIndex % colors$1.length];
|
|
38667
38656
|
};
|
|
38668
|
-
|
|
38669
|
-
for (const range of this.getReferencedRanges()) {
|
|
38657
|
+
return this.getReferencedRanges().map((range) => {
|
|
38670
38658
|
const rangeString = this.getters.getRangeString(range, editionSheetId);
|
|
38671
38659
|
const { numberOfRows, numberOfCols } = zoneToDimension(range.zone);
|
|
38672
38660
|
const zone = numberOfRows * numberOfCols === 1
|
|
38673
38661
|
? this.getters.expandZone(range.sheetId, range.zone)
|
|
38674
38662
|
: range.zone;
|
|
38675
|
-
|
|
38663
|
+
return {
|
|
38676
38664
|
zone,
|
|
38677
38665
|
color: rangeColor(rangeString),
|
|
38678
38666
|
sheetId: range.sheetId,
|
|
38679
38667
|
interactive: true,
|
|
38680
|
-
}
|
|
38681
|
-
}
|
|
38682
|
-
const activeSheetId = this.getters.getActiveSheetId();
|
|
38683
|
-
const selectionZone = this.model.selection.getAnchor().zone;
|
|
38684
|
-
const isSelectionHightlighted = highlights.find((highlight) => highlight.sheetId === activeSheetId && isEqual(highlight.zone, selectionZone));
|
|
38685
|
-
if (this.editionMode === "selecting" && !isSelectionHightlighted) {
|
|
38686
|
-
highlights.push({
|
|
38687
|
-
zone: selectionZone,
|
|
38688
|
-
color: "#445566",
|
|
38689
|
-
sheetId: activeSheetId,
|
|
38690
|
-
dashed: true,
|
|
38691
|
-
interactive: false,
|
|
38692
|
-
noFill: true,
|
|
38693
|
-
thinLine: true,
|
|
38694
|
-
});
|
|
38695
|
-
}
|
|
38696
|
-
return highlights;
|
|
38668
|
+
};
|
|
38669
|
+
});
|
|
38697
38670
|
}
|
|
38698
38671
|
/**
|
|
38699
38672
|
* Return ranges currently referenced in the composer
|
|
@@ -54279,7 +54252,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
54279
54252
|
if (orderedSheetIds.find((id) => sheets[id]?.name.toLowerCase() === name && id !== cmd.sheetId)) {
|
|
54280
54253
|
return "DuplicatedSheetName" /* CommandResult.DuplicatedSheetName */;
|
|
54281
54254
|
}
|
|
54282
|
-
if (
|
|
54255
|
+
if (FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX.test(name)) {
|
|
54283
54256
|
return "ForbiddenCharactersInSheetName" /* CommandResult.ForbiddenCharactersInSheetName */;
|
|
54284
54257
|
}
|
|
54285
54258
|
return "Success" /* CommandResult.Success */;
|
|
@@ -59682,11 +59655,13 @@ class PivotUIPlugin extends UIPlugin {
|
|
|
59682
59655
|
return EMPTY_PIVOT_CELL;
|
|
59683
59656
|
}
|
|
59684
59657
|
if (functionName === "PIVOT") {
|
|
59685
|
-
const includeTotal = args[2]
|
|
59686
|
-
const
|
|
59658
|
+
const includeTotal = toScalar(args[2]);
|
|
59659
|
+
const shouldIncludeTotal = includeTotal === undefined ? true : toBoolean(includeTotal);
|
|
59660
|
+
const includeColumnHeaders = toScalar(args[3]);
|
|
59661
|
+
const shouldIncludeColumnHeaders = includeColumnHeaders === undefined ? true : toBoolean(includeColumnHeaders);
|
|
59687
59662
|
const pivotCells = pivot
|
|
59688
59663
|
.getTableStructure()
|
|
59689
|
-
.getPivotCells(
|
|
59664
|
+
.getPivotCells(shouldIncludeTotal, shouldIncludeColumnHeaders);
|
|
59690
59665
|
const pivotCol = position.col - mainPosition.col;
|
|
59691
59666
|
const pivotRow = position.row - mainPosition.row;
|
|
59692
59667
|
return pivotCells[pivotCol][pivotRow];
|
|
@@ -61842,7 +61817,7 @@ class InsertPivotPlugin extends UIPlugin {
|
|
|
61842
61817
|
getPivotDuplicateSheetName(pivotName) {
|
|
61843
61818
|
let i = 1;
|
|
61844
61819
|
const names = this.getters.getSheetIds().map((id) => this.getters.getSheetName(id));
|
|
61845
|
-
const sanitizedName = pivotName
|
|
61820
|
+
const sanitizedName = sanitizeSheetName(pivotName);
|
|
61846
61821
|
let name = sanitizedName;
|
|
61847
61822
|
while (names.includes(name)) {
|
|
61848
61823
|
name = `${sanitizedName} (${i})`;
|
|
@@ -65922,7 +65897,7 @@ function interactiveRenameSheet(env, sheetId, name, errorCallback) {
|
|
|
65922
65897
|
env.raiseError(_t("A sheet with the name %s already exists. Please select another name.", name), errorCallback);
|
|
65923
65898
|
}
|
|
65924
65899
|
else if (result.reasons.includes("ForbiddenCharactersInSheetName" /* CommandResult.ForbiddenCharactersInSheetName */)) {
|
|
65925
|
-
env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).",
|
|
65900
|
+
env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).", FORBIDDEN_SHEETNAME_CHARS.join(" ")), errorCallback);
|
|
65926
65901
|
}
|
|
65927
65902
|
}
|
|
65928
65903
|
|
|
@@ -67152,7 +67127,7 @@ class ActionButton extends owl.Component {
|
|
|
67152
67127
|
setup() {
|
|
67153
67128
|
owl.onWillUpdateProps((nextProps) => {
|
|
67154
67129
|
if (nextProps.action !== this.props.action) {
|
|
67155
|
-
this.actionButton = createAction(
|
|
67130
|
+
this.actionButton = createAction(nextProps.action);
|
|
67156
67131
|
}
|
|
67157
67132
|
});
|
|
67158
67133
|
}
|
|
@@ -69331,9 +69306,6 @@ class SelectionStreamProcessorImpl {
|
|
|
69331
69306
|
getBackToDefault() {
|
|
69332
69307
|
this.stream.getBackToDefault();
|
|
69333
69308
|
}
|
|
69334
|
-
getAnchor() {
|
|
69335
|
-
return this.anchor;
|
|
69336
|
-
}
|
|
69337
69309
|
modifyAnchor(anchor, mode, options) {
|
|
69338
69310
|
const sheetId = this.getters.getActiveSheetId();
|
|
69339
69311
|
anchor = {
|
|
@@ -72421,6 +72393,7 @@ const helpers = {
|
|
|
72421
72393
|
areDomainArgsFieldsValid,
|
|
72422
72394
|
splitReference,
|
|
72423
72395
|
formatTickValue,
|
|
72396
|
+
sanitizeSheetName,
|
|
72424
72397
|
};
|
|
72425
72398
|
const links = {
|
|
72426
72399
|
isMarkdownLink,
|
|
@@ -72556,6 +72529,6 @@ exports.tokenColors = tokenColors;
|
|
|
72556
72529
|
exports.tokenize = tokenize;
|
|
72557
72530
|
|
|
72558
72531
|
|
|
72559
|
-
__info__.version = "18.0.
|
|
72560
|
-
__info__.date = "2024-
|
|
72561
|
-
__info__.hash = "
|
|
72532
|
+
__info__.version = "18.0.7";
|
|
72533
|
+
__info__.date = "2024-12-05T10:41:39.380Z";
|
|
72534
|
+
__info__.hash = "a2652c5";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1306,7 +1306,6 @@ type StatefulStream<Event, State> = {
|
|
|
1306
1306
|
* Allows to select cells in the grid and update the selection
|
|
1307
1307
|
*/
|
|
1308
1308
|
interface SelectionProcessor {
|
|
1309
|
-
getAnchor(): Immutable<AnchorZone>;
|
|
1310
1309
|
selectZone(anchor: AnchorZone, options?: SelectionEventOptions): DispatchResult;
|
|
1311
1310
|
selectCell(col: number, row: number): DispatchResult;
|
|
1312
1311
|
moveAnchorCell(direction: Direction$1, step: SelectionStep): DispatchResult;
|
|
@@ -5706,6 +5705,8 @@ declare function createCurrencyFormat(currency: Partial<Currency>): Format;
|
|
|
5706
5705
|
*/
|
|
5707
5706
|
declare function deepCopy<T>(obj: T): T;
|
|
5708
5707
|
declare function unquote(string: string, quoteChar?: "'" | '"'): string;
|
|
5708
|
+
/** Replace the excel-excluded characters of a sheetName */
|
|
5709
|
+
declare function sanitizeSheetName(sheetName: string, replacementChar?: string): string;
|
|
5709
5710
|
declare function isMarkdownLink(str: string): boolean;
|
|
5710
5711
|
/**
|
|
5711
5712
|
* Build a markdown link from a label and an url
|
|
@@ -12085,6 +12086,7 @@ declare const helpers: {
|
|
|
12085
12086
|
areDomainArgsFieldsValid: typeof areDomainArgsFieldsValid;
|
|
12086
12087
|
splitReference: typeof splitReference;
|
|
12087
12088
|
formatTickValue: typeof formatTickValue;
|
|
12089
|
+
sanitizeSheetName: typeof sanitizeSheetName;
|
|
12088
12090
|
};
|
|
12089
12091
|
declare const links: {
|
|
12090
12092
|
isMarkdownLink: typeof isMarkdownLink;
|
|
@@ -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 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.7
|
|
6
|
+
* @date 2024-12-05T10:41:39.380Z
|
|
7
|
+
* @hash a2652c5
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -332,8 +332,8 @@ const LINE_FILL_TRANSPARENCY = 0.4;
|
|
|
332
332
|
const DEBOUNCE_TIME = 200;
|
|
333
333
|
const MESSAGE_VERSION = 1;
|
|
334
334
|
// Sheets
|
|
335
|
-
const
|
|
336
|
-
const
|
|
335
|
+
const FORBIDDEN_SHEETNAME_CHARS = ["'", "*", "?", "/", "\\", "[", "]"];
|
|
336
|
+
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
337
337
|
// Cells
|
|
338
338
|
const FORMULA_REF_IDENTIFIER = "|";
|
|
339
339
|
// Components
|
|
@@ -386,6 +386,7 @@ const DEFAULT_CURRENCY = {
|
|
|
386
386
|
//------------------------------------------------------------------------------
|
|
387
387
|
// Miscellaneous
|
|
388
388
|
//------------------------------------------------------------------------------
|
|
389
|
+
const sanitizeSheetNameRegex = new RegExp(FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX, "g");
|
|
389
390
|
/**
|
|
390
391
|
* Remove quotes from a quoted string
|
|
391
392
|
* ```js
|
|
@@ -481,6 +482,10 @@ function getCanonicalSymbolName(symbolName) {
|
|
|
481
482
|
}
|
|
482
483
|
return symbolName;
|
|
483
484
|
}
|
|
485
|
+
/** Replace the excel-excluded characters of a sheetName */
|
|
486
|
+
function sanitizeSheetName(sheetName, replacementChar = " ") {
|
|
487
|
+
return sheetName.replace(sanitizeSheetNameRegex, replacementChar);
|
|
488
|
+
}
|
|
484
489
|
function clip(val, min, max) {
|
|
485
490
|
return val < min ? min : val > max ? max : val;
|
|
486
491
|
}
|
|
@@ -9414,34 +9419,42 @@ function interpolateData(config, values, labels, newLabels) {
|
|
|
9414
9419
|
const labelRange = labelMax - labelMin;
|
|
9415
9420
|
const normalizedLabels = labels.map((v) => (v - labelMin) / labelRange);
|
|
9416
9421
|
const normalizedNewLabels = newLabels.map((v) => (v - labelMin) / labelRange);
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9422
|
+
try {
|
|
9423
|
+
switch (config.type) {
|
|
9424
|
+
case "polynomial": {
|
|
9425
|
+
const order = config.order;
|
|
9426
|
+
if (!order) {
|
|
9427
|
+
return Array.from({ length: newLabels.length }, () => NaN);
|
|
9428
|
+
}
|
|
9429
|
+
if (order === 1) {
|
|
9430
|
+
return predictLinearValues([values], [normalizedLabels], [normalizedNewLabels], true)[0];
|
|
9431
|
+
}
|
|
9432
|
+
const coeffs = polynomialRegression(values, normalizedLabels, order, true).flat();
|
|
9433
|
+
return normalizedNewLabels.map((v) => evaluatePolynomial(coeffs, v, order));
|
|
9434
|
+
}
|
|
9435
|
+
case "exponential": {
|
|
9436
|
+
const positiveLogValues = [];
|
|
9437
|
+
const filteredLabels = [];
|
|
9438
|
+
for (let i = 0; i < values.length; i++) {
|
|
9439
|
+
if (values[i] > 0) {
|
|
9440
|
+
positiveLogValues.push(Math.log(values[i]));
|
|
9441
|
+
filteredLabels.push(normalizedLabels[i]);
|
|
9442
|
+
}
|
|
9433
9443
|
}
|
|
9444
|
+
if (!filteredLabels.length) {
|
|
9445
|
+
return Array.from({ length: newLabels.length }, () => NaN);
|
|
9446
|
+
}
|
|
9447
|
+
return expM(predictLinearValues([positiveLogValues], [filteredLabels], [normalizedNewLabels], true))[0];
|
|
9434
9448
|
}
|
|
9435
|
-
|
|
9436
|
-
return [];
|
|
9449
|
+
case "logarithmic": {
|
|
9450
|
+
return predictLinearValues([values], logM([normalizedLabels]), logM([normalizedNewLabels]), true)[0];
|
|
9437
9451
|
}
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
case "logarithmic": {
|
|
9441
|
-
return predictLinearValues([values], logM([normalizedLabels]), logM([normalizedNewLabels]), true)[0];
|
|
9452
|
+
default:
|
|
9453
|
+
return [];
|
|
9442
9454
|
}
|
|
9443
|
-
|
|
9444
|
-
|
|
9455
|
+
}
|
|
9456
|
+
catch (e) {
|
|
9457
|
+
return Array.from({ length: newLabels.length }, () => NaN);
|
|
9445
9458
|
}
|
|
9446
9459
|
}
|
|
9447
9460
|
function formatTickValue(localeFormat) {
|
|
@@ -27240,13 +27253,12 @@ migrationStepRegistry
|
|
|
27240
27253
|
versionFrom: "7",
|
|
27241
27254
|
migrate(data) {
|
|
27242
27255
|
const namesTaken = [];
|
|
27243
|
-
const globalForbiddenInExcel = new RegExp(FORBIDDEN_IN_EXCEL_REGEX, "g");
|
|
27244
27256
|
for (let sheet of data.sheets || []) {
|
|
27245
27257
|
if (!sheet.name) {
|
|
27246
27258
|
continue;
|
|
27247
27259
|
}
|
|
27248
27260
|
const oldName = sheet.name;
|
|
27249
|
-
const escapedName = oldName
|
|
27261
|
+
const escapedName = sanitizeSheetName(oldName, "_");
|
|
27250
27262
|
let i = 1;
|
|
27251
27263
|
let newName = escapedName;
|
|
27252
27264
|
while (namesTaken.includes(newName)) {
|
|
@@ -37460,7 +37472,7 @@ class ChartWithAxisDesignPanel extends Component {
|
|
|
37460
37472
|
case "polynomial":
|
|
37461
37473
|
config = {
|
|
37462
37474
|
type: "polynomial",
|
|
37463
|
-
order: type === "linear" ? 1 :
|
|
37475
|
+
order: type === "linear" ? 1 : this.getMaxPolynomialDegree(),
|
|
37464
37476
|
};
|
|
37465
37477
|
break;
|
|
37466
37478
|
case "exponential":
|
|
@@ -38536,20 +38548,8 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
38536
38548
|
replaceSelectedRange(zone) {
|
|
38537
38549
|
const ref = this.getZoneReference(zone);
|
|
38538
38550
|
const currentToken = this.tokenAtCursor;
|
|
38539
|
-
|
|
38540
|
-
|
|
38541
|
-
replaceStart = currentToken.start;
|
|
38542
|
-
}
|
|
38543
|
-
else if (currentToken?.type === "RIGHT_PAREN") {
|
|
38544
|
-
// match left parenthesis
|
|
38545
|
-
const leftParenthesisIndex = this.currentTokens.findIndex((token) => token.type === "LEFT_PAREN" && token.parenIndex === currentToken.parenIndex);
|
|
38546
|
-
const functionToken = this.currentTokens[leftParenthesisIndex - 1];
|
|
38547
|
-
if (functionToken === undefined) {
|
|
38548
|
-
return;
|
|
38549
|
-
}
|
|
38550
|
-
replaceStart = functionToken.start;
|
|
38551
|
-
}
|
|
38552
|
-
this.replaceText(ref, replaceStart, this.selectionEnd);
|
|
38551
|
+
const start = currentToken?.type === "REFERENCE" ? currentToken.start : this.selectionStart;
|
|
38552
|
+
this.replaceText(ref, start, this.selectionEnd);
|
|
38553
38553
|
}
|
|
38554
38554
|
/**
|
|
38555
38555
|
* Replace the reference of the old zone by the new one.
|
|
@@ -38582,17 +38582,6 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
38582
38582
|
getZoneReference(zone) {
|
|
38583
38583
|
const inputSheetId = this.sheetId;
|
|
38584
38584
|
const sheetId = this.getters.getActiveSheetId();
|
|
38585
|
-
if (zone.top === zone.bottom && zone.left === zone.right) {
|
|
38586
|
-
const position = { sheetId, col: zone.left, row: zone.top };
|
|
38587
|
-
const pivotId = this.getters.getPivotIdFromPosition(position);
|
|
38588
|
-
const pivotCell = this.getters.getPivotCellFromPosition(position);
|
|
38589
|
-
const cell = this.getters.getCell(position);
|
|
38590
|
-
if (pivotId && pivotCell.type !== "EMPTY" && !cell?.isFormula) {
|
|
38591
|
-
const formulaPivotId = this.getters.getPivotFormulaId(pivotId);
|
|
38592
|
-
const formula = createPivotFormula(formulaPivotId, pivotCell);
|
|
38593
|
-
return localizeFormula(formula, this.getters.getLocale()).slice(1); // strip leading =
|
|
38594
|
-
}
|
|
38595
|
-
}
|
|
38596
38585
|
const range = this.getters.getRangeFromZone(sheetId, zone);
|
|
38597
38586
|
return this.getters.getSelectionRangeString(range, inputSheetId);
|
|
38598
38587
|
}
|
|
@@ -38663,35 +38652,19 @@ class AbstractComposerStore extends SpreadsheetStore {
|
|
|
38663
38652
|
const colorIndex = this.colorIndexByRange[rangeString];
|
|
38664
38653
|
return colors$1[colorIndex % colors$1.length];
|
|
38665
38654
|
};
|
|
38666
|
-
|
|
38667
|
-
for (const range of this.getReferencedRanges()) {
|
|
38655
|
+
return this.getReferencedRanges().map((range) => {
|
|
38668
38656
|
const rangeString = this.getters.getRangeString(range, editionSheetId);
|
|
38669
38657
|
const { numberOfRows, numberOfCols } = zoneToDimension(range.zone);
|
|
38670
38658
|
const zone = numberOfRows * numberOfCols === 1
|
|
38671
38659
|
? this.getters.expandZone(range.sheetId, range.zone)
|
|
38672
38660
|
: range.zone;
|
|
38673
|
-
|
|
38661
|
+
return {
|
|
38674
38662
|
zone,
|
|
38675
38663
|
color: rangeColor(rangeString),
|
|
38676
38664
|
sheetId: range.sheetId,
|
|
38677
38665
|
interactive: true,
|
|
38678
|
-
}
|
|
38679
|
-
}
|
|
38680
|
-
const activeSheetId = this.getters.getActiveSheetId();
|
|
38681
|
-
const selectionZone = this.model.selection.getAnchor().zone;
|
|
38682
|
-
const isSelectionHightlighted = highlights.find((highlight) => highlight.sheetId === activeSheetId && isEqual(highlight.zone, selectionZone));
|
|
38683
|
-
if (this.editionMode === "selecting" && !isSelectionHightlighted) {
|
|
38684
|
-
highlights.push({
|
|
38685
|
-
zone: selectionZone,
|
|
38686
|
-
color: "#445566",
|
|
38687
|
-
sheetId: activeSheetId,
|
|
38688
|
-
dashed: true,
|
|
38689
|
-
interactive: false,
|
|
38690
|
-
noFill: true,
|
|
38691
|
-
thinLine: true,
|
|
38692
|
-
});
|
|
38693
|
-
}
|
|
38694
|
-
return highlights;
|
|
38666
|
+
};
|
|
38667
|
+
});
|
|
38695
38668
|
}
|
|
38696
38669
|
/**
|
|
38697
38670
|
* Return ranges currently referenced in the composer
|
|
@@ -54277,7 +54250,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
54277
54250
|
if (orderedSheetIds.find((id) => sheets[id]?.name.toLowerCase() === name && id !== cmd.sheetId)) {
|
|
54278
54251
|
return "DuplicatedSheetName" /* CommandResult.DuplicatedSheetName */;
|
|
54279
54252
|
}
|
|
54280
|
-
if (
|
|
54253
|
+
if (FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX.test(name)) {
|
|
54281
54254
|
return "ForbiddenCharactersInSheetName" /* CommandResult.ForbiddenCharactersInSheetName */;
|
|
54282
54255
|
}
|
|
54283
54256
|
return "Success" /* CommandResult.Success */;
|
|
@@ -59680,11 +59653,13 @@ class PivotUIPlugin extends UIPlugin {
|
|
|
59680
59653
|
return EMPTY_PIVOT_CELL;
|
|
59681
59654
|
}
|
|
59682
59655
|
if (functionName === "PIVOT") {
|
|
59683
|
-
const includeTotal = args[2]
|
|
59684
|
-
const
|
|
59656
|
+
const includeTotal = toScalar(args[2]);
|
|
59657
|
+
const shouldIncludeTotal = includeTotal === undefined ? true : toBoolean(includeTotal);
|
|
59658
|
+
const includeColumnHeaders = toScalar(args[3]);
|
|
59659
|
+
const shouldIncludeColumnHeaders = includeColumnHeaders === undefined ? true : toBoolean(includeColumnHeaders);
|
|
59685
59660
|
const pivotCells = pivot
|
|
59686
59661
|
.getTableStructure()
|
|
59687
|
-
.getPivotCells(
|
|
59662
|
+
.getPivotCells(shouldIncludeTotal, shouldIncludeColumnHeaders);
|
|
59688
59663
|
const pivotCol = position.col - mainPosition.col;
|
|
59689
59664
|
const pivotRow = position.row - mainPosition.row;
|
|
59690
59665
|
return pivotCells[pivotCol][pivotRow];
|
|
@@ -61840,7 +61815,7 @@ class InsertPivotPlugin extends UIPlugin {
|
|
|
61840
61815
|
getPivotDuplicateSheetName(pivotName) {
|
|
61841
61816
|
let i = 1;
|
|
61842
61817
|
const names = this.getters.getSheetIds().map((id) => this.getters.getSheetName(id));
|
|
61843
|
-
const sanitizedName = pivotName
|
|
61818
|
+
const sanitizedName = sanitizeSheetName(pivotName);
|
|
61844
61819
|
let name = sanitizedName;
|
|
61845
61820
|
while (names.includes(name)) {
|
|
61846
61821
|
name = `${sanitizedName} (${i})`;
|
|
@@ -65920,7 +65895,7 @@ function interactiveRenameSheet(env, sheetId, name, errorCallback) {
|
|
|
65920
65895
|
env.raiseError(_t("A sheet with the name %s already exists. Please select another name.", name), errorCallback);
|
|
65921
65896
|
}
|
|
65922
65897
|
else if (result.reasons.includes("ForbiddenCharactersInSheetName" /* CommandResult.ForbiddenCharactersInSheetName */)) {
|
|
65923
|
-
env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).",
|
|
65898
|
+
env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).", FORBIDDEN_SHEETNAME_CHARS.join(" ")), errorCallback);
|
|
65924
65899
|
}
|
|
65925
65900
|
}
|
|
65926
65901
|
|
|
@@ -67150,7 +67125,7 @@ class ActionButton extends Component {
|
|
|
67150
67125
|
setup() {
|
|
67151
67126
|
onWillUpdateProps((nextProps) => {
|
|
67152
67127
|
if (nextProps.action !== this.props.action) {
|
|
67153
|
-
this.actionButton = createAction(
|
|
67128
|
+
this.actionButton = createAction(nextProps.action);
|
|
67154
67129
|
}
|
|
67155
67130
|
});
|
|
67156
67131
|
}
|
|
@@ -69329,9 +69304,6 @@ class SelectionStreamProcessorImpl {
|
|
|
69329
69304
|
getBackToDefault() {
|
|
69330
69305
|
this.stream.getBackToDefault();
|
|
69331
69306
|
}
|
|
69332
|
-
getAnchor() {
|
|
69333
|
-
return this.anchor;
|
|
69334
|
-
}
|
|
69335
69307
|
modifyAnchor(anchor, mode, options) {
|
|
69336
69308
|
const sheetId = this.getters.getActiveSheetId();
|
|
69337
69309
|
anchor = {
|
|
@@ -72419,6 +72391,7 @@ const helpers = {
|
|
|
72419
72391
|
areDomainArgsFieldsValid,
|
|
72420
72392
|
splitReference,
|
|
72421
72393
|
formatTickValue,
|
|
72394
|
+
sanitizeSheetName,
|
|
72422
72395
|
};
|
|
72423
72396
|
const links = {
|
|
72424
72397
|
isMarkdownLink,
|
|
@@ -72511,6 +72484,6 @@ const constants = {
|
|
|
72511
72484
|
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 };
|
|
72512
72485
|
|
|
72513
72486
|
|
|
72514
|
-
__info__.version = "18.0.
|
|
72515
|
-
__info__.date = "2024-
|
|
72516
|
-
__info__.hash = "
|
|
72487
|
+
__info__.version = "18.0.7";
|
|
72488
|
+
__info__.date = "2024-12-05T10:41:39.380Z";
|
|
72489
|
+
__info__.hash = "a2652c5";
|