@odoo/o-spreadsheet 17.1.5 → 17.1.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.
@@ -3533,6 +3533,7 @@ declare class FigurePlugin extends CorePlugin<FigureState> implements FigureStat
3533
3533
  [sheet: string]: Record<UID, Figure | undefined> | undefined;
3534
3534
  };
3535
3535
  allowDispatch(cmd: CoreCommand): CommandResult;
3536
+ beforeHandle(cmd: CoreCommand): void;
3536
3537
  handle(cmd: CoreCommand): void;
3537
3538
  private onRowColDelete;
3538
3539
  private onRowDeletion;
@@ -3854,7 +3855,7 @@ interface SheetState {
3854
3855
  readonly cellPosition: Record<UID, CellPosition | undefined>;
3855
3856
  }
3856
3857
  declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
3857
- static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "doesHeadersExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "isEmpty", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones", "getUnboundedZone", "checkElementsIncludeAllNonFrozenHeaders"];
3858
+ static getters: readonly ["getSheetName", "tryGetSheetName", "getSheet", "tryGetSheet", "getSheetIdByName", "getSheetIds", "getVisibleSheetIds", "isSheetVisible", "getEvaluationSheets", "doesHeaderExist", "doesHeadersExist", "getCell", "getCellPosition", "getColsZone", "getRowCells", "getRowsZone", "getNumberCols", "getNumberRows", "getNumberHeaders", "getGridLinesVisibility", "getNextSheetName", "getSheetSize", "getSheetZone", "getPaneDivisions", "checkZonesExistInSheet", "getCommandZones", "getUnboundedZone", "checkElementsIncludeAllNonFrozenHeaders"];
3858
3859
  readonly sheetIdsMapName: Record<string, UID | undefined>;
3859
3860
  readonly orderedSheetIds: UID[];
3860
3861
  readonly sheets: Record<UID, Sheet | undefined>;
@@ -3903,10 +3904,6 @@ declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
3903
3904
  * This validation ensures that all rows or columns cannot be deleted when frozen panes exist.
3904
3905
  */
3905
3906
  checkElementsIncludeAllNonFrozenHeaders(sheetId: UID, dimension: Dimension, elements: HeaderIndex[]): boolean;
3906
- /**
3907
- * Check if a zone only contains empty cells
3908
- */
3909
- isEmpty(sheetId: UID, zone: Zone): boolean;
3910
3907
  getCommandZones(cmd: Command): Zone[];
3911
3908
  /**
3912
3909
  * Check if zones in the command are well formed and
@@ -4001,7 +3998,7 @@ declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
4001
3998
  }
4002
3999
 
4003
4000
  declare class EvaluationPlugin extends UIPlugin {
4004
- static getters: readonly ["evaluateFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone", "getSpreadPositionsOf", "getArrayFormulaSpreadingOn"];
4001
+ static getters: readonly ["evaluateFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone", "getSpreadPositionsOf", "getArrayFormulaSpreadingOn", "isEmpty"];
4005
4002
  private shouldRebuildDependenciesGraph;
4006
4003
  private evaluator;
4007
4004
  private positionsToUpdate;
@@ -4027,6 +4024,10 @@ declare class EvaluationPlugin extends UIPlugin {
4027
4024
  getEvaluatedCellsInZone(sheetId: UID, zone: Zone): EvaluatedCell[];
4028
4025
  getSpreadPositionsOf(position: CellPosition): CellPosition[];
4029
4026
  getArrayFormulaSpreadingOn(position: CellPosition): CellPosition | undefined;
4027
+ /**
4028
+ * Check if a zone only contains empty cells
4029
+ */
4030
+ isEmpty(sheetId: UID, zone: Zone): boolean;
4030
4031
  exportForExcel(data: ExcelWorkbookData): void;
4031
4032
  /**
4032
4033
  * Returns the corresponding formula cell of a given cell
@@ -4126,7 +4127,7 @@ type SheetValidationResult = {
4126
4127
  [col: HeaderIndex]: Array<Lazy<ValidationResult>>;
4127
4128
  };
4128
4129
  declare class EvaluationDataValidationPlugin extends UIPlugin {
4129
- static getters: readonly ["getDataValidationInvalidCriterionValueMessage", "getDataValidationCheckBoxCellPositions", "getDataValidationListCellsPositions", "getInvalidDataValidationMessage", "getValidationResultForCellValue", "isCellValidCheckbox", "isDataValidationInvalid"];
4130
+ static getters: readonly ["getDataValidationInvalidCriterionValueMessage", "getInvalidDataValidationMessage", "getValidationResultForCellValue", "isCellValidCheckbox", "isDataValidationInvalid"];
4130
4131
  validationResults: Record<UID, SheetValidationResult>;
4131
4132
  handle(cmd: CoreViewCommand): void;
4132
4133
  isDataValidationInvalid(cellPosition: CellPosition): boolean;
@@ -4140,8 +4141,6 @@ declare class EvaluationDataValidationPlugin extends UIPlugin {
4140
4141
  isCellValidCheckbox(cellPosition: CellPosition): boolean;
4141
4142
  /** Get the validation result if the cell on the given position had the given value */
4142
4143
  getValidationResultForCellValue(cellValue: CellValue, cellPosition: CellPosition): ValidationResult;
4143
- getDataValidationCheckBoxCellPositions(): CellPosition[];
4144
- getDataValidationListCellsPositions(): CellPosition[];
4145
4144
  private getValidationResultForCell;
4146
4145
  private computeSheetValidationResults;
4147
4146
  private getRuleErrorForCellValue;
@@ -5029,7 +5028,7 @@ type SheetViewports = {
5029
5028
  *
5030
5029
  */
5031
5030
  declare class SheetViewPlugin extends UIPlugin {
5032
- static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
5031
+ static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getVisibleRectWithoutHeaders", "getVisibleCellPositions", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible"];
5033
5032
  readonly viewports: Record<UID, SheetViewports | undefined>;
5034
5033
  /**
5035
5034
  * The viewport dimensions are usually set by one of the components
@@ -5076,6 +5075,10 @@ declare class SheetViewPlugin extends UIPlugin {
5076
5075
  getActiveSheetDOMScrollInfo(): SheetDOMScrollInfo;
5077
5076
  getSheetViewVisibleCols(): HeaderIndex[];
5078
5077
  getSheetViewVisibleRows(): HeaderIndex[];
5078
+ /**
5079
+ * Get the positions of all the cells that are visible in the viewport, taking merges into account.
5080
+ */
5081
+ getVisibleCellPositions(): CellPosition[];
5079
5082
  /**
5080
5083
  * Return the main viewport maximum size relative to the client size.
5081
5084
  */
@@ -5092,6 +5095,10 @@ declare class SheetViewPlugin extends UIPlugin {
5092
5095
  * Computes the coordinates and size to draw the zone on the canvas
5093
5096
  */
5094
5097
  getVisibleRect(zone: Zone): Rect;
5098
+ /**
5099
+ * Computes the coordinates and size to draw the zone without taking the grid offset into account
5100
+ */
5101
+ getVisibleRectWithoutHeaders(zone: Zone): Rect;
5095
5102
  /**
5096
5103
  * Returns the position of the MainViewport relatively to the start of the grid (without headers)
5097
5104
  * It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)