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