@odoo/o-spreadsheet 17.4.25 → 17.4.27
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 +105 -32
- package/dist/o-spreadsheet.d.ts +3 -1
- package/dist/o-spreadsheet.esm.js +105 -32
- package/dist/o-spreadsheet.iife.js +105 -32
- package/dist/o-spreadsheet.iife.min.js +359 -359
- 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 17.4.
|
|
6
|
-
* @date 2025-03-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.27
|
|
6
|
+
* @date 2025-03-19T08:27:27.414Z
|
|
7
|
+
* @hash a87c1da
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -5199,11 +5199,13 @@ function getDefaultCellHeight(ctx, cell, colSize) {
|
|
|
5199
5199
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
5200
5200
|
return DEFAULT_CELL_HEIGHT;
|
|
5201
5201
|
}
|
|
5202
|
-
const
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
const
|
|
5202
|
+
const content = cell.isFormula ? "" : cell.content;
|
|
5203
|
+
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
5204
|
+
}
|
|
5205
|
+
function getCellContentHeight(ctx, content, style, colSize) {
|
|
5206
|
+
const maxWidth = style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : undefined;
|
|
5207
|
+
const numberOfLines = splitTextToWidth(ctx, content, style, maxWidth).length;
|
|
5208
|
+
const fontSize = computeTextFontSizeInPixels(style);
|
|
5207
5209
|
return computeTextLinesHeight(fontSize, numberOfLines) + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
5208
5210
|
}
|
|
5209
5211
|
function getDefaultContextFont(fontSize, bold = false, italic = false) {
|
|
@@ -6789,13 +6791,6 @@ class CellClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
6789
6791
|
this.clearClippedZones(content);
|
|
6790
6792
|
const selection = target[0];
|
|
6791
6793
|
this.pasteZone(sheetId, selection.left, selection.top, content.cells, options);
|
|
6792
|
-
this.dispatch("MOVE_RANGES", {
|
|
6793
|
-
target: content.zones,
|
|
6794
|
-
sheetId: content.sheetId,
|
|
6795
|
-
targetSheetId: sheetId,
|
|
6796
|
-
col: selection.left,
|
|
6797
|
-
row: selection.top,
|
|
6798
|
-
});
|
|
6799
6794
|
}
|
|
6800
6795
|
/**
|
|
6801
6796
|
* Clear the clipped zones: remove the cells and clear the formatting
|
|
@@ -7256,14 +7251,15 @@ class MergeClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
7256
7251
|
}
|
|
7257
7252
|
merges.push(mergesInRow);
|
|
7258
7253
|
}
|
|
7259
|
-
return { merges };
|
|
7254
|
+
return { merges, sheetId };
|
|
7260
7255
|
}
|
|
7261
7256
|
/**
|
|
7262
7257
|
* Paste the clipboard content in the given target
|
|
7263
7258
|
*/
|
|
7264
7259
|
paste(target, content, options) {
|
|
7265
7260
|
if (options.isCutOperation) {
|
|
7266
|
-
|
|
7261
|
+
const copiedMerges = content.merges.flat().filter(isDefined);
|
|
7262
|
+
this.dispatch("REMOVE_MERGE", { sheetId: content.sheetId, target: copiedMerges });
|
|
7267
7263
|
}
|
|
7268
7264
|
this.pasteFromCopy(target.sheetId, target.zones, content.merges, options);
|
|
7269
7265
|
}
|
|
@@ -7298,6 +7294,27 @@ class MergeClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
7298
7294
|
}
|
|
7299
7295
|
}
|
|
7300
7296
|
|
|
7297
|
+
class ReferenceClipboardHandler extends AbstractCellClipboardHandler {
|
|
7298
|
+
copy(data) {
|
|
7299
|
+
return {
|
|
7300
|
+
zones: data.clippedZones,
|
|
7301
|
+
sheetId: data.sheetId,
|
|
7302
|
+
};
|
|
7303
|
+
}
|
|
7304
|
+
paste(target, content, options) {
|
|
7305
|
+
if (options.isCutOperation) {
|
|
7306
|
+
const selection = target.zones[0];
|
|
7307
|
+
this.dispatch("MOVE_RANGES", {
|
|
7308
|
+
target: content.zones,
|
|
7309
|
+
sheetId: content.sheetId,
|
|
7310
|
+
targetSheetId: target.sheetId,
|
|
7311
|
+
col: selection.left,
|
|
7312
|
+
row: selection.top,
|
|
7313
|
+
});
|
|
7314
|
+
}
|
|
7315
|
+
}
|
|
7316
|
+
}
|
|
7317
|
+
|
|
7301
7318
|
class SheetClipboardHandler extends AbstractCellClipboardHandler {
|
|
7302
7319
|
isPasteAllowed(sheetId, target, content, options) {
|
|
7303
7320
|
if (!("cells" in content)) {
|
|
@@ -7465,7 +7482,8 @@ clipboardHandlersRegistries.cellHandlers
|
|
|
7465
7482
|
.add("merge", MergeClipboardHandler)
|
|
7466
7483
|
.add("border", BorderClipboardHandler)
|
|
7467
7484
|
.add("table", TableClipboardHandler)
|
|
7468
|
-
.add("conditionalFormat", ConditionalFormatClipboardHandler)
|
|
7485
|
+
.add("conditionalFormat", ConditionalFormatClipboardHandler)
|
|
7486
|
+
.add("references", ReferenceClipboardHandler);
|
|
7469
7487
|
|
|
7470
7488
|
function transformZone(zone, executed) {
|
|
7471
7489
|
if (executed.type === "REMOVE_COLUMNS_ROWS") {
|
|
@@ -9622,8 +9640,8 @@ class ComposerStore extends SpreadsheetStore {
|
|
|
9622
9640
|
this.colorIndexByRange = {};
|
|
9623
9641
|
}
|
|
9624
9642
|
cancelEdition() {
|
|
9625
|
-
this.cancelEditionAndActivateSheet();
|
|
9626
9643
|
this.resetContent();
|
|
9644
|
+
this.cancelEditionAndActivateSheet();
|
|
9627
9645
|
this.colorIndexByRange = {};
|
|
9628
9646
|
}
|
|
9629
9647
|
setCurrentContent(content, selection) {
|
|
@@ -9640,8 +9658,8 @@ class ComposerStore extends SpreadsheetStore {
|
|
|
9640
9658
|
switch (cmd.type) {
|
|
9641
9659
|
case "SELECT_FIGURE":
|
|
9642
9660
|
if (cmd.id) {
|
|
9643
|
-
this.cancelEditionAndActivateSheet();
|
|
9644
9661
|
this.resetContent();
|
|
9662
|
+
this.cancelEditionAndActivateSheet();
|
|
9645
9663
|
}
|
|
9646
9664
|
break;
|
|
9647
9665
|
case "SET_FORMATTING":
|
|
@@ -9691,8 +9709,8 @@ class ComposerStore extends SpreadsheetStore {
|
|
|
9691
9709
|
const sheetIdExists = !!this.getters.tryGetSheet(this.sheetId);
|
|
9692
9710
|
if (!sheetIdExists && this.editionMode !== "inactive") {
|
|
9693
9711
|
this.sheetId = this.getters.getActiveSheetId();
|
|
9694
|
-
this.cancelEditionAndActivateSheet();
|
|
9695
9712
|
this.resetContent();
|
|
9713
|
+
this.cancelEditionAndActivateSheet();
|
|
9696
9714
|
this.notificationStore.raiseError(CELL_DELETED_MESSAGE);
|
|
9697
9715
|
}
|
|
9698
9716
|
break;
|
|
@@ -10187,6 +10205,15 @@ class ComposerStore extends SpreadsheetStore {
|
|
|
10187
10205
|
const exactMatch = proposals?.find((p) => p.text === tokenAtCursor.value);
|
|
10188
10206
|
// remove tokens that are likely to be other parts of the formula that slipped in the token if it's a string
|
|
10189
10207
|
const searchTerm = tokenAtCursor.value.replace(/[ ,\(\)]/g, "");
|
|
10208
|
+
if (this._currentContent === this.initialContent &&
|
|
10209
|
+
provider.displayAllOnInitialContent &&
|
|
10210
|
+
proposals?.length) {
|
|
10211
|
+
return {
|
|
10212
|
+
proposals,
|
|
10213
|
+
selectProposal: provider.selectProposal,
|
|
10214
|
+
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
10215
|
+
};
|
|
10216
|
+
}
|
|
10190
10217
|
if (exactMatch && this._currentContent !== this.initialContent) {
|
|
10191
10218
|
// this means the user has chosen a proposal
|
|
10192
10219
|
return;
|
|
@@ -12227,6 +12254,7 @@ class ScorecardChart extends owl.Component {
|
|
|
12227
12254
|
}
|
|
12228
12255
|
|
|
12229
12256
|
autoCompleteProviders.add("dataValidation", {
|
|
12257
|
+
displayAllOnInitialContent: true,
|
|
12230
12258
|
getProposals(tokenAtCursor, content) {
|
|
12231
12259
|
if (content.startsWith("=")) {
|
|
12232
12260
|
return [];
|
|
@@ -37666,6 +37694,7 @@ class RemoveDuplicatesPanel extends owl.Component {
|
|
|
37666
37694
|
columns: {},
|
|
37667
37695
|
});
|
|
37668
37696
|
setup() {
|
|
37697
|
+
this.updateColumns();
|
|
37669
37698
|
owl.onWillUpdateProps(() => this.updateColumns());
|
|
37670
37699
|
}
|
|
37671
37700
|
toggleHasHeader() {
|
|
@@ -45814,7 +45843,7 @@ class XlsxChartExtractor extends XlsxBaseExtractor {
|
|
|
45814
45843
|
title: { text: chartTitle },
|
|
45815
45844
|
type: CHART_TYPE_CONVERSION_MAP[chartType],
|
|
45816
45845
|
dataSets: this.extractChartDatasets(this.querySelectorAll(rootChartElement, `c:${chartType}`), chartType),
|
|
45817
|
-
labelRange: this.
|
|
45846
|
+
labelRange: this.extractLabelRange(chartType, rootChartElement),
|
|
45818
45847
|
backgroundColor: this.extractChildAttr(rootChartElement, "c:chartSpace > c:spPr a:srgbClr", "val", {
|
|
45819
45848
|
default: "ffffff",
|
|
45820
45849
|
}).asString(),
|
|
@@ -45826,6 +45855,13 @@ class XlsxChartExtractor extends XlsxBaseExtractor {
|
|
|
45826
45855
|
};
|
|
45827
45856
|
})[0];
|
|
45828
45857
|
}
|
|
45858
|
+
extractLabelRange(chartType, rootChartElement) {
|
|
45859
|
+
if (chartType === "scatterChart") {
|
|
45860
|
+
return (this.extractChildTextContent(rootChartElement, `c:ser c:strRef c:f`) ||
|
|
45861
|
+
this.extractChildTextContent(rootChartElement, `c:ser c:numRef c:f`));
|
|
45862
|
+
}
|
|
45863
|
+
return this.extractChildTextContent(rootChartElement, `c:ser c:cat c:f`);
|
|
45864
|
+
}
|
|
45829
45865
|
extractComboChart(chartElement) {
|
|
45830
45866
|
// Title can be separated into multiple xml elements (for styling and such), we only import the text
|
|
45831
45867
|
const chartTitle = this.mapOnElements({ parent: chartElement, query: "c:title a:t" }, (textElement) => {
|
|
@@ -58746,12 +58782,7 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
58746
58782
|
}
|
|
58747
58783
|
break;
|
|
58748
58784
|
case "AUTORESIZE_ROWS":
|
|
58749
|
-
this.
|
|
58750
|
-
elements: cmd.rows,
|
|
58751
|
-
dimension: "ROW",
|
|
58752
|
-
size: null,
|
|
58753
|
-
sheetId: cmd.sheetId,
|
|
58754
|
-
});
|
|
58785
|
+
this.autoResizeRows(cmd.sheetId, cmd.rows);
|
|
58755
58786
|
break;
|
|
58756
58787
|
}
|
|
58757
58788
|
}
|
|
@@ -58901,6 +58932,48 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
58901
58932
|
}
|
|
58902
58933
|
return "Success" /* CommandResult.Success */;
|
|
58903
58934
|
}
|
|
58935
|
+
autoResizeRows(sheetId, rows) {
|
|
58936
|
+
const rowSizes = [];
|
|
58937
|
+
for (const row of rows) {
|
|
58938
|
+
let evaluatedRowSize = 0;
|
|
58939
|
+
for (const cellId of this.getters.getRowCells(sheetId, row)) {
|
|
58940
|
+
const cell = this.getters.getCellById(cellId);
|
|
58941
|
+
if (!cell) {
|
|
58942
|
+
continue;
|
|
58943
|
+
}
|
|
58944
|
+
const position = this.getters.getCellPosition(cell.id);
|
|
58945
|
+
const colSize = this.getters.getColSize(sheetId, position.col);
|
|
58946
|
+
if (cell.isFormula) {
|
|
58947
|
+
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
58948
|
+
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
58949
|
+
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
|
|
58950
|
+
evaluatedRowSize = evaluatedSize;
|
|
58951
|
+
}
|
|
58952
|
+
}
|
|
58953
|
+
else {
|
|
58954
|
+
const content = cell.content;
|
|
58955
|
+
const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
58956
|
+
// Only keep the size of evaluated cells if it's bigger than the dynamic row size
|
|
58957
|
+
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) {
|
|
58958
|
+
evaluatedRowSize = 0;
|
|
58959
|
+
}
|
|
58960
|
+
}
|
|
58961
|
+
}
|
|
58962
|
+
rowSizes.push(evaluatedRowSize || null);
|
|
58963
|
+
}
|
|
58964
|
+
const groupedSizes = new Map(rowSizes.map((size) => [size, []]));
|
|
58965
|
+
for (let i = 0; i < rowSizes.length; i++) {
|
|
58966
|
+
groupedSizes.get(rowSizes[i])?.push(rows[i]);
|
|
58967
|
+
}
|
|
58968
|
+
for (const [size, rows] of groupedSizes) {
|
|
58969
|
+
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
58970
|
+
elements: rows,
|
|
58971
|
+
dimension: "ROW",
|
|
58972
|
+
size,
|
|
58973
|
+
sheetId,
|
|
58974
|
+
});
|
|
58975
|
+
}
|
|
58976
|
+
}
|
|
58904
58977
|
}
|
|
58905
58978
|
|
|
58906
58979
|
class TableComputedStylePlugin extends UIPlugin {
|
|
@@ -67716,7 +67789,7 @@ function addStyles(styles) {
|
|
|
67716
67789
|
}
|
|
67717
67790
|
if (alignAttrs.length > 0) {
|
|
67718
67791
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
67719
|
-
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}
|
|
67792
|
+
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
67720
67793
|
}
|
|
67721
67794
|
else {
|
|
67722
67795
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)} />`);
|
|
@@ -69156,6 +69229,6 @@ exports.tokenColors = tokenColors;
|
|
|
69156
69229
|
exports.tokenize = tokenize;
|
|
69157
69230
|
|
|
69158
69231
|
|
|
69159
|
-
__info__.version = "17.4.
|
|
69160
|
-
__info__.date = "2025-03-
|
|
69161
|
-
__info__.hash = "
|
|
69232
|
+
__info__.version = "17.4.27";
|
|
69233
|
+
__info__.date = "2025-03-19T08:27:27.414Z";
|
|
69234
|
+
__info__.hash = "a87c1da";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -4721,6 +4721,7 @@ declare class SheetUIPlugin extends UIPlugin {
|
|
|
4721
4721
|
* not outside the sheet.
|
|
4722
4722
|
*/
|
|
4723
4723
|
private checkZonesAreInSheet;
|
|
4724
|
+
private autoResizeRows;
|
|
4724
4725
|
}
|
|
4725
4726
|
|
|
4726
4727
|
/**
|
|
@@ -7950,11 +7951,12 @@ interface AutoCompleteProvider {
|
|
|
7950
7951
|
* We declare the providers in the registry as an object (rather than a class)
|
|
7951
7952
|
* to allow a type-safe way to declare the provider.
|
|
7952
7953
|
* We still want to be able to use `this` for the getters and dispatch for simplicity.
|
|
7953
|
-
* Binding happens at runtime in the
|
|
7954
|
+
* Binding happens at runtime in the composer store.
|
|
7954
7955
|
*/
|
|
7955
7956
|
interface AutoCompleteProviderDefinition {
|
|
7956
7957
|
sequence?: number;
|
|
7957
7958
|
autoSelectFirstProposal?: boolean;
|
|
7959
|
+
displayAllOnInitialContent?: boolean;
|
|
7958
7960
|
maxDisplayedProposals?: number;
|
|
7959
7961
|
getProposals(this: {
|
|
7960
7962
|
composer: ComposerStore;
|
|
@@ -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 17.4.
|
|
6
|
-
* @date 2025-03-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 17.4.27
|
|
6
|
+
* @date 2025-03-19T08:27:27.414Z
|
|
7
|
+
* @hash a87c1da
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { useEnv, useSubEnv, onWillUnmount, useComponent, status, Component, useRef, onMounted, useEffect, useState, onPatched, onWillPatch, onWillUpdateProps, useExternalListener, onWillStart, xml, useChildSubEnv, markRaw, toRaw } from '@odoo/owl';
|
|
@@ -5197,11 +5197,13 @@ function getDefaultCellHeight(ctx, cell, colSize) {
|
|
|
5197
5197
|
if (!cell || (!cell.isFormula && !cell.content)) {
|
|
5198
5198
|
return DEFAULT_CELL_HEIGHT;
|
|
5199
5199
|
}
|
|
5200
|
-
const
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
const
|
|
5200
|
+
const content = cell.isFormula ? "" : cell.content;
|
|
5201
|
+
return getCellContentHeight(ctx, content, cell.style, colSize);
|
|
5202
|
+
}
|
|
5203
|
+
function getCellContentHeight(ctx, content, style, colSize) {
|
|
5204
|
+
const maxWidth = style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : undefined;
|
|
5205
|
+
const numberOfLines = splitTextToWidth(ctx, content, style, maxWidth).length;
|
|
5206
|
+
const fontSize = computeTextFontSizeInPixels(style);
|
|
5205
5207
|
return computeTextLinesHeight(fontSize, numberOfLines) + 2 * PADDING_AUTORESIZE_VERTICAL;
|
|
5206
5208
|
}
|
|
5207
5209
|
function getDefaultContextFont(fontSize, bold = false, italic = false) {
|
|
@@ -6787,13 +6789,6 @@ class CellClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
6787
6789
|
this.clearClippedZones(content);
|
|
6788
6790
|
const selection = target[0];
|
|
6789
6791
|
this.pasteZone(sheetId, selection.left, selection.top, content.cells, options);
|
|
6790
|
-
this.dispatch("MOVE_RANGES", {
|
|
6791
|
-
target: content.zones,
|
|
6792
|
-
sheetId: content.sheetId,
|
|
6793
|
-
targetSheetId: sheetId,
|
|
6794
|
-
col: selection.left,
|
|
6795
|
-
row: selection.top,
|
|
6796
|
-
});
|
|
6797
6792
|
}
|
|
6798
6793
|
/**
|
|
6799
6794
|
* Clear the clipped zones: remove the cells and clear the formatting
|
|
@@ -7254,14 +7249,15 @@ class MergeClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
7254
7249
|
}
|
|
7255
7250
|
merges.push(mergesInRow);
|
|
7256
7251
|
}
|
|
7257
|
-
return { merges };
|
|
7252
|
+
return { merges, sheetId };
|
|
7258
7253
|
}
|
|
7259
7254
|
/**
|
|
7260
7255
|
* Paste the clipboard content in the given target
|
|
7261
7256
|
*/
|
|
7262
7257
|
paste(target, content, options) {
|
|
7263
7258
|
if (options.isCutOperation) {
|
|
7264
|
-
|
|
7259
|
+
const copiedMerges = content.merges.flat().filter(isDefined);
|
|
7260
|
+
this.dispatch("REMOVE_MERGE", { sheetId: content.sheetId, target: copiedMerges });
|
|
7265
7261
|
}
|
|
7266
7262
|
this.pasteFromCopy(target.sheetId, target.zones, content.merges, options);
|
|
7267
7263
|
}
|
|
@@ -7296,6 +7292,27 @@ class MergeClipboardHandler extends AbstractCellClipboardHandler {
|
|
|
7296
7292
|
}
|
|
7297
7293
|
}
|
|
7298
7294
|
|
|
7295
|
+
class ReferenceClipboardHandler extends AbstractCellClipboardHandler {
|
|
7296
|
+
copy(data) {
|
|
7297
|
+
return {
|
|
7298
|
+
zones: data.clippedZones,
|
|
7299
|
+
sheetId: data.sheetId,
|
|
7300
|
+
};
|
|
7301
|
+
}
|
|
7302
|
+
paste(target, content, options) {
|
|
7303
|
+
if (options.isCutOperation) {
|
|
7304
|
+
const selection = target.zones[0];
|
|
7305
|
+
this.dispatch("MOVE_RANGES", {
|
|
7306
|
+
target: content.zones,
|
|
7307
|
+
sheetId: content.sheetId,
|
|
7308
|
+
targetSheetId: target.sheetId,
|
|
7309
|
+
col: selection.left,
|
|
7310
|
+
row: selection.top,
|
|
7311
|
+
});
|
|
7312
|
+
}
|
|
7313
|
+
}
|
|
7314
|
+
}
|
|
7315
|
+
|
|
7299
7316
|
class SheetClipboardHandler extends AbstractCellClipboardHandler {
|
|
7300
7317
|
isPasteAllowed(sheetId, target, content, options) {
|
|
7301
7318
|
if (!("cells" in content)) {
|
|
@@ -7463,7 +7480,8 @@ clipboardHandlersRegistries.cellHandlers
|
|
|
7463
7480
|
.add("merge", MergeClipboardHandler)
|
|
7464
7481
|
.add("border", BorderClipboardHandler)
|
|
7465
7482
|
.add("table", TableClipboardHandler)
|
|
7466
|
-
.add("conditionalFormat", ConditionalFormatClipboardHandler)
|
|
7483
|
+
.add("conditionalFormat", ConditionalFormatClipboardHandler)
|
|
7484
|
+
.add("references", ReferenceClipboardHandler);
|
|
7467
7485
|
|
|
7468
7486
|
function transformZone(zone, executed) {
|
|
7469
7487
|
if (executed.type === "REMOVE_COLUMNS_ROWS") {
|
|
@@ -9620,8 +9638,8 @@ class ComposerStore extends SpreadsheetStore {
|
|
|
9620
9638
|
this.colorIndexByRange = {};
|
|
9621
9639
|
}
|
|
9622
9640
|
cancelEdition() {
|
|
9623
|
-
this.cancelEditionAndActivateSheet();
|
|
9624
9641
|
this.resetContent();
|
|
9642
|
+
this.cancelEditionAndActivateSheet();
|
|
9625
9643
|
this.colorIndexByRange = {};
|
|
9626
9644
|
}
|
|
9627
9645
|
setCurrentContent(content, selection) {
|
|
@@ -9638,8 +9656,8 @@ class ComposerStore extends SpreadsheetStore {
|
|
|
9638
9656
|
switch (cmd.type) {
|
|
9639
9657
|
case "SELECT_FIGURE":
|
|
9640
9658
|
if (cmd.id) {
|
|
9641
|
-
this.cancelEditionAndActivateSheet();
|
|
9642
9659
|
this.resetContent();
|
|
9660
|
+
this.cancelEditionAndActivateSheet();
|
|
9643
9661
|
}
|
|
9644
9662
|
break;
|
|
9645
9663
|
case "SET_FORMATTING":
|
|
@@ -9689,8 +9707,8 @@ class ComposerStore extends SpreadsheetStore {
|
|
|
9689
9707
|
const sheetIdExists = !!this.getters.tryGetSheet(this.sheetId);
|
|
9690
9708
|
if (!sheetIdExists && this.editionMode !== "inactive") {
|
|
9691
9709
|
this.sheetId = this.getters.getActiveSheetId();
|
|
9692
|
-
this.cancelEditionAndActivateSheet();
|
|
9693
9710
|
this.resetContent();
|
|
9711
|
+
this.cancelEditionAndActivateSheet();
|
|
9694
9712
|
this.notificationStore.raiseError(CELL_DELETED_MESSAGE);
|
|
9695
9713
|
}
|
|
9696
9714
|
break;
|
|
@@ -10185,6 +10203,15 @@ class ComposerStore extends SpreadsheetStore {
|
|
|
10185
10203
|
const exactMatch = proposals?.find((p) => p.text === tokenAtCursor.value);
|
|
10186
10204
|
// remove tokens that are likely to be other parts of the formula that slipped in the token if it's a string
|
|
10187
10205
|
const searchTerm = tokenAtCursor.value.replace(/[ ,\(\)]/g, "");
|
|
10206
|
+
if (this._currentContent === this.initialContent &&
|
|
10207
|
+
provider.displayAllOnInitialContent &&
|
|
10208
|
+
proposals?.length) {
|
|
10209
|
+
return {
|
|
10210
|
+
proposals,
|
|
10211
|
+
selectProposal: provider.selectProposal,
|
|
10212
|
+
autoSelectFirstProposal: provider.autoSelectFirstProposal ?? false,
|
|
10213
|
+
};
|
|
10214
|
+
}
|
|
10188
10215
|
if (exactMatch && this._currentContent !== this.initialContent) {
|
|
10189
10216
|
// this means the user has chosen a proposal
|
|
10190
10217
|
return;
|
|
@@ -12225,6 +12252,7 @@ class ScorecardChart extends Component {
|
|
|
12225
12252
|
}
|
|
12226
12253
|
|
|
12227
12254
|
autoCompleteProviders.add("dataValidation", {
|
|
12255
|
+
displayAllOnInitialContent: true,
|
|
12228
12256
|
getProposals(tokenAtCursor, content) {
|
|
12229
12257
|
if (content.startsWith("=")) {
|
|
12230
12258
|
return [];
|
|
@@ -37664,6 +37692,7 @@ class RemoveDuplicatesPanel extends Component {
|
|
|
37664
37692
|
columns: {},
|
|
37665
37693
|
});
|
|
37666
37694
|
setup() {
|
|
37695
|
+
this.updateColumns();
|
|
37667
37696
|
onWillUpdateProps(() => this.updateColumns());
|
|
37668
37697
|
}
|
|
37669
37698
|
toggleHasHeader() {
|
|
@@ -45812,7 +45841,7 @@ class XlsxChartExtractor extends XlsxBaseExtractor {
|
|
|
45812
45841
|
title: { text: chartTitle },
|
|
45813
45842
|
type: CHART_TYPE_CONVERSION_MAP[chartType],
|
|
45814
45843
|
dataSets: this.extractChartDatasets(this.querySelectorAll(rootChartElement, `c:${chartType}`), chartType),
|
|
45815
|
-
labelRange: this.
|
|
45844
|
+
labelRange: this.extractLabelRange(chartType, rootChartElement),
|
|
45816
45845
|
backgroundColor: this.extractChildAttr(rootChartElement, "c:chartSpace > c:spPr a:srgbClr", "val", {
|
|
45817
45846
|
default: "ffffff",
|
|
45818
45847
|
}).asString(),
|
|
@@ -45824,6 +45853,13 @@ class XlsxChartExtractor extends XlsxBaseExtractor {
|
|
|
45824
45853
|
};
|
|
45825
45854
|
})[0];
|
|
45826
45855
|
}
|
|
45856
|
+
extractLabelRange(chartType, rootChartElement) {
|
|
45857
|
+
if (chartType === "scatterChart") {
|
|
45858
|
+
return (this.extractChildTextContent(rootChartElement, `c:ser c:strRef c:f`) ||
|
|
45859
|
+
this.extractChildTextContent(rootChartElement, `c:ser c:numRef c:f`));
|
|
45860
|
+
}
|
|
45861
|
+
return this.extractChildTextContent(rootChartElement, `c:ser c:cat c:f`);
|
|
45862
|
+
}
|
|
45827
45863
|
extractComboChart(chartElement) {
|
|
45828
45864
|
// Title can be separated into multiple xml elements (for styling and such), we only import the text
|
|
45829
45865
|
const chartTitle = this.mapOnElements({ parent: chartElement, query: "c:title a:t" }, (textElement) => {
|
|
@@ -58744,12 +58780,7 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
58744
58780
|
}
|
|
58745
58781
|
break;
|
|
58746
58782
|
case "AUTORESIZE_ROWS":
|
|
58747
|
-
this.
|
|
58748
|
-
elements: cmd.rows,
|
|
58749
|
-
dimension: "ROW",
|
|
58750
|
-
size: null,
|
|
58751
|
-
sheetId: cmd.sheetId,
|
|
58752
|
-
});
|
|
58783
|
+
this.autoResizeRows(cmd.sheetId, cmd.rows);
|
|
58753
58784
|
break;
|
|
58754
58785
|
}
|
|
58755
58786
|
}
|
|
@@ -58899,6 +58930,48 @@ class SheetUIPlugin extends UIPlugin {
|
|
|
58899
58930
|
}
|
|
58900
58931
|
return "Success" /* CommandResult.Success */;
|
|
58901
58932
|
}
|
|
58933
|
+
autoResizeRows(sheetId, rows) {
|
|
58934
|
+
const rowSizes = [];
|
|
58935
|
+
for (const row of rows) {
|
|
58936
|
+
let evaluatedRowSize = 0;
|
|
58937
|
+
for (const cellId of this.getters.getRowCells(sheetId, row)) {
|
|
58938
|
+
const cell = this.getters.getCellById(cellId);
|
|
58939
|
+
if (!cell) {
|
|
58940
|
+
continue;
|
|
58941
|
+
}
|
|
58942
|
+
const position = this.getters.getCellPosition(cell.id);
|
|
58943
|
+
const colSize = this.getters.getColSize(sheetId, position.col);
|
|
58944
|
+
if (cell.isFormula) {
|
|
58945
|
+
const content = this.getters.getEvaluatedCell(position).formattedValue;
|
|
58946
|
+
const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
58947
|
+
if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
|
|
58948
|
+
evaluatedRowSize = evaluatedSize;
|
|
58949
|
+
}
|
|
58950
|
+
}
|
|
58951
|
+
else {
|
|
58952
|
+
const content = cell.content;
|
|
58953
|
+
const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
|
|
58954
|
+
// Only keep the size of evaluated cells if it's bigger than the dynamic row size
|
|
58955
|
+
if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) {
|
|
58956
|
+
evaluatedRowSize = 0;
|
|
58957
|
+
}
|
|
58958
|
+
}
|
|
58959
|
+
}
|
|
58960
|
+
rowSizes.push(evaluatedRowSize || null);
|
|
58961
|
+
}
|
|
58962
|
+
const groupedSizes = new Map(rowSizes.map((size) => [size, []]));
|
|
58963
|
+
for (let i = 0; i < rowSizes.length; i++) {
|
|
58964
|
+
groupedSizes.get(rowSizes[i])?.push(rows[i]);
|
|
58965
|
+
}
|
|
58966
|
+
for (const [size, rows] of groupedSizes) {
|
|
58967
|
+
this.dispatch("RESIZE_COLUMNS_ROWS", {
|
|
58968
|
+
elements: rows,
|
|
58969
|
+
dimension: "ROW",
|
|
58970
|
+
size,
|
|
58971
|
+
sheetId,
|
|
58972
|
+
});
|
|
58973
|
+
}
|
|
58974
|
+
}
|
|
58902
58975
|
}
|
|
58903
58976
|
|
|
58904
58977
|
class TableComputedStylePlugin extends UIPlugin {
|
|
@@ -67714,7 +67787,7 @@ function addStyles(styles) {
|
|
|
67714
67787
|
}
|
|
67715
67788
|
if (alignAttrs.length > 0) {
|
|
67716
67789
|
attributes.push(["applyAlignment", "1"]); // for Libre Office
|
|
67717
|
-
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}
|
|
67790
|
+
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)}><alignment ${formatAttributes(alignAttrs)} /></xf> `);
|
|
67718
67791
|
}
|
|
67719
67792
|
else {
|
|
67720
67793
|
styleNodes.push(escapeXml /*xml*/ `<xf ${formatAttributes(attributes)} />`);
|
|
@@ -69111,6 +69184,6 @@ const constants = {
|
|
|
69111
69184
|
export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
|
|
69112
69185
|
|
|
69113
69186
|
|
|
69114
|
-
__info__.version = "17.4.
|
|
69115
|
-
__info__.date = "2025-03-
|
|
69116
|
-
__info__.hash = "
|
|
69187
|
+
__info__.version = "17.4.27";
|
|
69188
|
+
__info__.date = "2025-03-19T08:27:27.414Z";
|
|
69189
|
+
__info__.hash = "a87c1da";
|