@odoo/o-spreadsheet 18.1.18 → 18.1.19
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 +165 -62
- package/dist/o-spreadsheet.d.ts +8 -4
- package/dist/o-spreadsheet.esm.js +165 -62
- package/dist/o-spreadsheet.iife.js +165 -62
- package/dist/o-spreadsheet.iife.min.js +379 -379
- package/dist/o_spreadsheet.xml +7 -6
- 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.1.
|
|
6
|
-
* @date 2025-05-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.1.19
|
|
6
|
+
* @date 2025-05-12T05:26:05.861Z
|
|
7
|
+
* @hash 44cc170
|
|
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';
|
|
@@ -6271,6 +6271,25 @@ function moveHeaderIndexesOnHeaderDeletion(deletedHeaders, headers) {
|
|
|
6271
6271
|
})
|
|
6272
6272
|
.filter(isDefined);
|
|
6273
6273
|
}
|
|
6274
|
+
function getNextSheetName(existingNames, baseName = "Sheet") {
|
|
6275
|
+
let i = 1;
|
|
6276
|
+
let name = `${baseName}${i}`;
|
|
6277
|
+
while (existingNames.includes(name)) {
|
|
6278
|
+
name = `${baseName}${i}`;
|
|
6279
|
+
i++;
|
|
6280
|
+
}
|
|
6281
|
+
return name;
|
|
6282
|
+
}
|
|
6283
|
+
function getDuplicateSheetName(nameToDuplicate, existingNames) {
|
|
6284
|
+
let i = 1;
|
|
6285
|
+
const baseName = _t("Copy of %s", nameToDuplicate);
|
|
6286
|
+
let name = baseName.toString();
|
|
6287
|
+
while (existingNames.includes(name)) {
|
|
6288
|
+
name = `${baseName} (${i})`;
|
|
6289
|
+
i++;
|
|
6290
|
+
}
|
|
6291
|
+
return name;
|
|
6292
|
+
}
|
|
6274
6293
|
|
|
6275
6294
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
6276
6295
|
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
@@ -7969,6 +7988,24 @@ const monthNumberAdapter = {
|
|
|
7969
7988
|
return `${normalizedValue}`;
|
|
7970
7989
|
},
|
|
7971
7990
|
};
|
|
7991
|
+
/**
|
|
7992
|
+
* normalizes month number + year
|
|
7993
|
+
*/
|
|
7994
|
+
const monthAdapter = {
|
|
7995
|
+
normalizeFunctionValue(value) {
|
|
7996
|
+
const date = toNumber(value, DEFAULT_LOCALE);
|
|
7997
|
+
return formatValue(date, { locale: DEFAULT_LOCALE, format: "mm/yyyy" });
|
|
7998
|
+
},
|
|
7999
|
+
toValueAndFormat(normalizedValue) {
|
|
8000
|
+
return {
|
|
8001
|
+
value: toNumber(normalizedValue, DEFAULT_LOCALE),
|
|
8002
|
+
format: "mmmm yyyy",
|
|
8003
|
+
};
|
|
8004
|
+
},
|
|
8005
|
+
toFunctionValue(normalizedValue) {
|
|
8006
|
+
return `"${normalizedValue}"`;
|
|
8007
|
+
},
|
|
8008
|
+
};
|
|
7972
8009
|
/**
|
|
7973
8010
|
* normalizes quarter number
|
|
7974
8011
|
*/
|
|
@@ -8099,6 +8136,7 @@ pivotTimeAdapterRegistry
|
|
|
8099
8136
|
.add("day_of_month", nullHandlerDecorator(dayOfMonthAdapter))
|
|
8100
8137
|
.add("iso_week_number", nullHandlerDecorator(isoWeekNumberAdapter))
|
|
8101
8138
|
.add("month_number", nullHandlerDecorator(monthNumberAdapter))
|
|
8139
|
+
.add("month", nullHandlerDecorator(monthAdapter))
|
|
8102
8140
|
.add("quarter_number", nullHandlerDecorator(quarterNumberAdapter))
|
|
8103
8141
|
.add("day_of_week", nullHandlerDecorator(dayOfWeekAdapter))
|
|
8104
8142
|
.add("hour_number", nullHandlerDecorator(hourNumberAdapter))
|
|
@@ -8278,10 +8316,7 @@ function toNormalizedPivotValue(dimension, groupValue) {
|
|
|
8278
8316
|
return normalizer(groupValueString, dimension.granularity);
|
|
8279
8317
|
}
|
|
8280
8318
|
function normalizeDateTime(value, granularity) {
|
|
8281
|
-
|
|
8282
|
-
throw new Error("Missing granularity");
|
|
8283
|
-
}
|
|
8284
|
-
return pivotTimeAdapter(granularity).normalizeFunctionValue(value);
|
|
8319
|
+
return pivotTimeAdapter(granularity ?? "month").normalizeFunctionValue(value);
|
|
8285
8320
|
}
|
|
8286
8321
|
function toFunctionPivotValue(value, dimension) {
|
|
8287
8322
|
if (value === null) {
|
|
@@ -8293,10 +8328,7 @@ function toFunctionPivotValue(value, dimension) {
|
|
|
8293
8328
|
return pivotToFunctionValueRegistry.get(dimension.type)(value, dimension.granularity);
|
|
8294
8329
|
}
|
|
8295
8330
|
function toFunctionValueDateTime(value, granularity) {
|
|
8296
|
-
|
|
8297
|
-
throw new Error("Missing granularity");
|
|
8298
|
-
}
|
|
8299
|
-
return pivotTimeAdapter(granularity).toFunctionValue(value);
|
|
8331
|
+
return pivotTimeAdapter(granularity ?? "month").toFunctionValue(value);
|
|
8300
8332
|
}
|
|
8301
8333
|
const pivotNormalizationValueRegistry = new Registry();
|
|
8302
8334
|
pivotNormalizationValueRegistry
|
|
@@ -9611,12 +9643,24 @@ class ComposerFocusStore extends SpreadsheetStore {
|
|
|
9611
9643
|
}
|
|
9612
9644
|
|
|
9613
9645
|
const chartJsExtensionRegistry = new Registry();
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9646
|
+
function areChartJSExtensionsLoaded() {
|
|
9647
|
+
return !!window.Chart.registry.plugins.get("chartShowValuesPlugin");
|
|
9648
|
+
}
|
|
9649
|
+
function registerChartJSExtensions() {
|
|
9650
|
+
if (!window.Chart || areChartJSExtensionsLoaded()) {
|
|
9651
|
+
return;
|
|
9652
|
+
}
|
|
9653
|
+
for (const registryItem of chartJsExtensionRegistry.getAll()) {
|
|
9654
|
+
registryItem.register(window.Chart);
|
|
9655
|
+
}
|
|
9656
|
+
}
|
|
9657
|
+
function unregisterChartJsExtensions() {
|
|
9658
|
+
if (!window.Chart) {
|
|
9659
|
+
return;
|
|
9660
|
+
}
|
|
9661
|
+
for (const registryItem of chartJsExtensionRegistry.getAll()) {
|
|
9662
|
+
registryItem.unregister(window.Chart);
|
|
9618
9663
|
}
|
|
9619
|
-
return window.Chart;
|
|
9620
9664
|
}
|
|
9621
9665
|
|
|
9622
9666
|
const TREND_LINE_XAXIS_ID = "x1";
|
|
@@ -10157,8 +10201,14 @@ function getNextNonEmptyBar(bars, startIndex) {
|
|
|
10157
10201
|
return bars.find((bar, i) => i > startIndex && bar.height !== 0);
|
|
10158
10202
|
}
|
|
10159
10203
|
|
|
10160
|
-
chartJsExtensionRegistry.add("chartShowValuesPlugin",
|
|
10161
|
-
|
|
10204
|
+
chartJsExtensionRegistry.add("chartShowValuesPlugin", {
|
|
10205
|
+
register: (Chart) => Chart.register(chartShowValuesPlugin),
|
|
10206
|
+
unregister: (Chart) => Chart.unregister(chartShowValuesPlugin),
|
|
10207
|
+
});
|
|
10208
|
+
chartJsExtensionRegistry.add("waterfallLinesPlugin", {
|
|
10209
|
+
register: (Chart) => Chart.register(waterfallLinesPlugin),
|
|
10210
|
+
unregister: (Chart) => Chart.unregister(waterfallLinesPlugin),
|
|
10211
|
+
});
|
|
10162
10212
|
class ChartJsComponent extends Component {
|
|
10163
10213
|
static template = "o-spreadsheet-ChartJsComponent";
|
|
10164
10214
|
static props = {
|
|
@@ -10210,8 +10260,7 @@ class ChartJsComponent extends Component {
|
|
|
10210
10260
|
createChart(chartData) {
|
|
10211
10261
|
const canvas = this.canvas.el;
|
|
10212
10262
|
const ctx = canvas.getContext("2d");
|
|
10213
|
-
|
|
10214
|
-
this.chart = new Chart(ctx, chartData);
|
|
10263
|
+
this.chart = new window.Chart(ctx, chartData);
|
|
10215
10264
|
}
|
|
10216
10265
|
updateChartJs(chartData) {
|
|
10217
10266
|
if (chartData.data && chartData.data.datasets) {
|
|
@@ -18343,7 +18392,7 @@ const IF = {
|
|
|
18343
18392
|
return { value: "" };
|
|
18344
18393
|
}
|
|
18345
18394
|
if (result.value === null) {
|
|
18346
|
-
result
|
|
18395
|
+
return { ...result, value: "" };
|
|
18347
18396
|
}
|
|
18348
18397
|
return result;
|
|
18349
18398
|
},
|
|
@@ -18364,7 +18413,7 @@ const IFERROR = {
|
|
|
18364
18413
|
return { value: "" };
|
|
18365
18414
|
}
|
|
18366
18415
|
if (result.value === null) {
|
|
18367
|
-
result
|
|
18416
|
+
return { ...result, value: "" };
|
|
18368
18417
|
}
|
|
18369
18418
|
return result;
|
|
18370
18419
|
},
|
|
@@ -18385,7 +18434,7 @@ const IFNA = {
|
|
|
18385
18434
|
return { value: "" };
|
|
18386
18435
|
}
|
|
18387
18436
|
if (result.value === null) {
|
|
18388
|
-
result
|
|
18437
|
+
return { ...result, value: "" };
|
|
18389
18438
|
}
|
|
18390
18439
|
return result;
|
|
18391
18440
|
},
|
|
@@ -18411,7 +18460,7 @@ const IFS = {
|
|
|
18411
18460
|
return { value: "" };
|
|
18412
18461
|
}
|
|
18413
18462
|
if (result.value === null) {
|
|
18414
|
-
result
|
|
18463
|
+
return { ...result, value: "" };
|
|
18415
18464
|
}
|
|
18416
18465
|
return result;
|
|
18417
18466
|
}
|
|
@@ -18529,6 +18578,11 @@ function addPivotDependencies(evalContext, coreDefinition, forMeasures) {
|
|
|
18529
18578
|
if (range === undefined || range.invalidXc || range.invalidSheetName) {
|
|
18530
18579
|
throw new InvalidReferenceError();
|
|
18531
18580
|
}
|
|
18581
|
+
if (evalContext.__originCellPosition &&
|
|
18582
|
+
range.sheetId === evalContext.__originSheetId &&
|
|
18583
|
+
isZoneInside(positionToZone(evalContext.__originCellPosition), zone)) {
|
|
18584
|
+
throw new CircularDependencyError();
|
|
18585
|
+
}
|
|
18532
18586
|
dependencies.push(range);
|
|
18533
18587
|
}
|
|
18534
18588
|
for (const measure of forMeasures) {
|
|
@@ -22790,6 +22844,7 @@ const CHART_COMMON_OPTIONS = {
|
|
|
22790
22844
|
},
|
|
22791
22845
|
},
|
|
22792
22846
|
animation: false,
|
|
22847
|
+
events: ["mousemove", "mouseout", "click", "touchstart", "touchmove", "mouseup"],
|
|
22793
22848
|
};
|
|
22794
22849
|
function truncateLabel(label) {
|
|
22795
22850
|
if (!label) {
|
|
@@ -22815,8 +22870,7 @@ function chartToImage(runtime, figure, type) {
|
|
|
22815
22870
|
if ("chartJsConfig" in runtime) {
|
|
22816
22871
|
const config = deepCopy(runtime.chartJsConfig);
|
|
22817
22872
|
config.plugins = [backgroundColorChartJSPlugin];
|
|
22818
|
-
const
|
|
22819
|
-
const chart = new Chart(canvas, config);
|
|
22873
|
+
const chart = new window.Chart(canvas, config);
|
|
22820
22874
|
const imgContent = chart.toBase64Image();
|
|
22821
22875
|
chart.destroy();
|
|
22822
22876
|
div.remove();
|
|
@@ -27948,6 +28002,7 @@ function repairInitialMessages(data, initialMessages) {
|
|
|
27948
28002
|
initialMessages = dropCommands(initialMessages, "SORT_CELLS");
|
|
27949
28003
|
initialMessages = dropCommands(initialMessages, "SET_DECIMAL");
|
|
27950
28004
|
initialMessages = fixChartDefinitions(data, initialMessages);
|
|
28005
|
+
initialMessages = fixTranslatedDuplicateSheetName(data, initialMessages);
|
|
27951
28006
|
return initialMessages;
|
|
27952
28007
|
}
|
|
27953
28008
|
/**
|
|
@@ -28047,6 +28102,40 @@ function fixChartDefinitions(data, initialMessages) {
|
|
|
28047
28102
|
}
|
|
28048
28103
|
return messages;
|
|
28049
28104
|
}
|
|
28105
|
+
function fixTranslatedDuplicateSheetName(data, initialMessages) {
|
|
28106
|
+
const sheetNames = {};
|
|
28107
|
+
for (const sheet of data.sheets || []) {
|
|
28108
|
+
sheetNames[sheet.id] = sheet.name;
|
|
28109
|
+
}
|
|
28110
|
+
const messages = [];
|
|
28111
|
+
for (const message of initialMessages) {
|
|
28112
|
+
if (message.type === "REMOTE_REVISION") {
|
|
28113
|
+
const commands = [];
|
|
28114
|
+
for (const cmd of message.commands) {
|
|
28115
|
+
switch (cmd.type) {
|
|
28116
|
+
case "DUPLICATE_SHEET":
|
|
28117
|
+
cmd.sheetNameTo =
|
|
28118
|
+
cmd.sheetNameTo ??
|
|
28119
|
+
getDuplicateSheetName(sheetNames[cmd.sheetId], Object.values(sheetNames));
|
|
28120
|
+
break;
|
|
28121
|
+
case "CREATE_SHEET":
|
|
28122
|
+
case "RENAME_SHEET":
|
|
28123
|
+
sheetNames[cmd.sheetId] = cmd.name || getNextSheetName(Object.values(sheetNames));
|
|
28124
|
+
break;
|
|
28125
|
+
}
|
|
28126
|
+
commands.push(cmd);
|
|
28127
|
+
}
|
|
28128
|
+
messages.push({
|
|
28129
|
+
...message,
|
|
28130
|
+
commands,
|
|
28131
|
+
});
|
|
28132
|
+
}
|
|
28133
|
+
else {
|
|
28134
|
+
messages.push(message);
|
|
28135
|
+
}
|
|
28136
|
+
}
|
|
28137
|
+
return initialMessages;
|
|
28138
|
+
}
|
|
28050
28139
|
// -----------------------------------------------------------------------------
|
|
28051
28140
|
// Helpers
|
|
28052
28141
|
// -----------------------------------------------------------------------------
|
|
@@ -28844,12 +28933,11 @@ function canBeLinearChart(definition, dataSets, labelRange, getters) {
|
|
|
28844
28933
|
}
|
|
28845
28934
|
let missingTimeAdapterAlreadyWarned = false;
|
|
28846
28935
|
function isLuxonTimeAdapterInstalled() {
|
|
28847
|
-
|
|
28848
|
-
if (!Chart) {
|
|
28936
|
+
if (!window.Chart) {
|
|
28849
28937
|
return false;
|
|
28850
28938
|
}
|
|
28851
28939
|
// @ts-ignore
|
|
28852
|
-
const adapter = new Chart._adapters._date({});
|
|
28940
|
+
const adapter = new window.Chart._adapters._date({});
|
|
28853
28941
|
const isInstalled = adapter._id === "luxon";
|
|
28854
28942
|
if (!isInstalled && !missingTimeAdapterAlreadyWarned) {
|
|
28855
28943
|
missingTimeAdapterAlreadyWarned = true;
|
|
@@ -29487,6 +29575,9 @@ const INTERACTIVE_LEGEND_CONFIG = {
|
|
|
29487
29575
|
target.style.cursor = "default";
|
|
29488
29576
|
},
|
|
29489
29577
|
onClick: (event, legendItem, legend) => {
|
|
29578
|
+
if (event.type !== "click") {
|
|
29579
|
+
return;
|
|
29580
|
+
}
|
|
29490
29581
|
const index = legendItem.datasetIndex;
|
|
29491
29582
|
if (!legend.legendItems || index === undefined) {
|
|
29492
29583
|
return;
|
|
@@ -33212,10 +33303,13 @@ const duplicateSheet = {
|
|
|
33212
33303
|
name: _t("Duplicate"),
|
|
33213
33304
|
execute: (env) => {
|
|
33214
33305
|
const sheetIdFrom = env.model.getters.getActiveSheetId();
|
|
33306
|
+
const sheetNameFrom = env.model.getters.getSheetName(sheetIdFrom);
|
|
33215
33307
|
const sheetIdTo = env.model.uuidGenerator.smallUuid();
|
|
33308
|
+
const sheetNameTo = env.model.getters.getDuplicateSheetName(sheetNameFrom);
|
|
33216
33309
|
env.model.dispatch("DUPLICATE_SHEET", {
|
|
33217
33310
|
sheetId: sheetIdFrom,
|
|
33218
33311
|
sheetIdTo,
|
|
33312
|
+
sheetNameTo,
|
|
33219
33313
|
});
|
|
33220
33314
|
env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom, sheetIdTo });
|
|
33221
33315
|
},
|
|
@@ -41035,6 +41129,13 @@ class Composer extends Component {
|
|
|
41035
41129
|
openAssistant() {
|
|
41036
41130
|
this.assistant.forcedClosed = false;
|
|
41037
41131
|
}
|
|
41132
|
+
onWheel(event) {
|
|
41133
|
+
// detect if scrollbar is available
|
|
41134
|
+
if (this.composerRef.el &&
|
|
41135
|
+
this.composerRef.el.scrollHeight > this.composerRef.el.clientHeight) {
|
|
41136
|
+
event.stopPropagation();
|
|
41137
|
+
}
|
|
41138
|
+
}
|
|
41038
41139
|
// ---------------------------------------------------------------------------
|
|
41039
41140
|
// Private
|
|
41040
41141
|
// ---------------------------------------------------------------------------
|
|
@@ -45972,8 +46073,8 @@ function compareDimensionValues(dimension, a, b) {
|
|
|
45972
46073
|
|
|
45973
46074
|
const NULL_SYMBOL = Symbol("NULL");
|
|
45974
46075
|
function createDate(dimension, value, locale) {
|
|
45975
|
-
const granularity = dimension.granularity;
|
|
45976
|
-
if (!
|
|
46076
|
+
const granularity = dimension.granularity || "month";
|
|
46077
|
+
if (!(granularity in MAP_VALUE_DIMENSION_DATE)) {
|
|
45977
46078
|
throw new Error(`Unknown date granularity: ${granularity}`);
|
|
45978
46079
|
}
|
|
45979
46080
|
const keyInMap = typeof value === "number" || typeof value === "string" ? value : NULL_SYMBOL;
|
|
@@ -45992,6 +46093,9 @@ function createDate(dimension, value, locale) {
|
|
|
45992
46093
|
case "month_number":
|
|
45993
46094
|
number = date.getMonth() + 1;
|
|
45994
46095
|
break;
|
|
46096
|
+
case "month":
|
|
46097
|
+
number = Math.floor(toNumber(value, locale));
|
|
46098
|
+
break;
|
|
45995
46099
|
case "iso_week_number":
|
|
45996
46100
|
number = date.getIsoWeek();
|
|
45997
46101
|
break;
|
|
@@ -46085,6 +46189,10 @@ const MAP_VALUE_DIMENSION_DATE = {
|
|
|
46085
46189
|
set: new Set(),
|
|
46086
46190
|
values: {},
|
|
46087
46191
|
},
|
|
46192
|
+
month: {
|
|
46193
|
+
set: new Set(),
|
|
46194
|
+
values: {},
|
|
46195
|
+
},
|
|
46088
46196
|
iso_week_number: {
|
|
46089
46197
|
set: new Set(),
|
|
46090
46198
|
values: {},
|
|
@@ -46295,7 +46403,7 @@ class SpreadsheetPivot {
|
|
|
46295
46403
|
const cells = this.filterDataEntriesFromDomain(this.dataEntries, domain);
|
|
46296
46404
|
const finalCell = cells[0]?.[dimension.nameWithGranularity];
|
|
46297
46405
|
if (dimension.type === "datetime") {
|
|
46298
|
-
const adapter = pivotTimeAdapter(dimension.granularity);
|
|
46406
|
+
const adapter = pivotTimeAdapter((dimension.granularity || "month"));
|
|
46299
46407
|
return adapter.toValueAndFormat(lastNode.value, this.getters.getLocale());
|
|
46300
46408
|
}
|
|
46301
46409
|
if (!finalCell) {
|
|
@@ -46413,7 +46521,7 @@ class SpreadsheetPivot {
|
|
|
46413
46521
|
if (nonEmptyCells.length === 0) {
|
|
46414
46522
|
return "integer";
|
|
46415
46523
|
}
|
|
46416
|
-
if (nonEmptyCells.every((cell) => cell.format && isDateTimeFormat(cell.format))) {
|
|
46524
|
+
if (nonEmptyCells.every((cell) => cell.type === CellValueType.number && cell.format && isDateTimeFormat(cell.format))) {
|
|
46417
46525
|
return "datetime";
|
|
46418
46526
|
}
|
|
46419
46527
|
if (nonEmptyCells.every((cell) => cell.type === CellValueType.boolean)) {
|
|
@@ -46508,7 +46616,7 @@ class SpreadsheetPivot {
|
|
|
46508
46616
|
for (const entry of dataEntries) {
|
|
46509
46617
|
for (const dimension of dateDimensions) {
|
|
46510
46618
|
const value = createDate(dimension, entry[dimension.fieldName]?.value || null, this.getters.getLocale());
|
|
46511
|
-
const adapter = pivotTimeAdapter(dimension.granularity);
|
|
46619
|
+
const adapter = pivotTimeAdapter((dimension.granularity || "month"));
|
|
46512
46620
|
const { format, value: valueToFormat } = adapter.toValueAndFormat(value, locale);
|
|
46513
46621
|
entry[dimension.nameWithGranularity] = {
|
|
46514
46622
|
value,
|
|
@@ -46528,6 +46636,7 @@ const dateGranularities = [
|
|
|
46528
46636
|
"year",
|
|
46529
46637
|
"quarter_number",
|
|
46530
46638
|
"month_number",
|
|
46639
|
+
"month",
|
|
46531
46640
|
"iso_week_number",
|
|
46532
46641
|
"day_of_month",
|
|
46533
46642
|
"day",
|
|
@@ -46775,7 +46884,7 @@ class PivotSidePanelStore extends SpreadsheetStore {
|
|
|
46775
46884
|
: this.datetimeGranularities);
|
|
46776
46885
|
}
|
|
46777
46886
|
for (const field of dateFields) {
|
|
46778
|
-
granularitiesPerFields[field.fieldName].delete(field.granularity);
|
|
46887
|
+
granularitiesPerFields[field.fieldName].delete(field.granularity || "month");
|
|
46779
46888
|
}
|
|
46780
46889
|
return granularitiesPerFields;
|
|
46781
46890
|
}
|
|
@@ -48950,6 +49059,8 @@ class GridComposer extends Component {
|
|
|
48950
49059
|
}
|
|
48951
49060
|
get composerProps() {
|
|
48952
49061
|
const { width, height } = this.env.model.getters.getSheetViewDimensionWithHeaders();
|
|
49062
|
+
// Remove the wrapper border width
|
|
49063
|
+
const maxHeight = this.props.gridDims.height - this.rect.y - 2 * COMPOSER_BORDER_WIDTH;
|
|
48953
49064
|
return {
|
|
48954
49065
|
rect: { ...this.rect },
|
|
48955
49066
|
delimitation: {
|
|
@@ -48967,6 +49078,7 @@ class GridComposer extends Component {
|
|
|
48967
49078
|
}),
|
|
48968
49079
|
onInputContextMenu: this.props.onInputContextMenu,
|
|
48969
49080
|
composerStore: this.composerStore,
|
|
49081
|
+
inputStyle: `max-height: ${maxHeight}px;`,
|
|
48970
49082
|
};
|
|
48971
49083
|
}
|
|
48972
49084
|
get containerStyle() {
|
|
@@ -54257,9 +54369,7 @@ class ChartPlugin extends CorePlugin {
|
|
|
54257
54369
|
: "Success" /* CommandResult.Success */;
|
|
54258
54370
|
}
|
|
54259
54371
|
checkChartExists(cmd) {
|
|
54260
|
-
return this.
|
|
54261
|
-
? "Success" /* CommandResult.Success */
|
|
54262
|
-
: "ChartDoesNotExist" /* CommandResult.ChartDoesNotExist */;
|
|
54372
|
+
return this.isChartDefined(cmd.id) ? "Success" /* CommandResult.Success */ : "ChartDoesNotExist" /* CommandResult.ChartDoesNotExist */;
|
|
54263
54373
|
}
|
|
54264
54374
|
}
|
|
54265
54375
|
|
|
@@ -56544,6 +56654,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
56544
56654
|
"getCommandZones",
|
|
56545
56655
|
"getUnboundedZone",
|
|
56546
56656
|
"checkElementsIncludeAllNonFrozenHeaders",
|
|
56657
|
+
"getDuplicateSheetName",
|
|
56547
56658
|
];
|
|
56548
56659
|
sheetIdsMapName = {};
|
|
56549
56660
|
orderedSheetIds = [];
|
|
@@ -56568,7 +56679,11 @@ class SheetPlugin extends CorePlugin {
|
|
|
56568
56679
|
return this.checkValidations(cmd, this.checkSheetName, this.checkSheetPosition);
|
|
56569
56680
|
}
|
|
56570
56681
|
case "DUPLICATE_SHEET": {
|
|
56571
|
-
|
|
56682
|
+
if (this.sheets[cmd.sheetIdTo])
|
|
56683
|
+
return "DuplicatedSheetId" /* CommandResult.DuplicatedSheetId */;
|
|
56684
|
+
if (this.orderedSheetIds.map(this.getSheetName.bind(this)).includes(cmd.sheetNameTo))
|
|
56685
|
+
return "DuplicatedSheetName" /* CommandResult.DuplicatedSheetName */;
|
|
56686
|
+
return "Success" /* CommandResult.Success */;
|
|
56572
56687
|
}
|
|
56573
56688
|
case "MOVE_SHEET":
|
|
56574
56689
|
try {
|
|
@@ -56645,7 +56760,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
56645
56760
|
this.showSheet(cmd.sheetId);
|
|
56646
56761
|
break;
|
|
56647
56762
|
case "DUPLICATE_SHEET":
|
|
56648
|
-
this.duplicateSheet(cmd.sheetId, cmd.sheetIdTo);
|
|
56763
|
+
this.duplicateSheet(cmd.sheetId, cmd.sheetIdTo, cmd.sheetNameTo);
|
|
56649
56764
|
break;
|
|
56650
56765
|
case "DELETE_SHEET":
|
|
56651
56766
|
this.deleteSheet(this.sheets[cmd.sheetId]);
|
|
@@ -56851,14 +56966,8 @@ class SheetPlugin extends CorePlugin {
|
|
|
56851
56966
|
return dimension === "COL" ? this.getNumberCols(sheetId) : this.getNumberRows(sheetId);
|
|
56852
56967
|
}
|
|
56853
56968
|
getNextSheetName(baseName = "Sheet") {
|
|
56854
|
-
let i = 1;
|
|
56855
56969
|
const names = this.orderedSheetIds.map(this.getSheetName.bind(this));
|
|
56856
|
-
|
|
56857
|
-
while (names.includes(name)) {
|
|
56858
|
-
name = `${baseName}${i}`;
|
|
56859
|
-
i++;
|
|
56860
|
-
}
|
|
56861
|
-
return name;
|
|
56970
|
+
return getNextSheetName(names, baseName);
|
|
56862
56971
|
}
|
|
56863
56972
|
getSheetSize(sheetId) {
|
|
56864
56973
|
return {
|
|
@@ -57104,9 +57213,8 @@ class SheetPlugin extends CorePlugin {
|
|
|
57104
57213
|
showSheet(sheetId) {
|
|
57105
57214
|
this.history.update("sheets", sheetId, "isVisible", true);
|
|
57106
57215
|
}
|
|
57107
|
-
duplicateSheet(fromId, toId) {
|
|
57216
|
+
duplicateSheet(fromId, toId, toName) {
|
|
57108
57217
|
const sheet = this.getSheet(fromId);
|
|
57109
|
-
const toName = this.getDuplicateSheetName(sheet.name);
|
|
57110
57218
|
const newSheet = deepCopy(sheet);
|
|
57111
57219
|
newSheet.id = toId;
|
|
57112
57220
|
newSheet.name = toName;
|
|
@@ -57138,15 +57246,8 @@ class SheetPlugin extends CorePlugin {
|
|
|
57138
57246
|
this.history.update("sheetIdsMapName", sheetIdsMapName);
|
|
57139
57247
|
}
|
|
57140
57248
|
getDuplicateSheetName(sheetName) {
|
|
57141
|
-
let i = 1;
|
|
57142
57249
|
const names = this.orderedSheetIds.map(this.getSheetName.bind(this));
|
|
57143
|
-
|
|
57144
|
-
let name = baseName.toString();
|
|
57145
|
-
while (names.includes(name)) {
|
|
57146
|
-
name = `${baseName} (${i})`;
|
|
57147
|
-
i++;
|
|
57148
|
-
}
|
|
57149
|
-
return name;
|
|
57250
|
+
return getDuplicateSheetName(sheetName, names);
|
|
57150
57251
|
}
|
|
57151
57252
|
deleteSheet(sheet) {
|
|
57152
57253
|
const name = sheet.name;
|
|
@@ -59973,8 +60074,8 @@ class SpreadingRelation {
|
|
|
59973
60074
|
const EMPTY_ARRAY = [];
|
|
59974
60075
|
|
|
59975
60076
|
const MAX_ITERATION = 30;
|
|
59976
|
-
const ERROR_CYCLE_CELL = createEvaluatedCell(new CircularDependencyError());
|
|
59977
|
-
const EMPTY_CELL = createEvaluatedCell({ value: null });
|
|
60077
|
+
const ERROR_CYCLE_CELL = Object.freeze(createEvaluatedCell(new CircularDependencyError()));
|
|
60078
|
+
const EMPTY_CELL = Object.freeze(createEvaluatedCell({ value: null }));
|
|
59978
60079
|
class Evaluator {
|
|
59979
60080
|
context;
|
|
59980
60081
|
getters;
|
|
@@ -71306,11 +71407,13 @@ class Spreadsheet extends Component {
|
|
|
71306
71407
|
this.checkViewportSize();
|
|
71307
71408
|
stores.on("store-updated", this, render);
|
|
71308
71409
|
resizeObserver.observe(this.spreadsheetRef.el);
|
|
71410
|
+
registerChartJSExtensions();
|
|
71309
71411
|
});
|
|
71310
71412
|
onWillUnmount(() => {
|
|
71311
71413
|
this.unbindModelEvents();
|
|
71312
71414
|
stores.off("store-updated", this);
|
|
71313
71415
|
resizeObserver.disconnect();
|
|
71416
|
+
unregisterChartJsExtensions();
|
|
71314
71417
|
});
|
|
71315
71418
|
onPatched(() => {
|
|
71316
71419
|
this.checkViewportSize();
|
|
@@ -75760,6 +75863,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
75760
75863
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, 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 };
|
|
75761
75864
|
|
|
75762
75865
|
|
|
75763
|
-
__info__.version = "18.1.
|
|
75764
|
-
__info__.date = "2025-05-
|
|
75765
|
-
__info__.hash = "
|
|
75866
|
+
__info__.version = "18.1.19";
|
|
75867
|
+
__info__.date = "2025-05-12T05:26:05.861Z";
|
|
75868
|
+
__info__.hash = "44cc170";
|