@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.
@@ -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.18
6
- * @date 2025-05-02T12:30:47.822Z
7
- * @hash 29c21c6
5
+ * @version 18.1.19
6
+ * @date 2025-05-12T05:26:05.861Z
7
+ * @hash 44cc170
8
8
  */
9
9
 
10
10
  (function (exports, owl) {
@@ -6272,6 +6272,25 @@
6272
6272
  })
6273
6273
  .filter(isDefined);
6274
6274
  }
6275
+ function getNextSheetName(existingNames, baseName = "Sheet") {
6276
+ let i = 1;
6277
+ let name = `${baseName}${i}`;
6278
+ while (existingNames.includes(name)) {
6279
+ name = `${baseName}${i}`;
6280
+ i++;
6281
+ }
6282
+ return name;
6283
+ }
6284
+ function getDuplicateSheetName(nameToDuplicate, existingNames) {
6285
+ let i = 1;
6286
+ const baseName = _t("Copy of %s", nameToDuplicate);
6287
+ let name = baseName.toString();
6288
+ while (existingNames.includes(name)) {
6289
+ name = `${baseName} (${i})`;
6290
+ i++;
6291
+ }
6292
+ return name;
6293
+ }
6275
6294
 
6276
6295
  function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
6277
6296
  return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
@@ -7970,6 +7989,24 @@
7970
7989
  return `${normalizedValue}`;
7971
7990
  },
7972
7991
  };
7992
+ /**
7993
+ * normalizes month number + year
7994
+ */
7995
+ const monthAdapter = {
7996
+ normalizeFunctionValue(value) {
7997
+ const date = toNumber(value, DEFAULT_LOCALE);
7998
+ return formatValue(date, { locale: DEFAULT_LOCALE, format: "mm/yyyy" });
7999
+ },
8000
+ toValueAndFormat(normalizedValue) {
8001
+ return {
8002
+ value: toNumber(normalizedValue, DEFAULT_LOCALE),
8003
+ format: "mmmm yyyy",
8004
+ };
8005
+ },
8006
+ toFunctionValue(normalizedValue) {
8007
+ return `"${normalizedValue}"`;
8008
+ },
8009
+ };
7973
8010
  /**
7974
8011
  * normalizes quarter number
7975
8012
  */
@@ -8100,6 +8137,7 @@
8100
8137
  .add("day_of_month", nullHandlerDecorator(dayOfMonthAdapter))
8101
8138
  .add("iso_week_number", nullHandlerDecorator(isoWeekNumberAdapter))
8102
8139
  .add("month_number", nullHandlerDecorator(monthNumberAdapter))
8140
+ .add("month", nullHandlerDecorator(monthAdapter))
8103
8141
  .add("quarter_number", nullHandlerDecorator(quarterNumberAdapter))
8104
8142
  .add("day_of_week", nullHandlerDecorator(dayOfWeekAdapter))
8105
8143
  .add("hour_number", nullHandlerDecorator(hourNumberAdapter))
@@ -8279,10 +8317,7 @@
8279
8317
  return normalizer(groupValueString, dimension.granularity);
8280
8318
  }
8281
8319
  function normalizeDateTime(value, granularity) {
8282
- if (!granularity) {
8283
- throw new Error("Missing granularity");
8284
- }
8285
- return pivotTimeAdapter(granularity).normalizeFunctionValue(value);
8320
+ return pivotTimeAdapter(granularity ?? "month").normalizeFunctionValue(value);
8286
8321
  }
8287
8322
  function toFunctionPivotValue(value, dimension) {
8288
8323
  if (value === null) {
@@ -8294,10 +8329,7 @@
8294
8329
  return pivotToFunctionValueRegistry.get(dimension.type)(value, dimension.granularity);
8295
8330
  }
8296
8331
  function toFunctionValueDateTime(value, granularity) {
8297
- if (!granularity) {
8298
- throw new Error("Missing granularity");
8299
- }
8300
- return pivotTimeAdapter(granularity).toFunctionValue(value);
8332
+ return pivotTimeAdapter(granularity ?? "month").toFunctionValue(value);
8301
8333
  }
8302
8334
  const pivotNormalizationValueRegistry = new Registry();
8303
8335
  pivotNormalizationValueRegistry
@@ -9612,12 +9644,24 @@ stores.inject(MyMetaStore, storeInstance);
9612
9644
  }
9613
9645
 
9614
9646
  const chartJsExtensionRegistry = new Registry();
9615
- /** Return window.Chart, making sure all our extensions are loaded in ChartJS */
9616
- function getChartJSConstructor() {
9617
- if (window.Chart && !window.Chart?.registry.plugins.get("chartShowValuesPlugin")) {
9618
- window.Chart.register(...chartJsExtensionRegistry.getAll());
9647
+ function areChartJSExtensionsLoaded() {
9648
+ return !!window.Chart.registry.plugins.get("chartShowValuesPlugin");
9649
+ }
9650
+ function registerChartJSExtensions() {
9651
+ if (!window.Chart || areChartJSExtensionsLoaded()) {
9652
+ return;
9653
+ }
9654
+ for (const registryItem of chartJsExtensionRegistry.getAll()) {
9655
+ registryItem.register(window.Chart);
9656
+ }
9657
+ }
9658
+ function unregisterChartJsExtensions() {
9659
+ if (!window.Chart) {
9660
+ return;
9661
+ }
9662
+ for (const registryItem of chartJsExtensionRegistry.getAll()) {
9663
+ registryItem.unregister(window.Chart);
9619
9664
  }
9620
- return window.Chart;
9621
9665
  }
9622
9666
 
9623
9667
  const TREND_LINE_XAXIS_ID = "x1";
@@ -10158,8 +10202,14 @@ stores.inject(MyMetaStore, storeInstance);
10158
10202
  return bars.find((bar, i) => i > startIndex && bar.height !== 0);
10159
10203
  }
10160
10204
 
10161
- chartJsExtensionRegistry.add("chartShowValuesPlugin", chartShowValuesPlugin);
10162
- chartJsExtensionRegistry.add("waterfallLinesPlugin", waterfallLinesPlugin);
10205
+ chartJsExtensionRegistry.add("chartShowValuesPlugin", {
10206
+ register: (Chart) => Chart.register(chartShowValuesPlugin),
10207
+ unregister: (Chart) => Chart.unregister(chartShowValuesPlugin),
10208
+ });
10209
+ chartJsExtensionRegistry.add("waterfallLinesPlugin", {
10210
+ register: (Chart) => Chart.register(waterfallLinesPlugin),
10211
+ unregister: (Chart) => Chart.unregister(waterfallLinesPlugin),
10212
+ });
10163
10213
  class ChartJsComponent extends owl.Component {
10164
10214
  static template = "o-spreadsheet-ChartJsComponent";
10165
10215
  static props = {
@@ -10211,8 +10261,7 @@ stores.inject(MyMetaStore, storeInstance);
10211
10261
  createChart(chartData) {
10212
10262
  const canvas = this.canvas.el;
10213
10263
  const ctx = canvas.getContext("2d");
10214
- const Chart = getChartJSConstructor();
10215
- this.chart = new Chart(ctx, chartData);
10264
+ this.chart = new window.Chart(ctx, chartData);
10216
10265
  }
10217
10266
  updateChartJs(chartData) {
10218
10267
  if (chartData.data && chartData.data.datasets) {
@@ -18344,7 +18393,7 @@ stores.inject(MyMetaStore, storeInstance);
18344
18393
  return { value: "" };
18345
18394
  }
18346
18395
  if (result.value === null) {
18347
- result.value = "";
18396
+ return { ...result, value: "" };
18348
18397
  }
18349
18398
  return result;
18350
18399
  },
@@ -18365,7 +18414,7 @@ stores.inject(MyMetaStore, storeInstance);
18365
18414
  return { value: "" };
18366
18415
  }
18367
18416
  if (result.value === null) {
18368
- result.value = "";
18417
+ return { ...result, value: "" };
18369
18418
  }
18370
18419
  return result;
18371
18420
  },
@@ -18386,7 +18435,7 @@ stores.inject(MyMetaStore, storeInstance);
18386
18435
  return { value: "" };
18387
18436
  }
18388
18437
  if (result.value === null) {
18389
- result.value = "";
18438
+ return { ...result, value: "" };
18390
18439
  }
18391
18440
  return result;
18392
18441
  },
@@ -18412,7 +18461,7 @@ stores.inject(MyMetaStore, storeInstance);
18412
18461
  return { value: "" };
18413
18462
  }
18414
18463
  if (result.value === null) {
18415
- result.value = "";
18464
+ return { ...result, value: "" };
18416
18465
  }
18417
18466
  return result;
18418
18467
  }
@@ -18530,6 +18579,11 @@ stores.inject(MyMetaStore, storeInstance);
18530
18579
  if (range === undefined || range.invalidXc || range.invalidSheetName) {
18531
18580
  throw new InvalidReferenceError();
18532
18581
  }
18582
+ if (evalContext.__originCellPosition &&
18583
+ range.sheetId === evalContext.__originSheetId &&
18584
+ isZoneInside(positionToZone(evalContext.__originCellPosition), zone)) {
18585
+ throw new CircularDependencyError();
18586
+ }
18533
18587
  dependencies.push(range);
18534
18588
  }
18535
18589
  for (const measure of forMeasures) {
@@ -22791,6 +22845,7 @@ stores.inject(MyMetaStore, storeInstance);
22791
22845
  },
22792
22846
  },
22793
22847
  animation: false,
22848
+ events: ["mousemove", "mouseout", "click", "touchstart", "touchmove", "mouseup"],
22794
22849
  };
22795
22850
  function truncateLabel(label) {
22796
22851
  if (!label) {
@@ -22816,8 +22871,7 @@ stores.inject(MyMetaStore, storeInstance);
22816
22871
  if ("chartJsConfig" in runtime) {
22817
22872
  const config = deepCopy(runtime.chartJsConfig);
22818
22873
  config.plugins = [backgroundColorChartJSPlugin];
22819
- const Chart = getChartJSConstructor();
22820
- const chart = new Chart(canvas, config);
22874
+ const chart = new window.Chart(canvas, config);
22821
22875
  const imgContent = chart.toBase64Image();
22822
22876
  chart.destroy();
22823
22877
  div.remove();
@@ -27949,6 +28003,7 @@ stores.inject(MyMetaStore, storeInstance);
27949
28003
  initialMessages = dropCommands(initialMessages, "SORT_CELLS");
27950
28004
  initialMessages = dropCommands(initialMessages, "SET_DECIMAL");
27951
28005
  initialMessages = fixChartDefinitions(data, initialMessages);
28006
+ initialMessages = fixTranslatedDuplicateSheetName(data, initialMessages);
27952
28007
  return initialMessages;
27953
28008
  }
27954
28009
  /**
@@ -28048,6 +28103,40 @@ stores.inject(MyMetaStore, storeInstance);
28048
28103
  }
28049
28104
  return messages;
28050
28105
  }
28106
+ function fixTranslatedDuplicateSheetName(data, initialMessages) {
28107
+ const sheetNames = {};
28108
+ for (const sheet of data.sheets || []) {
28109
+ sheetNames[sheet.id] = sheet.name;
28110
+ }
28111
+ const messages = [];
28112
+ for (const message of initialMessages) {
28113
+ if (message.type === "REMOTE_REVISION") {
28114
+ const commands = [];
28115
+ for (const cmd of message.commands) {
28116
+ switch (cmd.type) {
28117
+ case "DUPLICATE_SHEET":
28118
+ cmd.sheetNameTo =
28119
+ cmd.sheetNameTo ??
28120
+ getDuplicateSheetName(sheetNames[cmd.sheetId], Object.values(sheetNames));
28121
+ break;
28122
+ case "CREATE_SHEET":
28123
+ case "RENAME_SHEET":
28124
+ sheetNames[cmd.sheetId] = cmd.name || getNextSheetName(Object.values(sheetNames));
28125
+ break;
28126
+ }
28127
+ commands.push(cmd);
28128
+ }
28129
+ messages.push({
28130
+ ...message,
28131
+ commands,
28132
+ });
28133
+ }
28134
+ else {
28135
+ messages.push(message);
28136
+ }
28137
+ }
28138
+ return initialMessages;
28139
+ }
28051
28140
  // -----------------------------------------------------------------------------
28052
28141
  // Helpers
28053
28142
  // -----------------------------------------------------------------------------
@@ -28845,12 +28934,11 @@ stores.inject(MyMetaStore, storeInstance);
28845
28934
  }
28846
28935
  let missingTimeAdapterAlreadyWarned = false;
28847
28936
  function isLuxonTimeAdapterInstalled() {
28848
- const Chart = getChartJSConstructor();
28849
- if (!Chart) {
28937
+ if (!window.Chart) {
28850
28938
  return false;
28851
28939
  }
28852
28940
  // @ts-ignore
28853
- const adapter = new Chart._adapters._date({});
28941
+ const adapter = new window.Chart._adapters._date({});
28854
28942
  const isInstalled = adapter._id === "luxon";
28855
28943
  if (!isInstalled && !missingTimeAdapterAlreadyWarned) {
28856
28944
  missingTimeAdapterAlreadyWarned = true;
@@ -29488,6 +29576,9 @@ stores.inject(MyMetaStore, storeInstance);
29488
29576
  target.style.cursor = "default";
29489
29577
  },
29490
29578
  onClick: (event, legendItem, legend) => {
29579
+ if (event.type !== "click") {
29580
+ return;
29581
+ }
29491
29582
  const index = legendItem.datasetIndex;
29492
29583
  if (!legend.legendItems || index === undefined) {
29493
29584
  return;
@@ -33213,10 +33304,13 @@ stores.inject(MyMetaStore, storeInstance);
33213
33304
  name: _t("Duplicate"),
33214
33305
  execute: (env) => {
33215
33306
  const sheetIdFrom = env.model.getters.getActiveSheetId();
33307
+ const sheetNameFrom = env.model.getters.getSheetName(sheetIdFrom);
33216
33308
  const sheetIdTo = env.model.uuidGenerator.smallUuid();
33309
+ const sheetNameTo = env.model.getters.getDuplicateSheetName(sheetNameFrom);
33217
33310
  env.model.dispatch("DUPLICATE_SHEET", {
33218
33311
  sheetId: sheetIdFrom,
33219
33312
  sheetIdTo,
33313
+ sheetNameTo,
33220
33314
  });
33221
33315
  env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom, sheetIdTo });
33222
33316
  },
@@ -41036,6 +41130,13 @@ stores.inject(MyMetaStore, storeInstance);
41036
41130
  openAssistant() {
41037
41131
  this.assistant.forcedClosed = false;
41038
41132
  }
41133
+ onWheel(event) {
41134
+ // detect if scrollbar is available
41135
+ if (this.composerRef.el &&
41136
+ this.composerRef.el.scrollHeight > this.composerRef.el.clientHeight) {
41137
+ event.stopPropagation();
41138
+ }
41139
+ }
41039
41140
  // ---------------------------------------------------------------------------
41040
41141
  // Private
41041
41142
  // ---------------------------------------------------------------------------
@@ -45973,8 +46074,8 @@ stores.inject(MyMetaStore, storeInstance);
45973
46074
 
45974
46075
  const NULL_SYMBOL = Symbol("NULL");
45975
46076
  function createDate(dimension, value, locale) {
45976
- const granularity = dimension.granularity;
45977
- if (!granularity || !(granularity in MAP_VALUE_DIMENSION_DATE)) {
46077
+ const granularity = dimension.granularity || "month";
46078
+ if (!(granularity in MAP_VALUE_DIMENSION_DATE)) {
45978
46079
  throw new Error(`Unknown date granularity: ${granularity}`);
45979
46080
  }
45980
46081
  const keyInMap = typeof value === "number" || typeof value === "string" ? value : NULL_SYMBOL;
@@ -45993,6 +46094,9 @@ stores.inject(MyMetaStore, storeInstance);
45993
46094
  case "month_number":
45994
46095
  number = date.getMonth() + 1;
45995
46096
  break;
46097
+ case "month":
46098
+ number = Math.floor(toNumber(value, locale));
46099
+ break;
45996
46100
  case "iso_week_number":
45997
46101
  number = date.getIsoWeek();
45998
46102
  break;
@@ -46086,6 +46190,10 @@ stores.inject(MyMetaStore, storeInstance);
46086
46190
  set: new Set(),
46087
46191
  values: {},
46088
46192
  },
46193
+ month: {
46194
+ set: new Set(),
46195
+ values: {},
46196
+ },
46089
46197
  iso_week_number: {
46090
46198
  set: new Set(),
46091
46199
  values: {},
@@ -46296,7 +46404,7 @@ stores.inject(MyMetaStore, storeInstance);
46296
46404
  const cells = this.filterDataEntriesFromDomain(this.dataEntries, domain);
46297
46405
  const finalCell = cells[0]?.[dimension.nameWithGranularity];
46298
46406
  if (dimension.type === "datetime") {
46299
- const adapter = pivotTimeAdapter(dimension.granularity);
46407
+ const adapter = pivotTimeAdapter((dimension.granularity || "month"));
46300
46408
  return adapter.toValueAndFormat(lastNode.value, this.getters.getLocale());
46301
46409
  }
46302
46410
  if (!finalCell) {
@@ -46414,7 +46522,7 @@ stores.inject(MyMetaStore, storeInstance);
46414
46522
  if (nonEmptyCells.length === 0) {
46415
46523
  return "integer";
46416
46524
  }
46417
- if (nonEmptyCells.every((cell) => cell.format && isDateTimeFormat(cell.format))) {
46525
+ if (nonEmptyCells.every((cell) => cell.type === CellValueType.number && cell.format && isDateTimeFormat(cell.format))) {
46418
46526
  return "datetime";
46419
46527
  }
46420
46528
  if (nonEmptyCells.every((cell) => cell.type === CellValueType.boolean)) {
@@ -46509,7 +46617,7 @@ stores.inject(MyMetaStore, storeInstance);
46509
46617
  for (const entry of dataEntries) {
46510
46618
  for (const dimension of dateDimensions) {
46511
46619
  const value = createDate(dimension, entry[dimension.fieldName]?.value || null, this.getters.getLocale());
46512
- const adapter = pivotTimeAdapter(dimension.granularity);
46620
+ const adapter = pivotTimeAdapter((dimension.granularity || "month"));
46513
46621
  const { format, value: valueToFormat } = adapter.toValueAndFormat(value, locale);
46514
46622
  entry[dimension.nameWithGranularity] = {
46515
46623
  value,
@@ -46529,6 +46637,7 @@ stores.inject(MyMetaStore, storeInstance);
46529
46637
  "year",
46530
46638
  "quarter_number",
46531
46639
  "month_number",
46640
+ "month",
46532
46641
  "iso_week_number",
46533
46642
  "day_of_month",
46534
46643
  "day",
@@ -46776,7 +46885,7 @@ stores.inject(MyMetaStore, storeInstance);
46776
46885
  : this.datetimeGranularities);
46777
46886
  }
46778
46887
  for (const field of dateFields) {
46779
- granularitiesPerFields[field.fieldName].delete(field.granularity);
46888
+ granularitiesPerFields[field.fieldName].delete(field.granularity || "month");
46780
46889
  }
46781
46890
  return granularitiesPerFields;
46782
46891
  }
@@ -48951,6 +49060,8 @@ stores.inject(MyMetaStore, storeInstance);
48951
49060
  }
48952
49061
  get composerProps() {
48953
49062
  const { width, height } = this.env.model.getters.getSheetViewDimensionWithHeaders();
49063
+ // Remove the wrapper border width
49064
+ const maxHeight = this.props.gridDims.height - this.rect.y - 2 * COMPOSER_BORDER_WIDTH;
48954
49065
  return {
48955
49066
  rect: { ...this.rect },
48956
49067
  delimitation: {
@@ -48968,6 +49079,7 @@ stores.inject(MyMetaStore, storeInstance);
48968
49079
  }),
48969
49080
  onInputContextMenu: this.props.onInputContextMenu,
48970
49081
  composerStore: this.composerStore,
49082
+ inputStyle: `max-height: ${maxHeight}px;`,
48971
49083
  };
48972
49084
  }
48973
49085
  get containerStyle() {
@@ -54258,9 +54370,7 @@ stores.inject(MyMetaStore, storeInstance);
54258
54370
  : "Success" /* CommandResult.Success */;
54259
54371
  }
54260
54372
  checkChartExists(cmd) {
54261
- return this.getters.getFigureSheetId(cmd.id)
54262
- ? "Success" /* CommandResult.Success */
54263
- : "ChartDoesNotExist" /* CommandResult.ChartDoesNotExist */;
54373
+ return this.isChartDefined(cmd.id) ? "Success" /* CommandResult.Success */ : "ChartDoesNotExist" /* CommandResult.ChartDoesNotExist */;
54264
54374
  }
54265
54375
  }
54266
54376
 
@@ -56545,6 +56655,7 @@ stores.inject(MyMetaStore, storeInstance);
56545
56655
  "getCommandZones",
56546
56656
  "getUnboundedZone",
56547
56657
  "checkElementsIncludeAllNonFrozenHeaders",
56658
+ "getDuplicateSheetName",
56548
56659
  ];
56549
56660
  sheetIdsMapName = {};
56550
56661
  orderedSheetIds = [];
@@ -56569,7 +56680,11 @@ stores.inject(MyMetaStore, storeInstance);
56569
56680
  return this.checkValidations(cmd, this.checkSheetName, this.checkSheetPosition);
56570
56681
  }
56571
56682
  case "DUPLICATE_SHEET": {
56572
- return this.sheets[cmd.sheetIdTo] ? "DuplicatedSheetId" /* CommandResult.DuplicatedSheetId */ : "Success" /* CommandResult.Success */;
56683
+ if (this.sheets[cmd.sheetIdTo])
56684
+ return "DuplicatedSheetId" /* CommandResult.DuplicatedSheetId */;
56685
+ if (this.orderedSheetIds.map(this.getSheetName.bind(this)).includes(cmd.sheetNameTo))
56686
+ return "DuplicatedSheetName" /* CommandResult.DuplicatedSheetName */;
56687
+ return "Success" /* CommandResult.Success */;
56573
56688
  }
56574
56689
  case "MOVE_SHEET":
56575
56690
  try {
@@ -56646,7 +56761,7 @@ stores.inject(MyMetaStore, storeInstance);
56646
56761
  this.showSheet(cmd.sheetId);
56647
56762
  break;
56648
56763
  case "DUPLICATE_SHEET":
56649
- this.duplicateSheet(cmd.sheetId, cmd.sheetIdTo);
56764
+ this.duplicateSheet(cmd.sheetId, cmd.sheetIdTo, cmd.sheetNameTo);
56650
56765
  break;
56651
56766
  case "DELETE_SHEET":
56652
56767
  this.deleteSheet(this.sheets[cmd.sheetId]);
@@ -56852,14 +56967,8 @@ stores.inject(MyMetaStore, storeInstance);
56852
56967
  return dimension === "COL" ? this.getNumberCols(sheetId) : this.getNumberRows(sheetId);
56853
56968
  }
56854
56969
  getNextSheetName(baseName = "Sheet") {
56855
- let i = 1;
56856
56970
  const names = this.orderedSheetIds.map(this.getSheetName.bind(this));
56857
- let name = `${baseName}${i}`;
56858
- while (names.includes(name)) {
56859
- name = `${baseName}${i}`;
56860
- i++;
56861
- }
56862
- return name;
56971
+ return getNextSheetName(names, baseName);
56863
56972
  }
56864
56973
  getSheetSize(sheetId) {
56865
56974
  return {
@@ -57105,9 +57214,8 @@ stores.inject(MyMetaStore, storeInstance);
57105
57214
  showSheet(sheetId) {
57106
57215
  this.history.update("sheets", sheetId, "isVisible", true);
57107
57216
  }
57108
- duplicateSheet(fromId, toId) {
57217
+ duplicateSheet(fromId, toId, toName) {
57109
57218
  const sheet = this.getSheet(fromId);
57110
- const toName = this.getDuplicateSheetName(sheet.name);
57111
57219
  const newSheet = deepCopy(sheet);
57112
57220
  newSheet.id = toId;
57113
57221
  newSheet.name = toName;
@@ -57139,15 +57247,8 @@ stores.inject(MyMetaStore, storeInstance);
57139
57247
  this.history.update("sheetIdsMapName", sheetIdsMapName);
57140
57248
  }
57141
57249
  getDuplicateSheetName(sheetName) {
57142
- let i = 1;
57143
57250
  const names = this.orderedSheetIds.map(this.getSheetName.bind(this));
57144
- const baseName = _t("Copy of %s", sheetName);
57145
- let name = baseName.toString();
57146
- while (names.includes(name)) {
57147
- name = `${baseName} (${i})`;
57148
- i++;
57149
- }
57150
- return name;
57251
+ return getDuplicateSheetName(sheetName, names);
57151
57252
  }
57152
57253
  deleteSheet(sheet) {
57153
57254
  const name = sheet.name;
@@ -59974,8 +60075,8 @@ stores.inject(MyMetaStore, storeInstance);
59974
60075
  const EMPTY_ARRAY = [];
59975
60076
 
59976
60077
  const MAX_ITERATION = 30;
59977
- const ERROR_CYCLE_CELL = createEvaluatedCell(new CircularDependencyError());
59978
- const EMPTY_CELL = createEvaluatedCell({ value: null });
60078
+ const ERROR_CYCLE_CELL = Object.freeze(createEvaluatedCell(new CircularDependencyError()));
60079
+ const EMPTY_CELL = Object.freeze(createEvaluatedCell({ value: null }));
59979
60080
  class Evaluator {
59980
60081
  context;
59981
60082
  getters;
@@ -71307,11 +71408,13 @@ stores.inject(MyMetaStore, storeInstance);
71307
71408
  this.checkViewportSize();
71308
71409
  stores.on("store-updated", this, render);
71309
71410
  resizeObserver.observe(this.spreadsheetRef.el);
71411
+ registerChartJSExtensions();
71310
71412
  });
71311
71413
  owl.onWillUnmount(() => {
71312
71414
  this.unbindModelEvents();
71313
71415
  stores.off("store-updated", this);
71314
71416
  resizeObserver.disconnect();
71417
+ unregisterChartJsExtensions();
71315
71418
  });
71316
71419
  owl.onPatched(() => {
71317
71420
  this.checkViewportSize();
@@ -75805,9 +75908,9 @@ stores.inject(MyMetaStore, storeInstance);
75805
75908
  exports.tokenize = tokenize;
75806
75909
 
75807
75910
 
75808
- __info__.version = "18.1.18";
75809
- __info__.date = "2025-05-02T12:30:47.822Z";
75810
- __info__.hash = "29c21c6";
75911
+ __info__.version = "18.1.19";
75912
+ __info__.date = "2025-05-12T05:26:05.861Z";
75913
+ __info__.hash = "44cc170";
75811
75914
 
75812
75915
 
75813
75916
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);