@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
|
import { App, Component, blockDom, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, whenReady, xml } from "@odoo/owl";
|
|
@@ -236,12 +236,19 @@ const GRAY_200 = "#E7E9ED";
|
|
|
236
236
|
const TEXT_BODY = "#374151";
|
|
237
237
|
const TEXT_BODY_MUTED = "#374151C2";
|
|
238
238
|
const ACTION_COLOR = HIGHLIGHT_COLOR;
|
|
239
|
+
const CHART_PADDING = 20;
|
|
240
|
+
const CHART_PADDING_BOTTOM = 10;
|
|
241
|
+
const CHART_PADDING_TOP = 15;
|
|
239
242
|
const CHART_TITLE_FONT_SIZE = 16;
|
|
243
|
+
const CHART_AXIS_TITLE_FONT_SIZE = 12;
|
|
244
|
+
const MASTER_CHART_HEIGHT = 60;
|
|
245
|
+
const CHART_COLORSCALE_WIDTH = 70;
|
|
240
246
|
const DEFAULT_CHART_COLOR_SCALE = {
|
|
241
247
|
minColor: "#FFF5EB",
|
|
242
248
|
midColor: "#FD8D3C",
|
|
243
249
|
maxColor: "#7F2704"
|
|
244
250
|
};
|
|
251
|
+
const SCORECARD_CHART_TITLE_FONT_SIZE = 14;
|
|
245
252
|
const PIVOT_TOKEN_COLOR = "#F28C28";
|
|
246
253
|
const COLOR_PICKER_DEFAULTS = [
|
|
247
254
|
"#000000",
|
|
@@ -325,8 +332,32 @@ const COLOR_PICKER_DEFAULTS = [
|
|
|
325
332
|
"#20124D",
|
|
326
333
|
"#4C1130"
|
|
327
334
|
];
|
|
335
|
+
const MIN_ROW_HEIGHT = 10;
|
|
336
|
+
const MIN_COL_WIDTH = 5;
|
|
337
|
+
const HEADER_HEIGHT = 26;
|
|
338
|
+
const HEADER_WIDTH = 48;
|
|
339
|
+
const DESKTOP_TOPBAR_TOOLBAR_HEIGHT = 34;
|
|
340
|
+
const DESKTOP_BOTTOMBAR_HEIGHT = 36;
|
|
341
|
+
const DEFAULT_CELL_WIDTH = 96;
|
|
328
342
|
const DEFAULT_CELL_HEIGHT = 23;
|
|
329
|
-
const
|
|
343
|
+
const SCROLLBAR_WIDTH = 15;
|
|
344
|
+
const AUTOFILL_EDGE_LENGTH = 8;
|
|
345
|
+
const ICON_EDGE_LENGTH = 18;
|
|
346
|
+
const MIN_CF_ICON_MARGIN = 4;
|
|
347
|
+
const MIN_CELL_TEXT_MARGIN = 4;
|
|
348
|
+
const PADDING_AUTORESIZE_VERTICAL = 3;
|
|
349
|
+
const PADDING_AUTORESIZE_HORIZONTAL = MIN_CELL_TEXT_MARGIN;
|
|
350
|
+
const GROUP_LAYER_WIDTH = 21;
|
|
351
|
+
const GRID_ICON_MARGIN = 2;
|
|
352
|
+
const GRID_ICON_EDGE_LENGTH = 17;
|
|
353
|
+
const FOOTER_HEIGHT = 2 * DEFAULT_CELL_HEIGHT;
|
|
354
|
+
const DATA_VALIDATION_CHIP_MARGIN = 5;
|
|
355
|
+
const MOBILE_WIDTH_BREAKPOINT = 768;
|
|
356
|
+
const MENU_WIDTH = 250;
|
|
357
|
+
const MENU_VERTICAL_PADDING = 6;
|
|
358
|
+
const DESKTOP_MENU_ITEM_HEIGHT = 26;
|
|
359
|
+
const MIN_ZOOM_LEVEL = .5;
|
|
360
|
+
const MAX_ZOOM_LEVEL = 2;
|
|
330
361
|
const ZOOM_VALUES = [
|
|
331
362
|
50,
|
|
332
363
|
75,
|
|
@@ -356,20 +387,34 @@ const DEFAULT_NUMBER_STYLE = {
|
|
|
356
387
|
};
|
|
357
388
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
358
389
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
390
|
+
const DEFAULT_FONT_WEIGHT = "400";
|
|
359
391
|
const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
|
|
392
|
+
const HEADER_FONT_SIZE = 11;
|
|
360
393
|
const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
|
|
361
394
|
const DEFAULT_BORDER_DESC = {
|
|
362
395
|
style: "thin",
|
|
363
396
|
color: "#000000"
|
|
364
397
|
};
|
|
398
|
+
const MAX_HISTORY_STEPS = 99;
|
|
365
399
|
const DEFAULT_REVISION_ID = "START_REVISION";
|
|
400
|
+
const DEFAULT_FIGURE_HEIGHT = 335;
|
|
401
|
+
const DEFAULT_FIGURE_WIDTH = 536;
|
|
402
|
+
const FIGURE_BORDER_WIDTH = 1;
|
|
403
|
+
const MIN_FIG_SIZE = 80;
|
|
404
|
+
const MAX_CHAR_LABEL = 20;
|
|
405
|
+
const FIGURE_ID_SPLITTER = "??";
|
|
366
406
|
const DEFAULT_GAUGE_LOWER_COLOR = "#EA6175";
|
|
367
407
|
const DEFAULT_GAUGE_MIDDLE_COLOR = "#FFD86D";
|
|
368
408
|
const DEFAULT_GAUGE_UPPER_COLOR = "#43C5B1";
|
|
369
409
|
const DEFAULT_SCORECARD_BASELINE_MODE = "difference";
|
|
370
410
|
const DEFAULT_SCORECARD_BASELINE_COLOR_UP = "#43C5B1";
|
|
371
411
|
const DEFAULT_SCORECARD_BASELINE_COLOR_DOWN = "#EA6175";
|
|
412
|
+
const DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE = 32;
|
|
413
|
+
const DEFAULT_SCORECARD_BASELINE_FONT_SIZE = 16;
|
|
372
414
|
const LINE_FILL_TRANSPARENCY = .4;
|
|
415
|
+
const LINE_DATA_POINT_RADIUS = 3;
|
|
416
|
+
const DEFAULT_WINDOW_SIZE = 2;
|
|
417
|
+
const MESSAGE_VERSION = 1;
|
|
373
418
|
const FORBIDDEN_SHEETNAME_CHARS = [
|
|
374
419
|
"'",
|
|
375
420
|
"*",
|
|
@@ -380,6 +425,7 @@ const FORBIDDEN_SHEETNAME_CHARS = [
|
|
|
380
425
|
"]"
|
|
381
426
|
];
|
|
382
427
|
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
428
|
+
const FORMULA_REF_IDENTIFIER = "|";
|
|
383
429
|
let DEFAULT_SHEETVIEW_SIZE = 0;
|
|
384
430
|
/**
|
|
385
431
|
* The viewport dimensions are usually set by one of the components
|
|
@@ -394,6 +440,7 @@ function setDefaultSheetViewSize(size) {
|
|
|
394
440
|
DEFAULT_SHEETVIEW_SIZE = size;
|
|
395
441
|
}
|
|
396
442
|
const MAXIMAL_FREEZABLE_RATIO = .85;
|
|
443
|
+
const NEWLINE = "\n";
|
|
397
444
|
const FONT_SIZES = [
|
|
398
445
|
6,
|
|
399
446
|
7,
|
|
@@ -419,6 +466,8 @@ const PIVOT_STATIC_TABLE_CONFIG = {
|
|
|
419
466
|
automaticAutofill: false
|
|
420
467
|
};
|
|
421
468
|
const PIVOT_INSERT_TABLE_STYLE_ID = "PivotTableStyleMedium12";
|
|
469
|
+
const PIVOT_INDENT = 15;
|
|
470
|
+
const PIVOT_COLLAPSE_ICON_SIZE = 12;
|
|
422
471
|
const PIVOT_MAX_NUMBER_OF_CELLS = 5e5;
|
|
423
472
|
const DEFAULT_CURRENCY = {
|
|
424
473
|
symbol: "$",
|
|
@@ -428,7 +477,7 @@ const DEFAULT_CURRENCY = {
|
|
|
428
477
|
name: "Dollar"
|
|
429
478
|
};
|
|
430
479
|
const DEFAULT_CAROUSEL_TITLE_STYLE = {
|
|
431
|
-
fontSize:
|
|
480
|
+
fontSize: CHART_TITLE_FONT_SIZE,
|
|
432
481
|
color: TEXT_BODY
|
|
433
482
|
};
|
|
434
483
|
const DEFAULT_TOKEN_COLOR = "light-dark(#000000, #ffffff)";
|
|
@@ -445,6 +494,7 @@ const tokenColors = {
|
|
|
445
494
|
ARG_SEPARATOR: functionColor,
|
|
446
495
|
ORPHAN_RIGHT_PAREN: "#ff0000"
|
|
447
496
|
};
|
|
497
|
+
const DRAG_THRESHOLD = 5;
|
|
448
498
|
|
|
449
499
|
//#endregion
|
|
450
500
|
//#region src/types/misc.ts
|
|
@@ -827,7 +877,7 @@ const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
|
|
|
827
877
|
*/
|
|
828
878
|
function replaceNewLines(text) {
|
|
829
879
|
if (!text) return "";
|
|
830
|
-
return text.replace(newLineRegexp,
|
|
880
|
+
return text.replace(newLineRegexp, NEWLINE);
|
|
831
881
|
}
|
|
832
882
|
/**
|
|
833
883
|
* Determine if the numbers are consecutive.
|
|
@@ -1076,7 +1126,7 @@ function toCartesian(xc) {
|
|
|
1076
1126
|
consumeSpaces(chars);
|
|
1077
1127
|
const col = letterPart - 1;
|
|
1078
1128
|
const row = num - 1;
|
|
1079
|
-
if (!chars.isOver() || col > MAX_COL || row >
|
|
1129
|
+
if (!chars.isOver() || col > MAX_COL || row > MAX_ROW) throw new Error(`Invalid cell description: ${xc}`);
|
|
1080
1130
|
return {
|
|
1081
1131
|
col,
|
|
1082
1132
|
row
|
|
@@ -1487,7 +1537,7 @@ function toUnboundedZone(xc) {
|
|
|
1487
1537
|
const orderedZone = reorderZone(toZoneWithoutBoundaryChanges(xc));
|
|
1488
1538
|
const bottom = orderedZone.bottom;
|
|
1489
1539
|
const right = orderedZone.right;
|
|
1490
|
-
if (bottom !== void 0 && bottom >
|
|
1540
|
+
if (bottom !== void 0 && bottom > MAX_ROW || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
|
|
1491
1541
|
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");
|
|
1492
1542
|
return orderedZone;
|
|
1493
1543
|
}
|
|
@@ -1648,7 +1698,7 @@ function intersection(z1, z2) {
|
|
|
1648
1698
|
return {
|
|
1649
1699
|
top: Math.max(z1.top, z2.top),
|
|
1650
1700
|
left: Math.max(z1.left, z2.left),
|
|
1651
|
-
bottom: Math.min(z1.bottom ??
|
|
1701
|
+
bottom: Math.min(z1.bottom ?? MAX_ROW, z2.bottom),
|
|
1652
1702
|
right: Math.min(z1.right ?? MAX_COL, z2.right)
|
|
1653
1703
|
};
|
|
1654
1704
|
}
|
|
@@ -4966,11 +5016,11 @@ function tokenize(str, locale = DEFAULT_LOCALE) {
|
|
|
4966
5016
|
return result;
|
|
4967
5017
|
}
|
|
4968
5018
|
function tokenizeDebugger(chars) {
|
|
4969
|
-
if (chars.current ===
|
|
5019
|
+
if (chars.current === DEBUGGER_CHAR) {
|
|
4970
5020
|
chars.shift();
|
|
4971
5021
|
return {
|
|
4972
5022
|
type: "DEBUGGER",
|
|
4973
|
-
value:
|
|
5023
|
+
value: DEBUGGER_CHAR
|
|
4974
5024
|
};
|
|
4975
5025
|
}
|
|
4976
5026
|
return null;
|
|
@@ -5129,13 +5179,13 @@ function tokenizeSimpleSpace(chars) {
|
|
|
5129
5179
|
}
|
|
5130
5180
|
function tokenizeNewLine(chars) {
|
|
5131
5181
|
let length = 0;
|
|
5132
|
-
while (chars.current ===
|
|
5182
|
+
while (chars.current === NEWLINE) {
|
|
5133
5183
|
length++;
|
|
5134
5184
|
chars.shift();
|
|
5135
5185
|
}
|
|
5136
5186
|
if (length) return {
|
|
5137
5187
|
type: "SPACE",
|
|
5138
|
-
value:
|
|
5188
|
+
value: NEWLINE.repeat(length)
|
|
5139
5189
|
};
|
|
5140
5190
|
return null;
|
|
5141
5191
|
}
|
|
@@ -6784,7 +6834,7 @@ function parseNumberFormatTokens(tokens) {
|
|
|
6784
6834
|
switch (token.type) {
|
|
6785
6835
|
case "DIGIT":
|
|
6786
6836
|
if (parsedPart === integerPart) parsedPart.push(token);
|
|
6787
|
-
else if (numberOfDecimalsDigits <
|
|
6837
|
+
else if (numberOfDecimalsDigits < MAX_DECIMAL_PLACES) {
|
|
6788
6838
|
parsedPart.push(token);
|
|
6789
6839
|
numberOfDecimalsDigits++;
|
|
6790
6840
|
}
|
|
@@ -7088,7 +7138,7 @@ function applyIntegerFormat(integerDigits, internalFormat, thousandsSeparator, h
|
|
|
7088
7138
|
if (digitType === "0") digit = digit || "0";
|
|
7089
7139
|
if (!digit) return;
|
|
7090
7140
|
const digitIndex = integerDigits.length - 1 - indexInIntegerString;
|
|
7091
|
-
const groups = getIndexesOfDigitsWithThousandSeparator(locale.digitGrouping ||
|
|
7141
|
+
const groups = getIndexesOfDigitsWithThousandSeparator(locale.digitGrouping || DEFAULT_LOCALE_DIGIT_GROUPING);
|
|
7092
7142
|
if (thousandsSeparator && groups.has(digitIndex - 1)) formattedInteger = digit + thousandsSeparator + formattedInteger;
|
|
7093
7143
|
else formattedInteger = digit + formattedInteger;
|
|
7094
7144
|
}
|
|
@@ -7148,7 +7198,7 @@ const numberRepresentation = [];
|
|
|
7148
7198
|
* exceed in the decimal part, in which case digits are rounded.
|
|
7149
7199
|
*
|
|
7150
7200
|
**/
|
|
7151
|
-
function splitNumber(value, maxDecimals =
|
|
7201
|
+
function splitNumber(value, maxDecimals = MAX_DECIMAL_PLACES) {
|
|
7152
7202
|
const asString = value.toString();
|
|
7153
7203
|
if (asString.includes("e")) return splitNumberIntl(value, maxDecimals);
|
|
7154
7204
|
if (Number.isInteger(value)) return {
|
|
@@ -7217,7 +7267,7 @@ function limitDecimalDigits(decimalDigits, maxDecimals) {
|
|
|
7217
7267
|
* Supports numbers with a lot of digits that are transformed to scientific notation by
|
|
7218
7268
|
* number.toString(), but is slow.
|
|
7219
7269
|
*/
|
|
7220
|
-
function splitNumberIntl(value, maxDecimals =
|
|
7270
|
+
function splitNumberIntl(value, maxDecimals = MAX_DECIMAL_PLACES) {
|
|
7221
7271
|
let formatter = numberRepresentation[maxDecimals];
|
|
7222
7272
|
if (!formatter) {
|
|
7223
7273
|
formatter = new Intl.NumberFormat("en-US", {
|
|
@@ -8363,7 +8413,7 @@ const MIN_DELAY = 20;
|
|
|
8363
8413
|
* Returns a timeout delay in milliseconds.
|
|
8364
8414
|
*/
|
|
8365
8415
|
function scrollDelay(value) {
|
|
8366
|
-
return
|
|
8416
|
+
return MIN_DELAY + (MAX_DELAY - MIN_DELAY) * Math.exp(-.035 * (value - 1));
|
|
8367
8417
|
}
|
|
8368
8418
|
|
|
8369
8419
|
//#endregion
|
|
@@ -8430,7 +8480,7 @@ function createEmptyStructure(node) {
|
|
|
8430
8480
|
//#endregion
|
|
8431
8481
|
//#region src/helpers/text_helper.ts
|
|
8432
8482
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
8433
|
-
return numberOfLines * (textLineHeight +
|
|
8483
|
+
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
8434
8484
|
}
|
|
8435
8485
|
function getCanvas(width = 100, height = 100) {
|
|
8436
8486
|
return new OffscreenCanvas(width, height).getContext("2d");
|
|
@@ -8439,7 +8489,7 @@ function getCanvas(width = 100, height = 100) {
|
|
|
8439
8489
|
* Get the default height of the cell given its style.
|
|
8440
8490
|
*/
|
|
8441
8491
|
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
8442
|
-
if (!cell || !cell.isFormula && !cell.content) return
|
|
8492
|
+
if (!cell || !cell.isFormula && !cell.content) return DEFAULT_CELL_HEIGHT;
|
|
8443
8493
|
let content = "";
|
|
8444
8494
|
try {
|
|
8445
8495
|
if (!cell.isFormula) {
|
|
@@ -8455,7 +8505,7 @@ function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
|
8455
8505
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
8456
8506
|
}
|
|
8457
8507
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
8458
|
-
return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 *
|
|
8508
|
+
return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : void 0), style).height + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
8459
8509
|
}
|
|
8460
8510
|
function getDefaultContextFont(fontSize, bold = false, italic = false) {
|
|
8461
8511
|
return `${italic ? "italic" : ""} ${bold ? "bold" : ""} ${fontSize}px ${DEFAULT_FONT}`;
|
|
@@ -8521,7 +8571,7 @@ function fontSizeInPixels(fontSize) {
|
|
|
8521
8571
|
return Math.round(fontSize * 96 / 72);
|
|
8522
8572
|
}
|
|
8523
8573
|
function computeTextFont(style, fontUnit = "pt") {
|
|
8524
|
-
return `${style.italic ? "italic " : ""}${style.bold ? "bold" :
|
|
8574
|
+
return `${style.italic ? "italic " : ""}${style.bold ? "bold" : DEFAULT_FONT_WEIGHT} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
8525
8575
|
}
|
|
8526
8576
|
function computeTextFontSizeInPixels(style) {
|
|
8527
8577
|
return fontSizeInPixels(style?.fontSize || DEFAULT_FONT_SIZE);
|
|
@@ -8545,7 +8595,7 @@ function splitTextToWidth(ctx, text, style, width) {
|
|
|
8545
8595
|
if (!style) style = {};
|
|
8546
8596
|
if (isMarkdownLink(text)) text = parseMarkdownLink(text).label;
|
|
8547
8597
|
const brokenText = [];
|
|
8548
|
-
const lines = text.includes(
|
|
8598
|
+
const lines = text.includes(NEWLINE) ? text.split(NEWLINE) : [text];
|
|
8549
8599
|
for (const line of lines) {
|
|
8550
8600
|
const words = line.includes(" ") ? line.split(" ") : [line];
|
|
8551
8601
|
if (!width) {
|
|
@@ -8711,7 +8761,7 @@ function computeRotationPosition(rect, style) {
|
|
|
8711
8761
|
let { x, y } = rect;
|
|
8712
8762
|
const cos = Math.cos(-style.rotation);
|
|
8713
8763
|
const sin = Math.sin(-style.rotation);
|
|
8714
|
-
const width = rect.textWidth - 2 *
|
|
8764
|
+
const width = rect.textWidth - 2 * MIN_CELL_TEXT_MARGIN;
|
|
8715
8765
|
const height = rect.textHeight;
|
|
8716
8766
|
const center = style.align === "center";
|
|
8717
8767
|
const rotateTowardCellCenter = style.align === "left" === sin < 0;
|
|
@@ -8829,7 +8879,7 @@ const chartBackgroundPlugin = {
|
|
|
8829
8879
|
const { ctx } = chart;
|
|
8830
8880
|
ctx.save();
|
|
8831
8881
|
ctx.globalCompositeOperation = "destination-over";
|
|
8832
|
-
ctx.fillStyle = options.color ||
|
|
8882
|
+
ctx.fillStyle = options.color || BACKGROUND_CHART_COLOR;
|
|
8833
8883
|
ctx.fillRect(0, 0, chart.width, chart.height);
|
|
8834
8884
|
ctx.restore();
|
|
8835
8885
|
}
|
|
@@ -8851,7 +8901,7 @@ function getCalendarChartController() {
|
|
|
8851
8901
|
};
|
|
8852
8902
|
updateElements(rects, start, count, mode) {
|
|
8853
8903
|
super.updateElements(rects, start, count, mode);
|
|
8854
|
-
const backgroundColor = this.chart.config.options?.plugins?.background?.color ||
|
|
8904
|
+
const backgroundColor = this.chart.config.options?.plugins?.background?.color || BACKGROUND_CHART_COLOR;
|
|
8855
8905
|
for (let i = start; i < start + count; i++) if (mode === "reset") this.updateElement(rects[i], i, { options: { backgroundColor } }, mode);
|
|
8856
8906
|
}
|
|
8857
8907
|
};
|
|
@@ -8871,7 +8921,7 @@ const chartColorScalePlugin = {
|
|
|
8871
8921
|
ctx.miterLimit = 1;
|
|
8872
8922
|
const gradientHeight = (chart.chartArea.bottom - chart.chartArea.top) / 2;
|
|
8873
8923
|
const gradientWidth = 10;
|
|
8874
|
-
const gradientX = options.position === "left" ?
|
|
8924
|
+
const gradientX = options.position === "left" ? CHART_PADDING : ctx.canvas.width - CHART_COLORSCALE_WIDTH;
|
|
8875
8925
|
const gradientY = chart.chartArea.top;
|
|
8876
8926
|
const gradient = ctx.createLinearGradient(0, gradientY + gradientHeight, 0, gradientY);
|
|
8877
8927
|
const step = 1 / (options.colorScale.length - 1);
|
|
@@ -8881,7 +8931,7 @@ const chartColorScalePlugin = {
|
|
|
8881
8931
|
ctx.fillStyle = gradient;
|
|
8882
8932
|
ctx.fillRect(gradientX, gradientY, gradientWidth, gradientHeight);
|
|
8883
8933
|
ctx.fillStyle = options.fontColor ?? "black";
|
|
8884
|
-
ctx.font = getDefaultContextFont(
|
|
8934
|
+
ctx.font = getDefaultContextFont(CHART_AXIS_TITLE_FONT_SIZE);
|
|
8885
8935
|
ctx.textAlign = "left";
|
|
8886
8936
|
let minValue = Math.round(options.minValue * 100) / 100;
|
|
8887
8937
|
let maxValue = Math.round(options.maxValue * 100) / 100;
|
|
@@ -9151,6 +9201,12 @@ const WIDTH_FACTOR = .143;
|
|
|
9151
9201
|
const EXCEL_DEFAULT_COL_WIDTH = 8.43;
|
|
9152
9202
|
/** unit : points */
|
|
9153
9203
|
const EXCEL_DEFAULT_ROW_HEIGHT = 12.75;
|
|
9204
|
+
const EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS = 30;
|
|
9205
|
+
const EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS = 100;
|
|
9206
|
+
/** The possible values for the XLSX polynomial trendline order are defined by the ST_Order simple type (§21.2.3.29) */
|
|
9207
|
+
const MAX_XLSX_POLYNOMIAL_DEGREE = 6;
|
|
9208
|
+
const FIRST_NUMFMT_ID = 164;
|
|
9209
|
+
const DEFAULT_DOUGHNUT_CHART_HOLE_SIZE = 50;
|
|
9154
9210
|
const FORCE_DEFAULT_ARGS_FUNCTIONS = {
|
|
9155
9211
|
FLOOR: [{
|
|
9156
9212
|
type: "NUMBER",
|
|
@@ -9452,8 +9508,8 @@ function toExcelDataset(getters, dataSetStyles, ds) {
|
|
|
9452
9508
|
if (dataSetStyle.trend?.type) trend = {
|
|
9453
9509
|
type: dataSetStyle.trend.type === "polynomial" && dataSetStyle.trend.order === 1 ? "linear" : SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING[dataSetStyle.trend.type],
|
|
9454
9510
|
color: dataSetStyle.trend.color,
|
|
9455
|
-
order: dataSetStyle.trend.order ? Math.min(dataSetStyle.trend.order,
|
|
9456
|
-
window: dataSetStyle.trend.window ||
|
|
9511
|
+
order: dataSetStyle.trend.order ? Math.min(dataSetStyle.trend.order, MAX_XLSX_POLYNOMIAL_DEGREE) : void 0,
|
|
9512
|
+
window: dataSetStyle.trend.window || DEFAULT_WINDOW_SIZE
|
|
9457
9513
|
};
|
|
9458
9514
|
return {
|
|
9459
9515
|
label,
|
|
@@ -9558,13 +9614,13 @@ function getPieColors(colors, dataSetsValues) {
|
|
|
9558
9614
|
for (let i = 0; i <= maxLength; i++) pieColors.push(colors.next());
|
|
9559
9615
|
return pieColors;
|
|
9560
9616
|
}
|
|
9561
|
-
function truncateLabel(label, maxLen =
|
|
9617
|
+
function truncateLabel(label, maxLen = MAX_CHAR_LABEL) {
|
|
9562
9618
|
if (!label) return "";
|
|
9563
9619
|
if (label.length > maxLen) return label.substring(0, maxLen) + "…";
|
|
9564
9620
|
return label;
|
|
9565
9621
|
}
|
|
9566
9622
|
function isTrendLineAxis(axisID) {
|
|
9567
|
-
return axisID ===
|
|
9623
|
+
return axisID === TREND_LINE_XAXIS_ID || axisID === MOVING_AVERAGE_TREND_LINE_XAXIS_ID;
|
|
9568
9624
|
}
|
|
9569
9625
|
|
|
9570
9626
|
//#endregion
|
|
@@ -9876,7 +9932,7 @@ function getBarChartScales(definition, args) {
|
|
|
9876
9932
|
scales = removeFalsyAttributes(scales);
|
|
9877
9933
|
if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
|
|
9878
9934
|
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
|
|
9879
|
-
scales[
|
|
9935
|
+
scales[TREND_LINE_XAXIS_ID] = {
|
|
9880
9936
|
...scales.x,
|
|
9881
9937
|
labels: Array(maxLength).fill(""),
|
|
9882
9938
|
offset: false,
|
|
@@ -9987,7 +10043,7 @@ function getLineChartScales(definition, args) {
|
|
|
9987
10043
|
});
|
|
9988
10044
|
}
|
|
9989
10045
|
if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
|
|
9990
|
-
scales[
|
|
10046
|
+
scales[TREND_LINE_XAXIS_ID] = {
|
|
9991
10047
|
...scales.x,
|
|
9992
10048
|
display: false
|
|
9993
10049
|
};
|
|
@@ -9997,9 +10053,9 @@ function getLineChartScales(definition, args) {
|
|
|
9997
10053
|
};
|
|
9998
10054
|
if (axisType === "category" || axisType === "time") {
|
|
9999
10055
|
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
|
|
10000
|
-
scales[
|
|
10001
|
-
scales[
|
|
10002
|
-
scales[
|
|
10056
|
+
scales[TREND_LINE_XAXIS_ID]["type"] = "category";
|
|
10057
|
+
scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
|
|
10058
|
+
scales[TREND_LINE_XAXIS_ID]["offset"] = false;
|
|
10003
10059
|
scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["type"] = "category";
|
|
10004
10060
|
scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["offset"] = false;
|
|
10005
10061
|
}
|
|
@@ -10161,7 +10217,7 @@ function getChartAxisTitleRuntime(design) {
|
|
|
10161
10217
|
font: {
|
|
10162
10218
|
style: italic ? "italic" : "normal",
|
|
10163
10219
|
weight: bold ? "bold" : "normal",
|
|
10164
|
-
size: design.title.fontSize ??
|
|
10220
|
+
size: design.title.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE
|
|
10165
10221
|
},
|
|
10166
10222
|
align: align === "left" ? "start" : align === "right" ? "end" : "center"
|
|
10167
10223
|
};
|
|
@@ -10249,16 +10305,16 @@ function getLegendMargin(definition) {
|
|
|
10249
10305
|
switch (definition.legendPosition) {
|
|
10250
10306
|
case "top":
|
|
10251
10307
|
case "right": return {
|
|
10252
|
-
top: !!definition.title.text ?
|
|
10253
|
-
left:
|
|
10254
|
-
right:
|
|
10308
|
+
top: !!definition.title.text ? CHART_PADDING_TOP + 30 : CHART_PADDING_TOP,
|
|
10309
|
+
left: CHART_PADDING,
|
|
10310
|
+
right: CHART_PADDING
|
|
10255
10311
|
};
|
|
10256
10312
|
case "bottom":
|
|
10257
10313
|
case "left":
|
|
10258
10314
|
case "none": return {
|
|
10259
|
-
left:
|
|
10260
|
-
right:
|
|
10261
|
-
bottom:
|
|
10315
|
+
left: CHART_PADDING,
|
|
10316
|
+
right: CHART_PADDING,
|
|
10317
|
+
bottom: CHART_PADDING_BOTTOM
|
|
10262
10318
|
};
|
|
10263
10319
|
}
|
|
10264
10320
|
}
|
|
@@ -10288,7 +10344,7 @@ function getBarChartDatasets(definition, args) {
|
|
|
10288
10344
|
label,
|
|
10289
10345
|
data: data.map((cell) => isNumberResult(cell) ? cell.value : NaN),
|
|
10290
10346
|
hidden,
|
|
10291
|
-
borderColor: definition.background ||
|
|
10347
|
+
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
10292
10348
|
borderWidth: definition.stacked ? 1 : 0,
|
|
10293
10349
|
backgroundColor,
|
|
10294
10350
|
yAxisID: definition.horizontal ? "y" : definition.dataSetStyles?.[dataSetId]?.yAxisId ?? "y",
|
|
@@ -10316,8 +10372,8 @@ function getCalendarChartDatasetAndLabels(definition, args) {
|
|
|
10316
10372
|
for (const dataSetValues of dataSetsValues) dataSets.push({
|
|
10317
10373
|
label: dataSetValues.label,
|
|
10318
10374
|
data: dataSetValues.data.map((v) => 1),
|
|
10319
|
-
backgroundColor: dataSetValues.data.map((v) => isNumberResult(v) ? colorMap(v.value) : definition.missingValueColor ||
|
|
10320
|
-
borderColor: definition.background ||
|
|
10375
|
+
backgroundColor: dataSetValues.data.map((v) => isNumberResult(v) ? colorMap(v.value) : definition.missingValueColor || COLOR_TRANSPARENT),
|
|
10376
|
+
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
10321
10377
|
borderSkipped: false,
|
|
10322
10378
|
borderWidth: 1,
|
|
10323
10379
|
barPercentage: 1,
|
|
@@ -10331,9 +10387,9 @@ function getCalendarChartDatasetAndLabels(definition, args) {
|
|
|
10331
10387
|
}
|
|
10332
10388
|
function getWaterfallDatasetAndLabels(definition, args) {
|
|
10333
10389
|
const { dataSetsValues, labels } = args;
|
|
10334
|
-
const negativeColor = definition.negativeValuesColor ||
|
|
10335
|
-
const positiveColor = definition.positiveValuesColor ||
|
|
10336
|
-
const subTotalColor = definition.subTotalValuesColor ||
|
|
10390
|
+
const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
10391
|
+
const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
10392
|
+
const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
10337
10393
|
const backgroundColor = [];
|
|
10338
10394
|
const datasetValues = [];
|
|
10339
10395
|
const dataset = {
|
|
@@ -10397,7 +10453,7 @@ function getLineChartDatasets(definition, args) {
|
|
|
10397
10453
|
backgroundColor: areaChart ? setColorAlpha(color, LINE_FILL_TRANSPARENCY) : color,
|
|
10398
10454
|
pointBackgroundColor: color,
|
|
10399
10455
|
fill: areaChart ? getFillingMode(index, stackedChart) : false,
|
|
10400
|
-
pointRadius: definition.hideDataMarkers ? 0 :
|
|
10456
|
+
pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS,
|
|
10401
10457
|
yAxisID: dataSetStyle?.yAxisId || "y"
|
|
10402
10458
|
};
|
|
10403
10459
|
dataSets.push(dataset);
|
|
@@ -10454,7 +10510,7 @@ function getComboChartDatasets(definition, args) {
|
|
|
10454
10510
|
xAxisID: "x",
|
|
10455
10511
|
type,
|
|
10456
10512
|
order: type === "bar" ? dataSetsValues.length + index : index,
|
|
10457
|
-
pointRadius: definition.hideDataMarkers ? 0 :
|
|
10513
|
+
pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
|
|
10458
10514
|
};
|
|
10459
10515
|
if (dataset.type === "bar") {
|
|
10460
10516
|
dataset.barPercentage = .9;
|
|
@@ -10486,7 +10542,7 @@ function getRadarChartDatasets(definition, args) {
|
|
|
10486
10542
|
borderColor,
|
|
10487
10543
|
backgroundColor: borderColor,
|
|
10488
10544
|
pointBackgroundColor: borderColor,
|
|
10489
|
-
pointRadius: definition.hideDataMarkers ? 0 :
|
|
10545
|
+
pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
|
|
10490
10546
|
};
|
|
10491
10547
|
if (fill) {
|
|
10492
10548
|
dataset.backgroundColor = setColorAlpha(borderColor, LINE_FILL_TRANSPARENCY);
|
|
@@ -10547,7 +10603,7 @@ function getFunnelChartDatasets(definition, args) {
|
|
|
10547
10603
|
xAxisID: "x",
|
|
10548
10604
|
barPercentage: 1,
|
|
10549
10605
|
categoryPercentage: 1,
|
|
10550
|
-
borderColor: definition.background ||
|
|
10606
|
+
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
10551
10607
|
borderWidth: 3
|
|
10552
10608
|
}];
|
|
10553
10609
|
}
|
|
@@ -10572,12 +10628,12 @@ function getSunburstChartDatasets(definition, args) {
|
|
|
10572
10628
|
data: data[i],
|
|
10573
10629
|
borderColor: (ctx) => {
|
|
10574
10630
|
const data = ctx.type === "data" ? ctx.raw : void 0;
|
|
10575
|
-
if (!data || data.label ===
|
|
10576
|
-
return definition.background ||
|
|
10631
|
+
if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
|
|
10632
|
+
return definition.background || BACKGROUND_CHART_COLOR;
|
|
10577
10633
|
},
|
|
10578
10634
|
backgroundColor: (ctx) => {
|
|
10579
10635
|
const data = ctx.type === "data" ? ctx.raw : void 0;
|
|
10580
|
-
if (!data || data.label ===
|
|
10636
|
+
if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
|
|
10581
10637
|
const rootGroup = data.groups[0];
|
|
10582
10638
|
return groupColors.find((groupColor) => groupColor.label === rootGroup)?.color;
|
|
10583
10639
|
},
|
|
@@ -10718,7 +10774,7 @@ function getTrendingLineDataSet(dataset, config, data) {
|
|
|
10718
10774
|
const borderColor = config.color || lightenColor(rgbaToHex(defaultBorderColor), .5);
|
|
10719
10775
|
return {
|
|
10720
10776
|
type: "line",
|
|
10721
|
-
xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID :
|
|
10777
|
+
xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID : TREND_LINE_XAXIS_ID,
|
|
10722
10778
|
yAxisID: dataset.yAxisID,
|
|
10723
10779
|
label: dataset.label ? _t("Trend line for %s", dataset.label) : "",
|
|
10724
10780
|
data,
|
|
@@ -10831,7 +10887,7 @@ const sunburstHoverPlugin = {
|
|
|
10831
10887
|
for (const metaSet of chart.getSortedVisibleDatasetMetas()) for (const arcElement of metaSet.data) {
|
|
10832
10888
|
const context = arcElement["$context"];
|
|
10833
10889
|
const { datasetIndex, index, dataset, raw } = context;
|
|
10834
|
-
if (raw.label ===
|
|
10890
|
+
if (raw.label === GHOST_SUNBURST_VALUE) continue;
|
|
10835
10891
|
const originalBackgroundColor = typeof dataset.backgroundColor === "function" ? dataset.backgroundColor(context) : dataset.backgroundColor;
|
|
10836
10892
|
if (activeDataPoints.length && !activeDataPoints.some((el) => el.datasetIndex === datasetIndex && el.index === index)) arcElement.options.backgroundColor = lightenColor(originalBackgroundColor, .5);
|
|
10837
10893
|
else arcElement.options.backgroundColor = originalBackgroundColor;
|
|
@@ -10859,7 +10915,7 @@ function drawSunburstChartValues(chart, options, ctx) {
|
|
|
10859
10915
|
const lineHeight = fontSize + Y_PADDING;
|
|
10860
10916
|
for (const dataset of chart._metasets) for (let i = 0; i < dataset._dataset.data.length; i++) {
|
|
10861
10917
|
const rawData = dataset._dataset.data[i];
|
|
10862
|
-
if (rawData.label ===
|
|
10918
|
+
if (rawData.label === GHOST_SUNBURST_VALUE) continue;
|
|
10863
10919
|
const valuesToDisplay = [options.showLabels ? rawData.label : void 0, options.showValues ? options.callback(rawData.value, "y") : void 0].filter(isDefined);
|
|
10864
10920
|
const arc = dataset.data[i];
|
|
10865
10921
|
let { startAngle, endAngle, innerRadius, outerRadius, circumference } = arc;
|
|
@@ -11385,7 +11441,7 @@ function drawScoreChart(structure, canvas, zoom = 1) {
|
|
|
11385
11441
|
canvas.width = dpr * structure.canvas.width * zoom;
|
|
11386
11442
|
canvas.height = dpr * structure.canvas.height * zoom;
|
|
11387
11443
|
ctx.scale(dpr * zoom, dpr * zoom);
|
|
11388
|
-
const availableWidth = structure.canvas.width -
|
|
11444
|
+
const availableWidth = structure.canvas.width - CHART_PADDING;
|
|
11389
11445
|
ctx.fillStyle = structure.canvas.backgroundColor;
|
|
11390
11446
|
ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
|
|
11391
11447
|
if (structure.title) {
|
|
@@ -11493,16 +11549,16 @@ var ScorecardChartConfigBuilder = class {
|
|
|
11493
11549
|
x = (this.width - titleWidth) / 2;
|
|
11494
11550
|
break;
|
|
11495
11551
|
case "right":
|
|
11496
|
-
x = this.width - titleWidth -
|
|
11552
|
+
x = this.width - titleWidth - CHART_PADDING;
|
|
11497
11553
|
break;
|
|
11498
|
-
default: x =
|
|
11554
|
+
default: x = CHART_PADDING;
|
|
11499
11555
|
}
|
|
11500
11556
|
structure.title = {
|
|
11501
11557
|
text: this.title,
|
|
11502
11558
|
style: style.title,
|
|
11503
11559
|
position: {
|
|
11504
11560
|
x,
|
|
11505
|
-
y:
|
|
11561
|
+
y: CHART_PADDING_BOTTOM + titleHeight / 2
|
|
11506
11562
|
}
|
|
11507
11563
|
};
|
|
11508
11564
|
}
|
|
@@ -11513,10 +11569,10 @@ var ScorecardChartConfigBuilder = class {
|
|
|
11513
11569
|
let baselineX;
|
|
11514
11570
|
switch (this.runtime.baselineStyle?.align) {
|
|
11515
11571
|
case "right":
|
|
11516
|
-
baselineX = this.width -
|
|
11572
|
+
baselineX = this.width - CHART_PADDING - baselineDescrWidth - baselineWidth;
|
|
11517
11573
|
break;
|
|
11518
11574
|
case "left":
|
|
11519
|
-
baselineX =
|
|
11575
|
+
baselineX = CHART_PADDING + baselineArrowSize;
|
|
11520
11576
|
break;
|
|
11521
11577
|
default: baselineX = (this.width - baselineWidth - baselineDescrWidth + baselineArrowSize) / 2;
|
|
11522
11578
|
}
|
|
@@ -11526,7 +11582,7 @@ var ScorecardChartConfigBuilder = class {
|
|
|
11526
11582
|
style: style.baselineValue,
|
|
11527
11583
|
position: {
|
|
11528
11584
|
x: baselineX,
|
|
11529
|
-
y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 -
|
|
11585
|
+
y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING_BOTTOM
|
|
11530
11586
|
}
|
|
11531
11587
|
};
|
|
11532
11588
|
if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
|
|
@@ -11554,12 +11610,12 @@ var ScorecardChartConfigBuilder = class {
|
|
|
11554
11610
|
progressBarHeight = this.height * .05;
|
|
11555
11611
|
structure.progressBar = {
|
|
11556
11612
|
position: {
|
|
11557
|
-
x: 2 *
|
|
11613
|
+
x: 2 * CHART_PADDING,
|
|
11558
11614
|
y: this.height * (1 - 2 * BOTTOM_PADDING_RATIO) - baselineHeight - progressBarHeight
|
|
11559
11615
|
},
|
|
11560
11616
|
dimension: {
|
|
11561
11617
|
height: progressBarHeight,
|
|
11562
|
-
width: this.width - 4 *
|
|
11618
|
+
width: this.width - 4 * CHART_PADDING
|
|
11563
11619
|
},
|
|
11564
11620
|
value: this.runtime.progressBar.value,
|
|
11565
11621
|
style: {
|
|
@@ -11573,10 +11629,10 @@ var ScorecardChartConfigBuilder = class {
|
|
|
11573
11629
|
let keyX;
|
|
11574
11630
|
switch (this.runtime.keyValueStyle?.align) {
|
|
11575
11631
|
case "right":
|
|
11576
|
-
keyX = this.width -
|
|
11632
|
+
keyX = this.width - CHART_PADDING - keyDescrWidth - keyWidth;
|
|
11577
11633
|
break;
|
|
11578
11634
|
case "left":
|
|
11579
|
-
keyX =
|
|
11635
|
+
keyX = CHART_PADDING;
|
|
11580
11636
|
break;
|
|
11581
11637
|
default: keyX = (this.width - keyWidth - keyDescrWidth) / 2;
|
|
11582
11638
|
}
|
|
@@ -11584,8 +11640,8 @@ var ScorecardChartConfigBuilder = class {
|
|
|
11584
11640
|
text: this.keyValue,
|
|
11585
11641
|
style: style.keyValue,
|
|
11586
11642
|
position: {
|
|
11587
|
-
x: Math.max(
|
|
11588
|
-
y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) +
|
|
11643
|
+
x: Math.max(CHART_PADDING, keyX),
|
|
11644
|
+
y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) + CHART_PADDING_BOTTOM / 2 + (titleHeight + keyHeight / 2) / 2
|
|
11589
11645
|
}
|
|
11590
11646
|
};
|
|
11591
11647
|
if (structure.key && this.keyDescr) {
|
|
@@ -11642,14 +11698,14 @@ var ScorecardChartConfigBuilder = class {
|
|
|
11642
11698
|
};
|
|
11643
11699
|
}
|
|
11644
11700
|
getTextStyles() {
|
|
11645
|
-
const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ??
|
|
11701
|
+
const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ?? DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE;
|
|
11646
11702
|
const keyValueDescrFontSize = Math.floor(.9 * keyValueFontSize);
|
|
11647
|
-
let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ??
|
|
11703
|
+
let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ?? DEFAULT_SCORECARD_BASELINE_FONT_SIZE;
|
|
11648
11704
|
const baselineDescrFontSize = Math.floor(.9 * baselineValueFontSize);
|
|
11649
11705
|
if (this.runtime.progressBar) baselineValueFontSize /= 1.5;
|
|
11650
11706
|
return {
|
|
11651
11707
|
title: {
|
|
11652
|
-
font: getDefaultContextFont(this.runtime.title.fontSize ??
|
|
11708
|
+
font: getDefaultContextFont(this.runtime.title.fontSize ?? SCORECARD_CHART_TITLE_FONT_SIZE, this.runtime.title.bold, this.runtime.title.italic),
|
|
11653
11709
|
color: this.runtime.title.color ?? this.secondaryFontColor
|
|
11654
11710
|
},
|
|
11655
11711
|
keyValue: {
|
|
@@ -12138,35 +12194,35 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
12138
12194
|
x: boundingRect.width / 2,
|
|
12139
12195
|
y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
|
|
12140
12196
|
};
|
|
12141
|
-
let gaugeValueFontSize =
|
|
12197
|
+
let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
|
|
12142
12198
|
if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
|
|
12143
12199
|
const maxTextWidth = gaugeRect.width / 2;
|
|
12144
12200
|
const gaugeLabel = runtime.gaugeValue?.label || "-";
|
|
12145
12201
|
if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
|
|
12146
12202
|
const minLabelPosition = {
|
|
12147
12203
|
x: gaugeRect.x + gaugeArcWidth / 2,
|
|
12148
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
12204
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
12149
12205
|
};
|
|
12150
12206
|
const maxLabelPosition = {
|
|
12151
12207
|
x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
|
|
12152
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
12208
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
12153
12209
|
};
|
|
12154
12210
|
const textColor = chartMutedFontColor(runtime.background);
|
|
12155
12211
|
const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
|
|
12156
12212
|
let x = 0, titleWidth = 0, titleHeight = 0;
|
|
12157
12213
|
if (runtime.title.text) ({width: titleWidth, height: titleHeight} = computeTextDimension(ctx, runtime.title.text, {
|
|
12158
|
-
fontSize:
|
|
12214
|
+
fontSize: CHART_TITLE_FONT_SIZE,
|
|
12159
12215
|
...runtime.title
|
|
12160
12216
|
}, "px"));
|
|
12161
12217
|
switch (runtime.title.align) {
|
|
12162
12218
|
case "right":
|
|
12163
|
-
x = boundingRect.width - titleWidth -
|
|
12219
|
+
x = boundingRect.width - titleWidth - CHART_PADDING;
|
|
12164
12220
|
break;
|
|
12165
12221
|
case "center":
|
|
12166
12222
|
x = (boundingRect.width - titleWidth) / 2;
|
|
12167
12223
|
break;
|
|
12168
12224
|
default:
|
|
12169
|
-
x =
|
|
12225
|
+
x = CHART_PADDING;
|
|
12170
12226
|
break;
|
|
12171
12227
|
}
|
|
12172
12228
|
return {
|
|
@@ -12174,10 +12230,10 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
12174
12230
|
height: boundingRect.height,
|
|
12175
12231
|
title: {
|
|
12176
12232
|
label: runtime.title.text ?? "",
|
|
12177
|
-
fontSize: runtime.title.fontSize ??
|
|
12233
|
+
fontSize: runtime.title.fontSize ?? CHART_TITLE_FONT_SIZE,
|
|
12178
12234
|
textPosition: {
|
|
12179
12235
|
x,
|
|
12180
|
-
y:
|
|
12236
|
+
y: CHART_PADDING_TOP + titleHeight / 2
|
|
12181
12237
|
},
|
|
12182
12238
|
color: runtime.title.color ?? textColor,
|
|
12183
12239
|
bold: runtime.title.bold,
|
|
@@ -12200,13 +12256,13 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
12200
12256
|
minLabel: {
|
|
12201
12257
|
label: runtime.minValue.label,
|
|
12202
12258
|
textPosition: minLabelPosition,
|
|
12203
|
-
fontSize:
|
|
12259
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
12204
12260
|
color: textColor
|
|
12205
12261
|
},
|
|
12206
12262
|
maxLabel: {
|
|
12207
12263
|
label: runtime.maxValue.label,
|
|
12208
12264
|
textPosition: maxLabelPosition,
|
|
12209
|
-
fontSize:
|
|
12265
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
12210
12266
|
color: textColor
|
|
12211
12267
|
}
|
|
12212
12268
|
};
|
|
@@ -12216,9 +12272,9 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
12216
12272
|
* space for the title and labels.
|
|
12217
12273
|
*/
|
|
12218
12274
|
function getGaugeRect(boundingRect, title) {
|
|
12219
|
-
const titleHeight = title ?
|
|
12220
|
-
const drawHeight = boundingRect.height -
|
|
12221
|
-
const drawWidth = boundingRect.width -
|
|
12275
|
+
const titleHeight = title ? GAUGE_TITLE_SECTION_HEIGHT : 0;
|
|
12276
|
+
const drawHeight = boundingRect.height - GAUGE_PADDING_BOTTOM - titleHeight - GAUGE_PADDING_TOP;
|
|
12277
|
+
const drawWidth = boundingRect.width - GAUGE_PADDING_SIDE * 2;
|
|
12222
12278
|
let gaugeWidth;
|
|
12223
12279
|
let gaugeHeight;
|
|
12224
12280
|
if (drawWidth > 2 * drawHeight) {
|
|
@@ -12229,8 +12285,8 @@ function getGaugeRect(boundingRect, title) {
|
|
|
12229
12285
|
gaugeHeight = drawWidth / 2;
|
|
12230
12286
|
}
|
|
12231
12287
|
return {
|
|
12232
|
-
x:
|
|
12233
|
-
y: titleHeight +
|
|
12288
|
+
x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
|
|
12289
|
+
y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
|
|
12234
12290
|
width: gaugeWidth,
|
|
12235
12291
|
height: gaugeHeight
|
|
12236
12292
|
};
|
|
@@ -12247,20 +12303,20 @@ function getInflectionValues(runtime, gaugeRect, textColor, ctx) {
|
|
|
12247
12303
|
x: gaugeRect.x + gaugeRect.width / 2,
|
|
12248
12304
|
y: gaugeRect.y + gaugeRect.height
|
|
12249
12305
|
};
|
|
12250
|
-
const textStyle = { fontSize:
|
|
12306
|
+
const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
|
|
12251
12307
|
const inflectionValues = [];
|
|
12252
12308
|
const inflectionValuesTextRects = [];
|
|
12253
12309
|
for (const inflectionValue of runtime.inflectionValues) {
|
|
12254
12310
|
const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
|
|
12255
12311
|
const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
|
|
12256
12312
|
const angle = Math.PI - Math.PI * percentage;
|
|
12257
|
-
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2,
|
|
12258
|
-
const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ?
|
|
12313
|
+
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, GAUGE_LABELS_FONT_SIZE);
|
|
12314
|
+
const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? GAUGE_LABELS_FONT_SIZE : 0;
|
|
12259
12315
|
inflectionValuesTextRects.push(textRect);
|
|
12260
12316
|
inflectionValues.push({
|
|
12261
12317
|
rotation: angle,
|
|
12262
12318
|
label: inflectionValue.label,
|
|
12263
|
-
fontSize:
|
|
12319
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
12264
12320
|
color: textColor,
|
|
12265
12321
|
offset
|
|
12266
12322
|
});
|
|
@@ -12760,7 +12816,7 @@ function predictLinearValues(Y, X, newX, computeIntercept) {
|
|
|
12760
12816
|
});
|
|
12761
12817
|
return newY.length === newX.length ? newY : transposeMatrix(newY);
|
|
12762
12818
|
}
|
|
12763
|
-
function getMovingAverageValues(dataset, labels, windowSize =
|
|
12819
|
+
function getMovingAverageValues(dataset, labels, windowSize = DEFAULT_WINDOW_SIZE) {
|
|
12764
12820
|
const values = [];
|
|
12765
12821
|
for (let i = 0; i < windowSize - 1; i++) values.push({
|
|
12766
12822
|
x: labels[i],
|
|
@@ -14344,19 +14400,19 @@ function getTopPaddingForDashboard(definition, getters) {
|
|
|
14344
14400
|
//#region src/helpers/figures/charts/runtime/chartjs_layout.ts
|
|
14345
14401
|
function getChartLayout(definition, args) {
|
|
14346
14402
|
return { padding: {
|
|
14347
|
-
left:
|
|
14348
|
-
right:
|
|
14349
|
-
top: Math.max(
|
|
14350
|
-
bottom:
|
|
14403
|
+
left: CHART_PADDING,
|
|
14404
|
+
right: CHART_PADDING,
|
|
14405
|
+
top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
|
|
14406
|
+
bottom: CHART_PADDING_BOTTOM
|
|
14351
14407
|
} };
|
|
14352
14408
|
}
|
|
14353
14409
|
function getCalendarChartLayout(definition, args) {
|
|
14354
14410
|
const legendPosition = definition.legendPosition;
|
|
14355
14411
|
return { padding: {
|
|
14356
|
-
left:
|
|
14357
|
-
right:
|
|
14358
|
-
top: Math.max(
|
|
14359
|
-
bottom:
|
|
14412
|
+
left: CHART_PADDING + (legendPosition === "left" ? CHART_COLORSCALE_WIDTH : 0),
|
|
14413
|
+
right: CHART_PADDING + (legendPosition === "right" ? CHART_COLORSCALE_WIDTH : 0),
|
|
14414
|
+
top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
|
|
14415
|
+
bottom: CHART_PADDING_BOTTOM
|
|
14360
14416
|
} };
|
|
14361
14417
|
}
|
|
14362
14418
|
|
|
@@ -14433,9 +14489,9 @@ function getComboChartLegend(definition, args) {
|
|
|
14433
14489
|
}
|
|
14434
14490
|
function getWaterfallChartLegend(definition, args) {
|
|
14435
14491
|
const fontColor = chartFontColor(definition.background);
|
|
14436
|
-
const negativeColor = definition.negativeValuesColor ||
|
|
14437
|
-
const positiveColor = definition.positiveValuesColor ||
|
|
14438
|
-
const subTotalColor = definition.subTotalValuesColor ||
|
|
14492
|
+
const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
14493
|
+
const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
14494
|
+
const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
14439
14495
|
return {
|
|
14440
14496
|
...getLegendDisplayOptions(definition, args),
|
|
14441
14497
|
labels: {
|
|
@@ -14674,11 +14730,11 @@ function getChartTitle(definition, getters) {
|
|
|
14674
14730
|
color: chartTitle?.color ?? fontColor,
|
|
14675
14731
|
align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
|
|
14676
14732
|
font: {
|
|
14677
|
-
size: definition.title.fontSize ??
|
|
14733
|
+
size: definition.title.fontSize ?? CHART_TITLE_FONT_SIZE,
|
|
14678
14734
|
weight: chartTitle.bold ? "bold" : "normal",
|
|
14679
14735
|
style: chartTitle.italic ? "italic" : "normal"
|
|
14680
14736
|
},
|
|
14681
|
-
padding: { bottom: definition.legendPosition === "top" ? 0 :
|
|
14737
|
+
padding: { bottom: definition.legendPosition === "top" ? 0 : CHART_PADDING }
|
|
14682
14738
|
};
|
|
14683
14739
|
}
|
|
14684
14740
|
|
|
@@ -15135,7 +15191,7 @@ const BarChart = {
|
|
|
15135
15191
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
15136
15192
|
return {
|
|
15137
15193
|
...definition,
|
|
15138
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
15194
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
15139
15195
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
15140
15196
|
dataSets,
|
|
15141
15197
|
labelRange,
|
|
@@ -15494,7 +15550,7 @@ const LineChart = {
|
|
|
15494
15550
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
15495
15551
|
return {
|
|
15496
15552
|
...definition,
|
|
15497
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
15553
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
15498
15554
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
15499
15555
|
dataSets,
|
|
15500
15556
|
labelRange,
|
|
@@ -15574,7 +15630,7 @@ const PieChart = {
|
|
|
15574
15630
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
15575
15631
|
return {
|
|
15576
15632
|
...definition,
|
|
15577
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
15633
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
15578
15634
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
15579
15635
|
dataSets,
|
|
15580
15636
|
labelRange
|
|
@@ -15694,7 +15750,7 @@ var charts_exports = /* @__PURE__ */ __exportAll({
|
|
|
15694
15750
|
PieChart: () => PieChart,
|
|
15695
15751
|
SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING: () => SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING,
|
|
15696
15752
|
ScorecardChart: () => ScorecardChart$1,
|
|
15697
|
-
TREND_LINE_XAXIS_ID: () =>
|
|
15753
|
+
TREND_LINE_XAXIS_ID: () => TREND_LINE_XAXIS_ID,
|
|
15698
15754
|
WaterfallChart: () => WaterfallChart,
|
|
15699
15755
|
adaptChartRange: () => adaptChartRange,
|
|
15700
15756
|
chartFontColor: () => chartFontColor,
|
|
@@ -16087,7 +16143,7 @@ function getElementMargins(el) {
|
|
|
16087
16143
|
|
|
16088
16144
|
//#endregion
|
|
16089
16145
|
//#region src/components/figures/chart/chartJs/zoomable_chart/zoomable_chart_store.ts
|
|
16090
|
-
const TREND_LINE_AXES_IDS = [
|
|
16146
|
+
const TREND_LINE_AXES_IDS = [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID];
|
|
16091
16147
|
const ZOOMABLE_AXIS_IDS = ["x", ...TREND_LINE_AXES_IDS];
|
|
16092
16148
|
var ZoomableChartStore = class extends SpreadsheetStore {
|
|
16093
16149
|
mutators = [
|
|
@@ -16203,7 +16259,7 @@ var ZoomableChartJsComponent = class extends ChartJsComponent {
|
|
|
16203
16259
|
this.removeEventListeners();
|
|
16204
16260
|
}
|
|
16205
16261
|
get containerStyle() {
|
|
16206
|
-
return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${
|
|
16262
|
+
return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${MASTER_CHART_HEIGHT}px)` : "100%" });
|
|
16207
16263
|
}
|
|
16208
16264
|
get masterChartContainerStyle() {
|
|
16209
16265
|
const runtime = this.env.model.getters.getChartRuntime(this.props.chartId);
|
|
@@ -16262,8 +16318,8 @@ var ZoomableChartJsComponent = class extends ChartJsComponent {
|
|
|
16262
16318
|
getAxisLimitsFromDataset(chartData) {
|
|
16263
16319
|
const xValues = chartData.data.datasets.map((ds) => ds.data).flat().map((d, i) => typeof d === "object" && d !== null ? d.x : i);
|
|
16264
16320
|
return {
|
|
16265
|
-
min:
|
|
16266
|
-
max:
|
|
16321
|
+
min: largeMin(xValues),
|
|
16322
|
+
max: largeMax(xValues)
|
|
16267
16323
|
};
|
|
16268
16324
|
}
|
|
16269
16325
|
setMasterChartCursor(runtime) {
|
|
@@ -16349,7 +16405,7 @@ var ZoomableChartJsComponent = class extends ChartJsComponent {
|
|
|
16349
16405
|
updateTrendingLineAxes() {
|
|
16350
16406
|
this.store.updateTrendLineConfiguration(this.chartId);
|
|
16351
16407
|
const limits = this.store.currentAxesLimits[this.chartId];
|
|
16352
|
-
for (const axisId of [
|
|
16408
|
+
for (const axisId of [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID]) {
|
|
16353
16409
|
if (!this.chart?.config?.options?.scales?.[axisId] || !limits?.[axisId]) continue;
|
|
16354
16410
|
this.chart.config.options.scales[axisId].min = limits[axisId].min;
|
|
16355
16411
|
this.chart.config.options.scales[axisId].max = limits[axisId].max;
|
|
@@ -17614,7 +17670,7 @@ var MenuPopover = class MenuPopover extends Component {
|
|
|
17614
17670
|
onClickMenu: this.onClickMenu.bind(this),
|
|
17615
17671
|
onMouseEnter: this.onMenuItemMouseEnter.bind(this),
|
|
17616
17672
|
onMouseLeave: this.onMouseLeave.bind(this),
|
|
17617
|
-
width: this.props.width ||
|
|
17673
|
+
width: this.props.width || MENU_WIDTH,
|
|
17618
17674
|
onScroll: this.onScroll.bind(this),
|
|
17619
17675
|
onKeyDown: this.onKeydown.bind(this),
|
|
17620
17676
|
hoveredMenuId,
|
|
@@ -17633,11 +17689,11 @@ var MenuPopover = class MenuPopover extends Component {
|
|
|
17633
17689
|
anchorRect: {
|
|
17634
17690
|
x: this.props.anchorRect.x,
|
|
17635
17691
|
y: this.props.anchorRect.y,
|
|
17636
|
-
width: isRoot ? this.props.anchorRect.width : this.props.width ||
|
|
17637
|
-
height: isRoot ? this.props.anchorRect.height :
|
|
17692
|
+
width: isRoot ? this.props.anchorRect.width : this.props.width || MENU_WIDTH,
|
|
17693
|
+
height: isRoot ? this.props.anchorRect.height : DESKTOP_MENU_ITEM_HEIGHT
|
|
17638
17694
|
},
|
|
17639
17695
|
positioning: this.props.popoverPositioning,
|
|
17640
|
-
verticalOffset: isRoot ? 0 :
|
|
17696
|
+
verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
|
|
17641
17697
|
onPopoverHidden: () => this.closeSubMenu(),
|
|
17642
17698
|
onPopoverMoved: () => this.closeSubMenu(),
|
|
17643
17699
|
maxHeight: this.props.maxHeight
|
|
@@ -17694,8 +17750,8 @@ var MenuPopover = class MenuPopover extends Component {
|
|
|
17694
17750
|
this.subMenu.anchorRect = {
|
|
17695
17751
|
x: getRefBoundingRect(this.menuRef).x,
|
|
17696
17752
|
y: y - (this.subMenu.scrollOffset || 0),
|
|
17697
|
-
width: this.props.width ||
|
|
17698
|
-
height:
|
|
17753
|
+
width: this.props.width || MENU_WIDTH,
|
|
17754
|
+
height: DESKTOP_MENU_ITEM_HEIGHT
|
|
17699
17755
|
};
|
|
17700
17756
|
this.subMenu.menuItems = menu.children(this.env);
|
|
17701
17757
|
this.subMenu.isOpen = true;
|
|
@@ -17971,7 +18027,7 @@ var ChartDashboardMenu = class extends Component {
|
|
|
17971
18027
|
return [this.fullScreenMenuItem].filter(isDefined);
|
|
17972
18028
|
}
|
|
17973
18029
|
get backgroundColor() {
|
|
17974
|
-
return "background-color: " + (this.env.model.getters.getChartDefinition(this.props.chartId).background ||
|
|
18030
|
+
return "background-color: " + (this.env.model.getters.getChartDefinition(this.props.chartId).background || BACKGROUND_CHART_COLOR);
|
|
17975
18031
|
}
|
|
17976
18032
|
openContextMenu(ev) {
|
|
17977
18033
|
this.menuState.isOpen = true;
|
|
@@ -18098,7 +18154,7 @@ var CarouselFigure = class extends Component {
|
|
|
18098
18154
|
if (this.selectedCarouselItem?.type === "chart") {
|
|
18099
18155
|
const chart = this.env.model.getters.getChartRuntime(this.selectedCarouselItem.chartId);
|
|
18100
18156
|
if ("background" in chart && chart.background) cssProperties["background-color"] = chart.background;
|
|
18101
|
-
else if ("chartJsConfig" in chart) cssProperties["background-color"] = chart.chartJsConfig.options?.plugins?.background?.color ||
|
|
18157
|
+
else if ("chartJsConfig" in chart) cssProperties["background-color"] = chart.chartJsConfig.options?.plugins?.background?.color || BACKGROUND_CHART_COLOR;
|
|
18102
18158
|
} else cssProperties["background-color"] = BACKGROUND_CHART_COLOR;
|
|
18103
18159
|
return cssPropertiesToCss(cssProperties);
|
|
18104
18160
|
}
|
|
@@ -19062,7 +19118,7 @@ function getCaretDownSvg(color) {
|
|
|
19062
19118
|
width: 512,
|
|
19063
19119
|
height: 512,
|
|
19064
19120
|
paths: [{
|
|
19065
|
-
fillColor: color.textColor ||
|
|
19121
|
+
fillColor: color.textColor || TEXT_BODY_MUTED,
|
|
19066
19122
|
path: CARET_DOWN_PATH
|
|
19067
19123
|
}]
|
|
19068
19124
|
};
|
|
@@ -19073,7 +19129,7 @@ function getCaretUpSvg(color) {
|
|
|
19073
19129
|
width: 512,
|
|
19074
19130
|
height: 512,
|
|
19075
19131
|
paths: [{
|
|
19076
|
-
fillColor: color.textColor ||
|
|
19132
|
+
fillColor: color.textColor || TEXT_BODY_MUTED,
|
|
19077
19133
|
path: CARET_UP_PATH
|
|
19078
19134
|
}]
|
|
19079
19135
|
};
|
|
@@ -19084,7 +19140,7 @@ function getHoveredCaretDownSvg(color) {
|
|
|
19084
19140
|
width: 512,
|
|
19085
19141
|
height: 512,
|
|
19086
19142
|
paths: [{
|
|
19087
|
-
fillColor: color.textColor ||
|
|
19143
|
+
fillColor: color.textColor || TEXT_BODY_MUTED,
|
|
19088
19144
|
path: HOVERED_CARET_DOWN_PATH
|
|
19089
19145
|
}, {
|
|
19090
19146
|
fillColor: color.fillColor || "#fff",
|
|
@@ -19847,7 +19903,7 @@ function extractStyle(data, content, styleId, formatId, borderId) {
|
|
|
19847
19903
|
alignment: {
|
|
19848
19904
|
horizontal: style.align,
|
|
19849
19905
|
vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
|
|
19850
|
-
wrapText: style.wrapping === "wrap" || content?.includes(
|
|
19906
|
+
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : void 0,
|
|
19851
19907
|
textRotation: style.rotation ? rotationToXLSX(style.rotation) : void 0,
|
|
19852
19908
|
shrinkToFit: style.wrapping === "clip" ? true : void 0
|
|
19853
19909
|
}
|
|
@@ -19888,7 +19944,7 @@ function normalizeStyle(construct, styles) {
|
|
|
19888
19944
|
function convertFormat(format, numFmtStructure) {
|
|
19889
19945
|
if (!format) return 0;
|
|
19890
19946
|
let formatId = XLSX_FORMAT_MAP[format.format];
|
|
19891
|
-
if (!formatId) formatId = pushElement(format, numFmtStructure) +
|
|
19947
|
+
if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
19892
19948
|
return formatId;
|
|
19893
19949
|
}
|
|
19894
19950
|
/**
|
|
@@ -20491,14 +20547,14 @@ function convertExcelTrendline(trend) {
|
|
|
20491
20547
|
type: trend.type === "linear" ? "polynomial" : EXCEL_TO_SPREADSHEET_TRENDLINE_TYPE_MAPPING[trend.type],
|
|
20492
20548
|
order: trend.type === "linear" ? 1 : trend.order,
|
|
20493
20549
|
color: trend.color,
|
|
20494
|
-
window: trend.window ||
|
|
20550
|
+
window: trend.window || DEFAULT_WINDOW_SIZE,
|
|
20495
20551
|
display: true
|
|
20496
20552
|
};
|
|
20497
20553
|
}
|
|
20498
20554
|
function convertAnchor(XLSXanchor) {
|
|
20499
20555
|
const offset = {
|
|
20500
|
-
x: convertEMUToDotValue(XLSXanchor.colOffset) -
|
|
20501
|
-
y: convertEMUToDotValue(XLSXanchor.rowOffset) -
|
|
20556
|
+
x: convertEMUToDotValue(XLSXanchor.colOffset) - FIGURE_BORDER_WIDTH,
|
|
20557
|
+
y: convertEMUToDotValue(XLSXanchor.rowOffset) - FIGURE_BORDER_WIDTH
|
|
20502
20558
|
};
|
|
20503
20559
|
return {
|
|
20504
20560
|
col: XLSXanchor.col,
|
|
@@ -20850,8 +20906,8 @@ function getSheetDims(sheet) {
|
|
|
20850
20906
|
dims[0] = Math.max(dims[0], fig.anchors[fig.anchors.length - 1]?.col ?? 0);
|
|
20851
20907
|
dims[1] = Math.max(dims[1], fig.anchors[fig.anchors.length - 1]?.row ?? 0);
|
|
20852
20908
|
}
|
|
20853
|
-
dims[0] = Math.max(dims[0] + 5,
|
|
20854
|
-
dims[1] = Math.max(dims[1] + 5,
|
|
20909
|
+
dims[0] = Math.max(dims[0] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
|
|
20910
|
+
dims[1] = Math.max(dims[1] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
|
|
20855
20911
|
return dims;
|
|
20856
20912
|
}
|
|
20857
20913
|
/**
|
|
@@ -22017,7 +22073,7 @@ var XlsxBaseExtractor = class {
|
|
|
22017
22073
|
rgb = this.getThemeColor(themeIndex, theme.clrScheme);
|
|
22018
22074
|
} else {
|
|
22019
22075
|
rgb = this.extractAttr(colorElement, "rgb")?.asString();
|
|
22020
|
-
rgb = rgb ===
|
|
22076
|
+
rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
|
|
22021
22077
|
}
|
|
22022
22078
|
return {
|
|
22023
22079
|
rgb: rgb || defaultColor,
|
|
@@ -23136,7 +23192,7 @@ function getPathsOfContent(contentType, xmls) {
|
|
|
23136
23192
|
* Get the corresponding relationship file for a given xml file in a XLSX directory.
|
|
23137
23193
|
*/
|
|
23138
23194
|
function getRelationFile(file, xmls) {
|
|
23139
|
-
if (file ===
|
|
23195
|
+
if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
|
|
23140
23196
|
let relsFile = "";
|
|
23141
23197
|
const pathParts = file.split("/");
|
|
23142
23198
|
for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
|
|
@@ -23246,7 +23302,7 @@ function normalizeV9(formula) {
|
|
|
23246
23302
|
if (token.type === "REFERENCE" && cellReference.test(token.value)) {
|
|
23247
23303
|
const value = token.value.trim();
|
|
23248
23304
|
if (!dependencies.includes(value)) dependencies.push(value);
|
|
23249
|
-
return `${
|
|
23305
|
+
return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
|
|
23250
23306
|
} else return token.value;
|
|
23251
23307
|
})),
|
|
23252
23308
|
dependencies
|
|
@@ -23442,7 +23498,7 @@ migrationStepRegistry.add("0.1", { migrate(data) {
|
|
|
23442
23498
|
if (cell.formula) {
|
|
23443
23499
|
let { text, dependencies } = cell.formula;
|
|
23444
23500
|
for (const [index, d] of Object.entries(dependencies)) {
|
|
23445
|
-
const stringPosition = `\\${
|
|
23501
|
+
const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
|
|
23446
23502
|
text = text.replace(new RegExp(stringPosition, "g"), d);
|
|
23447
23503
|
}
|
|
23448
23504
|
cell.content = text;
|
|
@@ -25232,12 +25288,12 @@ var ContentEditableHelper = class {
|
|
|
25232
25288
|
for (let current = it.next(); !current.done; current = it.next()) {
|
|
25233
25289
|
if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) {
|
|
25234
25290
|
if (isFirstParagraph) isFirstParagraph = false;
|
|
25235
|
-
else text +=
|
|
25291
|
+
else text += NEWLINE;
|
|
25236
25292
|
emptyParagraph = isEmptyParagraph(current.value);
|
|
25237
25293
|
continue;
|
|
25238
25294
|
}
|
|
25239
25295
|
if (!current.value.hasChildNodes()) {
|
|
25240
|
-
if (current.value.nodeName === "BR" && !emptyParagraph) text +=
|
|
25296
|
+
if (current.value.nodeName === "BR" && !emptyParagraph) text += NEWLINE;
|
|
25241
25297
|
text += current.value.textContent;
|
|
25242
25298
|
}
|
|
25243
25299
|
}
|
|
@@ -25471,7 +25527,7 @@ var Composer = class extends Component {
|
|
|
25471
25527
|
if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
|
|
25472
25528
|
} else {
|
|
25473
25529
|
assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
|
|
25474
|
-
if (composerRect.left + ASSISTANT_WIDTH +
|
|
25530
|
+
if (composerRect.left + ASSISTANT_WIDTH + SCROLLBAR_WIDTH + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
|
|
25475
25531
|
}
|
|
25476
25532
|
return assistantStyle;
|
|
25477
25533
|
}
|
|
@@ -25568,7 +25624,7 @@ var Composer = class extends Component {
|
|
|
25568
25624
|
const start = Math.min(selection.start, selection.end);
|
|
25569
25625
|
const end = Math.max(selection.start, selection.end);
|
|
25570
25626
|
this.props.composerStore.stopComposerRangeSelection();
|
|
25571
|
-
this.props.composerStore.setCurrentContent(content.slice(0, start) +
|
|
25627
|
+
this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
|
|
25572
25628
|
start: start + 1,
|
|
25573
25629
|
end: start + 1
|
|
25574
25630
|
});
|
|
@@ -25746,7 +25802,7 @@ var Composer = class extends Component {
|
|
|
25746
25802
|
const { end, start } = this.props.composerStore.composerSelection;
|
|
25747
25803
|
for (let index = 0; index < tokens.length; index++) {
|
|
25748
25804
|
const token = tokens[index];
|
|
25749
|
-
let color = token.color ||
|
|
25805
|
+
let color = token.color || DEFAULT_TOKEN_COLOR;
|
|
25750
25806
|
if (token.isBlurred) color = setColorAlpha(color, .5);
|
|
25751
25807
|
const classes = [];
|
|
25752
25808
|
if (token.type === "REFERENCE" && this.props.composerStore.tokenAtCursor === token && this.props.composerStore.editionMode === "selecting") classes.push("text-decoration-underline");
|
|
@@ -25777,8 +25833,8 @@ var Composer = class extends Component {
|
|
|
25777
25833
|
splitHtmlContentIntoLines(contents) {
|
|
25778
25834
|
const contentSplitInLines = [];
|
|
25779
25835
|
let currentLine = [];
|
|
25780
|
-
for (const content of contents) if (content.value.includes(
|
|
25781
|
-
const lines = content.value.split(
|
|
25836
|
+
for (const content of contents) if (content.value.includes(NEWLINE)) {
|
|
25837
|
+
const lines = content.value.split(NEWLINE);
|
|
25782
25838
|
const lastLine = lines.pop();
|
|
25783
25839
|
for (const line of lines) {
|
|
25784
25840
|
currentLine.push({
|
|
@@ -26125,7 +26181,7 @@ const autoCompleteProviders = new Registry();
|
|
|
26125
26181
|
function drawHighlight(renderingContext, highlight, rect) {
|
|
26126
26182
|
const { x, y, width, height } = rect;
|
|
26127
26183
|
if (width < 0 || height < 0) return;
|
|
26128
|
-
const color = highlight.color ||
|
|
26184
|
+
const color = highlight.color || HIGHLIGHT_COLOR;
|
|
26129
26185
|
const { ctx } = renderingContext;
|
|
26130
26186
|
ctx.save();
|
|
26131
26187
|
if (!highlight.noBorder) {
|
|
@@ -26694,11 +26750,11 @@ var AbstractComposerStore = class extends SpreadsheetStore {
|
|
|
26694
26750
|
getTokenColor(token) {
|
|
26695
26751
|
if (token.type === "REFERENCE") {
|
|
26696
26752
|
const { xc, sheetName } = splitReference(token.value);
|
|
26697
|
-
return this.rangeXCColor(xc, sheetName) ||
|
|
26753
|
+
return this.rangeXCColor(xc, sheetName) || DEFAULT_TOKEN_COLOR;
|
|
26698
26754
|
}
|
|
26699
26755
|
if (token.type === "SYMBOL") {
|
|
26700
26756
|
const namedRange = this.getters.getNamedRange(token.value);
|
|
26701
|
-
if (namedRange) return this.rangeColor(namedRange.range) ||
|
|
26757
|
+
if (namedRange) return this.rangeColor(namedRange.range) || DEFAULT_TOKEN_COLOR;
|
|
26702
26758
|
const upperCaseValue = token.value.toUpperCase();
|
|
26703
26759
|
if (upperCaseValue === "TRUE" || upperCaseValue === "FALSE") return tokenColors.NUMBER;
|
|
26704
26760
|
if (upperCaseValue in functionRegistry.content) return tokenColors.FUNCTION;
|
|
@@ -26706,7 +26762,7 @@ var AbstractComposerStore = class extends SpreadsheetStore {
|
|
|
26706
26762
|
if (["LEFT_PAREN", "RIGHT_PAREN"].includes(token.type)) {
|
|
26707
26763
|
if (token.parenthesesCode === "") return tokenColors.ORPHAN_RIGHT_PAREN;
|
|
26708
26764
|
}
|
|
26709
|
-
return tokenColors[token.type] ||
|
|
26765
|
+
return tokenColors[token.type] || DEFAULT_TOKEN_COLOR;
|
|
26710
26766
|
}
|
|
26711
26767
|
rangeXCColor(xc, sheetName) {
|
|
26712
26768
|
const refSheet = sheetName ? this.model.getters.getSheetIdByName(sheetName) : this.sheetId;
|
|
@@ -27385,7 +27441,7 @@ var ColorPicker = class extends Component {
|
|
|
27385
27441
|
}
|
|
27386
27442
|
get sliderStyle() {
|
|
27387
27443
|
const hue = this.state.currentHslaColor?.h || 0;
|
|
27388
|
-
return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) -
|
|
27444
|
+
return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - ICON_EDGE_LENGTH / 2}px` });
|
|
27389
27445
|
}
|
|
27390
27446
|
get pointerStyle() {
|
|
27391
27447
|
const { s, l } = this.state.currentHslaColor || {
|
|
@@ -29181,7 +29237,7 @@ var LinkDisplay = class extends Component {
|
|
|
29181
29237
|
col,
|
|
29182
29238
|
row
|
|
29183
29239
|
});
|
|
29184
|
-
const textColor = style?.textColor ===
|
|
29240
|
+
const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
|
|
29185
29241
|
this.env.model.dispatch("UPDATE_CELL", {
|
|
29186
29242
|
col,
|
|
29187
29243
|
row,
|
|
@@ -30191,8 +30247,8 @@ const CREATE_CHART = (env) => {
|
|
|
30191
30247
|
zones = getters.getSelectedZones();
|
|
30192
30248
|
}
|
|
30193
30249
|
const size = {
|
|
30194
|
-
width:
|
|
30195
|
-
height:
|
|
30250
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
30251
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
30196
30252
|
};
|
|
30197
30253
|
const { col, row, offset } = centerFigurePosition(getters, size);
|
|
30198
30254
|
if (env.model.dispatch("CREATE_CHART", {
|
|
@@ -30214,8 +30270,8 @@ const CREATE_CAROUSEL = (env) => {
|
|
|
30214
30270
|
const figureId = env.model.uuidGenerator.smallUuid();
|
|
30215
30271
|
const sheetId = getters.getActiveSheetId();
|
|
30216
30272
|
const size = {
|
|
30217
|
-
width:
|
|
30218
|
-
height:
|
|
30273
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
30274
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
30219
30275
|
};
|
|
30220
30276
|
const { col, row, offset } = centerFigurePosition(getters, size);
|
|
30221
30277
|
if (env.model.dispatch("CREATE_CAROUSEL", {
|
|
@@ -30265,7 +30321,7 @@ const REINSERT_STATIC_PIVOT_CHILDREN = (env) => env.model.getters.getPivotIds().
|
|
|
30265
30321
|
execute: (env) => {
|
|
30266
30322
|
const zone = env.model.getters.getSelectedZone();
|
|
30267
30323
|
const table = env.model.getters.getPivot(pivotId).getExpandedTableStructure();
|
|
30268
|
-
if (table.numberOfCells >
|
|
30324
|
+
if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
|
|
30269
30325
|
env.notifyUser({
|
|
30270
30326
|
type: "warning",
|
|
30271
30327
|
text: getPivotTooBigErrorMessage(table.numberOfCells, env.model.getters.getLocale()),
|
|
@@ -31008,6 +31064,11 @@ var NumberEditor = class extends Component {
|
|
|
31008
31064
|
rootEditorRef = useRef("NumberEditor");
|
|
31009
31065
|
valueListRef = useRef("numberList");
|
|
31010
31066
|
DOMFocusableElementStore;
|
|
31067
|
+
/**
|
|
31068
|
+
* Skips the change event triggered when moving focus out of the input.
|
|
31069
|
+
* The value has already been committed by `onInputKeydown`.
|
|
31070
|
+
*/
|
|
31071
|
+
skipNextInputChange = false;
|
|
31011
31072
|
setup() {
|
|
31012
31073
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
31013
31074
|
useExternalListener(window, "click", this.onExternalClick, { capture: true });
|
|
@@ -31044,11 +31105,14 @@ var NumberEditor = class extends Component {
|
|
|
31044
31105
|
this.dropdown.isOpen = false;
|
|
31045
31106
|
}
|
|
31046
31107
|
setValue(valueStr) {
|
|
31047
|
-
const value = clip(Math.
|
|
31108
|
+
const value = clip(Math.round(parseFloat(valueStr)), this.props.min, this.props.max);
|
|
31109
|
+
if (isNaN(value)) return;
|
|
31048
31110
|
this.props.onValueChange(value);
|
|
31049
31111
|
this.closeList();
|
|
31112
|
+
return value;
|
|
31050
31113
|
}
|
|
31051
31114
|
setValueFromInput(ev) {
|
|
31115
|
+
if (this.skipNextInputChange) return;
|
|
31052
31116
|
this.setValue(ev.target.value);
|
|
31053
31117
|
}
|
|
31054
31118
|
setValueFromList(valueStr) {
|
|
@@ -31062,19 +31126,26 @@ var NumberEditor = class extends Component {
|
|
|
31062
31126
|
ev.target.select();
|
|
31063
31127
|
}
|
|
31064
31128
|
onInputKeydown(ev) {
|
|
31065
|
-
|
|
31066
|
-
|
|
31067
|
-
|
|
31068
|
-
|
|
31069
|
-
|
|
31070
|
-
|
|
31071
|
-
|
|
31072
|
-
|
|
31073
|
-
|
|
31074
|
-
|
|
31075
|
-
|
|
31076
|
-
|
|
31129
|
+
const target = ev.target;
|
|
31130
|
+
switch (ev.key) {
|
|
31131
|
+
case "Enter":
|
|
31132
|
+
case "Tab": {
|
|
31133
|
+
ev.preventDefault();
|
|
31134
|
+
ev.stopPropagation();
|
|
31135
|
+
const value = this.setValue(target.value);
|
|
31136
|
+
if (value === void 0) return;
|
|
31137
|
+
target.value = `${value}`;
|
|
31138
|
+
break;
|
|
31139
|
+
}
|
|
31140
|
+
case "Escape":
|
|
31141
|
+
target.value = `${this.props.currentValue}`;
|
|
31142
|
+
this.closeList();
|
|
31143
|
+
break;
|
|
31144
|
+
default: return;
|
|
31077
31145
|
}
|
|
31146
|
+
this.skipNextInputChange = true;
|
|
31147
|
+
this.DOMFocusableElementStore.focus();
|
|
31148
|
+
this.skipNextInputChange = false;
|
|
31078
31149
|
}
|
|
31079
31150
|
};
|
|
31080
31151
|
|
|
@@ -31869,7 +31940,7 @@ var AxisDesignEditor = class extends Component {
|
|
|
31869
31940
|
axesList: Array
|
|
31870
31941
|
};
|
|
31871
31942
|
state = useState({ currentAxis: "x" });
|
|
31872
|
-
defaultFontSize =
|
|
31943
|
+
defaultFontSize = CHART_AXIS_TITLE_FONT_SIZE;
|
|
31873
31944
|
get axisTitleStyle() {
|
|
31874
31945
|
return this.props.definition.axesDesign?.[this.state.currentAxis]?.title ?? {};
|
|
31875
31946
|
}
|
|
@@ -32072,7 +32143,7 @@ var GeneralDesignEditor = class extends Component {
|
|
|
32072
32143
|
optional: true
|
|
32073
32144
|
}
|
|
32074
32145
|
};
|
|
32075
|
-
static defaultProps = { defaultChartTitleFontSize:
|
|
32146
|
+
static defaultProps = { defaultChartTitleFontSize: CHART_TITLE_FONT_SIZE };
|
|
32076
32147
|
state;
|
|
32077
32148
|
setup() {
|
|
32078
32149
|
this.state = useState({ activeTool: "" });
|
|
@@ -32342,11 +32413,11 @@ var SeriesWithAxisDesignEditor = class extends Component {
|
|
|
32342
32413
|
return Math.min(10, runtime.chartJsConfig.data.datasets[index].data.length - 1);
|
|
32343
32414
|
}
|
|
32344
32415
|
get defaultWindowSize() {
|
|
32345
|
-
return
|
|
32416
|
+
return DEFAULT_WINDOW_SIZE;
|
|
32346
32417
|
}
|
|
32347
32418
|
onChangeMovingAverageWindow(dataSetId, value) {
|
|
32348
|
-
let window = parseInt(value) ||
|
|
32349
|
-
if (window <= 1) window =
|
|
32419
|
+
let window = parseInt(value) || DEFAULT_WINDOW_SIZE;
|
|
32420
|
+
if (window <= 1) window = DEFAULT_WINDOW_SIZE;
|
|
32350
32421
|
this.updateTrendLineValue(dataSetId, { window });
|
|
32351
32422
|
}
|
|
32352
32423
|
getDataSeriesColor(dataSetId) {
|
|
@@ -33462,7 +33533,7 @@ var PieChartDesignPanel = class extends Component {
|
|
|
33462
33533
|
});
|
|
33463
33534
|
}
|
|
33464
33535
|
get defaultHoleSize() {
|
|
33465
|
-
return
|
|
33536
|
+
return DEFAULT_DOUGHNUT_CHART_HOLE_SIZE;
|
|
33466
33537
|
}
|
|
33467
33538
|
updateEditedValues(selectedIndex) {
|
|
33468
33539
|
this.state.index = parseInt(selectedIndex);
|
|
@@ -33632,7 +33703,7 @@ var ScorecardChartDesignPanel = class extends Component {
|
|
|
33632
33703
|
return this.props.definition.baselineMode === "progress" ? _t("Progress bar colors") : _t("Baseline colors");
|
|
33633
33704
|
}
|
|
33634
33705
|
get defaultScorecardTitleFontSize() {
|
|
33635
|
-
return
|
|
33706
|
+
return SCORECARD_CHART_TITLE_FONT_SIZE;
|
|
33636
33707
|
}
|
|
33637
33708
|
translate(term) {
|
|
33638
33709
|
return this.env.model.getters.dynamicTranslate(term);
|
|
@@ -33653,14 +33724,14 @@ var ScorecardChartDesignPanel = class extends Component {
|
|
|
33653
33724
|
get keyStyle() {
|
|
33654
33725
|
return {
|
|
33655
33726
|
align: "center",
|
|
33656
|
-
fontSize:
|
|
33727
|
+
fontSize: DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE,
|
|
33657
33728
|
...this.props.definition.keyDescr
|
|
33658
33729
|
};
|
|
33659
33730
|
}
|
|
33660
33731
|
get baselineStyle() {
|
|
33661
33732
|
return {
|
|
33662
33733
|
align: "center",
|
|
33663
|
-
fontSize:
|
|
33734
|
+
fontSize: DEFAULT_SCORECARD_BASELINE_FONT_SIZE,
|
|
33664
33735
|
...this.props.definition.baselineDescr
|
|
33665
33736
|
};
|
|
33666
33737
|
}
|
|
@@ -33900,13 +33971,13 @@ var WaterfallChartDesignPanel = class extends Component {
|
|
|
33900
33971
|
}];
|
|
33901
33972
|
}
|
|
33902
33973
|
get positiveValuesColor() {
|
|
33903
|
-
return this.props.definition.positiveValuesColor ||
|
|
33974
|
+
return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
33904
33975
|
}
|
|
33905
33976
|
get negativeValuesColor() {
|
|
33906
|
-
return this.props.definition.negativeValuesColor ||
|
|
33977
|
+
return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
33907
33978
|
}
|
|
33908
33979
|
get subTotalValuesColor() {
|
|
33909
|
-
return this.props.definition.subTotalValuesColor ||
|
|
33980
|
+
return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
33910
33981
|
}
|
|
33911
33982
|
updateVerticalAxisPosition(value) {
|
|
33912
33983
|
this.props.updateChart(this.props.chartId, { verticalAxisPosition: value });
|
|
@@ -35089,7 +35160,7 @@ var ConditionalFormattingEditorStore = class extends SpreadsheetStore {
|
|
|
35089
35160
|
get previewGradient() {
|
|
35090
35161
|
const rule = this.state.rules.colorScale;
|
|
35091
35162
|
const minColor = colorNumberToHex(rule.minimum.color);
|
|
35092
|
-
const midColor = colorNumberToHex(rule.midpoint?.color ||
|
|
35163
|
+
const midColor = colorNumberToHex(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
35093
35164
|
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
35094
35165
|
const baseString = "linear-gradient(to right, ";
|
|
35095
35166
|
return cssPropertiesToCss({
|
|
@@ -37188,7 +37259,7 @@ var PivotMeasureDisplayPanelStore = class extends SpreadsheetStore {
|
|
|
37188
37259
|
return {
|
|
37189
37260
|
type: measureDisplayType,
|
|
37190
37261
|
fieldNameWithGranularity,
|
|
37191
|
-
value: value ??
|
|
37262
|
+
value: value ?? PREVIOUS_VALUE
|
|
37192
37263
|
};
|
|
37193
37264
|
}
|
|
37194
37265
|
}
|
|
@@ -38224,6 +38295,117 @@ var SpreadsheetPivotRuntimeDefinition = class extends PivotRuntimeDefinition {
|
|
|
38224
38295
|
}
|
|
38225
38296
|
};
|
|
38226
38297
|
|
|
38298
|
+
//#endregion
|
|
38299
|
+
//#region src/helpers/pivot/spreadsheet_pivot/data_entries_index_spreadsheet_pivot.ts
|
|
38300
|
+
const EMPTY_DATA_ENTRIES = [];
|
|
38301
|
+
/**
|
|
38302
|
+
* Index of the data entries of a spreadsheet pivot, used to retrieve the
|
|
38303
|
+
* entries matching a pivot domain without scanning all the entries.
|
|
38304
|
+
*
|
|
38305
|
+
* Starting with the row dimensions, one can descend either in the
|
|
38306
|
+
* next row dimension (`rowChildren`) or in the first column dimension
|
|
38307
|
+
* (`colChildren`).
|
|
38308
|
+
*
|
|
38309
|
+
* e.g. with the rows ["continent", "city"] and the columns ["team"]
|
|
38310
|
+
*
|
|
38311
|
+
* root -> all the entries
|
|
38312
|
+
* ├── (col) Team 1 -> [team=Team 1]
|
|
38313
|
+
* ├── (col) Team 2 -> [team=Team 2]
|
|
38314
|
+
* ├── (row) Europe -> [continent=Europe]
|
|
38315
|
+
* │ ├── (col) Team 1 -> [continent=Europe, team=Team 1]
|
|
38316
|
+
* │ ├── (row) Brussels -> [continent=Europe, city=Brussels]
|
|
38317
|
+
* │ │ └── (col) Team 1 -> [continent=Europe, city=Brussels, team=Team 1]
|
|
38318
|
+
* │ └── (row) Paris
|
|
38319
|
+
* │ └── ...
|
|
38320
|
+
* └── (row) North America
|
|
38321
|
+
* └── ...
|
|
38322
|
+
*
|
|
38323
|
+
* Each entry is inserted once per couple (row prefix, column prefix) it belongs
|
|
38324
|
+
* to, which is exactly the number of pivot cells it contributes to.
|
|
38325
|
+
*/
|
|
38326
|
+
var PivotDataEntriesIndex = class {
|
|
38327
|
+
rowDimensions;
|
|
38328
|
+
colDimensions;
|
|
38329
|
+
root = createIndexNode();
|
|
38330
|
+
constructor(dataEntries, rowDimensions, colDimensions) {
|
|
38331
|
+
this.rowDimensions = rowDimensions;
|
|
38332
|
+
this.colDimensions = colDimensions;
|
|
38333
|
+
for (const entry of dataEntries) this.addEntry(entry);
|
|
38334
|
+
}
|
|
38335
|
+
/**
|
|
38336
|
+
* Get the data entries matching the given domain.
|
|
38337
|
+
*/
|
|
38338
|
+
getDataEntries(domain) {
|
|
38339
|
+
const rowKeys = [];
|
|
38340
|
+
const colKeys = [];
|
|
38341
|
+
for (const domainNode of domain) {
|
|
38342
|
+
const rowDimension = this.rowDimensions[rowKeys.length];
|
|
38343
|
+
if (rowDimension?.nameWithGranularity === domainNode.field) {
|
|
38344
|
+
rowKeys.push(toGroupKey(domainNode.value, rowDimension));
|
|
38345
|
+
continue;
|
|
38346
|
+
}
|
|
38347
|
+
const colDimension = this.colDimensions[colKeys.length];
|
|
38348
|
+
if (colDimension?.nameWithGranularity !== domainNode.field) throw new EvaluationError(_t("Dimension %s does not exist", domainNode.field));
|
|
38349
|
+
colKeys.push(toGroupKey(domainNode.value, colDimension));
|
|
38350
|
+
}
|
|
38351
|
+
let node = this.root;
|
|
38352
|
+
for (const key of rowKeys) {
|
|
38353
|
+
node = node.rowChildren?.get(key);
|
|
38354
|
+
if (!node) return EMPTY_DATA_ENTRIES;
|
|
38355
|
+
}
|
|
38356
|
+
for (const key of colKeys) {
|
|
38357
|
+
node = node.colChildren?.get(key);
|
|
38358
|
+
if (!node) return EMPTY_DATA_ENTRIES;
|
|
38359
|
+
}
|
|
38360
|
+
return node.entries;
|
|
38361
|
+
}
|
|
38362
|
+
addEntry(entry) {
|
|
38363
|
+
let rowNode = this.root;
|
|
38364
|
+
this.addEntryToColumns(rowNode, entry);
|
|
38365
|
+
for (const dimension of this.rowDimensions) {
|
|
38366
|
+
rowNode = getOrCreateChild(rowNode, "rowChildren", getEntryGroupKey(entry, dimension));
|
|
38367
|
+
this.addEntryToColumns(rowNode, entry);
|
|
38368
|
+
}
|
|
38369
|
+
}
|
|
38370
|
+
/**
|
|
38371
|
+
* Add the entry to the given row node, and to each of its column prefixes.
|
|
38372
|
+
*/
|
|
38373
|
+
addEntryToColumns(rowNode, entry) {
|
|
38374
|
+
rowNode.entries.push(entry);
|
|
38375
|
+
let node = rowNode;
|
|
38376
|
+
for (const dimension of this.colDimensions) {
|
|
38377
|
+
node = getOrCreateChild(node, "colChildren", getEntryGroupKey(entry, dimension));
|
|
38378
|
+
node.entries.push(entry);
|
|
38379
|
+
}
|
|
38380
|
+
}
|
|
38381
|
+
};
|
|
38382
|
+
function createIndexNode() {
|
|
38383
|
+
return {
|
|
38384
|
+
entries: [],
|
|
38385
|
+
rowChildren: void 0,
|
|
38386
|
+
colChildren: void 0
|
|
38387
|
+
};
|
|
38388
|
+
}
|
|
38389
|
+
function getOrCreateChild(node, axis, key) {
|
|
38390
|
+
let children = node[axis];
|
|
38391
|
+
if (!children) {
|
|
38392
|
+
children = /* @__PURE__ */ new Map();
|
|
38393
|
+
node[axis] = children;
|
|
38394
|
+
}
|
|
38395
|
+
let child = children.get(key);
|
|
38396
|
+
if (!child) {
|
|
38397
|
+
child = createIndexNode();
|
|
38398
|
+
children.set(key, child);
|
|
38399
|
+
}
|
|
38400
|
+
return child;
|
|
38401
|
+
}
|
|
38402
|
+
function getEntryGroupKey(entry, dimension) {
|
|
38403
|
+
return toGroupKey(entry[dimension.nameWithGranularity]?.value, dimension);
|
|
38404
|
+
}
|
|
38405
|
+
function toGroupKey(value, dimension) {
|
|
38406
|
+
return dimension.type === "char" ? String(value) : value;
|
|
38407
|
+
}
|
|
38408
|
+
|
|
38227
38409
|
//#endregion
|
|
38228
38410
|
//#region src/helpers/pivot/pivot_domain_helpers.ts
|
|
38229
38411
|
function getDomainOfParentRow(pivot, domain) {
|
|
@@ -38329,7 +38511,7 @@ function getPreviousOrNextValueDomain(pivot, domain, fieldNameWithGranularity, d
|
|
|
38329
38511
|
if (value === void 0) return;
|
|
38330
38512
|
const valueIndex = values.indexOf(value);
|
|
38331
38513
|
if (value === void 0 || valueIndex === -1) return;
|
|
38332
|
-
return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction ===
|
|
38514
|
+
return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === PREVIOUS_VALUE ? -1 : 1), 0, values.length - 1)]);
|
|
38333
38515
|
}
|
|
38334
38516
|
function domainToString(domain) {
|
|
38335
38517
|
return domain ? domain.map(domainNodeToString).join(", ") : "";
|
|
@@ -38980,6 +39162,11 @@ var SpreadsheetPivot = class {
|
|
|
38980
39162
|
*/
|
|
38981
39163
|
dataEntries = [];
|
|
38982
39164
|
/**
|
|
39165
|
+
* This index is used to retrieve the data entries matching a pivot domain
|
|
39166
|
+
* without scanning all the data entries.
|
|
39167
|
+
*/
|
|
39168
|
+
dataEntriesIndex = lazy(() => new PivotDataEntriesIndex([], [], []));
|
|
39169
|
+
/**
|
|
38983
39170
|
* This object contains the pivot table structure. It is created from the
|
|
38984
39171
|
* data entries and the pivot definition.
|
|
38985
39172
|
*/
|
|
@@ -39011,6 +39198,7 @@ var SpreadsheetPivot = class {
|
|
|
39011
39198
|
if (type >= 3) this._definition = this.loadRuntimeDefinition();
|
|
39012
39199
|
if (type >= 2) this.dataEntries = this.loadData();
|
|
39013
39200
|
if (type >= 1) {
|
|
39201
|
+
this.dataEntriesIndex = lazy(() => new PivotDataEntriesIndex(this.dataEntries, this.definition.rows, this.definition.columns));
|
|
39014
39202
|
this.collapsedTable = void 0;
|
|
39015
39203
|
this.expandedTable = void 0;
|
|
39016
39204
|
}
|
|
@@ -39087,14 +39275,14 @@ var SpreadsheetPivot = class {
|
|
|
39087
39275
|
const lastNode = domain.at(-1);
|
|
39088
39276
|
if (!lastNode) return { value: _t("Total") };
|
|
39089
39277
|
const dimension = this.getDimension(lastNode.field);
|
|
39090
|
-
const finalCell = this.filterDataEntriesFromDomain(this.dataEntries, domain)[0]?.[dimension.nameWithGranularity];
|
|
39091
39278
|
if (dimension.type === "datetime") return pivotTimeAdapter(dimension.granularity || "month").toValueAndFormat(lastNode.value, this.getters.getLocale());
|
|
39279
|
+
const finalCell = this.getDataEntriesFromDomain(domain)[0]?.[dimension.nameWithGranularity];
|
|
39092
39280
|
if (!finalCell) return { value: "" };
|
|
39093
39281
|
if (finalCell.value === null) return { value: _t("(Undefined)") };
|
|
39094
39282
|
return finalCell;
|
|
39095
39283
|
}
|
|
39096
39284
|
getPivotCellValueAndFormat(measureId, domain) {
|
|
39097
|
-
const dataEntries = this.
|
|
39285
|
+
const dataEntries = this.getDataEntriesFromDomain(domain);
|
|
39098
39286
|
if (dataEntries.length === 0) return { value: "" };
|
|
39099
39287
|
const measure = this.getMeasure(measureId);
|
|
39100
39288
|
const allValues = dataEntries.map((value) => value[measure.fieldName]).filter(isDefined);
|
|
@@ -39184,17 +39372,8 @@ var SpreadsheetPivot = class {
|
|
|
39184
39372
|
if (!type) throw new Error(`Field ${fieldName} does not exist`);
|
|
39185
39373
|
return type;
|
|
39186
39374
|
}
|
|
39187
|
-
|
|
39188
|
-
return
|
|
39189
|
-
}
|
|
39190
|
-
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
39191
|
-
const { field, value, type } = domain;
|
|
39192
|
-
const { nameWithGranularity } = this.getDimension(field);
|
|
39193
|
-
return dataEntries.filter((entry) => {
|
|
39194
|
-
const cellValue = entry[nameWithGranularity]?.value;
|
|
39195
|
-
if (type === "char") return String(cellValue) === String(value);
|
|
39196
|
-
return cellValue === value;
|
|
39197
|
-
});
|
|
39375
|
+
getDataEntriesFromDomain(domain) {
|
|
39376
|
+
return this.dataEntriesIndex().getDataEntries(domain);
|
|
39198
39377
|
}
|
|
39199
39378
|
getDimension(nameWithGranularity) {
|
|
39200
39379
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -39576,7 +39755,7 @@ var PivotSidePanelStore = class extends SpreadsheetStore {
|
|
|
39576
39755
|
}
|
|
39577
39756
|
const pivot = this.getters.getPivot(this.pivotId);
|
|
39578
39757
|
const numberOfCells = pivot.isValid() ? pivot.getExpandedTableStructure().numberOfCells : 0;
|
|
39579
|
-
if (!this.alreadyNotifiedForPivotSize && numberOfCells >
|
|
39758
|
+
if (!this.alreadyNotifiedForPivotSize && numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
|
|
39580
39759
|
this.alreadyNotifiedForPivotSize = true;
|
|
39581
39760
|
this.notification.notifyUser({
|
|
39582
39761
|
type: "warning",
|
|
@@ -41426,7 +41605,7 @@ const SEPARATORS = [
|
|
|
41426
41605
|
},
|
|
41427
41606
|
{
|
|
41428
41607
|
label: _t("Line Break"),
|
|
41429
|
-
value:
|
|
41608
|
+
value: NEWLINE
|
|
41430
41609
|
}
|
|
41431
41610
|
];
|
|
41432
41611
|
var SplitIntoColumnsPanel = class extends Component {
|
|
@@ -41971,7 +42150,7 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
41971
42150
|
const newPanelInfo = {
|
|
41972
42151
|
currentPanelProps,
|
|
41973
42152
|
componentTag,
|
|
41974
|
-
size:
|
|
42153
|
+
size: DEFAULT_SIDE_PANEL_SIZE
|
|
41975
42154
|
};
|
|
41976
42155
|
const state = this.computeState(newPanelInfo);
|
|
41977
42156
|
if (!state.isOpen) return;
|
|
@@ -41979,8 +42158,8 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
41979
42158
|
this._openPanel("mainPanel", newPanelInfo, state);
|
|
41980
42159
|
return;
|
|
41981
42160
|
}
|
|
41982
|
-
const nonCollapsedPanelSize = this.mainPanel.isCollapsed ?
|
|
41983
|
-
if (!this.secondaryPanel && nonCollapsedPanelSize +
|
|
42161
|
+
const nonCollapsedPanelSize = this.mainPanel.isCollapsed ? DEFAULT_SIDE_PANEL_SIZE : this.mainPanel.size;
|
|
42162
|
+
if (!this.secondaryPanel && nonCollapsedPanelSize + DEFAULT_SIDE_PANEL_SIZE > this.availableWidth) {
|
|
41984
42163
|
this.get(NotificationStore).notifyUser({
|
|
41985
42164
|
sticky: false,
|
|
41986
42165
|
type: "warning",
|
|
@@ -41994,7 +42173,7 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
41994
42173
|
const newPanelInfo = {
|
|
41995
42174
|
currentPanelProps,
|
|
41996
42175
|
componentTag,
|
|
41997
|
-
size:
|
|
42176
|
+
size: DEFAULT_SIDE_PANEL_SIZE
|
|
41998
42177
|
};
|
|
41999
42178
|
const state = this.computeState(newPanelInfo);
|
|
42000
42179
|
if (!state.isOpen) return;
|
|
@@ -42023,7 +42202,7 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
42023
42202
|
this[panel] = {
|
|
42024
42203
|
currentPanelProps: state.props ?? {},
|
|
42025
42204
|
componentTag: newPanel.componentTag,
|
|
42026
|
-
size: currentPanel?.size ||
|
|
42205
|
+
size: currentPanel?.size || DEFAULT_SIDE_PANEL_SIZE,
|
|
42027
42206
|
isCollapsed: currentPanel?.isCollapsed || false,
|
|
42028
42207
|
isPinned: currentPanel && "isPinned" in currentPanel ? currentPanel.isPinned : false
|
|
42029
42208
|
};
|
|
@@ -42053,19 +42232,19 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
42053
42232
|
changePanelSize(panel, size) {
|
|
42054
42233
|
const panelInfo = this[panel];
|
|
42055
42234
|
if (!panelInfo || "isCollapsed" in panelInfo && panelInfo.isCollapsed) return;
|
|
42056
|
-
size = Math.max(size,
|
|
42235
|
+
size = Math.max(size, DEFAULT_SIDE_PANEL_SIZE);
|
|
42057
42236
|
let otherPanelSize = panel === "mainPanel" ? this.secondaryPanel?.size || 0 : this.mainPanel?.size || 0;
|
|
42058
42237
|
if (size > this.availableWidth - otherPanelSize) {
|
|
42059
42238
|
if (panel === "mainPanel" && this.secondaryPanel) {
|
|
42060
|
-
this.secondaryPanel.size = Math.max(this.availableWidth - size,
|
|
42239
|
+
this.secondaryPanel.size = Math.max(this.availableWidth - size, DEFAULT_SIDE_PANEL_SIZE);
|
|
42061
42240
|
otherPanelSize = this.secondaryPanel.size;
|
|
42062
42241
|
}
|
|
42063
|
-
size = Math.max(this.availableWidth - otherPanelSize,
|
|
42242
|
+
size = Math.max(this.availableWidth - otherPanelSize, DEFAULT_SIDE_PANEL_SIZE);
|
|
42064
42243
|
}
|
|
42065
42244
|
panelInfo.size = size;
|
|
42066
42245
|
}
|
|
42067
42246
|
resetPanelSize(panel) {
|
|
42068
|
-
if (this[panel]) this[panel].size =
|
|
42247
|
+
if (this[panel]) this[panel].size = DEFAULT_SIDE_PANEL_SIZE;
|
|
42069
42248
|
}
|
|
42070
42249
|
togglePinPanel() {
|
|
42071
42250
|
if (!this.mainPanel) return;
|
|
@@ -42081,10 +42260,10 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
42081
42260
|
if (!panelInfo) return;
|
|
42082
42261
|
if (panelInfo.isCollapsed) {
|
|
42083
42262
|
panelInfo.isCollapsed = false;
|
|
42084
|
-
this.changePanelSize(panel,
|
|
42263
|
+
this.changePanelSize(panel, DEFAULT_SIDE_PANEL_SIZE);
|
|
42085
42264
|
} else {
|
|
42086
42265
|
panelInfo.isCollapsed = true;
|
|
42087
|
-
panelInfo.size =
|
|
42266
|
+
panelInfo.size = COLLAPSED_SIDE_PANEL_SIZE;
|
|
42088
42267
|
}
|
|
42089
42268
|
}
|
|
42090
42269
|
computeState({ componentTag, currentPanelProps: initialPanelProps }) {
|
|
@@ -42099,12 +42278,12 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
42099
42278
|
} : state;
|
|
42100
42279
|
}
|
|
42101
42280
|
changeSpreadsheetWidth(width) {
|
|
42102
|
-
this.availableWidth = width -
|
|
42103
|
-
if (this.secondaryPanel && width - this.totalPanelSize <
|
|
42281
|
+
this.availableWidth = width - MIN_SHEET_VIEW_WIDTH;
|
|
42282
|
+
if (this.secondaryPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) {
|
|
42104
42283
|
this.secondaryPanel?.currentPanelProps.onCloseSidePanel?.();
|
|
42105
42284
|
this.secondaryPanel = void 0;
|
|
42106
42285
|
}
|
|
42107
|
-
if (this.mainPanel && width - this.totalPanelSize <
|
|
42286
|
+
if (this.mainPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) this.mainPanel.size = Math.max(width - MIN_SHEET_VIEW_WIDTH, DEFAULT_SIDE_PANEL_SIZE);
|
|
42108
42287
|
}
|
|
42109
42288
|
};
|
|
42110
42289
|
|
|
@@ -43799,7 +43978,7 @@ function useDragAndDropBeyondTheViewport(env) {
|
|
|
43799
43978
|
let { scrollX, scrollY } = getters.getActiveSheetScrollInfo();
|
|
43800
43979
|
const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
|
|
43801
43980
|
let canEdgeScroll = false;
|
|
43802
|
-
let timeoutDelay =
|
|
43981
|
+
let timeoutDelay = MAX_DELAY;
|
|
43803
43982
|
const x = zoomedMouseEvent.clientX - position.x;
|
|
43804
43983
|
let colIndex = getters.getColIndex(x);
|
|
43805
43984
|
if (scrollDirection !== "vertical") {
|
|
@@ -44195,7 +44374,7 @@ function fits(width, linkedString) {
|
|
|
44195
44374
|
return true;
|
|
44196
44375
|
}
|
|
44197
44376
|
function astToDoc(ast) {
|
|
44198
|
-
const debugPrefix = ast.debug ? `${
|
|
44377
|
+
const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
|
|
44199
44378
|
switch (ast.type) {
|
|
44200
44379
|
case "NUMBER": return debugPrefix + String(ast.value);
|
|
44201
44380
|
case "STRING": return debugPrefix + `"${ast.value}"`;
|
|
@@ -44274,7 +44453,7 @@ function wrapInBraces(doc) {
|
|
|
44274
44453
|
* Converts an ast formula to the corresponding string
|
|
44275
44454
|
*/
|
|
44276
44455
|
function astToFormula(ast) {
|
|
44277
|
-
const debugPrefix = ast.debug ? `${
|
|
44456
|
+
const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
|
|
44278
44457
|
switch (ast.type) {
|
|
44279
44458
|
case "FUNCALL":
|
|
44280
44459
|
const args = ast.args.map((arg) => astToFormula(arg));
|
|
@@ -44958,19 +45137,19 @@ function getAxis(getters, figureUI, dnd, axisType) {
|
|
|
44958
45137
|
position = y;
|
|
44959
45138
|
break;
|
|
44960
45139
|
case "bottom":
|
|
44961
|
-
position = y + figureUI.height -
|
|
45140
|
+
position = y + figureUI.height - FIGURE_BORDER_WIDTH;
|
|
44962
45141
|
break;
|
|
44963
45142
|
case "vCenter":
|
|
44964
|
-
position = y + Math.floor(figureUI.height / 2) -
|
|
45143
|
+
position = y + Math.floor(figureUI.height / 2) - FIGURE_BORDER_WIDTH;
|
|
44965
45144
|
break;
|
|
44966
45145
|
case "left":
|
|
44967
45146
|
position = x;
|
|
44968
45147
|
break;
|
|
44969
45148
|
case "right":
|
|
44970
|
-
position = x + figureUI.width -
|
|
45149
|
+
position = x + figureUI.width - FIGURE_BORDER_WIDTH;
|
|
44971
45150
|
break;
|
|
44972
45151
|
case "hCenter":
|
|
44973
|
-
position = x + Math.floor(figureUI.width / 2) -
|
|
45152
|
+
position = x + Math.floor(figureUI.width / 2) - FIGURE_BORDER_WIDTH;
|
|
44974
45153
|
break;
|
|
44975
45154
|
}
|
|
44976
45155
|
return {
|
|
@@ -45182,7 +45361,7 @@ var FiguresContainer = class extends Component {
|
|
|
45182
45361
|
};
|
|
45183
45362
|
const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
|
|
45184
45363
|
const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
|
|
45185
|
-
if (!hasStartedDnd && offsetX <
|
|
45364
|
+
if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) return;
|
|
45186
45365
|
hasStartedDnd = true;
|
|
45187
45366
|
const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
|
|
45188
45367
|
const otherFigures = this.getOtherFigures(initialFigure.id);
|
|
@@ -45234,7 +45413,7 @@ var FiguresContainer = class extends Component {
|
|
|
45234
45413
|
ev.stopPropagation();
|
|
45235
45414
|
const initialScrollPosition = this.env.model.getters.getActiveSheetScrollInfo();
|
|
45236
45415
|
const keepRatio = figureRegistry.get(figureUI.tag).keepRatio || false;
|
|
45237
|
-
const minFigSize = figureRegistry.get(figureUI.tag).minFigSize ||
|
|
45416
|
+
const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || MIN_FIG_SIZE;
|
|
45238
45417
|
const zoom = this.env.model.getters.getViewportZoomLevel();
|
|
45239
45418
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
45240
45419
|
const initialMousePosition = {
|
|
@@ -45803,7 +45982,7 @@ var GridOverlay = class extends Component {
|
|
|
45803
45982
|
get isFooterVisible() {
|
|
45804
45983
|
const { y } = this.env.model.getters.getMainViewportCoordinates();
|
|
45805
45984
|
const { height } = this.env.model.getters.getSheetViewDimension();
|
|
45806
|
-
return !this.env.model.getters.isReadonly() && height - y >
|
|
45985
|
+
return !this.env.model.getters.isReadonly() && height - y > FOOTER_HEIGHT;
|
|
45807
45986
|
}
|
|
45808
45987
|
};
|
|
45809
45988
|
|
|
@@ -45858,7 +46037,7 @@ var UnhideRowHeaders = class extends Component {
|
|
|
45858
46037
|
row: hiddenIndex
|
|
45859
46038
|
}));
|
|
45860
46039
|
return cssPropertiesToCss({
|
|
45861
|
-
top: rect.y + rect.height -
|
|
46040
|
+
top: rect.y + rect.height - HEADER_HEIGHT - this.props.offset + "px",
|
|
45862
46041
|
"margin-right": "1px"
|
|
45863
46042
|
});
|
|
45864
46043
|
}
|
|
@@ -45867,7 +46046,7 @@ var UnhideRowHeaders = class extends Component {
|
|
|
45867
46046
|
top: this.env.model.getters.getRect(positionToZone({
|
|
45868
46047
|
col: 0,
|
|
45869
46048
|
row: hiddenIndex
|
|
45870
|
-
})).y -
|
|
46049
|
+
})).y - HEADER_HEIGHT - this.props.offset + "px",
|
|
45871
46050
|
"margin-right": "1px"
|
|
45872
46051
|
});
|
|
45873
46052
|
}
|
|
@@ -45901,13 +46080,13 @@ var UnhideColumnHeaders = class extends Component {
|
|
|
45901
46080
|
col: hiddenIndex,
|
|
45902
46081
|
row: 0
|
|
45903
46082
|
}));
|
|
45904
|
-
return cssPropertiesToCss({ left: rect.x + rect.width -
|
|
46083
|
+
return cssPropertiesToCss({ left: rect.x + rect.width - HEADER_WIDTH - this.props.offset + "px" });
|
|
45905
46084
|
}
|
|
45906
46085
|
getUnhideNextButtonStyle(hiddenIndex) {
|
|
45907
46086
|
return cssPropertiesToCss({ left: this.env.model.getters.getRect(positionToZone({
|
|
45908
46087
|
col: hiddenIndex,
|
|
45909
46088
|
row: 0
|
|
45910
|
-
})).x -
|
|
46089
|
+
})).x - HEADER_WIDTH - this.props.offset + "px" });
|
|
45911
46090
|
}
|
|
45912
46091
|
unhide(hiddenElements) {
|
|
45913
46092
|
this.env.model.dispatch("UNHIDE_COLUMNS_ROWS", {
|
|
@@ -46131,7 +46310,7 @@ var ColResizer = class extends AbstractResizer {
|
|
|
46131
46310
|
this.colResizerRef = useRef("colResizer");
|
|
46132
46311
|
this.PADDING = 15;
|
|
46133
46312
|
this.MAX_SIZE_MARGIN = 90;
|
|
46134
|
-
this.MIN_ELEMENT_SIZE =
|
|
46313
|
+
this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
|
|
46135
46314
|
}
|
|
46136
46315
|
get sheetId() {
|
|
46137
46316
|
return this.env.model.getters.getActiveSheetId();
|
|
@@ -46266,7 +46445,7 @@ var RowResizer = class extends AbstractResizer {
|
|
|
46266
46445
|
this.rowResizerRef = useRef("rowResizer");
|
|
46267
46446
|
this.PADDING = 5;
|
|
46268
46447
|
this.MAX_SIZE_MARGIN = 60;
|
|
46269
|
-
this.MIN_ELEMENT_SIZE =
|
|
46448
|
+
this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
|
|
46270
46449
|
}
|
|
46271
46450
|
rowResizerRef;
|
|
46272
46451
|
get sheetId() {
|
|
@@ -46699,7 +46878,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
46699
46878
|
x,
|
|
46700
46879
|
y
|
|
46701
46880
|
}, style.underline, style.strikethrough);
|
|
46702
|
-
y +=
|
|
46881
|
+
y += MIN_CELL_TEXT_MARGIN + box.content.fontSizePx;
|
|
46703
46882
|
}
|
|
46704
46883
|
if (style.rotation) ctx.restore();
|
|
46705
46884
|
if (box.clipRect) ctx.restore();
|
|
@@ -46746,7 +46925,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
46746
46925
|
const numberOfRows = this.getters.getNumberRows(sheetId);
|
|
46747
46926
|
const activeCols = renderingContext.activeCols;
|
|
46748
46927
|
const activeRows = renderingContext.activeRows;
|
|
46749
|
-
ctx.font = `400 ${
|
|
46928
|
+
ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
46750
46929
|
ctx.textAlign = "center";
|
|
46751
46930
|
ctx.textBaseline = "middle";
|
|
46752
46931
|
ctx.lineWidth = thinLineWidth;
|
|
@@ -46764,7 +46943,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
46764
46943
|
if (isColActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
46765
46944
|
else if (isColSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
46766
46945
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
46767
|
-
ctx.fillRect(x, 0, width,
|
|
46946
|
+
ctx.fillRect(x, 0, width, HEADER_HEIGHT);
|
|
46768
46947
|
}
|
|
46769
46948
|
for (const row of visibleRows) {
|
|
46770
46949
|
const rowZone = {
|
|
@@ -46779,13 +46958,13 @@ var GridRenderer = class extends DisposableStore {
|
|
|
46779
46958
|
if (isRowActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
46780
46959
|
else if (isRowSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
46781
46960
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
46782
|
-
ctx.fillRect(0, y,
|
|
46961
|
+
ctx.fillRect(0, y, HEADER_WIDTH, height);
|
|
46783
46962
|
}
|
|
46784
46963
|
ctx.beginPath();
|
|
46785
|
-
ctx.moveTo(
|
|
46786
|
-
ctx.lineTo(
|
|
46787
|
-
ctx.moveTo(0,
|
|
46788
|
-
ctx.lineTo(width,
|
|
46964
|
+
ctx.moveTo(HEADER_WIDTH, 0);
|
|
46965
|
+
ctx.lineTo(HEADER_WIDTH, height);
|
|
46966
|
+
ctx.moveTo(0, HEADER_HEIGHT);
|
|
46967
|
+
ctx.lineTo(width, HEADER_HEIGHT);
|
|
46789
46968
|
ctx.strokeStyle = HEADER_BORDER_COLOR;
|
|
46790
46969
|
ctx.stroke();
|
|
46791
46970
|
for (const col of visibleCols) {
|
|
@@ -46801,13 +46980,13 @@ var GridRenderer = class extends DisposableStore {
|
|
|
46801
46980
|
const { x, width } = viewports.getVisibleRect(sheetId, zone);
|
|
46802
46981
|
ctx.save();
|
|
46803
46982
|
ctx.beginPath();
|
|
46804
|
-
ctx.rect(x, 0, width,
|
|
46983
|
+
ctx.rect(x, 0, width, HEADER_HEIGHT);
|
|
46805
46984
|
ctx.clip();
|
|
46806
|
-
ctx.fillText(colName, colStart + colSize / 2,
|
|
46985
|
+
ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
|
|
46807
46986
|
ctx.restore();
|
|
46808
46987
|
ctx.beginPath();
|
|
46809
46988
|
ctx.moveTo(colStart + colSize, 0);
|
|
46810
|
-
ctx.lineTo(colStart + colSize,
|
|
46989
|
+
ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
|
|
46811
46990
|
ctx.stroke();
|
|
46812
46991
|
}
|
|
46813
46992
|
for (const row of visibleRows) {
|
|
@@ -46822,13 +47001,13 @@ var GridRenderer = class extends DisposableStore {
|
|
|
46822
47001
|
const { y, height } = viewports.getVisibleRect(sheetId, zone);
|
|
46823
47002
|
ctx.save();
|
|
46824
47003
|
ctx.beginPath();
|
|
46825
|
-
ctx.rect(0, y,
|
|
47004
|
+
ctx.rect(0, y, HEADER_WIDTH, height);
|
|
46826
47005
|
ctx.clip();
|
|
46827
|
-
ctx.fillText(String(row + 1),
|
|
47006
|
+
ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
|
|
46828
47007
|
ctx.restore();
|
|
46829
47008
|
ctx.beginPath();
|
|
46830
47009
|
ctx.moveTo(0, rowStart + rowSize);
|
|
46831
|
-
ctx.lineTo(
|
|
47010
|
+
ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
|
|
46832
47011
|
ctx.stroke();
|
|
46833
47012
|
}
|
|
46834
47013
|
}
|
|
@@ -46970,7 +47149,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
46970
47149
|
/** Content */
|
|
46971
47150
|
const wrapping = style.wrapping || "overflow";
|
|
46972
47151
|
const wrapText = wrapping === "wrap" && !showFormula;
|
|
46973
|
-
const availableWidth = width - 2 *
|
|
47152
|
+
const availableWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
|
|
46974
47153
|
const maxWidth = style.align ? 0 : availableWidth;
|
|
46975
47154
|
const wrapWidth = wrapText ? availableWidth : void 0;
|
|
46976
47155
|
const multiLineText = this.getters.getCellMultiLineText(position, {
|
|
@@ -46982,18 +47161,18 @@ var GridRenderer = class extends DisposableStore {
|
|
|
46982
47161
|
align: "left",
|
|
46983
47162
|
rotation: 0
|
|
46984
47163
|
};
|
|
46985
|
-
const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) +
|
|
47164
|
+
const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) + MIN_CELL_TEXT_MARGIN;
|
|
46986
47165
|
const contentSize = this.getters.getMultilineTextSize(multiLineText, style);
|
|
46987
|
-
const chipMargin = chipStyle ?
|
|
47166
|
+
const chipMargin = chipStyle ? DATA_VALIDATION_CHIP_MARGIN : 0;
|
|
46988
47167
|
const leftMargin = (box.icons.left ? box.icons.left.size + box.icons.left.margin : 0) + chipMargin;
|
|
46989
47168
|
const rightMargin = (box.icons.right ? box.icons.right.size + box.icons.right.margin : 0) + chipMargin;
|
|
46990
|
-
const contentWidth = leftMargin + contentSize.width + rightMargin +
|
|
47169
|
+
const contentWidth = leftMargin + contentSize.width + rightMargin + MIN_CELL_TEXT_MARGIN;
|
|
46991
47170
|
const align = this.computeCellAlignment(position, contentWidth > width);
|
|
46992
47171
|
const numberOfLines = multiLineText.length;
|
|
46993
47172
|
const contentY = Math.round(this.getters.computeTextYCoordinate(box, fontSizePX, style.verticalAlign, numberOfLines));
|
|
46994
47173
|
let contentX = box.x;
|
|
46995
|
-
if (align === "left") contentX +=
|
|
46996
|
-
else if (align === "right") contentX += box.width -
|
|
47174
|
+
if (align === "left") contentX += MIN_CELL_TEXT_MARGIN + leftMargin;
|
|
47175
|
+
else if (align === "right") contentX += box.width - MIN_CELL_TEXT_MARGIN - rightMargin;
|
|
46997
47176
|
else contentX += box.width / 2;
|
|
46998
47177
|
contentX = Math.round(contentX);
|
|
46999
47178
|
const textHeight = computeTextLinesHeight(fontSizePX, numberOfLines);
|
|
@@ -47009,7 +47188,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
47009
47188
|
};
|
|
47010
47189
|
if (chipStyle?.fillColor) {
|
|
47011
47190
|
const chipMarginLeft = leftMargin;
|
|
47012
|
-
const chipMarginRight =
|
|
47191
|
+
const chipMarginRight = DATA_VALIDATION_CHIP_MARGIN;
|
|
47013
47192
|
box.chip = {
|
|
47014
47193
|
color: chipStyle.fillColor,
|
|
47015
47194
|
width: box.width - chipMarginLeft - chipMarginRight,
|
|
@@ -47172,7 +47351,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
47172
47351
|
continue;
|
|
47173
47352
|
}
|
|
47174
47353
|
const elapsedTime = timeStamp - animation.startTime;
|
|
47175
|
-
const progress = Math.min(1, elapsedTime /
|
|
47354
|
+
const progress = Math.min(1, elapsedTime / CELL_ANIMATION_DURATION);
|
|
47176
47355
|
if (progress >= 1) this.animations.delete(boxId);
|
|
47177
47356
|
animation.progress = progress;
|
|
47178
47357
|
}
|
|
@@ -47295,7 +47474,7 @@ function useTouchHandlers(ref, { updateScroll, canMoveUp, canMoveDown, getZoom,
|
|
|
47295
47474
|
resetTimeout = setTimeout(() => {
|
|
47296
47475
|
velocityX = 0;
|
|
47297
47476
|
velocityY = 0;
|
|
47298
|
-
},
|
|
47477
|
+
}, resetTimeoutDuration);
|
|
47299
47478
|
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
47300
47479
|
}
|
|
47301
47480
|
function onTouchEnd(ev) {
|
|
@@ -47364,7 +47543,7 @@ function computeDistance(ev1, ev2) {
|
|
|
47364
47543
|
//#region src/components/helpers/wheel_hook.ts
|
|
47365
47544
|
function useWheelHandler(handler) {
|
|
47366
47545
|
function normalize(val, deltaMode) {
|
|
47367
|
-
return val * (deltaMode === 0 ? 1 :
|
|
47546
|
+
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
47368
47547
|
}
|
|
47369
47548
|
const onMouseWheel = (ev) => {
|
|
47370
47549
|
handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
|
|
@@ -47460,14 +47639,14 @@ var Corner = class extends Component {
|
|
|
47460
47639
|
return cssPropertiesToCss(css);
|
|
47461
47640
|
}
|
|
47462
47641
|
getHandlerEdgeLength() {
|
|
47463
|
-
return this.env.isMobile() ? MOBILE_HANDLER_WIDTH :
|
|
47642
|
+
return this.env.isMobile() ? MOBILE_HANDLER_WIDTH : AUTOFILL_EDGE_LENGTH;
|
|
47464
47643
|
}
|
|
47465
47644
|
get buttonLook() {
|
|
47466
47645
|
const css = {
|
|
47467
47646
|
"background-color": this.props.color,
|
|
47468
47647
|
cursor: `${this.props.orientation}-resize`
|
|
47469
47648
|
};
|
|
47470
|
-
if (this.env.isMobile()) css["border-radius"] = `${
|
|
47649
|
+
if (this.env.isMobile()) css["border-radius"] = `${AUTOFILL_EDGE_LENGTH / 2}px`;
|
|
47471
47650
|
return cssPropertiesToCss(css);
|
|
47472
47651
|
}
|
|
47473
47652
|
onMouseDown(ev) {
|
|
@@ -47885,8 +48064,8 @@ var Grid = class extends Component {
|
|
|
47885
48064
|
TableResizer,
|
|
47886
48065
|
Selection
|
|
47887
48066
|
};
|
|
47888
|
-
HEADER_HEIGHT =
|
|
47889
|
-
HEADER_WIDTH =
|
|
48067
|
+
HEADER_HEIGHT = HEADER_HEIGHT;
|
|
48068
|
+
HEADER_WIDTH = HEADER_WIDTH;
|
|
47890
48069
|
menuState;
|
|
47891
48070
|
gridRef;
|
|
47892
48071
|
highlightStore;
|
|
@@ -47957,10 +48136,10 @@ var Grid = class extends Component {
|
|
|
47957
48136
|
get gridOverlayDimensions() {
|
|
47958
48137
|
const scrollbarWidth = this.env.model.getters.getScrollBarWidth();
|
|
47959
48138
|
return cssPropertiesToCss({
|
|
47960
|
-
top: `${
|
|
47961
|
-
left: `${
|
|
47962
|
-
height: `calc(100% - ${
|
|
47963
|
-
width: `calc(100% - ${
|
|
48139
|
+
top: `${HEADER_HEIGHT}px`,
|
|
48140
|
+
left: `${HEADER_WIDTH}px`,
|
|
48141
|
+
height: `calc(100% - ${HEADER_HEIGHT + scrollbarWidth}px)`,
|
|
48142
|
+
width: `calc(100% - ${HEADER_WIDTH + scrollbarWidth}px)`
|
|
47964
48143
|
});
|
|
47965
48144
|
}
|
|
47966
48145
|
onClosePopover() {
|
|
@@ -48174,8 +48353,8 @@ var Grid = class extends Component {
|
|
|
48174
48353
|
const zone = this.env.model.getters.getSelectedZone();
|
|
48175
48354
|
const rect = this.env.model.getters.getVisibleRect(zone);
|
|
48176
48355
|
return {
|
|
48177
|
-
x: rect.x + rect.width -
|
|
48178
|
-
y: rect.y + rect.height -
|
|
48356
|
+
x: rect.x + rect.width - AUTOFILL_EDGE_LENGTH / 2,
|
|
48357
|
+
y: rect.y + rect.height - AUTOFILL_EDGE_LENGTH / 2
|
|
48179
48358
|
};
|
|
48180
48359
|
}
|
|
48181
48360
|
get isAutofillVisible() {
|
|
@@ -48192,10 +48371,10 @@ var Grid = class extends Component {
|
|
|
48192
48371
|
onGridResized() {
|
|
48193
48372
|
const { height, width } = this.props.getGridSize();
|
|
48194
48373
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
48195
|
-
width: width -
|
|
48196
|
-
height: height -
|
|
48197
|
-
gridOffsetX:
|
|
48198
|
-
gridOffsetY:
|
|
48374
|
+
width: width - HEADER_WIDTH,
|
|
48375
|
+
height: height - HEADER_HEIGHT,
|
|
48376
|
+
gridOffsetX: HEADER_WIDTH,
|
|
48377
|
+
gridOffsetY: HEADER_HEIGHT
|
|
48199
48378
|
});
|
|
48200
48379
|
}
|
|
48201
48380
|
moveCanvas(deltaX, deltaY) {
|
|
@@ -48541,7 +48720,7 @@ var ClickableCellSortIcon = class extends Component {
|
|
|
48541
48720
|
return cssPropertiesToCss({
|
|
48542
48721
|
height: `${size}px`,
|
|
48543
48722
|
width: `${size}px`,
|
|
48544
|
-
color: cellStyle.textColor ||
|
|
48723
|
+
color: cellStyle.textColor || TEXT_BODY_MUTED,
|
|
48545
48724
|
"background-color": this.getBackgroundColor(cellStyle)
|
|
48546
48725
|
});
|
|
48547
48726
|
}
|
|
@@ -49434,8 +49613,8 @@ var CarouselPlugin = class extends CorePlugin {
|
|
|
49434
49613
|
case "DUPLICATE_SHEET": {
|
|
49435
49614
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
49436
49615
|
for (const fig of sheetFiguresFrom) if (fig.tag === "carousel") {
|
|
49437
|
-
const figureIdBase = fig.id.split(
|
|
49438
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
49616
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
49617
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
49439
49618
|
const carousel = this.getCarousel(fig.id);
|
|
49440
49619
|
if (carousel) {
|
|
49441
49620
|
const size = {
|
|
@@ -49451,8 +49630,8 @@ var CarouselPlugin = class extends CorePlugin {
|
|
|
49451
49630
|
size,
|
|
49452
49631
|
definition: { items: carousel.items.map((item) => {
|
|
49453
49632
|
if (item.type === "carouselDataView") return { ...item };
|
|
49454
|
-
const chartIdBase = item.chartId.split(
|
|
49455
|
-
const newChartId = `${cmd.sheetIdTo}${
|
|
49633
|
+
const chartIdBase = item.chartId.split(FIGURE_ID_SPLITTER).pop();
|
|
49634
|
+
const newChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
|
|
49456
49635
|
return {
|
|
49457
49636
|
...item,
|
|
49458
49637
|
chartId: newChartId
|
|
@@ -49526,12 +49705,12 @@ var Squisher = class {
|
|
|
49526
49705
|
* with references (unless they contain a sheet name that contains the separator). */
|
|
49527
49706
|
buildResult(numbers, strings, references) {
|
|
49528
49707
|
const res = {};
|
|
49529
|
-
if (numbers.length) res.N = numbers.join(
|
|
49708
|
+
if (numbers.length) res.N = numbers.join(SEPARATOR);
|
|
49530
49709
|
if (strings.length) res.S = strings;
|
|
49531
49710
|
if (references.length) {
|
|
49532
49711
|
let referencePattern;
|
|
49533
|
-
if (references.some((x) => x.includes(
|
|
49534
|
-
else referencePattern = references.join(
|
|
49712
|
+
if (references.some((x) => x.includes(SEPARATOR))) referencePattern = references;
|
|
49713
|
+
else referencePattern = references.join(SEPARATOR);
|
|
49535
49714
|
res.R = referencePattern;
|
|
49536
49715
|
}
|
|
49537
49716
|
return res;
|
|
@@ -49664,7 +49843,7 @@ var Squisher = class {
|
|
|
49664
49843
|
}
|
|
49665
49844
|
squishOneReference(reference, previousReferences, index, forSheetId) {
|
|
49666
49845
|
const previousReference = previousReferences[index];
|
|
49667
|
-
if (deepEquals(previousReference, reference)) return
|
|
49846
|
+
if (deepEquals(previousReference, reference)) return NO_CHANGE;
|
|
49668
49847
|
if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc || previousReference.parts.length !== reference.parts.length) {
|
|
49669
49848
|
previousReferences[index] = deepCopy(reference);
|
|
49670
49849
|
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
@@ -49698,7 +49877,7 @@ var Squisher = class {
|
|
|
49698
49877
|
* - "=" meaning no change as string
|
|
49699
49878
|
* */
|
|
49700
49879
|
squishNumbers(numbers) {
|
|
49701
|
-
const result = numbers.map((x) =>
|
|
49880
|
+
const result = numbers.map((x) => NO_CHANGE);
|
|
49702
49881
|
for (let i = 0; i < numbers.length; i++) {
|
|
49703
49882
|
const previousValue = this.baseFormula.literalValues.numbers[i].value;
|
|
49704
49883
|
const currentValue = numbers[i].value;
|
|
@@ -49712,7 +49891,7 @@ var Squisher = class {
|
|
|
49712
49891
|
return result;
|
|
49713
49892
|
}
|
|
49714
49893
|
squishStrings(strings) {
|
|
49715
|
-
const result = strings.map((x) =>
|
|
49894
|
+
const result = strings.map((x) => NO_CHANGE);
|
|
49716
49895
|
for (let i = 0; i < strings.length; i++) {
|
|
49717
49896
|
const str = strings[i].value;
|
|
49718
49897
|
if (str !== this.previousStrings[i]) {
|
|
@@ -49985,16 +50164,16 @@ var Unsquisher = class {
|
|
|
49985
50164
|
strings: [],
|
|
49986
50165
|
dependencies: []
|
|
49987
50166
|
};
|
|
49988
|
-
if (squishedFormula.N !== void 0 && squishedFormula.N.length > 0) current.numbers = squishedFormula.N.split(
|
|
50167
|
+
if (squishedFormula.N !== void 0 && squishedFormula.N.length > 0) current.numbers = squishedFormula.N.split(SEPARATOR).map(this.adjustNumbers);
|
|
49989
50168
|
else current.numbers = this.previousFormula.literalValues.numbers;
|
|
49990
50169
|
if (squishedFormula.S !== void 0 && squishedFormula.S.length > 0) current.strings = squishedFormula.S.map(this.adjustStrings);
|
|
49991
50170
|
else current.strings = this.previousFormula.literalValues.strings;
|
|
49992
50171
|
if (squishedFormula.R !== void 0 && this.previousFormula) {
|
|
49993
50172
|
let references;
|
|
49994
50173
|
if (typeof squishedFormula.R !== "string") references = squishedFormula.R;
|
|
49995
|
-
else references = squishedFormula.R.split(
|
|
50174
|
+
else references = squishedFormula.R.split(SEPARATOR);
|
|
49996
50175
|
current.dependencies = references.map((refStr, index) => {
|
|
49997
|
-
if (refStr ===
|
|
50176
|
+
if (refStr === NO_CHANGE) return { ...this.alreadyAppliedReferenceOffset[index] };
|
|
49998
50177
|
else if (refStr.startsWith("+") || refStr.startsWith("-")) {
|
|
49999
50178
|
const offset = parseInt(refStr.slice(2), 10);
|
|
50000
50179
|
const sign = refStr[0] === "+" ? 1 : -1;
|
|
@@ -50030,14 +50209,14 @@ var Unsquisher = class {
|
|
|
50030
50209
|
throw new Error("Invalid squished element or no previous cell to unsquish against");
|
|
50031
50210
|
}
|
|
50032
50211
|
adjustStrings = (str, index) => {
|
|
50033
|
-
if (str ===
|
|
50212
|
+
if (str === NO_CHANGE) return { value: this.previousString[index] };
|
|
50034
50213
|
else {
|
|
50035
50214
|
this.previousString[index] = str;
|
|
50036
50215
|
return { value: str };
|
|
50037
50216
|
}
|
|
50038
50217
|
};
|
|
50039
50218
|
adjustNumbers = (numStr, index) => {
|
|
50040
|
-
if (numStr ===
|
|
50219
|
+
if (numStr === NO_CHANGE) return { value: this.alreadyAppliedNumberOffset[index] };
|
|
50041
50220
|
else {
|
|
50042
50221
|
const currentOffset = parseFloat(numStr.slice(1));
|
|
50043
50222
|
const adjustedOffset = (this.alreadyAppliedNumberOffset[index] || 0) + currentOffset;
|
|
@@ -50517,10 +50696,10 @@ var ChartPlugin = class extends CorePlugin {
|
|
|
50517
50696
|
if (!chart || !figureId) continue;
|
|
50518
50697
|
const fig = this.getters.getFigure(cmd.sheetId, figureId);
|
|
50519
50698
|
if (!fig) continue;
|
|
50520
|
-
const figureIdBase = figureId.split(
|
|
50521
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
50522
|
-
const chartIdBase = chartId.split(
|
|
50523
|
-
const duplicatedChartId = `${cmd.sheetIdTo}${
|
|
50699
|
+
const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
|
|
50700
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
50701
|
+
const chartIdBase = chartId.split(FIGURE_ID_SPLITTER).pop();
|
|
50702
|
+
const duplicatedChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
|
|
50524
50703
|
const definition = chart.duplicateInDuplicatedSheet(cmd.sheetId, cmd.sheetIdTo);
|
|
50525
50704
|
this.dispatch("CREATE_CHART", {
|
|
50526
50705
|
figureId: duplicatedFigureId,
|
|
@@ -50629,8 +50808,8 @@ var ChartPlugin = class extends CorePlugin {
|
|
|
50629
50808
|
* Add a figure with tag chart with the given id at the given position
|
|
50630
50809
|
*/
|
|
50631
50810
|
addFigure(figureId, sheetId, col, row, offset, size = {
|
|
50632
|
-
width:
|
|
50633
|
-
height:
|
|
50811
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
50812
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
50634
50813
|
}) {
|
|
50635
50814
|
this.dispatch("CREATE_FIGURE", {
|
|
50636
50815
|
sheetId,
|
|
@@ -51358,8 +51537,8 @@ var FigurePlugin = class extends CorePlugin {
|
|
|
51358
51537
|
const figureId = figure.id;
|
|
51359
51538
|
const fig = this.figures[cmd.sheetId]?.[figureId];
|
|
51360
51539
|
if (!fig) continue;
|
|
51361
|
-
const figureIdBase = figureId.split(
|
|
51362
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
51540
|
+
const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
|
|
51541
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
51363
51542
|
this.dispatch("CREATE_FIGURE", {
|
|
51364
51543
|
figureId: duplicatedFigureId,
|
|
51365
51544
|
...fig,
|
|
@@ -51397,11 +51576,11 @@ var FigurePlugin = class extends CorePlugin {
|
|
|
51397
51576
|
const numHeader = this.getters.getNumberRows(sheetId);
|
|
51398
51577
|
const remainingSize = new Array(numHeader + 1);
|
|
51399
51578
|
remainingSize[numHeader] = 0;
|
|
51400
|
-
for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ??
|
|
51579
|
+
for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ?? DEFAULT_CELL_HEIGHT);
|
|
51401
51580
|
for (const figure of this.getFigures(sheetId)) if (figure.offset.y + figure.height > remainingSize[figure.row]) {
|
|
51402
51581
|
let y = figure.offset.y;
|
|
51403
51582
|
let row = figure.row;
|
|
51404
|
-
for (let row_size = this.getters.getUserRowSize(sheetId, row) ??
|
|
51583
|
+
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) {
|
|
51405
51584
|
row += 1;
|
|
51406
51585
|
y -= row_size;
|
|
51407
51586
|
}
|
|
@@ -51426,7 +51605,7 @@ var FigurePlugin = class extends CorePlugin {
|
|
|
51426
51605
|
let rowNum, colNum;
|
|
51427
51606
|
let { col, row } = figure;
|
|
51428
51607
|
const offset = { ...figure.offset };
|
|
51429
|
-
for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ??
|
|
51608
|
+
for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ?? DEFAULT_CELL_HEIGHT;
|
|
51430
51609
|
if (row > rowNum) {
|
|
51431
51610
|
row = rowNum;
|
|
51432
51611
|
offset.y = Math.max(availableHeight - figure.height, 0);
|
|
@@ -51907,7 +52086,7 @@ var HeaderSizePlugin = class extends CorePlugin {
|
|
|
51907
52086
|
}
|
|
51908
52087
|
}
|
|
51909
52088
|
getColSize(sheetId, index) {
|
|
51910
|
-
return Math.round(this.sizes[sheetId]?.["COL"][index] ||
|
|
52089
|
+
return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
|
|
51911
52090
|
}
|
|
51912
52091
|
getUserRowSize(sheetId, index) {
|
|
51913
52092
|
const rowSize = this.sizes[sheetId]?.["ROW"][index];
|
|
@@ -51940,7 +52119,7 @@ var HeaderSizePlugin = class extends CorePlugin {
|
|
|
51940
52119
|
if (sheet.rows === void 0) sheet.rows = {};
|
|
51941
52120
|
for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
|
|
51942
52121
|
...sheet.rows[row],
|
|
51943
|
-
size: this.getUserRowSize(sheet.id, row) ??
|
|
52122
|
+
size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
|
|
51944
52123
|
};
|
|
51945
52124
|
if (sheet.cols === void 0) sheet.cols = {};
|
|
51946
52125
|
for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
|
|
@@ -52121,8 +52300,8 @@ var ImagePlugin = class extends CorePlugin {
|
|
|
52121
52300
|
case "DUPLICATE_SHEET": {
|
|
52122
52301
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
52123
52302
|
for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
|
|
52124
|
-
const figureIdBase = fig.id.split(
|
|
52125
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
52303
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
52304
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
52126
52305
|
const image = this.getImage(fig.id);
|
|
52127
52306
|
if (image) {
|
|
52128
52307
|
const size = {
|
|
@@ -55828,8 +56007,8 @@ iconsOnCellRegistry.add("data_validation_checkbox", (getters, position) => {
|
|
|
55828
56007
|
hoverSvg: value ? CHECKBOX_CHECKED : CHECKBOX_UNCHECKED_HOVERED,
|
|
55829
56008
|
priority: 2,
|
|
55830
56009
|
horizontalAlign: "center",
|
|
55831
|
-
size:
|
|
55832
|
-
margin:
|
|
56010
|
+
size: GRID_ICON_EDGE_LENGTH,
|
|
56011
|
+
margin: GRID_ICON_MARGIN,
|
|
55833
56012
|
position,
|
|
55834
56013
|
type: "data_validation_checkbox",
|
|
55835
56014
|
onClick: (position, env) => {
|
|
@@ -55876,7 +56055,7 @@ iconsOnCellRegistry.add("conditional_formatting", (getters, position) => {
|
|
|
55876
56055
|
priority: 1,
|
|
55877
56056
|
horizontalAlign: "left",
|
|
55878
56057
|
size: computeTextFontSizeInPixels(style),
|
|
55879
|
-
margin:
|
|
56058
|
+
margin: MIN_CF_ICON_MARGIN,
|
|
55880
56059
|
position
|
|
55881
56060
|
};
|
|
55882
56061
|
}
|
|
@@ -55891,13 +56070,13 @@ iconsOnCellRegistry.add("pivot_collapse", (getters, position) => {
|
|
|
55891
56070
|
const fields = pivotCell.dimension === "COL" ? definition.columns : definition.rows;
|
|
55892
56071
|
const hasIcon = !isDashboard && !getters.shouldShowFormulas() && pivotCell.domain.length !== fields.length;
|
|
55893
56072
|
const isCollapsed = (definition.collapsedDomains?.[pivotCell.dimension] ?? []).some((domain) => deepEquals(domain, pivotCell.domain));
|
|
55894
|
-
const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) *
|
|
56073
|
+
const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * PIVOT_INDENT : 0;
|
|
55895
56074
|
return {
|
|
55896
56075
|
type: "pivot_collapse",
|
|
55897
56076
|
priority: 4,
|
|
55898
56077
|
horizontalAlign: "left",
|
|
55899
|
-
size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ?
|
|
55900
|
-
margin: hasIcon ?
|
|
56078
|
+
size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ? PIVOT_COLLAPSE_ICON_SIZE : 0,
|
|
56079
|
+
margin: hasIcon ? GRID_ICON_MARGIN * 2 + indent : indent,
|
|
55901
56080
|
svg: hasIcon ? getPivotIconSvg(isCollapsed, false) : void 0,
|
|
55902
56081
|
hoverSvg: hasIcon ? getPivotIconSvg(isCollapsed, true) : void 0,
|
|
55903
56082
|
position,
|
|
@@ -56551,7 +56730,7 @@ var EvaluationChartPlugin = class extends CoreViewPlugin {
|
|
|
56551
56730
|
col,
|
|
56552
56731
|
row
|
|
56553
56732
|
});
|
|
56554
|
-
const background = style.fillColor ||
|
|
56733
|
+
const background = style.fillColor || BACKGROUND_CHART_COLOR;
|
|
56555
56734
|
return {
|
|
56556
56735
|
background,
|
|
56557
56736
|
fontColor: style.textColor || chartFontColor(background)
|
|
@@ -56871,7 +57050,7 @@ var EvaluationDataValidationPlugin = class extends CoreViewPlugin {
|
|
|
56871
57050
|
return this.getDataValidationStyle(position);
|
|
56872
57051
|
}
|
|
56873
57052
|
getDataValidationChipStyle(position) {
|
|
56874
|
-
if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor:
|
|
57053
|
+
if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor: GRAY_200 };
|
|
56875
57054
|
}
|
|
56876
57055
|
getInvalidDataValidationMessage(cellPosition) {
|
|
56877
57056
|
const validationResult = this.getValidationResultForCell(cellPosition);
|
|
@@ -57100,7 +57279,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
|
|
|
57100
57279
|
}
|
|
57101
57280
|
}
|
|
57102
57281
|
getRowSize(sheetId, row) {
|
|
57103
|
-
return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ??
|
|
57282
|
+
return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? DEFAULT_CELL_HEIGHT);
|
|
57104
57283
|
}
|
|
57105
57284
|
getMaxAnchorOffset(sheetId, height, width) {
|
|
57106
57285
|
let { numberOfRows: row, numberOfCols: col } = this.getters.getSheetSize(sheetId);
|
|
@@ -57138,8 +57317,8 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
|
|
|
57138
57317
|
col,
|
|
57139
57318
|
row
|
|
57140
57319
|
});
|
|
57141
|
-
if (updatedCellHeight <=
|
|
57142
|
-
if (!tallestCellInRow && updatedCellHeight >
|
|
57320
|
+
if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
|
|
57321
|
+
if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
|
|
57143
57322
|
const newTallestCell = {
|
|
57144
57323
|
cell: {
|
|
57145
57324
|
sheetId,
|
|
@@ -57164,7 +57343,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
|
|
|
57164
57343
|
* merge, or the height of the cell computed based on its style/content.
|
|
57165
57344
|
*/
|
|
57166
57345
|
getCellHeight(position) {
|
|
57167
|
-
if (this.isInMultiRowMerge(position)) return
|
|
57346
|
+
if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
|
|
57168
57347
|
const cell = this.getters.getCell(position);
|
|
57169
57348
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
57170
57349
|
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
@@ -57186,7 +57365,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
|
|
|
57186
57365
|
if (!cell) continue;
|
|
57187
57366
|
const position = this.getters.getCellPosition(cell.id);
|
|
57188
57367
|
const cellHeight = this.getCellHeight(position);
|
|
57189
|
-
if (cellHeight > maxHeight && cellHeight >
|
|
57368
|
+
if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
|
|
57190
57369
|
maxHeight = cellHeight;
|
|
57191
57370
|
tallestCell = {
|
|
57192
57371
|
cell: position,
|
|
@@ -57194,7 +57373,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
|
|
|
57194
57373
|
};
|
|
57195
57374
|
}
|
|
57196
57375
|
}
|
|
57197
|
-
if (tallestCell && tallestCell.size >
|
|
57376
|
+
if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
|
|
57198
57377
|
}
|
|
57199
57378
|
};
|
|
57200
57379
|
|
|
@@ -57638,7 +57817,7 @@ function pivot_presentation_default(PivotClass) {
|
|
|
57638
57817
|
* @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
|
|
57639
57818
|
*/
|
|
57640
57819
|
getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
|
|
57641
|
-
const comparedDomain = valueToCompare ===
|
|
57820
|
+
const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
|
|
57642
57821
|
if (deepEquals(comparedDomain, domain)) return "sameValue";
|
|
57643
57822
|
if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
|
|
57644
57823
|
const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
|
|
@@ -60535,7 +60714,7 @@ var Session = class extends EventBus {
|
|
|
60535
60714
|
this.trigger("new-local-state-update", { id: revision.id });
|
|
60536
60715
|
this.sendUpdateMessage({
|
|
60537
60716
|
type: "REMOTE_REVISION",
|
|
60538
|
-
version:
|
|
60717
|
+
version: MESSAGE_VERSION,
|
|
60539
60718
|
serverRevisionId: this.serverRevisionId,
|
|
60540
60719
|
nextRevisionId: revision.id,
|
|
60541
60720
|
clientId: revision.clientId,
|
|
@@ -60546,7 +60725,7 @@ var Session = class extends EventBus {
|
|
|
60546
60725
|
this.waitingUndoRedoAck = true;
|
|
60547
60726
|
this.sendUpdateMessage({
|
|
60548
60727
|
type: "REVISION_UNDONE",
|
|
60549
|
-
version:
|
|
60728
|
+
version: MESSAGE_VERSION,
|
|
60550
60729
|
serverRevisionId: this.serverRevisionId,
|
|
60551
60730
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
60552
60731
|
undoneRevisionId: revisionId
|
|
@@ -60556,7 +60735,7 @@ var Session = class extends EventBus {
|
|
|
60556
60735
|
this.waitingUndoRedoAck = true;
|
|
60557
60736
|
this.sendUpdateMessage({
|
|
60558
60737
|
type: "REVISION_REDONE",
|
|
60559
|
-
version:
|
|
60738
|
+
version: MESSAGE_VERSION,
|
|
60560
60739
|
serverRevisionId: this.serverRevisionId,
|
|
60561
60740
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
60562
60741
|
redoneRevisionId: revisionId
|
|
@@ -60597,7 +60776,7 @@ var Session = class extends EventBus {
|
|
|
60597
60776
|
await this.sendToTransport({
|
|
60598
60777
|
type: "CLIENT_LEFT",
|
|
60599
60778
|
clientId: this.clientId,
|
|
60600
|
-
version:
|
|
60779
|
+
version: MESSAGE_VERSION
|
|
60601
60780
|
});
|
|
60602
60781
|
}
|
|
60603
60782
|
/**
|
|
@@ -60614,7 +60793,7 @@ var Session = class extends EventBus {
|
|
|
60614
60793
|
...data,
|
|
60615
60794
|
revisionId: snapshotId
|
|
60616
60795
|
},
|
|
60617
|
-
version:
|
|
60796
|
+
version: MESSAGE_VERSION
|
|
60618
60797
|
});
|
|
60619
60798
|
}
|
|
60620
60799
|
getCurrentClient() {
|
|
@@ -60658,7 +60837,7 @@ var Session = class extends EventBus {
|
|
|
60658
60837
|
};
|
|
60659
60838
|
this.sendToTransport({
|
|
60660
60839
|
type,
|
|
60661
|
-
version:
|
|
60840
|
+
version: MESSAGE_VERSION,
|
|
60662
60841
|
client: {
|
|
60663
60842
|
...client,
|
|
60664
60843
|
position
|
|
@@ -60738,7 +60917,7 @@ var Session = class extends EventBus {
|
|
|
60738
60917
|
const { position } = client;
|
|
60739
60918
|
if (position) this.sendToTransport({
|
|
60740
60919
|
type: "CLIENT_MOVED",
|
|
60741
|
-
version:
|
|
60920
|
+
version: MESSAGE_VERSION,
|
|
60742
60921
|
client: {
|
|
60743
60922
|
...client,
|
|
60744
60923
|
position
|
|
@@ -61590,7 +61769,7 @@ var HistoryPlugin = class extends UIPlugin {
|
|
|
61590
61769
|
onNewLocalStateUpdate({ id }) {
|
|
61591
61770
|
this.undoStack.push(id);
|
|
61592
61771
|
this.redoStack = [];
|
|
61593
|
-
if (this.undoStack.length >
|
|
61772
|
+
if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
|
|
61594
61773
|
}
|
|
61595
61774
|
/**
|
|
61596
61775
|
* Fetch the last revision which is not empty and not a repeated command
|
|
@@ -61887,7 +62066,7 @@ var SplitToColumnsPlugin = class extends UIPlugin {
|
|
|
61887
62066
|
}
|
|
61888
62067
|
getAutoSeparatorForString(str) {
|
|
61889
62068
|
const separators = [
|
|
61890
|
-
|
|
62069
|
+
NEWLINE,
|
|
61891
62070
|
";",
|
|
61892
62071
|
",",
|
|
61893
62072
|
" ",
|
|
@@ -62221,9 +62400,9 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
62221
62400
|
contentWidth += computeMultilineTextSize(this.ctx, multiLineText, style).width;
|
|
62222
62401
|
}
|
|
62223
62402
|
for (const icon of this.getters.getCellIcons(position)) contentWidth += icon.margin + icon.size;
|
|
62224
|
-
if (this.getters.getDataValidationChipStyle(position)) contentWidth +=
|
|
62403
|
+
if (this.getters.getDataValidationChipStyle(position)) contentWidth += DATA_VALIDATION_CHIP_MARGIN * 2;
|
|
62225
62404
|
if (contentWidth === 0) return 0;
|
|
62226
|
-
contentWidth += 2 *
|
|
62405
|
+
contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
|
|
62227
62406
|
if (style.wrapping === "wrap") {
|
|
62228
62407
|
const colWidth = this.getters.getColSize(position.sheetId, position.col);
|
|
62229
62408
|
return Math.min(colWidth, contentWidth);
|
|
@@ -62274,11 +62453,11 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
62274
62453
|
computeTextYCoordinate(cellRect, textLineHeight, verticalAlign = DEFAULT_VERTICAL_ALIGN, numberOfLines = 1) {
|
|
62275
62454
|
const y = cellRect.y + 1;
|
|
62276
62455
|
const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
|
|
62277
|
-
if (cellRect.height > textHeight +
|
|
62456
|
+
if (cellRect.height > textHeight + MIN_CELL_TEXT_MARGIN * 2) {
|
|
62278
62457
|
if (verticalAlign === "middle") return Math.ceil(y + (cellRect.height - textHeight) / 2);
|
|
62279
|
-
if (verticalAlign === "bottom") return y + cellRect.height - textHeight -
|
|
62458
|
+
if (verticalAlign === "bottom") return y + cellRect.height - textHeight - MIN_CELL_TEXT_MARGIN;
|
|
62280
62459
|
}
|
|
62281
|
-
return y +
|
|
62460
|
+
return y + MIN_CELL_TEXT_MARGIN;
|
|
62282
62461
|
}
|
|
62283
62462
|
/**
|
|
62284
62463
|
* Expands the given zone until bordered by empty cells or reached the sheet boundaries.
|
|
@@ -62383,11 +62562,11 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
62383
62562
|
if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
|
|
62384
62563
|
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
62385
62564
|
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
62386
|
-
if (evaluatedSize > evaluatedRowSize && evaluatedSize >
|
|
62565
|
+
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = evaluatedSize;
|
|
62387
62566
|
} else {
|
|
62388
62567
|
const content = cell.content;
|
|
62389
62568
|
const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
62390
|
-
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize >
|
|
62569
|
+
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = 0;
|
|
62391
62570
|
}
|
|
62392
62571
|
}
|
|
62393
62572
|
rowSizes.push(evaluatedRowSize || null);
|
|
@@ -63082,7 +63261,7 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
63082
63261
|
const imageUrl = this.getters.getImage(figureId).path;
|
|
63083
63262
|
file = await this.fileStore?.getFile(imageUrl);
|
|
63084
63263
|
if (file.type !== "image/png") {
|
|
63085
|
-
if (file.size >
|
|
63264
|
+
if (file.size > MAX_FILE_SIZE) {
|
|
63086
63265
|
this.ui.notifyUI({
|
|
63087
63266
|
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))),
|
|
63088
63267
|
sticky: false,
|
|
@@ -64264,7 +64443,7 @@ var InternalViewport = class {
|
|
|
64264
64443
|
let height = lastRowEnd - this.offsetCorrectionY;
|
|
64265
64444
|
if (this.canScrollVertically) {
|
|
64266
64445
|
height = Math.max(height, this.viewportHeight);
|
|
64267
|
-
if (lastRowEnd +
|
|
64446
|
+
if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly() && this.viewportHeight > FOOTER_HEIGHT) height += FOOTER_HEIGHT;
|
|
64268
64447
|
}
|
|
64269
64448
|
return {
|
|
64270
64449
|
width,
|
|
@@ -64616,7 +64795,7 @@ var ViewportCollection = class {
|
|
|
64616
64795
|
return this.getSubViewports(sheetId).some((pane) => pane.isZoneVisible(zone));
|
|
64617
64796
|
}
|
|
64618
64797
|
getScrollBarWidth() {
|
|
64619
|
-
return
|
|
64798
|
+
return SCROLLBAR_WIDTH / this.zoomLevel;
|
|
64620
64799
|
}
|
|
64621
64800
|
getEdgeScrollCol(sheetId, x, previousX, startingX) {
|
|
64622
64801
|
let canEdgeScroll = false;
|
|
@@ -65141,7 +65320,7 @@ var SheetViewPlugin = class extends UIPlugin {
|
|
|
65141
65320
|
return this.chainValidations(() => this.viewports.checkScrollingDirection(sheetId, cmd), () => this.viewports.checkIfViewportsWillChange(sheetId, cmd))(cmd);
|
|
65142
65321
|
}
|
|
65143
65322
|
case "RESIZE_SHEETVIEW": return this.chainValidations(() => this.viewports.checkValuesAreDifferent(cmd), () => this.viewports.checkPositiveDimension(cmd))(cmd);
|
|
65144
|
-
case "SET_ZOOM": if (cmd.zoom >
|
|
65323
|
+
case "SET_ZOOM": if (isNaN(cmd.zoom) || cmd.zoom > MAX_ZOOM_LEVEL || cmd.zoom < MIN_ZOOM_LEVEL) return "InvalidZoomLevel";
|
|
65145
65324
|
else return "Success";
|
|
65146
65325
|
default: return "Success";
|
|
65147
65326
|
}
|
|
@@ -65345,7 +65524,7 @@ var SheetViewPlugin = class extends UIPlugin {
|
|
|
65345
65524
|
return this.viewports.isVisibleInViewport(cellPosition);
|
|
65346
65525
|
}
|
|
65347
65526
|
getScrollBarWidth() {
|
|
65348
|
-
return
|
|
65527
|
+
return SCROLLBAR_WIDTH / this.viewports.getZoomLevel();
|
|
65349
65528
|
}
|
|
65350
65529
|
getEdgeScrollCol(x, previousX, startingX) {
|
|
65351
65530
|
const sheetId = this.getters.getActiveSheetId();
|
|
@@ -65488,8 +65667,8 @@ autoCompleteProviders.add("dataValidation", {
|
|
|
65488
65667
|
text: value.value,
|
|
65489
65668
|
htmlContent: [{
|
|
65490
65669
|
value: value.label,
|
|
65491
|
-
color: chipTextColor(color ||
|
|
65492
|
-
backgroundColor: color ||
|
|
65670
|
+
color: chipTextColor(color || GRAY_200),
|
|
65671
|
+
backgroundColor: color || GRAY_200,
|
|
65493
65672
|
classes: ["badge rounded-pill fs-6 fw-normal w-100 mt-1 text-start"]
|
|
65494
65673
|
}],
|
|
65495
65674
|
fuzzySearchKey: value.label
|
|
@@ -65943,8 +66122,8 @@ iconsOnCellRegistry.add("filter_icon", (getters, position) => {
|
|
|
65943
66122
|
hoverSvg: getDataFilterIcon(isFilterActive, isHighContrast, true),
|
|
65944
66123
|
priority: 3,
|
|
65945
66124
|
horizontalAlign: "right",
|
|
65946
|
-
size:
|
|
65947
|
-
margin:
|
|
66125
|
+
size: GRID_ICON_EDGE_LENGTH,
|
|
66126
|
+
margin: GRID_ICON_MARGIN,
|
|
65948
66127
|
position,
|
|
65949
66128
|
onClick: (position, env) => {
|
|
65950
66129
|
const cellPopovers = env.getStore(CellPopoverStore);
|
|
@@ -68030,16 +68209,16 @@ var RowGroup = class extends AbstractHeaderGroup {
|
|
|
68030
68209
|
const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
|
|
68031
68210
|
const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
|
|
68032
68211
|
let groupHeaderY = 0;
|
|
68033
|
-
let groupHeaderHeight =
|
|
68212
|
+
let groupHeaderHeight = HEADER_HEIGHT;
|
|
68034
68213
|
if (startRow !== 0) {
|
|
68035
68214
|
const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
|
|
68036
|
-
groupHeaderY =
|
|
68215
|
+
groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
|
|
68037
68216
|
groupHeaderHeight = headerRowDims.end - headerRowDims.start;
|
|
68038
68217
|
}
|
|
68039
68218
|
const headerRect = {
|
|
68040
68219
|
x: this.props.layerOffset,
|
|
68041
68220
|
y: groupHeaderY,
|
|
68042
|
-
width:
|
|
68221
|
+
width: GROUP_LAYER_WIDTH,
|
|
68043
68222
|
height: groupHeaderHeight
|
|
68044
68223
|
};
|
|
68045
68224
|
return {
|
|
@@ -68047,7 +68226,7 @@ var RowGroup = class extends AbstractHeaderGroup {
|
|
|
68047
68226
|
groupRect: {
|
|
68048
68227
|
x: this.props.layerOffset,
|
|
68049
68228
|
y: headerRect.y,
|
|
68050
|
-
width:
|
|
68229
|
+
width: GROUP_LAYER_WIDTH,
|
|
68051
68230
|
height: headerRect.height + (endCoordinates - startCoordinates)
|
|
68052
68231
|
},
|
|
68053
68232
|
isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
|
|
@@ -68080,17 +68259,17 @@ var ColGroup = class extends AbstractHeaderGroup {
|
|
|
68080
68259
|
const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
|
|
68081
68260
|
const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
|
|
68082
68261
|
let groupHeaderX = 0;
|
|
68083
|
-
let groupHeaderWidth =
|
|
68262
|
+
let groupHeaderWidth = HEADER_WIDTH;
|
|
68084
68263
|
if (startCol !== 0) {
|
|
68085
68264
|
const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
|
|
68086
|
-
groupHeaderX =
|
|
68265
|
+
groupHeaderX = HEADER_WIDTH + headerRowDims.start;
|
|
68087
68266
|
groupHeaderWidth = headerRowDims.end - headerRowDims.start;
|
|
68088
68267
|
}
|
|
68089
68268
|
const headerRect = {
|
|
68090
68269
|
x: groupHeaderX,
|
|
68091
68270
|
y: this.props.layerOffset,
|
|
68092
68271
|
width: groupHeaderWidth,
|
|
68093
|
-
height:
|
|
68272
|
+
height: GROUP_LAYER_WIDTH
|
|
68094
68273
|
};
|
|
68095
68274
|
return {
|
|
68096
68275
|
headerRect,
|
|
@@ -68098,7 +68277,7 @@ var ColGroup = class extends AbstractHeaderGroup {
|
|
|
68098
68277
|
x: headerRect.x,
|
|
68099
68278
|
y: this.props.layerOffset,
|
|
68100
68279
|
width: headerRect.width + (endCoordinates - startCoordinates),
|
|
68101
|
-
height:
|
|
68280
|
+
height: GROUP_LAYER_WIDTH
|
|
68102
68281
|
},
|
|
68103
68282
|
isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
|
|
68104
68283
|
};
|
|
@@ -68124,7 +68303,7 @@ var HeaderGroupContainer = class extends Component {
|
|
|
68124
68303
|
menuItems: []
|
|
68125
68304
|
});
|
|
68126
68305
|
getLayerOffset(layerIndex) {
|
|
68127
|
-
return layerIndex *
|
|
68306
|
+
return layerIndex * GROUP_LAYER_WIDTH;
|
|
68128
68307
|
}
|
|
68129
68308
|
onContextMenu(event) {
|
|
68130
68309
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -68172,8 +68351,8 @@ var HeaderGroupContainer = class extends Component {
|
|
|
68172
68351
|
get frozenPaneContainerSize() {
|
|
68173
68352
|
if (!this.hasFrozenPane) return 0;
|
|
68174
68353
|
const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
|
|
68175
|
-
if (this.props.dimension === "COL") return
|
|
68176
|
-
else return
|
|
68354
|
+
if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
|
|
68355
|
+
else return HEADER_HEIGHT + viewportCoordinates.y;
|
|
68177
68356
|
}
|
|
68178
68357
|
};
|
|
68179
68358
|
|
|
@@ -68182,7 +68361,7 @@ var HeaderGroupContainer = class extends Component {
|
|
|
68182
68361
|
function useScreenWidth() {
|
|
68183
68362
|
const spreadsheetRect = useSpreadsheetRect();
|
|
68184
68363
|
return { get isSmall() {
|
|
68185
|
-
return spreadsheetRect.width <
|
|
68364
|
+
return spreadsheetRect.width < MOBILE_WIDTH_BREAKPOINT;
|
|
68186
68365
|
} };
|
|
68187
68366
|
}
|
|
68188
68367
|
|
|
@@ -68545,7 +68724,7 @@ var FigureRendererStore = class extends DisposableStore {
|
|
|
68545
68724
|
this.drawChart(renderingCtx, chartId, chartRect);
|
|
68546
68725
|
} else if (title.text) {
|
|
68547
68726
|
ctx.save();
|
|
68548
|
-
ctx.fillStyle = chartDefinition?.background ||
|
|
68727
|
+
ctx.fillStyle = chartDefinition?.background || BACKGROUND_CHART_COLOR;
|
|
68549
68728
|
ctx.fillRect(x, y, figure.width, headerSize);
|
|
68550
68729
|
ctx.font = computeTextFont(chartStyleToCellStyle(title));
|
|
68551
68730
|
ctx.fillStyle = title.color;
|
|
@@ -68992,7 +69171,7 @@ var TopBarComposer = class extends Component {
|
|
|
68992
69171
|
"line-height": "24px"
|
|
68993
69172
|
};
|
|
68994
69173
|
if (this.env.model.getters.isCurrentSheetLocked()) style["pointer-events"] = "none";
|
|
68995
|
-
style.height = this.focus === "inactive" ? `${
|
|
69174
|
+
style.height = this.focus === "inactive" ? `${DESKTOP_TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
|
|
68996
69175
|
return cssPropertiesToCss(style);
|
|
68997
69176
|
}
|
|
68998
69177
|
onFocus(selection) {
|
|
@@ -69665,14 +69844,17 @@ var ToolBarZoom = class extends Component {
|
|
|
69665
69844
|
static props = { class: String };
|
|
69666
69845
|
topBarToolStore;
|
|
69667
69846
|
valueList = ZOOM_VALUES;
|
|
69847
|
+
minZoom = MIN_ZOOM_LEVEL * 100;
|
|
69848
|
+
maxZoom = MAX_ZOOM_LEVEL * 100;
|
|
69668
69849
|
setup() {
|
|
69669
69850
|
this.topBarToolStore = useToolBarDropdownStore();
|
|
69670
69851
|
}
|
|
69671
|
-
|
|
69672
|
-
|
|
69852
|
+
getZoomLevel() {
|
|
69853
|
+
const zoom = this.env.model.getters.getViewportZoomLevel() || 1;
|
|
69854
|
+
return Math.round(zoom * 100);
|
|
69673
69855
|
}
|
|
69674
|
-
setZoom(
|
|
69675
|
-
this.env.model.dispatch("SET_ZOOM", { zoom:
|
|
69856
|
+
setZoom(zoomPercentage) {
|
|
69857
|
+
this.env.model.dispatch("SET_ZOOM", { zoom: zoomPercentage / 100 });
|
|
69676
69858
|
}
|
|
69677
69859
|
toggle() {
|
|
69678
69860
|
if (this.topBarToolStore.isActive) this.topBarToolStore.closeDropdowns();
|
|
@@ -70162,7 +70344,7 @@ var Spreadsheet = class extends Component {
|
|
|
70162
70344
|
else {
|
|
70163
70345
|
if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
|
|
70164
70346
|
else properties["grid-template-rows"] = `min-content auto min-content`;
|
|
70165
|
-
properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize ||
|
|
70347
|
+
properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize || DEFAULT_SIDE_PANEL_SIZE}px` : "auto"}`;
|
|
70166
70348
|
}
|
|
70167
70349
|
return cssPropertiesToCss(properties);
|
|
70168
70350
|
}
|
|
@@ -70264,7 +70446,7 @@ var Spreadsheet = class extends Component {
|
|
|
70264
70446
|
checkViewportSize() {
|
|
70265
70447
|
const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
|
|
70266
70448
|
if (!isFinite(xRatio) || !isFinite(yRatio)) return;
|
|
70267
|
-
if (yRatio >
|
|
70449
|
+
if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
|
|
70268
70450
|
if (this.isViewportTooSmall) return;
|
|
70269
70451
|
this.notificationStore.notifyUser({
|
|
70270
70452
|
text: _t("The current window is too small to display this sheet properly. Consider resizing your browser window or adjusting frozen rows and columns."),
|
|
@@ -70282,8 +70464,8 @@ var Spreadsheet = class extends Component {
|
|
|
70282
70464
|
return this.env.model.getters.getSheetViewDimension().height;
|
|
70283
70465
|
}
|
|
70284
70466
|
get gridContainerStyle() {
|
|
70285
|
-
const gridColSize =
|
|
70286
|
-
const gridRowSize =
|
|
70467
|
+
const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
|
|
70468
|
+
const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
|
|
70287
70469
|
const zoom = this.env.model.getters.getViewportZoomLevel();
|
|
70288
70470
|
return cssPropertiesToCss({
|
|
70289
70471
|
"grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
|
|
@@ -72214,7 +72396,7 @@ function createChart(chart, chartSheetIndex, data) {
|
|
|
72214
72396
|
let title = escapeXml``;
|
|
72215
72397
|
if (chart.data.title?.text) {
|
|
72216
72398
|
const titleColor = toXlsxHexColor(chartMutedFontColor(chart.data.backgroundColor));
|
|
72217
|
-
const fontSize = chart.data.title.fontSize ??
|
|
72399
|
+
const fontSize = chart.data.title.fontSize ?? CHART_TITLE_FONT_SIZE;
|
|
72218
72400
|
title = escapeXml`
|
|
72219
72401
|
<c:title>
|
|
72220
72402
|
${insertText(chart.data.title.text, titleColor, fontSize, chart.data.title)}
|
|
@@ -72305,7 +72487,7 @@ function lineAttributes(params) {
|
|
|
72305
72487
|
</a:ln>
|
|
72306
72488
|
`;
|
|
72307
72489
|
}
|
|
72308
|
-
function insertText(text, fontColor = "000000", fontsize =
|
|
72490
|
+
function insertText(text, fontColor = "000000", fontsize = CHART_TITLE_FONT_SIZE, style = {}) {
|
|
72309
72491
|
const textProperties = [
|
|
72310
72492
|
["b", style.bold ? "1" : "0"],
|
|
72311
72493
|
["i", style.italic ? "1" : "0"],
|
|
@@ -72892,7 +73074,7 @@ function addDoughnutChart(chart, chartSheetIndex, data) {
|
|
|
72892
73074
|
return escapeXml`
|
|
72893
73075
|
<c:doughnutChart>
|
|
72894
73076
|
<c:varyColors val="1" />
|
|
72895
|
-
<c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ?
|
|
73077
|
+
<c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ? DEFAULT_DOUGHNUT_CHART_HOLE_SIZE : 0)}" />
|
|
72896
73078
|
${joinXmlNodes(dataSetsNodes)}
|
|
72897
73079
|
${insertDataLabels({ showValues: chart.showValues })}
|
|
72898
73080
|
</c:doughnutChart>
|
|
@@ -72916,7 +73098,7 @@ function insertDataLabels({ showLeaderLines, showValues } = {
|
|
|
72916
73098
|
}
|
|
72917
73099
|
function addAx(position, axisName, axId, crossAxId, title, defaultFontColor, deleteAxis = 0, orientation = "minMax", crossPosition, tickLabelPosition = "nextTo", maxValue, majorUnit, format = "General") {
|
|
72918
73100
|
const color = title?.color ? toXlsxHexColor(title.color) : defaultFontColor;
|
|
72919
|
-
const fontSize = title?.fontSize ??
|
|
73101
|
+
const fontSize = title?.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE;
|
|
72920
73102
|
const crossBetweenEl = axisName === "c:valAx" ? escapeXml`<c:crossBetween val="between" />` : "";
|
|
72921
73103
|
const maxValueEl = maxValue ? escapeXml`<c:max val="${maxValue}" />` : "";
|
|
72922
73104
|
const minValueEl = maxValue ? escapeXml`<c:min val="${-maxValue}" />` : "";
|
|
@@ -73544,12 +73726,12 @@ function figureCoordinates(headers, anchor, offset) {
|
|
|
73544
73726
|
let currentPosition = 0;
|
|
73545
73727
|
for (const [headerIndex, header] of headers.slice(anchor).entries()) if (currentPosition <= offset && offset < currentPosition + header.size) return {
|
|
73546
73728
|
index: anchor + headerIndex,
|
|
73547
|
-
offset: convertDotValueToEMU(offset - currentPosition +
|
|
73729
|
+
offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
|
|
73548
73730
|
};
|
|
73549
73731
|
else if (headerIndex < headers.length - 1) currentPosition += header.size;
|
|
73550
73732
|
return {
|
|
73551
73733
|
index: headers.length - 1,
|
|
73552
|
-
offset: convertDotValueToEMU(offset - currentPosition +
|
|
73734
|
+
offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
|
|
73553
73735
|
};
|
|
73554
73736
|
}
|
|
73555
73737
|
function createChartDrawing(figure, sheet, chartRelId, construct) {
|
|
@@ -73655,7 +73837,7 @@ function addSheetProtection(sheet) {
|
|
|
73655
73837
|
function addNumberFormats(numFmts) {
|
|
73656
73838
|
const numFmtNodes = [];
|
|
73657
73839
|
for (const [index, numFmt] of Object.entries(numFmts)) {
|
|
73658
|
-
const numFmtAttrs = [["numFmtId", parseInt(index) +
|
|
73840
|
+
const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
|
|
73659
73841
|
numFmtNodes.push(escapeXml`
|
|
73660
73842
|
<numFmt ${formatAttributes(numFmtAttrs)}/>
|
|
73661
73843
|
`);
|
|
@@ -73888,7 +74070,7 @@ function addColumns(cols) {
|
|
|
73888
74070
|
const attributes = [
|
|
73889
74071
|
["min", parseInt(id) + 1],
|
|
73890
74072
|
["max", parseInt(id) + 1],
|
|
73891
|
-
["width", convertWidthToExcel(col.size ||
|
|
74073
|
+
["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
|
|
73892
74074
|
["customWidth", 1],
|
|
73893
74075
|
["hidden", col.isHidden ? 1 : 0]
|
|
73894
74076
|
];
|
|
@@ -73912,7 +74094,7 @@ function addRows(construct, data, sheet) {
|
|
|
73912
74094
|
for (let r = 0; r < sheet.rowNumber; r++) {
|
|
73913
74095
|
const rowAttrs = [["r", r + 1]];
|
|
73914
74096
|
const row = sheet.rows[r] || {};
|
|
73915
|
-
if (row.size && row.size !==
|
|
74097
|
+
if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
|
|
73916
74098
|
if (row.isHidden) rowAttrs.push(["hidden", 1]);
|
|
73917
74099
|
if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
|
|
73918
74100
|
if (row.collapsed) rowAttrs.push(["collapsed", 1]);
|
|
@@ -73954,7 +74136,7 @@ function addRows(construct, data, sheet) {
|
|
|
73954
74136
|
</c>`);
|
|
73955
74137
|
}
|
|
73956
74138
|
}
|
|
73957
|
-
if (cellNodes.length || row.size !==
|
|
74139
|
+
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
|
|
73958
74140
|
<row ${formatAttributes(rowAttrs)}>
|
|
73959
74141
|
${joinXmlNodes(cellNodes)}
|
|
73960
74142
|
</row>
|
|
@@ -74127,7 +74309,7 @@ function createWorksheets(data, construct) {
|
|
|
74127
74309
|
let currentTableIndex = 1;
|
|
74128
74310
|
for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
|
|
74129
74311
|
const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
|
|
74130
|
-
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(
|
|
74312
|
+
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
|
|
74131
74313
|
const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
|
|
74132
74314
|
currentTableIndex += sheet.tables.length;
|
|
74133
74315
|
let drawingNode = escapeXml``;
|
|
@@ -74830,7 +75012,7 @@ var Model = class Model extends EventBus {
|
|
|
74830
75012
|
_exportData(shouldSquish) {
|
|
74831
75013
|
let data = createEmptyWorkbookData();
|
|
74832
75014
|
for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data, shouldSquish);
|
|
74833
|
-
data.revisionId = this.session.getRevisionId() ||
|
|
75015
|
+
data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
|
|
74834
75016
|
data = deepCopy(data);
|
|
74835
75017
|
return data;
|
|
74836
75018
|
}
|
|
@@ -75263,7 +75445,7 @@ const ComboChart = {
|
|
|
75263
75445
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
75264
75446
|
return {
|
|
75265
75447
|
...definition,
|
|
75266
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
75448
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
75267
75449
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
75268
75450
|
dataSets,
|
|
75269
75451
|
labelRange,
|
|
@@ -75500,7 +75682,7 @@ const PyramidChart = {
|
|
|
75500
75682
|
return {
|
|
75501
75683
|
...definition,
|
|
75502
75684
|
horizontal: true,
|
|
75503
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
75685
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
75504
75686
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
75505
75687
|
dataSets,
|
|
75506
75688
|
labelRange,
|
|
@@ -75582,7 +75764,7 @@ const RadarChart = {
|
|
|
75582
75764
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
75583
75765
|
return {
|
|
75584
75766
|
...definition,
|
|
75585
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
75767
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
75586
75768
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
75587
75769
|
dataSets,
|
|
75588
75770
|
labelRange
|
|
@@ -75659,7 +75841,7 @@ const ScatterChart = {
|
|
|
75659
75841
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
75660
75842
|
return {
|
|
75661
75843
|
...definition,
|
|
75662
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
75844
|
+
backgroundColor: toXlsxHexColor(definition.background || BACKGROUND_CHART_COLOR),
|
|
75663
75845
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
75664
75846
|
dataSets,
|
|
75665
75847
|
labelRange,
|
|
@@ -82854,7 +83036,7 @@ const PIVOT = {
|
|
|
82854
83036
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
82855
83037
|
if (error) return error;
|
|
82856
83038
|
const table = pivot.getCollapsedTableStructure();
|
|
82857
|
-
if (table.numberOfCells >
|
|
83039
|
+
if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) return new EvaluationError(getPivotTooBigErrorMessage(table.numberOfCells, this.locale));
|
|
82858
83040
|
const cells = table.getPivotCells(pivotStyle);
|
|
82859
83041
|
const pivotTitle = this.getters.getPivotName(pivotId);
|
|
82860
83042
|
const { numberOfCols, numberOfRows } = table.getPivotTableDimensions(pivotStyle);
|
|
@@ -84533,14 +84715,14 @@ for (const category of categories) {
|
|
|
84533
84715
|
*/
|
|
84534
84716
|
const __info__ = {};
|
|
84535
84717
|
const SPREADSHEET_DIMENSIONS = {
|
|
84536
|
-
MIN_ROW_HEIGHT
|
|
84537
|
-
MIN_COL_WIDTH
|
|
84538
|
-
HEADER_HEIGHT
|
|
84539
|
-
HEADER_WIDTH
|
|
84540
|
-
DESKTOP_BOTTOMBAR_HEIGHT
|
|
84541
|
-
DEFAULT_CELL_WIDTH
|
|
84542
|
-
DEFAULT_CELL_HEIGHT
|
|
84543
|
-
SCROLLBAR_WIDTH
|
|
84718
|
+
MIN_ROW_HEIGHT,
|
|
84719
|
+
MIN_COL_WIDTH,
|
|
84720
|
+
HEADER_HEIGHT,
|
|
84721
|
+
HEADER_WIDTH,
|
|
84722
|
+
DESKTOP_BOTTOMBAR_HEIGHT,
|
|
84723
|
+
DEFAULT_CELL_WIDTH,
|
|
84724
|
+
DEFAULT_CELL_HEIGHT,
|
|
84725
|
+
SCROLLBAR_WIDTH
|
|
84544
84726
|
};
|
|
84545
84727
|
const registries = {
|
|
84546
84728
|
autoCompleteProviders,
|
|
@@ -84765,9 +84947,9 @@ const constants = {
|
|
|
84765
84947
|
PIVOT_STATIC_TABLE_CONFIG,
|
|
84766
84948
|
PIVOT_INSERT_TABLE_STYLE_ID,
|
|
84767
84949
|
ChartTerms,
|
|
84768
|
-
FIGURE_ID_SPLITTER
|
|
84769
|
-
GRID_ICON_EDGE_LENGTH
|
|
84770
|
-
GRID_ICON_MARGIN
|
|
84950
|
+
FIGURE_ID_SPLITTER,
|
|
84951
|
+
GRID_ICON_EDGE_LENGTH,
|
|
84952
|
+
GRID_ICON_MARGIN,
|
|
84771
84953
|
CHART_TYPES
|
|
84772
84954
|
};
|
|
84773
84955
|
const chartHelpers = {
|
|
@@ -84778,6 +84960,6 @@ const chartHelpers = {
|
|
|
84778
84960
|
//#endregion
|
|
84779
84961
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CompiledFormula, CorePlugin, CoreViewPlugin, DEFAULT_LOCALE, DEFAULT_LOCALES, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, canExecuteInReadonly, categories, chartHelpers, components, constants, convertAstNodes, coreTypes, createAutocompleteArgumentsProvider, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, isCoreCommand, isSheetDependent, iterateAstNodes, links, load, lockedSheetAllowedCommands, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
84780
84962
|
|
|
84781
|
-
__info__.version = "19.3.
|
|
84782
|
-
__info__.date = "2026-
|
|
84783
|
-
__info__.hash = "
|
|
84963
|
+
__info__.version = "19.3.22";
|
|
84964
|
+
__info__.date = "2026-10-01T07:46:51.994Z";
|
|
84965
|
+
__info__.hash = "0dd651f";
|