@odoo/o-spreadsheet 18.0.40 → 18.0.41
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 +41 -17
- package/dist/o-spreadsheet.d.ts +2 -0
- package/dist/o-spreadsheet.esm.js +41 -17
- package/dist/o-spreadsheet.iife.js +41 -17
- package/dist/o-spreadsheet.iife.min.js +222 -222
- package/dist/o_spreadsheet.xml +3 -3
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.0.
|
|
6
|
-
* @date 2025-08-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.41
|
|
6
|
+
* @date 2025-08-21T06:42:14.859Z
|
|
7
|
+
* @hash bc6051c
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
@@ -3435,6 +3435,7 @@ exports.CommandResult = void 0;
|
|
|
3435
3435
|
CommandResult["Success"] = "Success";
|
|
3436
3436
|
CommandResult["CancelledForUnknownReason"] = "CancelledForUnknownReason";
|
|
3437
3437
|
CommandResult["WillRemoveExistingMerge"] = "WillRemoveExistingMerge";
|
|
3438
|
+
CommandResult["CannotMoveTableHeader"] = "CannotMoveTableHeader";
|
|
3438
3439
|
CommandResult["MergeIsDestructive"] = "MergeIsDestructive";
|
|
3439
3440
|
CommandResult["CellIsMerged"] = "CellIsMerged";
|
|
3440
3441
|
CommandResult["InvalidTarget"] = "InvalidTarget";
|
|
@@ -15901,6 +15902,7 @@ const CustomCurrencyTerms = {
|
|
|
15901
15902
|
Custom: _t("Custom"),
|
|
15902
15903
|
};
|
|
15903
15904
|
const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerge those cells and try again.");
|
|
15905
|
+
const TableHeaderMoveErrorMessage = _t("The header row of a table can't be moved.");
|
|
15904
15906
|
const SplitToColumnsTerms = {
|
|
15905
15907
|
Errors: {
|
|
15906
15908
|
Unexpected: _t("Cannot split the selection for an unknown reason"),
|
|
@@ -30158,10 +30160,6 @@ class ComboChart extends AbstractChart {
|
|
|
30158
30160
|
};
|
|
30159
30161
|
}
|
|
30160
30162
|
getDefinitionForExcel() {
|
|
30161
|
-
// Excel does not support aggregating labels
|
|
30162
|
-
if (this.aggregated) {
|
|
30163
|
-
return undefined;
|
|
30164
|
-
}
|
|
30165
30163
|
const dataSets = this.dataSets
|
|
30166
30164
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
30167
30165
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -31175,10 +31173,6 @@ class ScatterChart extends AbstractChart {
|
|
|
31175
31173
|
return new ScatterChart(definition, this.sheetId, this.getters);
|
|
31176
31174
|
}
|
|
31177
31175
|
getDefinitionForExcel() {
|
|
31178
|
-
// Excel does not support aggregating labels
|
|
31179
|
-
if (this.aggregated) {
|
|
31180
|
-
return undefined;
|
|
31181
|
-
}
|
|
31182
31176
|
const dataSets = this.dataSets
|
|
31183
31177
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
31184
31178
|
.filter((ds) => ds.range !== "");
|
|
@@ -49130,8 +49124,13 @@ class RowResizer extends AbstractResizer {
|
|
|
49130
49124
|
elements,
|
|
49131
49125
|
position: this.state.position,
|
|
49132
49126
|
});
|
|
49133
|
-
if (!result.isSuccessful
|
|
49134
|
-
|
|
49127
|
+
if (!result.isSuccessful) {
|
|
49128
|
+
if (result.reasons.includes("WillRemoveExistingMerge" /* CommandResult.WillRemoveExistingMerge */)) {
|
|
49129
|
+
this.env.raiseError(MergeErrorMessage);
|
|
49130
|
+
}
|
|
49131
|
+
else if (result.reasons.includes("CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */)) {
|
|
49132
|
+
this.env.raiseError(TableHeaderMoveErrorMessage);
|
|
49133
|
+
}
|
|
49135
49134
|
}
|
|
49136
49135
|
}
|
|
49137
49136
|
_selectElement(index, addDistinctHeader) {
|
|
@@ -61161,7 +61160,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
61161
61160
|
return PivotPresentationLayer;
|
|
61162
61161
|
}
|
|
61163
61162
|
|
|
61164
|
-
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT"];
|
|
61163
|
+
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT", "REMOVE_PIVOT"];
|
|
61165
61164
|
function isPivotCommand(cmd) {
|
|
61166
61165
|
return UNDO_REDO_PIVOT_COMMANDS.includes(cmd.type);
|
|
61167
61166
|
}
|
|
@@ -66266,8 +66265,33 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66266
66265
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
66267
66266
|
return "InvalidHeaderIndex" /* CommandResult.InvalidHeaderIndex */;
|
|
66268
66267
|
}
|
|
66268
|
+
if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) {
|
|
66269
|
+
return "CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */;
|
|
66270
|
+
}
|
|
66269
66271
|
return "Success" /* CommandResult.Success */;
|
|
66270
66272
|
}
|
|
66273
|
+
isTableRowMoveAllowed(sheetId, selectedRows) {
|
|
66274
|
+
const tables = this.getters.getCoreTables(sheetId);
|
|
66275
|
+
if (tables.length === 0) {
|
|
66276
|
+
return true;
|
|
66277
|
+
}
|
|
66278
|
+
const selectedRowSet = new Set(selectedRows);
|
|
66279
|
+
return tables.every(({ range: { zone }, config }) => {
|
|
66280
|
+
const { top, bottom } = zone;
|
|
66281
|
+
if (config.numberOfHeaders === 0) {
|
|
66282
|
+
return true;
|
|
66283
|
+
}
|
|
66284
|
+
const headerRowEnd = top + config.numberOfHeaders - 1;
|
|
66285
|
+
// Moving the table is allowed if table header rows are not part of the selection
|
|
66286
|
+
// Or if the entire table (including header) is selected
|
|
66287
|
+
const isHeaderSelected = selectedRows.some((row) => row >= top && row <= headerRowEnd);
|
|
66288
|
+
if (!isHeaderSelected) {
|
|
66289
|
+
return true;
|
|
66290
|
+
}
|
|
66291
|
+
const isWholeTableSelected = range(top, bottom + 1).every((r) => selectedRowSet.has(r));
|
|
66292
|
+
return isWholeTableSelected;
|
|
66293
|
+
});
|
|
66294
|
+
}
|
|
66271
66295
|
fallbackToVisibleSheet() {
|
|
66272
66296
|
if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
|
|
66273
66297
|
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
@@ -74649,6 +74673,6 @@ exports.tokenColors = tokenColors;
|
|
|
74649
74673
|
exports.tokenize = tokenize;
|
|
74650
74674
|
|
|
74651
74675
|
|
|
74652
|
-
__info__.version = "18.0.
|
|
74653
|
-
__info__.date = "2025-08-
|
|
74654
|
-
__info__.hash = "
|
|
74676
|
+
__info__.version = "18.0.41";
|
|
74677
|
+
__info__.date = "2025-08-21T06:42:14.859Z";
|
|
74678
|
+
__info__.hash = "bc6051c";
|
package/dist/o-spreadsheet.d.ts
CHANGED
|
@@ -1591,6 +1591,7 @@ declare class GridSelectionPlugin extends UIPlugin {
|
|
|
1591
1591
|
private onAddElements;
|
|
1592
1592
|
private onMoveElements;
|
|
1593
1593
|
private isMoveElementAllowed;
|
|
1594
|
+
private isTableRowMoveAllowed;
|
|
1594
1595
|
private fallbackToVisibleSheet;
|
|
1595
1596
|
/**
|
|
1596
1597
|
* Clip the selection if it spans outside the sheet
|
|
@@ -2578,6 +2579,7 @@ declare const enum CommandResult {
|
|
|
2578
2579
|
Success = "Success",
|
|
2579
2580
|
CancelledForUnknownReason = "CancelledForUnknownReason",
|
|
2580
2581
|
WillRemoveExistingMerge = "WillRemoveExistingMerge",
|
|
2582
|
+
CannotMoveTableHeader = "CannotMoveTableHeader",
|
|
2581
2583
|
MergeIsDestructive = "MergeIsDestructive",
|
|
2582
2584
|
CellIsMerged = "CellIsMerged",
|
|
2583
2585
|
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.0.
|
|
6
|
-
* @date 2025-08-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.41
|
|
6
|
+
* @date 2025-08-21T06:42:14.859Z
|
|
7
|
+
* @hash bc6051c
|
|
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';
|
|
@@ -3433,6 +3433,7 @@ var CommandResult;
|
|
|
3433
3433
|
CommandResult["Success"] = "Success";
|
|
3434
3434
|
CommandResult["CancelledForUnknownReason"] = "CancelledForUnknownReason";
|
|
3435
3435
|
CommandResult["WillRemoveExistingMerge"] = "WillRemoveExistingMerge";
|
|
3436
|
+
CommandResult["CannotMoveTableHeader"] = "CannotMoveTableHeader";
|
|
3436
3437
|
CommandResult["MergeIsDestructive"] = "MergeIsDestructive";
|
|
3437
3438
|
CommandResult["CellIsMerged"] = "CellIsMerged";
|
|
3438
3439
|
CommandResult["InvalidTarget"] = "InvalidTarget";
|
|
@@ -15899,6 +15900,7 @@ const CustomCurrencyTerms = {
|
|
|
15899
15900
|
Custom: _t("Custom"),
|
|
15900
15901
|
};
|
|
15901
15902
|
const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerge those cells and try again.");
|
|
15903
|
+
const TableHeaderMoveErrorMessage = _t("The header row of a table can't be moved.");
|
|
15902
15904
|
const SplitToColumnsTerms = {
|
|
15903
15905
|
Errors: {
|
|
15904
15906
|
Unexpected: _t("Cannot split the selection for an unknown reason"),
|
|
@@ -30156,10 +30158,6 @@ class ComboChart extends AbstractChart {
|
|
|
30156
30158
|
};
|
|
30157
30159
|
}
|
|
30158
30160
|
getDefinitionForExcel() {
|
|
30159
|
-
// Excel does not support aggregating labels
|
|
30160
|
-
if (this.aggregated) {
|
|
30161
|
-
return undefined;
|
|
30162
|
-
}
|
|
30163
30161
|
const dataSets = this.dataSets
|
|
30164
30162
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
30165
30163
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -31173,10 +31171,6 @@ class ScatterChart extends AbstractChart {
|
|
|
31173
31171
|
return new ScatterChart(definition, this.sheetId, this.getters);
|
|
31174
31172
|
}
|
|
31175
31173
|
getDefinitionForExcel() {
|
|
31176
|
-
// Excel does not support aggregating labels
|
|
31177
|
-
if (this.aggregated) {
|
|
31178
|
-
return undefined;
|
|
31179
|
-
}
|
|
31180
31174
|
const dataSets = this.dataSets
|
|
31181
31175
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
31182
31176
|
.filter((ds) => ds.range !== "");
|
|
@@ -49128,8 +49122,13 @@ class RowResizer extends AbstractResizer {
|
|
|
49128
49122
|
elements,
|
|
49129
49123
|
position: this.state.position,
|
|
49130
49124
|
});
|
|
49131
|
-
if (!result.isSuccessful
|
|
49132
|
-
|
|
49125
|
+
if (!result.isSuccessful) {
|
|
49126
|
+
if (result.reasons.includes("WillRemoveExistingMerge" /* CommandResult.WillRemoveExistingMerge */)) {
|
|
49127
|
+
this.env.raiseError(MergeErrorMessage);
|
|
49128
|
+
}
|
|
49129
|
+
else if (result.reasons.includes("CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */)) {
|
|
49130
|
+
this.env.raiseError(TableHeaderMoveErrorMessage);
|
|
49131
|
+
}
|
|
49133
49132
|
}
|
|
49134
49133
|
}
|
|
49135
49134
|
_selectElement(index, addDistinctHeader) {
|
|
@@ -61159,7 +61158,7 @@ function withPivotPresentationLayer (PivotClass) {
|
|
|
61159
61158
|
return PivotPresentationLayer;
|
|
61160
61159
|
}
|
|
61161
61160
|
|
|
61162
|
-
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT"];
|
|
61161
|
+
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT", "REMOVE_PIVOT"];
|
|
61163
61162
|
function isPivotCommand(cmd) {
|
|
61164
61163
|
return UNDO_REDO_PIVOT_COMMANDS.includes(cmd.type);
|
|
61165
61164
|
}
|
|
@@ -66264,8 +66263,33 @@ class GridSelectionPlugin extends UIPlugin {
|
|
|
66264
66263
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
66265
66264
|
return "InvalidHeaderIndex" /* CommandResult.InvalidHeaderIndex */;
|
|
66266
66265
|
}
|
|
66266
|
+
if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) {
|
|
66267
|
+
return "CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */;
|
|
66268
|
+
}
|
|
66267
66269
|
return "Success" /* CommandResult.Success */;
|
|
66268
66270
|
}
|
|
66271
|
+
isTableRowMoveAllowed(sheetId, selectedRows) {
|
|
66272
|
+
const tables = this.getters.getCoreTables(sheetId);
|
|
66273
|
+
if (tables.length === 0) {
|
|
66274
|
+
return true;
|
|
66275
|
+
}
|
|
66276
|
+
const selectedRowSet = new Set(selectedRows);
|
|
66277
|
+
return tables.every(({ range: { zone }, config }) => {
|
|
66278
|
+
const { top, bottom } = zone;
|
|
66279
|
+
if (config.numberOfHeaders === 0) {
|
|
66280
|
+
return true;
|
|
66281
|
+
}
|
|
66282
|
+
const headerRowEnd = top + config.numberOfHeaders - 1;
|
|
66283
|
+
// Moving the table is allowed if table header rows are not part of the selection
|
|
66284
|
+
// Or if the entire table (including header) is selected
|
|
66285
|
+
const isHeaderSelected = selectedRows.some((row) => row >= top && row <= headerRowEnd);
|
|
66286
|
+
if (!isHeaderSelected) {
|
|
66287
|
+
return true;
|
|
66288
|
+
}
|
|
66289
|
+
const isWholeTableSelected = range(top, bottom + 1).every((r) => selectedRowSet.has(r));
|
|
66290
|
+
return isWholeTableSelected;
|
|
66291
|
+
});
|
|
66292
|
+
}
|
|
66269
66293
|
fallbackToVisibleSheet() {
|
|
66270
66294
|
if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
|
|
66271
66295
|
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
@@ -74604,6 +74628,6 @@ const constants = {
|
|
|
74604
74628
|
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 };
|
|
74605
74629
|
|
|
74606
74630
|
|
|
74607
|
-
__info__.version = "18.0.
|
|
74608
|
-
__info__.date = "2025-08-
|
|
74609
|
-
__info__.hash = "
|
|
74631
|
+
__info__.version = "18.0.41";
|
|
74632
|
+
__info__.date = "2025-08-21T06:42:14.859Z";
|
|
74633
|
+
__info__.hash = "bc6051c";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file is generated by o-spreadsheet build tools. Do not edit it.
|
|
4
4
|
* @see https://github.com/odoo/o-spreadsheet
|
|
5
|
-
* @version 18.0.
|
|
6
|
-
* @date 2025-08-
|
|
7
|
-
* @hash
|
|
5
|
+
* @version 18.0.41
|
|
6
|
+
* @date 2025-08-21T06:42:14.859Z
|
|
7
|
+
* @hash bc6051c
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
(function (exports, owl) {
|
|
@@ -3434,6 +3434,7 @@
|
|
|
3434
3434
|
CommandResult["Success"] = "Success";
|
|
3435
3435
|
CommandResult["CancelledForUnknownReason"] = "CancelledForUnknownReason";
|
|
3436
3436
|
CommandResult["WillRemoveExistingMerge"] = "WillRemoveExistingMerge";
|
|
3437
|
+
CommandResult["CannotMoveTableHeader"] = "CannotMoveTableHeader";
|
|
3437
3438
|
CommandResult["MergeIsDestructive"] = "MergeIsDestructive";
|
|
3438
3439
|
CommandResult["CellIsMerged"] = "CellIsMerged";
|
|
3439
3440
|
CommandResult["InvalidTarget"] = "InvalidTarget";
|
|
@@ -15900,6 +15901,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
15900
15901
|
Custom: _t("Custom"),
|
|
15901
15902
|
};
|
|
15902
15903
|
const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerge those cells and try again.");
|
|
15904
|
+
const TableHeaderMoveErrorMessage = _t("The header row of a table can't be moved.");
|
|
15903
15905
|
const SplitToColumnsTerms = {
|
|
15904
15906
|
Errors: {
|
|
15905
15907
|
Unexpected: _t("Cannot split the selection for an unknown reason"),
|
|
@@ -30157,10 +30159,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
30157
30159
|
};
|
|
30158
30160
|
}
|
|
30159
30161
|
getDefinitionForExcel() {
|
|
30160
|
-
// Excel does not support aggregating labels
|
|
30161
|
-
if (this.aggregated) {
|
|
30162
|
-
return undefined;
|
|
30163
|
-
}
|
|
30164
30162
|
const dataSets = this.dataSets
|
|
30165
30163
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
30166
30164
|
.filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
|
|
@@ -31174,10 +31172,6 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
31174
31172
|
return new ScatterChart(definition, this.sheetId, this.getters);
|
|
31175
31173
|
}
|
|
31176
31174
|
getDefinitionForExcel() {
|
|
31177
|
-
// Excel does not support aggregating labels
|
|
31178
|
-
if (this.aggregated) {
|
|
31179
|
-
return undefined;
|
|
31180
|
-
}
|
|
31181
31175
|
const dataSets = this.dataSets
|
|
31182
31176
|
.map((ds) => toExcelDataset(this.getters, ds))
|
|
31183
31177
|
.filter((ds) => ds.range !== "");
|
|
@@ -49129,8 +49123,13 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
49129
49123
|
elements,
|
|
49130
49124
|
position: this.state.position,
|
|
49131
49125
|
});
|
|
49132
|
-
if (!result.isSuccessful
|
|
49133
|
-
|
|
49126
|
+
if (!result.isSuccessful) {
|
|
49127
|
+
if (result.reasons.includes("WillRemoveExistingMerge" /* CommandResult.WillRemoveExistingMerge */)) {
|
|
49128
|
+
this.env.raiseError(MergeErrorMessage);
|
|
49129
|
+
}
|
|
49130
|
+
else if (result.reasons.includes("CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */)) {
|
|
49131
|
+
this.env.raiseError(TableHeaderMoveErrorMessage);
|
|
49132
|
+
}
|
|
49134
49133
|
}
|
|
49135
49134
|
}
|
|
49136
49135
|
_selectElement(index, addDistinctHeader) {
|
|
@@ -61160,7 +61159,7 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
61160
61159
|
return PivotPresentationLayer;
|
|
61161
61160
|
}
|
|
61162
61161
|
|
|
61163
|
-
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT"];
|
|
61162
|
+
const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT", "REMOVE_PIVOT"];
|
|
61164
61163
|
function isPivotCommand(cmd) {
|
|
61165
61164
|
return UNDO_REDO_PIVOT_COMMANDS.includes(cmd.type);
|
|
61166
61165
|
}
|
|
@@ -66265,8 +66264,33 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
66265
66264
|
if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
|
|
66266
66265
|
return "InvalidHeaderIndex" /* CommandResult.InvalidHeaderIndex */;
|
|
66267
66266
|
}
|
|
66267
|
+
if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) {
|
|
66268
|
+
return "CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */;
|
|
66269
|
+
}
|
|
66268
66270
|
return "Success" /* CommandResult.Success */;
|
|
66269
66271
|
}
|
|
66272
|
+
isTableRowMoveAllowed(sheetId, selectedRows) {
|
|
66273
|
+
const tables = this.getters.getCoreTables(sheetId);
|
|
66274
|
+
if (tables.length === 0) {
|
|
66275
|
+
return true;
|
|
66276
|
+
}
|
|
66277
|
+
const selectedRowSet = new Set(selectedRows);
|
|
66278
|
+
return tables.every(({ range: { zone }, config }) => {
|
|
66279
|
+
const { top, bottom } = zone;
|
|
66280
|
+
if (config.numberOfHeaders === 0) {
|
|
66281
|
+
return true;
|
|
66282
|
+
}
|
|
66283
|
+
const headerRowEnd = top + config.numberOfHeaders - 1;
|
|
66284
|
+
// Moving the table is allowed if table header rows are not part of the selection
|
|
66285
|
+
// Or if the entire table (including header) is selected
|
|
66286
|
+
const isHeaderSelected = selectedRows.some((row) => row >= top && row <= headerRowEnd);
|
|
66287
|
+
if (!isHeaderSelected) {
|
|
66288
|
+
return true;
|
|
66289
|
+
}
|
|
66290
|
+
const isWholeTableSelected = range(top, bottom + 1).every((r) => selectedRowSet.has(r));
|
|
66291
|
+
return isWholeTableSelected;
|
|
66292
|
+
});
|
|
66293
|
+
}
|
|
66270
66294
|
fallbackToVisibleSheet() {
|
|
66271
66295
|
if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
|
|
66272
66296
|
const currentSheetIds = this.getters.getVisibleSheetIds();
|
|
@@ -74648,9 +74672,9 @@ stores.inject(MyMetaStore, storeInstance);
|
|
|
74648
74672
|
exports.tokenize = tokenize;
|
|
74649
74673
|
|
|
74650
74674
|
|
|
74651
|
-
__info__.version = "18.0.
|
|
74652
|
-
__info__.date = "2025-08-
|
|
74653
|
-
__info__.hash = "
|
|
74675
|
+
__info__.version = "18.0.41";
|
|
74676
|
+
__info__.date = "2025-08-21T06:42:14.859Z";
|
|
74677
|
+
__info__.hash = "bc6051c";
|
|
74654
74678
|
|
|
74655
74679
|
|
|
74656
74680
|
})(this.o_spreadsheet = this.o_spreadsheet || {}, owl);
|