@odoo/o-spreadsheet 18.2.10 → 18.2.11
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 +172 -55
- package/dist/o-spreadsheet.d.ts +9 -4
- package/dist/o-spreadsheet.esm.js +172 -55
- package/dist/o-spreadsheet.iife.js +172 -55
- package/dist/o-spreadsheet.iife.min.js +380 -380
- 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.2.
|
|
6
|
-
* @date 2025-05-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.11
|
|
6
|
+
* @date 2025-05-12T05:25:59.138Z
|
|
7
|
+
* @hash eb87dca
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -6281,6 +6281,25 @@
|
|
|
6281
6281
|
})
|
|
6282
6282
|
.filter(isDefined);
|
|
6283
6283
|
}
|
|
6284
|
+
function getNextSheetName(existingNames, baseName = "Sheet") {
|
|
6285
|
+
let i = 1;
|
|
6286
|
+
let name = `${baseName}${i}`;
|
|
6287
|
+
while (existingNames.includes(name)) {
|
|
6288
|
+
name = `${baseName}${i}`;
|
|
6289
|
+
i++;
|
|
6290
|
+
}
|
|
6291
|
+
return name;
|
|
6292
|
+
}
|
|
6293
|
+
function getDuplicateSheetName(nameToDuplicate, existingNames) {
|
|
6294
|
+
let i = 1;
|
|
6295
|
+
const baseName = _t("Copy of %s", nameToDuplicate);
|
|
6296
|
+
let name = baseName.toString();
|
|
6297
|
+
while (existingNames.includes(name)) {
|
|
6298
|
+
name = `${baseName} (${i})`;
|
|
6299
|
+
i++;
|
|
6300
|
+
}
|
|
6301
|
+
return name;
|
|
6302
|
+
}
|
|
6284
6303
|
|
|
6285
6304
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
6286
6305
|
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
@@ -7979,6 +7998,24 @@
|
|
|
7979
7998
|
return `${normalizedValue}`;
|
|
7980
7999
|
},
|
|
7981
8000
|
};
|
|
8001
|
+
/**
|
|
8002
|
+
* normalizes month number + year
|
|
8003
|
+
*/
|
|
8004
|
+
const monthAdapter = {
|
|
8005
|
+
normalizeFunctionValue(value) {
|
|
8006
|
+
const date = toNumber(value, DEFAULT_LOCALE);
|
|
8007
|
+
return formatValue(date, { locale: DEFAULT_LOCALE, format: "mm/yyyy" });
|
|
8008
|
+
},
|
|
8009
|
+
toValueAndFormat(normalizedValue) {
|
|
8010
|
+
return {
|
|
8011
|
+
value: toNumber(normalizedValue, DEFAULT_LOCALE),
|
|
8012
|
+
format: "mmmm yyyy",
|
|
8013
|
+
};
|
|
8014
|
+
},
|
|
8015
|
+
toFunctionValue(normalizedValue) {
|
|
8016
|
+
return `"${normalizedValue}"`;
|
|
8017
|
+
},
|
|
8018
|
+
};
|
|
7982
8019
|
/**
|
|
7983
8020
|
* normalizes quarter number
|
|
7984
8021
|
*/
|
|
@@ -8109,6 +8146,7 @@
|
|
|
8109
8146
|
.add("day_of_month", nullHandlerDecorator(dayOfMonthAdapter))
|
|
8110
8147
|
.add("iso_week_number", nullHandlerDecorator(isoWeekNumberAdapter))
|
|
8111
8148
|
.add("month_number", nullHandlerDecorator(monthNumberAdapter))
|
|
8149
|
+
.add("month", nullHandlerDecorator(monthAdapter))
|
|
8112
8150
|
.add("quarter_number", nullHandlerDecorator(quarterNumberAdapter))
|
|
8113
8151
|
.add("day_of_week", nullHandlerDecorator(dayOfWeekAdapter))
|
|
8114
8152
|
.add("hour_number", nullHandlerDecorator(hourNumberAdapter))
|
|
@@ -8289,10 +8327,7 @@
|
|
|
8289
8327
|
return normalizer(groupValueString, dimension.granularity);
|
|
8290
8328
|
}
|
|
8291
8329
|
function normalizeDateTime(value, granularity) {
|
|
8292
|
-
|
|
8293
|
-
throw new Error("Missing granularity");
|
|
8294
|
-
}
|
|
8295
|
-
return pivotTimeAdapter(granularity).normalizeFunctionValue(value);
|
|
8330
|
+
return pivotTimeAdapter(granularity ?? "month").normalizeFunctionValue(value);
|
|
8296
8331
|
}
|
|
8297
8332
|
function toFunctionPivotValue(value, dimension) {
|
|
8298
8333
|
if (value === null) {
|
|
@@ -8304,10 +8339,7 @@
|
|
|
8304
8339
|
return pivotToFunctionValueRegistry.get(dimension.type)(value, dimension.granularity);
|
|
8305
8340
|
}
|
|
8306
8341
|
function toFunctionValueDateTime(value, granularity) {
|
|
8307
|
-
|
|
8308
|
-
throw new Error("Missing granularity");
|
|
8309
|
-
}
|
|
8310
|
-
return pivotTimeAdapter(granularity).toFunctionValue(value);
|
|
8342
|
+
return pivotTimeAdapter(granularity ?? "month").toFunctionValue(value);
|
|
8311
8343
|
}
|
|
8312
8344
|
const pivotNormalizationValueRegistry = new Registry();
|
|
8313
8345
|
pivotNormalizationValueRegistry
|
|
@@ -9766,12 +9798,24 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9766
9798
|
}
|
|
9767
9799
|
|
|
9768
9800
|
const chartJsExtensionRegistry = new Registry();
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9801
|
+
function areChartJSExtensionsLoaded() {
|
|
9802
|
+
return !!window.Chart.registry.plugins.get("chartShowValuesPlugin");
|
|
9803
|
+
}
|
|
9804
|
+
function registerChartJSExtensions() {
|
|
9805
|
+
if (!window.Chart || areChartJSExtensionsLoaded()) {
|
|
9806
|
+
return;
|
|
9807
|
+
}
|
|
9808
|
+
for (const registryItem of chartJsExtensionRegistry.getAll()) {
|
|
9809
|
+
registryItem.register(window.Chart);
|
|
9810
|
+
}
|
|
9811
|
+
}
|
|
9812
|
+
function unregisterChartJsExtensions() {
|
|
9813
|
+
if (!window.Chart) {
|
|
9814
|
+
return;
|
|
9815
|
+
}
|
|
9816
|
+
for (const registryItem of chartJsExtensionRegistry.getAll()) {
|
|
9817
|
+
registryItem.unregister(window.Chart);
|
|
9773
9818
|
}
|
|
9774
|
-
return window.Chart;
|
|
9775
9819
|
}
|
|
9776
9820
|
|
|
9777
9821
|
const TREND_LINE_XAXIS_ID = "x1";
|
|
@@ -10331,8 +10375,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10331
10375
|
}
|
|
10332
10376
|
}
|
|
10333
10377
|
`;
|
|
10334
|
-
chartJsExtensionRegistry.add("chartShowValuesPlugin",
|
|
10335
|
-
|
|
10378
|
+
chartJsExtensionRegistry.add("chartShowValuesPlugin", {
|
|
10379
|
+
register: (Chart) => Chart.register(chartShowValuesPlugin),
|
|
10380
|
+
unregister: (Chart) => Chart.unregister(chartShowValuesPlugin),
|
|
10381
|
+
});
|
|
10382
|
+
chartJsExtensionRegistry.add("waterfallLinesPlugin", {
|
|
10383
|
+
register: (Chart) => Chart.register(waterfallLinesPlugin),
|
|
10384
|
+
unregister: (Chart) => Chart.unregister(waterfallLinesPlugin),
|
|
10385
|
+
});
|
|
10336
10386
|
class ChartJsComponent extends owl.Component {
|
|
10337
10387
|
static template = "o-spreadsheet-ChartJsComponent";
|
|
10338
10388
|
static props = {
|
|
@@ -10384,8 +10434,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10384
10434
|
createChart(chartData) {
|
|
10385
10435
|
const canvas = this.canvas.el;
|
|
10386
10436
|
const ctx = canvas.getContext("2d");
|
|
10387
|
-
|
|
10388
|
-
this.chart = new Chart(ctx, chartData);
|
|
10437
|
+
this.chart = new window.Chart(ctx, chartData);
|
|
10389
10438
|
}
|
|
10390
10439
|
updateChartJs(chartData) {
|
|
10391
10440
|
if (chartData.data && chartData.data.datasets) {
|
|
@@ -18517,7 +18566,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18517
18566
|
return { value: "" };
|
|
18518
18567
|
}
|
|
18519
18568
|
if (result.value === null) {
|
|
18520
|
-
result
|
|
18569
|
+
return { ...result, value: "" };
|
|
18521
18570
|
}
|
|
18522
18571
|
return result;
|
|
18523
18572
|
},
|
|
@@ -18538,7 +18587,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18538
18587
|
return { value: "" };
|
|
18539
18588
|
}
|
|
18540
18589
|
if (result.value === null) {
|
|
18541
|
-
result
|
|
18590
|
+
return { ...result, value: "" };
|
|
18542
18591
|
}
|
|
18543
18592
|
return result;
|
|
18544
18593
|
},
|
|
@@ -18559,7 +18608,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18559
18608
|
return { value: "" };
|
|
18560
18609
|
}
|
|
18561
18610
|
if (result.value === null) {
|
|
18562
|
-
result
|
|
18611
|
+
return { ...result, value: "" };
|
|
18563
18612
|
}
|
|
18564
18613
|
return result;
|
|
18565
18614
|
},
|
|
@@ -18585,7 +18634,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18585
18634
|
return { value: "" };
|
|
18586
18635
|
}
|
|
18587
18636
|
if (result.value === null) {
|
|
18588
|
-
result
|
|
18637
|
+
return { ...result, value: "" };
|
|
18589
18638
|
}
|
|
18590
18639
|
return result;
|
|
18591
18640
|
}
|
|
@@ -18703,6 +18752,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18703
18752
|
if (range === undefined || range.invalidXc || range.invalidSheetName) {
|
|
18704
18753
|
throw new InvalidReferenceError();
|
|
18705
18754
|
}
|
|
18755
|
+
if (evalContext.__originCellPosition &&
|
|
18756
|
+
range.sheetId === evalContext.__originSheetId &&
|
|
18757
|
+
isZoneInside(positionToZone(evalContext.__originCellPosition), zone)) {
|
|
18758
|
+
throw new CircularDependencyError();
|
|
18759
|
+
}
|
|
18706
18760
|
dependencies.push(range);
|
|
18707
18761
|
}
|
|
18708
18762
|
for (const measure of forMeasures) {
|
|
@@ -22964,6 +23018,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
22964
23018
|
},
|
|
22965
23019
|
},
|
|
22966
23020
|
animation: false,
|
|
23021
|
+
events: ["mousemove", "mouseout", "click", "touchstart", "touchmove", "mouseup"],
|
|
22967
23022
|
};
|
|
22968
23023
|
function chartToImage(runtime, figure, type) {
|
|
22969
23024
|
// wrap the canvas in a div with a fixed size because chart.js would
|
|
@@ -22980,8 +23035,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
22980
23035
|
if ("chartJsConfig" in runtime) {
|
|
22981
23036
|
const config = deepCopy(runtime.chartJsConfig);
|
|
22982
23037
|
config.plugins = [backgroundColorChartJSPlugin];
|
|
22983
|
-
const
|
|
22984
|
-
const chart = new Chart(canvas, config);
|
|
23038
|
+
const chart = new window.Chart(canvas, config);
|
|
22985
23039
|
const imgContent = chart.toBase64Image();
|
|
22986
23040
|
chart.destroy();
|
|
22987
23041
|
div.remove();
|
|
@@ -27974,6 +28028,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27974
28028
|
initialMessages = dropCommands(initialMessages, "SORT_CELLS");
|
|
27975
28029
|
initialMessages = dropCommands(initialMessages, "SET_DECIMAL");
|
|
27976
28030
|
initialMessages = fixChartDefinitions(data, initialMessages);
|
|
28031
|
+
initialMessages = fixTranslatedDuplicateSheetName(data, initialMessages);
|
|
27977
28032
|
return initialMessages;
|
|
27978
28033
|
}
|
|
27979
28034
|
/**
|
|
@@ -28073,6 +28128,40 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28073
28128
|
}
|
|
28074
28129
|
return messages;
|
|
28075
28130
|
}
|
|
28131
|
+
function fixTranslatedDuplicateSheetName(data, initialMessages) {
|
|
28132
|
+
const sheetNames = {};
|
|
28133
|
+
for (const sheet of data.sheets || []) {
|
|
28134
|
+
sheetNames[sheet.id] = sheet.name;
|
|
28135
|
+
}
|
|
28136
|
+
const messages = [];
|
|
28137
|
+
for (const message of initialMessages) {
|
|
28138
|
+
if (message.type === "REMOTE_REVISION") {
|
|
28139
|
+
const commands = [];
|
|
28140
|
+
for (const cmd of message.commands) {
|
|
28141
|
+
switch (cmd.type) {
|
|
28142
|
+
case "DUPLICATE_SHEET":
|
|
28143
|
+
cmd.sheetNameTo =
|
|
28144
|
+
cmd.sheetNameTo ??
|
|
28145
|
+
getDuplicateSheetName(sheetNames[cmd.sheetId], Object.values(sheetNames));
|
|
28146
|
+
break;
|
|
28147
|
+
case "CREATE_SHEET":
|
|
28148
|
+
case "RENAME_SHEET":
|
|
28149
|
+
sheetNames[cmd.sheetId] = cmd.name || getNextSheetName(Object.values(sheetNames));
|
|
28150
|
+
break;
|
|
28151
|
+
}
|
|
28152
|
+
commands.push(cmd);
|
|
28153
|
+
}
|
|
28154
|
+
messages.push({
|
|
28155
|
+
...message,
|
|
28156
|
+
commands,
|
|
28157
|
+
});
|
|
28158
|
+
}
|
|
28159
|
+
else {
|
|
28160
|
+
messages.push(message);
|
|
28161
|
+
}
|
|
28162
|
+
}
|
|
28163
|
+
return initialMessages;
|
|
28164
|
+
}
|
|
28076
28165
|
// -----------------------------------------------------------------------------
|
|
28077
28166
|
// Helpers
|
|
28078
28167
|
// -----------------------------------------------------------------------------
|
|
@@ -28869,12 +28958,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28869
28958
|
}
|
|
28870
28959
|
let missingTimeAdapterAlreadyWarned = false;
|
|
28871
28960
|
function isLuxonTimeAdapterInstalled() {
|
|
28872
|
-
|
|
28873
|
-
if (!Chart) {
|
|
28961
|
+
if (!window.Chart) {
|
|
28874
28962
|
return false;
|
|
28875
28963
|
}
|
|
28876
28964
|
// @ts-ignore
|
|
28877
|
-
const adapter = new Chart._adapters._date({});
|
|
28965
|
+
const adapter = new window.Chart._adapters._date({});
|
|
28878
28966
|
const isInstalled = adapter._id === "luxon";
|
|
28879
28967
|
if (!isInstalled && !missingTimeAdapterAlreadyWarned) {
|
|
28880
28968
|
missingTimeAdapterAlreadyWarned = true;
|
|
@@ -29512,6 +29600,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29512
29600
|
target.style.cursor = "default";
|
|
29513
29601
|
},
|
|
29514
29602
|
onClick: (event, legendItem, legend) => {
|
|
29603
|
+
if (event.type !== "click") {
|
|
29604
|
+
return;
|
|
29605
|
+
}
|
|
29515
29606
|
const index = legendItem.datasetIndex;
|
|
29516
29607
|
if (!legend.legendItems || index === undefined) {
|
|
29517
29608
|
return;
|
|
@@ -33411,10 +33502,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
33411
33502
|
name: _t("Duplicate"),
|
|
33412
33503
|
execute: (env) => {
|
|
33413
33504
|
const sheetIdFrom = env.model.getters.getActiveSheetId();
|
|
33505
|
+
const sheetNameFrom = env.model.getters.getSheetName(sheetIdFrom);
|
|
33414
33506
|
const sheetIdTo = env.model.uuidGenerator.smallUuid();
|
|
33507
|
+
const sheetNameTo = env.model.getters.getDuplicateSheetName(sheetNameFrom);
|
|
33415
33508
|
env.model.dispatch("DUPLICATE_SHEET", {
|
|
33416
33509
|
sheetId: sheetIdFrom,
|
|
33417
33510
|
sheetIdTo,
|
|
33511
|
+
sheetNameTo,
|
|
33418
33512
|
});
|
|
33419
33513
|
env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom, sheetIdTo });
|
|
33420
33514
|
},
|
|
@@ -38617,7 +38711,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
38617
38711
|
const cancelledReasons = [
|
|
38618
38712
|
...(this.state.datasetDispatchResult?.reasons || []),
|
|
38619
38713
|
...(this.state.labelsDispatchResult?.reasons || []),
|
|
38620
|
-
];
|
|
38714
|
+
].filter((reason) => reason !== "NoChanges" /* CommandResult.NoChanges */);
|
|
38621
38715
|
return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
|
|
38622
38716
|
}
|
|
38623
38717
|
get isDatasetInvalid() {
|
|
@@ -40839,6 +40933,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
40839
40933
|
openAssistant() {
|
|
40840
40934
|
this.assistant.forcedClosed = false;
|
|
40841
40935
|
}
|
|
40936
|
+
onWheel(event) {
|
|
40937
|
+
// detect if scrollbar is available
|
|
40938
|
+
if (this.composerRef.el &&
|
|
40939
|
+
this.composerRef.el.scrollHeight > this.composerRef.el.clientHeight) {
|
|
40940
|
+
event.stopPropagation();
|
|
40941
|
+
}
|
|
40942
|
+
}
|
|
40842
40943
|
// ---------------------------------------------------------------------------
|
|
40843
40944
|
// Private
|
|
40844
40945
|
// ---------------------------------------------------------------------------
|
|
@@ -46315,8 +46416,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46315
46416
|
|
|
46316
46417
|
const NULL_SYMBOL = Symbol("NULL");
|
|
46317
46418
|
function createDate(dimension, value, locale) {
|
|
46318
|
-
const granularity = dimension.granularity;
|
|
46319
|
-
if (!
|
|
46419
|
+
const granularity = dimension.granularity || "month";
|
|
46420
|
+
if (!(granularity in MAP_VALUE_DIMENSION_DATE)) {
|
|
46320
46421
|
throw new Error(`Unknown date granularity: ${granularity}`);
|
|
46321
46422
|
}
|
|
46322
46423
|
const keyInMap = typeof value === "number" || typeof value === "string" ? value : NULL_SYMBOL;
|
|
@@ -46335,6 +46436,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46335
46436
|
case "month_number":
|
|
46336
46437
|
number = date.getMonth() + 1;
|
|
46337
46438
|
break;
|
|
46439
|
+
case "month":
|
|
46440
|
+
number = Math.floor(toNumber(value, locale));
|
|
46441
|
+
break;
|
|
46338
46442
|
case "iso_week_number":
|
|
46339
46443
|
number = date.getIsoWeek();
|
|
46340
46444
|
break;
|
|
@@ -46428,6 +46532,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46428
46532
|
set: new Set(),
|
|
46429
46533
|
values: {},
|
|
46430
46534
|
},
|
|
46535
|
+
month: {
|
|
46536
|
+
set: new Set(),
|
|
46537
|
+
values: {},
|
|
46538
|
+
},
|
|
46431
46539
|
iso_week_number: {
|
|
46432
46540
|
set: new Set(),
|
|
46433
46541
|
values: {},
|
|
@@ -46638,7 +46746,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46638
46746
|
const cells = this.filterDataEntriesFromDomain(this.dataEntries, domain);
|
|
46639
46747
|
const finalCell = cells[0]?.[dimension.nameWithGranularity];
|
|
46640
46748
|
if (dimension.type === "datetime") {
|
|
46641
|
-
const adapter = pivotTimeAdapter(dimension.granularity);
|
|
46749
|
+
const adapter = pivotTimeAdapter((dimension.granularity || "month"));
|
|
46642
46750
|
return adapter.toValueAndFormat(lastNode.value, this.getters.getLocale());
|
|
46643
46751
|
}
|
|
46644
46752
|
if (!finalCell) {
|
|
@@ -46756,7 +46864,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46756
46864
|
if (nonEmptyCells.length === 0) {
|
|
46757
46865
|
return "integer";
|
|
46758
46866
|
}
|
|
46759
|
-
if (nonEmptyCells.every((cell) => cell.format && isDateTimeFormat(cell.format))) {
|
|
46867
|
+
if (nonEmptyCells.every((cell) => cell.type === CellValueType.number && cell.format && isDateTimeFormat(cell.format))) {
|
|
46760
46868
|
return "datetime";
|
|
46761
46869
|
}
|
|
46762
46870
|
if (nonEmptyCells.every((cell) => cell.type === CellValueType.boolean)) {
|
|
@@ -46849,7 +46957,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46849
46957
|
for (const entry of dataEntries) {
|
|
46850
46958
|
for (const dimension of dateDimensions) {
|
|
46851
46959
|
const value = createDate(dimension, entry[dimension.fieldName]?.value || null, this.getters.getLocale());
|
|
46852
|
-
const adapter = pivotTimeAdapter(dimension.granularity);
|
|
46960
|
+
const adapter = pivotTimeAdapter((dimension.granularity || "month"));
|
|
46853
46961
|
const { format, value: valueToFormat } = adapter.toValueAndFormat(value, locale);
|
|
46854
46962
|
entry[dimension.nameWithGranularity] = {
|
|
46855
46963
|
value,
|
|
@@ -46869,6 +46977,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46869
46977
|
"year",
|
|
46870
46978
|
"quarter_number",
|
|
46871
46979
|
"month_number",
|
|
46980
|
+
"month",
|
|
46872
46981
|
"iso_week_number",
|
|
46873
46982
|
"day_of_month",
|
|
46874
46983
|
"day",
|
|
@@ -47119,7 +47228,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47119
47228
|
: this.datetimeGranularities);
|
|
47120
47229
|
}
|
|
47121
47230
|
for (const field of dateFields) {
|
|
47122
|
-
granularitiesPerFields[field.fieldName].delete(field.granularity);
|
|
47231
|
+
granularitiesPerFields[field.fieldName].delete(field.granularity || "month");
|
|
47123
47232
|
}
|
|
47124
47233
|
return granularitiesPerFields;
|
|
47125
47234
|
}
|
|
@@ -49289,6 +49398,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49289
49398
|
}
|
|
49290
49399
|
get composerProps() {
|
|
49291
49400
|
const { width, height } = this.env.model.getters.getSheetViewDimensionWithHeaders();
|
|
49401
|
+
// Remove the wrapper border width
|
|
49402
|
+
const maxHeight = this.props.gridDims.height - this.rect.y - 2 * COMPOSER_BORDER_WIDTH;
|
|
49292
49403
|
return {
|
|
49293
49404
|
rect: { ...this.rect },
|
|
49294
49405
|
delimitation: {
|
|
@@ -49306,6 +49417,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49306
49417
|
}),
|
|
49307
49418
|
onInputContextMenu: this.props.onInputContextMenu,
|
|
49308
49419
|
composerStore: this.composerStore,
|
|
49420
|
+
inputStyle: `max-height: ${maxHeight}px;`,
|
|
49309
49421
|
};
|
|
49310
49422
|
}
|
|
49311
49423
|
get containerStyle() {
|
|
@@ -54568,7 +54680,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
54568
54680
|
case "CREATE_CHART":
|
|
54569
54681
|
return this.checkValidations(cmd, this.chainValidations(this.validateChartDefinition, this.checkChartDuplicate));
|
|
54570
54682
|
case "UPDATE_CHART":
|
|
54571
|
-
return this.checkValidations(cmd, this.chainValidations(this.validateChartDefinition, this.checkChartExists));
|
|
54683
|
+
return this.checkValidations(cmd, this.chainValidations(this.validateChartDefinition, this.checkChartExists, this.checkChartChanged));
|
|
54572
54684
|
default:
|
|
54573
54685
|
return "Success" /* CommandResult.Success */;
|
|
54574
54686
|
}
|
|
@@ -54723,9 +54835,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
54723
54835
|
: "Success" /* CommandResult.Success */;
|
|
54724
54836
|
}
|
|
54725
54837
|
checkChartExists(cmd) {
|
|
54726
|
-
return this.
|
|
54727
|
-
|
|
54728
|
-
|
|
54838
|
+
return this.isChartDefined(cmd.id) ? "Success" /* CommandResult.Success */ : "ChartDoesNotExist" /* CommandResult.ChartDoesNotExist */;
|
|
54839
|
+
}
|
|
54840
|
+
checkChartChanged(cmd) {
|
|
54841
|
+
return deepEquals(this.getChartDefinition(cmd.id), cmd.definition)
|
|
54842
|
+
? "NoChanges" /* CommandResult.NoChanges */
|
|
54843
|
+
: "Success" /* CommandResult.Success */;
|
|
54729
54844
|
}
|
|
54730
54845
|
}
|
|
54731
54846
|
|
|
@@ -57044,6 +57159,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57044
57159
|
"getCommandZones",
|
|
57045
57160
|
"getUnboundedZone",
|
|
57046
57161
|
"checkElementsIncludeAllNonFrozenHeaders",
|
|
57162
|
+
"getDuplicateSheetName",
|
|
57047
57163
|
];
|
|
57048
57164
|
sheetIdsMapName = {};
|
|
57049
57165
|
orderedSheetIds = [];
|
|
@@ -57068,7 +57184,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57068
57184
|
return this.checkValidations(cmd, this.checkSheetName, this.checkSheetPosition);
|
|
57069
57185
|
}
|
|
57070
57186
|
case "DUPLICATE_SHEET": {
|
|
57071
|
-
|
|
57187
|
+
if (this.sheets[cmd.sheetIdTo])
|
|
57188
|
+
return "DuplicatedSheetId" /* CommandResult.DuplicatedSheetId */;
|
|
57189
|
+
if (this.orderedSheetIds.map(this.getSheetName.bind(this)).includes(cmd.sheetNameTo))
|
|
57190
|
+
return "DuplicatedSheetName" /* CommandResult.DuplicatedSheetName */;
|
|
57191
|
+
return "Success" /* CommandResult.Success */;
|
|
57072
57192
|
}
|
|
57073
57193
|
case "MOVE_SHEET":
|
|
57074
57194
|
try {
|
|
@@ -57145,7 +57265,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57145
57265
|
this.showSheet(cmd.sheetId);
|
|
57146
57266
|
break;
|
|
57147
57267
|
case "DUPLICATE_SHEET":
|
|
57148
|
-
this.duplicateSheet(cmd.sheetId, cmd.sheetIdTo);
|
|
57268
|
+
this.duplicateSheet(cmd.sheetId, cmd.sheetIdTo, cmd.sheetNameTo);
|
|
57149
57269
|
break;
|
|
57150
57270
|
case "DELETE_SHEET":
|
|
57151
57271
|
this.deleteSheet(this.sheets[cmd.sheetId]);
|
|
@@ -57352,10 +57472,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57352
57472
|
}
|
|
57353
57473
|
getNextSheetName(baseName = "Sheet") {
|
|
57354
57474
|
const names = this.orderedSheetIds.map(this.getSheetName.bind(this));
|
|
57355
|
-
return
|
|
57356
|
-
compute: (name, i) => `${name}${i}`,
|
|
57357
|
-
computeFirstOne: true,
|
|
57358
|
-
});
|
|
57475
|
+
return getNextSheetName(names, baseName);
|
|
57359
57476
|
}
|
|
57360
57477
|
getSheetSize(sheetId) {
|
|
57361
57478
|
return {
|
|
@@ -57601,9 +57718,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57601
57718
|
showSheet(sheetId) {
|
|
57602
57719
|
this.history.update("sheets", sheetId, "isVisible", true);
|
|
57603
57720
|
}
|
|
57604
|
-
duplicateSheet(fromId, toId) {
|
|
57721
|
+
duplicateSheet(fromId, toId, toName) {
|
|
57605
57722
|
const sheet = this.getSheet(fromId);
|
|
57606
|
-
const toName = this.getDuplicateSheetName(sheet.name);
|
|
57607
57723
|
const newSheet = deepCopy(sheet);
|
|
57608
57724
|
newSheet.id = toId;
|
|
57609
57725
|
newSheet.name = toName;
|
|
@@ -57636,8 +57752,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57636
57752
|
}
|
|
57637
57753
|
getDuplicateSheetName(sheetName) {
|
|
57638
57754
|
const names = this.orderedSheetIds.map(this.getSheetName.bind(this));
|
|
57639
|
-
|
|
57640
|
-
return getUniqueText(baseName.toString(), names);
|
|
57755
|
+
return getDuplicateSheetName(sheetName, names);
|
|
57641
57756
|
}
|
|
57642
57757
|
deleteSheet(sheet) {
|
|
57643
57758
|
const name = sheet.name;
|
|
@@ -60432,8 +60547,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60432
60547
|
const EMPTY_ARRAY = [];
|
|
60433
60548
|
|
|
60434
60549
|
const MAX_ITERATION = 30;
|
|
60435
|
-
const ERROR_CYCLE_CELL = createEvaluatedCell(new CircularDependencyError());
|
|
60436
|
-
const EMPTY_CELL = createEvaluatedCell({ value: null });
|
|
60550
|
+
const ERROR_CYCLE_CELL = Object.freeze(createEvaluatedCell(new CircularDependencyError()));
|
|
60551
|
+
const EMPTY_CELL = Object.freeze(createEvaluatedCell({ value: null }));
|
|
60437
60552
|
class Evaluator {
|
|
60438
60553
|
context;
|
|
60439
60554
|
getters;
|
|
@@ -71738,11 +71853,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
71738
71853
|
this.checkViewportSize();
|
|
71739
71854
|
stores.on("store-updated", this, render);
|
|
71740
71855
|
resizeObserver.observe(this.spreadsheetRef.el);
|
|
71856
|
+
registerChartJSExtensions();
|
|
71741
71857
|
});
|
|
71742
71858
|
owl.onWillUnmount(() => {
|
|
71743
71859
|
this.unbindModelEvents();
|
|
71744
71860
|
stores.off("store-updated", this);
|
|
71745
71861
|
resizeObserver.disconnect();
|
|
71862
|
+
unregisterChartJsExtensions();
|
|
71746
71863
|
});
|
|
71747
71864
|
owl.onPatched(() => {
|
|
71748
71865
|
this.checkViewportSize();
|
|
@@ -76269,9 +76386,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
76269
76386
|
exports.tokenize = tokenize;
|
|
76270
76387
|
|
|
76271
76388
|
|
|
76272
|
-
__info__.version = "18.2.
|
|
76273
|
-
__info__.date = "2025-05-
|
|
76274
|
-
__info__.hash = "
|
|
76389
|
+
__info__.version = "18.2.11";
|
|
76390
|
+
__info__.date = "2025-05-12T05:25:59.138Z";
|
|
76391
|
+
__info__.hash = "eb87dca";
|
|
76275
76392
|
|
|
76276
76393
|
|
|
76277
76394
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|