@odoo/o-spreadsheet 16.0.24 → 16.0.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.
@@ -1146,7 +1146,7 @@ declare class StateObserver {
1146
1146
  commands: CoreCommand[];
1147
1147
  };
1148
1148
  addCommand(command: CoreCommand): void;
1149
- addChange(...args: any[]): void;
1149
+ addChange(...args: [...HistoryChange["path"], any]): void;
1150
1150
  }
1151
1151
 
1152
1152
  interface Validator {
@@ -1562,6 +1562,7 @@ interface MoveColumnsRowsCommand extends GridDependentCommand {
1562
1562
  type: "MOVE_COLUMNS_ROWS";
1563
1563
  base: HeaderIndex;
1564
1564
  elements: HeaderIndex[];
1565
+ position: "before" | "after";
1565
1566
  }
1566
1567
  interface ResizeColumnsRowsCommand extends GridDependentCommand {
1567
1568
  type: "RESIZE_COLUMNS_ROWS";
@@ -2182,7 +2183,8 @@ declare const enum CommandResult {
2182
2183
  DuplicatedChartId = 83,
2183
2184
  ChartDoesNotExist = 84,
2184
2185
  InvalidHeaderIndex = 85,
2185
- InvalidQuantity = 86
2186
+ InvalidQuantity = 86,
2187
+ NoChanges = 87
2186
2188
  }
2187
2189
  interface CommandHandler<T> {
2188
2190
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -2946,7 +2948,8 @@ interface BordersPluginState {
2946
2948
  declare class BordersPlugin extends CorePlugin<BordersPluginState> implements BordersPluginState {
2947
2949
  static getters: readonly ["getCellBorder"];
2948
2950
  readonly borders: BordersPluginState["borders"];
2949
- handle(cmd: Command): void;
2951
+ allowDispatch(cmd: CoreCommand): CommandResult.Success | CommandResult.NoChanges;
2952
+ handle(cmd: CoreCommand): void;
2950
2953
  /**
2951
2954
  * Move borders according to the inserted columns.
2952
2955
  * Ensure borders continuity.
@@ -3043,6 +3046,7 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
3043
3046
  * Compute the borders to add to the given zone merged.
3044
3047
  */
3045
3048
  private addBordersToMerge;
3049
+ private checkBordersUnchanged;
3046
3050
  import(data: WorkbookData): void;
3047
3051
  export(data: WorkbookData): void;
3048
3052
  exportForExcel(data: ExcelWorkbookData): void;
@@ -3050,6 +3054,7 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
3050
3054
 
3051
3055
  interface CoreState {
3052
3056
  cells: Record<UID, Record<UID, Cell | undefined>>;
3057
+ nextId: number;
3053
3058
  }
3054
3059
  /**
3055
3060
  * Core Plugin
@@ -3059,6 +3064,7 @@ interface CoreState {
3059
3064
  */
3060
3065
  declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3061
3066
  static getters: readonly ["zoneToXC", "getCells", "getFormulaCellContent", "getCellStyle", "buildFormulaContent", "getCellById"];
3067
+ readonly nextId = 1;
3062
3068
  readonly cells: {
3063
3069
  [sheetId: string]: {
3064
3070
  [id: string]: Cell;
@@ -3066,7 +3072,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3066
3072
  };
3067
3073
  private createCell;
3068
3074
  adaptRanges(applyChange: ApplyRangeChange, sheetId?: UID): void;
3069
- allowDispatch(cmd: CoreCommand): CommandResult;
3075
+ allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
3070
3076
  handle(cmd: CoreCommand): void;
3071
3077
  /**
3072
3078
  * Set a format to all the cells in a zone
@@ -3127,8 +3133,10 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3127
3133
  * gets the currently used style/border of a cell based on it's coordinates
3128
3134
  */
3129
3135
  private getFormat;
3136
+ private getNextUid;
3130
3137
  private updateCell;
3131
3138
  private checkCellOutOfSheet;
3139
+ private checkUselessClearCell;
3132
3140
  }
3133
3141
 
3134
3142
  /**
@@ -3615,15 +3623,6 @@ declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
3615
3623
  */
3616
3624
  private moveCellOnRowsDeletion;
3617
3625
  private updateRowsStructureOnDeletion;
3618
- /**
3619
- * Update the rows of the sheet after an addition:
3620
- * - Rename the rows
3621
- *
3622
- * @param sheet Sheet on which the deletion occurs
3623
- * @param addedRow Index of the added row
3624
- * @param rowsToAdd Number of the rows to add
3625
- */
3626
- private updateRowsStructureOnAddition;
3627
3626
  /**
3628
3627
  * Add empty rows at the end of the rows
3629
3628
  *
@@ -3873,7 +3872,7 @@ declare class EvaluationPlugin extends UIPlugin {
3873
3872
  constructor(getters: Getters, state: StateObserver, dispatch: CommandDispatcher["dispatch"], config: ModelConfig, selection: SelectionStreamProcessor);
3874
3873
  handle(cmd: Command): void;
3875
3874
  finalize(): void;
3876
- evaluateFormula(formulaString: string, sheetId?: UID): any;
3875
+ evaluateFormula(formulaString: string, sheetId?: UID): FunctionReturnValue | null;
3877
3876
  /**
3878
3877
  * Return the value of each cell in the range as they are displayed in the grid.
3879
3878
  */
@@ -4659,8 +4658,7 @@ type Getters = {
4659
4658
  } & LocalHistoryGetters & CoreGetters & SessionGetters & AutofillGetters & AutomaticSumGetters & ClipboardGetters & EditionGetters & EvaluationGetters & EvaluationChartGetters & EvaluationConditionalFormatGetters & FindAndReplaceGetters & HighlightGetters & CustomColorsGetters & RendererGetters & SelectionGetters & SelectionInputGetters & SelectionMultiUserGetters & SortGetters & UIOptionsGetters & SheetUIGetters & ViewportGetters & CellPopoverPluginGetters & FilterEvaluationGetters & HeaderVisibilityIUIGetters;
4660
4659
 
4661
4660
  interface HistoryChange {
4662
- root: any;
4663
- path: (string | number)[];
4661
+ path: [any, ...(number | string)[]];
4664
4662
  before: any;
4665
4663
  after: any;
4666
4664
  }
@@ -5761,8 +5759,8 @@ interface Props$d {
5761
5759
  onCellHovered: (position: Partial<Position$1>) => void;
5762
5760
  onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
5763
5761
  onCellClicked: (col: HeaderIndex, row: HeaderIndex, modifiers: {
5764
- ctrlKey: boolean;
5765
- shiftKey: boolean;
5762
+ addZone: boolean;
5763
+ expandZone: boolean;
5766
5764
  }) => void;
5767
5765
  onCellRightClicked: (col: HeaderIndex, row: HeaderIndex, coordinates: DOMCoordinates) => void;
5768
5766
  onGridResized: (dimension: DOMDimension) => void;
@@ -5821,6 +5819,7 @@ interface ResizerState {
5821
5819
  draggerShadowThickness: number;
5822
5820
  delta: number;
5823
5821
  base: number;
5822
+ position: "before" | "after";
5824
5823
  }
5825
5824
  interface ResizerProps {
5826
5825
  onOpenContextMenu: (type: ContextMenuType, x: Pixel, y: Pixel) => void;
@@ -5843,7 +5842,7 @@ declare abstract class AbstractResizer extends Component<ResizerProps, Spreadshe
5843
5842
  abstract _getMaxSize(): Pixel;
5844
5843
  abstract _updateSize(): void;
5845
5844
  abstract _moveElements(): void;
5846
- abstract _selectElement(index: HeaderIndex, ctrlKey: boolean): void;
5845
+ abstract _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
5847
5846
  abstract _increaseSelection(index: HeaderIndex): void;
5848
5847
  abstract _fitElementSize(index: HeaderIndex): void;
5849
5848
  abstract _getType(): ContextMenuType;
@@ -5877,7 +5876,7 @@ declare class ColResizer extends AbstractResizer {
5877
5876
  _getMaxSize(): Pixel;
5878
5877
  _updateSize(): void;
5879
5878
  _moveElements(): void;
5880
- _selectElement(index: HeaderIndex, ctrlKey: boolean): void;
5879
+ _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
5881
5880
  _increaseSelection(index: HeaderIndex): void;
5882
5881
  _fitElementSize(index: HeaderIndex): void;
5883
5882
  _getType(): ContextMenuType;
@@ -5902,7 +5901,7 @@ declare class RowResizer extends AbstractResizer {
5902
5901
  _getMaxSize(): Pixel;
5903
5902
  _updateSize(): void;
5904
5903
  _moveElements(): void;
5905
- _selectElement(index: HeaderIndex, ctrlKey: boolean): void;
5904
+ _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
5906
5905
  _increaseSelection(index: HeaderIndex): void;
5907
5906
  _fitElementSize(index: HeaderIndex): void;
5908
5907
  _getType(): ContextMenuType;
@@ -6106,9 +6105,9 @@ declare class Grid extends Component<Props$5, SpreadsheetChildEnv> {
6106
6105
  private moveCanvas;
6107
6106
  getClientPositionKey(client: Client): string;
6108
6107
  isCellHovered(col: HeaderIndex, row: HeaderIndex): boolean;
6109
- onCellClicked(col: HeaderIndex, row: HeaderIndex, { ctrlKey, shiftKey }: {
6110
- ctrlKey: boolean;
6111
- shiftKey: boolean;
6108
+ onCellClicked(col: HeaderIndex, row: HeaderIndex, { addZone, expandZone }: {
6109
+ addZone: boolean;
6110
+ expandZone: boolean;
6112
6111
  }): void;
6113
6112
  onCellDoubleClicked(col: HeaderIndex, row: HeaderIndex): void;
6114
6113
  closeOpenedPopover(): void;