@odoo/o-spreadsheet 18.0.82 → 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 +377 -309
- package/dist/o-spreadsheet.iife.js +377 -309
- 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) => ({
|
|
@@ -8781,7 +8845,7 @@ function drawTextWithBackground(text, x, y, ctx) {
|
|
|
8781
8845
|
function drawLineOrBarChartValues(chart, options, ctx) {
|
|
8782
8846
|
const textsPositions = {};
|
|
8783
8847
|
for (const dataset of chart._metasets) {
|
|
8784
|
-
if (dataset.xAxisID ===
|
|
8848
|
+
if (dataset.xAxisID === TREND_LINE_XAXIS_ID) return;
|
|
8785
8849
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
8786
8850
|
const value = dataset._parsed[i].y;
|
|
8787
8851
|
const point = dataset.data[i];
|
|
@@ -8801,7 +8865,7 @@ function drawLineOrBarChartValues(chart, options, ctx) {
|
|
|
8801
8865
|
function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
8802
8866
|
const textsPositions = {};
|
|
8803
8867
|
for (const dataset of chart._metasets) {
|
|
8804
|
-
if (dataset.xAxisID ===
|
|
8868
|
+
if (dataset.xAxisID === TREND_LINE_XAXIS_ID) return;
|
|
8805
8869
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
8806
8870
|
const value = dataset._parsed[i].x;
|
|
8807
8871
|
const displayValue = options.callback(value, dataset, i);
|
|
@@ -8988,6 +9052,9 @@ const WIDTH_FACTOR = .143;
|
|
|
8988
9052
|
const EXCEL_DEFAULT_COL_WIDTH = 8.43;
|
|
8989
9053
|
/** unit : points */
|
|
8990
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;
|
|
8991
9058
|
const FORCE_DEFAULT_ARGS_FUNCTIONS = {
|
|
8992
9059
|
FLOOR: [{
|
|
8993
9060
|
type: "NUMBER",
|
|
@@ -9305,9 +9372,9 @@ css`
|
|
|
9305
9372
|
display: flex;
|
|
9306
9373
|
align-items: center;
|
|
9307
9374
|
justify-content: center;
|
|
9308
|
-
width: ${
|
|
9309
|
-
height: ${
|
|
9310
|
-
font-size: ${
|
|
9375
|
+
width: ${ICON_EDGE_LENGTH}px;
|
|
9376
|
+
height: ${ICON_EDGE_LENGTH}px;
|
|
9377
|
+
font-size: ${ICON_EDGE_LENGTH}px;
|
|
9311
9378
|
vertical-align: middle;
|
|
9312
9379
|
|
|
9313
9380
|
.small-text {
|
|
@@ -10279,7 +10346,7 @@ function extractStyle(cell, data) {
|
|
|
10279
10346
|
alignment: {
|
|
10280
10347
|
horizontal: style.align,
|
|
10281
10348
|
vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
|
|
10282
|
-
wrapText: style.wrapping === "wrap" || cell.content?.includes(
|
|
10349
|
+
wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : void 0,
|
|
10283
10350
|
shrinkToFit: style.wrapping === "clip" ? true : void 0
|
|
10284
10351
|
}
|
|
10285
10352
|
};
|
|
@@ -10310,7 +10377,7 @@ function normalizeStyle(construct, styles) {
|
|
|
10310
10377
|
function convertFormat(format, numFmtStructure) {
|
|
10311
10378
|
if (!format) return 0;
|
|
10312
10379
|
let formatId = XLSX_FORMAT_MAP[format.format];
|
|
10313
|
-
if (!formatId) formatId = pushElement(format, numFmtStructure) +
|
|
10380
|
+
if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
10314
10381
|
return formatId;
|
|
10315
10382
|
}
|
|
10316
10383
|
/**
|
|
@@ -10892,8 +10959,8 @@ function getSheetDims(sheet) {
|
|
|
10892
10959
|
dims[0] = Math.max(dims[0], largeMax(row.cells.map((cell) => toCartesian(cell.xc).col)));
|
|
10893
10960
|
dims[1] = Math.max(dims[1], row.index);
|
|
10894
10961
|
}
|
|
10895
|
-
dims[0] = Math.max(dims[0],
|
|
10896
|
-
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);
|
|
10897
10964
|
return dims;
|
|
10898
10965
|
}
|
|
10899
10966
|
/**
|
|
@@ -11998,7 +12065,7 @@ var XlsxBaseExtractor = class {
|
|
|
11998
12065
|
rgb = this.getThemeColor(themeIndex, theme.clrScheme);
|
|
11999
12066
|
} else {
|
|
12000
12067
|
rgb = this.extractAttr(colorElement, "rgb")?.asString();
|
|
12001
|
-
rgb = rgb ===
|
|
12068
|
+
rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
|
|
12002
12069
|
}
|
|
12003
12070
|
return {
|
|
12004
12071
|
rgb: rgb || defaultColor,
|
|
@@ -13076,7 +13143,7 @@ function getPathsOfContent(contentType, xmls) {
|
|
|
13076
13143
|
* Get the corresponding relationship file for a given xml file in a XLSX directory.
|
|
13077
13144
|
*/
|
|
13078
13145
|
function getRelationFile(file, xmls) {
|
|
13079
|
-
if (file ===
|
|
13146
|
+
if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
|
|
13080
13147
|
let relsFile = "";
|
|
13081
13148
|
const pathParts = file.split("/");
|
|
13082
13149
|
for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
|
|
@@ -13276,7 +13343,7 @@ function normalizeV9(formula) {
|
|
|
13276
13343
|
if (token.type === "REFERENCE" && cellReference.test(token.value)) {
|
|
13277
13344
|
const value = token.value.trim();
|
|
13278
13345
|
if (!dependencies.includes(value)) dependencies.push(value);
|
|
13279
|
-
return `${
|
|
13346
|
+
return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
|
|
13280
13347
|
} else return token.value;
|
|
13281
13348
|
})),
|
|
13282
13349
|
dependencies
|
|
@@ -13504,7 +13571,7 @@ migrationStepRegistry.add("migration_1", {
|
|
|
13504
13571
|
if (cell.formula) {
|
|
13505
13572
|
let { text, dependencies } = cell.formula;
|
|
13506
13573
|
for (const [index, d] of Object.entries(dependencies)) {
|
|
13507
|
-
const stringPosition = `\\${
|
|
13574
|
+
const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
|
|
13508
13575
|
text = text.replace(new RegExp(stringPosition, "g"), d);
|
|
13509
13576
|
}
|
|
13510
13577
|
cell.content = text;
|
|
@@ -13700,7 +13767,7 @@ function load(data, verboseImport) {
|
|
|
13700
13767
|
if (verboseImport) for (const parsingError of reader.warningManager.warnings.sort()) console.warn(parsingError);
|
|
13701
13768
|
}
|
|
13702
13769
|
if ("version" in data) {
|
|
13703
|
-
if (data.version <
|
|
13770
|
+
if (data.version < CURRENT_VERSION) {
|
|
13704
13771
|
console.debug("Migrating data from version", data.version);
|
|
13705
13772
|
data = migrate(data);
|
|
13706
13773
|
}
|
|
@@ -13756,7 +13823,7 @@ function forceUnicityOfFigure(data) {
|
|
|
13756
13823
|
* sensible default values
|
|
13757
13824
|
*/
|
|
13758
13825
|
function setDefaults(partialData) {
|
|
13759
|
-
const data = Object.assign(createEmptyWorkbookData(), partialData, { version:
|
|
13826
|
+
const data = Object.assign(createEmptyWorkbookData(), partialData, { version: CURRENT_VERSION });
|
|
13760
13827
|
data.sheets = data.sheets ? data.sheets.map((s, i) => Object.assign(createEmptySheet(`Sheet${i + 1}`, `Sheet${i + 1}`), s)) : [];
|
|
13761
13828
|
if (data.sheets.length === 0) data.sheets.push(createEmptySheet(INITIAL_SHEET_ID, "Sheet1"));
|
|
13762
13829
|
if (!isValidLocale(data.settings.locale)) data.settings.locale = DEFAULT_LOCALE;
|
|
@@ -13898,7 +13965,7 @@ function createEmptySheet(sheetId, name) {
|
|
|
13898
13965
|
}
|
|
13899
13966
|
function createEmptyWorkbookData(sheetName = "Sheet1") {
|
|
13900
13967
|
return {
|
|
13901
|
-
version:
|
|
13968
|
+
version: CURRENT_VERSION,
|
|
13902
13969
|
sheets: [createEmptySheet(INITIAL_SHEET_ID, sheetName)],
|
|
13903
13970
|
styles: {},
|
|
13904
13971
|
formats: {},
|
|
@@ -13948,7 +14015,7 @@ function interactivePaste(env, target, pasteOption) {
|
|
|
13948
14015
|
}));
|
|
13949
14016
|
}
|
|
13950
14017
|
function interactivePasteFromOS(env, target, clipboardContent, pasteOption) {
|
|
13951
|
-
if (clipboardContent.data && clipboardContent.data.version !==
|
|
14018
|
+
if (clipboardContent.data && clipboardContent.data.version !== CURRENT_VERSION) env.notifyUser({
|
|
13952
14019
|
type: "warning",
|
|
13953
14020
|
text: _t("You copied content from a different version of the application. Only text content will be pasted."),
|
|
13954
14021
|
sticky: false
|
|
@@ -14161,9 +14228,9 @@ const GAUGE_TEXT_COLOR_HIGH_CONTRAST = "#C8C8C8";
|
|
|
14161
14228
|
const GAUGE_INFLECTION_MARKER_COLOR = "#666666aa";
|
|
14162
14229
|
const GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN = 6;
|
|
14163
14230
|
const GAUGE_TITLE_SECTION_HEIGHT = 25;
|
|
14164
|
-
const GAUGE_TITLE_FONT_SIZE =
|
|
14165
|
-
const GAUGE_TITLE_PADDING_LEFT =
|
|
14166
|
-
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;
|
|
14167
14234
|
function drawGaugeChart(canvas, runtime) {
|
|
14168
14235
|
const canvasBoundingRect = canvas.getBoundingClientRect();
|
|
14169
14236
|
const dpr = window.devicePixelRatio || 1;
|
|
@@ -14257,18 +14324,18 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
14257
14324
|
x: boundingRect.width / 2,
|
|
14258
14325
|
y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
|
|
14259
14326
|
};
|
|
14260
|
-
let gaugeValueFontSize =
|
|
14327
|
+
let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
|
|
14261
14328
|
if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
|
|
14262
14329
|
const maxTextWidth = gaugeRect.width / 2;
|
|
14263
14330
|
const gaugeLabel = gaugeValue?.label || "-";
|
|
14264
14331
|
if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
|
|
14265
14332
|
const minLabelPosition = {
|
|
14266
14333
|
x: gaugeRect.x + gaugeArcWidth / 2,
|
|
14267
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
14334
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
14268
14335
|
};
|
|
14269
14336
|
const maxLabelPosition = {
|
|
14270
14337
|
x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
|
|
14271
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
14338
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
14272
14339
|
};
|
|
14273
14340
|
const textColor = getContrastedTextColor(runtime.background);
|
|
14274
14341
|
const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
|
|
@@ -14319,13 +14386,13 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
14319
14386
|
minLabel: {
|
|
14320
14387
|
label: runtime.minValue.label,
|
|
14321
14388
|
textPosition: minLabelPosition,
|
|
14322
|
-
fontSize:
|
|
14389
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14323
14390
|
color: textColor
|
|
14324
14391
|
},
|
|
14325
14392
|
maxLabel: {
|
|
14326
14393
|
label: runtime.maxValue.label,
|
|
14327
14394
|
textPosition: maxLabelPosition,
|
|
14328
|
-
fontSize:
|
|
14395
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14329
14396
|
color: textColor
|
|
14330
14397
|
}
|
|
14331
14398
|
};
|
|
@@ -14335,9 +14402,9 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
|
|
|
14335
14402
|
* space for the title and labels.
|
|
14336
14403
|
*/
|
|
14337
14404
|
function getGaugeRect(boundingRect, title) {
|
|
14338
|
-
const titleHeight = title ?
|
|
14339
|
-
const drawHeight = boundingRect.height -
|
|
14340
|
-
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;
|
|
14341
14408
|
let gaugeWidth;
|
|
14342
14409
|
let gaugeHeight;
|
|
14343
14410
|
if (drawWidth > 2 * drawHeight) {
|
|
@@ -14348,8 +14415,8 @@ function getGaugeRect(boundingRect, title) {
|
|
|
14348
14415
|
gaugeHeight = drawWidth / 2;
|
|
14349
14416
|
}
|
|
14350
14417
|
return {
|
|
14351
|
-
x:
|
|
14352
|
-
y: titleHeight +
|
|
14418
|
+
x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
|
|
14419
|
+
y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
|
|
14353
14420
|
width: gaugeWidth,
|
|
14354
14421
|
height: gaugeHeight
|
|
14355
14422
|
};
|
|
@@ -14366,20 +14433,20 @@ function getInflectionValues(runtime, gaugeRect, textColor, ctx) {
|
|
|
14366
14433
|
x: gaugeRect.x + gaugeRect.width / 2,
|
|
14367
14434
|
y: gaugeRect.y + gaugeRect.height
|
|
14368
14435
|
};
|
|
14369
|
-
const textStyle = { fontSize:
|
|
14436
|
+
const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
|
|
14370
14437
|
const inflectionValues = [];
|
|
14371
14438
|
const inflectionValuesTextRects = [];
|
|
14372
14439
|
for (const inflectionValue of runtime.inflectionValues) {
|
|
14373
14440
|
const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
|
|
14374
14441
|
const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
|
|
14375
14442
|
const angle = Math.PI - Math.PI * percentage;
|
|
14376
|
-
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2,
|
|
14377
|
-
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;
|
|
14378
14445
|
inflectionValuesTextRects.push(textRect);
|
|
14379
14446
|
inflectionValues.push({
|
|
14380
14447
|
rotation: angle,
|
|
14381
14448
|
label: inflectionValue.label,
|
|
14382
|
-
fontSize:
|
|
14449
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14383
14450
|
color: textColor,
|
|
14384
14451
|
offset
|
|
14385
14452
|
});
|
|
@@ -14589,8 +14656,8 @@ var ScorecardChart$1 = class ScorecardChart$1 extends AbstractChart {
|
|
|
14589
14656
|
this.baselineMode = definition.baselineMode;
|
|
14590
14657
|
this.baselineDescr = definition.baselineDescr;
|
|
14591
14658
|
this.background = definition.background;
|
|
14592
|
-
this.baselineColorUp = definition.baselineColorUp ??
|
|
14593
|
-
this.baselineColorDown = definition.baselineColorDown ??
|
|
14659
|
+
this.baselineColorUp = definition.baselineColorUp ?? DEFAULT_SCORECARD_BASELINE_COLOR_UP;
|
|
14660
|
+
this.baselineColorDown = definition.baselineColorDown ?? DEFAULT_SCORECARD_BASELINE_COLOR_DOWN;
|
|
14594
14661
|
this.humanize = definition.humanize ?? false;
|
|
14595
14662
|
}
|
|
14596
14663
|
static validateChartDefinition(validator, definition) {
|
|
@@ -14665,7 +14732,7 @@ function drawScoreChart(structure, canvas) {
|
|
|
14665
14732
|
canvas.width = dpr * structure.canvas.width;
|
|
14666
14733
|
canvas.height = dpr * structure.canvas.height;
|
|
14667
14734
|
ctx.scale(dpr, dpr);
|
|
14668
|
-
const availableWidth = structure.canvas.width -
|
|
14735
|
+
const availableWidth = structure.canvas.width - DEFAULT_CHART_PADDING;
|
|
14669
14736
|
ctx.fillStyle = structure.canvas.backgroundColor;
|
|
14670
14737
|
ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
|
|
14671
14738
|
if (structure.title) {
|
|
@@ -14780,9 +14847,9 @@ function createScorecardChartRuntime(chart, getters) {
|
|
|
14780
14847
|
|
|
14781
14848
|
//#endregion
|
|
14782
14849
|
//#region src/helpers/figures/charts/scorecard_chart_config_builder.ts
|
|
14783
|
-
const CHART_PADDING =
|
|
14850
|
+
const CHART_PADDING = SCORECARD_GAUGE_CHART_PADDING;
|
|
14784
14851
|
const BOTTOM_PADDING_RATIO = .05;
|
|
14785
|
-
const CHART_TITLE_FONT_SIZE =
|
|
14852
|
+
const CHART_TITLE_FONT_SIZE = SCORECARD_GAUGE_CHART_FONT_SIZE;
|
|
14786
14853
|
const KEY_VALUE_FONT_SIZE = 32;
|
|
14787
14854
|
const BASELINE_MAX_FONT_SIZE = 16;
|
|
14788
14855
|
function formatBaselineDescr(baselineDescr, baseline) {
|
|
@@ -14848,7 +14915,7 @@ var ScorecardChartConfigBuilder = class {
|
|
|
14848
14915
|
y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING
|
|
14849
14916
|
}
|
|
14850
14917
|
};
|
|
14851
|
-
const minimalBaselinePosition = baselineArrowSize +
|
|
14918
|
+
const minimalBaselinePosition = baselineArrowSize + DEFAULT_CHART_PADDING;
|
|
14852
14919
|
if (structure.baseline.position.x < minimalBaselinePosition) structure.baseline.position.x = minimalBaselinePosition;
|
|
14853
14920
|
if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
|
|
14854
14921
|
direction: this.baselineArrow,
|
|
@@ -15026,7 +15093,7 @@ function aggregateDataForLabels(labels, datasets) {
|
|
|
15026
15093
|
}
|
|
15027
15094
|
function truncateLabel(label) {
|
|
15028
15095
|
if (!label) return "";
|
|
15029
|
-
if (label.length >
|
|
15096
|
+
if (label.length > MAX_CHAR_LABEL) return label.substring(0, MAX_CHAR_LABEL) + "…";
|
|
15030
15097
|
return label;
|
|
15031
15098
|
}
|
|
15032
15099
|
/**
|
|
@@ -15041,10 +15108,10 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
|
|
|
15041
15108
|
responsive: true,
|
|
15042
15109
|
maintainAspectRatio: false,
|
|
15043
15110
|
layout: { padding: {
|
|
15044
|
-
left:
|
|
15045
|
-
right:
|
|
15046
|
-
top: chartTitle.text ?
|
|
15047
|
-
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
|
|
15048
15115
|
} },
|
|
15049
15116
|
elements: {
|
|
15050
15117
|
line: { fill: false },
|
|
@@ -15058,7 +15125,7 @@ function getDefaultChartJsRuntime(chart, labels, fontColor, { format, locale, tr
|
|
|
15058
15125
|
color: chartTitle?.color ?? fontColor,
|
|
15059
15126
|
align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
|
|
15060
15127
|
font: {
|
|
15061
|
-
size:
|
|
15128
|
+
size: DEFAULT_CHART_FONT_SIZE,
|
|
15062
15129
|
weight: chartTitle.bold ? "bold" : "normal",
|
|
15063
15130
|
style: chartTitle.italic ? "italic" : "normal"
|
|
15064
15131
|
}
|
|
@@ -23492,7 +23559,7 @@ var ContentEditableHelper = class {
|
|
|
23492
23559
|
while (!current.done) {
|
|
23493
23560
|
if (!current.value.hasChildNodes()) text += current.value.textContent;
|
|
23494
23561
|
if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) if (isFirstParagraph) isFirstParagraph = false;
|
|
23495
|
-
else text +=
|
|
23562
|
+
else text += NEWLINE;
|
|
23496
23563
|
current = it.next();
|
|
23497
23564
|
}
|
|
23498
23565
|
return text;
|
|
@@ -23719,7 +23786,7 @@ var Composer = class extends Component {
|
|
|
23719
23786
|
if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
|
|
23720
23787
|
} else {
|
|
23721
23788
|
assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
|
|
23722
|
-
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`;
|
|
23723
23790
|
}
|
|
23724
23791
|
return assistantStyle;
|
|
23725
23792
|
}
|
|
@@ -23833,7 +23900,7 @@ var Composer = class extends Component {
|
|
|
23833
23900
|
const start = Math.min(selection.start, selection.end);
|
|
23834
23901
|
const end = Math.max(selection.start, selection.end);
|
|
23835
23902
|
this.props.composerStore.stopComposerRangeSelection();
|
|
23836
|
-
this.props.composerStore.setCurrentContent(content.slice(0, start) +
|
|
23903
|
+
this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
|
|
23837
23904
|
start: start + 1,
|
|
23838
23905
|
end: start + 1
|
|
23839
23906
|
});
|
|
@@ -24062,8 +24129,8 @@ var Composer = class extends Component {
|
|
|
24062
24129
|
splitHtmlContentIntoLines(contents) {
|
|
24063
24130
|
const contentSplitInLines = [];
|
|
24064
24131
|
let currentLine = [];
|
|
24065
|
-
for (const content of contents) if (content.value.includes(
|
|
24066
|
-
const lines = content.value.split(
|
|
24132
|
+
for (const content of contents) if (content.value.includes(NEWLINE)) {
|
|
24133
|
+
const lines = content.value.split(NEWLINE);
|
|
24067
24134
|
const lastLine = lines.pop();
|
|
24068
24135
|
for (const line of lines) {
|
|
24069
24136
|
currentLine.push({
|
|
@@ -25284,7 +25351,7 @@ var BarChart = class BarChart extends AbstractChart {
|
|
|
25284
25351
|
const definition = this.getDefinition();
|
|
25285
25352
|
return {
|
|
25286
25353
|
...definition,
|
|
25287
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
25354
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
25288
25355
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
25289
25356
|
dataSets,
|
|
25290
25357
|
labelRange,
|
|
@@ -25374,7 +25441,7 @@ function createBarChartRuntime(chart, getters) {
|
|
|
25374
25441
|
label,
|
|
25375
25442
|
data,
|
|
25376
25443
|
hidden,
|
|
25377
|
-
borderColor: definition.background ||
|
|
25444
|
+
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
25378
25445
|
borderWidth: definition.stacked ? 1 : 0,
|
|
25379
25446
|
backgroundColor: color
|
|
25380
25447
|
};
|
|
@@ -25388,7 +25455,7 @@ function createBarChartRuntime(chart, getters) {
|
|
|
25388
25455
|
}
|
|
25389
25456
|
if (trendDatasets.length) {
|
|
25390
25457
|
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset.data.length));
|
|
25391
|
-
config.options.scales[
|
|
25458
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25392
25459
|
...xAxis,
|
|
25393
25460
|
labels: Array(maxLength).fill(""),
|
|
25394
25461
|
offset: false,
|
|
@@ -25396,12 +25463,12 @@ function createBarChartRuntime(chart, getters) {
|
|
|
25396
25463
|
};
|
|
25397
25464
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
25398
25465
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
25399
|
-
return tooltipItems.some((item) => item.dataset.xAxisID !==
|
|
25466
|
+
return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
|
|
25400
25467
|
};
|
|
25401
25468
|
}
|
|
25402
25469
|
return {
|
|
25403
25470
|
chartJsConfig: config,
|
|
25404
|
-
background: chart.background ||
|
|
25471
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
25405
25472
|
};
|
|
25406
25473
|
}
|
|
25407
25474
|
|
|
@@ -25688,7 +25755,7 @@ function createLineOrScatterChartRuntime(chart, getters) {
|
|
|
25688
25755
|
config.options.plugins.tooltip.callbacks.label = (tooltipItem) => {
|
|
25689
25756
|
let dataSetPoint;
|
|
25690
25757
|
let label;
|
|
25691
|
-
if (tooltipItem.dataset.xAxisID ===
|
|
25758
|
+
if (tooltipItem.dataset.xAxisID === TREND_LINE_XAXIS_ID) {
|
|
25692
25759
|
dataSetPoint = dataSetsValues[tooltipItem.datasetIndex].data[tooltipItem.dataIndex].y;
|
|
25693
25760
|
label = "";
|
|
25694
25761
|
} else {
|
|
@@ -25759,23 +25826,23 @@ function createLineOrScatterChartRuntime(chart, getters) {
|
|
|
25759
25826
|
}
|
|
25760
25827
|
}
|
|
25761
25828
|
if (trendDatasets.length) {
|
|
25762
|
-
config.options.scales[
|
|
25829
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25763
25830
|
...xAxis,
|
|
25764
25831
|
display: false
|
|
25765
25832
|
};
|
|
25766
25833
|
if (axisType === "category" || axisType === "time") {
|
|
25767
|
-
config.options.scales[
|
|
25768
|
-
config.options.scales[
|
|
25769
|
-
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;
|
|
25770
25837
|
}
|
|
25771
25838
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
25772
25839
|
}
|
|
25773
25840
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
25774
|
-
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 : "";
|
|
25775
25842
|
};
|
|
25776
25843
|
return {
|
|
25777
25844
|
chartJsConfig: config,
|
|
25778
|
-
background: chart.background ||
|
|
25845
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
25779
25846
|
};
|
|
25780
25847
|
}
|
|
25781
25848
|
|
|
@@ -25851,7 +25918,7 @@ var ComboChart = class ComboChart extends AbstractChart {
|
|
|
25851
25918
|
const definition = this.getDefinition();
|
|
25852
25919
|
return {
|
|
25853
25920
|
...definition,
|
|
25854
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
25921
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
25855
25922
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
25856
25923
|
dataSets,
|
|
25857
25924
|
labelRange,
|
|
@@ -25991,19 +26058,19 @@ function createComboChartRuntime(chart, getters) {
|
|
|
25991
26058
|
}
|
|
25992
26059
|
if (trendDatasets.length) {
|
|
25993
26060
|
const trendLinesMaxLength = Math.max(...trendDatasets.map((trend) => trend.data.length));
|
|
25994
|
-
config.options.scales[
|
|
26061
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25995
26062
|
labels: Array(Math.round(trendLinesMaxLength)).fill(""),
|
|
25996
26063
|
offset: false,
|
|
25997
26064
|
display: false
|
|
25998
26065
|
};
|
|
25999
26066
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
26000
26067
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
26001
|
-
return tooltipItems.some((item) => item.dataset.xAxisID !==
|
|
26068
|
+
return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
|
|
26002
26069
|
};
|
|
26003
26070
|
}
|
|
26004
26071
|
return {
|
|
26005
26072
|
chartJsConfig: config,
|
|
26006
|
-
background: chart.background ||
|
|
26073
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26007
26074
|
};
|
|
26008
26075
|
}
|
|
26009
26076
|
|
|
@@ -26327,7 +26394,7 @@ var LineChart = class LineChart extends AbstractChart {
|
|
|
26327
26394
|
const definition = this.getDefinition();
|
|
26328
26395
|
return {
|
|
26329
26396
|
...definition,
|
|
26330
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26397
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26331
26398
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26332
26399
|
dataSets,
|
|
26333
26400
|
labelRange,
|
|
@@ -26424,7 +26491,7 @@ var PieChart = class PieChart extends AbstractChart {
|
|
|
26424
26491
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
26425
26492
|
return {
|
|
26426
26493
|
...this.getDefinition(),
|
|
26427
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26494
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26428
26495
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26429
26496
|
dataSets,
|
|
26430
26497
|
labelRange
|
|
@@ -26528,7 +26595,7 @@ function createPieChartRuntime(chart, getters) {
|
|
|
26528
26595
|
if (chart.isDoughnut) config.type = "doughnut";
|
|
26529
26596
|
return {
|
|
26530
26597
|
chartJsConfig: config,
|
|
26531
|
-
background: chart.background ||
|
|
26598
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26532
26599
|
};
|
|
26533
26600
|
}
|
|
26534
26601
|
|
|
@@ -26660,7 +26727,7 @@ function createPyramidChartRuntime(chart, getters) {
|
|
|
26660
26727
|
config.options.plugins.chartShowValuesPlugin.callback = (value, dataset, index) => callback(Math.abs(value), dataset, index);
|
|
26661
26728
|
return {
|
|
26662
26729
|
chartJsConfig: config,
|
|
26663
|
-
background: chart.background ||
|
|
26730
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26664
26731
|
};
|
|
26665
26732
|
}
|
|
26666
26733
|
|
|
@@ -26758,7 +26825,7 @@ var ScatterChart = class ScatterChart extends AbstractChart {
|
|
|
26758
26825
|
const definition = this.getDefinition();
|
|
26759
26826
|
return {
|
|
26760
26827
|
...definition,
|
|
26761
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26828
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26762
26829
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26763
26830
|
dataSets,
|
|
26764
26831
|
labelRange,
|
|
@@ -26907,9 +26974,9 @@ function getWaterfallConfiguration(chart, labels, dataSeriesLabels, localeFormat
|
|
|
26907
26974
|
const { locale, format } = localeFormat;
|
|
26908
26975
|
const fontColor = chartFontColor(chart.background);
|
|
26909
26976
|
const config = getDefaultChartJsRuntime(chart, labels, fontColor, localeFormat);
|
|
26910
|
-
const negativeColor = chart.negativeValuesColor ||
|
|
26911
|
-
const positiveColor = chart.positiveValuesColor ||
|
|
26912
|
-
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;
|
|
26913
26980
|
const legend = { labels: { generateLabels: () => {
|
|
26914
26981
|
const legendValues = [{
|
|
26915
26982
|
text: _t("Positive values"),
|
|
@@ -27013,9 +27080,9 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
27013
27080
|
locale
|
|
27014
27081
|
}, dataSetsValues);
|
|
27015
27082
|
config.type = "bar";
|
|
27016
|
-
const negativeColor = chart.negativeValuesColor ||
|
|
27017
|
-
const positiveColor = chart.positiveValuesColor ||
|
|
27018
|
-
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;
|
|
27019
27086
|
const backgroundColor = [];
|
|
27020
27087
|
const datasetValues = [];
|
|
27021
27088
|
const dataset = {
|
|
@@ -27050,7 +27117,7 @@ function createWaterfallChartRuntime(chart, getters) {
|
|
|
27050
27117
|
config.data.labels = labelsWithSubTotals.map(truncateLabel);
|
|
27051
27118
|
return {
|
|
27052
27119
|
chartJsConfig: config,
|
|
27053
|
-
background: chart.background ||
|
|
27120
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
27054
27121
|
};
|
|
27055
27122
|
}
|
|
27056
27123
|
|
|
@@ -27779,7 +27846,7 @@ const CSS = css`
|
|
|
27779
27846
|
.o-filter-menu-item {
|
|
27780
27847
|
display: flex;
|
|
27781
27848
|
box-sizing: border-box;
|
|
27782
|
-
height: ${
|
|
27849
|
+
height: ${MENU_ITEM_HEIGHT}px;
|
|
27783
27850
|
padding: 4px 4px 4px 0px;
|
|
27784
27851
|
cursor: pointer;
|
|
27785
27852
|
user-select: none;
|
|
@@ -28214,7 +28281,7 @@ var LinkDisplay = class extends Component {
|
|
|
28214
28281
|
col,
|
|
28215
28282
|
row
|
|
28216
28283
|
});
|
|
28217
|
-
const textColor = style?.textColor ===
|
|
28284
|
+
const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
|
|
28218
28285
|
this.env.model.dispatch("UPDATE_CELL", {
|
|
28219
28286
|
col,
|
|
28220
28287
|
row,
|
|
@@ -28621,15 +28688,15 @@ var TopRightPopoverContext = class extends PopoverPositionContext {
|
|
|
28621
28688
|
css`
|
|
28622
28689
|
.o-menu {
|
|
28623
28690
|
background-color: white;
|
|
28624
|
-
padding: ${
|
|
28625
|
-
width: ${
|
|
28691
|
+
padding: ${MENU_VERTICAL_PADDING}px 0px;
|
|
28692
|
+
width: ${MENU_WIDTH}px;
|
|
28626
28693
|
box-sizing: border-box !important;
|
|
28627
28694
|
user-select: none;
|
|
28628
28695
|
|
|
28629
28696
|
.o-menu-item {
|
|
28630
28697
|
box-sizing: border-box;
|
|
28631
|
-
height: ${
|
|
28632
|
-
padding: ${
|
|
28698
|
+
height: ${MENU_ITEM_HEIGHT}px;
|
|
28699
|
+
padding: ${MENU_ITEM_PADDING_VERTICAL}px ${MENU_ITEM_PADDING_HORIZONTAL}px;
|
|
28633
28700
|
cursor: pointer;
|
|
28634
28701
|
user-select: none;
|
|
28635
28702
|
|
|
@@ -28640,8 +28707,8 @@ css`
|
|
|
28640
28707
|
.o-menu-item-icon {
|
|
28641
28708
|
display: inline-block;
|
|
28642
28709
|
margin: 0px 8px 0px 0px;
|
|
28643
|
-
width: ${
|
|
28644
|
-
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;
|
|
28645
28712
|
}
|
|
28646
28713
|
|
|
28647
28714
|
&:not(.disabled) {
|
|
@@ -28746,11 +28813,11 @@ var Menu = class Menu extends Component {
|
|
|
28746
28813
|
anchorRect: {
|
|
28747
28814
|
x: this.props.position.x,
|
|
28748
28815
|
y: this.props.position.y,
|
|
28749
|
-
width: isRoot ? 0 : this.props.width ||
|
|
28750
|
-
height: isRoot ? 0 :
|
|
28816
|
+
width: isRoot ? 0 : this.props.width || MENU_WIDTH,
|
|
28817
|
+
height: isRoot ? 0 : MENU_ITEM_HEIGHT
|
|
28751
28818
|
},
|
|
28752
28819
|
positioning: "TopRight",
|
|
28753
|
-
verticalOffset: isRoot ? 0 :
|
|
28820
|
+
verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
|
|
28754
28821
|
onPopoverHidden: () => this.closeSubMenu(),
|
|
28755
28822
|
onPopoverMoved: () => this.closeSubMenu()
|
|
28756
28823
|
};
|
|
@@ -29431,8 +29498,8 @@ const CREATE_CHART = (env) => {
|
|
|
29431
29498
|
const sheetId = getters.getActiveSheetId();
|
|
29432
29499
|
if (getZoneArea(env.model.getters.getSelectedZone()) === 1) env.model.selection.selectTableAroundSelection();
|
|
29433
29500
|
const size = {
|
|
29434
|
-
width:
|
|
29435
|
-
height:
|
|
29501
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
29502
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
29436
29503
|
};
|
|
29437
29504
|
const position = getChartPositionAtCenterOfViewport(getters, size);
|
|
29438
29505
|
if (env.model.dispatch("CREATE_CHART", {
|
|
@@ -31256,7 +31323,7 @@ function getVisiblePivotCellPositions(getters, pivotId) {
|
|
|
31256
31323
|
function drawHighlight(renderingContext, highlight, rect) {
|
|
31257
31324
|
const { x, y, width, height } = rect;
|
|
31258
31325
|
if (width < 0 || height < 0) return;
|
|
31259
|
-
const color = highlight.color ||
|
|
31326
|
+
const color = highlight.color || HIGHLIGHT_COLOR;
|
|
31260
31327
|
const { ctx } = renderingContext;
|
|
31261
31328
|
ctx.save();
|
|
31262
31329
|
if (!highlight.noBorder) {
|
|
@@ -31751,8 +31818,8 @@ css`
|
|
|
31751
31818
|
-webkit-appearance: none;
|
|
31752
31819
|
-moz-appearance: none;
|
|
31753
31820
|
border-radius: 0;
|
|
31754
|
-
width: ${
|
|
31755
|
-
height: ${
|
|
31821
|
+
width: ${CHECKBOX_WIDTH}px;
|
|
31822
|
+
height: ${CHECKBOX_WIDTH}px;
|
|
31756
31823
|
vertical-align: top;
|
|
31757
31824
|
box-sizing: border-box;
|
|
31758
31825
|
outline: none;
|
|
@@ -32694,7 +32761,7 @@ function dragAndDropBeyondTheViewport(env, cbMouseMove, cbMouseUp, only = false)
|
|
|
32694
32761
|
let { scrollX, scrollY } = getters.getActiveSheetDOMScrollInfo();
|
|
32695
32762
|
const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
|
|
32696
32763
|
let canEdgeScroll = false;
|
|
32697
|
-
let timeoutDelay =
|
|
32764
|
+
let timeoutDelay = MAX_DELAY;
|
|
32698
32765
|
const x = currentEv.clientX - position.left;
|
|
32699
32766
|
colIndex = getters.getColIndex(x);
|
|
32700
32767
|
if (only !== "vertical") {
|
|
@@ -32860,9 +32927,9 @@ css`
|
|
|
32860
32927
|
}
|
|
32861
32928
|
}
|
|
32862
32929
|
.o-separator {
|
|
32863
|
-
border-bottom: ${
|
|
32864
|
-
margin-top: ${
|
|
32865
|
-
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;
|
|
32866
32933
|
}
|
|
32867
32934
|
|
|
32868
32935
|
.o-custom-selector {
|
|
@@ -33004,7 +33071,7 @@ var ColorPicker = class extends Component {
|
|
|
33004
33071
|
}
|
|
33005
33072
|
get sliderStyle() {
|
|
33006
33073
|
const hue = this.state.currentHslaColor?.h || 0;
|
|
33007
|
-
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` });
|
|
33008
33075
|
}
|
|
33009
33076
|
get pointerStyle() {
|
|
33010
33077
|
const { s, l } = this.state.currentHslaColor || {
|
|
@@ -34129,13 +34196,13 @@ var WaterfallChartDesignPanel = class extends Component {
|
|
|
34129
34196
|
}];
|
|
34130
34197
|
}
|
|
34131
34198
|
get positiveValuesColor() {
|
|
34132
|
-
return this.props.definition.positiveValuesColor ||
|
|
34199
|
+
return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
34133
34200
|
}
|
|
34134
34201
|
get negativeValuesColor() {
|
|
34135
|
-
return this.props.definition.negativeValuesColor ||
|
|
34202
|
+
return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
34136
34203
|
}
|
|
34137
34204
|
get subTotalValuesColor() {
|
|
34138
|
-
return this.props.definition.subTotalValuesColor ||
|
|
34205
|
+
return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
34139
34206
|
}
|
|
34140
34207
|
updateLegendPosition(ev) {
|
|
34141
34208
|
this.props.updateChart(this.props.figureId, { legendPosition: ev.target.value });
|
|
@@ -35409,8 +35476,8 @@ css`
|
|
|
35409
35476
|
height: 50px;
|
|
35410
35477
|
width: 50px;
|
|
35411
35478
|
.o-icon {
|
|
35412
|
-
width: ${
|
|
35413
|
-
height: ${
|
|
35479
|
+
width: ${CF_ICON_EDGE_LENGTH}px;
|
|
35480
|
+
height: ${CF_ICON_EDGE_LENGTH}px;
|
|
35414
35481
|
}
|
|
35415
35482
|
}
|
|
35416
35483
|
.o-cf-preview-description {
|
|
@@ -35588,8 +35655,8 @@ css`
|
|
|
35588
35655
|
background-color: ${BADGE_SELECTED_COLOR};
|
|
35589
35656
|
}
|
|
35590
35657
|
.o-icon {
|
|
35591
|
-
width: ${
|
|
35592
|
-
height: ${
|
|
35658
|
+
width: ${CF_ICON_EDGE_LENGTH}px;
|
|
35659
|
+
height: ${CF_ICON_EDGE_LENGTH}px;
|
|
35593
35660
|
}
|
|
35594
35661
|
}
|
|
35595
35662
|
.o-cf-iconsets {
|
|
@@ -35863,7 +35930,7 @@ var ConditionalFormattingEditor = class extends Component {
|
|
|
35863
35930
|
getPreviewGradient() {
|
|
35864
35931
|
const rule = this.state.rules.colorScale;
|
|
35865
35932
|
const minColor = colorNumberString(rule.minimum.color);
|
|
35866
|
-
const midColor = colorNumberString(rule.midpoint?.color ||
|
|
35933
|
+
const midColor = colorNumberString(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
35867
35934
|
const maxColor = colorNumberString(rule.maximum.color);
|
|
35868
35935
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
35869
35936
|
return rule.midpoint === void 0 ? baseString + minColor + ", " + maxColor + ")" : baseString + minColor + ", " + midColor + ", " + maxColor + ")";
|
|
@@ -37862,7 +37929,7 @@ var PivotMeasureDisplayPanelStore = class extends SpreadsheetStore {
|
|
|
37862
37929
|
return {
|
|
37863
37930
|
type: measureDisplayType,
|
|
37864
37931
|
fieldNameWithGranularity,
|
|
37865
|
-
value: value ??
|
|
37932
|
+
value: value ?? PREVIOUS_VALUE
|
|
37866
37933
|
};
|
|
37867
37934
|
}
|
|
37868
37935
|
}
|
|
@@ -40331,7 +40398,7 @@ const SEPARATORS = [
|
|
|
40331
40398
|
},
|
|
40332
40399
|
{
|
|
40333
40400
|
name: _t("Line Break"),
|
|
40334
|
-
value:
|
|
40401
|
+
value: NEWLINE
|
|
40335
40402
|
}
|
|
40336
40403
|
];
|
|
40337
40404
|
var SplitIntoColumnsPanel = class extends Component {
|
|
@@ -41579,7 +41646,7 @@ var FigureComponent = class extends Component {
|
|
|
41579
41646
|
showMenu() {
|
|
41580
41647
|
const { x, y, width } = this.menuButtonRect;
|
|
41581
41648
|
const menuPosition = {
|
|
41582
|
-
x: x >=
|
|
41649
|
+
x: x >= MENU_WIDTH ? x - MENU_WIDTH : x + width,
|
|
41583
41650
|
y
|
|
41584
41651
|
};
|
|
41585
41652
|
this.openContextMenu(menuPosition);
|
|
@@ -41717,8 +41784,8 @@ var ArrayFormulaHighlight = class extends SpreadsheetStore {
|
|
|
41717
41784
|
css`
|
|
41718
41785
|
.o-autofill {
|
|
41719
41786
|
position: absolute;
|
|
41720
|
-
height: ${
|
|
41721
|
-
width: ${
|
|
41787
|
+
height: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41788
|
+
width: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41722
41789
|
border: 1px solid white;
|
|
41723
41790
|
box-sizing: border-box !important;
|
|
41724
41791
|
background-color: #1a73e8;
|
|
@@ -41726,8 +41793,8 @@ css`
|
|
|
41726
41793
|
|
|
41727
41794
|
.o-autofill-handler {
|
|
41728
41795
|
position: absolute;
|
|
41729
|
-
height: ${
|
|
41730
|
-
width: ${
|
|
41796
|
+
height: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41797
|
+
width: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41731
41798
|
&:hover {
|
|
41732
41799
|
cursor: crosshair;
|
|
41733
41800
|
}
|
|
@@ -42275,8 +42342,8 @@ var GridComposer = class extends Component {
|
|
|
42275
42342
|
//#region src/components/grid_cell_icon/grid_cell_icon.ts
|
|
42276
42343
|
css`
|
|
42277
42344
|
.o-grid-cell-icon {
|
|
42278
|
-
width: ${
|
|
42279
|
-
height: ${
|
|
42345
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42346
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42280
42347
|
}
|
|
42281
42348
|
`;
|
|
42282
42349
|
var GridCellIcon = class extends Component {
|
|
@@ -42308,11 +42375,11 @@ var GridCellIcon = class extends Component {
|
|
|
42308
42375
|
const end = rect.y + rect.height;
|
|
42309
42376
|
const cell = this.env.model.getters.getCell(cellPosition);
|
|
42310
42377
|
switch (this.props.verticalAlign || cell?.style?.verticalAlign || DEFAULT_VERTICAL_ALIGN) {
|
|
42311
|
-
case "bottom": return end -
|
|
42312
|
-
case "top": return start +
|
|
42378
|
+
case "bottom": return end - GRID_ICON_MARGIN - GRID_ICON_EDGE_LENGTH;
|
|
42379
|
+
case "top": return start + GRID_ICON_MARGIN;
|
|
42313
42380
|
default:
|
|
42314
|
-
const centeringOffset = Math.floor((end - start -
|
|
42315
|
-
return end -
|
|
42381
|
+
const centeringOffset = Math.floor((end - start - GRID_ICON_EDGE_LENGTH) / 2);
|
|
42382
|
+
return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
|
|
42316
42383
|
}
|
|
42317
42384
|
}
|
|
42318
42385
|
getIconHorizontalPosition(rect, cellPosition) {
|
|
@@ -42321,11 +42388,11 @@ var GridCellIcon = class extends Component {
|
|
|
42321
42388
|
const cell = this.env.model.getters.getCell(cellPosition);
|
|
42322
42389
|
const evaluatedCell = this.env.model.getters.getEvaluatedCell(cellPosition);
|
|
42323
42390
|
switch (this.props.horizontalAlign || cell?.style?.align || evaluatedCell.defaultAlign) {
|
|
42324
|
-
case "right": return end -
|
|
42325
|
-
case "left": return start +
|
|
42391
|
+
case "right": return end - GRID_ICON_MARGIN - GRID_ICON_EDGE_LENGTH;
|
|
42392
|
+
case "left": return start + GRID_ICON_MARGIN;
|
|
42326
42393
|
default:
|
|
42327
|
-
const centeringOffset = Math.floor((end - start -
|
|
42328
|
-
return end -
|
|
42394
|
+
const centeringOffset = Math.floor((end - start - GRID_ICON_EDGE_LENGTH) / 2);
|
|
42395
|
+
return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
|
|
42329
42396
|
}
|
|
42330
42397
|
}
|
|
42331
42398
|
isPositionVisible(position) {
|
|
@@ -42340,7 +42407,7 @@ css`
|
|
|
42340
42407
|
.o-dv-checkbox {
|
|
42341
42408
|
box-sizing: border-box !important;
|
|
42342
42409
|
accent-color: #808080;
|
|
42343
|
-
margin: ${(
|
|
42410
|
+
margin: ${(GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2}px;
|
|
42344
42411
|
/** required to prevent the checkbox position to be sensible to the font-size (affects Firefox) */
|
|
42345
42412
|
position: absolute;
|
|
42346
42413
|
}
|
|
@@ -42375,8 +42442,8 @@ css`
|
|
|
42375
42442
|
.o-dv-list-icon {
|
|
42376
42443
|
color: ${TEXT_BODY_MUTED};
|
|
42377
42444
|
border-radius: 1px;
|
|
42378
|
-
height: ${
|
|
42379
|
-
width: ${
|
|
42445
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42446
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42380
42447
|
|
|
42381
42448
|
&:hover {
|
|
42382
42449
|
color: #ffffff;
|
|
@@ -42691,19 +42758,19 @@ function getAxis(fig, axisType) {
|
|
|
42691
42758
|
position = fig.y;
|
|
42692
42759
|
break;
|
|
42693
42760
|
case "bottom":
|
|
42694
|
-
position = fig.y + fig.height -
|
|
42761
|
+
position = fig.y + fig.height - FIGURE_BORDER_WIDTH;
|
|
42695
42762
|
break;
|
|
42696
42763
|
case "vCenter":
|
|
42697
|
-
position = fig.y + Math.floor(fig.height / 2) -
|
|
42764
|
+
position = fig.y + Math.floor(fig.height / 2) - FIGURE_BORDER_WIDTH;
|
|
42698
42765
|
break;
|
|
42699
42766
|
case "left":
|
|
42700
42767
|
position = fig.x;
|
|
42701
42768
|
break;
|
|
42702
42769
|
case "right":
|
|
42703
|
-
position = fig.x + fig.width -
|
|
42770
|
+
position = fig.x + fig.width - FIGURE_BORDER_WIDTH;
|
|
42704
42771
|
break;
|
|
42705
42772
|
case "hCenter":
|
|
42706
|
-
position = fig.x + Math.floor(fig.width / 2) -
|
|
42773
|
+
position = fig.x + Math.floor(fig.width / 2) - FIGURE_BORDER_WIDTH;
|
|
42707
42774
|
break;
|
|
42708
42775
|
}
|
|
42709
42776
|
return {
|
|
@@ -42960,7 +43027,7 @@ var FiguresContainer = class extends Component {
|
|
|
42960
43027
|
y
|
|
42961
43028
|
};
|
|
42962
43029
|
const keepRatio = figureRegistry.get(figure.tag).keepRatio || false;
|
|
42963
|
-
const minFigSize = figureRegistry.get(figure.tag).minFigSize ||
|
|
43030
|
+
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
42964
43031
|
const onMouseMove = (ev) => {
|
|
42965
43032
|
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, {
|
|
42966
43033
|
x: ev.clientX,
|
|
@@ -43051,8 +43118,8 @@ css`
|
|
|
43051
43118
|
display: flex;
|
|
43052
43119
|
align-items: center;
|
|
43053
43120
|
justify-content: center;
|
|
43054
|
-
width: ${
|
|
43055
|
-
height: ${
|
|
43121
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
43122
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
43056
43123
|
|
|
43057
43124
|
&:hover {
|
|
43058
43125
|
background: ${FILTERS_COLOR};
|
|
@@ -43679,9 +43746,9 @@ css`
|
|
|
43679
43746
|
.o-col-resizer {
|
|
43680
43747
|
position: absolute;
|
|
43681
43748
|
top: 0;
|
|
43682
|
-
left: ${
|
|
43683
|
-
right: ${
|
|
43684
|
-
height: ${
|
|
43749
|
+
left: ${HEADER_WIDTH}px;
|
|
43750
|
+
right: ${SCROLLBAR_WIDTH}px;
|
|
43751
|
+
height: ${HEADER_HEIGHT}px;
|
|
43685
43752
|
&.o-dragging {
|
|
43686
43753
|
cursor: grabbing;
|
|
43687
43754
|
}
|
|
@@ -43689,14 +43756,14 @@ css`
|
|
|
43689
43756
|
cursor: grab;
|
|
43690
43757
|
}
|
|
43691
43758
|
.dragging-col-line {
|
|
43692
|
-
top: ${
|
|
43759
|
+
top: ${HEADER_HEIGHT}px;
|
|
43693
43760
|
position: absolute;
|
|
43694
43761
|
width: 2px;
|
|
43695
43762
|
height: 10000px;
|
|
43696
43763
|
background-color: black;
|
|
43697
43764
|
}
|
|
43698
43765
|
.dragging-col-shadow {
|
|
43699
|
-
top: ${
|
|
43766
|
+
top: ${HEADER_HEIGHT}px;
|
|
43700
43767
|
position: absolute;
|
|
43701
43768
|
height: 10000px;
|
|
43702
43769
|
background-color: black;
|
|
@@ -43704,13 +43771,13 @@ css`
|
|
|
43704
43771
|
}
|
|
43705
43772
|
.o-handle {
|
|
43706
43773
|
position: absolute;
|
|
43707
|
-
height: ${
|
|
43774
|
+
height: ${HEADER_HEIGHT}px;
|
|
43708
43775
|
width: 4px;
|
|
43709
43776
|
cursor: e-resize;
|
|
43710
43777
|
background-color: ${SELECTION_BORDER_COLOR};
|
|
43711
43778
|
}
|
|
43712
43779
|
.dragging-resizer {
|
|
43713
|
-
top: ${
|
|
43780
|
+
top: ${HEADER_HEIGHT}px;
|
|
43714
43781
|
position: absolute;
|
|
43715
43782
|
margin-left: 2px;
|
|
43716
43783
|
width: 1px;
|
|
@@ -43735,7 +43802,7 @@ var ColResizer = class extends AbstractResizer {
|
|
|
43735
43802
|
this.colResizerRef = useRef("colResizer");
|
|
43736
43803
|
this.PADDING = 15;
|
|
43737
43804
|
this.MAX_SIZE_MARGIN = 90;
|
|
43738
|
-
this.MIN_ELEMENT_SIZE =
|
|
43805
|
+
this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
|
|
43739
43806
|
}
|
|
43740
43807
|
get sheetId() {
|
|
43741
43808
|
return this.env.model.getters.getActiveSheetId();
|
|
@@ -43834,10 +43901,10 @@ var ColResizer = class extends AbstractResizer {
|
|
|
43834
43901
|
css`
|
|
43835
43902
|
.o-row-resizer {
|
|
43836
43903
|
position: absolute;
|
|
43837
|
-
top: ${
|
|
43904
|
+
top: ${HEADER_HEIGHT}px;
|
|
43838
43905
|
left: 0;
|
|
43839
|
-
bottom: ${
|
|
43840
|
-
width: ${
|
|
43906
|
+
bottom: ${SCROLLBAR_WIDTH}px;
|
|
43907
|
+
width: ${HEADER_WIDTH}px;
|
|
43841
43908
|
&.o-dragging {
|
|
43842
43909
|
cursor: grabbing;
|
|
43843
43910
|
}
|
|
@@ -43845,14 +43912,14 @@ css`
|
|
|
43845
43912
|
cursor: grab;
|
|
43846
43913
|
}
|
|
43847
43914
|
.dragging-row-line {
|
|
43848
|
-
left: ${
|
|
43915
|
+
left: ${HEADER_WIDTH}px;
|
|
43849
43916
|
position: absolute;
|
|
43850
43917
|
width: 10000px;
|
|
43851
43918
|
height: 2px;
|
|
43852
43919
|
background-color: black;
|
|
43853
43920
|
}
|
|
43854
43921
|
.dragging-row-shadow {
|
|
43855
|
-
left: ${
|
|
43922
|
+
left: ${HEADER_WIDTH}px;
|
|
43856
43923
|
position: absolute;
|
|
43857
43924
|
width: 10000px;
|
|
43858
43925
|
background-color: black;
|
|
@@ -43861,12 +43928,12 @@ css`
|
|
|
43861
43928
|
.o-handle {
|
|
43862
43929
|
position: absolute;
|
|
43863
43930
|
height: 4px;
|
|
43864
|
-
width: ${
|
|
43931
|
+
width: ${HEADER_WIDTH}px;
|
|
43865
43932
|
cursor: n-resize;
|
|
43866
43933
|
background-color: ${SELECTION_BORDER_COLOR};
|
|
43867
43934
|
}
|
|
43868
43935
|
.dragging-resizer {
|
|
43869
|
-
left: ${
|
|
43936
|
+
left: ${HEADER_WIDTH}px;
|
|
43870
43937
|
position: absolute;
|
|
43871
43938
|
margin-top: 2px;
|
|
43872
43939
|
width: 10000px;
|
|
@@ -43890,7 +43957,7 @@ var RowResizer = class extends AbstractResizer {
|
|
|
43890
43957
|
this.rowResizerRef = useRef("rowResizer");
|
|
43891
43958
|
this.PADDING = 5;
|
|
43892
43959
|
this.MAX_SIZE_MARGIN = 60;
|
|
43893
|
-
this.MIN_ELEMENT_SIZE =
|
|
43960
|
+
this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
|
|
43894
43961
|
}
|
|
43895
43962
|
rowResizerRef;
|
|
43896
43963
|
get sheetId() {
|
|
@@ -43997,8 +44064,8 @@ css`
|
|
|
43997
44064
|
top: 0;
|
|
43998
44065
|
left: 0;
|
|
43999
44066
|
right: 0;
|
|
44000
|
-
width: ${
|
|
44001
|
-
height: ${
|
|
44067
|
+
width: ${HEADER_WIDTH}px;
|
|
44068
|
+
height: ${HEADER_HEIGHT}px;
|
|
44002
44069
|
}
|
|
44003
44070
|
}
|
|
44004
44071
|
`;
|
|
@@ -44033,7 +44100,7 @@ var GridRenderer = class {
|
|
|
44033
44100
|
*/
|
|
44034
44101
|
getHeaderOffset(dimension, start, index) {
|
|
44035
44102
|
let size = this.getters.getColRowOffsetInViewport(dimension, start, index);
|
|
44036
|
-
if (!this.getters.isDashboard()) size += dimension === "ROW" ?
|
|
44103
|
+
if (!this.getters.isDashboard()) size += dimension === "ROW" ? HEADER_HEIGHT : HEADER_WIDTH;
|
|
44037
44104
|
return size;
|
|
44038
44105
|
}
|
|
44039
44106
|
drawLayer(renderingContext, layer) {
|
|
@@ -44215,8 +44282,8 @@ var GridRenderer = class {
|
|
|
44215
44282
|
}
|
|
44216
44283
|
ctx.fillStyle = style.textColor || "#000";
|
|
44217
44284
|
let x = box.x;
|
|
44218
|
-
if (align === "left") x +=
|
|
44219
|
-
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);
|
|
44220
44287
|
else x += box.width / 2;
|
|
44221
44288
|
ctx.textAlign = align;
|
|
44222
44289
|
if (box.clipRect) {
|
|
@@ -44234,7 +44301,7 @@ var GridRenderer = class {
|
|
|
44234
44301
|
x: Math.round(x),
|
|
44235
44302
|
y: Math.round(y)
|
|
44236
44303
|
}, style.underline, style.strikethrough);
|
|
44237
|
-
y +=
|
|
44304
|
+
y += MIN_CELL_TEXT_MARGIN + textLineHeight;
|
|
44238
44305
|
}
|
|
44239
44306
|
if (box.clipRect) ctx.restore();
|
|
44240
44307
|
}
|
|
@@ -44252,7 +44319,7 @@ var GridRenderer = class {
|
|
|
44252
44319
|
}
|
|
44253
44320
|
const iconSize = box.image.size;
|
|
44254
44321
|
const y = this.computeTextYCoordinate(box, iconSize);
|
|
44255
|
-
ctx.drawImage(icon, box.x +
|
|
44322
|
+
ctx.drawImage(icon, box.x + MIN_CF_ICON_MARGIN, y, iconSize, iconSize);
|
|
44256
44323
|
if (box.image.clipIcon) ctx.restore();
|
|
44257
44324
|
}
|
|
44258
44325
|
}
|
|
@@ -44264,13 +44331,13 @@ var GridRenderer = class {
|
|
|
44264
44331
|
computeTextYCoordinate(box, textLineHeight, numberOfLines = 1) {
|
|
44265
44332
|
const y = box.y + 1;
|
|
44266
44333
|
const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
|
|
44267
|
-
const hasEnoughSpaces = box.height > textHeight +
|
|
44334
|
+
const hasEnoughSpaces = box.height > textHeight + MIN_CELL_TEXT_MARGIN * 2;
|
|
44268
44335
|
const verticalAlign = box.verticalAlign || DEFAULT_VERTICAL_ALIGN;
|
|
44269
44336
|
if (hasEnoughSpaces) {
|
|
44270
44337
|
if (verticalAlign === "middle") return y + (box.height - textHeight) / 2;
|
|
44271
|
-
if (verticalAlign === "bottom") return y + box.height - textHeight -
|
|
44338
|
+
if (verticalAlign === "bottom") return y + box.height - textHeight - MIN_CELL_TEXT_MARGIN;
|
|
44272
44339
|
}
|
|
44273
|
-
return y +
|
|
44340
|
+
return y + MIN_CELL_TEXT_MARGIN;
|
|
44274
44341
|
}
|
|
44275
44342
|
drawHeaders(renderingContext) {
|
|
44276
44343
|
const { ctx, thinLineWidth } = renderingContext;
|
|
@@ -44287,7 +44354,7 @@ var GridRenderer = class {
|
|
|
44287
44354
|
const numberOfRows = this.getters.getNumberRows(sheetId);
|
|
44288
44355
|
const activeCols = this.getters.getActiveCols();
|
|
44289
44356
|
const activeRows = this.getters.getActiveRows();
|
|
44290
|
-
ctx.font = `400 ${
|
|
44357
|
+
ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
44291
44358
|
ctx.textAlign = "center";
|
|
44292
44359
|
ctx.textBaseline = "middle";
|
|
44293
44360
|
ctx.lineWidth = thinLineWidth;
|
|
@@ -44305,7 +44372,7 @@ var GridRenderer = class {
|
|
|
44305
44372
|
if (isColActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
44306
44373
|
else if (isColSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
44307
44374
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
44308
|
-
ctx.fillRect(x, 0, width,
|
|
44375
|
+
ctx.fillRect(x, 0, width, HEADER_HEIGHT);
|
|
44309
44376
|
}
|
|
44310
44377
|
for (const row of visibleRows) {
|
|
44311
44378
|
const rowZone = {
|
|
@@ -44320,13 +44387,13 @@ var GridRenderer = class {
|
|
|
44320
44387
|
if (isRowActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
44321
44388
|
else if (isRowSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
44322
44389
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
44323
|
-
ctx.fillRect(0, y,
|
|
44390
|
+
ctx.fillRect(0, y, HEADER_WIDTH, height);
|
|
44324
44391
|
}
|
|
44325
44392
|
ctx.beginPath();
|
|
44326
|
-
ctx.moveTo(
|
|
44327
|
-
ctx.lineTo(
|
|
44328
|
-
ctx.moveTo(0,
|
|
44329
|
-
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);
|
|
44330
44397
|
ctx.strokeStyle = HEADER_BORDER_COLOR;
|
|
44331
44398
|
ctx.stroke();
|
|
44332
44399
|
ctx.beginPath();
|
|
@@ -44335,25 +44402,25 @@ var GridRenderer = class {
|
|
|
44335
44402
|
const colName = numberToLetters(col);
|
|
44336
44403
|
ctx.fillStyle = activeCols.has(col) ? "#fff" : TEXT_HEADER_COLOR;
|
|
44337
44404
|
const colStart = this.getHeaderOffset("COL", left, col);
|
|
44338
|
-
ctx.fillText(colName, colStart + colSize / 2,
|
|
44405
|
+
ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
|
|
44339
44406
|
ctx.moveTo(colStart + colSize, 0);
|
|
44340
|
-
ctx.lineTo(colStart + colSize,
|
|
44407
|
+
ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
|
|
44341
44408
|
}
|
|
44342
44409
|
for (const row of visibleRows) {
|
|
44343
44410
|
const rowSize = this.getters.getRowSize(sheetId, row);
|
|
44344
44411
|
ctx.fillStyle = activeRows.has(row) ? "#fff" : TEXT_HEADER_COLOR;
|
|
44345
44412
|
const rowStart = this.getHeaderOffset("ROW", top, row);
|
|
44346
|
-
ctx.fillText(String(row + 1),
|
|
44413
|
+
ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
|
|
44347
44414
|
ctx.moveTo(0, rowStart + rowSize);
|
|
44348
|
-
ctx.lineTo(
|
|
44415
|
+
ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
|
|
44349
44416
|
}
|
|
44350
44417
|
ctx.stroke();
|
|
44351
44418
|
}
|
|
44352
44419
|
drawFrozenPanesHeaders(renderingContext) {
|
|
44353
44420
|
const { ctx, thinLineWidth } = renderingContext;
|
|
44354
44421
|
const { x: offsetCorrectionX, y: offsetCorrectionY } = this.getters.getMainViewportCoordinates();
|
|
44355
|
-
const widthCorrection = this.getters.isDashboard() ? 0 :
|
|
44356
|
-
const heightCorrection = this.getters.isDashboard() ? 0 :
|
|
44422
|
+
const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
|
|
44423
|
+
const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
|
|
44357
44424
|
ctx.lineWidth = 6 * thinLineWidth;
|
|
44358
44425
|
ctx.strokeStyle = FROZEN_PANE_HEADER_BORDER_COLOR;
|
|
44359
44426
|
ctx.beginPath();
|
|
@@ -44381,8 +44448,8 @@ var GridRenderer = class {
|
|
|
44381
44448
|
bottom: visibleRows[visibleRows.length - 1]
|
|
44382
44449
|
};
|
|
44383
44450
|
const rect = this.getters.getVisibleRect(viewport);
|
|
44384
|
-
const widthCorrection = this.getters.isDashboard() ? 0 :
|
|
44385
|
-
const heightCorrection = this.getters.isDashboard() ? 0 :
|
|
44451
|
+
const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
|
|
44452
|
+
const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
|
|
44386
44453
|
ctx.lineWidth = 6 * thinLineWidth;
|
|
44387
44454
|
ctx.strokeStyle = FROZEN_PANE_BORDER_COLOR;
|
|
44388
44455
|
ctx.beginPath();
|
|
@@ -44466,7 +44533,7 @@ var GridRenderer = class {
|
|
|
44466
44533
|
/** Icon */
|
|
44467
44534
|
const iconSrc = this.getters.getCellIconSrc(position);
|
|
44468
44535
|
const fontSizePX = computeTextFontSizeInPixels(box.style);
|
|
44469
|
-
const iconBoxWidth = iconSrc ?
|
|
44536
|
+
const iconBoxWidth = iconSrc ? MIN_CF_ICON_MARGIN + fontSizePX : 0;
|
|
44470
44537
|
if (iconSrc) {
|
|
44471
44538
|
const imageHtmlElement = loadIconImage(iconSrc);
|
|
44472
44539
|
box.image = {
|
|
@@ -44484,19 +44551,19 @@ var GridRenderer = class {
|
|
|
44484
44551
|
if (cell.type === "empty" || this.getters.isCellValidCheckbox(position)) return box;
|
|
44485
44552
|
/** Filter Header or data validation icon */
|
|
44486
44553
|
box.hasIcon = this.getters.doesCellHaveGridIcon(position);
|
|
44487
|
-
const headerIconWidth = box.hasIcon ?
|
|
44554
|
+
const headerIconWidth = box.hasIcon ? GRID_ICON_EDGE_LENGTH + GRID_ICON_MARGIN : 0;
|
|
44488
44555
|
/** Content */
|
|
44489
44556
|
const style = this.getters.getCellComputedStyle(position);
|
|
44490
44557
|
const wrapping = style.wrapping || "overflow";
|
|
44491
44558
|
const wrapText = wrapping === "wrap" && !showFormula;
|
|
44492
|
-
const maxWidth = width - 2 *
|
|
44559
|
+
const maxWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
|
|
44493
44560
|
const formatWidth = style.align ? 0 : maxWidth;
|
|
44494
44561
|
const multiLineText = this.getters.getCellMultiLineText(position, {
|
|
44495
44562
|
maxWidth,
|
|
44496
44563
|
formatWidth,
|
|
44497
44564
|
wrapText
|
|
44498
44565
|
});
|
|
44499
|
-
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));
|
|
44500
44567
|
const contentWidth = iconBoxWidth + textWidth + headerIconWidth;
|
|
44501
44568
|
const align = this.computeCellAlignment(position, contentWidth > width);
|
|
44502
44569
|
box.content = {
|
|
@@ -44708,7 +44775,7 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
44708
44775
|
resetTimeout = setTimeout(() => {
|
|
44709
44776
|
velocityX = 0;
|
|
44710
44777
|
velocityY = 0;
|
|
44711
|
-
},
|
|
44778
|
+
}, resetTimeoutDuration);
|
|
44712
44779
|
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
44713
44780
|
}
|
|
44714
44781
|
function onTouchEnd(ev) {
|
|
@@ -44739,7 +44806,7 @@ function useTouchScroll(ref, updateScroll, canMoveUp) {
|
|
|
44739
44806
|
//#region src/components/helpers/wheel_hook.ts
|
|
44740
44807
|
function useWheelHandler(handler) {
|
|
44741
44808
|
function normalize(val, deltaMode) {
|
|
44742
|
-
return val * (deltaMode === 0 ? 1 :
|
|
44809
|
+
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
44743
44810
|
}
|
|
44744
44811
|
const onMouseWheel = (ev) => {
|
|
44745
44812
|
handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
|
|
@@ -44855,8 +44922,8 @@ var Corner = class extends Component {
|
|
|
44855
44922
|
const leftValue = this.isLeft ? rect.x : rect.x + rect.width;
|
|
44856
44923
|
const topValue = this.isTop ? rect.y : rect.y + rect.height;
|
|
44857
44924
|
return cssPropertiesToCss({
|
|
44858
|
-
left: `${leftValue -
|
|
44859
|
-
top: `${topValue -
|
|
44925
|
+
left: `${leftValue - AUTOFILL_EDGE_LENGTH / 2}px`,
|
|
44926
|
+
top: `${topValue - AUTOFILL_EDGE_LENGTH / 2}px`,
|
|
44860
44927
|
"background-color": this.props.color
|
|
44861
44928
|
});
|
|
44862
44929
|
}
|
|
@@ -44996,8 +45063,8 @@ css`
|
|
|
44996
45063
|
&.corner {
|
|
44997
45064
|
right: 0px;
|
|
44998
45065
|
bottom: 0px;
|
|
44999
|
-
height: ${
|
|
45000
|
-
width: ${
|
|
45066
|
+
height: ${SCROLLBAR_WIDTH}px;
|
|
45067
|
+
width: ${SCROLLBAR_WIDTH}px;
|
|
45001
45068
|
border-top: 1px solid #e2e3e3;
|
|
45002
45069
|
border-left: 1px solid #e2e3e3;
|
|
45003
45070
|
}
|
|
@@ -45090,7 +45157,7 @@ var HorizontalScrollBar = class extends Component {
|
|
|
45090
45157
|
return {
|
|
45091
45158
|
left: `${this.props.leftOffset + x}px`,
|
|
45092
45159
|
bottom: "0px",
|
|
45093
|
-
height: `${
|
|
45160
|
+
height: `${SCROLLBAR_WIDTH}px`,
|
|
45094
45161
|
right: `0px`
|
|
45095
45162
|
};
|
|
45096
45163
|
}
|
|
@@ -45136,7 +45203,7 @@ var VerticalScrollBar = class extends Component {
|
|
|
45136
45203
|
return {
|
|
45137
45204
|
top: `${this.props.topOffset + y}px`,
|
|
45138
45205
|
right: "0px",
|
|
45139
|
-
width: `${
|
|
45206
|
+
width: `${SCROLLBAR_WIDTH}px`,
|
|
45140
45207
|
bottom: `0px`
|
|
45141
45208
|
};
|
|
45142
45209
|
}
|
|
@@ -45163,7 +45230,7 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
45163
45230
|
];
|
|
45164
45231
|
currentPanelProps = {};
|
|
45165
45232
|
componentTag = "";
|
|
45166
|
-
panelSize =
|
|
45233
|
+
panelSize = DEFAULT_SIDE_PANEL_SIZE;
|
|
45167
45234
|
get isOpen() {
|
|
45168
45235
|
if (!this.componentTag) return false;
|
|
45169
45236
|
return this.computeState(this.componentTag, this.currentPanelProps).isOpen;
|
|
@@ -45194,12 +45261,12 @@ var SidePanelStore = class extends SpreadsheetStore {
|
|
|
45194
45261
|
this.componentTag = "";
|
|
45195
45262
|
}
|
|
45196
45263
|
changePanelSize(size, spreadsheetElWidth) {
|
|
45197
|
-
if (size <
|
|
45198
|
-
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);
|
|
45199
45266
|
else this.panelSize = size;
|
|
45200
45267
|
}
|
|
45201
45268
|
resetPanelSize() {
|
|
45202
|
-
this.panelSize =
|
|
45269
|
+
this.panelSize = DEFAULT_SIDE_PANEL_SIZE;
|
|
45203
45270
|
}
|
|
45204
45271
|
computeState(componentTag, panelProps) {
|
|
45205
45272
|
const customComputeState = sidePanelRegistry.get(componentTag).computeState;
|
|
@@ -45315,8 +45382,8 @@ var Grid = class extends Component {
|
|
|
45315
45382
|
HorizontalScrollBar,
|
|
45316
45383
|
TableResizer
|
|
45317
45384
|
};
|
|
45318
|
-
HEADER_HEIGHT =
|
|
45319
|
-
HEADER_WIDTH =
|
|
45385
|
+
HEADER_HEIGHT = HEADER_HEIGHT;
|
|
45386
|
+
HEADER_WIDTH = HEADER_WIDTH;
|
|
45320
45387
|
menuState;
|
|
45321
45388
|
gridRef;
|
|
45322
45389
|
highlightStore;
|
|
@@ -45374,10 +45441,10 @@ var Grid = class extends Component {
|
|
|
45374
45441
|
}
|
|
45375
45442
|
get gridOverlayDimensions() {
|
|
45376
45443
|
return cssPropertiesToCss({
|
|
45377
|
-
top: `${
|
|
45378
|
-
left: `${
|
|
45379
|
-
height: `calc(100% - ${
|
|
45380
|
-
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)`
|
|
45381
45448
|
});
|
|
45382
45449
|
}
|
|
45383
45450
|
onClosePopover() {
|
|
@@ -45550,8 +45617,8 @@ var Grid = class extends Component {
|
|
|
45550
45617
|
const zone = this.env.model.getters.getSelectedZone();
|
|
45551
45618
|
const rect = this.env.model.getters.getVisibleRect(zone);
|
|
45552
45619
|
return {
|
|
45553
|
-
left: rect.x + rect.width -
|
|
45554
|
-
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
|
|
45555
45622
|
};
|
|
45556
45623
|
}
|
|
45557
45624
|
get isAutofillVisible() {
|
|
@@ -45568,8 +45635,8 @@ var Grid = class extends Component {
|
|
|
45568
45635
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
45569
45636
|
width,
|
|
45570
45637
|
height,
|
|
45571
|
-
gridOffsetX:
|
|
45572
|
-
gridOffsetY:
|
|
45638
|
+
gridOffsetX: HEADER_WIDTH,
|
|
45639
|
+
gridOffsetY: HEADER_HEIGHT
|
|
45573
45640
|
});
|
|
45574
45641
|
}
|
|
45575
45642
|
moveCanvas(deltaX, deltaY) {
|
|
@@ -47305,8 +47372,8 @@ var ChartPlugin = class extends CorePlugin {
|
|
|
47305
47372
|
case "DUPLICATE_SHEET": {
|
|
47306
47373
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
47307
47374
|
for (const fig of sheetFiguresFrom) if (fig.tag === "chart") {
|
|
47308
|
-
const figureIdBase = fig.id.split(
|
|
47309
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
47375
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
47376
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
47310
47377
|
const chart = this.charts[fig.id]?.copyForSheetId(cmd.sheetIdTo);
|
|
47311
47378
|
if (chart) this.dispatch("CREATE_CHART", {
|
|
47312
47379
|
id: duplicatedFigureId,
|
|
@@ -47383,8 +47450,8 @@ var ChartPlugin = class extends CorePlugin {
|
|
|
47383
47450
|
x: 0,
|
|
47384
47451
|
y: 0
|
|
47385
47452
|
}, size = {
|
|
47386
|
-
width:
|
|
47387
|
-
height:
|
|
47453
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
47454
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
47388
47455
|
}) {
|
|
47389
47456
|
if (this.getters.getFigure(sheetId, id)) return;
|
|
47390
47457
|
const figure = {
|
|
@@ -48026,7 +48093,7 @@ var FigurePlugin = class extends CorePlugin {
|
|
|
48026
48093
|
onRowDeletion(sheetId) {
|
|
48027
48094
|
const numHeader = this.getters.getNumberRows(sheetId);
|
|
48028
48095
|
let gridHeight = 0;
|
|
48029
|
-
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;
|
|
48030
48097
|
const figures = this.getters.getFigures(sheetId);
|
|
48031
48098
|
for (const figure of figures) {
|
|
48032
48099
|
const newY = Math.min(figure.y, gridHeight - figure.height);
|
|
@@ -48157,7 +48224,7 @@ var HeaderSizePlugin = class extends CorePlugin {
|
|
|
48157
48224
|
}
|
|
48158
48225
|
}
|
|
48159
48226
|
getColSize(sheetId, index) {
|
|
48160
|
-
return Math.round(this.sizes[sheetId]?.["COL"][index] ||
|
|
48227
|
+
return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
|
|
48161
48228
|
}
|
|
48162
48229
|
getUserRowSize(sheetId, index) {
|
|
48163
48230
|
const rowSize = this.sizes[sheetId]?.["ROW"][index];
|
|
@@ -48190,7 +48257,7 @@ var HeaderSizePlugin = class extends CorePlugin {
|
|
|
48190
48257
|
if (sheet.rows === void 0) sheet.rows = {};
|
|
48191
48258
|
for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
|
|
48192
48259
|
...sheet.rows[row],
|
|
48193
|
-
size: this.getUserRowSize(sheet.id, row) ??
|
|
48260
|
+
size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
|
|
48194
48261
|
};
|
|
48195
48262
|
if (sheet.cols === void 0) sheet.cols = {};
|
|
48196
48263
|
for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
|
|
@@ -48371,8 +48438,8 @@ var ImagePlugin = class extends CorePlugin {
|
|
|
48371
48438
|
case "DUPLICATE_SHEET": {
|
|
48372
48439
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
48373
48440
|
for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
|
|
48374
|
-
const figureIdBase = fig.id.split(
|
|
48375
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
48441
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
48442
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
48376
48443
|
const image = this.getImage(fig.id);
|
|
48377
48444
|
if (image) {
|
|
48378
48445
|
const size = {
|
|
@@ -52679,7 +52746,7 @@ var EvaluationChartPlugin = class extends UIPlugin {
|
|
|
52679
52746
|
col,
|
|
52680
52747
|
row
|
|
52681
52748
|
});
|
|
52682
|
-
const background = style.fillColor ||
|
|
52749
|
+
const background = style.fillColor || BACKGROUND_CHART_COLOR;
|
|
52683
52750
|
return {
|
|
52684
52751
|
background,
|
|
52685
52752
|
fontColor: style.textColor || chartFontColor(background)
|
|
@@ -53376,7 +53443,7 @@ var HeaderSizeUIPlugin = class extends UIPlugin {
|
|
|
53376
53443
|
}
|
|
53377
53444
|
}
|
|
53378
53445
|
getRowSize(sheetId, row) {
|
|
53379
|
-
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);
|
|
53380
53447
|
}
|
|
53381
53448
|
getHeaderSize(sheetId, dimension, index) {
|
|
53382
53449
|
if (this.getters.isHeaderHidden(sheetId, dimension, index)) return 0;
|
|
@@ -53393,8 +53460,8 @@ var HeaderSizeUIPlugin = class extends UIPlugin {
|
|
|
53393
53460
|
col,
|
|
53394
53461
|
row
|
|
53395
53462
|
});
|
|
53396
|
-
if (updatedCellHeight <=
|
|
53397
|
-
if (!tallestCellInRow && updatedCellHeight >
|
|
53463
|
+
if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
|
|
53464
|
+
if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
|
|
53398
53465
|
const newTallestCell = {
|
|
53399
53466
|
cell: {
|
|
53400
53467
|
sheetId,
|
|
@@ -53419,7 +53486,7 @@ var HeaderSizeUIPlugin = class extends UIPlugin {
|
|
|
53419
53486
|
* merge, or the height of the cell computed based on its style/content.
|
|
53420
53487
|
*/
|
|
53421
53488
|
getCellHeight(position) {
|
|
53422
|
-
if (this.isInMultiRowMerge(position)) return
|
|
53489
|
+
if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
|
|
53423
53490
|
const cell = this.getters.getCell(position);
|
|
53424
53491
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
53425
53492
|
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
@@ -53441,7 +53508,7 @@ var HeaderSizeUIPlugin = class extends UIPlugin {
|
|
|
53441
53508
|
if (!cell) continue;
|
|
53442
53509
|
const position = this.getters.getCellPosition(cell.id);
|
|
53443
53510
|
const cellHeight = this.getCellHeight(position);
|
|
53444
|
-
if (cellHeight > maxHeight && cellHeight >
|
|
53511
|
+
if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
|
|
53445
53512
|
maxHeight = cellHeight;
|
|
53446
53513
|
tallestCell = {
|
|
53447
53514
|
cell: position,
|
|
@@ -53449,7 +53516,7 @@ var HeaderSizeUIPlugin = class extends UIPlugin {
|
|
|
53449
53516
|
};
|
|
53450
53517
|
}
|
|
53451
53518
|
}
|
|
53452
|
-
if (tallestCell && tallestCell.size >
|
|
53519
|
+
if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
|
|
53453
53520
|
}
|
|
53454
53521
|
};
|
|
53455
53522
|
|
|
@@ -53837,7 +53904,7 @@ function pivot_presentation_default(PivotClass) {
|
|
|
53837
53904
|
* @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
|
|
53838
53905
|
*/
|
|
53839
53906
|
getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
|
|
53840
|
-
const comparedDomain = valueToCompare ===
|
|
53907
|
+
const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
|
|
53841
53908
|
if (deepEquals(comparedDomain, domain)) return "sameValue";
|
|
53842
53909
|
if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
|
|
53843
53910
|
const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
|
|
@@ -55312,7 +55379,7 @@ var Session = class extends EventBus {
|
|
|
55312
55379
|
this.revisions = revisions;
|
|
55313
55380
|
this.transportService = transportService;
|
|
55314
55381
|
this.serverRevisionId = serverRevisionId;
|
|
55315
|
-
this.debouncedMove = debounce(this._move.bind(this),
|
|
55382
|
+
this.debouncedMove = debounce(this._move.bind(this), DEBOUNCE_TIME);
|
|
55316
55383
|
}
|
|
55317
55384
|
canApplyOptimisticUpdate() {
|
|
55318
55385
|
return !this.waitingUndoRedoAck;
|
|
@@ -55329,7 +55396,7 @@ var Session = class extends EventBus {
|
|
|
55329
55396
|
this.trigger("new-local-state-update", { id: revision.id });
|
|
55330
55397
|
this.sendUpdateMessage({
|
|
55331
55398
|
type: "REMOTE_REVISION",
|
|
55332
|
-
version:
|
|
55399
|
+
version: MESSAGE_VERSION,
|
|
55333
55400
|
serverRevisionId: this.serverRevisionId,
|
|
55334
55401
|
nextRevisionId: revision.id,
|
|
55335
55402
|
clientId: revision.clientId,
|
|
@@ -55340,7 +55407,7 @@ var Session = class extends EventBus {
|
|
|
55340
55407
|
this.waitingUndoRedoAck = true;
|
|
55341
55408
|
this.sendUpdateMessage({
|
|
55342
55409
|
type: "REVISION_UNDONE",
|
|
55343
|
-
version:
|
|
55410
|
+
version: MESSAGE_VERSION,
|
|
55344
55411
|
serverRevisionId: this.serverRevisionId,
|
|
55345
55412
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
55346
55413
|
undoneRevisionId: revisionId
|
|
@@ -55350,7 +55417,7 @@ var Session = class extends EventBus {
|
|
|
55350
55417
|
this.waitingUndoRedoAck = true;
|
|
55351
55418
|
this.sendUpdateMessage({
|
|
55352
55419
|
type: "REVISION_REDONE",
|
|
55353
|
-
version:
|
|
55420
|
+
version: MESSAGE_VERSION,
|
|
55354
55421
|
serverRevisionId: this.serverRevisionId,
|
|
55355
55422
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
55356
55423
|
redoneRevisionId: revisionId
|
|
@@ -55393,7 +55460,7 @@ var Session = class extends EventBus {
|
|
|
55393
55460
|
this.transportService.sendMessage({
|
|
55394
55461
|
type: "CLIENT_LEFT",
|
|
55395
55462
|
clientId: this.clientId,
|
|
55396
|
-
version:
|
|
55463
|
+
version: MESSAGE_VERSION
|
|
55397
55464
|
});
|
|
55398
55465
|
}
|
|
55399
55466
|
/**
|
|
@@ -55410,7 +55477,7 @@ var Session = class extends EventBus {
|
|
|
55410
55477
|
...data,
|
|
55411
55478
|
revisionId: snapshotId
|
|
55412
55479
|
},
|
|
55413
|
-
version:
|
|
55480
|
+
version: MESSAGE_VERSION
|
|
55414
55481
|
});
|
|
55415
55482
|
}
|
|
55416
55483
|
getClient() {
|
|
@@ -55445,7 +55512,7 @@ var Session = class extends EventBus {
|
|
|
55445
55512
|
};
|
|
55446
55513
|
this.transportService.sendMessage({
|
|
55447
55514
|
type,
|
|
55448
|
-
version:
|
|
55515
|
+
version: MESSAGE_VERSION,
|
|
55449
55516
|
client: {
|
|
55450
55517
|
...client,
|
|
55451
55518
|
position
|
|
@@ -55522,7 +55589,7 @@ var Session = class extends EventBus {
|
|
|
55522
55589
|
const { position } = client;
|
|
55523
55590
|
if (position) this.transportService.sendMessage({
|
|
55524
55591
|
type: "CLIENT_MOVED",
|
|
55525
|
-
version:
|
|
55592
|
+
version: MESSAGE_VERSION,
|
|
55526
55593
|
client: {
|
|
55527
55594
|
...client,
|
|
55528
55595
|
position
|
|
@@ -56442,9 +56509,9 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
56442
56509
|
contentWidth += Math.max(...multiLineText.map((line) => computeTextWidth(this.ctx, line, style)));
|
|
56443
56510
|
}
|
|
56444
56511
|
if (this.getters.getCellIconSrc(position)) contentWidth += computeIconWidth(style);
|
|
56445
|
-
if (this.getters.doesCellHaveGridIcon(position)) contentWidth +=
|
|
56512
|
+
if (this.getters.doesCellHaveGridIcon(position)) contentWidth += ICON_EDGE_LENGTH + GRID_ICON_MARGIN;
|
|
56446
56513
|
if (contentWidth === 0) return 0;
|
|
56447
|
-
contentWidth += 2 *
|
|
56514
|
+
contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
|
|
56448
56515
|
if (style.wrapping === "wrap") {
|
|
56449
56516
|
const colWidth = this.getters.getColSize(position.sheetId, position.col);
|
|
56450
56517
|
return Math.min(colWidth, contentWidth);
|
|
@@ -56600,11 +56667,11 @@ var SheetUIPlugin = class extends UIPlugin {
|
|
|
56600
56667
|
if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
|
|
56601
56668
|
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
56602
56669
|
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
56603
|
-
if (evaluatedSize > evaluatedRowSize && evaluatedSize >
|
|
56670
|
+
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = evaluatedSize;
|
|
56604
56671
|
} else {
|
|
56605
56672
|
const content = cell.content;
|
|
56606
56673
|
const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
56607
|
-
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize >
|
|
56674
|
+
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = 0;
|
|
56608
56675
|
}
|
|
56609
56676
|
}
|
|
56610
56677
|
rowSizes.push(evaluatedRowSize || null);
|
|
@@ -57144,7 +57211,7 @@ var HistoryPlugin = class extends UIPlugin {
|
|
|
57144
57211
|
onNewLocalStateUpdate({ id }) {
|
|
57145
57212
|
this.undoStack.push(id);
|
|
57146
57213
|
this.redoStack = [];
|
|
57147
|
-
if (this.undoStack.length >
|
|
57214
|
+
if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
|
|
57148
57215
|
}
|
|
57149
57216
|
/**
|
|
57150
57217
|
* Fetch the last revision which is not empty and not a repeated command
|
|
@@ -57239,7 +57306,7 @@ var SplitToColumnsPlugin = class extends UIPlugin {
|
|
|
57239
57306
|
}
|
|
57240
57307
|
getAutoSeparatorForString(str) {
|
|
57241
57308
|
const separators = [
|
|
57242
|
-
|
|
57309
|
+
NEWLINE,
|
|
57243
57310
|
";",
|
|
57244
57311
|
",",
|
|
57245
57312
|
" ",
|
|
@@ -57564,7 +57631,7 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
57564
57631
|
case "PASTE_FROM_OS_CLIPBOARD": {
|
|
57565
57632
|
this._isCutOperation = false;
|
|
57566
57633
|
let contentToPaste = cmd.clipboardContent;
|
|
57567
|
-
if (contentToPaste.data?.version !==
|
|
57634
|
+
if (contentToPaste.data?.version !== CURRENT_VERSION) {
|
|
57568
57635
|
contentToPaste = { ...contentToPaste };
|
|
57569
57636
|
delete contentToPaste.data;
|
|
57570
57637
|
}
|
|
@@ -57799,7 +57866,7 @@ var ClipboardPlugin = class extends UIPlugin {
|
|
|
57799
57866
|
}
|
|
57800
57867
|
getSheetData() {
|
|
57801
57868
|
const data = {
|
|
57802
|
-
version:
|
|
57869
|
+
version: CURRENT_VERSION,
|
|
57803
57870
|
clipboardId: this.clipboardId
|
|
57804
57871
|
};
|
|
57805
57872
|
if (this.copiedData && "figureId" in this.copiedData) return data;
|
|
@@ -58522,7 +58589,7 @@ var GridSelectionPlugin = class extends UIPlugin {
|
|
|
58522
58589
|
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
58523
58590
|
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
58524
58591
|
const size = isCol ? this.getters.getColSize(cmd.sheetId, element) : this.getters.getUserRowSize(cmd.sheetId, element);
|
|
58525
|
-
return [element, isCol && size ===
|
|
58592
|
+
return [element, isCol && size === DEFAULT_CELL_WIDTH || size === void 0 ? null : size];
|
|
58526
58593
|
}));
|
|
58527
58594
|
const target = [{
|
|
58528
58595
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -58737,14 +58804,14 @@ var InternalViewport = class {
|
|
|
58737
58804
|
const topRowSize = this.getters.getRowSize(this.sheetId, topRowIndex);
|
|
58738
58805
|
let width = lastColEnd - this.offsetCorrectionX;
|
|
58739
58806
|
if (this.canScrollHorizontally) {
|
|
58740
|
-
width += Math.max(
|
|
58807
|
+
width += Math.max(DEFAULT_CELL_WIDTH, Math.min(leftColSize, this.viewportWidth - lastColSize));
|
|
58741
58808
|
width = Math.max(width, this.viewportWidth);
|
|
58742
58809
|
}
|
|
58743
58810
|
let height = lastRowEnd - this.offsetCorrectionY;
|
|
58744
58811
|
if (this.canScrollVertically) {
|
|
58745
|
-
height += Math.max(
|
|
58812
|
+
height += Math.max(DEFAULT_CELL_HEIGHT + 5, Math.min(topRowSize, this.viewportHeight - lastRowSize));
|
|
58746
58813
|
height = Math.max(height, this.viewportHeight);
|
|
58747
|
-
if (lastRowEnd +
|
|
58814
|
+
if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly()) height += FOOTER_HEIGHT;
|
|
58748
58815
|
}
|
|
58749
58816
|
return {
|
|
58750
58817
|
width,
|
|
@@ -60045,7 +60112,7 @@ css`
|
|
|
60045
60112
|
.o-sheet {
|
|
60046
60113
|
padding: 0 15px;
|
|
60047
60114
|
padding-right: 10px;
|
|
60048
|
-
height: ${
|
|
60115
|
+
height: ${BOTTOMBAR_HEIGHT}px;
|
|
60049
60116
|
border-left: 1px solid #c1c1c1;
|
|
60050
60117
|
border-right: 1px solid #c1c1c1;
|
|
60051
60118
|
margin-left: -1px;
|
|
@@ -60418,7 +60485,7 @@ const MENU_MAX_HEIGHT = 250;
|
|
|
60418
60485
|
css`
|
|
60419
60486
|
.o-spreadsheet-bottom-bar {
|
|
60420
60487
|
background-color: ${BACKGROUND_GRAY_COLOR};
|
|
60421
|
-
padding-left: ${
|
|
60488
|
+
padding-left: ${HEADER_WIDTH}px;
|
|
60422
60489
|
font-size: 15px;
|
|
60423
60490
|
border-top: 1px solid lightgrey;
|
|
60424
60491
|
|
|
@@ -60918,16 +60985,16 @@ var RowGroup = class extends AbstractHeaderGroup {
|
|
|
60918
60985
|
const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
|
|
60919
60986
|
const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
|
|
60920
60987
|
let groupHeaderY = 0;
|
|
60921
|
-
let groupHeaderHeight =
|
|
60988
|
+
let groupHeaderHeight = HEADER_HEIGHT;
|
|
60922
60989
|
if (startRow !== 0) {
|
|
60923
60990
|
const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
|
|
60924
|
-
groupHeaderY =
|
|
60991
|
+
groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
|
|
60925
60992
|
groupHeaderHeight = headerRowDims.end - headerRowDims.start;
|
|
60926
60993
|
}
|
|
60927
60994
|
const headerRect = {
|
|
60928
60995
|
x: this.props.layerOffset,
|
|
60929
60996
|
y: groupHeaderY,
|
|
60930
|
-
width:
|
|
60997
|
+
width: GROUP_LAYER_WIDTH,
|
|
60931
60998
|
height: groupHeaderHeight
|
|
60932
60999
|
};
|
|
60933
61000
|
return {
|
|
@@ -60935,7 +61002,7 @@ var RowGroup = class extends AbstractHeaderGroup {
|
|
|
60935
61002
|
groupRect: {
|
|
60936
61003
|
x: this.props.layerOffset,
|
|
60937
61004
|
y: headerRect.y,
|
|
60938
|
-
width:
|
|
61005
|
+
width: GROUP_LAYER_WIDTH,
|
|
60939
61006
|
height: headerRect.height + (endCoordinates - startCoordinates)
|
|
60940
61007
|
},
|
|
60941
61008
|
isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
|
|
@@ -60968,17 +61035,17 @@ var ColGroup = class extends AbstractHeaderGroup {
|
|
|
60968
61035
|
const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
|
|
60969
61036
|
const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
|
|
60970
61037
|
let groupHeaderX = 0;
|
|
60971
|
-
let groupHeaderWidth =
|
|
61038
|
+
let groupHeaderWidth = HEADER_WIDTH;
|
|
60972
61039
|
if (startCol !== 0) {
|
|
60973
61040
|
const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
|
|
60974
|
-
groupHeaderX =
|
|
61041
|
+
groupHeaderX = HEADER_WIDTH + headerRowDims.start;
|
|
60975
61042
|
groupHeaderWidth = headerRowDims.end - headerRowDims.start;
|
|
60976
61043
|
}
|
|
60977
61044
|
const headerRect = {
|
|
60978
61045
|
x: groupHeaderX,
|
|
60979
61046
|
y: this.props.layerOffset,
|
|
60980
61047
|
width: groupHeaderWidth,
|
|
60981
|
-
height:
|
|
61048
|
+
height: GROUP_LAYER_WIDTH
|
|
60982
61049
|
};
|
|
60983
61050
|
return {
|
|
60984
61051
|
headerRect,
|
|
@@ -60986,7 +61053,7 @@ var ColGroup = class extends AbstractHeaderGroup {
|
|
|
60986
61053
|
x: headerRect.x,
|
|
60987
61054
|
y: this.props.layerOffset,
|
|
60988
61055
|
width: headerRect.width + (endCoordinates - startCoordinates),
|
|
60989
|
-
height:
|
|
61056
|
+
height: GROUP_LAYER_WIDTH
|
|
60990
61057
|
},
|
|
60991
61058
|
isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
|
|
60992
61059
|
};
|
|
@@ -61033,7 +61100,7 @@ var HeaderGroupContainer = class extends Component {
|
|
|
61033
61100
|
menuItems: []
|
|
61034
61101
|
});
|
|
61035
61102
|
getLayerOffset(layerIndex) {
|
|
61036
|
-
return layerIndex *
|
|
61103
|
+
return layerIndex * GROUP_LAYER_WIDTH;
|
|
61037
61104
|
}
|
|
61038
61105
|
onContextMenu(event) {
|
|
61039
61106
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -61077,8 +61144,8 @@ var HeaderGroupContainer = class extends Component {
|
|
|
61077
61144
|
get frozenPaneContainerSize() {
|
|
61078
61145
|
if (!this.hasFrozenPane) return 0;
|
|
61079
61146
|
const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
|
|
61080
|
-
if (this.props.dimension === "COL") return
|
|
61081
|
-
else return
|
|
61147
|
+
if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
|
|
61148
|
+
else return HEADER_HEIGHT + viewportCoordinates.y;
|
|
61082
61149
|
}
|
|
61083
61150
|
};
|
|
61084
61151
|
|
|
@@ -61597,7 +61664,7 @@ var TopBarComposer = class extends Component {
|
|
|
61597
61664
|
"max-height": `${COMPOSER_MAX_HEIGHT}px`,
|
|
61598
61665
|
"line-height": "24px"
|
|
61599
61666
|
};
|
|
61600
|
-
style.height = this.focus === "inactive" ? `${
|
|
61667
|
+
style.height = this.focus === "inactive" ? `${TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
|
|
61601
61668
|
return cssPropertiesToCss(style);
|
|
61602
61669
|
}
|
|
61603
61670
|
get containerStyle() {
|
|
@@ -61805,7 +61872,7 @@ css`
|
|
|
61805
61872
|
|
|
61806
61873
|
/* Toolbar */
|
|
61807
61874
|
.o-topbar-toolbar {
|
|
61808
|
-
height: ${
|
|
61875
|
+
height: ${TOPBAR_TOOLBAR_HEIGHT}px;
|
|
61809
61876
|
|
|
61810
61877
|
.o-readonly-toolbar {
|
|
61811
61878
|
background-color: ${BACKGROUND_HEADER_COLOR};
|
|
@@ -62072,9 +62139,9 @@ css`
|
|
|
62072
62139
|
direction: ltr;
|
|
62073
62140
|
}
|
|
62074
62141
|
.o-separator {
|
|
62075
|
-
border-bottom: ${
|
|
62076
|
-
margin-top: ${
|
|
62077
|
-
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;
|
|
62078
62145
|
}
|
|
62079
62146
|
.o-hoverable-button {
|
|
62080
62147
|
border-radius: 2px;
|
|
@@ -62201,8 +62268,8 @@ css`
|
|
|
62201
62268
|
&.corner {
|
|
62202
62269
|
right: 0px;
|
|
62203
62270
|
bottom: 0px;
|
|
62204
|
-
height: ${
|
|
62205
|
-
width: ${
|
|
62271
|
+
height: ${SCROLLBAR_WIDTH}px;
|
|
62272
|
+
width: ${SCROLLBAR_WIDTH}px;
|
|
62206
62273
|
border-top: 1px solid #e2e3e3;
|
|
62207
62274
|
border-left: 1px solid #e2e3e3;
|
|
62208
62275
|
}
|
|
@@ -62328,7 +62395,7 @@ var Spreadsheet = class extends Component {
|
|
|
62328
62395
|
getStyle() {
|
|
62329
62396
|
const properties = {};
|
|
62330
62397
|
if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
|
|
62331
|
-
else properties["grid-template-rows"] = `${
|
|
62398
|
+
else properties["grid-template-rows"] = `${TOPBAR_HEIGHT}px auto ${BOTTOMBAR_HEIGHT + 1}px`;
|
|
62332
62399
|
properties["grid-template-columns"] = `auto ${this.sidePanel.panelSize}px`;
|
|
62333
62400
|
return cssPropertiesToCss(properties);
|
|
62334
62401
|
}
|
|
@@ -62405,7 +62472,7 @@ var Spreadsheet = class extends Component {
|
|
|
62405
62472
|
checkViewportSize() {
|
|
62406
62473
|
const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
|
|
62407
62474
|
if (!isFinite(xRatio) || !isFinite(yRatio)) return;
|
|
62408
|
-
if (yRatio >
|
|
62475
|
+
if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
|
|
62409
62476
|
if (this.isViewportTooSmall) return;
|
|
62410
62477
|
this.notificationStore.notifyUser({
|
|
62411
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."),
|
|
@@ -62436,8 +62503,8 @@ var Spreadsheet = class extends Component {
|
|
|
62436
62503
|
return height;
|
|
62437
62504
|
}
|
|
62438
62505
|
get gridContainerStyle() {
|
|
62439
|
-
const gridColSize =
|
|
62440
|
-
const gridRowSize =
|
|
62506
|
+
const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
|
|
62507
|
+
const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
|
|
62441
62508
|
return cssPropertiesToCss({
|
|
62442
62509
|
"grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
|
|
62443
62510
|
"grid-template-rows": `${gridRowSize ? gridRowSize + 2 : 0}px auto`
|
|
@@ -63973,7 +64040,7 @@ function createChart(chart, chartSheetIndex, data) {
|
|
|
63973
64040
|
const color = chart.data.title.color ? toXlsxHexColor(chart.data.title.color) : chart.data.fontColor;
|
|
63974
64041
|
title = escapeXml`
|
|
63975
64042
|
<c:title>
|
|
63976
|
-
${insertText(chart.data.title.text, color,
|
|
64043
|
+
${insertText(chart.data.title.text, color, DEFAULT_CHART_FONT_SIZE, chart.data.title)}
|
|
63977
64044
|
<c:overlay val="0" />
|
|
63978
64045
|
</c:title>
|
|
63979
64046
|
`;
|
|
@@ -64057,7 +64124,7 @@ function lineAttributes(params) {
|
|
|
64057
64124
|
</a:ln>
|
|
64058
64125
|
`;
|
|
64059
64126
|
}
|
|
64060
|
-
function insertText(text, fontColor = "000000", fontsize =
|
|
64127
|
+
function insertText(text, fontColor = "000000", fontsize = DEFAULT_CHART_FONT_SIZE, style = {}) {
|
|
64061
64128
|
return escapeXml`
|
|
64062
64129
|
<c:tx>
|
|
64063
64130
|
<c:rich>
|
|
@@ -65009,12 +65076,12 @@ function figureCoordinates(headers, position) {
|
|
|
65009
65076
|
let currentPosition = 0;
|
|
65010
65077
|
for (const [headerIndex, header] of headers.entries()) if (currentPosition <= position && position < currentPosition + header.size) return {
|
|
65011
65078
|
index: headerIndex,
|
|
65012
|
-
offset: convertDotValueToEMU(position - currentPosition +
|
|
65079
|
+
offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH)
|
|
65013
65080
|
};
|
|
65014
65081
|
else if (headerIndex < headers.length - 1) currentPosition += header.size;
|
|
65015
65082
|
return {
|
|
65016
65083
|
index: headers.length - 1,
|
|
65017
|
-
offset: convertDotValueToEMU(position - currentPosition +
|
|
65084
|
+
offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH)
|
|
65018
65085
|
};
|
|
65019
65086
|
}
|
|
65020
65087
|
function createChartDrawing(figure, sheet, chartRelId) {
|
|
@@ -65113,7 +65180,7 @@ function createImageDrawing(figure, sheet, imageRelId) {
|
|
|
65113
65180
|
function addNumberFormats(numFmts) {
|
|
65114
65181
|
const numFmtNodes = [];
|
|
65115
65182
|
for (const [index, numFmt] of Object.entries(numFmts)) {
|
|
65116
|
-
const numFmtAttrs = [["numFmtId", parseInt(index) +
|
|
65183
|
+
const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
|
|
65117
65184
|
numFmtNodes.push(escapeXml`
|
|
65118
65185
|
<numFmt ${formatAttributes(numFmtAttrs)}/>
|
|
65119
65186
|
`);
|
|
@@ -65345,7 +65412,7 @@ function addColumns(cols) {
|
|
|
65345
65412
|
const attributes = [
|
|
65346
65413
|
["min", parseInt(id) + 1],
|
|
65347
65414
|
["max", parseInt(id) + 1],
|
|
65348
|
-
["width", convertWidthToExcel(col.size ||
|
|
65415
|
+
["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
|
|
65349
65416
|
["customWidth", 1],
|
|
65350
65417
|
["hidden", col.isHidden ? 1 : 0]
|
|
65351
65418
|
];
|
|
@@ -65366,7 +65433,7 @@ function addRows(construct, data, sheet) {
|
|
|
65366
65433
|
for (let r = 0; r < sheet.rowNumber; r++) {
|
|
65367
65434
|
const rowAttrs = [["r", r + 1]];
|
|
65368
65435
|
const row = sheet.rows[r] || {};
|
|
65369
|
-
if (row.size && row.size !==
|
|
65436
|
+
if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
|
|
65370
65437
|
if (row.isHidden) rowAttrs.push(["hidden", 1]);
|
|
65371
65438
|
if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
|
|
65372
65439
|
if (row.collapsed) rowAttrs.push(["collapsed", 1]);
|
|
@@ -65399,7 +65466,7 @@ function addRows(construct, data, sheet) {
|
|
|
65399
65466
|
</c>`);
|
|
65400
65467
|
}
|
|
65401
65468
|
}
|
|
65402
|
-
if (cellNodes.length || row.size !==
|
|
65469
|
+
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
|
|
65403
65470
|
<row ${formatAttributes(rowAttrs)}>
|
|
65404
65471
|
${joinXmlNodes(cellNodes)}
|
|
65405
65472
|
</row>
|
|
@@ -65572,7 +65639,7 @@ function createWorksheets(data, construct) {
|
|
|
65572
65639
|
let currentTableIndex = 1;
|
|
65573
65640
|
for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
|
|
65574
65641
|
const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
|
|
65575
|
-
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(
|
|
65642
|
+
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
|
|
65576
65643
|
const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
|
|
65577
65644
|
currentTableIndex += sheet.tables.length;
|
|
65578
65645
|
let drawingNode = escapeXml``;
|
|
@@ -66200,7 +66267,7 @@ var Model = class extends EventBus {
|
|
|
66200
66267
|
exportData() {
|
|
66201
66268
|
let data = createEmptyWorkbookData();
|
|
66202
66269
|
for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data);
|
|
66203
|
-
data.revisionId = this.session.getRevisionId() ||
|
|
66270
|
+
data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
|
|
66204
66271
|
data = deepCopy(data);
|
|
66205
66272
|
return data;
|
|
66206
66273
|
}
|
|
@@ -66244,15 +66311,15 @@ function createCommand(type, payload = {}) {
|
|
|
66244
66311
|
*/
|
|
66245
66312
|
const __info__ = {};
|
|
66246
66313
|
const SPREADSHEET_DIMENSIONS = {
|
|
66247
|
-
MIN_ROW_HEIGHT
|
|
66248
|
-
MIN_COL_WIDTH
|
|
66249
|
-
HEADER_HEIGHT
|
|
66250
|
-
HEADER_WIDTH
|
|
66251
|
-
TOPBAR_HEIGHT
|
|
66252
|
-
BOTTOMBAR_HEIGHT
|
|
66253
|
-
DEFAULT_CELL_WIDTH
|
|
66254
|
-
DEFAULT_CELL_HEIGHT
|
|
66255
|
-
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
|
|
66256
66323
|
};
|
|
66257
66324
|
const registries = {
|
|
66258
66325
|
autoCompleteProviders,
|
|
@@ -66337,6 +66404,7 @@ const helpers = {
|
|
|
66337
66404
|
overlap,
|
|
66338
66405
|
union,
|
|
66339
66406
|
isInside,
|
|
66407
|
+
addStyleToWorkbookData,
|
|
66340
66408
|
deepCopy,
|
|
66341
66409
|
expandZoneOnInsertion,
|
|
66342
66410
|
reduceZoneOnDeletion,
|
|
@@ -66444,7 +66512,7 @@ const constants = {
|
|
|
66444
66512
|
DEFAULT_LOCALE,
|
|
66445
66513
|
HIGHLIGHT_COLOR,
|
|
66446
66514
|
PIVOT_TABLE_CONFIG,
|
|
66447
|
-
TREND_LINE_XAXIS_ID
|
|
66515
|
+
TREND_LINE_XAXIS_ID,
|
|
66448
66516
|
CHART_AXIS_CHOICES,
|
|
66449
66517
|
ChartTerms
|
|
66450
66518
|
};
|
|
@@ -66452,6 +66520,6 @@ const constants = {
|
|
|
66452
66520
|
//#endregion
|
|
66453
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 };
|
|
66454
66522
|
|
|
66455
|
-
__info__.version = "18.0.
|
|
66456
|
-
__info__.date = "2026-
|
|
66457
|
-
__info__.hash = "
|
|
66523
|
+
__info__.version = "18.0.83";
|
|
66524
|
+
__info__.date = "2026-10-10T06:31:52.656Z";
|
|
66525
|
+
__info__.hash = "22b9b73";
|