@odoo/o-spreadsheet 19.3.21 → 19.3.22
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.
- package/dist/o_spreadsheet.cjs +575 -393
- package/dist/o_spreadsheet.css +3 -3
- package/dist/o_spreadsheet.esm.js +575 -393
- package/dist/o_spreadsheet.iife.js +575 -393
- package/dist/o_spreadsheet.min.iife.js +270 -270
- package/dist/o_spreadsheet.xml +8 -8
- package/dist/types/components/number_editor/number_editor.d.ts +5 -0
- package/dist/types/components/top_bar/zoom_editor/zoom_editor.d.ts +4 -2
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/helpers/pivot/spreadsheet_pivot/data_entries_index_spreadsheet_pivot.d.ts +42 -0
- package/dist/types/helpers/pivot/spreadsheet_pivot/spreadsheet_pivot.d.ts +6 -2
- package/package.json +1 -1
|
@@ -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.3.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.3.22
|
|
6
|
+
* @date 2026-10-01T07:46:51.994Z
|
|
7
|
+
* @hash 0dd651f
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function(exports, _odoo_owl) {
|
|
@@ -238,12 +238,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
238
238
|
const TEXT_BODY = "#374151";
|
|
239
239
|
const TEXT_BODY_MUTED = "#374151C2";
|
|
240
240
|
const ACTION_COLOR = HIGHLIGHT_COLOR;
|
|
241
|
+
const CHART_PADDING = 20;
|
|
242
|
+
const CHART_PADDING_BOTTOM = 10;
|
|
243
|
+
const CHART_PADDING_TOP = 15;
|
|
241
244
|
const CHART_TITLE_FONT_SIZE = 16;
|
|
245
|
+
const CHART_AXIS_TITLE_FONT_SIZE = 12;
|
|
246
|
+
const MASTER_CHART_HEIGHT = 60;
|
|
247
|
+
const CHART_COLORSCALE_WIDTH = 70;
|
|
242
248
|
const DEFAULT_CHART_COLOR_SCALE = {
|
|
243
249
|
minColor: "#FFF5EB",
|
|
244
250
|
midColor: "#FD8D3C",
|
|
245
251
|
maxColor: "#7F2704"
|
|
246
252
|
};
|
|
253
|
+
const SCORECARD_CHART_TITLE_FONT_SIZE = 14;
|
|
247
254
|
const PIVOT_TOKEN_COLOR = "#F28C28";
|
|
248
255
|
const COLOR_PICKER_DEFAULTS = [
|
|
249
256
|
"#000000",
|
|
@@ -327,8 +334,32 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
327
334
|
"#20124D",
|
|
328
335
|
"#4C1130"
|
|
329
336
|
];
|
|
337
|
+
const MIN_ROW_HEIGHT = 10;
|
|
338
|
+
const MIN_COL_WIDTH = 5;
|
|
339
|
+
const HEADER_HEIGHT = 26;
|
|
340
|
+
const HEADER_WIDTH = 48;
|
|
341
|
+
const DESKTOP_TOPBAR_TOOLBAR_HEIGHT = 34;
|
|
342
|
+
const DESKTOP_BOTTOMBAR_HEIGHT = 36;
|
|
343
|
+
const DEFAULT_CELL_WIDTH = 96;
|
|
330
344
|
const DEFAULT_CELL_HEIGHT = 23;
|
|
331
|
-
const
|
|
345
|
+
const SCROLLBAR_WIDTH = 15;
|
|
346
|
+
const AUTOFILL_EDGE_LENGTH = 8;
|
|
347
|
+
const ICON_EDGE_LENGTH = 18;
|
|
348
|
+
const MIN_CF_ICON_MARGIN = 4;
|
|
349
|
+
const MIN_CELL_TEXT_MARGIN = 4;
|
|
350
|
+
const PADDING_AUTORESIZE_VERTICAL = 3;
|
|
351
|
+
const PADDING_AUTORESIZE_HORIZONTAL = MIN_CELL_TEXT_MARGIN;
|
|
352
|
+
const GROUP_LAYER_WIDTH = 21;
|
|
353
|
+
const GRID_ICON_MARGIN = 2;
|
|
354
|
+
const GRID_ICON_EDGE_LENGTH = 17;
|
|
355
|
+
const FOOTER_HEIGHT = 2 * DEFAULT_CELL_HEIGHT;
|
|
356
|
+
const DATA_VALIDATION_CHIP_MARGIN = 5;
|
|
357
|
+
const MOBILE_WIDTH_BREAKPOINT = 768;
|
|
358
|
+
const MENU_WIDTH = 250;
|
|
359
|
+
const MENU_VERTICAL_PADDING = 6;
|
|
360
|
+
const DESKTOP_MENU_ITEM_HEIGHT = 26;
|
|
361
|
+
const MIN_ZOOM_LEVEL = .5;
|
|
362
|
+
const MAX_ZOOM_LEVEL = 2;
|
|
332
363
|
const ZOOM_VALUES = [
|
|
333
364
|
50,
|
|
334
365
|
75,
|
|
@@ -358,20 +389,34 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
358
389
|
};
|
|
359
390
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
360
391
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
392
|
+
const DEFAULT_FONT_WEIGHT = "400";
|
|
361
393
|
const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
|
|
394
|
+
const HEADER_FONT_SIZE = 11;
|
|
362
395
|
const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
|
|
363
396
|
const DEFAULT_BORDER_DESC = {
|
|
364
397
|
style: "thin",
|
|
365
398
|
color: "#000000"
|
|
366
399
|
};
|
|
400
|
+
const MAX_HISTORY_STEPS = 99;
|
|
367
401
|
const DEFAULT_REVISION_ID = "START_REVISION";
|
|
402
|
+
const DEFAULT_FIGURE_HEIGHT = 335;
|
|
403
|
+
const DEFAULT_FIGURE_WIDTH = 536;
|
|
404
|
+
const FIGURE_BORDER_WIDTH = 1;
|
|
405
|
+
const MIN_FIG_SIZE = 80;
|
|
406
|
+
const MAX_CHAR_LABEL = 20;
|
|
407
|
+
const FIGURE_ID_SPLITTER = "??";
|
|
368
408
|
const DEFAULT_GAUGE_LOWER_COLOR = "#EA6175";
|
|
369
409
|
const DEFAULT_GAUGE_MIDDLE_COLOR = "#FFD86D";
|
|
370
410
|
const DEFAULT_GAUGE_UPPER_COLOR = "#43C5B1";
|
|
371
411
|
const DEFAULT_SCORECARD_BASELINE_MODE = "difference";
|
|
372
412
|
const DEFAULT_SCORECARD_BASELINE_COLOR_UP = "#43C5B1";
|
|
373
413
|
const DEFAULT_SCORECARD_BASELINE_COLOR_DOWN = "#EA6175";
|
|
414
|
+
const DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE = 32;
|
|
415
|
+
const DEFAULT_SCORECARD_BASELINE_FONT_SIZE = 16;
|
|
374
416
|
const LINE_FILL_TRANSPARENCY = .4;
|
|
417
|
+
const LINE_DATA_POINT_RADIUS = 3;
|
|
418
|
+
const DEFAULT_WINDOW_SIZE = 2;
|
|
419
|
+
const MESSAGE_VERSION = 1;
|
|
375
420
|
const FORBIDDEN_SHEETNAME_CHARS = [
|
|
376
421
|
"'",
|
|
377
422
|
"*",
|
|
@@ -382,6 +427,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
382
427
|
"]"
|
|
383
428
|
];
|
|
384
429
|
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
430
|
+
const FORMULA_REF_IDENTIFIER = "|";
|
|
385
431
|
let DEFAULT_SHEETVIEW_SIZE = 0;
|
|
386
432
|
/**
|
|
387
433
|
* The viewport dimensions are usually set by one of the components
|
|
@@ -396,6 +442,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
396
442
|
DEFAULT_SHEETVIEW_SIZE = size;
|
|
397
443
|
}
|
|
398
444
|
const MAXIMAL_FREEZABLE_RATIO = .85;
|
|
445
|
+
const NEWLINE = "\n";
|
|
399
446
|
const FONT_SIZES = [
|
|
400
447
|
6,
|
|
401
448
|
7,
|
|
@@ -421,6 +468,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
421
468
|
automaticAutofill: false
|
|
422
469
|
};
|
|
423
470
|
const PIVOT_INSERT_TABLE_STYLE_ID = "PivotTableStyleMedium12";
|
|
471
|
+
const PIVOT_INDENT = 15;
|
|
472
|
+
const PIVOT_COLLAPSE_ICON_SIZE = 12;
|
|
424
473
|
const PIVOT_MAX_NUMBER_OF_CELLS = 5e5;
|
|
425
474
|
const DEFAULT_CURRENCY = {
|
|
426
475
|
symbol: "$",
|
|
@@ -430,7 +479,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
430
479
|
name: "Dollar"
|
|
431
480
|
};
|
|
432
481
|
const DEFAULT_CAROUSEL_TITLE_STYLE = {
|
|
433
|
-
fontSize:
|
|
482
|
+
fontSize: CHART_TITLE_FONT_SIZE,
|
|
434
483
|
color: TEXT_BODY
|
|
435
484
|
};
|
|
436
485
|
const DEFAULT_TOKEN_COLOR = "light-dark(#000000, #ffffff)";
|
|
@@ -447,6 +496,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
447
496
|
ARG_SEPARATOR: functionColor,
|
|
448
497
|
ORPHAN_RIGHT_PAREN: "#ff0000"
|
|
449
498
|
};
|
|
499
|
+
const DRAG_THRESHOLD = 5;
|
|
450
500
|
|
|
451
501
|
//#endregion
|
|
452
502
|
//#region src/types/misc.ts
|
|
@@ -829,7 +879,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
829
879
|
*/
|
|
830
880
|
function replaceNewLines(text) {
|
|
831
881
|
if (!text) return "";
|
|
832
|
-
return text.replace(newLineRegexp,
|
|
882
|
+
return text.replace(newLineRegexp, NEWLINE);
|
|
833
883
|
}
|
|
834
884
|
/**
|
|
835
885
|
* Determine if the numbers are consecutive.
|
|
@@ -1078,7 +1128,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1078
1128
|
consumeSpaces(chars);
|
|
1079
1129
|
const col = letterPart - 1;
|
|
1080
1130
|
const row = num - 1;
|
|
1081
|
-
if (!chars.isOver() || col > MAX_COL || row >
|
|
1131
|
+
if (!chars.isOver() || col > MAX_COL || row > MAX_ROW) throw new Error(`Invalid cell description: ${xc}`);
|
|
1082
1132
|
return {
|
|
1083
1133
|
col,
|
|
1084
1134
|
row
|
|
@@ -1489,7 +1539,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1489
1539
|
const orderedZone = reorderZone(toZoneWithoutBoundaryChanges(xc));
|
|
1490
1540
|
const bottom = orderedZone.bottom;
|
|
1491
1541
|
const right = orderedZone.right;
|
|
1492
|
-
if (bottom !== void 0 && bottom >
|
|
1542
|
+
if (bottom !== void 0 && bottom > MAX_ROW || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
|
|
1493
1543
|
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");
|
|
1494
1544
|
return orderedZone;
|
|
1495
1545
|
}
|
|
@@ -1650,7 +1700,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1650
1700
|
return {
|
|
1651
1701
|
top: Math.max(z1.top, z2.top),
|
|
1652
1702
|
left: Math.max(z1.left, z2.left),
|
|
1653
|
-
bottom: Math.min(z1.bottom ??
|
|
1703
|
+
bottom: Math.min(z1.bottom ?? MAX_ROW, z2.bottom),
|
|
1654
1704
|
right: Math.min(z1.right ?? MAX_COL, z2.right)
|
|
1655
1705
|
};
|
|
1656
1706
|
}
|
|
@@ -4968,11 +5018,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
4968
5018
|
return result;
|
|
4969
5019
|
}
|
|
4970
5020
|
function tokenizeDebugger(chars) {
|
|
4971
|
-
if (chars.current ===
|
|
5021
|
+
if (chars.current === DEBUGGER_CHAR) {
|
|
4972
5022
|
chars.shift();
|
|
4973
5023
|
return {
|
|
4974
5024
|
type: "DEBUGGER",
|
|
4975
|
-
value:
|
|
5025
|
+
value: DEBUGGER_CHAR
|
|
4976
5026
|
};
|
|
4977
5027
|
}
|
|
4978
5028
|
return null;
|
|
@@ -5131,13 +5181,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
5131
5181
|
}
|
|
5132
5182
|
function tokenizeNewLine(chars) {
|
|
5133
5183
|
let length = 0;
|
|
5134
|
-
while (chars.current ===
|
|
5184
|
+
while (chars.current === NEWLINE) {
|
|
5135
5185
|
length++;
|
|
5136
5186
|
chars.shift();
|
|
5137
5187
|
}
|
|
5138
5188
|
if (length) return {
|
|
5139
5189
|
type: "SPACE",
|
|
5140
|
-
value:
|
|
5190
|
+
value: NEWLINE.repeat(length)
|
|
5141
5191
|
};
|
|
5142
5192
|
return null;
|
|
5143
5193
|
}
|
|
@@ -6786,7 +6836,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
6786
6836
|
switch (token.type) {
|
|
6787
6837
|
case "DIGIT":
|
|
6788
6838
|
if (parsedPart === integerPart) parsedPart.push(token);
|
|
6789
|
-
else if (numberOfDecimalsDigits <
|
|
6839
|
+
else if (numberOfDecimalsDigits < MAX_DECIMAL_PLACES) {
|
|
6790
6840
|
parsedPart.push(token);
|
|
6791
6841
|
numberOfDecimalsDigits++;
|
|
6792
6842
|
}
|
|
@@ -7090,7 +7140,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
7090
7140
|
if (digitType === "0") digit = digit || "0";
|
|
7091
7141
|
if (!digit) return;
|
|
7092
7142
|
const digitIndex = integerDigits.length - 1 - indexInIntegerString;
|
|
7093
|
-
const groups = getIndexesOfDigitsWithThousandSeparator(locale.digitGrouping ||
|
|
7143
|
+
const groups = getIndexesOfDigitsWithThousandSeparator(locale.digitGrouping || DEFAULT_LOCALE_DIGIT_GROUPING);
|
|
7094
7144
|
if (thousandsSeparator && groups.has(digitIndex - 1)) formattedInteger = digit + thousandsSeparator + formattedInteger;
|
|
7095
7145
|
else formattedInteger = digit + formattedInteger;
|
|
7096
7146
|
}
|
|
@@ -7150,7 +7200,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
7150
7200
|
* exceed in the decimal part, in which case digits are rounded.
|
|
7151
7201
|
*
|
|
7152
7202
|
**/
|
|
7153
|
-
function splitNumber(value, maxDecimals =
|
|
7203
|
+
function splitNumber(value, maxDecimals = MAX_DECIMAL_PLACES) {
|
|
7154
7204
|
const asString = value.toString();
|
|
7155
7205
|
if (asString.includes("e")) return splitNumberIntl(value, maxDecimals);
|
|
7156
7206
|
if (Number.isInteger(value)) return {
|
|
@@ -7219,7 +7269,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
7219
7269
|
* Supports numbers with a lot of digits that are transformed to scientific notation by
|
|
7220
7270
|
* number.toString(), but is slow.
|
|
7221
7271
|
*/
|
|
7222
|
-
function splitNumberIntl(value, maxDecimals =
|
|
7272
|
+
function splitNumberIntl(value, maxDecimals = MAX_DECIMAL_PLACES) {
|
|
7223
7273
|
let formatter = numberRepresentation[maxDecimals];
|
|
7224
7274
|
if (!formatter) {
|
|
7225
7275
|
formatter = new Intl.NumberFormat("en-US", {
|
|
@@ -8365,7 +8415,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8365
8415
|
* Returns a timeout delay in milliseconds.
|
|
8366
8416
|
*/
|
|
8367
8417
|
function scrollDelay(value) {
|
|
8368
|
-
return
|
|
8418
|
+
return MIN_DELAY + (MAX_DELAY - MIN_DELAY) * Math.exp(-.035 * (value - 1));
|
|
8369
8419
|
}
|
|
8370
8420
|
|
|
8371
8421
|
//#endregion
|
|
@@ -8432,7 +8482,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8432
8482
|
//#endregion
|
|
8433
8483
|
//#region src/helpers/text_helper.ts
|
|
8434
8484
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
8435
|
-
return numberOfLines * (textLineHeight +
|
|
8485
|
+
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
8436
8486
|
}
|
|
8437
8487
|
function getCanvas(width = 100, height = 100) {
|
|
8438
8488
|
return new OffscreenCanvas(width, height).getContext("2d");
|
|
@@ -8441,7 +8491,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8441
8491
|
* Get the default height of the cell given its style.
|
|
8442
8492
|
*/
|
|
8443
8493
|
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
8444
|
-
if (!cell || !cell.isFormula && !cell.content) return
|
|
8494
|
+
if (!cell || !cell.isFormula && !cell.content) return DEFAULT_CELL_HEIGHT;
|
|
8445
8495
|
let content = "";
|
|
8446
8496
|
try {
|
|
8447
8497
|
if (!cell.isFormula) {
|
|
@@ -8457,7 +8507,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8457
8507
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
8458
8508
|
}
|
|
8459
8509
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
8460
|
-
return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 *
|
|
8510
|
+
return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : void 0), style).height + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
8461
8511
|
}
|
|
8462
8512
|
function getDefaultContextFont(fontSize, bold = false, italic = false) {
|
|
8463
8513
|
return `${italic ? "italic" : ""} ${bold ? "bold" : ""} ${fontSize}px ${DEFAULT_FONT}`;
|
|
@@ -8523,7 +8573,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8523
8573
|
return Math.round(fontSize * 96 / 72);
|
|
8524
8574
|
}
|
|
8525
8575
|
function computeTextFont(style, fontUnit = "pt") {
|
|
8526
|
-
return `${style.italic ? "italic " : ""}${style.bold ? "bold" :
|
|
8576
|
+
return `${style.italic ? "italic " : ""}${style.bold ? "bold" : DEFAULT_FONT_WEIGHT} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
8527
8577
|
}
|
|
8528
8578
|
function computeTextFontSizeInPixels(style) {
|
|
8529
8579
|
return fontSizeInPixels(style?.fontSize || DEFAULT_FONT_SIZE);
|
|
@@ -8547,7 +8597,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8547
8597
|
if (!style) style = {};
|
|
8548
8598
|
if (isMarkdownLink(text)) text = parseMarkdownLink(text).label;
|
|
8549
8599
|
const brokenText = [];
|
|
8550
|
-
const lines = text.includes(
|
|
8600
|
+
const lines = text.includes(NEWLINE) ? text.split(NEWLINE) : [text];
|
|
8551
8601
|
for (const line of lines) {
|
|
8552
8602
|
const words = line.includes(" ") ? line.split(" ") : [line];
|
|
8553
8603
|
if (!width) {
|
|
@@ -8713,7 +8763,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8713
8763
|
let { x, y } = rect;
|
|
8714
8764
|
const cos = Math.cos(-style.rotation);
|
|
8715
8765
|
const sin = Math.sin(-style.rotation);
|
|
8716
|
-
const width = rect.textWidth - 2 *
|
|
8766
|
+
const width = rect.textWidth - 2 * MIN_CELL_TEXT_MARGIN;
|
|
8717
8767
|
const height = rect.textHeight;
|
|
8718
8768
|
const center = style.align === "center";
|
|
8719
8769
|
const rotateTowardCellCenter = style.align === "left" === sin < 0;
|
|
@@ -8831,7 +8881,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8831
8881
|
const { ctx } = chart;
|
|
8832
8882
|
ctx.save();
|
|
8833
8883
|
ctx.globalCompositeOperation = "destination-over";
|
|
8834
|
-
ctx.fillStyle = options.color ||
|
|
8884
|
+
ctx.fillStyle = options.color || BACKGROUND_CHART_COLOR;
|
|
8835
8885
|
ctx.fillRect(0, 0, chart.width, chart.height);
|
|
8836
8886
|
ctx.restore();
|
|
8837
8887
|
}
|
|
@@ -8853,7 +8903,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8853
8903
|
};
|
|
8854
8904
|
updateElements(rects, start, count, mode) {
|
|
8855
8905
|
super.updateElements(rects, start, count, mode);
|
|
8856
|
-
const backgroundColor = this.chart.config.options?.plugins?.background?.color ||
|
|
8906
|
+
const backgroundColor = this.chart.config.options?.plugins?.background?.color || BACKGROUND_CHART_COLOR;
|
|
8857
8907
|
for (let i = start; i < start + count; i++) if (mode === "reset") this.updateElement(rects[i], i, { options: { backgroundColor } }, mode);
|
|
8858
8908
|
}
|
|
8859
8909
|
};
|
|
@@ -8873,7 +8923,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8873
8923
|
ctx.miterLimit = 1;
|
|
8874
8924
|
const gradientHeight = (chart.chartArea.bottom - chart.chartArea.top) / 2;
|
|
8875
8925
|
const gradientWidth = 10;
|
|
8876
|
-
const gradientX = options.position === "left" ?
|
|
8926
|
+
const gradientX = options.position === "left" ? CHART_PADDING : ctx.canvas.width - CHART_COLORSCALE_WIDTH;
|
|
8877
8927
|
const gradientY = chart.chartArea.top;
|
|
8878
8928
|
const gradient = ctx.createLinearGradient(0, gradientY + gradientHeight, 0, gradientY);
|
|
8879
8929
|
const step = 1 / (options.colorScale.length - 1);
|
|
@@ -8883,7 +8933,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8883
8933
|
ctx.fillStyle = gradient;
|
|
8884
8934
|
ctx.fillRect(gradientX, gradientY, gradientWidth, gradientHeight);
|
|
8885
8935
|
ctx.fillStyle = options.fontColor ?? "black";
|
|
8886
|
-
ctx.font = getDefaultContextFont(
|
|
8936
|
+
ctx.font = getDefaultContextFont(CHART_AXIS_TITLE_FONT_SIZE);
|
|
8887
8937
|
ctx.textAlign = "left";
|
|
8888
8938
|
let minValue = Math.round(options.minValue * 100) / 100;
|
|
8889
8939
|
let maxValue = Math.round(options.maxValue * 100) / 100;
|
|
@@ -9153,6 +9203,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9153
9203
|
const EXCEL_DEFAULT_COL_WIDTH = 8.43;
|
|
9154
9204
|
/** unit : points */
|
|
9155
9205
|
const EXCEL_DEFAULT_ROW_HEIGHT = 12.75;
|
|
9206
|
+
const EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS = 30;
|
|
9207
|
+
const EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS = 100;
|
|
9208
|
+
/** The possible values for the XLSX polynomial trendline order are defined by the ST_Order simple type (§21.2.3.29) */
|
|
9209
|
+
const MAX_XLSX_POLYNOMIAL_DEGREE = 6;
|
|
9210
|
+
const FIRST_NUMFMT_ID = 164;
|
|
9211
|
+
const DEFAULT_DOUGHNUT_CHART_HOLE_SIZE = 50;
|
|
9156
9212
|
const FORCE_DEFAULT_ARGS_FUNCTIONS = {
|
|
9157
9213
|
FLOOR: [{
|
|
9158
9214
|
type: "NUMBER",
|
|
@@ -9454,8 +9510,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9454
9510
|
if (dataSetStyle.trend?.type) trend = {
|
|
9455
9511
|
type: dataSetStyle.trend.type === "polynomial" && dataSetStyle.trend.order === 1 ? "linear" : SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING[dataSetStyle.trend.type],
|
|
9456
9512
|
color: dataSetStyle.trend.color,
|
|
9457
|
-
order: dataSetStyle.trend.order ? Math.min(dataSetStyle.trend.order,
|
|
9458
|
-
window: dataSetStyle.trend.window ||
|
|
9513
|
+
order: dataSetStyle.trend.order ? Math.min(dataSetStyle.trend.order, MAX_XLSX_POLYNOMIAL_DEGREE) : void 0,
|
|
9514
|
+
window: dataSetStyle.trend.window || DEFAULT_WINDOW_SIZE
|
|
9459
9515
|
};
|
|
9460
9516
|
return {
|
|
9461
9517
|
label,
|
|
@@ -9560,13 +9616,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9560
9616
|
for (let i = 0; i <= maxLength; i++) pieColors.push(colors.next());
|
|
9561
9617
|
return pieColors;
|
|
9562
9618
|
}
|
|
9563
|
-
function truncateLabel(label, maxLen =
|
|
9619
|
+
function truncateLabel(label, maxLen = MAX_CHAR_LABEL) {
|
|
9564
9620
|
if (!label) return "";
|
|
9565
9621
|
if (label.length > maxLen) return label.substring(0, maxLen) + "…";
|
|
9566
9622
|
return label;
|
|
9567
9623
|
}
|
|
9568
9624
|
function isTrendLineAxis(axisID) {
|
|
9569
|
-
return axisID ===
|
|
9625
|
+
return axisID === TREND_LINE_XAXIS_ID || axisID === MOVING_AVERAGE_TREND_LINE_XAXIS_ID;
|
|
9570
9626
|
}
|
|
9571
9627
|
|
|
9572
9628
|
//#endregion
|
|
@@ -9878,7 +9934,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9878
9934
|
scales = removeFalsyAttributes(scales);
|
|
9879
9935
|
if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
|
|
9880
9936
|
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
|
|
9881
|
-
scales[
|
|
9937
|
+
scales[TREND_LINE_XAXIS_ID] = {
|
|
9882
9938
|
...scales.x,
|
|
9883
9939
|
labels: Array(maxLength).fill(""),
|
|
9884
9940
|
offset: false,
|
|
@@ -9989,7 +10045,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9989
10045
|
});
|
|
9990
10046
|
}
|
|
9991
10047
|
if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
|
|
9992
|
-
scales[
|
|
10048
|
+
scales[TREND_LINE_XAXIS_ID] = {
|
|
9993
10049
|
...scales.x,
|
|
9994
10050
|
display: false
|
|
9995
10051
|
};
|
|
@@ -9999,9 +10055,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9999
10055
|
};
|
|
10000
10056
|
if (axisType === "category" || axisType === "time") {
|
|
10001
10057
|
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
|
|
10002
|
-
scales[
|
|
10003
|
-
scales[
|
|
10004
|
-
scales[
|
|
10058
|
+
scales[TREND_LINE_XAXIS_ID]["type"] = "category";
|
|
10059
|
+
scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
|
|
10060
|
+
scales[TREND_LINE_XAXIS_ID]["offset"] = false;
|
|
10005
10061
|
scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["type"] = "category";
|
|
10006
10062
|
scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["offset"] = false;
|
|
10007
10063
|
}
|
|
@@ -10163,7 +10219,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10163
10219
|
font: {
|
|
10164
10220
|
style: italic ? "italic" : "normal",
|
|
10165
10221
|
weight: bold ? "bold" : "normal",
|
|
10166
|
-
size: design.title.fontSize ??
|
|
10222
|
+
size: design.title.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE
|
|
10167
10223
|
},
|
|
10168
10224
|
align: align === "left" ? "start" : align === "right" ? "end" : "center"
|
|
10169
10225
|
};
|
|
@@ -10251,16 +10307,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10251
10307
|
switch (definition.legendPosition) {
|
|
10252
10308
|
case "top":
|
|
10253
10309
|
case "right": return {
|
|
10254
|
-
top: !!definition.title.text ?
|
|
10255
|
-
left:
|
|
10256
|
-
right:
|
|
10310
|
+
top: !!definition.title.text ? CHART_PADDING_TOP + 30 : CHART_PADDING_TOP,
|
|
10311
|
+
left: CHART_PADDING,
|
|
10312
|
+
right: CHART_PADDING
|
|
10257
10313
|
};
|
|
10258
10314
|
case "bottom":
|
|
10259
10315
|
case "left":
|
|
10260
10316
|
case "none": return {
|
|
10261
|
-
left:
|
|
10262
|
-
right:
|
|
10263
|
-
bottom:
|
|
10317
|
+
left: CHART_PADDING,
|
|
10318
|
+
right: CHART_PADDING,
|
|
10319
|
+
bottom: CHART_PADDING_BOTTOM
|
|
10264
10320
|
};
|
|
10265
10321
|
}
|
|
10266
10322
|
}
|
|
@@ -10290,7 +10346,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10290
10346
|
label,
|
|
10291
10347
|
data: data.map((cell) => isNumberResult(cell) ? cell.value : NaN),
|
|
10292
10348
|
hidden,
|
|
10293
|
-
borderColor: definition.background ||
|
|
10349
|
+
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
10294
10350
|
borderWidth: definition.stacked ? 1 : 0,
|
|
10295
10351
|
backgroundColor,
|
|
10296
10352
|
yAxisID: definition.horizontal ? "y" : definition.dataSetStyles?.[dataSetId]?.yAxisId ?? "y",
|
|
@@ -10318,8 +10374,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10318
10374
|
for (const dataSetValues of dataSetsValues) dataSets.push({
|
|
10319
10375
|
label: dataSetValues.label,
|
|
10320
10376
|
data: dataSetValues.data.map((v) => 1),
|
|
10321
|
-
backgroundColor: dataSetValues.data.map((v) => isNumberResult(v) ? colorMap(v.value) : definition.missingValueColor ||
|
|
10322
|
-
borderColor: definition.background ||
|
|
10377
|
+
backgroundColor: dataSetValues.data.map((v) => isNumberResult(v) ? colorMap(v.value) : definition.missingValueColor || COLOR_TRANSPARENT),
|
|
10378
|
+
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
10323
10379
|
borderSkipped: false,
|
|
10324
10380
|
borderWidth: 1,
|
|
10325
10381
|
barPercentage: 1,
|
|
@@ -10333,9 +10389,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10333
10389
|
}
|
|
10334
10390
|
function getWaterfallDatasetAndLabels(definition, args) {
|
|
10335
10391
|
const { dataSetsValues, labels } = args;
|
|
10336
|
-
const negativeColor = definition.negativeValuesColor ||
|
|
10337
|
-
const positiveColor = definition.positiveValuesColor ||
|
|
10338
|
-
const subTotalColor = definition.subTotalValuesColor ||
|
|
10392
|
+
const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
10393
|
+
const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
10394
|
+
const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
10339
10395
|
const backgroundColor = [];
|
|
10340
10396
|
const datasetValues = [];
|
|
10341
10397
|
const dataset = {
|
|
@@ -10399,7 +10455,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10399
10455
|
backgroundColor: areaChart ? setColorAlpha(color, LINE_FILL_TRANSPARENCY) : color,
|
|
10400
10456
|
pointBackgroundColor: color,
|
|
10401
10457
|
fill: areaChart ? getFillingMode(index, stackedChart) : false,
|
|
10402
|
-
pointRadius: definition.hideDataMarkers ? 0 :
|
|
10458
|
+
pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS,
|
|
10403
10459
|
yAxisID: dataSetStyle?.yAxisId || "y"
|
|
10404
10460
|
};
|
|
10405
10461
|
dataSets.push(dataset);
|
|
@@ -10456,7 +10512,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10456
10512
|
xAxisID: "x",
|
|
10457
10513
|
type,
|
|
10458
10514
|
order: type === "bar" ? dataSetsValues.length + index : index,
|
|
10459
|
-
pointRadius: definition.hideDataMarkers ? 0 :
|
|
10515
|
+
pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
|
|
10460
10516
|
};
|
|
10461
10517
|
if (dataset.type === "bar") {
|
|
10462
10518
|
dataset.barPercentage = .9;
|
|
@@ -10488,7 +10544,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10488
10544
|
borderColor,
|
|
10489
10545
|
backgroundColor: borderColor,
|
|
10490
10546
|
pointBackgroundColor: borderColor,
|
|
10491
|
-
pointRadius: definition.hideDataMarkers ? 0 :
|
|
10547
|
+
pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
|
|
10492
10548
|
};
|
|
10493
10549
|
if (fill) {
|
|
10494
10550
|
dataset.backgroundColor = setColorAlpha(borderColor, LINE_FILL_TRANSPARENCY);
|
|
@@ -10549,7 +10605,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10549
10605
|
xAxisID: "x",
|
|
10550
10606
|
barPercentage: 1,
|
|
10551
10607
|
categoryPercentage: 1,
|
|
10552
|
-
borderColor: definition.background ||
|
|
10608
|
+
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
10553
10609
|
borderWidth: 3
|
|
10554
10610
|
}];
|
|
10555
10611
|
}
|
|
@@ -10574,12 +10630,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10574
10630
|
data: data[i],
|
|
10575
10631
|
borderColor: (ctx) => {
|
|
10576
10632
|
const data = ctx.type === "data" ? ctx.raw : void 0;
|
|
10577
|
-
if (!data || data.label ===
|
|
10578
|
-
return definition.background ||
|
|
10633
|
+
if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
|
|
10634
|
+
return definition.background || BACKGROUND_CHART_COLOR;
|
|
10579
10635
|
},
|
|
10580
10636
|
backgroundColor: (ctx) => {
|
|
10581
10637
|
const data = ctx.type === "data" ? ctx.raw : void 0;
|
|
10582
|
-
if (!data || data.label ===
|
|
10638
|
+
if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
|
|
10583
10639
|
const rootGroup = data.groups[0];
|
|
10584
10640
|
return groupColors.find((groupColor) => groupColor.label === rootGroup)?.color;
|
|
10585
10641
|
},
|
|
@@ -10720,7 +10776,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10720
10776
|
const borderColor = config.color || lightenColor(rgbaToHex(defaultBorderColor), .5);
|
|
10721
10777
|
return {
|
|
10722
10778
|
type: "line",
|
|
10723
|
-
xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID :
|
|
10779
|
+
xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID : TREND_LINE_XAXIS_ID,
|
|
10724
10780
|
yAxisID: dataset.yAxisID,
|
|
10725
10781
|
label: dataset.label ? _t("Trend line for %s", dataset.label) : "",
|
|
10726
10782
|
data,
|
|
@@ -10833,7 +10889,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10833
10889
|
for (const metaSet of chart.getSortedVisibleDatasetMetas()) for (const arcElement of metaSet.data) {
|
|
10834
10890
|
const context = arcElement["$context"];
|
|
10835
10891
|
const { datasetIndex, index, dataset, raw } = context;
|
|
10836
|
-
if (raw.label ===
|
|
10892
|
+
if (raw.label === GHOST_SUNBURST_VALUE) continue;
|
|
10837
10893
|
const originalBackgroundColor = typeof dataset.backgroundColor === "function" ? dataset.backgroundColor(context) : dataset.backgroundColor;
|
|
10838
10894
|
if (activeDataPoints.length && !activeDataPoints.some((el) => el.datasetIndex === datasetIndex && el.index === index)) arcElement.options.backgroundColor = lightenColor(originalBackgroundColor, .5);
|
|
10839
10895
|
else arcElement.options.backgroundColor = originalBackgroundColor;
|
|
@@ -10861,7 +10917,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10861
10917
|
const lineHeight = fontSize + Y_PADDING;
|
|
10862
10918
|
for (const dataset of chart._metasets) for (let i = 0; i < dataset._dataset.data.length; i++) {
|
|
10863
10919
|
const rawData = dataset._dataset.data[i];
|
|
10864
|
-
if (rawData.label ===
|
|
10920
|
+
if (rawData.label === GHOST_SUNBURST_VALUE) continue;
|
|
10865
10921
|
const valuesToDisplay = [options.showLabels ? rawData.label : void 0, options.showValues ? options.callback(rawData.value, "y") : void 0].filter(isDefined);
|
|
10866
10922
|
const arc = dataset.data[i];
|
|
10867
10923
|
let { startAngle, endAngle, innerRadius, outerRadius, circumference } = arc;
|
|
@@ -11387,7 +11443,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11387
11443
|
canvas.width = dpr * structure.canvas.width * zoom;
|
|
11388
11444
|
canvas.height = dpr * structure.canvas.height * zoom;
|
|
11389
11445
|
ctx.scale(dpr * zoom, dpr * zoom);
|
|
11390
|
-
const availableWidth = structure.canvas.width -
|
|
11446
|
+
const availableWidth = structure.canvas.width - CHART_PADDING;
|
|
11391
11447
|
ctx.fillStyle = structure.canvas.backgroundColor;
|
|
11392
11448
|
ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
|
|
11393
11449
|
if (structure.title) {
|
|
@@ -11495,16 +11551,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11495
11551
|
x = (this.width - titleWidth) / 2;
|
|
11496
11552
|
break;
|
|
11497
11553
|
case "right":
|
|
11498
|
-
x = this.width - titleWidth -
|
|
11554
|
+
x = this.width - titleWidth - CHART_PADDING;
|
|
11499
11555
|
break;
|
|
11500
|
-
default: x =
|
|
11556
|
+
default: x = CHART_PADDING;
|
|
11501
11557
|
}
|
|
11502
11558
|
structure.title = {
|
|
11503
11559
|
text: this.title,
|
|
11504
11560
|
style: style.title,
|
|
11505
11561
|
position: {
|
|
11506
11562
|
x,
|
|
11507
|
-
y:
|
|
11563
|
+
y: CHART_PADDING_BOTTOM + titleHeight / 2
|
|
11508
11564
|
}
|
|
11509
11565
|
};
|
|
11510
11566
|
}
|
|
@@ -11515,10 +11571,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11515
11571
|
let baselineX;
|
|
11516
11572
|
switch (this.runtime.baselineStyle?.align) {
|
|
11517
11573
|
case "right":
|
|
11518
|
-
baselineX = this.width -
|
|
11574
|
+
baselineX = this.width - CHART_PADDING - baselineDescrWidth - baselineWidth;
|
|
11519
11575
|
break;
|
|
11520
11576
|
case "left":
|
|
11521
|
-
baselineX =
|
|
11577
|
+
baselineX = CHART_PADDING + baselineArrowSize;
|
|
11522
11578
|
break;
|
|
11523
11579
|
default: baselineX = (this.width - baselineWidth - baselineDescrWidth + baselineArrowSize) / 2;
|
|
11524
11580
|
}
|
|
@@ -11528,7 +11584,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11528
11584
|
style: style.baselineValue,
|
|
11529
11585
|
position: {
|
|
11530
11586
|
x: baselineX,
|
|
11531
|
-
y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 -
|
|
11587
|
+
y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING_BOTTOM
|
|
11532
11588
|
}
|
|
11533
11589
|
};
|
|
11534
11590
|
if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
|
|
@@ -11556,12 +11612,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11556
11612
|
progressBarHeight = this.height * .05;
|
|
11557
11613
|
structure.progressBar = {
|
|
11558
11614
|
position: {
|
|
11559
|
-
x: 2 *
|
|
11615
|
+
x: 2 * CHART_PADDING,
|
|
11560
11616
|
y: this.height * (1 - 2 * BOTTOM_PADDING_RATIO) - baselineHeight - progressBarHeight
|
|
11561
11617
|
},
|
|
11562
11618
|
dimension: {
|
|
11563
11619
|
height: progressBarHeight,
|
|
11564
|
-
width: this.width - 4 *
|
|
11620
|
+
width: this.width - 4 * CHART_PADDING
|
|
11565
11621
|
},
|
|
11566
11622
|
value: this.runtime.progressBar.value,
|
|
11567
11623
|
style: {
|
|
@@ -11575,10 +11631,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11575
11631
|
let keyX;
|
|
11576
11632
|
switch (this.runtime.keyValueStyle?.align) {
|
|
11577
11633
|
case "right":
|
|
11578
|
-
keyX = this.width -
|
|
11634
|
+
keyX = this.width - CHART_PADDING - keyDescrWidth - keyWidth;
|
|
11579
11635
|
break;
|
|
11580
11636
|
case "left":
|
|
11581
|
-
keyX =
|
|
11637
|
+
keyX = CHART_PADDING;
|
|
11582
11638
|
break;
|
|
11583
11639
|
default: keyX = (this.width - keyWidth - keyDescrWidth) / 2;
|
|
11584
11640
|
}
|
|
@@ -11586,8 +11642,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11586
11642
|
text: this.keyValue,
|
|
11587
11643
|
style: style.keyValue,
|
|
11588
11644
|
position: {
|
|
11589
|
-
x: Math.max(
|
|
11590
|
-
y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) +
|
|
11645
|
+
x: Math.max(CHART_PADDING, keyX),
|
|
11646
|
+
y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) + CHART_PADDING_BOTTOM / 2 + (titleHeight + keyHeight / 2) / 2
|
|
11591
11647
|
}
|
|
11592
11648
|
};
|
|
11593
11649
|
if (structure.key && this.keyDescr) {
|
|
@@ -11644,14 +11700,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11644
11700
|
};
|
|
11645
11701
|
}
|
|
11646
11702
|
getTextStyles() {
|
|
11647
|
-
const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ??
|
|
11703
|
+
const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ?? DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE;
|
|
11648
11704
|
const keyValueDescrFontSize = Math.floor(.9 * keyValueFontSize);
|
|
11649
|
-
let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ??
|
|
11705
|
+
let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ?? DEFAULT_SCORECARD_BASELINE_FONT_SIZE;
|
|
11650
11706
|
const baselineDescrFontSize = Math.floor(.9 * baselineValueFontSize);
|
|
11651
11707
|
if (this.runtime.progressBar) baselineValueFontSize /= 1.5;
|
|
11652
11708
|
return {
|
|
11653
11709
|
title: {
|
|
11654
|
-
font: getDefaultContextFont(this.runtime.title.fontSize ??
|
|
11710
|
+
font: getDefaultContextFont(this.runtime.title.fontSize ?? SCORECARD_CHART_TITLE_FONT_SIZE, this.runtime.title.bold, this.runtime.title.italic),
|
|
11655
11711
|
color: this.runtime.title.color ?? this.secondaryFontColor
|
|
11656
11712
|
},
|
|
11657
11713
|
keyValue: {
|
|
@@ -12140,35 +12196,35 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
12140
12196
|
x: boundingRect.width / 2,
|
|
12141
12197
|
y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
|
|
12142
12198
|
};
|
|
12143
|
-
let gaugeValueFontSize =
|
|
12199
|
+
let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
|
|
12144
12200
|
if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
|
|
12145
12201
|
const maxTextWidth = gaugeRect.width / 2;
|
|
12146
12202
|
const gaugeLabel = runtime.gaugeValue?.label || "-";
|
|
12147
12203
|
if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
|
|
12148
12204
|
const minLabelPosition = {
|
|
12149
12205
|
x: gaugeRect.x + gaugeArcWidth / 2,
|
|
12150
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
12206
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
12151
12207
|
};
|
|
12152
12208
|
const maxLabelPosition = {
|
|
12153
12209
|
x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
|
|
12154
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
12210
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
12155
12211
|
};
|
|
12156
12212
|
const textColor = chartMutedFontColor(runtime.background);
|
|
12157
12213
|
const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
|
|
12158
12214
|
let x = 0, titleWidth = 0, titleHeight = 0;
|
|
12159
12215
|
if (runtime.title.text) ({width: titleWidth, height: titleHeight} = computeTextDimension(ctx, runtime.title.text, {
|
|
12160
|
-
fontSize:
|
|
12216
|
+
fontSize: CHART_TITLE_FONT_SIZE,
|
|
12161
12217
|
...runtime.title
|
|
12162
12218
|
}, "px"));
|
|
12163
12219
|
switch (runtime.title.align) {
|
|
12164
12220
|
case "right":
|
|
12165
|
-
x = boundingRect.width - titleWidth -
|
|
12221
|
+
x = boundingRect.width - titleWidth - CHART_PADDING;
|
|
12166
12222
|
break;
|
|
12167
12223
|
case "center":
|
|
12168
12224
|
x = (boundingRect.width - titleWidth) / 2;
|
|
12169
12225
|
break;
|
|
12170
12226
|
default:
|
|
12171
|
-
x =
|
|
12227
|
+
x = CHART_PADDING;
|
|
12172
12228
|
break;
|
|
12173
12229
|
}
|
|
12174
12230
|
return {
|
|
@@ -12176,10 +12232,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
12176
12232
|
height: boundingRect.height,
|
|
12177
12233
|
title: {
|
|
12178
12234
|
label: runtime.title.text ?? "",
|
|
12179
|
-
fontSize: runtime.title.fontSize ??
|
|
12235
|
+
fontSize: runtime.title.fontSize ?? CHART_TITLE_FONT_SIZE,
|
|
12180
12236
|
textPosition: {
|
|
12181
12237
|
x,
|
|
12182
|
-
y:
|
|
12238
|
+
y: CHART_PADDING_TOP + titleHeight / 2
|
|
12183
12239
|
},
|
|
12184
12240
|
color: runtime.title.color ?? textColor,
|
|
12185
12241
|
bold: runtime.title.bold,
|
|
@@ -12202,13 +12258,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
12202
12258
|
minLabel: {
|
|
12203
12259
|
label: runtime.minValue.label,
|
|
12204
12260
|
textPosition: minLabelPosition,
|
|
12205
|
-
fontSize:
|
|
12261
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
12206
12262
|
color: textColor
|
|
12207
12263
|
},
|
|
12208
12264
|
maxLabel: {
|
|
12209
12265
|
label: runtime.maxValue.label,
|
|
12210
12266
|
textPosition: maxLabelPosition,
|
|
12211
|
-
fontSize:
|
|
12267
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
12212
12268
|
color: textColor
|
|
12213
12269
|
}
|
|
12214
12270
|
};
|
|
@@ -12218,9 +12274,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
12218
12274
|
* space for the title and labels.
|
|
12219
12275
|
*/
|
|
12220
12276
|
function getGaugeRect(boundingRect, title) {
|
|
12221
|
-
const titleHeight = title ?
|
|
12222
|
-
const drawHeight = boundingRect.height -
|
|
12223
|
-
const drawWidth = boundingRect.width -
|
|
12277
|
+
const titleHeight = title ? GAUGE_TITLE_SECTION_HEIGHT : 0;
|
|
12278
|
+
const drawHeight = boundingRect.height - GAUGE_PADDING_BOTTOM - titleHeight - GAUGE_PADDING_TOP;
|
|
12279
|
+
const drawWidth = boundingRect.width - GAUGE_PADDING_SIDE * 2;
|
|
12224
12280
|
let gaugeWidth;
|
|
12225
12281
|
let gaugeHeight;
|
|
12226
12282
|
if (drawWidth > 2 * drawHeight) {
|
|
@@ -12231,8 +12287,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
12231
12287
|
gaugeHeight = drawWidth / 2;
|
|
12232
12288
|
}
|
|
12233
12289
|
return {
|
|
12234
|
-
x:
|
|
12235
|
-
y: titleHeight +
|
|
12290
|
+
x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
|
|
12291
|
+
y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
|
|
12236
12292
|
width: gaugeWidth,
|
|
12237
12293
|
height: gaugeHeight
|
|
12238
12294
|
};
|
|
@@ -12249,20 +12305,20 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
12249
12305
|
x: gaugeRect.x + gaugeRect.width / 2,
|
|
12250
12306
|
y: gaugeRect.y + gaugeRect.height
|
|
12251
12307
|
};
|
|
12252
|
-
const textStyle = { fontSize:
|
|
12308
|
+
const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
|
|
12253
12309
|
const inflectionValues = [];
|
|
12254
12310
|
const inflectionValuesTextRects = [];
|
|
12255
12311
|
for (const inflectionValue of runtime.inflectionValues) {
|
|
12256
12312
|
const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
|
|
12257
12313
|
const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
|
|
12258
12314
|
const angle = Math.PI - Math.PI * percentage;
|
|
12259
|
-
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2,
|
|
12260
|
-
const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ?
|
|
12315
|
+
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, GAUGE_LABELS_FONT_SIZE);
|
|
12316
|
+
const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? GAUGE_LABELS_FONT_SIZE : 0;
|
|
12261
12317
|
inflectionValuesTextRects.push(textRect);
|
|
12262
12318
|
inflectionValues.push({
|
|
12263
12319
|
rotation: angle,
|
|
12264
12320
|
label: inflectionValue.label,
|
|
12265
|
-
fontSize:
|
|
12321
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
12266
12322
|
color: textColor,
|
|
12267
12323
|
offset
|
|
12268
12324
|
});
|
|
@@ -12762,7 +12818,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
12762
12818
|
});
|
|
12763
12819
|
return newY.length === newX.length ? newY : transposeMatrix(newY);
|
|
12764
12820
|
}
|
|
12765
|
-
function getMovingAverageValues(dataset, labels, windowSize =
|
|
12821
|
+
function getMovingAverageValues(dataset, labels, windowSize = DEFAULT_WINDOW_SIZE) {
|
|
12766
12822
|
const values = [];
|
|
12767
12823
|
for (let i = 0; i < windowSize - 1; i++) values.push({
|
|
12768
12824
|
x: labels[i],
|
|
@@ -14346,19 +14402,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14346
14402
|
//#region src/helpers/figures/charts/runtime/chartjs_layout.ts
|
|
14347
14403
|
function getChartLayout(definition, args) {
|
|
14348
14404
|
return { padding: {
|
|
14349
|
-
left:
|
|
14350
|
-
right:
|
|
14351
|
-
top: Math.max(
|
|
14352
|
-
bottom:
|
|
14405
|
+
left: CHART_PADDING,
|
|
14406
|
+
right: CHART_PADDING,
|
|
14407
|
+
top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
|
|
14408
|
+
bottom: CHART_PADDING_BOTTOM
|
|
14353
14409
|
} };
|
|
14354
14410
|
}
|
|
14355
14411
|
function getCalendarChartLayout(definition, args) {
|
|
14356
14412
|
const legendPosition = definition.legendPosition;
|
|
14357
14413
|
return { padding: {
|
|
14358
|
-
left:
|
|
14359
|
-
right:
|
|
14360
|
-
top: Math.max(
|
|
14361
|
-
bottom:
|
|
14414
|
+
left: CHART_PADDING + (legendPosition === "left" ? CHART_COLORSCALE_WIDTH : 0),
|
|
14415
|
+
right: CHART_PADDING + (legendPosition === "right" ? CHART_COLORSCALE_WIDTH : 0),
|
|
14416
|
+
top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
|
|
14417
|
+
bottom: CHART_PADDING_BOTTOM
|
|
14362
14418
|
} };
|
|
14363
14419
|
}
|
|
14364
14420
|
|
|
@@ -14435,9 +14491,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14435
14491
|
}
|
|
14436
14492
|
function getWaterfallChartLegend(definition, args) {
|
|
14437
14493
|
const fontColor = chartFontColor(definition.background);
|
|
14438
|
-
const negativeColor = definition.negativeValuesColor ||
|
|
14439
|
-
const positiveColor = definition.positiveValuesColor ||
|
|
14440
|
-
const subTotalColor = definition.subTotalValuesColor ||
|
|
14494
|
+
const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
14495
|
+
const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
14496
|
+
const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
14441
14497
|
return {
|
|
14442
14498
|
...getLegendDisplayOptions(definition, args),
|
|
14443
14499
|
labels: {
|
|
@@ -14676,11 +14732,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14676
14732
|
color: chartTitle?.color ?? fontColor,
|
|
14677
14733
|
align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
|
|
14678
14734
|
font: {
|
|
14679
|
-
size: definition.title.fontSize ??
|
|
14735
|
+
size: definition.title.fontSize ?? CHART_TITLE_FONT_SIZE,
|
|
14680
14736
|
weight: chartTitle.bold ? "bold" : "normal",
|
|
14681
14737
|
style: chartTitle.italic ? "italic" : "normal"
|
|
14682
14738
|
},
|
|
14683
|
-
padding: { bottom: definition.legendPosition === "top" ? 0 :
|
|
14739
|
+
padding: { bottom: definition.legendPosition === "top" ? 0 : CHART_PADDING }
|
|
14684
14740
|
};
|
|
14685
14741
|
}
|
|
14686
14742
|
|
|
@@ -15137,7 +15193,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15137
15193
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
15138
15194
|
return {
|
|
15139
15195
|
...definition,
|
|
15140
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
15196
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
15141
15197
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
15142
15198
|
dataSets,
|
|
15143
15199
|
labelRange,
|
|
@@ -15496,7 +15552,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15496
15552
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
15497
15553
|
return {
|
|
15498
15554
|
...definition,
|
|
15499
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
15555
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
15500
15556
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
15501
15557
|
dataSets,
|
|
15502
15558
|
labelRange,
|
|
@@ -15576,7 +15632,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15576
15632
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
15577
15633
|
return {
|
|
15578
15634
|
...definition,
|
|
15579
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
15635
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
15580
15636
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
15581
15637
|
dataSets,
|
|
15582
15638
|
labelRange
|
|
@@ -15696,7 +15752,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15696
15752
|
PieChart: () => PieChart,
|
|
15697
15753
|
SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING: () => SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING,
|
|
15698
15754
|
ScorecardChart: () => ScorecardChart$1,
|
|
15699
|
-
TREND_LINE_XAXIS_ID: () =>
|
|
15755
|
+
TREND_LINE_XAXIS_ID: () => TREND_LINE_XAXIS_ID,
|
|
15700
15756
|
WaterfallChart: () => WaterfallChart,
|
|
15701
15757
|
adaptChartRange: () => adaptChartRange,
|
|
15702
15758
|
chartFontColor: () => chartFontColor,
|
|
@@ -16089,7 +16145,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
16089
16145
|
|
|
16090
16146
|
//#endregion
|
|
16091
16147
|
//#region src/components/figures/chart/chartJs/zoomable_chart/zoomable_chart_store.ts
|
|
16092
|
-
const TREND_LINE_AXES_IDS = [
|
|
16148
|
+
const TREND_LINE_AXES_IDS = [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID];
|
|
16093
16149
|
const ZOOMABLE_AXIS_IDS = ["x", ...TREND_LINE_AXES_IDS];
|
|
16094
16150
|
var ZoomableChartStore = class extends SpreadsheetStore {
|
|
16095
16151
|
mutators = [
|
|
@@ -16205,7 +16261,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
16205
16261
|
this.removeEventListeners();
|
|
16206
16262
|
}
|
|
16207
16263
|
get containerStyle() {
|
|
16208
|
-
return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${
|
|
16264
|
+
return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${MASTER_CHART_HEIGHT}px)` : "100%" });
|
|
16209
16265
|
}
|
|
16210
16266
|
get masterChartContainerStyle() {
|
|
16211
16267
|
const runtime = this.env.model.getters.getChartRuntime(this.props.chartId);
|
|
@@ -16264,8 +16320,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
16264
16320
|
getAxisLimitsFromDataset(chartData) {
|
|
16265
16321
|
const xValues = chartData.data.datasets.map((ds) => ds.data).flat().map((d, i) => typeof d === "object" && d !== null ? d.x : i);
|
|
16266
16322
|
return {
|
|
16267
|
-
min:
|
|
16268
|
-
max:
|
|
16323
|
+
min: largeMin(xValues),
|
|
16324
|
+
max: largeMax(xValues)
|
|
16269
16325
|
};
|
|
16270
16326
|
}
|
|
16271
16327
|
setMasterChartCursor(runtime) {
|
|
@@ -16351,7 +16407,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
16351
16407
|
updateTrendingLineAxes() {
|
|
16352
16408
|
this.store.updateTrendLineConfiguration(this.chartId);
|
|
16353
16409
|
const limits = this.store.currentAxesLimits[this.chartId];
|
|
16354
|
-
for (const axisId of [
|
|
16410
|
+
for (const axisId of [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID]) {
|
|
16355
16411
|
if (!this.chart?.config?.options?.scales?.[axisId] || !limits?.[axisId]) continue;
|
|
16356
16412
|
this.chart.config.options.scales[axisId].min = limits[axisId].min;
|
|
16357
16413
|
this.chart.config.options.scales[axisId].max = limits[axisId].max;
|
|
@@ -17616,7 +17672,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
17616
17672
|
onClickMenu: this.onClickMenu.bind(this),
|
|
17617
17673
|
onMouseEnter: this.onMenuItemMouseEnter.bind(this),
|
|
17618
17674
|
onMouseLeave: this.onMouseLeave.bind(this),
|
|
17619
|
-
width: this.props.width ||
|
|
17675
|
+
width: this.props.width || MENU_WIDTH,
|
|
17620
17676
|
onScroll: this.onScroll.bind(this),
|
|
17621
17677
|
onKeyDown: this.onKeydown.bind(this),
|
|
17622
17678
|
hoveredMenuId,
|
|
@@ -17635,11 +17691,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
17635
17691
|
anchorRect: {
|
|
17636
17692
|
x: this.props.anchorRect.x,
|
|
17637
17693
|
y: this.props.anchorRect.y,
|
|
17638
|
-
width: isRoot ? this.props.anchorRect.width : this.props.width ||
|
|
17639
|
-
height: isRoot ? this.props.anchorRect.height :
|
|
17694
|
+
width: isRoot ? this.props.anchorRect.width : this.props.width || MENU_WIDTH,
|
|
17695
|
+
height: isRoot ? this.props.anchorRect.height : DESKTOP_MENU_ITEM_HEIGHT
|
|
17640
17696
|
},
|
|
17641
17697
|
positioning: this.props.popoverPositioning,
|
|
17642
|
-
verticalOffset: isRoot ? 0 :
|
|
17698
|
+
verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
|
|
17643
17699
|
onPopoverHidden: () => this.closeSubMenu(),
|
|
17644
17700
|
onPopoverMoved: () => this.closeSubMenu(),
|
|
17645
17701
|
maxHeight: this.props.maxHeight
|
|
@@ -17696,8 +17752,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
17696
17752
|
this.subMenu.anchorRect = {
|
|
17697
17753
|
x: getRefBoundingRect(this.menuRef).x,
|
|
17698
17754
|
y: y - (this.subMenu.scrollOffset || 0),
|
|
17699
|
-
width: this.props.width ||
|
|
17700
|
-
height:
|
|
17755
|
+
width: this.props.width || MENU_WIDTH,
|
|
17756
|
+
height: DESKTOP_MENU_ITEM_HEIGHT
|
|
17701
17757
|
};
|
|
17702
17758
|
this.subMenu.menuItems = menu.children(this.env);
|
|
17703
17759
|
this.subMenu.isOpen = true;
|
|
@@ -17973,7 +18029,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
17973
18029
|
return [this.fullScreenMenuItem].filter(isDefined);
|
|
17974
18030
|
}
|
|
17975
18031
|
get backgroundColor() {
|
|
17976
|
-
return "background-color: " + (this.env.model.getters.getChartDefinition(this.props.chartId).background ||
|
|
18032
|
+
return "background-color: " + (this.env.model.getters.getChartDefinition(this.props.chartId).background || BACKGROUND_CHART_COLOR);
|
|
17977
18033
|
}
|
|
17978
18034
|
openContextMenu(ev) {
|
|
17979
18035
|
this.menuState.isOpen = true;
|
|
@@ -18100,7 +18156,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
18100
18156
|
if (this.selectedCarouselItem?.type === "chart") {
|
|
18101
18157
|
const chart = this.env.model.getters.getChartRuntime(this.selectedCarouselItem.chartId);
|
|
18102
18158
|
if ("background" in chart && chart.background) cssProperties["background-color"] = chart.background;
|
|
18103
|
-
else if ("chartJsConfig" in chart) cssProperties["background-color"] = chart.chartJsConfig.options?.plugins?.background?.color ||
|
|
18159
|
+
else if ("chartJsConfig" in chart) cssProperties["background-color"] = chart.chartJsConfig.options?.plugins?.background?.color || BACKGROUND_CHART_COLOR;
|
|
18104
18160
|
} else cssProperties["background-color"] = BACKGROUND_CHART_COLOR;
|
|
18105
18161
|
return cssPropertiesToCss(cssProperties);
|
|
18106
18162
|
}
|
|
@@ -19064,7 +19120,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19064
19120
|
width: 512,
|
|
19065
19121
|
height: 512,
|
|
19066
19122
|
paths: [{
|
|
19067
|
-
fillColor: color.textColor ||
|
|
19123
|
+
fillColor: color.textColor || TEXT_BODY_MUTED,
|
|
19068
19124
|
path: CARET_DOWN_PATH
|
|
19069
19125
|
}]
|
|
19070
19126
|
};
|
|
@@ -19075,7 +19131,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19075
19131
|
width: 512,
|
|
19076
19132
|
height: 512,
|
|
19077
19133
|
paths: [{
|
|
19078
|
-
fillColor: color.textColor ||
|
|
19134
|
+
fillColor: color.textColor || TEXT_BODY_MUTED,
|
|
19079
19135
|
path: CARET_UP_PATH
|
|
19080
19136
|
}]
|
|
19081
19137
|
};
|
|
@@ -19086,7 +19142,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19086
19142
|
width: 512,
|
|
19087
19143
|
height: 512,
|
|
19088
19144
|
paths: [{
|
|
19089
|
-
fillColor: color.textColor ||
|
|
19145
|
+
fillColor: color.textColor || TEXT_BODY_MUTED,
|
|
19090
19146
|
path: HOVERED_CARET_DOWN_PATH
|
|
19091
19147
|
}, {
|
|
19092
19148
|
fillColor: color.fillColor || "#fff",
|
|
@@ -19849,7 +19905,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19849
19905
|
alignment: {
|
|
19850
19906
|
horizontal: style.align,
|
|
19851
19907
|
vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
|
|
19852
|
-
wrapText: style.wrapping === "wrap" || content?.includes(
|
|
19908
|
+
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : void 0,
|
|
19853
19909
|
textRotation: style.rotation ? rotationToXLSX(style.rotation) : void 0,
|
|
19854
19910
|
shrinkToFit: style.wrapping === "clip" ? true : void 0
|
|
19855
19911
|
}
|
|
@@ -19890,7 +19946,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
19890
19946
|
function convertFormat(format, numFmtStructure) {
|
|
19891
19947
|
if (!format) return 0;
|
|
19892
19948
|
let formatId = XLSX_FORMAT_MAP[format.format];
|
|
19893
|
-
if (!formatId) formatId = pushElement(format, numFmtStructure) +
|
|
19949
|
+
if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
19894
19950
|
return formatId;
|
|
19895
19951
|
}
|
|
19896
19952
|
/**
|
|
@@ -20493,14 +20549,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
20493
20549
|
type: trend.type === "linear" ? "polynomial" : EXCEL_TO_SPREADSHEET_TRENDLINE_TYPE_MAPPING[trend.type],
|
|
20494
20550
|
order: trend.type === "linear" ? 1 : trend.order,
|
|
20495
20551
|
color: trend.color,
|
|
20496
|
-
window: trend.window ||
|
|
20552
|
+
window: trend.window || DEFAULT_WINDOW_SIZE,
|
|
20497
20553
|
display: true
|
|
20498
20554
|
};
|
|
20499
20555
|
}
|
|
20500
20556
|
function convertAnchor(XLSXanchor) {
|
|
20501
20557
|
const offset = {
|
|
20502
|
-
x: convertEMUToDotValue(XLSXanchor.colOffset) -
|
|
20503
|
-
y: convertEMUToDotValue(XLSXanchor.rowOffset) -
|
|
20558
|
+
x: convertEMUToDotValue(XLSXanchor.colOffset) - FIGURE_BORDER_WIDTH,
|
|
20559
|
+
y: convertEMUToDotValue(XLSXanchor.rowOffset) - FIGURE_BORDER_WIDTH
|
|
20504
20560
|
};
|
|
20505
20561
|
return {
|
|
20506
20562
|
col: XLSXanchor.col,
|
|
@@ -20852,8 +20908,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
20852
20908
|
dims[0] = Math.max(dims[0], fig.anchors[fig.anchors.length - 1]?.col ?? 0);
|
|
20853
20909
|
dims[1] = Math.max(dims[1], fig.anchors[fig.anchors.length - 1]?.row ?? 0);
|
|
20854
20910
|
}
|
|
20855
|
-
dims[0] = Math.max(dims[0] + 5,
|
|
20856
|
-
dims[1] = Math.max(dims[1] + 5,
|
|
20911
|
+
dims[0] = Math.max(dims[0] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
|
|
20912
|
+
dims[1] = Math.max(dims[1] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
|
|
20857
20913
|
return dims;
|
|
20858
20914
|
}
|
|
20859
20915
|
/**
|
|
@@ -22019,7 +22075,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
22019
22075
|
rgb = this.getThemeColor(themeIndex, theme.clrScheme);
|
|
22020
22076
|
} else {
|
|
22021
22077
|
rgb = this.extractAttr(colorElement, "rgb")?.asString();
|
|
22022
|
-
rgb = rgb ===
|
|
22078
|
+
rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
|
|
22023
22079
|
}
|
|
22024
22080
|
return {
|
|
22025
22081
|
rgb: rgb || defaultColor,
|
|
@@ -23138,7 +23194,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23138
23194
|
* Get the corresponding relationship file for a given xml file in a XLSX directory.
|
|
23139
23195
|
*/
|
|
23140
23196
|
function getRelationFile(file, xmls) {
|
|
23141
|
-
if (file ===
|
|
23197
|
+
if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
|
|
23142
23198
|
let relsFile = "";
|
|
23143
23199
|
const pathParts = file.split("/");
|
|
23144
23200
|
for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
|
|
@@ -23248,7 +23304,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23248
23304
|
if (token.type === "REFERENCE" && cellReference.test(token.value)) {
|
|
23249
23305
|
const value = token.value.trim();
|
|
23250
23306
|
if (!dependencies.includes(value)) dependencies.push(value);
|
|
23251
|
-
return `${
|
|
23307
|
+
return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
|
|
23252
23308
|
} else return token.value;
|
|
23253
23309
|
})),
|
|
23254
23310
|
dependencies
|
|
@@ -23444,7 +23500,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23444
23500
|
if (cell.formula) {
|
|
23445
23501
|
let { text, dependencies } = cell.formula;
|
|
23446
23502
|
for (const [index, d] of Object.entries(dependencies)) {
|
|
23447
|
-
const stringPosition = `\\${
|
|
23503
|
+
const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
|
|
23448
23504
|
text = text.replace(new RegExp(stringPosition, "g"), d);
|
|
23449
23505
|
}
|
|
23450
23506
|
cell.content = text;
|
|
@@ -25234,12 +25290,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25234
25290
|
for (let current = it.next(); !current.done; current = it.next()) {
|
|
25235
25291
|
if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) {
|
|
25236
25292
|
if (isFirstParagraph) isFirstParagraph = false;
|
|
25237
|
-
else text +=
|
|
25293
|
+
else text += NEWLINE;
|
|
25238
25294
|
emptyParagraph = isEmptyParagraph(current.value);
|
|
25239
25295
|
continue;
|
|
25240
25296
|
}
|
|
25241
25297
|
if (!current.value.hasChildNodes()) {
|
|
25242
|
-
if (current.value.nodeName === "BR" && !emptyParagraph) text +=
|
|
25298
|
+
if (current.value.nodeName === "BR" && !emptyParagraph) text += NEWLINE;
|
|
25243
25299
|
text += current.value.textContent;
|
|
25244
25300
|
}
|
|
25245
25301
|
}
|
|
@@ -25473,7 +25529,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25473
25529
|
if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
|
|
25474
25530
|
} else {
|
|
25475
25531
|
assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
|
|
25476
|
-
if (composerRect.left + ASSISTANT_WIDTH +
|
|
25532
|
+
if (composerRect.left + ASSISTANT_WIDTH + SCROLLBAR_WIDTH + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
|
|
25477
25533
|
}
|
|
25478
25534
|
return assistantStyle;
|
|
25479
25535
|
}
|
|
@@ -25570,7 +25626,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25570
25626
|
const start = Math.min(selection.start, selection.end);
|
|
25571
25627
|
const end = Math.max(selection.start, selection.end);
|
|
25572
25628
|
this.props.composerStore.stopComposerRangeSelection();
|
|
25573
|
-
this.props.composerStore.setCurrentContent(content.slice(0, start) +
|
|
25629
|
+
this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
|
|
25574
25630
|
start: start + 1,
|
|
25575
25631
|
end: start + 1
|
|
25576
25632
|
});
|
|
@@ -25748,7 +25804,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25748
25804
|
const { end, start } = this.props.composerStore.composerSelection;
|
|
25749
25805
|
for (let index = 0; index < tokens.length; index++) {
|
|
25750
25806
|
const token = tokens[index];
|
|
25751
|
-
let color = token.color ||
|
|
25807
|
+
let color = token.color || DEFAULT_TOKEN_COLOR;
|
|
25752
25808
|
if (token.isBlurred) color = setColorAlpha(color, .5);
|
|
25753
25809
|
const classes = [];
|
|
25754
25810
|
if (token.type === "REFERENCE" && this.props.composerStore.tokenAtCursor === token && this.props.composerStore.editionMode === "selecting") classes.push("text-decoration-underline");
|
|
@@ -25779,8 +25835,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25779
25835
|
splitHtmlContentIntoLines(contents) {
|
|
25780
25836
|
const contentSplitInLines = [];
|
|
25781
25837
|
let currentLine = [];
|
|
25782
|
-
for (const content of contents) if (content.value.includes(
|
|
25783
|
-
const lines = content.value.split(
|
|
25838
|
+
for (const content of contents) if (content.value.includes(NEWLINE)) {
|
|
25839
|
+
const lines = content.value.split(NEWLINE);
|
|
25784
25840
|
const lastLine = lines.pop();
|
|
25785
25841
|
for (const line of lines) {
|
|
25786
25842
|
currentLine.push({
|
|
@@ -26127,7 +26183,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26127
26183
|
function drawHighlight(renderingContext, highlight, rect) {
|
|
26128
26184
|
const { x, y, width, height } = rect;
|
|
26129
26185
|
if (width < 0 || height < 0) return;
|
|
26130
|
-
const color = highlight.color ||
|
|
26186
|
+
const color = highlight.color || HIGHLIGHT_COLOR;
|
|
26131
26187
|
const { ctx } = renderingContext;
|
|
26132
26188
|
ctx.save();
|
|
26133
26189
|
if (!highlight.noBorder) {
|
|
@@ -26696,11 +26752,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26696
26752
|
getTokenColor(token) {
|
|
26697
26753
|
if (token.type === "REFERENCE") {
|
|
26698
26754
|
const { xc, sheetName } = splitReference(token.value);
|
|
26699
|
-
return this.rangeXCColor(xc, sheetName) ||
|
|
26755
|
+
return this.rangeXCColor(xc, sheetName) || DEFAULT_TOKEN_COLOR;
|
|
26700
26756
|
}
|
|
26701
26757
|
if (token.type === "SYMBOL") {
|
|
26702
26758
|
const namedRange = this.getters.getNamedRange(token.value);
|
|
26703
|
-
if (namedRange) return this.rangeColor(namedRange.range) ||
|
|
26759
|
+
if (namedRange) return this.rangeColor(namedRange.range) || DEFAULT_TOKEN_COLOR;
|
|
26704
26760
|
const upperCaseValue = token.value.toUpperCase();
|
|
26705
26761
|
if (upperCaseValue === "TRUE" || upperCaseValue === "FALSE") return tokenColors.NUMBER;
|
|
26706
26762
|
if (upperCaseValue in functionRegistry.content) return tokenColors.FUNCTION;
|
|
@@ -26708,7 +26764,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26708
26764
|
if (["LEFT_PAREN", "RIGHT_PAREN"].includes(token.type)) {
|
|
26709
26765
|
if (token.parenthesesCode === "") return tokenColors.ORPHAN_RIGHT_PAREN;
|
|
26710
26766
|
}
|
|
26711
|
-
return tokenColors[token.type] ||
|
|
26767
|
+
return tokenColors[token.type] || DEFAULT_TOKEN_COLOR;
|
|
26712
26768
|
}
|
|
26713
26769
|
rangeXCColor(xc, sheetName) {
|
|
26714
26770
|
const refSheet = sheetName ? this.model.getters.getSheetIdByName(sheetName) : this.sheetId;
|
|
@@ -27387,7 +27443,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27387
27443
|
}
|
|
27388
27444
|
get sliderStyle() {
|
|
27389
27445
|
const hue = this.state.currentHslaColor?.h || 0;
|
|
27390
|
-
return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) -
|
|
27446
|
+
return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - ICON_EDGE_LENGTH / 2}px` });
|
|
27391
27447
|
}
|
|
27392
27448
|
get pointerStyle() {
|
|
27393
27449
|
const { s, l } = this.state.currentHslaColor || {
|
|
@@ -29183,7 +29239,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29183
29239
|
col,
|
|
29184
29240
|
row
|
|
29185
29241
|
});
|
|
29186
|
-
const textColor = style?.textColor ===
|
|
29242
|
+
const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
|
|
29187
29243
|
this.env.model.dispatch("UPDATE_CELL", {
|
|
29188
29244
|
col,
|
|
29189
29245
|
row,
|
|
@@ -30193,8 +30249,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30193
30249
|
zones = getters.getSelectedZones();
|
|
30194
30250
|
}
|
|
30195
30251
|
const size = {
|
|
30196
|
-
width:
|
|
30197
|
-
height:
|
|
30252
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
30253
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
30198
30254
|
};
|
|
30199
30255
|
const { col, row, offset } = centerFigurePosition(getters, size);
|
|
30200
30256
|
if (env.model.dispatch("CREATE_CHART", {
|
|
@@ -30216,8 +30272,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30216
30272
|
const figureId = env.model.uuidGenerator.smallUuid();
|
|
30217
30273
|
const sheetId = getters.getActiveSheetId();
|
|
30218
30274
|
const size = {
|
|
30219
|
-
width:
|
|
30220
|
-
height:
|
|
30275
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
30276
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
30221
30277
|
};
|
|
30222
30278
|
const { col, row, offset } = centerFigurePosition(getters, size);
|
|
30223
30279
|
if (env.model.dispatch("CREATE_CAROUSEL", {
|
|
@@ -30267,7 +30323,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30267
30323
|
execute: (env) => {
|
|
30268
30324
|
const zone = env.model.getters.getSelectedZone();
|
|
30269
30325
|
const table = env.model.getters.getPivot(pivotId).getExpandedTableStructure();
|
|
30270
|
-
if (table.numberOfCells >
|
|
30326
|
+
if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
|
|
30271
30327
|
env.notifyUser({
|
|
30272
30328
|
type: "warning",
|
|
30273
30329
|
text: getPivotTooBigErrorMessage(table.numberOfCells, env.model.getters.getLocale()),
|
|
@@ -31010,6 +31066,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31010
31066
|
rootEditorRef = (0, _odoo_owl.useRef)("NumberEditor");
|
|
31011
31067
|
valueListRef = (0, _odoo_owl.useRef)("numberList");
|
|
31012
31068
|
DOMFocusableElementStore;
|
|
31069
|
+
/**
|
|
31070
|
+
* Skips the change event triggered when moving focus out of the input.
|
|
31071
|
+
* The value has already been committed by `onInputKeydown`.
|
|
31072
|
+
*/
|
|
31073
|
+
skipNextInputChange = false;
|
|
31013
31074
|
setup() {
|
|
31014
31075
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
31015
31076
|
(0, _odoo_owl.useExternalListener)(window, "click", this.onExternalClick, { capture: true });
|
|
@@ -31046,11 +31107,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31046
31107
|
this.dropdown.isOpen = false;
|
|
31047
31108
|
}
|
|
31048
31109
|
setValue(valueStr) {
|
|
31049
|
-
const value = clip(Math.
|
|
31110
|
+
const value = clip(Math.round(parseFloat(valueStr)), this.props.min, this.props.max);
|
|
31111
|
+
if (isNaN(value)) return;
|
|
31050
31112
|
this.props.onValueChange(value);
|
|
31051
31113
|
this.closeList();
|
|
31114
|
+
return value;
|
|
31052
31115
|
}
|
|
31053
31116
|
setValueFromInput(ev) {
|
|
31117
|
+
if (this.skipNextInputChange) return;
|
|
31054
31118
|
this.setValue(ev.target.value);
|
|
31055
31119
|
}
|
|
31056
31120
|
setValueFromList(valueStr) {
|
|
@@ -31064,19 +31128,26 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31064
31128
|
ev.target.select();
|
|
31065
31129
|
}
|
|
31066
31130
|
onInputKeydown(ev) {
|
|
31067
|
-
|
|
31068
|
-
|
|
31069
|
-
|
|
31070
|
-
|
|
31071
|
-
|
|
31072
|
-
|
|
31073
|
-
|
|
31074
|
-
|
|
31075
|
-
|
|
31076
|
-
|
|
31077
|
-
|
|
31078
|
-
|
|
31131
|
+
const target = ev.target;
|
|
31132
|
+
switch (ev.key) {
|
|
31133
|
+
case "Enter":
|
|
31134
|
+
case "Tab": {
|
|
31135
|
+
ev.preventDefault();
|
|
31136
|
+
ev.stopPropagation();
|
|
31137
|
+
const value = this.setValue(target.value);
|
|
31138
|
+
if (value === void 0) return;
|
|
31139
|
+
target.value = `${value}`;
|
|
31140
|
+
break;
|
|
31141
|
+
}
|
|
31142
|
+
case "Escape":
|
|
31143
|
+
target.value = `${this.props.currentValue}`;
|
|
31144
|
+
this.closeList();
|
|
31145
|
+
break;
|
|
31146
|
+
default: return;
|
|
31079
31147
|
}
|
|
31148
|
+
this.skipNextInputChange = true;
|
|
31149
|
+
this.DOMFocusableElementStore.focus();
|
|
31150
|
+
this.skipNextInputChange = false;
|
|
31080
31151
|
}
|
|
31081
31152
|
};
|
|
31082
31153
|
|
|
@@ -31871,7 +31942,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31871
31942
|
axesList: Array
|
|
31872
31943
|
};
|
|
31873
31944
|
state = (0, _odoo_owl.useState)({ currentAxis: "x" });
|
|
31874
|
-
defaultFontSize =
|
|
31945
|
+
defaultFontSize = CHART_AXIS_TITLE_FONT_SIZE;
|
|
31875
31946
|
get axisTitleStyle() {
|
|
31876
31947
|
return this.props.definition.axesDesign?.[this.state.currentAxis]?.title ?? {};
|
|
31877
31948
|
}
|
|
@@ -32074,7 +32145,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32074
32145
|
optional: true
|
|
32075
32146
|
}
|
|
32076
32147
|
};
|
|
32077
|
-
static defaultProps = { defaultChartTitleFontSize:
|
|
32148
|
+
static defaultProps = { defaultChartTitleFontSize: CHART_TITLE_FONT_SIZE };
|
|
32078
32149
|
state;
|
|
32079
32150
|
setup() {
|
|
32080
32151
|
this.state = (0, _odoo_owl.useState)({ activeTool: "" });
|
|
@@ -32344,11 +32415,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32344
32415
|
return Math.min(10, runtime.chartJsConfig.data.datasets[index].data.length - 1);
|
|
32345
32416
|
}
|
|
32346
32417
|
get defaultWindowSize() {
|
|
32347
|
-
return
|
|
32418
|
+
return DEFAULT_WINDOW_SIZE;
|
|
32348
32419
|
}
|
|
32349
32420
|
onChangeMovingAverageWindow(dataSetId, value) {
|
|
32350
|
-
let window = parseInt(value) ||
|
|
32351
|
-
if (window <= 1) window =
|
|
32421
|
+
let window = parseInt(value) || DEFAULT_WINDOW_SIZE;
|
|
32422
|
+
if (window <= 1) window = DEFAULT_WINDOW_SIZE;
|
|
32352
32423
|
this.updateTrendLineValue(dataSetId, { window });
|
|
32353
32424
|
}
|
|
32354
32425
|
getDataSeriesColor(dataSetId) {
|
|
@@ -33464,7 +33535,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
33464
33535
|
});
|
|
33465
33536
|
}
|
|
33466
33537
|
get defaultHoleSize() {
|
|
33467
|
-
return
|
|
33538
|
+
return DEFAULT_DOUGHNUT_CHART_HOLE_SIZE;
|
|
33468
33539
|
}
|
|
33469
33540
|
updateEditedValues(selectedIndex) {
|
|
33470
33541
|
this.state.index = parseInt(selectedIndex);
|
|
@@ -33634,7 +33705,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
33634
33705
|
return this.props.definition.baselineMode === "progress" ? _t("Progress bar colors") : _t("Baseline colors");
|
|
33635
33706
|
}
|
|
33636
33707
|
get defaultScorecardTitleFontSize() {
|
|
33637
|
-
return
|
|
33708
|
+
return SCORECARD_CHART_TITLE_FONT_SIZE;
|
|
33638
33709
|
}
|
|
33639
33710
|
translate(term) {
|
|
33640
33711
|
return this.env.model.getters.dynamicTranslate(term);
|
|
@@ -33655,14 +33726,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
33655
33726
|
get keyStyle() {
|
|
33656
33727
|
return {
|
|
33657
33728
|
align: "center",
|
|
33658
|
-
fontSize:
|
|
33729
|
+
fontSize: DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE,
|
|
33659
33730
|
...this.props.definition.keyDescr
|
|
33660
33731
|
};
|
|
33661
33732
|
}
|
|
33662
33733
|
get baselineStyle() {
|
|
33663
33734
|
return {
|
|
33664
33735
|
align: "center",
|
|
33665
|
-
fontSize:
|
|
33736
|
+
fontSize: DEFAULT_SCORECARD_BASELINE_FONT_SIZE,
|
|
33666
33737
|
...this.props.definition.baselineDescr
|
|
33667
33738
|
};
|
|
33668
33739
|
}
|
|
@@ -33902,13 +33973,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
33902
33973
|
}];
|
|
33903
33974
|
}
|
|
33904
33975
|
get positiveValuesColor() {
|
|
33905
|
-
return this.props.definition.positiveValuesColor ||
|
|
33976
|
+
return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
33906
33977
|
}
|
|
33907
33978
|
get negativeValuesColor() {
|
|
33908
|
-
return this.props.definition.negativeValuesColor ||
|
|
33979
|
+
return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
33909
33980
|
}
|
|
33910
33981
|
get subTotalValuesColor() {
|
|
33911
|
-
return this.props.definition.subTotalValuesColor ||
|
|
33982
|
+
return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
33912
33983
|
}
|
|
33913
33984
|
updateVerticalAxisPosition(value) {
|
|
33914
33985
|
this.props.updateChart(this.props.chartId, { verticalAxisPosition: value });
|
|
@@ -35091,7 +35162,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35091
35162
|
get previewGradient() {
|
|
35092
35163
|
const rule = this.state.rules.colorScale;
|
|
35093
35164
|
const minColor = colorNumberToHex(rule.minimum.color);
|
|
35094
|
-
const midColor = colorNumberToHex(rule.midpoint?.color ||
|
|
35165
|
+
const midColor = colorNumberToHex(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
35095
35166
|
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
35096
35167
|
const baseString = "linear-gradient(to right, ";
|
|
35097
35168
|
return cssPropertiesToCss({
|
|
@@ -37190,7 +37261,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
37190
37261
|
return {
|
|
37191
37262
|
type: measureDisplayType,
|
|
37192
37263
|
fieldNameWithGranularity,
|
|
37193
|
-
value: value ??
|
|
37264
|
+
value: value ?? PREVIOUS_VALUE
|
|
37194
37265
|
};
|
|
37195
37266
|
}
|
|
37196
37267
|
}
|
|
@@ -38226,6 +38297,117 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
38226
38297
|
}
|
|
38227
38298
|
};
|
|
38228
38299
|
|
|
38300
|
+
//#endregion
|
|
38301
|
+
//#region src/helpers/pivot/spreadsheet_pivot/data_entries_index_spreadsheet_pivot.ts
|
|
38302
|
+
const EMPTY_DATA_ENTRIES = [];
|
|
38303
|
+
/**
|
|
38304
|
+
* Index of the data entries of a spreadsheet pivot, used to retrieve the
|
|
38305
|
+
* entries matching a pivot domain without scanning all the entries.
|
|
38306
|
+
*
|
|
38307
|
+
* Starting with the row dimensions, one can descend either in the
|
|
38308
|
+
* next row dimension (`rowChildren`) or in the first column dimension
|
|
38309
|
+
* (`colChildren`).
|
|
38310
|
+
*
|
|
38311
|
+
* e.g. with the rows ["continent", "city"] and the columns ["team"]
|
|
38312
|
+
*
|
|
38313
|
+
* root -> all the entries
|
|
38314
|
+
* ├── (col) Team 1 -> [team=Team 1]
|
|
38315
|
+
* ├── (col) Team 2 -> [team=Team 2]
|
|
38316
|
+
* ├── (row) Europe -> [continent=Europe]
|
|
38317
|
+
* │ ├── (col) Team 1 -> [continent=Europe, team=Team 1]
|
|
38318
|
+
* │ ├── (row) Brussels -> [continent=Europe, city=Brussels]
|
|
38319
|
+
* │ │ └── (col) Team 1 -> [continent=Europe, city=Brussels, team=Team 1]
|
|
38320
|
+
* │ └── (row) Paris
|
|
38321
|
+
* │ └── ...
|
|
38322
|
+
* └── (row) North America
|
|
38323
|
+
* └── ...
|
|
38324
|
+
*
|
|
38325
|
+
* Each entry is inserted once per couple (row prefix, column prefix) it belongs
|
|
38326
|
+
* to, which is exactly the number of pivot cells it contributes to.
|
|
38327
|
+
*/
|
|
38328
|
+
var PivotDataEntriesIndex = class {
|
|
38329
|
+
rowDimensions;
|
|
38330
|
+
colDimensions;
|
|
38331
|
+
root = createIndexNode();
|
|
38332
|
+
constructor(dataEntries, rowDimensions, colDimensions) {
|
|
38333
|
+
this.rowDimensions = rowDimensions;
|
|
38334
|
+
this.colDimensions = colDimensions;
|
|
38335
|
+
for (const entry of dataEntries) this.addEntry(entry);
|
|
38336
|
+
}
|
|
38337
|
+
/**
|
|
38338
|
+
* Get the data entries matching the given domain.
|
|
38339
|
+
*/
|
|
38340
|
+
getDataEntries(domain) {
|
|
38341
|
+
const rowKeys = [];
|
|
38342
|
+
const colKeys = [];
|
|
38343
|
+
for (const domainNode of domain) {
|
|
38344
|
+
const rowDimension = this.rowDimensions[rowKeys.length];
|
|
38345
|
+
if (rowDimension?.nameWithGranularity === domainNode.field) {
|
|
38346
|
+
rowKeys.push(toGroupKey(domainNode.value, rowDimension));
|
|
38347
|
+
continue;
|
|
38348
|
+
}
|
|
38349
|
+
const colDimension = this.colDimensions[colKeys.length];
|
|
38350
|
+
if (colDimension?.nameWithGranularity !== domainNode.field) throw new EvaluationError(_t("Dimension %s does not exist", domainNode.field));
|
|
38351
|
+
colKeys.push(toGroupKey(domainNode.value, colDimension));
|
|
38352
|
+
}
|
|
38353
|
+
let node = this.root;
|
|
38354
|
+
for (const key of rowKeys) {
|
|
38355
|
+
node = node.rowChildren?.get(key);
|
|
38356
|
+
if (!node) return EMPTY_DATA_ENTRIES;
|
|
38357
|
+
}
|
|
38358
|
+
for (const key of colKeys) {
|
|
38359
|
+
node = node.colChildren?.get(key);
|
|
38360
|
+
if (!node) return EMPTY_DATA_ENTRIES;
|
|
38361
|
+
}
|
|
38362
|
+
return node.entries;
|
|
38363
|
+
}
|
|
38364
|
+
addEntry(entry) {
|
|
38365
|
+
let rowNode = this.root;
|
|
38366
|
+
this.addEntryToColumns(rowNode, entry);
|
|
38367
|
+
for (const dimension of this.rowDimensions) {
|
|
38368
|
+
rowNode = getOrCreateChild(rowNode, "rowChildren", getEntryGroupKey(entry, dimension));
|
|
38369
|
+
this.addEntryToColumns(rowNode, entry);
|
|
38370
|
+
}
|
|
38371
|
+
}
|
|
38372
|
+
/**
|
|
38373
|
+
* Add the entry to the given row node, and to each of its column prefixes.
|
|
38374
|
+
*/
|
|
38375
|
+
addEntryToColumns(rowNode, entry) {
|
|
38376
|
+
rowNode.entries.push(entry);
|
|
38377
|
+
let node = rowNode;
|
|
38378
|
+
for (const dimension of this.colDimensions) {
|
|
38379
|
+
node = getOrCreateChild(node, "colChildren", getEntryGroupKey(entry, dimension));
|
|
38380
|
+
node.entries.push(entry);
|
|
38381
|
+
}
|
|
38382
|
+
}
|
|
38383
|
+
};
|
|
38384
|
+
function createIndexNode() {
|
|
38385
|
+
return {
|
|
38386
|
+
entries: [],
|
|
38387
|
+
rowChildren: void 0,
|
|
38388
|
+
colChildren: void 0
|
|
38389
|
+
};
|
|
38390
|
+
}
|
|
38391
|
+
function getOrCreateChild(node, axis, key) {
|
|
38392
|
+
let children = node[axis];
|
|
38393
|
+
if (!children) {
|
|
38394
|
+
children = /* @__PURE__ */ new Map();
|
|
38395
|
+
node[axis] = children;
|
|
38396
|
+
}
|
|
38397
|
+
let child = children.get(key);
|
|
38398
|
+
if (!child) {
|
|
38399
|
+
child = createIndexNode();
|
|
38400
|
+
children.set(key, child);
|
|
38401
|
+
}
|
|
38402
|
+
return child;
|
|
38403
|
+
}
|
|
38404
|
+
function getEntryGroupKey(entry, dimension) {
|
|
38405
|
+
return toGroupKey(entry[dimension.nameWithGranularity]?.value, dimension);
|
|
38406
|
+
}
|
|
38407
|
+
function toGroupKey(value, dimension) {
|
|
38408
|
+
return dimension.type === "char" ? String(value) : value;
|
|
38409
|
+
}
|
|
38410
|
+
|
|
38229
38411
|
//#endregion
|
|
38230
38412
|
//#region src/helpers/pivot/pivot_domain_helpers.ts
|
|
38231
38413
|
function getDomainOfParentRow(pivot, domain) {
|
|
@@ -38331,7 +38513,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
38331
38513
|
if (value === void 0) return;
|
|
38332
38514
|
const valueIndex = values.indexOf(value);
|
|
38333
38515
|
if (value === void 0 || valueIndex === -1) return;
|
|
38334
|
-
return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction ===
|
|
38516
|
+
return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === PREVIOUS_VALUE ? -1 : 1), 0, values.length - 1)]);
|
|
38335
38517
|
}
|
|
38336
38518
|
function domainToString(domain) {
|
|
38337
38519
|
return domain ? domain.map(domainNodeToString).join(", ") : "";
|
|
@@ -38982,6 +39164,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
38982
39164
|
*/
|
|
38983
39165
|
dataEntries = [];
|
|
38984
39166
|
/**
|
|
39167
|
+
* This index is used to retrieve the data entries matching a pivot domain
|
|
39168
|
+
* without scanning all the data entries.
|
|
39169
|
+
*/
|
|
39170
|
+
dataEntriesIndex = lazy(() => new PivotDataEntriesIndex([], [], []));
|
|
39171
|
+
/**
|
|
38985
39172
|
* This object contains the pivot table structure. It is created from the
|
|
38986
39173
|
* data entries and the pivot definition.
|
|
38987
39174
|
*/
|
|
@@ -39013,6 +39200,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39013
39200
|
if (type >= 3) this._definition = this.loadRuntimeDefinition();
|
|
39014
39201
|
if (type >= 2) this.dataEntries = this.loadData();
|
|
39015
39202
|
if (type >= 1) {
|
|
39203
|
+
this.dataEntriesIndex = lazy(() => new PivotDataEntriesIndex(this.dataEntries, this.definition.rows, this.definition.columns));
|
|
39016
39204
|
this.collapsedTable = void 0;
|
|
39017
39205
|
this.expandedTable = void 0;
|
|
39018
39206
|
}
|
|
@@ -39089,14 +39277,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39089
39277
|
const lastNode = domain.at(-1);
|
|
39090
39278
|
if (!lastNode) return { value: _t("Total") };
|
|
39091
39279
|
const dimension = this.getDimension(lastNode.field);
|
|
39092
|
-
const finalCell = this.filterDataEntriesFromDomain(this.dataEntries, domain)[0]?.[dimension.nameWithGranularity];
|
|
39093
39280
|
if (dimension.type === "datetime") return pivotTimeAdapter(dimension.granularity || "month").toValueAndFormat(lastNode.value, this.getters.getLocale());
|
|
39281
|
+
const finalCell = this.getDataEntriesFromDomain(domain)[0]?.[dimension.nameWithGranularity];
|
|
39094
39282
|
if (!finalCell) return { value: "" };
|
|
39095
39283
|
if (finalCell.value === null) return { value: _t("(Undefined)") };
|
|
39096
39284
|
return finalCell;
|
|
39097
39285
|
}
|
|
39098
39286
|
getPivotCellValueAndFormat(measureId, domain) {
|
|
39099
|
-
const dataEntries = this.
|
|
39287
|
+
const dataEntries = this.getDataEntriesFromDomain(domain);
|
|
39100
39288
|
if (dataEntries.length === 0) return { value: "" };
|
|
39101
39289
|
const measure = this.getMeasure(measureId);
|
|
39102
39290
|
const allValues = dataEntries.map((value) => value[measure.fieldName]).filter(isDefined);
|
|
@@ -39186,17 +39374,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39186
39374
|
if (!type) throw new Error(`Field ${fieldName} does not exist`);
|
|
39187
39375
|
return type;
|
|
39188
39376
|
}
|
|
39189
|
-
|
|
39190
|
-
return
|
|
39191
|
-
}
|
|
39192
|
-
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
39193
|
-
const { field, value, type } = domain;
|
|
39194
|
-
const { nameWithGranularity } = this.getDimension(field);
|
|
39195
|
-
return dataEntries.filter((entry) => {
|
|
39196
|
-
const cellValue = entry[nameWithGranularity]?.value;
|
|
39197
|
-
if (type === "char") return String(cellValue) === String(value);
|
|
39198
|
-
return cellValue === value;
|
|
39199
|
-
});
|
|
39377
|
+
getDataEntriesFromDomain(domain) {
|
|
39378
|
+
return this.dataEntriesIndex().getDataEntries(domain);
|
|
39200
39379
|
}
|
|
39201
39380
|
getDimension(nameWithGranularity) {
|
|
39202
39381
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -39578,7 +39757,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
39578
39757
|
}
|
|
39579
39758
|
const pivot = this.getters.getPivot(this.pivotId);
|
|
39580
39759
|
const numberOfCells = pivot.isValid() ? pivot.getExpandedTableStructure().numberOfCells : 0;
|
|
39581
|
-
if (!this.alreadyNotifiedForPivotSize && numberOfCells >
|
|
39760
|
+
if (!this.alreadyNotifiedForPivotSize && numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
|
|
39582
39761
|
this.alreadyNotifiedForPivotSize = true;
|
|
39583
39762
|
this.notification.notifyUser({
|
|
39584
39763
|
type: "warning",
|
|
@@ -41428,7 +41607,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41428
41607
|
},
|
|
41429
41608
|
{
|
|
41430
41609
|
label: _t("Line Break"),
|
|
41431
|
-
value:
|
|
41610
|
+
value: NEWLINE
|
|
41432
41611
|
}
|
|
41433
41612
|
];
|
|
41434
41613
|
var SplitIntoColumnsPanel = class extends _odoo_owl.Component {
|
|
@@ -41973,7 +42152,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41973
42152
|
const newPanelInfo = {
|
|
41974
42153
|
currentPanelProps,
|
|
41975
42154
|
componentTag,
|
|
41976
|
-
size:
|
|
42155
|
+
size: DEFAULT_SIDE_PANEL_SIZE
|
|
41977
42156
|
};
|
|
41978
42157
|
const state = this.computeState(newPanelInfo);
|
|
41979
42158
|
if (!state.isOpen) return;
|
|
@@ -41981,8 +42160,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41981
42160
|
this._openPanel("mainPanel", newPanelInfo, state);
|
|
41982
42161
|
return;
|
|
41983
42162
|
}
|
|
41984
|
-
const nonCollapsedPanelSize = this.mainPanel.isCollapsed ?
|
|
41985
|
-
if (!this.secondaryPanel && nonCollapsedPanelSize +
|
|
42163
|
+
const nonCollapsedPanelSize = this.mainPanel.isCollapsed ? DEFAULT_SIDE_PANEL_SIZE : this.mainPanel.size;
|
|
42164
|
+
if (!this.secondaryPanel && nonCollapsedPanelSize + DEFAULT_SIDE_PANEL_SIZE > this.availableWidth) {
|
|
41986
42165
|
this.get(NotificationStore).notifyUser({
|
|
41987
42166
|
sticky: false,
|
|
41988
42167
|
type: "warning",
|
|
@@ -41996,7 +42175,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41996
42175
|
const newPanelInfo = {
|
|
41997
42176
|
currentPanelProps,
|
|
41998
42177
|
componentTag,
|
|
41999
|
-
size:
|
|
42178
|
+
size: DEFAULT_SIDE_PANEL_SIZE
|
|
42000
42179
|
};
|
|
42001
42180
|
const state = this.computeState(newPanelInfo);
|
|
42002
42181
|
if (!state.isOpen) return;
|
|
@@ -42025,7 +42204,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42025
42204
|
this[panel] = {
|
|
42026
42205
|
currentPanelProps: state.props ?? {},
|
|
42027
42206
|
componentTag: newPanel.componentTag,
|
|
42028
|
-
size: currentPanel?.size ||
|
|
42207
|
+
size: currentPanel?.size || DEFAULT_SIDE_PANEL_SIZE,
|
|
42029
42208
|
isCollapsed: currentPanel?.isCollapsed || false,
|
|
42030
42209
|
isPinned: currentPanel && "isPinned" in currentPanel ? currentPanel.isPinned : false
|
|
42031
42210
|
};
|
|
@@ -42055,19 +42234,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42055
42234
|
changePanelSize(panel, size) {
|
|
42056
42235
|
const panelInfo = this[panel];
|
|
42057
42236
|
if (!panelInfo || "isCollapsed" in panelInfo && panelInfo.isCollapsed) return;
|
|
42058
|
-
size = Math.max(size,
|
|
42237
|
+
size = Math.max(size, DEFAULT_SIDE_PANEL_SIZE);
|
|
42059
42238
|
let otherPanelSize = panel === "mainPanel" ? this.secondaryPanel?.size || 0 : this.mainPanel?.size || 0;
|
|
42060
42239
|
if (size > this.availableWidth - otherPanelSize) {
|
|
42061
42240
|
if (panel === "mainPanel" && this.secondaryPanel) {
|
|
42062
|
-
this.secondaryPanel.size = Math.max(this.availableWidth - size,
|
|
42241
|
+
this.secondaryPanel.size = Math.max(this.availableWidth - size, DEFAULT_SIDE_PANEL_SIZE);
|
|
42063
42242
|
otherPanelSize = this.secondaryPanel.size;
|
|
42064
42243
|
}
|
|
42065
|
-
size = Math.max(this.availableWidth - otherPanelSize,
|
|
42244
|
+
size = Math.max(this.availableWidth - otherPanelSize, DEFAULT_SIDE_PANEL_SIZE);
|
|
42066
42245
|
}
|
|
42067
42246
|
panelInfo.size = size;
|
|
42068
42247
|
}
|
|
42069
42248
|
resetPanelSize(panel) {
|
|
42070
|
-
if (this[panel]) this[panel].size =
|
|
42249
|
+
if (this[panel]) this[panel].size = DEFAULT_SIDE_PANEL_SIZE;
|
|
42071
42250
|
}
|
|
42072
42251
|
togglePinPanel() {
|
|
42073
42252
|
if (!this.mainPanel) return;
|
|
@@ -42083,10 +42262,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42083
42262
|
if (!panelInfo) return;
|
|
42084
42263
|
if (panelInfo.isCollapsed) {
|
|
42085
42264
|
panelInfo.isCollapsed = false;
|
|
42086
|
-
this.changePanelSize(panel,
|
|
42265
|
+
this.changePanelSize(panel, DEFAULT_SIDE_PANEL_SIZE);
|
|
42087
42266
|
} else {
|
|
42088
42267
|
panelInfo.isCollapsed = true;
|
|
42089
|
-
panelInfo.size =
|
|
42268
|
+
panelInfo.size = COLLAPSED_SIDE_PANEL_SIZE;
|
|
42090
42269
|
}
|
|
42091
42270
|
}
|
|
42092
42271
|
computeState({ componentTag, currentPanelProps: initialPanelProps }) {
|
|
@@ -42101,12 +42280,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42101
42280
|
} : state;
|
|
42102
42281
|
}
|
|
42103
42282
|
changeSpreadsheetWidth(width) {
|
|
42104
|
-
this.availableWidth = width -
|
|
42105
|
-
if (this.secondaryPanel && width - this.totalPanelSize <
|
|
42283
|
+
this.availableWidth = width - MIN_SHEET_VIEW_WIDTH;
|
|
42284
|
+
if (this.secondaryPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) {
|
|
42106
42285
|
this.secondaryPanel?.currentPanelProps.onCloseSidePanel?.();
|
|
42107
42286
|
this.secondaryPanel = void 0;
|
|
42108
42287
|
}
|
|
42109
|
-
if (this.mainPanel && width - this.totalPanelSize <
|
|
42288
|
+
if (this.mainPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) this.mainPanel.size = Math.max(width - MIN_SHEET_VIEW_WIDTH, DEFAULT_SIDE_PANEL_SIZE);
|
|
42110
42289
|
}
|
|
42111
42290
|
};
|
|
42112
42291
|
|
|
@@ -43801,7 +43980,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43801
43980
|
let { scrollX, scrollY } = getters.getActiveSheetScrollInfo();
|
|
43802
43981
|
const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
|
|
43803
43982
|
let canEdgeScroll = false;
|
|
43804
|
-
let timeoutDelay =
|
|
43983
|
+
let timeoutDelay = MAX_DELAY;
|
|
43805
43984
|
const x = zoomedMouseEvent.clientX - position.x;
|
|
43806
43985
|
let colIndex = getters.getColIndex(x);
|
|
43807
43986
|
if (scrollDirection !== "vertical") {
|
|
@@ -44197,7 +44376,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44197
44376
|
return true;
|
|
44198
44377
|
}
|
|
44199
44378
|
function astToDoc(ast) {
|
|
44200
|
-
const debugPrefix = ast.debug ? `${
|
|
44379
|
+
const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
|
|
44201
44380
|
switch (ast.type) {
|
|
44202
44381
|
case "NUMBER": return debugPrefix + String(ast.value);
|
|
44203
44382
|
case "STRING": return debugPrefix + `"${ast.value}"`;
|
|
@@ -44276,7 +44455,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44276
44455
|
* Converts an ast formula to the corresponding string
|
|
44277
44456
|
*/
|
|
44278
44457
|
function astToFormula(ast) {
|
|
44279
|
-
const debugPrefix = ast.debug ? `${
|
|
44458
|
+
const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
|
|
44280
44459
|
switch (ast.type) {
|
|
44281
44460
|
case "FUNCALL":
|
|
44282
44461
|
const args = ast.args.map((arg) => astToFormula(arg));
|
|
@@ -44960,19 +45139,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44960
45139
|
position = y;
|
|
44961
45140
|
break;
|
|
44962
45141
|
case "bottom":
|
|
44963
|
-
position = y + figureUI.height -
|
|
45142
|
+
position = y + figureUI.height - FIGURE_BORDER_WIDTH;
|
|
44964
45143
|
break;
|
|
44965
45144
|
case "vCenter":
|
|
44966
|
-
position = y + Math.floor(figureUI.height / 2) -
|
|
45145
|
+
position = y + Math.floor(figureUI.height / 2) - FIGURE_BORDER_WIDTH;
|
|
44967
45146
|
break;
|
|
44968
45147
|
case "left":
|
|
44969
45148
|
position = x;
|
|
44970
45149
|
break;
|
|
44971
45150
|
case "right":
|
|
44972
|
-
position = x + figureUI.width -
|
|
45151
|
+
position = x + figureUI.width - FIGURE_BORDER_WIDTH;
|
|
44973
45152
|
break;
|
|
44974
45153
|
case "hCenter":
|
|
44975
|
-
position = x + Math.floor(figureUI.width / 2) -
|
|
45154
|
+
position = x + Math.floor(figureUI.width / 2) - FIGURE_BORDER_WIDTH;
|
|
44976
45155
|
break;
|
|
44977
45156
|
}
|
|
44978
45157
|
return {
|
|
@@ -45184,7 +45363,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45184
45363
|
};
|
|
45185
45364
|
const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
|
|
45186
45365
|
const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
|
|
45187
|
-
if (!hasStartedDnd && offsetX <
|
|
45366
|
+
if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) return;
|
|
45188
45367
|
hasStartedDnd = true;
|
|
45189
45368
|
const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
|
|
45190
45369
|
const otherFigures = this.getOtherFigures(initialFigure.id);
|
|
@@ -45236,7 +45415,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45236
45415
|
ev.stopPropagation();
|
|
45237
45416
|
const initialScrollPosition = this.env.model.getters.getActiveSheetScrollInfo();
|
|
45238
45417
|
const keepRatio = figureRegistry.get(figureUI.tag).keepRatio || false;
|
|
45239
|
-
const minFigSize = figureRegistry.get(figureUI.tag).minFigSize ||
|
|
45418
|
+
const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || MIN_FIG_SIZE;
|
|
45240
45419
|
const zoom = this.env.model.getters.getViewportZoomLevel();
|
|
45241
45420
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
45242
45421
|
const initialMousePosition = {
|
|
@@ -45805,7 +45984,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45805
45984
|
get isFooterVisible() {
|
|
45806
45985
|
const { y } = this.env.model.getters.getMainViewportCoordinates();
|
|
45807
45986
|
const { height } = this.env.model.getters.getSheetViewDimension();
|
|
45808
|
-
return !this.env.model.getters.isReadonly() && height - y >
|
|
45987
|
+
return !this.env.model.getters.isReadonly() && height - y > FOOTER_HEIGHT;
|
|
45809
45988
|
}
|
|
45810
45989
|
};
|
|
45811
45990
|
|
|
@@ -45860,7 +46039,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45860
46039
|
row: hiddenIndex
|
|
45861
46040
|
}));
|
|
45862
46041
|
return cssPropertiesToCss({
|
|
45863
|
-
top: rect.y + rect.height -
|
|
46042
|
+
top: rect.y + rect.height - HEADER_HEIGHT - this.props.offset + "px",
|
|
45864
46043
|
"margin-right": "1px"
|
|
45865
46044
|
});
|
|
45866
46045
|
}
|
|
@@ -45869,7 +46048,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45869
46048
|
top: this.env.model.getters.getRect(positionToZone({
|
|
45870
46049
|
col: 0,
|
|
45871
46050
|
row: hiddenIndex
|
|
45872
|
-
})).y -
|
|
46051
|
+
})).y - HEADER_HEIGHT - this.props.offset + "px",
|
|
45873
46052
|
"margin-right": "1px"
|
|
45874
46053
|
});
|
|
45875
46054
|
}
|
|
@@ -45903,13 +46082,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45903
46082
|
col: hiddenIndex,
|
|
45904
46083
|
row: 0
|
|
45905
46084
|
}));
|
|
45906
|
-
return cssPropertiesToCss({ left: rect.x + rect.width -
|
|
46085
|
+
return cssPropertiesToCss({ left: rect.x + rect.width - HEADER_WIDTH - this.props.offset + "px" });
|
|
45907
46086
|
}
|
|
45908
46087
|
getUnhideNextButtonStyle(hiddenIndex) {
|
|
45909
46088
|
return cssPropertiesToCss({ left: this.env.model.getters.getRect(positionToZone({
|
|
45910
46089
|
col: hiddenIndex,
|
|
45911
46090
|
row: 0
|
|
45912
|
-
})).x -
|
|
46091
|
+
})).x - HEADER_WIDTH - this.props.offset + "px" });
|
|
45913
46092
|
}
|
|
45914
46093
|
unhide(hiddenElements) {
|
|
45915
46094
|
this.env.model.dispatch("UNHIDE_COLUMNS_ROWS", {
|
|
@@ -46133,7 +46312,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46133
46312
|
this.colResizerRef = (0, _odoo_owl.useRef)("colResizer");
|
|
46134
46313
|
this.PADDING = 15;
|
|
46135
46314
|
this.MAX_SIZE_MARGIN = 90;
|
|
46136
|
-
this.MIN_ELEMENT_SIZE =
|
|
46315
|
+
this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
|
|
46137
46316
|
}
|
|
46138
46317
|
get sheetId() {
|
|
46139
46318
|
return this.env.model.getters.getActiveSheetId();
|
|
@@ -46268,7 +46447,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46268
46447
|
this.rowResizerRef = (0, _odoo_owl.useRef)("rowResizer");
|
|
46269
46448
|
this.PADDING = 5;
|
|
46270
46449
|
this.MAX_SIZE_MARGIN = 60;
|
|
46271
|
-
this.MIN_ELEMENT_SIZE =
|
|
46450
|
+
this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
|
|
46272
46451
|
}
|
|
46273
46452
|
rowResizerRef;
|
|
46274
46453
|
get sheetId() {
|
|
@@ -46701,7 +46880,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46701
46880
|
x,
|
|
46702
46881
|
y
|
|
46703
46882
|
}, style.underline, style.strikethrough);
|
|
46704
|
-
y +=
|
|
46883
|
+
y += MIN_CELL_TEXT_MARGIN + box.content.fontSizePx;
|
|
46705
46884
|
}
|
|
46706
46885
|
if (style.rotation) ctx.restore();
|
|
46707
46886
|
if (box.clipRect) ctx.restore();
|
|
@@ -46748,7 +46927,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46748
46927
|
const numberOfRows = this.getters.getNumberRows(sheetId);
|
|
46749
46928
|
const activeCols = renderingContext.activeCols;
|
|
46750
46929
|
const activeRows = renderingContext.activeRows;
|
|
46751
|
-
ctx.font = `400 ${
|
|
46930
|
+
ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
46752
46931
|
ctx.textAlign = "center";
|
|
46753
46932
|
ctx.textBaseline = "middle";
|
|
46754
46933
|
ctx.lineWidth = thinLineWidth;
|
|
@@ -46766,7 +46945,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46766
46945
|
if (isColActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
46767
46946
|
else if (isColSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
46768
46947
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
46769
|
-
ctx.fillRect(x, 0, width,
|
|
46948
|
+
ctx.fillRect(x, 0, width, HEADER_HEIGHT);
|
|
46770
46949
|
}
|
|
46771
46950
|
for (const row of visibleRows) {
|
|
46772
46951
|
const rowZone = {
|
|
@@ -46781,13 +46960,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46781
46960
|
if (isRowActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
46782
46961
|
else if (isRowSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
46783
46962
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
46784
|
-
ctx.fillRect(0, y,
|
|
46963
|
+
ctx.fillRect(0, y, HEADER_WIDTH, height);
|
|
46785
46964
|
}
|
|
46786
46965
|
ctx.beginPath();
|
|
46787
|
-
ctx.moveTo(
|
|
46788
|
-
ctx.lineTo(
|
|
46789
|
-
ctx.moveTo(0,
|
|
46790
|
-
ctx.lineTo(width,
|
|
46966
|
+
ctx.moveTo(HEADER_WIDTH, 0);
|
|
46967
|
+
ctx.lineTo(HEADER_WIDTH, height);
|
|
46968
|
+
ctx.moveTo(0, HEADER_HEIGHT);
|
|
46969
|
+
ctx.lineTo(width, HEADER_HEIGHT);
|
|
46791
46970
|
ctx.strokeStyle = HEADER_BORDER_COLOR;
|
|
46792
46971
|
ctx.stroke();
|
|
46793
46972
|
for (const col of visibleCols) {
|
|
@@ -46803,13 +46982,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46803
46982
|
const { x, width } = viewports.getVisibleRect(sheetId, zone);
|
|
46804
46983
|
ctx.save();
|
|
46805
46984
|
ctx.beginPath();
|
|
46806
|
-
ctx.rect(x, 0, width,
|
|
46985
|
+
ctx.rect(x, 0, width, HEADER_HEIGHT);
|
|
46807
46986
|
ctx.clip();
|
|
46808
|
-
ctx.fillText(colName, colStart + colSize / 2,
|
|
46987
|
+
ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
|
|
46809
46988
|
ctx.restore();
|
|
46810
46989
|
ctx.beginPath();
|
|
46811
46990
|
ctx.moveTo(colStart + colSize, 0);
|
|
46812
|
-
ctx.lineTo(colStart + colSize,
|
|
46991
|
+
ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
|
|
46813
46992
|
ctx.stroke();
|
|
46814
46993
|
}
|
|
46815
46994
|
for (const row of visibleRows) {
|
|
@@ -46824,13 +47003,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46824
47003
|
const { y, height } = viewports.getVisibleRect(sheetId, zone);
|
|
46825
47004
|
ctx.save();
|
|
46826
47005
|
ctx.beginPath();
|
|
46827
|
-
ctx.rect(0, y,
|
|
47006
|
+
ctx.rect(0, y, HEADER_WIDTH, height);
|
|
46828
47007
|
ctx.clip();
|
|
46829
|
-
ctx.fillText(String(row + 1),
|
|
47008
|
+
ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
|
|
46830
47009
|
ctx.restore();
|
|
46831
47010
|
ctx.beginPath();
|
|
46832
47011
|
ctx.moveTo(0, rowStart + rowSize);
|
|
46833
|
-
ctx.lineTo(
|
|
47012
|
+
ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
|
|
46834
47013
|
ctx.stroke();
|
|
46835
47014
|
}
|
|
46836
47015
|
}
|
|
@@ -46972,7 +47151,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46972
47151
|
/** Content */
|
|
46973
47152
|
const wrapping = style.wrapping || "overflow";
|
|
46974
47153
|
const wrapText = wrapping === "wrap" && !showFormula;
|
|
46975
|
-
const availableWidth = width - 2 *
|
|
47154
|
+
const availableWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
|
|
46976
47155
|
const maxWidth = style.align ? 0 : availableWidth;
|
|
46977
47156
|
const wrapWidth = wrapText ? availableWidth : void 0;
|
|
46978
47157
|
const multiLineText = this.getters.getCellMultiLineText(position, {
|
|
@@ -46984,18 +47163,18 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
46984
47163
|
align: "left",
|
|
46985
47164
|
rotation: 0
|
|
46986
47165
|
};
|
|
46987
|
-
const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) +
|
|
47166
|
+
const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) + MIN_CELL_TEXT_MARGIN;
|
|
46988
47167
|
const contentSize = this.getters.getMultilineTextSize(multiLineText, style);
|
|
46989
|
-
const chipMargin = chipStyle ?
|
|
47168
|
+
const chipMargin = chipStyle ? DATA_VALIDATION_CHIP_MARGIN : 0;
|
|
46990
47169
|
const leftMargin = (box.icons.left ? box.icons.left.size + box.icons.left.margin : 0) + chipMargin;
|
|
46991
47170
|
const rightMargin = (box.icons.right ? box.icons.right.size + box.icons.right.margin : 0) + chipMargin;
|
|
46992
|
-
const contentWidth = leftMargin + contentSize.width + rightMargin +
|
|
47171
|
+
const contentWidth = leftMargin + contentSize.width + rightMargin + MIN_CELL_TEXT_MARGIN;
|
|
46993
47172
|
const align = this.computeCellAlignment(position, contentWidth > width);
|
|
46994
47173
|
const numberOfLines = multiLineText.length;
|
|
46995
47174
|
const contentY = Math.round(this.getters.computeTextYCoordinate(box, fontSizePX, style.verticalAlign, numberOfLines));
|
|
46996
47175
|
let contentX = box.x;
|
|
46997
|
-
if (align === "left") contentX +=
|
|
46998
|
-
else if (align === "right") contentX += box.width -
|
|
47176
|
+
if (align === "left") contentX += MIN_CELL_TEXT_MARGIN + leftMargin;
|
|
47177
|
+
else if (align === "right") contentX += box.width - MIN_CELL_TEXT_MARGIN - rightMargin;
|
|
46999
47178
|
else contentX += box.width / 2;
|
|
47000
47179
|
contentX = Math.round(contentX);
|
|
47001
47180
|
const textHeight = computeTextLinesHeight(fontSizePX, numberOfLines);
|
|
@@ -47011,7 +47190,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47011
47190
|
};
|
|
47012
47191
|
if (chipStyle?.fillColor) {
|
|
47013
47192
|
const chipMarginLeft = leftMargin;
|
|
47014
|
-
const chipMarginRight =
|
|
47193
|
+
const chipMarginRight = DATA_VALIDATION_CHIP_MARGIN;
|
|
47015
47194
|
box.chip = {
|
|
47016
47195
|
color: chipStyle.fillColor,
|
|
47017
47196
|
width: box.width - chipMarginLeft - chipMarginRight,
|
|
@@ -47174,7 +47353,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47174
47353
|
continue;
|
|
47175
47354
|
}
|
|
47176
47355
|
const elapsedTime = timeStamp - animation.startTime;
|
|
47177
|
-
const progress = Math.min(1, elapsedTime /
|
|
47356
|
+
const progress = Math.min(1, elapsedTime / CELL_ANIMATION_DURATION);
|
|
47178
47357
|
if (progress >= 1) this.animations.delete(boxId);
|
|
47179
47358
|
animation.progress = progress;
|
|
47180
47359
|
}
|
|
@@ -47297,7 +47476,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47297
47476
|
resetTimeout = setTimeout(() => {
|
|
47298
47477
|
velocityX = 0;
|
|
47299
47478
|
velocityY = 0;
|
|
47300
|
-
},
|
|
47479
|
+
}, resetTimeoutDuration);
|
|
47301
47480
|
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
47302
47481
|
}
|
|
47303
47482
|
function onTouchEnd(ev) {
|
|
@@ -47366,7 +47545,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47366
47545
|
//#region src/components/helpers/wheel_hook.ts
|
|
47367
47546
|
function useWheelHandler(handler) {
|
|
47368
47547
|
function normalize(val, deltaMode) {
|
|
47369
|
-
return val * (deltaMode === 0 ? 1 :
|
|
47548
|
+
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
47370
47549
|
}
|
|
47371
47550
|
const onMouseWheel = (ev) => {
|
|
47372
47551
|
handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
|
|
@@ -47462,14 +47641,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47462
47641
|
return cssPropertiesToCss(css);
|
|
47463
47642
|
}
|
|
47464
47643
|
getHandlerEdgeLength() {
|
|
47465
|
-
return this.env.isMobile() ? MOBILE_HANDLER_WIDTH :
|
|
47644
|
+
return this.env.isMobile() ? MOBILE_HANDLER_WIDTH : AUTOFILL_EDGE_LENGTH;
|
|
47466
47645
|
}
|
|
47467
47646
|
get buttonLook() {
|
|
47468
47647
|
const css = {
|
|
47469
47648
|
"background-color": this.props.color,
|
|
47470
47649
|
cursor: `${this.props.orientation}-resize`
|
|
47471
47650
|
};
|
|
47472
|
-
if (this.env.isMobile()) css["border-radius"] = `${
|
|
47651
|
+
if (this.env.isMobile()) css["border-radius"] = `${AUTOFILL_EDGE_LENGTH / 2}px`;
|
|
47473
47652
|
return cssPropertiesToCss(css);
|
|
47474
47653
|
}
|
|
47475
47654
|
onMouseDown(ev) {
|
|
@@ -47887,8 +48066,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47887
48066
|
TableResizer,
|
|
47888
48067
|
Selection
|
|
47889
48068
|
};
|
|
47890
|
-
HEADER_HEIGHT =
|
|
47891
|
-
HEADER_WIDTH =
|
|
48069
|
+
HEADER_HEIGHT = HEADER_HEIGHT;
|
|
48070
|
+
HEADER_WIDTH = HEADER_WIDTH;
|
|
47892
48071
|
menuState;
|
|
47893
48072
|
gridRef;
|
|
47894
48073
|
highlightStore;
|
|
@@ -47959,10 +48138,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47959
48138
|
get gridOverlayDimensions() {
|
|
47960
48139
|
const scrollbarWidth = this.env.model.getters.getScrollBarWidth();
|
|
47961
48140
|
return cssPropertiesToCss({
|
|
47962
|
-
top: `${
|
|
47963
|
-
left: `${
|
|
47964
|
-
height: `calc(100% - ${
|
|
47965
|
-
width: `calc(100% - ${
|
|
48141
|
+
top: `${HEADER_HEIGHT}px`,
|
|
48142
|
+
left: `${HEADER_WIDTH}px`,
|
|
48143
|
+
height: `calc(100% - ${HEADER_HEIGHT + scrollbarWidth}px)`,
|
|
48144
|
+
width: `calc(100% - ${HEADER_WIDTH + scrollbarWidth}px)`
|
|
47966
48145
|
});
|
|
47967
48146
|
}
|
|
47968
48147
|
onClosePopover() {
|
|
@@ -48176,8 +48355,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48176
48355
|
const zone = this.env.model.getters.getSelectedZone();
|
|
48177
48356
|
const rect = this.env.model.getters.getVisibleRect(zone);
|
|
48178
48357
|
return {
|
|
48179
|
-
x: rect.x + rect.width -
|
|
48180
|
-
y: rect.y + rect.height -
|
|
48358
|
+
x: rect.x + rect.width - AUTOFILL_EDGE_LENGTH / 2,
|
|
48359
|
+
y: rect.y + rect.height - AUTOFILL_EDGE_LENGTH / 2
|
|
48181
48360
|
};
|
|
48182
48361
|
}
|
|
48183
48362
|
get isAutofillVisible() {
|
|
@@ -48194,10 +48373,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48194
48373
|
onGridResized() {
|
|
48195
48374
|
const { height, width } = this.props.getGridSize();
|
|
48196
48375
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
48197
|
-
width: width -
|
|
48198
|
-
height: height -
|
|
48199
|
-
gridOffsetX:
|
|
48200
|
-
gridOffsetY:
|
|
48376
|
+
width: width - HEADER_WIDTH,
|
|
48377
|
+
height: height - HEADER_HEIGHT,
|
|
48378
|
+
gridOffsetX: HEADER_WIDTH,
|
|
48379
|
+
gridOffsetY: HEADER_HEIGHT
|
|
48201
48380
|
});
|
|
48202
48381
|
}
|
|
48203
48382
|
moveCanvas(deltaX, deltaY) {
|
|
@@ -48543,7 +48722,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48543
48722
|
return cssPropertiesToCss({
|
|
48544
48723
|
height: `${size}px`,
|
|
48545
48724
|
width: `${size}px`,
|
|
48546
|
-
color: cellStyle.textColor ||
|
|
48725
|
+
color: cellStyle.textColor || TEXT_BODY_MUTED,
|
|
48547
48726
|
"background-color": this.getBackgroundColor(cellStyle)
|
|
48548
48727
|
});
|
|
48549
48728
|
}
|
|
@@ -49436,8 +49615,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49436
49615
|
case "DUPLICATE_SHEET": {
|
|
49437
49616
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
49438
49617
|
for (const fig of sheetFiguresFrom) if (fig.tag === "carousel") {
|
|
49439
|
-
const figureIdBase = fig.id.split(
|
|
49440
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
49618
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
49619
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
49441
49620
|
const carousel = this.getCarousel(fig.id);
|
|
49442
49621
|
if (carousel) {
|
|
49443
49622
|
const size = {
|
|
@@ -49453,8 +49632,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49453
49632
|
size,
|
|
49454
49633
|
definition: { items: carousel.items.map((item) => {
|
|
49455
49634
|
if (item.type === "carouselDataView") return { ...item };
|
|
49456
|
-
const chartIdBase = item.chartId.split(
|
|
49457
|
-
const newChartId = `${cmd.sheetIdTo}${
|
|
49635
|
+
const chartIdBase = item.chartId.split(FIGURE_ID_SPLITTER).pop();
|
|
49636
|
+
const newChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
|
|
49458
49637
|
return {
|
|
49459
49638
|
...item,
|
|
49460
49639
|
chartId: newChartId
|
|
@@ -49528,12 +49707,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49528
49707
|
* with references (unless they contain a sheet name that contains the separator). */
|
|
49529
49708
|
buildResult(numbers, strings, references) {
|
|
49530
49709
|
const res = {};
|
|
49531
|
-
if (numbers.length) res.N = numbers.join(
|
|
49710
|
+
if (numbers.length) res.N = numbers.join(SEPARATOR);
|
|
49532
49711
|
if (strings.length) res.S = strings;
|
|
49533
49712
|
if (references.length) {
|
|
49534
49713
|
let referencePattern;
|
|
49535
|
-
if (references.some((x) => x.includes(
|
|
49536
|
-
else referencePattern = references.join(
|
|
49714
|
+
if (references.some((x) => x.includes(SEPARATOR))) referencePattern = references;
|
|
49715
|
+
else referencePattern = references.join(SEPARATOR);
|
|
49537
49716
|
res.R = referencePattern;
|
|
49538
49717
|
}
|
|
49539
49718
|
return res;
|
|
@@ -49666,7 +49845,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49666
49845
|
}
|
|
49667
49846
|
squishOneReference(reference, previousReferences, index, forSheetId) {
|
|
49668
49847
|
const previousReference = previousReferences[index];
|
|
49669
|
-
if (deepEquals(previousReference, reference)) return
|
|
49848
|
+
if (deepEquals(previousReference, reference)) return NO_CHANGE;
|
|
49670
49849
|
if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc || previousReference.parts.length !== reference.parts.length) {
|
|
49671
49850
|
previousReferences[index] = deepCopy(reference);
|
|
49672
49851
|
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
@@ -49700,7 +49879,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49700
49879
|
* - "=" meaning no change as string
|
|
49701
49880
|
* */
|
|
49702
49881
|
squishNumbers(numbers) {
|
|
49703
|
-
const result = numbers.map((x) =>
|
|
49882
|
+
const result = numbers.map((x) => NO_CHANGE);
|
|
49704
49883
|
for (let i = 0; i < numbers.length; i++) {
|
|
49705
49884
|
const previousValue = this.baseFormula.literalValues.numbers[i].value;
|
|
49706
49885
|
const currentValue = numbers[i].value;
|
|
@@ -49714,7 +49893,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49714
49893
|
return result;
|
|
49715
49894
|
}
|
|
49716
49895
|
squishStrings(strings) {
|
|
49717
|
-
const result = strings.map((x) =>
|
|
49896
|
+
const result = strings.map((x) => NO_CHANGE);
|
|
49718
49897
|
for (let i = 0; i < strings.length; i++) {
|
|
49719
49898
|
const str = strings[i].value;
|
|
49720
49899
|
if (str !== this.previousStrings[i]) {
|
|
@@ -49987,16 +50166,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49987
50166
|
strings: [],
|
|
49988
50167
|
dependencies: []
|
|
49989
50168
|
};
|
|
49990
|
-
if (squishedFormula.N !== void 0 && squishedFormula.N.length > 0) current.numbers = squishedFormula.N.split(
|
|
50169
|
+
if (squishedFormula.N !== void 0 && squishedFormula.N.length > 0) current.numbers = squishedFormula.N.split(SEPARATOR).map(this.adjustNumbers);
|
|
49991
50170
|
else current.numbers = this.previousFormula.literalValues.numbers;
|
|
49992
50171
|
if (squishedFormula.S !== void 0 && squishedFormula.S.length > 0) current.strings = squishedFormula.S.map(this.adjustStrings);
|
|
49993
50172
|
else current.strings = this.previousFormula.literalValues.strings;
|
|
49994
50173
|
if (squishedFormula.R !== void 0 && this.previousFormula) {
|
|
49995
50174
|
let references;
|
|
49996
50175
|
if (typeof squishedFormula.R !== "string") references = squishedFormula.R;
|
|
49997
|
-
else references = squishedFormula.R.split(
|
|
50176
|
+
else references = squishedFormula.R.split(SEPARATOR);
|
|
49998
50177
|
current.dependencies = references.map((refStr, index) => {
|
|
49999
|
-
if (refStr ===
|
|
50178
|
+
if (refStr === NO_CHANGE) return { ...this.alreadyAppliedReferenceOffset[index] };
|
|
50000
50179
|
else if (refStr.startsWith("+") || refStr.startsWith("-")) {
|
|
50001
50180
|
const offset = parseInt(refStr.slice(2), 10);
|
|
50002
50181
|
const sign = refStr[0] === "+" ? 1 : -1;
|
|
@@ -50032,14 +50211,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50032
50211
|
throw new Error("Invalid squished element or no previous cell to unsquish against");
|
|
50033
50212
|
}
|
|
50034
50213
|
adjustStrings = (str, index) => {
|
|
50035
|
-
if (str ===
|
|
50214
|
+
if (str === NO_CHANGE) return { value: this.previousString[index] };
|
|
50036
50215
|
else {
|
|
50037
50216
|
this.previousString[index] = str;
|
|
50038
50217
|
return { value: str };
|
|
50039
50218
|
}
|
|
50040
50219
|
};
|
|
50041
50220
|
adjustNumbers = (numStr, index) => {
|
|
50042
|
-
if (numStr ===
|
|
50221
|
+
if (numStr === NO_CHANGE) return { value: this.alreadyAppliedNumberOffset[index] };
|
|
50043
50222
|
else {
|
|
50044
50223
|
const currentOffset = parseFloat(numStr.slice(1));
|
|
50045
50224
|
const adjustedOffset = (this.alreadyAppliedNumberOffset[index] || 0) + currentOffset;
|
|
@@ -50519,10 +50698,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50519
50698
|
if (!chart || !figureId) continue;
|
|
50520
50699
|
const fig = this.getters.getFigure(cmd.sheetId, figureId);
|
|
50521
50700
|
if (!fig) continue;
|
|
50522
|
-
const figureIdBase = figureId.split(
|
|
50523
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
50524
|
-
const chartIdBase = chartId.split(
|
|
50525
|
-
const duplicatedChartId = `${cmd.sheetIdTo}${
|
|
50701
|
+
const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
|
|
50702
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
50703
|
+
const chartIdBase = chartId.split(FIGURE_ID_SPLITTER).pop();
|
|
50704
|
+
const duplicatedChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
|
|
50526
50705
|
const definition = chart.duplicateInDuplicatedSheet(cmd.sheetId, cmd.sheetIdTo);
|
|
50527
50706
|
this.dispatch("CREATE_CHART", {
|
|
50528
50707
|
figureId: duplicatedFigureId,
|
|
@@ -50631,8 +50810,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
50631
50810
|
* Add a figure with tag chart with the given id at the given position
|
|
50632
50811
|
*/
|
|
50633
50812
|
addFigure(figureId, sheetId, col, row, offset, size = {
|
|
50634
|
-
width:
|
|
50635
|
-
height:
|
|
50813
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
50814
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
50636
50815
|
}) {
|
|
50637
50816
|
this.dispatch("CREATE_FIGURE", {
|
|
50638
50817
|
sheetId,
|
|
@@ -51360,8 +51539,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51360
51539
|
const figureId = figure.id;
|
|
51361
51540
|
const fig = this.figures[cmd.sheetId]?.[figureId];
|
|
51362
51541
|
if (!fig) continue;
|
|
51363
|
-
const figureIdBase = figureId.split(
|
|
51364
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
51542
|
+
const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
|
|
51543
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
51365
51544
|
this.dispatch("CREATE_FIGURE", {
|
|
51366
51545
|
figureId: duplicatedFigureId,
|
|
51367
51546
|
...fig,
|
|
@@ -51399,11 +51578,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51399
51578
|
const numHeader = this.getters.getNumberRows(sheetId);
|
|
51400
51579
|
const remainingSize = new Array(numHeader + 1);
|
|
51401
51580
|
remainingSize[numHeader] = 0;
|
|
51402
|
-
for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ??
|
|
51581
|
+
for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ?? DEFAULT_CELL_HEIGHT);
|
|
51403
51582
|
for (const figure of this.getFigures(sheetId)) if (figure.offset.y + figure.height > remainingSize[figure.row]) {
|
|
51404
51583
|
let y = figure.offset.y;
|
|
51405
51584
|
let row = figure.row;
|
|
51406
|
-
for (let row_size = this.getters.getUserRowSize(sheetId, row) ??
|
|
51585
|
+
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) {
|
|
51407
51586
|
row += 1;
|
|
51408
51587
|
y -= row_size;
|
|
51409
51588
|
}
|
|
@@ -51428,7 +51607,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51428
51607
|
let rowNum, colNum;
|
|
51429
51608
|
let { col, row } = figure;
|
|
51430
51609
|
const offset = { ...figure.offset };
|
|
51431
|
-
for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ??
|
|
51610
|
+
for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ?? DEFAULT_CELL_HEIGHT;
|
|
51432
51611
|
if (row > rowNum) {
|
|
51433
51612
|
row = rowNum;
|
|
51434
51613
|
offset.y = Math.max(availableHeight - figure.height, 0);
|
|
@@ -51909,7 +52088,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51909
52088
|
}
|
|
51910
52089
|
}
|
|
51911
52090
|
getColSize(sheetId, index) {
|
|
51912
|
-
return Math.round(this.sizes[sheetId]?.["COL"][index] ||
|
|
52091
|
+
return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
|
|
51913
52092
|
}
|
|
51914
52093
|
getUserRowSize(sheetId, index) {
|
|
51915
52094
|
const rowSize = this.sizes[sheetId]?.["ROW"][index];
|
|
@@ -51942,7 +52121,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51942
52121
|
if (sheet.rows === void 0) sheet.rows = {};
|
|
51943
52122
|
for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
|
|
51944
52123
|
...sheet.rows[row],
|
|
51945
|
-
size: this.getUserRowSize(sheet.id, row) ??
|
|
52124
|
+
size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
|
|
51946
52125
|
};
|
|
51947
52126
|
if (sheet.cols === void 0) sheet.cols = {};
|
|
51948
52127
|
for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
|
|
@@ -52123,8 +52302,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52123
52302
|
case "DUPLICATE_SHEET": {
|
|
52124
52303
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
52125
52304
|
for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
|
|
52126
|
-
const figureIdBase = fig.id.split(
|
|
52127
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
52305
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
52306
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
52128
52307
|
const image = this.getImage(fig.id);
|
|
52129
52308
|
if (image) {
|
|
52130
52309
|
const size = {
|
|
@@ -55830,8 +56009,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55830
56009
|
hoverSvg: value ? CHECKBOX_CHECKED : CHECKBOX_UNCHECKED_HOVERED,
|
|
55831
56010
|
priority: 2,
|
|
55832
56011
|
horizontalAlign: "center",
|
|
55833
|
-
size:
|
|
55834
|
-
margin:
|
|
56012
|
+
size: GRID_ICON_EDGE_LENGTH,
|
|
56013
|
+
margin: GRID_ICON_MARGIN,
|
|
55835
56014
|
position,
|
|
55836
56015
|
type: "data_validation_checkbox",
|
|
55837
56016
|
onClick: (position, env) => {
|
|
@@ -55878,7 +56057,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55878
56057
|
priority: 1,
|
|
55879
56058
|
horizontalAlign: "left",
|
|
55880
56059
|
size: computeTextFontSizeInPixels(style),
|
|
55881
|
-
margin:
|
|
56060
|
+
margin: MIN_CF_ICON_MARGIN,
|
|
55882
56061
|
position
|
|
55883
56062
|
};
|
|
55884
56063
|
}
|
|
@@ -55893,13 +56072,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55893
56072
|
const fields = pivotCell.dimension === "COL" ? definition.columns : definition.rows;
|
|
55894
56073
|
const hasIcon = !isDashboard && !getters.shouldShowFormulas() && pivotCell.domain.length !== fields.length;
|
|
55895
56074
|
const isCollapsed = (definition.collapsedDomains?.[pivotCell.dimension] ?? []).some((domain) => deepEquals(domain, pivotCell.domain));
|
|
55896
|
-
const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) *
|
|
56075
|
+
const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * PIVOT_INDENT : 0;
|
|
55897
56076
|
return {
|
|
55898
56077
|
type: "pivot_collapse",
|
|
55899
56078
|
priority: 4,
|
|
55900
56079
|
horizontalAlign: "left",
|
|
55901
|
-
size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ?
|
|
55902
|
-
margin: hasIcon ?
|
|
56080
|
+
size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ? PIVOT_COLLAPSE_ICON_SIZE : 0,
|
|
56081
|
+
margin: hasIcon ? GRID_ICON_MARGIN * 2 + indent : indent,
|
|
55903
56082
|
svg: hasIcon ? getPivotIconSvg(isCollapsed, false) : void 0,
|
|
55904
56083
|
hoverSvg: hasIcon ? getPivotIconSvg(isCollapsed, true) : void 0,
|
|
55905
56084
|
position,
|
|
@@ -56553,7 +56732,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56553
56732
|
col,
|
|
56554
56733
|
row
|
|
56555
56734
|
});
|
|
56556
|
-
const background = style.fillColor ||
|
|
56735
|
+
const background = style.fillColor || BACKGROUND_CHART_COLOR;
|
|
56557
56736
|
return {
|
|
56558
56737
|
background,
|
|
56559
56738
|
fontColor: style.textColor || chartFontColor(background)
|
|
@@ -56873,7 +57052,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56873
57052
|
return this.getDataValidationStyle(position);
|
|
56874
57053
|
}
|
|
56875
57054
|
getDataValidationChipStyle(position) {
|
|
56876
|
-
if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor:
|
|
57055
|
+
if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor: GRAY_200 };
|
|
56877
57056
|
}
|
|
56878
57057
|
getInvalidDataValidationMessage(cellPosition) {
|
|
56879
57058
|
const validationResult = this.getValidationResultForCell(cellPosition);
|
|
@@ -57102,7 +57281,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57102
57281
|
}
|
|
57103
57282
|
}
|
|
57104
57283
|
getRowSize(sheetId, row) {
|
|
57105
|
-
return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ??
|
|
57284
|
+
return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? DEFAULT_CELL_HEIGHT);
|
|
57106
57285
|
}
|
|
57107
57286
|
getMaxAnchorOffset(sheetId, height, width) {
|
|
57108
57287
|
let { numberOfRows: row, numberOfCols: col } = this.getters.getSheetSize(sheetId);
|
|
@@ -57140,8 +57319,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57140
57319
|
col,
|
|
57141
57320
|
row
|
|
57142
57321
|
});
|
|
57143
|
-
if (updatedCellHeight <=
|
|
57144
|
-
if (!tallestCellInRow && updatedCellHeight >
|
|
57322
|
+
if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
|
|
57323
|
+
if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
|
|
57145
57324
|
const newTallestCell = {
|
|
57146
57325
|
cell: {
|
|
57147
57326
|
sheetId,
|
|
@@ -57166,7 +57345,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57166
57345
|
* merge, or the height of the cell computed based on its style/content.
|
|
57167
57346
|
*/
|
|
57168
57347
|
getCellHeight(position) {
|
|
57169
|
-
if (this.isInMultiRowMerge(position)) return
|
|
57348
|
+
if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
|
|
57170
57349
|
const cell = this.getters.getCell(position);
|
|
57171
57350
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
57172
57351
|
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
@@ -57188,7 +57367,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57188
57367
|
if (!cell) continue;
|
|
57189
57368
|
const position = this.getters.getCellPosition(cell.id);
|
|
57190
57369
|
const cellHeight = this.getCellHeight(position);
|
|
57191
|
-
if (cellHeight > maxHeight && cellHeight >
|
|
57370
|
+
if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
|
|
57192
57371
|
maxHeight = cellHeight;
|
|
57193
57372
|
tallestCell = {
|
|
57194
57373
|
cell: position,
|
|
@@ -57196,7 +57375,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57196
57375
|
};
|
|
57197
57376
|
}
|
|
57198
57377
|
}
|
|
57199
|
-
if (tallestCell && tallestCell.size >
|
|
57378
|
+
if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
|
|
57200
57379
|
}
|
|
57201
57380
|
};
|
|
57202
57381
|
|
|
@@ -57640,7 +57819,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57640
57819
|
* @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
|
|
57641
57820
|
*/
|
|
57642
57821
|
getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
|
|
57643
|
-
const comparedDomain = valueToCompare ===
|
|
57822
|
+
const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
|
|
57644
57823
|
if (deepEquals(comparedDomain, domain)) return "sameValue";
|
|
57645
57824
|
if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
|
|
57646
57825
|
const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
|
|
@@ -60537,7 +60716,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60537
60716
|
this.trigger("new-local-state-update", { id: revision.id });
|
|
60538
60717
|
this.sendUpdateMessage({
|
|
60539
60718
|
type: "REMOTE_REVISION",
|
|
60540
|
-
version:
|
|
60719
|
+
version: MESSAGE_VERSION,
|
|
60541
60720
|
serverRevisionId: this.serverRevisionId,
|
|
60542
60721
|
nextRevisionId: revision.id,
|
|
60543
60722
|
clientId: revision.clientId,
|
|
@@ -60548,7 +60727,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60548
60727
|
this.waitingUndoRedoAck = true;
|
|
60549
60728
|
this.sendUpdateMessage({
|
|
60550
60729
|
type: "REVISION_UNDONE",
|
|
60551
|
-
version:
|
|
60730
|
+
version: MESSAGE_VERSION,
|
|
60552
60731
|
serverRevisionId: this.serverRevisionId,
|
|
60553
60732
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
60554
60733
|
undoneRevisionId: revisionId
|
|
@@ -60558,7 +60737,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60558
60737
|
this.waitingUndoRedoAck = true;
|
|
60559
60738
|
this.sendUpdateMessage({
|
|
60560
60739
|
type: "REVISION_REDONE",
|
|
60561
|
-
version:
|
|
60740
|
+
version: MESSAGE_VERSION,
|
|
60562
60741
|
serverRevisionId: this.serverRevisionId,
|
|
60563
60742
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
60564
60743
|
redoneRevisionId: revisionId
|
|
@@ -60599,7 +60778,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60599
60778
|
await this.sendToTransport({
|
|
60600
60779
|
type: "CLIENT_LEFT",
|
|
60601
60780
|
clientId: this.clientId,
|
|
60602
|
-
version:
|
|
60781
|
+
version: MESSAGE_VERSION
|
|
60603
60782
|
});
|
|
60604
60783
|
}
|
|
60605
60784
|
/**
|
|
@@ -60616,7 +60795,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60616
60795
|
...data,
|
|
60617
60796
|
revisionId: snapshotId
|
|
60618
60797
|
},
|
|
60619
|
-
version:
|
|
60798
|
+
version: MESSAGE_VERSION
|
|
60620
60799
|
});
|
|
60621
60800
|
}
|
|
60622
60801
|
getCurrentClient() {
|
|
@@ -60660,7 +60839,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60660
60839
|
};
|
|
60661
60840
|
this.sendToTransport({
|
|
60662
60841
|
type,
|
|
60663
|
-
version:
|
|
60842
|
+
version: MESSAGE_VERSION,
|
|
60664
60843
|
client: {
|
|
60665
60844
|
...client,
|
|
60666
60845
|
position
|
|
@@ -60740,7 +60919,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60740
60919
|
const { position } = client;
|
|
60741
60920
|
if (position) this.sendToTransport({
|
|
60742
60921
|
type: "CLIENT_MOVED",
|
|
60743
|
-
version:
|
|
60922
|
+
version: MESSAGE_VERSION,
|
|
60744
60923
|
client: {
|
|
60745
60924
|
...client,
|
|
60746
60925
|
position
|
|
@@ -61592,7 +61771,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61592
61771
|
onNewLocalStateUpdate({ id }) {
|
|
61593
61772
|
this.undoStack.push(id);
|
|
61594
61773
|
this.redoStack = [];
|
|
61595
|
-
if (this.undoStack.length >
|
|
61774
|
+
if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
|
|
61596
61775
|
}
|
|
61597
61776
|
/**
|
|
61598
61777
|
* Fetch the last revision which is not empty and not a repeated command
|
|
@@ -61889,7 +62068,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61889
62068
|
}
|
|
61890
62069
|
getAutoSeparatorForString(str) {
|
|
61891
62070
|
const separators = [
|
|
61892
|
-
|
|
62071
|
+
NEWLINE,
|
|
61893
62072
|
";",
|
|
61894
62073
|
",",
|
|
61895
62074
|
" ",
|
|
@@ -62223,9 +62402,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62223
62402
|
contentWidth += computeMultilineTextSize(this.ctx, multiLineText, style).width;
|
|
62224
62403
|
}
|
|
62225
62404
|
for (const icon of this.getters.getCellIcons(position)) contentWidth += icon.margin + icon.size;
|
|
62226
|
-
if (this.getters.getDataValidationChipStyle(position)) contentWidth +=
|
|
62405
|
+
if (this.getters.getDataValidationChipStyle(position)) contentWidth += DATA_VALIDATION_CHIP_MARGIN * 2;
|
|
62227
62406
|
if (contentWidth === 0) return 0;
|
|
62228
|
-
contentWidth += 2 *
|
|
62407
|
+
contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
|
|
62229
62408
|
if (style.wrapping === "wrap") {
|
|
62230
62409
|
const colWidth = this.getters.getColSize(position.sheetId, position.col);
|
|
62231
62410
|
return Math.min(colWidth, contentWidth);
|
|
@@ -62276,11 +62455,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62276
62455
|
computeTextYCoordinate(cellRect, textLineHeight, verticalAlign = DEFAULT_VERTICAL_ALIGN, numberOfLines = 1) {
|
|
62277
62456
|
const y = cellRect.y + 1;
|
|
62278
62457
|
const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
|
|
62279
|
-
if (cellRect.height > textHeight +
|
|
62458
|
+
if (cellRect.height > textHeight + MIN_CELL_TEXT_MARGIN * 2) {
|
|
62280
62459
|
if (verticalAlign === "middle") return Math.ceil(y + (cellRect.height - textHeight) / 2);
|
|
62281
|
-
if (verticalAlign === "bottom") return y + cellRect.height - textHeight -
|
|
62460
|
+
if (verticalAlign === "bottom") return y + cellRect.height - textHeight - MIN_CELL_TEXT_MARGIN;
|
|
62282
62461
|
}
|
|
62283
|
-
return y +
|
|
62462
|
+
return y + MIN_CELL_TEXT_MARGIN;
|
|
62284
62463
|
}
|
|
62285
62464
|
/**
|
|
62286
62465
|
* Expands the given zone until bordered by empty cells or reached the sheet boundaries.
|
|
@@ -62385,11 +62564,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62385
62564
|
if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
|
|
62386
62565
|
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
62387
62566
|
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
62388
|
-
if (evaluatedSize > evaluatedRowSize && evaluatedSize >
|
|
62567
|
+
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = evaluatedSize;
|
|
62389
62568
|
} else {
|
|
62390
62569
|
const content = cell.content;
|
|
62391
62570
|
const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
62392
|
-
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize >
|
|
62571
|
+
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = 0;
|
|
62393
62572
|
}
|
|
62394
62573
|
}
|
|
62395
62574
|
rowSizes.push(evaluatedRowSize || null);
|
|
@@ -63084,7 +63263,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63084
63263
|
const imageUrl = this.getters.getImage(figureId).path;
|
|
63085
63264
|
file = await this.fileStore?.getFile(imageUrl);
|
|
63086
63265
|
if (file.type !== "image/png") {
|
|
63087
|
-
if (file.size >
|
|
63266
|
+
if (file.size > MAX_FILE_SIZE) {
|
|
63088
63267
|
this.ui.notifyUI({
|
|
63089
63268
|
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))),
|
|
63090
63269
|
sticky: false,
|
|
@@ -64266,7 +64445,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
64266
64445
|
let height = lastRowEnd - this.offsetCorrectionY;
|
|
64267
64446
|
if (this.canScrollVertically) {
|
|
64268
64447
|
height = Math.max(height, this.viewportHeight);
|
|
64269
|
-
if (lastRowEnd +
|
|
64448
|
+
if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly() && this.viewportHeight > FOOTER_HEIGHT) height += FOOTER_HEIGHT;
|
|
64270
64449
|
}
|
|
64271
64450
|
return {
|
|
64272
64451
|
width,
|
|
@@ -64618,7 +64797,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
64618
64797
|
return this.getSubViewports(sheetId).some((pane) => pane.isZoneVisible(zone));
|
|
64619
64798
|
}
|
|
64620
64799
|
getScrollBarWidth() {
|
|
64621
|
-
return
|
|
64800
|
+
return SCROLLBAR_WIDTH / this.zoomLevel;
|
|
64622
64801
|
}
|
|
64623
64802
|
getEdgeScrollCol(sheetId, x, previousX, startingX) {
|
|
64624
64803
|
let canEdgeScroll = false;
|
|
@@ -65143,7 +65322,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65143
65322
|
return this.chainValidations(() => this.viewports.checkScrollingDirection(sheetId, cmd), () => this.viewports.checkIfViewportsWillChange(sheetId, cmd))(cmd);
|
|
65144
65323
|
}
|
|
65145
65324
|
case "RESIZE_SHEETVIEW": return this.chainValidations(() => this.viewports.checkValuesAreDifferent(cmd), () => this.viewports.checkPositiveDimension(cmd))(cmd);
|
|
65146
|
-
case "SET_ZOOM": if (cmd.zoom >
|
|
65325
|
+
case "SET_ZOOM": if (isNaN(cmd.zoom) || cmd.zoom > MAX_ZOOM_LEVEL || cmd.zoom < MIN_ZOOM_LEVEL) return "InvalidZoomLevel";
|
|
65147
65326
|
else return "Success";
|
|
65148
65327
|
default: return "Success";
|
|
65149
65328
|
}
|
|
@@ -65347,7 +65526,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65347
65526
|
return this.viewports.isVisibleInViewport(cellPosition);
|
|
65348
65527
|
}
|
|
65349
65528
|
getScrollBarWidth() {
|
|
65350
|
-
return
|
|
65529
|
+
return SCROLLBAR_WIDTH / this.viewports.getZoomLevel();
|
|
65351
65530
|
}
|
|
65352
65531
|
getEdgeScrollCol(x, previousX, startingX) {
|
|
65353
65532
|
const sheetId = this.getters.getActiveSheetId();
|
|
@@ -65490,8 +65669,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65490
65669
|
text: value.value,
|
|
65491
65670
|
htmlContent: [{
|
|
65492
65671
|
value: value.label,
|
|
65493
|
-
color: chipTextColor(color ||
|
|
65494
|
-
backgroundColor: color ||
|
|
65672
|
+
color: chipTextColor(color || GRAY_200),
|
|
65673
|
+
backgroundColor: color || GRAY_200,
|
|
65495
65674
|
classes: ["badge rounded-pill fs-6 fw-normal w-100 mt-1 text-start"]
|
|
65496
65675
|
}],
|
|
65497
65676
|
fuzzySearchKey: value.label
|
|
@@ -65945,8 +66124,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65945
66124
|
hoverSvg: getDataFilterIcon(isFilterActive, isHighContrast, true),
|
|
65946
66125
|
priority: 3,
|
|
65947
66126
|
horizontalAlign: "right",
|
|
65948
|
-
size:
|
|
65949
|
-
margin:
|
|
66127
|
+
size: GRID_ICON_EDGE_LENGTH,
|
|
66128
|
+
margin: GRID_ICON_MARGIN,
|
|
65950
66129
|
position,
|
|
65951
66130
|
onClick: (position, env) => {
|
|
65952
66131
|
const cellPopovers = env.getStore(CellPopoverStore);
|
|
@@ -68032,16 +68211,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68032
68211
|
const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
|
|
68033
68212
|
const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
|
|
68034
68213
|
let groupHeaderY = 0;
|
|
68035
|
-
let groupHeaderHeight =
|
|
68214
|
+
let groupHeaderHeight = HEADER_HEIGHT;
|
|
68036
68215
|
if (startRow !== 0) {
|
|
68037
68216
|
const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
|
|
68038
|
-
groupHeaderY =
|
|
68217
|
+
groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
|
|
68039
68218
|
groupHeaderHeight = headerRowDims.end - headerRowDims.start;
|
|
68040
68219
|
}
|
|
68041
68220
|
const headerRect = {
|
|
68042
68221
|
x: this.props.layerOffset,
|
|
68043
68222
|
y: groupHeaderY,
|
|
68044
|
-
width:
|
|
68223
|
+
width: GROUP_LAYER_WIDTH,
|
|
68045
68224
|
height: groupHeaderHeight
|
|
68046
68225
|
};
|
|
68047
68226
|
return {
|
|
@@ -68049,7 +68228,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68049
68228
|
groupRect: {
|
|
68050
68229
|
x: this.props.layerOffset,
|
|
68051
68230
|
y: headerRect.y,
|
|
68052
|
-
width:
|
|
68231
|
+
width: GROUP_LAYER_WIDTH,
|
|
68053
68232
|
height: headerRect.height + (endCoordinates - startCoordinates)
|
|
68054
68233
|
},
|
|
68055
68234
|
isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
|
|
@@ -68082,17 +68261,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68082
68261
|
const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
|
|
68083
68262
|
const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
|
|
68084
68263
|
let groupHeaderX = 0;
|
|
68085
|
-
let groupHeaderWidth =
|
|
68264
|
+
let groupHeaderWidth = HEADER_WIDTH;
|
|
68086
68265
|
if (startCol !== 0) {
|
|
68087
68266
|
const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
|
|
68088
|
-
groupHeaderX =
|
|
68267
|
+
groupHeaderX = HEADER_WIDTH + headerRowDims.start;
|
|
68089
68268
|
groupHeaderWidth = headerRowDims.end - headerRowDims.start;
|
|
68090
68269
|
}
|
|
68091
68270
|
const headerRect = {
|
|
68092
68271
|
x: groupHeaderX,
|
|
68093
68272
|
y: this.props.layerOffset,
|
|
68094
68273
|
width: groupHeaderWidth,
|
|
68095
|
-
height:
|
|
68274
|
+
height: GROUP_LAYER_WIDTH
|
|
68096
68275
|
};
|
|
68097
68276
|
return {
|
|
68098
68277
|
headerRect,
|
|
@@ -68100,7 +68279,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68100
68279
|
x: headerRect.x,
|
|
68101
68280
|
y: this.props.layerOffset,
|
|
68102
68281
|
width: headerRect.width + (endCoordinates - startCoordinates),
|
|
68103
|
-
height:
|
|
68282
|
+
height: GROUP_LAYER_WIDTH
|
|
68104
68283
|
},
|
|
68105
68284
|
isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
|
|
68106
68285
|
};
|
|
@@ -68126,7 +68305,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68126
68305
|
menuItems: []
|
|
68127
68306
|
});
|
|
68128
68307
|
getLayerOffset(layerIndex) {
|
|
68129
|
-
return layerIndex *
|
|
68308
|
+
return layerIndex * GROUP_LAYER_WIDTH;
|
|
68130
68309
|
}
|
|
68131
68310
|
onContextMenu(event) {
|
|
68132
68311
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -68174,8 +68353,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68174
68353
|
get frozenPaneContainerSize() {
|
|
68175
68354
|
if (!this.hasFrozenPane) return 0;
|
|
68176
68355
|
const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
|
|
68177
|
-
if (this.props.dimension === "COL") return
|
|
68178
|
-
else return
|
|
68356
|
+
if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
|
|
68357
|
+
else return HEADER_HEIGHT + viewportCoordinates.y;
|
|
68179
68358
|
}
|
|
68180
68359
|
};
|
|
68181
68360
|
|
|
@@ -68184,7 +68363,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68184
68363
|
function useScreenWidth() {
|
|
68185
68364
|
const spreadsheetRect = useSpreadsheetRect();
|
|
68186
68365
|
return { get isSmall() {
|
|
68187
|
-
return spreadsheetRect.width <
|
|
68366
|
+
return spreadsheetRect.width < MOBILE_WIDTH_BREAKPOINT;
|
|
68188
68367
|
} };
|
|
68189
68368
|
}
|
|
68190
68369
|
|
|
@@ -68547,7 +68726,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68547
68726
|
this.drawChart(renderingCtx, chartId, chartRect);
|
|
68548
68727
|
} else if (title.text) {
|
|
68549
68728
|
ctx.save();
|
|
68550
|
-
ctx.fillStyle = chartDefinition?.background ||
|
|
68729
|
+
ctx.fillStyle = chartDefinition?.background || BACKGROUND_CHART_COLOR;
|
|
68551
68730
|
ctx.fillRect(x, y, figure.width, headerSize);
|
|
68552
68731
|
ctx.font = computeTextFont(chartStyleToCellStyle(title));
|
|
68553
68732
|
ctx.fillStyle = title.color;
|
|
@@ -68994,7 +69173,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68994
69173
|
"line-height": "24px"
|
|
68995
69174
|
};
|
|
68996
69175
|
if (this.env.model.getters.isCurrentSheetLocked()) style["pointer-events"] = "none";
|
|
68997
|
-
style.height = this.focus === "inactive" ? `${
|
|
69176
|
+
style.height = this.focus === "inactive" ? `${DESKTOP_TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
|
|
68998
69177
|
return cssPropertiesToCss(style);
|
|
68999
69178
|
}
|
|
69000
69179
|
onFocus(selection) {
|
|
@@ -69667,14 +69846,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
69667
69846
|
static props = { class: String };
|
|
69668
69847
|
topBarToolStore;
|
|
69669
69848
|
valueList = ZOOM_VALUES;
|
|
69849
|
+
minZoom = MIN_ZOOM_LEVEL * 100;
|
|
69850
|
+
maxZoom = MAX_ZOOM_LEVEL * 100;
|
|
69670
69851
|
setup() {
|
|
69671
69852
|
this.topBarToolStore = useToolBarDropdownStore();
|
|
69672
69853
|
}
|
|
69673
|
-
|
|
69674
|
-
|
|
69854
|
+
getZoomLevel() {
|
|
69855
|
+
const zoom = this.env.model.getters.getViewportZoomLevel() || 1;
|
|
69856
|
+
return Math.round(zoom * 100);
|
|
69675
69857
|
}
|
|
69676
|
-
setZoom(
|
|
69677
|
-
this.env.model.dispatch("SET_ZOOM", { zoom:
|
|
69858
|
+
setZoom(zoomPercentage) {
|
|
69859
|
+
this.env.model.dispatch("SET_ZOOM", { zoom: zoomPercentage / 100 });
|
|
69678
69860
|
}
|
|
69679
69861
|
toggle() {
|
|
69680
69862
|
if (this.topBarToolStore.isActive) this.topBarToolStore.closeDropdowns();
|
|
@@ -70164,7 +70346,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
70164
70346
|
else {
|
|
70165
70347
|
if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
|
|
70166
70348
|
else properties["grid-template-rows"] = `min-content auto min-content`;
|
|
70167
|
-
properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize ||
|
|
70349
|
+
properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize || DEFAULT_SIDE_PANEL_SIZE}px` : "auto"}`;
|
|
70168
70350
|
}
|
|
70169
70351
|
return cssPropertiesToCss(properties);
|
|
70170
70352
|
}
|
|
@@ -70266,7 +70448,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
70266
70448
|
checkViewportSize() {
|
|
70267
70449
|
const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
|
|
70268
70450
|
if (!isFinite(xRatio) || !isFinite(yRatio)) return;
|
|
70269
|
-
if (yRatio >
|
|
70451
|
+
if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
|
|
70270
70452
|
if (this.isViewportTooSmall) return;
|
|
70271
70453
|
this.notificationStore.notifyUser({
|
|
70272
70454
|
text: _t("The current window is too small to display this sheet properly. Consider resizing your browser window or adjusting frozen rows and columns."),
|
|
@@ -70284,8 +70466,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
70284
70466
|
return this.env.model.getters.getSheetViewDimension().height;
|
|
70285
70467
|
}
|
|
70286
70468
|
get gridContainerStyle() {
|
|
70287
|
-
const gridColSize =
|
|
70288
|
-
const gridRowSize =
|
|
70469
|
+
const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
|
|
70470
|
+
const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
|
|
70289
70471
|
const zoom = this.env.model.getters.getViewportZoomLevel();
|
|
70290
70472
|
return cssPropertiesToCss({
|
|
70291
70473
|
"grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
|
|
@@ -72216,7 +72398,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
72216
72398
|
let title = escapeXml``;
|
|
72217
72399
|
if (chart.data.title?.text) {
|
|
72218
72400
|
const titleColor = toXlsxHexColor(chartMutedFontColor(chart.data.backgroundColor));
|
|
72219
|
-
const fontSize = chart.data.title.fontSize ??
|
|
72401
|
+
const fontSize = chart.data.title.fontSize ?? CHART_TITLE_FONT_SIZE;
|
|
72220
72402
|
title = escapeXml`
|
|
72221
72403
|
<c:title>
|
|
72222
72404
|
${insertText(chart.data.title.text, titleColor, fontSize, chart.data.title)}
|
|
@@ -72307,7 +72489,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
72307
72489
|
</a:ln>
|
|
72308
72490
|
`;
|
|
72309
72491
|
}
|
|
72310
|
-
function insertText(text, fontColor = "000000", fontsize =
|
|
72492
|
+
function insertText(text, fontColor = "000000", fontsize = CHART_TITLE_FONT_SIZE, style = {}) {
|
|
72311
72493
|
const textProperties = [
|
|
72312
72494
|
["b", style.bold ? "1" : "0"],
|
|
72313
72495
|
["i", style.italic ? "1" : "0"],
|
|
@@ -72894,7 +73076,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
72894
73076
|
return escapeXml`
|
|
72895
73077
|
<c:doughnutChart>
|
|
72896
73078
|
<c:varyColors val="1" />
|
|
72897
|
-
<c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ?
|
|
73079
|
+
<c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ? DEFAULT_DOUGHNUT_CHART_HOLE_SIZE : 0)}" />
|
|
72898
73080
|
${joinXmlNodes(dataSetsNodes)}
|
|
72899
73081
|
${insertDataLabels({ showValues: chart.showValues })}
|
|
72900
73082
|
</c:doughnutChart>
|
|
@@ -72918,7 +73100,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
72918
73100
|
}
|
|
72919
73101
|
function addAx(position, axisName, axId, crossAxId, title, defaultFontColor, deleteAxis = 0, orientation = "minMax", crossPosition, tickLabelPosition = "nextTo", maxValue, majorUnit, format = "General") {
|
|
72920
73102
|
const color = title?.color ? toXlsxHexColor(title.color) : defaultFontColor;
|
|
72921
|
-
const fontSize = title?.fontSize ??
|
|
73103
|
+
const fontSize = title?.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE;
|
|
72922
73104
|
const crossBetweenEl = axisName === "c:valAx" ? escapeXml`<c:crossBetween val="between" />` : "";
|
|
72923
73105
|
const maxValueEl = maxValue ? escapeXml`<c:max val="${maxValue}" />` : "";
|
|
72924
73106
|
const minValueEl = maxValue ? escapeXml`<c:min val="${-maxValue}" />` : "";
|
|
@@ -73546,12 +73728,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73546
73728
|
let currentPosition = 0;
|
|
73547
73729
|
for (const [headerIndex, header] of headers.slice(anchor).entries()) if (currentPosition <= offset && offset < currentPosition + header.size) return {
|
|
73548
73730
|
index: anchor + headerIndex,
|
|
73549
|
-
offset: convertDotValueToEMU(offset - currentPosition +
|
|
73731
|
+
offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
|
|
73550
73732
|
};
|
|
73551
73733
|
else if (headerIndex < headers.length - 1) currentPosition += header.size;
|
|
73552
73734
|
return {
|
|
73553
73735
|
index: headers.length - 1,
|
|
73554
|
-
offset: convertDotValueToEMU(offset - currentPosition +
|
|
73736
|
+
offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
|
|
73555
73737
|
};
|
|
73556
73738
|
}
|
|
73557
73739
|
function createChartDrawing(figure, sheet, chartRelId, construct) {
|
|
@@ -73657,7 +73839,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73657
73839
|
function addNumberFormats(numFmts) {
|
|
73658
73840
|
const numFmtNodes = [];
|
|
73659
73841
|
for (const [index, numFmt] of Object.entries(numFmts)) {
|
|
73660
|
-
const numFmtAttrs = [["numFmtId", parseInt(index) +
|
|
73842
|
+
const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
|
|
73661
73843
|
numFmtNodes.push(escapeXml`
|
|
73662
73844
|
<numFmt ${formatAttributes(numFmtAttrs)}/>
|
|
73663
73845
|
`);
|
|
@@ -73890,7 +74072,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73890
74072
|
const attributes = [
|
|
73891
74073
|
["min", parseInt(id) + 1],
|
|
73892
74074
|
["max", parseInt(id) + 1],
|
|
73893
|
-
["width", convertWidthToExcel(col.size ||
|
|
74075
|
+
["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
|
|
73894
74076
|
["customWidth", 1],
|
|
73895
74077
|
["hidden", col.isHidden ? 1 : 0]
|
|
73896
74078
|
];
|
|
@@ -73914,7 +74096,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73914
74096
|
for (let r = 0; r < sheet.rowNumber; r++) {
|
|
73915
74097
|
const rowAttrs = [["r", r + 1]];
|
|
73916
74098
|
const row = sheet.rows[r] || {};
|
|
73917
|
-
if (row.size && row.size !==
|
|
74099
|
+
if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
|
|
73918
74100
|
if (row.isHidden) rowAttrs.push(["hidden", 1]);
|
|
73919
74101
|
if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
|
|
73920
74102
|
if (row.collapsed) rowAttrs.push(["collapsed", 1]);
|
|
@@ -73956,7 +74138,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
73956
74138
|
</c>`);
|
|
73957
74139
|
}
|
|
73958
74140
|
}
|
|
73959
|
-
if (cellNodes.length || row.size !==
|
|
74141
|
+
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
|
|
73960
74142
|
<row ${formatAttributes(rowAttrs)}>
|
|
73961
74143
|
${joinXmlNodes(cellNodes)}
|
|
73962
74144
|
</row>
|
|
@@ -74129,7 +74311,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
74129
74311
|
let currentTableIndex = 1;
|
|
74130
74312
|
for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
|
|
74131
74313
|
const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
|
|
74132
|
-
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(
|
|
74314
|
+
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
|
|
74133
74315
|
const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
|
|
74134
74316
|
currentTableIndex += sheet.tables.length;
|
|
74135
74317
|
let drawingNode = escapeXml``;
|
|
@@ -74832,7 +75014,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
74832
75014
|
_exportData(shouldSquish) {
|
|
74833
75015
|
let data = createEmptyWorkbookData();
|
|
74834
75016
|
for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data, shouldSquish);
|
|
74835
|
-
data.revisionId = this.session.getRevisionId() ||
|
|
75017
|
+
data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
|
|
74836
75018
|
data = deepCopy(data);
|
|
74837
75019
|
return data;
|
|
74838
75020
|
}
|
|
@@ -75265,7 +75447,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
75265
75447
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
75266
75448
|
return {
|
|
75267
75449
|
...definition,
|
|
75268
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
75450
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
75269
75451
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
75270
75452
|
dataSets,
|
|
75271
75453
|
labelRange,
|
|
@@ -75502,7 +75684,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
75502
75684
|
return {
|
|
75503
75685
|
...definition,
|
|
75504
75686
|
horizontal: true,
|
|
75505
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
75687
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
75506
75688
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
75507
75689
|
dataSets,
|
|
75508
75690
|
labelRange,
|
|
@@ -75584,7 +75766,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
75584
75766
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
75585
75767
|
return {
|
|
75586
75768
|
...definition,
|
|
75587
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
75769
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
75588
75770
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
75589
75771
|
dataSets,
|
|
75590
75772
|
labelRange
|
|
@@ -75661,7 +75843,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
75661
75843
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
75662
75844
|
return {
|
|
75663
75845
|
...definition,
|
|
75664
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
75846
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
75665
75847
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
75666
75848
|
dataSets,
|
|
75667
75849
|
labelRange,
|
|
@@ -82856,7 +83038,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
82856
83038
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
82857
83039
|
if (error) return error;
|
|
82858
83040
|
const table = pivot.getCollapsedTableStructure();
|
|
82859
|
-
if (table.numberOfCells >
|
|
83041
|
+
if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) return new EvaluationError(getPivotTooBigErrorMessage(table.numberOfCells, this.locale));
|
|
82860
83042
|
const cells = table.getPivotCells(pivotStyle);
|
|
82861
83043
|
const pivotTitle = this.getters.getPivotName(pivotId);
|
|
82862
83044
|
const { numberOfCols, numberOfRows } = table.getPivotTableDimensions(pivotStyle);
|
|
@@ -84535,14 +84717,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
84535
84717
|
*/
|
|
84536
84718
|
const __info__ = {};
|
|
84537
84719
|
const SPREADSHEET_DIMENSIONS = {
|
|
84538
|
-
MIN_ROW_HEIGHT
|
|
84539
|
-
MIN_COL_WIDTH
|
|
84540
|
-
HEADER_HEIGHT
|
|
84541
|
-
HEADER_WIDTH
|
|
84542
|
-
DESKTOP_BOTTOMBAR_HEIGHT
|
|
84543
|
-
DEFAULT_CELL_WIDTH
|
|
84544
|
-
DEFAULT_CELL_HEIGHT
|
|
84545
|
-
SCROLLBAR_WIDTH
|
|
84720
|
+
MIN_ROW_HEIGHT,
|
|
84721
|
+
MIN_COL_WIDTH,
|
|
84722
|
+
HEADER_HEIGHT,
|
|
84723
|
+
HEADER_WIDTH,
|
|
84724
|
+
DESKTOP_BOTTOMBAR_HEIGHT,
|
|
84725
|
+
DEFAULT_CELL_WIDTH,
|
|
84726
|
+
DEFAULT_CELL_HEIGHT,
|
|
84727
|
+
SCROLLBAR_WIDTH
|
|
84546
84728
|
};
|
|
84547
84729
|
const registries = {
|
|
84548
84730
|
autoCompleteProviders,
|
|
@@ -84767,9 +84949,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
84767
84949
|
PIVOT_STATIC_TABLE_CONFIG,
|
|
84768
84950
|
PIVOT_INSERT_TABLE_STYLE_ID,
|
|
84769
84951
|
ChartTerms,
|
|
84770
|
-
FIGURE_ID_SPLITTER
|
|
84771
|
-
GRID_ICON_EDGE_LENGTH
|
|
84772
|
-
GRID_ICON_MARGIN
|
|
84952
|
+
FIGURE_ID_SPLITTER,
|
|
84953
|
+
GRID_ICON_EDGE_LENGTH,
|
|
84954
|
+
GRID_ICON_MARGIN,
|
|
84773
84955
|
CHART_TYPES
|
|
84774
84956
|
};
|
|
84775
84957
|
const chartHelpers = {
|
|
@@ -84838,8 +85020,8 @@ exports.stores = stores;
|
|
|
84838
85020
|
exports.tokenColors = tokenColors;
|
|
84839
85021
|
exports.tokenize = tokenize;
|
|
84840
85022
|
|
|
84841
|
-
__info__.version = "19.3.
|
|
84842
|
-
__info__.date = "2026-
|
|
84843
|
-
__info__.hash = "
|
|
85023
|
+
__info__.version = "19.3.22";
|
|
85024
|
+
__info__.date = "2026-10-01T07:46:51.994Z";
|
|
85025
|
+
__info__.hash = "0dd651f";
|
|
84844
85026
|
|
|
84845
85027
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|