@odoo/o-spreadsheet 17.2.30 → 17.2.31

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.
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.30
7
- * @date 2024-12-19T07:48:16.226Z
8
- * @hash 9a9ae31
6
+ * @version 17.2.31
7
+ * @date 2025-01-14T11:31:09.035Z
8
+ * @hash 306dbf7
9
9
  */
10
10
 
11
11
  'use strict';
@@ -20245,7 +20245,7 @@ function createGaugeChartRuntime(chart, getters) {
20245
20245
  colors.push(chartColors.upperColor);
20246
20246
  return {
20247
20247
  background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
20248
- title: chart.title,
20248
+ title: _t(chart.title),
20249
20249
  minValue: {
20250
20250
  value: minValue,
20251
20251
  label: formatValue(minValue, { locale, format }),
@@ -31582,14 +31582,11 @@ unGroupHeadersMenuRegistry
31582
31582
  });
31583
31583
 
31584
31584
  class DOMFocusableElementStore {
31585
- mutators = ["setFocusableElement", "focus"];
31585
+ mutators = ["setFocusableElement"];
31586
31586
  focusableElement = undefined;
31587
31587
  setFocusableElement(element) {
31588
31588
  this.focusableElement = element;
31589
31589
  }
31590
- focus() {
31591
- this.focusableElement?.focus();
31592
- }
31593
31590
  }
31594
31591
 
31595
31592
  // -----------------------------------------------------------------------------
@@ -32929,7 +32926,7 @@ class GridComposer extends owl.Component {
32929
32926
  this.isEditing = isEditing;
32930
32927
  if (!isEditing) {
32931
32928
  this.rect = this.defaultRect;
32932
- this.DOMFocusableElementStore.focus();
32929
+ this.DOMFocusableElementStore.focusableElement?.focus();
32933
32930
  return;
32934
32931
  }
32935
32932
  const position = this.env.model.getters.getActivePosition();
@@ -35865,7 +35862,7 @@ class Grid extends owl.Component {
35865
35862
  this.cellPopovers = useStore(CellPopoverStore);
35866
35863
  owl.useEffect(() => {
35867
35864
  if (!this.sidePanel.isOpen) {
35868
- this.DOMFocusableElementStore.focus();
35865
+ this.DOMFocusableElementStore.focusableElement?.focus();
35869
35866
  }
35870
35867
  }, () => [this.sidePanel.isOpen]);
35871
35868
  }
@@ -36069,7 +36066,7 @@ class Grid extends owl.Component {
36069
36066
  focusDefaultElement() {
36070
36067
  if (!this.env.model.getters.getSelectedFigureId() &&
36071
36068
  this.composerStore.editionMode === "inactive") {
36072
- this.DOMFocusableElementStore.focus();
36069
+ this.DOMFocusableElementStore.focusableElement?.focus();
36073
36070
  }
36074
36071
  }
36075
36072
  get gridEl() {
@@ -37911,7 +37908,7 @@ function convertFigure(figure, id, sheetData) {
37911
37908
  return undefined;
37912
37909
  }
37913
37910
  function isChartData(data) {
37914
- return "dataSets" in data;
37911
+ return "dataSets" in data && data.dataSets.length > 0;
37915
37912
  }
37916
37913
  function isImageData(data) {
37917
37914
  return "imageSrc" in data;
@@ -40708,10 +40705,34 @@ class BordersPlugin extends CorePlugin {
40708
40705
  const elements = [...cmd.elements].sort((a, b) => b - a);
40709
40706
  for (const group of groupConsecutive(elements)) {
40710
40707
  if (cmd.dimension === "COL") {
40711
- this.shiftBordersHorizontally(cmd.sheetId, group[group.length - 1] + 1, -group.length);
40708
+ if (group[0] >= this.getters.getNumberCols(cmd.sheetId)) {
40709
+ for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
40710
+ this.history.update("borders", cmd.sheetId, group[0] + 1, row, "vertical", undefined);
40711
+ }
40712
+ }
40713
+ if (group[group.length - 1] === 0) {
40714
+ for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
40715
+ this.history.update("borders", cmd.sheetId, 0, row, "vertical", undefined);
40716
+ }
40717
+ }
40718
+ const zone = this.getters.getColsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
40719
+ this.clearInsideBorders(cmd.sheetId, [zone]);
40720
+ this.shiftBordersHorizontally(cmd.sheetId, group[0] + 1, -group.length);
40712
40721
  }
40713
40722
  else {
40714
- this.shiftBordersVertically(cmd.sheetId, group[group.length - 1] + 1, -group.length);
40723
+ if (group[0] >= this.getters.getNumberRows(cmd.sheetId)) {
40724
+ for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
40725
+ this.history.update("borders", cmd.sheetId, col, group[0] + 1, "horizontal", undefined);
40726
+ }
40727
+ }
40728
+ if (group[group.length - 1] === 0) {
40729
+ for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
40730
+ this.history.update("borders", cmd.sheetId, col, 0, "horizontal", undefined);
40731
+ }
40732
+ }
40733
+ const zone = this.getters.getRowsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
40734
+ this.clearInsideBorders(cmd.sheetId, [zone]);
40735
+ this.shiftBordersVertically(cmd.sheetId, group[0] + 1, -group.length);
40715
40736
  }
40716
40737
  }
40717
40738
  break;
@@ -41018,6 +41039,18 @@ class BordersPlugin extends CorePlugin {
41018
41039
  }
41019
41040
  }
41020
41041
  }
41042
+ /**
41043
+ * Remove the borders inside of a zone
41044
+ */
41045
+ clearInsideBorders(sheetId, zones) {
41046
+ for (let zone of zones) {
41047
+ for (let row = zone.top; row <= zone.bottom; row++) {
41048
+ for (let col = zone.left; col <= zone.right; col++) {
41049
+ this.history.update("borders", sheetId, col, row, undefined);
41050
+ }
41051
+ }
41052
+ }
41053
+ }
41021
41054
  /**
41022
41055
  * Add a border to the existing one to a cell
41023
41056
  */
@@ -50599,6 +50632,9 @@ class Session extends EventBus {
50599
50632
  }
50600
50633
  }
50601
50634
  this.acknowledge(message);
50635
+ if (message.type === "REMOTE_REVISION" && message.clientId === this.clientId) {
50636
+ return;
50637
+ }
50602
50638
  this.trigger("collaborative-event-received");
50603
50639
  }
50604
50640
  onClientMoved(message) {
@@ -55150,11 +55186,6 @@ class BottomBarSheet extends owl.Component {
55150
55186
  editionState = "initializing";
55151
55187
  DOMFocusableElementStore;
55152
55188
  setup() {
55153
- owl.onMounted(() => {
55154
- if (this.isSheetActive) {
55155
- this.scrollToSheet();
55156
- }
55157
- });
55158
55189
  owl.onPatched(() => {
55159
55190
  if (this.sheetNameRef.el && this.state.isEditing && this.editionState === "initializing") {
55160
55191
  this.editionState = "editing";
@@ -55162,6 +55193,11 @@ class BottomBarSheet extends owl.Component {
55162
55193
  }
55163
55194
  });
55164
55195
  this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
55196
+ owl.useEffect((sheetId) => {
55197
+ if (this.props.sheetId === sheetId) {
55198
+ this.scrollToSheet();
55199
+ }
55200
+ }, () => [this.env.model.getters.getActiveSheetId()]);
55165
55201
  }
55166
55202
  focusInputAndSelectContent() {
55167
55203
  if (!this.state.isEditing || !this.sheetNameRef.el)
@@ -55173,7 +55209,10 @@ class BottomBarSheet extends owl.Component {
55173
55209
  }
55174
55210
  }
55175
55211
  scrollToSheet() {
55176
- this.sheetDivRef.el?.scrollIntoView?.();
55212
+ this.sheetDivRef.el?.scrollIntoView?.({
55213
+ behavior: "smooth",
55214
+ inline: "nearest",
55215
+ });
55177
55216
  }
55178
55217
  onFocusOut() {
55179
55218
  if (this.state.isEditing && this.editionState !== "initializing") {
@@ -55203,11 +55242,11 @@ class BottomBarSheet extends owl.Component {
55203
55242
  if (ev.key === "Enter") {
55204
55243
  ev.preventDefault();
55205
55244
  this.stopEdition();
55206
- this.DOMFocusableElementStore.focus();
55245
+ this.DOMFocusableElementStore.focusableElement?.focus();
55207
55246
  }
55208
55247
  if (ev.key === "Escape") {
55209
55248
  this.cancelEdition();
55210
- this.DOMFocusableElementStore.focus();
55249
+ this.DOMFocusableElementStore.focusableElement?.focus();
55211
55250
  }
55212
55251
  }
55213
55252
  onMouseEventSheetName(ev) {
@@ -60921,6 +60960,8 @@ const helpers = {
60921
60960
  expandZoneOnInsertion,
60922
60961
  reduceZoneOnDeletion,
60923
60962
  unquote,
60963
+ isNumber,
60964
+ isDateTime,
60924
60965
  };
60925
60966
  const links = {
60926
60967
  isMarkdownLink,
@@ -61035,6 +61076,6 @@ exports.tokenColors = tokenColors;
61035
61076
  exports.tokenize = tokenize;
61036
61077
 
61037
61078
 
61038
- __info__.version = "17.2.30";
61039
- __info__.date = "2024-12-19T07:48:16.226Z";
61040
- __info__.hash = "9a9ae31";
61079
+ __info__.version = "17.2.31";
61080
+ __info__.date = "2025-01-14T11:31:09.035Z";
61081
+ __info__.hash = "306dbf7";
@@ -2334,6 +2334,10 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
2334
2334
  * Remove the borders of a zone
2335
2335
  */
2336
2336
  private clearBorders;
2337
+ /**
2338
+ * Remove the borders inside of a zone
2339
+ */
2340
+ private clearInsideBorders;
2337
2341
  /**
2338
2342
  * Add a border to the existing one to a cell
2339
2343
  */
@@ -4918,6 +4922,7 @@ declare class DateTime {
4918
4922
  setMinutes(minutes: number): number;
4919
4923
  setSeconds(seconds: number): number;
4920
4924
  }
4925
+ declare function isDateTime(str: string, locale: Locale): boolean;
4921
4926
 
4922
4927
  /**
4923
4928
  * Formats a cell value with its format.
@@ -4955,6 +4960,13 @@ declare function lazy<T>(fn: (() => T) | T): Lazy<T>;
4955
4960
  */
4956
4961
  declare function deepEquals(o1: any, o2: any): boolean;
4957
4962
 
4963
+ /**
4964
+ * Return true if the argument is a "number string".
4965
+ *
4966
+ * Note that "" (empty string) does not count as a number string
4967
+ */
4968
+ declare function isNumber(value: string | undefined, locale: Locale): boolean;
4969
+
4958
4970
  interface ConstructorArgs {
4959
4971
  readonly zone: Readonly<Zone | UnboundedZone>;
4960
4972
  readonly parts: readonly RangePart[];
@@ -10025,6 +10037,8 @@ declare const helpers: {
10025
10037
  expandZoneOnInsertion: typeof expandZoneOnInsertion;
10026
10038
  reduceZoneOnDeletion: typeof reduceZoneOnDeletion;
10027
10039
  unquote: typeof unquote;
10040
+ isNumber: typeof isNumber;
10041
+ isDateTime: typeof isDateTime;
10028
10042
  };
10029
10043
  declare const links: {
10030
10044
  isMarkdownLink: typeof isMarkdownLink;
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.30
7
- * @date 2024-12-19T07:48:16.226Z
8
- * @hash 9a9ae31
6
+ * @version 17.2.31
7
+ * @date 2025-01-14T11:31:09.035Z
8
+ * @hash 306dbf7
9
9
  */
10
10
 
11
11
  import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw } from '@odoo/owl';
@@ -20243,7 +20243,7 @@ function createGaugeChartRuntime(chart, getters) {
20243
20243
  colors.push(chartColors.upperColor);
20244
20244
  return {
20245
20245
  background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
20246
- title: chart.title,
20246
+ title: _t(chart.title),
20247
20247
  minValue: {
20248
20248
  value: minValue,
20249
20249
  label: formatValue(minValue, { locale, format }),
@@ -31580,14 +31580,11 @@ unGroupHeadersMenuRegistry
31580
31580
  });
31581
31581
 
31582
31582
  class DOMFocusableElementStore {
31583
- mutators = ["setFocusableElement", "focus"];
31583
+ mutators = ["setFocusableElement"];
31584
31584
  focusableElement = undefined;
31585
31585
  setFocusableElement(element) {
31586
31586
  this.focusableElement = element;
31587
31587
  }
31588
- focus() {
31589
- this.focusableElement?.focus();
31590
- }
31591
31588
  }
31592
31589
 
31593
31590
  // -----------------------------------------------------------------------------
@@ -32927,7 +32924,7 @@ class GridComposer extends Component {
32927
32924
  this.isEditing = isEditing;
32928
32925
  if (!isEditing) {
32929
32926
  this.rect = this.defaultRect;
32930
- this.DOMFocusableElementStore.focus();
32927
+ this.DOMFocusableElementStore.focusableElement?.focus();
32931
32928
  return;
32932
32929
  }
32933
32930
  const position = this.env.model.getters.getActivePosition();
@@ -35863,7 +35860,7 @@ class Grid extends Component {
35863
35860
  this.cellPopovers = useStore(CellPopoverStore);
35864
35861
  useEffect(() => {
35865
35862
  if (!this.sidePanel.isOpen) {
35866
- this.DOMFocusableElementStore.focus();
35863
+ this.DOMFocusableElementStore.focusableElement?.focus();
35867
35864
  }
35868
35865
  }, () => [this.sidePanel.isOpen]);
35869
35866
  }
@@ -36067,7 +36064,7 @@ class Grid extends Component {
36067
36064
  focusDefaultElement() {
36068
36065
  if (!this.env.model.getters.getSelectedFigureId() &&
36069
36066
  this.composerStore.editionMode === "inactive") {
36070
- this.DOMFocusableElementStore.focus();
36067
+ this.DOMFocusableElementStore.focusableElement?.focus();
36071
36068
  }
36072
36069
  }
36073
36070
  get gridEl() {
@@ -37909,7 +37906,7 @@ function convertFigure(figure, id, sheetData) {
37909
37906
  return undefined;
37910
37907
  }
37911
37908
  function isChartData(data) {
37912
- return "dataSets" in data;
37909
+ return "dataSets" in data && data.dataSets.length > 0;
37913
37910
  }
37914
37911
  function isImageData(data) {
37915
37912
  return "imageSrc" in data;
@@ -40706,10 +40703,34 @@ class BordersPlugin extends CorePlugin {
40706
40703
  const elements = [...cmd.elements].sort((a, b) => b - a);
40707
40704
  for (const group of groupConsecutive(elements)) {
40708
40705
  if (cmd.dimension === "COL") {
40709
- this.shiftBordersHorizontally(cmd.sheetId, group[group.length - 1] + 1, -group.length);
40706
+ if (group[0] >= this.getters.getNumberCols(cmd.sheetId)) {
40707
+ for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
40708
+ this.history.update("borders", cmd.sheetId, group[0] + 1, row, "vertical", undefined);
40709
+ }
40710
+ }
40711
+ if (group[group.length - 1] === 0) {
40712
+ for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
40713
+ this.history.update("borders", cmd.sheetId, 0, row, "vertical", undefined);
40714
+ }
40715
+ }
40716
+ const zone = this.getters.getColsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
40717
+ this.clearInsideBorders(cmd.sheetId, [zone]);
40718
+ this.shiftBordersHorizontally(cmd.sheetId, group[0] + 1, -group.length);
40710
40719
  }
40711
40720
  else {
40712
- this.shiftBordersVertically(cmd.sheetId, group[group.length - 1] + 1, -group.length);
40721
+ if (group[0] >= this.getters.getNumberRows(cmd.sheetId)) {
40722
+ for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
40723
+ this.history.update("borders", cmd.sheetId, col, group[0] + 1, "horizontal", undefined);
40724
+ }
40725
+ }
40726
+ if (group[group.length - 1] === 0) {
40727
+ for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
40728
+ this.history.update("borders", cmd.sheetId, col, 0, "horizontal", undefined);
40729
+ }
40730
+ }
40731
+ const zone = this.getters.getRowsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
40732
+ this.clearInsideBorders(cmd.sheetId, [zone]);
40733
+ this.shiftBordersVertically(cmd.sheetId, group[0] + 1, -group.length);
40713
40734
  }
40714
40735
  }
40715
40736
  break;
@@ -41016,6 +41037,18 @@ class BordersPlugin extends CorePlugin {
41016
41037
  }
41017
41038
  }
41018
41039
  }
41040
+ /**
41041
+ * Remove the borders inside of a zone
41042
+ */
41043
+ clearInsideBorders(sheetId, zones) {
41044
+ for (let zone of zones) {
41045
+ for (let row = zone.top; row <= zone.bottom; row++) {
41046
+ for (let col = zone.left; col <= zone.right; col++) {
41047
+ this.history.update("borders", sheetId, col, row, undefined);
41048
+ }
41049
+ }
41050
+ }
41051
+ }
41019
41052
  /**
41020
41053
  * Add a border to the existing one to a cell
41021
41054
  */
@@ -50597,6 +50630,9 @@ class Session extends EventBus {
50597
50630
  }
50598
50631
  }
50599
50632
  this.acknowledge(message);
50633
+ if (message.type === "REMOTE_REVISION" && message.clientId === this.clientId) {
50634
+ return;
50635
+ }
50600
50636
  this.trigger("collaborative-event-received");
50601
50637
  }
50602
50638
  onClientMoved(message) {
@@ -55148,11 +55184,6 @@ class BottomBarSheet extends Component {
55148
55184
  editionState = "initializing";
55149
55185
  DOMFocusableElementStore;
55150
55186
  setup() {
55151
- onMounted(() => {
55152
- if (this.isSheetActive) {
55153
- this.scrollToSheet();
55154
- }
55155
- });
55156
55187
  onPatched(() => {
55157
55188
  if (this.sheetNameRef.el && this.state.isEditing && this.editionState === "initializing") {
55158
55189
  this.editionState = "editing";
@@ -55160,6 +55191,11 @@ class BottomBarSheet extends Component {
55160
55191
  }
55161
55192
  });
55162
55193
  this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
55194
+ useEffect((sheetId) => {
55195
+ if (this.props.sheetId === sheetId) {
55196
+ this.scrollToSheet();
55197
+ }
55198
+ }, () => [this.env.model.getters.getActiveSheetId()]);
55163
55199
  }
55164
55200
  focusInputAndSelectContent() {
55165
55201
  if (!this.state.isEditing || !this.sheetNameRef.el)
@@ -55171,7 +55207,10 @@ class BottomBarSheet extends Component {
55171
55207
  }
55172
55208
  }
55173
55209
  scrollToSheet() {
55174
- this.sheetDivRef.el?.scrollIntoView?.();
55210
+ this.sheetDivRef.el?.scrollIntoView?.({
55211
+ behavior: "smooth",
55212
+ inline: "nearest",
55213
+ });
55175
55214
  }
55176
55215
  onFocusOut() {
55177
55216
  if (this.state.isEditing && this.editionState !== "initializing") {
@@ -55201,11 +55240,11 @@ class BottomBarSheet extends Component {
55201
55240
  if (ev.key === "Enter") {
55202
55241
  ev.preventDefault();
55203
55242
  this.stopEdition();
55204
- this.DOMFocusableElementStore.focus();
55243
+ this.DOMFocusableElementStore.focusableElement?.focus();
55205
55244
  }
55206
55245
  if (ev.key === "Escape") {
55207
55246
  this.cancelEdition();
55208
- this.DOMFocusableElementStore.focus();
55247
+ this.DOMFocusableElementStore.focusableElement?.focus();
55209
55248
  }
55210
55249
  }
55211
55250
  onMouseEventSheetName(ev) {
@@ -60919,6 +60958,8 @@ const helpers = {
60919
60958
  expandZoneOnInsertion,
60920
60959
  reduceZoneOnDeletion,
60921
60960
  unquote,
60961
+ isNumber,
60962
+ isDateTime,
60922
60963
  };
60923
60964
  const links = {
60924
60965
  isMarkdownLink,
@@ -60992,6 +61033,6 @@ const constants = {
60992
61033
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, 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 };
60993
61034
 
60994
61035
 
60995
- __info__.version = "17.2.30";
60996
- __info__.date = "2024-12-19T07:48:16.226Z";
60997
- __info__.hash = "9a9ae31";
61036
+ __info__.version = "17.2.31";
61037
+ __info__.date = "2025-01-14T11:31:09.035Z";
61038
+ __info__.hash = "306dbf7";
@@ -3,9 +3,9 @@
3
3
  /**
4
4
  * This file is generated by o-spreadsheet build tools. Do not edit it.
5
5
  * @see https://github.com/odoo/o-spreadsheet
6
- * @version 17.2.30
7
- * @date 2024-12-19T07:48:16.226Z
8
- * @hash 9a9ae31
6
+ * @version 17.2.31
7
+ * @date 2025-01-14T11:31:09.035Z
8
+ * @hash 306dbf7
9
9
  */
10
10
 
11
11
  (function (exports, owl) {
@@ -20244,7 +20244,7 @@ stores.inject(MyMetaStore, storeInstance);
20244
20244
  colors.push(chartColors.upperColor);
20245
20245
  return {
20246
20246
  background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
20247
- title: chart.title,
20247
+ title: _t(chart.title),
20248
20248
  minValue: {
20249
20249
  value: minValue,
20250
20250
  label: formatValue(minValue, { locale, format }),
@@ -31581,14 +31581,11 @@ stores.inject(MyMetaStore, storeInstance);
31581
31581
  });
31582
31582
 
31583
31583
  class DOMFocusableElementStore {
31584
- mutators = ["setFocusableElement", "focus"];
31584
+ mutators = ["setFocusableElement"];
31585
31585
  focusableElement = undefined;
31586
31586
  setFocusableElement(element) {
31587
31587
  this.focusableElement = element;
31588
31588
  }
31589
- focus() {
31590
- this.focusableElement?.focus();
31591
- }
31592
31589
  }
31593
31590
 
31594
31591
  // -----------------------------------------------------------------------------
@@ -32928,7 +32925,7 @@ stores.inject(MyMetaStore, storeInstance);
32928
32925
  this.isEditing = isEditing;
32929
32926
  if (!isEditing) {
32930
32927
  this.rect = this.defaultRect;
32931
- this.DOMFocusableElementStore.focus();
32928
+ this.DOMFocusableElementStore.focusableElement?.focus();
32932
32929
  return;
32933
32930
  }
32934
32931
  const position = this.env.model.getters.getActivePosition();
@@ -35864,7 +35861,7 @@ stores.inject(MyMetaStore, storeInstance);
35864
35861
  this.cellPopovers = useStore(CellPopoverStore);
35865
35862
  owl.useEffect(() => {
35866
35863
  if (!this.sidePanel.isOpen) {
35867
- this.DOMFocusableElementStore.focus();
35864
+ this.DOMFocusableElementStore.focusableElement?.focus();
35868
35865
  }
35869
35866
  }, () => [this.sidePanel.isOpen]);
35870
35867
  }
@@ -36068,7 +36065,7 @@ stores.inject(MyMetaStore, storeInstance);
36068
36065
  focusDefaultElement() {
36069
36066
  if (!this.env.model.getters.getSelectedFigureId() &&
36070
36067
  this.composerStore.editionMode === "inactive") {
36071
- this.DOMFocusableElementStore.focus();
36068
+ this.DOMFocusableElementStore.focusableElement?.focus();
36072
36069
  }
36073
36070
  }
36074
36071
  get gridEl() {
@@ -37910,7 +37907,7 @@ stores.inject(MyMetaStore, storeInstance);
37910
37907
  return undefined;
37911
37908
  }
37912
37909
  function isChartData(data) {
37913
- return "dataSets" in data;
37910
+ return "dataSets" in data && data.dataSets.length > 0;
37914
37911
  }
37915
37912
  function isImageData(data) {
37916
37913
  return "imageSrc" in data;
@@ -40707,10 +40704,34 @@ stores.inject(MyMetaStore, storeInstance);
40707
40704
  const elements = [...cmd.elements].sort((a, b) => b - a);
40708
40705
  for (const group of groupConsecutive(elements)) {
40709
40706
  if (cmd.dimension === "COL") {
40710
- this.shiftBordersHorizontally(cmd.sheetId, group[group.length - 1] + 1, -group.length);
40707
+ if (group[0] >= this.getters.getNumberCols(cmd.sheetId)) {
40708
+ for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
40709
+ this.history.update("borders", cmd.sheetId, group[0] + 1, row, "vertical", undefined);
40710
+ }
40711
+ }
40712
+ if (group[group.length - 1] === 0) {
40713
+ for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
40714
+ this.history.update("borders", cmd.sheetId, 0, row, "vertical", undefined);
40715
+ }
40716
+ }
40717
+ const zone = this.getters.getColsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
40718
+ this.clearInsideBorders(cmd.sheetId, [zone]);
40719
+ this.shiftBordersHorizontally(cmd.sheetId, group[0] + 1, -group.length);
40711
40720
  }
40712
40721
  else {
40713
- this.shiftBordersVertically(cmd.sheetId, group[group.length - 1] + 1, -group.length);
40722
+ if (group[0] >= this.getters.getNumberRows(cmd.sheetId)) {
40723
+ for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
40724
+ this.history.update("borders", cmd.sheetId, col, group[0] + 1, "horizontal", undefined);
40725
+ }
40726
+ }
40727
+ if (group[group.length - 1] === 0) {
40728
+ for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
40729
+ this.history.update("borders", cmd.sheetId, col, 0, "horizontal", undefined);
40730
+ }
40731
+ }
40732
+ const zone = this.getters.getRowsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
40733
+ this.clearInsideBorders(cmd.sheetId, [zone]);
40734
+ this.shiftBordersVertically(cmd.sheetId, group[0] + 1, -group.length);
40714
40735
  }
40715
40736
  }
40716
40737
  break;
@@ -41017,6 +41038,18 @@ stores.inject(MyMetaStore, storeInstance);
41017
41038
  }
41018
41039
  }
41019
41040
  }
41041
+ /**
41042
+ * Remove the borders inside of a zone
41043
+ */
41044
+ clearInsideBorders(sheetId, zones) {
41045
+ for (let zone of zones) {
41046
+ for (let row = zone.top; row <= zone.bottom; row++) {
41047
+ for (let col = zone.left; col <= zone.right; col++) {
41048
+ this.history.update("borders", sheetId, col, row, undefined);
41049
+ }
41050
+ }
41051
+ }
41052
+ }
41020
41053
  /**
41021
41054
  * Add a border to the existing one to a cell
41022
41055
  */
@@ -50598,6 +50631,9 @@ stores.inject(MyMetaStore, storeInstance);
50598
50631
  }
50599
50632
  }
50600
50633
  this.acknowledge(message);
50634
+ if (message.type === "REMOTE_REVISION" && message.clientId === this.clientId) {
50635
+ return;
50636
+ }
50601
50637
  this.trigger("collaborative-event-received");
50602
50638
  }
50603
50639
  onClientMoved(message) {
@@ -55149,11 +55185,6 @@ stores.inject(MyMetaStore, storeInstance);
55149
55185
  editionState = "initializing";
55150
55186
  DOMFocusableElementStore;
55151
55187
  setup() {
55152
- owl.onMounted(() => {
55153
- if (this.isSheetActive) {
55154
- this.scrollToSheet();
55155
- }
55156
- });
55157
55188
  owl.onPatched(() => {
55158
55189
  if (this.sheetNameRef.el && this.state.isEditing && this.editionState === "initializing") {
55159
55190
  this.editionState = "editing";
@@ -55161,6 +55192,11 @@ stores.inject(MyMetaStore, storeInstance);
55161
55192
  }
55162
55193
  });
55163
55194
  this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
55195
+ owl.useEffect((sheetId) => {
55196
+ if (this.props.sheetId === sheetId) {
55197
+ this.scrollToSheet();
55198
+ }
55199
+ }, () => [this.env.model.getters.getActiveSheetId()]);
55164
55200
  }
55165
55201
  focusInputAndSelectContent() {
55166
55202
  if (!this.state.isEditing || !this.sheetNameRef.el)
@@ -55172,7 +55208,10 @@ stores.inject(MyMetaStore, storeInstance);
55172
55208
  }
55173
55209
  }
55174
55210
  scrollToSheet() {
55175
- this.sheetDivRef.el?.scrollIntoView?.();
55211
+ this.sheetDivRef.el?.scrollIntoView?.({
55212
+ behavior: "smooth",
55213
+ inline: "nearest",
55214
+ });
55176
55215
  }
55177
55216
  onFocusOut() {
55178
55217
  if (this.state.isEditing && this.editionState !== "initializing") {
@@ -55202,11 +55241,11 @@ stores.inject(MyMetaStore, storeInstance);
55202
55241
  if (ev.key === "Enter") {
55203
55242
  ev.preventDefault();
55204
55243
  this.stopEdition();
55205
- this.DOMFocusableElementStore.focus();
55244
+ this.DOMFocusableElementStore.focusableElement?.focus();
55206
55245
  }
55207
55246
  if (ev.key === "Escape") {
55208
55247
  this.cancelEdition();
55209
- this.DOMFocusableElementStore.focus();
55248
+ this.DOMFocusableElementStore.focusableElement?.focus();
55210
55249
  }
55211
55250
  }
55212
55251
  onMouseEventSheetName(ev) {
@@ -60920,6 +60959,8 @@ stores.inject(MyMetaStore, storeInstance);
60920
60959
  expandZoneOnInsertion,
60921
60960
  reduceZoneOnDeletion,
60922
60961
  unquote,
60962
+ isNumber,
60963
+ isDateTime,
60923
60964
  };
60924
60965
  const links = {
60925
60966
  isMarkdownLink,
@@ -61034,9 +61075,9 @@ stores.inject(MyMetaStore, storeInstance);
61034
61075
  exports.tokenize = tokenize;
61035
61076
 
61036
61077
 
61037
- __info__.version = "17.2.30";
61038
- __info__.date = "2024-12-19T07:48:16.226Z";
61039
- __info__.hash = "9a9ae31";
61078
+ __info__.version = "17.2.31";
61079
+ __info__.date = "2025-01-14T11:31:09.035Z";
61080
+ __info__.hash = "306dbf7";
61040
61081
 
61041
61082
 
61042
61083
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);