@odoo/o-spreadsheet 18.0.82 → 18.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/o-spreadsheet.esm.js +377 -309
- package/dist/o-spreadsheet.iife.js +377 -309
- package/dist/o-spreadsheet.iife.min.js +490 -490
- package/dist/o_spreadsheet.xml +4 -4
- package/dist/types/helpers/data_normalization.d.ts +5 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.0.
|
|
6
|
-
* @date 2026-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.83
|
|
6
|
+
* @date 2026-10-10T06:31:52.656Z
|
|
7
|
+
* @hash 22b9b73
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(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) => ({
|
|
@@ -8783,7 +8847,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8783
8847
|
function drawLineOrBarChartValues(chart, options, ctx) {
|
|
8784
8848
|
const textsPositions = {};
|
|
8785
8849
|
for (const dataset of chart._metasets) {
|
|
8786
|
-
if (dataset.xAxisID ===
|
|
8850
|
+
if (dataset.xAxisID === TREND_LINE_XAXIS_ID) return;
|
|
8787
8851
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
8788
8852
|
const value = dataset._parsed[i].y;
|
|
8789
8853
|
const point = dataset.data[i];
|
|
@@ -8803,7 +8867,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8803
8867
|
function drawHorizontalBarChartValues(chart, options, ctx) {
|
|
8804
8868
|
const textsPositions = {};
|
|
8805
8869
|
for (const dataset of chart._metasets) {
|
|
8806
|
-
if (dataset.xAxisID ===
|
|
8870
|
+
if (dataset.xAxisID === TREND_LINE_XAXIS_ID) return;
|
|
8807
8871
|
for (let i = 0; i < dataset._parsed.length; i++) {
|
|
8808
8872
|
const value = dataset._parsed[i].x;
|
|
8809
8873
|
const displayValue = options.callback(value, dataset, i);
|
|
@@ -8990,6 +9054,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
8990
9054
|
const EXCEL_DEFAULT_COL_WIDTH = 8.43;
|
|
8991
9055
|
/** unit : points */
|
|
8992
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;
|
|
8993
9060
|
const FORCE_DEFAULT_ARGS_FUNCTIONS = {
|
|
8994
9061
|
FLOOR: [{
|
|
8995
9062
|
type: "NUMBER",
|
|
@@ -9307,9 +9374,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
9307
9374
|
display: flex;
|
|
9308
9375
|
align-items: center;
|
|
9309
9376
|
justify-content: center;
|
|
9310
|
-
width: ${
|
|
9311
|
-
height: ${
|
|
9312
|
-
font-size: ${
|
|
9377
|
+
width: ${ICON_EDGE_LENGTH}px;
|
|
9378
|
+
height: ${ICON_EDGE_LENGTH}px;
|
|
9379
|
+
font-size: ${ICON_EDGE_LENGTH}px;
|
|
9313
9380
|
vertical-align: middle;
|
|
9314
9381
|
|
|
9315
9382
|
.small-text {
|
|
@@ -10281,7 +10348,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10281
10348
|
alignment: {
|
|
10282
10349
|
horizontal: style.align,
|
|
10283
10350
|
vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
|
|
10284
|
-
wrapText: style.wrapping === "wrap" || cell.content?.includes(
|
|
10351
|
+
wrapText: style.wrapping === "wrap" || cell.content?.includes(NEWLINE) ? true : void 0,
|
|
10285
10352
|
shrinkToFit: style.wrapping === "clip" ? true : void 0
|
|
10286
10353
|
}
|
|
10287
10354
|
};
|
|
@@ -10312,7 +10379,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10312
10379
|
function convertFormat(format, numFmtStructure) {
|
|
10313
10380
|
if (!format) return 0;
|
|
10314
10381
|
let formatId = XLSX_FORMAT_MAP[format.format];
|
|
10315
|
-
if (!formatId) formatId = pushElement(format, numFmtStructure) +
|
|
10382
|
+
if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
|
|
10316
10383
|
return formatId;
|
|
10317
10384
|
}
|
|
10318
10385
|
/**
|
|
@@ -10894,8 +10961,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
10894
10961
|
dims[0] = Math.max(dims[0], largeMax(row.cells.map((cell) => toCartesian(cell.xc).col)));
|
|
10895
10962
|
dims[1] = Math.max(dims[1], row.index);
|
|
10896
10963
|
}
|
|
10897
|
-
dims[0] = Math.max(dims[0],
|
|
10898
|
-
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);
|
|
10899
10966
|
return dims;
|
|
10900
10967
|
}
|
|
10901
10968
|
/**
|
|
@@ -12000,7 +12067,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
12000
12067
|
rgb = this.getThemeColor(themeIndex, theme.clrScheme);
|
|
12001
12068
|
} else {
|
|
12002
12069
|
rgb = this.extractAttr(colorElement, "rgb")?.asString();
|
|
12003
|
-
rgb = rgb ===
|
|
12070
|
+
rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
|
|
12004
12071
|
}
|
|
12005
12072
|
return {
|
|
12006
12073
|
rgb: rgb || defaultColor,
|
|
@@ -13078,7 +13145,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13078
13145
|
* Get the corresponding relationship file for a given xml file in a XLSX directory.
|
|
13079
13146
|
*/
|
|
13080
13147
|
function getRelationFile(file, xmls) {
|
|
13081
|
-
if (file ===
|
|
13148
|
+
if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
|
|
13082
13149
|
let relsFile = "";
|
|
13083
13150
|
const pathParts = file.split("/");
|
|
13084
13151
|
for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
|
|
@@ -13278,7 +13345,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13278
13345
|
if (token.type === "REFERENCE" && cellReference.test(token.value)) {
|
|
13279
13346
|
const value = token.value.trim();
|
|
13280
13347
|
if (!dependencies.includes(value)) dependencies.push(value);
|
|
13281
|
-
return `${
|
|
13348
|
+
return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
|
|
13282
13349
|
} else return token.value;
|
|
13283
13350
|
})),
|
|
13284
13351
|
dependencies
|
|
@@ -13506,7 +13573,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13506
13573
|
if (cell.formula) {
|
|
13507
13574
|
let { text, dependencies } = cell.formula;
|
|
13508
13575
|
for (const [index, d] of Object.entries(dependencies)) {
|
|
13509
|
-
const stringPosition = `\\${
|
|
13576
|
+
const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
|
|
13510
13577
|
text = text.replace(new RegExp(stringPosition, "g"), d);
|
|
13511
13578
|
}
|
|
13512
13579
|
cell.content = text;
|
|
@@ -13702,7 +13769,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13702
13769
|
if (verboseImport) for (const parsingError of reader.warningManager.warnings.sort()) console.warn(parsingError);
|
|
13703
13770
|
}
|
|
13704
13771
|
if ("version" in data) {
|
|
13705
|
-
if (data.version <
|
|
13772
|
+
if (data.version < CURRENT_VERSION) {
|
|
13706
13773
|
console.debug("Migrating data from version", data.version);
|
|
13707
13774
|
data = migrate(data);
|
|
13708
13775
|
}
|
|
@@ -13758,7 +13825,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13758
13825
|
* sensible default values
|
|
13759
13826
|
*/
|
|
13760
13827
|
function setDefaults(partialData) {
|
|
13761
|
-
const data = Object.assign(createEmptyWorkbookData(), partialData, { version:
|
|
13828
|
+
const data = Object.assign(createEmptyWorkbookData(), partialData, { version: CURRENT_VERSION });
|
|
13762
13829
|
data.sheets = data.sheets ? data.sheets.map((s, i) => Object.assign(createEmptySheet(`Sheet${i + 1}`, `Sheet${i + 1}`), s)) : [];
|
|
13763
13830
|
if (data.sheets.length === 0) data.sheets.push(createEmptySheet(INITIAL_SHEET_ID, "Sheet1"));
|
|
13764
13831
|
if (!isValidLocale(data.settings.locale)) data.settings.locale = DEFAULT_LOCALE;
|
|
@@ -13900,7 +13967,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13900
13967
|
}
|
|
13901
13968
|
function createEmptyWorkbookData(sheetName = "Sheet1") {
|
|
13902
13969
|
return {
|
|
13903
|
-
version:
|
|
13970
|
+
version: CURRENT_VERSION,
|
|
13904
13971
|
sheets: [createEmptySheet(INITIAL_SHEET_ID, sheetName)],
|
|
13905
13972
|
styles: {},
|
|
13906
13973
|
formats: {},
|
|
@@ -13950,7 +14017,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
13950
14017
|
}));
|
|
13951
14018
|
}
|
|
13952
14019
|
function interactivePasteFromOS(env, target, clipboardContent, pasteOption) {
|
|
13953
|
-
if (clipboardContent.data && clipboardContent.data.version !==
|
|
14020
|
+
if (clipboardContent.data && clipboardContent.data.version !== CURRENT_VERSION) env.notifyUser({
|
|
13954
14021
|
type: "warning",
|
|
13955
14022
|
text: _t("You copied content from a different version of the application. Only text content will be pasted."),
|
|
13956
14023
|
sticky: false
|
|
@@ -14163,9 +14230,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14163
14230
|
const GAUGE_INFLECTION_MARKER_COLOR = "#666666aa";
|
|
14164
14231
|
const GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN = 6;
|
|
14165
14232
|
const GAUGE_TITLE_SECTION_HEIGHT = 25;
|
|
14166
|
-
const GAUGE_TITLE_FONT_SIZE =
|
|
14167
|
-
const GAUGE_TITLE_PADDING_LEFT =
|
|
14168
|
-
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;
|
|
14169
14236
|
function drawGaugeChart(canvas, runtime) {
|
|
14170
14237
|
const canvasBoundingRect = canvas.getBoundingClientRect();
|
|
14171
14238
|
const dpr = window.devicePixelRatio || 1;
|
|
@@ -14259,18 +14326,18 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14259
14326
|
x: boundingRect.width / 2,
|
|
14260
14327
|
y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
|
|
14261
14328
|
};
|
|
14262
|
-
let gaugeValueFontSize =
|
|
14329
|
+
let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
|
|
14263
14330
|
if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
|
|
14264
14331
|
const maxTextWidth = gaugeRect.width / 2;
|
|
14265
14332
|
const gaugeLabel = gaugeValue?.label || "-";
|
|
14266
14333
|
if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
|
|
14267
14334
|
const minLabelPosition = {
|
|
14268
14335
|
x: gaugeRect.x + gaugeArcWidth / 2,
|
|
14269
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
14336
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
14270
14337
|
};
|
|
14271
14338
|
const maxLabelPosition = {
|
|
14272
14339
|
x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
|
|
14273
|
-
y: gaugeRect.y + gaugeRect.height +
|
|
14340
|
+
y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
|
|
14274
14341
|
};
|
|
14275
14342
|
const textColor = getContrastedTextColor(runtime.background);
|
|
14276
14343
|
const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
|
|
@@ -14321,13 +14388,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14321
14388
|
minLabel: {
|
|
14322
14389
|
label: runtime.minValue.label,
|
|
14323
14390
|
textPosition: minLabelPosition,
|
|
14324
|
-
fontSize:
|
|
14391
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14325
14392
|
color: textColor
|
|
14326
14393
|
},
|
|
14327
14394
|
maxLabel: {
|
|
14328
14395
|
label: runtime.maxValue.label,
|
|
14329
14396
|
textPosition: maxLabelPosition,
|
|
14330
|
-
fontSize:
|
|
14397
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14331
14398
|
color: textColor
|
|
14332
14399
|
}
|
|
14333
14400
|
};
|
|
@@ -14337,9 +14404,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14337
14404
|
* space for the title and labels.
|
|
14338
14405
|
*/
|
|
14339
14406
|
function getGaugeRect(boundingRect, title) {
|
|
14340
|
-
const titleHeight = title ?
|
|
14341
|
-
const drawHeight = boundingRect.height -
|
|
14342
|
-
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;
|
|
14343
14410
|
let gaugeWidth;
|
|
14344
14411
|
let gaugeHeight;
|
|
14345
14412
|
if (drawWidth > 2 * drawHeight) {
|
|
@@ -14350,8 +14417,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14350
14417
|
gaugeHeight = drawWidth / 2;
|
|
14351
14418
|
}
|
|
14352
14419
|
return {
|
|
14353
|
-
x:
|
|
14354
|
-
y: titleHeight +
|
|
14420
|
+
x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
|
|
14421
|
+
y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
|
|
14355
14422
|
width: gaugeWidth,
|
|
14356
14423
|
height: gaugeHeight
|
|
14357
14424
|
};
|
|
@@ -14368,20 +14435,20 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14368
14435
|
x: gaugeRect.x + gaugeRect.width / 2,
|
|
14369
14436
|
y: gaugeRect.y + gaugeRect.height
|
|
14370
14437
|
};
|
|
14371
|
-
const textStyle = { fontSize:
|
|
14438
|
+
const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
|
|
14372
14439
|
const inflectionValues = [];
|
|
14373
14440
|
const inflectionValuesTextRects = [];
|
|
14374
14441
|
for (const inflectionValue of runtime.inflectionValues) {
|
|
14375
14442
|
const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
|
|
14376
14443
|
const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
|
|
14377
14444
|
const angle = Math.PI - Math.PI * percentage;
|
|
14378
|
-
const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2,
|
|
14379
|
-
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;
|
|
14380
14447
|
inflectionValuesTextRects.push(textRect);
|
|
14381
14448
|
inflectionValues.push({
|
|
14382
14449
|
rotation: angle,
|
|
14383
14450
|
label: inflectionValue.label,
|
|
14384
|
-
fontSize:
|
|
14451
|
+
fontSize: GAUGE_LABELS_FONT_SIZE,
|
|
14385
14452
|
color: textColor,
|
|
14386
14453
|
offset
|
|
14387
14454
|
});
|
|
@@ -14591,8 +14658,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14591
14658
|
this.baselineMode = definition.baselineMode;
|
|
14592
14659
|
this.baselineDescr = definition.baselineDescr;
|
|
14593
14660
|
this.background = definition.background;
|
|
14594
|
-
this.baselineColorUp = definition.baselineColorUp ??
|
|
14595
|
-
this.baselineColorDown = definition.baselineColorDown ??
|
|
14661
|
+
this.baselineColorUp = definition.baselineColorUp ?? DEFAULT_SCORECARD_BASELINE_COLOR_UP;
|
|
14662
|
+
this.baselineColorDown = definition.baselineColorDown ?? DEFAULT_SCORECARD_BASELINE_COLOR_DOWN;
|
|
14596
14663
|
this.humanize = definition.humanize ?? false;
|
|
14597
14664
|
}
|
|
14598
14665
|
static validateChartDefinition(validator, definition) {
|
|
@@ -14667,7 +14734,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14667
14734
|
canvas.width = dpr * structure.canvas.width;
|
|
14668
14735
|
canvas.height = dpr * structure.canvas.height;
|
|
14669
14736
|
ctx.scale(dpr, dpr);
|
|
14670
|
-
const availableWidth = structure.canvas.width -
|
|
14737
|
+
const availableWidth = structure.canvas.width - DEFAULT_CHART_PADDING;
|
|
14671
14738
|
ctx.fillStyle = structure.canvas.backgroundColor;
|
|
14672
14739
|
ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
|
|
14673
14740
|
if (structure.title) {
|
|
@@ -14782,9 +14849,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14782
14849
|
|
|
14783
14850
|
//#endregion
|
|
14784
14851
|
//#region src/helpers/figures/charts/scorecard_chart_config_builder.ts
|
|
14785
|
-
const CHART_PADDING =
|
|
14852
|
+
const CHART_PADDING = SCORECARD_GAUGE_CHART_PADDING;
|
|
14786
14853
|
const BOTTOM_PADDING_RATIO = .05;
|
|
14787
|
-
const CHART_TITLE_FONT_SIZE =
|
|
14854
|
+
const CHART_TITLE_FONT_SIZE = SCORECARD_GAUGE_CHART_FONT_SIZE;
|
|
14788
14855
|
const KEY_VALUE_FONT_SIZE = 32;
|
|
14789
14856
|
const BASELINE_MAX_FONT_SIZE = 16;
|
|
14790
14857
|
function formatBaselineDescr(baselineDescr, baseline) {
|
|
@@ -14850,7 +14917,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
14850
14917
|
y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING
|
|
14851
14918
|
}
|
|
14852
14919
|
};
|
|
14853
|
-
const minimalBaselinePosition = baselineArrowSize +
|
|
14920
|
+
const minimalBaselinePosition = baselineArrowSize + DEFAULT_CHART_PADDING;
|
|
14854
14921
|
if (structure.baseline.position.x < minimalBaselinePosition) structure.baseline.position.x = minimalBaselinePosition;
|
|
14855
14922
|
if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
|
|
14856
14923
|
direction: this.baselineArrow,
|
|
@@ -15028,7 +15095,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15028
15095
|
}
|
|
15029
15096
|
function truncateLabel(label) {
|
|
15030
15097
|
if (!label) return "";
|
|
15031
|
-
if (label.length >
|
|
15098
|
+
if (label.length > MAX_CHAR_LABEL) return label.substring(0, MAX_CHAR_LABEL) + "…";
|
|
15032
15099
|
return label;
|
|
15033
15100
|
}
|
|
15034
15101
|
/**
|
|
@@ -15043,10 +15110,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15043
15110
|
responsive: true,
|
|
15044
15111
|
maintainAspectRatio: false,
|
|
15045
15112
|
layout: { padding: {
|
|
15046
|
-
left:
|
|
15047
|
-
right:
|
|
15048
|
-
top: chartTitle.text ?
|
|
15049
|
-
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
|
|
15050
15117
|
} },
|
|
15051
15118
|
elements: {
|
|
15052
15119
|
line: { fill: false },
|
|
@@ -15060,7 +15127,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15060
15127
|
color: chartTitle?.color ?? fontColor,
|
|
15061
15128
|
align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
|
|
15062
15129
|
font: {
|
|
15063
|
-
size:
|
|
15130
|
+
size: DEFAULT_CHART_FONT_SIZE,
|
|
15064
15131
|
weight: chartTitle.bold ? "bold" : "normal",
|
|
15065
15132
|
style: chartTitle.italic ? "italic" : "normal"
|
|
15066
15133
|
}
|
|
@@ -23494,7 +23561,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23494
23561
|
while (!current.done) {
|
|
23495
23562
|
if (!current.value.hasChildNodes()) text += current.value.textContent;
|
|
23496
23563
|
if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) if (isFirstParagraph) isFirstParagraph = false;
|
|
23497
|
-
else text +=
|
|
23564
|
+
else text += NEWLINE;
|
|
23498
23565
|
current = it.next();
|
|
23499
23566
|
}
|
|
23500
23567
|
return text;
|
|
@@ -23721,7 +23788,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23721
23788
|
if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
|
|
23722
23789
|
} else {
|
|
23723
23790
|
assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
|
|
23724
|
-
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`;
|
|
23725
23792
|
}
|
|
23726
23793
|
return assistantStyle;
|
|
23727
23794
|
}
|
|
@@ -23835,7 +23902,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
23835
23902
|
const start = Math.min(selection.start, selection.end);
|
|
23836
23903
|
const end = Math.max(selection.start, selection.end);
|
|
23837
23904
|
this.props.composerStore.stopComposerRangeSelection();
|
|
23838
|
-
this.props.composerStore.setCurrentContent(content.slice(0, start) +
|
|
23905
|
+
this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
|
|
23839
23906
|
start: start + 1,
|
|
23840
23907
|
end: start + 1
|
|
23841
23908
|
});
|
|
@@ -24064,8 +24131,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
24064
24131
|
splitHtmlContentIntoLines(contents) {
|
|
24065
24132
|
const contentSplitInLines = [];
|
|
24066
24133
|
let currentLine = [];
|
|
24067
|
-
for (const content of contents) if (content.value.includes(
|
|
24068
|
-
const lines = content.value.split(
|
|
24134
|
+
for (const content of contents) if (content.value.includes(NEWLINE)) {
|
|
24135
|
+
const lines = content.value.split(NEWLINE);
|
|
24069
24136
|
const lastLine = lines.pop();
|
|
24070
24137
|
for (const line of lines) {
|
|
24071
24138
|
currentLine.push({
|
|
@@ -25286,7 +25353,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25286
25353
|
const definition = this.getDefinition();
|
|
25287
25354
|
return {
|
|
25288
25355
|
...definition,
|
|
25289
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
25356
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
25290
25357
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
25291
25358
|
dataSets,
|
|
25292
25359
|
labelRange,
|
|
@@ -25376,7 +25443,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25376
25443
|
label,
|
|
25377
25444
|
data,
|
|
25378
25445
|
hidden,
|
|
25379
|
-
borderColor: definition.background ||
|
|
25446
|
+
borderColor: definition.background || BACKGROUND_CHART_COLOR,
|
|
25380
25447
|
borderWidth: definition.stacked ? 1 : 0,
|
|
25381
25448
|
backgroundColor: color
|
|
25382
25449
|
};
|
|
@@ -25390,7 +25457,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25390
25457
|
}
|
|
25391
25458
|
if (trendDatasets.length) {
|
|
25392
25459
|
const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset.data.length));
|
|
25393
|
-
config.options.scales[
|
|
25460
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25394
25461
|
...xAxis,
|
|
25395
25462
|
labels: Array(maxLength).fill(""),
|
|
25396
25463
|
offset: false,
|
|
@@ -25398,12 +25465,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25398
25465
|
};
|
|
25399
25466
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
25400
25467
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
25401
|
-
return tooltipItems.some((item) => item.dataset.xAxisID !==
|
|
25468
|
+
return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
|
|
25402
25469
|
};
|
|
25403
25470
|
}
|
|
25404
25471
|
return {
|
|
25405
25472
|
chartJsConfig: config,
|
|
25406
|
-
background: chart.background ||
|
|
25473
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
25407
25474
|
};
|
|
25408
25475
|
}
|
|
25409
25476
|
|
|
@@ -25690,7 +25757,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25690
25757
|
config.options.plugins.tooltip.callbacks.label = (tooltipItem) => {
|
|
25691
25758
|
let dataSetPoint;
|
|
25692
25759
|
let label;
|
|
25693
|
-
if (tooltipItem.dataset.xAxisID ===
|
|
25760
|
+
if (tooltipItem.dataset.xAxisID === TREND_LINE_XAXIS_ID) {
|
|
25694
25761
|
dataSetPoint = dataSetsValues[tooltipItem.datasetIndex].data[tooltipItem.dataIndex].y;
|
|
25695
25762
|
label = "";
|
|
25696
25763
|
} else {
|
|
@@ -25761,23 +25828,23 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25761
25828
|
}
|
|
25762
25829
|
}
|
|
25763
25830
|
if (trendDatasets.length) {
|
|
25764
|
-
config.options.scales[
|
|
25831
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25765
25832
|
...xAxis,
|
|
25766
25833
|
display: false
|
|
25767
25834
|
};
|
|
25768
25835
|
if (axisType === "category" || axisType === "time") {
|
|
25769
|
-
config.options.scales[
|
|
25770
|
-
config.options.scales[
|
|
25771
|
-
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;
|
|
25772
25839
|
}
|
|
25773
25840
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
25774
25841
|
}
|
|
25775
25842
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
25776
|
-
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 : "";
|
|
25777
25844
|
};
|
|
25778
25845
|
return {
|
|
25779
25846
|
chartJsConfig: config,
|
|
25780
|
-
background: chart.background ||
|
|
25847
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
25781
25848
|
};
|
|
25782
25849
|
}
|
|
25783
25850
|
|
|
@@ -25853,7 +25920,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25853
25920
|
const definition = this.getDefinition();
|
|
25854
25921
|
return {
|
|
25855
25922
|
...definition,
|
|
25856
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
25923
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
25857
25924
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
25858
25925
|
dataSets,
|
|
25859
25926
|
labelRange,
|
|
@@ -25993,19 +26060,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
25993
26060
|
}
|
|
25994
26061
|
if (trendDatasets.length) {
|
|
25995
26062
|
const trendLinesMaxLength = Math.max(...trendDatasets.map((trend) => trend.data.length));
|
|
25996
|
-
config.options.scales[
|
|
26063
|
+
config.options.scales[TREND_LINE_XAXIS_ID] = {
|
|
25997
26064
|
labels: Array(Math.round(trendLinesMaxLength)).fill(""),
|
|
25998
26065
|
offset: false,
|
|
25999
26066
|
display: false
|
|
26000
26067
|
};
|
|
26001
26068
|
trendDatasets.forEach((x) => config.data.datasets.push(x));
|
|
26002
26069
|
config.options.plugins.tooltip.callbacks.title = function(tooltipItems) {
|
|
26003
|
-
return tooltipItems.some((item) => item.dataset.xAxisID !==
|
|
26070
|
+
return tooltipItems.some((item) => item.dataset.xAxisID !== TREND_LINE_XAXIS_ID) ? void 0 : "";
|
|
26004
26071
|
};
|
|
26005
26072
|
}
|
|
26006
26073
|
return {
|
|
26007
26074
|
chartJsConfig: config,
|
|
26008
|
-
background: chart.background ||
|
|
26075
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26009
26076
|
};
|
|
26010
26077
|
}
|
|
26011
26078
|
|
|
@@ -26329,7 +26396,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26329
26396
|
const definition = this.getDefinition();
|
|
26330
26397
|
return {
|
|
26331
26398
|
...definition,
|
|
26332
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26399
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26333
26400
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26334
26401
|
dataSets,
|
|
26335
26402
|
labelRange,
|
|
@@ -26426,7 +26493,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26426
26493
|
const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
|
|
26427
26494
|
return {
|
|
26428
26495
|
...this.getDefinition(),
|
|
26429
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26496
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26430
26497
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26431
26498
|
dataSets,
|
|
26432
26499
|
labelRange
|
|
@@ -26530,7 +26597,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26530
26597
|
if (chart.isDoughnut) config.type = "doughnut";
|
|
26531
26598
|
return {
|
|
26532
26599
|
chartJsConfig: config,
|
|
26533
|
-
background: chart.background ||
|
|
26600
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26534
26601
|
};
|
|
26535
26602
|
}
|
|
26536
26603
|
|
|
@@ -26662,7 +26729,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26662
26729
|
config.options.plugins.chartShowValuesPlugin.callback = (value, dataset, index) => callback(Math.abs(value), dataset, index);
|
|
26663
26730
|
return {
|
|
26664
26731
|
chartJsConfig: config,
|
|
26665
|
-
background: chart.background ||
|
|
26732
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
26666
26733
|
};
|
|
26667
26734
|
}
|
|
26668
26735
|
|
|
@@ -26760,7 +26827,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26760
26827
|
const definition = this.getDefinition();
|
|
26761
26828
|
return {
|
|
26762
26829
|
...definition,
|
|
26763
|
-
backgroundColor: toXlsxHexColor(this.background ||
|
|
26830
|
+
backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
|
|
26764
26831
|
fontColor: toXlsxHexColor(chartFontColor(this.background)),
|
|
26765
26832
|
dataSets,
|
|
26766
26833
|
labelRange,
|
|
@@ -26909,9 +26976,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
26909
26976
|
const { locale, format } = localeFormat;
|
|
26910
26977
|
const fontColor = chartFontColor(chart.background);
|
|
26911
26978
|
const config = getDefaultChartJsRuntime(chart, labels, fontColor, localeFormat);
|
|
26912
|
-
const negativeColor = chart.negativeValuesColor ||
|
|
26913
|
-
const positiveColor = chart.positiveValuesColor ||
|
|
26914
|
-
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;
|
|
26915
26982
|
const legend = { labels: { generateLabels: () => {
|
|
26916
26983
|
const legendValues = [{
|
|
26917
26984
|
text: _t("Positive values"),
|
|
@@ -27015,9 +27082,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27015
27082
|
locale
|
|
27016
27083
|
}, dataSetsValues);
|
|
27017
27084
|
config.type = "bar";
|
|
27018
|
-
const negativeColor = chart.negativeValuesColor ||
|
|
27019
|
-
const positiveColor = chart.positiveValuesColor ||
|
|
27020
|
-
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;
|
|
27021
27088
|
const backgroundColor = [];
|
|
27022
27089
|
const datasetValues = [];
|
|
27023
27090
|
const dataset = {
|
|
@@ -27052,7 +27119,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27052
27119
|
config.data.labels = labelsWithSubTotals.map(truncateLabel);
|
|
27053
27120
|
return {
|
|
27054
27121
|
chartJsConfig: config,
|
|
27055
|
-
background: chart.background ||
|
|
27122
|
+
background: chart.background || BACKGROUND_CHART_COLOR
|
|
27056
27123
|
};
|
|
27057
27124
|
}
|
|
27058
27125
|
|
|
@@ -27781,7 +27848,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
27781
27848
|
.o-filter-menu-item {
|
|
27782
27849
|
display: flex;
|
|
27783
27850
|
box-sizing: border-box;
|
|
27784
|
-
height: ${
|
|
27851
|
+
height: ${MENU_ITEM_HEIGHT}px;
|
|
27785
27852
|
padding: 4px 4px 4px 0px;
|
|
27786
27853
|
cursor: pointer;
|
|
27787
27854
|
user-select: none;
|
|
@@ -28216,7 +28283,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28216
28283
|
col,
|
|
28217
28284
|
row
|
|
28218
28285
|
});
|
|
28219
|
-
const textColor = style?.textColor ===
|
|
28286
|
+
const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
|
|
28220
28287
|
this.env.model.dispatch("UPDATE_CELL", {
|
|
28221
28288
|
col,
|
|
28222
28289
|
row,
|
|
@@ -28623,15 +28690,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28623
28690
|
css`
|
|
28624
28691
|
.o-menu {
|
|
28625
28692
|
background-color: white;
|
|
28626
|
-
padding: ${
|
|
28627
|
-
width: ${
|
|
28693
|
+
padding: ${MENU_VERTICAL_PADDING}px 0px;
|
|
28694
|
+
width: ${MENU_WIDTH}px;
|
|
28628
28695
|
box-sizing: border-box !important;
|
|
28629
28696
|
user-select: none;
|
|
28630
28697
|
|
|
28631
28698
|
.o-menu-item {
|
|
28632
28699
|
box-sizing: border-box;
|
|
28633
|
-
height: ${
|
|
28634
|
-
padding: ${
|
|
28700
|
+
height: ${MENU_ITEM_HEIGHT}px;
|
|
28701
|
+
padding: ${MENU_ITEM_PADDING_VERTICAL}px ${MENU_ITEM_PADDING_HORIZONTAL}px;
|
|
28635
28702
|
cursor: pointer;
|
|
28636
28703
|
user-select: none;
|
|
28637
28704
|
|
|
@@ -28642,8 +28709,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28642
28709
|
.o-menu-item-icon {
|
|
28643
28710
|
display: inline-block;
|
|
28644
28711
|
margin: 0px 8px 0px 0px;
|
|
28645
|
-
width: ${
|
|
28646
|
-
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;
|
|
28647
28714
|
}
|
|
28648
28715
|
|
|
28649
28716
|
&:not(.disabled) {
|
|
@@ -28748,11 +28815,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28748
28815
|
anchorRect: {
|
|
28749
28816
|
x: this.props.position.x,
|
|
28750
28817
|
y: this.props.position.y,
|
|
28751
|
-
width: isRoot ? 0 : this.props.width ||
|
|
28752
|
-
height: isRoot ? 0 :
|
|
28818
|
+
width: isRoot ? 0 : this.props.width || MENU_WIDTH,
|
|
28819
|
+
height: isRoot ? 0 : MENU_ITEM_HEIGHT
|
|
28753
28820
|
},
|
|
28754
28821
|
positioning: "TopRight",
|
|
28755
|
-
verticalOffset: isRoot ? 0 :
|
|
28822
|
+
verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
|
|
28756
28823
|
onPopoverHidden: () => this.closeSubMenu(),
|
|
28757
28824
|
onPopoverMoved: () => this.closeSubMenu()
|
|
28758
28825
|
};
|
|
@@ -29433,8 +29500,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
29433
29500
|
const sheetId = getters.getActiveSheetId();
|
|
29434
29501
|
if (getZoneArea(env.model.getters.getSelectedZone()) === 1) env.model.selection.selectTableAroundSelection();
|
|
29435
29502
|
const size = {
|
|
29436
|
-
width:
|
|
29437
|
-
height:
|
|
29503
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
29504
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
29438
29505
|
};
|
|
29439
29506
|
const position = getChartPositionAtCenterOfViewport(getters, size);
|
|
29440
29507
|
if (env.model.dispatch("CREATE_CHART", {
|
|
@@ -31258,7 +31325,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31258
31325
|
function drawHighlight(renderingContext, highlight, rect) {
|
|
31259
31326
|
const { x, y, width, height } = rect;
|
|
31260
31327
|
if (width < 0 || height < 0) return;
|
|
31261
|
-
const color = highlight.color ||
|
|
31328
|
+
const color = highlight.color || HIGHLIGHT_COLOR;
|
|
31262
31329
|
const { ctx } = renderingContext;
|
|
31263
31330
|
ctx.save();
|
|
31264
31331
|
if (!highlight.noBorder) {
|
|
@@ -31753,8 +31820,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31753
31820
|
-webkit-appearance: none;
|
|
31754
31821
|
-moz-appearance: none;
|
|
31755
31822
|
border-radius: 0;
|
|
31756
|
-
width: ${
|
|
31757
|
-
height: ${
|
|
31823
|
+
width: ${CHECKBOX_WIDTH}px;
|
|
31824
|
+
height: ${CHECKBOX_WIDTH}px;
|
|
31758
31825
|
vertical-align: top;
|
|
31759
31826
|
box-sizing: border-box;
|
|
31760
31827
|
outline: none;
|
|
@@ -32696,7 +32763,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32696
32763
|
let { scrollX, scrollY } = getters.getActiveSheetDOMScrollInfo();
|
|
32697
32764
|
const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
|
|
32698
32765
|
let canEdgeScroll = false;
|
|
32699
|
-
let timeoutDelay =
|
|
32766
|
+
let timeoutDelay = MAX_DELAY;
|
|
32700
32767
|
const x = currentEv.clientX - position.left;
|
|
32701
32768
|
colIndex = getters.getColIndex(x);
|
|
32702
32769
|
if (only !== "vertical") {
|
|
@@ -32862,9 +32929,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32862
32929
|
}
|
|
32863
32930
|
}
|
|
32864
32931
|
.o-separator {
|
|
32865
|
-
border-bottom: ${
|
|
32866
|
-
margin-top: ${
|
|
32867
|
-
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;
|
|
32868
32935
|
}
|
|
32869
32936
|
|
|
32870
32937
|
.o-custom-selector {
|
|
@@ -33006,7 +33073,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
33006
33073
|
}
|
|
33007
33074
|
get sliderStyle() {
|
|
33008
33075
|
const hue = this.state.currentHslaColor?.h || 0;
|
|
33009
|
-
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` });
|
|
33010
33077
|
}
|
|
33011
33078
|
get pointerStyle() {
|
|
33012
33079
|
const { s, l } = this.state.currentHslaColor || {
|
|
@@ -34131,13 +34198,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
34131
34198
|
}];
|
|
34132
34199
|
}
|
|
34133
34200
|
get positiveValuesColor() {
|
|
34134
|
-
return this.props.definition.positiveValuesColor ||
|
|
34201
|
+
return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
|
|
34135
34202
|
}
|
|
34136
34203
|
get negativeValuesColor() {
|
|
34137
|
-
return this.props.definition.negativeValuesColor ||
|
|
34204
|
+
return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
|
|
34138
34205
|
}
|
|
34139
34206
|
get subTotalValuesColor() {
|
|
34140
|
-
return this.props.definition.subTotalValuesColor ||
|
|
34207
|
+
return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
|
|
34141
34208
|
}
|
|
34142
34209
|
updateLegendPosition(ev) {
|
|
34143
34210
|
this.props.updateChart(this.props.figureId, { legendPosition: ev.target.value });
|
|
@@ -35411,8 +35478,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35411
35478
|
height: 50px;
|
|
35412
35479
|
width: 50px;
|
|
35413
35480
|
.o-icon {
|
|
35414
|
-
width: ${
|
|
35415
|
-
height: ${
|
|
35481
|
+
width: ${CF_ICON_EDGE_LENGTH}px;
|
|
35482
|
+
height: ${CF_ICON_EDGE_LENGTH}px;
|
|
35416
35483
|
}
|
|
35417
35484
|
}
|
|
35418
35485
|
.o-cf-preview-description {
|
|
@@ -35590,8 +35657,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35590
35657
|
background-color: ${BADGE_SELECTED_COLOR};
|
|
35591
35658
|
}
|
|
35592
35659
|
.o-icon {
|
|
35593
|
-
width: ${
|
|
35594
|
-
height: ${
|
|
35660
|
+
width: ${CF_ICON_EDGE_LENGTH}px;
|
|
35661
|
+
height: ${CF_ICON_EDGE_LENGTH}px;
|
|
35595
35662
|
}
|
|
35596
35663
|
}
|
|
35597
35664
|
.o-cf-iconsets {
|
|
@@ -35865,7 +35932,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
35865
35932
|
getPreviewGradient() {
|
|
35866
35933
|
const rule = this.state.rules.colorScale;
|
|
35867
35934
|
const minColor = colorNumberString(rule.minimum.color);
|
|
35868
|
-
const midColor = colorNumberString(rule.midpoint?.color ||
|
|
35935
|
+
const midColor = colorNumberString(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
|
|
35869
35936
|
const maxColor = colorNumberString(rule.maximum.color);
|
|
35870
35937
|
const baseString = "background-image: linear-gradient(to right, ";
|
|
35871
35938
|
return rule.midpoint === void 0 ? baseString + minColor + ", " + maxColor + ")" : baseString + minColor + ", " + midColor + ", " + maxColor + ")";
|
|
@@ -37864,7 +37931,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
37864
37931
|
return {
|
|
37865
37932
|
type: measureDisplayType,
|
|
37866
37933
|
fieldNameWithGranularity,
|
|
37867
|
-
value: value ??
|
|
37934
|
+
value: value ?? PREVIOUS_VALUE
|
|
37868
37935
|
};
|
|
37869
37936
|
}
|
|
37870
37937
|
}
|
|
@@ -40333,7 +40400,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
40333
40400
|
},
|
|
40334
40401
|
{
|
|
40335
40402
|
name: _t("Line Break"),
|
|
40336
|
-
value:
|
|
40403
|
+
value: NEWLINE
|
|
40337
40404
|
}
|
|
40338
40405
|
];
|
|
40339
40406
|
var SplitIntoColumnsPanel = class extends _odoo_owl.Component {
|
|
@@ -41581,7 +41648,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41581
41648
|
showMenu() {
|
|
41582
41649
|
const { x, y, width } = this.menuButtonRect;
|
|
41583
41650
|
const menuPosition = {
|
|
41584
|
-
x: x >=
|
|
41651
|
+
x: x >= MENU_WIDTH ? x - MENU_WIDTH : x + width,
|
|
41585
41652
|
y
|
|
41586
41653
|
};
|
|
41587
41654
|
this.openContextMenu(menuPosition);
|
|
@@ -41719,8 +41786,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41719
41786
|
css`
|
|
41720
41787
|
.o-autofill {
|
|
41721
41788
|
position: absolute;
|
|
41722
|
-
height: ${
|
|
41723
|
-
width: ${
|
|
41789
|
+
height: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41790
|
+
width: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41724
41791
|
border: 1px solid white;
|
|
41725
41792
|
box-sizing: border-box !important;
|
|
41726
41793
|
background-color: #1a73e8;
|
|
@@ -41728,8 +41795,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
41728
41795
|
|
|
41729
41796
|
.o-autofill-handler {
|
|
41730
41797
|
position: absolute;
|
|
41731
|
-
height: ${
|
|
41732
|
-
width: ${
|
|
41798
|
+
height: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41799
|
+
width: ${AUTOFILL_EDGE_LENGTH}px;
|
|
41733
41800
|
&:hover {
|
|
41734
41801
|
cursor: crosshair;
|
|
41735
41802
|
}
|
|
@@ -42277,8 +42344,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42277
42344
|
//#region src/components/grid_cell_icon/grid_cell_icon.ts
|
|
42278
42345
|
css`
|
|
42279
42346
|
.o-grid-cell-icon {
|
|
42280
|
-
width: ${
|
|
42281
|
-
height: ${
|
|
42347
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42348
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42282
42349
|
}
|
|
42283
42350
|
`;
|
|
42284
42351
|
var GridCellIcon = class extends _odoo_owl.Component {
|
|
@@ -42310,11 +42377,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42310
42377
|
const end = rect.y + rect.height;
|
|
42311
42378
|
const cell = this.env.model.getters.getCell(cellPosition);
|
|
42312
42379
|
switch (this.props.verticalAlign || cell?.style?.verticalAlign || DEFAULT_VERTICAL_ALIGN) {
|
|
42313
|
-
case "bottom": return end -
|
|
42314
|
-
case "top": return start +
|
|
42380
|
+
case "bottom": return end - GRID_ICON_MARGIN - GRID_ICON_EDGE_LENGTH;
|
|
42381
|
+
case "top": return start + GRID_ICON_MARGIN;
|
|
42315
42382
|
default:
|
|
42316
|
-
const centeringOffset = Math.floor((end - start -
|
|
42317
|
-
return end -
|
|
42383
|
+
const centeringOffset = Math.floor((end - start - GRID_ICON_EDGE_LENGTH) / 2);
|
|
42384
|
+
return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
|
|
42318
42385
|
}
|
|
42319
42386
|
}
|
|
42320
42387
|
getIconHorizontalPosition(rect, cellPosition) {
|
|
@@ -42323,11 +42390,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42323
42390
|
const cell = this.env.model.getters.getCell(cellPosition);
|
|
42324
42391
|
const evaluatedCell = this.env.model.getters.getEvaluatedCell(cellPosition);
|
|
42325
42392
|
switch (this.props.horizontalAlign || cell?.style?.align || evaluatedCell.defaultAlign) {
|
|
42326
|
-
case "right": return end -
|
|
42327
|
-
case "left": return start +
|
|
42393
|
+
case "right": return end - GRID_ICON_MARGIN - GRID_ICON_EDGE_LENGTH;
|
|
42394
|
+
case "left": return start + GRID_ICON_MARGIN;
|
|
42328
42395
|
default:
|
|
42329
|
-
const centeringOffset = Math.floor((end - start -
|
|
42330
|
-
return end -
|
|
42396
|
+
const centeringOffset = Math.floor((end - start - GRID_ICON_EDGE_LENGTH) / 2);
|
|
42397
|
+
return end - GRID_ICON_EDGE_LENGTH - centeringOffset;
|
|
42331
42398
|
}
|
|
42332
42399
|
}
|
|
42333
42400
|
isPositionVisible(position) {
|
|
@@ -42342,7 +42409,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42342
42409
|
.o-dv-checkbox {
|
|
42343
42410
|
box-sizing: border-box !important;
|
|
42344
42411
|
accent-color: #808080;
|
|
42345
|
-
margin: ${(
|
|
42412
|
+
margin: ${(GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2}px;
|
|
42346
42413
|
/** required to prevent the checkbox position to be sensible to the font-size (affects Firefox) */
|
|
42347
42414
|
position: absolute;
|
|
42348
42415
|
}
|
|
@@ -42377,8 +42444,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42377
42444
|
.o-dv-list-icon {
|
|
42378
42445
|
color: ${TEXT_BODY_MUTED};
|
|
42379
42446
|
border-radius: 1px;
|
|
42380
|
-
height: ${
|
|
42381
|
-
width: ${
|
|
42447
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42448
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
42382
42449
|
|
|
42383
42450
|
&:hover {
|
|
42384
42451
|
color: #ffffff;
|
|
@@ -42693,19 +42760,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42693
42760
|
position = fig.y;
|
|
42694
42761
|
break;
|
|
42695
42762
|
case "bottom":
|
|
42696
|
-
position = fig.y + fig.height -
|
|
42763
|
+
position = fig.y + fig.height - FIGURE_BORDER_WIDTH;
|
|
42697
42764
|
break;
|
|
42698
42765
|
case "vCenter":
|
|
42699
|
-
position = fig.y + Math.floor(fig.height / 2) -
|
|
42766
|
+
position = fig.y + Math.floor(fig.height / 2) - FIGURE_BORDER_WIDTH;
|
|
42700
42767
|
break;
|
|
42701
42768
|
case "left":
|
|
42702
42769
|
position = fig.x;
|
|
42703
42770
|
break;
|
|
42704
42771
|
case "right":
|
|
42705
|
-
position = fig.x + fig.width -
|
|
42772
|
+
position = fig.x + fig.width - FIGURE_BORDER_WIDTH;
|
|
42706
42773
|
break;
|
|
42707
42774
|
case "hCenter":
|
|
42708
|
-
position = fig.x + Math.floor(fig.width / 2) -
|
|
42775
|
+
position = fig.x + Math.floor(fig.width / 2) - FIGURE_BORDER_WIDTH;
|
|
42709
42776
|
break;
|
|
42710
42777
|
}
|
|
42711
42778
|
return {
|
|
@@ -42962,7 +43029,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
42962
43029
|
y
|
|
42963
43030
|
};
|
|
42964
43031
|
const keepRatio = figureRegistry.get(figure.tag).keepRatio || false;
|
|
42965
|
-
const minFigSize = figureRegistry.get(figure.tag).minFigSize ||
|
|
43032
|
+
const minFigSize = figureRegistry.get(figure.tag).minFigSize || MIN_FIG_SIZE;
|
|
42966
43033
|
const onMouseMove = (ev) => {
|
|
42967
43034
|
const draggedFigure = dragFigureForResize(initialFig, dirX, dirY, {
|
|
42968
43035
|
x: ev.clientX,
|
|
@@ -43053,8 +43120,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43053
43120
|
display: flex;
|
|
43054
43121
|
align-items: center;
|
|
43055
43122
|
justify-content: center;
|
|
43056
|
-
width: ${
|
|
43057
|
-
height: ${
|
|
43123
|
+
width: ${GRID_ICON_EDGE_LENGTH}px;
|
|
43124
|
+
height: ${GRID_ICON_EDGE_LENGTH}px;
|
|
43058
43125
|
|
|
43059
43126
|
&:hover {
|
|
43060
43127
|
background: ${FILTERS_COLOR};
|
|
@@ -43681,9 +43748,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43681
43748
|
.o-col-resizer {
|
|
43682
43749
|
position: absolute;
|
|
43683
43750
|
top: 0;
|
|
43684
|
-
left: ${
|
|
43685
|
-
right: ${
|
|
43686
|
-
height: ${
|
|
43751
|
+
left: ${HEADER_WIDTH}px;
|
|
43752
|
+
right: ${SCROLLBAR_WIDTH}px;
|
|
43753
|
+
height: ${HEADER_HEIGHT}px;
|
|
43687
43754
|
&.o-dragging {
|
|
43688
43755
|
cursor: grabbing;
|
|
43689
43756
|
}
|
|
@@ -43691,14 +43758,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43691
43758
|
cursor: grab;
|
|
43692
43759
|
}
|
|
43693
43760
|
.dragging-col-line {
|
|
43694
|
-
top: ${
|
|
43761
|
+
top: ${HEADER_HEIGHT}px;
|
|
43695
43762
|
position: absolute;
|
|
43696
43763
|
width: 2px;
|
|
43697
43764
|
height: 10000px;
|
|
43698
43765
|
background-color: black;
|
|
43699
43766
|
}
|
|
43700
43767
|
.dragging-col-shadow {
|
|
43701
|
-
top: ${
|
|
43768
|
+
top: ${HEADER_HEIGHT}px;
|
|
43702
43769
|
position: absolute;
|
|
43703
43770
|
height: 10000px;
|
|
43704
43771
|
background-color: black;
|
|
@@ -43706,13 +43773,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43706
43773
|
}
|
|
43707
43774
|
.o-handle {
|
|
43708
43775
|
position: absolute;
|
|
43709
|
-
height: ${
|
|
43776
|
+
height: ${HEADER_HEIGHT}px;
|
|
43710
43777
|
width: 4px;
|
|
43711
43778
|
cursor: e-resize;
|
|
43712
43779
|
background-color: ${SELECTION_BORDER_COLOR};
|
|
43713
43780
|
}
|
|
43714
43781
|
.dragging-resizer {
|
|
43715
|
-
top: ${
|
|
43782
|
+
top: ${HEADER_HEIGHT}px;
|
|
43716
43783
|
position: absolute;
|
|
43717
43784
|
margin-left: 2px;
|
|
43718
43785
|
width: 1px;
|
|
@@ -43737,7 +43804,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43737
43804
|
this.colResizerRef = (0, _odoo_owl.useRef)("colResizer");
|
|
43738
43805
|
this.PADDING = 15;
|
|
43739
43806
|
this.MAX_SIZE_MARGIN = 90;
|
|
43740
|
-
this.MIN_ELEMENT_SIZE =
|
|
43807
|
+
this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
|
|
43741
43808
|
}
|
|
43742
43809
|
get sheetId() {
|
|
43743
43810
|
return this.env.model.getters.getActiveSheetId();
|
|
@@ -43836,10 +43903,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43836
43903
|
css`
|
|
43837
43904
|
.o-row-resizer {
|
|
43838
43905
|
position: absolute;
|
|
43839
|
-
top: ${
|
|
43906
|
+
top: ${HEADER_HEIGHT}px;
|
|
43840
43907
|
left: 0;
|
|
43841
|
-
bottom: ${
|
|
43842
|
-
width: ${
|
|
43908
|
+
bottom: ${SCROLLBAR_WIDTH}px;
|
|
43909
|
+
width: ${HEADER_WIDTH}px;
|
|
43843
43910
|
&.o-dragging {
|
|
43844
43911
|
cursor: grabbing;
|
|
43845
43912
|
}
|
|
@@ -43847,14 +43914,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43847
43914
|
cursor: grab;
|
|
43848
43915
|
}
|
|
43849
43916
|
.dragging-row-line {
|
|
43850
|
-
left: ${
|
|
43917
|
+
left: ${HEADER_WIDTH}px;
|
|
43851
43918
|
position: absolute;
|
|
43852
43919
|
width: 10000px;
|
|
43853
43920
|
height: 2px;
|
|
43854
43921
|
background-color: black;
|
|
43855
43922
|
}
|
|
43856
43923
|
.dragging-row-shadow {
|
|
43857
|
-
left: ${
|
|
43924
|
+
left: ${HEADER_WIDTH}px;
|
|
43858
43925
|
position: absolute;
|
|
43859
43926
|
width: 10000px;
|
|
43860
43927
|
background-color: black;
|
|
@@ -43863,12 +43930,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43863
43930
|
.o-handle {
|
|
43864
43931
|
position: absolute;
|
|
43865
43932
|
height: 4px;
|
|
43866
|
-
width: ${
|
|
43933
|
+
width: ${HEADER_WIDTH}px;
|
|
43867
43934
|
cursor: n-resize;
|
|
43868
43935
|
background-color: ${SELECTION_BORDER_COLOR};
|
|
43869
43936
|
}
|
|
43870
43937
|
.dragging-resizer {
|
|
43871
|
-
left: ${
|
|
43938
|
+
left: ${HEADER_WIDTH}px;
|
|
43872
43939
|
position: absolute;
|
|
43873
43940
|
margin-top: 2px;
|
|
43874
43941
|
width: 10000px;
|
|
@@ -43892,7 +43959,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43892
43959
|
this.rowResizerRef = (0, _odoo_owl.useRef)("rowResizer");
|
|
43893
43960
|
this.PADDING = 5;
|
|
43894
43961
|
this.MAX_SIZE_MARGIN = 60;
|
|
43895
|
-
this.MIN_ELEMENT_SIZE =
|
|
43962
|
+
this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
|
|
43896
43963
|
}
|
|
43897
43964
|
rowResizerRef;
|
|
43898
43965
|
get sheetId() {
|
|
@@ -43999,8 +44066,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
43999
44066
|
top: 0;
|
|
44000
44067
|
left: 0;
|
|
44001
44068
|
right: 0;
|
|
44002
|
-
width: ${
|
|
44003
|
-
height: ${
|
|
44069
|
+
width: ${HEADER_WIDTH}px;
|
|
44070
|
+
height: ${HEADER_HEIGHT}px;
|
|
44004
44071
|
}
|
|
44005
44072
|
}
|
|
44006
44073
|
`;
|
|
@@ -44035,7 +44102,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44035
44102
|
*/
|
|
44036
44103
|
getHeaderOffset(dimension, start, index) {
|
|
44037
44104
|
let size = this.getters.getColRowOffsetInViewport(dimension, start, index);
|
|
44038
|
-
if (!this.getters.isDashboard()) size += dimension === "ROW" ?
|
|
44105
|
+
if (!this.getters.isDashboard()) size += dimension === "ROW" ? HEADER_HEIGHT : HEADER_WIDTH;
|
|
44039
44106
|
return size;
|
|
44040
44107
|
}
|
|
44041
44108
|
drawLayer(renderingContext, layer) {
|
|
@@ -44217,8 +44284,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44217
44284
|
}
|
|
44218
44285
|
ctx.fillStyle = style.textColor || "#000";
|
|
44219
44286
|
let x = box.x;
|
|
44220
|
-
if (align === "left") x +=
|
|
44221
|
-
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);
|
|
44222
44289
|
else x += box.width / 2;
|
|
44223
44290
|
ctx.textAlign = align;
|
|
44224
44291
|
if (box.clipRect) {
|
|
@@ -44236,7 +44303,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44236
44303
|
x: Math.round(x),
|
|
44237
44304
|
y: Math.round(y)
|
|
44238
44305
|
}, style.underline, style.strikethrough);
|
|
44239
|
-
y +=
|
|
44306
|
+
y += MIN_CELL_TEXT_MARGIN + textLineHeight;
|
|
44240
44307
|
}
|
|
44241
44308
|
if (box.clipRect) ctx.restore();
|
|
44242
44309
|
}
|
|
@@ -44254,7 +44321,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44254
44321
|
}
|
|
44255
44322
|
const iconSize = box.image.size;
|
|
44256
44323
|
const y = this.computeTextYCoordinate(box, iconSize);
|
|
44257
|
-
ctx.drawImage(icon, box.x +
|
|
44324
|
+
ctx.drawImage(icon, box.x + MIN_CF_ICON_MARGIN, y, iconSize, iconSize);
|
|
44258
44325
|
if (box.image.clipIcon) ctx.restore();
|
|
44259
44326
|
}
|
|
44260
44327
|
}
|
|
@@ -44266,13 +44333,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44266
44333
|
computeTextYCoordinate(box, textLineHeight, numberOfLines = 1) {
|
|
44267
44334
|
const y = box.y + 1;
|
|
44268
44335
|
const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
|
|
44269
|
-
const hasEnoughSpaces = box.height > textHeight +
|
|
44336
|
+
const hasEnoughSpaces = box.height > textHeight + MIN_CELL_TEXT_MARGIN * 2;
|
|
44270
44337
|
const verticalAlign = box.verticalAlign || DEFAULT_VERTICAL_ALIGN;
|
|
44271
44338
|
if (hasEnoughSpaces) {
|
|
44272
44339
|
if (verticalAlign === "middle") return y + (box.height - textHeight) / 2;
|
|
44273
|
-
if (verticalAlign === "bottom") return y + box.height - textHeight -
|
|
44340
|
+
if (verticalAlign === "bottom") return y + box.height - textHeight - MIN_CELL_TEXT_MARGIN;
|
|
44274
44341
|
}
|
|
44275
|
-
return y +
|
|
44342
|
+
return y + MIN_CELL_TEXT_MARGIN;
|
|
44276
44343
|
}
|
|
44277
44344
|
drawHeaders(renderingContext) {
|
|
44278
44345
|
const { ctx, thinLineWidth } = renderingContext;
|
|
@@ -44289,7 +44356,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44289
44356
|
const numberOfRows = this.getters.getNumberRows(sheetId);
|
|
44290
44357
|
const activeCols = this.getters.getActiveCols();
|
|
44291
44358
|
const activeRows = this.getters.getActiveRows();
|
|
44292
|
-
ctx.font = `400 ${
|
|
44359
|
+
ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
|
|
44293
44360
|
ctx.textAlign = "center";
|
|
44294
44361
|
ctx.textBaseline = "middle";
|
|
44295
44362
|
ctx.lineWidth = thinLineWidth;
|
|
@@ -44307,7 +44374,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44307
44374
|
if (isColActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
44308
44375
|
else if (isColSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
44309
44376
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
44310
|
-
ctx.fillRect(x, 0, width,
|
|
44377
|
+
ctx.fillRect(x, 0, width, HEADER_HEIGHT);
|
|
44311
44378
|
}
|
|
44312
44379
|
for (const row of visibleRows) {
|
|
44313
44380
|
const rowZone = {
|
|
@@ -44322,13 +44389,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44322
44389
|
if (isRowActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
|
|
44323
44390
|
else if (isRowSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
|
|
44324
44391
|
else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
|
|
44325
|
-
ctx.fillRect(0, y,
|
|
44392
|
+
ctx.fillRect(0, y, HEADER_WIDTH, height);
|
|
44326
44393
|
}
|
|
44327
44394
|
ctx.beginPath();
|
|
44328
|
-
ctx.moveTo(
|
|
44329
|
-
ctx.lineTo(
|
|
44330
|
-
ctx.moveTo(0,
|
|
44331
|
-
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);
|
|
44332
44399
|
ctx.strokeStyle = HEADER_BORDER_COLOR;
|
|
44333
44400
|
ctx.stroke();
|
|
44334
44401
|
ctx.beginPath();
|
|
@@ -44337,25 +44404,25 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44337
44404
|
const colName = numberToLetters(col);
|
|
44338
44405
|
ctx.fillStyle = activeCols.has(col) ? "#fff" : TEXT_HEADER_COLOR;
|
|
44339
44406
|
const colStart = this.getHeaderOffset("COL", left, col);
|
|
44340
|
-
ctx.fillText(colName, colStart + colSize / 2,
|
|
44407
|
+
ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
|
|
44341
44408
|
ctx.moveTo(colStart + colSize, 0);
|
|
44342
|
-
ctx.lineTo(colStart + colSize,
|
|
44409
|
+
ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
|
|
44343
44410
|
}
|
|
44344
44411
|
for (const row of visibleRows) {
|
|
44345
44412
|
const rowSize = this.getters.getRowSize(sheetId, row);
|
|
44346
44413
|
ctx.fillStyle = activeRows.has(row) ? "#fff" : TEXT_HEADER_COLOR;
|
|
44347
44414
|
const rowStart = this.getHeaderOffset("ROW", top, row);
|
|
44348
|
-
ctx.fillText(String(row + 1),
|
|
44415
|
+
ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
|
|
44349
44416
|
ctx.moveTo(0, rowStart + rowSize);
|
|
44350
|
-
ctx.lineTo(
|
|
44417
|
+
ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
|
|
44351
44418
|
}
|
|
44352
44419
|
ctx.stroke();
|
|
44353
44420
|
}
|
|
44354
44421
|
drawFrozenPanesHeaders(renderingContext) {
|
|
44355
44422
|
const { ctx, thinLineWidth } = renderingContext;
|
|
44356
44423
|
const { x: offsetCorrectionX, y: offsetCorrectionY } = this.getters.getMainViewportCoordinates();
|
|
44357
|
-
const widthCorrection = this.getters.isDashboard() ? 0 :
|
|
44358
|
-
const heightCorrection = this.getters.isDashboard() ? 0 :
|
|
44424
|
+
const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
|
|
44425
|
+
const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
|
|
44359
44426
|
ctx.lineWidth = 6 * thinLineWidth;
|
|
44360
44427
|
ctx.strokeStyle = FROZEN_PANE_HEADER_BORDER_COLOR;
|
|
44361
44428
|
ctx.beginPath();
|
|
@@ -44383,8 +44450,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44383
44450
|
bottom: visibleRows[visibleRows.length - 1]
|
|
44384
44451
|
};
|
|
44385
44452
|
const rect = this.getters.getVisibleRect(viewport);
|
|
44386
|
-
const widthCorrection = this.getters.isDashboard() ? 0 :
|
|
44387
|
-
const heightCorrection = this.getters.isDashboard() ? 0 :
|
|
44453
|
+
const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
|
|
44454
|
+
const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
|
|
44388
44455
|
ctx.lineWidth = 6 * thinLineWidth;
|
|
44389
44456
|
ctx.strokeStyle = FROZEN_PANE_BORDER_COLOR;
|
|
44390
44457
|
ctx.beginPath();
|
|
@@ -44468,7 +44535,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44468
44535
|
/** Icon */
|
|
44469
44536
|
const iconSrc = this.getters.getCellIconSrc(position);
|
|
44470
44537
|
const fontSizePX = computeTextFontSizeInPixels(box.style);
|
|
44471
|
-
const iconBoxWidth = iconSrc ?
|
|
44538
|
+
const iconBoxWidth = iconSrc ? MIN_CF_ICON_MARGIN + fontSizePX : 0;
|
|
44472
44539
|
if (iconSrc) {
|
|
44473
44540
|
const imageHtmlElement = loadIconImage(iconSrc);
|
|
44474
44541
|
box.image = {
|
|
@@ -44486,19 +44553,19 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44486
44553
|
if (cell.type === "empty" || this.getters.isCellValidCheckbox(position)) return box;
|
|
44487
44554
|
/** Filter Header or data validation icon */
|
|
44488
44555
|
box.hasIcon = this.getters.doesCellHaveGridIcon(position);
|
|
44489
|
-
const headerIconWidth = box.hasIcon ?
|
|
44556
|
+
const headerIconWidth = box.hasIcon ? GRID_ICON_EDGE_LENGTH + GRID_ICON_MARGIN : 0;
|
|
44490
44557
|
/** Content */
|
|
44491
44558
|
const style = this.getters.getCellComputedStyle(position);
|
|
44492
44559
|
const wrapping = style.wrapping || "overflow";
|
|
44493
44560
|
const wrapText = wrapping === "wrap" && !showFormula;
|
|
44494
|
-
const maxWidth = width - 2 *
|
|
44561
|
+
const maxWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
|
|
44495
44562
|
const formatWidth = style.align ? 0 : maxWidth;
|
|
44496
44563
|
const multiLineText = this.getters.getCellMultiLineText(position, {
|
|
44497
44564
|
maxWidth,
|
|
44498
44565
|
formatWidth,
|
|
44499
44566
|
wrapText
|
|
44500
44567
|
});
|
|
44501
|
-
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));
|
|
44502
44569
|
const contentWidth = iconBoxWidth + textWidth + headerIconWidth;
|
|
44503
44570
|
const align = this.computeCellAlignment(position, contentWidth > width);
|
|
44504
44571
|
box.content = {
|
|
@@ -44710,7 +44777,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44710
44777
|
resetTimeout = setTimeout(() => {
|
|
44711
44778
|
velocityX = 0;
|
|
44712
44779
|
velocityY = 0;
|
|
44713
|
-
},
|
|
44780
|
+
}, resetTimeoutDuration);
|
|
44714
44781
|
updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
|
|
44715
44782
|
}
|
|
44716
44783
|
function onTouchEnd(ev) {
|
|
@@ -44741,7 +44808,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44741
44808
|
//#region src/components/helpers/wheel_hook.ts
|
|
44742
44809
|
function useWheelHandler(handler) {
|
|
44743
44810
|
function normalize(val, deltaMode) {
|
|
44744
|
-
return val * (deltaMode === 0 ? 1 :
|
|
44811
|
+
return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
|
|
44745
44812
|
}
|
|
44746
44813
|
const onMouseWheel = (ev) => {
|
|
44747
44814
|
handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
|
|
@@ -44857,8 +44924,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44857
44924
|
const leftValue = this.isLeft ? rect.x : rect.x + rect.width;
|
|
44858
44925
|
const topValue = this.isTop ? rect.y : rect.y + rect.height;
|
|
44859
44926
|
return cssPropertiesToCss({
|
|
44860
|
-
left: `${leftValue -
|
|
44861
|
-
top: `${topValue -
|
|
44927
|
+
left: `${leftValue - AUTOFILL_EDGE_LENGTH / 2}px`,
|
|
44928
|
+
top: `${topValue - AUTOFILL_EDGE_LENGTH / 2}px`,
|
|
44862
44929
|
"background-color": this.props.color
|
|
44863
44930
|
});
|
|
44864
44931
|
}
|
|
@@ -44998,8 +45065,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
44998
45065
|
&.corner {
|
|
44999
45066
|
right: 0px;
|
|
45000
45067
|
bottom: 0px;
|
|
45001
|
-
height: ${
|
|
45002
|
-
width: ${
|
|
45068
|
+
height: ${SCROLLBAR_WIDTH}px;
|
|
45069
|
+
width: ${SCROLLBAR_WIDTH}px;
|
|
45003
45070
|
border-top: 1px solid #e2e3e3;
|
|
45004
45071
|
border-left: 1px solid #e2e3e3;
|
|
45005
45072
|
}
|
|
@@ -45092,7 +45159,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45092
45159
|
return {
|
|
45093
45160
|
left: `${this.props.leftOffset + x}px`,
|
|
45094
45161
|
bottom: "0px",
|
|
45095
|
-
height: `${
|
|
45162
|
+
height: `${SCROLLBAR_WIDTH}px`,
|
|
45096
45163
|
right: `0px`
|
|
45097
45164
|
};
|
|
45098
45165
|
}
|
|
@@ -45138,7 +45205,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45138
45205
|
return {
|
|
45139
45206
|
top: `${this.props.topOffset + y}px`,
|
|
45140
45207
|
right: "0px",
|
|
45141
|
-
width: `${
|
|
45208
|
+
width: `${SCROLLBAR_WIDTH}px`,
|
|
45142
45209
|
bottom: `0px`
|
|
45143
45210
|
};
|
|
45144
45211
|
}
|
|
@@ -45165,7 +45232,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45165
45232
|
];
|
|
45166
45233
|
currentPanelProps = {};
|
|
45167
45234
|
componentTag = "";
|
|
45168
|
-
panelSize =
|
|
45235
|
+
panelSize = DEFAULT_SIDE_PANEL_SIZE;
|
|
45169
45236
|
get isOpen() {
|
|
45170
45237
|
if (!this.componentTag) return false;
|
|
45171
45238
|
return this.computeState(this.componentTag, this.currentPanelProps).isOpen;
|
|
@@ -45196,12 +45263,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45196
45263
|
this.componentTag = "";
|
|
45197
45264
|
}
|
|
45198
45265
|
changePanelSize(size, spreadsheetElWidth) {
|
|
45199
|
-
if (size <
|
|
45200
|
-
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);
|
|
45201
45268
|
else this.panelSize = size;
|
|
45202
45269
|
}
|
|
45203
45270
|
resetPanelSize() {
|
|
45204
|
-
this.panelSize =
|
|
45271
|
+
this.panelSize = DEFAULT_SIDE_PANEL_SIZE;
|
|
45205
45272
|
}
|
|
45206
45273
|
computeState(componentTag, panelProps) {
|
|
45207
45274
|
const customComputeState = sidePanelRegistry.get(componentTag).computeState;
|
|
@@ -45317,8 +45384,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45317
45384
|
HorizontalScrollBar,
|
|
45318
45385
|
TableResizer
|
|
45319
45386
|
};
|
|
45320
|
-
HEADER_HEIGHT =
|
|
45321
|
-
HEADER_WIDTH =
|
|
45387
|
+
HEADER_HEIGHT = HEADER_HEIGHT;
|
|
45388
|
+
HEADER_WIDTH = HEADER_WIDTH;
|
|
45322
45389
|
menuState;
|
|
45323
45390
|
gridRef;
|
|
45324
45391
|
highlightStore;
|
|
@@ -45376,10 +45443,10 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45376
45443
|
}
|
|
45377
45444
|
get gridOverlayDimensions() {
|
|
45378
45445
|
return cssPropertiesToCss({
|
|
45379
|
-
top: `${
|
|
45380
|
-
left: `${
|
|
45381
|
-
height: `calc(100% - ${
|
|
45382
|
-
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)`
|
|
45383
45450
|
});
|
|
45384
45451
|
}
|
|
45385
45452
|
onClosePopover() {
|
|
@@ -45552,8 +45619,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45552
45619
|
const zone = this.env.model.getters.getSelectedZone();
|
|
45553
45620
|
const rect = this.env.model.getters.getVisibleRect(zone);
|
|
45554
45621
|
return {
|
|
45555
|
-
left: rect.x + rect.width -
|
|
45556
|
-
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
|
|
45557
45624
|
};
|
|
45558
45625
|
}
|
|
45559
45626
|
get isAutofillVisible() {
|
|
@@ -45570,8 +45637,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
45570
45637
|
this.env.model.dispatch("RESIZE_SHEETVIEW", {
|
|
45571
45638
|
width,
|
|
45572
45639
|
height,
|
|
45573
|
-
gridOffsetX:
|
|
45574
|
-
gridOffsetY:
|
|
45640
|
+
gridOffsetX: HEADER_WIDTH,
|
|
45641
|
+
gridOffsetY: HEADER_HEIGHT
|
|
45575
45642
|
});
|
|
45576
45643
|
}
|
|
45577
45644
|
moveCanvas(deltaX, deltaY) {
|
|
@@ -47307,8 +47374,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47307
47374
|
case "DUPLICATE_SHEET": {
|
|
47308
47375
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
47309
47376
|
for (const fig of sheetFiguresFrom) if (fig.tag === "chart") {
|
|
47310
|
-
const figureIdBase = fig.id.split(
|
|
47311
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
47377
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
47378
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
47312
47379
|
const chart = this.charts[fig.id]?.copyForSheetId(cmd.sheetIdTo);
|
|
47313
47380
|
if (chart) this.dispatch("CREATE_CHART", {
|
|
47314
47381
|
id: duplicatedFigureId,
|
|
@@ -47385,8 +47452,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
47385
47452
|
x: 0,
|
|
47386
47453
|
y: 0
|
|
47387
47454
|
}, size = {
|
|
47388
|
-
width:
|
|
47389
|
-
height:
|
|
47455
|
+
width: DEFAULT_FIGURE_WIDTH,
|
|
47456
|
+
height: DEFAULT_FIGURE_HEIGHT
|
|
47390
47457
|
}) {
|
|
47391
47458
|
if (this.getters.getFigure(sheetId, id)) return;
|
|
47392
47459
|
const figure = {
|
|
@@ -48028,7 +48095,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48028
48095
|
onRowDeletion(sheetId) {
|
|
48029
48096
|
const numHeader = this.getters.getNumberRows(sheetId);
|
|
48030
48097
|
let gridHeight = 0;
|
|
48031
|
-
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;
|
|
48032
48099
|
const figures = this.getters.getFigures(sheetId);
|
|
48033
48100
|
for (const figure of figures) {
|
|
48034
48101
|
const newY = Math.min(figure.y, gridHeight - figure.height);
|
|
@@ -48159,7 +48226,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48159
48226
|
}
|
|
48160
48227
|
}
|
|
48161
48228
|
getColSize(sheetId, index) {
|
|
48162
|
-
return Math.round(this.sizes[sheetId]?.["COL"][index] ||
|
|
48229
|
+
return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
|
|
48163
48230
|
}
|
|
48164
48231
|
getUserRowSize(sheetId, index) {
|
|
48165
48232
|
const rowSize = this.sizes[sheetId]?.["ROW"][index];
|
|
@@ -48192,7 +48259,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48192
48259
|
if (sheet.rows === void 0) sheet.rows = {};
|
|
48193
48260
|
for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
|
|
48194
48261
|
...sheet.rows[row],
|
|
48195
|
-
size: this.getUserRowSize(sheet.id, row) ??
|
|
48262
|
+
size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
|
|
48196
48263
|
};
|
|
48197
48264
|
if (sheet.cols === void 0) sheet.cols = {};
|
|
48198
48265
|
for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
|
|
@@ -48373,8 +48440,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
48373
48440
|
case "DUPLICATE_SHEET": {
|
|
48374
48441
|
const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
|
|
48375
48442
|
for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
|
|
48376
|
-
const figureIdBase = fig.id.split(
|
|
48377
|
-
const duplicatedFigureId = `${cmd.sheetIdTo}${
|
|
48443
|
+
const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
|
|
48444
|
+
const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
|
|
48378
48445
|
const image = this.getImage(fig.id);
|
|
48379
48446
|
if (image) {
|
|
48380
48447
|
const size = {
|
|
@@ -52681,7 +52748,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
52681
52748
|
col,
|
|
52682
52749
|
row
|
|
52683
52750
|
});
|
|
52684
|
-
const background = style.fillColor ||
|
|
52751
|
+
const background = style.fillColor || BACKGROUND_CHART_COLOR;
|
|
52685
52752
|
return {
|
|
52686
52753
|
background,
|
|
52687
52754
|
fontColor: style.textColor || chartFontColor(background)
|
|
@@ -53378,7 +53445,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53378
53445
|
}
|
|
53379
53446
|
}
|
|
53380
53447
|
getRowSize(sheetId, row) {
|
|
53381
|
-
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);
|
|
53382
53449
|
}
|
|
53383
53450
|
getHeaderSize(sheetId, dimension, index) {
|
|
53384
53451
|
if (this.getters.isHeaderHidden(sheetId, dimension, index)) return 0;
|
|
@@ -53395,8 +53462,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53395
53462
|
col,
|
|
53396
53463
|
row
|
|
53397
53464
|
});
|
|
53398
|
-
if (updatedCellHeight <=
|
|
53399
|
-
if (!tallestCellInRow && updatedCellHeight >
|
|
53465
|
+
if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
|
|
53466
|
+
if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
|
|
53400
53467
|
const newTallestCell = {
|
|
53401
53468
|
cell: {
|
|
53402
53469
|
sheetId,
|
|
@@ -53421,7 +53488,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53421
53488
|
* merge, or the height of the cell computed based on its style/content.
|
|
53422
53489
|
*/
|
|
53423
53490
|
getCellHeight(position) {
|
|
53424
|
-
if (this.isInMultiRowMerge(position)) return
|
|
53491
|
+
if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
|
|
53425
53492
|
const cell = this.getters.getCell(position);
|
|
53426
53493
|
const colSize = this.getters.getColSize(position.sheetId, position.col);
|
|
53427
53494
|
return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
|
|
@@ -53443,7 +53510,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53443
53510
|
if (!cell) continue;
|
|
53444
53511
|
const position = this.getters.getCellPosition(cell.id);
|
|
53445
53512
|
const cellHeight = this.getCellHeight(position);
|
|
53446
|
-
if (cellHeight > maxHeight && cellHeight >
|
|
53513
|
+
if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
|
|
53447
53514
|
maxHeight = cellHeight;
|
|
53448
53515
|
tallestCell = {
|
|
53449
53516
|
cell: position,
|
|
@@ -53451,7 +53518,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53451
53518
|
};
|
|
53452
53519
|
}
|
|
53453
53520
|
}
|
|
53454
|
-
if (tallestCell && tallestCell.size >
|
|
53521
|
+
if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
|
|
53455
53522
|
}
|
|
53456
53523
|
};
|
|
53457
53524
|
|
|
@@ -53839,7 +53906,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
53839
53906
|
* @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
|
|
53840
53907
|
*/
|
|
53841
53908
|
getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
|
|
53842
|
-
const comparedDomain = valueToCompare ===
|
|
53909
|
+
const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
|
|
53843
53910
|
if (deepEquals(comparedDomain, domain)) return "sameValue";
|
|
53844
53911
|
if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
|
|
53845
53912
|
const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
|
|
@@ -55314,7 +55381,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55314
55381
|
this.revisions = revisions;
|
|
55315
55382
|
this.transportService = transportService;
|
|
55316
55383
|
this.serverRevisionId = serverRevisionId;
|
|
55317
|
-
this.debouncedMove = debounce(this._move.bind(this),
|
|
55384
|
+
this.debouncedMove = debounce(this._move.bind(this), DEBOUNCE_TIME);
|
|
55318
55385
|
}
|
|
55319
55386
|
canApplyOptimisticUpdate() {
|
|
55320
55387
|
return !this.waitingUndoRedoAck;
|
|
@@ -55331,7 +55398,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55331
55398
|
this.trigger("new-local-state-update", { id: revision.id });
|
|
55332
55399
|
this.sendUpdateMessage({
|
|
55333
55400
|
type: "REMOTE_REVISION",
|
|
55334
|
-
version:
|
|
55401
|
+
version: MESSAGE_VERSION,
|
|
55335
55402
|
serverRevisionId: this.serverRevisionId,
|
|
55336
55403
|
nextRevisionId: revision.id,
|
|
55337
55404
|
clientId: revision.clientId,
|
|
@@ -55342,7 +55409,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55342
55409
|
this.waitingUndoRedoAck = true;
|
|
55343
55410
|
this.sendUpdateMessage({
|
|
55344
55411
|
type: "REVISION_UNDONE",
|
|
55345
|
-
version:
|
|
55412
|
+
version: MESSAGE_VERSION,
|
|
55346
55413
|
serverRevisionId: this.serverRevisionId,
|
|
55347
55414
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
55348
55415
|
undoneRevisionId: revisionId
|
|
@@ -55352,7 +55419,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55352
55419
|
this.waitingUndoRedoAck = true;
|
|
55353
55420
|
this.sendUpdateMessage({
|
|
55354
55421
|
type: "REVISION_REDONE",
|
|
55355
|
-
version:
|
|
55422
|
+
version: MESSAGE_VERSION,
|
|
55356
55423
|
serverRevisionId: this.serverRevisionId,
|
|
55357
55424
|
nextRevisionId: this.uuidGenerator.uuidv4(),
|
|
55358
55425
|
redoneRevisionId: revisionId
|
|
@@ -55395,7 +55462,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55395
55462
|
this.transportService.sendMessage({
|
|
55396
55463
|
type: "CLIENT_LEFT",
|
|
55397
55464
|
clientId: this.clientId,
|
|
55398
|
-
version:
|
|
55465
|
+
version: MESSAGE_VERSION
|
|
55399
55466
|
});
|
|
55400
55467
|
}
|
|
55401
55468
|
/**
|
|
@@ -55412,7 +55479,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55412
55479
|
...data,
|
|
55413
55480
|
revisionId: snapshotId
|
|
55414
55481
|
},
|
|
55415
|
-
version:
|
|
55482
|
+
version: MESSAGE_VERSION
|
|
55416
55483
|
});
|
|
55417
55484
|
}
|
|
55418
55485
|
getClient() {
|
|
@@ -55447,7 +55514,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55447
55514
|
};
|
|
55448
55515
|
this.transportService.sendMessage({
|
|
55449
55516
|
type,
|
|
55450
|
-
version:
|
|
55517
|
+
version: MESSAGE_VERSION,
|
|
55451
55518
|
client: {
|
|
55452
55519
|
...client,
|
|
55453
55520
|
position
|
|
@@ -55524,7 +55591,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
55524
55591
|
const { position } = client;
|
|
55525
55592
|
if (position) this.transportService.sendMessage({
|
|
55526
55593
|
type: "CLIENT_MOVED",
|
|
55527
|
-
version:
|
|
55594
|
+
version: MESSAGE_VERSION,
|
|
55528
55595
|
client: {
|
|
55529
55596
|
...client,
|
|
55530
55597
|
position
|
|
@@ -56444,9 +56511,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56444
56511
|
contentWidth += Math.max(...multiLineText.map((line) => computeTextWidth(this.ctx, line, style)));
|
|
56445
56512
|
}
|
|
56446
56513
|
if (this.getters.getCellIconSrc(position)) contentWidth += computeIconWidth(style);
|
|
56447
|
-
if (this.getters.doesCellHaveGridIcon(position)) contentWidth +=
|
|
56514
|
+
if (this.getters.doesCellHaveGridIcon(position)) contentWidth += ICON_EDGE_LENGTH + GRID_ICON_MARGIN;
|
|
56448
56515
|
if (contentWidth === 0) return 0;
|
|
56449
|
-
contentWidth += 2 *
|
|
56516
|
+
contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
|
|
56450
56517
|
if (style.wrapping === "wrap") {
|
|
56451
56518
|
const colWidth = this.getters.getColSize(position.sheetId, position.col);
|
|
56452
56519
|
return Math.min(colWidth, contentWidth);
|
|
@@ -56602,11 +56669,11 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
56602
56669
|
if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
|
|
56603
56670
|
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
56604
56671
|
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
56605
|
-
if (evaluatedSize > evaluatedRowSize && evaluatedSize >
|
|
56672
|
+
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = evaluatedSize;
|
|
56606
56673
|
} else {
|
|
56607
56674
|
const content = cell.content;
|
|
56608
56675
|
const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
56609
|
-
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize >
|
|
56676
|
+
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = 0;
|
|
56610
56677
|
}
|
|
56611
56678
|
}
|
|
56612
56679
|
rowSizes.push(evaluatedRowSize || null);
|
|
@@ -57146,7 +57213,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57146
57213
|
onNewLocalStateUpdate({ id }) {
|
|
57147
57214
|
this.undoStack.push(id);
|
|
57148
57215
|
this.redoStack = [];
|
|
57149
|
-
if (this.undoStack.length >
|
|
57216
|
+
if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
|
|
57150
57217
|
}
|
|
57151
57218
|
/**
|
|
57152
57219
|
* Fetch the last revision which is not empty and not a repeated command
|
|
@@ -57241,7 +57308,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57241
57308
|
}
|
|
57242
57309
|
getAutoSeparatorForString(str) {
|
|
57243
57310
|
const separators = [
|
|
57244
|
-
|
|
57311
|
+
NEWLINE,
|
|
57245
57312
|
";",
|
|
57246
57313
|
",",
|
|
57247
57314
|
" ",
|
|
@@ -57566,7 +57633,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57566
57633
|
case "PASTE_FROM_OS_CLIPBOARD": {
|
|
57567
57634
|
this._isCutOperation = false;
|
|
57568
57635
|
let contentToPaste = cmd.clipboardContent;
|
|
57569
|
-
if (contentToPaste.data?.version !==
|
|
57636
|
+
if (contentToPaste.data?.version !== CURRENT_VERSION) {
|
|
57570
57637
|
contentToPaste = { ...contentToPaste };
|
|
57571
57638
|
delete contentToPaste.data;
|
|
57572
57639
|
}
|
|
@@ -57801,7 +57868,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
57801
57868
|
}
|
|
57802
57869
|
getSheetData() {
|
|
57803
57870
|
const data = {
|
|
57804
|
-
version:
|
|
57871
|
+
version: CURRENT_VERSION,
|
|
57805
57872
|
clipboardId: this.clipboardId
|
|
57806
57873
|
};
|
|
57807
57874
|
if (this.copiedData && "figureId" in this.copiedData) return data;
|
|
@@ -58524,7 +58591,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
58524
58591
|
const toRemove = isBasedBefore ? cmd.elements.map((el) => el + thickness) : cmd.elements;
|
|
58525
58592
|
const originalSize = Object.fromEntries(toRemove.map((element) => {
|
|
58526
58593
|
const size = isCol ? this.getters.getColSize(cmd.sheetId, element) : this.getters.getUserRowSize(cmd.sheetId, element);
|
|
58527
|
-
return [element, isCol && size ===
|
|
58594
|
+
return [element, isCol && size === DEFAULT_CELL_WIDTH || size === void 0 ? null : size];
|
|
58528
58595
|
}));
|
|
58529
58596
|
const target = [{
|
|
58530
58597
|
left: isCol ? start + deltaCol : 0,
|
|
@@ -58739,14 +58806,14 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
58739
58806
|
const topRowSize = this.getters.getRowSize(this.sheetId, topRowIndex);
|
|
58740
58807
|
let width = lastColEnd - this.offsetCorrectionX;
|
|
58741
58808
|
if (this.canScrollHorizontally) {
|
|
58742
|
-
width += Math.max(
|
|
58809
|
+
width += Math.max(DEFAULT_CELL_WIDTH, Math.min(leftColSize, this.viewportWidth - lastColSize));
|
|
58743
58810
|
width = Math.max(width, this.viewportWidth);
|
|
58744
58811
|
}
|
|
58745
58812
|
let height = lastRowEnd - this.offsetCorrectionY;
|
|
58746
58813
|
if (this.canScrollVertically) {
|
|
58747
|
-
height += Math.max(
|
|
58814
|
+
height += Math.max(DEFAULT_CELL_HEIGHT + 5, Math.min(topRowSize, this.viewportHeight - lastRowSize));
|
|
58748
58815
|
height = Math.max(height, this.viewportHeight);
|
|
58749
|
-
if (lastRowEnd +
|
|
58816
|
+
if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly()) height += FOOTER_HEIGHT;
|
|
58750
58817
|
}
|
|
58751
58818
|
return {
|
|
58752
58819
|
width,
|
|
@@ -60047,7 +60114,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60047
60114
|
.o-sheet {
|
|
60048
60115
|
padding: 0 15px;
|
|
60049
60116
|
padding-right: 10px;
|
|
60050
|
-
height: ${
|
|
60117
|
+
height: ${BOTTOMBAR_HEIGHT}px;
|
|
60051
60118
|
border-left: 1px solid #c1c1c1;
|
|
60052
60119
|
border-right: 1px solid #c1c1c1;
|
|
60053
60120
|
margin-left: -1px;
|
|
@@ -60420,7 +60487,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60420
60487
|
css`
|
|
60421
60488
|
.o-spreadsheet-bottom-bar {
|
|
60422
60489
|
background-color: ${BACKGROUND_GRAY_COLOR};
|
|
60423
|
-
padding-left: ${
|
|
60490
|
+
padding-left: ${HEADER_WIDTH}px;
|
|
60424
60491
|
font-size: 15px;
|
|
60425
60492
|
border-top: 1px solid lightgrey;
|
|
60426
60493
|
|
|
@@ -60920,16 +60987,16 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60920
60987
|
const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
|
|
60921
60988
|
const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
|
|
60922
60989
|
let groupHeaderY = 0;
|
|
60923
|
-
let groupHeaderHeight =
|
|
60990
|
+
let groupHeaderHeight = HEADER_HEIGHT;
|
|
60924
60991
|
if (startRow !== 0) {
|
|
60925
60992
|
const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
|
|
60926
|
-
groupHeaderY =
|
|
60993
|
+
groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
|
|
60927
60994
|
groupHeaderHeight = headerRowDims.end - headerRowDims.start;
|
|
60928
60995
|
}
|
|
60929
60996
|
const headerRect = {
|
|
60930
60997
|
x: this.props.layerOffset,
|
|
60931
60998
|
y: groupHeaderY,
|
|
60932
|
-
width:
|
|
60999
|
+
width: GROUP_LAYER_WIDTH,
|
|
60933
61000
|
height: groupHeaderHeight
|
|
60934
61001
|
};
|
|
60935
61002
|
return {
|
|
@@ -60937,7 +61004,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60937
61004
|
groupRect: {
|
|
60938
61005
|
x: this.props.layerOffset,
|
|
60939
61006
|
y: headerRect.y,
|
|
60940
|
-
width:
|
|
61007
|
+
width: GROUP_LAYER_WIDTH,
|
|
60941
61008
|
height: headerRect.height + (endCoordinates - startCoordinates)
|
|
60942
61009
|
},
|
|
60943
61010
|
isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
|
|
@@ -60970,17 +61037,17 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60970
61037
|
const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
|
|
60971
61038
|
const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
|
|
60972
61039
|
let groupHeaderX = 0;
|
|
60973
|
-
let groupHeaderWidth =
|
|
61040
|
+
let groupHeaderWidth = HEADER_WIDTH;
|
|
60974
61041
|
if (startCol !== 0) {
|
|
60975
61042
|
const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
|
|
60976
|
-
groupHeaderX =
|
|
61043
|
+
groupHeaderX = HEADER_WIDTH + headerRowDims.start;
|
|
60977
61044
|
groupHeaderWidth = headerRowDims.end - headerRowDims.start;
|
|
60978
61045
|
}
|
|
60979
61046
|
const headerRect = {
|
|
60980
61047
|
x: groupHeaderX,
|
|
60981
61048
|
y: this.props.layerOffset,
|
|
60982
61049
|
width: groupHeaderWidth,
|
|
60983
|
-
height:
|
|
61050
|
+
height: GROUP_LAYER_WIDTH
|
|
60984
61051
|
};
|
|
60985
61052
|
return {
|
|
60986
61053
|
headerRect,
|
|
@@ -60988,7 +61055,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
60988
61055
|
x: headerRect.x,
|
|
60989
61056
|
y: this.props.layerOffset,
|
|
60990
61057
|
width: headerRect.width + (endCoordinates - startCoordinates),
|
|
60991
|
-
height:
|
|
61058
|
+
height: GROUP_LAYER_WIDTH
|
|
60992
61059
|
},
|
|
60993
61060
|
isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
|
|
60994
61061
|
};
|
|
@@ -61035,7 +61102,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61035
61102
|
menuItems: []
|
|
61036
61103
|
});
|
|
61037
61104
|
getLayerOffset(layerIndex) {
|
|
61038
|
-
return layerIndex *
|
|
61105
|
+
return layerIndex * GROUP_LAYER_WIDTH;
|
|
61039
61106
|
}
|
|
61040
61107
|
onContextMenu(event) {
|
|
61041
61108
|
const sheetId = this.env.model.getters.getActiveSheetId();
|
|
@@ -61079,8 +61146,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61079
61146
|
get frozenPaneContainerSize() {
|
|
61080
61147
|
if (!this.hasFrozenPane) return 0;
|
|
61081
61148
|
const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
|
|
61082
|
-
if (this.props.dimension === "COL") return
|
|
61083
|
-
else return
|
|
61149
|
+
if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
|
|
61150
|
+
else return HEADER_HEIGHT + viewportCoordinates.y;
|
|
61084
61151
|
}
|
|
61085
61152
|
};
|
|
61086
61153
|
|
|
@@ -61599,7 +61666,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61599
61666
|
"max-height": `${COMPOSER_MAX_HEIGHT}px`,
|
|
61600
61667
|
"line-height": "24px"
|
|
61601
61668
|
};
|
|
61602
|
-
style.height = this.focus === "inactive" ? `${
|
|
61669
|
+
style.height = this.focus === "inactive" ? `${TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
|
|
61603
61670
|
return cssPropertiesToCss(style);
|
|
61604
61671
|
}
|
|
61605
61672
|
get containerStyle() {
|
|
@@ -61807,7 +61874,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61807
61874
|
|
|
61808
61875
|
/* Toolbar */
|
|
61809
61876
|
.o-topbar-toolbar {
|
|
61810
|
-
height: ${
|
|
61877
|
+
height: ${TOPBAR_TOOLBAR_HEIGHT}px;
|
|
61811
61878
|
|
|
61812
61879
|
.o-readonly-toolbar {
|
|
61813
61880
|
background-color: ${BACKGROUND_HEADER_COLOR};
|
|
@@ -62074,9 +62141,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62074
62141
|
direction: ltr;
|
|
62075
62142
|
}
|
|
62076
62143
|
.o-separator {
|
|
62077
|
-
border-bottom: ${
|
|
62078
|
-
margin-top: ${
|
|
62079
|
-
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;
|
|
62080
62147
|
}
|
|
62081
62148
|
.o-hoverable-button {
|
|
62082
62149
|
border-radius: 2px;
|
|
@@ -62203,8 +62270,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62203
62270
|
&.corner {
|
|
62204
62271
|
right: 0px;
|
|
62205
62272
|
bottom: 0px;
|
|
62206
|
-
height: ${
|
|
62207
|
-
width: ${
|
|
62273
|
+
height: ${SCROLLBAR_WIDTH}px;
|
|
62274
|
+
width: ${SCROLLBAR_WIDTH}px;
|
|
62208
62275
|
border-top: 1px solid #e2e3e3;
|
|
62209
62276
|
border-left: 1px solid #e2e3e3;
|
|
62210
62277
|
}
|
|
@@ -62330,7 +62397,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62330
62397
|
getStyle() {
|
|
62331
62398
|
const properties = {};
|
|
62332
62399
|
if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
|
|
62333
|
-
else properties["grid-template-rows"] = `${
|
|
62400
|
+
else properties["grid-template-rows"] = `${TOPBAR_HEIGHT}px auto ${BOTTOMBAR_HEIGHT + 1}px`;
|
|
62334
62401
|
properties["grid-template-columns"] = `auto ${this.sidePanel.panelSize}px`;
|
|
62335
62402
|
return cssPropertiesToCss(properties);
|
|
62336
62403
|
}
|
|
@@ -62407,7 +62474,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62407
62474
|
checkViewportSize() {
|
|
62408
62475
|
const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
|
|
62409
62476
|
if (!isFinite(xRatio) || !isFinite(yRatio)) return;
|
|
62410
|
-
if (yRatio >
|
|
62477
|
+
if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
|
|
62411
62478
|
if (this.isViewportTooSmall) return;
|
|
62412
62479
|
this.notificationStore.notifyUser({
|
|
62413
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."),
|
|
@@ -62438,8 +62505,8 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
62438
62505
|
return height;
|
|
62439
62506
|
}
|
|
62440
62507
|
get gridContainerStyle() {
|
|
62441
|
-
const gridColSize =
|
|
62442
|
-
const gridRowSize =
|
|
62508
|
+
const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
|
|
62509
|
+
const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
|
|
62443
62510
|
return cssPropertiesToCss({
|
|
62444
62511
|
"grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
|
|
62445
62512
|
"grid-template-rows": `${gridRowSize ? gridRowSize + 2 : 0}px auto`
|
|
@@ -63975,7 +64042,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63975
64042
|
const color = chart.data.title.color ? toXlsxHexColor(chart.data.title.color) : chart.data.fontColor;
|
|
63976
64043
|
title = escapeXml`
|
|
63977
64044
|
<c:title>
|
|
63978
|
-
${insertText(chart.data.title.text, color,
|
|
64045
|
+
${insertText(chart.data.title.text, color, DEFAULT_CHART_FONT_SIZE, chart.data.title)}
|
|
63979
64046
|
<c:overlay val="0" />
|
|
63980
64047
|
</c:title>
|
|
63981
64048
|
`;
|
|
@@ -64059,7 +64126,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
64059
64126
|
</a:ln>
|
|
64060
64127
|
`;
|
|
64061
64128
|
}
|
|
64062
|
-
function insertText(text, fontColor = "000000", fontsize =
|
|
64129
|
+
function insertText(text, fontColor = "000000", fontsize = DEFAULT_CHART_FONT_SIZE, style = {}) {
|
|
64063
64130
|
return escapeXml`
|
|
64064
64131
|
<c:tx>
|
|
64065
64132
|
<c:rich>
|
|
@@ -65011,12 +65078,12 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65011
65078
|
let currentPosition = 0;
|
|
65012
65079
|
for (const [headerIndex, header] of headers.entries()) if (currentPosition <= position && position < currentPosition + header.size) return {
|
|
65013
65080
|
index: headerIndex,
|
|
65014
|
-
offset: convertDotValueToEMU(position - currentPosition +
|
|
65081
|
+
offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH)
|
|
65015
65082
|
};
|
|
65016
65083
|
else if (headerIndex < headers.length - 1) currentPosition += header.size;
|
|
65017
65084
|
return {
|
|
65018
65085
|
index: headers.length - 1,
|
|
65019
|
-
offset: convertDotValueToEMU(position - currentPosition +
|
|
65086
|
+
offset: convertDotValueToEMU(position - currentPosition + FIGURE_BORDER_WIDTH)
|
|
65020
65087
|
};
|
|
65021
65088
|
}
|
|
65022
65089
|
function createChartDrawing(figure, sheet, chartRelId) {
|
|
@@ -65115,7 +65182,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65115
65182
|
function addNumberFormats(numFmts) {
|
|
65116
65183
|
const numFmtNodes = [];
|
|
65117
65184
|
for (const [index, numFmt] of Object.entries(numFmts)) {
|
|
65118
|
-
const numFmtAttrs = [["numFmtId", parseInt(index) +
|
|
65185
|
+
const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
|
|
65119
65186
|
numFmtNodes.push(escapeXml`
|
|
65120
65187
|
<numFmt ${formatAttributes(numFmtAttrs)}/>
|
|
65121
65188
|
`);
|
|
@@ -65347,7 +65414,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65347
65414
|
const attributes = [
|
|
65348
65415
|
["min", parseInt(id) + 1],
|
|
65349
65416
|
["max", parseInt(id) + 1],
|
|
65350
|
-
["width", convertWidthToExcel(col.size ||
|
|
65417
|
+
["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
|
|
65351
65418
|
["customWidth", 1],
|
|
65352
65419
|
["hidden", col.isHidden ? 1 : 0]
|
|
65353
65420
|
];
|
|
@@ -65368,7 +65435,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65368
65435
|
for (let r = 0; r < sheet.rowNumber; r++) {
|
|
65369
65436
|
const rowAttrs = [["r", r + 1]];
|
|
65370
65437
|
const row = sheet.rows[r] || {};
|
|
65371
|
-
if (row.size && row.size !==
|
|
65438
|
+
if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
|
|
65372
65439
|
if (row.isHidden) rowAttrs.push(["hidden", 1]);
|
|
65373
65440
|
if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
|
|
65374
65441
|
if (row.collapsed) rowAttrs.push(["collapsed", 1]);
|
|
@@ -65401,7 +65468,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65401
65468
|
</c>`);
|
|
65402
65469
|
}
|
|
65403
65470
|
}
|
|
65404
|
-
if (cellNodes.length || row.size !==
|
|
65471
|
+
if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
|
|
65405
65472
|
<row ${formatAttributes(rowAttrs)}>
|
|
65406
65473
|
${joinXmlNodes(cellNodes)}
|
|
65407
65474
|
</row>
|
|
@@ -65574,7 +65641,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
65574
65641
|
let currentTableIndex = 1;
|
|
65575
65642
|
for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
|
|
65576
65643
|
const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
|
|
65577
|
-
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(
|
|
65644
|
+
const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
|
|
65578
65645
|
const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
|
|
65579
65646
|
currentTableIndex += sheet.tables.length;
|
|
65580
65647
|
let drawingNode = escapeXml``;
|
|
@@ -66202,7 +66269,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66202
66269
|
exportData() {
|
|
66203
66270
|
let data = createEmptyWorkbookData();
|
|
66204
66271
|
for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data);
|
|
66205
|
-
data.revisionId = this.session.getRevisionId() ||
|
|
66272
|
+
data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
|
|
66206
66273
|
data = deepCopy(data);
|
|
66207
66274
|
return data;
|
|
66208
66275
|
}
|
|
@@ -66246,15 +66313,15 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66246
66313
|
*/
|
|
66247
66314
|
const __info__ = {};
|
|
66248
66315
|
const SPREADSHEET_DIMENSIONS = {
|
|
66249
|
-
MIN_ROW_HEIGHT
|
|
66250
|
-
MIN_COL_WIDTH
|
|
66251
|
-
HEADER_HEIGHT
|
|
66252
|
-
HEADER_WIDTH
|
|
66253
|
-
TOPBAR_HEIGHT
|
|
66254
|
-
BOTTOMBAR_HEIGHT
|
|
66255
|
-
DEFAULT_CELL_WIDTH
|
|
66256
|
-
DEFAULT_CELL_HEIGHT
|
|
66257
|
-
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
|
|
66258
66325
|
};
|
|
66259
66326
|
const registries = {
|
|
66260
66327
|
autoCompleteProviders,
|
|
@@ -66339,6 +66406,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66339
66406
|
overlap,
|
|
66340
66407
|
union,
|
|
66341
66408
|
isInside,
|
|
66409
|
+
addStyleToWorkbookData,
|
|
66342
66410
|
deepCopy,
|
|
66343
66411
|
expandZoneOnInsertion,
|
|
66344
66412
|
reduceZoneOnDeletion,
|
|
@@ -66446,7 +66514,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66446
66514
|
DEFAULT_LOCALE,
|
|
66447
66515
|
HIGHLIGHT_COLOR,
|
|
66448
66516
|
PIVOT_TABLE_CONFIG,
|
|
66449
|
-
TREND_LINE_XAXIS_ID
|
|
66517
|
+
TREND_LINE_XAXIS_ID,
|
|
66450
66518
|
CHART_AXIS_CHOICES,
|
|
66451
66519
|
ChartTerms
|
|
66452
66520
|
};
|
|
@@ -66498,8 +66566,8 @@ exports.stores = stores;
|
|
|
66498
66566
|
exports.tokenColors = tokenColors;
|
|
66499
66567
|
exports.tokenize = tokenize;
|
|
66500
66568
|
|
|
66501
|
-
__info__.version = "18.0.
|
|
66502
|
-
__info__.date = "2026-
|
|
66503
|
-
__info__.hash = "
|
|
66569
|
+
__info__.version = "18.0.83";
|
|
66570
|
+
__info__.date = "2026-10-10T06:31:52.656Z";
|
|
66571
|
+
__info__.hash = "22b9b73";
|
|
66504
66572
|
|
|
66505
66573
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|