@odoo/o-spreadsheet 19.1.36 → 19.1.37

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 19.1.36
6
- * @date 2026-09-18T05:25:25.806Z
7
- * @hash 5661311
5
+ * @version 19.1.37
6
+ * @date 2026-10-01T07:46:03.212Z
7
+ * @hash fe8ce23
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -226,12 +226,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
226
226
  const TEXT_BODY = "#374151";
227
227
  const TEXT_BODY_MUTED = "#374151C2";
228
228
  const ACTION_COLOR = HIGHLIGHT_COLOR;
229
+ const CHART_PADDING = 20;
230
+ const CHART_PADDING_BOTTOM = 10;
231
+ const CHART_PADDING_TOP = 15;
229
232
  const CHART_TITLE_FONT_SIZE = 16;
233
+ const CHART_AXIS_TITLE_FONT_SIZE = 12;
234
+ const MASTER_CHART_HEIGHT = 60;
235
+ const CHART_COLORSCALE_WIDTH = 70;
230
236
  const DEFAULT_CHART_COLOR_SCALE = {
231
237
  minColor: "#FFF5EB",
232
238
  midColor: "#FD8D3C",
233
239
  maxColor: "#7F2704"
234
240
  };
241
+ const SCORECARD_CHART_TITLE_FONT_SIZE = 14;
235
242
  const PIVOT_TOKEN_COLOR = "#F28C28";
236
243
  const COLOR_PICKER_DEFAULTS = [
237
244
  "#000000",
@@ -315,8 +322,30 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
315
322
  "#20124D",
316
323
  "#4C1130"
317
324
  ];
325
+ const MIN_ROW_HEIGHT = 10;
326
+ const MIN_COL_WIDTH = 5;
327
+ const HEADER_HEIGHT = 26;
328
+ const HEADER_WIDTH = 48;
329
+ const DESKTOP_TOPBAR_TOOLBAR_HEIGHT = 34;
330
+ const DESKTOP_BOTTOMBAR_HEIGHT = 36;
331
+ const DEFAULT_CELL_WIDTH = 96;
318
332
  const DEFAULT_CELL_HEIGHT = 23;
319
- const FOOTER_HEIGHT = 2 * 23;
333
+ const SCROLLBAR_WIDTH = 15;
334
+ const AUTOFILL_EDGE_LENGTH = 8;
335
+ const ICON_EDGE_LENGTH = 18;
336
+ const MIN_CF_ICON_MARGIN = 4;
337
+ const MIN_CELL_TEXT_MARGIN = 4;
338
+ const PADDING_AUTORESIZE_VERTICAL = 3;
339
+ const PADDING_AUTORESIZE_HORIZONTAL = MIN_CELL_TEXT_MARGIN;
340
+ const GROUP_LAYER_WIDTH = 21;
341
+ const GRID_ICON_MARGIN = 2;
342
+ const GRID_ICON_EDGE_LENGTH = 17;
343
+ const FOOTER_HEIGHT = 2 * DEFAULT_CELL_HEIGHT;
344
+ const DATA_VALIDATION_CHIP_MARGIN = 5;
345
+ const MOBILE_WIDTH_BREAKPOINT = 768;
346
+ const MENU_WIDTH = 250;
347
+ const MENU_VERTICAL_PADDING = 6;
348
+ const DESKTOP_MENU_ITEM_HEIGHT = 26;
320
349
  const ZOOM_VALUES = [
321
350
  50,
322
351
  75,
@@ -341,20 +370,35 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
341
370
  const ROTATION_EPSILON = .001;
342
371
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
343
372
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
373
+ const DEFAULT_FONT_WEIGHT = "400";
344
374
  const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
375
+ const HEADER_FONT_SIZE = 11;
345
376
  const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
346
377
  const DEFAULT_BORDER_DESC = {
347
378
  style: "thin",
348
379
  color: "#000000"
349
380
  };
381
+ const MAX_HISTORY_STEPS = 99;
350
382
  const DEFAULT_REVISION_ID = "START_REVISION";
383
+ const DEFAULT_FIGURE_HEIGHT = 335;
384
+ const DEFAULT_FIGURE_WIDTH = 536;
385
+ const FIGURE_BORDER_WIDTH = 1;
386
+ const MIN_FIG_SIZE = 80;
387
+ const MAX_CHAR_LABEL = 20;
388
+ const FIGURE_ID_SPLITTER = "??";
351
389
  const DEFAULT_GAUGE_LOWER_COLOR = "#EA6175";
352
390
  const DEFAULT_GAUGE_MIDDLE_COLOR = "#FFD86D";
353
391
  const DEFAULT_GAUGE_UPPER_COLOR = "#43C5B1";
354
392
  const DEFAULT_SCORECARD_BASELINE_MODE = "difference";
355
393
  const DEFAULT_SCORECARD_BASELINE_COLOR_UP = "#43C5B1";
356
394
  const DEFAULT_SCORECARD_BASELINE_COLOR_DOWN = "#EA6175";
395
+ const DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE = 32;
396
+ const DEFAULT_SCORECARD_BASELINE_FONT_SIZE = 16;
357
397
  const LINE_FILL_TRANSPARENCY = .4;
398
+ const LINE_DATA_POINT_RADIUS = 3;
399
+ const DEFAULT_WINDOW_SIZE = 2;
400
+ const DEBOUNCE_TIME = 200;
401
+ const MESSAGE_VERSION = 1;
358
402
  const FORBIDDEN_SHEETNAME_CHARS = [
359
403
  "'",
360
404
  "*",
@@ -365,6 +409,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
365
409
  "]"
366
410
  ];
367
411
  const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
412
+ const FORMULA_REF_IDENTIFIER = "|";
368
413
  let DEFAULT_SHEETVIEW_SIZE = 0;
369
414
  function getDefaultSheetViewSize() {
370
415
  return DEFAULT_SHEETVIEW_SIZE;
@@ -373,6 +418,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
373
418
  DEFAULT_SHEETVIEW_SIZE = size;
374
419
  }
375
420
  const MAXIMAL_FREEZABLE_RATIO = .85;
421
+ const NEWLINE = "\n";
376
422
  const FONT_SIZES = [
377
423
  6,
378
424
  7,
@@ -397,6 +443,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
397
443
  styleId: "TableStyleMedium5",
398
444
  automaticAutofill: false
399
445
  };
446
+ const PIVOT_INDENT = 15;
447
+ const PIVOT_COLLAPSE_ICON_SIZE = 12;
400
448
  const PIVOT_MAX_NUMBER_OF_CELLS = 5e5;
401
449
  const DEFAULT_CURRENCY = {
402
450
  symbol: "$",
@@ -406,7 +454,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
406
454
  name: "Dollar"
407
455
  };
408
456
  const DEFAULT_CAROUSEL_TITLE_STYLE = {
409
- fontSize: 16,
457
+ fontSize: CHART_TITLE_FONT_SIZE,
410
458
  color: TEXT_BODY
411
459
  };
412
460
  const DEFAULT_TOKEN_COLOR = "light-dark(#000000, #ffffff)";
@@ -423,6 +471,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
423
471
  ARG_SEPARATOR: functionColor,
424
472
  ORPHAN_RIGHT_PAREN: "#ff0000"
425
473
  };
474
+ const DRAG_THRESHOLD = 5;
426
475
 
427
476
  //#endregion
428
477
  //#region src/helpers/misc.ts
@@ -779,7 +828,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
779
828
  */
780
829
  function replaceNewLines(text) {
781
830
  if (!text) return "";
782
- return text.replace(newLineRegexp, "\n");
831
+ return text.replace(newLineRegexp, NEWLINE);
783
832
  }
784
833
  /**
785
834
  * Determine if the numbers are consecutive.
@@ -1008,7 +1057,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1008
1057
  consumeSpaces(chars);
1009
1058
  const col = letterPart - 1;
1010
1059
  const row = num - 1;
1011
- if (!chars.isOver() || col > MAX_COL || row > 9999998) throw new Error(`Invalid cell description: ${xc}`);
1060
+ if (!chars.isOver() || col > MAX_COL || row > MAX_ROW) throw new Error(`Invalid cell description: ${xc}`);
1012
1061
  return {
1013
1062
  col,
1014
1063
  row
@@ -1419,7 +1468,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1419
1468
  const orderedZone = reorderZone(toZoneWithoutBoundaryChanges(xc));
1420
1469
  const bottom = orderedZone.bottom;
1421
1470
  const right = orderedZone.right;
1422
- if (bottom !== void 0 && bottom > 9999998 || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
1471
+ if (bottom !== void 0 && bottom > MAX_ROW || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
1423
1472
  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");
1424
1473
  return orderedZone;
1425
1474
  }
@@ -1580,7 +1629,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1580
1629
  return {
1581
1630
  top: Math.max(z1.top, z2.top),
1582
1631
  left: Math.max(z1.left, z2.left),
1583
- bottom: Math.min(z1.bottom ?? 9999998, z2.bottom),
1632
+ bottom: Math.min(z1.bottom ?? MAX_ROW, z2.bottom),
1584
1633
  right: Math.min(z1.right ?? MAX_COL, z2.right)
1585
1634
  };
1586
1635
  }
@@ -4550,7 +4599,7 @@ stores.inject(MyMetaStore, storeInstance);
4550
4599
  switch (token.type) {
4551
4600
  case "DIGIT":
4552
4601
  if (parsedPart === integerPart) parsedPart.push(token);
4553
- else if (numberOfDecimalsDigits < 20) {
4602
+ else if (numberOfDecimalsDigits < MAX_DECIMAL_PLACES) {
4554
4603
  parsedPart.push(token);
4555
4604
  numberOfDecimalsDigits++;
4556
4605
  }
@@ -4913,7 +4962,7 @@ stores.inject(MyMetaStore, storeInstance);
4913
4962
  * exceed in the decimal part, in which case digits are rounded.
4914
4963
  *
4915
4964
  **/
4916
- function splitNumber(value, maxDecimals = 20) {
4965
+ function splitNumber(value, maxDecimals = MAX_DECIMAL_PLACES) {
4917
4966
  const asString = value.toString();
4918
4967
  if (asString.includes("e")) return splitNumberIntl(value, maxDecimals);
4919
4968
  if (Number.isInteger(value)) return {
@@ -4982,7 +5031,7 @@ stores.inject(MyMetaStore, storeInstance);
4982
5031
  * Supports numbers with a lot of digits that are transformed to scientific notation by
4983
5032
  * number.toString(), but is slow.
4984
5033
  */
4985
- function splitNumberIntl(value, maxDecimals = 20) {
5034
+ function splitNumberIntl(value, maxDecimals = MAX_DECIMAL_PLACES) {
4986
5035
  let formatter = numberRepresentation[maxDecimals];
4987
5036
  if (!formatter) {
4988
5037
  formatter = new Intl.NumberFormat("en-US", {
@@ -6056,7 +6105,7 @@ stores.inject(MyMetaStore, storeInstance);
6056
6105
  * Returns a timeout delay in milliseconds.
6057
6106
  */
6058
6107
  function scrollDelay(value) {
6059
- return 20 + (140 - 20) * Math.exp(-.035 * (value - 1));
6108
+ return MIN_DELAY + (MAX_DELAY - MIN_DELAY) * Math.exp(-.035 * (value - 1));
6060
6109
  }
6061
6110
 
6062
6111
  //#endregion
@@ -6714,7 +6763,7 @@ stores.inject(MyMetaStore, storeInstance);
6714
6763
  //#endregion
6715
6764
  //#region src/helpers/text_helper.ts
6716
6765
  function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
6717
- return numberOfLines * (textLineHeight + 4) - 4;
6766
+ return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
6718
6767
  }
6719
6768
  function getCanvas(width = 100, height = 100) {
6720
6769
  return new OffscreenCanvas(width, height).getContext("2d");
@@ -6723,7 +6772,7 @@ stores.inject(MyMetaStore, storeInstance);
6723
6772
  * Get the default height of the cell given its style.
6724
6773
  */
6725
6774
  function getDefaultCellHeight(ctx, cell, style, locale, colSize) {
6726
- if (!cell || !cell.isFormula && !cell.content) return 23;
6775
+ if (!cell || !cell.isFormula && !cell.content) return DEFAULT_CELL_HEIGHT;
6727
6776
  let content = "";
6728
6777
  try {
6729
6778
  if (!cell.isFormula) {
@@ -6739,7 +6788,7 @@ stores.inject(MyMetaStore, storeInstance);
6739
6788
  return getCellContentHeight(ctx, content, style, colSize);
6740
6789
  }
6741
6790
  function getCellContentHeight(ctx, content, style, colSize) {
6742
- return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * 4 : void 0), style).height + 2 * 3;
6791
+ return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : void 0), style).height + 2 * PADDING_AUTORESIZE_VERTICAL;
6743
6792
  }
6744
6793
  function getDefaultContextFont(fontSize, bold = false, italic = false) {
6745
6794
  return `${italic ? "italic" : ""} ${bold ? "bold" : ""} ${fontSize}px ${DEFAULT_FONT}`;
@@ -6805,7 +6854,7 @@ stores.inject(MyMetaStore, storeInstance);
6805
6854
  return Math.round(fontSize * 96 / 72);
6806
6855
  }
6807
6856
  function computeTextFont(style, fontUnit = "pt") {
6808
- return `${style.italic ? "italic " : ""}${style.bold ? "bold" : "400"} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
6857
+ return `${style.italic ? "italic " : ""}${style.bold ? "bold" : DEFAULT_FONT_WEIGHT} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
6809
6858
  }
6810
6859
  function computeTextFontSizeInPixels(style) {
6811
6860
  return fontSizeInPixels(style?.fontSize || DEFAULT_FONT_SIZE);
@@ -6829,7 +6878,7 @@ stores.inject(MyMetaStore, storeInstance);
6829
6878
  if (!style) style = {};
6830
6879
  if (isMarkdownLink(text)) text = parseMarkdownLink(text).label;
6831
6880
  const brokenText = [];
6832
- const lines = text.includes("\n") ? text.split("\n") : [text];
6881
+ const lines = text.includes(NEWLINE) ? text.split(NEWLINE) : [text];
6833
6882
  for (const line of lines) {
6834
6883
  const words = line.includes(" ") ? line.split(" ") : [line];
6835
6884
  if (!width) {
@@ -6995,7 +7044,7 @@ stores.inject(MyMetaStore, storeInstance);
6995
7044
  let { x, y } = rect;
6996
7045
  const cos = Math.cos(-style.rotation);
6997
7046
  const sin = Math.sin(-style.rotation);
6998
- const width = rect.textWidth - 2 * 4;
7047
+ const width = rect.textWidth - 2 * MIN_CELL_TEXT_MARGIN;
6999
7048
  const height = rect.textHeight;
7000
7049
  const center = style.align === "center";
7001
7050
  const rotateTowardCellCenter = style.align === "left" === sin < 0;
@@ -7140,7 +7189,7 @@ stores.inject(MyMetaStore, storeInstance);
7140
7189
  ctx.miterLimit = 1;
7141
7190
  const gradientHeight = (chart.chartArea.bottom - chart.chartArea.top) / 2;
7142
7191
  const gradientWidth = 10;
7143
- const gradientX = options.position === "left" ? 20 : ctx.canvas.width - 70;
7192
+ const gradientX = options.position === "left" ? CHART_PADDING : ctx.canvas.width - CHART_COLORSCALE_WIDTH;
7144
7193
  const gradientY = chart.chartArea.top;
7145
7194
  const gradient = ctx.createLinearGradient(0, gradientY + gradientHeight, 0, gradientY);
7146
7195
  const step = 1 / (options.colorScale.length - 1);
@@ -7150,7 +7199,7 @@ stores.inject(MyMetaStore, storeInstance);
7150
7199
  ctx.fillStyle = gradient;
7151
7200
  ctx.fillRect(gradientX, gradientY, gradientWidth, gradientHeight);
7152
7201
  ctx.fillStyle = options.fontColor ?? "black";
7153
- ctx.font = getDefaultContextFont(12);
7202
+ ctx.font = getDefaultContextFont(CHART_AXIS_TITLE_FONT_SIZE);
7154
7203
  ctx.textAlign = "left";
7155
7204
  let minValue = Math.round(options.minValue * 100) / 100;
7156
7205
  let maxValue = Math.round(options.maxValue * 100) / 100;
@@ -7359,6 +7408,12 @@ stores.inject(MyMetaStore, storeInstance);
7359
7408
  const EXCEL_DEFAULT_COL_WIDTH = 8.43;
7360
7409
  /** unit : points */
7361
7410
  const EXCEL_DEFAULT_ROW_HEIGHT = 12.75;
7411
+ const EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS = 30;
7412
+ const EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS = 100;
7413
+ /** The possible values for the XLSX polynomial trendline order are defined by the ST_Order simple type (§21.2.3.29) */
7414
+ const MAX_XLSX_POLYNOMIAL_DEGREE = 6;
7415
+ const FIRST_NUMFMT_ID = 164;
7416
+ const DEFAULT_DOUGHNUT_CHART_HOLE_SIZE = 50;
7362
7417
  const FORCE_DEFAULT_ARGS_FUNCTIONS = {
7363
7418
  FLOOR: [{
7364
7419
  type: "NUMBER",
@@ -7582,11 +7637,11 @@ stores.inject(MyMetaStore, storeInstance);
7582
7637
  return result;
7583
7638
  }
7584
7639
  function tokenizeDebugger(chars) {
7585
- if (chars.current === "?") {
7640
+ if (chars.current === DEBUGGER_CHAR) {
7586
7641
  chars.shift();
7587
7642
  return {
7588
7643
  type: "DEBUGGER",
7589
- value: "?"
7644
+ value: DEBUGGER_CHAR
7590
7645
  };
7591
7646
  }
7592
7647
  return null;
@@ -7745,13 +7800,13 @@ stores.inject(MyMetaStore, storeInstance);
7745
7800
  }
7746
7801
  function tokenizeNewLine(chars) {
7747
7802
  let length = 0;
7748
- while (chars.current === "\n") {
7803
+ while (chars.current === NEWLINE) {
7749
7804
  length++;
7750
7805
  chars.shift();
7751
7806
  }
7752
7807
  if (length) return {
7753
7808
  type: "SPACE",
7754
- value: "\n".repeat(length)
7809
+ value: NEWLINE.repeat(length)
7755
7810
  };
7756
7811
  return null;
7757
7812
  }
@@ -8093,8 +8148,8 @@ stores.inject(MyMetaStore, storeInstance);
8093
8148
  if (ds.trend?.type) trend = {
8094
8149
  type: ds.trend.type === "polynomial" && ds.trend.order === 1 ? "linear" : SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING[ds.trend.type],
8095
8150
  color: ds.trend.color,
8096
- order: ds.trend.order ? Math.min(ds.trend.order, 6) : void 0,
8097
- window: ds.trend.window || 2
8151
+ order: ds.trend.order ? Math.min(ds.trend.order, MAX_XLSX_POLYNOMIAL_DEGREE) : void 0,
8152
+ window: ds.trend.window || DEFAULT_WINDOW_SIZE
8098
8153
  };
8099
8154
  return {
8100
8155
  label,
@@ -8231,13 +8286,13 @@ stores.inject(MyMetaStore, storeInstance);
8231
8286
  for (let i = 0; i <= maxLength; i++) pieColors.push(colors.next());
8232
8287
  return pieColors;
8233
8288
  }
8234
- function truncateLabel(label, maxLen = 20) {
8289
+ function truncateLabel(label, maxLen = MAX_CHAR_LABEL) {
8235
8290
  if (!label) return "";
8236
8291
  if (label.length > maxLen) return label.substring(0, maxLen) + "…";
8237
8292
  return label;
8238
8293
  }
8239
8294
  function isTrendLineAxis(axisID) {
8240
- return axisID === "x1" || axisID === "xMovingAverage";
8295
+ return axisID === TREND_LINE_XAXIS_ID || axisID === MOVING_AVERAGE_TREND_LINE_XAXIS_ID;
8241
8296
  }
8242
8297
 
8243
8298
  //#endregion
@@ -8543,7 +8598,7 @@ stores.inject(MyMetaStore, storeInstance);
8543
8598
  scales = removeFalsyAttributes(scales);
8544
8599
  if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
8545
8600
  const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
8546
- scales["x1"] = {
8601
+ scales[TREND_LINE_XAXIS_ID] = {
8547
8602
  ...scales.x,
8548
8603
  labels: Array(maxLength).fill(""),
8549
8604
  offset: false,
@@ -8646,7 +8701,7 @@ stores.inject(MyMetaStore, storeInstance);
8646
8701
  });
8647
8702
  }
8648
8703
  if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
8649
- scales["x1"] = {
8704
+ scales[TREND_LINE_XAXIS_ID] = {
8650
8705
  ...scales.x,
8651
8706
  display: false
8652
8707
  };
@@ -8656,9 +8711,9 @@ stores.inject(MyMetaStore, storeInstance);
8656
8711
  };
8657
8712
  if (axisType === "category" || axisType === "time") {
8658
8713
  const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
8659
- scales["x1"]["type"] = "category";
8660
- scales["x1"]["labels"] = range(0, maxLength).map((x) => x.toString());
8661
- scales["x1"]["offset"] = false;
8714
+ scales[TREND_LINE_XAXIS_ID]["type"] = "category";
8715
+ scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
8716
+ scales[TREND_LINE_XAXIS_ID]["offset"] = false;
8662
8717
  scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["type"] = "category";
8663
8718
  scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["offset"] = false;
8664
8719
  }
@@ -8803,7 +8858,7 @@ stores.inject(MyMetaStore, storeInstance);
8803
8858
  font: {
8804
8859
  style: italic ? "italic" : "normal",
8805
8860
  weight: bold ? "bold" : "normal",
8806
- size: design.title.fontSize ?? 12
8861
+ size: design.title.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE
8807
8862
  },
8808
8863
  align: align === "left" ? "start" : align === "right" ? "end" : "center"
8809
8864
  };
@@ -8866,16 +8921,16 @@ stores.inject(MyMetaStore, storeInstance);
8866
8921
  switch (definition.legendPosition) {
8867
8922
  case "top":
8868
8923
  case "right": return {
8869
- top: !!definition.title.text ? 15 + 30 : 15,
8870
- left: 20,
8871
- right: 20
8924
+ top: !!definition.title.text ? CHART_PADDING_TOP + 30 : CHART_PADDING_TOP,
8925
+ left: CHART_PADDING,
8926
+ right: CHART_PADDING
8872
8927
  };
8873
8928
  case "bottom":
8874
8929
  case "left":
8875
8930
  case "none": return {
8876
- left: 20,
8877
- right: 20,
8878
- bottom: 10
8931
+ left: CHART_PADDING,
8932
+ right: CHART_PADDING,
8933
+ bottom: CHART_PADDING_BOTTOM
8879
8934
  };
8880
8935
  }
8881
8936
  }
@@ -8905,7 +8960,7 @@ stores.inject(MyMetaStore, storeInstance);
8905
8960
  label,
8906
8961
  data,
8907
8962
  hidden,
8908
- borderColor: definition.background || "#FFFFFF",
8963
+ borderColor: definition.background || BACKGROUND_CHART_COLOR,
8909
8964
  borderWidth: definition.stacked ? 1 : 0,
8910
8965
  backgroundColor,
8911
8966
  yAxisID: definition.horizontal ? "y" : definition.dataSets?.[index].yAxisId || "y",
@@ -8933,8 +8988,8 @@ stores.inject(MyMetaStore, storeInstance);
8933
8988
  for (const dataSetValues of dataSetsValues) dataSets.push({
8934
8989
  label: dataSetValues.label,
8935
8990
  data: dataSetValues.data.map((v) => 1),
8936
- backgroundColor: dataSetValues.data.map((v) => v !== void 0 ? colorMap(v) : definition.missingValueColor || "#00000000"),
8937
- borderColor: definition.background || "#FFFFFF",
8991
+ backgroundColor: dataSetValues.data.map((v) => v !== void 0 ? colorMap(v) : definition.missingValueColor || COLOR_TRANSPARENT),
8992
+ borderColor: definition.background || BACKGROUND_CHART_COLOR,
8938
8993
  borderSkipped: false,
8939
8994
  borderWidth: 1,
8940
8995
  barPercentage: 1,
@@ -8948,9 +9003,9 @@ stores.inject(MyMetaStore, storeInstance);
8948
9003
  }
8949
9004
  function getWaterfallDatasetAndLabels(definition, args) {
8950
9005
  const { dataSetsValues, labels } = args;
8951
- const negativeColor = definition.negativeValuesColor || "#EA6175";
8952
- const positiveColor = definition.positiveValuesColor || "#4EA7F2";
8953
- const subTotalColor = definition.subTotalValuesColor || "#AAAAAA";
9006
+ const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
9007
+ const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
9008
+ const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
8954
9009
  const backgroundColor = [];
8955
9010
  const datasetValues = [];
8956
9011
  const dataset = {
@@ -9011,7 +9066,7 @@ stores.inject(MyMetaStore, storeInstance);
9011
9066
  backgroundColor: areaChart ? setColorAlpha(color, LINE_FILL_TRANSPARENCY) : color,
9012
9067
  pointBackgroundColor: color,
9013
9068
  fill: areaChart ? getFillingMode(index, stackedChart) : false,
9014
- pointRadius: definition.hideDataMarkers ? 0 : 3,
9069
+ pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS,
9015
9070
  yAxisID: definition.dataSets?.[index].yAxisId || "y"
9016
9071
  };
9017
9072
  dataSets.push(dataset);
@@ -9067,7 +9122,7 @@ stores.inject(MyMetaStore, storeInstance);
9067
9122
  xAxisID: "x",
9068
9123
  type,
9069
9124
  order: type === "bar" ? dataSetsValues.length + index : index,
9070
- pointRadius: definition.hideDataMarkers ? 0 : 3
9125
+ pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
9071
9126
  };
9072
9127
  if (dataset.type === "bar") {
9073
9128
  dataset.barPercentage = .9;
@@ -9099,7 +9154,7 @@ stores.inject(MyMetaStore, storeInstance);
9099
9154
  borderColor,
9100
9155
  backgroundColor: borderColor,
9101
9156
  pointBackgroundColor: borderColor,
9102
- pointRadius: definition.hideDataMarkers ? 0 : 3
9157
+ pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
9103
9158
  };
9104
9159
  if (fill) {
9105
9160
  dataset.backgroundColor = setColorAlpha(borderColor, LINE_FILL_TRANSPARENCY);
@@ -9155,7 +9210,7 @@ stores.inject(MyMetaStore, storeInstance);
9155
9210
  xAxisID: "x",
9156
9211
  barPercentage: 1,
9157
9212
  categoryPercentage: 1,
9158
- borderColor: definition.background || "#FFFFFF",
9213
+ borderColor: definition.background || BACKGROUND_CHART_COLOR,
9159
9214
  borderWidth: 3
9160
9215
  }];
9161
9216
  }
@@ -9180,12 +9235,12 @@ stores.inject(MyMetaStore, storeInstance);
9180
9235
  data: data[i],
9181
9236
  borderColor: (ctx) => {
9182
9237
  const data = ctx.type === "data" ? ctx.raw : void 0;
9183
- if (!data || data.label === "nullValue") return COLOR_TRANSPARENT;
9184
- return definition.background || "#FFFFFF";
9238
+ if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
9239
+ return definition.background || BACKGROUND_CHART_COLOR;
9185
9240
  },
9186
9241
  backgroundColor: (ctx) => {
9187
9242
  const data = ctx.type === "data" ? ctx.raw : void 0;
9188
- if (!data || data.label === "nullValue") return COLOR_TRANSPARENT;
9243
+ if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
9189
9244
  const rootGroup = data.groups[0];
9190
9245
  return groupColors.find((groupColor) => groupColor.label === rootGroup)?.color;
9191
9246
  },
@@ -9325,7 +9380,7 @@ stores.inject(MyMetaStore, storeInstance);
9325
9380
  const borderColor = config.color || lightenColor(rgbaToHex(defaultBorderColor), .5);
9326
9381
  return {
9327
9382
  type: "line",
9328
- xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID : "x1",
9383
+ xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID : TREND_LINE_XAXIS_ID,
9329
9384
  yAxisID: dataset.yAxisID,
9330
9385
  label: dataset.label ? _t("Trend line for %s", dataset.label) : "",
9331
9386
  data,
@@ -9436,7 +9491,7 @@ stores.inject(MyMetaStore, storeInstance);
9436
9491
  for (const metaSet of chart.getSortedVisibleDatasetMetas()) for (const arcElement of metaSet.data) {
9437
9492
  const context = arcElement["$context"];
9438
9493
  const { datasetIndex, index, dataset, raw } = context;
9439
- if (raw.label === "nullValue") continue;
9494
+ if (raw.label === GHOST_SUNBURST_VALUE) continue;
9440
9495
  const originalBackgroundColor = typeof dataset.backgroundColor === "function" ? dataset.backgroundColor(context) : dataset.backgroundColor;
9441
9496
  if (activeDataPoints.length && !activeDataPoints.some((el) => el.datasetIndex === datasetIndex && el.index === index)) arcElement.options.backgroundColor = lightenColor(originalBackgroundColor, .5);
9442
9497
  else arcElement.options.backgroundColor = originalBackgroundColor;
@@ -9464,7 +9519,7 @@ stores.inject(MyMetaStore, storeInstance);
9464
9519
  const lineHeight = fontSize + Y_PADDING;
9465
9520
  for (const dataset of chart._metasets) for (let i = 0; i < dataset._dataset.data.length; i++) {
9466
9521
  const rawData = dataset._dataset.data[i];
9467
- if (rawData.label === "nullValue") continue;
9522
+ if (rawData.label === GHOST_SUNBURST_VALUE) continue;
9468
9523
  const valuesToDisplay = [options.showLabels ? rawData.label : void 0, options.showValues ? options.callback(rawData.value, "y") : void 0].filter(isDefined);
9469
9524
  const arc = dataset.data[i];
9470
9525
  let { startAngle, endAngle, innerRadius, outerRadius, circumference } = arc;
@@ -9864,8 +9919,8 @@ stores.inject(MyMetaStore, storeInstance);
9864
9919
  this.baselineMode = definition.baselineMode;
9865
9920
  this.baselineDescr = definition.baselineDescr;
9866
9921
  this.background = definition.background;
9867
- this.baselineColorUp = definition.baselineColorUp ?? "#43C5B1";
9868
- this.baselineColorDown = definition.baselineColorDown ?? "#EA6175";
9922
+ this.baselineColorUp = definition.baselineColorUp ?? DEFAULT_SCORECARD_BASELINE_COLOR_UP;
9923
+ this.baselineColorDown = definition.baselineColorDown ?? DEFAULT_SCORECARD_BASELINE_COLOR_DOWN;
9869
9924
  this.humanize = definition.humanize ?? true;
9870
9925
  }
9871
9926
  static validateChartDefinition(validator, definition) {
@@ -9949,7 +10004,7 @@ stores.inject(MyMetaStore, storeInstance);
9949
10004
  canvas.width = dpr * structure.canvas.width * zoom;
9950
10005
  canvas.height = dpr * structure.canvas.height * zoom;
9951
10006
  ctx.scale(dpr * zoom, dpr * zoom);
9952
- const availableWidth = structure.canvas.width - 20;
10007
+ const availableWidth = structure.canvas.width - CHART_PADDING;
9953
10008
  ctx.fillStyle = structure.canvas.backgroundColor;
9954
10009
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
9955
10010
  if (structure.title) {
@@ -10128,16 +10183,16 @@ stores.inject(MyMetaStore, storeInstance);
10128
10183
  x = (this.width - titleWidth) / 2;
10129
10184
  break;
10130
10185
  case "right":
10131
- x = this.width - titleWidth - 20;
10186
+ x = this.width - titleWidth - CHART_PADDING;
10132
10187
  break;
10133
- default: x = 20;
10188
+ default: x = CHART_PADDING;
10134
10189
  }
10135
10190
  structure.title = {
10136
10191
  text: this.title,
10137
10192
  style: style.title,
10138
10193
  position: {
10139
10194
  x,
10140
- y: 10 + titleHeight / 2
10195
+ y: CHART_PADDING_BOTTOM + titleHeight / 2
10141
10196
  }
10142
10197
  };
10143
10198
  }
@@ -10148,10 +10203,10 @@ stores.inject(MyMetaStore, storeInstance);
10148
10203
  let baselineX;
10149
10204
  switch (this.runtime.baselineStyle?.align) {
10150
10205
  case "right":
10151
- baselineX = this.width - 20 - baselineDescrWidth - baselineWidth;
10206
+ baselineX = this.width - CHART_PADDING - baselineDescrWidth - baselineWidth;
10152
10207
  break;
10153
10208
  case "left":
10154
- baselineX = 20 + baselineArrowSize;
10209
+ baselineX = CHART_PADDING + baselineArrowSize;
10155
10210
  break;
10156
10211
  default: baselineX = (this.width - baselineWidth - baselineDescrWidth + baselineArrowSize) / 2;
10157
10212
  }
@@ -10161,7 +10216,7 @@ stores.inject(MyMetaStore, storeInstance);
10161
10216
  style: style.baselineValue,
10162
10217
  position: {
10163
10218
  x: baselineX,
10164
- y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - 10
10219
+ y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING_BOTTOM
10165
10220
  }
10166
10221
  };
10167
10222
  if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
@@ -10189,12 +10244,12 @@ stores.inject(MyMetaStore, storeInstance);
10189
10244
  progressBarHeight = this.height * .05;
10190
10245
  structure.progressBar = {
10191
10246
  position: {
10192
- x: 2 * 20,
10247
+ x: 2 * CHART_PADDING,
10193
10248
  y: this.height * (1 - 2 * BOTTOM_PADDING_RATIO) - baselineHeight - progressBarHeight
10194
10249
  },
10195
10250
  dimension: {
10196
10251
  height: progressBarHeight,
10197
- width: this.width - 4 * 20
10252
+ width: this.width - 4 * CHART_PADDING
10198
10253
  },
10199
10254
  value: this.runtime.progressBar.value,
10200
10255
  style: {
@@ -10208,10 +10263,10 @@ stores.inject(MyMetaStore, storeInstance);
10208
10263
  let keyX;
10209
10264
  switch (this.runtime.keyValueStyle?.align) {
10210
10265
  case "right":
10211
- keyX = this.width - 20 - keyDescrWidth - keyWidth;
10266
+ keyX = this.width - CHART_PADDING - keyDescrWidth - keyWidth;
10212
10267
  break;
10213
10268
  case "left":
10214
- keyX = 20;
10269
+ keyX = CHART_PADDING;
10215
10270
  break;
10216
10271
  default: keyX = (this.width - keyWidth - keyDescrWidth) / 2;
10217
10272
  }
@@ -10219,8 +10274,8 @@ stores.inject(MyMetaStore, storeInstance);
10219
10274
  text: this.keyValue,
10220
10275
  style: style.keyValue,
10221
10276
  position: {
10222
- x: Math.max(20, keyX),
10223
- y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) + 10 / 2 + (titleHeight + keyHeight / 2) / 2
10277
+ x: Math.max(CHART_PADDING, keyX),
10278
+ y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) + CHART_PADDING_BOTTOM / 2 + (titleHeight + keyHeight / 2) / 2
10224
10279
  }
10225
10280
  };
10226
10281
  if (structure.key && this.keyDescr) {
@@ -10277,14 +10332,14 @@ stores.inject(MyMetaStore, storeInstance);
10277
10332
  };
10278
10333
  }
10279
10334
  getTextStyles() {
10280
- const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ?? 32;
10335
+ const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ?? DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE;
10281
10336
  const keyValueDescrFontSize = Math.floor(.9 * keyValueFontSize);
10282
- let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ?? 16;
10337
+ let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ?? DEFAULT_SCORECARD_BASELINE_FONT_SIZE;
10283
10338
  const baselineDescrFontSize = Math.floor(.9 * baselineValueFontSize);
10284
10339
  if (this.runtime.progressBar) baselineValueFontSize /= 1.5;
10285
10340
  return {
10286
10341
  title: {
10287
- font: getDefaultContextFont(this.runtime.title.fontSize ?? 14, this.runtime.title.bold, this.runtime.title.italic),
10342
+ font: getDefaultContextFont(this.runtime.title.fontSize ?? SCORECARD_CHART_TITLE_FONT_SIZE, this.runtime.title.bold, this.runtime.title.italic),
10288
10343
  color: this.runtime.title.color ?? this.secondaryFontColor
10289
10344
  },
10290
10345
  keyValue: {
@@ -10760,35 +10815,35 @@ stores.inject(MyMetaStore, storeInstance);
10760
10815
  x: boundingRect.width / 2,
10761
10816
  y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
10762
10817
  };
10763
- let gaugeValueFontSize = 80;
10818
+ let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
10764
10819
  if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
10765
10820
  const maxTextWidth = gaugeRect.width / 2;
10766
10821
  const gaugeLabel = runtime.gaugeValue?.label || "-";
10767
10822
  if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
10768
10823
  const minLabelPosition = {
10769
10824
  x: gaugeRect.x + gaugeArcWidth / 2,
10770
- y: gaugeRect.y + gaugeRect.height + 12
10825
+ y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
10771
10826
  };
10772
10827
  const maxLabelPosition = {
10773
10828
  x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
10774
- y: gaugeRect.y + gaugeRect.height + 12
10829
+ y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
10775
10830
  };
10776
10831
  const textColor = chartMutedFontColor(runtime.background);
10777
10832
  const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
10778
10833
  let x = 0, titleWidth = 0, titleHeight = 0;
10779
10834
  if (runtime.title.text) ({width: titleWidth, height: titleHeight} = computeTextDimension(ctx, runtime.title.text, {
10780
- fontSize: 16,
10835
+ fontSize: CHART_TITLE_FONT_SIZE,
10781
10836
  ...runtime.title
10782
10837
  }, "px"));
10783
10838
  switch (runtime.title.align) {
10784
10839
  case "right":
10785
- x = boundingRect.width - titleWidth - 20;
10840
+ x = boundingRect.width - titleWidth - CHART_PADDING;
10786
10841
  break;
10787
10842
  case "center":
10788
10843
  x = (boundingRect.width - titleWidth) / 2;
10789
10844
  break;
10790
10845
  default:
10791
- x = 20;
10846
+ x = CHART_PADDING;
10792
10847
  break;
10793
10848
  }
10794
10849
  return {
@@ -10796,10 +10851,10 @@ stores.inject(MyMetaStore, storeInstance);
10796
10851
  height: boundingRect.height,
10797
10852
  title: {
10798
10853
  label: runtime.title.text ?? "",
10799
- fontSize: runtime.title.fontSize ?? 16,
10854
+ fontSize: runtime.title.fontSize ?? CHART_TITLE_FONT_SIZE,
10800
10855
  textPosition: {
10801
10856
  x,
10802
- y: 15 + titleHeight / 2
10857
+ y: CHART_PADDING_TOP + titleHeight / 2
10803
10858
  },
10804
10859
  color: runtime.title.color ?? textColor,
10805
10860
  bold: runtime.title.bold,
@@ -10822,13 +10877,13 @@ stores.inject(MyMetaStore, storeInstance);
10822
10877
  minLabel: {
10823
10878
  label: runtime.minValue.label,
10824
10879
  textPosition: minLabelPosition,
10825
- fontSize: 12,
10880
+ fontSize: GAUGE_LABELS_FONT_SIZE,
10826
10881
  color: textColor
10827
10882
  },
10828
10883
  maxLabel: {
10829
10884
  label: runtime.maxValue.label,
10830
10885
  textPosition: maxLabelPosition,
10831
- fontSize: 12,
10886
+ fontSize: GAUGE_LABELS_FONT_SIZE,
10832
10887
  color: textColor
10833
10888
  }
10834
10889
  };
@@ -10838,9 +10893,9 @@ stores.inject(MyMetaStore, storeInstance);
10838
10893
  * space for the title and labels.
10839
10894
  */
10840
10895
  function getGaugeRect(boundingRect, title) {
10841
- const titleHeight = title ? 25 : 0;
10842
- const drawHeight = boundingRect.height - 20 - titleHeight - 10;
10843
- const drawWidth = boundingRect.width - 30 * 2;
10896
+ const titleHeight = title ? GAUGE_TITLE_SECTION_HEIGHT : 0;
10897
+ const drawHeight = boundingRect.height - GAUGE_PADDING_BOTTOM - titleHeight - GAUGE_PADDING_TOP;
10898
+ const drawWidth = boundingRect.width - GAUGE_PADDING_SIDE * 2;
10844
10899
  let gaugeWidth;
10845
10900
  let gaugeHeight;
10846
10901
  if (drawWidth > 2 * drawHeight) {
@@ -10851,8 +10906,8 @@ stores.inject(MyMetaStore, storeInstance);
10851
10906
  gaugeHeight = drawWidth / 2;
10852
10907
  }
10853
10908
  return {
10854
- x: 30 + (drawWidth - gaugeWidth) / 2,
10855
- y: titleHeight + 10 + (drawHeight - gaugeHeight) / 2,
10909
+ x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
10910
+ y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
10856
10911
  width: gaugeWidth,
10857
10912
  height: gaugeHeight
10858
10913
  };
@@ -10869,20 +10924,20 @@ stores.inject(MyMetaStore, storeInstance);
10869
10924
  x: gaugeRect.x + gaugeRect.width / 2,
10870
10925
  y: gaugeRect.y + gaugeRect.height
10871
10926
  };
10872
- const textStyle = { fontSize: 12 };
10927
+ const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
10873
10928
  const inflectionValues = [];
10874
10929
  const inflectionValuesTextRects = [];
10875
10930
  for (const inflectionValue of runtime.inflectionValues) {
10876
10931
  const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
10877
10932
  const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
10878
10933
  const angle = Math.PI - Math.PI * percentage;
10879
- const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, 12);
10880
- const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? 12 : 0;
10934
+ const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, GAUGE_LABELS_FONT_SIZE);
10935
+ const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? GAUGE_LABELS_FONT_SIZE : 0;
10881
10936
  inflectionValuesTextRects.push(textRect);
10882
10937
  inflectionValues.push({
10883
10938
  rotation: angle,
10884
10939
  label: inflectionValue.label,
10885
- fontSize: 12,
10940
+ fontSize: GAUGE_LABELS_FONT_SIZE,
10886
10941
  color: textColor,
10887
10942
  offset
10888
10943
  });
@@ -11604,7 +11659,7 @@ stores.inject(MyMetaStore, storeInstance);
11604
11659
  });
11605
11660
  return newY.length === newX.length ? newY : transposeMatrix(newY);
11606
11661
  }
11607
- function getMovingAverageValues(dataset, labels, windowSize = 2) {
11662
+ function getMovingAverageValues(dataset, labels, windowSize = DEFAULT_WINDOW_SIZE) {
11608
11663
  const values = [];
11609
11664
  for (let i = 0; i < windowSize - 1; i++) values.push({
11610
11665
  x: labels[i],
@@ -13217,19 +13272,19 @@ stores.inject(MyMetaStore, storeInstance);
13217
13272
  //#region src/helpers/figures/charts/runtime/chartjs_layout.ts
13218
13273
  function getChartLayout(definition, args) {
13219
13274
  return { padding: {
13220
- left: 20,
13221
- right: 20,
13222
- top: Math.max(15, args.topPadding || 0),
13223
- bottom: 10
13275
+ left: CHART_PADDING,
13276
+ right: CHART_PADDING,
13277
+ top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
13278
+ bottom: CHART_PADDING_BOTTOM
13224
13279
  } };
13225
13280
  }
13226
13281
  function getCalendarChartLayout(definition, args) {
13227
13282
  const legendPosition = definition.legendPosition;
13228
13283
  return { padding: {
13229
- left: 20 + (legendPosition === "left" ? 70 : 0),
13230
- right: 20 + (legendPosition === "right" ? 70 : 0),
13231
- top: Math.max(15, args.topPadding || 0),
13232
- bottom: 10
13284
+ left: CHART_PADDING + (legendPosition === "left" ? CHART_COLORSCALE_WIDTH : 0),
13285
+ right: CHART_PADDING + (legendPosition === "right" ? CHART_COLORSCALE_WIDTH : 0),
13286
+ top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
13287
+ bottom: CHART_PADDING_BOTTOM
13233
13288
  } };
13234
13289
  }
13235
13290
 
@@ -13306,9 +13361,9 @@ stores.inject(MyMetaStore, storeInstance);
13306
13361
  }
13307
13362
  function getWaterfallChartLegend(definition, args) {
13308
13363
  const fontColor = chartFontColor(definition.background);
13309
- const negativeColor = definition.negativeValuesColor || "#EA6175";
13310
- const positiveColor = definition.positiveValuesColor || "#4EA7F2";
13311
- const subTotalColor = definition.subTotalValuesColor || "#AAAAAA";
13364
+ const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
13365
+ const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
13366
+ const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
13312
13367
  return {
13313
13368
  ...getLegendDisplayOptions(definition, args),
13314
13369
  labels: {
@@ -13547,11 +13602,11 @@ stores.inject(MyMetaStore, storeInstance);
13547
13602
  color: chartTitle?.color ?? fontColor,
13548
13603
  align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
13549
13604
  font: {
13550
- size: definition.title.fontSize ?? 16,
13605
+ size: definition.title.fontSize ?? CHART_TITLE_FONT_SIZE,
13551
13606
  weight: chartTitle.bold ? "bold" : "normal",
13552
13607
  style: chartTitle.italic ? "italic" : "normal"
13553
13608
  },
13554
- padding: { bottom: definition.legendPosition === "top" ? 0 : 20 }
13609
+ padding: { bottom: definition.legendPosition === "top" ? 0 : CHART_PADDING }
13555
13610
  };
13556
13611
  }
13557
13612
 
@@ -14068,7 +14123,7 @@ stores.inject(MyMetaStore, storeInstance);
14068
14123
  const definition = this.getDefinition();
14069
14124
  return {
14070
14125
  ...definition,
14071
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
14126
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
14072
14127
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
14073
14128
  dataSets,
14074
14129
  labelRange,
@@ -14104,7 +14159,7 @@ stores.inject(MyMetaStore, storeInstance);
14104
14159
  }
14105
14160
  }
14106
14161
  },
14107
- background: chart.background || "#FFFFFF"
14162
+ background: chart.background || BACKGROUND_CHART_COLOR
14108
14163
  };
14109
14164
  }
14110
14165
 
@@ -14589,7 +14644,7 @@ stores.inject(MyMetaStore, storeInstance);
14589
14644
  const definition = this.getDefinition();
14590
14645
  return {
14591
14646
  ...definition,
14592
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
14647
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
14593
14648
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
14594
14649
  dataSets,
14595
14650
  labelRange,
@@ -14627,7 +14682,7 @@ stores.inject(MyMetaStore, storeInstance);
14627
14682
  }
14628
14683
  }
14629
14684
  },
14630
- background: chart.background || "#FFFFFF"
14685
+ background: chart.background || BACKGROUND_CHART_COLOR
14631
14686
  };
14632
14687
  }
14633
14688
 
@@ -14716,7 +14771,7 @@ stores.inject(MyMetaStore, storeInstance);
14716
14771
  const { dataSets, labelRange } = this.getCommonDataSetAttributesForExcel(this.labelRange, this.dataSets, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
14717
14772
  return {
14718
14773
  ...this.getDefinition(),
14719
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
14774
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
14720
14775
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
14721
14776
  dataSets,
14722
14777
  labelRange
@@ -14750,7 +14805,7 @@ stores.inject(MyMetaStore, storeInstance);
14750
14805
  }
14751
14806
  }
14752
14807
  },
14753
- background: chart.background || "#FFFFFF"
14808
+ background: chart.background || BACKGROUND_CHART_COLOR
14754
14809
  };
14755
14810
  }
14756
14811
 
@@ -14903,7 +14958,7 @@ stores.inject(MyMetaStore, storeInstance);
14903
14958
  }
14904
14959
  }
14905
14960
  },
14906
- background: chart.background || "#FFFFFF"
14961
+ background: chart.background || BACKGROUND_CHART_COLOR
14907
14962
  };
14908
14963
  }
14909
14964
 
@@ -14920,7 +14975,7 @@ stores.inject(MyMetaStore, storeInstance);
14920
14975
  PieChart: () => PieChart,
14921
14976
  SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING: () => SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING,
14922
14977
  ScorecardChart: () => ScorecardChart$1,
14923
- TREND_LINE_XAXIS_ID: () => "x1",
14978
+ TREND_LINE_XAXIS_ID: () => TREND_LINE_XAXIS_ID,
14924
14979
  WaterfallChart: () => WaterfallChart,
14925
14980
  adaptChartRange: () => adaptChartRange,
14926
14981
  chartFactory: () => chartFactory,
@@ -15318,7 +15373,7 @@ stores.inject(MyMetaStore, storeInstance);
15318
15373
 
15319
15374
  //#endregion
15320
15375
  //#region src/components/figures/chart/chartJs/zoomable_chart/zoomable_chart_store.ts
15321
- const TREND_LINE_AXES_IDS = ["x1", MOVING_AVERAGE_TREND_LINE_XAXIS_ID];
15376
+ const TREND_LINE_AXES_IDS = [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID];
15322
15377
  const ZOOMABLE_AXIS_IDS = ["x", ...TREND_LINE_AXES_IDS];
15323
15378
  var ZoomableChartStore = class extends SpreadsheetStore {
15324
15379
  mutators = [
@@ -15415,7 +15470,7 @@ stores.inject(MyMetaStore, storeInstance);
15415
15470
  this.removeEventListeners();
15416
15471
  }
15417
15472
  get containerStyle() {
15418
- return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${60}px)` : "100%" });
15473
+ return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${MASTER_CHART_HEIGHT}px)` : "100%" });
15419
15474
  }
15420
15475
  get masterChartContainerStyle() {
15421
15476
  const runtime = this.env.model.getters.getChartRuntime(this.props.chartId);
@@ -15474,8 +15529,8 @@ stores.inject(MyMetaStore, storeInstance);
15474
15529
  getAxisLimitsFromDataset(chartData) {
15475
15530
  const xValues = chartData.data.datasets.map((ds) => ds.data).flat().map((d, i) => typeof d === "object" && d !== null ? d.x : i);
15476
15531
  return {
15477
- min: Math.min(...xValues),
15478
- max: Math.max(...xValues)
15532
+ min: largeMin(xValues),
15533
+ max: largeMax(xValues)
15479
15534
  };
15480
15535
  }
15481
15536
  setMasterChartCursor(runtime) {
@@ -15561,7 +15616,7 @@ stores.inject(MyMetaStore, storeInstance);
15561
15616
  updateTrendingLineAxes() {
15562
15617
  this.store.updateTrendLineConfiguration(this.chartId);
15563
15618
  const limits = this.store.currentAxesLimits[this.chartId];
15564
- for (const axisId of ["x1", MOVING_AVERAGE_TREND_LINE_XAXIS_ID]) {
15619
+ for (const axisId of [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID]) {
15565
15620
  if (!this.chart?.config?.options?.scales?.[axisId] || !limits?.[axisId]) continue;
15566
15621
  this.chart.config.options.scales[axisId].min = limits[axisId].min;
15567
15622
  this.chart.config.options.scales[axisId].max = limits[axisId].max;
@@ -16789,7 +16844,7 @@ stores.inject(MyMetaStore, storeInstance);
16789
16844
  onClickMenu: this.onClickMenu.bind(this),
16790
16845
  onMouseOver: this.onMouseOver.bind(this),
16791
16846
  onMouseLeave: this.onMouseLeave.bind(this),
16792
- width: this.props.width || 250,
16847
+ width: this.props.width || MENU_WIDTH,
16793
16848
  isActive: this.isActive.bind(this),
16794
16849
  onScroll: this.onScroll.bind(this)
16795
16850
  };
@@ -16805,11 +16860,11 @@ stores.inject(MyMetaStore, storeInstance);
16805
16860
  anchorRect: {
16806
16861
  x: this.props.anchorRect.x,
16807
16862
  y: this.props.anchorRect.y,
16808
- width: isRoot ? this.props.anchorRect.width : this.props.width || 250,
16809
- height: isRoot ? this.props.anchorRect.height : 26
16863
+ width: isRoot ? this.props.anchorRect.width : this.props.width || MENU_WIDTH,
16864
+ height: isRoot ? this.props.anchorRect.height : DESKTOP_MENU_ITEM_HEIGHT
16810
16865
  },
16811
16866
  positioning: this.props.popoverPositioning,
16812
- verticalOffset: isRoot ? 0 : 6,
16867
+ verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
16813
16868
  onPopoverHidden: () => this.closeSubMenu(),
16814
16869
  onPopoverMoved: () => this.closeSubMenu(),
16815
16870
  maxHeight: this.props.maxHeight
@@ -16872,8 +16927,8 @@ stores.inject(MyMetaStore, storeInstance);
16872
16927
  this.subMenu.anchorRect = {
16873
16928
  x: getRefBoundingRect(this.menuRef).x,
16874
16929
  y: y - (this.subMenu.scrollOffset || 0),
16875
- width: this.props.width || 250,
16876
- height: 26
16930
+ width: this.props.width || MENU_WIDTH,
16931
+ height: DESKTOP_MENU_ITEM_HEIGHT
16877
16932
  };
16878
16933
  this.subMenu.menuItems = menu.children(this.env);
16879
16934
  this.subMenu.isOpen = true;
@@ -16944,7 +16999,7 @@ stores.inject(MyMetaStore, storeInstance);
16944
16999
  return [this.fullScreenMenuItem].filter(isDefined);
16945
17000
  }
16946
17001
  get backgroundColor() {
16947
- return "background-color: " + (this.env.model.getters.getChartDefinition(this.props.chartId).background || "#FFFFFF");
17002
+ return "background-color: " + (this.env.model.getters.getChartDefinition(this.props.chartId).background || BACKGROUND_CHART_COLOR);
16948
17003
  }
16949
17004
  openContextMenu(ev) {
16950
17005
  this.menuState.isOpen = true;
@@ -24872,7 +24927,7 @@ stores.inject(MyMetaStore, storeInstance);
24872
24927
  const error = pivot.assertIsValid({ throwOnError: false });
24873
24928
  if (error) return error;
24874
24929
  const table = pivot.getCollapsedTableStructure();
24875
- if (table.numberOfCells > 5e5) return new EvaluationError(getPivotTooBigErrorMessage(table.numberOfCells, this.locale));
24930
+ if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) return new EvaluationError(getPivotTooBigErrorMessage(table.numberOfCells, this.locale));
24876
24931
  const cells = table.getPivotCells(pivotStyle);
24877
24932
  let headerRows = 0;
24878
24933
  if (pivotStyle.displayColumnHeaders) headerRows = table.columns.length - 1;
@@ -26663,12 +26718,12 @@ stores.inject(MyMetaStore, storeInstance);
26663
26718
  for (let current = it.next(); !current.done; current = it.next()) {
26664
26719
  if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) {
26665
26720
  if (isFirstParagraph) isFirstParagraph = false;
26666
- else text += "\n";
26721
+ else text += NEWLINE;
26667
26722
  emptyParagraph = isEmptyParagraph(current.value);
26668
26723
  continue;
26669
26724
  }
26670
26725
  if (!current.value.hasChildNodes()) {
26671
- if (current.value.nodeName === "BR" && !emptyParagraph) text += "\n";
26726
+ if (current.value.nodeName === "BR" && !emptyParagraph) text += NEWLINE;
26672
26727
  text += current.value.textContent;
26673
26728
  }
26674
26729
  }
@@ -26902,7 +26957,7 @@ stores.inject(MyMetaStore, storeInstance);
26902
26957
  if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
26903
26958
  } else {
26904
26959
  assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
26905
- if (composerRect.left + ASSISTANT_WIDTH + 15 + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
26960
+ if (composerRect.left + ASSISTANT_WIDTH + SCROLLBAR_WIDTH + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
26906
26961
  }
26907
26962
  return assistantStyle;
26908
26963
  }
@@ -26999,7 +27054,7 @@ stores.inject(MyMetaStore, storeInstance);
26999
27054
  const start = Math.min(selection.start, selection.end);
27000
27055
  const end = Math.max(selection.start, selection.end);
27001
27056
  this.props.composerStore.stopComposerRangeSelection();
27002
- this.props.composerStore.setCurrentContent(content.slice(0, start) + "\n" + content.slice(end), {
27057
+ this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
27003
27058
  start: start + 1,
27004
27059
  end: start + 1
27005
27060
  });
@@ -27177,7 +27232,7 @@ stores.inject(MyMetaStore, storeInstance);
27177
27232
  const { end, start } = this.props.composerStore.composerSelection;
27178
27233
  for (let index = 0; index < tokens.length; index++) {
27179
27234
  const token = tokens[index];
27180
- let color = token.color || "light-dark(#000000, #ffffff)";
27235
+ let color = token.color || DEFAULT_TOKEN_COLOR;
27181
27236
  if (token.isBlurred) color = setColorAlpha(color, .5);
27182
27237
  const classes = [];
27183
27238
  if (token.type === "REFERENCE" && this.props.composerStore.tokenAtCursor === token && this.props.composerStore.editionMode === "selecting") classes.push("text-decoration-underline");
@@ -27208,8 +27263,8 @@ stores.inject(MyMetaStore, storeInstance);
27208
27263
  splitHtmlContentIntoLines(contents) {
27209
27264
  const contentSplitInLines = [];
27210
27265
  let currentLine = [];
27211
- for (const content of contents) if (content.value.includes("\n")) {
27212
- const lines = content.value.split("\n");
27266
+ for (const content of contents) if (content.value.includes(NEWLINE)) {
27267
+ const lines = content.value.split(NEWLINE);
27213
27268
  const lastLine = lines.pop();
27214
27269
  for (const line of lines) {
27215
27270
  currentLine.push({
@@ -27815,7 +27870,7 @@ stores.inject(MyMetaStore, storeInstance);
27815
27870
  function drawHighlight(renderingContext, highlight, rect) {
27816
27871
  const { x, y, width, height } = rect;
27817
27872
  if (width < 0 || height < 0) return;
27818
- const color = highlight.color || "#017E84";
27873
+ const color = highlight.color || HIGHLIGHT_COLOR;
27819
27874
  const { ctx } = renderingContext;
27820
27875
  ctx.save();
27821
27876
  if (!highlight.noBorder) {
@@ -28375,7 +28430,7 @@ stores.inject(MyMetaStore, storeInstance);
28375
28430
  getTokenColor(token) {
28376
28431
  if (token.type === "REFERENCE") {
28377
28432
  const { xc, sheetName } = splitReference(token.value);
28378
- return this.rangeColor(xc, sheetName) || "light-dark(#000000, #ffffff)";
28433
+ return this.rangeColor(xc, sheetName) || DEFAULT_TOKEN_COLOR;
28379
28434
  }
28380
28435
  if (token.type === "SYMBOL") {
28381
28436
  const upperCaseValue = token.value.toUpperCase();
@@ -28385,7 +28440,7 @@ stores.inject(MyMetaStore, storeInstance);
28385
28440
  if (["LEFT_PAREN", "RIGHT_PAREN"].includes(token.type)) {
28386
28441
  if (token.parenthesesCode === "") return tokenColors.ORPHAN_RIGHT_PAREN;
28387
28442
  }
28388
- return tokenColors[token.type] || "light-dark(#000000, #ffffff)";
28443
+ return tokenColors[token.type] || DEFAULT_TOKEN_COLOR;
28389
28444
  }
28390
28445
  rangeColor(xc, sheetName) {
28391
28446
  const refSheet = sheetName ? this.model.getters.getSheetIdByName(sheetName) : this.sheetId;
@@ -28979,7 +29034,7 @@ stores.inject(MyMetaStore, storeInstance);
28979
29034
  }
28980
29035
  get sliderStyle() {
28981
29036
  const hue = this.state.currentHslaColor?.h || 0;
28982
- return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - 18 / 2}px` });
29037
+ return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - ICON_EDGE_LENGTH / 2}px` });
28983
29038
  }
28984
29039
  get pointerStyle() {
28985
29040
  const { s, l } = this.state.currentHslaColor || {
@@ -30814,7 +30869,7 @@ stores.inject(MyMetaStore, storeInstance);
30814
30869
  col,
30815
30870
  row
30816
30871
  });
30817
- const textColor = style?.textColor === "#017E84" ? void 0 : style?.textColor;
30872
+ const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
30818
30873
  this.env.model.dispatch("UPDATE_CELL", {
30819
30874
  col,
30820
30875
  row,
@@ -32161,7 +32216,7 @@ stores.inject(MyMetaStore, storeInstance);
32161
32216
  width: 512,
32162
32217
  height: 512,
32163
32218
  paths: [{
32164
- fillColor: color.textColor || "#374151C2",
32219
+ fillColor: color.textColor || TEXT_BODY_MUTED,
32165
32220
  path: "M120 195 h270 l-135 130"
32166
32221
  }]
32167
32222
  };
@@ -32172,7 +32227,7 @@ stores.inject(MyMetaStore, storeInstance);
32172
32227
  width: 512,
32173
32228
  height: 512,
32174
32229
  paths: [{
32175
- fillColor: color.textColor || "#374151C2",
32230
+ fillColor: color.textColor || TEXT_BODY_MUTED,
32176
32231
  path: "M120 325 h270 l-135 -130"
32177
32232
  }]
32178
32233
  };
@@ -32183,7 +32238,7 @@ stores.inject(MyMetaStore, storeInstance);
32183
32238
  width: 512,
32184
32239
  height: 512,
32185
32240
  paths: [{
32186
- fillColor: color.textColor || "#374151C2",
32241
+ fillColor: color.textColor || TEXT_BODY_MUTED,
32187
32242
  path: "M15 15 h482 v482 h-482"
32188
32243
  }, {
32189
32244
  fillColor: color.fillColor || "#fff",
@@ -32198,7 +32253,7 @@ stores.inject(MyMetaStore, storeInstance);
32198
32253
  width: 512,
32199
32254
  height: 512,
32200
32255
  paths: [{
32201
- fillColor: chipStyle.textColor || "#374151C2",
32256
+ fillColor: chipStyle.textColor || TEXT_BODY_MUTED,
32202
32257
  path: CHIP_CARET_DOWN_PATH
32203
32258
  }]
32204
32259
  };
@@ -32209,10 +32264,10 @@ stores.inject(MyMetaStore, storeInstance);
32209
32264
  width: 512,
32210
32265
  height: 512,
32211
32266
  paths: [{
32212
- fillColor: chipStyle.textColor || "#374151C2",
32267
+ fillColor: chipStyle.textColor || TEXT_BODY_MUTED,
32213
32268
  path: "M0,225 A175,175 0 1,0 350,225 A175,175 0 1,0 0,225"
32214
32269
  }, {
32215
- fillColor: chipStyle.fillColor || "#374151C2",
32270
+ fillColor: chipStyle.fillColor || TEXT_BODY_MUTED,
32216
32271
  path: CHIP_CARET_DOWN_PATH
32217
32272
  }]
32218
32273
  };
@@ -32969,7 +33024,7 @@ stores.inject(MyMetaStore, storeInstance);
32969
33024
  alignment: {
32970
33025
  horizontal: style.align,
32971
33026
  vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
32972
- wrapText: style.wrapping === "wrap" || content?.includes("\n") ? true : void 0,
33027
+ wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : void 0,
32973
33028
  textRotation: style.rotation ? rotationToXLSX(style.rotation) : void 0,
32974
33029
  shrinkToFit: style.wrapping === "clip" ? true : void 0
32975
33030
  }
@@ -33010,7 +33065,7 @@ stores.inject(MyMetaStore, storeInstance);
33010
33065
  function convertFormat(format, numFmtStructure) {
33011
33066
  if (!format) return 0;
33012
33067
  let formatId = XLSX_FORMAT_MAP[format.format];
33013
- if (!formatId) formatId = pushElement(format, numFmtStructure) + 164;
33068
+ if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
33014
33069
  return formatId;
33015
33070
  }
33016
33071
  /**
@@ -33584,14 +33639,14 @@ stores.inject(MyMetaStore, storeInstance);
33584
33639
  type: trend.type === "linear" ? "polynomial" : EXCEL_TO_SPREADSHEET_TRENDLINE_TYPE_MAPPING[trend.type],
33585
33640
  order: trend.type === "linear" ? 1 : trend.order,
33586
33641
  color: trend.color,
33587
- window: trend.window || 2,
33642
+ window: trend.window || DEFAULT_WINDOW_SIZE,
33588
33643
  display: true
33589
33644
  };
33590
33645
  }
33591
33646
  function convertAnchor(XLSXanchor) {
33592
33647
  const offset = {
33593
- x: convertEMUToDotValue(XLSXanchor.colOffset) - 1,
33594
- y: convertEMUToDotValue(XLSXanchor.rowOffset) - 1
33648
+ x: convertEMUToDotValue(XLSXanchor.colOffset) - FIGURE_BORDER_WIDTH,
33649
+ y: convertEMUToDotValue(XLSXanchor.rowOffset) - FIGURE_BORDER_WIDTH
33595
33650
  };
33596
33651
  return {
33597
33652
  col: XLSXanchor.col,
@@ -33942,8 +33997,8 @@ stores.inject(MyMetaStore, storeInstance);
33942
33997
  dims[0] = Math.max(dims[0], fig.anchors[fig.anchors.length - 1]?.col ?? 0);
33943
33998
  dims[1] = Math.max(dims[1], fig.anchors[fig.anchors.length - 1]?.row ?? 0);
33944
33999
  }
33945
- dims[0] = Math.max(dims[0] + 5, 30);
33946
- dims[1] = Math.max(dims[1] + 5, 100);
34000
+ dims[0] = Math.max(dims[0] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
34001
+ dims[1] = Math.max(dims[1] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
33947
34002
  return dims;
33948
34003
  }
33949
34004
  /**
@@ -34517,7 +34572,7 @@ stores.inject(MyMetaStore, storeInstance);
34517
34572
  rgb = this.getThemeColor(themeIndex, theme.clrScheme);
34518
34573
  } else {
34519
34574
  rgb = this.extractAttr(colorElement, "rgb")?.asString();
34520
- rgb = rgb === "FF000000" ? void 0 : rgb;
34575
+ rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
34521
34576
  }
34522
34577
  return {
34523
34578
  rgb: rgb || defaultColor,
@@ -35626,7 +35681,7 @@ stores.inject(MyMetaStore, storeInstance);
35626
35681
  * Get the corresponding relationship file for a given xml file in a XLSX directory.
35627
35682
  */
35628
35683
  function getRelationFile(file, xmls) {
35629
- if (file === "[Content_Types].xml") return "_rels/.rels";
35684
+ if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
35630
35685
  let relsFile = "";
35631
35686
  const pathParts = file.split("/");
35632
35687
  for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
@@ -35736,7 +35791,7 @@ stores.inject(MyMetaStore, storeInstance);
35736
35791
  if (token.type === "REFERENCE" && cellReference.test(token.value)) {
35737
35792
  const value = token.value.trim();
35738
35793
  if (!dependencies.includes(value)) dependencies.push(value);
35739
- return `${"|"}${dependencies.indexOf(value)}${"|"}`;
35794
+ return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
35740
35795
  } else return token.value;
35741
35796
  })),
35742
35797
  dependencies
@@ -35932,7 +35987,7 @@ stores.inject(MyMetaStore, storeInstance);
35932
35987
  if (cell.formula) {
35933
35988
  let { text, dependencies } = cell.formula;
35934
35989
  for (const [index, d] of Object.entries(dependencies)) {
35935
- const stringPosition = `\\${"|"}${index}\\${"|"}`;
35990
+ const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
35936
35991
  text = text.replace(new RegExp(stringPosition, "g"), d);
35937
35992
  }
35938
35993
  cell.content = text;
@@ -36831,8 +36886,8 @@ stores.inject(MyMetaStore, storeInstance);
36831
36886
  zones = getters.getSelectedZones();
36832
36887
  }
36833
36888
  const size = {
36834
- width: 536,
36835
- height: 335
36889
+ width: DEFAULT_FIGURE_WIDTH,
36890
+ height: DEFAULT_FIGURE_HEIGHT
36836
36891
  };
36837
36892
  const { col, row, offset } = centerFigurePosition(getters, size);
36838
36893
  if (env.model.dispatch("CREATE_CHART", {
@@ -36854,8 +36909,8 @@ stores.inject(MyMetaStore, storeInstance);
36854
36909
  const figureId = env.model.uuidGenerator.smallUuid();
36855
36910
  const sheetId = getters.getActiveSheetId();
36856
36911
  const size = {
36857
- width: 536,
36858
- height: 335
36912
+ width: DEFAULT_FIGURE_WIDTH,
36913
+ height: DEFAULT_FIGURE_HEIGHT
36859
36914
  };
36860
36915
  const { col, row, offset } = centerFigurePosition(getters, size);
36861
36916
  if (env.model.dispatch("CREATE_CAROUSEL", {
@@ -36905,7 +36960,7 @@ stores.inject(MyMetaStore, storeInstance);
36905
36960
  execute: (env) => {
36906
36961
  const zone = env.model.getters.getSelectedZone();
36907
36962
  const table = env.model.getters.getPivot(pivotId).getExpandedTableStructure();
36908
- if (table.numberOfCells > 5e5) {
36963
+ if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
36909
36964
  env.notifyUser({
36910
36965
  type: "warning",
36911
36966
  text: getPivotTooBigErrorMessage(table.numberOfCells, env.model.getters.getLocale()),
@@ -38303,7 +38358,7 @@ stores.inject(MyMetaStore, storeInstance);
38303
38358
  if (value === void 0) return;
38304
38359
  const valueIndex = values.indexOf(value);
38305
38360
  if (value === void 0 || valueIndex === -1) return;
38306
- return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === "(previous)" ? -1 : 1), 0, values.length - 1)]);
38361
+ return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === PREVIOUS_VALUE ? -1 : 1), 0, values.length - 1)]);
38307
38362
  }
38308
38363
  function domainToString(domain) {
38309
38364
  return domain ? domain.map(domainNodeToString).join(", ") : "";
@@ -40748,7 +40803,7 @@ stores.inject(MyMetaStore, storeInstance);
40748
40803
  let { scrollX, scrollY } = getters.getActiveSheetScrollInfo();
40749
40804
  const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
40750
40805
  let canEdgeScroll = false;
40751
- let timeoutDelay = 140;
40806
+ let timeoutDelay = MAX_DELAY;
40752
40807
  const x = zoomedMouseEvent.clientX - position.x;
40753
40808
  let colIndex = getters.getColIndex(x);
40754
40809
  if (scrollDirection !== "vertical") {
@@ -41144,7 +41199,7 @@ stores.inject(MyMetaStore, storeInstance);
41144
41199
  return true;
41145
41200
  }
41146
41201
  function astToDoc(ast) {
41147
- const debugPrefix = ast.debug ? `${"?"}` : "";
41202
+ const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
41148
41203
  switch (ast.type) {
41149
41204
  case "NUMBER": return debugPrefix + String(ast.value);
41150
41205
  case "STRING": return debugPrefix + `"${ast.value}"`;
@@ -41223,7 +41278,7 @@ stores.inject(MyMetaStore, storeInstance);
41223
41278
  * Converts an ast formula to the corresponding string
41224
41279
  */
41225
41280
  function astToFormula(ast) {
41226
- const debugPrefix = ast.debug ? `${"?"}` : "";
41281
+ const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
41227
41282
  switch (ast.type) {
41228
41283
  case "FUNCALL":
41229
41284
  const args = ast.args.map((arg) => astToFormula(arg));
@@ -41896,19 +41951,19 @@ stores.inject(MyMetaStore, storeInstance);
41896
41951
  position = y;
41897
41952
  break;
41898
41953
  case "bottom":
41899
- position = y + figureUI.height - 1;
41954
+ position = y + figureUI.height - FIGURE_BORDER_WIDTH;
41900
41955
  break;
41901
41956
  case "vCenter":
41902
- position = y + Math.floor(figureUI.height / 2) - 1;
41957
+ position = y + Math.floor(figureUI.height / 2) - FIGURE_BORDER_WIDTH;
41903
41958
  break;
41904
41959
  case "left":
41905
41960
  position = x;
41906
41961
  break;
41907
41962
  case "right":
41908
- position = x + figureUI.width - 1;
41963
+ position = x + figureUI.width - FIGURE_BORDER_WIDTH;
41909
41964
  break;
41910
41965
  case "hCenter":
41911
- position = x + Math.floor(figureUI.width / 2) - 1;
41966
+ position = x + Math.floor(figureUI.width / 2) - FIGURE_BORDER_WIDTH;
41912
41967
  break;
41913
41968
  }
41914
41969
  return {
@@ -42120,7 +42175,7 @@ stores.inject(MyMetaStore, storeInstance);
42120
42175
  };
42121
42176
  const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
42122
42177
  const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
42123
- if (!hasStartedDnd && offsetX < 5 && offsetY < 5) return;
42178
+ if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) return;
42124
42179
  hasStartedDnd = true;
42125
42180
  const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
42126
42181
  const otherFigures = this.getOtherFigures(initialFigure.id);
@@ -42172,7 +42227,7 @@ stores.inject(MyMetaStore, storeInstance);
42172
42227
  ev.stopPropagation();
42173
42228
  const initialScrollPosition = this.env.model.getters.getActiveSheetScrollInfo();
42174
42229
  const keepRatio = figureRegistry.get(figureUI.tag).keepRatio || false;
42175
- const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || 80;
42230
+ const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || MIN_FIG_SIZE;
42176
42231
  const zoom = this.env.model.getters.getViewportZoomLevel();
42177
42232
  const sheetId = this.env.model.getters.getActiveSheetId();
42178
42233
  const initialMousePosition = {
@@ -42787,7 +42842,7 @@ stores.inject(MyMetaStore, storeInstance);
42787
42842
  get isFooterVisible() {
42788
42843
  const { y } = this.env.model.getters.getMainViewportCoordinates();
42789
42844
  const { height } = this.env.model.getters.getSheetViewDimension();
42790
- return !this.env.model.getters.isReadonly() && height - y > 46;
42845
+ return !this.env.model.getters.isReadonly() && height - y > FOOTER_HEIGHT;
42791
42846
  }
42792
42847
  };
42793
42848
 
@@ -42842,7 +42897,7 @@ stores.inject(MyMetaStore, storeInstance);
42842
42897
  row: hiddenIndex
42843
42898
  }));
42844
42899
  return cssPropertiesToCss({
42845
- top: rect.y + rect.height - 26 - this.props.offset + "px",
42900
+ top: rect.y + rect.height - HEADER_HEIGHT - this.props.offset + "px",
42846
42901
  "margin-right": "1px"
42847
42902
  });
42848
42903
  }
@@ -42851,7 +42906,7 @@ stores.inject(MyMetaStore, storeInstance);
42851
42906
  top: this.env.model.getters.getRect(positionToZone({
42852
42907
  col: 0,
42853
42908
  row: hiddenIndex
42854
- })).y - 26 - this.props.offset + "px",
42909
+ })).y - HEADER_HEIGHT - this.props.offset + "px",
42855
42910
  "margin-right": "1px"
42856
42911
  });
42857
42912
  }
@@ -42885,13 +42940,13 @@ stores.inject(MyMetaStore, storeInstance);
42885
42940
  col: hiddenIndex,
42886
42941
  row: 0
42887
42942
  }));
42888
- return cssPropertiesToCss({ left: rect.x + rect.width - 48 - this.props.offset + "px" });
42943
+ return cssPropertiesToCss({ left: rect.x + rect.width - HEADER_WIDTH - this.props.offset + "px" });
42889
42944
  }
42890
42945
  getUnhideNextButtonStyle(hiddenIndex) {
42891
42946
  return cssPropertiesToCss({ left: this.env.model.getters.getRect(positionToZone({
42892
42947
  col: hiddenIndex,
42893
42948
  row: 0
42894
- })).x - 48 - this.props.offset + "px" });
42949
+ })).x - HEADER_WIDTH - this.props.offset + "px" });
42895
42950
  }
42896
42951
  unhide(hiddenElements) {
42897
42952
  this.env.model.dispatch("UNHIDE_COLUMNS_ROWS", {
@@ -43114,7 +43169,7 @@ stores.inject(MyMetaStore, storeInstance);
43114
43169
  this.colResizerRef = (0, _odoo_owl.useRef)("colResizer");
43115
43170
  this.PADDING = 15;
43116
43171
  this.MAX_SIZE_MARGIN = 90;
43117
- this.MIN_ELEMENT_SIZE = 5;
43172
+ this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
43118
43173
  }
43119
43174
  get sheetId() {
43120
43175
  return this.env.model.getters.getActiveSheetId();
@@ -43249,7 +43304,7 @@ stores.inject(MyMetaStore, storeInstance);
43249
43304
  this.rowResizerRef = (0, _odoo_owl.useRef)("rowResizer");
43250
43305
  this.PADDING = 5;
43251
43306
  this.MAX_SIZE_MARGIN = 60;
43252
- this.MIN_ELEMENT_SIZE = 10;
43307
+ this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
43253
43308
  }
43254
43309
  rowResizerRef;
43255
43310
  get sheetId() {
@@ -43668,7 +43723,7 @@ stores.inject(MyMetaStore, storeInstance);
43668
43723
  x,
43669
43724
  y
43670
43725
  }, style.underline, style.strikethrough);
43671
- y += 4 + box.content.fontSizePx;
43726
+ y += MIN_CELL_TEXT_MARGIN + box.content.fontSizePx;
43672
43727
  }
43673
43728
  if (style.rotation) ctx.restore();
43674
43729
  if (box.clipRect) ctx.restore();
@@ -43716,7 +43771,7 @@ stores.inject(MyMetaStore, storeInstance);
43716
43771
  const numberOfRows = this.getters.getNumberRows(sheetId);
43717
43772
  const activeCols = this.getters.getActiveCols();
43718
43773
  const activeRows = this.getters.getActiveRows();
43719
- ctx.font = `400 ${11}px ${DEFAULT_FONT}`;
43774
+ ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
43720
43775
  ctx.textAlign = "center";
43721
43776
  ctx.textBaseline = "middle";
43722
43777
  ctx.lineWidth = thinLineWidth;
@@ -43734,7 +43789,7 @@ stores.inject(MyMetaStore, storeInstance);
43734
43789
  if (isColActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
43735
43790
  else if (isColSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
43736
43791
  else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
43737
- ctx.fillRect(x, 0, width, 26);
43792
+ ctx.fillRect(x, 0, width, HEADER_HEIGHT);
43738
43793
  }
43739
43794
  for (const row of visibleRows) {
43740
43795
  const rowZone = {
@@ -43749,13 +43804,13 @@ stores.inject(MyMetaStore, storeInstance);
43749
43804
  if (isRowActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
43750
43805
  else if (isRowSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
43751
43806
  else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
43752
- ctx.fillRect(0, y, 48, height);
43807
+ ctx.fillRect(0, y, HEADER_WIDTH, height);
43753
43808
  }
43754
43809
  ctx.beginPath();
43755
- ctx.moveTo(48, 0);
43756
- ctx.lineTo(48, height);
43757
- ctx.moveTo(0, 26);
43758
- ctx.lineTo(width, 26);
43810
+ ctx.moveTo(HEADER_WIDTH, 0);
43811
+ ctx.lineTo(HEADER_WIDTH, height);
43812
+ ctx.moveTo(0, HEADER_HEIGHT);
43813
+ ctx.lineTo(width, HEADER_HEIGHT);
43759
43814
  ctx.strokeStyle = HEADER_BORDER_COLOR;
43760
43815
  ctx.stroke();
43761
43816
  for (const col of visibleCols) {
@@ -43771,13 +43826,13 @@ stores.inject(MyMetaStore, storeInstance);
43771
43826
  const { x, width } = this.getters.getVisibleRect(zone);
43772
43827
  ctx.save();
43773
43828
  ctx.beginPath();
43774
- ctx.rect(x, 0, width, 26);
43829
+ ctx.rect(x, 0, width, HEADER_HEIGHT);
43775
43830
  ctx.clip();
43776
- ctx.fillText(colName, colStart + colSize / 2, 26 / 2);
43831
+ ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
43777
43832
  ctx.restore();
43778
43833
  ctx.beginPath();
43779
43834
  ctx.moveTo(colStart + colSize, 0);
43780
- ctx.lineTo(colStart + colSize, 26);
43835
+ ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
43781
43836
  ctx.stroke();
43782
43837
  }
43783
43838
  for (const row of visibleRows) {
@@ -43792,21 +43847,21 @@ stores.inject(MyMetaStore, storeInstance);
43792
43847
  const { y, height } = this.getters.getVisibleRect(zone);
43793
43848
  ctx.save();
43794
43849
  ctx.beginPath();
43795
- ctx.rect(0, y, 48, height);
43850
+ ctx.rect(0, y, HEADER_WIDTH, height);
43796
43851
  ctx.clip();
43797
- ctx.fillText(String(row + 1), 48 / 2, rowStart + rowSize / 2);
43852
+ ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
43798
43853
  ctx.restore();
43799
43854
  ctx.beginPath();
43800
43855
  ctx.moveTo(0, rowStart + rowSize);
43801
- ctx.lineTo(48, rowStart + rowSize);
43856
+ ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
43802
43857
  ctx.stroke();
43803
43858
  }
43804
43859
  }
43805
43860
  drawFrozenPanesHeaders(renderingContext) {
43806
43861
  const { ctx, thinLineWidth } = renderingContext;
43807
43862
  const { x: offsetCorrectionX, y: offsetCorrectionY } = this.getters.getMainViewportCoordinates();
43808
- const widthCorrection = this.getters.isDashboard() ? 0 : 48;
43809
- const heightCorrection = this.getters.isDashboard() ? 0 : 26;
43863
+ const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
43864
+ const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
43810
43865
  ctx.lineWidth = 6 * thinLineWidth;
43811
43866
  ctx.strokeStyle = FROZEN_PANE_HEADER_BORDER_COLOR;
43812
43867
  ctx.beginPath();
@@ -43834,8 +43889,8 @@ stores.inject(MyMetaStore, storeInstance);
43834
43889
  bottom: visibleRows[visibleRows.length - 1]
43835
43890
  };
43836
43891
  const rect = this.getters.getVisibleRect(viewport);
43837
- const widthCorrection = this.getters.isDashboard() ? 0 : 48;
43838
- const heightCorrection = this.getters.isDashboard() ? 0 : 26;
43892
+ const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
43893
+ const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
43839
43894
  ctx.lineWidth = 6 * thinLineWidth;
43840
43895
  ctx.strokeStyle = FROZEN_PANE_BORDER_COLOR;
43841
43896
  ctx.beginPath();
@@ -43942,7 +43997,7 @@ stores.inject(MyMetaStore, storeInstance);
43942
43997
  /** Content */
43943
43998
  const wrapping = style.wrapping || "overflow";
43944
43999
  const wrapText = wrapping === "wrap" && !showFormula;
43945
- const maxWidth = width - 2 * 4;
44000
+ const maxWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
43946
44001
  const formatWidth = style.align ? 0 : maxWidth;
43947
44002
  const multiLineText = this.getters.getCellMultiLineText(position, {
43948
44003
  maxWidth,
@@ -43954,18 +44009,18 @@ stores.inject(MyMetaStore, storeInstance);
43954
44009
  align: "left",
43955
44010
  rotation: 0
43956
44011
  };
43957
- const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) + 4;
44012
+ const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) + MIN_CELL_TEXT_MARGIN;
43958
44013
  const contentSize = this.getters.getMultilineTextSize(multiLineText, style);
43959
- const chipMargin = chipStyle ? 5 : 0;
44014
+ const chipMargin = chipStyle ? DATA_VALIDATION_CHIP_MARGIN : 0;
43960
44015
  const leftMargin = (box.icons.left ? box.icons.left.size + box.icons.left.margin : 0) + chipMargin;
43961
44016
  const rightMargin = (box.icons.right ? box.icons.right.size + box.icons.right.margin : 0) + chipMargin;
43962
- const contentWidth = leftMargin + contentSize.width + rightMargin + 4;
44017
+ const contentWidth = leftMargin + contentSize.width + rightMargin + MIN_CELL_TEXT_MARGIN;
43963
44018
  const align = this.computeCellAlignment(position, contentWidth > width);
43964
44019
  const numberOfLines = multiLineText.length;
43965
44020
  const contentY = Math.round(this.getters.computeTextYCoordinate(box, fontSizePX, style.verticalAlign, numberOfLines));
43966
44021
  let contentX = box.x;
43967
- if (align === "left") contentX += 4 + leftMargin;
43968
- else if (align === "right") contentX += box.width - 4 - rightMargin;
44022
+ if (align === "left") contentX += MIN_CELL_TEXT_MARGIN + leftMargin;
44023
+ else if (align === "right") contentX += box.width - MIN_CELL_TEXT_MARGIN - rightMargin;
43969
44024
  else contentX += box.width / 2;
43970
44025
  contentX = Math.round(contentX);
43971
44026
  const textHeight = computeTextLinesHeight(fontSizePX, numberOfLines);
@@ -43981,7 +44036,7 @@ stores.inject(MyMetaStore, storeInstance);
43981
44036
  };
43982
44037
  if (chipStyle?.fillColor) {
43983
44038
  const chipMarginLeft = leftMargin;
43984
- const chipMarginRight = 5;
44039
+ const chipMarginRight = DATA_VALIDATION_CHIP_MARGIN;
43985
44040
  box.chip = {
43986
44041
  color: chipStyle.fillColor,
43987
44042
  width: box.width - chipMarginLeft - chipMarginRight,
@@ -44145,7 +44200,7 @@ stores.inject(MyMetaStore, storeInstance);
44145
44200
  continue;
44146
44201
  }
44147
44202
  const elapsedTime = timeStamp - animation.startTime;
44148
- const progress = Math.min(1, elapsedTime / 200);
44203
+ const progress = Math.min(1, elapsedTime / CELL_ANIMATION_DURATION);
44149
44204
  if (progress >= 1) this.animations.delete(boxId);
44150
44205
  animation.progress = progress;
44151
44206
  }
@@ -44247,7 +44302,7 @@ stores.inject(MyMetaStore, storeInstance);
44247
44302
  resetTimeout = setTimeout(() => {
44248
44303
  velocityX = 0;
44249
44304
  velocityY = 0;
44250
- }, 100);
44305
+ }, resetTimeoutDuration);
44251
44306
  updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
44252
44307
  }
44253
44308
  function onTouchEnd(ev) {
@@ -44278,7 +44333,7 @@ stores.inject(MyMetaStore, storeInstance);
44278
44333
  //#region src/components/helpers/wheel_hook.ts
44279
44334
  function useWheelHandler(handler) {
44280
44335
  function normalize(val, deltaMode) {
44281
- return val * (deltaMode === 0 ? 1 : 23);
44336
+ return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
44282
44337
  }
44283
44338
  const onMouseWheel = (ev) => {
44284
44339
  handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
@@ -44374,14 +44429,14 @@ stores.inject(MyMetaStore, storeInstance);
44374
44429
  return cssPropertiesToCss(css);
44375
44430
  }
44376
44431
  getHandlerEdgeLength() {
44377
- return this.env.isMobile() ? MOBILE_HANDLER_WIDTH : 8;
44432
+ return this.env.isMobile() ? MOBILE_HANDLER_WIDTH : AUTOFILL_EDGE_LENGTH;
44378
44433
  }
44379
44434
  get buttonLook() {
44380
44435
  const css = {
44381
44436
  "background-color": this.props.color,
44382
44437
  cursor: `${this.props.orientation}-resize`
44383
44438
  };
44384
- if (this.env.isMobile()) css["border-radius"] = `${8 / 2}px`;
44439
+ if (this.env.isMobile()) css["border-radius"] = `${AUTOFILL_EDGE_LENGTH / 2}px`;
44385
44440
  return cssPropertiesToCss(css);
44386
44441
  }
44387
44442
  onMouseDown(ev) {
@@ -45944,7 +45999,7 @@ stores.inject(MyMetaStore, storeInstance);
45944
45999
  axesList: Array
45945
46000
  };
45946
46001
  state = (0, _odoo_owl.useState)({ currentAxis: "x" });
45947
- defaultFontSize = 12;
46002
+ defaultFontSize = CHART_AXIS_TITLE_FONT_SIZE;
45948
46003
  get axisTitleStyle() {
45949
46004
  return this.props.definition.axesDesign?.[this.state.currentAxis]?.title ?? {};
45950
46005
  }
@@ -46020,7 +46075,7 @@ stores.inject(MyMetaStore, storeInstance);
46020
46075
  optional: true
46021
46076
  }
46022
46077
  };
46023
- static defaultProps = { defaultChartTitleFontSize: 16 };
46078
+ static defaultProps = { defaultChartTitleFontSize: CHART_TITLE_FONT_SIZE };
46024
46079
  state;
46025
46080
  setup() {
46026
46081
  this.state = (0, _odoo_owl.useState)({ activeTool: "" });
@@ -46249,11 +46304,11 @@ stores.inject(MyMetaStore, storeInstance);
46249
46304
  return Math.min(10, runtime.chartJsConfig.data.datasets[index].data.length - 1);
46250
46305
  }
46251
46306
  get defaultWindowSize() {
46252
- return 2;
46307
+ return DEFAULT_WINDOW_SIZE;
46253
46308
  }
46254
46309
  onChangeMovingAverageWindow(index, value) {
46255
- let window = parseInt(value) || 2;
46256
- if (window <= 1) window = 2;
46310
+ let window = parseInt(value) || DEFAULT_WINDOW_SIZE;
46311
+ if (window <= 1) window = DEFAULT_WINDOW_SIZE;
46257
46312
  this.updateTrendLineValue(index, { window });
46258
46313
  }
46259
46314
  getDataSeriesColor(index) {
@@ -46912,7 +46967,7 @@ stores.inject(MyMetaStore, storeInstance);
46912
46967
  });
46913
46968
  }
46914
46969
  get defaultHoleSize() {
46915
- return 50;
46970
+ return DEFAULT_DOUGHNUT_CHART_HOLE_SIZE;
46916
46971
  }
46917
46972
  };
46918
46973
 
@@ -47029,7 +47084,7 @@ stores.inject(MyMetaStore, storeInstance);
47029
47084
  const definition = this.getDefinition();
47030
47085
  return {
47031
47086
  ...definition,
47032
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
47087
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
47033
47088
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
47034
47089
  dataSets,
47035
47090
  labelRange,
@@ -47067,7 +47122,7 @@ stores.inject(MyMetaStore, storeInstance);
47067
47122
  }
47068
47123
  }
47069
47124
  },
47070
- background: chart.background || "#FFFFFF"
47125
+ background: chart.background || BACKGROUND_CHART_COLOR
47071
47126
  };
47072
47127
  }
47073
47128
 
@@ -47163,7 +47218,7 @@ stores.inject(MyMetaStore, storeInstance);
47163
47218
  return this.props.definition.baselineMode === "progress" ? _t("Progress bar colors") : _t("Baseline colors");
47164
47219
  }
47165
47220
  get defaultScorecardTitleFontSize() {
47166
- return 14;
47221
+ return SCORECARD_CHART_TITLE_FONT_SIZE;
47167
47222
  }
47168
47223
  translate(term) {
47169
47224
  return this.env.model.getters.dynamicTranslate(term);
@@ -47184,14 +47239,14 @@ stores.inject(MyMetaStore, storeInstance);
47184
47239
  get keyStyle() {
47185
47240
  return {
47186
47241
  align: "center",
47187
- fontSize: 32,
47242
+ fontSize: DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE,
47188
47243
  ...this.props.definition.keyDescr
47189
47244
  };
47190
47245
  }
47191
47246
  get baselineStyle() {
47192
47247
  return {
47193
47248
  align: "center",
47194
- fontSize: 16,
47249
+ fontSize: DEFAULT_SCORECARD_BASELINE_FONT_SIZE,
47195
47250
  ...this.props.definition.baselineDescr
47196
47251
  };
47197
47252
  }
@@ -47431,13 +47486,13 @@ stores.inject(MyMetaStore, storeInstance);
47431
47486
  }];
47432
47487
  }
47433
47488
  get positiveValuesColor() {
47434
- return this.props.definition.positiveValuesColor || "#4EA7F2";
47489
+ return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
47435
47490
  }
47436
47491
  get negativeValuesColor() {
47437
- return this.props.definition.negativeValuesColor || "#EA6175";
47492
+ return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
47438
47493
  }
47439
47494
  get subTotalValuesColor() {
47440
- return this.props.definition.subTotalValuesColor || "#AAAAAA";
47495
+ return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
47441
47496
  }
47442
47497
  updateVerticalAxisPosition(value) {
47443
47498
  this.props.updateChart(this.props.chartId, { verticalAxisPosition: value });
@@ -48090,7 +48145,7 @@ stores.inject(MyMetaStore, storeInstance);
48090
48145
  getColorScalePreviewStyle() {
48091
48146
  const rule = this.state.rules.colorScale;
48092
48147
  const minColor = colorNumberToHex(rule.minimum.color);
48093
- const midColor = colorNumberToHex(rule.midpoint?.color || 11982760);
48148
+ const midColor = colorNumberToHex(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
48094
48149
  const maxColor = colorNumberToHex(rule.maximum.color);
48095
48150
  const baseString = "linear-gradient(to right, ";
48096
48151
  return cssPropertiesToCss({
@@ -49388,7 +49443,7 @@ stores.inject(MyMetaStore, storeInstance);
49388
49443
  return {
49389
49444
  type: measureDisplayType,
49390
49445
  fieldNameWithGranularity,
49391
- value: value ?? "(previous)"
49446
+ value: value ?? PREVIOUS_VALUE
49392
49447
  };
49393
49448
  }
49394
49449
  }
@@ -50799,7 +50854,7 @@ stores.inject(MyMetaStore, storeInstance);
50799
50854
  }
50800
50855
  const pivot = this.getters.getPivot(this.pivotId);
50801
50856
  const numberOfCells = pivot.isValid() ? pivot.getExpandedTableStructure().numberOfCells : 0;
50802
- if (!this.alreadyNotifiedForPivotSize && numberOfCells > 5e5) {
50857
+ if (!this.alreadyNotifiedForPivotSize && numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
50803
50858
  this.alreadyNotifiedForPivotSize = true;
50804
50859
  this.notification.notifyUser({
50805
50860
  type: "warning",
@@ -51261,7 +51316,7 @@ stores.inject(MyMetaStore, storeInstance);
51261
51316
  },
51262
51317
  {
51263
51318
  name: _t("Line Break"),
51264
- value: "\n"
51319
+ value: NEWLINE
51265
51320
  }
51266
51321
  ];
51267
51322
  var SplitIntoColumnsPanel = class extends _odoo_owl.Component {
@@ -52025,7 +52080,7 @@ stores.inject(MyMetaStore, storeInstance);
52025
52080
  const newPanelInfo = {
52026
52081
  currentPanelProps,
52027
52082
  componentTag,
52028
- size: 350
52083
+ size: DEFAULT_SIDE_PANEL_SIZE
52029
52084
  };
52030
52085
  const state = this.computeState(newPanelInfo);
52031
52086
  if (!state.isOpen) return;
@@ -52033,8 +52088,8 @@ stores.inject(MyMetaStore, storeInstance);
52033
52088
  this._openPanel("mainPanel", newPanelInfo, state);
52034
52089
  return;
52035
52090
  }
52036
- const nonCollapsedPanelSize = this.mainPanel.isCollapsed ? 350 : this.mainPanel.size;
52037
- if (!this.secondaryPanel && nonCollapsedPanelSize + 350 > this.availableWidth) {
52091
+ const nonCollapsedPanelSize = this.mainPanel.isCollapsed ? DEFAULT_SIDE_PANEL_SIZE : this.mainPanel.size;
52092
+ if (!this.secondaryPanel && nonCollapsedPanelSize + DEFAULT_SIDE_PANEL_SIZE > this.availableWidth) {
52038
52093
  this.get(NotificationStore).notifyUser({
52039
52094
  sticky: false,
52040
52095
  type: "warning",
@@ -52048,7 +52103,7 @@ stores.inject(MyMetaStore, storeInstance);
52048
52103
  const newPanelInfo = {
52049
52104
  currentPanelProps,
52050
52105
  componentTag,
52051
- size: 350
52106
+ size: DEFAULT_SIDE_PANEL_SIZE
52052
52107
  };
52053
52108
  const state = this.computeState(newPanelInfo);
52054
52109
  if (!state.isOpen) return;
@@ -52077,7 +52132,7 @@ stores.inject(MyMetaStore, storeInstance);
52077
52132
  this[panel] = {
52078
52133
  currentPanelProps: state.props ?? {},
52079
52134
  componentTag: newPanel.componentTag,
52080
- size: currentPanel?.size || 350,
52135
+ size: currentPanel?.size || DEFAULT_SIDE_PANEL_SIZE,
52081
52136
  isCollapsed: currentPanel?.isCollapsed || false,
52082
52137
  isPinned: currentPanel && "isPinned" in currentPanel ? currentPanel.isPinned : false
52083
52138
  };
@@ -52107,19 +52162,19 @@ stores.inject(MyMetaStore, storeInstance);
52107
52162
  changePanelSize(panel, size) {
52108
52163
  const panelInfo = this[panel];
52109
52164
  if (!panelInfo || "isCollapsed" in panelInfo && panelInfo.isCollapsed) return;
52110
- size = Math.max(size, 350);
52165
+ size = Math.max(size, DEFAULT_SIDE_PANEL_SIZE);
52111
52166
  let otherPanelSize = panel === "mainPanel" ? this.secondaryPanel?.size || 0 : this.mainPanel?.size || 0;
52112
52167
  if (size > this.availableWidth - otherPanelSize) {
52113
52168
  if (panel === "mainPanel" && this.secondaryPanel) {
52114
- this.secondaryPanel.size = Math.max(this.availableWidth - size, 350);
52169
+ this.secondaryPanel.size = Math.max(this.availableWidth - size, DEFAULT_SIDE_PANEL_SIZE);
52115
52170
  otherPanelSize = this.secondaryPanel.size;
52116
52171
  }
52117
- size = Math.max(this.availableWidth - otherPanelSize, 350);
52172
+ size = Math.max(this.availableWidth - otherPanelSize, DEFAULT_SIDE_PANEL_SIZE);
52118
52173
  }
52119
52174
  panelInfo.size = size;
52120
52175
  }
52121
52176
  resetPanelSize(panel) {
52122
- if (this[panel]) this[panel].size = 350;
52177
+ if (this[panel]) this[panel].size = DEFAULT_SIDE_PANEL_SIZE;
52123
52178
  }
52124
52179
  togglePinPanel() {
52125
52180
  if (!this.mainPanel) return;
@@ -52135,10 +52190,10 @@ stores.inject(MyMetaStore, storeInstance);
52135
52190
  if (!panelInfo) return;
52136
52191
  if (panelInfo.isCollapsed) {
52137
52192
  panelInfo.isCollapsed = false;
52138
- this.changePanelSize(panel, 350);
52193
+ this.changePanelSize(panel, DEFAULT_SIDE_PANEL_SIZE);
52139
52194
  } else {
52140
52195
  panelInfo.isCollapsed = true;
52141
- panelInfo.size = 45;
52196
+ panelInfo.size = COLLAPSED_SIDE_PANEL_SIZE;
52142
52197
  }
52143
52198
  }
52144
52199
  computeState({ componentTag, currentPanelProps: initialPanelProps }) {
@@ -52153,12 +52208,12 @@ stores.inject(MyMetaStore, storeInstance);
52153
52208
  } : state;
52154
52209
  }
52155
52210
  changeSpreadsheetWidth(width) {
52156
- this.availableWidth = width - 150;
52157
- if (this.secondaryPanel && width - this.totalPanelSize < 150) {
52211
+ this.availableWidth = width - MIN_SHEET_VIEW_WIDTH;
52212
+ if (this.secondaryPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) {
52158
52213
  this.secondaryPanel?.currentPanelProps.onCloseSidePanel?.();
52159
52214
  this.secondaryPanel = void 0;
52160
52215
  }
52161
- if (this.mainPanel && width - this.totalPanelSize < 150) this.mainPanel.size = Math.max(width - 150, 350);
52216
+ if (this.mainPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) this.mainPanel.size = Math.max(width - MIN_SHEET_VIEW_WIDTH, DEFAULT_SIDE_PANEL_SIZE);
52162
52217
  }
52163
52218
  };
52164
52219
 
@@ -52258,8 +52313,8 @@ stores.inject(MyMetaStore, storeInstance);
52258
52313
  TableResizer,
52259
52314
  Selection
52260
52315
  };
52261
- HEADER_HEIGHT = 26;
52262
- HEADER_WIDTH = 48;
52316
+ HEADER_HEIGHT = HEADER_HEIGHT;
52317
+ HEADER_WIDTH = HEADER_WIDTH;
52263
52318
  menuState;
52264
52319
  gridRef;
52265
52320
  highlightStore;
@@ -52317,10 +52372,10 @@ stores.inject(MyMetaStore, storeInstance);
52317
52372
  get gridOverlayDimensions() {
52318
52373
  const scrollbarWidth = this.env.model.getters.getScrollBarWidth();
52319
52374
  return cssPropertiesToCss({
52320
- top: `${26}px`,
52321
- left: `${48}px`,
52322
- height: `calc(100% - ${26 + scrollbarWidth}px)`,
52323
- width: `calc(100% - ${48 + scrollbarWidth}px)`
52375
+ top: `${HEADER_HEIGHT}px`,
52376
+ left: `${HEADER_WIDTH}px`,
52377
+ height: `calc(100% - ${HEADER_HEIGHT + scrollbarWidth}px)`,
52378
+ width: `calc(100% - ${HEADER_WIDTH + scrollbarWidth}px)`
52324
52379
  });
52325
52380
  }
52326
52381
  onClosePopover() {
@@ -52497,8 +52552,8 @@ stores.inject(MyMetaStore, storeInstance);
52497
52552
  const zone = this.env.model.getters.getSelectedZone();
52498
52553
  const rect = this.env.model.getters.getVisibleRect(zone);
52499
52554
  return {
52500
- x: rect.x + rect.width - 8 / 2,
52501
- y: rect.y + rect.height - 8 / 2
52555
+ x: rect.x + rect.width - AUTOFILL_EDGE_LENGTH / 2,
52556
+ y: rect.y + rect.height - AUTOFILL_EDGE_LENGTH / 2
52502
52557
  };
52503
52558
  }
52504
52559
  get isAutofillVisible() {
@@ -52514,10 +52569,10 @@ stores.inject(MyMetaStore, storeInstance);
52514
52569
  onGridResized() {
52515
52570
  const { height, width } = this.props.getGridSize();
52516
52571
  this.env.model.dispatch("RESIZE_SHEETVIEW", {
52517
- width: width - 48,
52518
- height: height - 26,
52519
- gridOffsetX: 48,
52520
- gridOffsetY: 26
52572
+ width: width - HEADER_WIDTH,
52573
+ height: height - HEADER_HEIGHT,
52574
+ gridOffsetX: HEADER_WIDTH,
52575
+ gridOffsetY: HEADER_HEIGHT
52521
52576
  });
52522
52577
  }
52523
52578
  moveCanvas(deltaX, deltaY) {
@@ -52855,7 +52910,7 @@ stores.inject(MyMetaStore, storeInstance);
52855
52910
  get style() {
52856
52911
  const cellStyle = this.env.model.getters.getCellComputedStyle(this.props.position);
52857
52912
  return cssPropertiesToCss({
52858
- color: cellStyle.textColor || "#374151C2",
52913
+ color: cellStyle.textColor || TEXT_BODY_MUTED,
52859
52914
  "background-color": this.getBackgroundColor(cellStyle)
52860
52915
  });
52861
52916
  }
@@ -53665,8 +53720,8 @@ stores.inject(MyMetaStore, storeInstance);
53665
53720
  case "DUPLICATE_SHEET": {
53666
53721
  const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
53667
53722
  for (const fig of sheetFiguresFrom) if (fig.tag === "carousel") {
53668
- const figureIdBase = fig.id.split("??").pop();
53669
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
53723
+ const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
53724
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
53670
53725
  const carousel = this.getCarousel(fig.id);
53671
53726
  if (carousel) {
53672
53727
  const size = {
@@ -53682,8 +53737,8 @@ stores.inject(MyMetaStore, storeInstance);
53682
53737
  size,
53683
53738
  definition: { items: carousel.items.map((item) => {
53684
53739
  if (item.type === "carouselDataView") return { ...item };
53685
- const chartIdBase = item.chartId.split("??").pop();
53686
- const newChartId = `${cmd.sheetIdTo}${"??"}${chartIdBase}`;
53740
+ const chartIdBase = item.chartId.split(FIGURE_ID_SPLITTER).pop();
53741
+ const newChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
53687
53742
  return {
53688
53743
  ...item,
53689
53744
  chartId: newChartId
@@ -54251,10 +54306,10 @@ stores.inject(MyMetaStore, storeInstance);
54251
54306
  if (!chart || !figureId) continue;
54252
54307
  const fig = this.getters.getFigure(cmd.sheetId, figureId);
54253
54308
  if (!fig) continue;
54254
- const figureIdBase = figureId.split("??").pop();
54255
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
54256
- const chartIdBase = chartId.split("??").pop();
54257
- const duplicatedChartId = `${cmd.sheetIdTo}${"??"}${chartIdBase}`;
54309
+ const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
54310
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
54311
+ const chartIdBase = chartId.split(FIGURE_ID_SPLITTER).pop();
54312
+ const duplicatedChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
54258
54313
  const newChart = chart.duplicateInDuplicatedSheet(cmd.sheetIdTo);
54259
54314
  if (newChart) this.dispatch("CREATE_CHART", {
54260
54315
  figureId: duplicatedFigureId,
@@ -54361,8 +54416,8 @@ stores.inject(MyMetaStore, storeInstance);
54361
54416
  * Add a figure with tag chart with the given id at the given position
54362
54417
  */
54363
54418
  addFigure(figureId, sheetId, col, row, offset, size = {
54364
- width: 536,
54365
- height: 335
54419
+ width: DEFAULT_FIGURE_WIDTH,
54420
+ height: DEFAULT_FIGURE_HEIGHT
54366
54421
  }) {
54367
54422
  this.dispatch("CREATE_FIGURE", {
54368
54423
  sheetId,
@@ -55084,8 +55139,8 @@ stores.inject(MyMetaStore, storeInstance);
55084
55139
  const figureId = figure.id;
55085
55140
  const fig = this.figures[cmd.sheetId]?.[figureId];
55086
55141
  if (!fig) continue;
55087
- const figureIdBase = figureId.split("??").pop();
55088
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
55142
+ const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
55143
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
55089
55144
  this.dispatch("CREATE_FIGURE", {
55090
55145
  figureId: duplicatedFigureId,
55091
55146
  ...fig,
@@ -55123,11 +55178,11 @@ stores.inject(MyMetaStore, storeInstance);
55123
55178
  const numHeader = this.getters.getNumberRows(sheetId);
55124
55179
  const remainingSize = new Array(numHeader + 1);
55125
55180
  remainingSize[numHeader] = 0;
55126
- for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ?? 23);
55181
+ for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ?? DEFAULT_CELL_HEIGHT);
55127
55182
  for (const figure of this.getFigures(sheetId)) if (figure.offset.y + figure.height > remainingSize[figure.row]) {
55128
55183
  let y = figure.offset.y;
55129
55184
  let row = figure.row;
55130
- for (let row_size = this.getters.getUserRowSize(sheetId, row) ?? 23; row_size < y; row_size = this.getters.getUserRowSize(sheetId, row) ?? 23) {
55185
+ for (let row_size = this.getters.getUserRowSize(sheetId, row) ?? DEFAULT_CELL_HEIGHT; row_size < y; row_size = this.getters.getUserRowSize(sheetId, row) ?? DEFAULT_CELL_HEIGHT) {
55131
55186
  row += 1;
55132
55187
  y -= row_size;
55133
55188
  }
@@ -55152,7 +55207,7 @@ stores.inject(MyMetaStore, storeInstance);
55152
55207
  let rowNum, colNum;
55153
55208
  let { col, row } = figure;
55154
55209
  const offset = { ...figure.offset };
55155
- for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ?? 23;
55210
+ for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ?? DEFAULT_CELL_HEIGHT;
55156
55211
  if (row > rowNum) {
55157
55212
  row = rowNum;
55158
55213
  offset.y = Math.max(availableHeight - figure.height, 0);
@@ -55633,7 +55688,7 @@ stores.inject(MyMetaStore, storeInstance);
55633
55688
  }
55634
55689
  }
55635
55690
  getColSize(sheetId, index) {
55636
- return Math.round(this.sizes[sheetId]?.["COL"][index] || 96);
55691
+ return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
55637
55692
  }
55638
55693
  getUserRowSize(sheetId, index) {
55639
55694
  const rowSize = this.sizes[sheetId]?.["ROW"][index];
@@ -55666,7 +55721,7 @@ stores.inject(MyMetaStore, storeInstance);
55666
55721
  if (sheet.rows === void 0) sheet.rows = {};
55667
55722
  for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
55668
55723
  ...sheet.rows[row],
55669
- size: this.getUserRowSize(sheet.id, row) ?? 23
55724
+ size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
55670
55725
  };
55671
55726
  if (sheet.cols === void 0) sheet.cols = {};
55672
55727
  for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
@@ -55847,8 +55902,8 @@ stores.inject(MyMetaStore, storeInstance);
55847
55902
  case "DUPLICATE_SHEET": {
55848
55903
  const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
55849
55904
  for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
55850
- const figureIdBase = fig.id.split("??").pop();
55851
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
55905
+ const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
55906
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
55852
55907
  const image = this.getImage(fig.id);
55853
55908
  if (image) {
55854
55909
  const size = {
@@ -59612,8 +59667,8 @@ stores.inject(MyMetaStore, storeInstance);
59612
59667
  hoverSvg: value ? CHECKBOX_CHECKED : CHECKBOX_UNCHECKED_HOVERED,
59613
59668
  priority: 2,
59614
59669
  horizontalAlign: "center",
59615
- size: 17,
59616
- margin: 2,
59670
+ size: GRID_ICON_EDGE_LENGTH,
59671
+ margin: GRID_ICON_MARGIN,
59617
59672
  position,
59618
59673
  type: "data_validation_checkbox",
59619
59674
  onClick: (position, env) => {
@@ -59657,8 +59712,8 @@ stores.inject(MyMetaStore, storeInstance);
59657
59712
  hoverSvg: getHoveredCaretDownSvg(cellStyle),
59658
59713
  priority: 2,
59659
59714
  horizontalAlign: "right",
59660
- size: 17,
59661
- margin: 2,
59715
+ size: GRID_ICON_EDGE_LENGTH,
59716
+ margin: GRID_ICON_MARGIN,
59662
59717
  position,
59663
59718
  onClick: (position, env) => {
59664
59719
  const { col, row } = position;
@@ -59679,7 +59734,7 @@ stores.inject(MyMetaStore, storeInstance);
59679
59734
  priority: 1,
59680
59735
  horizontalAlign: "left",
59681
59736
  size: computeTextFontSizeInPixels(style),
59682
- margin: 4,
59737
+ margin: MIN_CF_ICON_MARGIN,
59683
59738
  position
59684
59739
  };
59685
59740
  }
@@ -59694,13 +59749,13 @@ stores.inject(MyMetaStore, storeInstance);
59694
59749
  const fields = pivotCell.dimension === "COL" ? definition.columns : definition.rows;
59695
59750
  const hasIcon = !isDashboard && !getters.shouldShowFormulas() && pivotCell.domain.length !== fields.length;
59696
59751
  const isCollapsed = (definition.collapsedDomains?.[pivotCell.dimension] ?? []).some((domain) => deepEquals(domain, pivotCell.domain));
59697
- const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * 15 : 0;
59752
+ const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * PIVOT_INDENT : 0;
59698
59753
  return {
59699
59754
  type: "pivot_collapse",
59700
59755
  priority: 4,
59701
59756
  horizontalAlign: "left",
59702
- size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ? 12 : 0,
59703
- margin: hasIcon ? 2 * 2 + indent : indent,
59757
+ size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ? PIVOT_COLLAPSE_ICON_SIZE : 0,
59758
+ margin: hasIcon ? GRID_ICON_MARGIN * 2 + indent : indent,
59704
59759
  svg: hasIcon ? getPivotIconSvg(isCollapsed, false) : void 0,
59705
59760
  hoverSvg: hasIcon ? getPivotIconSvg(isCollapsed, true) : void 0,
59706
59761
  position,
@@ -59718,8 +59773,8 @@ stores.inject(MyMetaStore, storeInstance);
59718
59773
  type: `pivot_dashboard_sorting_${sortDirection}`,
59719
59774
  priority: 5,
59720
59775
  horizontalAlign: "right",
59721
- size: 17,
59722
- margin: 2,
59776
+ size: GRID_ICON_EDGE_LENGTH,
59777
+ margin: GRID_ICON_MARGIN,
59723
59778
  svg: sortDirection === "asc" ? getCaretUpSvg(cellStyle) : getCaretDownSvg(cellStyle),
59724
59779
  position,
59725
59780
  onClick: void 0
@@ -60258,7 +60313,7 @@ stores.inject(MyMetaStore, storeInstance);
60258
60313
  col,
60259
60314
  row
60260
60315
  });
60261
- const background = style.fillColor || "#FFFFFF";
60316
+ const background = style.fillColor || BACKGROUND_CHART_COLOR;
60262
60317
  return {
60263
60318
  background,
60264
60319
  fontColor: style.textColor || chartFontColor(background)
@@ -60555,7 +60610,7 @@ stores.inject(MyMetaStore, storeInstance);
60555
60610
  return this.getDataValidationStyle(position);
60556
60611
  }
60557
60612
  getDataValidationChipStyle(position) {
60558
- if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor: "#E7E9ED" };
60613
+ if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor: GRAY_200 };
60559
60614
  }
60560
60615
  getInvalidDataValidationMessage(cellPosition) {
60561
60616
  const validationResult = this.getValidationResultForCell(cellPosition);
@@ -60751,7 +60806,7 @@ stores.inject(MyMetaStore, storeInstance);
60751
60806
  }
60752
60807
  }
60753
60808
  getRowSize(sheetId, row) {
60754
- return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? 23);
60809
+ return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? DEFAULT_CELL_HEIGHT);
60755
60810
  }
60756
60811
  getMaxAnchorOffset(sheetId, height, width) {
60757
60812
  let { numberOfRows: row, numberOfCols: col } = this.getters.getSheetSize(sheetId);
@@ -60789,8 +60844,8 @@ stores.inject(MyMetaStore, storeInstance);
60789
60844
  col,
60790
60845
  row
60791
60846
  });
60792
- if (updatedCellHeight <= 23) return;
60793
- if (!tallestCellInRow && updatedCellHeight > 23 || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
60847
+ if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
60848
+ if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
60794
60849
  const newTallestCell = {
60795
60850
  cell: {
60796
60851
  sheetId,
@@ -60815,7 +60870,7 @@ stores.inject(MyMetaStore, storeInstance);
60815
60870
  * merge, or the height of the cell computed based on its style/content.
60816
60871
  */
60817
60872
  getCellHeight(position) {
60818
- if (this.isInMultiRowMerge(position)) return 23;
60873
+ if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
60819
60874
  const cell = this.getters.getCell(position);
60820
60875
  const style = this.getters.getCellStyle(position);
60821
60876
  const colSize = this.getters.getColSize(position.sheetId, position.col);
@@ -60838,7 +60893,7 @@ stores.inject(MyMetaStore, storeInstance);
60838
60893
  if (!cell) continue;
60839
60894
  const position = this.getters.getCellPosition(cell.id);
60840
60895
  const cellHeight = this.getCellHeight(position);
60841
- if (cellHeight > maxHeight && cellHeight > 23) {
60896
+ if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
60842
60897
  maxHeight = cellHeight;
60843
60898
  tallestCell = {
60844
60899
  cell: position,
@@ -60846,7 +60901,7 @@ stores.inject(MyMetaStore, storeInstance);
60846
60901
  };
60847
60902
  }
60848
60903
  }
60849
- if (tallestCell && tallestCell.size > 23) return tallestCell;
60904
+ if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
60850
60905
  }
60851
60906
  };
60852
60907
 
@@ -61234,7 +61289,7 @@ stores.inject(MyMetaStore, storeInstance);
61234
61289
  * @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
61235
61290
  */
61236
61291
  getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
61237
- const comparedDomain = valueToCompare === "(previous)" || valueToCompare === "(next)" ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
61292
+ const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
61238
61293
  if (deepEquals(comparedDomain, domain)) return "sameValue";
61239
61294
  if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
61240
61295
  const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
@@ -63905,7 +63960,7 @@ stores.inject(MyMetaStore, storeInstance);
63905
63960
  this.revisions = revisions;
63906
63961
  this.transportService = transportService;
63907
63962
  this.serverRevisionId = serverRevisionId;
63908
- this.debouncedMove = debounce(this._move.bind(this), 200);
63963
+ this.debouncedMove = debounce(this._move.bind(this), DEBOUNCE_TIME);
63909
63964
  }
63910
63965
  canApplyOptimisticUpdate() {
63911
63966
  return !this.waitingUndoRedoAck;
@@ -63922,7 +63977,7 @@ stores.inject(MyMetaStore, storeInstance);
63922
63977
  this.trigger("new-local-state-update", { id: revision.id });
63923
63978
  this.sendUpdateMessage({
63924
63979
  type: "REMOTE_REVISION",
63925
- version: 1,
63980
+ version: MESSAGE_VERSION,
63926
63981
  serverRevisionId: this.serverRevisionId,
63927
63982
  nextRevisionId: revision.id,
63928
63983
  clientId: revision.clientId,
@@ -63933,7 +63988,7 @@ stores.inject(MyMetaStore, storeInstance);
63933
63988
  this.waitingUndoRedoAck = true;
63934
63989
  this.sendUpdateMessage({
63935
63990
  type: "REVISION_UNDONE",
63936
- version: 1,
63991
+ version: MESSAGE_VERSION,
63937
63992
  serverRevisionId: this.serverRevisionId,
63938
63993
  nextRevisionId: this.uuidGenerator.uuidv4(),
63939
63994
  undoneRevisionId: revisionId
@@ -63943,7 +63998,7 @@ stores.inject(MyMetaStore, storeInstance);
63943
63998
  this.waitingUndoRedoAck = true;
63944
63999
  this.sendUpdateMessage({
63945
64000
  type: "REVISION_REDONE",
63946
- version: 1,
64001
+ version: MESSAGE_VERSION,
63947
64002
  serverRevisionId: this.serverRevisionId,
63948
64003
  nextRevisionId: this.uuidGenerator.uuidv4(),
63949
64004
  redoneRevisionId: revisionId
@@ -63990,7 +64045,7 @@ stores.inject(MyMetaStore, storeInstance);
63990
64045
  this.sendToTransport({
63991
64046
  type: "CLIENT_LEFT",
63992
64047
  clientId: this.clientId,
63993
- version: 1
64048
+ version: MESSAGE_VERSION
63994
64049
  });
63995
64050
  }
63996
64051
  /**
@@ -64007,7 +64062,7 @@ stores.inject(MyMetaStore, storeInstance);
64007
64062
  ...data,
64008
64063
  revisionId: snapshotId
64009
64064
  },
64010
- version: 1
64065
+ version: MESSAGE_VERSION
64011
64066
  });
64012
64067
  }
64013
64068
  getCurrentClient() {
@@ -64048,7 +64103,7 @@ stores.inject(MyMetaStore, storeInstance);
64048
64103
  };
64049
64104
  this.sendToTransport({
64050
64105
  type,
64051
- version: 1,
64106
+ version: MESSAGE_VERSION,
64052
64107
  client: {
64053
64108
  ...client,
64054
64109
  position
@@ -64127,7 +64182,7 @@ stores.inject(MyMetaStore, storeInstance);
64127
64182
  const { position } = client;
64128
64183
  if (position) this.sendToTransport({
64129
64184
  type: "CLIENT_MOVED",
64130
- version: 1,
64185
+ version: MESSAGE_VERSION,
64131
64186
  client: {
64132
64187
  ...client,
64133
64188
  position
@@ -64916,7 +64971,7 @@ stores.inject(MyMetaStore, storeInstance);
64916
64971
  onNewLocalStateUpdate({ id }) {
64917
64972
  this.undoStack.push(id);
64918
64973
  this.redoStack = [];
64919
- if (this.undoStack.length > 99) this.undoStack.shift();
64974
+ if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
64920
64975
  }
64921
64976
  /**
64922
64977
  * Fetch the last revision which is not empty and not a repeated command
@@ -65159,7 +65214,7 @@ stores.inject(MyMetaStore, storeInstance);
65159
65214
  }
65160
65215
  getAutoSeparatorForString(str) {
65161
65216
  const separators = [
65162
- "\n",
65217
+ NEWLINE,
65163
65218
  ";",
65164
65219
  ",",
65165
65220
  " ",
@@ -65493,9 +65548,9 @@ stores.inject(MyMetaStore, storeInstance);
65493
65548
  contentWidth += computeMultilineTextSize(this.ctx, multiLineText, style).width;
65494
65549
  }
65495
65550
  for (const icon of this.getters.getCellIcons(position)) contentWidth += icon.margin + icon.size;
65496
- if (this.getters.getDataValidationChipStyle(position)) contentWidth += 5 * 2;
65551
+ if (this.getters.getDataValidationChipStyle(position)) contentWidth += DATA_VALIDATION_CHIP_MARGIN * 2;
65497
65552
  if (contentWidth === 0) return 0;
65498
- contentWidth += 2 * 4;
65553
+ contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
65499
65554
  if (style.wrapping === "wrap") {
65500
65555
  const colWidth = this.getters.getColSize(position.sheetId, position.col);
65501
65556
  return Math.min(colWidth, contentWidth);
@@ -65547,11 +65602,11 @@ stores.inject(MyMetaStore, storeInstance);
65547
65602
  computeTextYCoordinate(cellRect, textLineHeight, verticalAlign = DEFAULT_VERTICAL_ALIGN, numberOfLines = 1) {
65548
65603
  const y = cellRect.y + 1;
65549
65604
  const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
65550
- if (cellRect.height > textHeight + 4 * 2) {
65605
+ if (cellRect.height > textHeight + MIN_CELL_TEXT_MARGIN * 2) {
65551
65606
  if (verticalAlign === "middle") return Math.ceil(y + (cellRect.height - textHeight) / 2);
65552
- if (verticalAlign === "bottom") return y + cellRect.height - textHeight - 4;
65607
+ if (verticalAlign === "bottom") return y + cellRect.height - textHeight - MIN_CELL_TEXT_MARGIN;
65553
65608
  }
65554
- return y + 4;
65609
+ return y + MIN_CELL_TEXT_MARGIN;
65555
65610
  }
65556
65611
  /**
65557
65612
  * Expands the given zone until bordered by empty cells or reached the sheet boundaries.
@@ -65655,7 +65710,7 @@ stores.inject(MyMetaStore, storeInstance);
65655
65710
  const style = this.getters.getCellStyle(position);
65656
65711
  const content = evaluatedCell.formattedValue;
65657
65712
  const evaluatedSize = getCellContentHeight(this.ctx, content, style, colSize);
65658
- if (evaluatedSize > evaluatedRowSize && evaluatedSize > 23) {
65713
+ if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
65659
65714
  evaluatedRowSize = evaluatedSize;
65660
65715
  tallestCell = position;
65661
65716
  }
@@ -66310,7 +66365,7 @@ stores.inject(MyMetaStore, storeInstance);
66310
66365
  const imageUrl = this.getters.getImage(figureId).path;
66311
66366
  file = await this.fileStore?.getFile(imageUrl);
66312
66367
  if (file.type !== "image/png") {
66313
- if (file.size > 5242880) {
66368
+ if (file.size > MAX_FILE_SIZE) {
66314
66369
  this.ui.notifyUI({
66315
66370
  text: _t("The file you are trying to copy is too large (>%sMB).\nIt will not be added to your OS clipboard.\nYou can download it directly instead.", Math.round(MAX_FILE_SIZE / (1024 * 1024))),
66316
66371
  sticky: false,
@@ -67435,7 +67490,7 @@ stores.inject(MyMetaStore, storeInstance);
67435
67490
  let height = lastRowEnd - this.offsetCorrectionY;
67436
67491
  if (this.canScrollVertically) {
67437
67492
  height = Math.max(height, this.viewportHeight);
67438
- if (lastRowEnd + 46 > height && !this.getters.isReadonly() && this.viewportHeight > 46) height += 46;
67493
+ if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly() && this.viewportHeight > FOOTER_HEIGHT) height += FOOTER_HEIGHT;
67439
67494
  }
67440
67495
  return {
67441
67496
  width,
@@ -67954,7 +68009,7 @@ stores.inject(MyMetaStore, storeInstance);
67954
68009
  return this.getSubViewports(sheetId).some((pane) => pane.isVisible(col, row));
67955
68010
  }
67956
68011
  getScrollBarWidth() {
67957
- return 15 / this.zoomLevel;
68012
+ return SCROLLBAR_WIDTH / this.zoomLevel;
67958
68013
  }
67959
68014
  getEdgeScrollCol(x, previousX, startingX) {
67960
68015
  let canEdgeScroll = false;
@@ -68467,8 +68522,8 @@ stores.inject(MyMetaStore, storeInstance);
68467
68522
  text: value.value,
68468
68523
  htmlContent: [{
68469
68524
  value: value.label,
68470
- color: chipTextColor(color || "#E7E9ED"),
68471
- backgroundColor: color || "#E7E9ED",
68525
+ color: chipTextColor(color || GRAY_200),
68526
+ backgroundColor: color || GRAY_200,
68472
68527
  classes: ["badge rounded-pill fs-6 fw-normal w-100 mt-1 text-start"]
68473
68528
  }],
68474
68529
  fuzzySearchKey: value.label
@@ -68908,8 +68963,8 @@ stores.inject(MyMetaStore, storeInstance);
68908
68963
  hoverSvg: getDataFilterIcon(isFilterActive, isHighContrast, true),
68909
68964
  priority: 3,
68910
68965
  horizontalAlign: "right",
68911
- size: 17,
68912
- margin: 2,
68966
+ size: GRID_ICON_EDGE_LENGTH,
68967
+ margin: GRID_ICON_MARGIN,
68913
68968
  position,
68914
68969
  onClick: (position, env) => {
68915
68970
  const cellPopovers = env.getStore(CellPopoverStore);
@@ -70800,16 +70855,16 @@ stores.inject(MyMetaStore, storeInstance);
70800
70855
  const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
70801
70856
  const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
70802
70857
  let groupHeaderY = 0;
70803
- let groupHeaderHeight = 26;
70858
+ let groupHeaderHeight = HEADER_HEIGHT;
70804
70859
  if (startRow !== 0) {
70805
70860
  const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
70806
- groupHeaderY = 26 + headerRowDims.start;
70861
+ groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
70807
70862
  groupHeaderHeight = headerRowDims.end - headerRowDims.start;
70808
70863
  }
70809
70864
  const headerRect = {
70810
70865
  x: this.props.layerOffset,
70811
70866
  y: groupHeaderY,
70812
- width: 21,
70867
+ width: GROUP_LAYER_WIDTH,
70813
70868
  height: groupHeaderHeight
70814
70869
  };
70815
70870
  return {
@@ -70817,7 +70872,7 @@ stores.inject(MyMetaStore, storeInstance);
70817
70872
  groupRect: {
70818
70873
  x: this.props.layerOffset,
70819
70874
  y: headerRect.y,
70820
- width: 21,
70875
+ width: GROUP_LAYER_WIDTH,
70821
70876
  height: headerRect.height + (endCoordinates - startCoordinates)
70822
70877
  },
70823
70878
  isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
@@ -70850,17 +70905,17 @@ stores.inject(MyMetaStore, storeInstance);
70850
70905
  const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
70851
70906
  const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
70852
70907
  let groupHeaderX = 0;
70853
- let groupHeaderWidth = 48;
70908
+ let groupHeaderWidth = HEADER_WIDTH;
70854
70909
  if (startCol !== 0) {
70855
70910
  const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
70856
- groupHeaderX = 48 + headerRowDims.start;
70911
+ groupHeaderX = HEADER_WIDTH + headerRowDims.start;
70857
70912
  groupHeaderWidth = headerRowDims.end - headerRowDims.start;
70858
70913
  }
70859
70914
  const headerRect = {
70860
70915
  x: groupHeaderX,
70861
70916
  y: this.props.layerOffset,
70862
70917
  width: groupHeaderWidth,
70863
- height: 21
70918
+ height: GROUP_LAYER_WIDTH
70864
70919
  };
70865
70920
  return {
70866
70921
  headerRect,
@@ -70868,7 +70923,7 @@ stores.inject(MyMetaStore, storeInstance);
70868
70923
  x: headerRect.x,
70869
70924
  y: this.props.layerOffset,
70870
70925
  width: headerRect.width + (endCoordinates - startCoordinates),
70871
- height: 21
70926
+ height: GROUP_LAYER_WIDTH
70872
70927
  },
70873
70928
  isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
70874
70929
  };
@@ -70894,7 +70949,7 @@ stores.inject(MyMetaStore, storeInstance);
70894
70949
  menuItems: []
70895
70950
  });
70896
70951
  getLayerOffset(layerIndex) {
70897
- return layerIndex * 21;
70952
+ return layerIndex * GROUP_LAYER_WIDTH;
70898
70953
  }
70899
70954
  onContextMenu(event) {
70900
70955
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -70942,8 +70997,8 @@ stores.inject(MyMetaStore, storeInstance);
70942
70997
  get frozenPaneContainerSize() {
70943
70998
  if (!this.hasFrozenPane) return 0;
70944
70999
  const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
70945
- if (this.props.dimension === "COL") return 48 + viewportCoordinates.x;
70946
- else return 26 + viewportCoordinates.y;
71000
+ if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
71001
+ else return HEADER_HEIGHT + viewportCoordinates.y;
70947
71002
  }
70948
71003
  };
70949
71004
 
@@ -70952,7 +71007,7 @@ stores.inject(MyMetaStore, storeInstance);
70952
71007
  function useScreenWidth() {
70953
71008
  const spreadsheetRect = useSpreadsheetRect();
70954
71009
  return { get isSmall() {
70955
- return spreadsheetRect.width < 768;
71010
+ return spreadsheetRect.width < MOBILE_WIDTH_BREAKPOINT;
70956
71011
  } };
70957
71012
  }
70958
71013
 
@@ -71264,7 +71319,7 @@ stores.inject(MyMetaStore, storeInstance);
71264
71319
  "max-height": `${COMPOSER_MAX_HEIGHT}px`,
71265
71320
  "line-height": "24px"
71266
71321
  };
71267
- style.height = this.focus === "inactive" ? `${34}px` : "fit-content";
71322
+ style.height = this.focus === "inactive" ? `${DESKTOP_TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
71268
71323
  return cssPropertiesToCss(style);
71269
71324
  }
71270
71325
  onFocus(selection) {
@@ -72223,7 +72278,7 @@ stores.inject(MyMetaStore, storeInstance);
72223
72278
  const scrollbarWidth = this.env.model.getters.getScrollBarWidth();
72224
72279
  if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
72225
72280
  else properties["grid-template-rows"] = `min-content auto min-content`;
72226
- properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize || 350}px` : "auto"}`;
72281
+ properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize || DEFAULT_SIDE_PANEL_SIZE}px` : "auto"}`;
72227
72282
  properties["--os-scrollbar-width"] = `${scrollbarWidth}px`;
72228
72283
  properties["color-scheme"] = this.props.colorScheme;
72229
72284
  return cssPropertiesToCss(properties);
@@ -72310,7 +72365,7 @@ stores.inject(MyMetaStore, storeInstance);
72310
72365
  checkViewportSize() {
72311
72366
  const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
72312
72367
  if (!isFinite(xRatio) || !isFinite(yRatio)) return;
72313
- if (yRatio > .85 || xRatio > .85) {
72368
+ if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
72314
72369
  if (this.isViewportTooSmall) return;
72315
72370
  this.notificationStore.notifyUser({
72316
72371
  text: _t("The current window is too small to display this sheet properly. Consider resizing your browser window or adjusting frozen rows and columns."),
@@ -72328,8 +72383,8 @@ stores.inject(MyMetaStore, storeInstance);
72328
72383
  return this.env.model.getters.getSheetViewDimension().height;
72329
72384
  }
72330
72385
  get gridContainerStyle() {
72331
- const gridColSize = 21 * this.rowLayers.length;
72332
- const gridRowSize = 21 * this.colLayers.length;
72386
+ const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
72387
+ const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
72333
72388
  const zoom = this.env.model.getters.getViewportZoomLevel();
72334
72389
  return cssPropertiesToCss({
72335
72390
  "grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
@@ -74124,7 +74179,7 @@ stores.inject(MyMetaStore, storeInstance);
74124
74179
  let title = escapeXml``;
74125
74180
  if (chart.data.title?.text) {
74126
74181
  const titleColor = toXlsxHexColor(chartMutedFontColor(chart.data.backgroundColor));
74127
- const fontSize = chart.data.title.fontSize ?? 16;
74182
+ const fontSize = chart.data.title.fontSize ?? CHART_TITLE_FONT_SIZE;
74128
74183
  title = escapeXml`
74129
74184
  <c:title>
74130
74185
  ${insertText(chart.data.title.text, titleColor, fontSize, chart.data.title)}
@@ -74215,7 +74270,7 @@ stores.inject(MyMetaStore, storeInstance);
74215
74270
  </a:ln>
74216
74271
  `;
74217
74272
  }
74218
- function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
74273
+ function insertText(text, fontColor = "000000", fontsize = CHART_TITLE_FONT_SIZE, style = {}) {
74219
74274
  const textProperties = [
74220
74275
  ["b", style.bold ? "1" : "0"],
74221
74276
  ["i", style.italic ? "1" : "0"],
@@ -74778,7 +74833,7 @@ stores.inject(MyMetaStore, storeInstance);
74778
74833
  return escapeXml`
74779
74834
  <c:doughnutChart>
74780
74835
  <c:varyColors val="1" />
74781
- <c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ? 50 : 0)}" />
74836
+ <c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ? DEFAULT_DOUGHNUT_CHART_HOLE_SIZE : 0)}" />
74782
74837
  ${insertDataLabels()}
74783
74838
  ${joinXmlNodes(dataSetsNodes)}
74784
74839
  </c:doughnutChart>
@@ -74799,7 +74854,7 @@ stores.inject(MyMetaStore, storeInstance);
74799
74854
  }
74800
74855
  function addAx(position, axisName, axId, crossAxId, title, defaultFontColor, deleteAxis = 0, orientation = "minMax", crossPosition, tickLabelPosition = "nextTo", maxValue, majorUnit, format = "General") {
74801
74856
  const color = title?.color ? toXlsxHexColor(title.color) : defaultFontColor;
74802
- const fontSize = title?.fontSize ?? 12;
74857
+ const fontSize = title?.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE;
74803
74858
  const crossBetweenEl = axisName === "c:valAx" ? escapeXml`<c:crossBetween val="between" />` : "";
74804
74859
  const maxValueEl = maxValue ? escapeXml`<c:max val="${maxValue}" />` : "";
74805
74860
  const minValueEl = maxValue ? escapeXml`<c:min val="${-maxValue}" />` : "";
@@ -75416,12 +75471,12 @@ stores.inject(MyMetaStore, storeInstance);
75416
75471
  let currentPosition = 0;
75417
75472
  for (const [headerIndex, header] of headers.slice(anchor).entries()) if (currentPosition <= offset && offset < currentPosition + header.size) return {
75418
75473
  index: anchor + headerIndex,
75419
- offset: convertDotValueToEMU(offset - currentPosition + 1)
75474
+ offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
75420
75475
  };
75421
75476
  else if (headerIndex < headers.length - 1) currentPosition += header.size;
75422
75477
  return {
75423
75478
  index: headers.length - 1,
75424
- offset: convertDotValueToEMU(offset - currentPosition + 1)
75479
+ offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
75425
75480
  };
75426
75481
  }
75427
75482
  function createChartDrawing(figure, sheet, chartRelId, construct) {
@@ -75520,7 +75575,7 @@ stores.inject(MyMetaStore, storeInstance);
75520
75575
  function addNumberFormats(numFmts) {
75521
75576
  const numFmtNodes = [];
75522
75577
  for (const [index, numFmt] of Object.entries(numFmts)) {
75523
- const numFmtAttrs = [["numFmtId", parseInt(index) + 164], ["formatCode", numFmt.format]];
75578
+ const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
75524
75579
  numFmtNodes.push(escapeXml`
75525
75580
  <numFmt ${formatAttributes(numFmtAttrs)}/>
75526
75581
  `);
@@ -75753,7 +75808,7 @@ stores.inject(MyMetaStore, storeInstance);
75753
75808
  const attributes = [
75754
75809
  ["min", parseInt(id) + 1],
75755
75810
  ["max", parseInt(id) + 1],
75756
- ["width", convertWidthToExcel(col.size || 96)],
75811
+ ["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
75757
75812
  ["customWidth", 1],
75758
75813
  ["hidden", col.isHidden ? 1 : 0]
75759
75814
  ];
@@ -75777,7 +75832,7 @@ stores.inject(MyMetaStore, storeInstance);
75777
75832
  for (let r = 0; r < sheet.rowNumber; r++) {
75778
75833
  const rowAttrs = [["r", r + 1]];
75779
75834
  const row = sheet.rows[r] || {};
75780
- if (row.size && row.size !== 23) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
75835
+ if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
75781
75836
  if (row.isHidden) rowAttrs.push(["hidden", 1]);
75782
75837
  if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
75783
75838
  if (row.collapsed) rowAttrs.push(["collapsed", 1]);
@@ -75819,7 +75874,7 @@ stores.inject(MyMetaStore, storeInstance);
75819
75874
  </c>`);
75820
75875
  }
75821
75876
  }
75822
- if (cellNodes.length || row.size !== 23 || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
75877
+ if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
75823
75878
  <row ${formatAttributes(rowAttrs)}>
75824
75879
  ${joinXmlNodes(cellNodes)}
75825
75880
  </row>
@@ -75992,7 +76047,7 @@ stores.inject(MyMetaStore, storeInstance);
75992
76047
  let currentTableIndex = 1;
75993
76048
  for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
75994
76049
  const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
75995
- const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(23)], ["defaultColWidth", convertWidthToExcel(96)]];
76050
+ const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
75996
76051
  const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
75997
76052
  currentTableIndex += sheet.tables.length;
75998
76053
  let drawingNode = escapeXml``;
@@ -76661,7 +76716,7 @@ stores.inject(MyMetaStore, storeInstance);
76661
76716
  exportData() {
76662
76717
  let data = createEmptyWorkbookData();
76663
76718
  for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data);
76664
- data.revisionId = this.session.getRevisionId() || "START_REVISION";
76719
+ data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
76665
76720
  data = deepCopy(data);
76666
76721
  return data;
76667
76722
  }
@@ -76814,10 +76869,10 @@ stores.inject(MyMetaStore, storeInstance);
76814
76869
  chartShowValuesPlugin: getCalendarChartShowValues(definition, chartData),
76815
76870
  chartColorScalePlugin: getCalendarColorScale(definition, chartData)
76816
76871
  },
76817
- chartBackground: definition.background || "#FFFFFF"
76872
+ chartBackground: definition.background || BACKGROUND_CHART_COLOR
76818
76873
  }
76819
76874
  },
76820
- background: chart.background || "#FFFFFF"
76875
+ background: chart.background || BACKGROUND_CHART_COLOR
76821
76876
  };
76822
76877
  }
76823
76878
 
@@ -76899,7 +76954,7 @@ stores.inject(MyMetaStore, storeInstance);
76899
76954
  const definition = this.getDefinition();
76900
76955
  return {
76901
76956
  ...definition,
76902
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
76957
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
76903
76958
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
76904
76959
  dataSets,
76905
76960
  labelRange,
@@ -76963,7 +77018,7 @@ stores.inject(MyMetaStore, storeInstance);
76963
77018
  }
76964
77019
  }
76965
77020
  },
76966
- background: chart.background || "#FFFFFF"
77021
+ background: chart.background || BACKGROUND_CHART_COLOR
76967
77022
  };
76968
77023
  }
76969
77024
 
@@ -77098,7 +77153,7 @@ stores.inject(MyMetaStore, storeInstance);
77098
77153
  }
77099
77154
  }
77100
77155
  },
77101
- background: chart.background || "#FFFFFF"
77156
+ background: chart.background || BACKGROUND_CHART_COLOR
77102
77157
  };
77103
77158
  }
77104
77159
 
@@ -77213,7 +77268,7 @@ stores.inject(MyMetaStore, storeInstance);
77213
77268
  }
77214
77269
  }
77215
77270
  },
77216
- background: chart.background || "#FFFFFF"
77271
+ background: chart.background || BACKGROUND_CHART_COLOR
77217
77272
  };
77218
77273
  }
77219
77274
 
@@ -77320,7 +77375,7 @@ stores.inject(MyMetaStore, storeInstance);
77320
77375
  return {
77321
77376
  ...definition,
77322
77377
  horizontal: true,
77323
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
77378
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
77324
77379
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
77325
77380
  dataSets,
77326
77381
  labelRange,
@@ -77357,7 +77412,7 @@ stores.inject(MyMetaStore, storeInstance);
77357
77412
  }
77358
77413
  }
77359
77414
  },
77360
- background: chart.background || "#FFFFFF"
77415
+ background: chart.background || BACKGROUND_CHART_COLOR
77361
77416
  };
77362
77417
  }
77363
77418
 
@@ -77462,7 +77517,7 @@ stores.inject(MyMetaStore, storeInstance);
77462
77517
  const { dataSets, labelRange } = this.getCommonDataSetAttributesForExcel(this.labelRange, this.dataSets, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
77463
77518
  return {
77464
77519
  ...this.getDefinition(),
77465
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
77520
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
77466
77521
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
77467
77522
  dataSets,
77468
77523
  labelRange
@@ -77496,7 +77551,7 @@ stores.inject(MyMetaStore, storeInstance);
77496
77551
  }
77497
77552
  }
77498
77553
  },
77499
- background: chart.background || "#FFFFFF"
77554
+ background: chart.background || BACKGROUND_CHART_COLOR
77500
77555
  };
77501
77556
  }
77502
77557
 
@@ -77619,7 +77674,7 @@ stores.inject(MyMetaStore, storeInstance);
77619
77674
  }
77620
77675
  }
77621
77676
  },
77622
- background: chart.background || "#FFFFFF"
77677
+ background: chart.background || BACKGROUND_CHART_COLOR
77623
77678
  };
77624
77679
  }
77625
77680
 
@@ -77755,7 +77810,7 @@ stores.inject(MyMetaStore, storeInstance);
77755
77810
  }
77756
77811
  }
77757
77812
  },
77758
- background: chart.background || "#FFFFFF"
77813
+ background: chart.background || BACKGROUND_CHART_COLOR
77759
77814
  };
77760
77815
  }
77761
77816
 
@@ -78958,14 +79013,14 @@ stores.inject(MyMetaStore, storeInstance);
78958
79013
  */
78959
79014
  const __info__ = {};
78960
79015
  const SPREADSHEET_DIMENSIONS = {
78961
- MIN_ROW_HEIGHT: 10,
78962
- MIN_COL_WIDTH: 5,
78963
- HEADER_HEIGHT: 26,
78964
- HEADER_WIDTH: 48,
78965
- DESKTOP_BOTTOMBAR_HEIGHT: 36,
78966
- DEFAULT_CELL_WIDTH: 96,
78967
- DEFAULT_CELL_HEIGHT: 23,
78968
- SCROLLBAR_WIDTH: 15
79016
+ MIN_ROW_HEIGHT,
79017
+ MIN_COL_WIDTH,
79018
+ HEADER_HEIGHT,
79019
+ HEADER_WIDTH,
79020
+ DESKTOP_BOTTOMBAR_HEIGHT,
79021
+ DEFAULT_CELL_WIDTH,
79022
+ DEFAULT_CELL_HEIGHT,
79023
+ SCROLLBAR_WIDTH
78969
79024
  };
78970
79025
  const registries = {
78971
79026
  autoCompleteProviders,
@@ -79183,9 +79238,9 @@ stores.inject(MyMetaStore, storeInstance);
79183
79238
  HIGHLIGHT_COLOR,
79184
79239
  PIVOT_TABLE_CONFIG,
79185
79240
  ChartTerms,
79186
- FIGURE_ID_SPLITTER: "??",
79187
- GRID_ICON_EDGE_LENGTH: 17,
79188
- GRID_ICON_MARGIN: 2
79241
+ FIGURE_ID_SPLITTER,
79242
+ GRID_ICON_EDGE_LENGTH,
79243
+ GRID_ICON_MARGIN
79189
79244
  };
79190
79245
  const chartHelpers = {
79191
79246
  ...charts_exports,
@@ -79248,8 +79303,8 @@ exports.stores = stores;
79248
79303
  exports.tokenColors = tokenColors;
79249
79304
  exports.tokenize = tokenize;
79250
79305
 
79251
- __info__.version = "19.1.36";
79252
- __info__.date = "2026-09-18T05:25:25.806Z";
79253
- __info__.hash = "5661311";
79306
+ __info__.version = "19.1.37";
79307
+ __info__.date = "2026-10-01T07:46:03.212Z";
79308
+ __info__.hash = "fe8ce23";
79254
79309
 
79255
79310
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);