@odoo/o-spreadsheet 18.0.81 → 18.0.83
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.esm.js +382 -312
- package/dist/o-spreadsheet.iife.js +382 -312
- package/dist/o-spreadsheet.iife.min.js +490 -490
- package/dist/o_spreadsheet.xml +4 -4
- package/dist/types/helpers/data_normalization.d.ts +5 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.0.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.83
|
|
6
|
+
* @date 2026-10-10T06:31:52.656Z
|
|
7
|
+
* @hash 22b9b73
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Component, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, xml } from "@odoo/owl";
|
|
@@ -207,6 +207,10 @@ const ALERT_INFO_BG = "#CDEDF1";
|
|
|
207
207
|
const ALERT_INFO_BORDER = "#98DBE2";
|
|
208
208
|
const ALERT_INFO_TEXT_COLOR = "#09414A";
|
|
209
209
|
const BADGE_SELECTED_COLOR = "#E6F2F3";
|
|
210
|
+
const DEFAULT_CHART_PADDING = 20;
|
|
211
|
+
const DEFAULT_CHART_FONT_SIZE = 22;
|
|
212
|
+
const SCORECARD_GAUGE_CHART_PADDING = 10;
|
|
213
|
+
const SCORECARD_GAUGE_CHART_FONT_SIZE = 14;
|
|
210
214
|
const COLOR_PICKER_DEFAULTS = [
|
|
211
215
|
"#000000",
|
|
212
216
|
"#434343",
|
|
@@ -289,8 +293,34 @@ const COLOR_PICKER_DEFAULTS = [
|
|
|
289
293
|
"#20124D",
|
|
290
294
|
"#4C1130"
|
|
291
295
|
];
|
|
296
|
+
const MIN_ROW_HEIGHT = 10;
|
|
297
|
+
const MIN_COL_WIDTH = 5;
|
|
298
|
+
const HEADER_HEIGHT = 26;
|
|
299
|
+
const HEADER_WIDTH = 48;
|
|
300
|
+
const TOPBAR_HEIGHT = 63;
|
|
301
|
+
const TOPBAR_TOOLBAR_HEIGHT = 34;
|
|
302
|
+
const BOTTOMBAR_HEIGHT = 36;
|
|
303
|
+
const DEFAULT_CELL_WIDTH = 96;
|
|
292
304
|
const DEFAULT_CELL_HEIGHT = 23;
|
|
293
|
-
const
|
|
305
|
+
const SCROLLBAR_WIDTH = 15;
|
|
306
|
+
const AUTOFILL_EDGE_LENGTH = 8;
|
|
307
|
+
const ICON_EDGE_LENGTH = 18;
|
|
308
|
+
const MIN_CF_ICON_MARGIN = 4;
|
|
309
|
+
const MIN_CELL_TEXT_MARGIN = 4;
|
|
310
|
+
const CF_ICON_EDGE_LENGTH = 15;
|
|
311
|
+
const PADDING_AUTORESIZE_VERTICAL = 3;
|
|
312
|
+
const PADDING_AUTORESIZE_HORIZONTAL = MIN_CELL_TEXT_MARGIN;
|
|
313
|
+
const GROUP_LAYER_WIDTH = 21;
|
|
314
|
+
const GRID_ICON_MARGIN = 2;
|
|
315
|
+
const GRID_ICON_EDGE_LENGTH = 17;
|
|
316
|
+
const FOOTER_HEIGHT = 2 * DEFAULT_CELL_HEIGHT;
|
|
317
|
+
const MENU_WIDTH = 250;
|
|
318
|
+
const MENU_VERTICAL_PADDING = 6;
|
|
319
|
+
const MENU_ITEM_HEIGHT = 26;
|
|
320
|
+
const MENU_ITEM_PADDING_HORIZONTAL = 11;
|
|
321
|
+
const MENU_ITEM_PADDING_VERTICAL = 4;
|
|
322
|
+
const MENU_SEPARATOR_BORDER_WIDTH = 1;
|
|
323
|
+
const MENU_SEPARATOR_PADDING = 5;
|
|
294
324
|
const DEFAULT_STYLE = {
|
|
295
325
|
align: "left",
|
|
296
326
|
verticalAlign: "bottom",
|
|
@@ -309,13 +339,22 @@ const DEFAULT_NUMBER_STYLE = {
|
|
|
309
339
|
};
|
|
310
340
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
311
341
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
342
|
+
const DEFAULT_FONT_WEIGHT = "400";
|
|
312
343
|
const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
|
|
344
|
+
const HEADER_FONT_SIZE = 11;
|
|
313
345
|
const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
|
|
314
346
|
const DEFAULT_BORDER_DESC = {
|
|
315
347
|
style: "thin",
|
|
316
348
|
color: "#000000"
|
|
317
349
|
};
|
|
350
|
+
const MAX_HISTORY_STEPS = 99;
|
|
318
351
|
const DEFAULT_REVISION_ID = "START_REVISION";
|
|
352
|
+
const DEFAULT_FIGURE_HEIGHT = 335;
|
|
353
|
+
const DEFAULT_FIGURE_WIDTH = 536;
|
|
354
|
+
const FIGURE_BORDER_WIDTH = 1;
|
|
355
|
+
const MIN_FIG_SIZE = 80;
|
|
356
|
+
const MAX_CHAR_LABEL = 20;
|
|
357
|
+
const FIGURE_ID_SPLITTER = "??";
|
|
319
358
|
const DEFAULT_GAUGE_LOWER_COLOR = "#EA6175";
|
|
320
359
|
const DEFAULT_GAUGE_MIDDLE_COLOR = "#FFD86D";
|
|
321
360
|
const DEFAULT_GAUGE_UPPER_COLOR = "#43C5B1";
|
|
@@ -323,6 +362,8 @@ const DEFAULT_SCORECARD_BASELINE_MODE = "difference";
|
|
|
323
362
|
const DEFAULT_SCORECARD_BASELINE_COLOR_UP = "#43C5B1";
|
|
324
363
|
const DEFAULT_SCORECARD_BASELINE_COLOR_DOWN = "#EA6175";
|
|
325
364
|
const LINE_FILL_TRANSPARENCY = .4;
|
|
365
|
+
const DEBOUNCE_TIME = 200;
|
|
366
|
+
const MESSAGE_VERSION = 1;
|
|
326
367
|
const FORBIDDEN_SHEETNAME_CHARS = [
|
|
327
368
|
"'",
|
|
328
369
|
"*",
|
|
@@ -333,6 +374,7 @@ const FORBIDDEN_SHEETNAME_CHARS = [
|
|
|
333
374
|
"]"
|
|
334
375
|
];
|
|
335
376
|
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
377
|
+
const FORMULA_REF_IDENTIFIER = "|";
|
|
336
378
|
let DEFAULT_SHEETVIEW_SIZE = 0;
|
|
337
379
|
function getDefaultSheetViewSize() {
|
|
338
380
|
return DEFAULT_SHEETVIEW_SIZE;
|
|
@@ -341,6 +383,7 @@ function setDefaultSheetViewSize(size) {
|
|
|
341
383
|
DEFAULT_SHEETVIEW_SIZE = size;
|
|
342
384
|
}
|
|
343
385
|
const MAXIMAL_FREEZABLE_RATIO = .85;
|
|
386
|
+
const NEWLINE = "\n";
|
|
344
387
|
const FONT_SIZES = [
|
|
345
388
|
6,
|
|
346
389
|
7,
|
|
@@ -725,7 +768,7 @@ const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
|
|
|
725
768
|
*/
|
|
726
769
|
function replaceNewLines(text) {
|
|
727
770
|
if (!text) return "";
|
|
728
|
-
return text.replace(newLineRegexp,
|
|
771
|
+
return text.replace(newLineRegexp, NEWLINE);
|
|
729
772
|
}
|
|
730
773
|
/**
|
|
731
774
|
* Determine if the numbers are consecutive.
|
|
@@ -1333,7 +1376,7 @@ function toCartesian(xc) {
|
|
|
1333
1376
|
consumeSpaces(chars);
|
|
1334
1377
|
const col = letterPart - 1;
|
|
1335
1378
|
const row = num - 1;
|
|
1336
|
-
if (!chars.isOver() || col > MAX_COL || row >
|
|
1379
|
+
if (!chars.isOver() || col > MAX_COL || row > MAX_ROW) throw new Error(`Invalid cell description: ${xc}`);
|
|
1337
1380
|
return {
|
|
1338
1381
|
col,
|
|
1339
1382
|
row
|
|
@@ -1771,7 +1814,7 @@ function toUnboundedZone(xc) {
|
|
|
1771
1814
|
const orderedZone = reorderZone(toZoneWithoutBoundaryChanges(xc));
|
|
1772
1815
|
const bottom = orderedZone.bottom;
|
|
1773
1816
|
const right = orderedZone.right;
|
|
1774
|
-
if (bottom !== void 0 && bottom >
|
|
1817
|
+
if (bottom !== void 0 && bottom > MAX_ROW || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
|
|
1775
1818
|
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");
|
|
1776
1819
|
return orderedZone;
|
|
1777
1820
|
}
|
|
@@ -2168,7 +2211,8 @@ const globalIdCounter = /* @__PURE__ */ new WeakMap();
|
|
|
2168
2211
|
function getItemId(item, itemsDic) {
|
|
2169
2212
|
if (!globalReverseLookup$1.has(itemsDic)) {
|
|
2170
2213
|
globalReverseLookup$1.set(itemsDic, /* @__PURE__ */ new Map());
|
|
2171
|
-
|
|
2214
|
+
const maxId = Math.max(...Object.keys(itemsDic).map(parseInt), 0);
|
|
2215
|
+
globalIdCounter.set(itemsDic, maxId);
|
|
2172
2216
|
}
|
|
2173
2217
|
const reverseLookup = globalReverseLookup$1.get(itemsDic);
|
|
2174
2218
|
const canonical = getCanonicalRepresentation(item);
|
|
@@ -2210,6 +2254,26 @@ function getCanonicalRepresentation(item) {
|
|
|
2210
2254
|
repr += "}";
|
|
2211
2255
|
return repr;
|
|
2212
2256
|
}
|
|
2257
|
+
/**
|
|
2258
|
+
* This adds a border/style/format to the cell position in the workbook data, updating the zonified structure accordingly.
|
|
2259
|
+
*/
|
|
2260
|
+
function addStyleToWorkbookData(workbookData, key, position, newItem) {
|
|
2261
|
+
const sheetData = workbookData.sheets.find((sheet) => sheet.id === position.sheetId);
|
|
2262
|
+
if (!sheetData) throw new Error(`Sheet with id ${position.sheetId} not found`);
|
|
2263
|
+
const id = getItemId(newItem, workbookData[key]);
|
|
2264
|
+
const zonifiedData = sheetData[key];
|
|
2265
|
+
const zone = positionToZone(position);
|
|
2266
|
+
const styleXc = Object.keys(zonifiedData).find((styleXc) => isZoneInside(zone, toZone(styleXc)));
|
|
2267
|
+
if (!styleXc) {
|
|
2268
|
+
zonifiedData[zoneToXc(zone)] = id;
|
|
2269
|
+
return;
|
|
2270
|
+
}
|
|
2271
|
+
const existingStyle = zonifiedData[styleXc];
|
|
2272
|
+
const remainingZones = recomputeZones([toZone(styleXc)], [zone]);
|
|
2273
|
+
delete zonifiedData[styleXc];
|
|
2274
|
+
for (const remainingZone of remainingZones) zonifiedData[zoneToXc(remainingZone)] = existingStyle;
|
|
2275
|
+
zonifiedData[zoneToXc(zone)] = id;
|
|
2276
|
+
}
|
|
2213
2277
|
|
|
2214
2278
|
//#endregion
|
|
2215
2279
|
//#region src/helpers/dates.ts
|
|
@@ -4124,7 +4188,7 @@ function parseNumberFormatTokens(tokens) {
|
|
|
4124
4188
|
switch (token.type) {
|
|
4125
4189
|
case "DIGIT":
|
|
4126
4190
|
if (parsedPart === integerPart) parsedPart.push(token);
|
|
4127
|
-
else if (numberOfDecimalsDigits <
|
|
4191
|
+
else if (numberOfDecimalsDigits < MAX_DECIMAL_PLACES) {
|
|
4128
4192
|
parsedPart.push(token);
|
|
4129
4193
|
numberOfDecimalsDigits++;
|
|
4130
4194
|
}
|
|
@@ -4441,7 +4505,7 @@ const numberRepresentation = [];
|
|
|
4441
4505
|
* exceed in the decimal part, in which case digits are rounded.
|
|
4442
4506
|
*
|
|
4443
4507
|
**/
|
|
4444
|
-
function splitNumber(value, maxDecimals =
|
|
4508
|
+
function splitNumber(value, maxDecimals = MAX_DECIMAL_PLACES) {
|
|
4445
4509
|
const asString = value.toString();
|
|
4446
4510
|
if (asString.includes("e")) return splitNumberIntl(value, maxDecimals);
|
|
4447
4511
|
if (Number.isInteger(value)) return {
|
|
@@ -4510,7 +4574,7 @@ function limitDecimalDigits(decimalDigits, maxDecimals) {
|
|
|
4510
4574
|
* Supports numbers with a lot of digits that are transformed to scientific notation by
|
|
4511
4575
|
* number.toString(), but is slow.
|
|
4512
4576
|
*/
|
|
4513
|
-
function splitNumberIntl(value, maxDecimals =
|
|
4577
|
+
function splitNumberIntl(value, maxDecimals = MAX_DECIMAL_PLACES) {
|
|
4514
4578
|
let formatter = numberRepresentation[maxDecimals];
|
|
4515
4579
|
if (!formatter) {
|
|
4516
4580
|
formatter = new Intl.NumberFormat("en-US", {
|
|
@@ -4997,7 +5061,7 @@ const MIN_DELAY = 20;
|
|
|
4997
5061
|
* Returns a timeout delay in milliseconds.
|
|
4998
5062
|
*/
|
|
4999
5063
|
function scrollDelay(value) {
|
|
5000
|
-
return
|
|
5064
|
+
return MIN_DELAY + (MAX_DELAY - MIN_DELAY) * Math.exp(-.035 * (value - 1));
|
|
5001
5065
|
}
|
|
5002
5066
|
|
|
5003
5067
|
//#endregion
|
|
@@ -5365,13 +5429,13 @@ function isSheetNameEqual(name1, name2) {
|
|
|
5365
5429
|
//#endregion
|
|
5366
5430
|
//#region src/helpers/text_helper.ts
|
|
5367
5431
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
5368
|
-
return numberOfLines * (textLineHeight +
|
|
5432
|
+
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
5369
5433
|
}
|
|
5370
5434
|
/**
|
|
5371
5435
|
* Get the default height of the cell given its style.
|
|
5372
5436
|
*/
|
|
5373
5437
|
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
5374
|
-
if (!cell || !cell.isFormula && !cell.content) return
|
|
5438
|
+
if (!cell || !cell.isFormula && !cell.content) return DEFAULT_CELL_HEIGHT;
|
|
5375
5439
|
let content = "";
|
|
5376
5440
|
try {
|
|
5377
5441
|
if (!cell.isFormula) {
|
|
@@ -5387,8 +5451,8 @@ function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
|
5387
5451
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
5388
5452
|
}
|
|
5389
5453
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
5390
|
-
const numberOfLines = splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 *
|
|
5391
|
-
return computeTextLinesHeight(computeTextFontSizeInPixels(style), numberOfLines) + 2 *
|
|
5454
|
+
const numberOfLines = splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : void 0).length;
|
|
5455
|
+
return computeTextLinesHeight(computeTextFontSizeInPixels(style), numberOfLines) + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
5392
5456
|
}
|
|
5393
5457
|
function getDefaultContextFont(fontSize, bold = false, italic = false) {
|
|
5394
5458
|
return `${italic ? "italic" : ""} ${bold ? "bold" : ""} ${fontSize}px ${DEFAULT_FONT}`;
|
|
@@ -5438,7 +5502,7 @@ function fontSizeInPixels(fontSize) {
|
|
|
5438
5502
|
return Math.round(fontSize * 96 / 72);
|
|
5439
5503
|
}
|
|
5440
5504
|
function computeTextFont(style, fontUnit = "pt") {
|
|
5441
|
-
return `${style.italic ? "italic " : ""}${style.bold ? "bold" :
|
|
5505
|
+
return `${style.italic ? "italic " : ""}${style.bold ? "bold" : DEFAULT_FONT_WEIGHT} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
5442
5506
|
}
|
|
5443
5507
|
function computeTextFontSizeInPixels(style) {
|
|
5444
5508
|
return fontSizeInPixels(style?.fontSize || DEFAULT_FONT_SIZE);
|
|
@@ -5462,7 +5526,7 @@ function splitTextToWidth(ctx, text, style, width) {
|
|
|
5462
5526
|
if (!style) style = {};
|
|
5463
5527
|
if (isMarkdownLink(text)) text = parseMarkdownLink(text).label;
|
|
5464
5528
|
const brokenText = [];
|
|
5465
|
-
const lines = text.includes(
|
|
5529
|
+
const lines = text.includes(NEWLINE) ? text.split(NEWLINE) : [text];
|
|
5466
5530
|
for (const line of lines) {
|
|
5467
5531
|
const words = line.includes(" ") ? line.split(" ") : [line];
|
|
5468
5532
|
if (!width) {
|
|
@@ -5526,7 +5590,7 @@ function getFontSizeMatchingWidth(lineWidth, maxFontSize, getTextWidth, precisio
|
|
|
5526
5590
|
return fontSize;
|
|
5527
5591
|
}
|
|
5528
5592
|
function computeIconWidth(style) {
|
|
5529
|
-
return computeTextFontSizeInPixels(style) + 2 *
|
|
5593
|
+
return computeTextFontSizeInPixels(style) + 2 * MIN_CF_ICON_MARGIN;
|
|
5530
5594
|
}
|
|
5531
5595
|
/** Transform a string to lower case. If the string is undefined, return an empty string */
|
|
5532
5596
|
function toLowerCase(str) {
|
|
@@ -6045,13 +6109,13 @@ function tokenizeSimpleSpace(chars) {
|
|
|
6045
6109
|
}
|
|
6046
6110
|
function tokenizeNewLine(chars) {
|
|
6047
6111
|
let length = 0;
|
|
6048
|
-
while (chars.current ===
|
|
6112
|
+
while (chars.current === NEWLINE) {
|
|
6049
6113
|
length++;
|
|
6050
6114
|
chars.shift();
|
|
6051
6115
|
}
|
|
6052
6116
|
if (length) return {
|
|
6053
6117
|
type: "SPACE",
|
|
6054
|
-
value:
|
|
6118
|
+
value: NEWLINE.repeat(length)
|
|
6055
6119
|
};
|
|
6056
6120
|
return null;
|
|
6057
6121
|
}
|
|
@@ -6705,7 +6769,7 @@ function getPreviousOrNextValueDomain(pivot, domain, fieldNameWithGranularity, d
|
|
|
6705
6769
|
if (value === void 0) return;
|
|
6706
6770
|
const valueIndex = values.indexOf(value);
|
|
6707
6771
|
if (value === void 0 || valueIndex === -1) return;
|
|
6708
|
-
return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction ===
|
|
6772
|
+
return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === PREVIOUS_VALUE ? -1 : 1), 0, values.length - 1)]);
|
|
6709
6773
|
}
|
|
6710
6774
|
function domainToString(domain) {
|
|
6711
6775
|
return domain ? domain.map(domainNodeToString).join(", ") : "";
|
|
@@ -8658,7 +8722,7 @@ function getFullTrendingLineDataSet(dataset, config, data, labels) {
|
|
|
8658
8722
|
const borderColor = config.color || lightenColor(rgbaToHex(defaultBorderColor), .5);
|
|
8659
8723
|
return {
|
|
8660
8724
|
type: "line",
|
|
8661
|
-
xAxisID:
|
|
8725
|
+
xAxisID: TREND_LINE_XAXIS_ID,
|
|
8662
8726
|
yAxisID: dataset.yAxisID,
|
|
8663
8727
|
label: dataset.label ? _t("Trend line for %s", dataset.label) : "",
|
|
8664
8728
|
data: data.map((v, i) => ({
|
|
@@ -8763,6 +8827,7 @@ const chartShowValuesPlugin = {
|
|
|
8763
8827
|
case "doughnut":
|
|
8764
8828
|
drawPieChartValues(chart, options, ctx);
|
|
8765
8829
|
break;
|
|
8830
|
+
case "combo":
|
|
8766
8831
|
case "bar":
|
|
8767
8832
|
case "line":
|
|
8768
8833
|
options.horizontal ? drawHorizontalBarChartValues(chart, options, ctx) : drawLineOrBarChartValues(chart, options, ctx);
|
|
@@ -8780,13 +8845,13 @@ function drawTextWithBackground(text, x, y, ctx) {
|
|
|
8780
8845
|
function drawLineOrBarChartValues(chart, options, ctx) {
|
|
8781
8846
|
const textsPositions = {};
|
|
8782
8847
|
for (const dataset of chart._metasets) {
|
|
8783
|
-
if (dataset.xAxisID ===
|
|
8848
|
+
if (dataset.xAxisID === TREND_LINE_XAXIS_ID) return;
|
|
8784
8849
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
8785
8850
|
const value = dataset._parsed[i].y;
|
|
8786
8851
|
const point = dataset.data[i];
|
|
8787
8852
|
const xPosition = point.x;
|
|
8788
8853
|
let yPosition = 0;
|
|
8789
|
-
if (
|
|
8854
|
+
if (dataset.type === "line") yPosition = point.y - 10;
|
|
8790
8855
|
else yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
|
|
8791
8856
|
if (!textsPositions[xPosition]) textsPositions[xPosition] = [];
|
|
8792
8857
|
for (const otherPosition of textsPositions[xPosition] || []) if (Math.abs(otherPosition - yPosition) < 13) yPosition = otherPosition - 13;
|
|
@@ -8800,7 +8865,7 @@ function drawLineOrBarChartValues(chart, options, ctx) {
|
|
|
8800
8865
|
function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
8801
8866
|
const textsPositions = {};
|
|
8802
8867
|
for (const dataset of chart._metasets) {
|
|
8803
|
-
if (dataset.xAxisID ===
|
|
8868
|
+
if (dataset.xAxisID === TREND_LINE_XAXIS_ID) return;
|
|
8804
8869
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
8805
8870
|
const value = dataset._parsed[i].x;
|
|
8806
8871
|
const displayValue = options.callback(value, dataset, i);
|
|
@@ -8987,6 +9052,9 @@ const WIDTH_FACTOR = .143;
|
|
|
8987
9052
|
const EXCEL_DEFAULT_COL_WIDTH = 8.43;
|
|
8988
9053
|
/** unit : points */
|
|
8989
9054
|
const EXCEL_DEFAULT_ROW_HEIGHT = 12.75;
|
|
9055
|
+
const EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS = 30;
|
|
9056
|
+
const EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS = 100;
|
|
9057
|
+
const FIRST_NUMFMT_ID = 164;
|
|
8990
9058
|
const FORCE_DEFAULT_ARGS_FUNCTIONS = {
|
|
8991
9059
|
FLOOR: [{
|
|
8992
9060
|
type: "NUMBER",
|
|
@@ -9304,9 +9372,9 @@ css`
|
|
|
9304
9372
|
display: flex;
|
|
9305
9373
|
align-items: center;
|
|
9306
9374
|
justify-content: center;
|
|
9307
|
-
width: ${
|
|
9308
|
-
height: ${
|
|
9309
|
-
font-size: ${
|
|
9375
|
+
width: ${ICON_EDGE_LENGTH}px;
|
|
9376
|
+
height: ${ICON_EDGE_LENGTH}px;
|
|
9377
|
+
font-size: ${ICON_EDGE_LENGTH}px;
|
|
9310
9378
|
vertical-align: middle;
|
|
9311
9379
|
|
|
9312
9380
|
.small-text {
|
|
@@ -10278,7 +10346,7 @@ function extractStyle(cell, data) {
|
|
|
10278
10346
|
alignment: {
|
|
10279
10347
|
horizontal: style.align,
|
|
10280
10348
|
vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
|
|
10281
|
-
wrapText: style.wrapping === "wrap" || cell.content?.includes(
|
|
10349
|
+
wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : void 0,
|
|
10282
10350
|
shrinkToFit: style.wrapping === "clip" ? true : void 0
|
|
10283
10351
|
}
|
|
10284
10352
|
};
|
|
@@ -10309,7 +10377,7 @@ function normalizeStyle(construct, styles) {
|
|
|
10309
10377
|
function convertFormat(format, numFmtStructure) {
|
|
10310
10378
|
if (!format) return 0;
|
|
10311
10379
|
let formatId = XLSX_FORMAT_MAP[format.format];
|
|
10312
|
-
if (!formatId) formatId = pushElement(format, numFmtStructure) +
|
|
10380
|
+
if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
10313
10381
|
return formatId;
|
|
10314
10382
|
}
|
|
10315
10383
|
/**
|
|
@@ -10891,8 +10959,8 @@ function getSheetDims(sheet) {
|
|
|
10891
10959
|
dims[0] = Math.max(dims[0], largeMax(row.cells.map((cell) => toCartesian(cell.xc).col)));
|
|
10892
10960
|
dims[1] = Math.max(dims[1], row.index);
|
|
10893
10961
|
}
|
|
10894
|
-
dims[0] = Math.max(dims[0],
|
|
10895
|
-
dims[1] = Math.max(dims[1],
|
|
10962
|
+
dims[0] = Math.max(dims[0], EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
|
|
10963
|
+
dims[1] = Math.max(dims[1], EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
|
|
10896
10964
|
return dims;
|
|
10897
10965
|
}
|
|
10898
10966
|
/**
|
|
@@ -11997,7 +12065,7 @@ var XlsxBaseExtractor = class {
|
|
|
11997
12065
|
rgb = this.getThemeColor(themeIndex, theme.clrScheme);
|
|
11998
12066
|
} else {
|
|
11999
12067
|
rgb = this.extractAttr(colorElement, "rgb")?.asString();
|
|
12000
|
-
rgb = rgb ===
|
|
12068
|
+
rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
|
|
12001
12069
|
}
|
|
12002
12070
|
return {
|
|
12003
12071
|
rgb: rgb || defaultColor,
|
|
@@ -13075,7 +13143,7 @@ function getPathsOfContent(contentType, xmls) {
|
|
|
13075
13143
|
* Get the corresponding relationship file for a given xml file in a XLSX directory.
|
|
13076
13144
|
*/
|
|
13077
13145
|
function getRelationFile(file, xmls) {
|
|
13078
|
-
if (file ===
|
|
13146
|
+
if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
|
|
13079
13147
|
let relsFile = "";
|
|
13080
13148
|
const pathParts = file.split("/");
|
|
13081
13149
|
for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
|
|
@@ -13275,7 +13343,7 @@ function normalizeV9(formula) {
|
|
|
13275
13343
|
if (token.type === "REFERENCE" && cellReference.test(token.value)) {
|
|
13276
13344
|
const value = token.value.trim();
|
|
13277
13345
|
if (!dependencies.includes(value)) dependencies.push(value);
|
|
13278
|
-
return `${
|
|
13346
|
+
return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
|
|
13279
13347
|
} else return token.value;
|
|
13280
13348
|
})),
|
|
13281
13349
|
dependencies
|
|
@@ -13503,7 +13571,7 @@ migrationStepRegistry.add("migration_1", {
|
|
|
13503
13571
|
if (cell.formula) {
|
|
13504
13572
|
let { text, dependencies } = cell.formula;
|
|
13505
13573
|
for (const [index, d] of Object.entries(dependencies)) {
|
|
13506
|
-
const stringPosition = `\\${
|
|
13574
|
+
const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
|
|
13507
13575
|
text = text.replace(new RegExp(stringPosition, "g"), d);
|
|
13508
13576
|
}
|
|
13509
13577
|
cell.content = text;
|
|
@@ -13699,7 +13767,7 @@ function load(data, verboseImport) {
|
|
|
13699
13767
|
if (verboseImport) for (const parsingError of reader.warningManager.warnings.sort()) console.warn(parsingError);
|
|
13700
13768
|
}
|
|
13701
13769
|
if ("version" in data) {
|
|
13702
|
-
if (data.version <
|
|
13770
|
+
if (data.version < CURRENT_VERSION) {
|
|
13703
13771
|
console.debug("Migrating data from version", data.version);
|
|
13704
13772
|
data = migrate(data);
|
|
13705
13773
|
}
|
|
@@ -13755,7 +13823,7 @@ function forceUnicityOfFigure(data) {
|
|
|
13755
13823
|
* sensible default values
|
|
13756
13824
|
*/
|
|
13757
13825
|
function setDefaults(partialData) {
|
|
13758
|
-
const data = Object.assign(createEmptyWorkbookData(), partialData, { version:
|
|
13826
|
+
const data = Object.assign(createEmptyWorkbookData(), partialData, { version: CURRENT_VERSION });
|
|
13759
13827
|
data.sheets = data.sheets ? data.sheets.map((s, i) => Object.assign(createEmptySheet(`Sheet${i + 1}`, `Sheet${i + 1}`), s)) : [];
|
|
13760
13828
|
if (data.sheets.length === 0) data.sheets.push(createEmptySheet(INITIAL_SHEET_ID, "Sheet1"));
|
|
13761
13829
|
if (!isValidLocale(data.settings.locale)) data.settings.locale = DEFAULT_LOCALE;
|
|
@@ -13897,7 +13965,7 @@ function createEmptySheet(sheetId, name) {
|
|
|
13897
13965
|
}
|
|
13898
13966
|
function createEmptyWorkbookData(sheetName = "Sheet1") {
|
|
13899
13967
|
return {
|
|
13900
|
-
version:
|
|
13968
|
+
version: CURRENT_VERSION,
|
|
13901
13969
|
sheets: [createEmptySheet(INITIAL_SHEET_ID, sheetName)],
|
|
13902
13970
|
styles: {},
|
|
13903
13971
|
formats: {},
|
|
@@ -13928,7 +13996,7 @@ function createEmptyExcelWorkbookData() {
|
|
|
13928
13996
|
//#region src/helpers/ui/paste_interactive.ts
|
|
13929
13997
|
const PasteInteractiveContent = {
|
|
13930
13998
|
wrongPasteSelection: _t("This operation is not allowed with multiple selections."),
|
|
13931
|
-
willRemoveExistingMerge: _t("
|
|
13999
|
+
willRemoveExistingMerge: _t("Cannot perform this action on merged cells. Unmerge the cells and try again."),
|
|
13932
14000
|
wrongFigurePasteOption: _t("Cannot do a special paste of a figure."),
|
|
13933
14001
|
frozenPaneOverlap: _t("This operation is not allowed due to an overlapping frozen pane.")
|
|
13934
14002
|
};
|
|
@@ -13947,7 +14015,7 @@ function interactivePaste(env, target, pasteOption) {
|
|
|
13947
14015
|
}));
|
|
13948
14016
|
}
|
|
13949
14017
|
function interactivePasteFromOS(env, target, clipboardContent, pasteOption) {
|
|
13950
|
-
if (clipboardContent.data && clipboardContent.data.version !==
|
|
14018
|
+
if (clipboardContent.data && clipboardContent.data.version !== CURRENT_VERSION) env.notifyUser({
|
|
13951
14019
|
type: "warning",
|
|
13952
14020
|
text: _t("You copied content from a different version of the application. Only text content will be pasted."),
|
|
13953
14021
|
sticky: false
|
|
@@ -14160,9 +14228,9 @@ const GAUGE_TEXT_COLOR_HIGH_CONTRAST = "#C8C8C8";
|
|
|
14160
14228
|
const GAUGE_INFLECTION_MARKER_COLOR = "#666666aa";
|
|
14161
14229
|
const GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN = 6;
|
|
14162
14230
|
const GAUGE_TITLE_SECTION_HEIGHT = 25;
|
|
14163
|
-
const GAUGE_TITLE_FONT_SIZE =
|
|
14164
|
-
const GAUGE_TITLE_PADDING_LEFT =
|
|
14165
|
-
const GAUGE_TITLE_PADDING_TOP =
|
|
14231
|
+
const GAUGE_TITLE_FONT_SIZE = SCORECARD_GAUGE_CHART_FONT_SIZE;
|
|
14232
|
+
const GAUGE_TITLE_PADDING_LEFT = SCORECARD_GAUGE_CHART_PADDING;
|
|
14233
|
+
const GAUGE_TITLE_PADDING_TOP = SCORECARD_GAUGE_CHART_PADDING;
|
|
14166
14234
|
function drawGaugeChart(canvas, runtime) {
|
|
14167
14235
|
const canvasBoundingRect = canvas.getBoundingClientRect();
|
|
14168
14236
|
const dpr = window.devicePixelRatio || 1;
|
|
@@ -14256,18 +14324,18 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
14256
14324
|
x: boundingRect.width / 2,
|
|
14257
14325
|
y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
|
|
14258
14326
|
};
|
|
14259
|
-
let gaugeValueFontSize =
|
|
14327
|
+
let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
|
|
14260
14328
|
if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
|
|
14261
14329
|
const maxTextWidth = gaugeRect.width / 2;
|
|
14262
14330
|
const gaugeLabel = gaugeValue?.label || "-";
|
|
14263
14331
|
if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
|
|
14264
14332
|
const minLabelPosition = {
|
|
14265
14333
|
x: gaugeRect.x + gaugeArcWidth / 2,
|
|
14266
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
14334
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
14267
14335
|
};
|
|
14268
14336
|
const maxLabelPosition = {
|
|
14269
14337
|
x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
|
|
14270
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
14338
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
14271
14339
|
};
|
|
14272
14340
|
const textColor = getContrastedTextColor(runtime.background);
|
|
14273
14341
|
const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
|
|
@@ -14318,13 +14386,13 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
14318
14386
|
minLabel: {
|
|
14319
14387
|
label: runtime.minValue.label,
|
|
14320
14388
|
textPosition: minLabelPosition,
|
|
14321
|
-
fontSize:
|
|
14389
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14322
14390
|
color: textColor
|
|
14323
14391
|
},
|
|
14324
14392
|
maxLabel: {
|
|
14325
14393
|
label: runtime.maxValue.label,
|
|
14326
14394
|
textPosition: maxLabelPosition,
|
|
14327
|
-
fontSize:
|
|
14395
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14328
14396
|
color: textColor
|
|
14329
14397
|
}
|
|
14330
14398
|
};
|
|
@@ -14334,9 +14402,9 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
14334
14402
|
* space for the title and labels.
|
|
14335
14403
|
*/
|
|
14336
14404
|
function getGaugeRect(boundingRect, title) {
|
|
14337
|
-
const titleHeight = title ?
|
|
14338
|
-
const drawHeight = boundingRect.height -
|
|
14339
|
-
const drawWidth = boundingRect.width -
|
|
14405
|
+
const titleHeight = title ? GAUGE_TITLE_SECTION_HEIGHT : 0;
|
|
14406
|
+
const drawHeight = boundingRect.height - GAUGE_PADDING_BOTTOM - titleHeight - GAUGE_PADDING_TOP;
|
|
14407
|
+
const drawWidth = boundingRect.width - GAUGE_PADDING_SIDE * 2;
|
|
14340
14408
|
let gaugeWidth;
|
|
14341
14409
|
let gaugeHeight;
|
|
14342
14410
|
if (drawWidth > 2 * drawHeight) {
|
|
@@ -14347,8 +14415,8 @@ function getGaugeRect(boundingRect, title) {
|
|
|
14347
14415
|
gaugeHeight = drawWidth / 2;
|
|
14348
14416
|
}
|
|
14349
14417
|
return {
|
|
14350
|
-
x:
|
|
14351
|
-
y: titleHeight +
|
|
14418
|
+
x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
|
|
14419
|
+
y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
|
|
14352
14420
|
width: gaugeWidth,
|
|
14353
14421
|
height: gaugeHeight
|
|
14354
14422
|
};
|
|
@@ -14365,20 +14433,20 @@ function getInflectionValues(runtime, gaugeRect, textColor, ctx) {
|
|
|
14365
14433
|
x: gaugeRect.x + gaugeRect.width / 2,
|
|
14366
14434
|
y: gaugeRect.y + gaugeRect.height
|
|
14367
14435
|
};
|
|
14368
|
-
const textStyle = { fontSize:
|
|
14436
|
+
const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
|
|
14369
14437
|
const inflectionValues = [];
|
|
14370
14438
|
const inflectionValuesTextRects = [];
|
|
14371
14439
|
for (const inflectionValue of runtime.inflectionValues) {
|
|
14372
14440
|
const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
|
|
14373
14441
|
const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
|
|
14374
14442
|
const angle = Math.PI - Math.PI * percentage;
|
|
14375
|
-
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2,
|
|
14376
|
-
const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ?
|
|
14443
|
+
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, GAUGE_LABELS_FONT_SIZE);
|
|
14444
|
+
const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? GAUGE_LABELS_FONT_SIZE : 0;
|
|
14377
14445
|
inflectionValuesTextRects.push(textRect);
|
|
14378
14446
|
inflectionValues.push({
|
|
14379
14447
|
rotation: angle,
|
|
14380
14448
|
label: inflectionValue.label,
|
|
14381
|
-
fontSize:
|
|
14449
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14382
14450
|
color: textColor,
|
|
14383
14451
|
offset
|
|
14384
14452
|
});
|
|
@@ -14588,8 +14656,8 @@ var ScorecardChart$1 = class ScorecardChart$1 extends AbstractChart {
|
|
|
14588
14656
|
this.baselineMode = definition.baselineMode;
|
|
14589
14657
|
this.baselineDescr = definition.baselineDescr;
|
|
14590
14658
|
this.background = definition.background;
|
|
14591
|
-
this.baselineColorUp = definition.baselineColorUp ??
|
|
14592
|
-
this.baselineColorDown = definition.baselineColorDown ??
|
|
14659
|
+
this.baselineColorUp = definition.baselineColorUp ?? DEFAULT_SCORECARD_BASELINE_COLOR_UP;
|
|
14660
|
+
this.baselineColorDown = definition.baselineColorDown ?? DEFAULT_SCORECARD_BASELINE_COLOR_DOWN;
|
|
14593
14661
|
this.humanize = definition.humanize ?? false;
|
|
14594
14662
|
}
|
|
14595
14663
|
static validateChartDefinition(validator, definition) {
|
|
@@ -14664,7 +14732,7 @@ function drawScoreChart(structure, canvas) {
|
|
|
14664
14732
|
canvas.width = dpr * structure.canvas.width;
|
|
14665
14733
|
canvas.height = dpr * structure.canvas.height;
|
|
14666
14734
|
ctx.scale(dpr, dpr);
|
|
14667
|
-
const availableWidth = structure.canvas.width -
|
|
14735
|
+
const availableWidth = structure.canvas.width - DEFAULT_CHART_PADDING;
|
|
14668
14736
|
ctx.fillStyle = structure.canvas.backgroundColor;
|
|
14669
14737
|
ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
|
|
14670
14738
|
if (structure.title) {
|
|
@@ -14779,9 +14847,9 @@ function createScorecardChartRuntime(chart, getters) {
|
|
|
14779
14847
|
|
|
14780
14848
|
//#endregion
|
|
14781
14849
|
//#region src/helpers/figures/charts/scorecard_chart_config_builder.ts
|
|
14782
|
-
const CHART_PADDING =
|
|
14850
|
+
const CHART_PADDING = SCORECARD_GAUGE_CHART_PADDING;
|
|
14783
14851
|
const BOTTOM_PADDING_RATIO = .05;
|
|
14784
|
-
const CHART_TITLE_FONT_SIZE =
|
|
14852
|
+
const CHART_TITLE_FONT_SIZE = SCORECARD_GAUGE_CHART_FONT_SIZE;
|
|
14785
14853
|
const KEY_VALUE_FONT_SIZE = 32;
|
|
14786
14854
|
const BASELINE_MAX_FONT_SIZE = 16;
|
|
14787
14855
|
function formatBaselineDescr(baselineDescr, baseline) {
|
|
@@ -14847,7 +14915,7 @@ var ScorecardChartConfigBuilder = class {
|
|
|
14847
14915
|
y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING
|
|
14848
14916
|
}
|
|
14849
14917
|
};
|
|
14850
|
-
const minimalBaselinePosition = baselineArrowSize +
|
|
14918
|
+
const minimalBaselinePosition = baselineArrowSize + DEFAULT_CHART_PADDING;
|
|
14851
14919
|
if (structure.baseline.position.x < minimalBaselinePosition) structure.baseline.position.x = minimalBaselinePosition;
|
|
14852
14920
|
if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
|
|
14853
14921
|
direction: this.baselineArrow,
|
|
@@ -15025,7 +15093,7 @@ function aggregateDataForLabels(labels, datasets) {
|
|
|
15025
15093
|
}
|
|
15026
15094
|
function truncateLabel(label) {
|
|
15027
15095
|
if (!label) return "";
|
|
15028
|
-
if (label.length >
|
|
15096
|
+
if (label.length > MAX_CHAR_LABEL) return label.substring(0, MAX_CHAR_LABEL) + "…";
|
|
15029
15097
|
return label;
|
|
15030
15098
|
}
|
|
15031
15099
|
/**
|
|
@@ -15040,10 +15108,10 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
|
|
|
15040
15108
|
responsive: true,
|
|
15041
15109
|
maintainAspectRatio: false,
|
|
15042
15110
|
layout: { padding: {
|
|
15043
|
-
left:
|
|
15044
|
-
right:
|
|
15045
|
-
top: chartTitle.text ?
|
|
15046
|
-
bottom:
|
|
15111
|
+
left: DEFAULT_CHART_PADDING,
|
|
15112
|
+
right: DEFAULT_CHART_PADDING,
|
|
15113
|
+
top: chartTitle.text ? DEFAULT_CHART_PADDING / 2 : DEFAULT_CHART_PADDING + 5,
|
|
15114
|
+
bottom: DEFAULT_CHART_PADDING
|
|
15047
15115
|
} },
|
|
15048
15116
|
elements: {
|
|
15049
15117
|
line: { fill: false },
|
|
@@ -15057,7 +15125,7 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
|
|
|
15057
15125
|
color: chartTitle?.color ?? fontColor,
|
|
15058
15126
|
align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
|
|
15059
15127
|
font: {
|
|
15060
|
-
size:
|
|
15128
|
+
size: DEFAULT_CHART_FONT_SIZE,
|
|
15061
15129
|
weight: chartTitle.bold ? "bold" : "normal",
|
|
15062
15130
|
style: chartTitle.italic ? "italic" : "normal"
|
|
15063
15131
|
}
|
|
@@ -23491,7 +23559,7 @@ var ContentEditableHelper = class {
|
|
|
23491
23559
|
while (!current.done) {
|
|
23492
23560
|
if (!current.value.hasChildNodes()) text += current.value.textContent;
|
|
23493
23561
|
if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) if (isFirstParagraph) isFirstParagraph = false;
|
|
23494
|
-
else text +=
|
|
23562
|
+
else text += NEWLINE;
|
|
23495
23563
|
current = it.next();
|
|
23496
23564
|
}
|
|
23497
23565
|
return text;
|
|
@@ -23718,7 +23786,7 @@ var Composer = class extends Component {
|
|
|
23718
23786
|
if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
|
|
23719
23787
|
} else {
|
|
23720
23788
|
assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
|
|
23721
|
-
if (composerRect.left + ASSISTANT_WIDTH +
|
|
23789
|
+
if (composerRect.left + ASSISTANT_WIDTH + SCROLLBAR_WIDTH + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
|
|
23722
23790
|
}
|
|
23723
23791
|
return assistantStyle;
|
|
23724
23792
|
}
|
|
@@ -23832,7 +23900,7 @@ var Composer = class extends Component {
|
|
|
23832
23900
|
const start = Math.min(selection.start, selection.end);
|
|
23833
23901
|
const end = Math.max(selection.start, selection.end);
|
|
23834
23902
|
this.props.composerStore.stopComposerRangeSelection();
|
|
23835
|
-
this.props.composerStore.setCurrentContent(content.slice(0, start) +
|
|
23903
|
+
this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
|
|
23836
23904
|
start: start + 1,
|
|
23837
23905
|
end: start + 1
|
|
23838
23906
|
});
|
|
@@ -24061,8 +24129,8 @@ var Composer = class extends Component {
|
|
|
24061
24129
|
splitHtmlContentIntoLines(contents) {
|
|
24062
24130
|
const contentSplitInLines = [];
|
|
24063
24131
|
let currentLine = [];
|
|
24064
|
-
for (const content of contents) if (content.value.includes(
|
|
24065
|
-
const lines = content.value.split(
|
|
24132
|
+
for (const content of contents) if (content.value.includes(NEWLINE)) {
|
|
24133
|
+
const lines = content.value.split(NEWLINE);
|
|
24066
24134
|
const lastLine = lines.pop();
|
|
24067
24135
|
for (const line of lines) {
|
|
24068
24136
|
currentLine.push({
|
|
@@ -25283,7 +25351,7 @@ var BarChart = class BarChart extends AbstractChart {
|
|
|
25283
25351
|
const definition = this.getDefinition();
|
|
25284
25352
|
return {
|
|
25285
25353
|
...definition,
|
|
25286
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
25354
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
25287
25355
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
25288
25356
|
dataSets,
|
|
25289
25357
|
labelRange,
|
|
@@ -25373,7 +25441,7 @@ function createBarChartRuntime(chart, getters) {
|
|
|
25373
25441
|
label,
|
|
25374
25442
|
data,
|
|
25375
25443
|
hidden,
|
|
25376
|
-
borderColor: definition.background ||
|
|
25444
|
+
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
25377
25445
|
borderWidth: definition.stacked ? 1 : 0,
|
|
25378
25446
|
backgroundColor: color
|
|
25379
25447
|
};
|
|
@@ -25387,7 +25455,7 @@ function createBarChartRuntime(chart, getters) {
|
|
|
25387
25455
|
}
|
|
25388
25456
|
if (trendDatasets.length) {
|
|
25389
25457
|
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset.data.length));
|
|
25390
|
-
config.options.scales[
|
|
25458
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25391
25459
|
...xAxis,
|
|
25392
25460
|
labels: Array(maxLength).fill(""),
|
|
25393
25461
|
offset: false,
|
|
@@ -25395,12 +25463,12 @@ function createBarChartRuntime(chart, getters) {
|
|
|
25395
25463
|
};
|
|
25396
25464
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
25397
25465
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
25398
|
-
return tooltipItems.some((item) => item.dataset.xAxisID !==
|
|
25466
|
+
return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
|
|
25399
25467
|
};
|
|
25400
25468
|
}
|
|
25401
25469
|
return {
|
|
25402
25470
|
chartJsConfig: config,
|
|
25403
|
-
background: chart.background ||
|
|
25471
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
25404
25472
|
};
|
|
25405
25473
|
}
|
|
25406
25474
|
|
|
@@ -25687,7 +25755,7 @@ function createLineOrScatterChartRuntime(chart, getters) {
|
|
|
25687
25755
|
config.options.plugins.tooltip.callbacks.label = (tooltipItem) => {
|
|
25688
25756
|
let dataSetPoint;
|
|
25689
25757
|
let label;
|
|
25690
|
-
if (tooltipItem.dataset.xAxisID ===
|
|
25758
|
+
if (tooltipItem.dataset.xAxisID === TREND_LINE_XAXIS_ID) {
|
|
25691
25759
|
dataSetPoint = dataSetsValues[tooltipItem.datasetIndex].data[tooltipItem.dataIndex].y;
|
|
25692
25760
|
label = "";
|
|
25693
25761
|
} else {
|
|
@@ -25758,23 +25826,23 @@ function createLineOrScatterChartRuntime(chart, getters) {
|
|
|
25758
25826
|
}
|
|
25759
25827
|
}
|
|
25760
25828
|
if (trendDatasets.length) {
|
|
25761
|
-
config.options.scales[
|
|
25829
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25762
25830
|
...xAxis,
|
|
25763
25831
|
display: false
|
|
25764
25832
|
};
|
|
25765
25833
|
if (axisType === "category" || axisType === "time") {
|
|
25766
|
-
config.options.scales[
|
|
25767
|
-
config.options.scales[
|
|
25768
|
-
config.options.scales[
|
|
25834
|
+
config.options.scales[TREND_LINE_XAXIS_ID]["type"] = "category";
|
|
25835
|
+
config.options.scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
|
|
25836
|
+
config.options.scales[TREND_LINE_XAXIS_ID]["offset"] = false;
|
|
25769
25837
|
}
|
|
25770
25838
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
25771
25839
|
}
|
|
25772
25840
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
25773
|
-
return axisType !== "linear" && tooltipItems.some((item) => item.dataset.xAxisID !==
|
|
25841
|
+
return axisType !== "linear" && tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
|
|
25774
25842
|
};
|
|
25775
25843
|
return {
|
|
25776
25844
|
chartJsConfig: config,
|
|
25777
|
-
background: chart.background ||
|
|
25845
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
25778
25846
|
};
|
|
25779
25847
|
}
|
|
25780
25848
|
|
|
@@ -25850,7 +25918,7 @@ var ComboChart = class ComboChart extends AbstractChart {
|
|
|
25850
25918
|
const definition = this.getDefinition();
|
|
25851
25919
|
return {
|
|
25852
25920
|
...definition,
|
|
25853
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
25921
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
25854
25922
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
25855
25923
|
dataSets,
|
|
25856
25924
|
labelRange,
|
|
@@ -25904,6 +25972,7 @@ function createComboChartRuntime(chart, getters) {
|
|
|
25904
25972
|
};
|
|
25905
25973
|
const fontColor = chartFontColor(chart.background);
|
|
25906
25974
|
const config = getDefaultChartJsRuntime(chart, labels, fontColor, localeFormat);
|
|
25975
|
+
config.type = "bar";
|
|
25907
25976
|
const legend = getChartJsLegend(fontColor);
|
|
25908
25977
|
if (chart.legendPosition === "none") legend.display = false;
|
|
25909
25978
|
else legend.position = chart.legendPosition;
|
|
@@ -25989,19 +26058,19 @@ function createComboChartRuntime(chart, getters) {
|
|
|
25989
26058
|
}
|
|
25990
26059
|
if (trendDatasets.length) {
|
|
25991
26060
|
const trendLinesMaxLength = Math.max(...trendDatasets.map((trend) => trend.data.length));
|
|
25992
|
-
config.options.scales[
|
|
26061
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25993
26062
|
labels: Array(Math.round(trendLinesMaxLength)).fill(""),
|
|
25994
26063
|
offset: false,
|
|
25995
26064
|
display: false
|
|
25996
26065
|
};
|
|
25997
26066
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
25998
26067
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
25999
|
-
return tooltipItems.some((item) => item.dataset.xAxisID !==
|
|
26068
|
+
return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
|
|
26000
26069
|
};
|
|
26001
26070
|
}
|
|
26002
26071
|
return {
|
|
26003
26072
|
chartJsConfig: config,
|
|
26004
|
-
background: chart.background ||
|
|
26073
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26005
26074
|
};
|
|
26006
26075
|
}
|
|
26007
26076
|
|
|
@@ -26325,7 +26394,7 @@ var LineChart = class LineChart extends AbstractChart {
|
|
|
26325
26394
|
const definition = this.getDefinition();
|
|
26326
26395
|
return {
|
|
26327
26396
|
...definition,
|
|
26328
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26397
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26329
26398
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26330
26399
|
dataSets,
|
|
26331
26400
|
labelRange,
|
|
@@ -26422,7 +26491,7 @@ var PieChart = class PieChart extends AbstractChart {
|
|
|
26422
26491
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
26423
26492
|
return {
|
|
26424
26493
|
...this.getDefinition(),
|
|
26425
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26494
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26426
26495
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26427
26496
|
dataSets,
|
|
26428
26497
|
labelRange
|
|
@@ -26526,7 +26595,7 @@ function createPieChartRuntime(chart, getters) {
|
|
|
26526
26595
|
if (chart.isDoughnut) config.type = "doughnut";
|
|
26527
26596
|
return {
|
|
26528
26597
|
chartJsConfig: config,
|
|
26529
|
-
background: chart.background ||
|
|
26598
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26530
26599
|
};
|
|
26531
26600
|
}
|
|
26532
26601
|
|
|
@@ -26658,7 +26727,7 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
26658
26727
|
config.options.plugins.chartShowValuesPlugin.callback = (value, dataset, index) => callback(Math.abs(value), dataset, index);
|
|
26659
26728
|
return {
|
|
26660
26729
|
chartJsConfig: config,
|
|
26661
|
-
background: chart.background ||
|
|
26730
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26662
26731
|
};
|
|
26663
26732
|
}
|
|
26664
26733
|
|
|
@@ -26756,7 +26825,7 @@ var ScatterChart = class ScatterChart extends AbstractChart {
|
|
|
26756
26825
|
const definition = this.getDefinition();
|
|
26757
26826
|
return {
|
|
26758
26827
|
...definition,
|
|
26759
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26828
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26760
26829
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26761
26830
|
dataSets,
|
|
26762
26831
|
labelRange,
|
|
@@ -26905,9 +26974,9 @@ function getWaterfallConfiguration(chart, labels, dataSeriesLabels, localeFormat
|
|
|
26905
26974
|
const { locale, format } = localeFormat;
|
|
26906
26975
|
const fontColor = chartFontColor(chart.background);
|
|
26907
26976
|
const config = getDefaultChartJsRuntime(chart, labels, fontColor, localeFormat);
|
|
26908
|
-
const negativeColor = chart.negativeValuesColor ||
|
|
26909
|
-
const positiveColor = chart.positiveValuesColor ||
|
|
26910
|
-
const subTotalColor = chart.subTotalValuesColor ||
|
|
26977
|
+
const negativeColor = chart.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
26978
|
+
const positiveColor = chart.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
26979
|
+
const subTotalColor = chart.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
26911
26980
|
const legend = { labels: { generateLabels: () => {
|
|
26912
26981
|
const legendValues = [{
|
|
26913
26982
|
text: _t("Positive values"),
|
|
@@ -27011,9 +27080,9 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
27011
27080
|
locale
|
|
27012
27081
|
}, dataSetsValues);
|
|
27013
27082
|
config.type = "bar";
|
|
27014
|
-
const negativeColor = chart.negativeValuesColor ||
|
|
27015
|
-
const positiveColor = chart.positiveValuesColor ||
|
|
27016
|
-
const subTotalColor = chart.subTotalValuesColor ||
|
|
27083
|
+
const negativeColor = chart.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
27084
|
+
const positiveColor = chart.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
27085
|
+
const subTotalColor = chart.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
27017
27086
|
const backgroundColor = [];
|
|
27018
27087
|
const datasetValues = [];
|
|
27019
27088
|
const dataset = {
|
|
@@ -27048,7 +27117,7 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
27048
27117
|
config.data.labels = labelsWithSubTotals.map(truncateLabel);
|
|
27049
27118
|
return {
|
|
27050
27119
|
chartJsConfig: config,
|
|
27051
|
-
background: chart.background ||
|
|
27120
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
27052
27121
|
};
|
|
27053
27122
|
}
|
|
27054
27123
|
|
|
@@ -27777,7 +27846,7 @@ const CSS = css`
|
|
|
27777
27846
|
.o-filter-menu-item {
|
|
27778
27847
|
display: flex;
|
|
27779
27848
|
box-sizing: border-box;
|
|
27780
|
-
height: ${
|
|
27849
|
+
height: ${MENU_ITEM_HEIGHT}px;
|
|
27781
27850
|
padding: 4px 4px 4px 0px;
|
|
27782
27851
|
cursor: pointer;
|
|
27783
27852
|
user-select: none;
|
|
@@ -28212,7 +28281,7 @@ var LinkDisplay = class extends Component {
|
|
|
28212
28281
|
col,
|
|
28213
28282
|
row
|
|
28214
28283
|
});
|
|
28215
|
-
const textColor = style?.textColor ===
|
|
28284
|
+
const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
|
|
28216
28285
|
this.env.model.dispatch("UPDATE_CELL", {
|
|
28217
28286
|
col,
|
|
28218
28287
|
row,
|
|
@@ -28619,15 +28688,15 @@ var TopRightPopoverContext = class extends PopoverPositionContext {
|
|
|
28619
28688
|
css`
|
|
28620
28689
|
.o-menu {
|
|
28621
28690
|
background-color: white;
|
|
28622
|
-
padding: ${
|
|
28623
|
-
width: ${
|
|
28691
|
+
padding: ${MENU_VERTICAL_PADDING}px 0px;
|
|
28692
|
+
width: ${MENU_WIDTH}px;
|
|
28624
28693
|
box-sizing: border-box !important;
|
|
28625
28694
|
user-select: none;
|
|
28626
28695
|
|
|
28627
28696
|
.o-menu-item {
|
|
28628
28697
|
box-sizing: border-box;
|
|
28629
|
-
height: ${
|
|
28630
|
-
padding: ${
|
|
28698
|
+
height: ${MENU_ITEM_HEIGHT}px;
|
|
28699
|
+
padding: ${MENU_ITEM_PADDING_VERTICAL}px ${MENU_ITEM_PADDING_HORIZONTAL}px;
|
|
28631
28700
|
cursor: pointer;
|
|
28632
28701
|
user-select: none;
|
|
28633
28702
|
|
|
@@ -28638,8 +28707,8 @@ css`
|
|
|
28638
28707
|
.o-menu-item-icon {
|
|
28639
28708
|
display: inline-block;
|
|
28640
28709
|
margin: 0px 8px 0px 0px;
|
|
28641
|
-
width: ${
|
|
28642
|
-
line-height: ${
|
|
28710
|
+
width: ${MENU_ITEM_HEIGHT - 2 * MENU_ITEM_PADDING_VERTICAL}px;
|
|
28711
|
+
line-height: ${MENU_ITEM_HEIGHT - 2 * MENU_ITEM_PADDING_VERTICAL}px;
|
|
28643
28712
|
}
|
|
28644
28713
|
|
|
28645
28714
|
&:not(.disabled) {
|
|
@@ -28744,11 +28813,11 @@ var Menu = class Menu extends Component {
|
|
|
28744
28813
|
anchorRect: {
|
|
28745
28814
|
x: this.props.position.x,
|
|
28746
28815
|
y: this.props.position.y,
|
|
28747
|
-
width: isRoot ? 0 : this.props.width ||
|
|
28748
|
-
height: isRoot ? 0 :
|
|
28816
|
+
width: isRoot ? 0 : this.props.width || MENU_WIDTH,
|
|
28817
|
+
height: isRoot ? 0 : MENU_ITEM_HEIGHT
|
|
28749
28818
|
},
|
|
28750
28819
|
positioning: "TopRight",
|
|
28751
|
-
verticalOffset: isRoot ? 0 :
|
|
28820
|
+
verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
|
|
28752
28821
|
onPopoverHidden: () => this.closeSubMenu(),
|
|
28753
28822
|
onPopoverMoved: () => this.closeSubMenu()
|
|
28754
28823
|
};
|
|
@@ -29429,8 +29498,8 @@ const CREATE_CHART = (env) => {
|
|
|
29429
29498
|
const sheetId = getters.getActiveSheetId();
|
|
29430
29499
|
if (getZoneArea(env.model.getters.getSelectedZone()) === 1) env.model.selection.selectTableAroundSelection();
|
|
29431
29500
|
const size = {
|
|
29432
|
-
width:
|
|
29433
|
-
height:
|
|
29501
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
29502
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
29434
29503
|
};
|
|
29435
29504
|
const position = getChartPositionAtCenterOfViewport(getters, size);
|
|
29436
29505
|
if (env.model.dispatch("CREATE_CHART", {
|
|
@@ -31254,7 +31323,7 @@ function getVisiblePivotCellPositions(getters, pivotId) {
|
|
|
31254
31323
|
function drawHighlight(renderingContext, highlight, rect) {
|
|
31255
31324
|
const { x, y, width, height } = rect;
|
|
31256
31325
|
if (width < 0 || height < 0) return;
|
|
31257
|
-
const color = highlight.color ||
|
|
31326
|
+
const color = highlight.color || HIGHLIGHT_COLOR;
|
|
31258
31327
|
const { ctx } = renderingContext;
|
|
31259
31328
|
ctx.save();
|
|
31260
31329
|
if (!highlight.noBorder) {
|
|
@@ -31749,8 +31818,8 @@ css`
|
|
|
31749
31818
|
-webkit-appearance: none;
|
|
31750
31819
|
-moz-appearance: none;
|
|
31751
31820
|
border-radius: 0;
|
|
31752
|
-
width: ${
|
|
31753
|
-
height: ${
|
|
31821
|
+
width: ${CHECKBOX_WIDTH}px;
|
|
31822
|
+
height: ${CHECKBOX_WIDTH}px;
|
|
31754
31823
|
vertical-align: top;
|
|
31755
31824
|
box-sizing: border-box;
|
|
31756
31825
|
outline: none;
|
|
@@ -32692,7 +32761,7 @@ function dragAndDropBeyondTheViewport(env, cbMouseMove, cbMouseUp, only = false)
|
|
|
32692
32761
|
let { scrollX, scrollY } = getters.getActiveSheetDOMScrollInfo();
|
|
32693
32762
|
const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
|
|
32694
32763
|
let canEdgeScroll = false;
|
|
32695
|
-
let timeoutDelay =
|
|
32764
|
+
let timeoutDelay = MAX_DELAY;
|
|
32696
32765
|
const x = currentEv.clientX - position.left;
|
|
32697
32766
|
colIndex = getters.getColIndex(x);
|
|
32698
32767
|
if (only !== "vertical") {
|
|
@@ -32858,9 +32927,9 @@ css`
|
|
|
32858
32927
|
}
|
|
32859
32928
|
}
|
|
32860
32929
|
.o-separator {
|
|
32861
|
-
border-bottom: ${
|
|
32862
|
-
margin-top: ${
|
|
32863
|
-
margin-bottom: ${
|
|
32930
|
+
border-bottom: ${MENU_SEPARATOR_BORDER_WIDTH}px solid ${SEPARATOR_COLOR};
|
|
32931
|
+
margin-top: ${MENU_SEPARATOR_PADDING}px;
|
|
32932
|
+
margin-bottom: ${MENU_SEPARATOR_PADDING}px;
|
|
32864
32933
|
}
|
|
32865
32934
|
|
|
32866
32935
|
.o-custom-selector {
|
|
@@ -33002,7 +33071,7 @@ var ColorPicker = class extends Component {
|
|
|
33002
33071
|
}
|
|
33003
33072
|
get sliderStyle() {
|
|
33004
33073
|
const hue = this.state.currentHslaColor?.h || 0;
|
|
33005
|
-
return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) -
|
|
33074
|
+
return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - ICON_EDGE_LENGTH / 2}px` });
|
|
33006
33075
|
}
|
|
33007
33076
|
get pointerStyle() {
|
|
33008
33077
|
const { s, l } = this.state.currentHslaColor || {
|
|
@@ -34127,13 +34196,13 @@ var WaterfallChartDesignPanel = class extends Component {
|
|
|
34127
34196
|
}];
|
|
34128
34197
|
}
|
|
34129
34198
|
get positiveValuesColor() {
|
|
34130
|
-
return this.props.definition.positiveValuesColor ||
|
|
34199
|
+
return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
34131
34200
|
}
|
|
34132
34201
|
get negativeValuesColor() {
|
|
34133
|
-
return this.props.definition.negativeValuesColor ||
|
|
34202
|
+
return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
34134
34203
|
}
|
|
34135
34204
|
get subTotalValuesColor() {
|
|
34136
|
-
return this.props.definition.subTotalValuesColor ||
|
|
34205
|
+
return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
34137
34206
|
}
|
|
34138
34207
|
updateLegendPosition(ev) {
|
|
34139
34208
|
this.props.updateChart(this.props.figureId, { legendPosition: ev.target.value });
|
|
@@ -35407,8 +35476,8 @@ css`
|
|
|
35407
35476
|
height: 50px;
|
|
35408
35477
|
width: 50px;
|
|
35409
35478
|
.o-icon {
|
|
35410
|
-
width: ${
|
|
35411
|
-
height: ${
|
|
35479
|
+
width: ${CF_ICON_EDGE_LENGTH}px;
|
|
35480
|
+
height: ${CF_ICON_EDGE_LENGTH}px;
|
|
35412
35481
|
}
|
|
35413
35482
|
}
|
|
35414
35483
|
.o-cf-preview-description {
|
|
@@ -35586,8 +35655,8 @@ css`
|
|
|
35586
35655
|
background-color: ${BADGE_SELECTED_COLOR};
|
|
35587
35656
|
}
|
|
35588
35657
|
.o-icon {
|
|
35589
|
-
width: ${
|
|
35590
|
-
height: ${
|
|
35658
|
+
width: ${CF_ICON_EDGE_LENGTH}px;
|
|
35659
|
+
height: ${CF_ICON_EDGE_LENGTH}px;
|
|
35591
35660
|
}
|
|
35592
35661
|
}
|
|
35593
35662
|
.o-cf-iconsets {
|
|
@@ -35861,7 +35930,7 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
35861
35930
|
getPreviewGradient() {
|
|
35862
35931
|
const rule = this.state.rules.colorScale;
|
|
35863
35932
|
const minColor = colorNumberString(rule.minimum.color);
|
|
35864
|
-
const midColor = colorNumberString(rule.midpoint?.color ||
|
|
35933
|
+
const midColor = colorNumberString(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
35865
35934
|
const maxColor = colorNumberString(rule.maximum.color);
|
|
35866
35935
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
35867
35936
|
return rule.midpoint === void 0 ? baseString + minColor + ", " + maxColor + ")" : baseString + minColor + ", " + midColor + ", " + maxColor + ")";
|
|
@@ -37675,7 +37744,7 @@ var FindAndReplacePanel = class extends Component {
|
|
|
37675
37744
|
}
|
|
37676
37745
|
get specificRangeMatchesCount() {
|
|
37677
37746
|
const range = this.searchOptions.specificRange;
|
|
37678
|
-
if (!range) return "";
|
|
37747
|
+
if (!range || range.invalidSheetName || range.invalidXc) return "";
|
|
37679
37748
|
const { sheetId, zone } = range;
|
|
37680
37749
|
return _t("%(matches)s matches in range %(range)s of %(sheetName)s", {
|
|
37681
37750
|
matches: this.store.specificRangeMatchesCount,
|
|
@@ -37860,7 +37929,7 @@ var PivotMeasureDisplayPanelStore = class extends SpreadsheetStore {
|
|
|
37860
37929
|
return {
|
|
37861
37930
|
type: measureDisplayType,
|
|
37862
37931
|
fieldNameWithGranularity,
|
|
37863
|
-
value: value ??
|
|
37932
|
+
value: value ?? PREVIOUS_VALUE
|
|
37864
37933
|
};
|
|
37865
37934
|
}
|
|
37866
37935
|
}
|
|
@@ -40329,7 +40398,7 @@ const SEPARATORS = [
|
|
|
40329
40398
|
},
|
|
40330
40399
|
{
|
|
40331
40400
|
name: _t("Line Break"),
|
|
40332
|
-
value:
|
|
40401
|
+
value: NEWLINE
|
|
40333
40402
|
}
|
|
40334
40403
|
];
|
|
40335
40404
|
var SplitIntoColumnsPanel = class extends Component {
|
|
@@ -41577,7 +41646,7 @@ var FigureComponent = class extends Component {
|
|
|
41577
41646
|
showMenu() {
|
|
41578
41647
|
const { x, y, width } = this.menuButtonRect;
|
|
41579
41648
|
const menuPosition = {
|
|
41580
|
-
x: x >=
|
|
41649
|
+
x: x >= MENU_WIDTH ? x - MENU_WIDTH : x + width,
|
|
41581
41650
|
y
|
|
41582
41651
|
};
|
|
41583
41652
|
this.openContextMenu(menuPosition);
|
|
@@ -41715,8 +41784,8 @@ var ArrayFormulaHighlight = class extends SpreadsheetStore {
|
|
|
41715
41784
|
css`
|
|
41716
41785
|
.o-autofill {
|
|
41717
41786
|
position: absolute;
|
|
41718
|
-
height: ${
|
|
41719
|
-
width: ${
|
|
41787
|
+
height: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41788
|
+
width: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41720
41789
|
border: 1px solid white;
|
|
41721
41790
|
box-sizing: border-box !important;
|
|
41722
41791
|
background-color: #1a73e8;
|
|
@@ -41724,8 +41793,8 @@ css`
|
|
|
41724
41793
|
|
|
41725
41794
|
.o-autofill-handler {
|
|
41726
41795
|
position: absolute;
|
|
41727
|
-
height: ${
|
|
41728
|
-
width: ${
|
|
41796
|
+
height: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41797
|
+
width: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41729
41798
|
&:hover {
|
|
41730
41799
|
cursor: crosshair;
|
|
41731
41800
|
}
|
|
@@ -42273,8 +42342,8 @@ var GridComposer = class extends Component {
|
|
|
42273
42342
|
//#region src/components/grid_cell_icon/grid_cell_icon.ts
|
|
42274
42343
|
css`
|
|
42275
42344
|
.o-grid-cell-icon {
|
|
42276
|
-
width: ${
|
|
42277
|
-
height: ${
|
|
42345
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42346
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42278
42347
|
}
|
|
42279
42348
|
`;
|
|
42280
42349
|
var GridCellIcon = class extends Component {
|
|
@@ -42306,11 +42375,11 @@ var GridCellIcon = class extends Component {
|
|
|
42306
42375
|
const end = rect.y + rect.height;
|
|
42307
42376
|
const cell = this.env.model.getters.getCell(cellPosition);
|
|
42308
42377
|
switch (this.props.verticalAlign || cell?.style?.verticalAlign || DEFAULT_VERTICAL_ALIGN) {
|
|
42309
|
-
case "bottom": return end -
|
|
42310
|
-
case "top": return start +
|
|
42378
|
+
case "bottom": return end - GRID_ICON_MARGIN - GRID_ICON_EDGE_LENGTH;
|
|
42379
|
+
case "top": return start + GRID_ICON_MARGIN;
|
|
42311
42380
|
default:
|
|
42312
|
-
const centeringOffset = Math.floor((end - start -
|
|
42313
|
-
return end -
|
|
42381
|
+
const centeringOffset = Math.floor((end - start - GRID_ICON_EDGE_LENGTH) / 2);
|
|
42382
|
+
return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
|
|
42314
42383
|
}
|
|
42315
42384
|
}
|
|
42316
42385
|
getIconHorizontalPosition(rect, cellPosition) {
|
|
@@ -42319,11 +42388,11 @@ var GridCellIcon = class extends Component {
|
|
|
42319
42388
|
const cell = this.env.model.getters.getCell(cellPosition);
|
|
42320
42389
|
const evaluatedCell = this.env.model.getters.getEvaluatedCell(cellPosition);
|
|
42321
42390
|
switch (this.props.horizontalAlign || cell?.style?.align || evaluatedCell.defaultAlign) {
|
|
42322
|
-
case "right": return end -
|
|
42323
|
-
case "left": return start +
|
|
42391
|
+
case "right": return end - GRID_ICON_MARGIN - GRID_ICON_EDGE_LENGTH;
|
|
42392
|
+
case "left": return start + GRID_ICON_MARGIN;
|
|
42324
42393
|
default:
|
|
42325
|
-
const centeringOffset = Math.floor((end - start -
|
|
42326
|
-
return end -
|
|
42394
|
+
const centeringOffset = Math.floor((end - start - GRID_ICON_EDGE_LENGTH) / 2);
|
|
42395
|
+
return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
|
|
42327
42396
|
}
|
|
42328
42397
|
}
|
|
42329
42398
|
isPositionVisible(position) {
|
|
@@ -42338,7 +42407,7 @@ css`
|
|
|
42338
42407
|
.o-dv-checkbox {
|
|
42339
42408
|
box-sizing: border-box !important;
|
|
42340
42409
|
accent-color: #808080;
|
|
42341
|
-
margin: ${(
|
|
42410
|
+
margin: ${(GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2}px;
|
|
42342
42411
|
/** required to prevent the checkbox position to be sensible to the font-size (affects Firefox) */
|
|
42343
42412
|
position: absolute;
|
|
42344
42413
|
}
|
|
@@ -42373,8 +42442,8 @@ css`
|
|
|
42373
42442
|
.o-dv-list-icon {
|
|
42374
42443
|
color: ${TEXT_BODY_MUTED};
|
|
42375
42444
|
border-radius: 1px;
|
|
42376
|
-
height: ${
|
|
42377
|
-
width: ${
|
|
42445
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42446
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42378
42447
|
|
|
42379
42448
|
&:hover {
|
|
42380
42449
|
color: #ffffff;
|
|
@@ -42689,19 +42758,19 @@ function getAxis(fig, axisType) {
|
|
|
42689
42758
|
position = fig.y;
|
|
42690
42759
|
break;
|
|
42691
42760
|
case "bottom":
|
|
42692
|
-
position = fig.y + fig.height -
|
|
42761
|
+
position = fig.y + fig.height - FIGURE_BORDER_WIDTH;
|
|
42693
42762
|
break;
|
|
42694
42763
|
case "vCenter":
|
|
42695
|
-
position = fig.y + Math.floor(fig.height / 2) -
|
|
42764
|
+
position = fig.y + Math.floor(fig.height / 2) - FIGURE_BORDER_WIDTH;
|
|
42696
42765
|
break;
|
|
42697
42766
|
case "left":
|
|
42698
42767
|
position = fig.x;
|
|
42699
42768
|
break;
|
|
42700
42769
|
case "right":
|
|
42701
|
-
position = fig.x + fig.width -
|
|
42770
|
+
position = fig.x + fig.width - FIGURE_BORDER_WIDTH;
|
|
42702
42771
|
break;
|
|
42703
42772
|
case "hCenter":
|
|
42704
|
-
position = fig.x + Math.floor(fig.width / 2) -
|
|
42773
|
+
position = fig.x + Math.floor(fig.width / 2) - FIGURE_BORDER_WIDTH;
|
|
42705
42774
|
break;
|
|
42706
42775
|
}
|
|
42707
42776
|
return {
|
|
@@ -42958,7 +43027,7 @@ var FiguresContainer = class extends Component {
|
|
|
42958
43027
|
y
|
|
42959
43028
|
};
|
|
42960
43029
|
const keepRatio = figureRegistry.get(figure.tag).keepRatio || false;
|
|
42961
|
-
const minFigSize = figureRegistry.get(figure.tag).minFigSize ||
|
|
43030
|
+
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
42962
43031
|
const onMouseMove = (ev) => {
|
|
42963
43032
|
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, {
|
|
42964
43033
|
x: ev.clientX,
|
|
@@ -43049,8 +43118,8 @@ css`
|
|
|
43049
43118
|
display: flex;
|
|
43050
43119
|
align-items: center;
|
|
43051
43120
|
justify-content: center;
|
|
43052
|
-
width: ${
|
|
43053
|
-
height: ${
|
|
43121
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
43122
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
43054
43123
|
|
|
43055
43124
|
&:hover {
|
|
43056
43125
|
background: ${FILTERS_COLOR};
|
|
@@ -43677,9 +43746,9 @@ css`
|
|
|
43677
43746
|
.o-col-resizer {
|
|
43678
43747
|
position: absolute;
|
|
43679
43748
|
top: 0;
|
|
43680
|
-
left: ${
|
|
43681
|
-
right: ${
|
|
43682
|
-
height: ${
|
|
43749
|
+
left: ${HEADER_WIDTH}px;
|
|
43750
|
+
right: ${SCROLLBAR_WIDTH}px;
|
|
43751
|
+
height: ${HEADER_HEIGHT}px;
|
|
43683
43752
|
&.o-dragging {
|
|
43684
43753
|
cursor: grabbing;
|
|
43685
43754
|
}
|
|
@@ -43687,14 +43756,14 @@ css`
|
|
|
43687
43756
|
cursor: grab;
|
|
43688
43757
|
}
|
|
43689
43758
|
.dragging-col-line {
|
|
43690
|
-
top: ${
|
|
43759
|
+
top: ${HEADER_HEIGHT}px;
|
|
43691
43760
|
position: absolute;
|
|
43692
43761
|
width: 2px;
|
|
43693
43762
|
height: 10000px;
|
|
43694
43763
|
background-color: black;
|
|
43695
43764
|
}
|
|
43696
43765
|
.dragging-col-shadow {
|
|
43697
|
-
top: ${
|
|
43766
|
+
top: ${HEADER_HEIGHT}px;
|
|
43698
43767
|
position: absolute;
|
|
43699
43768
|
height: 10000px;
|
|
43700
43769
|
background-color: black;
|
|
@@ -43702,13 +43771,13 @@ css`
|
|
|
43702
43771
|
}
|
|
43703
43772
|
.o-handle {
|
|
43704
43773
|
position: absolute;
|
|
43705
|
-
height: ${
|
|
43774
|
+
height: ${HEADER_HEIGHT}px;
|
|
43706
43775
|
width: 4px;
|
|
43707
43776
|
cursor: e-resize;
|
|
43708
43777
|
background-color: ${SELECTION_BORDER_COLOR};
|
|
43709
43778
|
}
|
|
43710
43779
|
.dragging-resizer {
|
|
43711
|
-
top: ${
|
|
43780
|
+
top: ${HEADER_HEIGHT}px;
|
|
43712
43781
|
position: absolute;
|
|
43713
43782
|
margin-left: 2px;
|
|
43714
43783
|
width: 1px;
|
|
@@ -43733,7 +43802,7 @@ var ColResizer = class extends AbstractResizer {
|
|
|
43733
43802
|
this.colResizerRef = useRef("colResizer");
|
|
43734
43803
|
this.PADDING = 15;
|
|
43735
43804
|
this.MAX_SIZE_MARGIN = 90;
|
|
43736
|
-
this.MIN_ELEMENT_SIZE =
|
|
43805
|
+
this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
|
|
43737
43806
|
}
|
|
43738
43807
|
get sheetId() {
|
|
43739
43808
|
return this.env.model.getters.getActiveSheetId();
|
|
@@ -43832,10 +43901,10 @@ var ColResizer = class extends AbstractResizer {
|
|
|
43832
43901
|
css`
|
|
43833
43902
|
.o-row-resizer {
|
|
43834
43903
|
position: absolute;
|
|
43835
|
-
top: ${
|
|
43904
|
+
top: ${HEADER_HEIGHT}px;
|
|
43836
43905
|
left: 0;
|
|
43837
|
-
bottom: ${
|
|
43838
|
-
width: ${
|
|
43906
|
+
bottom: ${SCROLLBAR_WIDTH}px;
|
|
43907
|
+
width: ${HEADER_WIDTH}px;
|
|
43839
43908
|
&.o-dragging {
|
|
43840
43909
|
cursor: grabbing;
|
|
43841
43910
|
}
|
|
@@ -43843,14 +43912,14 @@ css`
|
|
|
43843
43912
|
cursor: grab;
|
|
43844
43913
|
}
|
|
43845
43914
|
.dragging-row-line {
|
|
43846
|
-
left: ${
|
|
43915
|
+
left: ${HEADER_WIDTH}px;
|
|
43847
43916
|
position: absolute;
|
|
43848
43917
|
width: 10000px;
|
|
43849
43918
|
height: 2px;
|
|
43850
43919
|
background-color: black;
|
|
43851
43920
|
}
|
|
43852
43921
|
.dragging-row-shadow {
|
|
43853
|
-
left: ${
|
|
43922
|
+
left: ${HEADER_WIDTH}px;
|
|
43854
43923
|
position: absolute;
|
|
43855
43924
|
width: 10000px;
|
|
43856
43925
|
background-color: black;
|
|
@@ -43859,12 +43928,12 @@ css`
|
|
|
43859
43928
|
.o-handle {
|
|
43860
43929
|
position: absolute;
|
|
43861
43930
|
height: 4px;
|
|
43862
|
-
width: ${
|
|
43931
|
+
width: ${HEADER_WIDTH}px;
|
|
43863
43932
|
cursor: n-resize;
|
|
43864
43933
|
background-color: ${SELECTION_BORDER_COLOR};
|
|
43865
43934
|
}
|
|
43866
43935
|
.dragging-resizer {
|
|
43867
|
-
left: ${
|
|
43936
|
+
left: ${HEADER_WIDTH}px;
|
|
43868
43937
|
position: absolute;
|
|
43869
43938
|
margin-top: 2px;
|
|
43870
43939
|
width: 10000px;
|
|
@@ -43888,7 +43957,7 @@ var RowResizer = class extends AbstractResizer {
|
|
|
43888
43957
|
this.rowResizerRef = useRef("rowResizer");
|
|
43889
43958
|
this.PADDING = 5;
|
|
43890
43959
|
this.MAX_SIZE_MARGIN = 60;
|
|
43891
|
-
this.MIN_ELEMENT_SIZE =
|
|
43960
|
+
this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
|
|
43892
43961
|
}
|
|
43893
43962
|
rowResizerRef;
|
|
43894
43963
|
get sheetId() {
|
|
@@ -43995,8 +44064,8 @@ css`
|
|
|
43995
44064
|
top: 0;
|
|
43996
44065
|
left: 0;
|
|
43997
44066
|
right: 0;
|
|
43998
|
-
width: ${
|
|
43999
|
-
height: ${
|
|
44067
|
+
width: ${HEADER_WIDTH}px;
|
|
44068
|
+
height: ${HEADER_HEIGHT}px;
|
|
44000
44069
|
}
|
|
44001
44070
|
}
|
|
44002
44071
|
`;
|
|
@@ -44031,7 +44100,7 @@ var GridRenderer = class {
|
|
|
44031
44100
|
*/
|
|
44032
44101
|
getHeaderOffset(dimension, start, index) {
|
|
44033
44102
|
let size = this.getters.getColRowOffsetInViewport(dimension, start, index);
|
|
44034
|
-
if (!this.getters.isDashboard()) size += dimension === "ROW" ?
|
|
44103
|
+
if (!this.getters.isDashboard()) size += dimension === "ROW" ? HEADER_HEIGHT : HEADER_WIDTH;
|
|
44035
44104
|
return size;
|
|
44036
44105
|
}
|
|
44037
44106
|
drawLayer(renderingContext, layer) {
|
|
@@ -44213,8 +44282,8 @@ var GridRenderer = class {
|
|
|
44213
44282
|
}
|
|
44214
44283
|
ctx.fillStyle = style.textColor || "#000";
|
|
44215
44284
|
let x = box.x;
|
|
44216
|
-
if (align === "left") x +=
|
|
44217
|
-
else if (align === "right") x += box.width -
|
|
44285
|
+
if (align === "left") x += MIN_CELL_TEXT_MARGIN + (box.image ? box.image.size + MIN_CF_ICON_MARGIN : 0);
|
|
44286
|
+
else if (align === "right") x += box.width - MIN_CELL_TEXT_MARGIN - (box.hasIcon ? GRID_ICON_EDGE_LENGTH + GRID_ICON_MARGIN : 0);
|
|
44218
44287
|
else x += box.width / 2;
|
|
44219
44288
|
ctx.textAlign = align;
|
|
44220
44289
|
if (box.clipRect) {
|
|
@@ -44232,7 +44301,7 @@ var GridRenderer = class {
|
|
|
44232
44301
|
x: Math.round(x),
|
|
44233
44302
|
y: Math.round(y)
|
|
44234
44303
|
}, style.underline, style.strikethrough);
|
|
44235
|
-
y +=
|
|
44304
|
+
y += MIN_CELL_TEXT_MARGIN + textLineHeight;
|
|
44236
44305
|
}
|
|
44237
44306
|
if (box.clipRect) ctx.restore();
|
|
44238
44307
|
}
|
|
@@ -44250,7 +44319,7 @@ var GridRenderer = class {
|
|
|
44250
44319
|
}
|
|
44251
44320
|
const iconSize = box.image.size;
|
|
44252
44321
|
const y = this.computeTextYCoordinate(box, iconSize);
|
|
44253
|
-
ctx.drawImage(icon, box.x +
|
|
44322
|
+
ctx.drawImage(icon, box.x + MIN_CF_ICON_MARGIN, y, iconSize, iconSize);
|
|
44254
44323
|
if (box.image.clipIcon) ctx.restore();
|
|
44255
44324
|
}
|
|
44256
44325
|
}
|
|
@@ -44262,13 +44331,13 @@ var GridRenderer = class {
|
|
|
44262
44331
|
computeTextYCoordinate(box, textLineHeight, numberOfLines = 1) {
|
|
44263
44332
|
const y = box.y + 1;
|
|
44264
44333
|
const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
|
|
44265
|
-
const hasEnoughSpaces = box.height > textHeight +
|
|
44334
|
+
const hasEnoughSpaces = box.height > textHeight + MIN_CELL_TEXT_MARGIN * 2;
|
|
44266
44335
|
const verticalAlign = box.verticalAlign || DEFAULT_VERTICAL_ALIGN;
|
|
44267
44336
|
if (hasEnoughSpaces) {
|
|
44268
44337
|
if (verticalAlign === "middle") return y + (box.height - textHeight) / 2;
|
|
44269
|
-
if (verticalAlign === "bottom") return y + box.height - textHeight -
|
|
44338
|
+
if (verticalAlign === "bottom") return y + box.height - textHeight - MIN_CELL_TEXT_MARGIN;
|
|
44270
44339
|
}
|
|
44271
|
-
return y +
|
|
44340
|
+
return y + MIN_CELL_TEXT_MARGIN;
|
|
44272
44341
|
}
|
|
44273
44342
|
drawHeaders(renderingContext) {
|
|
44274
44343
|
const { ctx, thinLineWidth } = renderingContext;
|
|
@@ -44285,7 +44354,7 @@ var GridRenderer = class {
|
|
|
44285
44354
|
const numberOfRows = this.getters.getNumberRows(sheetId);
|
|
44286
44355
|
const activeCols = this.getters.getActiveCols();
|
|
44287
44356
|
const activeRows = this.getters.getActiveRows();
|
|
44288
|
-
ctx.font = `400 ${
|
|
44357
|
+
ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
44289
44358
|
ctx.textAlign = "center";
|
|
44290
44359
|
ctx.textBaseline = "middle";
|
|
44291
44360
|
ctx.lineWidth = thinLineWidth;
|
|
@@ -44303,7 +44372,7 @@ var GridRenderer = class {
|
|
|
44303
44372
|
if (isColActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
44304
44373
|
else if (isColSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
44305
44374
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
44306
|
-
ctx.fillRect(x, 0, width,
|
|
44375
|
+
ctx.fillRect(x, 0, width, HEADER_HEIGHT);
|
|
44307
44376
|
}
|
|
44308
44377
|
for (const row of visibleRows) {
|
|
44309
44378
|
const rowZone = {
|
|
@@ -44318,13 +44387,13 @@ var GridRenderer = class {
|
|
|
44318
44387
|
if (isRowActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
44319
44388
|
else if (isRowSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
44320
44389
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
44321
|
-
ctx.fillRect(0, y,
|
|
44390
|
+
ctx.fillRect(0, y, HEADER_WIDTH, height);
|
|
44322
44391
|
}
|
|
44323
44392
|
ctx.beginPath();
|
|
44324
|
-
ctx.moveTo(
|
|
44325
|
-
ctx.lineTo(
|
|
44326
|
-
ctx.moveTo(0,
|
|
44327
|
-
ctx.lineTo(width,
|
|
44393
|
+
ctx.moveTo(HEADER_WIDTH, 0);
|
|
44394
|
+
ctx.lineTo(HEADER_WIDTH, height);
|
|
44395
|
+
ctx.moveTo(0, HEADER_HEIGHT);
|
|
44396
|
+
ctx.lineTo(width, HEADER_HEIGHT);
|
|
44328
44397
|
ctx.strokeStyle = HEADER_BORDER_COLOR;
|
|
44329
44398
|
ctx.stroke();
|
|
44330
44399
|
ctx.beginPath();
|
|
@@ -44333,25 +44402,25 @@ var GridRenderer = class {
|
|
|
44333
44402
|
const colName = numberToLetters(col);
|
|
44334
44403
|
ctx.fillStyle = activeCols.has(col) ? "#fff" : TEXT_HEADER_COLOR;
|
|
44335
44404
|
const colStart = this.getHeaderOffset("COL", left, col);
|
|
44336
|
-
ctx.fillText(colName, colStart + colSize / 2,
|
|
44405
|
+
ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
|
|
44337
44406
|
ctx.moveTo(colStart + colSize, 0);
|
|
44338
|
-
ctx.lineTo(colStart + colSize,
|
|
44407
|
+
ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
|
|
44339
44408
|
}
|
|
44340
44409
|
for (const row of visibleRows) {
|
|
44341
44410
|
const rowSize = this.getters.getRowSize(sheetId, row);
|
|
44342
44411
|
ctx.fillStyle = activeRows.has(row) ? "#fff" : TEXT_HEADER_COLOR;
|
|
44343
44412
|
const rowStart = this.getHeaderOffset("ROW", top, row);
|
|
44344
|
-
ctx.fillText(String(row + 1),
|
|
44413
|
+
ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
|
|
44345
44414
|
ctx.moveTo(0, rowStart + rowSize);
|
|
44346
|
-
ctx.lineTo(
|
|
44415
|
+
ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
|
|
44347
44416
|
}
|
|
44348
44417
|
ctx.stroke();
|
|
44349
44418
|
}
|
|
44350
44419
|
drawFrozenPanesHeaders(renderingContext) {
|
|
44351
44420
|
const { ctx, thinLineWidth } = renderingContext;
|
|
44352
44421
|
const { x: offsetCorrectionX, y: offsetCorrectionY } = this.getters.getMainViewportCoordinates();
|
|
44353
|
-
const widthCorrection = this.getters.isDashboard() ? 0 :
|
|
44354
|
-
const heightCorrection = this.getters.isDashboard() ? 0 :
|
|
44422
|
+
const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
|
|
44423
|
+
const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
|
|
44355
44424
|
ctx.lineWidth = 6 * thinLineWidth;
|
|
44356
44425
|
ctx.strokeStyle = FROZEN_PANE_HEADER_BORDER_COLOR;
|
|
44357
44426
|
ctx.beginPath();
|
|
@@ -44379,8 +44448,8 @@ var GridRenderer = class {
|
|
|
44379
44448
|
bottom: visibleRows[visibleRows.length - 1]
|
|
44380
44449
|
};
|
|
44381
44450
|
const rect = this.getters.getVisibleRect(viewport);
|
|
44382
|
-
const widthCorrection = this.getters.isDashboard() ? 0 :
|
|
44383
|
-
const heightCorrection = this.getters.isDashboard() ? 0 :
|
|
44451
|
+
const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
|
|
44452
|
+
const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
|
|
44384
44453
|
ctx.lineWidth = 6 * thinLineWidth;
|
|
44385
44454
|
ctx.strokeStyle = FROZEN_PANE_BORDER_COLOR;
|
|
44386
44455
|
ctx.beginPath();
|
|
@@ -44464,7 +44533,7 @@ var GridRenderer = class {
|
|
|
44464
44533
|
/** Icon */
|
|
44465
44534
|
const iconSrc = this.getters.getCellIconSrc(position);
|
|
44466
44535
|
const fontSizePX = computeTextFontSizeInPixels(box.style);
|
|
44467
|
-
const iconBoxWidth = iconSrc ?
|
|
44536
|
+
const iconBoxWidth = iconSrc ? MIN_CF_ICON_MARGIN + fontSizePX : 0;
|
|
44468
44537
|
if (iconSrc) {
|
|
44469
44538
|
const imageHtmlElement = loadIconImage(iconSrc);
|
|
44470
44539
|
box.image = {
|
|
@@ -44482,19 +44551,19 @@ var GridRenderer = class {
|
|
|
44482
44551
|
if (cell.type === "empty" || this.getters.isCellValidCheckbox(position)) return box;
|
|
44483
44552
|
/** Filter Header or data validation icon */
|
|
44484
44553
|
box.hasIcon = this.getters.doesCellHaveGridIcon(position);
|
|
44485
|
-
const headerIconWidth = box.hasIcon ?
|
|
44554
|
+
const headerIconWidth = box.hasIcon ? GRID_ICON_EDGE_LENGTH + GRID_ICON_MARGIN : 0;
|
|
44486
44555
|
/** Content */
|
|
44487
44556
|
const style = this.getters.getCellComputedStyle(position);
|
|
44488
44557
|
const wrapping = style.wrapping || "overflow";
|
|
44489
44558
|
const wrapText = wrapping === "wrap" && !showFormula;
|
|
44490
|
-
const maxWidth = width - 2 *
|
|
44559
|
+
const maxWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
|
|
44491
44560
|
const formatWidth = style.align ? 0 : maxWidth;
|
|
44492
44561
|
const multiLineText = this.getters.getCellMultiLineText(position, {
|
|
44493
44562
|
maxWidth,
|
|
44494
44563
|
formatWidth,
|
|
44495
44564
|
wrapText
|
|
44496
44565
|
});
|
|
44497
|
-
const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, style) +
|
|
44566
|
+
const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, style) + MIN_CELL_TEXT_MARGIN));
|
|
44498
44567
|
const contentWidth = iconBoxWidth + textWidth + headerIconWidth;
|
|
44499
44568
|
const align = this.computeCellAlignment(position, contentWidth > width);
|
|
44500
44569
|
box.content = {
|
|
@@ -44706,7 +44775,7 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
44706
44775
|
resetTimeout = setTimeout(() => {
|
|
44707
44776
|
velocityX = 0;
|
|
44708
44777
|
velocityY = 0;
|
|
44709
|
-
},
|
|
44778
|
+
}, resetTimeoutDuration);
|
|
44710
44779
|
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
44711
44780
|
}
|
|
44712
44781
|
function onTouchEnd(ev) {
|
|
@@ -44737,7 +44806,7 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
44737
44806
|
//#region src/components/helpers/wheel_hook.ts
|
|
44738
44807
|
function useWheelHandler(handler) {
|
|
44739
44808
|
function normalize(val, deltaMode) {
|
|
44740
|
-
return val * (deltaMode === 0 ? 1 :
|
|
44809
|
+
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
44741
44810
|
}
|
|
44742
44811
|
const onMouseWheel = (ev) => {
|
|
44743
44812
|
handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
|
|
@@ -44853,8 +44922,8 @@ var Corner = class extends Component {
|
|
|
44853
44922
|
const leftValue = this.isLeft ? rect.x : rect.x + rect.width;
|
|
44854
44923
|
const topValue = this.isTop ? rect.y : rect.y + rect.height;
|
|
44855
44924
|
return cssPropertiesToCss({
|
|
44856
|
-
left: `${leftValue -
|
|
44857
|
-
top: `${topValue -
|
|
44925
|
+
left: `${leftValue - AUTOFILL_EDGE_LENGTH / 2}px`,
|
|
44926
|
+
top: `${topValue - AUTOFILL_EDGE_LENGTH / 2}px`,
|
|
44858
44927
|
"background-color": this.props.color
|
|
44859
44928
|
});
|
|
44860
44929
|
}
|
|
@@ -44994,8 +45063,8 @@ css`
|
|
|
44994
45063
|
&.corner {
|
|
44995
45064
|
right: 0px;
|
|
44996
45065
|
bottom: 0px;
|
|
44997
|
-
height: ${
|
|
44998
|
-
width: ${
|
|
45066
|
+
height: ${SCROLLBAR_WIDTH}px;
|
|
45067
|
+
width: ${SCROLLBAR_WIDTH}px;
|
|
44999
45068
|
border-top: 1px solid #e2e3e3;
|
|
45000
45069
|
border-left: 1px solid #e2e3e3;
|
|
45001
45070
|
}
|
|
@@ -45088,7 +45157,7 @@ var HorizontalScrollBar = class extends Component {
|
|
|
45088
45157
|
return {
|
|
45089
45158
|
left: `${this.props.leftOffset + x}px`,
|
|
45090
45159
|
bottom: "0px",
|
|
45091
|
-
height: `${
|
|
45160
|
+
height: `${SCROLLBAR_WIDTH}px`,
|
|
45092
45161
|
right: `0px`
|
|
45093
45162
|
};
|
|
45094
45163
|
}
|
|
@@ -45134,7 +45203,7 @@ var VerticalScrollBar = class extends Component {
|
|
|
45134
45203
|
return {
|
|
45135
45204
|
top: `${this.props.topOffset + y}px`,
|
|
45136
45205
|
right: "0px",
|
|
45137
|
-
width: `${
|
|
45206
|
+
width: `${SCROLLBAR_WIDTH}px`,
|
|
45138
45207
|
bottom: `0px`
|
|
45139
45208
|
};
|
|
45140
45209
|
}
|
|
@@ -45161,7 +45230,7 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
45161
45230
|
];
|
|
45162
45231
|
currentPanelProps = {};
|
|
45163
45232
|
componentTag = "";
|
|
45164
|
-
panelSize =
|
|
45233
|
+
panelSize = DEFAULT_SIDE_PANEL_SIZE;
|
|
45165
45234
|
get isOpen() {
|
|
45166
45235
|
if (!this.componentTag) return false;
|
|
45167
45236
|
return this.computeState(this.componentTag, this.currentPanelProps).isOpen;
|
|
@@ -45192,12 +45261,12 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
45192
45261
|
this.componentTag = "";
|
|
45193
45262
|
}
|
|
45194
45263
|
changePanelSize(size, spreadsheetElWidth) {
|
|
45195
|
-
if (size <
|
|
45196
|
-
else if (size > spreadsheetElWidth -
|
|
45264
|
+
if (size < DEFAULT_SIDE_PANEL_SIZE) this.panelSize = DEFAULT_SIDE_PANEL_SIZE;
|
|
45265
|
+
else if (size > spreadsheetElWidth - MIN_SHEET_VIEW_WIDTH) this.panelSize = Math.max(spreadsheetElWidth - MIN_SHEET_VIEW_WIDTH, DEFAULT_SIDE_PANEL_SIZE);
|
|
45197
45266
|
else this.panelSize = size;
|
|
45198
45267
|
}
|
|
45199
45268
|
resetPanelSize() {
|
|
45200
|
-
this.panelSize =
|
|
45269
|
+
this.panelSize = DEFAULT_SIDE_PANEL_SIZE;
|
|
45201
45270
|
}
|
|
45202
45271
|
computeState(componentTag, panelProps) {
|
|
45203
45272
|
const customComputeState = sidePanelRegistry.get(componentTag).computeState;
|
|
@@ -45313,8 +45382,8 @@ var Grid = class extends Component {
|
|
|
45313
45382
|
HorizontalScrollBar,
|
|
45314
45383
|
TableResizer
|
|
45315
45384
|
};
|
|
45316
|
-
HEADER_HEIGHT =
|
|
45317
|
-
HEADER_WIDTH =
|
|
45385
|
+
HEADER_HEIGHT = HEADER_HEIGHT;
|
|
45386
|
+
HEADER_WIDTH = HEADER_WIDTH;
|
|
45318
45387
|
menuState;
|
|
45319
45388
|
gridRef;
|
|
45320
45389
|
highlightStore;
|
|
@@ -45372,10 +45441,10 @@ var Grid = class extends Component {
|
|
|
45372
45441
|
}
|
|
45373
45442
|
get gridOverlayDimensions() {
|
|
45374
45443
|
return cssPropertiesToCss({
|
|
45375
|
-
top: `${
|
|
45376
|
-
left: `${
|
|
45377
|
-
height: `calc(100% - ${
|
|
45378
|
-
width: `calc(100% - ${
|
|
45444
|
+
top: `${HEADER_HEIGHT}px`,
|
|
45445
|
+
left: `${HEADER_WIDTH}px`,
|
|
45446
|
+
height: `calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px)`,
|
|
45447
|
+
width: `calc(100% - ${HEADER_WIDTH + SCROLLBAR_WIDTH}px)`
|
|
45379
45448
|
});
|
|
45380
45449
|
}
|
|
45381
45450
|
onClosePopover() {
|
|
@@ -45548,8 +45617,8 @@ var Grid = class extends Component {
|
|
|
45548
45617
|
const zone = this.env.model.getters.getSelectedZone();
|
|
45549
45618
|
const rect = this.env.model.getters.getVisibleRect(zone);
|
|
45550
45619
|
return {
|
|
45551
|
-
left: rect.x + rect.width -
|
|
45552
|
-
top: rect.y + rect.height -
|
|
45620
|
+
left: rect.x + rect.width - AUTOFILL_EDGE_LENGTH / 2,
|
|
45621
|
+
top: rect.y + rect.height - AUTOFILL_EDGE_LENGTH / 2
|
|
45553
45622
|
};
|
|
45554
45623
|
}
|
|
45555
45624
|
get isAutofillVisible() {
|
|
@@ -45566,8 +45635,8 @@ var Grid = class extends Component {
|
|
|
45566
45635
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
45567
45636
|
width,
|
|
45568
45637
|
height,
|
|
45569
|
-
gridOffsetX:
|
|
45570
|
-
gridOffsetY:
|
|
45638
|
+
gridOffsetX: HEADER_WIDTH,
|
|
45639
|
+
gridOffsetY: HEADER_HEIGHT
|
|
45571
45640
|
});
|
|
45572
45641
|
}
|
|
45573
45642
|
moveCanvas(deltaX, deltaY) {
|
|
@@ -47303,8 +47372,8 @@ var ChartPlugin = class extends CorePlugin {
|
|
|
47303
47372
|
case "DUPLICATE_SHEET": {
|
|
47304
47373
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
47305
47374
|
for (const fig of sheetFiguresFrom) if (fig.tag === "chart") {
|
|
47306
|
-
const figureIdBase = fig.id.split(
|
|
47307
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
47375
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
47376
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
47308
47377
|
const chart = this.charts[fig.id]?.copyForSheetId(cmd.sheetIdTo);
|
|
47309
47378
|
if (chart) this.dispatch("CREATE_CHART", {
|
|
47310
47379
|
id: duplicatedFigureId,
|
|
@@ -47381,8 +47450,8 @@ var ChartPlugin = class extends CorePlugin {
|
|
|
47381
47450
|
x: 0,
|
|
47382
47451
|
y: 0
|
|
47383
47452
|
}, size = {
|
|
47384
|
-
width:
|
|
47385
|
-
height:
|
|
47453
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
47454
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
47386
47455
|
}) {
|
|
47387
47456
|
if (this.getters.getFigure(sheetId, id)) return;
|
|
47388
47457
|
const figure = {
|
|
@@ -48024,7 +48093,7 @@ var FigurePlugin = class extends CorePlugin {
|
|
|
48024
48093
|
onRowDeletion(sheetId) {
|
|
48025
48094
|
const numHeader = this.getters.getNumberRows(sheetId);
|
|
48026
48095
|
let gridHeight = 0;
|
|
48027
|
-
for (let i = 0; i < numHeader; i++) gridHeight += this.getters.getUserRowSize(sheetId, i) ||
|
|
48096
|
+
for (let i = 0; i < numHeader; i++) gridHeight += this.getters.getUserRowSize(sheetId, i) || DEFAULT_CELL_HEIGHT;
|
|
48028
48097
|
const figures = this.getters.getFigures(sheetId);
|
|
48029
48098
|
for (const figure of figures) {
|
|
48030
48099
|
const newY = Math.min(figure.y, gridHeight - figure.height);
|
|
@@ -48155,7 +48224,7 @@ var HeaderSizePlugin = class extends CorePlugin {
|
|
|
48155
48224
|
}
|
|
48156
48225
|
}
|
|
48157
48226
|
getColSize(sheetId, index) {
|
|
48158
|
-
return Math.round(this.sizes[sheetId]?.["COL"][index] ||
|
|
48227
|
+
return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
|
|
48159
48228
|
}
|
|
48160
48229
|
getUserRowSize(sheetId, index) {
|
|
48161
48230
|
const rowSize = this.sizes[sheetId]?.["ROW"][index];
|
|
@@ -48188,7 +48257,7 @@ var HeaderSizePlugin = class extends CorePlugin {
|
|
|
48188
48257
|
if (sheet.rows === void 0) sheet.rows = {};
|
|
48189
48258
|
for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
|
|
48190
48259
|
...sheet.rows[row],
|
|
48191
|
-
size: this.getUserRowSize(sheet.id, row) ??
|
|
48260
|
+
size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
|
|
48192
48261
|
};
|
|
48193
48262
|
if (sheet.cols === void 0) sheet.cols = {};
|
|
48194
48263
|
for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
|
|
@@ -48369,8 +48438,8 @@ var ImagePlugin = class extends CorePlugin {
|
|
|
48369
48438
|
case "DUPLICATE_SHEET": {
|
|
48370
48439
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
48371
48440
|
for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
|
|
48372
|
-
const figureIdBase = fig.id.split(
|
|
48373
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
48441
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
48442
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
48374
48443
|
const image = this.getImage(fig.id);
|
|
48375
48444
|
if (image) {
|
|
48376
48445
|
const size = {
|
|
@@ -52677,7 +52746,7 @@ var EvaluationChartPlugin = class extends UIPlugin {
|
|
|
52677
52746
|
col,
|
|
52678
52747
|
row
|
|
52679
52748
|
});
|
|
52680
|
-
const background = style.fillColor ||
|
|
52749
|
+
const background = style.fillColor || BACKGROUND_CHART_COLOR;
|
|
52681
52750
|
return {
|
|
52682
52751
|
background,
|
|
52683
52752
|
fontColor: style.textColor || chartFontColor(background)
|
|
@@ -53374,7 +53443,7 @@ var HeaderSizeUIPlugin = class extends UIPlugin {
|
|
|
53374
53443
|
}
|
|
53375
53444
|
}
|
|
53376
53445
|
getRowSize(sheetId, row) {
|
|
53377
|
-
return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ??
|
|
53446
|
+
return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? DEFAULT_CELL_HEIGHT);
|
|
53378
53447
|
}
|
|
53379
53448
|
getHeaderSize(sheetId, dimension, index) {
|
|
53380
53449
|
if (this.getters.isHeaderHidden(sheetId, dimension, index)) return 0;
|
|
@@ -53391,8 +53460,8 @@ var HeaderSizeUIPlugin = class extends UIPlugin {
|
|
|
53391
53460
|
col,
|
|
53392
53461
|
row
|
|
53393
53462
|
});
|
|
53394
|
-
if (updatedCellHeight <=
|
|
53395
|
-
if (!tallestCellInRow && updatedCellHeight >
|
|
53463
|
+
if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
|
|
53464
|
+
if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
|
|
53396
53465
|
const newTallestCell = {
|
|
53397
53466
|
cell: {
|
|
53398
53467
|
sheetId,
|
|
@@ -53417,7 +53486,7 @@ var HeaderSizeUIPlugin = class extends UIPlugin {
|
|
|
53417
53486
|
* merge, or the height of the cell computed based on its style/content.
|
|
53418
53487
|
*/
|
|
53419
53488
|
getCellHeight(position) {
|
|
53420
|
-
if (this.isInMultiRowMerge(position)) return
|
|
53489
|
+
if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
|
|
53421
53490
|
const cell = this.getters.getCell(position);
|
|
53422
53491
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
53423
53492
|
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
@@ -53439,7 +53508,7 @@ var HeaderSizeUIPlugin = class extends UIPlugin {
|
|
|
53439
53508
|
if (!cell) continue;
|
|
53440
53509
|
const position = this.getters.getCellPosition(cell.id);
|
|
53441
53510
|
const cellHeight = this.getCellHeight(position);
|
|
53442
|
-
if (cellHeight > maxHeight && cellHeight >
|
|
53511
|
+
if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
|
|
53443
53512
|
maxHeight = cellHeight;
|
|
53444
53513
|
tallestCell = {
|
|
53445
53514
|
cell: position,
|
|
@@ -53447,7 +53516,7 @@ var HeaderSizeUIPlugin = class extends UIPlugin {
|
|
|
53447
53516
|
};
|
|
53448
53517
|
}
|
|
53449
53518
|
}
|
|
53450
|
-
if (tallestCell && tallestCell.size >
|
|
53519
|
+
if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
|
|
53451
53520
|
}
|
|
53452
53521
|
};
|
|
53453
53522
|
|
|
@@ -53835,7 +53904,7 @@ function pivot_presentation_default(PivotClass) {
|
|
|
53835
53904
|
* @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
|
|
53836
53905
|
*/
|
|
53837
53906
|
getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
|
|
53838
|
-
const comparedDomain = valueToCompare ===
|
|
53907
|
+
const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
|
|
53839
53908
|
if (deepEquals(comparedDomain, domain)) return "sameValue";
|
|
53840
53909
|
if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
|
|
53841
53910
|
const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
|
|
@@ -55310,7 +55379,7 @@ var Session = class extends EventBus {
|
|
|
55310
55379
|
this.revisions = revisions;
|
|
55311
55380
|
this.transportService = transportService;
|
|
55312
55381
|
this.serverRevisionId = serverRevisionId;
|
|
55313
|
-
this.debouncedMove = debounce(this._move.bind(this),
|
|
55382
|
+
this.debouncedMove = debounce(this._move.bind(this), DEBOUNCE_TIME);
|
|
55314
55383
|
}
|
|
55315
55384
|
canApplyOptimisticUpdate() {
|
|
55316
55385
|
return !this.waitingUndoRedoAck;
|
|
@@ -55327,7 +55396,7 @@ var Session = class extends EventBus {
|
|
|
55327
55396
|
this.trigger("new-local-state-update", { id: revision.id });
|
|
55328
55397
|
this.sendUpdateMessage({
|
|
55329
55398
|
type: "REMOTE_REVISION",
|
|
55330
|
-
version:
|
|
55399
|
+
version: MESSAGE_VERSION,
|
|
55331
55400
|
serverRevisionId: this.serverRevisionId,
|
|
55332
55401
|
nextRevisionId: revision.id,
|
|
55333
55402
|
clientId: revision.clientId,
|
|
@@ -55338,7 +55407,7 @@ var Session = class extends EventBus {
|
|
|
55338
55407
|
this.waitingUndoRedoAck = true;
|
|
55339
55408
|
this.sendUpdateMessage({
|
|
55340
55409
|
type: "REVISION_UNDONE",
|
|
55341
|
-
version:
|
|
55410
|
+
version: MESSAGE_VERSION,
|
|
55342
55411
|
serverRevisionId: this.serverRevisionId,
|
|
55343
55412
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
55344
55413
|
undoneRevisionId: revisionId
|
|
@@ -55348,7 +55417,7 @@ var Session = class extends EventBus {
|
|
|
55348
55417
|
this.waitingUndoRedoAck = true;
|
|
55349
55418
|
this.sendUpdateMessage({
|
|
55350
55419
|
type: "REVISION_REDONE",
|
|
55351
|
-
version:
|
|
55420
|
+
version: MESSAGE_VERSION,
|
|
55352
55421
|
serverRevisionId: this.serverRevisionId,
|
|
55353
55422
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
55354
55423
|
redoneRevisionId: revisionId
|
|
@@ -55391,7 +55460,7 @@ var Session = class extends EventBus {
|
|
|
55391
55460
|
this.transportService.sendMessage({
|
|
55392
55461
|
type: "CLIENT_LEFT",
|
|
55393
55462
|
clientId: this.clientId,
|
|
55394
|
-
version:
|
|
55463
|
+
version: MESSAGE_VERSION
|
|
55395
55464
|
});
|
|
55396
55465
|
}
|
|
55397
55466
|
/**
|
|
@@ -55408,7 +55477,7 @@ var Session = class extends EventBus {
|
|
|
55408
55477
|
...data,
|
|
55409
55478
|
revisionId: snapshotId
|
|
55410
55479
|
},
|
|
55411
|
-
version:
|
|
55480
|
+
version: MESSAGE_VERSION
|
|
55412
55481
|
});
|
|
55413
55482
|
}
|
|
55414
55483
|
getClient() {
|
|
@@ -55443,7 +55512,7 @@ var Session = class extends EventBus {
|
|
|
55443
55512
|
};
|
|
55444
55513
|
this.transportService.sendMessage({
|
|
55445
55514
|
type,
|
|
55446
|
-
version:
|
|
55515
|
+
version: MESSAGE_VERSION,
|
|
55447
55516
|
client: {
|
|
55448
55517
|
...client,
|
|
55449
55518
|
position
|
|
@@ -55520,7 +55589,7 @@ var Session = class extends EventBus {
|
|
|
55520
55589
|
const { position } = client;
|
|
55521
55590
|
if (position) this.transportService.sendMessage({
|
|
55522
55591
|
type: "CLIENT_MOVED",
|
|
55523
|
-
version:
|
|
55592
|
+
version: MESSAGE_VERSION,
|
|
55524
55593
|
client: {
|
|
55525
55594
|
...client,
|
|
55526
55595
|
position
|
|
@@ -56440,9 +56509,9 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
56440
56509
|
contentWidth += Math.max(...multiLineText.map((line) => computeTextWidth(this.ctx, line, style)));
|
|
56441
56510
|
}
|
|
56442
56511
|
if (this.getters.getCellIconSrc(position)) contentWidth += computeIconWidth(style);
|
|
56443
|
-
if (this.getters.doesCellHaveGridIcon(position)) contentWidth +=
|
|
56512
|
+
if (this.getters.doesCellHaveGridIcon(position)) contentWidth += ICON_EDGE_LENGTH + GRID_ICON_MARGIN;
|
|
56444
56513
|
if (contentWidth === 0) return 0;
|
|
56445
|
-
contentWidth += 2 *
|
|
56514
|
+
contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
|
|
56446
56515
|
if (style.wrapping === "wrap") {
|
|
56447
56516
|
const colWidth = this.getters.getColSize(position.sheetId, position.col);
|
|
56448
56517
|
return Math.min(colWidth, contentWidth);
|
|
@@ -56598,11 +56667,11 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
56598
56667
|
if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
|
|
56599
56668
|
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
56600
56669
|
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
56601
|
-
if (evaluatedSize > evaluatedRowSize && evaluatedSize >
|
|
56670
|
+
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = evaluatedSize;
|
|
56602
56671
|
} else {
|
|
56603
56672
|
const content = cell.content;
|
|
56604
56673
|
const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
56605
|
-
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize >
|
|
56674
|
+
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = 0;
|
|
56606
56675
|
}
|
|
56607
56676
|
}
|
|
56608
56677
|
rowSizes.push(evaluatedRowSize || null);
|
|
@@ -57142,7 +57211,7 @@ var HistoryPlugin = class extends UIPlugin {
|
|
|
57142
57211
|
onNewLocalStateUpdate({ id }) {
|
|
57143
57212
|
this.undoStack.push(id);
|
|
57144
57213
|
this.redoStack = [];
|
|
57145
|
-
if (this.undoStack.length >
|
|
57214
|
+
if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
|
|
57146
57215
|
}
|
|
57147
57216
|
/**
|
|
57148
57217
|
* Fetch the last revision which is not empty and not a repeated command
|
|
@@ -57237,7 +57306,7 @@ var SplitToColumnsPlugin = class extends UIPlugin {
|
|
|
57237
57306
|
}
|
|
57238
57307
|
getAutoSeparatorForString(str) {
|
|
57239
57308
|
const separators = [
|
|
57240
|
-
|
|
57309
|
+
NEWLINE,
|
|
57241
57310
|
";",
|
|
57242
57311
|
",",
|
|
57243
57312
|
" ",
|
|
@@ -57562,7 +57631,7 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
57562
57631
|
case "PASTE_FROM_OS_CLIPBOARD": {
|
|
57563
57632
|
this._isCutOperation = false;
|
|
57564
57633
|
let contentToPaste = cmd.clipboardContent;
|
|
57565
|
-
if (contentToPaste.data?.version !==
|
|
57634
|
+
if (contentToPaste.data?.version !== CURRENT_VERSION) {
|
|
57566
57635
|
contentToPaste = { ...contentToPaste };
|
|
57567
57636
|
delete contentToPaste.data;
|
|
57568
57637
|
}
|
|
@@ -57797,7 +57866,7 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
57797
57866
|
}
|
|
57798
57867
|
getSheetData() {
|
|
57799
57868
|
const data = {
|
|
57800
|
-
version:
|
|
57869
|
+
version: CURRENT_VERSION,
|
|
57801
57870
|
clipboardId: this.clipboardId
|
|
57802
57871
|
};
|
|
57803
57872
|
if (this.copiedData && "figureId" in this.copiedData) return data;
|
|
@@ -58520,7 +58589,7 @@ var GridSelectionPlugin = class extends UIPlugin {
|
|
|
58520
58589
|
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
58521
58590
|
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
58522
58591
|
const size = isCol ? this.getters.getColSize(cmd.sheetId, element) : this.getters.getUserRowSize(cmd.sheetId, element);
|
|
58523
|
-
return [element, isCol && size ===
|
|
58592
|
+
return [element, isCol && size === DEFAULT_CELL_WIDTH || size === void 0 ? null : size];
|
|
58524
58593
|
}));
|
|
58525
58594
|
const target = [{
|
|
58526
58595
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -58735,14 +58804,14 @@ var InternalViewport = class {
|
|
|
58735
58804
|
const topRowSize = this.getters.getRowSize(this.sheetId, topRowIndex);
|
|
58736
58805
|
let width = lastColEnd - this.offsetCorrectionX;
|
|
58737
58806
|
if (this.canScrollHorizontally) {
|
|
58738
|
-
width += Math.max(
|
|
58807
|
+
width += Math.max(DEFAULT_CELL_WIDTH, Math.min(leftColSize, this.viewportWidth - lastColSize));
|
|
58739
58808
|
width = Math.max(width, this.viewportWidth);
|
|
58740
58809
|
}
|
|
58741
58810
|
let height = lastRowEnd - this.offsetCorrectionY;
|
|
58742
58811
|
if (this.canScrollVertically) {
|
|
58743
|
-
height += Math.max(
|
|
58812
|
+
height += Math.max(DEFAULT_CELL_HEIGHT + 5, Math.min(topRowSize, this.viewportHeight - lastRowSize));
|
|
58744
58813
|
height = Math.max(height, this.viewportHeight);
|
|
58745
|
-
if (lastRowEnd +
|
|
58814
|
+
if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly()) height += FOOTER_HEIGHT;
|
|
58746
58815
|
}
|
|
58747
58816
|
return {
|
|
58748
58817
|
width,
|
|
@@ -60043,7 +60112,7 @@ css`
|
|
|
60043
60112
|
.o-sheet {
|
|
60044
60113
|
padding: 0 15px;
|
|
60045
60114
|
padding-right: 10px;
|
|
60046
|
-
height: ${
|
|
60115
|
+
height: ${BOTTOMBAR_HEIGHT}px;
|
|
60047
60116
|
border-left: 1px solid #c1c1c1;
|
|
60048
60117
|
border-right: 1px solid #c1c1c1;
|
|
60049
60118
|
margin-left: -1px;
|
|
@@ -60416,7 +60485,7 @@ const MENU_MAX_HEIGHT = 250;
|
|
|
60416
60485
|
css`
|
|
60417
60486
|
.o-spreadsheet-bottom-bar {
|
|
60418
60487
|
background-color: ${BACKGROUND_GRAY_COLOR};
|
|
60419
|
-
padding-left: ${
|
|
60488
|
+
padding-left: ${HEADER_WIDTH}px;
|
|
60420
60489
|
font-size: 15px;
|
|
60421
60490
|
border-top: 1px solid lightgrey;
|
|
60422
60491
|
|
|
@@ -60916,16 +60985,16 @@ var RowGroup = class extends AbstractHeaderGroup {
|
|
|
60916
60985
|
const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
|
|
60917
60986
|
const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
|
|
60918
60987
|
let groupHeaderY = 0;
|
|
60919
|
-
let groupHeaderHeight =
|
|
60988
|
+
let groupHeaderHeight = HEADER_HEIGHT;
|
|
60920
60989
|
if (startRow !== 0) {
|
|
60921
60990
|
const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
|
|
60922
|
-
groupHeaderY =
|
|
60991
|
+
groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
|
|
60923
60992
|
groupHeaderHeight = headerRowDims.end - headerRowDims.start;
|
|
60924
60993
|
}
|
|
60925
60994
|
const headerRect = {
|
|
60926
60995
|
x: this.props.layerOffset,
|
|
60927
60996
|
y: groupHeaderY,
|
|
60928
|
-
width:
|
|
60997
|
+
width: GROUP_LAYER_WIDTH,
|
|
60929
60998
|
height: groupHeaderHeight
|
|
60930
60999
|
};
|
|
60931
61000
|
return {
|
|
@@ -60933,7 +61002,7 @@ var RowGroup = class extends AbstractHeaderGroup {
|
|
|
60933
61002
|
groupRect: {
|
|
60934
61003
|
x: this.props.layerOffset,
|
|
60935
61004
|
y: headerRect.y,
|
|
60936
|
-
width:
|
|
61005
|
+
width: GROUP_LAYER_WIDTH,
|
|
60937
61006
|
height: headerRect.height + (endCoordinates - startCoordinates)
|
|
60938
61007
|
},
|
|
60939
61008
|
isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
|
|
@@ -60966,17 +61035,17 @@ var ColGroup = class extends AbstractHeaderGroup {
|
|
|
60966
61035
|
const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
|
|
60967
61036
|
const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
|
|
60968
61037
|
let groupHeaderX = 0;
|
|
60969
|
-
let groupHeaderWidth =
|
|
61038
|
+
let groupHeaderWidth = HEADER_WIDTH;
|
|
60970
61039
|
if (startCol !== 0) {
|
|
60971
61040
|
const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
|
|
60972
|
-
groupHeaderX =
|
|
61041
|
+
groupHeaderX = HEADER_WIDTH + headerRowDims.start;
|
|
60973
61042
|
groupHeaderWidth = headerRowDims.end - headerRowDims.start;
|
|
60974
61043
|
}
|
|
60975
61044
|
const headerRect = {
|
|
60976
61045
|
x: groupHeaderX,
|
|
60977
61046
|
y: this.props.layerOffset,
|
|
60978
61047
|
width: groupHeaderWidth,
|
|
60979
|
-
height:
|
|
61048
|
+
height: GROUP_LAYER_WIDTH
|
|
60980
61049
|
};
|
|
60981
61050
|
return {
|
|
60982
61051
|
headerRect,
|
|
@@ -60984,7 +61053,7 @@ var ColGroup = class extends AbstractHeaderGroup {
|
|
|
60984
61053
|
x: headerRect.x,
|
|
60985
61054
|
y: this.props.layerOffset,
|
|
60986
61055
|
width: headerRect.width + (endCoordinates - startCoordinates),
|
|
60987
|
-
height:
|
|
61056
|
+
height: GROUP_LAYER_WIDTH
|
|
60988
61057
|
},
|
|
60989
61058
|
isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
|
|
60990
61059
|
};
|
|
@@ -61031,7 +61100,7 @@ var HeaderGroupContainer = class extends Component {
|
|
|
61031
61100
|
menuItems: []
|
|
61032
61101
|
});
|
|
61033
61102
|
getLayerOffset(layerIndex) {
|
|
61034
|
-
return layerIndex *
|
|
61103
|
+
return layerIndex * GROUP_LAYER_WIDTH;
|
|
61035
61104
|
}
|
|
61036
61105
|
onContextMenu(event) {
|
|
61037
61106
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -61075,8 +61144,8 @@ var HeaderGroupContainer = class extends Component {
|
|
|
61075
61144
|
get frozenPaneContainerSize() {
|
|
61076
61145
|
if (!this.hasFrozenPane) return 0;
|
|
61077
61146
|
const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
|
|
61078
|
-
if (this.props.dimension === "COL") return
|
|
61079
|
-
else return
|
|
61147
|
+
if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
|
|
61148
|
+
else return HEADER_HEIGHT + viewportCoordinates.y;
|
|
61080
61149
|
}
|
|
61081
61150
|
};
|
|
61082
61151
|
|
|
@@ -61595,7 +61664,7 @@ var TopBarComposer = class extends Component {
|
|
|
61595
61664
|
"max-height": `${COMPOSER_MAX_HEIGHT}px`,
|
|
61596
61665
|
"line-height": "24px"
|
|
61597
61666
|
};
|
|
61598
|
-
style.height = this.focus === "inactive" ? `${
|
|
61667
|
+
style.height = this.focus === "inactive" ? `${TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
|
|
61599
61668
|
return cssPropertiesToCss(style);
|
|
61600
61669
|
}
|
|
61601
61670
|
get containerStyle() {
|
|
@@ -61803,7 +61872,7 @@ css`
|
|
|
61803
61872
|
|
|
61804
61873
|
/* Toolbar */
|
|
61805
61874
|
.o-topbar-toolbar {
|
|
61806
|
-
height: ${
|
|
61875
|
+
height: ${TOPBAR_TOOLBAR_HEIGHT}px;
|
|
61807
61876
|
|
|
61808
61877
|
.o-readonly-toolbar {
|
|
61809
61878
|
background-color: ${BACKGROUND_HEADER_COLOR};
|
|
@@ -62070,9 +62139,9 @@ css`
|
|
|
62070
62139
|
direction: ltr;
|
|
62071
62140
|
}
|
|
62072
62141
|
.o-separator {
|
|
62073
|
-
border-bottom: ${
|
|
62074
|
-
margin-top: ${
|
|
62075
|
-
margin-bottom: ${
|
|
62142
|
+
border-bottom: ${MENU_SEPARATOR_BORDER_WIDTH}px solid ${SEPARATOR_COLOR};
|
|
62143
|
+
margin-top: ${MENU_SEPARATOR_PADDING}px;
|
|
62144
|
+
margin-bottom: ${MENU_SEPARATOR_PADDING}px;
|
|
62076
62145
|
}
|
|
62077
62146
|
.o-hoverable-button {
|
|
62078
62147
|
border-radius: 2px;
|
|
@@ -62199,8 +62268,8 @@ css`
|
|
|
62199
62268
|
&.corner {
|
|
62200
62269
|
right: 0px;
|
|
62201
62270
|
bottom: 0px;
|
|
62202
|
-
height: ${
|
|
62203
|
-
width: ${
|
|
62271
|
+
height: ${SCROLLBAR_WIDTH}px;
|
|
62272
|
+
width: ${SCROLLBAR_WIDTH}px;
|
|
62204
62273
|
border-top: 1px solid #e2e3e3;
|
|
62205
62274
|
border-left: 1px solid #e2e3e3;
|
|
62206
62275
|
}
|
|
@@ -62326,7 +62395,7 @@ var Spreadsheet = class extends Component {
|
|
|
62326
62395
|
getStyle() {
|
|
62327
62396
|
const properties = {};
|
|
62328
62397
|
if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
|
|
62329
|
-
else properties["grid-template-rows"] = `${
|
|
62398
|
+
else properties["grid-template-rows"] = `${TOPBAR_HEIGHT}px auto ${BOTTOMBAR_HEIGHT + 1}px`;
|
|
62330
62399
|
properties["grid-template-columns"] = `auto ${this.sidePanel.panelSize}px`;
|
|
62331
62400
|
return cssPropertiesToCss(properties);
|
|
62332
62401
|
}
|
|
@@ -62403,7 +62472,7 @@ var Spreadsheet = class extends Component {
|
|
|
62403
62472
|
checkViewportSize() {
|
|
62404
62473
|
const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
|
|
62405
62474
|
if (!isFinite(xRatio) || !isFinite(yRatio)) return;
|
|
62406
|
-
if (yRatio >
|
|
62475
|
+
if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
|
|
62407
62476
|
if (this.isViewportTooSmall) return;
|
|
62408
62477
|
this.notificationStore.notifyUser({
|
|
62409
62478
|
text: _t("The current window is too small to display this sheet properly. Consider resizing your browser window or adjusting frozen rows and columns."),
|
|
@@ -62434,8 +62503,8 @@ var Spreadsheet = class extends Component {
|
|
|
62434
62503
|
return height;
|
|
62435
62504
|
}
|
|
62436
62505
|
get gridContainerStyle() {
|
|
62437
|
-
const gridColSize =
|
|
62438
|
-
const gridRowSize =
|
|
62506
|
+
const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
|
|
62507
|
+
const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
|
|
62439
62508
|
return cssPropertiesToCss({
|
|
62440
62509
|
"grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
|
|
62441
62510
|
"grid-template-rows": `${gridRowSize ? gridRowSize + 2 : 0}px auto`
|
|
@@ -63971,7 +64040,7 @@ function createChart(chart, chartSheetIndex, data) {
|
|
|
63971
64040
|
const color = chart.data.title.color ? toXlsxHexColor(chart.data.title.color) : chart.data.fontColor;
|
|
63972
64041
|
title = escapeXml`
|
|
63973
64042
|
<c:title>
|
|
63974
|
-
${insertText(chart.data.title.text, color,
|
|
64043
|
+
${insertText(chart.data.title.text, color, DEFAULT_CHART_FONT_SIZE, chart.data.title)}
|
|
63975
64044
|
<c:overlay val="0" />
|
|
63976
64045
|
</c:title>
|
|
63977
64046
|
`;
|
|
@@ -64055,7 +64124,7 @@ function lineAttributes(params) {
|
|
|
64055
64124
|
</a:ln>
|
|
64056
64125
|
`;
|
|
64057
64126
|
}
|
|
64058
|
-
function insertText(text, fontColor = "000000", fontsize =
|
|
64127
|
+
function insertText(text, fontColor = "000000", fontsize = DEFAULT_CHART_FONT_SIZE, style = {}) {
|
|
64059
64128
|
return escapeXml`
|
|
64060
64129
|
<c:tx>
|
|
64061
64130
|
<c:rich>
|
|
@@ -65007,12 +65076,12 @@ function figureCoordinates(headers, position) {
|
|
|
65007
65076
|
let currentPosition = 0;
|
|
65008
65077
|
for (const [headerIndex, header] of headers.entries()) if (currentPosition <= position && position < currentPosition + header.size) return {
|
|
65009
65078
|
index: headerIndex,
|
|
65010
|
-
offset: convertDotValueToEMU(position - currentPosition +
|
|
65079
|
+
offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH)
|
|
65011
65080
|
};
|
|
65012
65081
|
else if (headerIndex < headers.length - 1) currentPosition += header.size;
|
|
65013
65082
|
return {
|
|
65014
65083
|
index: headers.length - 1,
|
|
65015
|
-
offset: convertDotValueToEMU(position - currentPosition +
|
|
65084
|
+
offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH)
|
|
65016
65085
|
};
|
|
65017
65086
|
}
|
|
65018
65087
|
function createChartDrawing(figure, sheet, chartRelId) {
|
|
@@ -65111,7 +65180,7 @@ function createImageDrawing(figure, sheet, imageRelId) {
|
|
|
65111
65180
|
function addNumberFormats(numFmts) {
|
|
65112
65181
|
const numFmtNodes = [];
|
|
65113
65182
|
for (const [index, numFmt] of Object.entries(numFmts)) {
|
|
65114
|
-
const numFmtAttrs = [["numFmtId", parseInt(index) +
|
|
65183
|
+
const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
|
|
65115
65184
|
numFmtNodes.push(escapeXml`
|
|
65116
65185
|
<numFmt ${formatAttributes(numFmtAttrs)}/>
|
|
65117
65186
|
`);
|
|
@@ -65343,7 +65412,7 @@ function addColumns(cols) {
|
|
|
65343
65412
|
const attributes = [
|
|
65344
65413
|
["min", parseInt(id) + 1],
|
|
65345
65414
|
["max", parseInt(id) + 1],
|
|
65346
|
-
["width", convertWidthToExcel(col.size ||
|
|
65415
|
+
["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
|
|
65347
65416
|
["customWidth", 1],
|
|
65348
65417
|
["hidden", col.isHidden ? 1 : 0]
|
|
65349
65418
|
];
|
|
@@ -65364,7 +65433,7 @@ function addRows(construct, data, sheet) {
|
|
|
65364
65433
|
for (let r = 0; r < sheet.rowNumber; r++) {
|
|
65365
65434
|
const rowAttrs = [["r", r + 1]];
|
|
65366
65435
|
const row = sheet.rows[r] || {};
|
|
65367
|
-
if (row.size && row.size !==
|
|
65436
|
+
if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
|
|
65368
65437
|
if (row.isHidden) rowAttrs.push(["hidden", 1]);
|
|
65369
65438
|
if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
|
|
65370
65439
|
if (row.collapsed) rowAttrs.push(["collapsed", 1]);
|
|
@@ -65397,7 +65466,7 @@ function addRows(construct, data, sheet) {
|
|
|
65397
65466
|
</c>`);
|
|
65398
65467
|
}
|
|
65399
65468
|
}
|
|
65400
|
-
if (cellNodes.length || row.size !==
|
|
65469
|
+
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
|
|
65401
65470
|
<row ${formatAttributes(rowAttrs)}>
|
|
65402
65471
|
${joinXmlNodes(cellNodes)}
|
|
65403
65472
|
</row>
|
|
@@ -65570,7 +65639,7 @@ function createWorksheets(data, construct) {
|
|
|
65570
65639
|
let currentTableIndex = 1;
|
|
65571
65640
|
for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
|
|
65572
65641
|
const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
|
|
65573
|
-
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(
|
|
65642
|
+
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
|
|
65574
65643
|
const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
|
|
65575
65644
|
currentTableIndex += sheet.tables.length;
|
|
65576
65645
|
let drawingNode = escapeXml``;
|
|
@@ -66198,7 +66267,7 @@ var Model = class extends EventBus {
|
|
|
66198
66267
|
exportData() {
|
|
66199
66268
|
let data = createEmptyWorkbookData();
|
|
66200
66269
|
for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data);
|
|
66201
|
-
data.revisionId = this.session.getRevisionId() ||
|
|
66270
|
+
data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
|
|
66202
66271
|
data = deepCopy(data);
|
|
66203
66272
|
return data;
|
|
66204
66273
|
}
|
|
@@ -66242,15 +66311,15 @@ function createCommand(type, payload = {}) {
|
|
|
66242
66311
|
*/
|
|
66243
66312
|
const __info__ = {};
|
|
66244
66313
|
const SPREADSHEET_DIMENSIONS = {
|
|
66245
|
-
MIN_ROW_HEIGHT
|
|
66246
|
-
MIN_COL_WIDTH
|
|
66247
|
-
HEADER_HEIGHT
|
|
66248
|
-
HEADER_WIDTH
|
|
66249
|
-
TOPBAR_HEIGHT
|
|
66250
|
-
BOTTOMBAR_HEIGHT
|
|
66251
|
-
DEFAULT_CELL_WIDTH
|
|
66252
|
-
DEFAULT_CELL_HEIGHT
|
|
66253
|
-
SCROLLBAR_WIDTH
|
|
66314
|
+
MIN_ROW_HEIGHT,
|
|
66315
|
+
MIN_COL_WIDTH,
|
|
66316
|
+
HEADER_HEIGHT,
|
|
66317
|
+
HEADER_WIDTH,
|
|
66318
|
+
TOPBAR_HEIGHT,
|
|
66319
|
+
BOTTOMBAR_HEIGHT,
|
|
66320
|
+
DEFAULT_CELL_WIDTH,
|
|
66321
|
+
DEFAULT_CELL_HEIGHT,
|
|
66322
|
+
SCROLLBAR_WIDTH
|
|
66254
66323
|
};
|
|
66255
66324
|
const registries = {
|
|
66256
66325
|
autoCompleteProviders,
|
|
@@ -66335,6 +66404,7 @@ const helpers = {
|
|
|
66335
66404
|
overlap,
|
|
66336
66405
|
union,
|
|
66337
66406
|
isInside,
|
|
66407
|
+
addStyleToWorkbookData,
|
|
66338
66408
|
deepCopy,
|
|
66339
66409
|
expandZoneOnInsertion,
|
|
66340
66410
|
reduceZoneOnDeletion,
|
|
@@ -66442,7 +66512,7 @@ const constants = {
|
|
|
66442
66512
|
DEFAULT_LOCALE,
|
|
66443
66513
|
HIGHLIGHT_COLOR,
|
|
66444
66514
|
PIVOT_TABLE_CONFIG,
|
|
66445
|
-
TREND_LINE_XAXIS_ID
|
|
66515
|
+
TREND_LINE_XAXIS_ID,
|
|
66446
66516
|
CHART_AXIS_CHOICES,
|
|
66447
66517
|
ChartTerms
|
|
66448
66518
|
};
|
|
@@ -66450,6 +66520,6 @@ const constants = {
|
|
|
66450
66520
|
//#endregion
|
|
66451
66521
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
66452
66522
|
|
|
66453
|
-
__info__.version = "18.0.
|
|
66454
|
-
__info__.date = "2026-
|
|
66455
|
-
__info__.hash = "
|
|
66523
|
+
__info__.version = "18.0.83";
|
|
66524
|
+
__info__.date = "2026-10-10T06:31:52.656Z";
|
|
66525
|
+
__info__.hash = "22b9b73";
|