@odoo/o-spreadsheet 17.2.2 → 17.2.3

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.2
7
- * @date 2024-04-05T14:01:19.824Z
8
- * @hash c15836d
6
+ * @version 17.2.3
7
+ * @date 2024-04-10T12:28:36.552Z
8
+ * @hash ab5e22d
9
9
  */
10
10
 
11
11
  'use strict';
@@ -562,7 +562,7 @@ function deepEquals(o1, o2) {
562
562
  if (typeof o1 !== typeof o2)
563
563
  return false;
564
564
  if (typeof o1 !== "object")
565
- return o1 === o2;
565
+ return false;
566
566
  // Objects can have different keys if the values are undefined
567
567
  for (const key in o2) {
568
568
  if (!(key in o1) && o2[key] !== undefined) {
@@ -31969,6 +31969,7 @@ class Composer extends owl.Component {
31969
31969
  onComposerCellFocused: { type: Function, optional: true },
31970
31970
  onComposerContentFocused: Function,
31971
31971
  isDefaultFocus: { type: Boolean, optional: true },
31972
+ onInputContextMenu: { type: Function, optional: true },
31972
31973
  };
31973
31974
  static components = { TextValueProvider, FunctionDescriptionProvider };
31974
31975
  static defaultProps = {
@@ -32019,6 +32020,9 @@ class Composer extends owl.Component {
32019
32020
  assistantStyle.right = `0px`;
32020
32021
  }
32021
32022
  }
32023
+ else if (this.props.delimitation) {
32024
+ assistantStyle["max-height"] = `${this.props.delimitation.height}px`;
32025
+ }
32022
32026
  return cssPropertiesToCss(assistantStyle);
32023
32027
  }
32024
32028
  // we can't allow input events to be triggered while we remove and add back the content of the composer in processContent
@@ -32305,6 +32309,11 @@ class Composer extends owl.Component {
32305
32309
  }
32306
32310
  }
32307
32311
  }
32312
+ onContextMenu(ev) {
32313
+ if (this.composerStore.editionMode === "inactive") {
32314
+ this.props.onInputContextMenu?.(ev);
32315
+ }
32316
+ }
32308
32317
  // ---------------------------------------------------------------------------
32309
32318
  // Private
32310
32319
  // ---------------------------------------------------------------------------
@@ -32526,6 +32535,7 @@ class GridComposer extends owl.Component {
32526
32535
  static template = "o-spreadsheet-GridComposer";
32527
32536
  static props = {
32528
32537
  gridDims: Object,
32538
+ onInputContextMenu: Function,
32529
32539
  };
32530
32540
  static components = { Composer };
32531
32541
  rect = this.defaultRect;
@@ -32573,6 +32583,7 @@ class GridComposer extends owl.Component {
32573
32583
  isDefaultFocus: true,
32574
32584
  onComposerContentFocused: () => this.composerFocusStore.focusGridComposerContent(),
32575
32585
  onComposerCellFocused: (content) => this.composerFocusStore.focusGridComposerCell(content),
32586
+ onInputContextMenu: this.props.onInputContextMenu,
32576
32587
  };
32577
32588
  }
32578
32589
  get containerStyle() {
@@ -37295,29 +37306,12 @@ function convertWidthFromExcel(width) {
37295
37306
  return width;
37296
37307
  return Math.round((width / WIDTH_FACTOR) * 100) / 100;
37297
37308
  }
37298
- function convertBorderDescr(descr) {
37299
- if (!descr) {
37300
- return undefined;
37301
- }
37302
- return {
37303
- style: descr.style,
37304
- color: { rgb: descr.color },
37305
- };
37306
- }
37307
37309
  function extractStyle(cell, data) {
37308
37310
  let style = {};
37309
37311
  if (cell.style) {
37310
37312
  style = data.styles[cell.style];
37311
37313
  }
37312
37314
  const format = extractFormat(cell, data);
37313
- const exportedBorder = {};
37314
- if (cell.border) {
37315
- const border = data.borders[cell.border];
37316
- exportedBorder.left = convertBorderDescr(border.left);
37317
- exportedBorder.right = convertBorderDescr(border.right);
37318
- exportedBorder.bottom = convertBorderDescr(border.bottom);
37319
- exportedBorder.top = convertBorderDescr(border.top);
37320
- }
37321
37315
  const styles = {
37322
37316
  font: {
37323
37317
  size: style?.fontSize || DEFAULT_FONT_SIZE,
@@ -37331,7 +37325,7 @@ function extractStyle(cell, data) {
37331
37325
  }
37332
37326
  : { reservedAttribute: "none" },
37333
37327
  numFmt: format ? { format: format, id: 0 /* id not used for export */ } : undefined,
37334
- border: exportedBorder || {},
37328
+ border: cell.border || 0,
37335
37329
  alignment: {
37336
37330
  horizontal: style.align,
37337
37331
  vertical: style.verticalAlign
@@ -37353,15 +37347,12 @@ function extractFormat(cell, data) {
37353
37347
  return undefined;
37354
37348
  }
37355
37349
  function normalizeStyle(construct, styles) {
37356
- const { id: fontId } = pushElement(styles["font"], construct.fonts);
37357
- const { id: fillId } = pushElement(styles["fill"], construct.fills);
37358
- const { id: borderId } = pushElement(styles["border"], construct.borders);
37359
37350
  // Normalize this
37360
37351
  const numFmtId = convertFormat(styles["numFmt"], construct.numFmts);
37361
37352
  const style = {
37362
- fontId,
37363
- fillId,
37364
- borderId,
37353
+ fontId: pushElement(styles.font, construct.fonts),
37354
+ fillId: pushElement(styles.fill, construct.fills),
37355
+ borderId: styles.border,
37365
37356
  numFmtId,
37366
37357
  alignment: {
37367
37358
  vertical: styles.alignment.vertical,
@@ -37369,8 +37360,7 @@ function normalizeStyle(construct, styles) {
37369
37360
  wrapText: styles.alignment.wrapText,
37370
37361
  },
37371
37362
  };
37372
- const { id } = pushElement(style, construct.styles);
37373
- return id;
37363
+ return pushElement(style, construct.styles);
37374
37364
  }
37375
37365
  function convertFormat(format, numFmtStructure) {
37376
37366
  if (!format) {
@@ -37378,8 +37368,7 @@ function convertFormat(format, numFmtStructure) {
37378
37368
  }
37379
37369
  let formatId = XLSX_FORMAT_MAP[format.format];
37380
37370
  if (!formatId) {
37381
- const { id } = pushElement(format, numFmtStructure);
37382
- formatId = id + FIRST_NUMFMT_ID;
37371
+ formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
37383
37372
  }
37384
37373
  return formatId;
37385
37374
  }
@@ -37404,20 +37393,15 @@ function addRelsToFile(relsFiles, path, rel) {
37404
37393
  return id;
37405
37394
  }
37406
37395
  function pushElement(property, propertyList) {
37407
- for (let [key, value] of Object.entries(propertyList)) {
37408
- if (JSON.stringify(value) === JSON.stringify(property)) {
37409
- return { id: parseInt(key, 10), list: propertyList };
37396
+ let len = propertyList.length;
37397
+ const operator = typeof property === "object" ? deepEquals : (a, b) => a === b;
37398
+ for (let i = 0; i < len; i++) {
37399
+ if (operator(property, propertyList[i])) {
37400
+ return i;
37410
37401
  }
37411
37402
  }
37412
- let elemId = propertyList.findIndex((elem) => JSON.stringify(elem) === JSON.stringify(property));
37413
- if (elemId === -1) {
37414
- propertyList.push(property);
37415
- elemId = propertyList.length - 1;
37416
- }
37417
- return {
37418
- id: elemId,
37419
- list: propertyList,
37420
- };
37403
+ propertyList[propertyList.length] = property;
37404
+ return propertyList.length - 1;
37421
37405
  }
37422
37406
  const chartIds = [];
37423
37407
  /**
@@ -38212,7 +38196,25 @@ function parseXML(xmlString, mimeType = "text/xml") {
38212
38196
  }
38213
38197
  return document;
38214
38198
  }
38215
- function getDefaultXLSXStructure() {
38199
+ function convertBorderDescr(descr) {
38200
+ if (!descr) {
38201
+ return undefined;
38202
+ }
38203
+ return {
38204
+ style: descr.style,
38205
+ color: { rgb: descr.color },
38206
+ };
38207
+ }
38208
+ function getDefaultXLSXStructure(data) {
38209
+ const xlsxBorders = Object.values(data.borders).map((border) => {
38210
+ return {
38211
+ left: convertBorderDescr(border.left),
38212
+ right: convertBorderDescr(border.right),
38213
+ bottom: convertBorderDescr(border.bottom),
38214
+ top: convertBorderDescr(border.top),
38215
+ };
38216
+ });
38217
+ const borders = [{}, ...xlsxBorders];
38216
38218
  return {
38217
38219
  relsFiles: [],
38218
38220
  sharedStrings: [],
@@ -38235,7 +38237,7 @@ function getDefaultXLSXStructure() {
38235
38237
  },
38236
38238
  ],
38237
38239
  fills: [{ reservedAttribute: "none" }, { reservedAttribute: "gray125" }],
38238
- borders: [{}],
38240
+ borders,
38239
38241
  numFmts: [],
38240
38242
  dxfs: [],
38241
38243
  };
@@ -45272,7 +45274,15 @@ class TablePlugin extends CorePlugin {
45272
45274
  }
45273
45275
  }
45274
45276
  exportForExcel(data) {
45275
- this.export(data);
45277
+ for (const sheet of data.sheets) {
45278
+ for (const table of this.getTables(sheet.id)) {
45279
+ if (zoneToDimension(table.range.zone).numberOfRows === 1) {
45280
+ continue;
45281
+ }
45282
+ const tableData = { range: zoneToXc(table.range.zone), filters: [] };
45283
+ sheet.tables.push(tableData);
45284
+ }
45285
+ }
45276
45286
  }
45277
45287
  }
45278
45288
 
@@ -47044,7 +47054,9 @@ class Evaluator {
47044
47054
  this.blockedArrayFormulas = this.createEmptyPositionSet();
47045
47055
  this.spreadingRelations = new SpreadingRelation(this.createEmptyPositionSet.bind(this));
47046
47056
  this.formulaDependencies = lazy(() => {
47047
- const dependencies = [...this.getAllCells()].flatMap((position) => this.getDirectDependencies(position).map((range) => ({
47057
+ const dependencies = [...this.getAllCells()].flatMap((position) => this.getDirectDependencies(position)
47058
+ .filter((range) => !range.invalidSheetName && !range.invalidXc)
47059
+ .map((range) => ({
47048
47060
  data: position,
47049
47061
  boundingBox: {
47050
47062
  zone: range.zone,
@@ -55689,6 +55701,13 @@ class TopBarComposer extends owl.Component {
55689
55701
  "border-color": SELECTION_BORDER_COLOR,
55690
55702
  });
55691
55703
  }
55704
+ get delimitation() {
55705
+ const { width, height } = this.env.model.getters.getSheetViewDimensionWithHeaders();
55706
+ return {
55707
+ width,
55708
+ height,
55709
+ };
55710
+ }
55692
55711
  onFocus(selection) {
55693
55712
  this.composerFocusStore.focusTopBarComposer(selection);
55694
55713
  }
@@ -58320,8 +58339,7 @@ function addContent(content, sharedStrings, forceString = false) {
58320
58339
  attrs.push(["t", "b"]);
58321
58340
  }
58322
58341
  else if (forceString || !isNumber(value, DEFAULT_LOCALE)) {
58323
- const { id } = pushElement(content, sharedStrings);
58324
- value = id.toString();
58342
+ value = pushElement(content, sharedStrings);
58325
58343
  attrs.push(["t", "s"]);
58326
58344
  }
58327
58345
  return { attrs, node: escapeXml /*xml*/ `<v>${value}</v>` };
@@ -58446,8 +58464,7 @@ function addCellIsRule(cf, rule, dxfs) {
58446
58464
  if (rule.style.fillColor) {
58447
58465
  dxf.fill = { fgColor: { rgb: rule.style.fillColor } };
58448
58466
  }
58449
- const { id } = pushElement(dxf, dxfs);
58450
- ruleAttributes.push(["dxfId", id]);
58467
+ ruleAttributes.push(["dxfId", pushElement(dxf, dxfs)]);
58451
58468
  return escapeXml /*xml*/ `
58452
58469
  <conditionalFormatting sqref="${cf.ranges.join(" ")}">
58453
58470
  <cfRule ${formatAttributes(ruleAttributes)}>
@@ -59277,7 +59294,7 @@ function addSheetViews(sheet) {
59277
59294
  */
59278
59295
  function getXLSX(data) {
59279
59296
  const files = [];
59280
- const construct = getDefaultXLSXStructure();
59297
+ const construct = getDefaultXLSXStructure(data);
59281
59298
  files.push(createWorkbook(data, construct));
59282
59299
  files.push(...createWorksheets(data, construct));
59283
59300
  files.push(createStylesSheet(construct));
@@ -60212,6 +60229,6 @@ exports.tokenColors = tokenColors;
60212
60229
  exports.tokenize = tokenize;
60213
60230
 
60214
60231
 
60215
- __info__.version = "17.2.2";
60216
- __info__.date = "2024-04-05T14:01:19.824Z";
60217
- __info__.hash = "c15836d";
60232
+ __info__.version = "17.2.3";
60233
+ __info__.date = "2024-04-10T12:28:36.552Z";
60234
+ __info__.hash = "ab5e22d";
@@ -6685,6 +6685,7 @@ interface ComposerProps {
6685
6685
  delimitation?: DOMDimension;
6686
6686
  onComposerContentFocused: () => void;
6687
6687
  onComposerCellFocused?: (content: String) => void;
6688
+ onInputContextMenu?: (event: MouseEvent) => void;
6688
6689
  isDefaultFocus?: boolean;
6689
6690
  }
6690
6691
  interface ComposerState {
@@ -6728,6 +6729,10 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6728
6729
  type: BooleanConstructor;
6729
6730
  optional: boolean;
6730
6731
  };
6732
+ onInputContextMenu: {
6733
+ type: FunctionConstructor;
6734
+ optional: boolean;
6735
+ };
6731
6736
  };
6732
6737
  static components: {
6733
6738
  TextValueProvider: typeof TextValueProvider;
@@ -6784,6 +6789,7 @@ declare class Composer extends Component<ComposerProps, SpreadsheetChildEnv> {
6784
6789
  onMousedown(ev: MouseEvent): void;
6785
6790
  onClick(): void;
6786
6791
  onDblClick(): void;
6792
+ onContextMenu(ev: MouseEvent): void;
6787
6793
  private processContent;
6788
6794
  /**
6789
6795
  * Get the HTML content corresponding to the current composer token, divided by lines.
@@ -7088,6 +7094,7 @@ declare class ClientTag extends Component<ClientTagProps, SpreadsheetChildEnv> {
7088
7094
 
7089
7095
  interface Props$s {
7090
7096
  gridDims: DOMDimension;
7097
+ onInputContextMenu: (event: MouseEvent) => void;
7091
7098
  }
7092
7099
  /**
7093
7100
  * This component is a composer which positions itself on the grid at the anchor cell.
@@ -7097,6 +7104,7 @@ declare class GridComposer extends Component<Props$s, SpreadsheetChildEnv> {
7097
7104
  static template: string;
7098
7105
  static props: {
7099
7106
  gridDims: ObjectConstructor;
7107
+ onInputContextMenu: FunctionConstructor;
7100
7108
  };
7101
7109
  static components: {
7102
7110
  Composer: typeof Composer;
@@ -8830,6 +8838,7 @@ declare class TopBarComposer extends Component<any, SpreadsheetChildEnv> {
8830
8838
  get focus(): Omit<ComposerFocusType, "cellFocus">;
8831
8839
  get composerStyle(): string;
8832
8840
  get containerStyle(): string;
8841
+ get delimitation(): DOMDimension;
8833
8842
  onFocus(selection: ComposerSelection): void;
8834
8843
  }
8835
8844
 
@@ -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.2
7
- * @date 2024-04-05T14:01:19.824Z
8
- * @hash c15836d
6
+ * @version 17.2.3
7
+ * @date 2024-04-10T12:28:36.552Z
8
+ * @hash ab5e22d
9
9
  */
10
10
 
11
11
  import { reactive, useEnv, useSubEnv, useState, onWillUnmount, markRaw, toRaw, Component, useRef, onMounted, useEffect, onPatched, useComponent, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv } from '@odoo/owl';
@@ -560,7 +560,7 @@ function deepEquals(o1, o2) {
560
560
  if (typeof o1 !== typeof o2)
561
561
  return false;
562
562
  if (typeof o1 !== "object")
563
- return o1 === o2;
563
+ return false;
564
564
  // Objects can have different keys if the values are undefined
565
565
  for (const key in o2) {
566
566
  if (!(key in o1) && o2[key] !== undefined) {
@@ -31967,6 +31967,7 @@ class Composer extends Component {
31967
31967
  onComposerCellFocused: { type: Function, optional: true },
31968
31968
  onComposerContentFocused: Function,
31969
31969
  isDefaultFocus: { type: Boolean, optional: true },
31970
+ onInputContextMenu: { type: Function, optional: true },
31970
31971
  };
31971
31972
  static components = { TextValueProvider, FunctionDescriptionProvider };
31972
31973
  static defaultProps = {
@@ -32017,6 +32018,9 @@ class Composer extends Component {
32017
32018
  assistantStyle.right = `0px`;
32018
32019
  }
32019
32020
  }
32021
+ else if (this.props.delimitation) {
32022
+ assistantStyle["max-height"] = `${this.props.delimitation.height}px`;
32023
+ }
32020
32024
  return cssPropertiesToCss(assistantStyle);
32021
32025
  }
32022
32026
  // we can't allow input events to be triggered while we remove and add back the content of the composer in processContent
@@ -32303,6 +32307,11 @@ class Composer extends Component {
32303
32307
  }
32304
32308
  }
32305
32309
  }
32310
+ onContextMenu(ev) {
32311
+ if (this.composerStore.editionMode === "inactive") {
32312
+ this.props.onInputContextMenu?.(ev);
32313
+ }
32314
+ }
32306
32315
  // ---------------------------------------------------------------------------
32307
32316
  // Private
32308
32317
  // ---------------------------------------------------------------------------
@@ -32524,6 +32533,7 @@ class GridComposer extends Component {
32524
32533
  static template = "o-spreadsheet-GridComposer";
32525
32534
  static props = {
32526
32535
  gridDims: Object,
32536
+ onInputContextMenu: Function,
32527
32537
  };
32528
32538
  static components = { Composer };
32529
32539
  rect = this.defaultRect;
@@ -32571,6 +32581,7 @@ class GridComposer extends Component {
32571
32581
  isDefaultFocus: true,
32572
32582
  onComposerContentFocused: () => this.composerFocusStore.focusGridComposerContent(),
32573
32583
  onComposerCellFocused: (content) => this.composerFocusStore.focusGridComposerCell(content),
32584
+ onInputContextMenu: this.props.onInputContextMenu,
32574
32585
  };
32575
32586
  }
32576
32587
  get containerStyle() {
@@ -37293,29 +37304,12 @@ function convertWidthFromExcel(width) {
37293
37304
  return width;
37294
37305
  return Math.round((width / WIDTH_FACTOR) * 100) / 100;
37295
37306
  }
37296
- function convertBorderDescr(descr) {
37297
- if (!descr) {
37298
- return undefined;
37299
- }
37300
- return {
37301
- style: descr.style,
37302
- color: { rgb: descr.color },
37303
- };
37304
- }
37305
37307
  function extractStyle(cell, data) {
37306
37308
  let style = {};
37307
37309
  if (cell.style) {
37308
37310
  style = data.styles[cell.style];
37309
37311
  }
37310
37312
  const format = extractFormat(cell, data);
37311
- const exportedBorder = {};
37312
- if (cell.border) {
37313
- const border = data.borders[cell.border];
37314
- exportedBorder.left = convertBorderDescr(border.left);
37315
- exportedBorder.right = convertBorderDescr(border.right);
37316
- exportedBorder.bottom = convertBorderDescr(border.bottom);
37317
- exportedBorder.top = convertBorderDescr(border.top);
37318
- }
37319
37313
  const styles = {
37320
37314
  font: {
37321
37315
  size: style?.fontSize || DEFAULT_FONT_SIZE,
@@ -37329,7 +37323,7 @@ function extractStyle(cell, data) {
37329
37323
  }
37330
37324
  : { reservedAttribute: "none" },
37331
37325
  numFmt: format ? { format: format, id: 0 /* id not used for export */ } : undefined,
37332
- border: exportedBorder || {},
37326
+ border: cell.border || 0,
37333
37327
  alignment: {
37334
37328
  horizontal: style.align,
37335
37329
  vertical: style.verticalAlign
@@ -37351,15 +37345,12 @@ function extractFormat(cell, data) {
37351
37345
  return undefined;
37352
37346
  }
37353
37347
  function normalizeStyle(construct, styles) {
37354
- const { id: fontId } = pushElement(styles["font"], construct.fonts);
37355
- const { id: fillId } = pushElement(styles["fill"], construct.fills);
37356
- const { id: borderId } = pushElement(styles["border"], construct.borders);
37357
37348
  // Normalize this
37358
37349
  const numFmtId = convertFormat(styles["numFmt"], construct.numFmts);
37359
37350
  const style = {
37360
- fontId,
37361
- fillId,
37362
- borderId,
37351
+ fontId: pushElement(styles.font, construct.fonts),
37352
+ fillId: pushElement(styles.fill, construct.fills),
37353
+ borderId: styles.border,
37363
37354
  numFmtId,
37364
37355
  alignment: {
37365
37356
  vertical: styles.alignment.vertical,
@@ -37367,8 +37358,7 @@ function normalizeStyle(construct, styles) {
37367
37358
  wrapText: styles.alignment.wrapText,
37368
37359
  },
37369
37360
  };
37370
- const { id } = pushElement(style, construct.styles);
37371
- return id;
37361
+ return pushElement(style, construct.styles);
37372
37362
  }
37373
37363
  function convertFormat(format, numFmtStructure) {
37374
37364
  if (!format) {
@@ -37376,8 +37366,7 @@ function convertFormat(format, numFmtStructure) {
37376
37366
  }
37377
37367
  let formatId = XLSX_FORMAT_MAP[format.format];
37378
37368
  if (!formatId) {
37379
- const { id } = pushElement(format, numFmtStructure);
37380
- formatId = id + FIRST_NUMFMT_ID;
37369
+ formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
37381
37370
  }
37382
37371
  return formatId;
37383
37372
  }
@@ -37402,20 +37391,15 @@ function addRelsToFile(relsFiles, path, rel) {
37402
37391
  return id;
37403
37392
  }
37404
37393
  function pushElement(property, propertyList) {
37405
- for (let [key, value] of Object.entries(propertyList)) {
37406
- if (JSON.stringify(value) === JSON.stringify(property)) {
37407
- return { id: parseInt(key, 10), list: propertyList };
37394
+ let len = propertyList.length;
37395
+ const operator = typeof property === "object" ? deepEquals : (a, b) => a === b;
37396
+ for (let i = 0; i < len; i++) {
37397
+ if (operator(property, propertyList[i])) {
37398
+ return i;
37408
37399
  }
37409
37400
  }
37410
- let elemId = propertyList.findIndex((elem) => JSON.stringify(elem) === JSON.stringify(property));
37411
- if (elemId === -1) {
37412
- propertyList.push(property);
37413
- elemId = propertyList.length - 1;
37414
- }
37415
- return {
37416
- id: elemId,
37417
- list: propertyList,
37418
- };
37401
+ propertyList[propertyList.length] = property;
37402
+ return propertyList.length - 1;
37419
37403
  }
37420
37404
  const chartIds = [];
37421
37405
  /**
@@ -38210,7 +38194,25 @@ function parseXML(xmlString, mimeType = "text/xml") {
38210
38194
  }
38211
38195
  return document;
38212
38196
  }
38213
- function getDefaultXLSXStructure() {
38197
+ function convertBorderDescr(descr) {
38198
+ if (!descr) {
38199
+ return undefined;
38200
+ }
38201
+ return {
38202
+ style: descr.style,
38203
+ color: { rgb: descr.color },
38204
+ };
38205
+ }
38206
+ function getDefaultXLSXStructure(data) {
38207
+ const xlsxBorders = Object.values(data.borders).map((border) => {
38208
+ return {
38209
+ left: convertBorderDescr(border.left),
38210
+ right: convertBorderDescr(border.right),
38211
+ bottom: convertBorderDescr(border.bottom),
38212
+ top: convertBorderDescr(border.top),
38213
+ };
38214
+ });
38215
+ const borders = [{}, ...xlsxBorders];
38214
38216
  return {
38215
38217
  relsFiles: [],
38216
38218
  sharedStrings: [],
@@ -38233,7 +38235,7 @@ function getDefaultXLSXStructure() {
38233
38235
  },
38234
38236
  ],
38235
38237
  fills: [{ reservedAttribute: "none" }, { reservedAttribute: "gray125" }],
38236
- borders: [{}],
38238
+ borders,
38237
38239
  numFmts: [],
38238
38240
  dxfs: [],
38239
38241
  };
@@ -45270,7 +45272,15 @@ class TablePlugin extends CorePlugin {
45270
45272
  }
45271
45273
  }
45272
45274
  exportForExcel(data) {
45273
- this.export(data);
45275
+ for (const sheet of data.sheets) {
45276
+ for (const table of this.getTables(sheet.id)) {
45277
+ if (zoneToDimension(table.range.zone).numberOfRows === 1) {
45278
+ continue;
45279
+ }
45280
+ const tableData = { range: zoneToXc(table.range.zone), filters: [] };
45281
+ sheet.tables.push(tableData);
45282
+ }
45283
+ }
45274
45284
  }
45275
45285
  }
45276
45286
 
@@ -47042,7 +47052,9 @@ class Evaluator {
47042
47052
  this.blockedArrayFormulas = this.createEmptyPositionSet();
47043
47053
  this.spreadingRelations = new SpreadingRelation(this.createEmptyPositionSet.bind(this));
47044
47054
  this.formulaDependencies = lazy(() => {
47045
- const dependencies = [...this.getAllCells()].flatMap((position) => this.getDirectDependencies(position).map((range) => ({
47055
+ const dependencies = [...this.getAllCells()].flatMap((position) => this.getDirectDependencies(position)
47056
+ .filter((range) => !range.invalidSheetName && !range.invalidXc)
47057
+ .map((range) => ({
47046
47058
  data: position,
47047
47059
  boundingBox: {
47048
47060
  zone: range.zone,
@@ -55687,6 +55699,13 @@ class TopBarComposer extends Component {
55687
55699
  "border-color": SELECTION_BORDER_COLOR,
55688
55700
  });
55689
55701
  }
55702
+ get delimitation() {
55703
+ const { width, height } = this.env.model.getters.getSheetViewDimensionWithHeaders();
55704
+ return {
55705
+ width,
55706
+ height,
55707
+ };
55708
+ }
55690
55709
  onFocus(selection) {
55691
55710
  this.composerFocusStore.focusTopBarComposer(selection);
55692
55711
  }
@@ -58318,8 +58337,7 @@ function addContent(content, sharedStrings, forceString = false) {
58318
58337
  attrs.push(["t", "b"]);
58319
58338
  }
58320
58339
  else if (forceString || !isNumber(value, DEFAULT_LOCALE)) {
58321
- const { id } = pushElement(content, sharedStrings);
58322
- value = id.toString();
58340
+ value = pushElement(content, sharedStrings);
58323
58341
  attrs.push(["t", "s"]);
58324
58342
  }
58325
58343
  return { attrs, node: escapeXml /*xml*/ `<v>${value}</v>` };
@@ -58444,8 +58462,7 @@ function addCellIsRule(cf, rule, dxfs) {
58444
58462
  if (rule.style.fillColor) {
58445
58463
  dxf.fill = { fgColor: { rgb: rule.style.fillColor } };
58446
58464
  }
58447
- const { id } = pushElement(dxf, dxfs);
58448
- ruleAttributes.push(["dxfId", id]);
58465
+ ruleAttributes.push(["dxfId", pushElement(dxf, dxfs)]);
58449
58466
  return escapeXml /*xml*/ `
58450
58467
  <conditionalFormatting sqref="${cf.ranges.join(" ")}">
58451
58468
  <cfRule ${formatAttributes(ruleAttributes)}>
@@ -59275,7 +59292,7 @@ function addSheetViews(sheet) {
59275
59292
  */
59276
59293
  function getXLSX(data) {
59277
59294
  const files = [];
59278
- const construct = getDefaultXLSXStructure();
59295
+ const construct = getDefaultXLSXStructure(data);
59279
59296
  files.push(createWorkbook(data, construct));
59280
59297
  files.push(...createWorksheets(data, construct));
59281
59298
  files.push(createStylesSheet(construct));
@@ -60169,6 +60186,6 @@ const constants = {
60169
60186
  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 };
60170
60187
 
60171
60188
 
60172
- __info__.version = "17.2.2";
60173
- __info__.date = "2024-04-05T14:01:19.824Z";
60174
- __info__.hash = "c15836d";
60189
+ __info__.version = "17.2.3";
60190
+ __info__.date = "2024-04-10T12:28:36.552Z";
60191
+ __info__.hash = "ab5e22d";