@odoo/o-spreadsheet 17.4.16 → 17.4.18

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 17.4.16
6
- * @date 2024-12-19T07:50:04.021Z
7
- * @hash 6b827fc
5
+ * @version 17.4.18
6
+ * @date 2025-01-15T08:05:34.182Z
7
+ * @hash 9e0f399
8
8
  */
9
9
 
10
10
  'use strict';
@@ -20367,6 +20367,17 @@ const TEXT = {
20367
20367
  },
20368
20368
  isExported: true,
20369
20369
  };
20370
+ // -----------------------------------------------------------------------------
20371
+ // VALUE
20372
+ // -----------------------------------------------------------------------------
20373
+ const VALUE = {
20374
+ description: _t("Converts a string to a numeric value."),
20375
+ args: [arg("value (number)", _t("the string to be converted"))],
20376
+ compute: function (value) {
20377
+ return toNumber(value, this.locale);
20378
+ },
20379
+ isExported: true,
20380
+ };
20370
20381
 
20371
20382
  var text = /*#__PURE__*/Object.freeze({
20372
20383
  __proto__: null,
@@ -20389,7 +20400,8 @@ var text = /*#__PURE__*/Object.freeze({
20389
20400
  TEXT: TEXT,
20390
20401
  TEXTJOIN: TEXTJOIN,
20391
20402
  TRIM: TRIM,
20392
- UPPER: UPPER
20403
+ UPPER: UPPER,
20404
+ VALUE: VALUE
20393
20405
  });
20394
20406
 
20395
20407
  // -----------------------------------------------------------------------------
@@ -20646,14 +20658,11 @@ autoCompleteProviders.add("functions", {
20646
20658
  });
20647
20659
 
20648
20660
  class DOMFocusableElementStore {
20649
- mutators = ["setFocusableElement", "focus"];
20661
+ mutators = ["setFocusableElement"];
20650
20662
  focusableElement = undefined;
20651
20663
  setFocusableElement(element) {
20652
20664
  this.focusableElement = element;
20653
20665
  }
20654
- focus() {
20655
- this.focusableElement?.focus();
20656
- }
20657
20666
  }
20658
20667
 
20659
20668
  /**
@@ -24681,7 +24690,11 @@ function createGaugeChartRuntime(chart, getters) {
24681
24690
  colors.push(chartColors.upperColor);
24682
24691
  return {
24683
24692
  background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
24684
- title: chart.title ?? { text: "" },
24693
+ title: {
24694
+ ...chart.title,
24695
+ // chart titles are extracted from .json files and they are translated at runtime here
24696
+ text: _t(chart.title.text ?? ""),
24697
+ },
24685
24698
  minValue: {
24686
24699
  value: minValue,
24687
24700
  label: formatValue(minValue, { locale, format }),
@@ -39421,7 +39434,7 @@ class GridComposer extends owl.Component {
39421
39434
  this.isEditing = isEditing;
39422
39435
  if (!isEditing) {
39423
39436
  this.rect = this.defaultRect;
39424
- this.DOMFocusableElementStore.focus();
39437
+ this.DOMFocusableElementStore.focusableElement?.focus();
39425
39438
  return;
39426
39439
  }
39427
39440
  const position = this.env.model.getters.getActivePosition();
@@ -42461,7 +42474,7 @@ class Grid extends owl.Component {
42461
42474
  this.cellPopovers = useStore(CellPopoverStore);
42462
42475
  owl.useEffect(() => {
42463
42476
  if (!this.sidePanel.isOpen) {
42464
- this.DOMFocusableElementStore.focus();
42477
+ this.DOMFocusableElementStore.focusableElement?.focus();
42465
42478
  }
42466
42479
  }, () => [this.sidePanel.isOpen]);
42467
42480
  }
@@ -42665,7 +42678,7 @@ class Grid extends owl.Component {
42665
42678
  focusDefaultElement() {
42666
42679
  if (!this.env.model.getters.getSelectedFigureId() &&
42667
42680
  this.composerStore.editionMode === "inactive") {
42668
- this.DOMFocusableElementStore.focus();
42681
+ this.DOMFocusableElementStore.focusableElement?.focus();
42669
42682
  }
42670
42683
  }
42671
42684
  get gridEl() {
@@ -44282,7 +44295,7 @@ function extractStyle(cell, data) {
44282
44295
  vertical: style.verticalAlign
44283
44296
  ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
44284
44297
  : undefined,
44285
- wrapText: style.wrapping === "wrap" || undefined,
44298
+ wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
44286
44299
  },
44287
44300
  };
44288
44301
  styles.font["strike"] = !!style?.strikethrough || undefined;
@@ -44505,7 +44518,7 @@ function convertFigure(figure, id, sheetData) {
44505
44518
  return undefined;
44506
44519
  }
44507
44520
  function isChartData(data) {
44508
- return "dataSets" in data;
44521
+ return "dataSets" in data && data.dataSets.length > 0;
44509
44522
  }
44510
44523
  function isImageData(data) {
44511
44524
  return "imageSrc" in data;
@@ -44743,9 +44756,8 @@ function convertRows(sheet, numberOfRows, headerGroups) {
44743
44756
  }
44744
44757
  return rows;
44745
44758
  }
44746
- /** Remove newlines (\n) in shared strings, We do not support them */
44747
44759
  function convertSharedStrings(xlsxSharedStrings) {
44748
- return xlsxSharedStrings.map((str) => str.replace(/\n/g, ""));
44760
+ return xlsxSharedStrings.map(replaceNewLines);
44749
44761
  }
44750
44762
  function convertCells(sheet, data, sheetDims, warningManager) {
44751
44763
  const cells = {};
@@ -45514,15 +45526,10 @@ class XlsxMiscExtractor extends XlsxBaseExtractor {
45514
45526
  getSharedStrings() {
45515
45527
  return this.mapOnElements({ parent: this.rootFile.file.xml, query: "si" }, (ssElement) => {
45516
45528
  // Shared string can either be a simple text, or a rich text (text with formatting, possibly in multiple parts)
45517
- if (ssElement.children[0].tagName === "t") {
45518
- return this.extractTextContent(ssElement) || "";
45519
- }
45520
45529
  // We don't support rich text formatting, we'll only extract the text
45521
- else {
45522
- return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
45523
- return this.extractTextContent(textElement) || "";
45524
- }).join("");
45525
- }
45530
+ return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
45531
+ return this.extractTextContent(textElement) || "";
45532
+ }).join("");
45526
45533
  });
45527
45534
  }
45528
45535
  }
@@ -47396,10 +47403,34 @@ class BordersPlugin extends CorePlugin {
47396
47403
  const elements = [...cmd.elements].sort((a, b) => b - a);
47397
47404
  for (const group of groupConsecutive(elements)) {
47398
47405
  if (cmd.dimension === "COL") {
47399
- this.shiftBordersHorizontally(cmd.sheetId, group[group.length - 1] + 1, -group.length);
47406
+ if (group[0] >= this.getters.getNumberCols(cmd.sheetId)) {
47407
+ for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
47408
+ this.history.update("borders", cmd.sheetId, group[0] + 1, row, "vertical", undefined);
47409
+ }
47410
+ }
47411
+ if (group[group.length - 1] === 0) {
47412
+ for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
47413
+ this.history.update("borders", cmd.sheetId, 0, row, "vertical", undefined);
47414
+ }
47415
+ }
47416
+ const zone = this.getters.getColsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
47417
+ this.clearInsideBorders(cmd.sheetId, [zone]);
47418
+ this.shiftBordersHorizontally(cmd.sheetId, group[0] + 1, -group.length);
47400
47419
  }
47401
47420
  else {
47402
- this.shiftBordersVertically(cmd.sheetId, group[group.length - 1] + 1, -group.length);
47421
+ if (group[0] >= this.getters.getNumberRows(cmd.sheetId)) {
47422
+ for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
47423
+ this.history.update("borders", cmd.sheetId, col, group[0] + 1, "horizontal", undefined);
47424
+ }
47425
+ }
47426
+ if (group[group.length - 1] === 0) {
47427
+ for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
47428
+ this.history.update("borders", cmd.sheetId, col, 0, "horizontal", undefined);
47429
+ }
47430
+ }
47431
+ const zone = this.getters.getRowsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
47432
+ this.clearInsideBorders(cmd.sheetId, [zone]);
47433
+ this.shiftBordersVertically(cmd.sheetId, group[0] + 1, -group.length);
47403
47434
  }
47404
47435
  }
47405
47436
  break;
@@ -47706,6 +47737,18 @@ class BordersPlugin extends CorePlugin {
47706
47737
  }
47707
47738
  }
47708
47739
  }
47740
+ /**
47741
+ * Remove the borders inside of a zone
47742
+ */
47743
+ clearInsideBorders(sheetId, zones) {
47744
+ for (let zone of zones) {
47745
+ for (let row = zone.top; row <= zone.bottom; row++) {
47746
+ for (let col = zone.left; col <= zone.right; col++) {
47747
+ this.history.update("borders", sheetId, col, row, undefined);
47748
+ }
47749
+ }
47750
+ }
47751
+ }
47709
47752
  /**
47710
47753
  * Add a border to the existing one to a cell
47711
47754
  */
@@ -62288,11 +62331,6 @@ class BottomBarSheet extends owl.Component {
62288
62331
  editionState = "initializing";
62289
62332
  DOMFocusableElementStore;
62290
62333
  setup() {
62291
- owl.onMounted(() => {
62292
- if (this.isSheetActive) {
62293
- this.scrollToSheet();
62294
- }
62295
- });
62296
62334
  owl.onPatched(() => {
62297
62335
  if (this.sheetNameRef.el && this.state.isEditing && this.editionState === "initializing") {
62298
62336
  this.editionState = "editing";
@@ -62300,6 +62338,11 @@ class BottomBarSheet extends owl.Component {
62300
62338
  }
62301
62339
  });
62302
62340
  this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
62341
+ owl.useEffect((sheetId) => {
62342
+ if (this.props.sheetId === sheetId) {
62343
+ this.scrollToSheet();
62344
+ }
62345
+ }, () => [this.env.model.getters.getActiveSheetId()]);
62303
62346
  }
62304
62347
  focusInputAndSelectContent() {
62305
62348
  if (!this.state.isEditing || !this.sheetNameRef.el)
@@ -62311,7 +62354,10 @@ class BottomBarSheet extends owl.Component {
62311
62354
  }
62312
62355
  }
62313
62356
  scrollToSheet() {
62314
- this.sheetDivRef.el?.scrollIntoView?.();
62357
+ this.sheetDivRef.el?.scrollIntoView?.({
62358
+ behavior: "smooth",
62359
+ inline: "nearest",
62360
+ });
62315
62361
  }
62316
62362
  onFocusOut() {
62317
62363
  if (this.state.isEditing && this.editionState !== "initializing") {
@@ -62341,11 +62387,11 @@ class BottomBarSheet extends owl.Component {
62341
62387
  if (ev.key === "Enter") {
62342
62388
  ev.preventDefault();
62343
62389
  this.stopEdition();
62344
- this.DOMFocusableElementStore.focus();
62390
+ this.DOMFocusableElementStore.focusableElement?.focus();
62345
62391
  }
62346
62392
  if (ev.key === "Escape") {
62347
62393
  this.cancelEdition();
62348
- this.DOMFocusableElementStore.focus();
62394
+ this.DOMFocusableElementStore.focusableElement?.focus();
62349
62395
  }
62350
62396
  }
62351
62397
  onMouseEventSheetName(ev) {
@@ -67880,7 +67926,12 @@ function createSharedStrings(strings) {
67880
67926
  ["count", strings.length],
67881
67927
  ["uniqueCount", strings.length],
67882
67928
  ];
67883
- const stringNodes = strings.map((string) => escapeXml /*xml*/ `<si><t>${string}</t></si>`);
67929
+ const stringNodes = strings.map((string) => {
67930
+ if (string.trim() !== string) {
67931
+ return escapeXml /*xml*/ `<si><t xml:space="preserve">${string}</t></si>`;
67932
+ }
67933
+ return escapeXml /*xml*/ `<si><t>${string}</t></si>`;
67934
+ });
67884
67935
  const xml = escapeXml /*xml*/ `
67885
67936
  <sst ${formatAttributes(namespaces)}>
67886
67937
  ${joinXmlNodes(stringNodes)}
@@ -68617,6 +68668,8 @@ const helpers = {
68617
68668
  areDomainArgsFieldsValid,
68618
68669
  formatTickValue,
68619
68670
  sanitizeSheetName,
68671
+ isNumber,
68672
+ isDateTime,
68620
68673
  };
68621
68674
  const links = {
68622
68675
  isMarkdownLink,
@@ -68747,6 +68800,6 @@ exports.tokenColors = tokenColors;
68747
68800
  exports.tokenize = tokenize;
68748
68801
 
68749
68802
 
68750
- __info__.version = "17.4.16";
68751
- __info__.date = "2024-12-19T07:50:04.021Z";
68752
- __info__.hash = "6b827fc";
68803
+ __info__.version = "17.4.18";
68804
+ __info__.date = "2025-01-15T08:05:34.182Z";
68805
+ __info__.hash = "9e0f399";
@@ -2671,6 +2671,10 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
2671
2671
  * Remove the borders of a zone
2672
2672
  */
2673
2673
  private clearBorders;
2674
+ /**
2675
+ * Remove the borders inside of a zone
2676
+ */
2677
+ private clearInsideBorders;
2674
2678
  /**
2675
2679
  * Add a border to the existing one to a cell
2676
2680
  */
@@ -5534,6 +5538,7 @@ declare class DateTime {
5534
5538
  setMinutes(minutes: number): number;
5535
5539
  setSeconds(seconds: number): number;
5536
5540
  }
5541
+ declare function isDateTime(str: string, locale: Locale): boolean;
5537
5542
 
5538
5543
  /**
5539
5544
  * Formats a cell value with its format.
@@ -5573,6 +5578,13 @@ declare function lazy<T>(fn: (() => T) | T): Lazy<T>;
5573
5578
  */
5574
5579
  declare function deepEquals(o1: any, o2: any): boolean;
5575
5580
 
5581
+ /**
5582
+ * Return true if the argument is a "number string".
5583
+ *
5584
+ * Note that "" (empty string) does not count as a number string
5585
+ */
5586
+ declare function isNumber(value: string | undefined, locale: Locale): boolean;
5587
+
5576
5588
  interface ConstructorArgs {
5577
5589
  readonly zone: Readonly<Zone | UnboundedZone>;
5578
5590
  readonly parts: readonly RangePart[];
@@ -11535,6 +11547,8 @@ declare const helpers: {
11535
11547
  areDomainArgsFieldsValid: typeof areDomainArgsFieldsValid;
11536
11548
  formatTickValue: typeof formatTickValue;
11537
11549
  sanitizeSheetName: typeof sanitizeSheetName;
11550
+ isNumber: typeof isNumber;
11551
+ isDateTime: typeof isDateTime;
11538
11552
  };
11539
11553
  declare const links: {
11540
11554
  isMarkdownLink: typeof isMarkdownLink;
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.4.16
6
- * @date 2024-12-19T07:50:04.021Z
7
- * @hash 6b827fc
5
+ * @version 17.4.18
6
+ * @date 2025-01-15T08:05:34.182Z
7
+ * @hash 9e0f399
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';
@@ -20365,6 +20365,17 @@ const TEXT = {
20365
20365
  },
20366
20366
  isExported: true,
20367
20367
  };
20368
+ // -----------------------------------------------------------------------------
20369
+ // VALUE
20370
+ // -----------------------------------------------------------------------------
20371
+ const VALUE = {
20372
+ description: _t("Converts a string to a numeric value."),
20373
+ args: [arg("value (number)", _t("the string to be converted"))],
20374
+ compute: function (value) {
20375
+ return toNumber(value, this.locale);
20376
+ },
20377
+ isExported: true,
20378
+ };
20368
20379
 
20369
20380
  var text = /*#__PURE__*/Object.freeze({
20370
20381
  __proto__: null,
@@ -20387,7 +20398,8 @@ var text = /*#__PURE__*/Object.freeze({
20387
20398
  TEXT: TEXT,
20388
20399
  TEXTJOIN: TEXTJOIN,
20389
20400
  TRIM: TRIM,
20390
- UPPER: UPPER
20401
+ UPPER: UPPER,
20402
+ VALUE: VALUE
20391
20403
  });
20392
20404
 
20393
20405
  // -----------------------------------------------------------------------------
@@ -20644,14 +20656,11 @@ autoCompleteProviders.add("functions", {
20644
20656
  });
20645
20657
 
20646
20658
  class DOMFocusableElementStore {
20647
- mutators = ["setFocusableElement", "focus"];
20659
+ mutators = ["setFocusableElement"];
20648
20660
  focusableElement = undefined;
20649
20661
  setFocusableElement(element) {
20650
20662
  this.focusableElement = element;
20651
20663
  }
20652
- focus() {
20653
- this.focusableElement?.focus();
20654
- }
20655
20664
  }
20656
20665
 
20657
20666
  /**
@@ -24679,7 +24688,11 @@ function createGaugeChartRuntime(chart, getters) {
24679
24688
  colors.push(chartColors.upperColor);
24680
24689
  return {
24681
24690
  background: getters.getStyleOfSingleCellChart(chart.background, dataRange).background,
24682
- title: chart.title ?? { text: "" },
24691
+ title: {
24692
+ ...chart.title,
24693
+ // chart titles are extracted from .json files and they are translated at runtime here
24694
+ text: _t(chart.title.text ?? ""),
24695
+ },
24683
24696
  minValue: {
24684
24697
  value: minValue,
24685
24698
  label: formatValue(minValue, { locale, format }),
@@ -39419,7 +39432,7 @@ class GridComposer extends Component {
39419
39432
  this.isEditing = isEditing;
39420
39433
  if (!isEditing) {
39421
39434
  this.rect = this.defaultRect;
39422
- this.DOMFocusableElementStore.focus();
39435
+ this.DOMFocusableElementStore.focusableElement?.focus();
39423
39436
  return;
39424
39437
  }
39425
39438
  const position = this.env.model.getters.getActivePosition();
@@ -42459,7 +42472,7 @@ class Grid extends Component {
42459
42472
  this.cellPopovers = useStore(CellPopoverStore);
42460
42473
  useEffect(() => {
42461
42474
  if (!this.sidePanel.isOpen) {
42462
- this.DOMFocusableElementStore.focus();
42475
+ this.DOMFocusableElementStore.focusableElement?.focus();
42463
42476
  }
42464
42477
  }, () => [this.sidePanel.isOpen]);
42465
42478
  }
@@ -42663,7 +42676,7 @@ class Grid extends Component {
42663
42676
  focusDefaultElement() {
42664
42677
  if (!this.env.model.getters.getSelectedFigureId() &&
42665
42678
  this.composerStore.editionMode === "inactive") {
42666
- this.DOMFocusableElementStore.focus();
42679
+ this.DOMFocusableElementStore.focusableElement?.focus();
42667
42680
  }
42668
42681
  }
42669
42682
  get gridEl() {
@@ -44280,7 +44293,7 @@ function extractStyle(cell, data) {
44280
44293
  vertical: style.verticalAlign
44281
44294
  ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign]
44282
44295
  : undefined,
44283
- wrapText: style.wrapping === "wrap" || undefined,
44296
+ wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : undefined,
44284
44297
  },
44285
44298
  };
44286
44299
  styles.font["strike"] = !!style?.strikethrough || undefined;
@@ -44503,7 +44516,7 @@ function convertFigure(figure, id, sheetData) {
44503
44516
  return undefined;
44504
44517
  }
44505
44518
  function isChartData(data) {
44506
- return "dataSets" in data;
44519
+ return "dataSets" in data && data.dataSets.length > 0;
44507
44520
  }
44508
44521
  function isImageData(data) {
44509
44522
  return "imageSrc" in data;
@@ -44741,9 +44754,8 @@ function convertRows(sheet, numberOfRows, headerGroups) {
44741
44754
  }
44742
44755
  return rows;
44743
44756
  }
44744
- /** Remove newlines (\n) in shared strings, We do not support them */
44745
44757
  function convertSharedStrings(xlsxSharedStrings) {
44746
- return xlsxSharedStrings.map((str) => str.replace(/\n/g, ""));
44758
+ return xlsxSharedStrings.map(replaceNewLines);
44747
44759
  }
44748
44760
  function convertCells(sheet, data, sheetDims, warningManager) {
44749
44761
  const cells = {};
@@ -45512,15 +45524,10 @@ class XlsxMiscExtractor extends XlsxBaseExtractor {
45512
45524
  getSharedStrings() {
45513
45525
  return this.mapOnElements({ parent: this.rootFile.file.xml, query: "si" }, (ssElement) => {
45514
45526
  // Shared string can either be a simple text, or a rich text (text with formatting, possibly in multiple parts)
45515
- if (ssElement.children[0].tagName === "t") {
45516
- return this.extractTextContent(ssElement) || "";
45517
- }
45518
45527
  // We don't support rich text formatting, we'll only extract the text
45519
- else {
45520
- return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
45521
- return this.extractTextContent(textElement) || "";
45522
- }).join("");
45523
- }
45528
+ return this.mapOnElements({ parent: ssElement, query: "t" }, (textElement) => {
45529
+ return this.extractTextContent(textElement) || "";
45530
+ }).join("");
45524
45531
  });
45525
45532
  }
45526
45533
  }
@@ -47394,10 +47401,34 @@ class BordersPlugin extends CorePlugin {
47394
47401
  const elements = [...cmd.elements].sort((a, b) => b - a);
47395
47402
  for (const group of groupConsecutive(elements)) {
47396
47403
  if (cmd.dimension === "COL") {
47397
- this.shiftBordersHorizontally(cmd.sheetId, group[group.length - 1] + 1, -group.length);
47404
+ if (group[0] >= this.getters.getNumberCols(cmd.sheetId)) {
47405
+ for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
47406
+ this.history.update("borders", cmd.sheetId, group[0] + 1, row, "vertical", undefined);
47407
+ }
47408
+ }
47409
+ if (group[group.length - 1] === 0) {
47410
+ for (let row = 0; row < this.getters.getNumberRows(cmd.sheetId); row++) {
47411
+ this.history.update("borders", cmd.sheetId, 0, row, "vertical", undefined);
47412
+ }
47413
+ }
47414
+ const zone = this.getters.getColsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
47415
+ this.clearInsideBorders(cmd.sheetId, [zone]);
47416
+ this.shiftBordersHorizontally(cmd.sheetId, group[0] + 1, -group.length);
47398
47417
  }
47399
47418
  else {
47400
- this.shiftBordersVertically(cmd.sheetId, group[group.length - 1] + 1, -group.length);
47419
+ if (group[0] >= this.getters.getNumberRows(cmd.sheetId)) {
47420
+ for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
47421
+ this.history.update("borders", cmd.sheetId, col, group[0] + 1, "horizontal", undefined);
47422
+ }
47423
+ }
47424
+ if (group[group.length - 1] === 0) {
47425
+ for (let col = 0; col < this.getters.getNumberCols(cmd.sheetId); col++) {
47426
+ this.history.update("borders", cmd.sheetId, col, 0, "horizontal", undefined);
47427
+ }
47428
+ }
47429
+ const zone = this.getters.getRowsZone(cmd.sheetId, group[group.length - 1] + 1, group[0]);
47430
+ this.clearInsideBorders(cmd.sheetId, [zone]);
47431
+ this.shiftBordersVertically(cmd.sheetId, group[0] + 1, -group.length);
47401
47432
  }
47402
47433
  }
47403
47434
  break;
@@ -47704,6 +47735,18 @@ class BordersPlugin extends CorePlugin {
47704
47735
  }
47705
47736
  }
47706
47737
  }
47738
+ /**
47739
+ * Remove the borders inside of a zone
47740
+ */
47741
+ clearInsideBorders(sheetId, zones) {
47742
+ for (let zone of zones) {
47743
+ for (let row = zone.top; row <= zone.bottom; row++) {
47744
+ for (let col = zone.left; col <= zone.right; col++) {
47745
+ this.history.update("borders", sheetId, col, row, undefined);
47746
+ }
47747
+ }
47748
+ }
47749
+ }
47707
47750
  /**
47708
47751
  * Add a border to the existing one to a cell
47709
47752
  */
@@ -62286,11 +62329,6 @@ class BottomBarSheet extends Component {
62286
62329
  editionState = "initializing";
62287
62330
  DOMFocusableElementStore;
62288
62331
  setup() {
62289
- onMounted(() => {
62290
- if (this.isSheetActive) {
62291
- this.scrollToSheet();
62292
- }
62293
- });
62294
62332
  onPatched(() => {
62295
62333
  if (this.sheetNameRef.el && this.state.isEditing && this.editionState === "initializing") {
62296
62334
  this.editionState = "editing";
@@ -62298,6 +62336,11 @@ class BottomBarSheet extends Component {
62298
62336
  }
62299
62337
  });
62300
62338
  this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
62339
+ useEffect((sheetId) => {
62340
+ if (this.props.sheetId === sheetId) {
62341
+ this.scrollToSheet();
62342
+ }
62343
+ }, () => [this.env.model.getters.getActiveSheetId()]);
62301
62344
  }
62302
62345
  focusInputAndSelectContent() {
62303
62346
  if (!this.state.isEditing || !this.sheetNameRef.el)
@@ -62309,7 +62352,10 @@ class BottomBarSheet extends Component {
62309
62352
  }
62310
62353
  }
62311
62354
  scrollToSheet() {
62312
- this.sheetDivRef.el?.scrollIntoView?.();
62355
+ this.sheetDivRef.el?.scrollIntoView?.({
62356
+ behavior: "smooth",
62357
+ inline: "nearest",
62358
+ });
62313
62359
  }
62314
62360
  onFocusOut() {
62315
62361
  if (this.state.isEditing && this.editionState !== "initializing") {
@@ -62339,11 +62385,11 @@ class BottomBarSheet extends Component {
62339
62385
  if (ev.key === "Enter") {
62340
62386
  ev.preventDefault();
62341
62387
  this.stopEdition();
62342
- this.DOMFocusableElementStore.focus();
62388
+ this.DOMFocusableElementStore.focusableElement?.focus();
62343
62389
  }
62344
62390
  if (ev.key === "Escape") {
62345
62391
  this.cancelEdition();
62346
- this.DOMFocusableElementStore.focus();
62392
+ this.DOMFocusableElementStore.focusableElement?.focus();
62347
62393
  }
62348
62394
  }
62349
62395
  onMouseEventSheetName(ev) {
@@ -67878,7 +67924,12 @@ function createSharedStrings(strings) {
67878
67924
  ["count", strings.length],
67879
67925
  ["uniqueCount", strings.length],
67880
67926
  ];
67881
- const stringNodes = strings.map((string) => escapeXml /*xml*/ `<si><t>${string}</t></si>`);
67927
+ const stringNodes = strings.map((string) => {
67928
+ if (string.trim() !== string) {
67929
+ return escapeXml /*xml*/ `<si><t xml:space="preserve">${string}</t></si>`;
67930
+ }
67931
+ return escapeXml /*xml*/ `<si><t>${string}</t></si>`;
67932
+ });
67882
67933
  const xml = escapeXml /*xml*/ `
67883
67934
  <sst ${formatAttributes(namespaces)}>
67884
67935
  ${joinXmlNodes(stringNodes)}
@@ -68615,6 +68666,8 @@ const helpers = {
68615
68666
  areDomainArgsFieldsValid,
68616
68667
  formatTickValue,
68617
68668
  sanitizeSheetName,
68669
+ isNumber,
68670
+ isDateTime,
68618
68671
  };
68619
68672
  const links = {
68620
68673
  isMarkdownLink,
@@ -68702,6 +68755,6 @@ const constants = {
68702
68755
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
68703
68756
 
68704
68757
 
68705
- __info__.version = "17.4.16";
68706
- __info__.date = "2024-12-19T07:50:04.021Z";
68707
- __info__.hash = "6b827fc";
68758
+ __info__.version = "17.4.18";
68759
+ __info__.date = "2025-01-15T08:05:34.182Z";
68760
+ __info__.hash = "9e0f399";