@odoo/o-spreadsheet 19.4.12 → 19.4.14
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 +577 -392
- package/dist/o_spreadsheet.css +41 -31
- package/dist/o_spreadsheet.esm.js +577 -392
- package/dist/o_spreadsheet.iife.js +577 -392
- package/dist/o_spreadsheet.min.iife.js +266 -266
- package/dist/o_spreadsheet.xml +7 -7
- 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 +2 -2
|
@@ -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.4.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 19.4.14
|
|
6
|
+
* @date 2026-10-01T07:47:35.933Z
|
|
7
|
+
* @hash 67c7fe5
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as owl from "@odoo/owl";
|
|
@@ -449,6 +449,9 @@ const DEFAULT_CHART_BACKGROUND_COLOR = "#FFFFFF";
|
|
|
449
449
|
const CHART_WATERFALL_POSITIVE_COLOR = "#4EA7F2";
|
|
450
450
|
const CHART_WATERFALL_NEGATIVE_COLOR = "#EA6175";
|
|
451
451
|
const CHART_WATERFALL_SUBTOTAL_COLOR = "#AAAAAA";
|
|
452
|
+
const MIN_BUBBLE_RADIUS = 10;
|
|
453
|
+
const DEFAULT_BUBBLE_RADIUS = 2;
|
|
454
|
+
const MAX_BUBBLE_RADIUS = 30;
|
|
452
455
|
const GRAY_900 = "#111827";
|
|
453
456
|
const GRAY_400 = "#ced4da";
|
|
454
457
|
const GRAY_300 = "#D8DADD";
|
|
@@ -456,12 +459,19 @@ const GRAY_200 = "#E7E9ED";
|
|
|
456
459
|
const TEXT_BODY = "#374151";
|
|
457
460
|
const TEXT_BODY_MUTED = "#374151C2";
|
|
458
461
|
const ACTION_COLOR = HIGHLIGHT_COLOR$1;
|
|
462
|
+
const CHART_PADDING = 20;
|
|
463
|
+
const CHART_PADDING_BOTTOM = 10;
|
|
464
|
+
const CHART_PADDING_TOP = 15;
|
|
459
465
|
const CHART_TITLE_FONT_SIZE = 16;
|
|
466
|
+
const CHART_AXIS_TITLE_FONT_SIZE = 12;
|
|
467
|
+
const MASTER_CHART_HEIGHT = 60;
|
|
468
|
+
const CHART_COLORSCALE_WIDTH = 70;
|
|
460
469
|
const DEFAULT_CHART_COLOR_SCALE = {
|
|
461
470
|
minColor: "#FFF5EB",
|
|
462
471
|
midColor: "#FD8D3C",
|
|
463
472
|
maxColor: "#7F2704"
|
|
464
473
|
};
|
|
474
|
+
const SCORECARD_CHART_TITLE_FONT_SIZE = 14;
|
|
465
475
|
const PIVOT_TOKEN_COLOR = "#F28C28";
|
|
466
476
|
const COLOR_PICKER_DEFAULTS = [
|
|
467
477
|
"#000000",
|
|
@@ -545,8 +555,32 @@ const COLOR_PICKER_DEFAULTS = [
|
|
|
545
555
|
"#20124D",
|
|
546
556
|
"#4C1130"
|
|
547
557
|
];
|
|
558
|
+
const MIN_ROW_HEIGHT = 10;
|
|
559
|
+
const MIN_COL_WIDTH = 5;
|
|
560
|
+
const HEADER_HEIGHT = 26;
|
|
561
|
+
const HEADER_WIDTH = 48;
|
|
562
|
+
const DESKTOP_TOPBAR_TOOLBAR_HEIGHT = 34;
|
|
563
|
+
const DESKTOP_BOTTOMBAR_HEIGHT = 36;
|
|
564
|
+
const DEFAULT_CELL_WIDTH = 96;
|
|
548
565
|
const DEFAULT_CELL_HEIGHT = 23;
|
|
549
|
-
const
|
|
566
|
+
const SCROLLBAR_WIDTH = 15;
|
|
567
|
+
const AUTOFILL_EDGE_LENGTH = 8;
|
|
568
|
+
const ICON_EDGE_LENGTH = 18;
|
|
569
|
+
const MIN_CF_ICON_MARGIN = 4;
|
|
570
|
+
const MIN_CELL_TEXT_MARGIN = 4;
|
|
571
|
+
const PADDING_AUTORESIZE_VERTICAL = 3;
|
|
572
|
+
const PADDING_AUTORESIZE_HORIZONTAL = MIN_CELL_TEXT_MARGIN;
|
|
573
|
+
const GROUP_LAYER_WIDTH = 21;
|
|
574
|
+
const GRID_ICON_MARGIN = 2;
|
|
575
|
+
const GRID_ICON_EDGE_LENGTH = 17;
|
|
576
|
+
const FOOTER_HEIGHT = 2 * DEFAULT_CELL_HEIGHT;
|
|
577
|
+
const DATA_VALIDATION_CHIP_MARGIN = 5;
|
|
578
|
+
const MOBILE_WIDTH_BREAKPOINT = 768;
|
|
579
|
+
const MENU_WIDTH = 250;
|
|
580
|
+
const MENU_VERTICAL_PADDING = 6;
|
|
581
|
+
const DESKTOP_MENU_ITEM_HEIGHT = 26;
|
|
582
|
+
const MIN_ZOOM_LEVEL = .5;
|
|
583
|
+
const MAX_ZOOM_LEVEL = 2;
|
|
550
584
|
const ZOOM_VALUES = [
|
|
551
585
|
50,
|
|
552
586
|
75,
|
|
@@ -576,20 +610,34 @@ const DEFAULT_NUMBER_STYLE = {
|
|
|
576
610
|
};
|
|
577
611
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
578
612
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
613
|
+
const DEFAULT_FONT_WEIGHT = "400";
|
|
579
614
|
const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
|
|
615
|
+
const HEADER_FONT_SIZE = 11;
|
|
580
616
|
const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
|
|
581
617
|
const DEFAULT_BORDER_DESC = {
|
|
582
618
|
style: "thin",
|
|
583
619
|
color: "#000000"
|
|
584
620
|
};
|
|
621
|
+
const MAX_HISTORY_STEPS = 99;
|
|
585
622
|
const DEFAULT_REVISION_ID = "START_REVISION";
|
|
623
|
+
const DEFAULT_FIGURE_HEIGHT = 335;
|
|
624
|
+
const DEFAULT_FIGURE_WIDTH = 536;
|
|
625
|
+
const FIGURE_BORDER_WIDTH = 1;
|
|
626
|
+
const MIN_FIG_SIZE = 80;
|
|
627
|
+
const MAX_CHAR_LABEL = 20;
|
|
628
|
+
const FIGURE_ID_SPLITTER = "??";
|
|
586
629
|
const DEFAULT_GAUGE_LOWER_COLOR = "#EA6175";
|
|
587
630
|
const DEFAULT_GAUGE_MIDDLE_COLOR = "#FFD86D";
|
|
588
631
|
const DEFAULT_GAUGE_UPPER_COLOR = "#43C5B1";
|
|
589
632
|
const DEFAULT_SCORECARD_BASELINE_MODE = "difference";
|
|
590
633
|
const DEFAULT_SCORECARD_BASELINE_COLOR_UP = "#43C5B1";
|
|
591
634
|
const DEFAULT_SCORECARD_BASELINE_COLOR_DOWN = "#EA6175";
|
|
635
|
+
const DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE = 32;
|
|
636
|
+
const DEFAULT_SCORECARD_BASELINE_FONT_SIZE = 16;
|
|
592
637
|
const LINE_FILL_TRANSPARENCY = .4;
|
|
638
|
+
const LINE_DATA_POINT_RADIUS = 3;
|
|
639
|
+
const DEFAULT_WINDOW_SIZE = 2;
|
|
640
|
+
const MESSAGE_VERSION = 1;
|
|
593
641
|
const FORBIDDEN_SHEETNAME_CHARS = [
|
|
594
642
|
"'",
|
|
595
643
|
"*",
|
|
@@ -600,6 +648,7 @@ const FORBIDDEN_SHEETNAME_CHARS = [
|
|
|
600
648
|
"]"
|
|
601
649
|
];
|
|
602
650
|
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
651
|
+
const FORMULA_REF_IDENTIFIER = "|";
|
|
603
652
|
let DEFAULT_SHEETVIEW_SIZE = 0;
|
|
604
653
|
/**
|
|
605
654
|
* The viewport dimensions are usually set by one of the components
|
|
@@ -614,6 +663,7 @@ function setDefaultSheetViewSize(size) {
|
|
|
614
663
|
DEFAULT_SHEETVIEW_SIZE = size;
|
|
615
664
|
}
|
|
616
665
|
const MAXIMAL_FREEZABLE_RATIO = .85;
|
|
666
|
+
const NEWLINE = "\n";
|
|
617
667
|
const FONT_SIZES = [
|
|
618
668
|
6,
|
|
619
669
|
7,
|
|
@@ -639,6 +689,8 @@ const PIVOT_STATIC_TABLE_CONFIG = {
|
|
|
639
689
|
automaticAutofill: false
|
|
640
690
|
};
|
|
641
691
|
const PIVOT_INSERT_TABLE_STYLE_ID = "PivotTableStyleMedium12";
|
|
692
|
+
const PIVOT_INDENT = 15;
|
|
693
|
+
const PIVOT_COLLAPSE_ICON_SIZE = 12;
|
|
642
694
|
const PIVOT_MAX_NUMBER_OF_CELLS = 5e5;
|
|
643
695
|
const DEFAULT_CURRENCY = {
|
|
644
696
|
symbol: "$",
|
|
@@ -648,7 +700,7 @@ const DEFAULT_CURRENCY = {
|
|
|
648
700
|
name: "Dollar"
|
|
649
701
|
};
|
|
650
702
|
const DEFAULT_CAROUSEL_TITLE_STYLE = {
|
|
651
|
-
fontSize:
|
|
703
|
+
fontSize: CHART_TITLE_FONT_SIZE,
|
|
652
704
|
color: TEXT_BODY
|
|
653
705
|
};
|
|
654
706
|
const DEFAULT_TOKEN_COLOR = "light-dark(#000000, #ffffff)";
|
|
@@ -665,6 +717,7 @@ const tokenColors = {
|
|
|
665
717
|
ARG_SEPARATOR: functionColor,
|
|
666
718
|
ORPHAN_RIGHT_PAREN: "#ff0000"
|
|
667
719
|
};
|
|
720
|
+
const DRAG_THRESHOLD = 5;
|
|
668
721
|
|
|
669
722
|
//#endregion
|
|
670
723
|
//#region src/types/misc.ts
|
|
@@ -1071,7 +1124,7 @@ const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
|
|
|
1071
1124
|
*/
|
|
1072
1125
|
function replaceNewLines(text) {
|
|
1073
1126
|
if (!text) return "";
|
|
1074
|
-
return text.replace(newLineRegexp,
|
|
1127
|
+
return text.replace(newLineRegexp, NEWLINE);
|
|
1075
1128
|
}
|
|
1076
1129
|
/**
|
|
1077
1130
|
* Determine if the numbers are consecutive.
|
|
@@ -1339,7 +1392,7 @@ function toCartesian(xc) {
|
|
|
1339
1392
|
consumeSpaces(chars);
|
|
1340
1393
|
const col = letterPart - 1;
|
|
1341
1394
|
const row = num - 1;
|
|
1342
|
-
if (!chars.isOver() || col > MAX_COL || row >
|
|
1395
|
+
if (!chars.isOver() || col > MAX_COL || row > MAX_ROW) throw new Error(`Invalid cell description: ${xc}`);
|
|
1343
1396
|
return {
|
|
1344
1397
|
col,
|
|
1345
1398
|
row
|
|
@@ -1750,7 +1803,7 @@ function toUnboundedZone(xc) {
|
|
|
1750
1803
|
const orderedZone = reorderZone(toZoneWithoutBoundaryChanges(xc));
|
|
1751
1804
|
const bottom = orderedZone.bottom;
|
|
1752
1805
|
const right = orderedZone.right;
|
|
1753
|
-
if (bottom !== void 0 && bottom >
|
|
1806
|
+
if (bottom !== void 0 && bottom > MAX_ROW || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
|
|
1754
1807
|
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");
|
|
1755
1808
|
return orderedZone;
|
|
1756
1809
|
}
|
|
@@ -1911,7 +1964,7 @@ function intersection(z1, z2) {
|
|
|
1911
1964
|
return {
|
|
1912
1965
|
top: Math.max(z1.top, z2.top),
|
|
1913
1966
|
left: Math.max(z1.left, z2.left),
|
|
1914
|
-
bottom: Math.min(z1.bottom ??
|
|
1967
|
+
bottom: Math.min(z1.bottom ?? MAX_ROW, z2.bottom),
|
|
1915
1968
|
right: Math.min(z1.right ?? MAX_COL, z2.right)
|
|
1916
1969
|
};
|
|
1917
1970
|
}
|
|
@@ -4742,7 +4795,7 @@ function parseNumberFormatTokens(tokens) {
|
|
|
4742
4795
|
switch (token.type) {
|
|
4743
4796
|
case "DIGIT":
|
|
4744
4797
|
if (parsedPart === integerPart) parsedPart.push(token);
|
|
4745
|
-
else if (numberOfDecimalsDigits <
|
|
4798
|
+
else if (numberOfDecimalsDigits < MAX_DECIMAL_PLACES) {
|
|
4746
4799
|
parsedPart.push(token);
|
|
4747
4800
|
numberOfDecimalsDigits++;
|
|
4748
4801
|
}
|
|
@@ -5046,7 +5099,7 @@ function applyIntegerFormat(integerDigits, internalFormat, thousandsSeparator, h
|
|
|
5046
5099
|
if (digitType === "0") digit = digit || "0";
|
|
5047
5100
|
if (!digit) return;
|
|
5048
5101
|
const digitIndex = integerDigits.length - 1 - indexInIntegerString;
|
|
5049
|
-
const groups = getIndexesOfDigitsWithThousandSeparator(locale.digitGrouping ||
|
|
5102
|
+
const groups = getIndexesOfDigitsWithThousandSeparator(locale.digitGrouping || DEFAULT_LOCALE_DIGIT_GROUPING);
|
|
5050
5103
|
if (thousandsSeparator && groups.has(digitIndex - 1)) formattedInteger = digit + thousandsSeparator + formattedInteger;
|
|
5051
5104
|
else formattedInteger = digit + formattedInteger;
|
|
5052
5105
|
}
|
|
@@ -5106,7 +5159,7 @@ const numberRepresentation = [];
|
|
|
5106
5159
|
* exceed in the decimal part, in which case digits are rounded.
|
|
5107
5160
|
*
|
|
5108
5161
|
**/
|
|
5109
|
-
function splitNumber(value, maxDecimals =
|
|
5162
|
+
function splitNumber(value, maxDecimals = MAX_DECIMAL_PLACES) {
|
|
5110
5163
|
const asString = value.toString();
|
|
5111
5164
|
if (asString.includes("e")) return splitNumberIntl(value, maxDecimals);
|
|
5112
5165
|
if (Number.isInteger(value)) return {
|
|
@@ -5175,7 +5228,7 @@ function limitDecimalDigits(decimalDigits, maxDecimals) {
|
|
|
5175
5228
|
* Supports numbers with a lot of digits that are transformed to scientific notation by
|
|
5176
5229
|
* number.toString(), but is slow.
|
|
5177
5230
|
*/
|
|
5178
|
-
function splitNumberIntl(value, maxDecimals =
|
|
5231
|
+
function splitNumberIntl(value, maxDecimals = MAX_DECIMAL_PLACES) {
|
|
5179
5232
|
let formatter = numberRepresentation[maxDecimals];
|
|
5180
5233
|
if (!formatter) {
|
|
5181
5234
|
formatter = new Intl.NumberFormat("en-US", {
|
|
@@ -6143,11 +6196,11 @@ function tokenize(str, locale = DEFAULT_LOCALE) {
|
|
|
6143
6196
|
return result;
|
|
6144
6197
|
}
|
|
6145
6198
|
function tokenizeDebugger(chars) {
|
|
6146
|
-
if (chars.current ===
|
|
6199
|
+
if (chars.current === DEBUGGER_CHAR) {
|
|
6147
6200
|
chars.shift();
|
|
6148
6201
|
return {
|
|
6149
6202
|
type: "DEBUGGER",
|
|
6150
|
-
value:
|
|
6203
|
+
value: DEBUGGER_CHAR
|
|
6151
6204
|
};
|
|
6152
6205
|
}
|
|
6153
6206
|
return null;
|
|
@@ -6306,13 +6359,13 @@ function tokenizeSimpleSpace(chars) {
|
|
|
6306
6359
|
}
|
|
6307
6360
|
function tokenizeNewLine(chars) {
|
|
6308
6361
|
let length = 0;
|
|
6309
|
-
while (chars.current ===
|
|
6362
|
+
while (chars.current === NEWLINE) {
|
|
6310
6363
|
length++;
|
|
6311
6364
|
chars.shift();
|
|
6312
6365
|
}
|
|
6313
6366
|
if (length) return {
|
|
6314
6367
|
type: "SPACE",
|
|
6315
|
-
value:
|
|
6368
|
+
value: NEWLINE.repeat(length)
|
|
6316
6369
|
};
|
|
6317
6370
|
return null;
|
|
6318
6371
|
}
|
|
@@ -8450,7 +8503,7 @@ function addOrigin(cell, origin) {
|
|
|
8450
8503
|
//#endregion
|
|
8451
8504
|
//#region src/helpers/text_helper.ts
|
|
8452
8505
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
8453
|
-
return numberOfLines * (textLineHeight +
|
|
8506
|
+
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
8454
8507
|
}
|
|
8455
8508
|
function getCanvas(width = 100, height = 100) {
|
|
8456
8509
|
return new OffscreenCanvas(width, height).getContext("2d");
|
|
@@ -8459,7 +8512,7 @@ function getCanvas(width = 100, height = 100) {
|
|
|
8459
8512
|
* Get the default height of the cell given its style.
|
|
8460
8513
|
*/
|
|
8461
8514
|
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
8462
|
-
if (!cell || !cell.isFormula && !cell.content) return
|
|
8515
|
+
if (!cell || !cell.isFormula && !cell.content) return DEFAULT_CELL_HEIGHT;
|
|
8463
8516
|
let content = "";
|
|
8464
8517
|
try {
|
|
8465
8518
|
if (!cell.isFormula) {
|
|
@@ -8475,7 +8528,7 @@ function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
|
8475
8528
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
8476
8529
|
}
|
|
8477
8530
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
8478
|
-
return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 *
|
|
8531
|
+
return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : void 0), style).height + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
8479
8532
|
}
|
|
8480
8533
|
function getDefaultContextFont(fontSize, bold = false, italic = false) {
|
|
8481
8534
|
return `${italic ? "italic" : ""} ${bold ? "bold" : ""} ${fontSize}px ${DEFAULT_FONT}`;
|
|
@@ -8541,7 +8594,7 @@ function fontSizeInPixels(fontSize) {
|
|
|
8541
8594
|
return Math.round(fontSize * 96 / 72);
|
|
8542
8595
|
}
|
|
8543
8596
|
function computeTextFont(style, fontUnit = "pt") {
|
|
8544
|
-
return `${style.italic ? "italic " : ""}${style.bold ? "bold" :
|
|
8597
|
+
return `${style.italic ? "italic " : ""}${style.bold ? "bold" : DEFAULT_FONT_WEIGHT} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
8545
8598
|
}
|
|
8546
8599
|
function computeTextFontSizeInPixels(style) {
|
|
8547
8600
|
return fontSizeInPixels(style?.fontSize || DEFAULT_FONT_SIZE);
|
|
@@ -8565,7 +8618,7 @@ function splitTextToWidth(ctx, text, style, width) {
|
|
|
8565
8618
|
if (!style) style = {};
|
|
8566
8619
|
if (isMarkdownLink(text)) text = parseMarkdownLink(text).label;
|
|
8567
8620
|
const brokenText = [];
|
|
8568
|
-
const lines = text.includes(
|
|
8621
|
+
const lines = text.includes(NEWLINE) ? text.split(NEWLINE) : [text];
|
|
8569
8622
|
for (const line of lines) {
|
|
8570
8623
|
const words = line.includes(" ") ? line.split(" ") : [line];
|
|
8571
8624
|
if (!width) {
|
|
@@ -8731,7 +8784,7 @@ function computeRotationPosition(rect, style) {
|
|
|
8731
8784
|
let { x, y } = rect;
|
|
8732
8785
|
const cos = Math.cos(-style.rotation);
|
|
8733
8786
|
const sin = Math.sin(-style.rotation);
|
|
8734
|
-
const width = rect.textWidth - 2 *
|
|
8787
|
+
const width = rect.textWidth - 2 * MIN_CELL_TEXT_MARGIN;
|
|
8735
8788
|
const height = rect.textHeight;
|
|
8736
8789
|
const center = style.align === "center";
|
|
8737
8790
|
const rotateTowardCellCenter = style.align === "left" === sin < 0;
|
|
@@ -8781,7 +8834,7 @@ const chartColorScalePlugin = {
|
|
|
8781
8834
|
ctx.miterLimit = 1;
|
|
8782
8835
|
const gradientHeight = (chart.chartArea.bottom - chart.chartArea.top) / 2;
|
|
8783
8836
|
const gradientWidth = 10;
|
|
8784
|
-
const gradientX = options.position === "left" ?
|
|
8837
|
+
const gradientX = options.position === "left" ? CHART_PADDING : ctx.canvas.width - CHART_COLORSCALE_WIDTH;
|
|
8785
8838
|
const gradientY = chart.chartArea.top;
|
|
8786
8839
|
const gradient = ctx.createLinearGradient(0, gradientY + gradientHeight, 0, gradientY);
|
|
8787
8840
|
const step = 1 / (options.colorScale.length - 1);
|
|
@@ -8791,7 +8844,7 @@ const chartColorScalePlugin = {
|
|
|
8791
8844
|
ctx.fillStyle = gradient;
|
|
8792
8845
|
ctx.fillRect(gradientX, gradientY, gradientWidth, gradientHeight);
|
|
8793
8846
|
ctx.fillStyle = options.fontColor ?? "black";
|
|
8794
|
-
ctx.font = getDefaultContextFont(
|
|
8847
|
+
ctx.font = getDefaultContextFont(CHART_AXIS_TITLE_FONT_SIZE);
|
|
8795
8848
|
ctx.textAlign = "left";
|
|
8796
8849
|
let minValue = Math.round(options.minValue * 100) / 100;
|
|
8797
8850
|
let maxValue = Math.round(options.maxValue * 100) / 100;
|
|
@@ -9061,6 +9114,12 @@ const WIDTH_FACTOR = .143;
|
|
|
9061
9114
|
const EXCEL_DEFAULT_COL_WIDTH = 8.43;
|
|
9062
9115
|
/** unit : points */
|
|
9063
9116
|
const EXCEL_DEFAULT_ROW_HEIGHT = 12.75;
|
|
9117
|
+
const EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS = 30;
|
|
9118
|
+
const EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS = 100;
|
|
9119
|
+
/** The possible values for the XLSX polynomial trendline order are defined by the ST_Order simple type (§21.2.3.29) */
|
|
9120
|
+
const MAX_XLSX_POLYNOMIAL_DEGREE = 6;
|
|
9121
|
+
const FIRST_NUMFMT_ID = 164;
|
|
9122
|
+
const DEFAULT_DOUGHNUT_CHART_HOLE_SIZE = 50;
|
|
9064
9123
|
const FORCE_DEFAULT_ARGS_FUNCTIONS = {
|
|
9065
9124
|
FLOOR: [{
|
|
9066
9125
|
type: "NUMBER",
|
|
@@ -10063,8 +10122,8 @@ function toExcelDataset(getters, dataSetStyles, ds) {
|
|
|
10063
10122
|
if (dataSetStyle.trend?.type) trend = {
|
|
10064
10123
|
type: dataSetStyle.trend.type === "polynomial" && dataSetStyle.trend.order === 1 ? "linear" : SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING[dataSetStyle.trend.type],
|
|
10065
10124
|
color: dataSetStyle.trend.color,
|
|
10066
|
-
order: dataSetStyle.trend.order ? Math.min(dataSetStyle.trend.order,
|
|
10067
|
-
window: dataSetStyle.trend.window ||
|
|
10125
|
+
order: dataSetStyle.trend.order ? Math.min(dataSetStyle.trend.order, MAX_XLSX_POLYNOMIAL_DEGREE) : void 0,
|
|
10126
|
+
window: dataSetStyle.trend.window || DEFAULT_WINDOW_SIZE
|
|
10068
10127
|
};
|
|
10069
10128
|
return {
|
|
10070
10129
|
label,
|
|
@@ -10170,13 +10229,13 @@ function getPieColors(colors, dataSetsValues) {
|
|
|
10170
10229
|
for (let i = 0; i <= maxLength; i++) pieColors.push(colors.next());
|
|
10171
10230
|
return pieColors;
|
|
10172
10231
|
}
|
|
10173
|
-
function truncateLabel(label, maxLen =
|
|
10232
|
+
function truncateLabel(label, maxLen = MAX_CHAR_LABEL) {
|
|
10174
10233
|
if (!label) return "";
|
|
10175
10234
|
if (label.length > maxLen) return label.substring(0, maxLen) + "…";
|
|
10176
10235
|
return label;
|
|
10177
10236
|
}
|
|
10178
10237
|
function isTrendLineAxis(axisID) {
|
|
10179
|
-
return axisID ===
|
|
10238
|
+
return axisID === TREND_LINE_XAXIS_ID || axisID === MOVING_AVERAGE_TREND_LINE_XAXIS_ID;
|
|
10180
10239
|
}
|
|
10181
10240
|
function getChartBackgroundColor({ background }, getters) {
|
|
10182
10241
|
const defaultColor = getters.getSpreadsheetTheme().backgroundColor;
|
|
@@ -10534,7 +10593,7 @@ function getBarChartScales(definition, args) {
|
|
|
10534
10593
|
scales = removeFalsyAttributes(scales);
|
|
10535
10594
|
if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
|
|
10536
10595
|
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
|
|
10537
|
-
scales[
|
|
10596
|
+
scales[TREND_LINE_XAXIS_ID] = {
|
|
10538
10597
|
...scales.x,
|
|
10539
10598
|
labels: Array(maxLength).fill(""),
|
|
10540
10599
|
offset: false,
|
|
@@ -10645,7 +10704,7 @@ function getLineChartScales(definition, args) {
|
|
|
10645
10704
|
});
|
|
10646
10705
|
}
|
|
10647
10706
|
if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
|
|
10648
|
-
scales[
|
|
10707
|
+
scales[TREND_LINE_XAXIS_ID] = {
|
|
10649
10708
|
...scales.x,
|
|
10650
10709
|
display: false
|
|
10651
10710
|
};
|
|
@@ -10655,9 +10714,9 @@ function getLineChartScales(definition, args) {
|
|
|
10655
10714
|
};
|
|
10656
10715
|
if (axisType === "category" || axisType === "time") {
|
|
10657
10716
|
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
|
|
10658
|
-
scales[
|
|
10659
|
-
scales[
|
|
10660
|
-
scales[
|
|
10717
|
+
scales[TREND_LINE_XAXIS_ID]["type"] = "category";
|
|
10718
|
+
scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
|
|
10719
|
+
scales[TREND_LINE_XAXIS_ID]["offset"] = false;
|
|
10661
10720
|
scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["type"] = "category";
|
|
10662
10721
|
scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["offset"] = false;
|
|
10663
10722
|
}
|
|
@@ -10830,7 +10889,7 @@ function getChartAxisTitleRuntime(design) {
|
|
|
10830
10889
|
font: {
|
|
10831
10890
|
style: italic ? "italic" : "normal",
|
|
10832
10891
|
weight: bold ? "bold" : "normal",
|
|
10833
|
-
size: design.title.fontSize ??
|
|
10892
|
+
size: design.title.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE
|
|
10834
10893
|
},
|
|
10835
10894
|
align: align === "left" ? "start" : align === "right" ? "end" : "center"
|
|
10836
10895
|
};
|
|
@@ -10918,16 +10977,16 @@ function getLegendMargin(definition) {
|
|
|
10918
10977
|
switch (definition.legendPosition) {
|
|
10919
10978
|
case "top":
|
|
10920
10979
|
case "right": return {
|
|
10921
|
-
top: !!definition.title.text ?
|
|
10922
|
-
left:
|
|
10923
|
-
right:
|
|
10980
|
+
top: !!definition.title.text ? CHART_PADDING_TOP + 30 : CHART_PADDING_TOP,
|
|
10981
|
+
left: CHART_PADDING,
|
|
10982
|
+
right: CHART_PADDING
|
|
10924
10983
|
};
|
|
10925
10984
|
case "bottom":
|
|
10926
10985
|
case "left":
|
|
10927
10986
|
case "none": return {
|
|
10928
|
-
left:
|
|
10929
|
-
right:
|
|
10930
|
-
bottom:
|
|
10987
|
+
left: CHART_PADDING,
|
|
10988
|
+
right: CHART_PADDING,
|
|
10989
|
+
bottom: CHART_PADDING_BOTTOM
|
|
10931
10990
|
};
|
|
10932
10991
|
}
|
|
10933
10992
|
}
|
|
@@ -10996,7 +11055,7 @@ function getBarChartTotalLineDataset(definition, dataSetsValues) {
|
|
|
10996
11055
|
order: -1,
|
|
10997
11056
|
tension: 0,
|
|
10998
11057
|
fill: false,
|
|
10999
|
-
pointRadius:
|
|
11058
|
+
pointRadius: LINE_DATA_POINT_RADIUS,
|
|
11000
11059
|
borderWidth: 2,
|
|
11001
11060
|
backgroundColor: color,
|
|
11002
11061
|
borderColor: color,
|
|
@@ -11015,7 +11074,7 @@ function getCalendarChartDatasetAndLabels(definition, args) {
|
|
|
11015
11074
|
for (const dataSetValues of dataSetsValues) dataSets.push({
|
|
11016
11075
|
label: dataSetValues.label,
|
|
11017
11076
|
data: dataSetValues.data.map((v) => 1),
|
|
11018
|
-
backgroundColor: dataSetValues.data.map((v) => isNumberResult(v) ? colorMap(v.value) : definition.missingValueColor ||
|
|
11077
|
+
backgroundColor: dataSetValues.data.map((v) => isNumberResult(v) ? colorMap(v.value) : definition.missingValueColor || COLOR_TRANSPARENT),
|
|
11019
11078
|
borderColor: definition.background || background,
|
|
11020
11079
|
borderSkipped: false,
|
|
11021
11080
|
borderWidth: 1,
|
|
@@ -11030,9 +11089,9 @@ function getCalendarChartDatasetAndLabels(definition, args) {
|
|
|
11030
11089
|
}
|
|
11031
11090
|
function getWaterfallDatasetAndLabels(definition, args) {
|
|
11032
11091
|
const { dataSetsValues, labels } = args;
|
|
11033
|
-
const negativeColor = definition.negativeValuesColor ||
|
|
11034
|
-
const positiveColor = definition.positiveValuesColor ||
|
|
11035
|
-
const subTotalColor = definition.subTotalValuesColor ||
|
|
11092
|
+
const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
11093
|
+
const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
11094
|
+
const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
11036
11095
|
const backgroundColor = [];
|
|
11037
11096
|
const datasetValues = [];
|
|
11038
11097
|
const dataset = {
|
|
@@ -11096,7 +11155,7 @@ function getLineChartDatasets(definition, args) {
|
|
|
11096
11155
|
backgroundColor: areaChart ? setColorAlpha(color, LINE_FILL_TRANSPARENCY) : color,
|
|
11097
11156
|
pointBackgroundColor: color,
|
|
11098
11157
|
fill: areaChart ? getFillingMode(index, stackedChart) : false,
|
|
11099
|
-
pointRadius: definition.hideDataMarkers ? 0 :
|
|
11158
|
+
pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS,
|
|
11100
11159
|
yAxisID: dataSetStyle?.yAxisId || "y"
|
|
11101
11160
|
};
|
|
11102
11161
|
dataSets.push(dataset);
|
|
@@ -11151,12 +11210,12 @@ function computeBubbleRadii(sizeValues) {
|
|
|
11151
11210
|
const finiteSizes = sizeValues.filter((value) => Number.isFinite(value) && value > 0);
|
|
11152
11211
|
const min = finiteSizes.length ? Math.min(...finiteSizes) : 0;
|
|
11153
11212
|
const range = (finiteSizes.length ? Math.max(...finiteSizes) : 0) - min;
|
|
11154
|
-
if (!finiteSizes.length) return sizeValues.map(() =>
|
|
11213
|
+
if (!finiteSizes.length) return sizeValues.map(() => DEFAULT_BUBBLE_RADIUS);
|
|
11155
11214
|
return sizeValues.map((value) => {
|
|
11156
11215
|
if (value === void 0 || !Number.isFinite(value) || value < 0) return 0;
|
|
11157
|
-
if (value === 0) return
|
|
11158
|
-
if (range === 0) return
|
|
11159
|
-
return
|
|
11216
|
+
if (value === 0) return DEFAULT_BUBBLE_RADIUS;
|
|
11217
|
+
if (range === 0) return MIN_BUBBLE_RADIUS;
|
|
11218
|
+
return MIN_BUBBLE_RADIUS + clip((value - min) / range, 0, 1) * (MAX_BUBBLE_RADIUS - MIN_BUBBLE_RADIUS);
|
|
11160
11219
|
});
|
|
11161
11220
|
}
|
|
11162
11221
|
function getPieChartDatasets(definition, args) {
|
|
@@ -11199,7 +11258,7 @@ function getComboChartDatasets(definition, args) {
|
|
|
11199
11258
|
xAxisID: "x",
|
|
11200
11259
|
type,
|
|
11201
11260
|
order: type === "bar" ? dataSetsValues.length + index : index,
|
|
11202
|
-
pointRadius: definition.hideDataMarkers ? 0 :
|
|
11261
|
+
pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
|
|
11203
11262
|
};
|
|
11204
11263
|
if (dataset.type === "bar") {
|
|
11205
11264
|
dataset.barPercentage = .9;
|
|
@@ -11231,7 +11290,7 @@ function getRadarChartDatasets(definition, args) {
|
|
|
11231
11290
|
borderColor,
|
|
11232
11291
|
backgroundColor: borderColor,
|
|
11233
11292
|
pointBackgroundColor: borderColor,
|
|
11234
|
-
pointRadius: definition.hideDataMarkers ? 0 :
|
|
11293
|
+
pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
|
|
11235
11294
|
};
|
|
11236
11295
|
if (fill) {
|
|
11237
11296
|
dataset.backgroundColor = setColorAlpha(borderColor, LINE_FILL_TRANSPARENCY);
|
|
@@ -11317,12 +11376,12 @@ function getSunburstChartDatasets(definition, args) {
|
|
|
11317
11376
|
data: data[i],
|
|
11318
11377
|
borderColor: (ctx) => {
|
|
11319
11378
|
const data = ctx.type === "data" ? ctx.raw : void 0;
|
|
11320
|
-
if (!data || data.label ===
|
|
11379
|
+
if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
|
|
11321
11380
|
return definition.background || background;
|
|
11322
11381
|
},
|
|
11323
11382
|
backgroundColor: (ctx) => {
|
|
11324
11383
|
const data = ctx.type === "data" ? ctx.raw : void 0;
|
|
11325
|
-
if (!data || data.label ===
|
|
11384
|
+
if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
|
|
11326
11385
|
const rootGroup = data.groups[0];
|
|
11327
11386
|
return groupColors.find((groupColor) => groupColor.label === rootGroup)?.color;
|
|
11328
11387
|
},
|
|
@@ -11463,7 +11522,7 @@ function getTrendingLineDataSet(dataset, config, data) {
|
|
|
11463
11522
|
const borderColor = config.color || lightenColor(rgbaToHex(defaultBorderColor), .5);
|
|
11464
11523
|
return {
|
|
11465
11524
|
type: "line",
|
|
11466
|
-
xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID :
|
|
11525
|
+
xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID : TREND_LINE_XAXIS_ID,
|
|
11467
11526
|
yAxisID: dataset.yAxisID,
|
|
11468
11527
|
label: dataset.label ? _t("Trend line for %s", dataset.label) : "",
|
|
11469
11528
|
data,
|
|
@@ -11576,7 +11635,7 @@ const sunburstHoverPlugin = {
|
|
|
11576
11635
|
for (const metaSet of chart.getSortedVisibleDatasetMetas()) for (const arcElement of metaSet.data) {
|
|
11577
11636
|
const context = arcElement["$context"];
|
|
11578
11637
|
const { datasetIndex, index, dataset, raw } = context;
|
|
11579
|
-
if (raw.label ===
|
|
11638
|
+
if (raw.label === GHOST_SUNBURST_VALUE) continue;
|
|
11580
11639
|
const originalBackgroundColor = typeof dataset.backgroundColor === "function" ? dataset.backgroundColor(context) : dataset.backgroundColor;
|
|
11581
11640
|
if (activeDataPoints.length && !activeDataPoints.some((el) => el.datasetIndex === datasetIndex && el.index === index)) arcElement.options.backgroundColor = lightenColor(originalBackgroundColor, .5);
|
|
11582
11641
|
else arcElement.options.backgroundColor = originalBackgroundColor;
|
|
@@ -11604,7 +11663,7 @@ function drawSunburstChartValues(chart, options, ctx) {
|
|
|
11604
11663
|
const lineHeight = fontSize + Y_PADDING;
|
|
11605
11664
|
for (const dataset of chart._metasets) for (let i = 0; i < dataset._dataset.data.length; i++) {
|
|
11606
11665
|
const rawData = dataset._dataset.data[i];
|
|
11607
|
-
if (rawData.label ===
|
|
11666
|
+
if (rawData.label === GHOST_SUNBURST_VALUE) continue;
|
|
11608
11667
|
const valuesToDisplay = [options.showLabels ? rawData.label : void 0, options.showValues ? options.callback(rawData.value, "y") : void 0].filter(isDefined);
|
|
11609
11668
|
const arc = dataset.data[i];
|
|
11610
11669
|
let { startAngle, endAngle, innerRadius, outerRadius, circumference } = arc;
|
|
@@ -12133,7 +12192,7 @@ function drawScoreChart(structure, canvas, zoom = 1) {
|
|
|
12133
12192
|
canvas.width = dpr * structure.canvas.width * zoom;
|
|
12134
12193
|
canvas.height = dpr * structure.canvas.height * zoom;
|
|
12135
12194
|
ctx.scale(dpr * zoom, dpr * zoom);
|
|
12136
|
-
const availableWidth = structure.canvas.width -
|
|
12195
|
+
const availableWidth = structure.canvas.width - CHART_PADDING;
|
|
12137
12196
|
ctx.fillStyle = structure.canvas.backgroundColor;
|
|
12138
12197
|
ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
|
|
12139
12198
|
if (structure.title) {
|
|
@@ -12241,16 +12300,16 @@ var ScorecardChartConfigBuilder = class {
|
|
|
12241
12300
|
x = (this.width - titleWidth) / 2;
|
|
12242
12301
|
break;
|
|
12243
12302
|
case "right":
|
|
12244
|
-
x = this.width - titleWidth -
|
|
12303
|
+
x = this.width - titleWidth - CHART_PADDING;
|
|
12245
12304
|
break;
|
|
12246
|
-
default: x =
|
|
12305
|
+
default: x = CHART_PADDING;
|
|
12247
12306
|
}
|
|
12248
12307
|
structure.title = {
|
|
12249
12308
|
text: this.title,
|
|
12250
12309
|
style: style.title,
|
|
12251
12310
|
position: {
|
|
12252
12311
|
x,
|
|
12253
|
-
y:
|
|
12312
|
+
y: CHART_PADDING_BOTTOM + titleHeight / 2
|
|
12254
12313
|
}
|
|
12255
12314
|
};
|
|
12256
12315
|
}
|
|
@@ -12261,10 +12320,10 @@ var ScorecardChartConfigBuilder = class {
|
|
|
12261
12320
|
let baselineX;
|
|
12262
12321
|
switch (this.runtime.baselineStyle?.align) {
|
|
12263
12322
|
case "right":
|
|
12264
|
-
baselineX = this.width -
|
|
12323
|
+
baselineX = this.width - CHART_PADDING - baselineDescrWidth - baselineWidth;
|
|
12265
12324
|
break;
|
|
12266
12325
|
case "left":
|
|
12267
|
-
baselineX =
|
|
12326
|
+
baselineX = CHART_PADDING + baselineArrowSize;
|
|
12268
12327
|
break;
|
|
12269
12328
|
default: baselineX = (this.width - baselineWidth - baselineDescrWidth + baselineArrowSize) / 2;
|
|
12270
12329
|
}
|
|
@@ -12274,7 +12333,7 @@ var ScorecardChartConfigBuilder = class {
|
|
|
12274
12333
|
style: style.baselineValue,
|
|
12275
12334
|
position: {
|
|
12276
12335
|
x: baselineX,
|
|
12277
|
-
y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 -
|
|
12336
|
+
y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING_BOTTOM
|
|
12278
12337
|
}
|
|
12279
12338
|
};
|
|
12280
12339
|
if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
|
|
@@ -12302,12 +12361,12 @@ var ScorecardChartConfigBuilder = class {
|
|
|
12302
12361
|
progressBarHeight = this.height * .05;
|
|
12303
12362
|
structure.progressBar = {
|
|
12304
12363
|
position: {
|
|
12305
|
-
x: 2 *
|
|
12364
|
+
x: 2 * CHART_PADDING,
|
|
12306
12365
|
y: this.height * (1 - 2 * BOTTOM_PADDING_RATIO) - baselineHeight - progressBarHeight
|
|
12307
12366
|
},
|
|
12308
12367
|
dimension: {
|
|
12309
12368
|
height: progressBarHeight,
|
|
12310
|
-
width: this.width - 4 *
|
|
12369
|
+
width: this.width - 4 * CHART_PADDING
|
|
12311
12370
|
},
|
|
12312
12371
|
value: this.runtime.progressBar.value,
|
|
12313
12372
|
style: {
|
|
@@ -12321,10 +12380,10 @@ var ScorecardChartConfigBuilder = class {
|
|
|
12321
12380
|
let keyX;
|
|
12322
12381
|
switch (this.runtime.keyValueStyle?.align) {
|
|
12323
12382
|
case "right":
|
|
12324
|
-
keyX = this.width -
|
|
12383
|
+
keyX = this.width - CHART_PADDING - keyDescrWidth - keyWidth;
|
|
12325
12384
|
break;
|
|
12326
12385
|
case "left":
|
|
12327
|
-
keyX =
|
|
12386
|
+
keyX = CHART_PADDING;
|
|
12328
12387
|
break;
|
|
12329
12388
|
default: keyX = (this.width - keyWidth - keyDescrWidth) / 2;
|
|
12330
12389
|
}
|
|
@@ -12332,8 +12391,8 @@ var ScorecardChartConfigBuilder = class {
|
|
|
12332
12391
|
text: this.keyValue,
|
|
12333
12392
|
style: style.keyValue,
|
|
12334
12393
|
position: {
|
|
12335
|
-
x: Math.max(
|
|
12336
|
-
y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) +
|
|
12394
|
+
x: Math.max(CHART_PADDING, keyX),
|
|
12395
|
+
y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) + CHART_PADDING_BOTTOM / 2 + (titleHeight + keyHeight / 2) / 2
|
|
12337
12396
|
}
|
|
12338
12397
|
};
|
|
12339
12398
|
if (structure.key && this.keyDescr) {
|
|
@@ -12390,14 +12449,14 @@ var ScorecardChartConfigBuilder = class {
|
|
|
12390
12449
|
};
|
|
12391
12450
|
}
|
|
12392
12451
|
getTextStyles() {
|
|
12393
|
-
const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ??
|
|
12452
|
+
const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ?? DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE;
|
|
12394
12453
|
const keyValueDescrFontSize = Math.floor(.9 * keyValueFontSize);
|
|
12395
|
-
let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ??
|
|
12454
|
+
let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ?? DEFAULT_SCORECARD_BASELINE_FONT_SIZE;
|
|
12396
12455
|
const baselineDescrFontSize = Math.floor(.9 * baselineValueFontSize);
|
|
12397
12456
|
if (this.runtime.progressBar) baselineValueFontSize /= 1.5;
|
|
12398
12457
|
return {
|
|
12399
12458
|
title: {
|
|
12400
|
-
font: getDefaultContextFont(this.runtime.title.fontSize ??
|
|
12459
|
+
font: getDefaultContextFont(this.runtime.title.fontSize ?? SCORECARD_CHART_TITLE_FONT_SIZE, this.runtime.title.bold, this.runtime.title.italic),
|
|
12401
12460
|
color: this.runtime.title.color ?? this.secondaryFontColor
|
|
12402
12461
|
},
|
|
12403
12462
|
keyValue: {
|
|
@@ -12652,35 +12711,35 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
12652
12711
|
x: boundingRect.width / 2,
|
|
12653
12712
|
y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
|
|
12654
12713
|
};
|
|
12655
|
-
let gaugeValueFontSize =
|
|
12714
|
+
let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
|
|
12656
12715
|
if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
|
|
12657
12716
|
const maxTextWidth = gaugeRect.width / 2;
|
|
12658
12717
|
const gaugeLabel = runtime.gaugeValue?.label || "-";
|
|
12659
12718
|
if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
|
|
12660
12719
|
const minLabelPosition = {
|
|
12661
12720
|
x: gaugeRect.x + gaugeArcWidth / 2,
|
|
12662
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
12721
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
12663
12722
|
};
|
|
12664
12723
|
const maxLabelPosition = {
|
|
12665
12724
|
x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
|
|
12666
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
12725
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
12667
12726
|
};
|
|
12668
12727
|
const textColor = chartMutedFontColor(runtime.background);
|
|
12669
12728
|
const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
|
|
12670
12729
|
let x = 0, titleWidth = 0, titleHeight = 0;
|
|
12671
12730
|
if (runtime.title.text) ({width: titleWidth, height: titleHeight} = computeTextDimension(ctx, runtime.title.text, {
|
|
12672
|
-
fontSize:
|
|
12731
|
+
fontSize: CHART_TITLE_FONT_SIZE,
|
|
12673
12732
|
...runtime.title
|
|
12674
12733
|
}, "px"));
|
|
12675
12734
|
switch (runtime.title.align) {
|
|
12676
12735
|
case "right":
|
|
12677
|
-
x = boundingRect.width - titleWidth -
|
|
12736
|
+
x = boundingRect.width - titleWidth - CHART_PADDING;
|
|
12678
12737
|
break;
|
|
12679
12738
|
case "center":
|
|
12680
12739
|
x = (boundingRect.width - titleWidth) / 2;
|
|
12681
12740
|
break;
|
|
12682
12741
|
default:
|
|
12683
|
-
x =
|
|
12742
|
+
x = CHART_PADDING;
|
|
12684
12743
|
break;
|
|
12685
12744
|
}
|
|
12686
12745
|
return {
|
|
@@ -12688,10 +12747,10 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
12688
12747
|
height: boundingRect.height,
|
|
12689
12748
|
title: {
|
|
12690
12749
|
label: runtime.title.text ?? "",
|
|
12691
|
-
fontSize: runtime.title.fontSize ??
|
|
12750
|
+
fontSize: runtime.title.fontSize ?? CHART_TITLE_FONT_SIZE,
|
|
12692
12751
|
textPosition: {
|
|
12693
12752
|
x,
|
|
12694
|
-
y:
|
|
12753
|
+
y: CHART_PADDING_TOP + titleHeight / 2
|
|
12695
12754
|
},
|
|
12696
12755
|
color: runtime.title.color ?? textColor,
|
|
12697
12756
|
bold: runtime.title.bold,
|
|
@@ -12714,13 +12773,13 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
12714
12773
|
minLabel: {
|
|
12715
12774
|
label: runtime.minValue.label,
|
|
12716
12775
|
textPosition: minLabelPosition,
|
|
12717
|
-
fontSize:
|
|
12776
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
12718
12777
|
color: textColor
|
|
12719
12778
|
},
|
|
12720
12779
|
maxLabel: {
|
|
12721
12780
|
label: runtime.maxValue.label,
|
|
12722
12781
|
textPosition: maxLabelPosition,
|
|
12723
|
-
fontSize:
|
|
12782
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
12724
12783
|
color: textColor
|
|
12725
12784
|
}
|
|
12726
12785
|
};
|
|
@@ -12730,9 +12789,9 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
12730
12789
|
* space for the title and labels.
|
|
12731
12790
|
*/
|
|
12732
12791
|
function getGaugeRect(boundingRect, title) {
|
|
12733
|
-
const titleHeight = title ?
|
|
12734
|
-
const drawHeight = boundingRect.height -
|
|
12735
|
-
const drawWidth = boundingRect.width -
|
|
12792
|
+
const titleHeight = title ? GAUGE_TITLE_SECTION_HEIGHT : 0;
|
|
12793
|
+
const drawHeight = boundingRect.height - GAUGE_PADDING_BOTTOM - titleHeight - GAUGE_PADDING_TOP;
|
|
12794
|
+
const drawWidth = boundingRect.width - GAUGE_PADDING_SIDE * 2;
|
|
12736
12795
|
let gaugeWidth;
|
|
12737
12796
|
let gaugeHeight;
|
|
12738
12797
|
if (drawWidth > 2 * drawHeight) {
|
|
@@ -12743,8 +12802,8 @@ function getGaugeRect(boundingRect, title) {
|
|
|
12743
12802
|
gaugeHeight = drawWidth / 2;
|
|
12744
12803
|
}
|
|
12745
12804
|
return {
|
|
12746
|
-
x:
|
|
12747
|
-
y: titleHeight +
|
|
12805
|
+
x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
|
|
12806
|
+
y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
|
|
12748
12807
|
width: gaugeWidth,
|
|
12749
12808
|
height: gaugeHeight
|
|
12750
12809
|
};
|
|
@@ -12761,20 +12820,20 @@ function getInflectionValues(runtime, gaugeRect, textColor, ctx) {
|
|
|
12761
12820
|
x: gaugeRect.x + gaugeRect.width / 2,
|
|
12762
12821
|
y: gaugeRect.y + gaugeRect.height
|
|
12763
12822
|
};
|
|
12764
|
-
const textStyle = { fontSize:
|
|
12823
|
+
const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
|
|
12765
12824
|
const inflectionValues = [];
|
|
12766
12825
|
const inflectionValuesTextRects = [];
|
|
12767
12826
|
for (const inflectionValue of runtime.inflectionValues) {
|
|
12768
12827
|
const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
|
|
12769
12828
|
const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
|
|
12770
12829
|
const angle = Math.PI - Math.PI * percentage;
|
|
12771
|
-
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2,
|
|
12772
|
-
const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ?
|
|
12830
|
+
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, GAUGE_LABELS_FONT_SIZE);
|
|
12831
|
+
const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? GAUGE_LABELS_FONT_SIZE : 0;
|
|
12773
12832
|
inflectionValuesTextRects.push(textRect);
|
|
12774
12833
|
inflectionValues.push({
|
|
12775
12834
|
rotation: angle,
|
|
12776
12835
|
label: inflectionValue.label,
|
|
12777
|
-
fontSize:
|
|
12836
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
12778
12837
|
color: textColor,
|
|
12779
12838
|
offset
|
|
12780
12839
|
});
|
|
@@ -13386,7 +13445,7 @@ function getElementMargins(el) {
|
|
|
13386
13445
|
|
|
13387
13446
|
//#endregion
|
|
13388
13447
|
//#region src/components/figures/chart/chartJs/zoomable_chart/zoomable_chart_store.ts
|
|
13389
|
-
const TREND_LINE_AXES_IDS = [
|
|
13448
|
+
const TREND_LINE_AXES_IDS = [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID];
|
|
13390
13449
|
const ZOOMABLE_AXIS_IDS = ["x", ...TREND_LINE_AXES_IDS];
|
|
13391
13450
|
var ZoomableChartStore = class extends SpreadsheetStore {
|
|
13392
13451
|
mutators = [
|
|
@@ -13502,7 +13561,7 @@ var ZoomableChartJsComponent = class extends ChartJsComponent {
|
|
|
13502
13561
|
this.removeEventListeners();
|
|
13503
13562
|
}
|
|
13504
13563
|
get containerStyle() {
|
|
13505
|
-
return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${
|
|
13564
|
+
return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${MASTER_CHART_HEIGHT}px)` : "100%" });
|
|
13506
13565
|
}
|
|
13507
13566
|
get masterChartContainerStyle() {
|
|
13508
13567
|
const runtime = this.env.model.getters.getChartRuntime(this.props.chartId);
|
|
@@ -13653,7 +13712,7 @@ var ZoomableChartJsComponent = class extends ChartJsComponent {
|
|
|
13653
13712
|
updateTrendingLineAxes() {
|
|
13654
13713
|
this.store.updateTrendLineConfiguration(this.chartId);
|
|
13655
13714
|
const limits = this.store.currentAxesLimits[this.chartId];
|
|
13656
|
-
for (const axisId of [
|
|
13715
|
+
for (const axisId of [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID]) {
|
|
13657
13716
|
if (!this.chart?.config?.options?.scales?.[axisId] || !limits?.[axisId]) continue;
|
|
13658
13717
|
this.chart.config.options.scales[axisId].min = limits[axisId].min;
|
|
13659
13718
|
this.chart.config.options.scales[axisId].max = limits[axisId].max;
|
|
@@ -14836,7 +14895,7 @@ var MenuPopover = class MenuPopover extends Component {
|
|
|
14836
14895
|
onClickMenu: this.onClickMenu.bind(this),
|
|
14837
14896
|
onMouseEnter: this.onMenuItemMouseEnter.bind(this),
|
|
14838
14897
|
onMouseLeave: this.onMouseLeave.bind(this),
|
|
14839
|
-
width: this.props.width ||
|
|
14898
|
+
width: this.props.width || MENU_WIDTH,
|
|
14840
14899
|
onScroll: this.onScroll.bind(this),
|
|
14841
14900
|
onKeyDown: this.onKeydown.bind(this),
|
|
14842
14901
|
hoveredMenuId,
|
|
@@ -14855,11 +14914,11 @@ var MenuPopover = class MenuPopover extends Component {
|
|
|
14855
14914
|
anchorRect: {
|
|
14856
14915
|
x: this.props.anchorRect.x,
|
|
14857
14916
|
y: this.props.anchorRect.y,
|
|
14858
|
-
width: isRoot ? this.props.anchorRect.width : this.props.width ||
|
|
14859
|
-
height: isRoot ? this.props.anchorRect.height :
|
|
14917
|
+
width: isRoot ? this.props.anchorRect.width : this.props.width || MENU_WIDTH,
|
|
14918
|
+
height: isRoot ? this.props.anchorRect.height : DESKTOP_MENU_ITEM_HEIGHT
|
|
14860
14919
|
},
|
|
14861
14920
|
positioning: this.props.popoverPositioning,
|
|
14862
|
-
verticalOffset: isRoot ? 0 :
|
|
14921
|
+
verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
|
|
14863
14922
|
onPopoverHidden: () => this.closeSubMenu(),
|
|
14864
14923
|
onPopoverMoved: () => this.closeSubMenu(),
|
|
14865
14924
|
maxHeight: this.props.maxHeight
|
|
@@ -14916,8 +14975,8 @@ var MenuPopover = class MenuPopover extends Component {
|
|
|
14916
14975
|
this.subMenu.anchorRect = {
|
|
14917
14976
|
x: getElBoundingRect(this.menuRef()).x,
|
|
14918
14977
|
y: y - (this.subMenu.scrollOffset || 0),
|
|
14919
|
-
width: this.props.width ||
|
|
14920
|
-
height:
|
|
14978
|
+
width: this.props.width || MENU_WIDTH,
|
|
14979
|
+
height: DESKTOP_MENU_ITEM_HEIGHT
|
|
14921
14980
|
};
|
|
14922
14981
|
this.subMenu.menuItems = menu.children(this.env);
|
|
14923
14982
|
this.subMenu.isOpen = true;
|
|
@@ -17021,7 +17080,7 @@ function extractStyle(data, content, styleId, formatId, borderId) {
|
|
|
17021
17080
|
alignment: {
|
|
17022
17081
|
horizontal: style.align === "default" ? void 0 : style.align,
|
|
17023
17082
|
vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
|
|
17024
|
-
wrapText: style.wrapping === "wrap" || content?.includes(
|
|
17083
|
+
wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : void 0,
|
|
17025
17084
|
textRotation: style.rotation ? rotationToXLSX(style.rotation) : void 0,
|
|
17026
17085
|
shrinkToFit: style.wrapping === "clip" ? true : void 0
|
|
17027
17086
|
}
|
|
@@ -17062,7 +17121,7 @@ function normalizeStyle(construct, styles) {
|
|
|
17062
17121
|
function convertFormat(format, numFmtStructure) {
|
|
17063
17122
|
if (!format) return 0;
|
|
17064
17123
|
let formatId = XLSX_FORMAT_MAP[format.format];
|
|
17065
|
-
if (!formatId) formatId = pushElement(format, numFmtStructure) +
|
|
17124
|
+
if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
17066
17125
|
return formatId;
|
|
17067
17126
|
}
|
|
17068
17127
|
/**
|
|
@@ -17323,7 +17382,7 @@ function getCaretDownSvg(color) {
|
|
|
17323
17382
|
width: 512,
|
|
17324
17383
|
height: 512,
|
|
17325
17384
|
paths: [{
|
|
17326
|
-
fillColor: color.textColor ||
|
|
17385
|
+
fillColor: color.textColor || TEXT_BODY_MUTED,
|
|
17327
17386
|
path: CARET_DOWN_PATH
|
|
17328
17387
|
}]
|
|
17329
17388
|
};
|
|
@@ -17334,7 +17393,7 @@ function getCaretUpSvg(color) {
|
|
|
17334
17393
|
width: 512,
|
|
17335
17394
|
height: 512,
|
|
17336
17395
|
paths: [{
|
|
17337
|
-
fillColor: color.textColor ||
|
|
17396
|
+
fillColor: color.textColor || TEXT_BODY_MUTED,
|
|
17338
17397
|
path: CARET_UP_PATH
|
|
17339
17398
|
}]
|
|
17340
17399
|
};
|
|
@@ -17345,7 +17404,7 @@ function getHoveredCaretDownSvg(color) {
|
|
|
17345
17404
|
width: 512,
|
|
17346
17405
|
height: 512,
|
|
17347
17406
|
paths: [{
|
|
17348
|
-
fillColor: color.textColor ||
|
|
17407
|
+
fillColor: color.textColor || TEXT_BODY_MUTED,
|
|
17349
17408
|
path: HOVERED_CARET_DOWN_PATH
|
|
17350
17409
|
}, {
|
|
17351
17410
|
fillColor: color.fillColor || "#fff",
|
|
@@ -18239,14 +18298,14 @@ function convertExcelTrendline(trend) {
|
|
|
18239
18298
|
type: trend.type === "linear" ? "polynomial" : EXCEL_TO_SPREADSHEET_TRENDLINE_TYPE_MAPPING[trend.type],
|
|
18240
18299
|
order: trend.type === "linear" ? 1 : trend.order,
|
|
18241
18300
|
color: trend.color,
|
|
18242
|
-
window: trend.window ||
|
|
18301
|
+
window: trend.window || DEFAULT_WINDOW_SIZE,
|
|
18243
18302
|
display: true
|
|
18244
18303
|
};
|
|
18245
18304
|
}
|
|
18246
18305
|
function convertAnchor(XLSXanchor) {
|
|
18247
18306
|
const offset = {
|
|
18248
|
-
x: convertEMUToDotValue(XLSXanchor.colOffset) -
|
|
18249
|
-
y: convertEMUToDotValue(XLSXanchor.rowOffset) -
|
|
18307
|
+
x: convertEMUToDotValue(XLSXanchor.colOffset) - FIGURE_BORDER_WIDTH,
|
|
18308
|
+
y: convertEMUToDotValue(XLSXanchor.rowOffset) - FIGURE_BORDER_WIDTH
|
|
18250
18309
|
};
|
|
18251
18310
|
return {
|
|
18252
18311
|
col: XLSXanchor.col,
|
|
@@ -18519,8 +18578,8 @@ function getSheetDims(sheet) {
|
|
|
18519
18578
|
dims[0] = Math.max(dims[0], fig.anchors[fig.anchors.length - 1]?.col ?? 0);
|
|
18520
18579
|
dims[1] = Math.max(dims[1], fig.anchors[fig.anchors.length - 1]?.row ?? 0);
|
|
18521
18580
|
}
|
|
18522
|
-
dims[0] = Math.max(dims[0] + 5,
|
|
18523
|
-
dims[1] = Math.max(dims[1] + 5,
|
|
18581
|
+
dims[0] = Math.max(dims[0] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
|
|
18582
|
+
dims[1] = Math.max(dims[1] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
|
|
18524
18583
|
return dims;
|
|
18525
18584
|
}
|
|
18526
18585
|
/**
|
|
@@ -19704,7 +19763,7 @@ var XlsxBaseExtractor = class {
|
|
|
19704
19763
|
rgb = this.getThemeColor(themeIndex, theme.clrScheme);
|
|
19705
19764
|
} else {
|
|
19706
19765
|
rgb = this.extractAttr(colorElement, "rgb")?.asString();
|
|
19707
|
-
rgb = rgb ===
|
|
19766
|
+
rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
|
|
19708
19767
|
}
|
|
19709
19768
|
return {
|
|
19710
19769
|
rgb: rgb || defaultColor,
|
|
@@ -20966,7 +21025,7 @@ function getPathsOfContent(contentType, xmls) {
|
|
|
20966
21025
|
* Get the corresponding relationship file for a given xml file in a XLSX directory.
|
|
20967
21026
|
*/
|
|
20968
21027
|
function getRelationFile(file, xmls) {
|
|
20969
|
-
if (file ===
|
|
21028
|
+
if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
|
|
20970
21029
|
let relsFile = "";
|
|
20971
21030
|
const pathParts = file.split("/");
|
|
20972
21031
|
for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
|
|
@@ -21411,7 +21470,7 @@ function predictLinearValues(Y, X, newX, computeIntercept) {
|
|
|
21411
21470
|
});
|
|
21412
21471
|
return newY.length === newX.length ? newY : transposeMatrix(newY);
|
|
21413
21472
|
}
|
|
21414
|
-
function getMovingAverageValues(dataset, labels, windowSize =
|
|
21473
|
+
function getMovingAverageValues(dataset, labels, windowSize = DEFAULT_WINDOW_SIZE) {
|
|
21415
21474
|
const values = [];
|
|
21416
21475
|
for (let i = 0; i < windowSize - 1; i++) values.push({
|
|
21417
21476
|
x: labels[i],
|
|
@@ -22093,7 +22152,7 @@ function normalizeV9(formula) {
|
|
|
22093
22152
|
if (token.type === "REFERENCE" && cellReference.test(token.value)) {
|
|
22094
22153
|
const value = token.value.trim();
|
|
22095
22154
|
if (!dependencies.includes(value)) dependencies.push(value);
|
|
22096
|
-
return `${
|
|
22155
|
+
return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
|
|
22097
22156
|
} else return token.value;
|
|
22098
22157
|
})),
|
|
22099
22158
|
dependencies
|
|
@@ -22289,7 +22348,7 @@ migrationStepRegistry.add("0.1", { migrate(data) {
|
|
|
22289
22348
|
if (cell.formula) {
|
|
22290
22349
|
let { text, dependencies } = cell.formula;
|
|
22291
22350
|
for (const [index, d] of Object.entries(dependencies)) {
|
|
22292
|
-
const stringPosition = `\\${
|
|
22351
|
+
const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
|
|
22293
22352
|
text = text.replace(new RegExp(stringPosition, "g"), d);
|
|
22294
22353
|
}
|
|
22295
22354
|
cell.content = text;
|
|
@@ -23846,8 +23905,8 @@ const CREATE_CHART = (env) => {
|
|
|
23846
23905
|
zones = getters.getSelectedZones();
|
|
23847
23906
|
}
|
|
23848
23907
|
const size = {
|
|
23849
|
-
width:
|
|
23850
|
-
height:
|
|
23908
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
23909
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
23851
23910
|
};
|
|
23852
23911
|
const { col, row, offset } = centerFigurePosition(getters, size);
|
|
23853
23912
|
if (env.model.dispatch("CREATE_CHART", {
|
|
@@ -23869,8 +23928,8 @@ const CREATE_CAROUSEL = (env) => {
|
|
|
23869
23928
|
const figureId = UuidGenerator.smallUuid();
|
|
23870
23929
|
const sheetId = getters.getActiveSheetId();
|
|
23871
23930
|
const size = {
|
|
23872
|
-
width:
|
|
23873
|
-
height:
|
|
23931
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
23932
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
23874
23933
|
};
|
|
23875
23934
|
const { col, row, offset } = centerFigurePosition(getters, size);
|
|
23876
23935
|
if (env.model.dispatch("CREATE_CAROUSEL", {
|
|
@@ -23920,7 +23979,7 @@ const REINSERT_STATIC_PIVOT_CHILDREN = (env) => env.model.getters.getPivotIds().
|
|
|
23920
23979
|
execute: (env) => {
|
|
23921
23980
|
const zone = env.model.getters.getSelectedZone();
|
|
23922
23981
|
const table = env.model.getters.getPivot(pivotId).getExpandedTableStructure();
|
|
23923
|
-
if (table.numberOfCells >
|
|
23982
|
+
if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
|
|
23924
23983
|
env.notifyUser({
|
|
23925
23984
|
type: "warning",
|
|
23926
23985
|
text: getPivotTooBigErrorMessage(table.numberOfCells, env.model.getters.getLocale()),
|
|
@@ -24888,7 +24947,7 @@ var ColorPicker = class extends Component {
|
|
|
24888
24947
|
}
|
|
24889
24948
|
get sliderStyle() {
|
|
24890
24949
|
const hue = this.state.currentHslaColor?.h || 0;
|
|
24891
|
-
return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) -
|
|
24950
|
+
return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - ICON_EDGE_LENGTH / 2}px` });
|
|
24892
24951
|
}
|
|
24893
24952
|
get pointerStyle() {
|
|
24894
24953
|
const { s, l } = this.state.currentHslaColor || {
|
|
@@ -25055,6 +25114,11 @@ var NumberEditor = class extends Component {
|
|
|
25055
25114
|
rootEditorRef = signal(null);
|
|
25056
25115
|
valueListRef = signal(null);
|
|
25057
25116
|
DOMFocusableElementStore;
|
|
25117
|
+
/**
|
|
25118
|
+
* Skips the change event triggered when moving focus out of the input.
|
|
25119
|
+
* The value has already been committed by `onInputKeydown`.
|
|
25120
|
+
*/
|
|
25121
|
+
skipNextInputChange = false;
|
|
25058
25122
|
setup() {
|
|
25059
25123
|
this.DOMFocusableElementStore = useStore(DOMFocusableElementStore);
|
|
25060
25124
|
useExternalListener(window, "click", this.onExternalClick, { capture: true });
|
|
@@ -25089,11 +25153,14 @@ var NumberEditor = class extends Component {
|
|
|
25089
25153
|
this.dropdown.isOpen = false;
|
|
25090
25154
|
}
|
|
25091
25155
|
setValue(valueStr) {
|
|
25092
|
-
const value = clip(Math.
|
|
25156
|
+
const value = clip(Math.round(parseFloat(valueStr)), this.props.min, this.props.max);
|
|
25157
|
+
if (isNaN(value)) return;
|
|
25093
25158
|
this.props.onValueChange(value);
|
|
25094
25159
|
this.closeList();
|
|
25160
|
+
return value;
|
|
25095
25161
|
}
|
|
25096
25162
|
setValueFromInput(ev) {
|
|
25163
|
+
if (this.skipNextInputChange) return;
|
|
25097
25164
|
this.setValue(ev.target.value);
|
|
25098
25165
|
}
|
|
25099
25166
|
setValueFromList(valueStr) {
|
|
@@ -25107,19 +25174,26 @@ var NumberEditor = class extends Component {
|
|
|
25107
25174
|
ev.target.select();
|
|
25108
25175
|
}
|
|
25109
25176
|
onInputKeydown(ev) {
|
|
25110
|
-
|
|
25111
|
-
|
|
25112
|
-
|
|
25113
|
-
|
|
25114
|
-
|
|
25115
|
-
|
|
25116
|
-
|
|
25117
|
-
|
|
25118
|
-
|
|
25119
|
-
|
|
25120
|
-
|
|
25121
|
-
|
|
25177
|
+
const target = ev.target;
|
|
25178
|
+
switch (ev.key) {
|
|
25179
|
+
case "Enter":
|
|
25180
|
+
case "Tab": {
|
|
25181
|
+
ev.preventDefault();
|
|
25182
|
+
ev.stopPropagation();
|
|
25183
|
+
const value = this.setValue(target.value);
|
|
25184
|
+
if (value === void 0) return;
|
|
25185
|
+
target.value = `${value}`;
|
|
25186
|
+
break;
|
|
25187
|
+
}
|
|
25188
|
+
case "Escape":
|
|
25189
|
+
target.value = `${this.props.currentValue}`;
|
|
25190
|
+
this.closeList();
|
|
25191
|
+
break;
|
|
25192
|
+
default: return;
|
|
25122
25193
|
}
|
|
25194
|
+
this.skipNextInputChange = true;
|
|
25195
|
+
this.DOMFocusableElementStore.focus();
|
|
25196
|
+
this.skipNextInputChange = false;
|
|
25123
25197
|
}
|
|
25124
25198
|
};
|
|
25125
25199
|
|
|
@@ -25684,7 +25758,7 @@ function isNavigablePosition(getters, position) {
|
|
|
25684
25758
|
function drawHighlight(renderingContext, highlight, rect) {
|
|
25685
25759
|
const { x, y, width, height } = rect;
|
|
25686
25760
|
if (width < 0 || height < 0) return;
|
|
25687
|
-
const color = highlight.color ||
|
|
25761
|
+
const color = highlight.color || HIGHLIGHT_COLOR$1;
|
|
25688
25762
|
const { ctx } = renderingContext;
|
|
25689
25763
|
ctx.save();
|
|
25690
25764
|
if (!highlight.noBorder) {
|
|
@@ -26622,7 +26696,7 @@ var AxisDesignEditor = class extends Component {
|
|
|
26622
26696
|
axesList: types$1.ArrayOf()
|
|
26623
26697
|
});
|
|
26624
26698
|
state = proxy({ currentAxis: "x" });
|
|
26625
|
-
defaultFontSize =
|
|
26699
|
+
defaultFontSize = CHART_AXIS_TITLE_FONT_SIZE;
|
|
26626
26700
|
get axisTitleStyle() {
|
|
26627
26701
|
return this.props.definition.axesDesign?.[this.state.currentAxis]?.title ?? {};
|
|
26628
26702
|
}
|
|
@@ -26853,7 +26927,7 @@ var GeneralDesignEditor = class extends Component {
|
|
|
26853
26927
|
definition: types$1.ChartDefinition(),
|
|
26854
26928
|
canUpdateChart: types$1.function(),
|
|
26855
26929
|
updateChart: types$1.function(),
|
|
26856
|
-
defaultChartTitleFontSize: types$1.number().optional(
|
|
26930
|
+
defaultChartTitleFontSize: types$1.number().optional(CHART_TITLE_FONT_SIZE)
|
|
26857
26931
|
});
|
|
26858
26932
|
state;
|
|
26859
26933
|
setup() {
|
|
@@ -27121,11 +27195,11 @@ var SeriesWithAxisDesignEditor = class extends Component {
|
|
|
27121
27195
|
return Math.min(10, runtime.chartJsConfig.data.datasets[index].data.length - 1);
|
|
27122
27196
|
}
|
|
27123
27197
|
get defaultWindowSize() {
|
|
27124
|
-
return
|
|
27198
|
+
return DEFAULT_WINDOW_SIZE;
|
|
27125
27199
|
}
|
|
27126
27200
|
onChangeMovingAverageWindow(dataSetId, value) {
|
|
27127
|
-
let window = parseInt(value) ||
|
|
27128
|
-
if (window <= 1) window =
|
|
27201
|
+
let window = parseInt(value) || DEFAULT_WINDOW_SIZE;
|
|
27202
|
+
if (window <= 1) window = DEFAULT_WINDOW_SIZE;
|
|
27129
27203
|
this.updateTrendLineValue(dataSetId, { window });
|
|
27130
27204
|
}
|
|
27131
27205
|
getDataSeriesColor(dataSetId) {
|
|
@@ -28264,19 +28338,19 @@ function getTopPaddingForDashboard(definition, getters) {
|
|
|
28264
28338
|
//#region src/helpers/figures/charts/runtime/chartjs_layout.ts
|
|
28265
28339
|
function getChartLayout(definition, args) {
|
|
28266
28340
|
return { padding: {
|
|
28267
|
-
left:
|
|
28268
|
-
right:
|
|
28269
|
-
top: Math.max(
|
|
28270
|
-
bottom:
|
|
28341
|
+
left: CHART_PADDING,
|
|
28342
|
+
right: CHART_PADDING,
|
|
28343
|
+
top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
|
|
28344
|
+
bottom: CHART_PADDING_BOTTOM
|
|
28271
28345
|
} };
|
|
28272
28346
|
}
|
|
28273
28347
|
function getCalendarChartLayout(definition, args) {
|
|
28274
28348
|
const legendPosition = definition.legendPosition;
|
|
28275
28349
|
return { padding: {
|
|
28276
|
-
left:
|
|
28277
|
-
right:
|
|
28278
|
-
top: Math.max(
|
|
28279
|
-
bottom:
|
|
28350
|
+
left: CHART_PADDING + (legendPosition === "left" ? CHART_COLORSCALE_WIDTH : 0),
|
|
28351
|
+
right: CHART_PADDING + (legendPosition === "right" ? CHART_COLORSCALE_WIDTH : 0),
|
|
28352
|
+
top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
|
|
28353
|
+
bottom: CHART_PADDING_BOTTOM
|
|
28280
28354
|
} };
|
|
28281
28355
|
}
|
|
28282
28356
|
|
|
@@ -28478,9 +28552,9 @@ function getComboChartLegend(definition, args) {
|
|
|
28478
28552
|
}
|
|
28479
28553
|
function getWaterfallChartLegend(definition, args) {
|
|
28480
28554
|
const fontColor = chartFontColor(definition.background);
|
|
28481
|
-
const negativeColor = definition.negativeValuesColor ||
|
|
28482
|
-
const positiveColor = definition.positiveValuesColor ||
|
|
28483
|
-
const subTotalColor = definition.subTotalValuesColor ||
|
|
28555
|
+
const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
28556
|
+
const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
28557
|
+
const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
28484
28558
|
return {
|
|
28485
28559
|
...getLegendDisplayOptions(definition),
|
|
28486
28560
|
labels: {
|
|
@@ -28806,11 +28880,11 @@ function getChartTitle({ title, legendPosition, background }, getters) {
|
|
|
28806
28880
|
color: title?.color ?? fontColor,
|
|
28807
28881
|
align: title.align === "center" ? "center" : title.align === "right" ? "end" : "start",
|
|
28808
28882
|
font: {
|
|
28809
|
-
size: title.fontSize ??
|
|
28883
|
+
size: title.fontSize ?? CHART_TITLE_FONT_SIZE,
|
|
28810
28884
|
weight: title.bold ? "bold" : "normal",
|
|
28811
28885
|
style: title.italic ? "italic" : "normal"
|
|
28812
28886
|
},
|
|
28813
|
-
padding: { bottom: legendPosition === "top" ? 0 :
|
|
28887
|
+
padding: { bottom: legendPosition === "top" ? 0 : CHART_PADDING }
|
|
28814
28888
|
};
|
|
28815
28889
|
}
|
|
28816
28890
|
|
|
@@ -29225,7 +29299,7 @@ const BarChart = {
|
|
|
29225
29299
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
29226
29300
|
return {
|
|
29227
29301
|
...definition,
|
|
29228
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
29302
|
+
backgroundColor: toXlsxHexColor(definition.background || DEFAULT_CHART_BACKGROUND_COLOR),
|
|
29229
29303
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
29230
29304
|
dataSets,
|
|
29231
29305
|
labelRange,
|
|
@@ -29588,7 +29662,7 @@ const LineChart = {
|
|
|
29588
29662
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
29589
29663
|
return {
|
|
29590
29664
|
...definition,
|
|
29591
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
29665
|
+
backgroundColor: toXlsxHexColor(definition.background || DEFAULT_CHART_BACKGROUND_COLOR),
|
|
29592
29666
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
29593
29667
|
dataSets,
|
|
29594
29668
|
labelRange,
|
|
@@ -29670,7 +29744,7 @@ const PieChart = {
|
|
|
29670
29744
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
29671
29745
|
return {
|
|
29672
29746
|
...definition,
|
|
29673
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
29747
|
+
backgroundColor: toXlsxHexColor(definition.background || DEFAULT_CHART_BACKGROUND_COLOR),
|
|
29674
29748
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
29675
29749
|
dataSets,
|
|
29676
29750
|
labelRange
|
|
@@ -29792,7 +29866,7 @@ var helpers_index_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
29792
29866
|
PieChart: () => PieChart,
|
|
29793
29867
|
SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING: () => SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING,
|
|
29794
29868
|
ScorecardChart: () => ScorecardChart$1,
|
|
29795
|
-
TREND_LINE_XAXIS_ID: () =>
|
|
29869
|
+
TREND_LINE_XAXIS_ID: () => TREND_LINE_XAXIS_ID,
|
|
29796
29870
|
WaterfallChart: () => WaterfallChart,
|
|
29797
29871
|
adaptChartRange: () => adaptChartRange,
|
|
29798
29872
|
chartFontColor: () => chartFontColor,
|
|
@@ -30670,12 +30744,12 @@ var ContentEditableHelper = class {
|
|
|
30670
30744
|
for (let current = it.next(); !current.done; current = it.next()) {
|
|
30671
30745
|
if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) {
|
|
30672
30746
|
if (isFirstParagraph) isFirstParagraph = false;
|
|
30673
|
-
else text +=
|
|
30747
|
+
else text += NEWLINE;
|
|
30674
30748
|
emptyParagraph = isEmptyParagraph(current.value);
|
|
30675
30749
|
continue;
|
|
30676
30750
|
}
|
|
30677
30751
|
if (!current.value.hasChildNodes()) {
|
|
30678
|
-
if (current.value.nodeName === "BR" && !emptyParagraph) text +=
|
|
30752
|
+
if (current.value.nodeName === "BR" && !emptyParagraph) text += NEWLINE;
|
|
30679
30753
|
text += current.value.textContent;
|
|
30680
30754
|
}
|
|
30681
30755
|
}
|
|
@@ -30869,7 +30943,7 @@ var Composer = class extends Component {
|
|
|
30869
30943
|
if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
|
|
30870
30944
|
} else {
|
|
30871
30945
|
assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
|
|
30872
|
-
if (composerRect.left + ASSISTANT_WIDTH +
|
|
30946
|
+
if (composerRect.left + ASSISTANT_WIDTH + SCROLLBAR_WIDTH + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
|
|
30873
30947
|
}
|
|
30874
30948
|
return assistantStyle;
|
|
30875
30949
|
}
|
|
@@ -30967,7 +31041,7 @@ var Composer = class extends Component {
|
|
|
30967
31041
|
const start = Math.min(selection.start, selection.end);
|
|
30968
31042
|
const end = Math.max(selection.start, selection.end);
|
|
30969
31043
|
this.props.composerStore.stopComposerRangeSelection();
|
|
30970
|
-
this.props.composerStore.setCurrentContent(content.slice(0, start) +
|
|
31044
|
+
this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
|
|
30971
31045
|
start: start + 1,
|
|
30972
31046
|
end: start + 1
|
|
30973
31047
|
});
|
|
@@ -31146,7 +31220,7 @@ var Composer = class extends Component {
|
|
|
31146
31220
|
const { end, start } = this.props.composerStore.composerSelection;
|
|
31147
31221
|
for (let index = 0; index < tokens.length; index++) {
|
|
31148
31222
|
const token = tokens[index];
|
|
31149
|
-
let color = token.color ||
|
|
31223
|
+
let color = token.color || DEFAULT_TOKEN_COLOR;
|
|
31150
31224
|
if (token.isBlurred) color = setColorAlpha(color, .5);
|
|
31151
31225
|
const classes = [];
|
|
31152
31226
|
if (token.type === "REFERENCE" && this.props.composerStore.tokenAtCursor === token && this.props.composerStore.editionMode === "selecting") classes.push("text-decoration-underline");
|
|
@@ -31177,8 +31251,8 @@ var Composer = class extends Component {
|
|
|
31177
31251
|
splitHtmlContentIntoLines(contents) {
|
|
31178
31252
|
const contentSplitInLines = [];
|
|
31179
31253
|
let currentLine = [];
|
|
31180
|
-
for (const content of contents) if (content.value.includes(
|
|
31181
|
-
const lines = content.value.split(
|
|
31254
|
+
for (const content of contents) if (content.value.includes(NEWLINE)) {
|
|
31255
|
+
const lines = content.value.split(NEWLINE);
|
|
31182
31256
|
const lastLine = lines.pop();
|
|
31183
31257
|
for (const line of lines) {
|
|
31184
31258
|
currentLine.push({
|
|
@@ -32076,11 +32150,11 @@ var AbstractComposerStore = class extends SpreadsheetStore {
|
|
|
32076
32150
|
getTokenColor(token) {
|
|
32077
32151
|
if (token.type === "REFERENCE") {
|
|
32078
32152
|
const { xc, sheetName } = splitReference(token.value);
|
|
32079
|
-
return this.rangeXCColor(xc, sheetName) ||
|
|
32153
|
+
return this.rangeXCColor(xc, sheetName) || DEFAULT_TOKEN_COLOR;
|
|
32080
32154
|
}
|
|
32081
32155
|
if (token.type === "SYMBOL") {
|
|
32082
32156
|
const namedRange = this.getters.getNamedRange(token.value);
|
|
32083
|
-
if (namedRange) return this.rangeColor(namedRange.range) ||
|
|
32157
|
+
if (namedRange) return this.rangeColor(namedRange.range) || DEFAULT_TOKEN_COLOR;
|
|
32084
32158
|
const upperCaseValue = token.value.toUpperCase();
|
|
32085
32159
|
if (upperCaseValue === "TRUE" || upperCaseValue === "FALSE") return tokenColors.NUMBER;
|
|
32086
32160
|
if (upperCaseValue in functionRegistry.content) return tokenColors.FUNCTION;
|
|
@@ -32088,7 +32162,7 @@ var AbstractComposerStore = class extends SpreadsheetStore {
|
|
|
32088
32162
|
if (["LEFT_PAREN", "RIGHT_PAREN"].includes(token.type)) {
|
|
32089
32163
|
if (token.parenthesesCode === "") return tokenColors.ORPHAN_RIGHT_PAREN;
|
|
32090
32164
|
}
|
|
32091
|
-
return tokenColors[token.type] ||
|
|
32165
|
+
return tokenColors[token.type] || DEFAULT_TOKEN_COLOR;
|
|
32092
32166
|
}
|
|
32093
32167
|
rangeXCColor(xc, sheetName) {
|
|
32094
32168
|
const refSheet = sheetName ? this.model.getters.getSheetIdByName(sheetName) : this.sheetId;
|
|
@@ -32807,7 +32881,7 @@ var PieChartDesignPanel = class extends Component {
|
|
|
32807
32881
|
});
|
|
32808
32882
|
}
|
|
32809
32883
|
get defaultHoleSize() {
|
|
32810
|
-
return
|
|
32884
|
+
return DEFAULT_DOUGHNUT_CHART_HOLE_SIZE;
|
|
32811
32885
|
}
|
|
32812
32886
|
updateEditedValues(selectedIndex) {
|
|
32813
32887
|
this.state.index = parseInt(selectedIndex);
|
|
@@ -32979,7 +33053,7 @@ var ScorecardChartDesignPanel = class extends Component {
|
|
|
32979
33053
|
return this.props.definition.baselineMode === "progress" ? _t("Progress bar colors") : _t("Baseline colors");
|
|
32980
33054
|
}
|
|
32981
33055
|
get defaultScorecardTitleFontSize() {
|
|
32982
|
-
return
|
|
33056
|
+
return SCORECARD_CHART_TITLE_FONT_SIZE;
|
|
32983
33057
|
}
|
|
32984
33058
|
translate(term) {
|
|
32985
33059
|
return this.env.model.getters.dynamicTranslate(term);
|
|
@@ -33000,14 +33074,14 @@ var ScorecardChartDesignPanel = class extends Component {
|
|
|
33000
33074
|
get keyStyle() {
|
|
33001
33075
|
return {
|
|
33002
33076
|
align: "center",
|
|
33003
|
-
fontSize:
|
|
33077
|
+
fontSize: DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE,
|
|
33004
33078
|
...this.props.definition.keyDescr
|
|
33005
33079
|
};
|
|
33006
33080
|
}
|
|
33007
33081
|
get baselineStyle() {
|
|
33008
33082
|
return {
|
|
33009
33083
|
align: "center",
|
|
33010
|
-
fontSize:
|
|
33084
|
+
fontSize: DEFAULT_SCORECARD_BASELINE_FONT_SIZE,
|
|
33011
33085
|
...this.props.definition.baselineDescr
|
|
33012
33086
|
};
|
|
33013
33087
|
}
|
|
@@ -33250,13 +33324,13 @@ var WaterfallChartDesignPanel = class extends Component {
|
|
|
33250
33324
|
}];
|
|
33251
33325
|
}
|
|
33252
33326
|
get positiveValuesColor() {
|
|
33253
|
-
return this.props.definition.positiveValuesColor ||
|
|
33327
|
+
return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
33254
33328
|
}
|
|
33255
33329
|
get negativeValuesColor() {
|
|
33256
|
-
return this.props.definition.negativeValuesColor ||
|
|
33330
|
+
return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
33257
33331
|
}
|
|
33258
33332
|
get subTotalValuesColor() {
|
|
33259
|
-
return this.props.definition.subTotalValuesColor ||
|
|
33333
|
+
return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
33260
33334
|
}
|
|
33261
33335
|
updateVerticalAxisPosition(value) {
|
|
33262
33336
|
this.props.updateChart(this.props.chartId, { verticalAxisPosition: value });
|
|
@@ -35597,7 +35671,7 @@ var ConditionalFormattingEditorStore = class extends SpreadsheetStore {
|
|
|
35597
35671
|
get previewGradient() {
|
|
35598
35672
|
const rule = this.state.rules.colorScale;
|
|
35599
35673
|
const minColor = colorNumberToHex(rule.minimum.color);
|
|
35600
|
-
const midColor = colorNumberToHex(rule.midpoint?.color ||
|
|
35674
|
+
const midColor = colorNumberToHex(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
35601
35675
|
const maxColor = colorNumberToHex(rule.maximum.color);
|
|
35602
35676
|
const baseString = "linear-gradient(to right, ";
|
|
35603
35677
|
return cssPropertiesToCss({
|
|
@@ -37873,7 +37947,7 @@ var PivotMeasureDisplayPanelStore = class extends SpreadsheetStore {
|
|
|
37873
37947
|
return {
|
|
37874
37948
|
type: measureDisplayType,
|
|
37875
37949
|
fieldNameWithGranularity,
|
|
37876
|
-
value: value ??
|
|
37950
|
+
value: value ?? PREVIOUS_VALUE
|
|
37877
37951
|
};
|
|
37878
37952
|
}
|
|
37879
37953
|
}
|
|
@@ -39377,6 +39451,117 @@ function isValueFiltered(getters, sheetId, data, filter, preComputedCriterion) {
|
|
|
39377
39451
|
return false;
|
|
39378
39452
|
}
|
|
39379
39453
|
|
|
39454
|
+
//#endregion
|
|
39455
|
+
//#region src/helpers/pivot/spreadsheet_pivot/data_entries_index_spreadsheet_pivot.ts
|
|
39456
|
+
const EMPTY_DATA_ENTRIES = [];
|
|
39457
|
+
/**
|
|
39458
|
+
* Index of the data entries of a spreadsheet pivot, used to retrieve the
|
|
39459
|
+
* entries matching a pivot domain without scanning all the entries.
|
|
39460
|
+
*
|
|
39461
|
+
* Starting with the row dimensions, one can descend either in the
|
|
39462
|
+
* next row dimension (`rowChildren`) or in the first column dimension
|
|
39463
|
+
* (`colChildren`).
|
|
39464
|
+
*
|
|
39465
|
+
* e.g. with the rows ["continent", "city"] and the columns ["team"]
|
|
39466
|
+
*
|
|
39467
|
+
* root -> all the entries
|
|
39468
|
+
* ├── (col) Team 1 -> [team=Team 1]
|
|
39469
|
+
* ├── (col) Team 2 -> [team=Team 2]
|
|
39470
|
+
* ├── (row) Europe -> [continent=Europe]
|
|
39471
|
+
* │ ├── (col) Team 1 -> [continent=Europe, team=Team 1]
|
|
39472
|
+
* │ ├── (row) Brussels -> [continent=Europe, city=Brussels]
|
|
39473
|
+
* │ │ └── (col) Team 1 -> [continent=Europe, city=Brussels, team=Team 1]
|
|
39474
|
+
* │ └── (row) Paris
|
|
39475
|
+
* │ └── ...
|
|
39476
|
+
* └── (row) North America
|
|
39477
|
+
* └── ...
|
|
39478
|
+
*
|
|
39479
|
+
* Each entry is inserted once per couple (row prefix, column prefix) it belongs
|
|
39480
|
+
* to, which is exactly the number of pivot cells it contributes to.
|
|
39481
|
+
*/
|
|
39482
|
+
var PivotDataEntriesIndex = class {
|
|
39483
|
+
rowDimensions;
|
|
39484
|
+
colDimensions;
|
|
39485
|
+
root = createIndexNode();
|
|
39486
|
+
constructor(dataEntries, rowDimensions, colDimensions) {
|
|
39487
|
+
this.rowDimensions = rowDimensions;
|
|
39488
|
+
this.colDimensions = colDimensions;
|
|
39489
|
+
for (const entry of dataEntries) this.addEntry(entry);
|
|
39490
|
+
}
|
|
39491
|
+
/**
|
|
39492
|
+
* Get the data entries matching the given domain.
|
|
39493
|
+
*/
|
|
39494
|
+
getDataEntries(domain) {
|
|
39495
|
+
const rowKeys = [];
|
|
39496
|
+
const colKeys = [];
|
|
39497
|
+
for (const domainNode of domain) {
|
|
39498
|
+
const rowDimension = this.rowDimensions[rowKeys.length];
|
|
39499
|
+
if (rowDimension?.nameWithGranularity === domainNode.field) {
|
|
39500
|
+
rowKeys.push(toGroupKey(domainNode.value, rowDimension));
|
|
39501
|
+
continue;
|
|
39502
|
+
}
|
|
39503
|
+
const colDimension = this.colDimensions[colKeys.length];
|
|
39504
|
+
if (colDimension?.nameWithGranularity !== domainNode.field) throw new EvaluationError(_t("Dimension %s does not exist", domainNode.field));
|
|
39505
|
+
colKeys.push(toGroupKey(domainNode.value, colDimension));
|
|
39506
|
+
}
|
|
39507
|
+
let node = this.root;
|
|
39508
|
+
for (const key of rowKeys) {
|
|
39509
|
+
node = node.rowChildren?.get(key);
|
|
39510
|
+
if (!node) return EMPTY_DATA_ENTRIES;
|
|
39511
|
+
}
|
|
39512
|
+
for (const key of colKeys) {
|
|
39513
|
+
node = node.colChildren?.get(key);
|
|
39514
|
+
if (!node) return EMPTY_DATA_ENTRIES;
|
|
39515
|
+
}
|
|
39516
|
+
return node.entries;
|
|
39517
|
+
}
|
|
39518
|
+
addEntry(entry) {
|
|
39519
|
+
let rowNode = this.root;
|
|
39520
|
+
this.addEntryToColumns(rowNode, entry);
|
|
39521
|
+
for (const dimension of this.rowDimensions) {
|
|
39522
|
+
rowNode = getOrCreateChild(rowNode, "rowChildren", getEntryGroupKey(entry, dimension));
|
|
39523
|
+
this.addEntryToColumns(rowNode, entry);
|
|
39524
|
+
}
|
|
39525
|
+
}
|
|
39526
|
+
/**
|
|
39527
|
+
* Add the entry to the given row node, and to each of its column prefixes.
|
|
39528
|
+
*/
|
|
39529
|
+
addEntryToColumns(rowNode, entry) {
|
|
39530
|
+
rowNode.entries.push(entry);
|
|
39531
|
+
let node = rowNode;
|
|
39532
|
+
for (const dimension of this.colDimensions) {
|
|
39533
|
+
node = getOrCreateChild(node, "colChildren", getEntryGroupKey(entry, dimension));
|
|
39534
|
+
node.entries.push(entry);
|
|
39535
|
+
}
|
|
39536
|
+
}
|
|
39537
|
+
};
|
|
39538
|
+
function createIndexNode() {
|
|
39539
|
+
return {
|
|
39540
|
+
entries: [],
|
|
39541
|
+
rowChildren: void 0,
|
|
39542
|
+
colChildren: void 0
|
|
39543
|
+
};
|
|
39544
|
+
}
|
|
39545
|
+
function getOrCreateChild(node, axis, key) {
|
|
39546
|
+
let children = node[axis];
|
|
39547
|
+
if (!children) {
|
|
39548
|
+
children = /* @__PURE__ */ new Map();
|
|
39549
|
+
node[axis] = children;
|
|
39550
|
+
}
|
|
39551
|
+
let child = children.get(key);
|
|
39552
|
+
if (!child) {
|
|
39553
|
+
child = createIndexNode();
|
|
39554
|
+
children.set(key, child);
|
|
39555
|
+
}
|
|
39556
|
+
return child;
|
|
39557
|
+
}
|
|
39558
|
+
function getEntryGroupKey(entry, dimension) {
|
|
39559
|
+
return toGroupKey(entry[dimension.nameWithGranularity]?.value, dimension);
|
|
39560
|
+
}
|
|
39561
|
+
function toGroupKey(value, dimension) {
|
|
39562
|
+
return dimension.type === "char" ? String(value) : value;
|
|
39563
|
+
}
|
|
39564
|
+
|
|
39380
39565
|
//#endregion
|
|
39381
39566
|
//#region src/helpers/pivot/pivot_domain_helpers.ts
|
|
39382
39567
|
function getDomainOfParentRow(pivot, domain) {
|
|
@@ -39482,7 +39667,7 @@ function getPreviousOrNextValueDomain(pivot, domain, fieldNameWithGranularity, d
|
|
|
39482
39667
|
if (value === void 0) return;
|
|
39483
39668
|
const valueIndex = values.indexOf(value);
|
|
39484
39669
|
if (value === void 0 || valueIndex === -1) return;
|
|
39485
|
-
return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction ===
|
|
39670
|
+
return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === PREVIOUS_VALUE ? -1 : 1), 0, values.length - 1)]);
|
|
39486
39671
|
}
|
|
39487
39672
|
function domainToString(domain) {
|
|
39488
39673
|
return domain ? domain.map(domainNodeToString).join(", ") : "";
|
|
@@ -40138,6 +40323,11 @@ var SpreadsheetPivot = class {
|
|
|
40138
40323
|
*/
|
|
40139
40324
|
filteredDataEntries = [];
|
|
40140
40325
|
/**
|
|
40326
|
+
* This index is used to retrieve the data entries matching a pivot domain
|
|
40327
|
+
* without scanning all the data entries.
|
|
40328
|
+
*/
|
|
40329
|
+
dataEntriesIndex = lazy(() => new PivotDataEntriesIndex([], [], []));
|
|
40330
|
+
/**
|
|
40141
40331
|
* This object contains the pivot table structure. It is created from the
|
|
40142
40332
|
* data entries and the pivot definition.
|
|
40143
40333
|
*/
|
|
@@ -40172,6 +40362,7 @@ var SpreadsheetPivot = class {
|
|
|
40172
40362
|
this.filteredDataEntries = this.loadFilteredDataEntries(this.unfilteredDataEntries);
|
|
40173
40363
|
}
|
|
40174
40364
|
if (type >= 1) {
|
|
40365
|
+
this.dataEntriesIndex = lazy(() => new PivotDataEntriesIndex(this.filteredDataEntries, this.definition.rows, this.definition.columns));
|
|
40175
40366
|
this.collapsedTable = void 0;
|
|
40176
40367
|
this.expandedTable = void 0;
|
|
40177
40368
|
}
|
|
@@ -40249,14 +40440,14 @@ var SpreadsheetPivot = class {
|
|
|
40249
40440
|
const lastNode = domain.at(-1);
|
|
40250
40441
|
if (!lastNode) return { value: _t("Total") };
|
|
40251
40442
|
const dimension = this.getDimension(lastNode.field);
|
|
40252
|
-
const finalCell = this.filterDataEntriesFromDomain(this.filteredDataEntries, domain)[0]?.[dimension.nameWithGranularity];
|
|
40253
40443
|
if (dimension.type === "datetime") return pivotTimeAdapter(dimension.granularity || "month").toValueAndFormat(lastNode.value, this.getters.getLocale());
|
|
40444
|
+
const finalCell = this.getDataEntriesFromDomain(domain)[0]?.[dimension.nameWithGranularity];
|
|
40254
40445
|
if (!finalCell) return { value: "" };
|
|
40255
40446
|
if (finalCell.value === null) return { value: _t("(Undefined)") };
|
|
40256
40447
|
return finalCell;
|
|
40257
40448
|
}
|
|
40258
40449
|
getPivotCellValueAndFormat(measureId, domain) {
|
|
40259
|
-
const dataEntries = this.
|
|
40450
|
+
const dataEntries = this.getDataEntriesFromDomain(domain);
|
|
40260
40451
|
if (dataEntries.length === 0) return { value: "" };
|
|
40261
40452
|
const measure = this.getMeasure(measureId);
|
|
40262
40453
|
const allValues = dataEntries.map((value) => value[measure.fieldName]).filter(isDefined);
|
|
@@ -40366,17 +40557,8 @@ var SpreadsheetPivot = class {
|
|
|
40366
40557
|
if (!type) throw new Error(`Field ${fieldName} does not exist`);
|
|
40367
40558
|
return type;
|
|
40368
40559
|
}
|
|
40369
|
-
|
|
40370
|
-
return
|
|
40371
|
-
}
|
|
40372
|
-
filterDataEntriesFromDomainNode(dataEntries, domain) {
|
|
40373
|
-
const { field, value, type } = domain;
|
|
40374
|
-
const { nameWithGranularity } = this.getDimension(field);
|
|
40375
|
-
return dataEntries.filter((entry) => {
|
|
40376
|
-
const cellValue = entry[nameWithGranularity]?.value;
|
|
40377
|
-
if (type === "char") return String(cellValue) === String(value);
|
|
40378
|
-
return cellValue === value;
|
|
40379
|
-
});
|
|
40560
|
+
getDataEntriesFromDomain(domain) {
|
|
40561
|
+
return this.dataEntriesIndex().getDataEntries(domain);
|
|
40380
40562
|
}
|
|
40381
40563
|
getDimension(nameWithGranularity) {
|
|
40382
40564
|
return this.definition.getDimension(nameWithGranularity);
|
|
@@ -40770,7 +40952,7 @@ var PivotSidePanelStore = class extends SpreadsheetStore {
|
|
|
40770
40952
|
}
|
|
40771
40953
|
const pivot = this.getters.getPivot(this.pivotId);
|
|
40772
40954
|
const numberOfCells = pivot.isValid() ? pivot.getExpandedTableStructure().numberOfCells : 0;
|
|
40773
|
-
if (!this.alreadyNotifiedForPivotSize && numberOfCells >
|
|
40955
|
+
if (!this.alreadyNotifiedForPivotSize && numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
|
|
40774
40956
|
this.alreadyNotifiedForPivotSize = true;
|
|
40775
40957
|
this.notification.notifyUser({
|
|
40776
40958
|
type: "warning",
|
|
@@ -42632,7 +42814,7 @@ const SEPARATORS = [
|
|
|
42632
42814
|
},
|
|
42633
42815
|
{
|
|
42634
42816
|
label: _t("Line Break"),
|
|
42635
|
-
value:
|
|
42817
|
+
value: NEWLINE
|
|
42636
42818
|
}
|
|
42637
42819
|
];
|
|
42638
42820
|
var SplitIntoColumnsPanel = class extends Component {
|
|
@@ -43177,7 +43359,7 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
43177
43359
|
const newPanelInfo = {
|
|
43178
43360
|
currentPanelProps,
|
|
43179
43361
|
componentTag,
|
|
43180
|
-
size:
|
|
43362
|
+
size: DEFAULT_SIDE_PANEL_SIZE
|
|
43181
43363
|
};
|
|
43182
43364
|
const state = this.computeState(newPanelInfo);
|
|
43183
43365
|
if (!state.isOpen) return;
|
|
@@ -43185,8 +43367,8 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
43185
43367
|
this._openPanel("mainPanel", newPanelInfo, state);
|
|
43186
43368
|
return;
|
|
43187
43369
|
}
|
|
43188
|
-
const nonCollapsedPanelSize = this.mainPanel.isCollapsed ?
|
|
43189
|
-
if (!this.secondaryPanel && nonCollapsedPanelSize +
|
|
43370
|
+
const nonCollapsedPanelSize = this.mainPanel.isCollapsed ? DEFAULT_SIDE_PANEL_SIZE : this.mainPanel.size;
|
|
43371
|
+
if (!this.secondaryPanel && nonCollapsedPanelSize + DEFAULT_SIDE_PANEL_SIZE > this.availableWidth) {
|
|
43190
43372
|
this.get(NotificationStore).notifyUser({
|
|
43191
43373
|
sticky: false,
|
|
43192
43374
|
type: "warning",
|
|
@@ -43200,7 +43382,7 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
43200
43382
|
const newPanelInfo = {
|
|
43201
43383
|
currentPanelProps,
|
|
43202
43384
|
componentTag,
|
|
43203
|
-
size:
|
|
43385
|
+
size: DEFAULT_SIDE_PANEL_SIZE
|
|
43204
43386
|
};
|
|
43205
43387
|
const state = this.computeState(newPanelInfo);
|
|
43206
43388
|
if (!state.isOpen) return;
|
|
@@ -43229,7 +43411,7 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
43229
43411
|
this[panel] = {
|
|
43230
43412
|
currentPanelProps: state.props ?? {},
|
|
43231
43413
|
componentTag: newPanel.componentTag,
|
|
43232
|
-
size: currentPanel?.size ||
|
|
43414
|
+
size: currentPanel?.size || DEFAULT_SIDE_PANEL_SIZE,
|
|
43233
43415
|
isCollapsed: currentPanel?.isCollapsed || false,
|
|
43234
43416
|
isPinned: currentPanel && "isPinned" in currentPanel ? currentPanel.isPinned : false
|
|
43235
43417
|
};
|
|
@@ -43259,19 +43441,19 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
43259
43441
|
changePanelSize(panel, size) {
|
|
43260
43442
|
const panelInfo = this[panel];
|
|
43261
43443
|
if (!panelInfo || "isCollapsed" in panelInfo && panelInfo.isCollapsed) return;
|
|
43262
|
-
size = Math.max(size,
|
|
43444
|
+
size = Math.max(size, DEFAULT_SIDE_PANEL_SIZE);
|
|
43263
43445
|
let otherPanelSize = panel === "mainPanel" ? this.secondaryPanel?.size || 0 : this.mainPanel?.size || 0;
|
|
43264
43446
|
if (size > this.availableWidth - otherPanelSize) {
|
|
43265
43447
|
if (panel === "mainPanel" && this.secondaryPanel) {
|
|
43266
|
-
this.secondaryPanel.size = Math.max(this.availableWidth - size,
|
|
43448
|
+
this.secondaryPanel.size = Math.max(this.availableWidth - size, DEFAULT_SIDE_PANEL_SIZE);
|
|
43267
43449
|
otherPanelSize = this.secondaryPanel.size;
|
|
43268
43450
|
}
|
|
43269
|
-
size = Math.max(this.availableWidth - otherPanelSize,
|
|
43451
|
+
size = Math.max(this.availableWidth - otherPanelSize, DEFAULT_SIDE_PANEL_SIZE);
|
|
43270
43452
|
}
|
|
43271
43453
|
panelInfo.size = size;
|
|
43272
43454
|
}
|
|
43273
43455
|
resetPanelSize(panel) {
|
|
43274
|
-
if (this[panel]) this[panel].size =
|
|
43456
|
+
if (this[panel]) this[panel].size = DEFAULT_SIDE_PANEL_SIZE;
|
|
43275
43457
|
}
|
|
43276
43458
|
togglePinPanel() {
|
|
43277
43459
|
if (!this.mainPanel) return;
|
|
@@ -43287,10 +43469,10 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
43287
43469
|
if (!panelInfo) return;
|
|
43288
43470
|
if (panelInfo.isCollapsed) {
|
|
43289
43471
|
panelInfo.isCollapsed = false;
|
|
43290
|
-
this.changePanelSize(panel,
|
|
43472
|
+
this.changePanelSize(panel, DEFAULT_SIDE_PANEL_SIZE);
|
|
43291
43473
|
} else {
|
|
43292
43474
|
panelInfo.isCollapsed = true;
|
|
43293
|
-
panelInfo.size =
|
|
43475
|
+
panelInfo.size = COLLAPSED_SIDE_PANEL_SIZE;
|
|
43294
43476
|
}
|
|
43295
43477
|
}
|
|
43296
43478
|
computeState({ componentTag, currentPanelProps: initialPanelProps }) {
|
|
@@ -43305,12 +43487,12 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
43305
43487
|
} : state;
|
|
43306
43488
|
}
|
|
43307
43489
|
changeSpreadsheetWidth(width) {
|
|
43308
|
-
this.availableWidth = width -
|
|
43309
|
-
if (this.secondaryPanel && width - this.totalPanelSize <
|
|
43490
|
+
this.availableWidth = width - MIN_SHEET_VIEW_WIDTH;
|
|
43491
|
+
if (this.secondaryPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) {
|
|
43310
43492
|
this.secondaryPanel?.currentPanelProps.onCloseSidePanel?.();
|
|
43311
43493
|
this.secondaryPanel = void 0;
|
|
43312
43494
|
}
|
|
43313
|
-
if (this.mainPanel && width - this.totalPanelSize <
|
|
43495
|
+
if (this.mainPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) this.mainPanel.size = Math.max(width - MIN_SHEET_VIEW_WIDTH, DEFAULT_SIDE_PANEL_SIZE);
|
|
43314
43496
|
}
|
|
43315
43497
|
};
|
|
43316
43498
|
|
|
@@ -45073,7 +45255,7 @@ const MIN_DELAY = 20;
|
|
|
45073
45255
|
* Returns a timeout delay in milliseconds.
|
|
45074
45256
|
*/
|
|
45075
45257
|
function scrollDelay(value) {
|
|
45076
|
-
return
|
|
45258
|
+
return MIN_DELAY + (MAX_DELAY - MIN_DELAY) * Math.exp(-.035 * (value - 1));
|
|
45077
45259
|
}
|
|
45078
45260
|
|
|
45079
45261
|
//#endregion
|
|
@@ -45117,7 +45299,7 @@ function useDragAndDropBeyondTheViewport(env) {
|
|
|
45117
45299
|
let { scrollX, scrollY } = getters.getActiveSheetScrollInfo();
|
|
45118
45300
|
const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
|
|
45119
45301
|
let canEdgeScroll = false;
|
|
45120
|
-
let timeoutDelay =
|
|
45302
|
+
let timeoutDelay = MAX_DELAY;
|
|
45121
45303
|
const x = zoomedMouseEvent.clientX - position.x;
|
|
45122
45304
|
let colIndex = getters.getColIndex(x);
|
|
45123
45305
|
if (scrollDirection !== "vertical") {
|
|
@@ -45513,7 +45695,7 @@ function fits(width, linkedString) {
|
|
|
45513
45695
|
return true;
|
|
45514
45696
|
}
|
|
45515
45697
|
function astToDoc(ast) {
|
|
45516
|
-
const debugPrefix = ast.debug ? `${
|
|
45698
|
+
const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
|
|
45517
45699
|
switch (ast.type) {
|
|
45518
45700
|
case "NUMBER": return debugPrefix + String(ast.value);
|
|
45519
45701
|
case "STRING": return debugPrefix + `"${ast.value}"`;
|
|
@@ -45592,7 +45774,7 @@ function wrapInBraces(doc) {
|
|
|
45592
45774
|
* Converts an ast formula to the corresponding string
|
|
45593
45775
|
*/
|
|
45594
45776
|
function astToFormula(ast) {
|
|
45595
|
-
const debugPrefix = ast.debug ? `${
|
|
45777
|
+
const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
|
|
45596
45778
|
switch (ast.type) {
|
|
45597
45779
|
case "FUNCALL":
|
|
45598
45780
|
const args = ast.args.map((arg) => astToFormula(arg));
|
|
@@ -46287,19 +46469,19 @@ function getAxis(getters, figureUI, dnd, axisType) {
|
|
|
46287
46469
|
position = y;
|
|
46288
46470
|
break;
|
|
46289
46471
|
case "bottom":
|
|
46290
|
-
position = y + figureUI.height -
|
|
46472
|
+
position = y + figureUI.height - FIGURE_BORDER_WIDTH;
|
|
46291
46473
|
break;
|
|
46292
46474
|
case "vCenter":
|
|
46293
|
-
position = y + Math.floor(figureUI.height / 2) -
|
|
46475
|
+
position = y + Math.floor(figureUI.height / 2) - FIGURE_BORDER_WIDTH;
|
|
46294
46476
|
break;
|
|
46295
46477
|
case "left":
|
|
46296
46478
|
position = x;
|
|
46297
46479
|
break;
|
|
46298
46480
|
case "right":
|
|
46299
|
-
position = x + figureUI.width -
|
|
46481
|
+
position = x + figureUI.width - FIGURE_BORDER_WIDTH;
|
|
46300
46482
|
break;
|
|
46301
46483
|
case "hCenter":
|
|
46302
|
-
position = x + Math.floor(figureUI.width / 2) -
|
|
46484
|
+
position = x + Math.floor(figureUI.width / 2) - FIGURE_BORDER_WIDTH;
|
|
46303
46485
|
break;
|
|
46304
46486
|
}
|
|
46305
46487
|
return {
|
|
@@ -46530,7 +46712,7 @@ var FiguresContainer = class extends Component {
|
|
|
46530
46712
|
};
|
|
46531
46713
|
const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
|
|
46532
46714
|
const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
|
|
46533
|
-
if (!hasStartedDnd && offsetX <
|
|
46715
|
+
if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) return;
|
|
46534
46716
|
hasStartedDnd = true;
|
|
46535
46717
|
const selectedFigures = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigures, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
|
|
46536
46718
|
const draggedFigure = selectedFigures.find((f) => f.id === draggedFigureId);
|
|
@@ -46599,7 +46781,7 @@ var FiguresContainer = class extends Component {
|
|
|
46599
46781
|
ev.stopPropagation();
|
|
46600
46782
|
const initialScrollPosition = this.env.model.getters.getActiveSheetScrollInfo();
|
|
46601
46783
|
const keepRatio = figureRegistry.get(figureUI.tag).keepRatio || false;
|
|
46602
|
-
const minFigSize = figureRegistry.get(figureUI.tag).minFigSize ||
|
|
46784
|
+
const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || MIN_FIG_SIZE;
|
|
46603
46785
|
const zoom = this.env.model.getters.getViewportZoomLevel();
|
|
46604
46786
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
46605
46787
|
const initialMousePosition = {
|
|
@@ -46737,8 +46919,8 @@ var GridAddRowsFooter = class extends Component {
|
|
|
46737
46919
|
const { scrollY } = this.env.model.getters.getActiveSheetScrollInfo();
|
|
46738
46920
|
const { y, height } = this.env.model.getters.getMainViewportRect();
|
|
46739
46921
|
return cssPropertiesToCss({
|
|
46740
|
-
top: `${y + height - scrollY -
|
|
46741
|
-
height: `${
|
|
46922
|
+
top: `${y + height - scrollY - FOOTER_HEIGHT}px`,
|
|
46923
|
+
height: `${FOOTER_HEIGHT}px`
|
|
46742
46924
|
});
|
|
46743
46925
|
}
|
|
46744
46926
|
get errorMessages() {
|
|
@@ -47148,7 +47330,7 @@ var GridOverlay = class extends Component {
|
|
|
47148
47330
|
get isFooterVisible() {
|
|
47149
47331
|
const { y } = this.env.model.getters.getMainViewportCoordinates();
|
|
47150
47332
|
const { height } = this.env.model.getters.getSheetViewDimension();
|
|
47151
|
-
return !this.env.model.getters.isReadonly() && height - y >
|
|
47333
|
+
return !this.env.model.getters.isReadonly() && height - y > FOOTER_HEIGHT;
|
|
47152
47334
|
}
|
|
47153
47335
|
};
|
|
47154
47336
|
|
|
@@ -47202,7 +47384,7 @@ var UnhideRowHeaders = class extends Component {
|
|
|
47202
47384
|
row: hiddenIndex
|
|
47203
47385
|
}));
|
|
47204
47386
|
return cssPropertiesToCss({
|
|
47205
|
-
top: rect.y + rect.height -
|
|
47387
|
+
top: rect.y + rect.height - HEADER_HEIGHT - this.props.offset + "px",
|
|
47206
47388
|
"margin-right": "1px"
|
|
47207
47389
|
});
|
|
47208
47390
|
}
|
|
@@ -47211,7 +47393,7 @@ var UnhideRowHeaders = class extends Component {
|
|
|
47211
47393
|
top: this.env.model.getters.getRect(positionToZone({
|
|
47212
47394
|
col: 0,
|
|
47213
47395
|
row: hiddenIndex
|
|
47214
|
-
})).y -
|
|
47396
|
+
})).y - HEADER_HEIGHT - this.props.offset + "px",
|
|
47215
47397
|
"margin-right": "1px"
|
|
47216
47398
|
});
|
|
47217
47399
|
}
|
|
@@ -47244,13 +47426,13 @@ var UnhideColumnHeaders = class extends Component {
|
|
|
47244
47426
|
col: hiddenIndex,
|
|
47245
47427
|
row: 0
|
|
47246
47428
|
}));
|
|
47247
|
-
return cssPropertiesToCss({ left: rect.x + rect.width -
|
|
47429
|
+
return cssPropertiesToCss({ left: rect.x + rect.width - HEADER_WIDTH - this.props.offset + "px" });
|
|
47248
47430
|
}
|
|
47249
47431
|
getUnhideNextButtonStyle(hiddenIndex) {
|
|
47250
47432
|
return cssPropertiesToCss({ left: this.env.model.getters.getRect(positionToZone({
|
|
47251
47433
|
col: hiddenIndex,
|
|
47252
47434
|
row: 0
|
|
47253
|
-
})).x -
|
|
47435
|
+
})).x - HEADER_WIDTH - this.props.offset + "px" });
|
|
47254
47436
|
}
|
|
47255
47437
|
unhide(hiddenElements) {
|
|
47256
47438
|
this.env.model.dispatch("UNHIDE_COLUMNS_ROWS", {
|
|
@@ -47473,7 +47655,7 @@ var ColResizer = class extends AbstractResizer {
|
|
|
47473
47655
|
super.setup();
|
|
47474
47656
|
this.PADDING = 15;
|
|
47475
47657
|
this.MAX_SIZE_MARGIN = 90;
|
|
47476
|
-
this.MIN_ELEMENT_SIZE =
|
|
47658
|
+
this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
|
|
47477
47659
|
}
|
|
47478
47660
|
get sheetId() {
|
|
47479
47661
|
return this.env.model.getters.getActiveSheetId();
|
|
@@ -47607,7 +47789,7 @@ var RowResizer = class extends AbstractResizer {
|
|
|
47607
47789
|
super.setup();
|
|
47608
47790
|
this.PADDING = 5;
|
|
47609
47791
|
this.MAX_SIZE_MARGIN = 60;
|
|
47610
|
-
this.MIN_ELEMENT_SIZE =
|
|
47792
|
+
this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
|
|
47611
47793
|
}
|
|
47612
47794
|
get sheetId() {
|
|
47613
47795
|
return this.env.model.getters.getActiveSheetId();
|
|
@@ -48043,7 +48225,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
48043
48225
|
x,
|
|
48044
48226
|
y
|
|
48045
48227
|
}, style.underline, style.strikethrough);
|
|
48046
|
-
y +=
|
|
48228
|
+
y += MIN_CELL_TEXT_MARGIN + box.content.fontSizePx;
|
|
48047
48229
|
}
|
|
48048
48230
|
if (style.rotation) ctx.restore();
|
|
48049
48231
|
if (box.clipRect) ctx.restore();
|
|
@@ -48091,14 +48273,14 @@ var GridRenderer = class extends DisposableStore {
|
|
|
48091
48273
|
const activeCols = renderingContext.activeCols;
|
|
48092
48274
|
const activeRows = renderingContext.activeRows;
|
|
48093
48275
|
const theme = this.getters.getSpreadsheetTheme();
|
|
48094
|
-
ctx.font = `400 ${
|
|
48276
|
+
ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
48095
48277
|
ctx.textAlign = "center";
|
|
48096
48278
|
ctx.textBaseline = "middle";
|
|
48097
48279
|
ctx.lineWidth = thinLineWidth;
|
|
48098
48280
|
ctx.strokeStyle = theme.headerTextColor;
|
|
48099
48281
|
ctx.fillStyle = this.getters.getSpreadsheetTheme().backgroundColor;
|
|
48100
|
-
ctx.fillRect(0, 0,
|
|
48101
|
-
ctx.fillRect(0, 0, width,
|
|
48282
|
+
ctx.fillRect(0, 0, HEADER_WIDTH, height);
|
|
48283
|
+
ctx.fillRect(0, 0, width, HEADER_HEIGHT);
|
|
48102
48284
|
for (const col of visibleCols) {
|
|
48103
48285
|
const colZone = {
|
|
48104
48286
|
left: col,
|
|
@@ -48112,7 +48294,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
48112
48294
|
if (isColActive) ctx.fillStyle = theme.headerActiveBackgroundColor;
|
|
48113
48295
|
else if (isColSelected) ctx.fillStyle = theme.headerSelectedBackgroundColor;
|
|
48114
48296
|
else ctx.fillStyle = theme.headerBackgroundColor;
|
|
48115
|
-
ctx.fillRect(x, 0, width,
|
|
48297
|
+
ctx.fillRect(x, 0, width, HEADER_HEIGHT);
|
|
48116
48298
|
}
|
|
48117
48299
|
for (const row of visibleRows) {
|
|
48118
48300
|
const rowZone = {
|
|
@@ -48127,13 +48309,13 @@ var GridRenderer = class extends DisposableStore {
|
|
|
48127
48309
|
if (isRowActive) ctx.fillStyle = theme.headerActiveBackgroundColor;
|
|
48128
48310
|
else if (isRowSelected) ctx.fillStyle = theme.headerSelectedBackgroundColor;
|
|
48129
48311
|
else ctx.fillStyle = theme.headerBackgroundColor;
|
|
48130
|
-
ctx.fillRect(0, y,
|
|
48312
|
+
ctx.fillRect(0, y, HEADER_WIDTH, height);
|
|
48131
48313
|
}
|
|
48132
48314
|
ctx.beginPath();
|
|
48133
|
-
ctx.moveTo(
|
|
48134
|
-
ctx.lineTo(
|
|
48135
|
-
ctx.moveTo(0,
|
|
48136
|
-
ctx.lineTo(width,
|
|
48315
|
+
ctx.moveTo(HEADER_WIDTH, 0);
|
|
48316
|
+
ctx.lineTo(HEADER_WIDTH, height);
|
|
48317
|
+
ctx.moveTo(0, HEADER_HEIGHT);
|
|
48318
|
+
ctx.lineTo(width, HEADER_HEIGHT);
|
|
48137
48319
|
ctx.strokeStyle = theme.headerBorderColor;
|
|
48138
48320
|
ctx.stroke();
|
|
48139
48321
|
for (const col of visibleCols) {
|
|
@@ -48149,13 +48331,13 @@ var GridRenderer = class extends DisposableStore {
|
|
|
48149
48331
|
const { x, width } = viewports.getVisibleRect(sheetId, zone);
|
|
48150
48332
|
ctx.save();
|
|
48151
48333
|
ctx.beginPath();
|
|
48152
|
-
ctx.rect(x, 0, width,
|
|
48334
|
+
ctx.rect(x, 0, width, HEADER_HEIGHT);
|
|
48153
48335
|
ctx.clip();
|
|
48154
|
-
ctx.fillText(colName, colStart + colSize / 2,
|
|
48336
|
+
ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
|
|
48155
48337
|
ctx.restore();
|
|
48156
48338
|
ctx.beginPath();
|
|
48157
48339
|
ctx.moveTo(colStart + colSize, 0);
|
|
48158
|
-
ctx.lineTo(colStart + colSize,
|
|
48340
|
+
ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
|
|
48159
48341
|
ctx.stroke();
|
|
48160
48342
|
}
|
|
48161
48343
|
for (const row of visibleRows) {
|
|
@@ -48170,13 +48352,13 @@ var GridRenderer = class extends DisposableStore {
|
|
|
48170
48352
|
const { y, height } = viewports.getVisibleRect(sheetId, zone);
|
|
48171
48353
|
ctx.save();
|
|
48172
48354
|
ctx.beginPath();
|
|
48173
|
-
ctx.rect(0, y,
|
|
48355
|
+
ctx.rect(0, y, HEADER_WIDTH, height);
|
|
48174
48356
|
ctx.clip();
|
|
48175
|
-
ctx.fillText(String(row + 1),
|
|
48357
|
+
ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
|
|
48176
48358
|
ctx.restore();
|
|
48177
48359
|
ctx.beginPath();
|
|
48178
48360
|
ctx.moveTo(0, rowStart + rowSize);
|
|
48179
|
-
ctx.lineTo(
|
|
48361
|
+
ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
|
|
48180
48362
|
ctx.stroke();
|
|
48181
48363
|
}
|
|
48182
48364
|
}
|
|
@@ -48319,7 +48501,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
48319
48501
|
/** Content */
|
|
48320
48502
|
const wrapping = style.wrapping || "overflow";
|
|
48321
48503
|
const wrapText = wrapping === "wrap" && !showFormula;
|
|
48322
|
-
const availableWidth = width - 2 *
|
|
48504
|
+
const availableWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
|
|
48323
48505
|
const maxWidth = style.align ? 0 : availableWidth;
|
|
48324
48506
|
const wrapWidth = wrapText ? availableWidth : void 0;
|
|
48325
48507
|
const multiLineText = this.getters.getCellMultiLineText(position, {
|
|
@@ -48331,18 +48513,18 @@ var GridRenderer = class extends DisposableStore {
|
|
|
48331
48513
|
align: "left",
|
|
48332
48514
|
rotation: 0
|
|
48333
48515
|
};
|
|
48334
|
-
const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) +
|
|
48516
|
+
const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) + MIN_CELL_TEXT_MARGIN;
|
|
48335
48517
|
const contentSize = this.getters.getMultilineTextSize(multiLineText, style);
|
|
48336
|
-
const chipMargin = chipStyle ?
|
|
48518
|
+
const chipMargin = chipStyle ? DATA_VALIDATION_CHIP_MARGIN : 0;
|
|
48337
48519
|
const leftMargin = (box.icons.left ? box.icons.left.size + box.icons.left.margin : 0) + chipMargin;
|
|
48338
48520
|
const rightMargin = (box.icons.right ? box.icons.right.size + box.icons.right.margin : 0) + chipMargin;
|
|
48339
|
-
const contentWidth = leftMargin + contentSize.width + rightMargin +
|
|
48521
|
+
const contentWidth = leftMargin + contentSize.width + rightMargin + MIN_CELL_TEXT_MARGIN;
|
|
48340
48522
|
const align = this.computeCellAlignment(position, contentWidth > width);
|
|
48341
48523
|
const numberOfLines = multiLineText.length;
|
|
48342
48524
|
const contentY = Math.round(this.getters.computeTextYCoordinate(box, fontSizePX, style.verticalAlign, numberOfLines));
|
|
48343
48525
|
let contentX = box.x;
|
|
48344
|
-
if (align === "left") contentX +=
|
|
48345
|
-
else if (align === "right") contentX += box.width -
|
|
48526
|
+
if (align === "left") contentX += MIN_CELL_TEXT_MARGIN + leftMargin;
|
|
48527
|
+
else if (align === "right") contentX += box.width - MIN_CELL_TEXT_MARGIN - rightMargin;
|
|
48346
48528
|
else contentX += box.width / 2;
|
|
48347
48529
|
contentX = Math.round(contentX);
|
|
48348
48530
|
const textHeight = computeTextLinesHeight(fontSizePX, numberOfLines);
|
|
@@ -48358,7 +48540,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
48358
48540
|
};
|
|
48359
48541
|
if (chipStyle?.fillColor) {
|
|
48360
48542
|
const chipMarginLeft = leftMargin;
|
|
48361
|
-
const chipMarginRight =
|
|
48543
|
+
const chipMarginRight = DATA_VALIDATION_CHIP_MARGIN;
|
|
48362
48544
|
box.chip = {
|
|
48363
48545
|
color: chipStyle.fillColor,
|
|
48364
48546
|
width: box.width - chipMarginLeft - chipMarginRight,
|
|
@@ -48521,7 +48703,7 @@ var GridRenderer = class extends DisposableStore {
|
|
|
48521
48703
|
continue;
|
|
48522
48704
|
}
|
|
48523
48705
|
const elapsedTime = timeStamp - animation.startTime;
|
|
48524
|
-
const progress = Math.min(1, elapsedTime /
|
|
48706
|
+
const progress = Math.min(1, elapsedTime / CELL_ANIMATION_DURATION);
|
|
48525
48707
|
if (progress >= 1) this.animations.delete(boxId);
|
|
48526
48708
|
animation.progress = progress;
|
|
48527
48709
|
}
|
|
@@ -48646,7 +48828,7 @@ function useTouchHandlers(ref, { updateScroll, canMoveUp, canMoveDown, getZoom,
|
|
|
48646
48828
|
resetTimeout = setTimeout(() => {
|
|
48647
48829
|
velocityX = 0;
|
|
48648
48830
|
velocityY = 0;
|
|
48649
|
-
},
|
|
48831
|
+
}, resetTimeoutDuration);
|
|
48650
48832
|
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
48651
48833
|
}
|
|
48652
48834
|
function onTouchEnd(ev) {
|
|
@@ -48715,7 +48897,7 @@ function computeDistance(ev1, ev2) {
|
|
|
48715
48897
|
//#region src/components/helpers/wheel_hook.ts
|
|
48716
48898
|
function useWheelHandler(handler) {
|
|
48717
48899
|
function normalize(val, deltaMode) {
|
|
48718
|
-
return val * (deltaMode === 0 ? 1 :
|
|
48900
|
+
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
48719
48901
|
}
|
|
48720
48902
|
const onMouseWheel = (ev) => {
|
|
48721
48903
|
handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
|
|
@@ -48825,14 +49007,14 @@ var Corner = class extends Component {
|
|
|
48825
49007
|
return cssPropertiesToCss(css);
|
|
48826
49008
|
}
|
|
48827
49009
|
getHandlerEdgeLength() {
|
|
48828
|
-
return this.env.isMobile() ? MOBILE_HANDLER_WIDTH :
|
|
49010
|
+
return this.env.isMobile() ? MOBILE_HANDLER_WIDTH : AUTOFILL_EDGE_LENGTH;
|
|
48829
49011
|
}
|
|
48830
49012
|
get buttonLook() {
|
|
48831
49013
|
const css = {
|
|
48832
49014
|
"background-color": this.props.color,
|
|
48833
49015
|
cursor: `${this.props.orientation}-resize`
|
|
48834
49016
|
};
|
|
48835
|
-
if (this.env.isMobile()) css["border-radius"] = `${
|
|
49017
|
+
if (this.env.isMobile()) css["border-radius"] = `${AUTOFILL_EDGE_LENGTH / 2}px`;
|
|
48836
49018
|
return cssPropertiesToCss(css);
|
|
48837
49019
|
}
|
|
48838
49020
|
onMouseDown(ev) {
|
|
@@ -49230,8 +49412,8 @@ var Grid = class extends Component {
|
|
|
49230
49412
|
exposeFocus: types$1.function(),
|
|
49231
49413
|
getGridSize: types$1.function()
|
|
49232
49414
|
});
|
|
49233
|
-
HEADER_HEIGHT =
|
|
49234
|
-
HEADER_WIDTH =
|
|
49415
|
+
HEADER_HEIGHT = HEADER_HEIGHT;
|
|
49416
|
+
HEADER_WIDTH = HEADER_WIDTH;
|
|
49235
49417
|
menuState;
|
|
49236
49418
|
gridRef = signal(null);
|
|
49237
49419
|
canvasRef = signal(null);
|
|
@@ -49302,10 +49484,10 @@ var Grid = class extends Component {
|
|
|
49302
49484
|
get gridOverlayDimensions() {
|
|
49303
49485
|
const scrollbarWidth = this.env.model.getters.getScrollBarWidth();
|
|
49304
49486
|
return cssPropertiesToCss({
|
|
49305
|
-
top: `${
|
|
49306
|
-
left: `${
|
|
49307
|
-
height: `calc(100% - ${
|
|
49308
|
-
width: `calc(100% - ${
|
|
49487
|
+
top: `${HEADER_HEIGHT}px`,
|
|
49488
|
+
left: `${HEADER_WIDTH}px`,
|
|
49489
|
+
height: `calc(100% - ${HEADER_HEIGHT + scrollbarWidth}px)`,
|
|
49490
|
+
width: `calc(100% - ${HEADER_WIDTH + scrollbarWidth}px)`
|
|
49309
49491
|
});
|
|
49310
49492
|
}
|
|
49311
49493
|
onClosePopover() {
|
|
@@ -49521,8 +49703,8 @@ var Grid = class extends Component {
|
|
|
49521
49703
|
const zone = this.env.model.getters.getSelectedZone();
|
|
49522
49704
|
const rect = this.env.model.getters.getVisibleRect(zone);
|
|
49523
49705
|
return {
|
|
49524
|
-
x: rect.x + rect.width -
|
|
49525
|
-
y: rect.y + rect.height -
|
|
49706
|
+
x: rect.x + rect.width - AUTOFILL_EDGE_LENGTH / 2,
|
|
49707
|
+
y: rect.y + rect.height - AUTOFILL_EDGE_LENGTH / 2
|
|
49526
49708
|
};
|
|
49527
49709
|
}
|
|
49528
49710
|
get isAutofillVisible() {
|
|
@@ -49539,10 +49721,10 @@ var Grid = class extends Component {
|
|
|
49539
49721
|
onGridResized() {
|
|
49540
49722
|
const { height, width } = this.props.getGridSize();
|
|
49541
49723
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
49542
|
-
width: width -
|
|
49543
|
-
height: height -
|
|
49544
|
-
gridOffsetX:
|
|
49545
|
-
gridOffsetY:
|
|
49724
|
+
width: width - HEADER_WIDTH,
|
|
49725
|
+
height: height - HEADER_HEIGHT,
|
|
49726
|
+
gridOffsetX: HEADER_WIDTH,
|
|
49727
|
+
gridOffsetY: HEADER_HEIGHT
|
|
49546
49728
|
});
|
|
49547
49729
|
}
|
|
49548
49730
|
moveCanvas(deltaX, deltaY) {
|
|
@@ -49888,7 +50070,7 @@ var ClickableCellSortIcon = class extends Component {
|
|
|
49888
50070
|
return cssPropertiesToCss({
|
|
49889
50071
|
height: `${size}px`,
|
|
49890
50072
|
width: `${size}px`,
|
|
49891
|
-
color: cellStyle.textColor ||
|
|
50073
|
+
color: cellStyle.textColor || TEXT_BODY_MUTED,
|
|
49892
50074
|
"background-color": this.getBackgroundColor(cellStyle)
|
|
49893
50075
|
});
|
|
49894
50076
|
}
|
|
@@ -50741,8 +50923,8 @@ var CarouselPlugin = class extends CorePlugin {
|
|
|
50741
50923
|
case "DUPLICATE_SHEET": {
|
|
50742
50924
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
50743
50925
|
for (const fig of sheetFiguresFrom) if (fig.tag === "carousel") {
|
|
50744
|
-
const figureIdBase = fig.id.split(
|
|
50745
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
50926
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
50927
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
50746
50928
|
const carousel = this.getCarousel(fig.id);
|
|
50747
50929
|
if (carousel) {
|
|
50748
50930
|
const size = {
|
|
@@ -50758,8 +50940,8 @@ var CarouselPlugin = class extends CorePlugin {
|
|
|
50758
50940
|
size,
|
|
50759
50941
|
definition: { items: carousel.items.map((item) => {
|
|
50760
50942
|
if (item.type === "carouselDataView") return { ...item };
|
|
50761
|
-
const chartIdBase = item.chartId.split(
|
|
50762
|
-
const newChartId = `${cmd.sheetIdTo}${
|
|
50943
|
+
const chartIdBase = item.chartId.split(FIGURE_ID_SPLITTER).pop();
|
|
50944
|
+
const newChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
|
|
50763
50945
|
return {
|
|
50764
50946
|
...item,
|
|
50765
50947
|
chartId: newChartId
|
|
@@ -50833,12 +51015,12 @@ var Squisher = class {
|
|
|
50833
51015
|
* with references (unless they contain a sheet name that contains the separator). */
|
|
50834
51016
|
buildResult(numbers, strings, references) {
|
|
50835
51017
|
const res = {};
|
|
50836
|
-
if (numbers.length) res.N = numbers.join(
|
|
51018
|
+
if (numbers.length) res.N = numbers.join(SEPARATOR);
|
|
50837
51019
|
if (strings.length) res.S = strings;
|
|
50838
51020
|
if (references.length) {
|
|
50839
51021
|
let referencePattern;
|
|
50840
|
-
if (references.some((x) => x.includes(
|
|
50841
|
-
else referencePattern = references.join(
|
|
51022
|
+
if (references.some((x) => x.includes(SEPARATOR))) referencePattern = references;
|
|
51023
|
+
else referencePattern = references.join(SEPARATOR);
|
|
50842
51024
|
res.R = referencePattern;
|
|
50843
51025
|
}
|
|
50844
51026
|
return res;
|
|
@@ -50971,7 +51153,7 @@ var Squisher = class {
|
|
|
50971
51153
|
}
|
|
50972
51154
|
squishOneReference(reference, previousReferences, index, forSheetId) {
|
|
50973
51155
|
const previousReference = previousReferences[index];
|
|
50974
|
-
if (deepEquals(previousReference, reference)) return
|
|
51156
|
+
if (deepEquals(previousReference, reference)) return NO_CHANGE;
|
|
50975
51157
|
if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc || previousReference.parts.length !== reference.parts.length) {
|
|
50976
51158
|
previousReferences[index] = deepCopy(reference);
|
|
50977
51159
|
return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
|
|
@@ -51005,7 +51187,7 @@ var Squisher = class {
|
|
|
51005
51187
|
* - "=" meaning no change as string
|
|
51006
51188
|
* */
|
|
51007
51189
|
squishNumbers(numbers) {
|
|
51008
|
-
const result = numbers.map((x) =>
|
|
51190
|
+
const result = numbers.map((x) => NO_CHANGE);
|
|
51009
51191
|
for (let i = 0; i < numbers.length; i++) {
|
|
51010
51192
|
const previousValue = this.baseFormula.literalValues.numbers[i].value;
|
|
51011
51193
|
const currentValue = numbers[i].value;
|
|
@@ -51019,7 +51201,7 @@ var Squisher = class {
|
|
|
51019
51201
|
return result;
|
|
51020
51202
|
}
|
|
51021
51203
|
squishStrings(strings) {
|
|
51022
|
-
const result = strings.map((x) =>
|
|
51204
|
+
const result = strings.map((x) => NO_CHANGE);
|
|
51023
51205
|
for (let i = 0; i < strings.length; i++) {
|
|
51024
51206
|
const str = strings[i].value;
|
|
51025
51207
|
if (str !== this.previousStrings[i]) {
|
|
@@ -51292,16 +51474,16 @@ var Unsquisher = class {
|
|
|
51292
51474
|
strings: [],
|
|
51293
51475
|
dependencies: []
|
|
51294
51476
|
};
|
|
51295
|
-
if (squishedFormula.N !== void 0 && squishedFormula.N.length > 0) current.numbers = squishedFormula.N.split(
|
|
51477
|
+
if (squishedFormula.N !== void 0 && squishedFormula.N.length > 0) current.numbers = squishedFormula.N.split(SEPARATOR).map(this.adjustNumbers);
|
|
51296
51478
|
else current.numbers = this.previousFormula.literalValues.numbers;
|
|
51297
51479
|
if (squishedFormula.S !== void 0 && squishedFormula.S.length > 0) current.strings = squishedFormula.S.map(this.adjustStrings);
|
|
51298
51480
|
else current.strings = this.previousFormula.literalValues.strings;
|
|
51299
51481
|
if (squishedFormula.R !== void 0 && this.previousFormula) {
|
|
51300
51482
|
let references;
|
|
51301
51483
|
if (typeof squishedFormula.R !== "string") references = squishedFormula.R;
|
|
51302
|
-
else references = squishedFormula.R.split(
|
|
51484
|
+
else references = squishedFormula.R.split(SEPARATOR);
|
|
51303
51485
|
current.dependencies = references.map((refStr, index) => {
|
|
51304
|
-
if (refStr ===
|
|
51486
|
+
if (refStr === NO_CHANGE) return { ...this.alreadyAppliedReferenceOffset[index] };
|
|
51305
51487
|
else if (refStr.startsWith("+") || refStr.startsWith("-")) {
|
|
51306
51488
|
const offset = parseInt(refStr.slice(2), 10);
|
|
51307
51489
|
const sign = refStr[0] === "+" ? 1 : -1;
|
|
@@ -51337,14 +51519,14 @@ var Unsquisher = class {
|
|
|
51337
51519
|
throw new Error("Invalid squished element or no previous cell to unsquish against");
|
|
51338
51520
|
}
|
|
51339
51521
|
adjustStrings = (str, index) => {
|
|
51340
|
-
if (str ===
|
|
51522
|
+
if (str === NO_CHANGE) return { value: this.previousString[index] };
|
|
51341
51523
|
else {
|
|
51342
51524
|
this.previousString[index] = str;
|
|
51343
51525
|
return { value: str };
|
|
51344
51526
|
}
|
|
51345
51527
|
};
|
|
51346
51528
|
adjustNumbers = (numStr, index) => {
|
|
51347
|
-
if (numStr ===
|
|
51529
|
+
if (numStr === NO_CHANGE) return { value: this.alreadyAppliedNumberOffset[index] };
|
|
51348
51530
|
else {
|
|
51349
51531
|
const currentOffset = parseFloat(numStr.slice(1));
|
|
51350
51532
|
const adjustedOffset = (this.alreadyAppliedNumberOffset[index] || 0) + currentOffset;
|
|
@@ -51767,10 +51949,10 @@ var ChartPlugin = class extends CorePlugin {
|
|
|
51767
51949
|
if (!chart || !figureId) continue;
|
|
51768
51950
|
const fig = this.getters.getFigure(cmd.sheetId, figureId);
|
|
51769
51951
|
if (!fig) continue;
|
|
51770
|
-
const figureIdBase = figureId.split(
|
|
51771
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
51772
|
-
const chartIdBase = chartId.split(
|
|
51773
|
-
const duplicatedChartId = `${cmd.sheetIdTo}${
|
|
51952
|
+
const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
|
|
51953
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
51954
|
+
const chartIdBase = chartId.split(FIGURE_ID_SPLITTER).pop();
|
|
51955
|
+
const duplicatedChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
|
|
51774
51956
|
const definition = chart.duplicateInDuplicatedSheet(cmd.sheetId, cmd.sheetIdTo);
|
|
51775
51957
|
this.dispatch("CREATE_CHART", {
|
|
51776
51958
|
figureId: duplicatedFigureId,
|
|
@@ -51879,8 +52061,8 @@ var ChartPlugin = class extends CorePlugin {
|
|
|
51879
52061
|
* Add a figure with tag chart with the given id at the given position
|
|
51880
52062
|
*/
|
|
51881
52063
|
addFigure(figureId, sheetId, col, row, offset, size = {
|
|
51882
|
-
width:
|
|
51883
|
-
height:
|
|
52064
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
52065
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
51884
52066
|
}) {
|
|
51885
52067
|
this.dispatch("CREATE_FIGURE", {
|
|
51886
52068
|
sheetId,
|
|
@@ -53131,8 +53313,8 @@ var FigurePlugin = class extends CorePlugin {
|
|
|
53131
53313
|
const figureId = figure.id;
|
|
53132
53314
|
const fig = this.figures[cmd.sheetId]?.[figureId];
|
|
53133
53315
|
if (!fig) continue;
|
|
53134
|
-
const figureIdBase = figureId.split(
|
|
53135
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
53316
|
+
const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
|
|
53317
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
53136
53318
|
this.dispatch("CREATE_FIGURE", {
|
|
53137
53319
|
figureId: duplicatedFigureId,
|
|
53138
53320
|
...fig,
|
|
@@ -53170,11 +53352,11 @@ var FigurePlugin = class extends CorePlugin {
|
|
|
53170
53352
|
const numHeader = this.getters.getNumberRows(sheetId);
|
|
53171
53353
|
const remainingSize = new Array(numHeader + 1);
|
|
53172
53354
|
remainingSize[numHeader] = 0;
|
|
53173
|
-
for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ??
|
|
53355
|
+
for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ?? DEFAULT_CELL_HEIGHT);
|
|
53174
53356
|
for (const figure of this.getFigures(sheetId)) if (figure.offset.y + figure.height > remainingSize[figure.row]) {
|
|
53175
53357
|
let y = figure.offset.y;
|
|
53176
53358
|
let row = figure.row;
|
|
53177
|
-
for (let row_size = this.getters.getUserRowSize(sheetId, row) ??
|
|
53359
|
+
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) {
|
|
53178
53360
|
row += 1;
|
|
53179
53361
|
y -= row_size;
|
|
53180
53362
|
}
|
|
@@ -53199,7 +53381,7 @@ var FigurePlugin = class extends CorePlugin {
|
|
|
53199
53381
|
let rowNum, colNum;
|
|
53200
53382
|
let { col, row } = figure;
|
|
53201
53383
|
const offset = { ...figure.offset };
|
|
53202
|
-
for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ??
|
|
53384
|
+
for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ?? DEFAULT_CELL_HEIGHT;
|
|
53203
53385
|
if (row > rowNum) {
|
|
53204
53386
|
row = rowNum;
|
|
53205
53387
|
offset.y = Math.max(availableHeight - figure.height, 0);
|
|
@@ -53680,7 +53862,7 @@ var HeaderSizePlugin = class extends CorePlugin {
|
|
|
53680
53862
|
}
|
|
53681
53863
|
}
|
|
53682
53864
|
getColSize(sheetId, index) {
|
|
53683
|
-
return Math.round(this.sizes[sheetId]?.["COL"][index] ||
|
|
53865
|
+
return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
|
|
53684
53866
|
}
|
|
53685
53867
|
getUserRowSize(sheetId, index) {
|
|
53686
53868
|
const rowSize = this.sizes[sheetId]?.["ROW"][index];
|
|
@@ -53713,7 +53895,7 @@ var HeaderSizePlugin = class extends CorePlugin {
|
|
|
53713
53895
|
if (sheet.rows === void 0) sheet.rows = {};
|
|
53714
53896
|
for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
|
|
53715
53897
|
...sheet.rows[row],
|
|
53716
|
-
size: this.getUserRowSize(sheet.id, row) ??
|
|
53898
|
+
size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
|
|
53717
53899
|
};
|
|
53718
53900
|
if (sheet.cols === void 0) sheet.cols = {};
|
|
53719
53901
|
for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
|
|
@@ -53894,8 +54076,8 @@ var ImagePlugin = class extends CorePlugin {
|
|
|
53894
54076
|
case "DUPLICATE_SHEET": {
|
|
53895
54077
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
53896
54078
|
for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
|
|
53897
|
-
const figureIdBase = fig.id.split(
|
|
53898
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
54079
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
54080
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
53899
54081
|
const image = this.getImage(fig.id);
|
|
53900
54082
|
if (image) {
|
|
53901
54083
|
const size = {
|
|
@@ -57592,8 +57774,8 @@ iconsOnCellRegistry.add("data_validation_checkbox", (getters, position) => {
|
|
|
57592
57774
|
hoverSvg,
|
|
57593
57775
|
priority: 2,
|
|
57594
57776
|
horizontalAlign: "center",
|
|
57595
|
-
size:
|
|
57596
|
-
margin:
|
|
57777
|
+
size: GRID_ICON_EDGE_LENGTH,
|
|
57778
|
+
margin: GRID_ICON_MARGIN,
|
|
57597
57779
|
position,
|
|
57598
57780
|
type: "data_validation_checkbox",
|
|
57599
57781
|
onClick: (position, env) => {
|
|
@@ -57640,7 +57822,7 @@ iconsOnCellRegistry.add("conditional_formatting", (getters, position) => {
|
|
|
57640
57822
|
priority: 1,
|
|
57641
57823
|
horizontalAlign: "left",
|
|
57642
57824
|
size: computeTextFontSizeInPixels(style),
|
|
57643
|
-
margin:
|
|
57825
|
+
margin: MIN_CF_ICON_MARGIN,
|
|
57644
57826
|
position
|
|
57645
57827
|
};
|
|
57646
57828
|
}
|
|
@@ -57655,13 +57837,13 @@ iconsOnCellRegistry.add("pivot_collapse", (getters, position) => {
|
|
|
57655
57837
|
const fields = pivotCell.dimension === "COL" ? definition.columns : definition.rows;
|
|
57656
57838
|
const hasIcon = !isDashboard && !getters.shouldShowFormulas() && pivotCell.domain.length !== fields.length;
|
|
57657
57839
|
const isCollapsed = (definition.collapsedDomains?.[pivotCell.dimension] ?? []).some((domain) => deepEquals(domain, pivotCell.domain));
|
|
57658
|
-
const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) *
|
|
57840
|
+
const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * PIVOT_INDENT : 0;
|
|
57659
57841
|
return {
|
|
57660
57842
|
type: "pivot_collapse",
|
|
57661
57843
|
priority: 4,
|
|
57662
57844
|
horizontalAlign: "left",
|
|
57663
|
-
size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ?
|
|
57664
|
-
margin: hasIcon ?
|
|
57845
|
+
size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ? PIVOT_COLLAPSE_ICON_SIZE : 0,
|
|
57846
|
+
margin: hasIcon ? GRID_ICON_MARGIN * 2 + indent : indent,
|
|
57665
57847
|
svg: hasIcon ? getPivotIconSvg(isCollapsed, false) : void 0,
|
|
57666
57848
|
hoverSvg: hasIcon ? getPivotIconSvg(isCollapsed, true) : void 0,
|
|
57667
57849
|
position,
|
|
@@ -58638,7 +58820,7 @@ var EvaluationDataValidationPlugin = class extends CoreViewPlugin {
|
|
|
58638
58820
|
return this.getDataValidationStyle(position);
|
|
58639
58821
|
}
|
|
58640
58822
|
getDataValidationChipStyle(position) {
|
|
58641
|
-
if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor:
|
|
58823
|
+
if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor: GRAY_200 };
|
|
58642
58824
|
}
|
|
58643
58825
|
getInvalidDataValidationMessage(cellPosition) {
|
|
58644
58826
|
const validationResult = this.getValidationResultForCell(cellPosition);
|
|
@@ -58867,7 +59049,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
|
|
|
58867
59049
|
}
|
|
58868
59050
|
}
|
|
58869
59051
|
getRowSize(sheetId, row) {
|
|
58870
|
-
return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ??
|
|
59052
|
+
return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? DEFAULT_CELL_HEIGHT);
|
|
58871
59053
|
}
|
|
58872
59054
|
getMaxAnchorOffset(sheetId, height, width) {
|
|
58873
59055
|
let { numberOfRows: row, numberOfCols: col } = this.getters.getSheetSize(sheetId);
|
|
@@ -58904,8 +59086,8 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
|
|
|
58904
59086
|
col,
|
|
58905
59087
|
row
|
|
58906
59088
|
});
|
|
58907
|
-
if (updatedCellHeight <=
|
|
58908
|
-
if (!tallestCellInRow && updatedCellHeight >
|
|
59089
|
+
if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
|
|
59090
|
+
if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
|
|
58909
59091
|
const newTallestCell = {
|
|
58910
59092
|
cell: {
|
|
58911
59093
|
sheetId,
|
|
@@ -58930,7 +59112,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
|
|
|
58930
59112
|
* merge, or the height of the cell computed based on its style/content.
|
|
58931
59113
|
*/
|
|
58932
59114
|
getCellHeight(position) {
|
|
58933
|
-
if (this.isInMultiRowMerge(position)) return
|
|
59115
|
+
if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
|
|
58934
59116
|
const cell = this.getters.getCell(position);
|
|
58935
59117
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
58936
59118
|
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
@@ -58952,7 +59134,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
|
|
|
58952
59134
|
if (!cell) continue;
|
|
58953
59135
|
const position = this.getters.getCellPosition(cell.id);
|
|
58954
59136
|
const cellHeight = this.getCellHeight(position);
|
|
58955
|
-
if (cellHeight > maxHeight && cellHeight >
|
|
59137
|
+
if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
|
|
58956
59138
|
maxHeight = cellHeight;
|
|
58957
59139
|
tallestCell = {
|
|
58958
59140
|
cell: position,
|
|
@@ -58960,7 +59142,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
|
|
|
58960
59142
|
};
|
|
58961
59143
|
}
|
|
58962
59144
|
}
|
|
58963
|
-
if (tallestCell && tallestCell.size >
|
|
59145
|
+
if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
|
|
58964
59146
|
}
|
|
58965
59147
|
};
|
|
58966
59148
|
|
|
@@ -59404,14 +59586,14 @@ function pivot_presentation_default(PivotClass) {
|
|
|
59404
59586
|
* @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
|
|
59405
59587
|
*/
|
|
59406
59588
|
getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
|
|
59407
|
-
const comparedDomain = valueToCompare ===
|
|
59589
|
+
const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
|
|
59408
59590
|
if (deepEquals(comparedDomain, domain)) return "sameValue";
|
|
59409
59591
|
if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
|
|
59410
59592
|
const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
|
|
59411
59593
|
return this.strictMeasureValueToNumber(comparedValue);
|
|
59412
59594
|
}
|
|
59413
59595
|
getPivotValueCells(measureId) {
|
|
59414
|
-
return this.
|
|
59596
|
+
return this.getExpandedTableStructure().getPivotCells().map((col) => col.filter((cell) => cell.type === "VALUE" && cell.measure === measureId)).filter((col) => col.length > 0);
|
|
59415
59597
|
}
|
|
59416
59598
|
measureValueToNumber(result) {
|
|
59417
59599
|
if (typeof result.value === "number") return result.value;
|
|
@@ -61921,7 +62103,7 @@ var Session = class extends EventBus {
|
|
|
61921
62103
|
this.trigger("new-local-state-update", { id: revision.id });
|
|
61922
62104
|
this.sendUpdateMessage({
|
|
61923
62105
|
type: "REMOTE_REVISION",
|
|
61924
|
-
version:
|
|
62106
|
+
version: MESSAGE_VERSION,
|
|
61925
62107
|
serverRevisionId: this.serverRevisionId,
|
|
61926
62108
|
nextRevisionId: revision.id,
|
|
61927
62109
|
clientId: revision.clientId,
|
|
@@ -61932,7 +62114,7 @@ var Session = class extends EventBus {
|
|
|
61932
62114
|
this.waitingUndoRedoAck = true;
|
|
61933
62115
|
this.sendUpdateMessage({
|
|
61934
62116
|
type: "REVISION_UNDONE",
|
|
61935
|
-
version:
|
|
62117
|
+
version: MESSAGE_VERSION,
|
|
61936
62118
|
serverRevisionId: this.serverRevisionId,
|
|
61937
62119
|
nextRevisionId: UuidGenerator.uuidv4(),
|
|
61938
62120
|
undoneRevisionId: revisionId
|
|
@@ -61942,7 +62124,7 @@ var Session = class extends EventBus {
|
|
|
61942
62124
|
this.waitingUndoRedoAck = true;
|
|
61943
62125
|
this.sendUpdateMessage({
|
|
61944
62126
|
type: "REVISION_REDONE",
|
|
61945
|
-
version:
|
|
62127
|
+
version: MESSAGE_VERSION,
|
|
61946
62128
|
serverRevisionId: this.serverRevisionId,
|
|
61947
62129
|
nextRevisionId: UuidGenerator.uuidv4(),
|
|
61948
62130
|
redoneRevisionId: revisionId
|
|
@@ -61983,7 +62165,7 @@ var Session = class extends EventBus {
|
|
|
61983
62165
|
await this.sendToTransport({
|
|
61984
62166
|
type: "CLIENT_LEFT",
|
|
61985
62167
|
clientId: this.clientId,
|
|
61986
|
-
version:
|
|
62168
|
+
version: MESSAGE_VERSION
|
|
61987
62169
|
});
|
|
61988
62170
|
}
|
|
61989
62171
|
/**
|
|
@@ -62000,7 +62182,7 @@ var Session = class extends EventBus {
|
|
|
62000
62182
|
...data,
|
|
62001
62183
|
revisionId: snapshotId
|
|
62002
62184
|
},
|
|
62003
|
-
version:
|
|
62185
|
+
version: MESSAGE_VERSION
|
|
62004
62186
|
});
|
|
62005
62187
|
}
|
|
62006
62188
|
getCurrentClient() {
|
|
@@ -62044,7 +62226,7 @@ var Session = class extends EventBus {
|
|
|
62044
62226
|
};
|
|
62045
62227
|
this.sendToTransport({
|
|
62046
62228
|
type,
|
|
62047
|
-
version:
|
|
62229
|
+
version: MESSAGE_VERSION,
|
|
62048
62230
|
client: {
|
|
62049
62231
|
...client,
|
|
62050
62232
|
position
|
|
@@ -62124,7 +62306,7 @@ var Session = class extends EventBus {
|
|
|
62124
62306
|
const { position } = client;
|
|
62125
62307
|
if (position) this.sendToTransport({
|
|
62126
62308
|
type: "CLIENT_MOVED",
|
|
62127
|
-
version:
|
|
62309
|
+
version: MESSAGE_VERSION,
|
|
62128
62310
|
client: {
|
|
62129
62311
|
...client,
|
|
62130
62312
|
position
|
|
@@ -63482,7 +63664,7 @@ var HistoryPlugin = class extends UIPlugin {
|
|
|
63482
63664
|
onNewLocalStateUpdate({ id }) {
|
|
63483
63665
|
this.undoStack.push(id);
|
|
63484
63666
|
this.redoStack = [];
|
|
63485
|
-
if (this.undoStack.length >
|
|
63667
|
+
if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
|
|
63486
63668
|
}
|
|
63487
63669
|
/**
|
|
63488
63670
|
* Fetch the last revision which is not empty and not a repeated command
|
|
@@ -63778,7 +63960,7 @@ var SplitToColumnsPlugin = class extends UIPlugin {
|
|
|
63778
63960
|
}
|
|
63779
63961
|
getAutoSeparatorForString(str) {
|
|
63780
63962
|
const separators = [
|
|
63781
|
-
|
|
63963
|
+
NEWLINE,
|
|
63782
63964
|
";",
|
|
63783
63965
|
",",
|
|
63784
63966
|
" ",
|
|
@@ -64137,9 +64319,9 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
64137
64319
|
contentWidth += computeMultilineTextSize(this.ctx, multiLineText, style).width;
|
|
64138
64320
|
}
|
|
64139
64321
|
for (const icon of this.getters.getCellIcons(position)) contentWidth += icon.margin + icon.size;
|
|
64140
|
-
if (this.getters.getDataValidationChipStyle(position)) contentWidth +=
|
|
64322
|
+
if (this.getters.getDataValidationChipStyle(position)) contentWidth += DATA_VALIDATION_CHIP_MARGIN * 2;
|
|
64141
64323
|
if (contentWidth === 0) return 0;
|
|
64142
|
-
contentWidth += 2 *
|
|
64324
|
+
contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
|
|
64143
64325
|
if (style.wrapping === "wrap") {
|
|
64144
64326
|
const colWidth = this.getters.getColSize(position.sheetId, position.col);
|
|
64145
64327
|
return Math.min(colWidth, contentWidth);
|
|
@@ -64190,11 +64372,11 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
64190
64372
|
computeTextYCoordinate(cellRect, textLineHeight, verticalAlign = DEFAULT_VERTICAL_ALIGN, numberOfLines = 1) {
|
|
64191
64373
|
const y = cellRect.y + 1;
|
|
64192
64374
|
const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
|
|
64193
|
-
if (cellRect.height > textHeight +
|
|
64375
|
+
if (cellRect.height > textHeight + MIN_CELL_TEXT_MARGIN * 2) {
|
|
64194
64376
|
if (verticalAlign === "middle") return Math.ceil(y + (cellRect.height - textHeight) / 2);
|
|
64195
|
-
if (verticalAlign === "bottom") return y + cellRect.height - textHeight -
|
|
64377
|
+
if (verticalAlign === "bottom") return y + cellRect.height - textHeight - MIN_CELL_TEXT_MARGIN;
|
|
64196
64378
|
}
|
|
64197
|
-
return y +
|
|
64379
|
+
return y + MIN_CELL_TEXT_MARGIN;
|
|
64198
64380
|
}
|
|
64199
64381
|
/**
|
|
64200
64382
|
* Expands the given zone until bordered by empty cells or reached the sheet boundaries.
|
|
@@ -64299,11 +64481,11 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
64299
64481
|
if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
|
|
64300
64482
|
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
64301
64483
|
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
64302
|
-
if (evaluatedSize > evaluatedRowSize && evaluatedSize >
|
|
64484
|
+
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = evaluatedSize;
|
|
64303
64485
|
} else {
|
|
64304
64486
|
const content = cell.content;
|
|
64305
64487
|
const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
64306
|
-
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize >
|
|
64488
|
+
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = 0;
|
|
64307
64489
|
}
|
|
64308
64490
|
}
|
|
64309
64491
|
rowSizes.push(evaluatedRowSize || null);
|
|
@@ -65004,7 +65186,7 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
65004
65186
|
const imageUrl = this.getters.getImage(figureId).path;
|
|
65005
65187
|
file = await this.fileStore?.getFile(imageUrl);
|
|
65006
65188
|
if (file.type !== "image/png") {
|
|
65007
|
-
if (file.size >
|
|
65189
|
+
if (file.size > MAX_FILE_SIZE) {
|
|
65008
65190
|
this.ui.notifyUI({
|
|
65009
65191
|
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))),
|
|
65010
65192
|
sticky: false,
|
|
@@ -66177,7 +66359,7 @@ var InternalViewport = class {
|
|
|
66177
66359
|
let height = lastRowEnd - this.offsetCorrectionY;
|
|
66178
66360
|
if (this.canScrollVertically) {
|
|
66179
66361
|
height = Math.max(height, this.viewportHeight);
|
|
66180
|
-
if (lastRowEnd +
|
|
66362
|
+
if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly() && this.viewportHeight > FOOTER_HEIGHT) height += FOOTER_HEIGHT;
|
|
66181
66363
|
}
|
|
66182
66364
|
return {
|
|
66183
66365
|
width,
|
|
@@ -66529,7 +66711,7 @@ var ViewportCollection = class {
|
|
|
66529
66711
|
return this.getSubViewports(sheetId).some((pane) => pane.isZoneVisible(zone));
|
|
66530
66712
|
}
|
|
66531
66713
|
getScrollBarWidth() {
|
|
66532
|
-
return
|
|
66714
|
+
return SCROLLBAR_WIDTH / this.zoomLevel;
|
|
66533
66715
|
}
|
|
66534
66716
|
getEdgeScrollCol(sheetId, x, previousX, startingX) {
|
|
66535
66717
|
let canEdgeScroll = false;
|
|
@@ -67056,7 +67238,7 @@ var SheetViewPlugin = class extends UIPlugin {
|
|
|
67056
67238
|
return this.chainValidations(() => this.viewports.checkScrollingDirection(sheetId, cmd), () => this.viewports.checkIfViewportsWillChange(sheetId, cmd))(cmd);
|
|
67057
67239
|
}
|
|
67058
67240
|
case "RESIZE_SHEETVIEW": return this.chainValidations(() => this.viewports.checkValuesAreDifferent(cmd), () => this.viewports.checkPositiveDimension(cmd))(cmd);
|
|
67059
|
-
case "SET_ZOOM": if (cmd.zoom >
|
|
67241
|
+
case "SET_ZOOM": if (isNaN(cmd.zoom) || cmd.zoom > MAX_ZOOM_LEVEL || cmd.zoom < MIN_ZOOM_LEVEL) return "InvalidZoomLevel";
|
|
67060
67242
|
else return "Success";
|
|
67061
67243
|
default: return "Success";
|
|
67062
67244
|
}
|
|
@@ -67260,7 +67442,7 @@ var SheetViewPlugin = class extends UIPlugin {
|
|
|
67260
67442
|
return this.viewports.isVisibleInViewport(cellPosition);
|
|
67261
67443
|
}
|
|
67262
67444
|
getScrollBarWidth() {
|
|
67263
|
-
return
|
|
67445
|
+
return SCROLLBAR_WIDTH / this.viewports.getZoomLevel();
|
|
67264
67446
|
}
|
|
67265
67447
|
getEdgeScrollCol(x, previousX, startingX) {
|
|
67266
67448
|
const sheetId = this.getters.getActiveSheetId();
|
|
@@ -69507,16 +69689,16 @@ var RowGroup = class extends AbstractHeaderGroup {
|
|
|
69507
69689
|
const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
|
|
69508
69690
|
const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
|
|
69509
69691
|
let groupHeaderY = 0;
|
|
69510
|
-
let groupHeaderHeight =
|
|
69692
|
+
let groupHeaderHeight = HEADER_HEIGHT;
|
|
69511
69693
|
if (startRow !== 0) {
|
|
69512
69694
|
const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
|
|
69513
|
-
groupHeaderY =
|
|
69695
|
+
groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
|
|
69514
69696
|
groupHeaderHeight = headerRowDims.end - headerRowDims.start;
|
|
69515
69697
|
}
|
|
69516
69698
|
const headerRect = {
|
|
69517
69699
|
x: this.props.layerOffset,
|
|
69518
69700
|
y: groupHeaderY,
|
|
69519
|
-
width:
|
|
69701
|
+
width: GROUP_LAYER_WIDTH,
|
|
69520
69702
|
height: groupHeaderHeight
|
|
69521
69703
|
};
|
|
69522
69704
|
return {
|
|
@@ -69524,7 +69706,7 @@ var RowGroup = class extends AbstractHeaderGroup {
|
|
|
69524
69706
|
groupRect: {
|
|
69525
69707
|
x: this.props.layerOffset,
|
|
69526
69708
|
y: headerRect.y,
|
|
69527
|
-
width:
|
|
69709
|
+
width: GROUP_LAYER_WIDTH,
|
|
69528
69710
|
height: headerRect.height + (endCoordinates - startCoordinates)
|
|
69529
69711
|
},
|
|
69530
69712
|
isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
|
|
@@ -69557,17 +69739,17 @@ var ColGroup = class extends AbstractHeaderGroup {
|
|
|
69557
69739
|
const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
|
|
69558
69740
|
const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
|
|
69559
69741
|
let groupHeaderX = 0;
|
|
69560
|
-
let groupHeaderWidth =
|
|
69742
|
+
let groupHeaderWidth = HEADER_WIDTH;
|
|
69561
69743
|
if (startCol !== 0) {
|
|
69562
69744
|
const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
|
|
69563
|
-
groupHeaderX =
|
|
69745
|
+
groupHeaderX = HEADER_WIDTH + headerRowDims.start;
|
|
69564
69746
|
groupHeaderWidth = headerRowDims.end - headerRowDims.start;
|
|
69565
69747
|
}
|
|
69566
69748
|
const headerRect = {
|
|
69567
69749
|
x: groupHeaderX,
|
|
69568
69750
|
y: this.props.layerOffset,
|
|
69569
69751
|
width: groupHeaderWidth,
|
|
69570
|
-
height:
|
|
69752
|
+
height: GROUP_LAYER_WIDTH
|
|
69571
69753
|
};
|
|
69572
69754
|
return {
|
|
69573
69755
|
headerRect,
|
|
@@ -69575,7 +69757,7 @@ var ColGroup = class extends AbstractHeaderGroup {
|
|
|
69575
69757
|
x: headerRect.x,
|
|
69576
69758
|
y: this.props.layerOffset,
|
|
69577
69759
|
width: headerRect.width + (endCoordinates - startCoordinates),
|
|
69578
|
-
height:
|
|
69760
|
+
height: GROUP_LAYER_WIDTH
|
|
69579
69761
|
},
|
|
69580
69762
|
isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
|
|
69581
69763
|
};
|
|
@@ -69601,7 +69783,7 @@ var HeaderGroupContainer = class extends Component {
|
|
|
69601
69783
|
menuItems: []
|
|
69602
69784
|
});
|
|
69603
69785
|
getLayerOffset(layerIndex) {
|
|
69604
|
-
return layerIndex *
|
|
69786
|
+
return layerIndex * GROUP_LAYER_WIDTH;
|
|
69605
69787
|
}
|
|
69606
69788
|
onContextMenu(event) {
|
|
69607
69789
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -69649,8 +69831,8 @@ var HeaderGroupContainer = class extends Component {
|
|
|
69649
69831
|
get frozenPaneContainerSize() {
|
|
69650
69832
|
if (!this.hasFrozenPane) return 0;
|
|
69651
69833
|
const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
|
|
69652
|
-
if (this.props.dimension === "COL") return
|
|
69653
|
-
else return
|
|
69834
|
+
if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
|
|
69835
|
+
else return HEADER_HEIGHT + viewportCoordinates.y;
|
|
69654
69836
|
}
|
|
69655
69837
|
};
|
|
69656
69838
|
|
|
@@ -69659,7 +69841,7 @@ var HeaderGroupContainer = class extends Component {
|
|
|
69659
69841
|
function useScreenWidth() {
|
|
69660
69842
|
const spreadsheetRect = useSpreadsheetRect();
|
|
69661
69843
|
return { get isSmall() {
|
|
69662
|
-
return spreadsheetRect.width <
|
|
69844
|
+
return spreadsheetRect.width < MOBILE_WIDTH_BREAKPOINT;
|
|
69663
69845
|
} };
|
|
69664
69846
|
}
|
|
69665
69847
|
|
|
@@ -70450,7 +70632,7 @@ var TopBarComposer = class extends Component {
|
|
|
70450
70632
|
"line-height": "24px"
|
|
70451
70633
|
};
|
|
70452
70634
|
if (this.env.model.getters.isCurrentSheetLocked()) style["pointer-events"] = "none";
|
|
70453
|
-
style.height = this.focus === "inactive" ? `${
|
|
70635
|
+
style.height = this.focus === "inactive" ? `${DESKTOP_TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
|
|
70454
70636
|
return cssPropertiesToCss(style);
|
|
70455
70637
|
}
|
|
70456
70638
|
onFocus(selection) {
|
|
@@ -71104,14 +71286,17 @@ var ToolBarZoom = class extends Component {
|
|
|
71104
71286
|
props = useProps({ class: types$1.string() });
|
|
71105
71287
|
topBarToolStore;
|
|
71106
71288
|
valueList = ZOOM_VALUES;
|
|
71289
|
+
minZoom = MIN_ZOOM_LEVEL * 100;
|
|
71290
|
+
maxZoom = MAX_ZOOM_LEVEL * 100;
|
|
71107
71291
|
setup() {
|
|
71108
71292
|
this.topBarToolStore = useToolBarDropdownStore();
|
|
71109
71293
|
}
|
|
71110
|
-
|
|
71111
|
-
|
|
71294
|
+
getZoomLevel() {
|
|
71295
|
+
const zoom = this.env.model.getters.getViewportZoomLevel() || 1;
|
|
71296
|
+
return Math.round(zoom * 100);
|
|
71112
71297
|
}
|
|
71113
|
-
setZoom(
|
|
71114
|
-
this.env.model.dispatch("SET_ZOOM", { zoom:
|
|
71298
|
+
setZoom(zoomPercentage) {
|
|
71299
|
+
this.env.model.dispatch("SET_ZOOM", { zoom: zoomPercentage / 100 });
|
|
71115
71300
|
}
|
|
71116
71301
|
toggle() {
|
|
71117
71302
|
if (this.topBarToolStore.isActive) this.topBarToolStore.closeDropdowns();
|
|
@@ -71645,7 +71830,7 @@ var Spreadsheet = class extends Component {
|
|
|
71645
71830
|
else {
|
|
71646
71831
|
if (this.env.model.getters.isDashboard()) properties["grid-template-rows"] = `auto`;
|
|
71647
71832
|
else properties["grid-template-rows"] = `min-content auto min-content`;
|
|
71648
|
-
properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize ||
|
|
71833
|
+
properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize || DEFAULT_SIDE_PANEL_SIZE}px` : "auto"}`;
|
|
71649
71834
|
}
|
|
71650
71835
|
return cssPropertiesToCss(properties);
|
|
71651
71836
|
}
|
|
@@ -71751,7 +71936,7 @@ var Spreadsheet = class extends Component {
|
|
|
71751
71936
|
checkViewportSize() {
|
|
71752
71937
|
const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
|
|
71753
71938
|
if (!isFinite(xRatio) || !isFinite(yRatio)) return;
|
|
71754
|
-
if (yRatio >
|
|
71939
|
+
if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
|
|
71755
71940
|
if (this.isViewportTooSmall) return;
|
|
71756
71941
|
this.notificationStore.notifyUser({
|
|
71757
71942
|
text: _t("The current window is too small to display this sheet properly. Consider resizing your browser window or adjusting frozen rows and columns."),
|
|
@@ -71769,8 +71954,8 @@ var Spreadsheet = class extends Component {
|
|
|
71769
71954
|
return this.env.model.getters.getSheetViewDimension().height;
|
|
71770
71955
|
}
|
|
71771
71956
|
get gridContainerStyle() {
|
|
71772
|
-
const gridColSize =
|
|
71773
|
-
const gridRowSize =
|
|
71957
|
+
const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
|
|
71958
|
+
const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
|
|
71774
71959
|
const zoom = this.env.model.getters.getViewportZoomLevel();
|
|
71775
71960
|
return cssPropertiesToCss({
|
|
71776
71961
|
"grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
|
|
@@ -73726,7 +73911,7 @@ function createChart(chart, chartSheetIndex, data) {
|
|
|
73726
73911
|
let title = escapeXml``;
|
|
73727
73912
|
if (chart.data.title?.text) {
|
|
73728
73913
|
const titleColor = chart.data.title.color ? toXlsxHexColor(chart.data.title.color) : toXlsxHexColor(chartMutedFontColor(chart.data.backgroundColor));
|
|
73729
|
-
const fontSize = chart.data.title.fontSize ??
|
|
73914
|
+
const fontSize = chart.data.title.fontSize ?? CHART_TITLE_FONT_SIZE;
|
|
73730
73915
|
title = escapeXml`
|
|
73731
73916
|
<c:title>
|
|
73732
73917
|
${insertText(chart.data.title.text, titleColor, fontSize, chart.data.title)}
|
|
@@ -73817,7 +74002,7 @@ function lineAttributes(params) {
|
|
|
73817
74002
|
</a:ln>
|
|
73818
74003
|
`;
|
|
73819
74004
|
}
|
|
73820
|
-
function insertText(text, fontColor = "000000", fontsize =
|
|
74005
|
+
function insertText(text, fontColor = "000000", fontsize = CHART_TITLE_FONT_SIZE, style = {}) {
|
|
73821
74006
|
return escapeXml`
|
|
73822
74007
|
<c:tx>
|
|
73823
74008
|
<c:rich>
|
|
@@ -74398,7 +74583,7 @@ function addDoughnutChart(chart, chartSheetIndex, data) {
|
|
|
74398
74583
|
return escapeXml`
|
|
74399
74584
|
<c:doughnutChart>
|
|
74400
74585
|
<c:varyColors val="1" />
|
|
74401
|
-
<c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ?
|
|
74586
|
+
<c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ? DEFAULT_DOUGHNUT_CHART_HOLE_SIZE : 0)}" />
|
|
74402
74587
|
${joinXmlNodes(dataSetsNodes)}
|
|
74403
74588
|
${insertDataLabels({ showValues: chart.showValues })}
|
|
74404
74589
|
</c:doughnutChart>
|
|
@@ -74422,7 +74607,7 @@ function insertDataLabels({ showLeaderLines, showValues } = {
|
|
|
74422
74607
|
}
|
|
74423
74608
|
function addAx(position, axisName, axId, crossAxId, title, defaultFontColor, deleteAxis = 0, orientation = "minMax", crossPosition, tickLabelPosition = "nextTo", maxValue, majorUnit, format = "General") {
|
|
74424
74609
|
const color = title?.color ? toXlsxHexColor(title.color) : defaultFontColor;
|
|
74425
|
-
const fontSize = title?.fontSize ??
|
|
74610
|
+
const fontSize = title?.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE;
|
|
74426
74611
|
const crossBetweenEl = axisName === "c:valAx" ? escapeXml`<c:crossBetween val="between" />` : "";
|
|
74427
74612
|
const maxValueEl = maxValue ? escapeXml`<c:max val="${maxValue}" />` : "";
|
|
74428
74613
|
const minValueEl = maxValue ? escapeXml`<c:min val="${-maxValue}" />` : "";
|
|
@@ -75050,12 +75235,12 @@ function figureCoordinates(headers, anchor, offset) {
|
|
|
75050
75235
|
let currentPosition = 0;
|
|
75051
75236
|
for (const [headerIndex, header] of headers.slice(anchor).entries()) if (currentPosition <= offset && offset < currentPosition + header.size) return {
|
|
75052
75237
|
index: anchor + headerIndex,
|
|
75053
|
-
offset: convertDotValueToEMU(offset - currentPosition +
|
|
75238
|
+
offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
|
|
75054
75239
|
};
|
|
75055
75240
|
else if (headerIndex < headers.length - 1) currentPosition += header.size;
|
|
75056
75241
|
return {
|
|
75057
75242
|
index: headers.length - 1,
|
|
75058
|
-
offset: convertDotValueToEMU(offset - currentPosition +
|
|
75243
|
+
offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
|
|
75059
75244
|
};
|
|
75060
75245
|
}
|
|
75061
75246
|
function createChartDrawing(figure, sheet, chartRelId, construct) {
|
|
@@ -75161,7 +75346,7 @@ function addSheetProtection(sheet) {
|
|
|
75161
75346
|
function addNumberFormats(numFmts) {
|
|
75162
75347
|
const numFmtNodes = [];
|
|
75163
75348
|
for (const [index, numFmt] of Object.entries(numFmts)) {
|
|
75164
|
-
const numFmtAttrs = [["numFmtId", parseInt(index) +
|
|
75349
|
+
const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
|
|
75165
75350
|
numFmtNodes.push(escapeXml`
|
|
75166
75351
|
<numFmt ${formatAttributes(numFmtAttrs)}/>
|
|
75167
75352
|
`);
|
|
@@ -75397,7 +75582,7 @@ function addColumns(construct, data, sheet) {
|
|
|
75397
75582
|
const attributes = [
|
|
75398
75583
|
["min", parseInt(id) + 1],
|
|
75399
75584
|
["max", parseInt(id) + 1],
|
|
75400
|
-
["width", convertWidthToExcel(col.size ||
|
|
75585
|
+
["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
|
|
75401
75586
|
["customWidth", 1],
|
|
75402
75587
|
["hidden", col.isHidden ? 1 : 0]
|
|
75403
75588
|
];
|
|
@@ -75423,7 +75608,7 @@ function addRows(construct, data, sheet) {
|
|
|
75423
75608
|
for (let r = 0; r < sheet.rowNumber; r++) {
|
|
75424
75609
|
const rowAttrs = [["r", r + 1]];
|
|
75425
75610
|
const row = sheet.rows[r] || {};
|
|
75426
|
-
if (row.size && row.size !==
|
|
75611
|
+
if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
|
|
75427
75612
|
if (row.isHidden) rowAttrs.push(["hidden", 1]);
|
|
75428
75613
|
if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
|
|
75429
75614
|
if (row.collapsed) rowAttrs.push(["collapsed", 1]);
|
|
@@ -75474,7 +75659,7 @@ function addRows(construct, data, sheet) {
|
|
|
75474
75659
|
</c>`);
|
|
75475
75660
|
}
|
|
75476
75661
|
}
|
|
75477
|
-
if (cellNodes.length || row.size !==
|
|
75662
|
+
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed || rowStyle || rowFormat) rowNodes.push(escapeXml`
|
|
75478
75663
|
<row ${formatAttributes(rowAttrs)}>
|
|
75479
75664
|
${joinXmlNodes(cellNodes)}
|
|
75480
75665
|
</row>
|
|
@@ -75664,7 +75849,7 @@ function createWorksheets(data, construct) {
|
|
|
75664
75849
|
let currentTableIndex = 1;
|
|
75665
75850
|
for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
|
|
75666
75851
|
const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
|
|
75667
|
-
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(
|
|
75852
|
+
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
|
|
75668
75853
|
const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
|
|
75669
75854
|
currentTableIndex += sheet.tables.length;
|
|
75670
75855
|
let drawingNode = escapeXml``;
|
|
@@ -76366,7 +76551,7 @@ var Model = class Model extends EventBus {
|
|
|
76366
76551
|
_exportData(shouldSquish) {
|
|
76367
76552
|
let data = createEmptyWorkbookData();
|
|
76368
76553
|
for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data, shouldSquish);
|
|
76369
|
-
data.revisionId = this.session.getRevisionId() ||
|
|
76554
|
+
data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
|
|
76370
76555
|
data = deepCopy(data);
|
|
76371
76556
|
return data;
|
|
76372
76557
|
}
|
|
@@ -77766,7 +77951,7 @@ var LinkDisplay = class extends Component {
|
|
|
77766
77951
|
col,
|
|
77767
77952
|
row
|
|
77768
77953
|
});
|
|
77769
|
-
const textColor = style?.textColor ===
|
|
77954
|
+
const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
|
|
77770
77955
|
this.env.model.dispatch("UPDATE_CELL", {
|
|
77771
77956
|
col,
|
|
77772
77957
|
row,
|
|
@@ -78280,8 +78465,8 @@ autoCompleteProviders.add("dataValidation", {
|
|
|
78280
78465
|
text: value.value,
|
|
78281
78466
|
htmlContent: [{
|
|
78282
78467
|
value: value.label,
|
|
78283
|
-
color: chipTextColor(color ||
|
|
78284
|
-
backgroundColor: color ||
|
|
78468
|
+
color: chipTextColor(color || GRAY_200),
|
|
78469
|
+
backgroundColor: color || GRAY_200,
|
|
78285
78470
|
classes: ["badge rounded-pill fs-6 fw-normal w-100 mt-1 text-start"]
|
|
78286
78471
|
}],
|
|
78287
78472
|
fuzzySearchKey: value.label
|
|
@@ -78824,7 +79009,7 @@ const BubbleChart = {
|
|
|
78824
79009
|
legend: getBubbleChartLegend(definition, chartData),
|
|
78825
79010
|
tooltip: getBubbleChartTooltip(definition, chartData),
|
|
78826
79011
|
chartShowValuesPlugin: getChartShowValues(definition, chartData),
|
|
78827
|
-
background: { color:
|
|
79012
|
+
background: { color: chartData.background }
|
|
78828
79013
|
}
|
|
78829
79014
|
}
|
|
78830
79015
|
} };
|
|
@@ -78935,7 +79120,7 @@ const ComboChart = {
|
|
|
78935
79120
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
78936
79121
|
return {
|
|
78937
79122
|
...definition,
|
|
78938
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
79123
|
+
backgroundColor: toXlsxHexColor(definition.background || DEFAULT_CHART_BACKGROUND_COLOR),
|
|
78939
79124
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
78940
79125
|
dataSets,
|
|
78941
79126
|
labelRange,
|
|
@@ -79180,7 +79365,7 @@ const PyramidChart = {
|
|
|
79180
79365
|
return {
|
|
79181
79366
|
...definition,
|
|
79182
79367
|
horizontal: true,
|
|
79183
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
79368
|
+
backgroundColor: toXlsxHexColor(definition.background || DEFAULT_CHART_BACKGROUND_COLOR),
|
|
79184
79369
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
79185
79370
|
dataSets,
|
|
79186
79371
|
labelRange,
|
|
@@ -79264,7 +79449,7 @@ const RadarChart = {
|
|
|
79264
79449
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
79265
79450
|
return {
|
|
79266
79451
|
...definition,
|
|
79267
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
79452
|
+
backgroundColor: toXlsxHexColor(definition.background || DEFAULT_CHART_BACKGROUND_COLOR),
|
|
79268
79453
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
79269
79454
|
dataSets,
|
|
79270
79455
|
labelRange
|
|
@@ -79343,7 +79528,7 @@ const ScatterChart = {
|
|
|
79343
79528
|
getDefinitionForExcel(getters, definition, { dataSets, labelRange }) {
|
|
79344
79529
|
return {
|
|
79345
79530
|
...definition,
|
|
79346
|
-
backgroundColor: toXlsxHexColor(definition.background ||
|
|
79531
|
+
backgroundColor: toXlsxHexColor(definition.background || DEFAULT_CHART_BACKGROUND_COLOR),
|
|
79347
79532
|
fontColor: toXlsxHexColor(chartFontColor(definition.background)),
|
|
79348
79533
|
dataSets,
|
|
79349
79534
|
labelRange,
|
|
@@ -79750,8 +79935,8 @@ iconsOnCellRegistry.add("filter_icon", (getters, position) => {
|
|
|
79750
79935
|
hoverSvg: getDataFilterIcon(isFilterActive, isHighContrast, true),
|
|
79751
79936
|
priority: 3,
|
|
79752
79937
|
horizontalAlign: "right",
|
|
79753
|
-
size:
|
|
79754
|
-
margin:
|
|
79938
|
+
size: GRID_ICON_EDGE_LENGTH,
|
|
79939
|
+
margin: GRID_ICON_MARGIN,
|
|
79755
79940
|
position,
|
|
79756
79941
|
onClick: (position, env) => {
|
|
79757
79942
|
const cellPopovers = env.getStore(CellPopoverStore);
|
|
@@ -85783,7 +85968,7 @@ const PIVOT = {
|
|
|
85783
85968
|
const error = pivot.assertIsValid({ throwOnError: false });
|
|
85784
85969
|
if (error) return error;
|
|
85785
85970
|
const table = pivot.getCollapsedTableStructure();
|
|
85786
|
-
if (table.numberOfCells >
|
|
85971
|
+
if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) return new EvaluationError(getPivotTooBigErrorMessage(table.numberOfCells, this.locale));
|
|
85787
85972
|
const cells = table.getPivotCells(pivotStyle);
|
|
85788
85973
|
const pivotTitle = this.getters.getPivotName(pivotId);
|
|
85789
85974
|
const { numberOfCols, numberOfRows } = table.getPivotTableDimensions(pivotStyle);
|
|
@@ -87481,14 +87666,14 @@ for (const category of categories) {
|
|
|
87481
87666
|
*/
|
|
87482
87667
|
const __info__ = {};
|
|
87483
87668
|
const SPREADSHEET_DIMENSIONS = {
|
|
87484
|
-
MIN_ROW_HEIGHT
|
|
87485
|
-
MIN_COL_WIDTH
|
|
87486
|
-
HEADER_HEIGHT
|
|
87487
|
-
HEADER_WIDTH
|
|
87488
|
-
DESKTOP_BOTTOMBAR_HEIGHT
|
|
87489
|
-
DEFAULT_CELL_WIDTH
|
|
87490
|
-
DEFAULT_CELL_HEIGHT
|
|
87491
|
-
SCROLLBAR_WIDTH
|
|
87669
|
+
MIN_ROW_HEIGHT,
|
|
87670
|
+
MIN_COL_WIDTH,
|
|
87671
|
+
HEADER_HEIGHT,
|
|
87672
|
+
HEADER_WIDTH,
|
|
87673
|
+
DESKTOP_BOTTOMBAR_HEIGHT,
|
|
87674
|
+
DEFAULT_CELL_WIDTH,
|
|
87675
|
+
DEFAULT_CELL_HEIGHT,
|
|
87676
|
+
SCROLLBAR_WIDTH
|
|
87492
87677
|
};
|
|
87493
87678
|
const registries = {
|
|
87494
87679
|
autoCompleteProviders,
|
|
@@ -87728,9 +87913,9 @@ const constants = {
|
|
|
87728
87913
|
PIVOT_STATIC_TABLE_CONFIG,
|
|
87729
87914
|
PIVOT_INSERT_TABLE_STYLE_ID,
|
|
87730
87915
|
ChartTerms,
|
|
87731
|
-
FIGURE_ID_SPLITTER
|
|
87732
|
-
GRID_ICON_EDGE_LENGTH
|
|
87733
|
-
GRID_ICON_MARGIN
|
|
87916
|
+
FIGURE_ID_SPLITTER,
|
|
87917
|
+
GRID_ICON_EDGE_LENGTH,
|
|
87918
|
+
GRID_ICON_MARGIN,
|
|
87734
87919
|
CHART_TYPES,
|
|
87735
87920
|
DARK_MODE_FILTER_STRING
|
|
87736
87921
|
};
|
|
@@ -87742,6 +87927,6 @@ const chartHelpers = {
|
|
|
87742
87927
|
//#endregion
|
|
87743
87928
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, BadExpressionError, CHART_TYPES, CellErrorType, CellValueType, CircularDependencyError, ClientDisconnectedError, ClipboardMIMEType, CommandResult, CompiledFormula, CorePlugin, CoreViewPlugin, DEFAULT_LOCALE, DEFAULT_LOCALES, DEFAULT_LOCALE_DIGIT_GROUPING, DIRECTION, DispatchResult, DivisionByZeroError, EvaluationError, InvalidReferenceError, LocalTransportService, Model, NEXT_VALUE, NotAvailableError, NumberTooLargeError, OrderedLayers, PREVIOUS_VALUE, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, SplillBlockedError, Spreadsheet, SpreadsheetPivotTable, UIPlugin, UnknownFunctionError, __info__, addFunction, addRenderingLayer, astToFormula, availableConditionalFormatOperators, availableDataValidationOperators, availableFiltersOperators, borderPositions, borderStyles, canExecuteInReadonly, categories, chartHelpers, compatibility, components, composerFocusTypes, constants, convertAstNodes, coreTypes, createAutocompleteArgumentsProvider, errorTypes, filterDateCriterionOperators, filterNumberCriterionOperators, filterTextCriterionOperators, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidSubtotalFormulasCommands, invalidateBordersCommands, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, isCoreCommand, isHeadersDependant, isMatrix, isPositionDependent, isRangeDependant, isSheetDependent, isTargetDependent, isZoneDependent, iterateAstNodes, links, load, lockedSheetAllowedCommands, parse, parseTokens, readonlyAllowedCommands, registries, schemeToColorScale, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
87744
87929
|
|
|
87745
|
-
__info__.version = "19.4.
|
|
87746
|
-
__info__.date = "2026-
|
|
87747
|
-
__info__.hash = "
|
|
87930
|
+
__info__.version = "19.4.14";
|
|
87931
|
+
__info__.date = "2026-10-01T07:47:35.933Z";
|
|
87932
|
+
__info__.hash = "67c7fe5";
|