@odoo/o-spreadsheet 18.2.0-alpha.1 → 18.2.0-alpha.3

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.
@@ -2111,10 +2111,16 @@ declare class InternalViewport {
2111
2111
  adjustViewportZone(): void;
2112
2112
  /**
2113
2113
  *
2114
- * @param zone
2115
- * @returns Computes the absolute coordinate of a given zone inside the viewport
2114
+ * Computes the visible coordinates & dimensions of a given zone inside the viewport
2115
+ *
2116
+ */
2117
+ getVisibleRect(zone: Zone): Rect | undefined;
2118
+ /**
2119
+ *
2120
+ * @returns Computes the absolute coordinates & dimensions of a given zone inside the viewport
2121
+ *
2116
2122
  */
2117
- getRect(zone: Zone): Rect | undefined;
2123
+ getFullRect(zone: Zone): Rect | undefined;
2118
2124
  isVisible(col: HeaderIndex, row: HeaderIndex): boolean;
2119
2125
  private searchHeaderIndex;
2120
2126
  private setViewportOffsetX;
@@ -2183,7 +2189,7 @@ type SheetViewports = {
2183
2189
  *
2184
2190
  */
2185
2191
  declare class SheetViewPlugin extends UIPlugin {
2186
- static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getVisibleRectWithoutHeaders", "getVisibleCellPositions", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible", "getColDimensionsInViewport", "getRowDimensionsInViewport"];
2192
+ static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getVisibleRectWithoutHeaders", "getVisibleCellPositions", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getActiveSheetDOMScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPositionVisible", "getColDimensionsInViewport", "getRowDimensionsInViewport", "getAllActiveViewportsZones", "getRect"];
2187
2193
  readonly viewports: Record<UID, SheetViewports | undefined>;
2188
2194
  /**
2189
2195
  * The viewport dimensions are usually set by one of the components
@@ -2254,6 +2260,11 @@ declare class SheetViewPlugin extends UIPlugin {
2254
2260
  * Computes the coordinates and size to draw the zone without taking the grid offset into account
2255
2261
  */
2256
2262
  getVisibleRectWithoutHeaders(zone: Zone): Rect;
2263
+ /**
2264
+ * Computes the actual size and position (:Rect) of the zone on the canvas
2265
+ * regardless of the viewport dimensions.
2266
+ */
2267
+ getRect(zone: Zone): Rect;
2257
2268
  /**
2258
2269
  * Returns the position of the MainViewport relatively to the start of the grid (without headers)
2259
2270
  * It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)
@@ -2270,6 +2281,7 @@ declare class SheetViewPlugin extends UIPlugin {
2270
2281
  * of the current viewport
2271
2282
  */
2272
2283
  getRowDimensionsInViewport(sheetId: UID, row: HeaderIndex): HeaderDimensions;
2284
+ getAllActiveViewportsZones(): Zone[];
2273
2285
  private ensureMainViewportExist;
2274
2286
  private getSubViewports;
2275
2287
  private checkPositiveDimension;
@@ -2301,6 +2313,7 @@ declare class SheetViewPlugin extends UIPlugin {
2301
2313
  xRatio: number;
2302
2314
  yRatio: number;
2303
2315
  };
2316
+ private recomposeRect;
2304
2317
  }
2305
2318
 
2306
2319
  declare enum ClipboardMIMEType {
@@ -4019,10 +4032,10 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
4019
4032
  * @param range the range (received from getRangeFromXC or getRangeFromZone)
4020
4033
  * @param forSheetId the id of the sheet where the range string is supposed to be used.
4021
4034
  * @param options
4022
- * @param options.useFixedReference if true, the range will be returned with fixed row and column
4035
+ * @param options.useBoundedReference if true, the range will be returned with fixed row and column
4023
4036
  */
4024
4037
  getRangeString(range: Range, forSheetId: UID, options?: {
4025
- useFixedReference: boolean;
4038
+ useBoundedReference: boolean;
4026
4039
  }): string;
4027
4040
  getRangeDataFromXc(sheetId: UID, xc: string): RangeData;
4028
4041
  getRangeDataFromZone(sheetId: UID, zone: Zone | UnboundedZone): RangeData;
@@ -4259,7 +4272,7 @@ declare class CellPlugin extends CorePlugin<CoreState$1> implements CoreState$1
4259
4272
  * starting an async evaluation even if it has been moved or re-allocated
4260
4273
  */
4261
4274
  getCellById(cellId: UID): Cell | undefined;
4262
- getFormulaString(sheetId: UID, tokens: Token[], dependencies: Range[], useFixedReference?: boolean): string;
4275
+ getFormulaString(sheetId: UID, tokens: Token[], dependencies: Range[], useBoundedReference?: boolean): string;
4263
4276
  getTranslatedCellFormula(sheetId: UID, offsetX: number, offsetY: number, tokens: Token[]): string;
4264
4277
  getFormulaMovedInSheet(originSheetId: UID, targetSheetId: UID, tokens: Token[]): string;
4265
4278
  getCellStyle(position: CellPosition): Style;
@@ -6807,8 +6820,8 @@ interface RangeInputValue {
6807
6820
  declare class SelectionInputStore extends SpreadsheetStore {
6808
6821
  private initialRanges;
6809
6822
  private readonly inputHasSingleRange;
6810
- private readonly colors;
6811
- mutators: readonly ["resetWithRanges", "focusById", "unfocus", "addEmptyRange", "removeRange", "changeRange", "reset", "confirm"];
6823
+ colors: Color[];
6824
+ mutators: readonly ["resetWithRanges", "focusById", "unfocus", "addEmptyRange", "removeRange", "changeRange", "reset", "confirm", "updateColors"];
6812
6825
  ranges: RangeInputValue[];
6813
6826
  focusedRangeIndex: number | null;
6814
6827
  private inputSheetId;
@@ -6826,6 +6839,7 @@ declare class SelectionInputStore extends SpreadsheetStore {
6826
6839
  changeRange(rangeId: number, value: string): void;
6827
6840
  addEmptyRange(): void;
6828
6841
  removeRange(rangeId: number): void;
6842
+ updateColors(colors: Color[]): void;
6829
6843
  confirm(): void;
6830
6844
  reset(): void;
6831
6845
  get selectionInputValues(): string[];
@@ -6892,6 +6906,8 @@ interface Props$1a {
6892
6906
  isInvalid?: boolean;
6893
6907
  class?: string;
6894
6908
  onSelectionChanged?: (ranges: string[]) => void;
6909
+ onSelectionReordered?: (indexes: number[]) => void;
6910
+ onSelectionRemoved?: (index: number) => void;
6895
6911
  onSelectionConfirmed?: () => void;
6896
6912
  colors?: Color[];
6897
6913
  }
@@ -6936,6 +6952,14 @@ declare class SelectionInput extends Component<Props$1a, SpreadsheetChildEnv> {
6936
6952
  type: FunctionConstructor;
6937
6953
  optional: boolean;
6938
6954
  };
6955
+ onSelectionReordered: {
6956
+ type: FunctionConstructor;
6957
+ optional: boolean;
6958
+ };
6959
+ onSelectionRemoved: {
6960
+ type: FunctionConstructor;
6961
+ optional: boolean;
6962
+ };
6939
6963
  colors: {
6940
6964
  type: ArrayConstructor;
6941
6965
  optional: boolean;
@@ -6943,7 +6967,9 @@ declare class SelectionInput extends Component<Props$1a, SpreadsheetChildEnv> {
6943
6967
  };
6944
6968
  };
6945
6969
  private state;
6970
+ private dragAndDrop;
6946
6971
  private focusedInput;
6972
+ private selectionRef;
6947
6973
  private store;
6948
6974
  get ranges(): SelectionRange[];
6949
6975
  get canAddRange(): boolean;
@@ -6951,6 +6977,8 @@ declare class SelectionInput extends Component<Props$1a, SpreadsheetChildEnv> {
6951
6977
  get isConfirmable(): boolean;
6952
6978
  get isResettable(): boolean;
6953
6979
  setup(): void;
6980
+ startDragAndDrop(rangeId: number, event: MouseEvent): void;
6981
+ getRangeElementsRects(): DOMRect[];
6954
6982
  getColor(range: SelectionRange): string;
6955
6983
  private triggerChange;
6956
6984
  onKeydown(ev: KeyboardEvent): void;
@@ -6967,6 +6995,8 @@ interface Props$19 {
6967
6995
  ranges: CustomizedDataSet[];
6968
6996
  hasSingleRange?: boolean;
6969
6997
  onSelectionChanged: (ranges: string[]) => void;
6998
+ onSelectionReordered?: (indexes: number[]) => void;
6999
+ onSelectionRemoved?: (index: number) => void;
6970
7000
  onSelectionConfirmed: () => void;
6971
7001
  }
6972
7002
  declare class ChartDataSeries extends Component<Props$19, SpreadsheetChildEnv> {
@@ -6982,6 +7012,14 @@ declare class ChartDataSeries extends Component<Props$19, SpreadsheetChildEnv> {
6982
7012
  optional: boolean;
6983
7013
  };
6984
7014
  onSelectionChanged: FunctionConstructor;
7015
+ onSelectionReordered: {
7016
+ type: FunctionConstructor;
7017
+ optional: boolean;
7018
+ };
7019
+ onSelectionRemoved: {
7020
+ type: FunctionConstructor;
7021
+ optional: boolean;
7022
+ };
6985
7023
  onSelectionConfirmed: FunctionConstructor;
6986
7024
  };
6987
7025
  get ranges(): string[];
@@ -7088,7 +7126,7 @@ declare class GenericChartConfigPanel extends Component<Props$15, SpreadsheetChi
7088
7126
  canUpdateChart: FunctionConstructor;
7089
7127
  };
7090
7128
  protected state: ChartPanelState;
7091
- protected dataSeriesRanges: CustomizedDataSet[];
7129
+ protected dataSets: CustomizedDataSet[];
7092
7130
  private labelRange;
7093
7131
  protected chartTerms: {
7094
7132
  [key: string]: any;
@@ -7113,6 +7151,8 @@ declare class GenericChartConfigPanel extends Component<Props$15, SpreadsheetChi
7113
7151
  * button "confirm" is clicked
7114
7152
  */
7115
7153
  onDataSeriesRangesChanged(ranges: string[]): void;
7154
+ onDataSeriesReordered(indexes: number[]): void;
7155
+ onDataSeriesRemoved(index: number): void;
7116
7156
  onDataSeriesConfirmed(): void;
7117
7157
  getDataSeriesRanges(): CustomizedDataSet[];
7118
7158
  /**
@@ -11199,7 +11239,7 @@ declare class BorderEditor extends Component<BorderEditorProps, SpreadsheetChild
11199
11239
  }
11200
11240
 
11201
11241
  interface Props$3 {
11202
- toggleBorderEditor: () => void;
11242
+ toggleBorderEditor: (ev: MouseEvent) => void;
11203
11243
  showBorderEditor: boolean;
11204
11244
  disabled?: boolean;
11205
11245
  dropdownMaxHeight?: Pixel;
@@ -11235,6 +11275,7 @@ declare class BorderEditorWidget extends Component<Props$3, SpreadsheetChildEnv>
11235
11275
  el: HTMLElement | null;
11236
11276
  };
11237
11277
  state: State$3;
11278
+ setup(): void;
11238
11279
  get borderEditorAnchorRect(): Rect;
11239
11280
  onBorderPositionPicked(position: BorderPosition): void;
11240
11281
  onBorderColorPicked(color: Color): void;
@@ -12699,6 +12740,7 @@ declare const chartHelpers: {
12699
12740
  getComboChartDatasets(definition: GenericDefinition<ComboChartDefinition>, args: ChartRuntimeGenerationArgs): chart_js.ChartDataset<"line" | "bar">[];
12700
12741
  getRadarChartDatasets(definition: GenericDefinition<RadarChartDefinition>, args: ChartRuntimeGenerationArgs): chart_js.ChartDataset<"radar">[];
12701
12742
  getGeoChartDatasets(definition: GenericDefinition<GeoChartDefinition>, args: GeoChartRuntimeGenerationArgs): chart_js.ChartDataset[];
12743
+ getChartColorsGenerator(definition: GenericDefinition<ChartWithDataSetDefinition>, dataSetsSize: number): ColorGenerator;
12702
12744
  getChartLayout(definition: GenericDefinition<ChartWithDataSetDefinition>): chart_js_dist_types_utils._DeepPartialObject<Partial<{
12703
12745
  autoPadding: boolean;
12704
12746
  padding: chart_js.Scriptable<chart_js_dist_types_geometric.Padding, chart_js.ScriptableContext<keyof chart_js.ChartTypeRegistry>>;