@odoo/o-spreadsheet 16.4.14 → 16.4.16

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.
@@ -1287,7 +1287,7 @@ declare class StateObserver {
1287
1287
  commands: CoreCommand[];
1288
1288
  };
1289
1289
  addCommand(command: CoreCommand): void;
1290
- addChange(...args: any[]): void;
1290
+ addChange(...args: [...HistoryChange["path"], any]): void;
1291
1291
  }
1292
1292
 
1293
1293
  interface Validator {
@@ -1715,6 +1715,7 @@ interface MoveColumnsRowsCommand extends GridDependentCommand {
1715
1715
  type: "MOVE_COLUMNS_ROWS";
1716
1716
  base: HeaderIndex;
1717
1717
  elements: HeaderIndex[];
1718
+ position: "before" | "after";
1718
1719
  }
1719
1720
  interface ResizeColumnsRowsCommand extends GridDependentCommand {
1720
1721
  type: "RESIZE_COLUMNS_ROWS";
@@ -2382,7 +2383,8 @@ declare const enum CommandResult {
2382
2383
  NoSplitSeparatorInSelection = 93,
2383
2384
  NoActiveSheet = 94,
2384
2385
  InvalidLocale = 95,
2385
- AlreadyInPaintingFormatMode = 96
2386
+ AlreadyInPaintingFormatMode = 96,
2387
+ NoChanges = 97
2386
2388
  }
2387
2389
  interface CommandHandler<T> {
2388
2390
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -3016,7 +3018,8 @@ interface BordersPluginState {
3016
3018
  declare class BordersPlugin extends CorePlugin<BordersPluginState> implements BordersPluginState {
3017
3019
  static getters: readonly ["getCellBorder", "getBordersColors"];
3018
3020
  readonly borders: BordersPluginState["borders"];
3019
- handle(cmd: Command): void;
3021
+ allowDispatch(cmd: CoreCommand): CommandResult.Success | CommandResult.NoChanges;
3022
+ handle(cmd: CoreCommand): void;
3020
3023
  /**
3021
3024
  * Move borders according to the inserted columns.
3022
3025
  * Ensure borders continuity.
@@ -3114,6 +3117,7 @@ declare class BordersPlugin extends CorePlugin<BordersPluginState> implements Bo
3114
3117
  * Compute the borders to add to the given zone merged.
3115
3118
  */
3116
3119
  private addBordersToMerge;
3120
+ private checkBordersUnchanged;
3117
3121
  import(data: WorkbookData): void;
3118
3122
  export(data: WorkbookData): void;
3119
3123
  exportForExcel(data: ExcelWorkbookData): void;
@@ -3138,7 +3142,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3138
3142
  };
3139
3143
  };
3140
3144
  adaptRanges(applyChange: ApplyRangeChange, sheetId?: UID): void;
3141
- allowDispatch(cmd: CoreCommand): CommandResult;
3145
+ allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
3142
3146
  handle(cmd: CoreCommand): void;
3143
3147
  /**
3144
3148
  * Set a format to all the cells in a zone
@@ -3211,6 +3215,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3211
3215
  private createFormulaCellWithDependencies;
3212
3216
  private createErrorFormula;
3213
3217
  private checkCellOutOfSheet;
3218
+ private checkUselessClearCell;
3214
3219
  }
3215
3220
 
3216
3221
  /**
@@ -3730,15 +3735,6 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
3730
3735
  */
3731
3736
  private moveCellOnRowsDeletion;
3732
3737
  private updateRowsStructureOnDeletion;
3733
- /**
3734
- * Update the rows of the sheet after an addition:
3735
- * - Rename the rows
3736
- *
3737
- * @param sheet Sheet on which the deletion occurs
3738
- * @param addedRow Index of the added row
3739
- * @param rowsToAdd Number of the rows to add
3740
- */
3741
- private updateRowsStructureOnAddition;
3742
3738
  /**
3743
3739
  * Add empty rows at the end of the rows
3744
3740
  *
@@ -3760,11 +3756,9 @@ declare class SheetPlugin extends CorePlugin<SheetState$1> implements SheetState
3760
3756
  }
3761
3757
 
3762
3758
  declare class EvaluationPlugin extends UIPlugin {
3763
- private config;
3764
3759
  static getters: readonly ["evaluateFormula", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone"];
3765
3760
  private shouldRebuildDependenciesGraph;
3766
3761
  private evaluator;
3767
- private compilationParams;
3768
3762
  private positionsToUpdate;
3769
3763
  constructor(config: UIPluginConfig);
3770
3764
  beforeHandle(cmd: Command): void;
@@ -3793,7 +3787,6 @@ declare class EvaluationPlugin extends UIPlugin {
3793
3787
  * formula of the array formula that spreads to the cell
3794
3788
  */
3795
3789
  private getCorrespondingFormulaCell;
3796
- private getCompilationParameters;
3797
3790
  }
3798
3791
 
3799
3792
  interface CustomColorState {
@@ -3818,25 +3811,23 @@ declare class CustomColorsPlugin extends UIPlugin<CustomColorState> {
3818
3811
  private tryToAddColor;
3819
3812
  }
3820
3813
 
3814
+ interface EvaluationChartStyle {
3815
+ background: Color;
3816
+ fontColor: Color;
3817
+ }
3821
3818
  interface EvaluationChartState {
3822
3819
  charts: Record<UID, ChartRuntime | undefined>;
3823
3820
  }
3824
3821
  declare class EvaluationChartPlugin extends UIPlugin<EvaluationChartState> {
3825
- static getters: readonly ["getChartRuntime", "getBackgroundOfSingleCellChart"];
3822
+ static getters: readonly ["getChartRuntime", "getStyleOfSingleCellChart"];
3826
3823
  charts: Record<UID, ChartRuntime | undefined>;
3827
3824
  private createRuntimeChart;
3828
3825
  handle(cmd: CoreViewCommand): void;
3829
3826
  getChartRuntime(figureId: UID): ChartRuntime;
3830
3827
  /**
3831
- * Get the background color of a chart based on the color of the first cell of the main range
3832
- * of the chart. In order of priority, it will return :
3833
- *
3834
- * - the chart background color if one is defined
3835
- * - the fill color of the cell if one is defined
3836
- * - the fill color of the cell from conditional formats if one is defined
3837
- * - the default chart color if no other color is defined
3828
+ * Get the background and textColor of a chart based on the color of the first cell of the main range of the chart.
3838
3829
  */
3839
- getBackgroundOfSingleCellChart(chartBackground: Color | undefined, mainRange: Range | undefined): Color;
3830
+ getStyleOfSingleCellChart(chartBackground: Color | undefined, mainRange: Range | undefined): EvaluationChartStyle;
3840
3831
  }
3841
3832
 
3842
3833
  declare class EvaluationConditionalFormatPlugin extends UIPlugin {
@@ -4890,8 +4881,7 @@ type Getters = {
4890
4881
  } & LocalHistoryGetters & CoreGetters & AutofillGetters & AutomaticSumGetters & ClipboardGetters & EditionGetters & EvaluationGetters & EvaluationChartGetters & EvaluationConditionalFormatGetters & FindAndReplaceGetters & HighlightGetters & CustomColorsGetters & RendererGetters & SelectionGetters & SelectionInputGetters & CollaborativeGetters & SortGetters & UIOptionsGetters & SheetUIGetters & ViewportGetters & CellPopoverPluginGetters & FilterEvaluationGetters & HeaderVisibilityIUIGetters & SplitToColumnsGetters & UIRowSizeGetters;
4891
4882
 
4892
4883
  interface HistoryChange {
4893
- root: any;
4894
- path: (string | number)[];
4884
+ path: [any, ...(number | string)[]];
4895
4885
  before: any;
4896
4886
  after: any;
4897
4887
  }
@@ -6941,6 +6931,7 @@ interface ResizerState {
6941
6931
  draggerShadowThickness: number;
6942
6932
  delta: number;
6943
6933
  base: number;
6934
+ position: "before" | "after";
6944
6935
  }
6945
6936
  interface ResizerProps {
6946
6937
  onOpenContextMenu: (type: ContextMenuType, x: Pixel, y: Pixel) => void;