@odoo/o-spreadsheet 18.2.25 → 18.2.26

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.
@@ -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.25
6
- * @date 2025-08-18T08:16:31.368Z
7
- * @hash 6b63aad
5
+ * @version 18.2.26
6
+ * @date 2025-08-21T06:39:39.007Z
7
+ * @hash d23c340
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";
@@ -28682,6 +28683,7 @@ const CustomCurrencyTerms = {
28682
28683
  Custom: _t("Custom"),
28683
28684
  };
28684
28685
  const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerge those cells and try again.");
28686
+ const TableHeaderMoveErrorMessage = _t("The header row of a table can't be moved.");
28685
28687
  const SplitToColumnsTerms = {
28686
28688
  Errors: {
28687
28689
  Unexpected: _t("Cannot split the selection for an unknown reason"),
@@ -31905,9 +31907,6 @@ class RadarChart extends AbstractChart {
31905
31907
  };
31906
31908
  }
31907
31909
  getDefinitionForExcel() {
31908
- if (this.aggregated) {
31909
- return undefined;
31910
- }
31911
31910
  const dataSets = this.dataSets
31912
31911
  .map((ds) => toExcelDataset(this.getters, ds))
31913
31912
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -51750,8 +51749,13 @@ class RowResizer extends AbstractResizer {
51750
51749
  elements,
51751
51750
  position: this.state.position,
51752
51751
  });
51753
- if (!result.isSuccessful && result.reasons.includes("WillRemoveExistingMerge" /* CommandResult.WillRemoveExistingMerge */)) {
51754
- this.env.raiseError(MergeErrorMessage);
51752
+ if (!result.isSuccessful) {
51753
+ if (result.reasons.includes("WillRemoveExistingMerge" /* CommandResult.WillRemoveExistingMerge */)) {
51754
+ this.env.raiseError(MergeErrorMessage);
51755
+ }
51756
+ else if (result.reasons.includes("CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */)) {
51757
+ this.env.raiseError(TableHeaderMoveErrorMessage);
51758
+ }
51755
51759
  }
51756
51760
  }
51757
51761
  _selectElement(index, addDistinctHeader) {
@@ -63747,7 +63751,7 @@ function withPivotPresentationLayer (PivotClass) {
63747
63751
  return PivotPresentationLayer;
63748
63752
  }
63749
63753
 
63750
- const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT"];
63754
+ const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT", "REMOVE_PIVOT"];
63751
63755
  function isPivotCommand(cmd) {
63752
63756
  return UNDO_REDO_PIVOT_COMMANDS.includes(cmd.type);
63753
63757
  }
@@ -68911,8 +68915,33 @@ class GridSelectionPlugin extends UIPlugin {
68911
68915
  if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
68912
68916
  return "InvalidHeaderIndex" /* CommandResult.InvalidHeaderIndex */;
68913
68917
  }
68918
+ if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) {
68919
+ return "CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */;
68920
+ }
68914
68921
  return "Success" /* CommandResult.Success */;
68915
68922
  }
68923
+ isTableRowMoveAllowed(sheetId, selectedRows) {
68924
+ const tables = this.getters.getCoreTables(sheetId);
68925
+ if (tables.length === 0) {
68926
+ return true;
68927
+ }
68928
+ const selectedRowSet = new Set(selectedRows);
68929
+ return tables.every(({ range: { zone }, config }) => {
68930
+ const { top, bottom } = zone;
68931
+ if (config.numberOfHeaders === 0) {
68932
+ return true;
68933
+ }
68934
+ const headerRowEnd = top + config.numberOfHeaders - 1;
68935
+ // Moving the table is allowed if table header rows are not part of the selection
68936
+ // Or if the entire table (including header) is selected
68937
+ const isHeaderSelected = selectedRows.some((row) => row >= top && row <= headerRowEnd);
68938
+ if (!isHeaderSelected) {
68939
+ return true;
68940
+ }
68941
+ const isWholeTableSelected = range(top, bottom + 1).every((r) => selectedRowSet.has(r));
68942
+ return isWholeTableSelected;
68943
+ });
68944
+ }
68916
68945
  fallbackToVisibleSheet() {
68917
68946
  if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
68918
68947
  const currentSheetIds = this.getters.getVisibleSheetIds();
@@ -77257,6 +77286,6 @@ exports.tokenColors = tokenColors;
77257
77286
  exports.tokenize = tokenize;
77258
77287
 
77259
77288
 
77260
- __info__.version = "18.2.25";
77261
- __info__.date = "2025-08-18T08:16:31.368Z";
77262
- __info__.hash = "6b63aad";
77289
+ __info__.version = "18.2.26";
77290
+ __info__.date = "2025-08-21T06:39:39.007Z";
77291
+ __info__.hash = "d23c340";
@@ -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.25
6
- * @date 2025-08-18T08:16:31.368Z
7
- * @hash 6b63aad
5
+ * @version 18.2.26
6
+ * @date 2025-08-21T06:39:39.007Z
7
+ * @hash d23c340
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";
@@ -28680,6 +28681,7 @@ const CustomCurrencyTerms = {
28680
28681
  Custom: _t("Custom"),
28681
28682
  };
28682
28683
  const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerge those cells and try again.");
28684
+ const TableHeaderMoveErrorMessage = _t("The header row of a table can't be moved.");
28683
28685
  const SplitToColumnsTerms = {
28684
28686
  Errors: {
28685
28687
  Unexpected: _t("Cannot split the selection for an unknown reason"),
@@ -31903,9 +31905,6 @@ class RadarChart extends AbstractChart {
31903
31905
  };
31904
31906
  }
31905
31907
  getDefinitionForExcel() {
31906
- if (this.aggregated) {
31907
- return undefined;
31908
- }
31909
31908
  const dataSets = this.dataSets
31910
31909
  .map((ds) => toExcelDataset(this.getters, ds))
31911
31910
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -51748,8 +51747,13 @@ class RowResizer extends AbstractResizer {
51748
51747
  elements,
51749
51748
  position: this.state.position,
51750
51749
  });
51751
- if (!result.isSuccessful && result.reasons.includes("WillRemoveExistingMerge" /* CommandResult.WillRemoveExistingMerge */)) {
51752
- this.env.raiseError(MergeErrorMessage);
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
+ }
51753
51757
  }
51754
51758
  }
51755
51759
  _selectElement(index, addDistinctHeader) {
@@ -63745,7 +63749,7 @@ function withPivotPresentationLayer (PivotClass) {
63745
63749
  return PivotPresentationLayer;
63746
63750
  }
63747
63751
 
63748
- const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT"];
63752
+ const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT", "REMOVE_PIVOT"];
63749
63753
  function isPivotCommand(cmd) {
63750
63754
  return UNDO_REDO_PIVOT_COMMANDS.includes(cmd.type);
63751
63755
  }
@@ -68909,8 +68913,33 @@ class GridSelectionPlugin extends UIPlugin {
68909
68913
  if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
68910
68914
  return "InvalidHeaderIndex" /* CommandResult.InvalidHeaderIndex */;
68911
68915
  }
68916
+ if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) {
68917
+ return "CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */;
68918
+ }
68912
68919
  return "Success" /* CommandResult.Success */;
68913
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
+ }
68914
68943
  fallbackToVisibleSheet() {
68915
68944
  if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
68916
68945
  const currentSheetIds = this.getters.getVisibleSheetIds();
@@ -77210,6 +77239,6 @@ const chartHelpers = { ...CHART_HELPERS, ...CHART_RUNTIME_HELPERS };
77210
77239
  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
77240
 
77212
77241
 
77213
- __info__.version = "18.2.25";
77214
- __info__.date = "2025-08-18T08:16:31.368Z";
77215
- __info__.hash = "6b63aad";
77242
+ __info__.version = "18.2.26";
77243
+ __info__.date = "2025-08-21T06:39:39.007Z";
77244
+ __info__.hash = "d23c340";
@@ -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.25
6
- * @date 2025-08-18T08:16:31.368Z
7
- * @hash 6b63aad
5
+ * @version 18.2.26
6
+ * @date 2025-08-21T06:39:39.007Z
7
+ * @hash d23c340
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";
@@ -28681,6 +28682,7 @@ stores.inject(MyMetaStore, storeInstance);
28681
28682
  Custom: _t("Custom"),
28682
28683
  };
28683
28684
  const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerge those cells and try again.");
28685
+ const TableHeaderMoveErrorMessage = _t("The header row of a table can't be moved.");
28684
28686
  const SplitToColumnsTerms = {
28685
28687
  Errors: {
28686
28688
  Unexpected: _t("Cannot split the selection for an unknown reason"),
@@ -31904,9 +31906,6 @@ stores.inject(MyMetaStore, storeInstance);
31904
31906
  };
31905
31907
  }
31906
31908
  getDefinitionForExcel() {
31907
- if (this.aggregated) {
31908
- return undefined;
31909
- }
31910
31909
  const dataSets = this.dataSets
31911
31910
  .map((ds) => toExcelDataset(this.getters, ds))
31912
31911
  .filter((ds) => ds.range !== "" && ds.range !== CellErrorType.InvalidReference);
@@ -51749,8 +51748,13 @@ stores.inject(MyMetaStore, storeInstance);
51749
51748
  elements,
51750
51749
  position: this.state.position,
51751
51750
  });
51752
- if (!result.isSuccessful && result.reasons.includes("WillRemoveExistingMerge" /* CommandResult.WillRemoveExistingMerge */)) {
51753
- this.env.raiseError(MergeErrorMessage);
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
+ }
51754
51758
  }
51755
51759
  }
51756
51760
  _selectElement(index, addDistinctHeader) {
@@ -63746,7 +63750,7 @@ stores.inject(MyMetaStore, storeInstance);
63746
63750
  return PivotPresentationLayer;
63747
63751
  }
63748
63752
 
63749
- const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT"];
63753
+ const UNDO_REDO_PIVOT_COMMANDS = ["ADD_PIVOT", "UPDATE_PIVOT", "REMOVE_PIVOT"];
63750
63754
  function isPivotCommand(cmd) {
63751
63755
  return UNDO_REDO_PIVOT_COMMANDS.includes(cmd.type);
63752
63756
  }
@@ -68910,8 +68914,33 @@ stores.inject(MyMetaStore, storeInstance);
68910
68914
  if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
68911
68915
  return "InvalidHeaderIndex" /* CommandResult.InvalidHeaderIndex */;
68912
68916
  }
68917
+ if (!isCol && !this.isTableRowMoveAllowed(id, cmd.elements)) {
68918
+ return "CannotMoveTableHeader" /* CommandResult.CannotMoveTableHeader */;
68919
+ }
68913
68920
  return "Success" /* CommandResult.Success */;
68914
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
+ }
68915
68944
  fallbackToVisibleSheet() {
68916
68945
  if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
68917
68946
  const currentSheetIds = this.getters.getVisibleSheetIds();
@@ -77256,9 +77285,9 @@ stores.inject(MyMetaStore, storeInstance);
77256
77285
  exports.tokenize = tokenize;
77257
77286
 
77258
77287
 
77259
- __info__.version = "18.2.25";
77260
- __info__.date = "2025-08-18T08:16:31.368Z";
77261
- __info__.hash = "6b63aad";
77288
+ __info__.version = "18.2.26";
77289
+ __info__.date = "2025-08-21T06:39:39.007Z";
77290
+ __info__.hash = "d23c340";
77262
77291
 
77263
77292
 
77264
77293
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);