@odoo/o-spreadsheet 19.0.11 → 19.0.15

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.
@@ -339,7 +339,7 @@ type PieChartRuntime = {
339
339
  background: Color;
340
340
  };
341
341
 
342
- interface PyramidChartDefinition extends Omit<BarChartDefinition, "type"> {
342
+ interface PyramidChartDefinition extends Omit<BarChartDefinition, "type" | "zoomable"> {
343
343
  readonly type: "pyramid";
344
344
  }
345
345
  type PyramidChartRuntime = {
@@ -2348,6 +2348,7 @@ declare class PivotCorePlugin extends CorePlugin<CoreState> implements CoreState
2348
2348
  declare class RangeAdapter$1 implements CommandHandler<CoreCommand> {
2349
2349
  private getters;
2350
2350
  private providers;
2351
+ private isAdaptingRanges;
2351
2352
  constructor(getters: CoreGetters);
2352
2353
  static getters: readonly ["adaptFormulaStringDependencies", "copyFormulaStringForSheet", "extendRange", "getRangeString", "getRangeFromSheetXC", "createAdaptedRanges", "getRangeData", "getRangeDataFromXc", "getRangeDataFromZone", "getRangeFromRangeData", "getRangeFromZone", "getRangesUnion", "recomputeRanges", "isRangeValid", "removeRangesSheetPrefix"];
2353
2354
  allowDispatch(cmd: CoreCommand): CommandResult;
@@ -2735,7 +2736,7 @@ declare class CoreViewPlugin<State = any> extends BasePlugin<State, Command> {
2735
2736
  }
2736
2737
 
2737
2738
  declare class EvaluationPlugin extends CoreViewPlugin {
2738
- static getters: readonly ["evaluateFormula", "evaluateFormulaResult", "evaluateCompiledFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone", "getEvaluatedCellsPositions", "getSpreadZone", "getArrayFormulaSpreadingOn", "isEmpty"];
2739
+ static getters: readonly ["evaluateFormula", "evaluateFormulaResult", "evaluateCompiledFormula", "getCorrespondingFormulaCell", "getRangeFormattedValues", "getRangeValues", "getRangeFormats", "getEvaluatedCell", "getEvaluatedCells", "getEvaluatedCellsInZone", "getEvaluatedCellsPositions", "getSpreadZone", "getArrayFormulaSpreadingOn", "isArrayFormulaSpillBlocked", "isEmpty"];
2739
2740
  private shouldRebuildDependenciesGraph;
2740
2741
  private evaluator;
2741
2742
  private positionsToUpdate;
@@ -2769,6 +2770,7 @@ declare class EvaluationPlugin extends CoreViewPlugin {
2769
2770
  ignoreSpillError: boolean;
2770
2771
  }): Zone | undefined;
2771
2772
  getArrayFormulaSpreadingOn(position: CellPosition): CellPosition | undefined;
2773
+ isArrayFormulaSpillBlocked(position: CellPosition): boolean;
2772
2774
  /**
2773
2775
  * Check if a zone only contains empty cells
2774
2776
  */
@@ -6883,12 +6885,12 @@ type PivotDefinitionConstructor = new (definition: PivotCoreDefinition, fields:
6883
6885
  interface PivotRegistryItem {
6884
6886
  ui: PivotUIConstructor;
6885
6887
  definition: PivotDefinitionConstructor;
6886
- externalData: boolean;
6887
6888
  dateGranularities: string[];
6888
6889
  datetimeGranularities: string[];
6889
6890
  isMeasureCandidate: (field: PivotField) => boolean;
6890
6891
  isGroupable: (field: PivotField) => boolean;
6891
6892
  canHaveCustomGroup: (field: PivotField) => boolean;
6893
+ adaptRanges?: (getters: CoreGetters, definition: PivotCoreDefinition, applyChange: ApplyRangeChange) => PivotCoreDefinition;
6892
6894
  }
6893
6895
 
6894
6896
  declare class ClipboardHandler<T> {
@@ -8036,6 +8038,7 @@ declare class FontSizeEditor extends Component<Props$1g, SpreadsheetChildEnv> {
8036
8038
  private inputRef;
8037
8039
  private rootEditorRef;
8038
8040
  private fontSizeListRef;
8041
+ private DOMFocusableElementStore;
8039
8042
  setup(): void;
8040
8043
  get popoverProps(): PopoverProps;
8041
8044
  onExternalClick(ev: MouseEvent): void;
@@ -9272,7 +9275,7 @@ interface ChartSidePanel {
9272
9275
  */
9273
9276
  interface FigureContent {
9274
9277
  Component: any;
9275
- menuBuilder: (figureId: UID, onFigureDeleted: () => void, env: SpreadsheetChildEnv) => Action[];
9278
+ menuBuilder: (figureId: UID, env: SpreadsheetChildEnv) => Action[];
9276
9279
  SidePanelComponent?: string;
9277
9280
  keepRatio?: boolean;
9278
9281
  minFigSize?: number;
@@ -9640,7 +9643,6 @@ interface Props$U {
9640
9643
  figureUI: FigureUI;
9641
9644
  style: string;
9642
9645
  class: string;
9643
- onFigureDeleted: () => void;
9644
9646
  onMouseDown: (ev: MouseEvent) => void;
9645
9647
  onClickAnchor(dirX: ResizeDirection, dirY: ResizeDirection, ev: MouseEvent): void;
9646
9648
  }
@@ -9656,10 +9658,6 @@ declare class FigureComponent extends Component<Props$U, SpreadsheetChildEnv> {
9656
9658
  type: StringConstructor;
9657
9659
  optional: boolean;
9658
9660
  };
9659
- onFigureDeleted: {
9660
- type: FunctionConstructor;
9661
- optional: boolean;
9662
- };
9663
9661
  onMouseDown: {
9664
9662
  type: FunctionConstructor;
9665
9663
  optional: boolean;
@@ -9673,7 +9671,6 @@ declare class FigureComponent extends Component<Props$U, SpreadsheetChildEnv> {
9673
9671
  MenuPopover: typeof MenuPopover;
9674
9672
  };
9675
9673
  static defaultProps: {
9676
- onFigureDeleted: () => void;
9677
9674
  onMouseDown: () => void;
9678
9675
  onClickAnchor: () => void;
9679
9676
  };
@@ -9737,7 +9734,6 @@ declare class ChartDashboardMenu extends Component<Props$T, SpreadsheetChildEnv>
9737
9734
 
9738
9735
  interface Props$S {
9739
9736
  figureUI: FigureUI;
9740
- onFigureDeleted: () => void;
9741
9737
  editFigureStyle?: (properties: CSSProperties) => void;
9742
9738
  isFullScreen?: boolean;
9743
9739
  openContextMenu?: (anchorRect: Rect, onClose?: () => void) => void;
@@ -9746,7 +9742,6 @@ declare class ChartFigure extends Component<Props$S, SpreadsheetChildEnv> {
9746
9742
  static template: string;
9747
9743
  static props: {
9748
9744
  figureUI: ObjectConstructor;
9749
- onFigureDeleted: FunctionConstructor;
9750
9745
  editFigureStyle: {
9751
9746
  type: FunctionConstructor;
9752
9747
  optional: boolean;
@@ -9885,7 +9880,6 @@ interface SnapLine<T extends HFigureAxisType | VFigureAxisType> {
9885
9880
 
9886
9881
  type ContainerType = "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "dnd";
9887
9882
  interface Props$P {
9888
- onFigureDeleted: () => void;
9889
9883
  }
9890
9884
  interface Container {
9891
9885
  type: ContainerType;
@@ -9967,9 +9961,7 @@ interface DndState {
9967
9961
  */
9968
9962
  declare class FiguresContainer extends Component<Props$P, SpreadsheetChildEnv> {
9969
9963
  static template: string;
9970
- static props: {
9971
- onFigureDeleted: FunctionConstructor;
9972
- };
9964
+ static props: {};
9973
9965
  static components: {
9974
9966
  FigureComponent: typeof FigureComponent;
9975
9967
  };
@@ -10004,16 +9996,14 @@ declare class FiguresContainer extends Component<Props$P, SpreadsheetChildEnv> {
10004
9996
  }
10005
9997
 
10006
9998
  interface Props$O {
10007
- focusGrid: () => void;
10008
9999
  }
10009
10000
  declare class GridAddRowsFooter extends Component<Props$O, SpreadsheetChildEnv> {
10010
10001
  static template: string;
10011
- static props: {
10012
- focusGrid: FunctionConstructor;
10013
- };
10002
+ static props: {};
10014
10003
  static components: {
10015
10004
  ValidationMessages: typeof ValidationMessages;
10016
10005
  };
10006
+ private DOMFocusableElementStore;
10017
10007
  inputRef: {
10018
10008
  el: HTMLInputElement | null;
10019
10009
  };
@@ -10028,6 +10018,7 @@ declare class GridAddRowsFooter extends Component<Props$O, SpreadsheetChildEnv>
10028
10018
  onInput(ev: InputEvent): void;
10029
10019
  onConfirm(): void;
10030
10020
  private onExternalClick;
10021
+ private focusDefaultElement;
10031
10022
  }
10032
10023
 
10033
10024
  interface Props$N {
@@ -10037,7 +10028,6 @@ interface Props$N {
10037
10028
  onGridResized: (dimension: Rect) => void;
10038
10029
  onGridMoved: (deltaX: Pixel, deltaY: Pixel) => void;
10039
10030
  gridOverlayDimensions: string;
10040
- onFigureDeleted: () => void;
10041
10031
  getGridSize: () => {
10042
10032
  width: number;
10043
10033
  height: number;
@@ -10062,10 +10052,6 @@ declare class GridOverlay extends Component<Props$N, SpreadsheetChildEnv> {
10062
10052
  type: FunctionConstructor;
10063
10053
  optional: boolean;
10064
10054
  };
10065
- onFigureDeleted: {
10066
- type: FunctionConstructor;
10067
- optional: boolean;
10068
- };
10069
10055
  onGridMoved: FunctionConstructor;
10070
10056
  gridOverlayDimensions: StringConstructor;
10071
10057
  slots: {
@@ -10083,7 +10069,6 @@ declare class GridOverlay extends Component<Props$N, SpreadsheetChildEnv> {
10083
10069
  onCellClicked: () => void;
10084
10070
  onCellRightClicked: () => void;
10085
10071
  onGridResized: () => void;
10086
- onFigureDeleted: () => void;
10087
10072
  };
10088
10073
  private gridOverlay;
10089
10074
  private cellPopovers;
@@ -11405,14 +11390,17 @@ declare class ZoomableChartJsComponent extends ChartJsComponent {
11405
11390
  private chartId;
11406
11391
  private datasetBoundaries;
11407
11392
  private removeEventListeners;
11393
+ private isMasterChartAllowed;
11408
11394
  setup(): void;
11409
11395
  protected unmount(): void;
11410
11396
  get containerStyle(): string;
11397
+ get masterChartContainerStyle(): "" | "opacity: 0.3;";
11411
11398
  get sliceable(): boolean;
11412
11399
  get axisOffset(): number;
11413
11400
  private getMasterChartConfiguration;
11414
11401
  private getDetailChartConfiguration;
11415
11402
  private getAxisLimitsFromDataset;
11403
+ private setMasterChartCursor;
11416
11404
  protected createChart(chartRuntime: ChartJSRuntime): void;
11417
11405
  protected updateChartJs(chartRuntime: ChartJSRuntime): void;
11418
11406
  private resetAxesLimits;
@@ -11421,11 +11409,37 @@ declare class ZoomableChartJsComponent extends ChartJsComponent {
11421
11409
  get lowerBound(): number | undefined;
11422
11410
  private computePosition;
11423
11411
  private computeCoordinate;
11412
+ /**
11413
+ * Compute min and max from the store, adjusting them if needed for non linear scales.
11414
+ * Getting the value from the store, we have to ensure that the values are integers for
11415
+ * non linear scales (bar and category). To select a bar in the chart, we have to include
11416
+ * the whole bar, which means that for the i-th bar, the selected min should be <= i and
11417
+ * the selected max should be >= i, so using the Math.floor and Math.ceil functions is
11418
+ * the right way to do it.
11419
+ * Sometimes, we can get a minimal value > the maximal value, which arise when the user
11420
+ * select a very small area in the master chart, and hasn't selected the middle of a bar
11421
+ * or a group of bars (in case of more than one data series).
11422
+ * Assuming we have to select the middle of a bar/a groupe of bars, we will reject the
11423
+ * coming value afterward. In this case, we do not update the chart because it would lead
11424
+ * to an empty chart.
11425
+ */
11426
+ private getStoredBoundaries;
11427
+ /**
11428
+ * Adjust the min and max values of an axis if needed for non linear scales.
11429
+ * Here, after rounding (see docstring of getStoredBoundaries), we adjust the min by
11430
+ * substracting the axis offset, and we add it to the max, because when computing from the
11431
+ * scale, chartJs use integer values as the limits for non linear scales. If we have a min
11432
+ * value of 1, it means we want to start displaying from 0.5, and if we have a max value of
11433
+ * 4, it means we want to display until 4.5.
11434
+ * Here, we don't have to check if min > max because we are computing from the scale, and
11435
+ * chartJs ensures that this won't happen, even after our adjustments.
11436
+ */
11437
+ private adjustBoundaries;
11424
11438
  private updateAxisLimits;
11425
- onPointerDownInMasterChart(ev: PointerEvent): void;
11426
- onPointerMoveInMasterChart(ev: PointerEvent): void;
11427
- onMouseLeaveMasterChart(ev: PointerEvent): void;
11428
- onDoubleClickInMasterChart(ev: PointerEvent): void;
11439
+ onMasterChartPointerDown(ev: PointerEvent): void;
11440
+ onMasterChartPointerMove(ev: PointerEvent): void;
11441
+ onMasterChartMouseLeave(ev: PointerEvent): void;
11442
+ onMasterChartDoubleClick(ev: PointerEvent): void;
11429
11443
  }
11430
11444
 
11431
11445
  interface Props$m {
@@ -11592,7 +11606,7 @@ interface Props$j {
11592
11606
  canUpdateChart: (chartId: UID, definition: GenericDefinition<ZoomableChartDefinition>) => DispatchResult;
11593
11607
  updateChart: (chartId: UID, definition: GenericDefinition<ZoomableChartDefinition>) => DispatchResult;
11594
11608
  }
11595
- declare class GenericZoomableChartDesignPanel<P extends Props$j = Props$j> extends ChartWithAxisDesignPanel<Props$j> {
11609
+ declare class GenericZoomableChartDesignPanel<P extends Props$j = Props$j> extends ChartWithAxisDesignPanel<P> {
11596
11610
  static template: string;
11597
11611
  static components: {
11598
11612
  Checkbox: typeof Checkbox;
@@ -12484,6 +12498,7 @@ declare class ClickableCellsStore extends SpreadsheetStore {
12484
12498
  private getClickableItem;
12485
12499
  private findClickableItem;
12486
12500
  get clickableCells(): ClickableCell[];
12501
+ private getClickableCellRect;
12487
12502
  }
12488
12503
 
12489
12504
  interface Props$4 {