@odoo/o-spreadsheet 17.4.13 → 17.4.15
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 +29 -17
- package/dist/o-spreadsheet.d.ts +3 -0
- package/dist/o-spreadsheet.esm.js +29 -17
- package/dist/o-spreadsheet.iife.js +29 -17
- 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 17.4.
|
|
6
|
-
* @date 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.15
|
|
6
|
+
* @date 2024-12-05T10:40:45.905Z
|
|
7
|
+
* @hash 9b13f22
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -306,8 +306,8 @@ const LINE_FILL_TRANSPARENCY = 0.4;
|
|
|
306
306
|
const DEBOUNCE_TIME = 200;
|
|
307
307
|
const MESSAGE_VERSION = 1;
|
|
308
308
|
// Sheets
|
|
309
|
-
const
|
|
310
|
-
const
|
|
309
|
+
const FORBIDDEN_SHEETNAME_CHARS = ["'", "*", "?", "/", "\\", "[", "]"];
|
|
310
|
+
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
311
311
|
// Cells
|
|
312
312
|
const FORMULA_REF_IDENTIFIER = "|";
|
|
313
313
|
// Components
|
|
@@ -353,6 +353,7 @@ const PIVOT_TABLE_CONFIG = {
|
|
|
353
353
|
//------------------------------------------------------------------------------
|
|
354
354
|
// Miscellaneous
|
|
355
355
|
//------------------------------------------------------------------------------
|
|
356
|
+
const sanitizeSheetNameRegex = new RegExp(FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX, "g");
|
|
356
357
|
/**
|
|
357
358
|
* Remove quotes from a quoted string
|
|
358
359
|
* ```js
|
|
@@ -448,6 +449,10 @@ function getCanonicalSheetName(sheetName) {
|
|
|
448
449
|
}
|
|
449
450
|
return sheetName;
|
|
450
451
|
}
|
|
452
|
+
/** Replace the excel-excluded characters of a sheetName */
|
|
453
|
+
function sanitizeSheetName(sheetName, replacementChar = " ") {
|
|
454
|
+
return sheetName.replace(sanitizeSheetNameRegex, replacementChar);
|
|
455
|
+
}
|
|
451
456
|
function clip(val, min, max) {
|
|
452
457
|
return val < min ? min : val > max ? max : val;
|
|
453
458
|
}
|
|
@@ -25183,9 +25188,12 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
25183
25188
|
if (datasets && datasets[1]) {
|
|
25184
25189
|
datasets[1].data = datasets[1].data.map((value) => (value > 0 ? -value : 0));
|
|
25185
25190
|
}
|
|
25191
|
+
const maxValue = Math.max(...config.data?.datasets.map((dataSet) => Math.max(...dataSet.data.map(Math.abs))));
|
|
25186
25192
|
const scales = config.options.scales;
|
|
25187
25193
|
const scalesXCallback = scales.x.ticks.callback;
|
|
25188
25194
|
scales.x.ticks.callback = (value) => scalesXCallback(Math.abs(value));
|
|
25195
|
+
scales.x.suggestedMin = -maxValue;
|
|
25196
|
+
scales.x.suggestedMax = maxValue;
|
|
25189
25197
|
const tooltipLabelCallback = config.options.plugins.tooltip.callbacks.label;
|
|
25190
25198
|
config.options.plugins.tooltip.callbacks.label = (item) => {
|
|
25191
25199
|
const tooltipItem = { ...item, parsed: { y: item.parsed.y, x: Math.abs(item.parsed.x) } };
|
|
@@ -46724,13 +46732,12 @@ const MIGRATIONS = [
|
|
|
46724
46732
|
to: 8,
|
|
46725
46733
|
applyMigration(data) {
|
|
46726
46734
|
const namesTaken = [];
|
|
46727
|
-
const globalForbiddenInExcel = new RegExp(FORBIDDEN_IN_EXCEL_REGEX, "g");
|
|
46728
46735
|
for (let sheet of data.sheets || []) {
|
|
46729
46736
|
if (!sheet.name) {
|
|
46730
46737
|
continue;
|
|
46731
46738
|
}
|
|
46732
46739
|
const oldName = sheet.name;
|
|
46733
|
-
const escapedName = oldName
|
|
46740
|
+
const escapedName = sanitizeSheetName(oldName, "_");
|
|
46734
46741
|
let i = 1;
|
|
46735
46742
|
let newName = escapedName;
|
|
46736
46743
|
while (namesTaken.includes(newName)) {
|
|
@@ -51255,7 +51262,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
51255
51262
|
if (orderedSheetIds.find((id) => sheets[id]?.name.toLowerCase() === name && id !== cmd.sheetId)) {
|
|
51256
51263
|
return "DuplicatedSheetName" /* CommandResult.DuplicatedSheetName */;
|
|
51257
51264
|
}
|
|
51258
|
-
if (
|
|
51265
|
+
if (FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX.test(name)) {
|
|
51259
51266
|
return "ForbiddenCharactersInSheetName" /* CommandResult.ForbiddenCharactersInSheetName */;
|
|
51260
51267
|
}
|
|
51261
51268
|
return "Success" /* CommandResult.Success */;
|
|
@@ -54459,6 +54466,8 @@ class Evaluator {
|
|
|
54459
54466
|
}
|
|
54460
54467
|
this.nextPositionsToUpdate.addMany(this.getCellsDependingOn(invalidated));
|
|
54461
54468
|
this.nextPositionsToUpdate.addMany(this.getArrayFormulasBlockedBy(invalidated));
|
|
54469
|
+
[...invalidated].forEach((inv) => this.spreadingRelations.removeNode(inv));
|
|
54470
|
+
this.spreadingRelations.removeNode(position);
|
|
54462
54471
|
}
|
|
54463
54472
|
// ----------------------------------------------------------
|
|
54464
54473
|
// COMMON FUNCTIONALITY
|
|
@@ -56042,11 +56051,13 @@ class PivotUIPlugin extends UIPlugin {
|
|
|
56042
56051
|
return EMPTY_PIVOT_CELL;
|
|
56043
56052
|
}
|
|
56044
56053
|
if (functionName === "PIVOT") {
|
|
56045
|
-
const includeTotal = args[2]
|
|
56046
|
-
const
|
|
56054
|
+
const includeTotal = toScalar(args[2]);
|
|
56055
|
+
const shouldIncludeTotal = includeTotal === undefined ? true : toBoolean(includeTotal);
|
|
56056
|
+
const includeColumnHeaders = toScalar(args[3]);
|
|
56057
|
+
const shouldIncludeColumnHeaders = includeColumnHeaders === undefined ? true : toBoolean(includeColumnHeaders);
|
|
56047
56058
|
const pivotCells = pivot
|
|
56048
56059
|
.getTableStructure()
|
|
56049
|
-
.getPivotCells(
|
|
56060
|
+
.getPivotCells(shouldIncludeTotal, shouldIncludeColumnHeaders);
|
|
56050
56061
|
const pivotCol = position.col - mainPosition.col;
|
|
56051
56062
|
const pivotRow = position.row - mainPosition.row;
|
|
56052
56063
|
return pivotCells[pivotCol][pivotRow];
|
|
@@ -58151,7 +58162,7 @@ class InsertPivotPlugin extends UIPlugin {
|
|
|
58151
58162
|
getPivotDuplicateSheetName(pivotName) {
|
|
58152
58163
|
let i = 1;
|
|
58153
58164
|
const names = this.getters.getSheetIds().map((id) => this.getters.getSheetName(id));
|
|
58154
|
-
const sanitizedName = pivotName
|
|
58165
|
+
const sanitizedName = sanitizeSheetName(pivotName);
|
|
58155
58166
|
let name = sanitizedName;
|
|
58156
58167
|
while (names.includes(name)) {
|
|
58157
58168
|
name = `${sanitizedName} (${i})`;
|
|
@@ -62192,7 +62203,7 @@ function interactiveRenameSheet(env, sheetId, name, errorCallback) {
|
|
|
62192
62203
|
env.raiseError(_t("A sheet with the name %s already exists. Please select another name.", name), errorCallback);
|
|
62193
62204
|
}
|
|
62194
62205
|
else if (result.reasons.includes("ForbiddenCharactersInSheetName" /* CommandResult.ForbiddenCharactersInSheetName */)) {
|
|
62195
|
-
env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).",
|
|
62206
|
+
env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).", FORBIDDEN_SHEETNAME_CHARS.join(" ")), errorCallback);
|
|
62196
62207
|
}
|
|
62197
62208
|
}
|
|
62198
62209
|
|
|
@@ -63451,7 +63462,7 @@ class ActionButton extends owl.Component {
|
|
|
63451
63462
|
setup() {
|
|
63452
63463
|
owl.onWillUpdateProps((nextProps) => {
|
|
63453
63464
|
if (nextProps.action !== this.props.action) {
|
|
63454
|
-
this.actionButton = createAction(
|
|
63465
|
+
this.actionButton = createAction(nextProps.action);
|
|
63455
63466
|
}
|
|
63456
63467
|
});
|
|
63457
63468
|
}
|
|
@@ -68584,6 +68595,7 @@ const helpers = {
|
|
|
68584
68595
|
createPivotFormula,
|
|
68585
68596
|
areDomainArgsFieldsValid,
|
|
68586
68597
|
formatTickValue,
|
|
68598
|
+
sanitizeSheetName,
|
|
68587
68599
|
};
|
|
68588
68600
|
const links = {
|
|
68589
68601
|
isMarkdownLink,
|
|
@@ -68714,6 +68726,6 @@ exports.tokenColors = tokenColors;
|
|
|
68714
68726
|
exports.tokenize = tokenize;
|
|
68715
68727
|
|
|
68716
68728
|
|
|
68717
|
-
__info__.version = "17.4.
|
|
68718
|
-
__info__.date = "2024-
|
|
68719
|
-
__info__.hash = "
|
|
68729
|
+
__info__.version = "17.4.15";
|
|
68730
|
+
__info__.date = "2024-12-05T10:40:45.905Z";
|
|
68731
|
+
__info__.hash = "9b13f22";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -5548,6 +5548,8 @@ declare function createCurrencyFormat(currency: Partial<Currency>): Format;
|
|
|
5548
5548
|
*/
|
|
5549
5549
|
declare function deepCopy<T>(obj: T): T;
|
|
5550
5550
|
declare function unquote(string: string, quoteChar?: "'" | '"'): string;
|
|
5551
|
+
/** Replace the excel-excluded characters of a sheetName */
|
|
5552
|
+
declare function sanitizeSheetName(sheetName: string, replacementChar?: string): string;
|
|
5551
5553
|
declare function isMarkdownLink(str: string): boolean;
|
|
5552
5554
|
/**
|
|
5553
5555
|
* Build a markdown link from a label and an url
|
|
@@ -11531,6 +11533,7 @@ declare const helpers: {
|
|
|
11531
11533
|
createPivotFormula: typeof createPivotFormula;
|
|
11532
11534
|
areDomainArgsFieldsValid: typeof areDomainArgsFieldsValid;
|
|
11533
11535
|
formatTickValue: typeof formatTickValue;
|
|
11536
|
+
sanitizeSheetName: typeof sanitizeSheetName;
|
|
11534
11537
|
};
|
|
11535
11538
|
declare const links: {
|
|
11536
11539
|
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 17.4.
|
|
6
|
-
* @date 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.15
|
|
6
|
+
* @date 2024-12-05T10:40:45.905Z
|
|
7
|
+
* @hash 9b13f22
|
|
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';
|
|
@@ -304,8 +304,8 @@ const LINE_FILL_TRANSPARENCY = 0.4;
|
|
|
304
304
|
const DEBOUNCE_TIME = 200;
|
|
305
305
|
const MESSAGE_VERSION = 1;
|
|
306
306
|
// Sheets
|
|
307
|
-
const
|
|
308
|
-
const
|
|
307
|
+
const FORBIDDEN_SHEETNAME_CHARS = ["'", "*", "?", "/", "\\", "[", "]"];
|
|
308
|
+
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
309
309
|
// Cells
|
|
310
310
|
const FORMULA_REF_IDENTIFIER = "|";
|
|
311
311
|
// Components
|
|
@@ -351,6 +351,7 @@ const PIVOT_TABLE_CONFIG = {
|
|
|
351
351
|
//------------------------------------------------------------------------------
|
|
352
352
|
// Miscellaneous
|
|
353
353
|
//------------------------------------------------------------------------------
|
|
354
|
+
const sanitizeSheetNameRegex = new RegExp(FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX, "g");
|
|
354
355
|
/**
|
|
355
356
|
* Remove quotes from a quoted string
|
|
356
357
|
* ```js
|
|
@@ -446,6 +447,10 @@ function getCanonicalSheetName(sheetName) {
|
|
|
446
447
|
}
|
|
447
448
|
return sheetName;
|
|
448
449
|
}
|
|
450
|
+
/** Replace the excel-excluded characters of a sheetName */
|
|
451
|
+
function sanitizeSheetName(sheetName, replacementChar = " ") {
|
|
452
|
+
return sheetName.replace(sanitizeSheetNameRegex, replacementChar);
|
|
453
|
+
}
|
|
449
454
|
function clip(val, min, max) {
|
|
450
455
|
return val < min ? min : val > max ? max : val;
|
|
451
456
|
}
|
|
@@ -25181,9 +25186,12 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
25181
25186
|
if (datasets && datasets[1]) {
|
|
25182
25187
|
datasets[1].data = datasets[1].data.map((value) => (value > 0 ? -value : 0));
|
|
25183
25188
|
}
|
|
25189
|
+
const maxValue = Math.max(...config.data?.datasets.map((dataSet) => Math.max(...dataSet.data.map(Math.abs))));
|
|
25184
25190
|
const scales = config.options.scales;
|
|
25185
25191
|
const scalesXCallback = scales.x.ticks.callback;
|
|
25186
25192
|
scales.x.ticks.callback = (value) => scalesXCallback(Math.abs(value));
|
|
25193
|
+
scales.x.suggestedMin = -maxValue;
|
|
25194
|
+
scales.x.suggestedMax = maxValue;
|
|
25187
25195
|
const tooltipLabelCallback = config.options.plugins.tooltip.callbacks.label;
|
|
25188
25196
|
config.options.plugins.tooltip.callbacks.label = (item) => {
|
|
25189
25197
|
const tooltipItem = { ...item, parsed: { y: item.parsed.y, x: Math.abs(item.parsed.x) } };
|
|
@@ -46722,13 +46730,12 @@ const MIGRATIONS = [
|
|
|
46722
46730
|
to: 8,
|
|
46723
46731
|
applyMigration(data) {
|
|
46724
46732
|
const namesTaken = [];
|
|
46725
|
-
const globalForbiddenInExcel = new RegExp(FORBIDDEN_IN_EXCEL_REGEX, "g");
|
|
46726
46733
|
for (let sheet of data.sheets || []) {
|
|
46727
46734
|
if (!sheet.name) {
|
|
46728
46735
|
continue;
|
|
46729
46736
|
}
|
|
46730
46737
|
const oldName = sheet.name;
|
|
46731
|
-
const escapedName = oldName
|
|
46738
|
+
const escapedName = sanitizeSheetName(oldName, "_");
|
|
46732
46739
|
let i = 1;
|
|
46733
46740
|
let newName = escapedName;
|
|
46734
46741
|
while (namesTaken.includes(newName)) {
|
|
@@ -51253,7 +51260,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
51253
51260
|
if (orderedSheetIds.find((id) => sheets[id]?.name.toLowerCase() === name && id !== cmd.sheetId)) {
|
|
51254
51261
|
return "DuplicatedSheetName" /* CommandResult.DuplicatedSheetName */;
|
|
51255
51262
|
}
|
|
51256
|
-
if (
|
|
51263
|
+
if (FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX.test(name)) {
|
|
51257
51264
|
return "ForbiddenCharactersInSheetName" /* CommandResult.ForbiddenCharactersInSheetName */;
|
|
51258
51265
|
}
|
|
51259
51266
|
return "Success" /* CommandResult.Success */;
|
|
@@ -54457,6 +54464,8 @@ class Evaluator {
|
|
|
54457
54464
|
}
|
|
54458
54465
|
this.nextPositionsToUpdate.addMany(this.getCellsDependingOn(invalidated));
|
|
54459
54466
|
this.nextPositionsToUpdate.addMany(this.getArrayFormulasBlockedBy(invalidated));
|
|
54467
|
+
[...invalidated].forEach((inv) => this.spreadingRelations.removeNode(inv));
|
|
54468
|
+
this.spreadingRelations.removeNode(position);
|
|
54460
54469
|
}
|
|
54461
54470
|
// ----------------------------------------------------------
|
|
54462
54471
|
// COMMON FUNCTIONALITY
|
|
@@ -56040,11 +56049,13 @@ class PivotUIPlugin extends UIPlugin {
|
|
|
56040
56049
|
return EMPTY_PIVOT_CELL;
|
|
56041
56050
|
}
|
|
56042
56051
|
if (functionName === "PIVOT") {
|
|
56043
|
-
const includeTotal = args[2]
|
|
56044
|
-
const
|
|
56052
|
+
const includeTotal = toScalar(args[2]);
|
|
56053
|
+
const shouldIncludeTotal = includeTotal === undefined ? true : toBoolean(includeTotal);
|
|
56054
|
+
const includeColumnHeaders = toScalar(args[3]);
|
|
56055
|
+
const shouldIncludeColumnHeaders = includeColumnHeaders === undefined ? true : toBoolean(includeColumnHeaders);
|
|
56045
56056
|
const pivotCells = pivot
|
|
56046
56057
|
.getTableStructure()
|
|
56047
|
-
.getPivotCells(
|
|
56058
|
+
.getPivotCells(shouldIncludeTotal, shouldIncludeColumnHeaders);
|
|
56048
56059
|
const pivotCol = position.col - mainPosition.col;
|
|
56049
56060
|
const pivotRow = position.row - mainPosition.row;
|
|
56050
56061
|
return pivotCells[pivotCol][pivotRow];
|
|
@@ -58149,7 +58160,7 @@ class InsertPivotPlugin extends UIPlugin {
|
|
|
58149
58160
|
getPivotDuplicateSheetName(pivotName) {
|
|
58150
58161
|
let i = 1;
|
|
58151
58162
|
const names = this.getters.getSheetIds().map((id) => this.getters.getSheetName(id));
|
|
58152
|
-
const sanitizedName = pivotName
|
|
58163
|
+
const sanitizedName = sanitizeSheetName(pivotName);
|
|
58153
58164
|
let name = sanitizedName;
|
|
58154
58165
|
while (names.includes(name)) {
|
|
58155
58166
|
name = `${sanitizedName} (${i})`;
|
|
@@ -62190,7 +62201,7 @@ function interactiveRenameSheet(env, sheetId, name, errorCallback) {
|
|
|
62190
62201
|
env.raiseError(_t("A sheet with the name %s already exists. Please select another name.", name), errorCallback);
|
|
62191
62202
|
}
|
|
62192
62203
|
else if (result.reasons.includes("ForbiddenCharactersInSheetName" /* CommandResult.ForbiddenCharactersInSheetName */)) {
|
|
62193
|
-
env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).",
|
|
62204
|
+
env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).", FORBIDDEN_SHEETNAME_CHARS.join(" ")), errorCallback);
|
|
62194
62205
|
}
|
|
62195
62206
|
}
|
|
62196
62207
|
|
|
@@ -63449,7 +63460,7 @@ class ActionButton extends Component {
|
|
|
63449
63460
|
setup() {
|
|
63450
63461
|
onWillUpdateProps((nextProps) => {
|
|
63451
63462
|
if (nextProps.action !== this.props.action) {
|
|
63452
|
-
this.actionButton = createAction(
|
|
63463
|
+
this.actionButton = createAction(nextProps.action);
|
|
63453
63464
|
}
|
|
63454
63465
|
});
|
|
63455
63466
|
}
|
|
@@ -68582,6 +68593,7 @@ const helpers = {
|
|
|
68582
68593
|
createPivotFormula,
|
|
68583
68594
|
areDomainArgsFieldsValid,
|
|
68584
68595
|
formatTickValue,
|
|
68596
|
+
sanitizeSheetName,
|
|
68585
68597
|
};
|
|
68586
68598
|
const links = {
|
|
68587
68599
|
isMarkdownLink,
|
|
@@ -68669,6 +68681,6 @@ const constants = {
|
|
|
68669
68681
|
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 };
|
|
68670
68682
|
|
|
68671
68683
|
|
|
68672
|
-
__info__.version = "17.4.
|
|
68673
|
-
__info__.date = "2024-
|
|
68674
|
-
__info__.hash = "
|
|
68684
|
+
__info__.version = "17.4.15";
|
|
68685
|
+
__info__.date = "2024-12-05T10:40:45.905Z";
|
|
68686
|
+
__info__.hash = "9b13f22";
|
|
@@ -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.4.
|
|
6
|
-
* @date 2024-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.15
|
|
6
|
+
* @date 2024-12-05T10:40:45.905Z
|
|
7
|
+
* @hash 9b13f22
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -305,8 +305,8 @@
|
|
|
305
305
|
const DEBOUNCE_TIME = 200;
|
|
306
306
|
const MESSAGE_VERSION = 1;
|
|
307
307
|
// Sheets
|
|
308
|
-
const
|
|
309
|
-
const
|
|
308
|
+
const FORBIDDEN_SHEETNAME_CHARS = ["'", "*", "?", "/", "\\", "[", "]"];
|
|
309
|
+
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
310
310
|
// Cells
|
|
311
311
|
const FORMULA_REF_IDENTIFIER = "|";
|
|
312
312
|
// Components
|
|
@@ -352,6 +352,7 @@
|
|
|
352
352
|
//------------------------------------------------------------------------------
|
|
353
353
|
// Miscellaneous
|
|
354
354
|
//------------------------------------------------------------------------------
|
|
355
|
+
const sanitizeSheetNameRegex = new RegExp(FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX, "g");
|
|
355
356
|
/**
|
|
356
357
|
* Remove quotes from a quoted string
|
|
357
358
|
* ```js
|
|
@@ -447,6 +448,10 @@
|
|
|
447
448
|
}
|
|
448
449
|
return sheetName;
|
|
449
450
|
}
|
|
451
|
+
/** Replace the excel-excluded characters of a sheetName */
|
|
452
|
+
function sanitizeSheetName(sheetName, replacementChar = " ") {
|
|
453
|
+
return sheetName.replace(sanitizeSheetNameRegex, replacementChar);
|
|
454
|
+
}
|
|
450
455
|
function clip(val, min, max) {
|
|
451
456
|
return val < min ? min : val > max ? max : val;
|
|
452
457
|
}
|
|
@@ -25182,9 +25187,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25182
25187
|
if (datasets && datasets[1]) {
|
|
25183
25188
|
datasets[1].data = datasets[1].data.map((value) => (value > 0 ? -value : 0));
|
|
25184
25189
|
}
|
|
25190
|
+
const maxValue = Math.max(...config.data?.datasets.map((dataSet) => Math.max(...dataSet.data.map(Math.abs))));
|
|
25185
25191
|
const scales = config.options.scales;
|
|
25186
25192
|
const scalesXCallback = scales.x.ticks.callback;
|
|
25187
25193
|
scales.x.ticks.callback = (value) => scalesXCallback(Math.abs(value));
|
|
25194
|
+
scales.x.suggestedMin = -maxValue;
|
|
25195
|
+
scales.x.suggestedMax = maxValue;
|
|
25188
25196
|
const tooltipLabelCallback = config.options.plugins.tooltip.callbacks.label;
|
|
25189
25197
|
config.options.plugins.tooltip.callbacks.label = (item) => {
|
|
25190
25198
|
const tooltipItem = { ...item, parsed: { y: item.parsed.y, x: Math.abs(item.parsed.x) } };
|
|
@@ -46723,13 +46731,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46723
46731
|
to: 8,
|
|
46724
46732
|
applyMigration(data) {
|
|
46725
46733
|
const namesTaken = [];
|
|
46726
|
-
const globalForbiddenInExcel = new RegExp(FORBIDDEN_IN_EXCEL_REGEX, "g");
|
|
46727
46734
|
for (let sheet of data.sheets || []) {
|
|
46728
46735
|
if (!sheet.name) {
|
|
46729
46736
|
continue;
|
|
46730
46737
|
}
|
|
46731
46738
|
const oldName = sheet.name;
|
|
46732
|
-
const escapedName = oldName
|
|
46739
|
+
const escapedName = sanitizeSheetName(oldName, "_");
|
|
46733
46740
|
let i = 1;
|
|
46734
46741
|
let newName = escapedName;
|
|
46735
46742
|
while (namesTaken.includes(newName)) {
|
|
@@ -51254,7 +51261,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51254
51261
|
if (orderedSheetIds.find((id) => sheets[id]?.name.toLowerCase() === name && id !== cmd.sheetId)) {
|
|
51255
51262
|
return "DuplicatedSheetName" /* CommandResult.DuplicatedSheetName */;
|
|
51256
51263
|
}
|
|
51257
|
-
if (
|
|
51264
|
+
if (FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX.test(name)) {
|
|
51258
51265
|
return "ForbiddenCharactersInSheetName" /* CommandResult.ForbiddenCharactersInSheetName */;
|
|
51259
51266
|
}
|
|
51260
51267
|
return "Success" /* CommandResult.Success */;
|
|
@@ -54458,6 +54465,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
54458
54465
|
}
|
|
54459
54466
|
this.nextPositionsToUpdate.addMany(this.getCellsDependingOn(invalidated));
|
|
54460
54467
|
this.nextPositionsToUpdate.addMany(this.getArrayFormulasBlockedBy(invalidated));
|
|
54468
|
+
[...invalidated].forEach((inv) => this.spreadingRelations.removeNode(inv));
|
|
54469
|
+
this.spreadingRelations.removeNode(position);
|
|
54461
54470
|
}
|
|
54462
54471
|
// ----------------------------------------------------------
|
|
54463
54472
|
// COMMON FUNCTIONALITY
|
|
@@ -56041,11 +56050,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56041
56050
|
return EMPTY_PIVOT_CELL;
|
|
56042
56051
|
}
|
|
56043
56052
|
if (functionName === "PIVOT") {
|
|
56044
|
-
const includeTotal = args[2]
|
|
56045
|
-
const
|
|
56053
|
+
const includeTotal = toScalar(args[2]);
|
|
56054
|
+
const shouldIncludeTotal = includeTotal === undefined ? true : toBoolean(includeTotal);
|
|
56055
|
+
const includeColumnHeaders = toScalar(args[3]);
|
|
56056
|
+
const shouldIncludeColumnHeaders = includeColumnHeaders === undefined ? true : toBoolean(includeColumnHeaders);
|
|
56046
56057
|
const pivotCells = pivot
|
|
56047
56058
|
.getTableStructure()
|
|
56048
|
-
.getPivotCells(
|
|
56059
|
+
.getPivotCells(shouldIncludeTotal, shouldIncludeColumnHeaders);
|
|
56049
56060
|
const pivotCol = position.col - mainPosition.col;
|
|
56050
56061
|
const pivotRow = position.row - mainPosition.row;
|
|
56051
56062
|
return pivotCells[pivotCol][pivotRow];
|
|
@@ -58150,7 +58161,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
58150
58161
|
getPivotDuplicateSheetName(pivotName) {
|
|
58151
58162
|
let i = 1;
|
|
58152
58163
|
const names = this.getters.getSheetIds().map((id) => this.getters.getSheetName(id));
|
|
58153
|
-
const sanitizedName = pivotName
|
|
58164
|
+
const sanitizedName = sanitizeSheetName(pivotName);
|
|
58154
58165
|
let name = sanitizedName;
|
|
58155
58166
|
while (names.includes(name)) {
|
|
58156
58167
|
name = `${sanitizedName} (${i})`;
|
|
@@ -62191,7 +62202,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62191
62202
|
env.raiseError(_t("A sheet with the name %s already exists. Please select another name.", name), errorCallback);
|
|
62192
62203
|
}
|
|
62193
62204
|
else if (result.reasons.includes("ForbiddenCharactersInSheetName" /* CommandResult.ForbiddenCharactersInSheetName */)) {
|
|
62194
|
-
env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).",
|
|
62205
|
+
env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).", FORBIDDEN_SHEETNAME_CHARS.join(" ")), errorCallback);
|
|
62195
62206
|
}
|
|
62196
62207
|
}
|
|
62197
62208
|
|
|
@@ -63450,7 +63461,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63450
63461
|
setup() {
|
|
63451
63462
|
owl.onWillUpdateProps((nextProps) => {
|
|
63452
63463
|
if (nextProps.action !== this.props.action) {
|
|
63453
|
-
this.actionButton = createAction(
|
|
63464
|
+
this.actionButton = createAction(nextProps.action);
|
|
63454
63465
|
}
|
|
63455
63466
|
});
|
|
63456
63467
|
}
|
|
@@ -68583,6 +68594,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68583
68594
|
createPivotFormula,
|
|
68584
68595
|
areDomainArgsFieldsValid,
|
|
68585
68596
|
formatTickValue,
|
|
68597
|
+
sanitizeSheetName,
|
|
68586
68598
|
};
|
|
68587
68599
|
const links = {
|
|
68588
68600
|
isMarkdownLink,
|
|
@@ -68713,9 +68725,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68713
68725
|
exports.tokenize = tokenize;
|
|
68714
68726
|
|
|
68715
68727
|
|
|
68716
|
-
__info__.version = "17.4.
|
|
68717
|
-
__info__.date = "2024-
|
|
68718
|
-
__info__.hash = "
|
|
68728
|
+
__info__.version = "17.4.15";
|
|
68729
|
+
__info__.date = "2024-12-05T10:40:45.905Z";
|
|
68730
|
+
__info__.hash = "9b13f22";
|
|
68719
68731
|
|
|
68720
68732
|
|
|
68721
68733
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|