@odoo/o-spreadsheet 18.0.81 → 18.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/o-spreadsheet.esm.js +382 -312
- package/dist/o-spreadsheet.iife.js +382 -312
- package/dist/o-spreadsheet.iife.min.js +490 -490
- package/dist/o_spreadsheet.xml +4 -4
- package/dist/types/helpers/data_normalization.d.ts +5 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.0.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.83
|
|
6
|
+
* @date 2026-10-10T06:31:52.656Z
|
|
7
|
+
* @hash 22b9b73
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function(exports, _odoo_owl) {
|
|
@@ -209,6 +209,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
209
209
|
const ALERT_INFO_BORDER = "#98DBE2";
|
|
210
210
|
const ALERT_INFO_TEXT_COLOR = "#09414A";
|
|
211
211
|
const BADGE_SELECTED_COLOR = "#E6F2F3";
|
|
212
|
+
const DEFAULT_CHART_PADDING = 20;
|
|
213
|
+
const DEFAULT_CHART_FONT_SIZE = 22;
|
|
214
|
+
const SCORECARD_GAUGE_CHART_PADDING = 10;
|
|
215
|
+
const SCORECARD_GAUGE_CHART_FONT_SIZE = 14;
|
|
212
216
|
const COLOR_PICKER_DEFAULTS = [
|
|
213
217
|
"#000000",
|
|
214
218
|
"#434343",
|
|
@@ -291,8 +295,34 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
291
295
|
"#20124D",
|
|
292
296
|
"#4C1130"
|
|
293
297
|
];
|
|
298
|
+
const MIN_ROW_HEIGHT = 10;
|
|
299
|
+
const MIN_COL_WIDTH = 5;
|
|
300
|
+
const HEADER_HEIGHT = 26;
|
|
301
|
+
const HEADER_WIDTH = 48;
|
|
302
|
+
const TOPBAR_HEIGHT = 63;
|
|
303
|
+
const TOPBAR_TOOLBAR_HEIGHT = 34;
|
|
304
|
+
const BOTTOMBAR_HEIGHT = 36;
|
|
305
|
+
const DEFAULT_CELL_WIDTH = 96;
|
|
294
306
|
const DEFAULT_CELL_HEIGHT = 23;
|
|
295
|
-
const
|
|
307
|
+
const SCROLLBAR_WIDTH = 15;
|
|
308
|
+
const AUTOFILL_EDGE_LENGTH = 8;
|
|
309
|
+
const ICON_EDGE_LENGTH = 18;
|
|
310
|
+
const MIN_CF_ICON_MARGIN = 4;
|
|
311
|
+
const MIN_CELL_TEXT_MARGIN = 4;
|
|
312
|
+
const CF_ICON_EDGE_LENGTH = 15;
|
|
313
|
+
const PADDING_AUTORESIZE_VERTICAL = 3;
|
|
314
|
+
const PADDING_AUTORESIZE_HORIZONTAL = MIN_CELL_TEXT_MARGIN;
|
|
315
|
+
const GROUP_LAYER_WIDTH = 21;
|
|
316
|
+
const GRID_ICON_MARGIN = 2;
|
|
317
|
+
const GRID_ICON_EDGE_LENGTH = 17;
|
|
318
|
+
const FOOTER_HEIGHT = 2 * DEFAULT_CELL_HEIGHT;
|
|
319
|
+
const MENU_WIDTH = 250;
|
|
320
|
+
const MENU_VERTICAL_PADDING = 6;
|
|
321
|
+
const MENU_ITEM_HEIGHT = 26;
|
|
322
|
+
const MENU_ITEM_PADDING_HORIZONTAL = 11;
|
|
323
|
+
const MENU_ITEM_PADDING_VERTICAL = 4;
|
|
324
|
+
const MENU_SEPARATOR_BORDER_WIDTH = 1;
|
|
325
|
+
const MENU_SEPARATOR_PADDING = 5;
|
|
296
326
|
const DEFAULT_STYLE = {
|
|
297
327
|
align: "left",
|
|
298
328
|
verticalAlign: "bottom",
|
|
@@ -311,13 +341,22 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
311
341
|
};
|
|
312
342
|
const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
|
|
313
343
|
const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
|
|
344
|
+
const DEFAULT_FONT_WEIGHT = "400";
|
|
314
345
|
const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
|
|
346
|
+
const HEADER_FONT_SIZE = 11;
|
|
315
347
|
const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
|
|
316
348
|
const DEFAULT_BORDER_DESC = {
|
|
317
349
|
style: "thin",
|
|
318
350
|
color: "#000000"
|
|
319
351
|
};
|
|
352
|
+
const MAX_HISTORY_STEPS = 99;
|
|
320
353
|
const DEFAULT_REVISION_ID = "START_REVISION";
|
|
354
|
+
const DEFAULT_FIGURE_HEIGHT = 335;
|
|
355
|
+
const DEFAULT_FIGURE_WIDTH = 536;
|
|
356
|
+
const FIGURE_BORDER_WIDTH = 1;
|
|
357
|
+
const MIN_FIG_SIZE = 80;
|
|
358
|
+
const MAX_CHAR_LABEL = 20;
|
|
359
|
+
const FIGURE_ID_SPLITTER = "??";
|
|
321
360
|
const DEFAULT_GAUGE_LOWER_COLOR = "#EA6175";
|
|
322
361
|
const DEFAULT_GAUGE_MIDDLE_COLOR = "#FFD86D";
|
|
323
362
|
const DEFAULT_GAUGE_UPPER_COLOR = "#43C5B1";
|
|
@@ -325,6 +364,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
325
364
|
const DEFAULT_SCORECARD_BASELINE_COLOR_UP = "#43C5B1";
|
|
326
365
|
const DEFAULT_SCORECARD_BASELINE_COLOR_DOWN = "#EA6175";
|
|
327
366
|
const LINE_FILL_TRANSPARENCY = .4;
|
|
367
|
+
const DEBOUNCE_TIME = 200;
|
|
368
|
+
const MESSAGE_VERSION = 1;
|
|
328
369
|
const FORBIDDEN_SHEETNAME_CHARS = [
|
|
329
370
|
"'",
|
|
330
371
|
"*",
|
|
@@ -335,6 +376,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
335
376
|
"]"
|
|
336
377
|
];
|
|
337
378
|
const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
|
|
379
|
+
const FORMULA_REF_IDENTIFIER = "|";
|
|
338
380
|
let DEFAULT_SHEETVIEW_SIZE = 0;
|
|
339
381
|
function getDefaultSheetViewSize() {
|
|
340
382
|
return DEFAULT_SHEETVIEW_SIZE;
|
|
@@ -343,6 +385,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
343
385
|
DEFAULT_SHEETVIEW_SIZE = size;
|
|
344
386
|
}
|
|
345
387
|
const MAXIMAL_FREEZABLE_RATIO = .85;
|
|
388
|
+
const NEWLINE = "\n";
|
|
346
389
|
const FONT_SIZES = [
|
|
347
390
|
6,
|
|
348
391
|
7,
|
|
@@ -727,7 +770,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
727
770
|
*/
|
|
728
771
|
function replaceNewLines(text) {
|
|
729
772
|
if (!text) return "";
|
|
730
|
-
return text.replace(newLineRegexp,
|
|
773
|
+
return text.replace(newLineRegexp, NEWLINE);
|
|
731
774
|
}
|
|
732
775
|
/**
|
|
733
776
|
* Determine if the numbers are consecutive.
|
|
@@ -1335,7 +1378,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1335
1378
|
consumeSpaces(chars);
|
|
1336
1379
|
const col = letterPart - 1;
|
|
1337
1380
|
const row = num - 1;
|
|
1338
|
-
if (!chars.isOver() || col > MAX_COL || row >
|
|
1381
|
+
if (!chars.isOver() || col > MAX_COL || row > MAX_ROW) throw new Error(`Invalid cell description: ${xc}`);
|
|
1339
1382
|
return {
|
|
1340
1383
|
col,
|
|
1341
1384
|
row
|
|
@@ -1773,7 +1816,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
1773
1816
|
const orderedZone = reorderZone(toZoneWithoutBoundaryChanges(xc));
|
|
1774
1817
|
const bottom = orderedZone.bottom;
|
|
1775
1818
|
const right = orderedZone.right;
|
|
1776
|
-
if (bottom !== void 0 && bottom >
|
|
1819
|
+
if (bottom !== void 0 && bottom > MAX_ROW || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
|
|
1777
1820
|
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");
|
|
1778
1821
|
return orderedZone;
|
|
1779
1822
|
}
|
|
@@ -2170,7 +2213,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2170
2213
|
function getItemId(item, itemsDic) {
|
|
2171
2214
|
if (!globalReverseLookup$1.has(itemsDic)) {
|
|
2172
2215
|
globalReverseLookup$1.set(itemsDic, /* @__PURE__ */ new Map());
|
|
2173
|
-
|
|
2216
|
+
const maxId = Math.max(...Object.keys(itemsDic).map(parseInt), 0);
|
|
2217
|
+
globalIdCounter.set(itemsDic, maxId);
|
|
2174
2218
|
}
|
|
2175
2219
|
const reverseLookup = globalReverseLookup$1.get(itemsDic);
|
|
2176
2220
|
const canonical = getCanonicalRepresentation(item);
|
|
@@ -2212,6 +2256,26 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2212
2256
|
repr += "}";
|
|
2213
2257
|
return repr;
|
|
2214
2258
|
}
|
|
2259
|
+
/**
|
|
2260
|
+
* This adds a border/style/format to the cell position in the workbook data, updating the zonified structure accordingly.
|
|
2261
|
+
*/
|
|
2262
|
+
function addStyleToWorkbookData(workbookData, key, position, newItem) {
|
|
2263
|
+
const sheetData = workbookData.sheets.find((sheet) => sheet.id === position.sheetId);
|
|
2264
|
+
if (!sheetData) throw new Error(`Sheet with id ${position.sheetId} not found`);
|
|
2265
|
+
const id = getItemId(newItem, workbookData[key]);
|
|
2266
|
+
const zonifiedData = sheetData[key];
|
|
2267
|
+
const zone = positionToZone(position);
|
|
2268
|
+
const styleXc = Object.keys(zonifiedData).find((styleXc) => isZoneInside(zone, toZone(styleXc)));
|
|
2269
|
+
if (!styleXc) {
|
|
2270
|
+
zonifiedData[zoneToXc(zone)] = id;
|
|
2271
|
+
return;
|
|
2272
|
+
}
|
|
2273
|
+
const existingStyle = zonifiedData[styleXc];
|
|
2274
|
+
const remainingZones = recomputeZones([toZone(styleXc)], [zone]);
|
|
2275
|
+
delete zonifiedData[styleXc];
|
|
2276
|
+
for (const remainingZone of remainingZones) zonifiedData[zoneToXc(remainingZone)] = existingStyle;
|
|
2277
|
+
zonifiedData[zoneToXc(zone)] = id;
|
|
2278
|
+
}
|
|
2215
2279
|
|
|
2216
2280
|
//#endregion
|
|
2217
2281
|
//#region src/helpers/dates.ts
|
|
@@ -4126,7 +4190,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4126
4190
|
switch (token.type) {
|
|
4127
4191
|
case "DIGIT":
|
|
4128
4192
|
if (parsedPart === integerPart) parsedPart.push(token);
|
|
4129
|
-
else if (numberOfDecimalsDigits <
|
|
4193
|
+
else if (numberOfDecimalsDigits < MAX_DECIMAL_PLACES) {
|
|
4130
4194
|
parsedPart.push(token);
|
|
4131
4195
|
numberOfDecimalsDigits++;
|
|
4132
4196
|
}
|
|
@@ -4443,7 +4507,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4443
4507
|
* exceed in the decimal part, in which case digits are rounded.
|
|
4444
4508
|
*
|
|
4445
4509
|
**/
|
|
4446
|
-
function splitNumber(value, maxDecimals =
|
|
4510
|
+
function splitNumber(value, maxDecimals = MAX_DECIMAL_PLACES) {
|
|
4447
4511
|
const asString = value.toString();
|
|
4448
4512
|
if (asString.includes("e")) return splitNumberIntl(value, maxDecimals);
|
|
4449
4513
|
if (Number.isInteger(value)) return {
|
|
@@ -4512,7 +4576,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4512
4576
|
* Supports numbers with a lot of digits that are transformed to scientific notation by
|
|
4513
4577
|
* number.toString(), but is slow.
|
|
4514
4578
|
*/
|
|
4515
|
-
function splitNumberIntl(value, maxDecimals =
|
|
4579
|
+
function splitNumberIntl(value, maxDecimals = MAX_DECIMAL_PLACES) {
|
|
4516
4580
|
let formatter = numberRepresentation[maxDecimals];
|
|
4517
4581
|
if (!formatter) {
|
|
4518
4582
|
formatter = new Intl.NumberFormat("en-US", {
|
|
@@ -4999,7 +5063,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4999
5063
|
* Returns a timeout delay in milliseconds.
|
|
5000
5064
|
*/
|
|
5001
5065
|
function scrollDelay(value) {
|
|
5002
|
-
return
|
|
5066
|
+
return MIN_DELAY + (MAX_DELAY - MIN_DELAY) * Math.exp(-.035 * (value - 1));
|
|
5003
5067
|
}
|
|
5004
5068
|
|
|
5005
5069
|
//#endregion
|
|
@@ -5367,13 +5431,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5367
5431
|
//#endregion
|
|
5368
5432
|
//#region src/helpers/text_helper.ts
|
|
5369
5433
|
function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
|
|
5370
|
-
return numberOfLines * (textLineHeight +
|
|
5434
|
+
return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
|
|
5371
5435
|
}
|
|
5372
5436
|
/**
|
|
5373
5437
|
* Get the default height of the cell given its style.
|
|
5374
5438
|
*/
|
|
5375
5439
|
function getDefaultCellHeight(ctx, cell, locale, colSize) {
|
|
5376
|
-
if (!cell || !cell.isFormula && !cell.content) return
|
|
5440
|
+
if (!cell || !cell.isFormula && !cell.content) return DEFAULT_CELL_HEIGHT;
|
|
5377
5441
|
let content = "";
|
|
5378
5442
|
try {
|
|
5379
5443
|
if (!cell.isFormula) {
|
|
@@ -5389,8 +5453,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5389
5453
|
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
5390
5454
|
}
|
|
5391
5455
|
function getCellContentHeight(ctx, content, style, colSize) {
|
|
5392
|
-
const numberOfLines = splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 *
|
|
5393
|
-
return computeTextLinesHeight(computeTextFontSizeInPixels(style), numberOfLines) + 2 *
|
|
5456
|
+
const numberOfLines = splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : void 0).length;
|
|
5457
|
+
return computeTextLinesHeight(computeTextFontSizeInPixels(style), numberOfLines) + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
5394
5458
|
}
|
|
5395
5459
|
function getDefaultContextFont(fontSize, bold = false, italic = false) {
|
|
5396
5460
|
return `${italic ? "italic" : ""} ${bold ? "bold" : ""} ${fontSize}px ${DEFAULT_FONT}`;
|
|
@@ -5440,7 +5504,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5440
5504
|
return Math.round(fontSize * 96 / 72);
|
|
5441
5505
|
}
|
|
5442
5506
|
function computeTextFont(style, fontUnit = "pt") {
|
|
5443
|
-
return `${style.italic ? "italic " : ""}${style.bold ? "bold" :
|
|
5507
|
+
return `${style.italic ? "italic " : ""}${style.bold ? "bold" : DEFAULT_FONT_WEIGHT} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
5444
5508
|
}
|
|
5445
5509
|
function computeTextFontSizeInPixels(style) {
|
|
5446
5510
|
return fontSizeInPixels(style?.fontSize || DEFAULT_FONT_SIZE);
|
|
@@ -5464,7 +5528,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5464
5528
|
if (!style) style = {};
|
|
5465
5529
|
if (isMarkdownLink(text)) text = parseMarkdownLink(text).label;
|
|
5466
5530
|
const brokenText = [];
|
|
5467
|
-
const lines = text.includes(
|
|
5531
|
+
const lines = text.includes(NEWLINE) ? text.split(NEWLINE) : [text];
|
|
5468
5532
|
for (const line of lines) {
|
|
5469
5533
|
const words = line.includes(" ") ? line.split(" ") : [line];
|
|
5470
5534
|
if (!width) {
|
|
@@ -5528,7 +5592,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5528
5592
|
return fontSize;
|
|
5529
5593
|
}
|
|
5530
5594
|
function computeIconWidth(style) {
|
|
5531
|
-
return computeTextFontSizeInPixels(style) + 2 *
|
|
5595
|
+
return computeTextFontSizeInPixels(style) + 2 * MIN_CF_ICON_MARGIN;
|
|
5532
5596
|
}
|
|
5533
5597
|
/** Transform a string to lower case. If the string is undefined, return an empty string */
|
|
5534
5598
|
function toLowerCase(str) {
|
|
@@ -6047,13 +6111,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
6047
6111
|
}
|
|
6048
6112
|
function tokenizeNewLine(chars) {
|
|
6049
6113
|
let length = 0;
|
|
6050
|
-
while (chars.current ===
|
|
6114
|
+
while (chars.current === NEWLINE) {
|
|
6051
6115
|
length++;
|
|
6052
6116
|
chars.shift();
|
|
6053
6117
|
}
|
|
6054
6118
|
if (length) return {
|
|
6055
6119
|
type: "SPACE",
|
|
6056
|
-
value:
|
|
6120
|
+
value: NEWLINE.repeat(length)
|
|
6057
6121
|
};
|
|
6058
6122
|
return null;
|
|
6059
6123
|
}
|
|
@@ -6707,7 +6771,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
6707
6771
|
if (value === void 0) return;
|
|
6708
6772
|
const valueIndex = values.indexOf(value);
|
|
6709
6773
|
if (value === void 0 || valueIndex === -1) return;
|
|
6710
|
-
return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction ===
|
|
6774
|
+
return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === PREVIOUS_VALUE ? -1 : 1), 0, values.length - 1)]);
|
|
6711
6775
|
}
|
|
6712
6776
|
function domainToString(domain) {
|
|
6713
6777
|
return domain ? domain.map(domainNodeToString).join(", ") : "";
|
|
@@ -8660,7 +8724,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8660
8724
|
const borderColor = config.color || lightenColor(rgbaToHex(defaultBorderColor), .5);
|
|
8661
8725
|
return {
|
|
8662
8726
|
type: "line",
|
|
8663
|
-
xAxisID:
|
|
8727
|
+
xAxisID: TREND_LINE_XAXIS_ID,
|
|
8664
8728
|
yAxisID: dataset.yAxisID,
|
|
8665
8729
|
label: dataset.label ? _t("Trend line for %s", dataset.label) : "",
|
|
8666
8730
|
data: data.map((v, i) => ({
|
|
@@ -8765,6 +8829,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8765
8829
|
case "doughnut":
|
|
8766
8830
|
drawPieChartValues(chart, options, ctx);
|
|
8767
8831
|
break;
|
|
8832
|
+
case "combo":
|
|
8768
8833
|
case "bar":
|
|
8769
8834
|
case "line":
|
|
8770
8835
|
options.horizontal ? drawHorizontalBarChartValues(chart, options, ctx) : drawLineOrBarChartValues(chart, options, ctx);
|
|
@@ -8782,13 +8847,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8782
8847
|
function drawLineOrBarChartValues(chart, options, ctx) {
|
|
8783
8848
|
const textsPositions = {};
|
|
8784
8849
|
for (const dataset of chart._metasets) {
|
|
8785
|
-
if (dataset.xAxisID ===
|
|
8850
|
+
if (dataset.xAxisID === TREND_LINE_XAXIS_ID) return;
|
|
8786
8851
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
8787
8852
|
const value = dataset._parsed[i].y;
|
|
8788
8853
|
const point = dataset.data[i];
|
|
8789
8854
|
const xPosition = point.x;
|
|
8790
8855
|
let yPosition = 0;
|
|
8791
|
-
if (
|
|
8856
|
+
if (dataset.type === "line") yPosition = point.y - 10;
|
|
8792
8857
|
else yPosition = value < 0 ? point.y - point.height / 2 : point.y + point.height / 2;
|
|
8793
8858
|
if (!textsPositions[xPosition]) textsPositions[xPosition] = [];
|
|
8794
8859
|
for (const otherPosition of textsPositions[xPosition] || []) if (Math.abs(otherPosition - yPosition) < 13) yPosition = otherPosition - 13;
|
|
@@ -8802,7 +8867,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8802
8867
|
function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
8803
8868
|
const textsPositions = {};
|
|
8804
8869
|
for (const dataset of chart._metasets) {
|
|
8805
|
-
if (dataset.xAxisID ===
|
|
8870
|
+
if (dataset.xAxisID === TREND_LINE_XAXIS_ID) return;
|
|
8806
8871
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
8807
8872
|
const value = dataset._parsed[i].x;
|
|
8808
8873
|
const displayValue = options.callback(value, dataset, i);
|
|
@@ -8989,6 +9054,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8989
9054
|
const EXCEL_DEFAULT_COL_WIDTH = 8.43;
|
|
8990
9055
|
/** unit : points */
|
|
8991
9056
|
const EXCEL_DEFAULT_ROW_HEIGHT = 12.75;
|
|
9057
|
+
const EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS = 30;
|
|
9058
|
+
const EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS = 100;
|
|
9059
|
+
const FIRST_NUMFMT_ID = 164;
|
|
8992
9060
|
const FORCE_DEFAULT_ARGS_FUNCTIONS = {
|
|
8993
9061
|
FLOOR: [{
|
|
8994
9062
|
type: "NUMBER",
|
|
@@ -9306,9 +9374,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9306
9374
|
display: flex;
|
|
9307
9375
|
align-items: center;
|
|
9308
9376
|
justify-content: center;
|
|
9309
|
-
width: ${
|
|
9310
|
-
height: ${
|
|
9311
|
-
font-size: ${
|
|
9377
|
+
width: ${ICON_EDGE_LENGTH}px;
|
|
9378
|
+
height: ${ICON_EDGE_LENGTH}px;
|
|
9379
|
+
font-size: ${ICON_EDGE_LENGTH}px;
|
|
9312
9380
|
vertical-align: middle;
|
|
9313
9381
|
|
|
9314
9382
|
.small-text {
|
|
@@ -10280,7 +10348,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10280
10348
|
alignment: {
|
|
10281
10349
|
horizontal: style.align,
|
|
10282
10350
|
vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
|
|
10283
|
-
wrapText: style.wrapping === "wrap" || cell.content?.includes(
|
|
10351
|
+
wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : void 0,
|
|
10284
10352
|
shrinkToFit: style.wrapping === "clip" ? true : void 0
|
|
10285
10353
|
}
|
|
10286
10354
|
};
|
|
@@ -10311,7 +10379,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10311
10379
|
function convertFormat(format, numFmtStructure) {
|
|
10312
10380
|
if (!format) return 0;
|
|
10313
10381
|
let formatId = XLSX_FORMAT_MAP[format.format];
|
|
10314
|
-
if (!formatId) formatId = pushElement(format, numFmtStructure) +
|
|
10382
|
+
if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
10315
10383
|
return formatId;
|
|
10316
10384
|
}
|
|
10317
10385
|
/**
|
|
@@ -10893,8 +10961,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10893
10961
|
dims[0] = Math.max(dims[0], largeMax(row.cells.map((cell) => toCartesian(cell.xc).col)));
|
|
10894
10962
|
dims[1] = Math.max(dims[1], row.index);
|
|
10895
10963
|
}
|
|
10896
|
-
dims[0] = Math.max(dims[0],
|
|
10897
|
-
dims[1] = Math.max(dims[1],
|
|
10964
|
+
dims[0] = Math.max(dims[0], EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
|
|
10965
|
+
dims[1] = Math.max(dims[1], EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
|
|
10898
10966
|
return dims;
|
|
10899
10967
|
}
|
|
10900
10968
|
/**
|
|
@@ -11999,7 +12067,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
11999
12067
|
rgb = this.getThemeColor(themeIndex, theme.clrScheme);
|
|
12000
12068
|
} else {
|
|
12001
12069
|
rgb = this.extractAttr(colorElement, "rgb")?.asString();
|
|
12002
|
-
rgb = rgb ===
|
|
12070
|
+
rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
|
|
12003
12071
|
}
|
|
12004
12072
|
return {
|
|
12005
12073
|
rgb: rgb || defaultColor,
|
|
@@ -13077,7 +13145,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13077
13145
|
* Get the corresponding relationship file for a given xml file in a XLSX directory.
|
|
13078
13146
|
*/
|
|
13079
13147
|
function getRelationFile(file, xmls) {
|
|
13080
|
-
if (file ===
|
|
13148
|
+
if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
|
|
13081
13149
|
let relsFile = "";
|
|
13082
13150
|
const pathParts = file.split("/");
|
|
13083
13151
|
for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
|
|
@@ -13277,7 +13345,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13277
13345
|
if (token.type === "REFERENCE" && cellReference.test(token.value)) {
|
|
13278
13346
|
const value = token.value.trim();
|
|
13279
13347
|
if (!dependencies.includes(value)) dependencies.push(value);
|
|
13280
|
-
return `${
|
|
13348
|
+
return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
|
|
13281
13349
|
} else return token.value;
|
|
13282
13350
|
})),
|
|
13283
13351
|
dependencies
|
|
@@ -13505,7 +13573,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13505
13573
|
if (cell.formula) {
|
|
13506
13574
|
let { text, dependencies } = cell.formula;
|
|
13507
13575
|
for (const [index, d] of Object.entries(dependencies)) {
|
|
13508
|
-
const stringPosition = `\\${
|
|
13576
|
+
const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
|
|
13509
13577
|
text = text.replace(new RegExp(stringPosition, "g"), d);
|
|
13510
13578
|
}
|
|
13511
13579
|
cell.content = text;
|
|
@@ -13701,7 +13769,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13701
13769
|
if (verboseImport) for (const parsingError of reader.warningManager.warnings.sort()) console.warn(parsingError);
|
|
13702
13770
|
}
|
|
13703
13771
|
if ("version" in data) {
|
|
13704
|
-
if (data.version <
|
|
13772
|
+
if (data.version < CURRENT_VERSION) {
|
|
13705
13773
|
console.debug("Migrating data from version", data.version);
|
|
13706
13774
|
data = migrate(data);
|
|
13707
13775
|
}
|
|
@@ -13757,7 +13825,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13757
13825
|
* sensible default values
|
|
13758
13826
|
*/
|
|
13759
13827
|
function setDefaults(partialData) {
|
|
13760
|
-
const data = Object.assign(createEmptyWorkbookData(), partialData, { version:
|
|
13828
|
+
const data = Object.assign(createEmptyWorkbookData(), partialData, { version: CURRENT_VERSION });
|
|
13761
13829
|
data.sheets = data.sheets ? data.sheets.map((s, i) => Object.assign(createEmptySheet(`Sheet${i + 1}`, `Sheet${i + 1}`), s)) : [];
|
|
13762
13830
|
if (data.sheets.length === 0) data.sheets.push(createEmptySheet(INITIAL_SHEET_ID, "Sheet1"));
|
|
13763
13831
|
if (!isValidLocale(data.settings.locale)) data.settings.locale = DEFAULT_LOCALE;
|
|
@@ -13899,7 +13967,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13899
13967
|
}
|
|
13900
13968
|
function createEmptyWorkbookData(sheetName = "Sheet1") {
|
|
13901
13969
|
return {
|
|
13902
|
-
version:
|
|
13970
|
+
version: CURRENT_VERSION,
|
|
13903
13971
|
sheets: [createEmptySheet(INITIAL_SHEET_ID, sheetName)],
|
|
13904
13972
|
styles: {},
|
|
13905
13973
|
formats: {},
|
|
@@ -13930,7 +13998,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13930
13998
|
//#region src/helpers/ui/paste_interactive.ts
|
|
13931
13999
|
const PasteInteractiveContent = {
|
|
13932
14000
|
wrongPasteSelection: _t("This operation is not allowed with multiple selections."),
|
|
13933
|
-
willRemoveExistingMerge: _t("
|
|
14001
|
+
willRemoveExistingMerge: _t("Cannot perform this action on merged cells. Unmerge the cells and try again."),
|
|
13934
14002
|
wrongFigurePasteOption: _t("Cannot do a special paste of a figure."),
|
|
13935
14003
|
frozenPaneOverlap: _t("This operation is not allowed due to an overlapping frozen pane.")
|
|
13936
14004
|
};
|
|
@@ -13949,7 +14017,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13949
14017
|
}));
|
|
13950
14018
|
}
|
|
13951
14019
|
function interactivePasteFromOS(env, target, clipboardContent, pasteOption) {
|
|
13952
|
-
if (clipboardContent.data && clipboardContent.data.version !==
|
|
14020
|
+
if (clipboardContent.data && clipboardContent.data.version !== CURRENT_VERSION) env.notifyUser({
|
|
13953
14021
|
type: "warning",
|
|
13954
14022
|
text: _t("You copied content from a different version of the application. Only text content will be pasted."),
|
|
13955
14023
|
sticky: false
|
|
@@ -14162,9 +14230,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14162
14230
|
const GAUGE_INFLECTION_MARKER_COLOR = "#666666aa";
|
|
14163
14231
|
const GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN = 6;
|
|
14164
14232
|
const GAUGE_TITLE_SECTION_HEIGHT = 25;
|
|
14165
|
-
const GAUGE_TITLE_FONT_SIZE =
|
|
14166
|
-
const GAUGE_TITLE_PADDING_LEFT =
|
|
14167
|
-
const GAUGE_TITLE_PADDING_TOP =
|
|
14233
|
+
const GAUGE_TITLE_FONT_SIZE = SCORECARD_GAUGE_CHART_FONT_SIZE;
|
|
14234
|
+
const GAUGE_TITLE_PADDING_LEFT = SCORECARD_GAUGE_CHART_PADDING;
|
|
14235
|
+
const GAUGE_TITLE_PADDING_TOP = SCORECARD_GAUGE_CHART_PADDING;
|
|
14168
14236
|
function drawGaugeChart(canvas, runtime) {
|
|
14169
14237
|
const canvasBoundingRect = canvas.getBoundingClientRect();
|
|
14170
14238
|
const dpr = window.devicePixelRatio || 1;
|
|
@@ -14258,18 +14326,18 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14258
14326
|
x: boundingRect.width / 2,
|
|
14259
14327
|
y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
|
|
14260
14328
|
};
|
|
14261
|
-
let gaugeValueFontSize =
|
|
14329
|
+
let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
|
|
14262
14330
|
if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
|
|
14263
14331
|
const maxTextWidth = gaugeRect.width / 2;
|
|
14264
14332
|
const gaugeLabel = gaugeValue?.label || "-";
|
|
14265
14333
|
if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
|
|
14266
14334
|
const minLabelPosition = {
|
|
14267
14335
|
x: gaugeRect.x + gaugeArcWidth / 2,
|
|
14268
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
14336
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
14269
14337
|
};
|
|
14270
14338
|
const maxLabelPosition = {
|
|
14271
14339
|
x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
|
|
14272
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
14340
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
14273
14341
|
};
|
|
14274
14342
|
const textColor = getContrastedTextColor(runtime.background);
|
|
14275
14343
|
const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
|
|
@@ -14320,13 +14388,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14320
14388
|
minLabel: {
|
|
14321
14389
|
label: runtime.minValue.label,
|
|
14322
14390
|
textPosition: minLabelPosition,
|
|
14323
|
-
fontSize:
|
|
14391
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14324
14392
|
color: textColor
|
|
14325
14393
|
},
|
|
14326
14394
|
maxLabel: {
|
|
14327
14395
|
label: runtime.maxValue.label,
|
|
14328
14396
|
textPosition: maxLabelPosition,
|
|
14329
|
-
fontSize:
|
|
14397
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14330
14398
|
color: textColor
|
|
14331
14399
|
}
|
|
14332
14400
|
};
|
|
@@ -14336,9 +14404,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14336
14404
|
* space for the title and labels.
|
|
14337
14405
|
*/
|
|
14338
14406
|
function getGaugeRect(boundingRect, title) {
|
|
14339
|
-
const titleHeight = title ?
|
|
14340
|
-
const drawHeight = boundingRect.height -
|
|
14341
|
-
const drawWidth = boundingRect.width -
|
|
14407
|
+
const titleHeight = title ? GAUGE_TITLE_SECTION_HEIGHT : 0;
|
|
14408
|
+
const drawHeight = boundingRect.height - GAUGE_PADDING_BOTTOM - titleHeight - GAUGE_PADDING_TOP;
|
|
14409
|
+
const drawWidth = boundingRect.width - GAUGE_PADDING_SIDE * 2;
|
|
14342
14410
|
let gaugeWidth;
|
|
14343
14411
|
let gaugeHeight;
|
|
14344
14412
|
if (drawWidth > 2 * drawHeight) {
|
|
@@ -14349,8 +14417,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14349
14417
|
gaugeHeight = drawWidth / 2;
|
|
14350
14418
|
}
|
|
14351
14419
|
return {
|
|
14352
|
-
x:
|
|
14353
|
-
y: titleHeight +
|
|
14420
|
+
x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
|
|
14421
|
+
y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
|
|
14354
14422
|
width: gaugeWidth,
|
|
14355
14423
|
height: gaugeHeight
|
|
14356
14424
|
};
|
|
@@ -14367,20 +14435,20 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14367
14435
|
x: gaugeRect.x + gaugeRect.width / 2,
|
|
14368
14436
|
y: gaugeRect.y + gaugeRect.height
|
|
14369
14437
|
};
|
|
14370
|
-
const textStyle = { fontSize:
|
|
14438
|
+
const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
|
|
14371
14439
|
const inflectionValues = [];
|
|
14372
14440
|
const inflectionValuesTextRects = [];
|
|
14373
14441
|
for (const inflectionValue of runtime.inflectionValues) {
|
|
14374
14442
|
const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
|
|
14375
14443
|
const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
|
|
14376
14444
|
const angle = Math.PI - Math.PI * percentage;
|
|
14377
|
-
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2,
|
|
14378
|
-
const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ?
|
|
14445
|
+
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, GAUGE_LABELS_FONT_SIZE);
|
|
14446
|
+
const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? GAUGE_LABELS_FONT_SIZE : 0;
|
|
14379
14447
|
inflectionValuesTextRects.push(textRect);
|
|
14380
14448
|
inflectionValues.push({
|
|
14381
14449
|
rotation: angle,
|
|
14382
14450
|
label: inflectionValue.label,
|
|
14383
|
-
fontSize:
|
|
14451
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14384
14452
|
color: textColor,
|
|
14385
14453
|
offset
|
|
14386
14454
|
});
|
|
@@ -14590,8 +14658,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14590
14658
|
this.baselineMode = definition.baselineMode;
|
|
14591
14659
|
this.baselineDescr = definition.baselineDescr;
|
|
14592
14660
|
this.background = definition.background;
|
|
14593
|
-
this.baselineColorUp = definition.baselineColorUp ??
|
|
14594
|
-
this.baselineColorDown = definition.baselineColorDown ??
|
|
14661
|
+
this.baselineColorUp = definition.baselineColorUp ?? DEFAULT_SCORECARD_BASELINE_COLOR_UP;
|
|
14662
|
+
this.baselineColorDown = definition.baselineColorDown ?? DEFAULT_SCORECARD_BASELINE_COLOR_DOWN;
|
|
14595
14663
|
this.humanize = definition.humanize ?? false;
|
|
14596
14664
|
}
|
|
14597
14665
|
static validateChartDefinition(validator, definition) {
|
|
@@ -14666,7 +14734,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14666
14734
|
canvas.width = dpr * structure.canvas.width;
|
|
14667
14735
|
canvas.height = dpr * structure.canvas.height;
|
|
14668
14736
|
ctx.scale(dpr, dpr);
|
|
14669
|
-
const availableWidth = structure.canvas.width -
|
|
14737
|
+
const availableWidth = structure.canvas.width - DEFAULT_CHART_PADDING;
|
|
14670
14738
|
ctx.fillStyle = structure.canvas.backgroundColor;
|
|
14671
14739
|
ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
|
|
14672
14740
|
if (structure.title) {
|
|
@@ -14781,9 +14849,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14781
14849
|
|
|
14782
14850
|
//#endregion
|
|
14783
14851
|
//#region src/helpers/figures/charts/scorecard_chart_config_builder.ts
|
|
14784
|
-
const CHART_PADDING =
|
|
14852
|
+
const CHART_PADDING = SCORECARD_GAUGE_CHART_PADDING;
|
|
14785
14853
|
const BOTTOM_PADDING_RATIO = .05;
|
|
14786
|
-
const CHART_TITLE_FONT_SIZE =
|
|
14854
|
+
const CHART_TITLE_FONT_SIZE = SCORECARD_GAUGE_CHART_FONT_SIZE;
|
|
14787
14855
|
const KEY_VALUE_FONT_SIZE = 32;
|
|
14788
14856
|
const BASELINE_MAX_FONT_SIZE = 16;
|
|
14789
14857
|
function formatBaselineDescr(baselineDescr, baseline) {
|
|
@@ -14849,7 +14917,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14849
14917
|
y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING
|
|
14850
14918
|
}
|
|
14851
14919
|
};
|
|
14852
|
-
const minimalBaselinePosition = baselineArrowSize +
|
|
14920
|
+
const minimalBaselinePosition = baselineArrowSize + DEFAULT_CHART_PADDING;
|
|
14853
14921
|
if (structure.baseline.position.x < minimalBaselinePosition) structure.baseline.position.x = minimalBaselinePosition;
|
|
14854
14922
|
if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
|
|
14855
14923
|
direction: this.baselineArrow,
|
|
@@ -15027,7 +15095,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15027
15095
|
}
|
|
15028
15096
|
function truncateLabel(label) {
|
|
15029
15097
|
if (!label) return "";
|
|
15030
|
-
if (label.length >
|
|
15098
|
+
if (label.length > MAX_CHAR_LABEL) return label.substring(0, MAX_CHAR_LABEL) + "…";
|
|
15031
15099
|
return label;
|
|
15032
15100
|
}
|
|
15033
15101
|
/**
|
|
@@ -15042,10 +15110,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15042
15110
|
responsive: true,
|
|
15043
15111
|
maintainAspectRatio: false,
|
|
15044
15112
|
layout: { padding: {
|
|
15045
|
-
left:
|
|
15046
|
-
right:
|
|
15047
|
-
top: chartTitle.text ?
|
|
15048
|
-
bottom:
|
|
15113
|
+
left: DEFAULT_CHART_PADDING,
|
|
15114
|
+
right: DEFAULT_CHART_PADDING,
|
|
15115
|
+
top: chartTitle.text ? DEFAULT_CHART_PADDING / 2 : DEFAULT_CHART_PADDING + 5,
|
|
15116
|
+
bottom: DEFAULT_CHART_PADDING
|
|
15049
15117
|
} },
|
|
15050
15118
|
elements: {
|
|
15051
15119
|
line: { fill: false },
|
|
@@ -15059,7 +15127,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15059
15127
|
color: chartTitle?.color ?? fontColor,
|
|
15060
15128
|
align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
|
|
15061
15129
|
font: {
|
|
15062
|
-
size:
|
|
15130
|
+
size: DEFAULT_CHART_FONT_SIZE,
|
|
15063
15131
|
weight: chartTitle.bold ? "bold" : "normal",
|
|
15064
15132
|
style: chartTitle.italic ? "italic" : "normal"
|
|
15065
15133
|
}
|
|
@@ -23493,7 +23561,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23493
23561
|
while (!current.done) {
|
|
23494
23562
|
if (!current.value.hasChildNodes()) text += current.value.textContent;
|
|
23495
23563
|
if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) if (isFirstParagraph) isFirstParagraph = false;
|
|
23496
|
-
else text +=
|
|
23564
|
+
else text += NEWLINE;
|
|
23497
23565
|
current = it.next();
|
|
23498
23566
|
}
|
|
23499
23567
|
return text;
|
|
@@ -23720,7 +23788,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23720
23788
|
if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
|
|
23721
23789
|
} else {
|
|
23722
23790
|
assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
|
|
23723
|
-
if (composerRect.left + ASSISTANT_WIDTH +
|
|
23791
|
+
if (composerRect.left + ASSISTANT_WIDTH + SCROLLBAR_WIDTH + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
|
|
23724
23792
|
}
|
|
23725
23793
|
return assistantStyle;
|
|
23726
23794
|
}
|
|
@@ -23834,7 +23902,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23834
23902
|
const start = Math.min(selection.start, selection.end);
|
|
23835
23903
|
const end = Math.max(selection.start, selection.end);
|
|
23836
23904
|
this.props.composerStore.stopComposerRangeSelection();
|
|
23837
|
-
this.props.composerStore.setCurrentContent(content.slice(0, start) +
|
|
23905
|
+
this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
|
|
23838
23906
|
start: start + 1,
|
|
23839
23907
|
end: start + 1
|
|
23840
23908
|
});
|
|
@@ -24063,8 +24131,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24063
24131
|
splitHtmlContentIntoLines(contents) {
|
|
24064
24132
|
const contentSplitInLines = [];
|
|
24065
24133
|
let currentLine = [];
|
|
24066
|
-
for (const content of contents) if (content.value.includes(
|
|
24067
|
-
const lines = content.value.split(
|
|
24134
|
+
for (const content of contents) if (content.value.includes(NEWLINE)) {
|
|
24135
|
+
const lines = content.value.split(NEWLINE);
|
|
24068
24136
|
const lastLine = lines.pop();
|
|
24069
24137
|
for (const line of lines) {
|
|
24070
24138
|
currentLine.push({
|
|
@@ -25285,7 +25353,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25285
25353
|
const definition = this.getDefinition();
|
|
25286
25354
|
return {
|
|
25287
25355
|
...definition,
|
|
25288
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
25356
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
25289
25357
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
25290
25358
|
dataSets,
|
|
25291
25359
|
labelRange,
|
|
@@ -25375,7 +25443,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25375
25443
|
label,
|
|
25376
25444
|
data,
|
|
25377
25445
|
hidden,
|
|
25378
|
-
borderColor: definition.background ||
|
|
25446
|
+
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
25379
25447
|
borderWidth: definition.stacked ? 1 : 0,
|
|
25380
25448
|
backgroundColor: color
|
|
25381
25449
|
};
|
|
@@ -25389,7 +25457,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25389
25457
|
}
|
|
25390
25458
|
if (trendDatasets.length) {
|
|
25391
25459
|
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset.data.length));
|
|
25392
|
-
config.options.scales[
|
|
25460
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25393
25461
|
...xAxis,
|
|
25394
25462
|
labels: Array(maxLength).fill(""),
|
|
25395
25463
|
offset: false,
|
|
@@ -25397,12 +25465,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25397
25465
|
};
|
|
25398
25466
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
25399
25467
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
25400
|
-
return tooltipItems.some((item) => item.dataset.xAxisID !==
|
|
25468
|
+
return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
|
|
25401
25469
|
};
|
|
25402
25470
|
}
|
|
25403
25471
|
return {
|
|
25404
25472
|
chartJsConfig: config,
|
|
25405
|
-
background: chart.background ||
|
|
25473
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
25406
25474
|
};
|
|
25407
25475
|
}
|
|
25408
25476
|
|
|
@@ -25689,7 +25757,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25689
25757
|
config.options.plugins.tooltip.callbacks.label = (tooltipItem) => {
|
|
25690
25758
|
let dataSetPoint;
|
|
25691
25759
|
let label;
|
|
25692
|
-
if (tooltipItem.dataset.xAxisID ===
|
|
25760
|
+
if (tooltipItem.dataset.xAxisID === TREND_LINE_XAXIS_ID) {
|
|
25693
25761
|
dataSetPoint = dataSetsValues[tooltipItem.datasetIndex].data[tooltipItem.dataIndex].y;
|
|
25694
25762
|
label = "";
|
|
25695
25763
|
} else {
|
|
@@ -25760,23 +25828,23 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25760
25828
|
}
|
|
25761
25829
|
}
|
|
25762
25830
|
if (trendDatasets.length) {
|
|
25763
|
-
config.options.scales[
|
|
25831
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25764
25832
|
...xAxis,
|
|
25765
25833
|
display: false
|
|
25766
25834
|
};
|
|
25767
25835
|
if (axisType === "category" || axisType === "time") {
|
|
25768
|
-
config.options.scales[
|
|
25769
|
-
config.options.scales[
|
|
25770
|
-
config.options.scales[
|
|
25836
|
+
config.options.scales[TREND_LINE_XAXIS_ID]["type"] = "category";
|
|
25837
|
+
config.options.scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
|
|
25838
|
+
config.options.scales[TREND_LINE_XAXIS_ID]["offset"] = false;
|
|
25771
25839
|
}
|
|
25772
25840
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
25773
25841
|
}
|
|
25774
25842
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
25775
|
-
return axisType !== "linear" && tooltipItems.some((item) => item.dataset.xAxisID !==
|
|
25843
|
+
return axisType !== "linear" && tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
|
|
25776
25844
|
};
|
|
25777
25845
|
return {
|
|
25778
25846
|
chartJsConfig: config,
|
|
25779
|
-
background: chart.background ||
|
|
25847
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
25780
25848
|
};
|
|
25781
25849
|
}
|
|
25782
25850
|
|
|
@@ -25852,7 +25920,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25852
25920
|
const definition = this.getDefinition();
|
|
25853
25921
|
return {
|
|
25854
25922
|
...definition,
|
|
25855
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
25923
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
25856
25924
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
25857
25925
|
dataSets,
|
|
25858
25926
|
labelRange,
|
|
@@ -25906,6 +25974,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25906
25974
|
};
|
|
25907
25975
|
const fontColor = chartFontColor(chart.background);
|
|
25908
25976
|
const config = getDefaultChartJsRuntime(chart, labels, fontColor, localeFormat);
|
|
25977
|
+
config.type = "bar";
|
|
25909
25978
|
const legend = getChartJsLegend(fontColor);
|
|
25910
25979
|
if (chart.legendPosition === "none") legend.display = false;
|
|
25911
25980
|
else legend.position = chart.legendPosition;
|
|
@@ -25991,19 +26060,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25991
26060
|
}
|
|
25992
26061
|
if (trendDatasets.length) {
|
|
25993
26062
|
const trendLinesMaxLength = Math.max(...trendDatasets.map((trend) => trend.data.length));
|
|
25994
|
-
config.options.scales[
|
|
26063
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25995
26064
|
labels: Array(Math.round(trendLinesMaxLength)).fill(""),
|
|
25996
26065
|
offset: false,
|
|
25997
26066
|
display: false
|
|
25998
26067
|
};
|
|
25999
26068
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
26000
26069
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
26001
|
-
return tooltipItems.some((item) => item.dataset.xAxisID !==
|
|
26070
|
+
return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
|
|
26002
26071
|
};
|
|
26003
26072
|
}
|
|
26004
26073
|
return {
|
|
26005
26074
|
chartJsConfig: config,
|
|
26006
|
-
background: chart.background ||
|
|
26075
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26007
26076
|
};
|
|
26008
26077
|
}
|
|
26009
26078
|
|
|
@@ -26327,7 +26396,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26327
26396
|
const definition = this.getDefinition();
|
|
26328
26397
|
return {
|
|
26329
26398
|
...definition,
|
|
26330
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26399
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26331
26400
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26332
26401
|
dataSets,
|
|
26333
26402
|
labelRange,
|
|
@@ -26424,7 +26493,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26424
26493
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
26425
26494
|
return {
|
|
26426
26495
|
...this.getDefinition(),
|
|
26427
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26496
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26428
26497
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26429
26498
|
dataSets,
|
|
26430
26499
|
labelRange
|
|
@@ -26528,7 +26597,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26528
26597
|
if (chart.isDoughnut) config.type = "doughnut";
|
|
26529
26598
|
return {
|
|
26530
26599
|
chartJsConfig: config,
|
|
26531
|
-
background: chart.background ||
|
|
26600
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26532
26601
|
};
|
|
26533
26602
|
}
|
|
26534
26603
|
|
|
@@ -26660,7 +26729,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26660
26729
|
config.options.plugins.chartShowValuesPlugin.callback = (value, dataset, index) => callback(Math.abs(value), dataset, index);
|
|
26661
26730
|
return {
|
|
26662
26731
|
chartJsConfig: config,
|
|
26663
|
-
background: chart.background ||
|
|
26732
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26664
26733
|
};
|
|
26665
26734
|
}
|
|
26666
26735
|
|
|
@@ -26758,7 +26827,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26758
26827
|
const definition = this.getDefinition();
|
|
26759
26828
|
return {
|
|
26760
26829
|
...definition,
|
|
26761
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26830
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26762
26831
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26763
26832
|
dataSets,
|
|
26764
26833
|
labelRange,
|
|
@@ -26907,9 +26976,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26907
26976
|
const { locale, format } = localeFormat;
|
|
26908
26977
|
const fontColor = chartFontColor(chart.background);
|
|
26909
26978
|
const config = getDefaultChartJsRuntime(chart, labels, fontColor, localeFormat);
|
|
26910
|
-
const negativeColor = chart.negativeValuesColor ||
|
|
26911
|
-
const positiveColor = chart.positiveValuesColor ||
|
|
26912
|
-
const subTotalColor = chart.subTotalValuesColor ||
|
|
26979
|
+
const negativeColor = chart.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
26980
|
+
const positiveColor = chart.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
26981
|
+
const subTotalColor = chart.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
26913
26982
|
const legend = { labels: { generateLabels: () => {
|
|
26914
26983
|
const legendValues = [{
|
|
26915
26984
|
text: _t("Positive values"),
|
|
@@ -27013,9 +27082,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27013
27082
|
locale
|
|
27014
27083
|
}, dataSetsValues);
|
|
27015
27084
|
config.type = "bar";
|
|
27016
|
-
const negativeColor = chart.negativeValuesColor ||
|
|
27017
|
-
const positiveColor = chart.positiveValuesColor ||
|
|
27018
|
-
const subTotalColor = chart.subTotalValuesColor ||
|
|
27085
|
+
const negativeColor = chart.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
27086
|
+
const positiveColor = chart.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
27087
|
+
const subTotalColor = chart.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
27019
27088
|
const backgroundColor = [];
|
|
27020
27089
|
const datasetValues = [];
|
|
27021
27090
|
const dataset = {
|
|
@@ -27050,7 +27119,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27050
27119
|
config.data.labels = labelsWithSubTotals.map(truncateLabel);
|
|
27051
27120
|
return {
|
|
27052
27121
|
chartJsConfig: config,
|
|
27053
|
-
background: chart.background ||
|
|
27122
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
27054
27123
|
};
|
|
27055
27124
|
}
|
|
27056
27125
|
|
|
@@ -27779,7 +27848,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27779
27848
|
.o-filter-menu-item {
|
|
27780
27849
|
display: flex;
|
|
27781
27850
|
box-sizing: border-box;
|
|
27782
|
-
height: ${
|
|
27851
|
+
height: ${MENU_ITEM_HEIGHT}px;
|
|
27783
27852
|
padding: 4px 4px 4px 0px;
|
|
27784
27853
|
cursor: pointer;
|
|
27785
27854
|
user-select: none;
|
|
@@ -28214,7 +28283,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28214
28283
|
col,
|
|
28215
28284
|
row
|
|
28216
28285
|
});
|
|
28217
|
-
const textColor = style?.textColor ===
|
|
28286
|
+
const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
|
|
28218
28287
|
this.env.model.dispatch("UPDATE_CELL", {
|
|
28219
28288
|
col,
|
|
28220
28289
|
row,
|
|
@@ -28621,15 +28690,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28621
28690
|
css`
|
|
28622
28691
|
.o-menu {
|
|
28623
28692
|
background-color: white;
|
|
28624
|
-
padding: ${
|
|
28625
|
-
width: ${
|
|
28693
|
+
padding: ${MENU_VERTICAL_PADDING}px 0px;
|
|
28694
|
+
width: ${MENU_WIDTH}px;
|
|
28626
28695
|
box-sizing: border-box !important;
|
|
28627
28696
|
user-select: none;
|
|
28628
28697
|
|
|
28629
28698
|
.o-menu-item {
|
|
28630
28699
|
box-sizing: border-box;
|
|
28631
|
-
height: ${
|
|
28632
|
-
padding: ${
|
|
28700
|
+
height: ${MENU_ITEM_HEIGHT}px;
|
|
28701
|
+
padding: ${MENU_ITEM_PADDING_VERTICAL}px ${MENU_ITEM_PADDING_HORIZONTAL}px;
|
|
28633
28702
|
cursor: pointer;
|
|
28634
28703
|
user-select: none;
|
|
28635
28704
|
|
|
@@ -28640,8 +28709,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28640
28709
|
.o-menu-item-icon {
|
|
28641
28710
|
display: inline-block;
|
|
28642
28711
|
margin: 0px 8px 0px 0px;
|
|
28643
|
-
width: ${
|
|
28644
|
-
line-height: ${
|
|
28712
|
+
width: ${MENU_ITEM_HEIGHT - 2 * MENU_ITEM_PADDING_VERTICAL}px;
|
|
28713
|
+
line-height: ${MENU_ITEM_HEIGHT - 2 * MENU_ITEM_PADDING_VERTICAL}px;
|
|
28645
28714
|
}
|
|
28646
28715
|
|
|
28647
28716
|
&:not(.disabled) {
|
|
@@ -28746,11 +28815,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28746
28815
|
anchorRect: {
|
|
28747
28816
|
x: this.props.position.x,
|
|
28748
28817
|
y: this.props.position.y,
|
|
28749
|
-
width: isRoot ? 0 : this.props.width ||
|
|
28750
|
-
height: isRoot ? 0 :
|
|
28818
|
+
width: isRoot ? 0 : this.props.width || MENU_WIDTH,
|
|
28819
|
+
height: isRoot ? 0 : MENU_ITEM_HEIGHT
|
|
28751
28820
|
},
|
|
28752
28821
|
positioning: "TopRight",
|
|
28753
|
-
verticalOffset: isRoot ? 0 :
|
|
28822
|
+
verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
|
|
28754
28823
|
onPopoverHidden: () => this.closeSubMenu(),
|
|
28755
28824
|
onPopoverMoved: () => this.closeSubMenu()
|
|
28756
28825
|
};
|
|
@@ -29431,8 +29500,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29431
29500
|
const sheetId = getters.getActiveSheetId();
|
|
29432
29501
|
if (getZoneArea(env.model.getters.getSelectedZone()) === 1) env.model.selection.selectTableAroundSelection();
|
|
29433
29502
|
const size = {
|
|
29434
|
-
width:
|
|
29435
|
-
height:
|
|
29503
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
29504
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
29436
29505
|
};
|
|
29437
29506
|
const position = getChartPositionAtCenterOfViewport(getters, size);
|
|
29438
29507
|
if (env.model.dispatch("CREATE_CHART", {
|
|
@@ -31256,7 +31325,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31256
31325
|
function drawHighlight(renderingContext, highlight, rect) {
|
|
31257
31326
|
const { x, y, width, height } = rect;
|
|
31258
31327
|
if (width < 0 || height < 0) return;
|
|
31259
|
-
const color = highlight.color ||
|
|
31328
|
+
const color = highlight.color || HIGHLIGHT_COLOR;
|
|
31260
31329
|
const { ctx } = renderingContext;
|
|
31261
31330
|
ctx.save();
|
|
31262
31331
|
if (!highlight.noBorder) {
|
|
@@ -31751,8 +31820,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31751
31820
|
-webkit-appearance: none;
|
|
31752
31821
|
-moz-appearance: none;
|
|
31753
31822
|
border-radius: 0;
|
|
31754
|
-
width: ${
|
|
31755
|
-
height: ${
|
|
31823
|
+
width: ${CHECKBOX_WIDTH}px;
|
|
31824
|
+
height: ${CHECKBOX_WIDTH}px;
|
|
31756
31825
|
vertical-align: top;
|
|
31757
31826
|
box-sizing: border-box;
|
|
31758
31827
|
outline: none;
|
|
@@ -32694,7 +32763,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32694
32763
|
let { scrollX, scrollY } = getters.getActiveSheetDOMScrollInfo();
|
|
32695
32764
|
const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
|
|
32696
32765
|
let canEdgeScroll = false;
|
|
32697
|
-
let timeoutDelay =
|
|
32766
|
+
let timeoutDelay = MAX_DELAY;
|
|
32698
32767
|
const x = currentEv.clientX - position.left;
|
|
32699
32768
|
colIndex = getters.getColIndex(x);
|
|
32700
32769
|
if (only !== "vertical") {
|
|
@@ -32860,9 +32929,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32860
32929
|
}
|
|
32861
32930
|
}
|
|
32862
32931
|
.o-separator {
|
|
32863
|
-
border-bottom: ${
|
|
32864
|
-
margin-top: ${
|
|
32865
|
-
margin-bottom: ${
|
|
32932
|
+
border-bottom: ${MENU_SEPARATOR_BORDER_WIDTH}px solid ${SEPARATOR_COLOR};
|
|
32933
|
+
margin-top: ${MENU_SEPARATOR_PADDING}px;
|
|
32934
|
+
margin-bottom: ${MENU_SEPARATOR_PADDING}px;
|
|
32866
32935
|
}
|
|
32867
32936
|
|
|
32868
32937
|
.o-custom-selector {
|
|
@@ -33004,7 +33073,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
33004
33073
|
}
|
|
33005
33074
|
get sliderStyle() {
|
|
33006
33075
|
const hue = this.state.currentHslaColor?.h || 0;
|
|
33007
|
-
return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) -
|
|
33076
|
+
return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - ICON_EDGE_LENGTH / 2}px` });
|
|
33008
33077
|
}
|
|
33009
33078
|
get pointerStyle() {
|
|
33010
33079
|
const { s, l } = this.state.currentHslaColor || {
|
|
@@ -34129,13 +34198,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
34129
34198
|
}];
|
|
34130
34199
|
}
|
|
34131
34200
|
get positiveValuesColor() {
|
|
34132
|
-
return this.props.definition.positiveValuesColor ||
|
|
34201
|
+
return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
34133
34202
|
}
|
|
34134
34203
|
get negativeValuesColor() {
|
|
34135
|
-
return this.props.definition.negativeValuesColor ||
|
|
34204
|
+
return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
34136
34205
|
}
|
|
34137
34206
|
get subTotalValuesColor() {
|
|
34138
|
-
return this.props.definition.subTotalValuesColor ||
|
|
34207
|
+
return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
34139
34208
|
}
|
|
34140
34209
|
updateLegendPosition(ev) {
|
|
34141
34210
|
this.props.updateChart(this.props.figureId, { legendPosition: ev.target.value });
|
|
@@ -35409,8 +35478,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35409
35478
|
height: 50px;
|
|
35410
35479
|
width: 50px;
|
|
35411
35480
|
.o-icon {
|
|
35412
|
-
width: ${
|
|
35413
|
-
height: ${
|
|
35481
|
+
width: ${CF_ICON_EDGE_LENGTH}px;
|
|
35482
|
+
height: ${CF_ICON_EDGE_LENGTH}px;
|
|
35414
35483
|
}
|
|
35415
35484
|
}
|
|
35416
35485
|
.o-cf-preview-description {
|
|
@@ -35588,8 +35657,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35588
35657
|
background-color: ${BADGE_SELECTED_COLOR};
|
|
35589
35658
|
}
|
|
35590
35659
|
.o-icon {
|
|
35591
|
-
width: ${
|
|
35592
|
-
height: ${
|
|
35660
|
+
width: ${CF_ICON_EDGE_LENGTH}px;
|
|
35661
|
+
height: ${CF_ICON_EDGE_LENGTH}px;
|
|
35593
35662
|
}
|
|
35594
35663
|
}
|
|
35595
35664
|
.o-cf-iconsets {
|
|
@@ -35863,7 +35932,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35863
35932
|
getPreviewGradient() {
|
|
35864
35933
|
const rule = this.state.rules.colorScale;
|
|
35865
35934
|
const minColor = colorNumberString(rule.minimum.color);
|
|
35866
|
-
const midColor = colorNumberString(rule.midpoint?.color ||
|
|
35935
|
+
const midColor = colorNumberString(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
35867
35936
|
const maxColor = colorNumberString(rule.maximum.color);
|
|
35868
35937
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
35869
35938
|
return rule.midpoint === void 0 ? baseString + minColor + ", " + maxColor + ")" : baseString + minColor + ", " + midColor + ", " + maxColor + ")";
|
|
@@ -37677,7 +37746,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
37677
37746
|
}
|
|
37678
37747
|
get specificRangeMatchesCount() {
|
|
37679
37748
|
const range = this.searchOptions.specificRange;
|
|
37680
|
-
if (!range) return "";
|
|
37749
|
+
if (!range || range.invalidSheetName || range.invalidXc) return "";
|
|
37681
37750
|
const { sheetId, zone } = range;
|
|
37682
37751
|
return _t("%(matches)s matches in range %(range)s of %(sheetName)s", {
|
|
37683
37752
|
matches: this.store.specificRangeMatchesCount,
|
|
@@ -37862,7 +37931,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
37862
37931
|
return {
|
|
37863
37932
|
type: measureDisplayType,
|
|
37864
37933
|
fieldNameWithGranularity,
|
|
37865
|
-
value: value ??
|
|
37934
|
+
value: value ?? PREVIOUS_VALUE
|
|
37866
37935
|
};
|
|
37867
37936
|
}
|
|
37868
37937
|
}
|
|
@@ -40331,7 +40400,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
40331
40400
|
},
|
|
40332
40401
|
{
|
|
40333
40402
|
name: _t("Line Break"),
|
|
40334
|
-
value:
|
|
40403
|
+
value: NEWLINE
|
|
40335
40404
|
}
|
|
40336
40405
|
];
|
|
40337
40406
|
var SplitIntoColumnsPanel = class extends _odoo_owl.Component {
|
|
@@ -41579,7 +41648,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41579
41648
|
showMenu() {
|
|
41580
41649
|
const { x, y, width } = this.menuButtonRect;
|
|
41581
41650
|
const menuPosition = {
|
|
41582
|
-
x: x >=
|
|
41651
|
+
x: x >= MENU_WIDTH ? x - MENU_WIDTH : x + width,
|
|
41583
41652
|
y
|
|
41584
41653
|
};
|
|
41585
41654
|
this.openContextMenu(menuPosition);
|
|
@@ -41717,8 +41786,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41717
41786
|
css`
|
|
41718
41787
|
.o-autofill {
|
|
41719
41788
|
position: absolute;
|
|
41720
|
-
height: ${
|
|
41721
|
-
width: ${
|
|
41789
|
+
height: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41790
|
+
width: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41722
41791
|
border: 1px solid white;
|
|
41723
41792
|
box-sizing: border-box !important;
|
|
41724
41793
|
background-color: #1a73e8;
|
|
@@ -41726,8 +41795,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41726
41795
|
|
|
41727
41796
|
.o-autofill-handler {
|
|
41728
41797
|
position: absolute;
|
|
41729
|
-
height: ${
|
|
41730
|
-
width: ${
|
|
41798
|
+
height: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41799
|
+
width: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41731
41800
|
&:hover {
|
|
41732
41801
|
cursor: crosshair;
|
|
41733
41802
|
}
|
|
@@ -42275,8 +42344,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42275
42344
|
//#region src/components/grid_cell_icon/grid_cell_icon.ts
|
|
42276
42345
|
css`
|
|
42277
42346
|
.o-grid-cell-icon {
|
|
42278
|
-
width: ${
|
|
42279
|
-
height: ${
|
|
42347
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42348
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42280
42349
|
}
|
|
42281
42350
|
`;
|
|
42282
42351
|
var GridCellIcon = class extends _odoo_owl.Component {
|
|
@@ -42308,11 +42377,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42308
42377
|
const end = rect.y + rect.height;
|
|
42309
42378
|
const cell = this.env.model.getters.getCell(cellPosition);
|
|
42310
42379
|
switch (this.props.verticalAlign || cell?.style?.verticalAlign || DEFAULT_VERTICAL_ALIGN) {
|
|
42311
|
-
case "bottom": return end -
|
|
42312
|
-
case "top": return start +
|
|
42380
|
+
case "bottom": return end - GRID_ICON_MARGIN - GRID_ICON_EDGE_LENGTH;
|
|
42381
|
+
case "top": return start + GRID_ICON_MARGIN;
|
|
42313
42382
|
default:
|
|
42314
|
-
const centeringOffset = Math.floor((end - start -
|
|
42315
|
-
return end -
|
|
42383
|
+
const centeringOffset = Math.floor((end - start - GRID_ICON_EDGE_LENGTH) / 2);
|
|
42384
|
+
return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
|
|
42316
42385
|
}
|
|
42317
42386
|
}
|
|
42318
42387
|
getIconHorizontalPosition(rect, cellPosition) {
|
|
@@ -42321,11 +42390,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42321
42390
|
const cell = this.env.model.getters.getCell(cellPosition);
|
|
42322
42391
|
const evaluatedCell = this.env.model.getters.getEvaluatedCell(cellPosition);
|
|
42323
42392
|
switch (this.props.horizontalAlign || cell?.style?.align || evaluatedCell.defaultAlign) {
|
|
42324
|
-
case "right": return end -
|
|
42325
|
-
case "left": return start +
|
|
42393
|
+
case "right": return end - GRID_ICON_MARGIN - GRID_ICON_EDGE_LENGTH;
|
|
42394
|
+
case "left": return start + GRID_ICON_MARGIN;
|
|
42326
42395
|
default:
|
|
42327
|
-
const centeringOffset = Math.floor((end - start -
|
|
42328
|
-
return end -
|
|
42396
|
+
const centeringOffset = Math.floor((end - start - GRID_ICON_EDGE_LENGTH) / 2);
|
|
42397
|
+
return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
|
|
42329
42398
|
}
|
|
42330
42399
|
}
|
|
42331
42400
|
isPositionVisible(position) {
|
|
@@ -42340,7 +42409,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42340
42409
|
.o-dv-checkbox {
|
|
42341
42410
|
box-sizing: border-box !important;
|
|
42342
42411
|
accent-color: #808080;
|
|
42343
|
-
margin: ${(
|
|
42412
|
+
margin: ${(GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2}px;
|
|
42344
42413
|
/** required to prevent the checkbox position to be sensible to the font-size (affects Firefox) */
|
|
42345
42414
|
position: absolute;
|
|
42346
42415
|
}
|
|
@@ -42375,8 +42444,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42375
42444
|
.o-dv-list-icon {
|
|
42376
42445
|
color: ${TEXT_BODY_MUTED};
|
|
42377
42446
|
border-radius: 1px;
|
|
42378
|
-
height: ${
|
|
42379
|
-
width: ${
|
|
42447
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42448
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42380
42449
|
|
|
42381
42450
|
&:hover {
|
|
42382
42451
|
color: #ffffff;
|
|
@@ -42691,19 +42760,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42691
42760
|
position = fig.y;
|
|
42692
42761
|
break;
|
|
42693
42762
|
case "bottom":
|
|
42694
|
-
position = fig.y + fig.height -
|
|
42763
|
+
position = fig.y + fig.height - FIGURE_BORDER_WIDTH;
|
|
42695
42764
|
break;
|
|
42696
42765
|
case "vCenter":
|
|
42697
|
-
position = fig.y + Math.floor(fig.height / 2) -
|
|
42766
|
+
position = fig.y + Math.floor(fig.height / 2) - FIGURE_BORDER_WIDTH;
|
|
42698
42767
|
break;
|
|
42699
42768
|
case "left":
|
|
42700
42769
|
position = fig.x;
|
|
42701
42770
|
break;
|
|
42702
42771
|
case "right":
|
|
42703
|
-
position = fig.x + fig.width -
|
|
42772
|
+
position = fig.x + fig.width - FIGURE_BORDER_WIDTH;
|
|
42704
42773
|
break;
|
|
42705
42774
|
case "hCenter":
|
|
42706
|
-
position = fig.x + Math.floor(fig.width / 2) -
|
|
42775
|
+
position = fig.x + Math.floor(fig.width / 2) - FIGURE_BORDER_WIDTH;
|
|
42707
42776
|
break;
|
|
42708
42777
|
}
|
|
42709
42778
|
return {
|
|
@@ -42960,7 +43029,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42960
43029
|
y
|
|
42961
43030
|
};
|
|
42962
43031
|
const keepRatio = figureRegistry.get(figure.tag).keepRatio || false;
|
|
42963
|
-
const minFigSize = figureRegistry.get(figure.tag).minFigSize ||
|
|
43032
|
+
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
42964
43033
|
const onMouseMove = (ev) => {
|
|
42965
43034
|
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, {
|
|
42966
43035
|
x: ev.clientX,
|
|
@@ -43051,8 +43120,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43051
43120
|
display: flex;
|
|
43052
43121
|
align-items: center;
|
|
43053
43122
|
justify-content: center;
|
|
43054
|
-
width: ${
|
|
43055
|
-
height: ${
|
|
43123
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
43124
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
43056
43125
|
|
|
43057
43126
|
&:hover {
|
|
43058
43127
|
background: ${FILTERS_COLOR};
|
|
@@ -43679,9 +43748,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43679
43748
|
.o-col-resizer {
|
|
43680
43749
|
position: absolute;
|
|
43681
43750
|
top: 0;
|
|
43682
|
-
left: ${
|
|
43683
|
-
right: ${
|
|
43684
|
-
height: ${
|
|
43751
|
+
left: ${HEADER_WIDTH}px;
|
|
43752
|
+
right: ${SCROLLBAR_WIDTH}px;
|
|
43753
|
+
height: ${HEADER_HEIGHT}px;
|
|
43685
43754
|
&.o-dragging {
|
|
43686
43755
|
cursor: grabbing;
|
|
43687
43756
|
}
|
|
@@ -43689,14 +43758,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43689
43758
|
cursor: grab;
|
|
43690
43759
|
}
|
|
43691
43760
|
.dragging-col-line {
|
|
43692
|
-
top: ${
|
|
43761
|
+
top: ${HEADER_HEIGHT}px;
|
|
43693
43762
|
position: absolute;
|
|
43694
43763
|
width: 2px;
|
|
43695
43764
|
height: 10000px;
|
|
43696
43765
|
background-color: black;
|
|
43697
43766
|
}
|
|
43698
43767
|
.dragging-col-shadow {
|
|
43699
|
-
top: ${
|
|
43768
|
+
top: ${HEADER_HEIGHT}px;
|
|
43700
43769
|
position: absolute;
|
|
43701
43770
|
height: 10000px;
|
|
43702
43771
|
background-color: black;
|
|
@@ -43704,13 +43773,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43704
43773
|
}
|
|
43705
43774
|
.o-handle {
|
|
43706
43775
|
position: absolute;
|
|
43707
|
-
height: ${
|
|
43776
|
+
height: ${HEADER_HEIGHT}px;
|
|
43708
43777
|
width: 4px;
|
|
43709
43778
|
cursor: e-resize;
|
|
43710
43779
|
background-color: ${SELECTION_BORDER_COLOR};
|
|
43711
43780
|
}
|
|
43712
43781
|
.dragging-resizer {
|
|
43713
|
-
top: ${
|
|
43782
|
+
top: ${HEADER_HEIGHT}px;
|
|
43714
43783
|
position: absolute;
|
|
43715
43784
|
margin-left: 2px;
|
|
43716
43785
|
width: 1px;
|
|
@@ -43735,7 +43804,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43735
43804
|
this.colResizerRef = (0, _odoo_owl.useRef)("colResizer");
|
|
43736
43805
|
this.PADDING = 15;
|
|
43737
43806
|
this.MAX_SIZE_MARGIN = 90;
|
|
43738
|
-
this.MIN_ELEMENT_SIZE =
|
|
43807
|
+
this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
|
|
43739
43808
|
}
|
|
43740
43809
|
get sheetId() {
|
|
43741
43810
|
return this.env.model.getters.getActiveSheetId();
|
|
@@ -43834,10 +43903,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43834
43903
|
css`
|
|
43835
43904
|
.o-row-resizer {
|
|
43836
43905
|
position: absolute;
|
|
43837
|
-
top: ${
|
|
43906
|
+
top: ${HEADER_HEIGHT}px;
|
|
43838
43907
|
left: 0;
|
|
43839
|
-
bottom: ${
|
|
43840
|
-
width: ${
|
|
43908
|
+
bottom: ${SCROLLBAR_WIDTH}px;
|
|
43909
|
+
width: ${HEADER_WIDTH}px;
|
|
43841
43910
|
&.o-dragging {
|
|
43842
43911
|
cursor: grabbing;
|
|
43843
43912
|
}
|
|
@@ -43845,14 +43914,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43845
43914
|
cursor: grab;
|
|
43846
43915
|
}
|
|
43847
43916
|
.dragging-row-line {
|
|
43848
|
-
left: ${
|
|
43917
|
+
left: ${HEADER_WIDTH}px;
|
|
43849
43918
|
position: absolute;
|
|
43850
43919
|
width: 10000px;
|
|
43851
43920
|
height: 2px;
|
|
43852
43921
|
background-color: black;
|
|
43853
43922
|
}
|
|
43854
43923
|
.dragging-row-shadow {
|
|
43855
|
-
left: ${
|
|
43924
|
+
left: ${HEADER_WIDTH}px;
|
|
43856
43925
|
position: absolute;
|
|
43857
43926
|
width: 10000px;
|
|
43858
43927
|
background-color: black;
|
|
@@ -43861,12 +43930,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43861
43930
|
.o-handle {
|
|
43862
43931
|
position: absolute;
|
|
43863
43932
|
height: 4px;
|
|
43864
|
-
width: ${
|
|
43933
|
+
width: ${HEADER_WIDTH}px;
|
|
43865
43934
|
cursor: n-resize;
|
|
43866
43935
|
background-color: ${SELECTION_BORDER_COLOR};
|
|
43867
43936
|
}
|
|
43868
43937
|
.dragging-resizer {
|
|
43869
|
-
left: ${
|
|
43938
|
+
left: ${HEADER_WIDTH}px;
|
|
43870
43939
|
position: absolute;
|
|
43871
43940
|
margin-top: 2px;
|
|
43872
43941
|
width: 10000px;
|
|
@@ -43890,7 +43959,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43890
43959
|
this.rowResizerRef = (0, _odoo_owl.useRef)("rowResizer");
|
|
43891
43960
|
this.PADDING = 5;
|
|
43892
43961
|
this.MAX_SIZE_MARGIN = 60;
|
|
43893
|
-
this.MIN_ELEMENT_SIZE =
|
|
43962
|
+
this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
|
|
43894
43963
|
}
|
|
43895
43964
|
rowResizerRef;
|
|
43896
43965
|
get sheetId() {
|
|
@@ -43997,8 +44066,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43997
44066
|
top: 0;
|
|
43998
44067
|
left: 0;
|
|
43999
44068
|
right: 0;
|
|
44000
|
-
width: ${
|
|
44001
|
-
height: ${
|
|
44069
|
+
width: ${HEADER_WIDTH}px;
|
|
44070
|
+
height: ${HEADER_HEIGHT}px;
|
|
44002
44071
|
}
|
|
44003
44072
|
}
|
|
44004
44073
|
`;
|
|
@@ -44033,7 +44102,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44033
44102
|
*/
|
|
44034
44103
|
getHeaderOffset(dimension, start, index) {
|
|
44035
44104
|
let size = this.getters.getColRowOffsetInViewport(dimension, start, index);
|
|
44036
|
-
if (!this.getters.isDashboard()) size += dimension === "ROW" ?
|
|
44105
|
+
if (!this.getters.isDashboard()) size += dimension === "ROW" ? HEADER_HEIGHT : HEADER_WIDTH;
|
|
44037
44106
|
return size;
|
|
44038
44107
|
}
|
|
44039
44108
|
drawLayer(renderingContext, layer) {
|
|
@@ -44215,8 +44284,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44215
44284
|
}
|
|
44216
44285
|
ctx.fillStyle = style.textColor || "#000";
|
|
44217
44286
|
let x = box.x;
|
|
44218
|
-
if (align === "left") x +=
|
|
44219
|
-
else if (align === "right") x += box.width -
|
|
44287
|
+
if (align === "left") x += MIN_CELL_TEXT_MARGIN + (box.image ? box.image.size + MIN_CF_ICON_MARGIN : 0);
|
|
44288
|
+
else if (align === "right") x += box.width - MIN_CELL_TEXT_MARGIN - (box.hasIcon ? GRID_ICON_EDGE_LENGTH + GRID_ICON_MARGIN : 0);
|
|
44220
44289
|
else x += box.width / 2;
|
|
44221
44290
|
ctx.textAlign = align;
|
|
44222
44291
|
if (box.clipRect) {
|
|
@@ -44234,7 +44303,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44234
44303
|
x: Math.round(x),
|
|
44235
44304
|
y: Math.round(y)
|
|
44236
44305
|
}, style.underline, style.strikethrough);
|
|
44237
|
-
y +=
|
|
44306
|
+
y += MIN_CELL_TEXT_MARGIN + textLineHeight;
|
|
44238
44307
|
}
|
|
44239
44308
|
if (box.clipRect) ctx.restore();
|
|
44240
44309
|
}
|
|
@@ -44252,7 +44321,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44252
44321
|
}
|
|
44253
44322
|
const iconSize = box.image.size;
|
|
44254
44323
|
const y = this.computeTextYCoordinate(box, iconSize);
|
|
44255
|
-
ctx.drawImage(icon, box.x +
|
|
44324
|
+
ctx.drawImage(icon, box.x + MIN_CF_ICON_MARGIN, y, iconSize, iconSize);
|
|
44256
44325
|
if (box.image.clipIcon) ctx.restore();
|
|
44257
44326
|
}
|
|
44258
44327
|
}
|
|
@@ -44264,13 +44333,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44264
44333
|
computeTextYCoordinate(box, textLineHeight, numberOfLines = 1) {
|
|
44265
44334
|
const y = box.y + 1;
|
|
44266
44335
|
const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
|
|
44267
|
-
const hasEnoughSpaces = box.height > textHeight +
|
|
44336
|
+
const hasEnoughSpaces = box.height > textHeight + MIN_CELL_TEXT_MARGIN * 2;
|
|
44268
44337
|
const verticalAlign = box.verticalAlign || DEFAULT_VERTICAL_ALIGN;
|
|
44269
44338
|
if (hasEnoughSpaces) {
|
|
44270
44339
|
if (verticalAlign === "middle") return y + (box.height - textHeight) / 2;
|
|
44271
|
-
if (verticalAlign === "bottom") return y + box.height - textHeight -
|
|
44340
|
+
if (verticalAlign === "bottom") return y + box.height - textHeight - MIN_CELL_TEXT_MARGIN;
|
|
44272
44341
|
}
|
|
44273
|
-
return y +
|
|
44342
|
+
return y + MIN_CELL_TEXT_MARGIN;
|
|
44274
44343
|
}
|
|
44275
44344
|
drawHeaders(renderingContext) {
|
|
44276
44345
|
const { ctx, thinLineWidth } = renderingContext;
|
|
@@ -44287,7 +44356,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44287
44356
|
const numberOfRows = this.getters.getNumberRows(sheetId);
|
|
44288
44357
|
const activeCols = this.getters.getActiveCols();
|
|
44289
44358
|
const activeRows = this.getters.getActiveRows();
|
|
44290
|
-
ctx.font = `400 ${
|
|
44359
|
+
ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
44291
44360
|
ctx.textAlign = "center";
|
|
44292
44361
|
ctx.textBaseline = "middle";
|
|
44293
44362
|
ctx.lineWidth = thinLineWidth;
|
|
@@ -44305,7 +44374,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44305
44374
|
if (isColActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
44306
44375
|
else if (isColSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
44307
44376
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
44308
|
-
ctx.fillRect(x, 0, width,
|
|
44377
|
+
ctx.fillRect(x, 0, width, HEADER_HEIGHT);
|
|
44309
44378
|
}
|
|
44310
44379
|
for (const row of visibleRows) {
|
|
44311
44380
|
const rowZone = {
|
|
@@ -44320,13 +44389,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44320
44389
|
if (isRowActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
44321
44390
|
else if (isRowSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
44322
44391
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
44323
|
-
ctx.fillRect(0, y,
|
|
44392
|
+
ctx.fillRect(0, y, HEADER_WIDTH, height);
|
|
44324
44393
|
}
|
|
44325
44394
|
ctx.beginPath();
|
|
44326
|
-
ctx.moveTo(
|
|
44327
|
-
ctx.lineTo(
|
|
44328
|
-
ctx.moveTo(0,
|
|
44329
|
-
ctx.lineTo(width,
|
|
44395
|
+
ctx.moveTo(HEADER_WIDTH, 0);
|
|
44396
|
+
ctx.lineTo(HEADER_WIDTH, height);
|
|
44397
|
+
ctx.moveTo(0, HEADER_HEIGHT);
|
|
44398
|
+
ctx.lineTo(width, HEADER_HEIGHT);
|
|
44330
44399
|
ctx.strokeStyle = HEADER_BORDER_COLOR;
|
|
44331
44400
|
ctx.stroke();
|
|
44332
44401
|
ctx.beginPath();
|
|
@@ -44335,25 +44404,25 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44335
44404
|
const colName = numberToLetters(col);
|
|
44336
44405
|
ctx.fillStyle = activeCols.has(col) ? "#fff" : TEXT_HEADER_COLOR;
|
|
44337
44406
|
const colStart = this.getHeaderOffset("COL", left, col);
|
|
44338
|
-
ctx.fillText(colName, colStart + colSize / 2,
|
|
44407
|
+
ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
|
|
44339
44408
|
ctx.moveTo(colStart + colSize, 0);
|
|
44340
|
-
ctx.lineTo(colStart + colSize,
|
|
44409
|
+
ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
|
|
44341
44410
|
}
|
|
44342
44411
|
for (const row of visibleRows) {
|
|
44343
44412
|
const rowSize = this.getters.getRowSize(sheetId, row);
|
|
44344
44413
|
ctx.fillStyle = activeRows.has(row) ? "#fff" : TEXT_HEADER_COLOR;
|
|
44345
44414
|
const rowStart = this.getHeaderOffset("ROW", top, row);
|
|
44346
|
-
ctx.fillText(String(row + 1),
|
|
44415
|
+
ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
|
|
44347
44416
|
ctx.moveTo(0, rowStart + rowSize);
|
|
44348
|
-
ctx.lineTo(
|
|
44417
|
+
ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
|
|
44349
44418
|
}
|
|
44350
44419
|
ctx.stroke();
|
|
44351
44420
|
}
|
|
44352
44421
|
drawFrozenPanesHeaders(renderingContext) {
|
|
44353
44422
|
const { ctx, thinLineWidth } = renderingContext;
|
|
44354
44423
|
const { x: offsetCorrectionX, y: offsetCorrectionY } = this.getters.getMainViewportCoordinates();
|
|
44355
|
-
const widthCorrection = this.getters.isDashboard() ? 0 :
|
|
44356
|
-
const heightCorrection = this.getters.isDashboard() ? 0 :
|
|
44424
|
+
const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
|
|
44425
|
+
const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
|
|
44357
44426
|
ctx.lineWidth = 6 * thinLineWidth;
|
|
44358
44427
|
ctx.strokeStyle = FROZEN_PANE_HEADER_BORDER_COLOR;
|
|
44359
44428
|
ctx.beginPath();
|
|
@@ -44381,8 +44450,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44381
44450
|
bottom: visibleRows[visibleRows.length - 1]
|
|
44382
44451
|
};
|
|
44383
44452
|
const rect = this.getters.getVisibleRect(viewport);
|
|
44384
|
-
const widthCorrection = this.getters.isDashboard() ? 0 :
|
|
44385
|
-
const heightCorrection = this.getters.isDashboard() ? 0 :
|
|
44453
|
+
const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
|
|
44454
|
+
const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
|
|
44386
44455
|
ctx.lineWidth = 6 * thinLineWidth;
|
|
44387
44456
|
ctx.strokeStyle = FROZEN_PANE_BORDER_COLOR;
|
|
44388
44457
|
ctx.beginPath();
|
|
@@ -44466,7 +44535,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44466
44535
|
/** Icon */
|
|
44467
44536
|
const iconSrc = this.getters.getCellIconSrc(position);
|
|
44468
44537
|
const fontSizePX = computeTextFontSizeInPixels(box.style);
|
|
44469
|
-
const iconBoxWidth = iconSrc ?
|
|
44538
|
+
const iconBoxWidth = iconSrc ? MIN_CF_ICON_MARGIN + fontSizePX : 0;
|
|
44470
44539
|
if (iconSrc) {
|
|
44471
44540
|
const imageHtmlElement = loadIconImage(iconSrc);
|
|
44472
44541
|
box.image = {
|
|
@@ -44484,19 +44553,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44484
44553
|
if (cell.type === "empty" || this.getters.isCellValidCheckbox(position)) return box;
|
|
44485
44554
|
/** Filter Header or data validation icon */
|
|
44486
44555
|
box.hasIcon = this.getters.doesCellHaveGridIcon(position);
|
|
44487
|
-
const headerIconWidth = box.hasIcon ?
|
|
44556
|
+
const headerIconWidth = box.hasIcon ? GRID_ICON_EDGE_LENGTH + GRID_ICON_MARGIN : 0;
|
|
44488
44557
|
/** Content */
|
|
44489
44558
|
const style = this.getters.getCellComputedStyle(position);
|
|
44490
44559
|
const wrapping = style.wrapping || "overflow";
|
|
44491
44560
|
const wrapText = wrapping === "wrap" && !showFormula;
|
|
44492
|
-
const maxWidth = width - 2 *
|
|
44561
|
+
const maxWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
|
|
44493
44562
|
const formatWidth = style.align ? 0 : maxWidth;
|
|
44494
44563
|
const multiLineText = this.getters.getCellMultiLineText(position, {
|
|
44495
44564
|
maxWidth,
|
|
44496
44565
|
formatWidth,
|
|
44497
44566
|
wrapText
|
|
44498
44567
|
});
|
|
44499
|
-
const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, style) +
|
|
44568
|
+
const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, style) + MIN_CELL_TEXT_MARGIN));
|
|
44500
44569
|
const contentWidth = iconBoxWidth + textWidth + headerIconWidth;
|
|
44501
44570
|
const align = this.computeCellAlignment(position, contentWidth > width);
|
|
44502
44571
|
box.content = {
|
|
@@ -44708,7 +44777,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44708
44777
|
resetTimeout = setTimeout(() => {
|
|
44709
44778
|
velocityX = 0;
|
|
44710
44779
|
velocityY = 0;
|
|
44711
|
-
},
|
|
44780
|
+
}, resetTimeoutDuration);
|
|
44712
44781
|
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
44713
44782
|
}
|
|
44714
44783
|
function onTouchEnd(ev) {
|
|
@@ -44739,7 +44808,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44739
44808
|
//#region src/components/helpers/wheel_hook.ts
|
|
44740
44809
|
function useWheelHandler(handler) {
|
|
44741
44810
|
function normalize(val, deltaMode) {
|
|
44742
|
-
return val * (deltaMode === 0 ? 1 :
|
|
44811
|
+
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
44743
44812
|
}
|
|
44744
44813
|
const onMouseWheel = (ev) => {
|
|
44745
44814
|
handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
|
|
@@ -44855,8 +44924,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44855
44924
|
const leftValue = this.isLeft ? rect.x : rect.x + rect.width;
|
|
44856
44925
|
const topValue = this.isTop ? rect.y : rect.y + rect.height;
|
|
44857
44926
|
return cssPropertiesToCss({
|
|
44858
|
-
left: `${leftValue -
|
|
44859
|
-
top: `${topValue -
|
|
44927
|
+
left: `${leftValue - AUTOFILL_EDGE_LENGTH / 2}px`,
|
|
44928
|
+
top: `${topValue - AUTOFILL_EDGE_LENGTH / 2}px`,
|
|
44860
44929
|
"background-color": this.props.color
|
|
44861
44930
|
});
|
|
44862
44931
|
}
|
|
@@ -44996,8 +45065,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44996
45065
|
&.corner {
|
|
44997
45066
|
right: 0px;
|
|
44998
45067
|
bottom: 0px;
|
|
44999
|
-
height: ${
|
|
45000
|
-
width: ${
|
|
45068
|
+
height: ${SCROLLBAR_WIDTH}px;
|
|
45069
|
+
width: ${SCROLLBAR_WIDTH}px;
|
|
45001
45070
|
border-top: 1px solid #e2e3e3;
|
|
45002
45071
|
border-left: 1px solid #e2e3e3;
|
|
45003
45072
|
}
|
|
@@ -45090,7 +45159,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45090
45159
|
return {
|
|
45091
45160
|
left: `${this.props.leftOffset + x}px`,
|
|
45092
45161
|
bottom: "0px",
|
|
45093
|
-
height: `${
|
|
45162
|
+
height: `${SCROLLBAR_WIDTH}px`,
|
|
45094
45163
|
right: `0px`
|
|
45095
45164
|
};
|
|
45096
45165
|
}
|
|
@@ -45136,7 +45205,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45136
45205
|
return {
|
|
45137
45206
|
top: `${this.props.topOffset + y}px`,
|
|
45138
45207
|
right: "0px",
|
|
45139
|
-
width: `${
|
|
45208
|
+
width: `${SCROLLBAR_WIDTH}px`,
|
|
45140
45209
|
bottom: `0px`
|
|
45141
45210
|
};
|
|
45142
45211
|
}
|
|
@@ -45163,7 +45232,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45163
45232
|
];
|
|
45164
45233
|
currentPanelProps = {};
|
|
45165
45234
|
componentTag = "";
|
|
45166
|
-
panelSize =
|
|
45235
|
+
panelSize = DEFAULT_SIDE_PANEL_SIZE;
|
|
45167
45236
|
get isOpen() {
|
|
45168
45237
|
if (!this.componentTag) return false;
|
|
45169
45238
|
return this.computeState(this.componentTag, this.currentPanelProps).isOpen;
|
|
@@ -45194,12 +45263,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45194
45263
|
this.componentTag = "";
|
|
45195
45264
|
}
|
|
45196
45265
|
changePanelSize(size, spreadsheetElWidth) {
|
|
45197
|
-
if (size <
|
|
45198
|
-
else if (size > spreadsheetElWidth -
|
|
45266
|
+
if (size < DEFAULT_SIDE_PANEL_SIZE) this.panelSize = DEFAULT_SIDE_PANEL_SIZE;
|
|
45267
|
+
else if (size > spreadsheetElWidth - MIN_SHEET_VIEW_WIDTH) this.panelSize = Math.max(spreadsheetElWidth - MIN_SHEET_VIEW_WIDTH, DEFAULT_SIDE_PANEL_SIZE);
|
|
45199
45268
|
else this.panelSize = size;
|
|
45200
45269
|
}
|
|
45201
45270
|
resetPanelSize() {
|
|
45202
|
-
this.panelSize =
|
|
45271
|
+
this.panelSize = DEFAULT_SIDE_PANEL_SIZE;
|
|
45203
45272
|
}
|
|
45204
45273
|
computeState(componentTag, panelProps) {
|
|
45205
45274
|
const customComputeState = sidePanelRegistry.get(componentTag).computeState;
|
|
@@ -45315,8 +45384,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45315
45384
|
HorizontalScrollBar,
|
|
45316
45385
|
TableResizer
|
|
45317
45386
|
};
|
|
45318
|
-
HEADER_HEIGHT =
|
|
45319
|
-
HEADER_WIDTH =
|
|
45387
|
+
HEADER_HEIGHT = HEADER_HEIGHT;
|
|
45388
|
+
HEADER_WIDTH = HEADER_WIDTH;
|
|
45320
45389
|
menuState;
|
|
45321
45390
|
gridRef;
|
|
45322
45391
|
highlightStore;
|
|
@@ -45374,10 +45443,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45374
45443
|
}
|
|
45375
45444
|
get gridOverlayDimensions() {
|
|
45376
45445
|
return cssPropertiesToCss({
|
|
45377
|
-
top: `${
|
|
45378
|
-
left: `${
|
|
45379
|
-
height: `calc(100% - ${
|
|
45380
|
-
width: `calc(100% - ${
|
|
45446
|
+
top: `${HEADER_HEIGHT}px`,
|
|
45447
|
+
left: `${HEADER_WIDTH}px`,
|
|
45448
|
+
height: `calc(100% - ${HEADER_HEIGHT + SCROLLBAR_WIDTH}px)`,
|
|
45449
|
+
width: `calc(100% - ${HEADER_WIDTH + SCROLLBAR_WIDTH}px)`
|
|
45381
45450
|
});
|
|
45382
45451
|
}
|
|
45383
45452
|
onClosePopover() {
|
|
@@ -45550,8 +45619,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45550
45619
|
const zone = this.env.model.getters.getSelectedZone();
|
|
45551
45620
|
const rect = this.env.model.getters.getVisibleRect(zone);
|
|
45552
45621
|
return {
|
|
45553
|
-
left: rect.x + rect.width -
|
|
45554
|
-
top: rect.y + rect.height -
|
|
45622
|
+
left: rect.x + rect.width - AUTOFILL_EDGE_LENGTH / 2,
|
|
45623
|
+
top: rect.y + rect.height - AUTOFILL_EDGE_LENGTH / 2
|
|
45555
45624
|
};
|
|
45556
45625
|
}
|
|
45557
45626
|
get isAutofillVisible() {
|
|
@@ -45568,8 +45637,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45568
45637
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
45569
45638
|
width,
|
|
45570
45639
|
height,
|
|
45571
|
-
gridOffsetX:
|
|
45572
|
-
gridOffsetY:
|
|
45640
|
+
gridOffsetX: HEADER_WIDTH,
|
|
45641
|
+
gridOffsetY: HEADER_HEIGHT
|
|
45573
45642
|
});
|
|
45574
45643
|
}
|
|
45575
45644
|
moveCanvas(deltaX, deltaY) {
|
|
@@ -47305,8 +47374,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47305
47374
|
case "DUPLICATE_SHEET": {
|
|
47306
47375
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
47307
47376
|
for (const fig of sheetFiguresFrom) if (fig.tag === "chart") {
|
|
47308
|
-
const figureIdBase = fig.id.split(
|
|
47309
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
47377
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
47378
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
47310
47379
|
const chart = this.charts[fig.id]?.copyForSheetId(cmd.sheetIdTo);
|
|
47311
47380
|
if (chart) this.dispatch("CREATE_CHART", {
|
|
47312
47381
|
id: duplicatedFigureId,
|
|
@@ -47383,8 +47452,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47383
47452
|
x: 0,
|
|
47384
47453
|
y: 0
|
|
47385
47454
|
}, size = {
|
|
47386
|
-
width:
|
|
47387
|
-
height:
|
|
47455
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
47456
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
47388
47457
|
}) {
|
|
47389
47458
|
if (this.getters.getFigure(sheetId, id)) return;
|
|
47390
47459
|
const figure = {
|
|
@@ -48026,7 +48095,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48026
48095
|
onRowDeletion(sheetId) {
|
|
48027
48096
|
const numHeader = this.getters.getNumberRows(sheetId);
|
|
48028
48097
|
let gridHeight = 0;
|
|
48029
|
-
for (let i = 0; i < numHeader; i++) gridHeight += this.getters.getUserRowSize(sheetId, i) ||
|
|
48098
|
+
for (let i = 0; i < numHeader; i++) gridHeight += this.getters.getUserRowSize(sheetId, i) || DEFAULT_CELL_HEIGHT;
|
|
48030
48099
|
const figures = this.getters.getFigures(sheetId);
|
|
48031
48100
|
for (const figure of figures) {
|
|
48032
48101
|
const newY = Math.min(figure.y, gridHeight - figure.height);
|
|
@@ -48157,7 +48226,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48157
48226
|
}
|
|
48158
48227
|
}
|
|
48159
48228
|
getColSize(sheetId, index) {
|
|
48160
|
-
return Math.round(this.sizes[sheetId]?.["COL"][index] ||
|
|
48229
|
+
return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
|
|
48161
48230
|
}
|
|
48162
48231
|
getUserRowSize(sheetId, index) {
|
|
48163
48232
|
const rowSize = this.sizes[sheetId]?.["ROW"][index];
|
|
@@ -48190,7 +48259,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48190
48259
|
if (sheet.rows === void 0) sheet.rows = {};
|
|
48191
48260
|
for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
|
|
48192
48261
|
...sheet.rows[row],
|
|
48193
|
-
size: this.getUserRowSize(sheet.id, row) ??
|
|
48262
|
+
size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
|
|
48194
48263
|
};
|
|
48195
48264
|
if (sheet.cols === void 0) sheet.cols = {};
|
|
48196
48265
|
for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
|
|
@@ -48371,8 +48440,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48371
48440
|
case "DUPLICATE_SHEET": {
|
|
48372
48441
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
48373
48442
|
for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
|
|
48374
|
-
const figureIdBase = fig.id.split(
|
|
48375
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
48443
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
48444
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
48376
48445
|
const image = this.getImage(fig.id);
|
|
48377
48446
|
if (image) {
|
|
48378
48447
|
const size = {
|
|
@@ -52679,7 +52748,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52679
52748
|
col,
|
|
52680
52749
|
row
|
|
52681
52750
|
});
|
|
52682
|
-
const background = style.fillColor ||
|
|
52751
|
+
const background = style.fillColor || BACKGROUND_CHART_COLOR;
|
|
52683
52752
|
return {
|
|
52684
52753
|
background,
|
|
52685
52754
|
fontColor: style.textColor || chartFontColor(background)
|
|
@@ -53376,7 +53445,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53376
53445
|
}
|
|
53377
53446
|
}
|
|
53378
53447
|
getRowSize(sheetId, row) {
|
|
53379
|
-
return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ??
|
|
53448
|
+
return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? DEFAULT_CELL_HEIGHT);
|
|
53380
53449
|
}
|
|
53381
53450
|
getHeaderSize(sheetId, dimension, index) {
|
|
53382
53451
|
if (this.getters.isHeaderHidden(sheetId, dimension, index)) return 0;
|
|
@@ -53393,8 +53462,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53393
53462
|
col,
|
|
53394
53463
|
row
|
|
53395
53464
|
});
|
|
53396
|
-
if (updatedCellHeight <=
|
|
53397
|
-
if (!tallestCellInRow && updatedCellHeight >
|
|
53465
|
+
if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
|
|
53466
|
+
if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
|
|
53398
53467
|
const newTallestCell = {
|
|
53399
53468
|
cell: {
|
|
53400
53469
|
sheetId,
|
|
@@ -53419,7 +53488,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53419
53488
|
* merge, or the height of the cell computed based on its style/content.
|
|
53420
53489
|
*/
|
|
53421
53490
|
getCellHeight(position) {
|
|
53422
|
-
if (this.isInMultiRowMerge(position)) return
|
|
53491
|
+
if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
|
|
53423
53492
|
const cell = this.getters.getCell(position);
|
|
53424
53493
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
53425
53494
|
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
@@ -53441,7 +53510,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53441
53510
|
if (!cell) continue;
|
|
53442
53511
|
const position = this.getters.getCellPosition(cell.id);
|
|
53443
53512
|
const cellHeight = this.getCellHeight(position);
|
|
53444
|
-
if (cellHeight > maxHeight && cellHeight >
|
|
53513
|
+
if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
|
|
53445
53514
|
maxHeight = cellHeight;
|
|
53446
53515
|
tallestCell = {
|
|
53447
53516
|
cell: position,
|
|
@@ -53449,7 +53518,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53449
53518
|
};
|
|
53450
53519
|
}
|
|
53451
53520
|
}
|
|
53452
|
-
if (tallestCell && tallestCell.size >
|
|
53521
|
+
if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
|
|
53453
53522
|
}
|
|
53454
53523
|
};
|
|
53455
53524
|
|
|
@@ -53837,7 +53906,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53837
53906
|
* @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
|
|
53838
53907
|
*/
|
|
53839
53908
|
getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
|
|
53840
|
-
const comparedDomain = valueToCompare ===
|
|
53909
|
+
const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
|
|
53841
53910
|
if (deepEquals(comparedDomain, domain)) return "sameValue";
|
|
53842
53911
|
if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
|
|
53843
53912
|
const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
|
|
@@ -55312,7 +55381,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55312
55381
|
this.revisions = revisions;
|
|
55313
55382
|
this.transportService = transportService;
|
|
55314
55383
|
this.serverRevisionId = serverRevisionId;
|
|
55315
|
-
this.debouncedMove = debounce(this._move.bind(this),
|
|
55384
|
+
this.debouncedMove = debounce(this._move.bind(this), DEBOUNCE_TIME);
|
|
55316
55385
|
}
|
|
55317
55386
|
canApplyOptimisticUpdate() {
|
|
55318
55387
|
return !this.waitingUndoRedoAck;
|
|
@@ -55329,7 +55398,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55329
55398
|
this.trigger("new-local-state-update", { id: revision.id });
|
|
55330
55399
|
this.sendUpdateMessage({
|
|
55331
55400
|
type: "REMOTE_REVISION",
|
|
55332
|
-
version:
|
|
55401
|
+
version: MESSAGE_VERSION,
|
|
55333
55402
|
serverRevisionId: this.serverRevisionId,
|
|
55334
55403
|
nextRevisionId: revision.id,
|
|
55335
55404
|
clientId: revision.clientId,
|
|
@@ -55340,7 +55409,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55340
55409
|
this.waitingUndoRedoAck = true;
|
|
55341
55410
|
this.sendUpdateMessage({
|
|
55342
55411
|
type: "REVISION_UNDONE",
|
|
55343
|
-
version:
|
|
55412
|
+
version: MESSAGE_VERSION,
|
|
55344
55413
|
serverRevisionId: this.serverRevisionId,
|
|
55345
55414
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
55346
55415
|
undoneRevisionId: revisionId
|
|
@@ -55350,7 +55419,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55350
55419
|
this.waitingUndoRedoAck = true;
|
|
55351
55420
|
this.sendUpdateMessage({
|
|
55352
55421
|
type: "REVISION_REDONE",
|
|
55353
|
-
version:
|
|
55422
|
+
version: MESSAGE_VERSION,
|
|
55354
55423
|
serverRevisionId: this.serverRevisionId,
|
|
55355
55424
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
55356
55425
|
redoneRevisionId: revisionId
|
|
@@ -55393,7 +55462,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55393
55462
|
this.transportService.sendMessage({
|
|
55394
55463
|
type: "CLIENT_LEFT",
|
|
55395
55464
|
clientId: this.clientId,
|
|
55396
|
-
version:
|
|
55465
|
+
version: MESSAGE_VERSION
|
|
55397
55466
|
});
|
|
55398
55467
|
}
|
|
55399
55468
|
/**
|
|
@@ -55410,7 +55479,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55410
55479
|
...data,
|
|
55411
55480
|
revisionId: snapshotId
|
|
55412
55481
|
},
|
|
55413
|
-
version:
|
|
55482
|
+
version: MESSAGE_VERSION
|
|
55414
55483
|
});
|
|
55415
55484
|
}
|
|
55416
55485
|
getClient() {
|
|
@@ -55445,7 +55514,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55445
55514
|
};
|
|
55446
55515
|
this.transportService.sendMessage({
|
|
55447
55516
|
type,
|
|
55448
|
-
version:
|
|
55517
|
+
version: MESSAGE_VERSION,
|
|
55449
55518
|
client: {
|
|
55450
55519
|
...client,
|
|
55451
55520
|
position
|
|
@@ -55522,7 +55591,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55522
55591
|
const { position } = client;
|
|
55523
55592
|
if (position) this.transportService.sendMessage({
|
|
55524
55593
|
type: "CLIENT_MOVED",
|
|
55525
|
-
version:
|
|
55594
|
+
version: MESSAGE_VERSION,
|
|
55526
55595
|
client: {
|
|
55527
55596
|
...client,
|
|
55528
55597
|
position
|
|
@@ -56442,9 +56511,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56442
56511
|
contentWidth += Math.max(...multiLineText.map((line) => computeTextWidth(this.ctx, line, style)));
|
|
56443
56512
|
}
|
|
56444
56513
|
if (this.getters.getCellIconSrc(position)) contentWidth += computeIconWidth(style);
|
|
56445
|
-
if (this.getters.doesCellHaveGridIcon(position)) contentWidth +=
|
|
56514
|
+
if (this.getters.doesCellHaveGridIcon(position)) contentWidth += ICON_EDGE_LENGTH + GRID_ICON_MARGIN;
|
|
56446
56515
|
if (contentWidth === 0) return 0;
|
|
56447
|
-
contentWidth += 2 *
|
|
56516
|
+
contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
|
|
56448
56517
|
if (style.wrapping === "wrap") {
|
|
56449
56518
|
const colWidth = this.getters.getColSize(position.sheetId, position.col);
|
|
56450
56519
|
return Math.min(colWidth, contentWidth);
|
|
@@ -56600,11 +56669,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56600
56669
|
if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
|
|
56601
56670
|
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
56602
56671
|
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
56603
|
-
if (evaluatedSize > evaluatedRowSize && evaluatedSize >
|
|
56672
|
+
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = evaluatedSize;
|
|
56604
56673
|
} else {
|
|
56605
56674
|
const content = cell.content;
|
|
56606
56675
|
const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
56607
|
-
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize >
|
|
56676
|
+
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = 0;
|
|
56608
56677
|
}
|
|
56609
56678
|
}
|
|
56610
56679
|
rowSizes.push(evaluatedRowSize || null);
|
|
@@ -57144,7 +57213,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57144
57213
|
onNewLocalStateUpdate({ id }) {
|
|
57145
57214
|
this.undoStack.push(id);
|
|
57146
57215
|
this.redoStack = [];
|
|
57147
|
-
if (this.undoStack.length >
|
|
57216
|
+
if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
|
|
57148
57217
|
}
|
|
57149
57218
|
/**
|
|
57150
57219
|
* Fetch the last revision which is not empty and not a repeated command
|
|
@@ -57239,7 +57308,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57239
57308
|
}
|
|
57240
57309
|
getAutoSeparatorForString(str) {
|
|
57241
57310
|
const separators = [
|
|
57242
|
-
|
|
57311
|
+
NEWLINE,
|
|
57243
57312
|
";",
|
|
57244
57313
|
",",
|
|
57245
57314
|
" ",
|
|
@@ -57564,7 +57633,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57564
57633
|
case "PASTE_FROM_OS_CLIPBOARD": {
|
|
57565
57634
|
this._isCutOperation = false;
|
|
57566
57635
|
let contentToPaste = cmd.clipboardContent;
|
|
57567
|
-
if (contentToPaste.data?.version !==
|
|
57636
|
+
if (contentToPaste.data?.version !== CURRENT_VERSION) {
|
|
57568
57637
|
contentToPaste = { ...contentToPaste };
|
|
57569
57638
|
delete contentToPaste.data;
|
|
57570
57639
|
}
|
|
@@ -57799,7 +57868,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57799
57868
|
}
|
|
57800
57869
|
getSheetData() {
|
|
57801
57870
|
const data = {
|
|
57802
|
-
version:
|
|
57871
|
+
version: CURRENT_VERSION,
|
|
57803
57872
|
clipboardId: this.clipboardId
|
|
57804
57873
|
};
|
|
57805
57874
|
if (this.copiedData && "figureId" in this.copiedData) return data;
|
|
@@ -58522,7 +58591,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
58522
58591
|
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
58523
58592
|
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
58524
58593
|
const size = isCol ? this.getters.getColSize(cmd.sheetId, element) : this.getters.getUserRowSize(cmd.sheetId, element);
|
|
58525
|
-
return [element, isCol && size ===
|
|
58594
|
+
return [element, isCol && size === DEFAULT_CELL_WIDTH || size === void 0 ? null : size];
|
|
58526
58595
|
}));
|
|
58527
58596
|
const target = [{
|
|
58528
58597
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -58737,14 +58806,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
58737
58806
|
const topRowSize = this.getters.getRowSize(this.sheetId, topRowIndex);
|
|
58738
58807
|
let width = lastColEnd - this.offsetCorrectionX;
|
|
58739
58808
|
if (this.canScrollHorizontally) {
|
|
58740
|
-
width += Math.max(
|
|
58809
|
+
width += Math.max(DEFAULT_CELL_WIDTH, Math.min(leftColSize, this.viewportWidth - lastColSize));
|
|
58741
58810
|
width = Math.max(width, this.viewportWidth);
|
|
58742
58811
|
}
|
|
58743
58812
|
let height = lastRowEnd - this.offsetCorrectionY;
|
|
58744
58813
|
if (this.canScrollVertically) {
|
|
58745
|
-
height += Math.max(
|
|
58814
|
+
height += Math.max(DEFAULT_CELL_HEIGHT + 5, Math.min(topRowSize, this.viewportHeight - lastRowSize));
|
|
58746
58815
|
height = Math.max(height, this.viewportHeight);
|
|
58747
|
-
if (lastRowEnd +
|
|
58816
|
+
if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly()) height += FOOTER_HEIGHT;
|
|
58748
58817
|
}
|
|
58749
58818
|
return {
|
|
58750
58819
|
width,
|
|
@@ -60045,7 +60114,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60045
60114
|
.o-sheet {
|
|
60046
60115
|
padding: 0 15px;
|
|
60047
60116
|
padding-right: 10px;
|
|
60048
|
-
height: ${
|
|
60117
|
+
height: ${BOTTOMBAR_HEIGHT}px;
|
|
60049
60118
|
border-left: 1px solid #c1c1c1;
|
|
60050
60119
|
border-right: 1px solid #c1c1c1;
|
|
60051
60120
|
margin-left: -1px;
|
|
@@ -60418,7 +60487,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60418
60487
|
css`
|
|
60419
60488
|
.o-spreadsheet-bottom-bar {
|
|
60420
60489
|
background-color: ${BACKGROUND_GRAY_COLOR};
|
|
60421
|
-
padding-left: ${
|
|
60490
|
+
padding-left: ${HEADER_WIDTH}px;
|
|
60422
60491
|
font-size: 15px;
|
|
60423
60492
|
border-top: 1px solid lightgrey;
|
|
60424
60493
|
|
|
@@ -60918,16 +60987,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60918
60987
|
const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
|
|
60919
60988
|
const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
|
|
60920
60989
|
let groupHeaderY = 0;
|
|
60921
|
-
let groupHeaderHeight =
|
|
60990
|
+
let groupHeaderHeight = HEADER_HEIGHT;
|
|
60922
60991
|
if (startRow !== 0) {
|
|
60923
60992
|
const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
|
|
60924
|
-
groupHeaderY =
|
|
60993
|
+
groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
|
|
60925
60994
|
groupHeaderHeight = headerRowDims.end - headerRowDims.start;
|
|
60926
60995
|
}
|
|
60927
60996
|
const headerRect = {
|
|
60928
60997
|
x: this.props.layerOffset,
|
|
60929
60998
|
y: groupHeaderY,
|
|
60930
|
-
width:
|
|
60999
|
+
width: GROUP_LAYER_WIDTH,
|
|
60931
61000
|
height: groupHeaderHeight
|
|
60932
61001
|
};
|
|
60933
61002
|
return {
|
|
@@ -60935,7 +61004,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60935
61004
|
groupRect: {
|
|
60936
61005
|
x: this.props.layerOffset,
|
|
60937
61006
|
y: headerRect.y,
|
|
60938
|
-
width:
|
|
61007
|
+
width: GROUP_LAYER_WIDTH,
|
|
60939
61008
|
height: headerRect.height + (endCoordinates - startCoordinates)
|
|
60940
61009
|
},
|
|
60941
61010
|
isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
|
|
@@ -60968,17 +61037,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60968
61037
|
const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
|
|
60969
61038
|
const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
|
|
60970
61039
|
let groupHeaderX = 0;
|
|
60971
|
-
let groupHeaderWidth =
|
|
61040
|
+
let groupHeaderWidth = HEADER_WIDTH;
|
|
60972
61041
|
if (startCol !== 0) {
|
|
60973
61042
|
const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
|
|
60974
|
-
groupHeaderX =
|
|
61043
|
+
groupHeaderX = HEADER_WIDTH + headerRowDims.start;
|
|
60975
61044
|
groupHeaderWidth = headerRowDims.end - headerRowDims.start;
|
|
60976
61045
|
}
|
|
60977
61046
|
const headerRect = {
|
|
60978
61047
|
x: groupHeaderX,
|
|
60979
61048
|
y: this.props.layerOffset,
|
|
60980
61049
|
width: groupHeaderWidth,
|
|
60981
|
-
height:
|
|
61050
|
+
height: GROUP_LAYER_WIDTH
|
|
60982
61051
|
};
|
|
60983
61052
|
return {
|
|
60984
61053
|
headerRect,
|
|
@@ -60986,7 +61055,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60986
61055
|
x: headerRect.x,
|
|
60987
61056
|
y: this.props.layerOffset,
|
|
60988
61057
|
width: headerRect.width + (endCoordinates - startCoordinates),
|
|
60989
|
-
height:
|
|
61058
|
+
height: GROUP_LAYER_WIDTH
|
|
60990
61059
|
},
|
|
60991
61060
|
isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
|
|
60992
61061
|
};
|
|
@@ -61033,7 +61102,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61033
61102
|
menuItems: []
|
|
61034
61103
|
});
|
|
61035
61104
|
getLayerOffset(layerIndex) {
|
|
61036
|
-
return layerIndex *
|
|
61105
|
+
return layerIndex * GROUP_LAYER_WIDTH;
|
|
61037
61106
|
}
|
|
61038
61107
|
onContextMenu(event) {
|
|
61039
61108
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -61077,8 +61146,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61077
61146
|
get frozenPaneContainerSize() {
|
|
61078
61147
|
if (!this.hasFrozenPane) return 0;
|
|
61079
61148
|
const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
|
|
61080
|
-
if (this.props.dimension === "COL") return
|
|
61081
|
-
else return
|
|
61149
|
+
if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
|
|
61150
|
+
else return HEADER_HEIGHT + viewportCoordinates.y;
|
|
61082
61151
|
}
|
|
61083
61152
|
};
|
|
61084
61153
|
|
|
@@ -61597,7 +61666,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61597
61666
|
"max-height": `${COMPOSER_MAX_HEIGHT}px`,
|
|
61598
61667
|
"line-height": "24px"
|
|
61599
61668
|
};
|
|
61600
|
-
style.height = this.focus === "inactive" ? `${
|
|
61669
|
+
style.height = this.focus === "inactive" ? `${TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
|
|
61601
61670
|
return cssPropertiesToCss(style);
|
|
61602
61671
|
}
|
|
61603
61672
|
get containerStyle() {
|
|
@@ -61805,7 +61874,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61805
61874
|
|
|
61806
61875
|
/* Toolbar */
|
|
61807
61876
|
.o-topbar-toolbar {
|
|
61808
|
-
height: ${
|
|
61877
|
+
height: ${TOPBAR_TOOLBAR_HEIGHT}px;
|
|
61809
61878
|
|
|
61810
61879
|
.o-readonly-toolbar {
|
|
61811
61880
|
background-color: ${BACKGROUND_HEADER_COLOR};
|
|
@@ -62072,9 +62141,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62072
62141
|
direction: ltr;
|
|
62073
62142
|
}
|
|
62074
62143
|
.o-separator {
|
|
62075
|
-
border-bottom: ${
|
|
62076
|
-
margin-top: ${
|
|
62077
|
-
margin-bottom: ${
|
|
62144
|
+
border-bottom: ${MENU_SEPARATOR_BORDER_WIDTH}px solid ${SEPARATOR_COLOR};
|
|
62145
|
+
margin-top: ${MENU_SEPARATOR_PADDING}px;
|
|
62146
|
+
margin-bottom: ${MENU_SEPARATOR_PADDING}px;
|
|
62078
62147
|
}
|
|
62079
62148
|
.o-hoverable-button {
|
|
62080
62149
|
border-radius: 2px;
|
|
@@ -62201,8 +62270,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62201
62270
|
&.corner {
|
|
62202
62271
|
right: 0px;
|
|
62203
62272
|
bottom: 0px;
|
|
62204
|
-
height: ${
|
|
62205
|
-
width: ${
|
|
62273
|
+
height: ${SCROLLBAR_WIDTH}px;
|
|
62274
|
+
width: ${SCROLLBAR_WIDTH}px;
|
|
62206
62275
|
border-top: 1px solid #e2e3e3;
|
|
62207
62276
|
border-left: 1px solid #e2e3e3;
|
|
62208
62277
|
}
|
|
@@ -62328,7 +62397,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62328
62397
|
getStyle() {
|
|
62329
62398
|
const properties = {};
|
|
62330
62399
|
if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
|
|
62331
|
-
else properties["grid-template-rows"] = `${
|
|
62400
|
+
else properties["grid-template-rows"] = `${TOPBAR_HEIGHT}px auto ${BOTTOMBAR_HEIGHT + 1}px`;
|
|
62332
62401
|
properties["grid-template-columns"] = `auto ${this.sidePanel.panelSize}px`;
|
|
62333
62402
|
return cssPropertiesToCss(properties);
|
|
62334
62403
|
}
|
|
@@ -62405,7 +62474,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62405
62474
|
checkViewportSize() {
|
|
62406
62475
|
const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
|
|
62407
62476
|
if (!isFinite(xRatio) || !isFinite(yRatio)) return;
|
|
62408
|
-
if (yRatio >
|
|
62477
|
+
if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
|
|
62409
62478
|
if (this.isViewportTooSmall) return;
|
|
62410
62479
|
this.notificationStore.notifyUser({
|
|
62411
62480
|
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 +62505,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62436
62505
|
return height;
|
|
62437
62506
|
}
|
|
62438
62507
|
get gridContainerStyle() {
|
|
62439
|
-
const gridColSize =
|
|
62440
|
-
const gridRowSize =
|
|
62508
|
+
const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
|
|
62509
|
+
const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
|
|
62441
62510
|
return cssPropertiesToCss({
|
|
62442
62511
|
"grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
|
|
62443
62512
|
"grid-template-rows": `${gridRowSize ? gridRowSize + 2 : 0}px auto`
|
|
@@ -63973,7 +64042,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63973
64042
|
const color = chart.data.title.color ? toXlsxHexColor(chart.data.title.color) : chart.data.fontColor;
|
|
63974
64043
|
title = escapeXml`
|
|
63975
64044
|
<c:title>
|
|
63976
|
-
${insertText(chart.data.title.text, color,
|
|
64045
|
+
${insertText(chart.data.title.text, color, DEFAULT_CHART_FONT_SIZE, chart.data.title)}
|
|
63977
64046
|
<c:overlay val="0" />
|
|
63978
64047
|
</c:title>
|
|
63979
64048
|
`;
|
|
@@ -64057,7 +64126,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
64057
64126
|
</a:ln>
|
|
64058
64127
|
`;
|
|
64059
64128
|
}
|
|
64060
|
-
function insertText(text, fontColor = "000000", fontsize =
|
|
64129
|
+
function insertText(text, fontColor = "000000", fontsize = DEFAULT_CHART_FONT_SIZE, style = {}) {
|
|
64061
64130
|
return escapeXml`
|
|
64062
64131
|
<c:tx>
|
|
64063
64132
|
<c:rich>
|
|
@@ -65009,12 +65078,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65009
65078
|
let currentPosition = 0;
|
|
65010
65079
|
for (const [headerIndex, header] of headers.entries()) if (currentPosition <= position && position < currentPosition + header.size) return {
|
|
65011
65080
|
index: headerIndex,
|
|
65012
|
-
offset: convertDotValueToEMU(position - currentPosition +
|
|
65081
|
+
offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH)
|
|
65013
65082
|
};
|
|
65014
65083
|
else if (headerIndex < headers.length - 1) currentPosition += header.size;
|
|
65015
65084
|
return {
|
|
65016
65085
|
index: headers.length - 1,
|
|
65017
|
-
offset: convertDotValueToEMU(position - currentPosition +
|
|
65086
|
+
offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH)
|
|
65018
65087
|
};
|
|
65019
65088
|
}
|
|
65020
65089
|
function createChartDrawing(figure, sheet, chartRelId) {
|
|
@@ -65113,7 +65182,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65113
65182
|
function addNumberFormats(numFmts) {
|
|
65114
65183
|
const numFmtNodes = [];
|
|
65115
65184
|
for (const [index, numFmt] of Object.entries(numFmts)) {
|
|
65116
|
-
const numFmtAttrs = [["numFmtId", parseInt(index) +
|
|
65185
|
+
const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
|
|
65117
65186
|
numFmtNodes.push(escapeXml`
|
|
65118
65187
|
<numFmt ${formatAttributes(numFmtAttrs)}/>
|
|
65119
65188
|
`);
|
|
@@ -65345,7 +65414,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65345
65414
|
const attributes = [
|
|
65346
65415
|
["min", parseInt(id) + 1],
|
|
65347
65416
|
["max", parseInt(id) + 1],
|
|
65348
|
-
["width", convertWidthToExcel(col.size ||
|
|
65417
|
+
["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
|
|
65349
65418
|
["customWidth", 1],
|
|
65350
65419
|
["hidden", col.isHidden ? 1 : 0]
|
|
65351
65420
|
];
|
|
@@ -65366,7 +65435,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65366
65435
|
for (let r = 0; r < sheet.rowNumber; r++) {
|
|
65367
65436
|
const rowAttrs = [["r", r + 1]];
|
|
65368
65437
|
const row = sheet.rows[r] || {};
|
|
65369
|
-
if (row.size && row.size !==
|
|
65438
|
+
if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
|
|
65370
65439
|
if (row.isHidden) rowAttrs.push(["hidden", 1]);
|
|
65371
65440
|
if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
|
|
65372
65441
|
if (row.collapsed) rowAttrs.push(["collapsed", 1]);
|
|
@@ -65399,7 +65468,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65399
65468
|
</c>`);
|
|
65400
65469
|
}
|
|
65401
65470
|
}
|
|
65402
|
-
if (cellNodes.length || row.size !==
|
|
65471
|
+
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
|
|
65403
65472
|
<row ${formatAttributes(rowAttrs)}>
|
|
65404
65473
|
${joinXmlNodes(cellNodes)}
|
|
65405
65474
|
</row>
|
|
@@ -65572,7 +65641,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65572
65641
|
let currentTableIndex = 1;
|
|
65573
65642
|
for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
|
|
65574
65643
|
const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
|
|
65575
|
-
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(
|
|
65644
|
+
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
|
|
65576
65645
|
const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
|
|
65577
65646
|
currentTableIndex += sheet.tables.length;
|
|
65578
65647
|
let drawingNode = escapeXml``;
|
|
@@ -66200,7 +66269,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66200
66269
|
exportData() {
|
|
66201
66270
|
let data = createEmptyWorkbookData();
|
|
66202
66271
|
for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data);
|
|
66203
|
-
data.revisionId = this.session.getRevisionId() ||
|
|
66272
|
+
data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
|
|
66204
66273
|
data = deepCopy(data);
|
|
66205
66274
|
return data;
|
|
66206
66275
|
}
|
|
@@ -66244,15 +66313,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66244
66313
|
*/
|
|
66245
66314
|
const __info__ = {};
|
|
66246
66315
|
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
|
|
66316
|
+
MIN_ROW_HEIGHT,
|
|
66317
|
+
MIN_COL_WIDTH,
|
|
66318
|
+
HEADER_HEIGHT,
|
|
66319
|
+
HEADER_WIDTH,
|
|
66320
|
+
TOPBAR_HEIGHT,
|
|
66321
|
+
BOTTOMBAR_HEIGHT,
|
|
66322
|
+
DEFAULT_CELL_WIDTH,
|
|
66323
|
+
DEFAULT_CELL_HEIGHT,
|
|
66324
|
+
SCROLLBAR_WIDTH
|
|
66256
66325
|
};
|
|
66257
66326
|
const registries = {
|
|
66258
66327
|
autoCompleteProviders,
|
|
@@ -66337,6 +66406,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66337
66406
|
overlap,
|
|
66338
66407
|
union,
|
|
66339
66408
|
isInside,
|
|
66409
|
+
addStyleToWorkbookData,
|
|
66340
66410
|
deepCopy,
|
|
66341
66411
|
expandZoneOnInsertion,
|
|
66342
66412
|
reduceZoneOnDeletion,
|
|
@@ -66444,7 +66514,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66444
66514
|
DEFAULT_LOCALE,
|
|
66445
66515
|
HIGHLIGHT_COLOR,
|
|
66446
66516
|
PIVOT_TABLE_CONFIG,
|
|
66447
|
-
TREND_LINE_XAXIS_ID
|
|
66517
|
+
TREND_LINE_XAXIS_ID,
|
|
66448
66518
|
CHART_AXIS_CHOICES,
|
|
66449
66519
|
ChartTerms
|
|
66450
66520
|
};
|
|
@@ -66496,8 +66566,8 @@ exports.stores = stores;
|
|
|
66496
66566
|
exports.tokenColors = tokenColors;
|
|
66497
66567
|
exports.tokenize = tokenize;
|
|
66498
66568
|
|
|
66499
|
-
__info__.version = "18.0.
|
|
66500
|
-
__info__.date = "2026-
|
|
66501
|
-
__info__.hash = "
|
|
66569
|
+
__info__.version = "18.0.83";
|
|
66570
|
+
__info__.date = "2026-10-10T06:31:52.656Z";
|
|
66571
|
+
__info__.hash = "22b9b73";
|
|
66502
66572
|
|
|
66503
66573
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|