@odoo/o-spreadsheet 18.2.0-alpha.7 → 18.2.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/o-spreadsheet.cjs.js +190 -179
- package/dist/o-spreadsheet.d.ts +18 -2
- package/dist/o-spreadsheet.esm.js +190 -179
- package/dist/o-spreadsheet.iife.js +190 -179
- package/dist/o-spreadsheet.iife.min.js +137 -185
- package/dist/o_spreadsheet.xml +4 -4
- 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.2.0-alpha.
|
|
6
|
-
* @date 2025-02-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.0-alpha.8
|
|
6
|
+
* @date 2025-02-14T08:40:13.286Z
|
|
7
|
+
* @hash 19d45d9
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, App, blockDom, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -6488,6 +6488,33 @@ function drawDecoratedText(context, text, position, underline = false, strikethr
|
|
|
6488
6488
|
* https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
|
|
6489
6489
|
* */
|
|
6490
6490
|
class UuidGenerator {
|
|
6491
|
+
/**
|
|
6492
|
+
* Generates a custom UUID using a simple 36^12 method (8-character alphanumeric string with lowercase letters)
|
|
6493
|
+
* This has a higher chance of collision than a UUIDv4, but not only faster to generate than an UUIDV4,
|
|
6494
|
+
* it also has a smaller size, which is preferable to alleviate the overall data size.
|
|
6495
|
+
*
|
|
6496
|
+
* This method is preferable when generating uuids for the core data (sheetId, figureId, etc)
|
|
6497
|
+
* as they will appear several times in the revisions and local history.
|
|
6498
|
+
*
|
|
6499
|
+
*/
|
|
6500
|
+
smallUuid() {
|
|
6501
|
+
//@ts-ignore
|
|
6502
|
+
if (window.crypto && window.crypto.getRandomValues) {
|
|
6503
|
+
//@ts-ignore
|
|
6504
|
+
return ([1e7] + -1e3).replace(/[018]/g, (c) => (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));
|
|
6505
|
+
}
|
|
6506
|
+
else {
|
|
6507
|
+
// mainly for jest and other browsers that do not have the crypto functionality
|
|
6508
|
+
return "xxxxxxxx-xxxx".replace(/[xy]/g, function (c) {
|
|
6509
|
+
const r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8;
|
|
6510
|
+
return v.toString(16);
|
|
6511
|
+
});
|
|
6512
|
+
}
|
|
6513
|
+
}
|
|
6514
|
+
/**
|
|
6515
|
+
* Generates an UUIDV4, has astronomically low chance of collision, but is larger in size than the smallUuid.
|
|
6516
|
+
* This method should be used when you need to avoid collisions at all costs, like the id of a revision.
|
|
6517
|
+
*/
|
|
6491
6518
|
uuidv4() {
|
|
6492
6519
|
//@ts-ignore
|
|
6493
6520
|
if (window.crypto && window.crypto.getRandomValues) {
|
|
@@ -8523,7 +8550,7 @@ class ChartClipboardHandler extends AbstractFigureClipboardHandler {
|
|
|
8523
8550
|
};
|
|
8524
8551
|
}
|
|
8525
8552
|
getPasteTarget(sheetId, target, content, options) {
|
|
8526
|
-
const newId = new UuidGenerator().
|
|
8553
|
+
const newId = new UuidGenerator().smallUuid();
|
|
8527
8554
|
return { zones: [], figureId: newId, sheetId };
|
|
8528
8555
|
}
|
|
8529
8556
|
paste(target, clippedContent, options) {
|
|
@@ -8689,7 +8716,7 @@ class ConditionalFormatClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
8689
8716
|
if (!targetCF && queuedCfs) {
|
|
8690
8717
|
targetCF = queuedCfs.find((queued) => queued.cf.stopIfTrue === originCF.stopIfTrue && deepEquals(queued.cf.rule, originCF.rule))?.cf;
|
|
8691
8718
|
}
|
|
8692
|
-
return targetCF || { ...originCF, id: this.uuidGenerator.
|
|
8719
|
+
return targetCF || { ...originCF, id: this.uuidGenerator.smallUuid(), ranges: [] };
|
|
8693
8720
|
}
|
|
8694
8721
|
}
|
|
8695
8722
|
|
|
@@ -8782,7 +8809,7 @@ class DataValidationClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
8782
8809
|
}
|
|
8783
8810
|
return (targetRule || {
|
|
8784
8811
|
...originRule,
|
|
8785
|
-
id: newId ? this.uuidGenerator.
|
|
8812
|
+
id: newId ? this.uuidGenerator.smallUuid() : originRule.id,
|
|
8786
8813
|
ranges: [],
|
|
8787
8814
|
});
|
|
8788
8815
|
}
|
|
@@ -8844,7 +8871,7 @@ class ImageClipboardHandler extends AbstractFigureClipboardHandler {
|
|
|
8844
8871
|
};
|
|
8845
8872
|
}
|
|
8846
8873
|
getPasteTarget(sheetId, target, content, options) {
|
|
8847
|
-
const newId = new UuidGenerator().
|
|
8874
|
+
const newId = new UuidGenerator().smallUuid();
|
|
8848
8875
|
return { sheetId, zones: [], figureId: newId };
|
|
8849
8876
|
}
|
|
8850
8877
|
paste(target, clippedContent, options) {
|
|
@@ -10179,9 +10206,6 @@ css /* scss */ `
|
|
|
10179
10206
|
font-size: 12px;
|
|
10180
10207
|
background-color: #fff;
|
|
10181
10208
|
z-index: ${ComponentsImportance.FigureTooltip};
|
|
10182
|
-
table td span {
|
|
10183
|
-
box-sizing: border-box;
|
|
10184
|
-
}
|
|
10185
10209
|
}
|
|
10186
10210
|
}
|
|
10187
10211
|
`;
|
|
@@ -15285,7 +15309,7 @@ const SORTN = {
|
|
|
15285
15309
|
}
|
|
15286
15310
|
}
|
|
15287
15311
|
},
|
|
15288
|
-
isExported:
|
|
15312
|
+
isExported: false,
|
|
15289
15313
|
};
|
|
15290
15314
|
// -----------------------------------------------------------------------------
|
|
15291
15315
|
// UNIQUE
|
|
@@ -22873,6 +22897,10 @@ const DRAWING_NS_A = "http://schemas.openxmlformats.org/drawingml/2006/main";
|
|
|
22873
22897
|
const DRAWING_NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
22874
22898
|
const CONTENT_TYPES = {
|
|
22875
22899
|
workbook: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
|
|
22900
|
+
macroEnabledWorkbook: "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
|
|
22901
|
+
templateWorkbook: "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml",
|
|
22902
|
+
macroEnabledTemplateWorkbook: "application/vnd.ms-excel.template.macroEnabled.main+xml",
|
|
22903
|
+
excelAddInWorkbook: "application/vnd.ms-excel.addin.macroEnabled.main+xml",
|
|
22876
22904
|
sheet: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
|
|
22877
22905
|
sharedStrings: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
|
|
22878
22906
|
styles: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
|
|
@@ -26944,7 +26972,11 @@ class XlsxReader {
|
|
|
26944
26972
|
buildXlsxFileStructure() {
|
|
26945
26973
|
const xlsxFileStructure = {
|
|
26946
26974
|
sheets: getXLSXFilesOfType(CONTENT_TYPES.sheet, this.xmls),
|
|
26947
|
-
workbook: getXLSXFilesOfType(CONTENT_TYPES.workbook, this.xmls)[0]
|
|
26975
|
+
workbook: getXLSXFilesOfType(CONTENT_TYPES.workbook, this.xmls)[0] ||
|
|
26976
|
+
getXLSXFilesOfType(CONTENT_TYPES.macroEnabledWorkbook, this.xmls)[0] ||
|
|
26977
|
+
getXLSXFilesOfType(CONTENT_TYPES.templateWorkbook, this.xmls)[0] ||
|
|
26978
|
+
getXLSXFilesOfType(CONTENT_TYPES.macroEnabledTemplateWorkbook, this.xmls)[0] ||
|
|
26979
|
+
getXLSXFilesOfType(CONTENT_TYPES.excelAddInWorkbook, this.xmls)[0],
|
|
26948
26980
|
styles: getXLSXFilesOfType(CONTENT_TYPES.styles, this.xmls)[0],
|
|
26949
26981
|
sharedStrings: getXLSXFilesOfType(CONTENT_TYPES.sharedStrings, this.xmls)[0],
|
|
26950
26982
|
theme: getXLSXFilesOfType(CONTENT_TYPES.themes, this.xmls)[0],
|
|
@@ -27642,7 +27674,7 @@ function forceUnicityOfFigure(data) {
|
|
|
27642
27674
|
for (const sheet of data.sheets || []) {
|
|
27643
27675
|
for (const figure of sheet.figures || []) {
|
|
27644
27676
|
if (figureIds.has(figure.id)) {
|
|
27645
|
-
figure.id += uuidGenerator.
|
|
27677
|
+
figure.id += uuidGenerator.smallUuid();
|
|
27646
27678
|
}
|
|
27647
27679
|
figureIds.add(figure.id);
|
|
27648
27680
|
}
|
|
@@ -28226,9 +28258,7 @@ function getBarChartData(definition, dataSets, labelRange, getters) {
|
|
|
28226
28258
|
const labelValues = getChartLabelValues(getters, dataSets, labelRange);
|
|
28227
28259
|
let labels = labelValues.formattedValues;
|
|
28228
28260
|
let dataSetsValues = getChartDatasetValues(getters, dataSets);
|
|
28229
|
-
if (definition.dataSetsHaveTitle
|
|
28230
|
-
dataSetsValues[0] &&
|
|
28231
|
-
labels.length > dataSetsValues[0].data.length) {
|
|
28261
|
+
if (shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false)) {
|
|
28232
28262
|
labels.shift();
|
|
28233
28263
|
}
|
|
28234
28264
|
({ labels, dataSetsValues } = filterInvalidDataPoints(labels, dataSetsValues));
|
|
@@ -28277,13 +28307,12 @@ function getPyramidChartData(definition, dataSets, labelRange, getters) {
|
|
|
28277
28307
|
};
|
|
28278
28308
|
}
|
|
28279
28309
|
function getLineChartData(definition, dataSets, labelRange, getters) {
|
|
28280
|
-
const axisType = getChartAxisType(definition, labelRange, getters);
|
|
28310
|
+
const axisType = getChartAxisType(definition, dataSets, labelRange, getters);
|
|
28281
28311
|
const labelValues = getChartLabelValues(getters, dataSets, labelRange);
|
|
28282
28312
|
let labels = axisType === "linear" ? labelValues.values : labelValues.formattedValues;
|
|
28283
28313
|
let dataSetsValues = getChartDatasetValues(getters, dataSets);
|
|
28284
|
-
|
|
28285
|
-
|
|
28286
|
-
labels.length > dataSetsValues[0].data.length) {
|
|
28314
|
+
const removeFirstLabel = shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false);
|
|
28315
|
+
if (removeFirstLabel) {
|
|
28287
28316
|
labels.shift();
|
|
28288
28317
|
}
|
|
28289
28318
|
({ labels, dataSetsValues } = filterInvalidDataPoints(labels, dataSetsValues));
|
|
@@ -28295,7 +28324,7 @@ function getLineChartData(definition, dataSets, labelRange, getters) {
|
|
|
28295
28324
|
}
|
|
28296
28325
|
const leftAxisFormat = getChartDatasetFormat(getters, dataSets, "left");
|
|
28297
28326
|
const rightAxisFormat = getChartDatasetFormat(getters, dataSets, "right");
|
|
28298
|
-
const labelsFormat = getChartLabelFormat(getters, labelRange);
|
|
28327
|
+
const labelsFormat = getChartLabelFormat(getters, labelRange, removeFirstLabel);
|
|
28299
28328
|
const axisFormats = { y: leftAxisFormat, y1: rightAxisFormat, x: labelsFormat };
|
|
28300
28329
|
const trendDataSetsValues = [];
|
|
28301
28330
|
for (const index in dataSetsValues) {
|
|
@@ -28331,9 +28360,7 @@ function getPieChartData(definition, dataSets, labelRange, getters) {
|
|
|
28331
28360
|
const labelValues = getChartLabelValues(getters, dataSets, labelRange);
|
|
28332
28361
|
let labels = labelValues.formattedValues;
|
|
28333
28362
|
let dataSetsValues = getChartDatasetValues(getters, dataSets);
|
|
28334
|
-
if (definition.dataSetsHaveTitle
|
|
28335
|
-
dataSetsValues[0] &&
|
|
28336
|
-
labels.length > dataSetsValues[0].data.length) {
|
|
28363
|
+
if (shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false)) {
|
|
28337
28364
|
labels.shift();
|
|
28338
28365
|
}
|
|
28339
28366
|
({ labels, dataSetsValues } = filterInvalidDataPoints(labels, dataSetsValues));
|
|
@@ -28353,9 +28380,7 @@ function getRadarChartData(definition, dataSets, labelRange, getters) {
|
|
|
28353
28380
|
const labelValues = getChartLabelValues(getters, dataSets, labelRange);
|
|
28354
28381
|
let labels = labelValues.formattedValues;
|
|
28355
28382
|
let dataSetsValues = getChartDatasetValues(getters, dataSets);
|
|
28356
|
-
if (definition.dataSetsHaveTitle
|
|
28357
|
-
dataSetsValues[0] &&
|
|
28358
|
-
labels.length > dataSetsValues[0].data.length) {
|
|
28383
|
+
if (shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false)) {
|
|
28359
28384
|
labels.shift();
|
|
28360
28385
|
}
|
|
28361
28386
|
({ labels, dataSetsValues } = filterInvalidDataPoints(labels, dataSetsValues));
|
|
@@ -28375,7 +28400,7 @@ function getRadarChartData(definition, dataSets, labelRange, getters) {
|
|
|
28375
28400
|
function getGeoChartData(definition, dataSets, labelRange, getters) {
|
|
28376
28401
|
const labelValues = getChartLabelValues(getters, dataSets, labelRange);
|
|
28377
28402
|
let labels = labelValues.formattedValues;
|
|
28378
|
-
if (definition.dataSetsHaveTitle) {
|
|
28403
|
+
if (shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false)) {
|
|
28379
28404
|
labels.shift();
|
|
28380
28405
|
}
|
|
28381
28406
|
let dataSetsValues = getChartDatasetValues(getters, dataSets);
|
|
@@ -28536,36 +28561,41 @@ function normalizeLabels(labels, newLabels, config) {
|
|
|
28536
28561
|
}
|
|
28537
28562
|
return { normalizedLabels, normalizedNewLabels };
|
|
28538
28563
|
}
|
|
28539
|
-
function getChartAxisType(
|
|
28540
|
-
if (isDateChart(
|
|
28564
|
+
function getChartAxisType(definition, dataSets, labelRange, getters) {
|
|
28565
|
+
if (isDateChart(definition, dataSets, labelRange, getters) && isLuxonTimeAdapterInstalled()) {
|
|
28541
28566
|
return "time";
|
|
28542
28567
|
}
|
|
28543
|
-
if (isLinearChart(
|
|
28568
|
+
if (isLinearChart(definition, dataSets, labelRange, getters)) {
|
|
28544
28569
|
return "linear";
|
|
28545
28570
|
}
|
|
28546
28571
|
return "category";
|
|
28547
28572
|
}
|
|
28548
|
-
function isDateChart(definition, labelRange, getters) {
|
|
28549
|
-
return !definition.labelsAsText && canBeDateChart(labelRange, getters);
|
|
28573
|
+
function isDateChart(definition, dataSets, labelRange, getters) {
|
|
28574
|
+
return !definition.labelsAsText && canBeDateChart(definition, dataSets, labelRange, getters);
|
|
28550
28575
|
}
|
|
28551
|
-
function isLinearChart(definition, labelRange, getters) {
|
|
28552
|
-
return !definition.labelsAsText && canBeLinearChart(labelRange, getters);
|
|
28576
|
+
function isLinearChart(definition, dataSets, labelRange, getters) {
|
|
28577
|
+
return !definition.labelsAsText && canBeLinearChart(definition, dataSets, labelRange, getters);
|
|
28553
28578
|
}
|
|
28554
|
-
function canChartParseLabels(labelRange, getters) {
|
|
28555
|
-
return canBeDateChart(
|
|
28579
|
+
function canChartParseLabels(definition, dataSets, labelRange, getters) {
|
|
28580
|
+
return (canBeDateChart(definition, dataSets, labelRange, getters) ||
|
|
28581
|
+
canBeLinearChart(definition, dataSets, labelRange, getters));
|
|
28556
28582
|
}
|
|
28557
|
-
function canBeDateChart(labelRange, getters) {
|
|
28558
|
-
if (!labelRange || !canBeLinearChart(labelRange, getters)) {
|
|
28583
|
+
function canBeDateChart(definition, dataSets, labelRange, getters) {
|
|
28584
|
+
if (!labelRange || !canBeLinearChart(definition, dataSets, labelRange, getters)) {
|
|
28559
28585
|
return false;
|
|
28560
28586
|
}
|
|
28561
|
-
const
|
|
28587
|
+
const removeFirstLabel = shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false);
|
|
28588
|
+
const labelFormat = getChartLabelFormat(getters, labelRange, removeFirstLabel);
|
|
28562
28589
|
return Boolean(labelFormat && timeFormatLuxonCompatible.test(labelFormat));
|
|
28563
28590
|
}
|
|
28564
|
-
function canBeLinearChart(labelRange, getters) {
|
|
28591
|
+
function canBeLinearChart(definition, dataSets, labelRange, getters) {
|
|
28565
28592
|
if (!labelRange) {
|
|
28566
28593
|
return false;
|
|
28567
28594
|
}
|
|
28568
28595
|
const labels = getters.getRangeValues(labelRange);
|
|
28596
|
+
if (shouldRemoveFirstLabel(labelRange, dataSets[0], definition.dataSetsHaveTitle || false)) {
|
|
28597
|
+
labels.shift();
|
|
28598
|
+
}
|
|
28569
28599
|
if (labels.some((label) => isNaN(Number(label)) && label)) {
|
|
28570
28600
|
return false;
|
|
28571
28601
|
}
|
|
@@ -28674,17 +28704,15 @@ function aggregateDataForLabels(labels, datasets) {
|
|
|
28674
28704
|
})),
|
|
28675
28705
|
};
|
|
28676
28706
|
}
|
|
28677
|
-
function getChartLabelFormat(getters, range) {
|
|
28707
|
+
function getChartLabelFormat(getters, range, shouldRemoveFirstLabel) {
|
|
28678
28708
|
if (!range)
|
|
28679
28709
|
return undefined;
|
|
28680
|
-
const { sheetId, zone
|
|
28681
|
-
|
|
28682
|
-
|
|
28683
|
-
|
|
28684
|
-
return format;
|
|
28685
|
-
}
|
|
28710
|
+
const { sheetId, zone } = range;
|
|
28711
|
+
const formats = positions(zone).map((position) => getters.getEvaluatedCell({ sheetId, ...position }).format);
|
|
28712
|
+
if (shouldRemoveFirstLabel) {
|
|
28713
|
+
formats.shift();
|
|
28686
28714
|
}
|
|
28687
|
-
return undefined;
|
|
28715
|
+
return formats.find((format) => format !== undefined);
|
|
28688
28716
|
}
|
|
28689
28717
|
function getChartLabelValues(getters, dataSets, labelRange) {
|
|
28690
28718
|
let labels = { values: [], formattedValues: [] };
|
|
@@ -32591,7 +32619,6 @@ css /* scss */ `
|
|
|
32591
32619
|
border-left: 3px solid red;
|
|
32592
32620
|
padding: 10px;
|
|
32593
32621
|
width: ${ERROR_TOOLTIP_WIDTH}px;
|
|
32594
|
-
box-sizing: border-box !important;
|
|
32595
32622
|
overflow-wrap: break-word;
|
|
32596
32623
|
|
|
32597
32624
|
.o-error-tooltip-message {
|
|
@@ -32674,7 +32701,6 @@ css /* scss */ `
|
|
|
32674
32701
|
width: ${CHECKBOX_WIDTH}px;
|
|
32675
32702
|
height: ${CHECKBOX_WIDTH}px;
|
|
32676
32703
|
vertical-align: top;
|
|
32677
|
-
box-sizing: border-box;
|
|
32678
32704
|
outline: none;
|
|
32679
32705
|
border: 1px solid ${GRAY_300};
|
|
32680
32706
|
cursor: pointer;
|
|
@@ -32747,14 +32773,12 @@ class FilterMenuValueItem extends Component {
|
|
|
32747
32773
|
const FILTER_MENU_HEIGHT = 295;
|
|
32748
32774
|
const CSS = css /* scss */ `
|
|
32749
32775
|
.o-filter-menu {
|
|
32750
|
-
box-sizing: border-box;
|
|
32751
32776
|
padding: 8px 16px;
|
|
32752
32777
|
height: ${FILTER_MENU_HEIGHT}px;
|
|
32753
32778
|
line-height: 1;
|
|
32754
32779
|
|
|
32755
32780
|
.o-filter-menu-item {
|
|
32756
32781
|
display: flex;
|
|
32757
|
-
box-sizing: border-box;
|
|
32758
32782
|
cursor: pointer;
|
|
32759
32783
|
user-select: none;
|
|
32760
32784
|
|
|
@@ -32984,7 +33008,6 @@ css /* scss */ `
|
|
|
32984
33008
|
justify-content: space-between;
|
|
32985
33009
|
height: ${LINK_TOOLTIP_HEIGHT}px;
|
|
32986
33010
|
width: ${LINK_TOOLTIP_WIDTH}px;
|
|
32987
|
-
box-sizing: border-box !important;
|
|
32988
33011
|
|
|
32989
33012
|
img {
|
|
32990
33013
|
margin-right: 3px;
|
|
@@ -33101,7 +33124,7 @@ const linkSheet = {
|
|
|
33101
33124
|
const deleteSheet = {
|
|
33102
33125
|
name: _t("Delete"),
|
|
33103
33126
|
isVisible: (env) => {
|
|
33104
|
-
return env.model.getters.
|
|
33127
|
+
return env.model.getters.getVisibleSheetIds().length > 1;
|
|
33105
33128
|
},
|
|
33106
33129
|
execute: (env) => env.askConfirmation(_t("Are you sure you want to delete this sheet?"), () => {
|
|
33107
33130
|
env.model.dispatch("DELETE_SHEET", { sheetId: env.model.getters.getActiveSheetId() });
|
|
@@ -33112,7 +33135,7 @@ const duplicateSheet = {
|
|
|
33112
33135
|
name: _t("Duplicate"),
|
|
33113
33136
|
execute: (env) => {
|
|
33114
33137
|
const sheetIdFrom = env.model.getters.getActiveSheetId();
|
|
33115
|
-
const sheetIdTo = env.model.uuidGenerator.
|
|
33138
|
+
const sheetIdTo = env.model.uuidGenerator.smallUuid();
|
|
33116
33139
|
env.model.dispatch("DUPLICATE_SHEET", {
|
|
33117
33140
|
sheetId: sheetIdFrom,
|
|
33118
33141
|
sheetIdTo,
|
|
@@ -33401,11 +33424,9 @@ css /* scss */ `
|
|
|
33401
33424
|
background-color: white;
|
|
33402
33425
|
padding: ${MENU_VERTICAL_PADDING}px 0px;
|
|
33403
33426
|
width: ${MENU_WIDTH}px;
|
|
33404
|
-
box-sizing: border-box !important;
|
|
33405
33427
|
user-select: none;
|
|
33406
33428
|
|
|
33407
33429
|
.o-menu-item {
|
|
33408
|
-
box-sizing: border-box;
|
|
33409
33430
|
height: ${MENU_ITEM_HEIGHT}px;
|
|
33410
33431
|
padding: ${MENU_ITEM_PADDING_VERTICAL}px ${MENU_ITEM_PADDING_HORIZONTAL}px;
|
|
33411
33432
|
cursor: pointer;
|
|
@@ -33657,7 +33678,7 @@ class Menu extends Component {
|
|
|
33657
33678
|
const MENU_OFFSET_X = 320;
|
|
33658
33679
|
const MENU_OFFSET_Y = 100;
|
|
33659
33680
|
const PADDING = 12;
|
|
33660
|
-
const LINK_EDITOR_WIDTH = 340;
|
|
33681
|
+
const LINK_EDITOR_WIDTH = 340 + 2 * PADDING;
|
|
33661
33682
|
css /* scss */ `
|
|
33662
33683
|
.o-link-editor {
|
|
33663
33684
|
font-size: 13px;
|
|
@@ -33681,7 +33702,6 @@ css /* scss */ `
|
|
|
33681
33702
|
text-align: right;
|
|
33682
33703
|
}
|
|
33683
33704
|
input.o-input {
|
|
33684
|
-
box-sizing: border-box;
|
|
33685
33705
|
width: 100%;
|
|
33686
33706
|
padding: 0 23px 4px 0;
|
|
33687
33707
|
}
|
|
@@ -33909,20 +33929,21 @@ function getSmartChartDefinition(zone, getters) {
|
|
|
33909
33929
|
}
|
|
33910
33930
|
// Only display legend for several datasets.
|
|
33911
33931
|
const newLegendPos = dataSetZone.right === dataSetZone.left ? "none" : "top";
|
|
33912
|
-
const
|
|
33913
|
-
|
|
33914
|
-
|
|
33915
|
-
|
|
33916
|
-
|
|
33917
|
-
|
|
33918
|
-
|
|
33919
|
-
|
|
33920
|
-
|
|
33921
|
-
|
|
33922
|
-
|
|
33923
|
-
|
|
33924
|
-
|
|
33925
|
-
|
|
33932
|
+
const lineChartDefinition = {
|
|
33933
|
+
title: {},
|
|
33934
|
+
dataSets,
|
|
33935
|
+
labelsAsText: false,
|
|
33936
|
+
stacked: false,
|
|
33937
|
+
aggregated: false,
|
|
33938
|
+
cumulative: false,
|
|
33939
|
+
labelRange: labelRangeXc,
|
|
33940
|
+
type: "line",
|
|
33941
|
+
dataSetsHaveTitle,
|
|
33942
|
+
legendPosition: newLegendPos,
|
|
33943
|
+
};
|
|
33944
|
+
const chart = new LineChart(lineChartDefinition, sheetId, getters);
|
|
33945
|
+
if (canChartParseLabels(lineChartDefinition, chart.dataSets, chart.labelRange, getters)) {
|
|
33946
|
+
return lineChartDefinition;
|
|
33926
33947
|
}
|
|
33927
33948
|
const _dataSets = createDataSets(getters, dataSets, sheetId, dataSetsHaveTitle);
|
|
33928
33949
|
if (singleColumn &&
|
|
@@ -34336,7 +34357,7 @@ const HIDE_ROWS_NAME = (env) => {
|
|
|
34336
34357
|
//------------------------------------------------------------------------------
|
|
34337
34358
|
const CREATE_CHART = (env) => {
|
|
34338
34359
|
const getters = env.model.getters;
|
|
34339
|
-
const id = env.model.uuidGenerator.
|
|
34360
|
+
const id = env.model.uuidGenerator.smallUuid();
|
|
34340
34361
|
const sheetId = getters.getActiveSheetId();
|
|
34341
34362
|
if (getZoneArea(env.model.getters.getSelectedZone()) === 1) {
|
|
34342
34363
|
env.model.selection.selectTableAroundSelection();
|
|
@@ -34359,8 +34380,8 @@ const CREATE_CHART = (env) => {
|
|
|
34359
34380
|
// Pivots
|
|
34360
34381
|
//------------------------------------------------------------------------------
|
|
34361
34382
|
const CREATE_PIVOT = (env) => {
|
|
34362
|
-
const pivotId = env.model.uuidGenerator.
|
|
34363
|
-
const newSheetId = env.model.uuidGenerator.
|
|
34383
|
+
const pivotId = env.model.uuidGenerator.smallUuid();
|
|
34384
|
+
const newSheetId = env.model.uuidGenerator.smallUuid();
|
|
34364
34385
|
const result = env.model.dispatch("INSERT_NEW_PIVOT", { pivotId, newSheetId });
|
|
34365
34386
|
if (result.isSuccessful) {
|
|
34366
34387
|
env.openSidePanel("PivotSidePanel", { pivotId });
|
|
@@ -34419,7 +34440,7 @@ async function requestImage(env) {
|
|
|
34419
34440
|
const CREATE_IMAGE = async (env) => {
|
|
34420
34441
|
if (env.imageProvider) {
|
|
34421
34442
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
34422
|
-
const figureId = env.model.uuidGenerator.
|
|
34443
|
+
const figureId = env.model.uuidGenerator.smallUuid();
|
|
34423
34444
|
const image = await requestImage(env);
|
|
34424
34445
|
if (!image) {
|
|
34425
34446
|
throw new Error("No image provider was given to the environment");
|
|
@@ -34972,7 +34993,7 @@ const insertCheckbox = {
|
|
|
34972
34993
|
ranges,
|
|
34973
34994
|
sheetId,
|
|
34974
34995
|
rule: {
|
|
34975
|
-
id: env.model.uuidGenerator.
|
|
34996
|
+
id: env.model.uuidGenerator.smallUuid(),
|
|
34976
34997
|
criterion: {
|
|
34977
34998
|
type: "isBoolean",
|
|
34978
34999
|
values: [],
|
|
@@ -34988,7 +35009,7 @@ const insertDropdown = {
|
|
|
34988
35009
|
const zones = env.model.getters.getSelectedZones();
|
|
34989
35010
|
const sheetId = env.model.getters.getActiveSheetId();
|
|
34990
35011
|
const ranges = zones.map((zone) => env.model.getters.getRangeDataFromZone(sheetId, zone));
|
|
34991
|
-
const ruleID = env.model.uuidGenerator.
|
|
35012
|
+
const ruleID = env.model.uuidGenerator.smallUuid();
|
|
34992
35013
|
env.model.dispatch("ADD_DATA_VALIDATION_RULE", {
|
|
34993
35014
|
ranges,
|
|
34994
35015
|
sheetId,
|
|
@@ -35019,7 +35040,7 @@ const insertSheet = {
|
|
|
35019
35040
|
execute: (env) => {
|
|
35020
35041
|
const activeSheetId = env.model.getters.getActiveSheetId();
|
|
35021
35042
|
const position = env.model.getters.getSheetIds().indexOf(activeSheetId) + 1;
|
|
35022
|
-
const sheetId = env.model.uuidGenerator.
|
|
35043
|
+
const sheetId = env.model.uuidGenerator.smallUuid();
|
|
35023
35044
|
env.model.dispatch("CREATE_SHEET", { sheetId, position });
|
|
35024
35045
|
env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
|
|
35025
35046
|
},
|
|
@@ -37997,7 +38018,6 @@ css /* scss */ `
|
|
|
37997
38018
|
}
|
|
37998
38019
|
}
|
|
37999
38020
|
.o-button {
|
|
38000
|
-
height: 28px;
|
|
38001
38021
|
flex-grow: 0;
|
|
38002
38022
|
}
|
|
38003
38023
|
|
|
@@ -38554,8 +38574,8 @@ css /* scss */ `
|
|
|
38554
38574
|
}
|
|
38555
38575
|
}
|
|
38556
38576
|
.o-color-picker-line-item {
|
|
38557
|
-
width: ${ITEM_EDGE_LENGTH}px;
|
|
38558
|
-
height: ${ITEM_EDGE_LENGTH}px;
|
|
38577
|
+
width: ${ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH}px;
|
|
38578
|
+
height: ${ITEM_EDGE_LENGTH + 2 * ITEM_BORDER_WIDTH}px;
|
|
38559
38579
|
margin: 0px;
|
|
38560
38580
|
border-radius: 50px;
|
|
38561
38581
|
border: ${ITEM_BORDER_WIDTH}px solid #666666;
|
|
@@ -38578,7 +38598,6 @@ css /* scss */ `
|
|
|
38578
38598
|
font-size: 14px;
|
|
38579
38599
|
background: white;
|
|
38580
38600
|
border-radius: 4px;
|
|
38581
|
-
box-sizing: border-box;
|
|
38582
38601
|
&:hover:enabled {
|
|
38583
38602
|
background-color: rgba(0, 0, 0, 0.08);
|
|
38584
38603
|
}
|
|
@@ -38605,7 +38624,6 @@ css /* scss */ `
|
|
|
38605
38624
|
.o-gradient {
|
|
38606
38625
|
margin-bottom: ${MAGNIFIER_EDGE / 2}px;
|
|
38607
38626
|
border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
|
|
38608
|
-
box-sizing: border-box;
|
|
38609
38627
|
width: ${INNER_GRADIENT_WIDTH + 2 * ITEM_BORDER_WIDTH}px;
|
|
38610
38628
|
height: ${INNER_GRADIENT_HEIGHT + 2 * ITEM_BORDER_WIDTH}px;
|
|
38611
38629
|
position: relative;
|
|
@@ -38614,7 +38632,6 @@ css /* scss */ `
|
|
|
38614
38632
|
.magnifier {
|
|
38615
38633
|
height: ${MAGNIFIER_EDGE}px;
|
|
38616
38634
|
width: ${MAGNIFIER_EDGE}px;
|
|
38617
|
-
box-sizing: border-box;
|
|
38618
38635
|
border-radius: 50%;
|
|
38619
38636
|
border: 2px solid #fff;
|
|
38620
38637
|
box-shadow: 0px 0px 3px #c0c0c0;
|
|
@@ -38629,7 +38646,6 @@ css /* scss */ `
|
|
|
38629
38646
|
}
|
|
38630
38647
|
.o-hue-picker {
|
|
38631
38648
|
border: ${ITEM_BORDER_WIDTH}px solid #c0c0c0;
|
|
38632
|
-
box-sizing: border-box;
|
|
38633
38649
|
width: 100%;
|
|
38634
38650
|
height: 12px;
|
|
38635
38651
|
border-radius: 4px;
|
|
@@ -38656,7 +38672,6 @@ css /* scss */ `
|
|
|
38656
38672
|
padding: 2px 0px;
|
|
38657
38673
|
display: flex;
|
|
38658
38674
|
input {
|
|
38659
|
-
box-sizing: border-box;
|
|
38660
38675
|
width: 50%;
|
|
38661
38676
|
border-radius: 4px;
|
|
38662
38677
|
padding: 4px 23px 4px 10px;
|
|
@@ -38855,7 +38870,7 @@ css /* scss */ `
|
|
|
38855
38870
|
.o-color-picker-button {
|
|
38856
38871
|
> span {
|
|
38857
38872
|
border-bottom: 4px solid;
|
|
38858
|
-
height:
|
|
38873
|
+
height: 20px;
|
|
38859
38874
|
margin-top: 2px;
|
|
38860
38875
|
display: block;
|
|
38861
38876
|
}
|
|
@@ -39184,8 +39199,8 @@ const TRANSPARENT_BACKGROUND_SVG = /*xml*/ `
|
|
|
39184
39199
|
`;
|
|
39185
39200
|
css /* scss */ `
|
|
39186
39201
|
.o-round-color-picker-button {
|
|
39187
|
-
width:
|
|
39188
|
-
height:
|
|
39202
|
+
width: 20px;
|
|
39203
|
+
height: 20px;
|
|
39189
39204
|
cursor: pointer;
|
|
39190
39205
|
border: 1px solid ${GRAY_300};
|
|
39191
39206
|
background-position: 1px 1px;
|
|
@@ -39332,7 +39347,6 @@ css /* scss */ `
|
|
|
39332
39347
|
width: 14px;
|
|
39333
39348
|
height: 14px;
|
|
39334
39349
|
border: 1px solid ${GRAY_300};
|
|
39335
|
-
box-sizing: border-box;
|
|
39336
39350
|
outline: none;
|
|
39337
39351
|
border-radius: 8px;
|
|
39338
39352
|
|
|
@@ -40048,8 +40062,6 @@ css /* scss */ `
|
|
|
40048
40062
|
word-break: break-all;
|
|
40049
40063
|
padding-right: 2px;
|
|
40050
40064
|
|
|
40051
|
-
box-sizing: border-box;
|
|
40052
|
-
|
|
40053
40065
|
caret-color: black;
|
|
40054
40066
|
padding-left: 3px;
|
|
40055
40067
|
padding-right: 3px;
|
|
@@ -40705,7 +40717,6 @@ css /* scss */ `
|
|
|
40705
40717
|
.o-spreadsheet {
|
|
40706
40718
|
.o-standalone-composer {
|
|
40707
40719
|
min-height: 24px;
|
|
40708
|
-
box-sizing: border-box;
|
|
40709
40720
|
|
|
40710
40721
|
border-bottom: 1px solid;
|
|
40711
40722
|
border-color: ${GRAY_300};
|
|
@@ -40807,7 +40818,6 @@ css /* scss */ `
|
|
|
40807
40818
|
}
|
|
40808
40819
|
|
|
40809
40820
|
td {
|
|
40810
|
-
box-sizing: border-box;
|
|
40811
40821
|
height: 30px;
|
|
40812
40822
|
padding: 6px 0;
|
|
40813
40823
|
}
|
|
@@ -40830,7 +40840,6 @@ css /* scss */ `
|
|
|
40830
40840
|
select {
|
|
40831
40841
|
width: 100%;
|
|
40832
40842
|
height: 100%;
|
|
40833
|
-
box-sizing: border-box;
|
|
40834
40843
|
}
|
|
40835
40844
|
}
|
|
40836
40845
|
`;
|
|
@@ -41060,7 +41069,7 @@ class LineConfigPanel extends GenericChartConfigPanel {
|
|
|
41060
41069
|
get canTreatLabelsAsText() {
|
|
41061
41070
|
const chart = this.env.model.getters.getChart(this.props.figureId);
|
|
41062
41071
|
if (chart && chart instanceof LineChart) {
|
|
41063
|
-
return canChartParseLabels(chart.labelRange, this.env.model.getters);
|
|
41072
|
+
return canChartParseLabels(chart.getDefinition(), chart.dataSets, chart.labelRange, this.env.model.getters);
|
|
41064
41073
|
}
|
|
41065
41074
|
return false;
|
|
41066
41075
|
}
|
|
@@ -41137,7 +41146,7 @@ class ScatterConfigPanel extends GenericChartConfigPanel {
|
|
|
41137
41146
|
get canTreatLabelsAsText() {
|
|
41138
41147
|
const chart = this.env.model.getters.getChart(this.props.figureId);
|
|
41139
41148
|
if (chart && chart instanceof ScatterChart) {
|
|
41140
|
-
return canChartParseLabels(chart.labelRange, this.env.model.getters);
|
|
41149
|
+
return canChartParseLabels(chart.getDefinition(), chart.dataSets, chart.labelRange, this.env.model.getters);
|
|
41141
41150
|
}
|
|
41142
41151
|
return false;
|
|
41143
41152
|
}
|
|
@@ -41390,7 +41399,6 @@ css /* scss */ `
|
|
|
41390
41399
|
}
|
|
41391
41400
|
|
|
41392
41401
|
.o-popover .o-chart-select-popover {
|
|
41393
|
-
box-sizing: border-box;
|
|
41394
41402
|
background: #fff;
|
|
41395
41403
|
.o-chart-type-item {
|
|
41396
41404
|
cursor: pointer;
|
|
@@ -41690,7 +41698,7 @@ css /* scss */ `
|
|
|
41690
41698
|
}
|
|
41691
41699
|
|
|
41692
41700
|
border-bottom: 1px solid ${GRAY_300};
|
|
41693
|
-
height:
|
|
41701
|
+
height: 80px;
|
|
41694
41702
|
padding: 10px;
|
|
41695
41703
|
position: relative;
|
|
41696
41704
|
cursor: pointer;
|
|
@@ -42424,7 +42432,7 @@ class ConditionalFormattingPanel extends Component {
|
|
|
42424
42432
|
this.originalEditedCf = undefined;
|
|
42425
42433
|
}
|
|
42426
42434
|
addConditionalFormat() {
|
|
42427
|
-
const cfId = this.env.model.uuidGenerator.
|
|
42435
|
+
const cfId = this.env.model.uuidGenerator.smallUuid();
|
|
42428
42436
|
this.env.model.dispatch("ADD_CONDITIONAL_FORMAT", {
|
|
42429
42437
|
sheetId: this.activeSheetId,
|
|
42430
42438
|
ranges: this.env.model.getters
|
|
@@ -43694,7 +43702,7 @@ class DataValidationEditor extends Component {
|
|
|
43694
43702
|
.getSelectedZones()
|
|
43695
43703
|
.map((zone) => zoneToXc(this.env.model.getters.getUnboundedZone(sheetId, zone)));
|
|
43696
43704
|
return {
|
|
43697
|
-
id: this.env.model.uuidGenerator.
|
|
43705
|
+
id: this.env.model.uuidGenerator.smallUuid(),
|
|
43698
43706
|
criterion: { type: "textContains", values: [""] },
|
|
43699
43707
|
ranges,
|
|
43700
43708
|
};
|
|
@@ -43711,7 +43719,6 @@ css /* scss */ `
|
|
|
43711
43719
|
.o-sidePanel {
|
|
43712
43720
|
.o-dv-preview {
|
|
43713
43721
|
height: 70px;
|
|
43714
|
-
box-sizing: border-box;
|
|
43715
43722
|
cursor: pointer;
|
|
43716
43723
|
border-bottom: 1px solid ${FIGURE_BORDER_COLOR};
|
|
43717
43724
|
|
|
@@ -44327,7 +44334,7 @@ class FindAndReplacePanel extends Component {
|
|
|
44327
44334
|
css /* scss */ `
|
|
44328
44335
|
.o-more-formats-panel {
|
|
44329
44336
|
.format-preview {
|
|
44330
|
-
height:
|
|
44337
|
+
height: 49px;
|
|
44331
44338
|
background-color: white;
|
|
44332
44339
|
cursor: pointer;
|
|
44333
44340
|
|
|
@@ -44499,7 +44506,6 @@ css /* scss */ `
|
|
|
44499
44506
|
.o-sidePanel {
|
|
44500
44507
|
.o-pivot-measure-display-field,
|
|
44501
44508
|
.o-pivot-measure-display-value {
|
|
44502
|
-
box-sizing: border-box;
|
|
44503
44509
|
border: solid 1px ${GRAY_300};
|
|
44504
44510
|
border-radius: 3px;
|
|
44505
44511
|
}
|
|
@@ -44542,7 +44548,7 @@ class PivotMeasureDisplayPanel extends Component {
|
|
|
44542
44548
|
|
|
44543
44549
|
css /* scss */ `
|
|
44544
44550
|
.pivot-defer-update {
|
|
44545
|
-
min-height:
|
|
44551
|
+
min-height: 40px;
|
|
44546
44552
|
}
|
|
44547
44553
|
`;
|
|
44548
44554
|
class PivotDeferUpdate extends Component {
|
|
@@ -44688,7 +44694,6 @@ class AddDimensionButton extends Component {
|
|
|
44688
44694
|
css /* scss */ `
|
|
44689
44695
|
.o-spreadsheet {
|
|
44690
44696
|
.os-input {
|
|
44691
|
-
box-sizing: border-box;
|
|
44692
44697
|
border-width: 0 0 1px 0;
|
|
44693
44698
|
border-color: transparent;
|
|
44694
44699
|
outline: none;
|
|
@@ -45312,8 +45317,8 @@ class PivotTitleSection extends Component {
|
|
|
45312
45317
|
return this.env.model.getters.getPivotDisplayName(this.props.pivotId);
|
|
45313
45318
|
}
|
|
45314
45319
|
duplicatePivot() {
|
|
45315
|
-
const newPivotId = this.env.model.uuidGenerator.
|
|
45316
|
-
const newSheetId = this.env.model.uuidGenerator.
|
|
45320
|
+
const newPivotId = this.env.model.uuidGenerator.smallUuid();
|
|
45321
|
+
const newSheetId = this.env.model.uuidGenerator.smallUuid();
|
|
45317
45322
|
const result = this.env.model.dispatch("DUPLICATE_PIVOT_IN_NEW_SHEET", {
|
|
45318
45323
|
pivotId: this.props.pivotId,
|
|
45319
45324
|
newPivotId,
|
|
@@ -47657,7 +47662,6 @@ class TableStylesPopover extends Component {
|
|
|
47657
47662
|
|
|
47658
47663
|
css /* scss */ `
|
|
47659
47664
|
.o-table-style-picker {
|
|
47660
|
-
box-sizing: border-box;
|
|
47661
47665
|
border: 1px solid ${GRAY_300};
|
|
47662
47666
|
border-radius: 3px;
|
|
47663
47667
|
|
|
@@ -47936,7 +47940,7 @@ class TableStyleEditorPanel extends Component {
|
|
|
47936
47940
|
this.state.selectedTemplateName = templateName;
|
|
47937
47941
|
}
|
|
47938
47942
|
onConfirm() {
|
|
47939
|
-
const tableStyleId = this.props.styleId || this.env.model.uuidGenerator.
|
|
47943
|
+
const tableStyleId = this.props.styleId || this.env.model.uuidGenerator.smallUuid();
|
|
47940
47944
|
this.env.model.dispatch("CREATE_TABLE_STYLE", {
|
|
47941
47945
|
tableStyleId,
|
|
47942
47946
|
tableStyleName: this.state.styleName,
|
|
@@ -48109,7 +48113,6 @@ const BORDER_WIDTH = 1;
|
|
|
48109
48113
|
const ACTIVE_BORDER_WIDTH = 2;
|
|
48110
48114
|
css /*SCSS*/ `
|
|
48111
48115
|
div.o-figure {
|
|
48112
|
-
box-sizing: border-box;
|
|
48113
48116
|
position: absolute;
|
|
48114
48117
|
width: 100%;
|
|
48115
48118
|
height: 100%;
|
|
@@ -48121,7 +48124,6 @@ css /*SCSS*/ `
|
|
|
48121
48124
|
}
|
|
48122
48125
|
|
|
48123
48126
|
div.o-figure-border {
|
|
48124
|
-
box-sizing: border-box;
|
|
48125
48127
|
z-index: 1;
|
|
48126
48128
|
}
|
|
48127
48129
|
|
|
@@ -48495,7 +48497,6 @@ css /* scss */ `
|
|
|
48495
48497
|
height: ${AUTOFILL_EDGE_LENGTH}px;
|
|
48496
48498
|
width: ${AUTOFILL_EDGE_LENGTH}px;
|
|
48497
48499
|
border: 1px solid white;
|
|
48498
|
-
box-sizing: border-box !important;
|
|
48499
48500
|
background-color: #1a73e8;
|
|
48500
48501
|
}
|
|
48501
48502
|
|
|
@@ -48872,7 +48873,6 @@ const GRID_CELL_REFERENCE_TOP_OFFSET = 28;
|
|
|
48872
48873
|
css /* scss */ `
|
|
48873
48874
|
div.o-grid-composer {
|
|
48874
48875
|
z-index: ${ComponentsImportance.GridComposer};
|
|
48875
|
-
box-sizing: border-box;
|
|
48876
48876
|
position: absolute;
|
|
48877
48877
|
border: ${COMPOSER_BORDER_WIDTH}px solid ${SELECTION_BORDER_COLOR};
|
|
48878
48878
|
font-family: ${DEFAULT_FONT};
|
|
@@ -49121,8 +49121,6 @@ class GridCellIcon extends Component {
|
|
|
49121
49121
|
const MARGIN = (GRID_ICON_EDGE_LENGTH - CHECKBOX_WIDTH) / 2;
|
|
49122
49122
|
css /* scss */ `
|
|
49123
49123
|
.o-dv-checkbox {
|
|
49124
|
-
box-sizing: border-box !important;
|
|
49125
|
-
accent-color: #808080;
|
|
49126
49124
|
margin: ${MARGIN}px;
|
|
49127
49125
|
/* required to prevent the checkbox position to be sensible to the font-size (affects Firefox) */
|
|
49128
49126
|
position: absolute;
|
|
@@ -49882,7 +49880,6 @@ class FilterIconsOverlay extends Component {
|
|
|
49882
49880
|
css /* scss */ `
|
|
49883
49881
|
.o-grid-add-rows {
|
|
49884
49882
|
input.o-input {
|
|
49885
|
-
box-sizing: border-box;
|
|
49886
49883
|
width: 60px;
|
|
49887
49884
|
height: 30px;
|
|
49888
49885
|
}
|
|
@@ -51810,6 +51807,7 @@ css /* scss */ `
|
|
|
51810
51807
|
background-color: ${BACKGROUND_GRAY_COLOR};
|
|
51811
51808
|
|
|
51812
51809
|
&.corner {
|
|
51810
|
+
box-sizing: content-box;
|
|
51813
51811
|
right: 0px;
|
|
51814
51812
|
bottom: 0px;
|
|
51815
51813
|
height: ${SCROLLBAR_WIDTH}px;
|
|
@@ -52045,8 +52043,8 @@ const SIZE = 3;
|
|
|
52045
52043
|
const COLOR = "#777";
|
|
52046
52044
|
css /* scss */ `
|
|
52047
52045
|
.o-table-resizer {
|
|
52048
|
-
width: ${SIZE}px;
|
|
52049
|
-
height: ${SIZE}px;
|
|
52046
|
+
width: ${SIZE * 2}px;
|
|
52047
|
+
height: ${SIZE * 2}px;
|
|
52050
52048
|
border-bottom: ${SIZE}px solid ${COLOR};
|
|
52051
52049
|
border-right: ${SIZE}px solid ${COLOR};
|
|
52052
52050
|
cursor: nwse-resize;
|
|
@@ -56562,7 +56560,7 @@ class SheetPlugin extends CorePlugin {
|
|
|
56562
56560
|
? "Success" /* CommandResult.Success */
|
|
56563
56561
|
: "InvalidColor" /* CommandResult.InvalidColor */;
|
|
56564
56562
|
case "DELETE_SHEET":
|
|
56565
|
-
return this.
|
|
56563
|
+
return this.getVisibleSheetIds().length > 1
|
|
56566
56564
|
? "Success" /* CommandResult.Success */
|
|
56567
56565
|
: "NotEnoughSheets" /* CommandResult.NotEnoughSheets */;
|
|
56568
56566
|
case "ADD_COLUMNS_ROWS":
|
|
@@ -63924,6 +63922,15 @@ class Session extends EventBus {
|
|
|
63924
63922
|
}
|
|
63925
63923
|
this.sendPendingMessage();
|
|
63926
63924
|
}
|
|
63925
|
+
dropPendingRevision(revisionId) {
|
|
63926
|
+
this.revisions.drop(revisionId);
|
|
63927
|
+
const revisionIds = this.pendingMessages
|
|
63928
|
+
.filter((message) => message.type === "REMOTE_REVISION")
|
|
63929
|
+
.map((message) => message.nextRevisionId);
|
|
63930
|
+
this.trigger("pending-revisions-dropped", { revisionIds });
|
|
63931
|
+
this.waitingAck = false;
|
|
63932
|
+
this.waitingUndoRedoAck = false;
|
|
63933
|
+
}
|
|
63927
63934
|
/**
|
|
63928
63935
|
* Send the next pending message
|
|
63929
63936
|
*/
|
|
@@ -63938,13 +63945,7 @@ class Session extends EventBus {
|
|
|
63938
63945
|
* The command is empty, we have to drop all the next local revisions
|
|
63939
63946
|
* to avoid issues with undo/redo
|
|
63940
63947
|
*/
|
|
63941
|
-
this.
|
|
63942
|
-
const revisionIds = this.pendingMessages
|
|
63943
|
-
.filter((message) => message.type === "REMOTE_REVISION")
|
|
63944
|
-
.map((message) => message.nextRevisionId);
|
|
63945
|
-
this.trigger("pending-revisions-dropped", { revisionIds });
|
|
63946
|
-
this.waitingAck = false;
|
|
63947
|
-
this.waitingUndoRedoAck = false;
|
|
63948
|
+
this.dropPendingRevision(revision.id);
|
|
63948
63949
|
this.pendingMessages = [];
|
|
63949
63950
|
return;
|
|
63950
63951
|
}
|
|
@@ -63971,7 +63972,6 @@ class Session extends EventBus {
|
|
|
63971
63972
|
switch (message.type) {
|
|
63972
63973
|
case "REMOTE_REVISION":
|
|
63973
63974
|
case "REVISION_REDONE":
|
|
63974
|
-
case "REVISION_UNDONE":
|
|
63975
63975
|
case "SNAPSHOT_CREATED":
|
|
63976
63976
|
this.waitingAck = false;
|
|
63977
63977
|
this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
|
|
@@ -63980,6 +63980,27 @@ class Session extends EventBus {
|
|
|
63980
63980
|
this.lastRevisionMessage = message;
|
|
63981
63981
|
this.sendPendingMessage();
|
|
63982
63982
|
break;
|
|
63983
|
+
case "REVISION_UNDONE": {
|
|
63984
|
+
this.waitingAck = false;
|
|
63985
|
+
this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
|
|
63986
|
+
const pendingRemoteRevisions = this.pendingMessages.filter((message) => message.type === "REMOTE_REVISION");
|
|
63987
|
+
const firstTransformedRevisionIndex = pendingRemoteRevisions.findIndex((message) => !deepEquals(message.commands, this.revisions.get(message.nextRevisionId).commands));
|
|
63988
|
+
if (firstTransformedRevisionIndex !== -1) {
|
|
63989
|
+
/**
|
|
63990
|
+
* Some revisions undergo transformations that may cause issues with
|
|
63991
|
+
* undo/redo if the transformation is destructive (we don't get back
|
|
63992
|
+
* the original command by transforming it with the inverse).
|
|
63993
|
+
* To prevent these problems, we must discard all subsequent local
|
|
63994
|
+
* revisions.
|
|
63995
|
+
*/
|
|
63996
|
+
this.dropPendingRevision(this.pendingMessages[firstTransformedRevisionIndex].nextRevisionId);
|
|
63997
|
+
this.pendingMessages = this.pendingMessages.slice(0, firstTransformedRevisionIndex);
|
|
63998
|
+
}
|
|
63999
|
+
this.serverRevisionId = message.nextRevisionId;
|
|
64000
|
+
this.processedRevisions.add(message.nextRevisionId);
|
|
64001
|
+
this.sendPendingMessage();
|
|
64002
|
+
break;
|
|
64003
|
+
}
|
|
63983
64004
|
}
|
|
63984
64005
|
}
|
|
63985
64006
|
isAlreadyProcessed(message) {
|
|
@@ -65444,23 +65465,23 @@ const uuidGenerator = new UuidGenerator();
|
|
|
65444
65465
|
function repeatCreateChartCommand(getters, cmd) {
|
|
65445
65466
|
return {
|
|
65446
65467
|
...repeatSheetDependantCommand(getters, cmd),
|
|
65447
|
-
id: uuidGenerator.
|
|
65468
|
+
id: uuidGenerator.smallUuid(),
|
|
65448
65469
|
};
|
|
65449
65470
|
}
|
|
65450
65471
|
function repeatCreateImageCommand(getters, cmd) {
|
|
65451
65472
|
return {
|
|
65452
65473
|
...repeatSheetDependantCommand(getters, cmd),
|
|
65453
|
-
figureId: uuidGenerator.
|
|
65474
|
+
figureId: uuidGenerator.smallUuid(),
|
|
65454
65475
|
};
|
|
65455
65476
|
}
|
|
65456
65477
|
function repeatCreateFigureCommand(getters, cmd) {
|
|
65457
65478
|
const newCmd = repeatSheetDependantCommand(getters, cmd);
|
|
65458
|
-
newCmd.figure.id = uuidGenerator.
|
|
65479
|
+
newCmd.figure.id = uuidGenerator.smallUuid();
|
|
65459
65480
|
return newCmd;
|
|
65460
65481
|
}
|
|
65461
65482
|
function repeatCreateSheetCommand(getters, cmd) {
|
|
65462
65483
|
const newCmd = deepCopy(cmd);
|
|
65463
|
-
newCmd.sheetId = uuidGenerator.
|
|
65484
|
+
newCmd.sheetId = uuidGenerator.smallUuid();
|
|
65464
65485
|
const sheetName = cmd.name || getters.getSheet(getters.getActiveSheetId()).name;
|
|
65465
65486
|
// Extract the prefix of the sheet name (everything before the number at the end of the name)
|
|
65466
65487
|
const namePrefix = sheetName.match(/(.+?)\d*$/)?.[1] || sheetName;
|
|
@@ -66920,23 +66941,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66920
66941
|
gridSelection: deepCopy(gridSelection),
|
|
66921
66942
|
};
|
|
66922
66943
|
}
|
|
66923
|
-
|
|
66924
|
-
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
66925
|
-
this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
|
|
66926
|
-
if (this.activeSheet.id in this.sheetsData) {
|
|
66927
|
-
const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
|
|
66928
|
-
this.selectCell(anchor.cell.col, anchor.cell.row);
|
|
66929
|
-
}
|
|
66930
|
-
else {
|
|
66931
|
-
this.selectCell(0, 0);
|
|
66932
|
-
}
|
|
66933
|
-
const { col, row } = this.gridSelection.anchor.cell;
|
|
66934
|
-
this.moveClient({
|
|
66935
|
-
sheetId: this.getters.getActiveSheetId(),
|
|
66936
|
-
col,
|
|
66937
|
-
row,
|
|
66938
|
-
});
|
|
66939
|
-
}
|
|
66944
|
+
this.fallbackToVisibleSheet();
|
|
66940
66945
|
const sheetId = this.getters.getActiveSheetId();
|
|
66941
66946
|
this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
|
|
66942
66947
|
this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
|
|
@@ -66946,6 +66951,7 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66946
66951
|
}
|
|
66947
66952
|
}
|
|
66948
66953
|
finalize() {
|
|
66954
|
+
this.fallbackToVisibleSheet();
|
|
66949
66955
|
/** Any change to the selection has to be reflected in the selection processor. */
|
|
66950
66956
|
this.selection.resetDefaultAnchor(this, deepCopy(this.gridSelection.anchor));
|
|
66951
66957
|
}
|
|
@@ -67256,6 +67262,25 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
67256
67262
|
}
|
|
67257
67263
|
return "Success" /* CommandResult.Success */;
|
|
67258
67264
|
}
|
|
67265
|
+
fallbackToVisibleSheet() {
|
|
67266
|
+
if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
|
|
67267
|
+
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
67268
|
+
this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
|
|
67269
|
+
if (this.activeSheet.id in this.sheetsData) {
|
|
67270
|
+
const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
|
|
67271
|
+
this.selectCell(anchor.cell.col, anchor.cell.row);
|
|
67272
|
+
}
|
|
67273
|
+
else {
|
|
67274
|
+
this.selectCell(0, 0);
|
|
67275
|
+
}
|
|
67276
|
+
const { col, row } = this.gridSelection.anchor.cell;
|
|
67277
|
+
this.moveClient({
|
|
67278
|
+
sheetId: this.getters.getActiveSheetId(),
|
|
67279
|
+
col,
|
|
67280
|
+
row,
|
|
67281
|
+
});
|
|
67282
|
+
}
|
|
67283
|
+
}
|
|
67259
67284
|
//-------------------------------------------
|
|
67260
67285
|
// Helpers for extensions
|
|
67261
67286
|
// ------------------------------------------
|
|
@@ -69230,7 +69255,7 @@ class BottomBar extends Component {
|
|
|
69230
69255
|
clickAddSheet(ev) {
|
|
69231
69256
|
const activeSheetId = this.env.model.getters.getActiveSheetId();
|
|
69232
69257
|
const position = this.env.model.getters.getSheetIds().findIndex((sheetId) => sheetId === activeSheetId) + 1;
|
|
69233
|
-
const sheetId = this.env.model.uuidGenerator.
|
|
69258
|
+
const sheetId = this.env.model.uuidGenerator.smallUuid();
|
|
69234
69259
|
const name = this.env.model.getters.getNextSheetName(_t("Sheet"));
|
|
69235
69260
|
this.env.model.dispatch("CREATE_SHEET", { sheetId, position, name });
|
|
69236
69261
|
this.env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
|
|
@@ -69546,8 +69571,8 @@ css /* scss */ `
|
|
|
69546
69571
|
z-index: ${ComponentsImportance.HeaderGroupingButton};
|
|
69547
69572
|
.o-group-fold-button {
|
|
69548
69573
|
cursor: pointer;
|
|
69549
|
-
width:
|
|
69550
|
-
height:
|
|
69574
|
+
width: 15px;
|
|
69575
|
+
height: 15px;
|
|
69551
69576
|
border: 1px solid ${HEADER_GROUPING_BORDER_COLOR};
|
|
69552
69577
|
.o-icon {
|
|
69553
69578
|
width: 7px;
|
|
@@ -69559,9 +69584,6 @@ css /* scss */ `
|
|
|
69559
69584
|
}
|
|
69560
69585
|
}
|
|
69561
69586
|
}
|
|
69562
|
-
.o-group-border {
|
|
69563
|
-
box-sizing: border-box;
|
|
69564
|
-
}
|
|
69565
69587
|
}
|
|
69566
69588
|
`;
|
|
69567
69589
|
class AbstractHeaderGroup extends Component {
|
|
@@ -69956,7 +69978,7 @@ css /* scss */ `
|
|
|
69956
69978
|
margin: 2px 1px;
|
|
69957
69979
|
padding: 0px 1px;
|
|
69958
69980
|
border-radius: 2px;
|
|
69959
|
-
min-width:
|
|
69981
|
+
min-width: 22px;
|
|
69960
69982
|
}
|
|
69961
69983
|
.o-disabled {
|
|
69962
69984
|
opacity: 0.6;
|
|
@@ -70055,8 +70077,8 @@ css /* scss */ `
|
|
|
70055
70077
|
margin: 1px;
|
|
70056
70078
|
.o-line-item {
|
|
70057
70079
|
padding: 4px;
|
|
70058
|
-
width:
|
|
70059
|
-
height:
|
|
70080
|
+
width: 26px;
|
|
70081
|
+
height: 26px;
|
|
70060
70082
|
&.active {
|
|
70061
70083
|
background-color: ${BUTTON_ACTIVE_BG};
|
|
70062
70084
|
}
|
|
@@ -70737,7 +70759,6 @@ css /* scss */ `
|
|
|
70737
70759
|
*,
|
|
70738
70760
|
*:before,
|
|
70739
70761
|
*:after {
|
|
70740
|
-
box-sizing: content-box;
|
|
70741
70762
|
/* rtl not supported ATM */
|
|
70742
70763
|
direction: ltr;
|
|
70743
70764
|
}
|
|
@@ -70796,7 +70817,6 @@ css /* scss */ `
|
|
|
70796
70817
|
.o-input {
|
|
70797
70818
|
min-width: 0px;
|
|
70798
70819
|
padding: 1px 0;
|
|
70799
|
-
box-sizing: border-box;
|
|
70800
70820
|
width: 100%;
|
|
70801
70821
|
outline: none;
|
|
70802
70822
|
border-color: ${GRAY_300};
|
|
@@ -70867,18 +70887,9 @@ css /* scss */ `
|
|
|
70867
70887
|
}
|
|
70868
70888
|
|
|
70869
70889
|
> canvas {
|
|
70890
|
+
box-sizing: content-box;
|
|
70870
70891
|
border-bottom: 1px solid #e2e3e3;
|
|
70871
70892
|
}
|
|
70872
|
-
.o-scrollbar {
|
|
70873
|
-
&.corner {
|
|
70874
|
-
right: 0px;
|
|
70875
|
-
bottom: 0px;
|
|
70876
|
-
height: ${SCROLLBAR_WIDTH}px;
|
|
70877
|
-
width: ${SCROLLBAR_WIDTH}px;
|
|
70878
|
-
border-top: 1px solid #e2e3e3;
|
|
70879
|
-
border-left: 1px solid #e2e3e3;
|
|
70880
|
-
}
|
|
70881
|
-
}
|
|
70882
70893
|
|
|
70883
70894
|
.o-grid-overlay {
|
|
70884
70895
|
position: absolute;
|
|
@@ -70891,7 +70902,7 @@ css /* scss */ `
|
|
|
70891
70902
|
border-radius: 4px;
|
|
70892
70903
|
font-weight: 500;
|
|
70893
70904
|
font-size: 14px;
|
|
70894
|
-
height:
|
|
70905
|
+
height: 32px;
|
|
70895
70906
|
line-height: 16px;
|
|
70896
70907
|
flex-grow: 1;
|
|
70897
70908
|
background-color: ${BUTTON_BG};
|
|
@@ -71519,7 +71530,7 @@ class Tree {
|
|
|
71519
71530
|
}
|
|
71520
71531
|
/**
|
|
71521
71532
|
* Drop the operation and all following operations in every
|
|
71522
|
-
*
|
|
71533
|
+
* branches
|
|
71523
71534
|
*/
|
|
71524
71535
|
drop(operationId) {
|
|
71525
71536
|
for (const branch of this.branches) {
|
|
@@ -74981,7 +74992,7 @@ class Model extends EventBus {
|
|
|
74981
74992
|
}
|
|
74982
74993
|
setupConfig(config) {
|
|
74983
74994
|
const client = config.client || {
|
|
74984
|
-
id: this.uuidGenerator.
|
|
74995
|
+
id: this.uuidGenerator.smallUuid(),
|
|
74985
74996
|
name: _t("Anonymous").toString(),
|
|
74986
74997
|
};
|
|
74987
74998
|
const transportService = config.transportService || new LocalTransportService();
|
|
@@ -75475,6 +75486,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
75475
75486
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, CoreViewPlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, chartHelpers, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
75476
75487
|
|
|
75477
75488
|
|
|
75478
|
-
__info__.version = "18.2.0-alpha.
|
|
75479
|
-
__info__.date = "2025-02-
|
|
75480
|
-
__info__.hash = "
|
|
75489
|
+
__info__.version = "18.2.0-alpha.8";
|
|
75490
|
+
__info__.date = "2025-02-14T08:40:13.286Z";
|
|
75491
|
+
__info__.hash = "19d45d9";
|