@odoo/o-spreadsheet 18.2.25 → 18.2.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 +53 -25
- package/dist/o-spreadsheet.d.ts +2 -0
- package/dist/o-spreadsheet.esm.js +53 -25
- package/dist/o-spreadsheet.iife.js +53 -25
- package/dist/o-spreadsheet.iife.min.js +368 -368
- package/dist/o_spreadsheet.xml +10 -7
- 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.
|
|
6
|
-
* @date 2025-08-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.27
|
|
6
|
+
* @date 2025-08-26T10:07:14.516Z
|
|
7
|
+
* @hash fbf9445
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -3613,6 +3613,7 @@ exports.CommandResult = void 0;
|
|
|
3613
3613
|
CommandResult["Success"] = "Success";
|
|
3614
3614
|
CommandResult["CancelledForUnknownReason"] = "CancelledForUnknownReason";
|
|
3615
3615
|
CommandResult["WillRemoveExistingMerge"] = "WillRemoveExistingMerge";
|
|
3616
|
+
CommandResult["CannotMoveTableHeader"] = "CannotMoveTableHeader";
|
|
3616
3617
|
CommandResult["MergeIsDestructive"] = "MergeIsDestructive";
|
|
3617
3618
|
CommandResult["CellIsMerged"] = "CellIsMerged";
|
|
3618
3619
|
CommandResult["InvalidTarget"] = "InvalidTarget";
|
|
@@ -6822,15 +6823,22 @@ function parseOSClipboardContent(content) {
|
|
|
6822
6823
|
};
|
|
6823
6824
|
}
|
|
6824
6825
|
const htmlDocument = new DOMParser().parseFromString(content[ClipboardMIMEType.Html], "text/html");
|
|
6825
|
-
const oSheetClipboardData = htmlDocument
|
|
6826
|
-
.querySelector("div")
|
|
6827
|
-
?.getAttribute("data-osheet-clipboard");
|
|
6828
|
-
const spreadsheetContent = oSheetClipboardData && JSON.parse(oSheetClipboardData);
|
|
6829
6826
|
return {
|
|
6830
6827
|
text: content[ClipboardMIMEType.PlainText],
|
|
6831
|
-
data:
|
|
6828
|
+
data: getOSheetDataFromHTML(htmlDocument),
|
|
6832
6829
|
};
|
|
6833
6830
|
}
|
|
6831
|
+
function getOSheetDataFromHTML(htmlDocument) {
|
|
6832
|
+
const attributes = [...htmlDocument.documentElement.attributes];
|
|
6833
|
+
// Check if it's a Microsoft Office clipboard data (it will have some namespaces defined in the root element)
|
|
6834
|
+
if (attributes.some((attr) => attr.value.includes("microsoft"))) {
|
|
6835
|
+
return undefined;
|
|
6836
|
+
}
|
|
6837
|
+
const oSheetClipboardData = htmlDocument
|
|
6838
|
+
.querySelector("div")
|
|
6839
|
+
?.getAttribute("data-osheet-clipboard");
|
|
6840
|
+
return oSheetClipboardData && JSON.parse(oSheetClipboardData);
|
|
6841
|
+
}
|
|
6834
6842
|
/**
|
|
6835
6843
|
* Applies each clipboard handler to paste its corresponding data into the target.
|
|
6836
6844
|
*/
|
|
@@ -28682,6 +28690,7 @@ const CustomCurrencyTerms = {
|
|
|
28682
28690
|
Custom: _t("Custom"),
|
|
28683
28691
|
};
|
|
28684
28692
|
const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerge those cells and try again.");
|
|
28693
|
+
const TableHeaderMoveErrorMessage = _t("The header row of a table can't be moved.");
|
|
28685
28694
|
const SplitToColumnsTerms = {
|
|
28686
28695
|
Errors: {
|
|
28687
28696
|
Unexpected: _t("Cannot split the selection for an unknown reason"),
|
|
@@ -30894,10 +30903,6 @@ class ComboChart extends AbstractChart {
|
|
|
30894
30903
|
};
|
|
30895
30904
|
}
|
|
30896
30905
|
getDefinitionForExcel() {
|
|
30897
|
-
// Excel does not support aggregating labels
|
|
30898
|
-
if (this.aggregated) {
|
|
30899
|
-
return undefined;
|
|
30900
|
-
}
|
|
30901
30906
|
const dataSets = this.dataSets
|
|
30902
30907
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
30903
30908
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -31905,9 +31910,6 @@ class RadarChart extends AbstractChart {
|
|
|
31905
31910
|
};
|
|
31906
31911
|
}
|
|
31907
31912
|
getDefinitionForExcel() {
|
|
31908
|
-
if (this.aggregated) {
|
|
31909
|
-
return undefined;
|
|
31910
|
-
}
|
|
31911
31913
|
const dataSets = this.dataSets
|
|
31912
31914
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
31913
31915
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -32052,10 +32054,6 @@ class ScatterChart extends AbstractChart {
|
|
|
32052
32054
|
return new ScatterChart(definition, this.sheetId, this.getters);
|
|
32053
32055
|
}
|
|
32054
32056
|
getDefinitionForExcel() {
|
|
32055
|
-
// Excel does not support aggregating labels
|
|
32056
|
-
if (this.aggregated) {
|
|
32057
|
-
return undefined;
|
|
32058
|
-
}
|
|
32059
32057
|
const dataSets = this.dataSets
|
|
32060
32058
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
32061
32059
|
.filter((ds) => ds.range !== "");
|
|
@@ -51750,8 +51748,13 @@ class RowResizer extends AbstractResizer {
|
|
|
51750
51748
|
elements,
|
|
51751
51749
|
position: this.state.position,
|
|
51752
51750
|
});
|
|
51753
|
-
if (!result.isSuccessful
|
|
51754
|
-
|
|
51751
|
+
if (!result.isSuccessful) {
|
|
51752
|
+
if (result.reasons.includes("WillRemoveExistingMerge" /* CommandResult.WillRemoveExistingMerge */)) {
|
|
51753
|
+
this.env.raiseError(MergeErrorMessage);
|
|
51754
|
+
}
|
|
51755
|
+
else if (result.reasons.includes("CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */)) {
|
|
51756
|
+
this.env.raiseError(TableHeaderMoveErrorMessage);
|
|
51757
|
+
}
|
|
51755
51758
|
}
|
|
51756
51759
|
}
|
|
51757
51760
|
_selectElement(index, addDistinctHeader) {
|
|
@@ -63747,7 +63750,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
63747
63750
|
return PivotPresentationLayer;
|
|
63748
63751
|
}
|
|
63749
63752
|
|
|
63750
|
-
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT"];
|
|
63753
|
+
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT", "REMOVE_PIVOT"];
|
|
63751
63754
|
function isPivotCommand(cmd) {
|
|
63752
63755
|
return UNDO_REDO_PIVOT_COMMANDS.includes(cmd.type);
|
|
63753
63756
|
}
|
|
@@ -68911,8 +68914,33 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68911
68914
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
68912
68915
|
return "InvalidHeaderIndex" /* CommandResult.InvalidHeaderIndex */;
|
|
68913
68916
|
}
|
|
68917
|
+
if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) {
|
|
68918
|
+
return "CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */;
|
|
68919
|
+
}
|
|
68914
68920
|
return "Success" /* CommandResult.Success */;
|
|
68915
68921
|
}
|
|
68922
|
+
isTableRowMoveAllowed(sheetId, selectedRows) {
|
|
68923
|
+
const tables = this.getters.getCoreTables(sheetId);
|
|
68924
|
+
if (tables.length === 0) {
|
|
68925
|
+
return true;
|
|
68926
|
+
}
|
|
68927
|
+
const selectedRowSet = new Set(selectedRows);
|
|
68928
|
+
return tables.every(({ range: { zone }, config }) => {
|
|
68929
|
+
const { top, bottom } = zone;
|
|
68930
|
+
if (config.numberOfHeaders === 0) {
|
|
68931
|
+
return true;
|
|
68932
|
+
}
|
|
68933
|
+
const headerRowEnd = top + config.numberOfHeaders - 1;
|
|
68934
|
+
// Moving the table is allowed if table header rows are not part of the selection
|
|
68935
|
+
// Or if the entire table (including header) is selected
|
|
68936
|
+
const isHeaderSelected = selectedRows.some((row) => row >= top && row <= headerRowEnd);
|
|
68937
|
+
if (!isHeaderSelected) {
|
|
68938
|
+
return true;
|
|
68939
|
+
}
|
|
68940
|
+
const isWholeTableSelected = range(top, bottom + 1).every((r) => selectedRowSet.has(r));
|
|
68941
|
+
return isWholeTableSelected;
|
|
68942
|
+
});
|
|
68943
|
+
}
|
|
68916
68944
|
fallbackToVisibleSheet() {
|
|
68917
68945
|
if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
|
|
68918
68946
|
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
@@ -77257,6 +77285,6 @@ exports.tokenColors = tokenColors;
|
|
|
77257
77285
|
exports.tokenize = tokenize;
|
|
77258
77286
|
|
|
77259
77287
|
|
|
77260
|
-
__info__.version = "18.2.
|
|
77261
|
-
__info__.date = "2025-08-
|
|
77262
|
-
__info__.hash = "
|
|
77288
|
+
__info__.version = "18.2.27";
|
|
77289
|
+
__info__.date = "2025-08-26T10:07:14.516Z";
|
|
77290
|
+
__info__.hash = "fbf9445";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -2061,6 +2061,7 @@ declare class GridSelectionPlugin extends UIPlugin {
|
|
|
2061
2061
|
private onAddElements;
|
|
2062
2062
|
private onMoveElements;
|
|
2063
2063
|
private isMoveElementAllowed;
|
|
2064
|
+
private isTableRowMoveAllowed;
|
|
2064
2065
|
private fallbackToVisibleSheet;
|
|
2065
2066
|
/**
|
|
2066
2067
|
* Clip the selection if it spans outside the sheet
|
|
@@ -3039,6 +3040,7 @@ declare const enum CommandResult {
|
|
|
3039
3040
|
Success = "Success",
|
|
3040
3041
|
CancelledForUnknownReason = "CancelledForUnknownReason",
|
|
3041
3042
|
WillRemoveExistingMerge = "WillRemoveExistingMerge",
|
|
3043
|
+
CannotMoveTableHeader = "CannotMoveTableHeader",
|
|
3042
3044
|
MergeIsDestructive = "MergeIsDestructive",
|
|
3043
3045
|
CellIsMerged = "CellIsMerged",
|
|
3044
3046
|
InvalidTarget = "InvalidTarget",
|
|
@@ -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.
|
|
6
|
-
* @date 2025-08-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.27
|
|
6
|
+
* @date 2025-08-26T10:07:14.516Z
|
|
7
|
+
* @hash fbf9445
|
|
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';
|
|
@@ -3611,6 +3611,7 @@ var CommandResult;
|
|
|
3611
3611
|
CommandResult["Success"] = "Success";
|
|
3612
3612
|
CommandResult["CancelledForUnknownReason"] = "CancelledForUnknownReason";
|
|
3613
3613
|
CommandResult["WillRemoveExistingMerge"] = "WillRemoveExistingMerge";
|
|
3614
|
+
CommandResult["CannotMoveTableHeader"] = "CannotMoveTableHeader";
|
|
3614
3615
|
CommandResult["MergeIsDestructive"] = "MergeIsDestructive";
|
|
3615
3616
|
CommandResult["CellIsMerged"] = "CellIsMerged";
|
|
3616
3617
|
CommandResult["InvalidTarget"] = "InvalidTarget";
|
|
@@ -6820,15 +6821,22 @@ function parseOSClipboardContent(content) {
|
|
|
6820
6821
|
};
|
|
6821
6822
|
}
|
|
6822
6823
|
const htmlDocument = new DOMParser().parseFromString(content[ClipboardMIMEType.Html], "text/html");
|
|
6823
|
-
const oSheetClipboardData = htmlDocument
|
|
6824
|
-
.querySelector("div")
|
|
6825
|
-
?.getAttribute("data-osheet-clipboard");
|
|
6826
|
-
const spreadsheetContent = oSheetClipboardData && JSON.parse(oSheetClipboardData);
|
|
6827
6824
|
return {
|
|
6828
6825
|
text: content[ClipboardMIMEType.PlainText],
|
|
6829
|
-
data:
|
|
6826
|
+
data: getOSheetDataFromHTML(htmlDocument),
|
|
6830
6827
|
};
|
|
6831
6828
|
}
|
|
6829
|
+
function getOSheetDataFromHTML(htmlDocument) {
|
|
6830
|
+
const attributes = [...htmlDocument.documentElement.attributes];
|
|
6831
|
+
// Check if it's a Microsoft Office clipboard data (it will have some namespaces defined in the root element)
|
|
6832
|
+
if (attributes.some((attr) => attr.value.includes("microsoft"))) {
|
|
6833
|
+
return undefined;
|
|
6834
|
+
}
|
|
6835
|
+
const oSheetClipboardData = htmlDocument
|
|
6836
|
+
.querySelector("div")
|
|
6837
|
+
?.getAttribute("data-osheet-clipboard");
|
|
6838
|
+
return oSheetClipboardData && JSON.parse(oSheetClipboardData);
|
|
6839
|
+
}
|
|
6832
6840
|
/**
|
|
6833
6841
|
* Applies each clipboard handler to paste its corresponding data into the target.
|
|
6834
6842
|
*/
|
|
@@ -28680,6 +28688,7 @@ const CustomCurrencyTerms = {
|
|
|
28680
28688
|
Custom: _t("Custom"),
|
|
28681
28689
|
};
|
|
28682
28690
|
const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerge those cells and try again.");
|
|
28691
|
+
const TableHeaderMoveErrorMessage = _t("The header row of a table can't be moved.");
|
|
28683
28692
|
const SplitToColumnsTerms = {
|
|
28684
28693
|
Errors: {
|
|
28685
28694
|
Unexpected: _t("Cannot split the selection for an unknown reason"),
|
|
@@ -30892,10 +30901,6 @@ class ComboChart extends AbstractChart {
|
|
|
30892
30901
|
};
|
|
30893
30902
|
}
|
|
30894
30903
|
getDefinitionForExcel() {
|
|
30895
|
-
// Excel does not support aggregating labels
|
|
30896
|
-
if (this.aggregated) {
|
|
30897
|
-
return undefined;
|
|
30898
|
-
}
|
|
30899
30904
|
const dataSets = this.dataSets
|
|
30900
30905
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
30901
30906
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -31903,9 +31908,6 @@ class RadarChart extends AbstractChart {
|
|
|
31903
31908
|
};
|
|
31904
31909
|
}
|
|
31905
31910
|
getDefinitionForExcel() {
|
|
31906
|
-
if (this.aggregated) {
|
|
31907
|
-
return undefined;
|
|
31908
|
-
}
|
|
31909
31911
|
const dataSets = this.dataSets
|
|
31910
31912
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
31911
31913
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -32050,10 +32052,6 @@ class ScatterChart extends AbstractChart {
|
|
|
32050
32052
|
return new ScatterChart(definition, this.sheetId, this.getters);
|
|
32051
32053
|
}
|
|
32052
32054
|
getDefinitionForExcel() {
|
|
32053
|
-
// Excel does not support aggregating labels
|
|
32054
|
-
if (this.aggregated) {
|
|
32055
|
-
return undefined;
|
|
32056
|
-
}
|
|
32057
32055
|
const dataSets = this.dataSets
|
|
32058
32056
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
32059
32057
|
.filter((ds) => ds.range !== "");
|
|
@@ -51748,8 +51746,13 @@ class RowResizer extends AbstractResizer {
|
|
|
51748
51746
|
elements,
|
|
51749
51747
|
position: this.state.position,
|
|
51750
51748
|
});
|
|
51751
|
-
if (!result.isSuccessful
|
|
51752
|
-
|
|
51749
|
+
if (!result.isSuccessful) {
|
|
51750
|
+
if (result.reasons.includes("WillRemoveExistingMerge" /* CommandResult.WillRemoveExistingMerge */)) {
|
|
51751
|
+
this.env.raiseError(MergeErrorMessage);
|
|
51752
|
+
}
|
|
51753
|
+
else if (result.reasons.includes("CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */)) {
|
|
51754
|
+
this.env.raiseError(TableHeaderMoveErrorMessage);
|
|
51755
|
+
}
|
|
51753
51756
|
}
|
|
51754
51757
|
}
|
|
51755
51758
|
_selectElement(index, addDistinctHeader) {
|
|
@@ -63745,7 +63748,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
63745
63748
|
return PivotPresentationLayer;
|
|
63746
63749
|
}
|
|
63747
63750
|
|
|
63748
|
-
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT"];
|
|
63751
|
+
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT", "REMOVE_PIVOT"];
|
|
63749
63752
|
function isPivotCommand(cmd) {
|
|
63750
63753
|
return UNDO_REDO_PIVOT_COMMANDS.includes(cmd.type);
|
|
63751
63754
|
}
|
|
@@ -68909,8 +68912,33 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
68909
68912
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
68910
68913
|
return "InvalidHeaderIndex" /* CommandResult.InvalidHeaderIndex */;
|
|
68911
68914
|
}
|
|
68915
|
+
if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) {
|
|
68916
|
+
return "CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */;
|
|
68917
|
+
}
|
|
68912
68918
|
return "Success" /* CommandResult.Success */;
|
|
68913
68919
|
}
|
|
68920
|
+
isTableRowMoveAllowed(sheetId, selectedRows) {
|
|
68921
|
+
const tables = this.getters.getCoreTables(sheetId);
|
|
68922
|
+
if (tables.length === 0) {
|
|
68923
|
+
return true;
|
|
68924
|
+
}
|
|
68925
|
+
const selectedRowSet = new Set(selectedRows);
|
|
68926
|
+
return tables.every(({ range: { zone }, config }) => {
|
|
68927
|
+
const { top, bottom } = zone;
|
|
68928
|
+
if (config.numberOfHeaders === 0) {
|
|
68929
|
+
return true;
|
|
68930
|
+
}
|
|
68931
|
+
const headerRowEnd = top + config.numberOfHeaders - 1;
|
|
68932
|
+
// Moving the table is allowed if table header rows are not part of the selection
|
|
68933
|
+
// Or if the entire table (including header) is selected
|
|
68934
|
+
const isHeaderSelected = selectedRows.some((row) => row >= top && row <= headerRowEnd);
|
|
68935
|
+
if (!isHeaderSelected) {
|
|
68936
|
+
return true;
|
|
68937
|
+
}
|
|
68938
|
+
const isWholeTableSelected = range(top, bottom + 1).every((r) => selectedRowSet.has(r));
|
|
68939
|
+
return isWholeTableSelected;
|
|
68940
|
+
});
|
|
68941
|
+
}
|
|
68914
68942
|
fallbackToVisibleSheet() {
|
|
68915
68943
|
if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
|
|
68916
68944
|
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
@@ -77210,6 +77238,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
|
|
|
77210
77238
|
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 };
|
|
77211
77239
|
|
|
77212
77240
|
|
|
77213
|
-
__info__.version = "18.2.
|
|
77214
|
-
__info__.date = "2025-08-
|
|
77215
|
-
__info__.hash = "
|
|
77241
|
+
__info__.version = "18.2.27";
|
|
77242
|
+
__info__.date = "2025-08-26T10:07:14.516Z";
|
|
77243
|
+
__info__.hash = "fbf9445";
|
|
@@ -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.
|
|
6
|
-
* @date 2025-08-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.2.27
|
|
6
|
+
* @date 2025-08-26T10:07:14.516Z
|
|
7
|
+
* @hash fbf9445
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -3612,6 +3612,7 @@
|
|
|
3612
3612
|
CommandResult["Success"] = "Success";
|
|
3613
3613
|
CommandResult["CancelledForUnknownReason"] = "CancelledForUnknownReason";
|
|
3614
3614
|
CommandResult["WillRemoveExistingMerge"] = "WillRemoveExistingMerge";
|
|
3615
|
+
CommandResult["CannotMoveTableHeader"] = "CannotMoveTableHeader";
|
|
3615
3616
|
CommandResult["MergeIsDestructive"] = "MergeIsDestructive";
|
|
3616
3617
|
CommandResult["CellIsMerged"] = "CellIsMerged";
|
|
3617
3618
|
CommandResult["InvalidTarget"] = "InvalidTarget";
|
|
@@ -6821,15 +6822,22 @@
|
|
|
6821
6822
|
};
|
|
6822
6823
|
}
|
|
6823
6824
|
const htmlDocument = new DOMParser().parseFromString(content[ClipboardMIMEType.Html], "text/html");
|
|
6824
|
-
const oSheetClipboardData = htmlDocument
|
|
6825
|
-
.querySelector("div")
|
|
6826
|
-
?.getAttribute("data-osheet-clipboard");
|
|
6827
|
-
const spreadsheetContent = oSheetClipboardData && JSON.parse(oSheetClipboardData);
|
|
6828
6825
|
return {
|
|
6829
6826
|
text: content[ClipboardMIMEType.PlainText],
|
|
6830
|
-
data:
|
|
6827
|
+
data: getOSheetDataFromHTML(htmlDocument),
|
|
6831
6828
|
};
|
|
6832
6829
|
}
|
|
6830
|
+
function getOSheetDataFromHTML(htmlDocument) {
|
|
6831
|
+
const attributes = [...htmlDocument.documentElement.attributes];
|
|
6832
|
+
// Check if it's a Microsoft Office clipboard data (it will have some namespaces defined in the root element)
|
|
6833
|
+
if (attributes.some((attr) => attr.value.includes("microsoft"))) {
|
|
6834
|
+
return undefined;
|
|
6835
|
+
}
|
|
6836
|
+
const oSheetClipboardData = htmlDocument
|
|
6837
|
+
.querySelector("div")
|
|
6838
|
+
?.getAttribute("data-osheet-clipboard");
|
|
6839
|
+
return oSheetClipboardData && JSON.parse(oSheetClipboardData);
|
|
6840
|
+
}
|
|
6833
6841
|
/**
|
|
6834
6842
|
* Applies each clipboard handler to paste its corresponding data into the target.
|
|
6835
6843
|
*/
|
|
@@ -28681,6 +28689,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
28681
28689
|
Custom: _t("Custom"),
|
|
28682
28690
|
};
|
|
28683
28691
|
const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerge those cells and try again.");
|
|
28692
|
+
const TableHeaderMoveErrorMessage = _t("The header row of a table can't be moved.");
|
|
28684
28693
|
const SplitToColumnsTerms = {
|
|
28685
28694
|
Errors: {
|
|
28686
28695
|
Unexpected: _t("Cannot split the selection for an unknown reason"),
|
|
@@ -30893,10 +30902,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30893
30902
|
};
|
|
30894
30903
|
}
|
|
30895
30904
|
getDefinitionForExcel() {
|
|
30896
|
-
// Excel does not support aggregating labels
|
|
30897
|
-
if (this.aggregated) {
|
|
30898
|
-
return undefined;
|
|
30899
|
-
}
|
|
30900
30905
|
const dataSets = this.dataSets
|
|
30901
30906
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
30902
30907
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -31904,9 +31909,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31904
31909
|
};
|
|
31905
31910
|
}
|
|
31906
31911
|
getDefinitionForExcel() {
|
|
31907
|
-
if (this.aggregated) {
|
|
31908
|
-
return undefined;
|
|
31909
|
-
}
|
|
31910
31912
|
const dataSets = this.dataSets
|
|
31911
31913
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
31912
31914
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -32051,10 +32053,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
32051
32053
|
return new ScatterChart(definition, this.sheetId, this.getters);
|
|
32052
32054
|
}
|
|
32053
32055
|
getDefinitionForExcel() {
|
|
32054
|
-
// Excel does not support aggregating labels
|
|
32055
|
-
if (this.aggregated) {
|
|
32056
|
-
return undefined;
|
|
32057
|
-
}
|
|
32058
32056
|
const dataSets = this.dataSets
|
|
32059
32057
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
32060
32058
|
.filter((ds) => ds.range !== "");
|
|
@@ -51749,8 +51747,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
51749
51747
|
elements,
|
|
51750
51748
|
position: this.state.position,
|
|
51751
51749
|
});
|
|
51752
|
-
if (!result.isSuccessful
|
|
51753
|
-
|
|
51750
|
+
if (!result.isSuccessful) {
|
|
51751
|
+
if (result.reasons.includes("WillRemoveExistingMerge" /* CommandResult.WillRemoveExistingMerge */)) {
|
|
51752
|
+
this.env.raiseError(MergeErrorMessage);
|
|
51753
|
+
}
|
|
51754
|
+
else if (result.reasons.includes("CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */)) {
|
|
51755
|
+
this.env.raiseError(TableHeaderMoveErrorMessage);
|
|
51756
|
+
}
|
|
51754
51757
|
}
|
|
51755
51758
|
}
|
|
51756
51759
|
_selectElement(index, addDistinctHeader) {
|
|
@@ -63746,7 +63749,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
63746
63749
|
return PivotPresentationLayer;
|
|
63747
63750
|
}
|
|
63748
63751
|
|
|
63749
|
-
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT"];
|
|
63752
|
+
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT", "REMOVE_PIVOT"];
|
|
63750
63753
|
function isPivotCommand(cmd) {
|
|
63751
63754
|
return UNDO_REDO_PIVOT_COMMANDS.includes(cmd.type);
|
|
63752
63755
|
}
|
|
@@ -68910,8 +68913,33 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
68910
68913
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
68911
68914
|
return "InvalidHeaderIndex" /* CommandResult.InvalidHeaderIndex */;
|
|
68912
68915
|
}
|
|
68916
|
+
if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) {
|
|
68917
|
+
return "CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */;
|
|
68918
|
+
}
|
|
68913
68919
|
return "Success" /* CommandResult.Success */;
|
|
68914
68920
|
}
|
|
68921
|
+
isTableRowMoveAllowed(sheetId, selectedRows) {
|
|
68922
|
+
const tables = this.getters.getCoreTables(sheetId);
|
|
68923
|
+
if (tables.length === 0) {
|
|
68924
|
+
return true;
|
|
68925
|
+
}
|
|
68926
|
+
const selectedRowSet = new Set(selectedRows);
|
|
68927
|
+
return tables.every(({ range: { zone }, config }) => {
|
|
68928
|
+
const { top, bottom } = zone;
|
|
68929
|
+
if (config.numberOfHeaders === 0) {
|
|
68930
|
+
return true;
|
|
68931
|
+
}
|
|
68932
|
+
const headerRowEnd = top + config.numberOfHeaders - 1;
|
|
68933
|
+
// Moving the table is allowed if table header rows are not part of the selection
|
|
68934
|
+
// Or if the entire table (including header) is selected
|
|
68935
|
+
const isHeaderSelected = selectedRows.some((row) => row >= top && row <= headerRowEnd);
|
|
68936
|
+
if (!isHeaderSelected) {
|
|
68937
|
+
return true;
|
|
68938
|
+
}
|
|
68939
|
+
const isWholeTableSelected = range(top, bottom + 1).every((r) => selectedRowSet.has(r));
|
|
68940
|
+
return isWholeTableSelected;
|
|
68941
|
+
});
|
|
68942
|
+
}
|
|
68915
68943
|
fallbackToVisibleSheet() {
|
|
68916
68944
|
if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
|
|
68917
68945
|
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
@@ -77256,9 +77284,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
77256
77284
|
exports.tokenize = tokenize;
|
|
77257
77285
|
|
|
77258
77286
|
|
|
77259
|
-
__info__.version = "18.2.
|
|
77260
|
-
__info__.date = "2025-08-
|
|
77261
|
-
__info__.hash = "
|
|
77287
|
+
__info__.version = "18.2.27";
|
|
77288
|
+
__info__.date = "2025-08-26T10:07:14.516Z";
|
|
77289
|
+
__info__.hash = "fbf9445";
|
|
77262
77290
|
|
|
77263
77291
|
|
|
77264
77292
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|