@odoo/o-spreadsheet 18.0.82 → 18.0.84

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.0.82
6
- * @date 2026-09-10T05:35:40.438Z
7
- * @hash d0329aa
5
+ * @version 18.0.84
6
+ * @date 2026-10-14T06:49:38.664Z
7
+ * @hash 56a1fca
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -209,6 +209,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
209
209
  const ALERT_INFO_BORDER = "#98DBE2";
210
210
  const ALERT_INFO_TEXT_COLOR = "#09414A";
211
211
  const BADGE_SELECTED_COLOR = "#E6F2F3";
212
+ const DEFAULT_CHART_PADDING = 20;
213
+ const DEFAULT_CHART_FONT_SIZE = 22;
214
+ const SCORECARD_GAUGE_CHART_PADDING = 10;
215
+ const SCORECARD_GAUGE_CHART_FONT_SIZE = 14;
212
216
  const COLOR_PICKER_DEFAULTS = [
213
217
  "#000000",
214
218
  "#434343",
@@ -291,8 +295,34 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
291
295
  "#20124D",
292
296
  "#4C1130"
293
297
  ];
298
+ const MIN_ROW_HEIGHT = 10;
299
+ const MIN_COL_WIDTH = 5;
300
+ const HEADER_HEIGHT = 26;
301
+ const HEADER_WIDTH = 48;
302
+ const TOPBAR_HEIGHT = 63;
303
+ const TOPBAR_TOOLBAR_HEIGHT = 34;
304
+ const BOTTOMBAR_HEIGHT = 36;
305
+ const DEFAULT_CELL_WIDTH = 96;
294
306
  const DEFAULT_CELL_HEIGHT = 23;
295
- const FOOTER_HEIGHT = 2 * 23;
307
+ const SCROLLBAR_WIDTH = 15;
308
+ const AUTOFILL_EDGE_LENGTH = 8;
309
+ const ICON_EDGE_LENGTH = 18;
310
+ const MIN_CF_ICON_MARGIN = 4;
311
+ const MIN_CELL_TEXT_MARGIN = 4;
312
+ const CF_ICON_EDGE_LENGTH = 15;
313
+ const PADDING_AUTORESIZE_VERTICAL = 3;
314
+ const PADDING_AUTORESIZE_HORIZONTAL = MIN_CELL_TEXT_MARGIN;
315
+ const GROUP_LAYER_WIDTH = 21;
316
+ const GRID_ICON_MARGIN = 2;
317
+ const GRID_ICON_EDGE_LENGTH = 17;
318
+ const FOOTER_HEIGHT = 2 * DEFAULT_CELL_HEIGHT;
319
+ const MENU_WIDTH = 250;
320
+ const MENU_VERTICAL_PADDING = 6;
321
+ const MENU_ITEM_HEIGHT = 26;
322
+ const MENU_ITEM_PADDING_HORIZONTAL = 11;
323
+ const MENU_ITEM_PADDING_VERTICAL = 4;
324
+ const MENU_SEPARATOR_BORDER_WIDTH = 1;
325
+ const MENU_SEPARATOR_PADDING = 5;
296
326
  const DEFAULT_STYLE = {
297
327
  align: "left",
298
328
  verticalAlign: "bottom",
@@ -311,13 +341,22 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
311
341
  };
312
342
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
313
343
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
344
+ const DEFAULT_FONT_WEIGHT = "400";
314
345
  const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
346
+ const HEADER_FONT_SIZE = 11;
315
347
  const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
316
348
  const DEFAULT_BORDER_DESC = {
317
349
  style: "thin",
318
350
  color: "#000000"
319
351
  };
352
+ const MAX_HISTORY_STEPS = 99;
320
353
  const DEFAULT_REVISION_ID = "START_REVISION";
354
+ const DEFAULT_FIGURE_HEIGHT = 335;
355
+ const DEFAULT_FIGURE_WIDTH = 536;
356
+ const FIGURE_BORDER_WIDTH = 1;
357
+ const MIN_FIG_SIZE = 80;
358
+ const MAX_CHAR_LABEL = 20;
359
+ const FIGURE_ID_SPLITTER = "??";
321
360
  const DEFAULT_GAUGE_LOWER_COLOR = "#EA6175";
322
361
  const DEFAULT_GAUGE_MIDDLE_COLOR = "#FFD86D";
323
362
  const DEFAULT_GAUGE_UPPER_COLOR = "#43C5B1";
@@ -325,6 +364,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
325
364
  const DEFAULT_SCORECARD_BASELINE_COLOR_UP = "#43C5B1";
326
365
  const DEFAULT_SCORECARD_BASELINE_COLOR_DOWN = "#EA6175";
327
366
  const LINE_FILL_TRANSPARENCY = .4;
367
+ const DEBOUNCE_TIME = 200;
368
+ const MESSAGE_VERSION = 1;
328
369
  const FORBIDDEN_SHEETNAME_CHARS = [
329
370
  "'",
330
371
  "*",
@@ -335,6 +376,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
335
376
  "]"
336
377
  ];
337
378
  const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
379
+ const FORMULA_REF_IDENTIFIER = "|";
338
380
  let DEFAULT_SHEETVIEW_SIZE = 0;
339
381
  function getDefaultSheetViewSize() {
340
382
  return DEFAULT_SHEETVIEW_SIZE;
@@ -343,6 +385,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
343
385
  DEFAULT_SHEETVIEW_SIZE = size;
344
386
  }
345
387
  const MAXIMAL_FREEZABLE_RATIO = .85;
388
+ const NEWLINE = "\n";
346
389
  const FONT_SIZES = [
347
390
  6,
348
391
  7,
@@ -727,7 +770,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
727
770
  */
728
771
  function replaceNewLines(text) {
729
772
  if (!text) return "";
730
- return text.replace(newLineRegexp, "\n");
773
+ return text.replace(newLineRegexp, NEWLINE);
731
774
  }
732
775
  /**
733
776
  * Determine if the numbers are consecutive.
@@ -1335,7 +1378,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1335
1378
  consumeSpaces(chars);
1336
1379
  const col = letterPart - 1;
1337
1380
  const row = num - 1;
1338
- if (!chars.isOver() || col > MAX_COL || row > 9999998) throw new Error(`Invalid cell description: ${xc}`);
1381
+ if (!chars.isOver() || col > MAX_COL || row > MAX_ROW) throw new Error(`Invalid cell description: ${xc}`);
1339
1382
  return {
1340
1383
  col,
1341
1384
  row
@@ -1773,7 +1816,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1773
1816
  const orderedZone = reorderZone(toZoneWithoutBoundaryChanges(xc));
1774
1817
  const bottom = orderedZone.bottom;
1775
1818
  const right = orderedZone.right;
1776
- if (bottom !== void 0 && bottom > 9999998 || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
1819
+ if (bottom !== void 0 && bottom > MAX_ROW || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
1777
1820
  if (bottom === void 0 && right === void 0) throw new Error("Wrong zone xc. The zone cannot be at the same time a full column and a full row");
1778
1821
  return orderedZone;
1779
1822
  }
@@ -2170,7 +2213,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2170
2213
  function getItemId(item, itemsDic) {
2171
2214
  if (!globalReverseLookup$1.has(itemsDic)) {
2172
2215
  globalReverseLookup$1.set(itemsDic, /* @__PURE__ */ new Map());
2173
- globalIdCounter.set(itemsDic, 0);
2216
+ const maxId = Math.max(...Object.keys(itemsDic).map(Number), 0);
2217
+ globalIdCounter.set(itemsDic, maxId);
2174
2218
  }
2175
2219
  const reverseLookup = globalReverseLookup$1.get(itemsDic);
2176
2220
  const canonical = getCanonicalRepresentation(item);
@@ -2212,6 +2256,26 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2212
2256
  repr += "}";
2213
2257
  return repr;
2214
2258
  }
2259
+ /**
2260
+ * This adds a border/style/format to the cell position in the workbook data, updating the zonified structure accordingly.
2261
+ */
2262
+ function addStyleToWorkbookData(workbookData, key, position, newItem) {
2263
+ const sheetData = workbookData.sheets.find((sheet) => sheet.id === position.sheetId);
2264
+ if (!sheetData) throw new Error(`Sheet with id ${position.sheetId} not found`);
2265
+ const id = getItemId(newItem, workbookData[key]);
2266
+ const zonifiedData = sheetData[key];
2267
+ const zone = positionToZone(position);
2268
+ const styleXc = Object.keys(zonifiedData).find((styleXc) => isZoneInside(zone, toZone(styleXc)));
2269
+ if (!styleXc) {
2270
+ zonifiedData[zoneToXc(zone)] = id;
2271
+ return;
2272
+ }
2273
+ const existingStyle = zonifiedData[styleXc];
2274
+ const remainingZones = recomputeZones([toZone(styleXc)], [zone]);
2275
+ delete zonifiedData[styleXc];
2276
+ for (const remainingZone of remainingZones) zonifiedData[zoneToXc(remainingZone)] = existingStyle;
2277
+ zonifiedData[zoneToXc(zone)] = id;
2278
+ }
2215
2279
 
2216
2280
  //#endregion
2217
2281
  //#region src/helpers/dates.ts
@@ -3670,7 +3734,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3670
3734
  for (let i = 0; i < countArg - 1; i += 2) {
3671
3735
  const criteriaRange = toMatrix(args[i]);
3672
3736
  if (criteriaRange.length !== dimRow || criteriaRange[0].length !== dimCol) throw new EvaluationError(_t("Function [[FUNCTION_NAME]] expects criteria_range to have the same dimension"));
3673
- const predicate = getPredicate(toString(args[i + 1]), locale);
3737
+ const predicate = getPredicate(toLocaleString(args[i + 1], locale), locale);
3674
3738
  if (isQuery && typeof predicate.operand === "string") predicate.operand += "*";
3675
3739
  predicates.push(predicate);
3676
3740
  }
@@ -4126,7 +4190,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4126
4190
  switch (token.type) {
4127
4191
  case "DIGIT":
4128
4192
  if (parsedPart === integerPart) parsedPart.push(token);
4129
- else if (numberOfDecimalsDigits < 20) {
4193
+ else if (numberOfDecimalsDigits < MAX_DECIMAL_PLACES) {
4130
4194
  parsedPart.push(token);
4131
4195
  numberOfDecimalsDigits++;
4132
4196
  }
@@ -4443,7 +4507,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4443
4507
  * exceed in the decimal part, in which case digits are rounded.
4444
4508
  *
4445
4509
  **/
4446
- function splitNumber(value, maxDecimals = 20) {
4510
+ function splitNumber(value, maxDecimals = MAX_DECIMAL_PLACES) {
4447
4511
  const asString = value.toString();
4448
4512
  if (asString.includes("e")) return splitNumberIntl(value, maxDecimals);
4449
4513
  if (Number.isInteger(value)) return {
@@ -4512,7 +4576,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4512
4576
  * Supports numbers with a lot of digits that are transformed to scientific notation by
4513
4577
  * number.toString(), but is slow.
4514
4578
  */
4515
- function splitNumberIntl(value, maxDecimals = 20) {
4579
+ function splitNumberIntl(value, maxDecimals = MAX_DECIMAL_PLACES) {
4516
4580
  let formatter = numberRepresentation[maxDecimals];
4517
4581
  if (!formatter) {
4518
4582
  formatter = new Intl.NumberFormat("en-US", {
@@ -4999,7 +5063,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4999
5063
  * Returns a timeout delay in milliseconds.
5000
5064
  */
5001
5065
  function scrollDelay(value) {
5002
- return 20 + (140 - 20) * Math.exp(-.035 * (value - 1));
5066
+ return MIN_DELAY + (MAX_DELAY - MIN_DELAY) * Math.exp(-.035 * (value - 1));
5003
5067
  }
5004
5068
 
5005
5069
  //#endregion
@@ -5367,13 +5431,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5367
5431
  //#endregion
5368
5432
  //#region src/helpers/text_helper.ts
5369
5433
  function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
5370
- return numberOfLines * (textLineHeight + 4) - 4;
5434
+ return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
5371
5435
  }
5372
5436
  /**
5373
5437
  * Get the default height of the cell given its style.
5374
5438
  */
5375
5439
  function getDefaultCellHeight(ctx, cell, locale, colSize) {
5376
- if (!cell || !cell.isFormula && !cell.content) return 23;
5440
+ if (!cell || !cell.isFormula && !cell.content) return DEFAULT_CELL_HEIGHT;
5377
5441
  let content = "";
5378
5442
  try {
5379
5443
  if (!cell.isFormula) {
@@ -5389,8 +5453,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5389
5453
  return getCellContentHeight(ctx, content, cell.style, colSize);
5390
5454
  }
5391
5455
  function getCellContentHeight(ctx, content, style, colSize) {
5392
- const numberOfLines = splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * 4 : void 0).length;
5393
- return computeTextLinesHeight(computeTextFontSizeInPixels(style), numberOfLines) + 2 * 3;
5456
+ const numberOfLines = splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : void 0).length;
5457
+ return computeTextLinesHeight(computeTextFontSizeInPixels(style), numberOfLines) + 2 * PADDING_AUTORESIZE_VERTICAL;
5394
5458
  }
5395
5459
  function getDefaultContextFont(fontSize, bold = false, italic = false) {
5396
5460
  return `${italic ? "italic" : ""} ${bold ? "bold" : ""} ${fontSize}px ${DEFAULT_FONT}`;
@@ -5440,7 +5504,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5440
5504
  return Math.round(fontSize * 96 / 72);
5441
5505
  }
5442
5506
  function computeTextFont(style, fontUnit = "pt") {
5443
- return `${style.italic ? "italic " : ""}${style.bold ? "bold" : "400"} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
5507
+ return `${style.italic ? "italic " : ""}${style.bold ? "bold" : DEFAULT_FONT_WEIGHT} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
5444
5508
  }
5445
5509
  function computeTextFontSizeInPixels(style) {
5446
5510
  return fontSizeInPixels(style?.fontSize || DEFAULT_FONT_SIZE);
@@ -5464,7 +5528,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5464
5528
  if (!style) style = {};
5465
5529
  if (isMarkdownLink(text)) text = parseMarkdownLink(text).label;
5466
5530
  const brokenText = [];
5467
- const lines = text.includes("\n") ? text.split("\n") : [text];
5531
+ const lines = text.includes(NEWLINE) ? text.split(NEWLINE) : [text];
5468
5532
  for (const line of lines) {
5469
5533
  const words = line.includes(" ") ? line.split(" ") : [line];
5470
5534
  if (!width) {
@@ -5528,7 +5592,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5528
5592
  return fontSize;
5529
5593
  }
5530
5594
  function computeIconWidth(style) {
5531
- return computeTextFontSizeInPixels(style) + 2 * 4;
5595
+ return computeTextFontSizeInPixels(style) + 2 * MIN_CF_ICON_MARGIN;
5532
5596
  }
5533
5597
  /** Transform a string to lower case. If the string is undefined, return an empty string */
5534
5598
  function toLowerCase(str) {
@@ -6047,13 +6111,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6047
6111
  }
6048
6112
  function tokenizeNewLine(chars) {
6049
6113
  let length = 0;
6050
- while (chars.current === "\n") {
6114
+ while (chars.current === NEWLINE) {
6051
6115
  length++;
6052
6116
  chars.shift();
6053
6117
  }
6054
6118
  if (length) return {
6055
6119
  type: "SPACE",
6056
- value: "\n".repeat(length)
6120
+ value: NEWLINE.repeat(length)
6057
6121
  };
6058
6122
  return null;
6059
6123
  }
@@ -6707,7 +6771,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6707
6771
  if (value === void 0) return;
6708
6772
  const valueIndex = values.indexOf(value);
6709
6773
  if (value === void 0 || valueIndex === -1) return;
6710
- return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === "(previous)" ? -1 : 1), 0, values.length - 1)]);
6774
+ return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === PREVIOUS_VALUE ? -1 : 1), 0, values.length - 1)]);
6711
6775
  }
6712
6776
  function domainToString(domain) {
6713
6777
  return domain ? domain.map(domainNodeToString).join(", ") : "";
@@ -8660,7 +8724,7 @@ stores.inject(MyMetaStore, storeInstance);
8660
8724
  const borderColor = config.color || lightenColor(rgbaToHex(defaultBorderColor), .5);
8661
8725
  return {
8662
8726
  type: "line",
8663
- xAxisID: "x1",
8727
+ xAxisID: TREND_LINE_XAXIS_ID,
8664
8728
  yAxisID: dataset.yAxisID,
8665
8729
  label: dataset.label ? _t("Trend line for %s", dataset.label) : "",
8666
8730
  data: data.map((v, i) => ({
@@ -8783,7 +8847,7 @@ stores.inject(MyMetaStore, storeInstance);
8783
8847
  function drawLineOrBarChartValues(chart, options, ctx) {
8784
8848
  const textsPositions = {};
8785
8849
  for (const dataset of chart._metasets) {
8786
- if (dataset.xAxisID === "x1") return;
8850
+ if (dataset.xAxisID === TREND_LINE_XAXIS_ID) return;
8787
8851
  for (let i = 0; i < dataset._parsed.length; i++) {
8788
8852
  const value = dataset._parsed[i].y;
8789
8853
  const point = dataset.data[i];
@@ -8803,7 +8867,7 @@ stores.inject(MyMetaStore, storeInstance);
8803
8867
  function drawHorizontalBarChartValues(chart, options, ctx) {
8804
8868
  const textsPositions = {};
8805
8869
  for (const dataset of chart._metasets) {
8806
- if (dataset.xAxisID === "x1") return;
8870
+ if (dataset.xAxisID === TREND_LINE_XAXIS_ID) return;
8807
8871
  for (let i = 0; i < dataset._parsed.length; i++) {
8808
8872
  const value = dataset._parsed[i].x;
8809
8873
  const displayValue = options.callback(value, dataset, i);
@@ -8990,6 +9054,9 @@ stores.inject(MyMetaStore, storeInstance);
8990
9054
  const EXCEL_DEFAULT_COL_WIDTH = 8.43;
8991
9055
  /** unit : points */
8992
9056
  const EXCEL_DEFAULT_ROW_HEIGHT = 12.75;
9057
+ const EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS = 30;
9058
+ const EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS = 100;
9059
+ const FIRST_NUMFMT_ID = 164;
8993
9060
  const FORCE_DEFAULT_ARGS_FUNCTIONS = {
8994
9061
  FLOOR: [{
8995
9062
  type: "NUMBER",
@@ -9307,9 +9374,9 @@ stores.inject(MyMetaStore, storeInstance);
9307
9374
  display: flex;
9308
9375
  align-items: center;
9309
9376
  justify-content: center;
9310
- width: ${18}px;
9311
- height: ${18}px;
9312
- font-size: ${18}px;
9377
+ width: ${ICON_EDGE_LENGTH}px;
9378
+ height: ${ICON_EDGE_LENGTH}px;
9379
+ font-size: ${ICON_EDGE_LENGTH}px;
9313
9380
  vertical-align: middle;
9314
9381
 
9315
9382
  .small-text {
@@ -10281,7 +10348,7 @@ stores.inject(MyMetaStore, storeInstance);
10281
10348
  alignment: {
10282
10349
  horizontal: style.align,
10283
10350
  vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
10284
- wrapText: style.wrapping === "wrap" || cell.content?.includes("\n") ? true : void 0,
10351
+ wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : void 0,
10285
10352
  shrinkToFit: style.wrapping === "clip" ? true : void 0
10286
10353
  }
10287
10354
  };
@@ -10312,7 +10379,7 @@ stores.inject(MyMetaStore, storeInstance);
10312
10379
  function convertFormat(format, numFmtStructure) {
10313
10380
  if (!format) return 0;
10314
10381
  let formatId = XLSX_FORMAT_MAP[format.format];
10315
- if (!formatId) formatId = pushElement(format, numFmtStructure) + 164;
10382
+ if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
10316
10383
  return formatId;
10317
10384
  }
10318
10385
  /**
@@ -10894,8 +10961,8 @@ stores.inject(MyMetaStore, storeInstance);
10894
10961
  dims[0] = Math.max(dims[0], largeMax(row.cells.map((cell) => toCartesian(cell.xc).col)));
10895
10962
  dims[1] = Math.max(dims[1], row.index);
10896
10963
  }
10897
- dims[0] = Math.max(dims[0], 30);
10898
- dims[1] = Math.max(dims[1], 100);
10964
+ dims[0] = Math.max(dims[0], EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
10965
+ dims[1] = Math.max(dims[1], EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
10899
10966
  return dims;
10900
10967
  }
10901
10968
  /**
@@ -12000,7 +12067,7 @@ stores.inject(MyMetaStore, storeInstance);
12000
12067
  rgb = this.getThemeColor(themeIndex, theme.clrScheme);
12001
12068
  } else {
12002
12069
  rgb = this.extractAttr(colorElement, "rgb")?.asString();
12003
- rgb = rgb === "FF000000" ? void 0 : rgb;
12070
+ rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
12004
12071
  }
12005
12072
  return {
12006
12073
  rgb: rgb || defaultColor,
@@ -13078,7 +13145,7 @@ stores.inject(MyMetaStore, storeInstance);
13078
13145
  * Get the corresponding relationship file for a given xml file in a XLSX directory.
13079
13146
  */
13080
13147
  function getRelationFile(file, xmls) {
13081
- if (file === "[Content_Types].xml") return "_rels/.rels";
13148
+ if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
13082
13149
  let relsFile = "";
13083
13150
  const pathParts = file.split("/");
13084
13151
  for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
@@ -13278,7 +13345,7 @@ stores.inject(MyMetaStore, storeInstance);
13278
13345
  if (token.type === "REFERENCE" && cellReference.test(token.value)) {
13279
13346
  const value = token.value.trim();
13280
13347
  if (!dependencies.includes(value)) dependencies.push(value);
13281
- return `${"|"}${dependencies.indexOf(value)}${"|"}`;
13348
+ return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
13282
13349
  } else return token.value;
13283
13350
  })),
13284
13351
  dependencies
@@ -13506,7 +13573,7 @@ stores.inject(MyMetaStore, storeInstance);
13506
13573
  if (cell.formula) {
13507
13574
  let { text, dependencies } = cell.formula;
13508
13575
  for (const [index, d] of Object.entries(dependencies)) {
13509
- const stringPosition = `\\${"|"}${index}\\${"|"}`;
13576
+ const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
13510
13577
  text = text.replace(new RegExp(stringPosition, "g"), d);
13511
13578
  }
13512
13579
  cell.content = text;
@@ -13702,7 +13769,7 @@ stores.inject(MyMetaStore, storeInstance);
13702
13769
  if (verboseImport) for (const parsingError of reader.warningManager.warnings.sort()) console.warn(parsingError);
13703
13770
  }
13704
13771
  if ("version" in data) {
13705
- if (data.version < 22) {
13772
+ if (data.version < CURRENT_VERSION) {
13706
13773
  console.debug("Migrating data from version", data.version);
13707
13774
  data = migrate(data);
13708
13775
  }
@@ -13758,7 +13825,7 @@ stores.inject(MyMetaStore, storeInstance);
13758
13825
  * sensible default values
13759
13826
  */
13760
13827
  function setDefaults(partialData) {
13761
- const data = Object.assign(createEmptyWorkbookData(), partialData, { version: 22 });
13828
+ const data = Object.assign(createEmptyWorkbookData(), partialData, { version: CURRENT_VERSION });
13762
13829
  data.sheets = data.sheets ? data.sheets.map((s, i) => Object.assign(createEmptySheet(`Sheet${i + 1}`, `Sheet${i + 1}`), s)) : [];
13763
13830
  if (data.sheets.length === 0) data.sheets.push(createEmptySheet(INITIAL_SHEET_ID, "Sheet1"));
13764
13831
  if (!isValidLocale(data.settings.locale)) data.settings.locale = DEFAULT_LOCALE;
@@ -13900,7 +13967,7 @@ stores.inject(MyMetaStore, storeInstance);
13900
13967
  }
13901
13968
  function createEmptyWorkbookData(sheetName = "Sheet1") {
13902
13969
  return {
13903
- version: 22,
13970
+ version: CURRENT_VERSION,
13904
13971
  sheets: [createEmptySheet(INITIAL_SHEET_ID, sheetName)],
13905
13972
  styles: {},
13906
13973
  formats: {},
@@ -13950,7 +14017,7 @@ stores.inject(MyMetaStore, storeInstance);
13950
14017
  }));
13951
14018
  }
13952
14019
  function interactivePasteFromOS(env, target, clipboardContent, pasteOption) {
13953
- if (clipboardContent.data && clipboardContent.data.version !== 22) env.notifyUser({
14020
+ if (clipboardContent.data && clipboardContent.data.version !== CURRENT_VERSION) env.notifyUser({
13954
14021
  type: "warning",
13955
14022
  text: _t("You copied content from a different version of the application. Only text content will be pasted."),
13956
14023
  sticky: false
@@ -14163,9 +14230,9 @@ stores.inject(MyMetaStore, storeInstance);
14163
14230
  const GAUGE_INFLECTION_MARKER_COLOR = "#666666aa";
14164
14231
  const GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN = 6;
14165
14232
  const GAUGE_TITLE_SECTION_HEIGHT = 25;
14166
- const GAUGE_TITLE_FONT_SIZE = 14;
14167
- const GAUGE_TITLE_PADDING_LEFT = 10;
14168
- const GAUGE_TITLE_PADDING_TOP = 10;
14233
+ const GAUGE_TITLE_FONT_SIZE = SCORECARD_GAUGE_CHART_FONT_SIZE;
14234
+ const GAUGE_TITLE_PADDING_LEFT = SCORECARD_GAUGE_CHART_PADDING;
14235
+ const GAUGE_TITLE_PADDING_TOP = SCORECARD_GAUGE_CHART_PADDING;
14169
14236
  function drawGaugeChart(canvas, runtime) {
14170
14237
  const canvasBoundingRect = canvas.getBoundingClientRect();
14171
14238
  const dpr = window.devicePixelRatio || 1;
@@ -14259,18 +14326,18 @@ stores.inject(MyMetaStore, storeInstance);
14259
14326
  x: boundingRect.width / 2,
14260
14327
  y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
14261
14328
  };
14262
- let gaugeValueFontSize = 80;
14329
+ let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
14263
14330
  if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
14264
14331
  const maxTextWidth = gaugeRect.width / 2;
14265
14332
  const gaugeLabel = gaugeValue?.label || "-";
14266
14333
  if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
14267
14334
  const minLabelPosition = {
14268
14335
  x: gaugeRect.x + gaugeArcWidth / 2,
14269
- y: gaugeRect.y + gaugeRect.height + 12
14336
+ y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
14270
14337
  };
14271
14338
  const maxLabelPosition = {
14272
14339
  x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
14273
- y: gaugeRect.y + gaugeRect.height + 12
14340
+ y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
14274
14341
  };
14275
14342
  const textColor = getContrastedTextColor(runtime.background);
14276
14343
  const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
@@ -14321,13 +14388,13 @@ stores.inject(MyMetaStore, storeInstance);
14321
14388
  minLabel: {
14322
14389
  label: runtime.minValue.label,
14323
14390
  textPosition: minLabelPosition,
14324
- fontSize: 12,
14391
+ fontSize: GAUGE_LABELS_FONT_SIZE,
14325
14392
  color: textColor
14326
14393
  },
14327
14394
  maxLabel: {
14328
14395
  label: runtime.maxValue.label,
14329
14396
  textPosition: maxLabelPosition,
14330
- fontSize: 12,
14397
+ fontSize: GAUGE_LABELS_FONT_SIZE,
14331
14398
  color: textColor
14332
14399
  }
14333
14400
  };
@@ -14337,9 +14404,9 @@ stores.inject(MyMetaStore, storeInstance);
14337
14404
  * space for the title and labels.
14338
14405
  */
14339
14406
  function getGaugeRect(boundingRect, title) {
14340
- const titleHeight = title ? 25 : 0;
14341
- const drawHeight = boundingRect.height - 20 - titleHeight - 10;
14342
- const drawWidth = boundingRect.width - 30 * 2;
14407
+ const titleHeight = title ? GAUGE_TITLE_SECTION_HEIGHT : 0;
14408
+ const drawHeight = boundingRect.height - GAUGE_PADDING_BOTTOM - titleHeight - GAUGE_PADDING_TOP;
14409
+ const drawWidth = boundingRect.width - GAUGE_PADDING_SIDE * 2;
14343
14410
  let gaugeWidth;
14344
14411
  let gaugeHeight;
14345
14412
  if (drawWidth > 2 * drawHeight) {
@@ -14350,8 +14417,8 @@ stores.inject(MyMetaStore, storeInstance);
14350
14417
  gaugeHeight = drawWidth / 2;
14351
14418
  }
14352
14419
  return {
14353
- x: 30 + (drawWidth - gaugeWidth) / 2,
14354
- y: titleHeight + 10 + (drawHeight - gaugeHeight) / 2,
14420
+ x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
14421
+ y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
14355
14422
  width: gaugeWidth,
14356
14423
  height: gaugeHeight
14357
14424
  };
@@ -14368,20 +14435,20 @@ stores.inject(MyMetaStore, storeInstance);
14368
14435
  x: gaugeRect.x + gaugeRect.width / 2,
14369
14436
  y: gaugeRect.y + gaugeRect.height
14370
14437
  };
14371
- const textStyle = { fontSize: 12 };
14438
+ const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
14372
14439
  const inflectionValues = [];
14373
14440
  const inflectionValuesTextRects = [];
14374
14441
  for (const inflectionValue of runtime.inflectionValues) {
14375
14442
  const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
14376
14443
  const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
14377
14444
  const angle = Math.PI - Math.PI * percentage;
14378
- const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, 12);
14379
- const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? 12 : 0;
14445
+ const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, GAUGE_LABELS_FONT_SIZE);
14446
+ const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? GAUGE_LABELS_FONT_SIZE : 0;
14380
14447
  inflectionValuesTextRects.push(textRect);
14381
14448
  inflectionValues.push({
14382
14449
  rotation: angle,
14383
14450
  label: inflectionValue.label,
14384
- fontSize: 12,
14451
+ fontSize: GAUGE_LABELS_FONT_SIZE,
14385
14452
  color: textColor,
14386
14453
  offset
14387
14454
  });
@@ -14591,8 +14658,8 @@ stores.inject(MyMetaStore, storeInstance);
14591
14658
  this.baselineMode = definition.baselineMode;
14592
14659
  this.baselineDescr = definition.baselineDescr;
14593
14660
  this.background = definition.background;
14594
- this.baselineColorUp = definition.baselineColorUp ?? "#43C5B1";
14595
- this.baselineColorDown = definition.baselineColorDown ?? "#EA6175";
14661
+ this.baselineColorUp = definition.baselineColorUp ?? DEFAULT_SCORECARD_BASELINE_COLOR_UP;
14662
+ this.baselineColorDown = definition.baselineColorDown ?? DEFAULT_SCORECARD_BASELINE_COLOR_DOWN;
14596
14663
  this.humanize = definition.humanize ?? false;
14597
14664
  }
14598
14665
  static validateChartDefinition(validator, definition) {
@@ -14667,7 +14734,7 @@ stores.inject(MyMetaStore, storeInstance);
14667
14734
  canvas.width = dpr * structure.canvas.width;
14668
14735
  canvas.height = dpr * structure.canvas.height;
14669
14736
  ctx.scale(dpr, dpr);
14670
- const availableWidth = structure.canvas.width - 20;
14737
+ const availableWidth = structure.canvas.width - DEFAULT_CHART_PADDING;
14671
14738
  ctx.fillStyle = structure.canvas.backgroundColor;
14672
14739
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
14673
14740
  if (structure.title) {
@@ -14782,9 +14849,9 @@ stores.inject(MyMetaStore, storeInstance);
14782
14849
 
14783
14850
  //#endregion
14784
14851
  //#region src/helpers/figures/charts/scorecard_chart_config_builder.ts
14785
- const CHART_PADDING = 10;
14852
+ const CHART_PADDING = SCORECARD_GAUGE_CHART_PADDING;
14786
14853
  const BOTTOM_PADDING_RATIO = .05;
14787
- const CHART_TITLE_FONT_SIZE = 14;
14854
+ const CHART_TITLE_FONT_SIZE = SCORECARD_GAUGE_CHART_FONT_SIZE;
14788
14855
  const KEY_VALUE_FONT_SIZE = 32;
14789
14856
  const BASELINE_MAX_FONT_SIZE = 16;
14790
14857
  function formatBaselineDescr(baselineDescr, baseline) {
@@ -14850,7 +14917,7 @@ stores.inject(MyMetaStore, storeInstance);
14850
14917
  y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING
14851
14918
  }
14852
14919
  };
14853
- const minimalBaselinePosition = baselineArrowSize + 20;
14920
+ const minimalBaselinePosition = baselineArrowSize + DEFAULT_CHART_PADDING;
14854
14921
  if (structure.baseline.position.x < minimalBaselinePosition) structure.baseline.position.x = minimalBaselinePosition;
14855
14922
  if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
14856
14923
  direction: this.baselineArrow,
@@ -15028,7 +15095,7 @@ stores.inject(MyMetaStore, storeInstance);
15028
15095
  }
15029
15096
  function truncateLabel(label) {
15030
15097
  if (!label) return "";
15031
- if (label.length > 20) return label.substring(0, 20) + "…";
15098
+ if (label.length > MAX_CHAR_LABEL) return label.substring(0, MAX_CHAR_LABEL) + "…";
15032
15099
  return label;
15033
15100
  }
15034
15101
  /**
@@ -15043,10 +15110,10 @@ stores.inject(MyMetaStore, storeInstance);
15043
15110
  responsive: true,
15044
15111
  maintainAspectRatio: false,
15045
15112
  layout: { padding: {
15046
- left: 20,
15047
- right: 20,
15048
- top: chartTitle.text ? 20 / 2 : 20 + 5,
15049
- bottom: 20
15113
+ left: DEFAULT_CHART_PADDING,
15114
+ right: DEFAULT_CHART_PADDING,
15115
+ top: chartTitle.text ? DEFAULT_CHART_PADDING / 2 : DEFAULT_CHART_PADDING + 5,
15116
+ bottom: DEFAULT_CHART_PADDING
15050
15117
  } },
15051
15118
  elements: {
15052
15119
  line: { fill: false },
@@ -15060,7 +15127,7 @@ stores.inject(MyMetaStore, storeInstance);
15060
15127
  color: chartTitle?.color ?? fontColor,
15061
15128
  align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
15062
15129
  font: {
15063
- size: 22,
15130
+ size: DEFAULT_CHART_FONT_SIZE,
15064
15131
  weight: chartTitle.bold ? "bold" : "normal",
15065
15132
  style: chartTitle.italic ? "italic" : "normal"
15066
15133
  }
@@ -23494,7 +23561,7 @@ stores.inject(MyMetaStore, storeInstance);
23494
23561
  while (!current.done) {
23495
23562
  if (!current.value.hasChildNodes()) text += current.value.textContent;
23496
23563
  if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) if (isFirstParagraph) isFirstParagraph = false;
23497
- else text += "\n";
23564
+ else text += NEWLINE;
23498
23565
  current = it.next();
23499
23566
  }
23500
23567
  return text;
@@ -23721,7 +23788,7 @@ stores.inject(MyMetaStore, storeInstance);
23721
23788
  if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
23722
23789
  } else {
23723
23790
  assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
23724
- if (composerRect.left + ASSISTANT_WIDTH + 15 + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
23791
+ if (composerRect.left + ASSISTANT_WIDTH + SCROLLBAR_WIDTH + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
23725
23792
  }
23726
23793
  return assistantStyle;
23727
23794
  }
@@ -23835,7 +23902,7 @@ stores.inject(MyMetaStore, storeInstance);
23835
23902
  const start = Math.min(selection.start, selection.end);
23836
23903
  const end = Math.max(selection.start, selection.end);
23837
23904
  this.props.composerStore.stopComposerRangeSelection();
23838
- this.props.composerStore.setCurrentContent(content.slice(0, start) + "\n" + content.slice(end), {
23905
+ this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
23839
23906
  start: start + 1,
23840
23907
  end: start + 1
23841
23908
  });
@@ -24064,8 +24131,8 @@ stores.inject(MyMetaStore, storeInstance);
24064
24131
  splitHtmlContentIntoLines(contents) {
24065
24132
  const contentSplitInLines = [];
24066
24133
  let currentLine = [];
24067
- for (const content of contents) if (content.value.includes("\n")) {
24068
- const lines = content.value.split("\n");
24134
+ for (const content of contents) if (content.value.includes(NEWLINE)) {
24135
+ const lines = content.value.split(NEWLINE);
24069
24136
  const lastLine = lines.pop();
24070
24137
  for (const line of lines) {
24071
24138
  currentLine.push({
@@ -25286,7 +25353,7 @@ stores.inject(MyMetaStore, storeInstance);
25286
25353
  const definition = this.getDefinition();
25287
25354
  return {
25288
25355
  ...definition,
25289
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
25356
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
25290
25357
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
25291
25358
  dataSets,
25292
25359
  labelRange,
@@ -25376,7 +25443,7 @@ stores.inject(MyMetaStore, storeInstance);
25376
25443
  label,
25377
25444
  data,
25378
25445
  hidden,
25379
- borderColor: definition.background || "#FFFFFF",
25446
+ borderColor: definition.background || BACKGROUND_CHART_COLOR,
25380
25447
  borderWidth: definition.stacked ? 1 : 0,
25381
25448
  backgroundColor: color
25382
25449
  };
@@ -25390,7 +25457,7 @@ stores.inject(MyMetaStore, storeInstance);
25390
25457
  }
25391
25458
  if (trendDatasets.length) {
25392
25459
  const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset.data.length));
25393
- config.options.scales["x1"] = {
25460
+ config.options.scales[TREND_LINE_XAXIS_ID] = {
25394
25461
  ...xAxis,
25395
25462
  labels: Array(maxLength).fill(""),
25396
25463
  offset: false,
@@ -25398,12 +25465,12 @@ stores.inject(MyMetaStore, storeInstance);
25398
25465
  };
25399
25466
  trendDatasets.forEach((x) => config.data.datasets.push(x));
25400
25467
  config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
25401
- return tooltipItems.some((item) => item.dataset.xAxisID !== "x1") ? void 0 : "";
25468
+ return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
25402
25469
  };
25403
25470
  }
25404
25471
  return {
25405
25472
  chartJsConfig: config,
25406
- background: chart.background || "#FFFFFF"
25473
+ background: chart.background || BACKGROUND_CHART_COLOR
25407
25474
  };
25408
25475
  }
25409
25476
 
@@ -25690,7 +25757,7 @@ stores.inject(MyMetaStore, storeInstance);
25690
25757
  config.options.plugins.tooltip.callbacks.label = (tooltipItem) => {
25691
25758
  let dataSetPoint;
25692
25759
  let label;
25693
- if (tooltipItem.dataset.xAxisID === "x1") {
25760
+ if (tooltipItem.dataset.xAxisID === TREND_LINE_XAXIS_ID) {
25694
25761
  dataSetPoint = dataSetsValues[tooltipItem.datasetIndex].data[tooltipItem.dataIndex].y;
25695
25762
  label = "";
25696
25763
  } else {
@@ -25761,23 +25828,23 @@ stores.inject(MyMetaStore, storeInstance);
25761
25828
  }
25762
25829
  }
25763
25830
  if (trendDatasets.length) {
25764
- config.options.scales["x1"] = {
25831
+ config.options.scales[TREND_LINE_XAXIS_ID] = {
25765
25832
  ...xAxis,
25766
25833
  display: false
25767
25834
  };
25768
25835
  if (axisType === "category" || axisType === "time") {
25769
- config.options.scales["x1"]["type"] = "category";
25770
- config.options.scales["x1"]["labels"] = range(0, maxLength).map((x) => x.toString());
25771
- config.options.scales["x1"]["offset"] = false;
25836
+ config.options.scales[TREND_LINE_XAXIS_ID]["type"] = "category";
25837
+ config.options.scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
25838
+ config.options.scales[TREND_LINE_XAXIS_ID]["offset"] = false;
25772
25839
  }
25773
25840
  trendDatasets.forEach((x) => config.data.datasets.push(x));
25774
25841
  }
25775
25842
  config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
25776
- return axisType !== "linear" && tooltipItems.some((item) => item.dataset.xAxisID !== "x1") ? void 0 : "";
25843
+ return axisType !== "linear" && tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
25777
25844
  };
25778
25845
  return {
25779
25846
  chartJsConfig: config,
25780
- background: chart.background || "#FFFFFF"
25847
+ background: chart.background || BACKGROUND_CHART_COLOR
25781
25848
  };
25782
25849
  }
25783
25850
 
@@ -25853,7 +25920,7 @@ stores.inject(MyMetaStore, storeInstance);
25853
25920
  const definition = this.getDefinition();
25854
25921
  return {
25855
25922
  ...definition,
25856
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
25923
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
25857
25924
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
25858
25925
  dataSets,
25859
25926
  labelRange,
@@ -25993,19 +26060,19 @@ stores.inject(MyMetaStore, storeInstance);
25993
26060
  }
25994
26061
  if (trendDatasets.length) {
25995
26062
  const trendLinesMaxLength = Math.max(...trendDatasets.map((trend) => trend.data.length));
25996
- config.options.scales["x1"] = {
26063
+ config.options.scales[TREND_LINE_XAXIS_ID] = {
25997
26064
  labels: Array(Math.round(trendLinesMaxLength)).fill(""),
25998
26065
  offset: false,
25999
26066
  display: false
26000
26067
  };
26001
26068
  trendDatasets.forEach((x) => config.data.datasets.push(x));
26002
26069
  config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
26003
- return tooltipItems.some((item) => item.dataset.xAxisID !== "x1") ? void 0 : "";
26070
+ return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
26004
26071
  };
26005
26072
  }
26006
26073
  return {
26007
26074
  chartJsConfig: config,
26008
- background: chart.background || "#FFFFFF"
26075
+ background: chart.background || BACKGROUND_CHART_COLOR
26009
26076
  };
26010
26077
  }
26011
26078
 
@@ -26329,7 +26396,7 @@ stores.inject(MyMetaStore, storeInstance);
26329
26396
  const definition = this.getDefinition();
26330
26397
  return {
26331
26398
  ...definition,
26332
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
26399
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
26333
26400
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
26334
26401
  dataSets,
26335
26402
  labelRange,
@@ -26426,7 +26493,7 @@ stores.inject(MyMetaStore, storeInstance);
26426
26493
  const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
26427
26494
  return {
26428
26495
  ...this.getDefinition(),
26429
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
26496
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
26430
26497
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
26431
26498
  dataSets,
26432
26499
  labelRange
@@ -26530,7 +26597,7 @@ stores.inject(MyMetaStore, storeInstance);
26530
26597
  if (chart.isDoughnut) config.type = "doughnut";
26531
26598
  return {
26532
26599
  chartJsConfig: config,
26533
- background: chart.background || "#FFFFFF"
26600
+ background: chart.background || BACKGROUND_CHART_COLOR
26534
26601
  };
26535
26602
  }
26536
26603
 
@@ -26662,7 +26729,7 @@ stores.inject(MyMetaStore, storeInstance);
26662
26729
  config.options.plugins.chartShowValuesPlugin.callback = (value, dataset, index) => callback(Math.abs(value), dataset, index);
26663
26730
  return {
26664
26731
  chartJsConfig: config,
26665
- background: chart.background || "#FFFFFF"
26732
+ background: chart.background || BACKGROUND_CHART_COLOR
26666
26733
  };
26667
26734
  }
26668
26735
 
@@ -26760,7 +26827,7 @@ stores.inject(MyMetaStore, storeInstance);
26760
26827
  const definition = this.getDefinition();
26761
26828
  return {
26762
26829
  ...definition,
26763
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
26830
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
26764
26831
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
26765
26832
  dataSets,
26766
26833
  labelRange,
@@ -26909,9 +26976,9 @@ stores.inject(MyMetaStore, storeInstance);
26909
26976
  const { locale, format } = localeFormat;
26910
26977
  const fontColor = chartFontColor(chart.background);
26911
26978
  const config = getDefaultChartJsRuntime(chart, labels, fontColor, localeFormat);
26912
- const negativeColor = chart.negativeValuesColor || "#EA6175";
26913
- const positiveColor = chart.positiveValuesColor || "#4EA7F2";
26914
- const subTotalColor = chart.subTotalValuesColor || "#AAAAAA";
26979
+ const negativeColor = chart.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
26980
+ const positiveColor = chart.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
26981
+ const subTotalColor = chart.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
26915
26982
  const legend = { labels: { generateLabels: () => {
26916
26983
  const legendValues = [{
26917
26984
  text: _t("Positive values"),
@@ -27015,9 +27082,9 @@ stores.inject(MyMetaStore, storeInstance);
27015
27082
  locale
27016
27083
  }, dataSetsValues);
27017
27084
  config.type = "bar";
27018
- const negativeColor = chart.negativeValuesColor || "#EA6175";
27019
- const positiveColor = chart.positiveValuesColor || "#4EA7F2";
27020
- const subTotalColor = chart.subTotalValuesColor || "#AAAAAA";
27085
+ const negativeColor = chart.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
27086
+ const positiveColor = chart.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
27087
+ const subTotalColor = chart.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
27021
27088
  const backgroundColor = [];
27022
27089
  const datasetValues = [];
27023
27090
  const dataset = {
@@ -27052,7 +27119,7 @@ stores.inject(MyMetaStore, storeInstance);
27052
27119
  config.data.labels = labelsWithSubTotals.map(truncateLabel);
27053
27120
  return {
27054
27121
  chartJsConfig: config,
27055
- background: chart.background || "#FFFFFF"
27122
+ background: chart.background || BACKGROUND_CHART_COLOR
27056
27123
  };
27057
27124
  }
27058
27125
 
@@ -27781,7 +27848,7 @@ stores.inject(MyMetaStore, storeInstance);
27781
27848
  .o-filter-menu-item {
27782
27849
  display: flex;
27783
27850
  box-sizing: border-box;
27784
- height: ${26}px;
27851
+ height: ${MENU_ITEM_HEIGHT}px;
27785
27852
  padding: 4px 4px 4px 0px;
27786
27853
  cursor: pointer;
27787
27854
  user-select: none;
@@ -28216,7 +28283,7 @@ stores.inject(MyMetaStore, storeInstance);
28216
28283
  col,
28217
28284
  row
28218
28285
  });
28219
- const textColor = style?.textColor === "#017E84" ? void 0 : style?.textColor;
28286
+ const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
28220
28287
  this.env.model.dispatch("UPDATE_CELL", {
28221
28288
  col,
28222
28289
  row,
@@ -28623,15 +28690,15 @@ stores.inject(MyMetaStore, storeInstance);
28623
28690
  css`
28624
28691
  .o-menu {
28625
28692
  background-color: white;
28626
- padding: ${6}px 0px;
28627
- width: ${250}px;
28693
+ padding: ${MENU_VERTICAL_PADDING}px 0px;
28694
+ width: ${MENU_WIDTH}px;
28628
28695
  box-sizing: border-box !important;
28629
28696
  user-select: none;
28630
28697
 
28631
28698
  .o-menu-item {
28632
28699
  box-sizing: border-box;
28633
- height: ${26}px;
28634
- padding: ${4}px ${11}px;
28700
+ height: ${MENU_ITEM_HEIGHT}px;
28701
+ padding: ${MENU_ITEM_PADDING_VERTICAL}px ${MENU_ITEM_PADDING_HORIZONTAL}px;
28635
28702
  cursor: pointer;
28636
28703
  user-select: none;
28637
28704
 
@@ -28642,8 +28709,8 @@ stores.inject(MyMetaStore, storeInstance);
28642
28709
  .o-menu-item-icon {
28643
28710
  display: inline-block;
28644
28711
  margin: 0px 8px 0px 0px;
28645
- width: ${26 - 2 * 4}px;
28646
- line-height: ${26 - 2 * 4}px;
28712
+ width: ${MENU_ITEM_HEIGHT - 2 * MENU_ITEM_PADDING_VERTICAL}px;
28713
+ line-height: ${MENU_ITEM_HEIGHT - 2 * MENU_ITEM_PADDING_VERTICAL}px;
28647
28714
  }
28648
28715
 
28649
28716
  &:not(.disabled) {
@@ -28748,11 +28815,11 @@ stores.inject(MyMetaStore, storeInstance);
28748
28815
  anchorRect: {
28749
28816
  x: this.props.position.x,
28750
28817
  y: this.props.position.y,
28751
- width: isRoot ? 0 : this.props.width || 250,
28752
- height: isRoot ? 0 : 26
28818
+ width: isRoot ? 0 : this.props.width || MENU_WIDTH,
28819
+ height: isRoot ? 0 : MENU_ITEM_HEIGHT
28753
28820
  },
28754
28821
  positioning: "TopRight",
28755
- verticalOffset: isRoot ? 0 : 6,
28822
+ verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
28756
28823
  onPopoverHidden: () => this.closeSubMenu(),
28757
28824
  onPopoverMoved: () => this.closeSubMenu()
28758
28825
  };
@@ -29433,8 +29500,8 @@ stores.inject(MyMetaStore, storeInstance);
29433
29500
  const sheetId = getters.getActiveSheetId();
29434
29501
  if (getZoneArea(env.model.getters.getSelectedZone()) === 1) env.model.selection.selectTableAroundSelection();
29435
29502
  const size = {
29436
- width: 536,
29437
- height: 335
29503
+ width: DEFAULT_FIGURE_WIDTH,
29504
+ height: DEFAULT_FIGURE_HEIGHT
29438
29505
  };
29439
29506
  const position = getChartPositionAtCenterOfViewport(getters, size);
29440
29507
  if (env.model.dispatch("CREATE_CHART", {
@@ -31258,7 +31325,7 @@ stores.inject(MyMetaStore, storeInstance);
31258
31325
  function drawHighlight(renderingContext, highlight, rect) {
31259
31326
  const { x, y, width, height } = rect;
31260
31327
  if (width < 0 || height < 0) return;
31261
- const color = highlight.color || "#37A850";
31328
+ const color = highlight.color || HIGHLIGHT_COLOR;
31262
31329
  const { ctx } = renderingContext;
31263
31330
  ctx.save();
31264
31331
  if (!highlight.noBorder) {
@@ -31753,8 +31820,8 @@ stores.inject(MyMetaStore, storeInstance);
31753
31820
  -webkit-appearance: none;
31754
31821
  -moz-appearance: none;
31755
31822
  border-radius: 0;
31756
- width: ${14}px;
31757
- height: ${14}px;
31823
+ width: ${CHECKBOX_WIDTH}px;
31824
+ height: ${CHECKBOX_WIDTH}px;
31758
31825
  vertical-align: top;
31759
31826
  box-sizing: border-box;
31760
31827
  outline: none;
@@ -32696,7 +32763,7 @@ stores.inject(MyMetaStore, storeInstance);
32696
32763
  let { scrollX, scrollY } = getters.getActiveSheetDOMScrollInfo();
32697
32764
  const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
32698
32765
  let canEdgeScroll = false;
32699
- let timeoutDelay = 140;
32766
+ let timeoutDelay = MAX_DELAY;
32700
32767
  const x = currentEv.clientX - position.left;
32701
32768
  colIndex = getters.getColIndex(x);
32702
32769
  if (only !== "vertical") {
@@ -32862,9 +32929,9 @@ stores.inject(MyMetaStore, storeInstance);
32862
32929
  }
32863
32930
  }
32864
32931
  .o-separator {
32865
- border-bottom: ${1}px solid ${SEPARATOR_COLOR};
32866
- margin-top: ${5}px;
32867
- margin-bottom: ${5}px;
32932
+ border-bottom: ${MENU_SEPARATOR_BORDER_WIDTH}px solid ${SEPARATOR_COLOR};
32933
+ margin-top: ${MENU_SEPARATOR_PADDING}px;
32934
+ margin-bottom: ${MENU_SEPARATOR_PADDING}px;
32868
32935
  }
32869
32936
 
32870
32937
  .o-custom-selector {
@@ -33006,7 +33073,7 @@ stores.inject(MyMetaStore, storeInstance);
33006
33073
  }
33007
33074
  get sliderStyle() {
33008
33075
  const hue = this.state.currentHslaColor?.h || 0;
33009
- return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - 18 / 2}px` });
33076
+ return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - ICON_EDGE_LENGTH / 2}px` });
33010
33077
  }
33011
33078
  get pointerStyle() {
33012
33079
  const { s, l } = this.state.currentHslaColor || {
@@ -34131,13 +34198,13 @@ stores.inject(MyMetaStore, storeInstance);
34131
34198
  }];
34132
34199
  }
34133
34200
  get positiveValuesColor() {
34134
- return this.props.definition.positiveValuesColor || "#4EA7F2";
34201
+ return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
34135
34202
  }
34136
34203
  get negativeValuesColor() {
34137
- return this.props.definition.negativeValuesColor || "#EA6175";
34204
+ return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
34138
34205
  }
34139
34206
  get subTotalValuesColor() {
34140
- return this.props.definition.subTotalValuesColor || "#AAAAAA";
34207
+ return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
34141
34208
  }
34142
34209
  updateLegendPosition(ev) {
34143
34210
  this.props.updateChart(this.props.figureId, { legendPosition: ev.target.value });
@@ -35411,8 +35478,8 @@ stores.inject(MyMetaStore, storeInstance);
35411
35478
  height: 50px;
35412
35479
  width: 50px;
35413
35480
  .o-icon {
35414
- width: ${15}px;
35415
- height: ${15}px;
35481
+ width: ${CF_ICON_EDGE_LENGTH}px;
35482
+ height: ${CF_ICON_EDGE_LENGTH}px;
35416
35483
  }
35417
35484
  }
35418
35485
  .o-cf-preview-description {
@@ -35590,8 +35657,8 @@ stores.inject(MyMetaStore, storeInstance);
35590
35657
  background-color: ${BADGE_SELECTED_COLOR};
35591
35658
  }
35592
35659
  .o-icon {
35593
- width: ${15}px;
35594
- height: ${15}px;
35660
+ width: ${CF_ICON_EDGE_LENGTH}px;
35661
+ height: ${CF_ICON_EDGE_LENGTH}px;
35595
35662
  }
35596
35663
  }
35597
35664
  .o-cf-iconsets {
@@ -35865,7 +35932,7 @@ stores.inject(MyMetaStore, storeInstance);
35865
35932
  getPreviewGradient() {
35866
35933
  const rule = this.state.rules.colorScale;
35867
35934
  const minColor = colorNumberString(rule.minimum.color);
35868
- const midColor = colorNumberString(rule.midpoint?.color || 11982760);
35935
+ const midColor = colorNumberString(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
35869
35936
  const maxColor = colorNumberString(rule.maximum.color);
35870
35937
  const baseString = "background-image: linear-gradient(to right, ";
35871
35938
  return rule.midpoint === void 0 ? baseString + minColor + ", " + maxColor + ")" : baseString + minColor + ", " + midColor + ", " + maxColor + ")";
@@ -37864,7 +37931,7 @@ stores.inject(MyMetaStore, storeInstance);
37864
37931
  return {
37865
37932
  type: measureDisplayType,
37866
37933
  fieldNameWithGranularity,
37867
- value: value ?? "(previous)"
37934
+ value: value ?? PREVIOUS_VALUE
37868
37935
  };
37869
37936
  }
37870
37937
  }
@@ -40059,7 +40126,7 @@ stores.inject(MyMetaStore, storeInstance);
40059
40126
  return this.pivot.isInvalidRange;
40060
40127
  }
40061
40128
  get ranges() {
40062
- if (this.state.range) return [this.state.range];
40129
+ if (this.state.rangeHasChanged) return this.state.range ? [this.state.range] : [];
40063
40130
  if (this.definition.range) return [this.env.model.getters.getRangeString(this.definition.range, "forceSheetReference")];
40064
40131
  return [];
40065
40132
  }
@@ -40074,25 +40141,23 @@ stores.inject(MyMetaStore, storeInstance);
40074
40141
  }
40075
40142
  onSelectionChanged(ranges) {
40076
40143
  this.state.rangeHasChanged = true;
40077
- if (ranges.length === 0) {
40078
- this.state.range = void 0;
40079
- return;
40080
- }
40081
- const sheetId = this.env.model.getters.getActiveSheetId();
40082
- const range = this.env.model.getters.getRangeFromSheetXC(sheetId, ranges[0]);
40083
- this.state.range = this.env.model.getters.getRangeString(range, "forceSheetReference", { useBoundedReference: true });
40144
+ this.state.range = ranges[0];
40084
40145
  }
40085
40146
  onSelectionConfirmed() {
40086
- if (this.state.range) {
40087
- const range = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.range);
40088
- if (range.invalidSheetName || range.invalidXc) return;
40089
- const dataSet = {
40090
- sheetId: range.sheetId,
40091
- zone: range.zone
40092
- };
40093
- this.store.update({ dataSet });
40094
- this.store.applyUpdate();
40147
+ if (!this.state.range) {
40148
+ const pivotRange = this.definition.range;
40149
+ this.state.range = pivotRange ? this.env.model.getters.getRangeString(pivotRange, "forceSheetReference") : void 0;
40150
+ return;
40095
40151
  }
40152
+ const range = this.env.model.getters.getRangeFromSheetXC(this.env.model.getters.getActiveSheetId(), this.state.range);
40153
+ if (range.invalidSheetName || range.invalidXc) return;
40154
+ this.state.range = this.env.model.getters.getRangeString(range, "forceSheetReference", { useBoundedReference: true });
40155
+ const dataSet = {
40156
+ sheetId: range.sheetId,
40157
+ zone: range.zone
40158
+ };
40159
+ this.store.update({ dataSet });
40160
+ this.store.applyUpdate();
40096
40161
  }
40097
40162
  flipAxis() {
40098
40163
  const { rows, columns } = this.definition;
@@ -40333,7 +40398,7 @@ stores.inject(MyMetaStore, storeInstance);
40333
40398
  },
40334
40399
  {
40335
40400
  name: _t("Line Break"),
40336
- value: "\n"
40401
+ value: NEWLINE
40337
40402
  }
40338
40403
  ];
40339
40404
  var SplitIntoColumnsPanel = class extends _odoo_owl.Component {
@@ -41581,7 +41646,7 @@ stores.inject(MyMetaStore, storeInstance);
41581
41646
  showMenu() {
41582
41647
  const { x, y, width } = this.menuButtonRect;
41583
41648
  const menuPosition = {
41584
- x: x >= 250 ? x - 250 : x + width,
41649
+ x: x >= MENU_WIDTH ? x - MENU_WIDTH : x + width,
41585
41650
  y
41586
41651
  };
41587
41652
  this.openContextMenu(menuPosition);
@@ -41719,8 +41784,8 @@ stores.inject(MyMetaStore, storeInstance);
41719
41784
  css`
41720
41785
  .o-autofill {
41721
41786
  position: absolute;
41722
- height: ${8}px;
41723
- width: ${8}px;
41787
+ height: ${AUTOFILL_EDGE_LENGTH}px;
41788
+ width: ${AUTOFILL_EDGE_LENGTH}px;
41724
41789
  border: 1px solid white;
41725
41790
  box-sizing: border-box !important;
41726
41791
  background-color: #1a73e8;
@@ -41728,8 +41793,8 @@ stores.inject(MyMetaStore, storeInstance);
41728
41793
 
41729
41794
  .o-autofill-handler {
41730
41795
  position: absolute;
41731
- height: ${8}px;
41732
- width: ${8}px;
41796
+ height: ${AUTOFILL_EDGE_LENGTH}px;
41797
+ width: ${AUTOFILL_EDGE_LENGTH}px;
41733
41798
  &:hover {
41734
41799
  cursor: crosshair;
41735
41800
  }
@@ -42277,8 +42342,8 @@ stores.inject(MyMetaStore, storeInstance);
42277
42342
  //#region src/components/grid_cell_icon/grid_cell_icon.ts
42278
42343
  css`
42279
42344
  .o-grid-cell-icon {
42280
- width: ${17}px;
42281
- height: ${17}px;
42345
+ width: ${GRID_ICON_EDGE_LENGTH}px;
42346
+ height: ${GRID_ICON_EDGE_LENGTH}px;
42282
42347
  }
42283
42348
  `;
42284
42349
  var GridCellIcon = class extends _odoo_owl.Component {
@@ -42310,11 +42375,11 @@ stores.inject(MyMetaStore, storeInstance);
42310
42375
  const end = rect.y + rect.height;
42311
42376
  const cell = this.env.model.getters.getCell(cellPosition);
42312
42377
  switch (this.props.verticalAlign || cell?.style?.verticalAlign || DEFAULT_VERTICAL_ALIGN) {
42313
- case "bottom": return end - 2 - 17;
42314
- case "top": return start + 2;
42378
+ case "bottom": return end - GRID_ICON_MARGIN - GRID_ICON_EDGE_LENGTH;
42379
+ case "top": return start + GRID_ICON_MARGIN;
42315
42380
  default:
42316
- const centeringOffset = Math.floor((end - start - 17) / 2);
42317
- return end - 17 - centeringOffset;
42381
+ const centeringOffset = Math.floor((end - start - GRID_ICON_EDGE_LENGTH) / 2);
42382
+ return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
42318
42383
  }
42319
42384
  }
42320
42385
  getIconHorizontalPosition(rect, cellPosition) {
@@ -42323,11 +42388,11 @@ stores.inject(MyMetaStore, storeInstance);
42323
42388
  const cell = this.env.model.getters.getCell(cellPosition);
42324
42389
  const evaluatedCell = this.env.model.getters.getEvaluatedCell(cellPosition);
42325
42390
  switch (this.props.horizontalAlign || cell?.style?.align || evaluatedCell.defaultAlign) {
42326
- case "right": return end - 2 - 17;
42327
- case "left": return start + 2;
42391
+ case "right": return end - GRID_ICON_MARGIN - GRID_ICON_EDGE_LENGTH;
42392
+ case "left": return start + GRID_ICON_MARGIN;
42328
42393
  default:
42329
- const centeringOffset = Math.floor((end - start - 17) / 2);
42330
- return end - 17 - centeringOffset;
42394
+ const centeringOffset = Math.floor((end - start - GRID_ICON_EDGE_LENGTH) / 2);
42395
+ return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
42331
42396
  }
42332
42397
  }
42333
42398
  isPositionVisible(position) {
@@ -42342,7 +42407,7 @@ stores.inject(MyMetaStore, storeInstance);
42342
42407
  .o-dv-checkbox {
42343
42408
  box-sizing: border-box !important;
42344
42409
  accent-color: #808080;
42345
- margin: ${(17 - 14) / 2}px;
42410
+ margin: ${(GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2}px;
42346
42411
  /** required to prevent the checkbox position to be sensible to the font-size (affects Firefox) */
42347
42412
  position: absolute;
42348
42413
  }
@@ -42377,8 +42442,8 @@ stores.inject(MyMetaStore, storeInstance);
42377
42442
  .o-dv-list-icon {
42378
42443
  color: ${TEXT_BODY_MUTED};
42379
42444
  border-radius: 1px;
42380
- height: ${17}px;
42381
- width: ${17}px;
42445
+ height: ${GRID_ICON_EDGE_LENGTH}px;
42446
+ width: ${GRID_ICON_EDGE_LENGTH}px;
42382
42447
 
42383
42448
  &:hover {
42384
42449
  color: #ffffff;
@@ -42693,19 +42758,19 @@ stores.inject(MyMetaStore, storeInstance);
42693
42758
  position = fig.y;
42694
42759
  break;
42695
42760
  case "bottom":
42696
- position = fig.y + fig.height - 1;
42761
+ position = fig.y + fig.height - FIGURE_BORDER_WIDTH;
42697
42762
  break;
42698
42763
  case "vCenter":
42699
- position = fig.y + Math.floor(fig.height / 2) - 1;
42764
+ position = fig.y + Math.floor(fig.height / 2) - FIGURE_BORDER_WIDTH;
42700
42765
  break;
42701
42766
  case "left":
42702
42767
  position = fig.x;
42703
42768
  break;
42704
42769
  case "right":
42705
- position = fig.x + fig.width - 1;
42770
+ position = fig.x + fig.width - FIGURE_BORDER_WIDTH;
42706
42771
  break;
42707
42772
  case "hCenter":
42708
- position = fig.x + Math.floor(fig.width / 2) - 1;
42773
+ position = fig.x + Math.floor(fig.width / 2) - FIGURE_BORDER_WIDTH;
42709
42774
  break;
42710
42775
  }
42711
42776
  return {
@@ -42962,7 +43027,7 @@ stores.inject(MyMetaStore, storeInstance);
42962
43027
  y
42963
43028
  };
42964
43029
  const keepRatio = figureRegistry.get(figure.tag).keepRatio || false;
42965
- const minFigSize = figureRegistry.get(figure.tag).minFigSize || 80;
43030
+ const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
42966
43031
  const onMouseMove = (ev) => {
42967
43032
  const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, {
42968
43033
  x: ev.clientX,
@@ -43053,8 +43118,8 @@ stores.inject(MyMetaStore, storeInstance);
43053
43118
  display: flex;
43054
43119
  align-items: center;
43055
43120
  justify-content: center;
43056
- width: ${17}px;
43057
- height: ${17}px;
43121
+ width: ${GRID_ICON_EDGE_LENGTH}px;
43122
+ height: ${GRID_ICON_EDGE_LENGTH}px;
43058
43123
 
43059
43124
  &:hover {
43060
43125
  background: ${FILTERS_COLOR};
@@ -43681,9 +43746,9 @@ stores.inject(MyMetaStore, storeInstance);
43681
43746
  .o-col-resizer {
43682
43747
  position: absolute;
43683
43748
  top: 0;
43684
- left: ${48}px;
43685
- right: ${15}px;
43686
- height: ${26}px;
43749
+ left: ${HEADER_WIDTH}px;
43750
+ right: ${SCROLLBAR_WIDTH}px;
43751
+ height: ${HEADER_HEIGHT}px;
43687
43752
  &.o-dragging {
43688
43753
  cursor: grabbing;
43689
43754
  }
@@ -43691,14 +43756,14 @@ stores.inject(MyMetaStore, storeInstance);
43691
43756
  cursor: grab;
43692
43757
  }
43693
43758
  .dragging-col-line {
43694
- top: ${26}px;
43759
+ top: ${HEADER_HEIGHT}px;
43695
43760
  position: absolute;
43696
43761
  width: 2px;
43697
43762
  height: 10000px;
43698
43763
  background-color: black;
43699
43764
  }
43700
43765
  .dragging-col-shadow {
43701
- top: ${26}px;
43766
+ top: ${HEADER_HEIGHT}px;
43702
43767
  position: absolute;
43703
43768
  height: 10000px;
43704
43769
  background-color: black;
@@ -43706,13 +43771,13 @@ stores.inject(MyMetaStore, storeInstance);
43706
43771
  }
43707
43772
  .o-handle {
43708
43773
  position: absolute;
43709
- height: ${26}px;
43774
+ height: ${HEADER_HEIGHT}px;
43710
43775
  width: 4px;
43711
43776
  cursor: e-resize;
43712
43777
  background-color: ${SELECTION_BORDER_COLOR};
43713
43778
  }
43714
43779
  .dragging-resizer {
43715
- top: ${26}px;
43780
+ top: ${HEADER_HEIGHT}px;
43716
43781
  position: absolute;
43717
43782
  margin-left: 2px;
43718
43783
  width: 1px;
@@ -43737,7 +43802,7 @@ stores.inject(MyMetaStore, storeInstance);
43737
43802
  this.colResizerRef = (0, _odoo_owl.useRef)("colResizer");
43738
43803
  this.PADDING = 15;
43739
43804
  this.MAX_SIZE_MARGIN = 90;
43740
- this.MIN_ELEMENT_SIZE = 5;
43805
+ this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
43741
43806
  }
43742
43807
  get sheetId() {
43743
43808
  return this.env.model.getters.getActiveSheetId();
@@ -43836,10 +43901,10 @@ stores.inject(MyMetaStore, storeInstance);
43836
43901
  css`
43837
43902
  .o-row-resizer {
43838
43903
  position: absolute;
43839
- top: ${26}px;
43904
+ top: ${HEADER_HEIGHT}px;
43840
43905
  left: 0;
43841
- bottom: ${15}px;
43842
- width: ${48}px;
43906
+ bottom: ${SCROLLBAR_WIDTH}px;
43907
+ width: ${HEADER_WIDTH}px;
43843
43908
  &.o-dragging {
43844
43909
  cursor: grabbing;
43845
43910
  }
@@ -43847,14 +43912,14 @@ stores.inject(MyMetaStore, storeInstance);
43847
43912
  cursor: grab;
43848
43913
  }
43849
43914
  .dragging-row-line {
43850
- left: ${48}px;
43915
+ left: ${HEADER_WIDTH}px;
43851
43916
  position: absolute;
43852
43917
  width: 10000px;
43853
43918
  height: 2px;
43854
43919
  background-color: black;
43855
43920
  }
43856
43921
  .dragging-row-shadow {
43857
- left: ${48}px;
43922
+ left: ${HEADER_WIDTH}px;
43858
43923
  position: absolute;
43859
43924
  width: 10000px;
43860
43925
  background-color: black;
@@ -43863,12 +43928,12 @@ stores.inject(MyMetaStore, storeInstance);
43863
43928
  .o-handle {
43864
43929
  position: absolute;
43865
43930
  height: 4px;
43866
- width: ${48}px;
43931
+ width: ${HEADER_WIDTH}px;
43867
43932
  cursor: n-resize;
43868
43933
  background-color: ${SELECTION_BORDER_COLOR};
43869
43934
  }
43870
43935
  .dragging-resizer {
43871
- left: ${48}px;
43936
+ left: ${HEADER_WIDTH}px;
43872
43937
  position: absolute;
43873
43938
  margin-top: 2px;
43874
43939
  width: 10000px;
@@ -43892,7 +43957,7 @@ stores.inject(MyMetaStore, storeInstance);
43892
43957
  this.rowResizerRef = (0, _odoo_owl.useRef)("rowResizer");
43893
43958
  this.PADDING = 5;
43894
43959
  this.MAX_SIZE_MARGIN = 60;
43895
- this.MIN_ELEMENT_SIZE = 10;
43960
+ this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
43896
43961
  }
43897
43962
  rowResizerRef;
43898
43963
  get sheetId() {
@@ -43999,8 +44064,8 @@ stores.inject(MyMetaStore, storeInstance);
43999
44064
  top: 0;
44000
44065
  left: 0;
44001
44066
  right: 0;
44002
- width: ${48}px;
44003
- height: ${26}px;
44067
+ width: ${HEADER_WIDTH}px;
44068
+ height: ${HEADER_HEIGHT}px;
44004
44069
  }
44005
44070
  }
44006
44071
  `;
@@ -44035,7 +44100,7 @@ stores.inject(MyMetaStore, storeInstance);
44035
44100
  */
44036
44101
  getHeaderOffset(dimension, start, index) {
44037
44102
  let size = this.getters.getColRowOffsetInViewport(dimension, start, index);
44038
- if (!this.getters.isDashboard()) size += dimension === "ROW" ? 26 : 48;
44103
+ if (!this.getters.isDashboard()) size += dimension === "ROW" ? HEADER_HEIGHT : HEADER_WIDTH;
44039
44104
  return size;
44040
44105
  }
44041
44106
  drawLayer(renderingContext, layer) {
@@ -44217,8 +44282,8 @@ stores.inject(MyMetaStore, storeInstance);
44217
44282
  }
44218
44283
  ctx.fillStyle = style.textColor || "#000";
44219
44284
  let x = box.x;
44220
- if (align === "left") x += 4 + (box.image ? box.image.size + 4 : 0);
44221
- else if (align === "right") x += box.width - 4 - (box.hasIcon ? 17 + 2 : 0);
44285
+ if (align === "left") x += MIN_CELL_TEXT_MARGIN + (box.image ? box.image.size + MIN_CF_ICON_MARGIN : 0);
44286
+ else if (align === "right") x += box.width - MIN_CELL_TEXT_MARGIN - (box.hasIcon ? GRID_ICON_EDGE_LENGTH + GRID_ICON_MARGIN : 0);
44222
44287
  else x += box.width / 2;
44223
44288
  ctx.textAlign = align;
44224
44289
  if (box.clipRect) {
@@ -44236,7 +44301,7 @@ stores.inject(MyMetaStore, storeInstance);
44236
44301
  x: Math.round(x),
44237
44302
  y: Math.round(y)
44238
44303
  }, style.underline, style.strikethrough);
44239
- y += 4 + textLineHeight;
44304
+ y += MIN_CELL_TEXT_MARGIN + textLineHeight;
44240
44305
  }
44241
44306
  if (box.clipRect) ctx.restore();
44242
44307
  }
@@ -44254,7 +44319,7 @@ stores.inject(MyMetaStore, storeInstance);
44254
44319
  }
44255
44320
  const iconSize = box.image.size;
44256
44321
  const y = this.computeTextYCoordinate(box, iconSize);
44257
- ctx.drawImage(icon, box.x + 4, y, iconSize, iconSize);
44322
+ ctx.drawImage(icon, box.x + MIN_CF_ICON_MARGIN, y, iconSize, iconSize);
44258
44323
  if (box.image.clipIcon) ctx.restore();
44259
44324
  }
44260
44325
  }
@@ -44266,13 +44331,13 @@ stores.inject(MyMetaStore, storeInstance);
44266
44331
  computeTextYCoordinate(box, textLineHeight, numberOfLines = 1) {
44267
44332
  const y = box.y + 1;
44268
44333
  const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
44269
- const hasEnoughSpaces = box.height > textHeight + 4 * 2;
44334
+ const hasEnoughSpaces = box.height > textHeight + MIN_CELL_TEXT_MARGIN * 2;
44270
44335
  const verticalAlign = box.verticalAlign || DEFAULT_VERTICAL_ALIGN;
44271
44336
  if (hasEnoughSpaces) {
44272
44337
  if (verticalAlign === "middle") return y + (box.height - textHeight) / 2;
44273
- if (verticalAlign === "bottom") return y + box.height - textHeight - 4;
44338
+ if (verticalAlign === "bottom") return y + box.height - textHeight - MIN_CELL_TEXT_MARGIN;
44274
44339
  }
44275
- return y + 4;
44340
+ return y + MIN_CELL_TEXT_MARGIN;
44276
44341
  }
44277
44342
  drawHeaders(renderingContext) {
44278
44343
  const { ctx, thinLineWidth } = renderingContext;
@@ -44289,7 +44354,7 @@ stores.inject(MyMetaStore, storeInstance);
44289
44354
  const numberOfRows = this.getters.getNumberRows(sheetId);
44290
44355
  const activeCols = this.getters.getActiveCols();
44291
44356
  const activeRows = this.getters.getActiveRows();
44292
- ctx.font = `400 ${11}px ${DEFAULT_FONT}`;
44357
+ ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
44293
44358
  ctx.textAlign = "center";
44294
44359
  ctx.textBaseline = "middle";
44295
44360
  ctx.lineWidth = thinLineWidth;
@@ -44307,7 +44372,7 @@ stores.inject(MyMetaStore, storeInstance);
44307
44372
  if (isColActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
44308
44373
  else if (isColSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
44309
44374
  else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
44310
- ctx.fillRect(x, 0, width, 26);
44375
+ ctx.fillRect(x, 0, width, HEADER_HEIGHT);
44311
44376
  }
44312
44377
  for (const row of visibleRows) {
44313
44378
  const rowZone = {
@@ -44322,13 +44387,13 @@ stores.inject(MyMetaStore, storeInstance);
44322
44387
  if (isRowActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
44323
44388
  else if (isRowSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
44324
44389
  else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
44325
- ctx.fillRect(0, y, 48, height);
44390
+ ctx.fillRect(0, y, HEADER_WIDTH, height);
44326
44391
  }
44327
44392
  ctx.beginPath();
44328
- ctx.moveTo(48, 0);
44329
- ctx.lineTo(48, height);
44330
- ctx.moveTo(0, 26);
44331
- ctx.lineTo(width, 26);
44393
+ ctx.moveTo(HEADER_WIDTH, 0);
44394
+ ctx.lineTo(HEADER_WIDTH, height);
44395
+ ctx.moveTo(0, HEADER_HEIGHT);
44396
+ ctx.lineTo(width, HEADER_HEIGHT);
44332
44397
  ctx.strokeStyle = HEADER_BORDER_COLOR;
44333
44398
  ctx.stroke();
44334
44399
  ctx.beginPath();
@@ -44337,25 +44402,25 @@ stores.inject(MyMetaStore, storeInstance);
44337
44402
  const colName = numberToLetters(col);
44338
44403
  ctx.fillStyle = activeCols.has(col) ? "#fff" : TEXT_HEADER_COLOR;
44339
44404
  const colStart = this.getHeaderOffset("COL", left, col);
44340
- ctx.fillText(colName, colStart + colSize / 2, 26 / 2);
44405
+ ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
44341
44406
  ctx.moveTo(colStart + colSize, 0);
44342
- ctx.lineTo(colStart + colSize, 26);
44407
+ ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
44343
44408
  }
44344
44409
  for (const row of visibleRows) {
44345
44410
  const rowSize = this.getters.getRowSize(sheetId, row);
44346
44411
  ctx.fillStyle = activeRows.has(row) ? "#fff" : TEXT_HEADER_COLOR;
44347
44412
  const rowStart = this.getHeaderOffset("ROW", top, row);
44348
- ctx.fillText(String(row + 1), 48 / 2, rowStart + rowSize / 2);
44413
+ ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
44349
44414
  ctx.moveTo(0, rowStart + rowSize);
44350
- ctx.lineTo(48, rowStart + rowSize);
44415
+ ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
44351
44416
  }
44352
44417
  ctx.stroke();
44353
44418
  }
44354
44419
  drawFrozenPanesHeaders(renderingContext) {
44355
44420
  const { ctx, thinLineWidth } = renderingContext;
44356
44421
  const { x: offsetCorrectionX, y: offsetCorrectionY } = this.getters.getMainViewportCoordinates();
44357
- const widthCorrection = this.getters.isDashboard() ? 0 : 48;
44358
- const heightCorrection = this.getters.isDashboard() ? 0 : 26;
44422
+ const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
44423
+ const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
44359
44424
  ctx.lineWidth = 6 * thinLineWidth;
44360
44425
  ctx.strokeStyle = FROZEN_PANE_HEADER_BORDER_COLOR;
44361
44426
  ctx.beginPath();
@@ -44383,8 +44448,8 @@ stores.inject(MyMetaStore, storeInstance);
44383
44448
  bottom: visibleRows[visibleRows.length - 1]
44384
44449
  };
44385
44450
  const rect = this.getters.getVisibleRect(viewport);
44386
- const widthCorrection = this.getters.isDashboard() ? 0 : 48;
44387
- const heightCorrection = this.getters.isDashboard() ? 0 : 26;
44451
+ const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
44452
+ const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
44388
44453
  ctx.lineWidth = 6 * thinLineWidth;
44389
44454
  ctx.strokeStyle = FROZEN_PANE_BORDER_COLOR;
44390
44455
  ctx.beginPath();
@@ -44468,7 +44533,7 @@ stores.inject(MyMetaStore, storeInstance);
44468
44533
  /** Icon */
44469
44534
  const iconSrc = this.getters.getCellIconSrc(position);
44470
44535
  const fontSizePX = computeTextFontSizeInPixels(box.style);
44471
- const iconBoxWidth = iconSrc ? 4 + fontSizePX : 0;
44536
+ const iconBoxWidth = iconSrc ? MIN_CF_ICON_MARGIN + fontSizePX : 0;
44472
44537
  if (iconSrc) {
44473
44538
  const imageHtmlElement = loadIconImage(iconSrc);
44474
44539
  box.image = {
@@ -44486,19 +44551,19 @@ stores.inject(MyMetaStore, storeInstance);
44486
44551
  if (cell.type === "empty" || this.getters.isCellValidCheckbox(position)) return box;
44487
44552
  /** Filter Header or data validation icon */
44488
44553
  box.hasIcon = this.getters.doesCellHaveGridIcon(position);
44489
- const headerIconWidth = box.hasIcon ? 17 + 2 : 0;
44554
+ const headerIconWidth = box.hasIcon ? GRID_ICON_EDGE_LENGTH + GRID_ICON_MARGIN : 0;
44490
44555
  /** Content */
44491
44556
  const style = this.getters.getCellComputedStyle(position);
44492
44557
  const wrapping = style.wrapping || "overflow";
44493
44558
  const wrapText = wrapping === "wrap" && !showFormula;
44494
- const maxWidth = width - 2 * 4;
44559
+ const maxWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
44495
44560
  const formatWidth = style.align ? 0 : maxWidth;
44496
44561
  const multiLineText = this.getters.getCellMultiLineText(position, {
44497
44562
  maxWidth,
44498
44563
  formatWidth,
44499
44564
  wrapText
44500
44565
  });
44501
- const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, style) + 4));
44566
+ const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, style) + MIN_CELL_TEXT_MARGIN));
44502
44567
  const contentWidth = iconBoxWidth + textWidth + headerIconWidth;
44503
44568
  const align = this.computeCellAlignment(position, contentWidth > width);
44504
44569
  box.content = {
@@ -44710,7 +44775,7 @@ stores.inject(MyMetaStore, storeInstance);
44710
44775
  resetTimeout = setTimeout(() => {
44711
44776
  velocityX = 0;
44712
44777
  velocityY = 0;
44713
- }, 100);
44778
+ }, resetTimeoutDuration);
44714
44779
  updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
44715
44780
  }
44716
44781
  function onTouchEnd(ev) {
@@ -44741,7 +44806,7 @@ stores.inject(MyMetaStore, storeInstance);
44741
44806
  //#region src/components/helpers/wheel_hook.ts
44742
44807
  function useWheelHandler(handler) {
44743
44808
  function normalize(val, deltaMode) {
44744
- return val * (deltaMode === 0 ? 1 : 23);
44809
+ return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
44745
44810
  }
44746
44811
  const onMouseWheel = (ev) => {
44747
44812
  handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
@@ -44857,8 +44922,8 @@ stores.inject(MyMetaStore, storeInstance);
44857
44922
  const leftValue = this.isLeft ? rect.x : rect.x + rect.width;
44858
44923
  const topValue = this.isTop ? rect.y : rect.y + rect.height;
44859
44924
  return cssPropertiesToCss({
44860
- left: `${leftValue - 8 / 2}px`,
44861
- top: `${topValue - 8 / 2}px`,
44925
+ left: `${leftValue - AUTOFILL_EDGE_LENGTH / 2}px`,
44926
+ top: `${topValue - AUTOFILL_EDGE_LENGTH / 2}px`,
44862
44927
  "background-color": this.props.color
44863
44928
  });
44864
44929
  }
@@ -44998,8 +45063,8 @@ stores.inject(MyMetaStore, storeInstance);
44998
45063
  &.corner {
44999
45064
  right: 0px;
45000
45065
  bottom: 0px;
45001
- height: ${15}px;
45002
- width: ${15}px;
45066
+ height: ${SCROLLBAR_WIDTH}px;
45067
+ width: ${SCROLLBAR_WIDTH}px;
45003
45068
  border-top: 1px solid #e2e3e3;
45004
45069
  border-left: 1px solid #e2e3e3;
45005
45070
  }
@@ -45092,7 +45157,7 @@ stores.inject(MyMetaStore, storeInstance);
45092
45157
  return {
45093
45158
  left: `${this.props.leftOffset + x}px`,
45094
45159
  bottom: "0px",
45095
- height: `${15}px`,
45160
+ height: `${SCROLLBAR_WIDTH}px`,
45096
45161
  right: `0px`
45097
45162
  };
45098
45163
  }
@@ -45138,7 +45203,7 @@ stores.inject(MyMetaStore, storeInstance);
45138
45203
  return {
45139
45204
  top: `${this.props.topOffset + y}px`,
45140
45205
  right: "0px",
45141
- width: `${15}px`,
45206
+ width: `${SCROLLBAR_WIDTH}px`,
45142
45207
  bottom: `0px`
45143
45208
  };
45144
45209
  }
@@ -45165,7 +45230,7 @@ stores.inject(MyMetaStore, storeInstance);
45165
45230
  ];
45166
45231
  currentPanelProps = {};
45167
45232
  componentTag = "";
45168
- panelSize = 350;
45233
+ panelSize = DEFAULT_SIDE_PANEL_SIZE;
45169
45234
  get isOpen() {
45170
45235
  if (!this.componentTag) return false;
45171
45236
  return this.computeState(this.componentTag, this.currentPanelProps).isOpen;
@@ -45196,12 +45261,12 @@ stores.inject(MyMetaStore, storeInstance);
45196
45261
  this.componentTag = "";
45197
45262
  }
45198
45263
  changePanelSize(size, spreadsheetElWidth) {
45199
- if (size < 350) this.panelSize = 350;
45200
- else if (size > spreadsheetElWidth - 150) this.panelSize = Math.max(spreadsheetElWidth - 150, 350);
45264
+ if (size < DEFAULT_SIDE_PANEL_SIZE) this.panelSize = DEFAULT_SIDE_PANEL_SIZE;
45265
+ else if (size > spreadsheetElWidth - MIN_SHEET_VIEW_WIDTH) this.panelSize = Math.max(spreadsheetElWidth - MIN_SHEET_VIEW_WIDTH, DEFAULT_SIDE_PANEL_SIZE);
45201
45266
  else this.panelSize = size;
45202
45267
  }
45203
45268
  resetPanelSize() {
45204
- this.panelSize = 350;
45269
+ this.panelSize = DEFAULT_SIDE_PANEL_SIZE;
45205
45270
  }
45206
45271
  computeState(componentTag, panelProps) {
45207
45272
  const customComputeState = sidePanelRegistry.get(componentTag).computeState;
@@ -45317,8 +45382,8 @@ stores.inject(MyMetaStore, storeInstance);
45317
45382
  HorizontalScrollBar,
45318
45383
  TableResizer
45319
45384
  };
45320
- HEADER_HEIGHT = 26;
45321
- HEADER_WIDTH = 48;
45385
+ HEADER_HEIGHT = HEADER_HEIGHT;
45386
+ HEADER_WIDTH = HEADER_WIDTH;
45322
45387
  menuState;
45323
45388
  gridRef;
45324
45389
  highlightStore;
@@ -45376,10 +45441,10 @@ stores.inject(MyMetaStore, storeInstance);
45376
45441
  }
45377
45442
  get gridOverlayDimensions() {
45378
45443
  return cssPropertiesToCss({
45379
- top: `${26}px`,
45380
- left: `${48}px`,
45381
- height: `calc(100% - ${26 + 15}px)`,
45382
- width: `calc(100% - ${48 + 15}px)`
45444
+ top: `${HEADER_HEIGHT}px`,
45445
+ left: `${HEADER_WIDTH}px`,
45446
+ height: `calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px)`,
45447
+ width: `calc(100% - ${HEADER_WIDTH + SCROLLBAR_WIDTH}px)`
45383
45448
  });
45384
45449
  }
45385
45450
  onClosePopover() {
@@ -45552,8 +45617,8 @@ stores.inject(MyMetaStore, storeInstance);
45552
45617
  const zone = this.env.model.getters.getSelectedZone();
45553
45618
  const rect = this.env.model.getters.getVisibleRect(zone);
45554
45619
  return {
45555
- left: rect.x + rect.width - 8 / 2,
45556
- top: rect.y + rect.height - 8 / 2
45620
+ left: rect.x + rect.width - AUTOFILL_EDGE_LENGTH / 2,
45621
+ top: rect.y + rect.height - AUTOFILL_EDGE_LENGTH / 2
45557
45622
  };
45558
45623
  }
45559
45624
  get isAutofillVisible() {
@@ -45570,8 +45635,8 @@ stores.inject(MyMetaStore, storeInstance);
45570
45635
  this.env.model.dispatch("RESIZE_SHEETVIEW", {
45571
45636
  width,
45572
45637
  height,
45573
- gridOffsetX: 48,
45574
- gridOffsetY: 26
45638
+ gridOffsetX: HEADER_WIDTH,
45639
+ gridOffsetY: HEADER_HEIGHT
45575
45640
  });
45576
45641
  }
45577
45642
  moveCanvas(deltaX, deltaY) {
@@ -47307,8 +47372,8 @@ stores.inject(MyMetaStore, storeInstance);
47307
47372
  case "DUPLICATE_SHEET": {
47308
47373
  const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
47309
47374
  for (const fig of sheetFiguresFrom) if (fig.tag === "chart") {
47310
- const figureIdBase = fig.id.split("??").pop();
47311
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
47375
+ const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
47376
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
47312
47377
  const chart = this.charts[fig.id]?.copyForSheetId(cmd.sheetIdTo);
47313
47378
  if (chart) this.dispatch("CREATE_CHART", {
47314
47379
  id: duplicatedFigureId,
@@ -47385,8 +47450,8 @@ stores.inject(MyMetaStore, storeInstance);
47385
47450
  x: 0,
47386
47451
  y: 0
47387
47452
  }, size = {
47388
- width: 536,
47389
- height: 335
47453
+ width: DEFAULT_FIGURE_WIDTH,
47454
+ height: DEFAULT_FIGURE_HEIGHT
47390
47455
  }) {
47391
47456
  if (this.getters.getFigure(sheetId, id)) return;
47392
47457
  const figure = {
@@ -48028,7 +48093,7 @@ stores.inject(MyMetaStore, storeInstance);
48028
48093
  onRowDeletion(sheetId) {
48029
48094
  const numHeader = this.getters.getNumberRows(sheetId);
48030
48095
  let gridHeight = 0;
48031
- for (let i = 0; i < numHeader; i++) gridHeight += this.getters.getUserRowSize(sheetId, i) || 23;
48096
+ for (let i = 0; i < numHeader; i++) gridHeight += this.getters.getUserRowSize(sheetId, i) || DEFAULT_CELL_HEIGHT;
48032
48097
  const figures = this.getters.getFigures(sheetId);
48033
48098
  for (const figure of figures) {
48034
48099
  const newY = Math.min(figure.y, gridHeight - figure.height);
@@ -48159,7 +48224,7 @@ stores.inject(MyMetaStore, storeInstance);
48159
48224
  }
48160
48225
  }
48161
48226
  getColSize(sheetId, index) {
48162
- return Math.round(this.sizes[sheetId]?.["COL"][index] || 96);
48227
+ return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
48163
48228
  }
48164
48229
  getUserRowSize(sheetId, index) {
48165
48230
  const rowSize = this.sizes[sheetId]?.["ROW"][index];
@@ -48192,7 +48257,7 @@ stores.inject(MyMetaStore, storeInstance);
48192
48257
  if (sheet.rows === void 0) sheet.rows = {};
48193
48258
  for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
48194
48259
  ...sheet.rows[row],
48195
- size: this.getUserRowSize(sheet.id, row) ?? 23
48260
+ size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
48196
48261
  };
48197
48262
  if (sheet.cols === void 0) sheet.cols = {};
48198
48263
  for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
@@ -48373,8 +48438,8 @@ stores.inject(MyMetaStore, storeInstance);
48373
48438
  case "DUPLICATE_SHEET": {
48374
48439
  const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
48375
48440
  for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
48376
- const figureIdBase = fig.id.split("??").pop();
48377
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
48441
+ const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
48442
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
48378
48443
  const image = this.getImage(fig.id);
48379
48444
  if (image) {
48380
48445
  const size = {
@@ -52681,7 +52746,7 @@ stores.inject(MyMetaStore, storeInstance);
52681
52746
  col,
52682
52747
  row
52683
52748
  });
52684
- const background = style.fillColor || "#FFFFFF";
52749
+ const background = style.fillColor || BACKGROUND_CHART_COLOR;
52685
52750
  return {
52686
52751
  background,
52687
52752
  fontColor: style.textColor || chartFontColor(background)
@@ -53378,7 +53443,7 @@ stores.inject(MyMetaStore, storeInstance);
53378
53443
  }
53379
53444
  }
53380
53445
  getRowSize(sheetId, row) {
53381
- return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? 23);
53446
+ return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? DEFAULT_CELL_HEIGHT);
53382
53447
  }
53383
53448
  getHeaderSize(sheetId, dimension, index) {
53384
53449
  if (this.getters.isHeaderHidden(sheetId, dimension, index)) return 0;
@@ -53395,8 +53460,8 @@ stores.inject(MyMetaStore, storeInstance);
53395
53460
  col,
53396
53461
  row
53397
53462
  });
53398
- if (updatedCellHeight <= 23) return;
53399
- if (!tallestCellInRow && updatedCellHeight > 23 || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
53463
+ if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
53464
+ if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
53400
53465
  const newTallestCell = {
53401
53466
  cell: {
53402
53467
  sheetId,
@@ -53421,7 +53486,7 @@ stores.inject(MyMetaStore, storeInstance);
53421
53486
  * merge, or the height of the cell computed based on its style/content.
53422
53487
  */
53423
53488
  getCellHeight(position) {
53424
- if (this.isInMultiRowMerge(position)) return 23;
53489
+ if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
53425
53490
  const cell = this.getters.getCell(position);
53426
53491
  const colSize = this.getters.getColSize(position.sheetId, position.col);
53427
53492
  return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
@@ -53443,7 +53508,7 @@ stores.inject(MyMetaStore, storeInstance);
53443
53508
  if (!cell) continue;
53444
53509
  const position = this.getters.getCellPosition(cell.id);
53445
53510
  const cellHeight = this.getCellHeight(position);
53446
- if (cellHeight > maxHeight && cellHeight > 23) {
53511
+ if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
53447
53512
  maxHeight = cellHeight;
53448
53513
  tallestCell = {
53449
53514
  cell: position,
@@ -53451,7 +53516,7 @@ stores.inject(MyMetaStore, storeInstance);
53451
53516
  };
53452
53517
  }
53453
53518
  }
53454
- if (tallestCell && tallestCell.size > 23) return tallestCell;
53519
+ if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
53455
53520
  }
53456
53521
  };
53457
53522
 
@@ -53839,7 +53904,7 @@ stores.inject(MyMetaStore, storeInstance);
53839
53904
  * @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
53840
53905
  */
53841
53906
  getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
53842
- const comparedDomain = valueToCompare === "(previous)" || valueToCompare === "(next)" ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
53907
+ const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
53843
53908
  if (deepEquals(comparedDomain, domain)) return "sameValue";
53844
53909
  if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
53845
53910
  const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
@@ -55314,7 +55379,7 @@ stores.inject(MyMetaStore, storeInstance);
55314
55379
  this.revisions = revisions;
55315
55380
  this.transportService = transportService;
55316
55381
  this.serverRevisionId = serverRevisionId;
55317
- this.debouncedMove = debounce(this._move.bind(this), 200);
55382
+ this.debouncedMove = debounce(this._move.bind(this), DEBOUNCE_TIME);
55318
55383
  }
55319
55384
  canApplyOptimisticUpdate() {
55320
55385
  return !this.waitingUndoRedoAck;
@@ -55331,7 +55396,7 @@ stores.inject(MyMetaStore, storeInstance);
55331
55396
  this.trigger("new-local-state-update", { id: revision.id });
55332
55397
  this.sendUpdateMessage({
55333
55398
  type: "REMOTE_REVISION",
55334
- version: 1,
55399
+ version: MESSAGE_VERSION,
55335
55400
  serverRevisionId: this.serverRevisionId,
55336
55401
  nextRevisionId: revision.id,
55337
55402
  clientId: revision.clientId,
@@ -55342,7 +55407,7 @@ stores.inject(MyMetaStore, storeInstance);
55342
55407
  this.waitingUndoRedoAck = true;
55343
55408
  this.sendUpdateMessage({
55344
55409
  type: "REVISION_UNDONE",
55345
- version: 1,
55410
+ version: MESSAGE_VERSION,
55346
55411
  serverRevisionId: this.serverRevisionId,
55347
55412
  nextRevisionId: this.uuidGenerator.uuidv4(),
55348
55413
  undoneRevisionId: revisionId
@@ -55352,7 +55417,7 @@ stores.inject(MyMetaStore, storeInstance);
55352
55417
  this.waitingUndoRedoAck = true;
55353
55418
  this.sendUpdateMessage({
55354
55419
  type: "REVISION_REDONE",
55355
- version: 1,
55420
+ version: MESSAGE_VERSION,
55356
55421
  serverRevisionId: this.serverRevisionId,
55357
55422
  nextRevisionId: this.uuidGenerator.uuidv4(),
55358
55423
  redoneRevisionId: revisionId
@@ -55395,7 +55460,7 @@ stores.inject(MyMetaStore, storeInstance);
55395
55460
  this.transportService.sendMessage({
55396
55461
  type: "CLIENT_LEFT",
55397
55462
  clientId: this.clientId,
55398
- version: 1
55463
+ version: MESSAGE_VERSION
55399
55464
  });
55400
55465
  }
55401
55466
  /**
@@ -55412,7 +55477,7 @@ stores.inject(MyMetaStore, storeInstance);
55412
55477
  ...data,
55413
55478
  revisionId: snapshotId
55414
55479
  },
55415
- version: 1
55480
+ version: MESSAGE_VERSION
55416
55481
  });
55417
55482
  }
55418
55483
  getClient() {
@@ -55447,7 +55512,7 @@ stores.inject(MyMetaStore, storeInstance);
55447
55512
  };
55448
55513
  this.transportService.sendMessage({
55449
55514
  type,
55450
- version: 1,
55515
+ version: MESSAGE_VERSION,
55451
55516
  client: {
55452
55517
  ...client,
55453
55518
  position
@@ -55524,7 +55589,7 @@ stores.inject(MyMetaStore, storeInstance);
55524
55589
  const { position } = client;
55525
55590
  if (position) this.transportService.sendMessage({
55526
55591
  type: "CLIENT_MOVED",
55527
- version: 1,
55592
+ version: MESSAGE_VERSION,
55528
55593
  client: {
55529
55594
  ...client,
55530
55595
  position
@@ -56444,9 +56509,9 @@ stores.inject(MyMetaStore, storeInstance);
56444
56509
  contentWidth += Math.max(...multiLineText.map((line) => computeTextWidth(this.ctx, line, style)));
56445
56510
  }
56446
56511
  if (this.getters.getCellIconSrc(position)) contentWidth += computeIconWidth(style);
56447
- if (this.getters.doesCellHaveGridIcon(position)) contentWidth += 18 + 2;
56512
+ if (this.getters.doesCellHaveGridIcon(position)) contentWidth += ICON_EDGE_LENGTH + GRID_ICON_MARGIN;
56448
56513
  if (contentWidth === 0) return 0;
56449
- contentWidth += 2 * 4;
56514
+ contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
56450
56515
  if (style.wrapping === "wrap") {
56451
56516
  const colWidth = this.getters.getColSize(position.sheetId, position.col);
56452
56517
  return Math.min(colWidth, contentWidth);
@@ -56602,11 +56667,11 @@ stores.inject(MyMetaStore, storeInstance);
56602
56667
  if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
56603
56668
  const content = this.getters.getEvaluatedCell(position).formattedValue;
56604
56669
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
56605
- if (evaluatedSize > evaluatedRowSize && evaluatedSize > 23) evaluatedRowSize = evaluatedSize;
56670
+ if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = evaluatedSize;
56606
56671
  } else {
56607
56672
  const content = cell.content;
56608
56673
  const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
56609
- if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > 23) evaluatedRowSize = 0;
56674
+ if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = 0;
56610
56675
  }
56611
56676
  }
56612
56677
  rowSizes.push(evaluatedRowSize || null);
@@ -57146,7 +57211,7 @@ stores.inject(MyMetaStore, storeInstance);
57146
57211
  onNewLocalStateUpdate({ id }) {
57147
57212
  this.undoStack.push(id);
57148
57213
  this.redoStack = [];
57149
- if (this.undoStack.length > 99) this.undoStack.shift();
57214
+ if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
57150
57215
  }
57151
57216
  /**
57152
57217
  * Fetch the last revision which is not empty and not a repeated command
@@ -57241,7 +57306,7 @@ stores.inject(MyMetaStore, storeInstance);
57241
57306
  }
57242
57307
  getAutoSeparatorForString(str) {
57243
57308
  const separators = [
57244
- "\n",
57309
+ NEWLINE,
57245
57310
  ";",
57246
57311
  ",",
57247
57312
  " ",
@@ -57566,7 +57631,7 @@ stores.inject(MyMetaStore, storeInstance);
57566
57631
  case "PASTE_FROM_OS_CLIPBOARD": {
57567
57632
  this._isCutOperation = false;
57568
57633
  let contentToPaste = cmd.clipboardContent;
57569
- if (contentToPaste.data?.version !== 22) {
57634
+ if (contentToPaste.data?.version !== CURRENT_VERSION) {
57570
57635
  contentToPaste = { ...contentToPaste };
57571
57636
  delete contentToPaste.data;
57572
57637
  }
@@ -57801,7 +57866,7 @@ stores.inject(MyMetaStore, storeInstance);
57801
57866
  }
57802
57867
  getSheetData() {
57803
57868
  const data = {
57804
- version: 22,
57869
+ version: CURRENT_VERSION,
57805
57870
  clipboardId: this.clipboardId
57806
57871
  };
57807
57872
  if (this.copiedData && "figureId" in this.copiedData) return data;
@@ -58524,7 +58589,7 @@ stores.inject(MyMetaStore, storeInstance);
58524
58589
  const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
58525
58590
  const originalSize = Object.fromEntries(toRemove.map((element) => {
58526
58591
  const size = isCol ? this.getters.getColSize(cmd.sheetId, element) : this.getters.getUserRowSize(cmd.sheetId, element);
58527
- return [element, isCol && size === 96 || size === void 0 ? null : size];
58592
+ return [element, isCol && size === DEFAULT_CELL_WIDTH || size === void 0 ? null : size];
58528
58593
  }));
58529
58594
  const target = [{
58530
58595
  left: isCol ? start + deltaCol : 0,
@@ -58739,14 +58804,14 @@ stores.inject(MyMetaStore, storeInstance);
58739
58804
  const topRowSize = this.getters.getRowSize(this.sheetId, topRowIndex);
58740
58805
  let width = lastColEnd - this.offsetCorrectionX;
58741
58806
  if (this.canScrollHorizontally) {
58742
- width += Math.max(96, Math.min(leftColSize, this.viewportWidth - lastColSize));
58807
+ width += Math.max(DEFAULT_CELL_WIDTH, Math.min(leftColSize, this.viewportWidth - lastColSize));
58743
58808
  width = Math.max(width, this.viewportWidth);
58744
58809
  }
58745
58810
  let height = lastRowEnd - this.offsetCorrectionY;
58746
58811
  if (this.canScrollVertically) {
58747
- height += Math.max(23 + 5, Math.min(topRowSize, this.viewportHeight - lastRowSize));
58812
+ height += Math.max(DEFAULT_CELL_HEIGHT + 5, Math.min(topRowSize, this.viewportHeight - lastRowSize));
58748
58813
  height = Math.max(height, this.viewportHeight);
58749
- if (lastRowEnd + 46 > height && !this.getters.isReadonly()) height += 46;
58814
+ if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly()) height += FOOTER_HEIGHT;
58750
58815
  }
58751
58816
  return {
58752
58817
  width,
@@ -60047,7 +60112,7 @@ stores.inject(MyMetaStore, storeInstance);
60047
60112
  .o-sheet {
60048
60113
  padding: 0 15px;
60049
60114
  padding-right: 10px;
60050
- height: ${36}px;
60115
+ height: ${BOTTOMBAR_HEIGHT}px;
60051
60116
  border-left: 1px solid #c1c1c1;
60052
60117
  border-right: 1px solid #c1c1c1;
60053
60118
  margin-left: -1px;
@@ -60420,7 +60485,7 @@ stores.inject(MyMetaStore, storeInstance);
60420
60485
  css`
60421
60486
  .o-spreadsheet-bottom-bar {
60422
60487
  background-color: ${BACKGROUND_GRAY_COLOR};
60423
- padding-left: ${48}px;
60488
+ padding-left: ${HEADER_WIDTH}px;
60424
60489
  font-size: 15px;
60425
60490
  border-top: 1px solid lightgrey;
60426
60491
 
@@ -60920,16 +60985,16 @@ stores.inject(MyMetaStore, storeInstance);
60920
60985
  const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
60921
60986
  const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
60922
60987
  let groupHeaderY = 0;
60923
- let groupHeaderHeight = 26;
60988
+ let groupHeaderHeight = HEADER_HEIGHT;
60924
60989
  if (startRow !== 0) {
60925
60990
  const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
60926
- groupHeaderY = 26 + headerRowDims.start;
60991
+ groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
60927
60992
  groupHeaderHeight = headerRowDims.end - headerRowDims.start;
60928
60993
  }
60929
60994
  const headerRect = {
60930
60995
  x: this.props.layerOffset,
60931
60996
  y: groupHeaderY,
60932
- width: 21,
60997
+ width: GROUP_LAYER_WIDTH,
60933
60998
  height: groupHeaderHeight
60934
60999
  };
60935
61000
  return {
@@ -60937,7 +61002,7 @@ stores.inject(MyMetaStore, storeInstance);
60937
61002
  groupRect: {
60938
61003
  x: this.props.layerOffset,
60939
61004
  y: headerRect.y,
60940
- width: 21,
61005
+ width: GROUP_LAYER_WIDTH,
60941
61006
  height: headerRect.height + (endCoordinates - startCoordinates)
60942
61007
  },
60943
61008
  isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
@@ -60970,17 +61035,17 @@ stores.inject(MyMetaStore, storeInstance);
60970
61035
  const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
60971
61036
  const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
60972
61037
  let groupHeaderX = 0;
60973
- let groupHeaderWidth = 48;
61038
+ let groupHeaderWidth = HEADER_WIDTH;
60974
61039
  if (startCol !== 0) {
60975
61040
  const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
60976
- groupHeaderX = 48 + headerRowDims.start;
61041
+ groupHeaderX = HEADER_WIDTH + headerRowDims.start;
60977
61042
  groupHeaderWidth = headerRowDims.end - headerRowDims.start;
60978
61043
  }
60979
61044
  const headerRect = {
60980
61045
  x: groupHeaderX,
60981
61046
  y: this.props.layerOffset,
60982
61047
  width: groupHeaderWidth,
60983
- height: 21
61048
+ height: GROUP_LAYER_WIDTH
60984
61049
  };
60985
61050
  return {
60986
61051
  headerRect,
@@ -60988,7 +61053,7 @@ stores.inject(MyMetaStore, storeInstance);
60988
61053
  x: headerRect.x,
60989
61054
  y: this.props.layerOffset,
60990
61055
  width: headerRect.width + (endCoordinates - startCoordinates),
60991
- height: 21
61056
+ height: GROUP_LAYER_WIDTH
60992
61057
  },
60993
61058
  isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
60994
61059
  };
@@ -61035,7 +61100,7 @@ stores.inject(MyMetaStore, storeInstance);
61035
61100
  menuItems: []
61036
61101
  });
61037
61102
  getLayerOffset(layerIndex) {
61038
- return layerIndex * 21;
61103
+ return layerIndex * GROUP_LAYER_WIDTH;
61039
61104
  }
61040
61105
  onContextMenu(event) {
61041
61106
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -61079,8 +61144,8 @@ stores.inject(MyMetaStore, storeInstance);
61079
61144
  get frozenPaneContainerSize() {
61080
61145
  if (!this.hasFrozenPane) return 0;
61081
61146
  const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
61082
- if (this.props.dimension === "COL") return 48 + viewportCoordinates.x;
61083
- else return 26 + viewportCoordinates.y;
61147
+ if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
61148
+ else return HEADER_HEIGHT + viewportCoordinates.y;
61084
61149
  }
61085
61150
  };
61086
61151
 
@@ -61599,7 +61664,7 @@ stores.inject(MyMetaStore, storeInstance);
61599
61664
  "max-height": `${COMPOSER_MAX_HEIGHT}px`,
61600
61665
  "line-height": "24px"
61601
61666
  };
61602
- style.height = this.focus === "inactive" ? `${34}px` : "fit-content";
61667
+ style.height = this.focus === "inactive" ? `${TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
61603
61668
  return cssPropertiesToCss(style);
61604
61669
  }
61605
61670
  get containerStyle() {
@@ -61807,7 +61872,7 @@ stores.inject(MyMetaStore, storeInstance);
61807
61872
 
61808
61873
  /* Toolbar */
61809
61874
  .o-topbar-toolbar {
61810
- height: ${34}px;
61875
+ height: ${TOPBAR_TOOLBAR_HEIGHT}px;
61811
61876
 
61812
61877
  .o-readonly-toolbar {
61813
61878
  background-color: ${BACKGROUND_HEADER_COLOR};
@@ -62074,9 +62139,9 @@ stores.inject(MyMetaStore, storeInstance);
62074
62139
  direction: ltr;
62075
62140
  }
62076
62141
  .o-separator {
62077
- border-bottom: ${1}px solid ${SEPARATOR_COLOR};
62078
- margin-top: ${5}px;
62079
- margin-bottom: ${5}px;
62142
+ border-bottom: ${MENU_SEPARATOR_BORDER_WIDTH}px solid ${SEPARATOR_COLOR};
62143
+ margin-top: ${MENU_SEPARATOR_PADDING}px;
62144
+ margin-bottom: ${MENU_SEPARATOR_PADDING}px;
62080
62145
  }
62081
62146
  .o-hoverable-button {
62082
62147
  border-radius: 2px;
@@ -62203,8 +62268,8 @@ stores.inject(MyMetaStore, storeInstance);
62203
62268
  &.corner {
62204
62269
  right: 0px;
62205
62270
  bottom: 0px;
62206
- height: ${15}px;
62207
- width: ${15}px;
62271
+ height: ${SCROLLBAR_WIDTH}px;
62272
+ width: ${SCROLLBAR_WIDTH}px;
62208
62273
  border-top: 1px solid #e2e3e3;
62209
62274
  border-left: 1px solid #e2e3e3;
62210
62275
  }
@@ -62330,7 +62395,7 @@ stores.inject(MyMetaStore, storeInstance);
62330
62395
  getStyle() {
62331
62396
  const properties = {};
62332
62397
  if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
62333
- else properties["grid-template-rows"] = `${63}px auto ${36 + 1}px`;
62398
+ else properties["grid-template-rows"] = `${TOPBAR_HEIGHT}px auto ${BOTTOMBAR_HEIGHT + 1}px`;
62334
62399
  properties["grid-template-columns"] = `auto ${this.sidePanel.panelSize}px`;
62335
62400
  return cssPropertiesToCss(properties);
62336
62401
  }
@@ -62407,7 +62472,7 @@ stores.inject(MyMetaStore, storeInstance);
62407
62472
  checkViewportSize() {
62408
62473
  const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
62409
62474
  if (!isFinite(xRatio) || !isFinite(yRatio)) return;
62410
- if (yRatio > .85 || xRatio > .85) {
62475
+ if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
62411
62476
  if (this.isViewportTooSmall) return;
62412
62477
  this.notificationStore.notifyUser({
62413
62478
  text: _t("The current window is too small to display this sheet properly. Consider resizing your browser window or adjusting frozen rows and columns."),
@@ -62438,8 +62503,8 @@ stores.inject(MyMetaStore, storeInstance);
62438
62503
  return height;
62439
62504
  }
62440
62505
  get gridContainerStyle() {
62441
- const gridColSize = 21 * this.rowLayers.length;
62442
- const gridRowSize = 21 * this.colLayers.length;
62506
+ const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
62507
+ const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
62443
62508
  return cssPropertiesToCss({
62444
62509
  "grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
62445
62510
  "grid-template-rows": `${gridRowSize ? gridRowSize + 2 : 0}px auto`
@@ -63975,7 +64040,7 @@ stores.inject(MyMetaStore, storeInstance);
63975
64040
  const color = chart.data.title.color ? toXlsxHexColor(chart.data.title.color) : chart.data.fontColor;
63976
64041
  title = escapeXml`
63977
64042
  <c:title>
63978
- ${insertText(chart.data.title.text, color, 22, chart.data.title)}
64043
+ ${insertText(chart.data.title.text, color, DEFAULT_CHART_FONT_SIZE, chart.data.title)}
63979
64044
  <c:overlay val="0" />
63980
64045
  </c:title>
63981
64046
  `;
@@ -64059,7 +64124,7 @@ stores.inject(MyMetaStore, storeInstance);
64059
64124
  </a:ln>
64060
64125
  `;
64061
64126
  }
64062
- function insertText(text, fontColor = "000000", fontsize = 22, style = {}) {
64127
+ function insertText(text, fontColor = "000000", fontsize = DEFAULT_CHART_FONT_SIZE, style = {}) {
64063
64128
  return escapeXml`
64064
64129
  <c:tx>
64065
64130
  <c:rich>
@@ -65011,12 +65076,12 @@ stores.inject(MyMetaStore, storeInstance);
65011
65076
  let currentPosition = 0;
65012
65077
  for (const [headerIndex, header] of headers.entries()) if (currentPosition <= position && position < currentPosition + header.size) return {
65013
65078
  index: headerIndex,
65014
- offset: convertDotValueToEMU(position - currentPosition + 1)
65079
+ offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH)
65015
65080
  };
65016
65081
  else if (headerIndex < headers.length - 1) currentPosition += header.size;
65017
65082
  return {
65018
65083
  index: headers.length - 1,
65019
- offset: convertDotValueToEMU(position - currentPosition + 1)
65084
+ offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH)
65020
65085
  };
65021
65086
  }
65022
65087
  function createChartDrawing(figure, sheet, chartRelId) {
@@ -65115,7 +65180,7 @@ stores.inject(MyMetaStore, storeInstance);
65115
65180
  function addNumberFormats(numFmts) {
65116
65181
  const numFmtNodes = [];
65117
65182
  for (const [index, numFmt] of Object.entries(numFmts)) {
65118
- const numFmtAttrs = [["numFmtId", parseInt(index) + 164], ["formatCode", numFmt.format]];
65183
+ const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
65119
65184
  numFmtNodes.push(escapeXml`
65120
65185
  <numFmt ${formatAttributes(numFmtAttrs)}/>
65121
65186
  `);
@@ -65347,7 +65412,7 @@ stores.inject(MyMetaStore, storeInstance);
65347
65412
  const attributes = [
65348
65413
  ["min", parseInt(id) + 1],
65349
65414
  ["max", parseInt(id) + 1],
65350
- ["width", convertWidthToExcel(col.size || 96)],
65415
+ ["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
65351
65416
  ["customWidth", 1],
65352
65417
  ["hidden", col.isHidden ? 1 : 0]
65353
65418
  ];
@@ -65368,7 +65433,7 @@ stores.inject(MyMetaStore, storeInstance);
65368
65433
  for (let r = 0; r < sheet.rowNumber; r++) {
65369
65434
  const rowAttrs = [["r", r + 1]];
65370
65435
  const row = sheet.rows[r] || {};
65371
- if (row.size && row.size !== 23) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
65436
+ if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
65372
65437
  if (row.isHidden) rowAttrs.push(["hidden", 1]);
65373
65438
  if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
65374
65439
  if (row.collapsed) rowAttrs.push(["collapsed", 1]);
@@ -65401,7 +65466,7 @@ stores.inject(MyMetaStore, storeInstance);
65401
65466
  </c>`);
65402
65467
  }
65403
65468
  }
65404
- if (cellNodes.length || row.size !== 23 || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
65469
+ if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
65405
65470
  <row ${formatAttributes(rowAttrs)}>
65406
65471
  ${joinXmlNodes(cellNodes)}
65407
65472
  </row>
@@ -65574,7 +65639,7 @@ stores.inject(MyMetaStore, storeInstance);
65574
65639
  let currentTableIndex = 1;
65575
65640
  for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
65576
65641
  const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
65577
- const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(23)], ["defaultColWidth", convertWidthToExcel(96)]];
65642
+ const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
65578
65643
  const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
65579
65644
  currentTableIndex += sheet.tables.length;
65580
65645
  let drawingNode = escapeXml``;
@@ -66202,7 +66267,7 @@ stores.inject(MyMetaStore, storeInstance);
66202
66267
  exportData() {
66203
66268
  let data = createEmptyWorkbookData();
66204
66269
  for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data);
66205
- data.revisionId = this.session.getRevisionId() || "START_REVISION";
66270
+ data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
66206
66271
  data = deepCopy(data);
66207
66272
  return data;
66208
66273
  }
@@ -66246,15 +66311,15 @@ stores.inject(MyMetaStore, storeInstance);
66246
66311
  */
66247
66312
  const __info__ = {};
66248
66313
  const SPREADSHEET_DIMENSIONS = {
66249
- MIN_ROW_HEIGHT: 10,
66250
- MIN_COL_WIDTH: 5,
66251
- HEADER_HEIGHT: 26,
66252
- HEADER_WIDTH: 48,
66253
- TOPBAR_HEIGHT: 63,
66254
- BOTTOMBAR_HEIGHT: 36,
66255
- DEFAULT_CELL_WIDTH: 96,
66256
- DEFAULT_CELL_HEIGHT: 23,
66257
- SCROLLBAR_WIDTH: 15
66314
+ MIN_ROW_HEIGHT,
66315
+ MIN_COL_WIDTH,
66316
+ HEADER_HEIGHT,
66317
+ HEADER_WIDTH,
66318
+ TOPBAR_HEIGHT,
66319
+ BOTTOMBAR_HEIGHT,
66320
+ DEFAULT_CELL_WIDTH,
66321
+ DEFAULT_CELL_HEIGHT,
66322
+ SCROLLBAR_WIDTH
66258
66323
  };
66259
66324
  const registries = {
66260
66325
  autoCompleteProviders,
@@ -66339,6 +66404,7 @@ stores.inject(MyMetaStore, storeInstance);
66339
66404
  overlap,
66340
66405
  union,
66341
66406
  isInside,
66407
+ addStyleToWorkbookData,
66342
66408
  deepCopy,
66343
66409
  expandZoneOnInsertion,
66344
66410
  reduceZoneOnDeletion,
@@ -66446,7 +66512,7 @@ stores.inject(MyMetaStore, storeInstance);
66446
66512
  DEFAULT_LOCALE,
66447
66513
  HIGHLIGHT_COLOR,
66448
66514
  PIVOT_TABLE_CONFIG,
66449
- TREND_LINE_XAXIS_ID: "x1",
66515
+ TREND_LINE_XAXIS_ID,
66450
66516
  CHART_AXIS_CHOICES,
66451
66517
  ChartTerms
66452
66518
  };
@@ -66498,8 +66564,8 @@ exports.stores = stores;
66498
66564
  exports.tokenColors = tokenColors;
66499
66565
  exports.tokenize = tokenize;
66500
66566
 
66501
- __info__.version = "18.0.82";
66502
- __info__.date = "2026-09-10T05:35:40.438Z";
66503
- __info__.hash = "d0329aa";
66567
+ __info__.version = "18.0.84";
66568
+ __info__.date = "2026-10-14T06:49:38.664Z";
66569
+ __info__.hash = "56a1fca";
66504
66570
 
66505
66571
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);