@odoo/o-spreadsheet 17.1.0-alpha.5 → 17.1.0-alpha.6

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.
@@ -1616,7 +1616,7 @@ declare enum ClipboardMIMEType {
1616
1616
  type ClipboardContent = {
1617
1617
  [type in ClipboardMIMEType]?: string;
1618
1618
  };
1619
- type ClipboardPasteOptions = "onlyFormat" | "onlyValue";
1619
+ type ClipboardPasteOptions = "onlyFormat" | "asValue";
1620
1620
 
1621
1621
  interface SearchOptions {
1622
1622
  matchCase: boolean;
@@ -2595,6 +2595,7 @@ type ValueAndFormat = {
2595
2595
  };
2596
2596
  type Arg = Maybe<ValueAndFormat> | Matrix<ValueAndFormat>;
2597
2597
  type ArgValue = Maybe<CellValue> | Matrix<CellValue>;
2598
+ declare function isMatrix(x: any): x is Matrix<any>;
2598
2599
  interface HeaderDimensions {
2599
2600
  start: Pixel;
2600
2601
  size: Pixel;
@@ -4025,25 +4026,23 @@ declare class CustomColorsPlugin extends UIPlugin<CustomColorState> {
4025
4026
  private tryToAddColor;
4026
4027
  }
4027
4028
 
4029
+ interface EvaluationChartStyle {
4030
+ background: Color;
4031
+ fontColor: Color;
4032
+ }
4028
4033
  interface EvaluationChartState {
4029
4034
  charts: Record<UID, ChartRuntime | undefined>;
4030
4035
  }
4031
4036
  declare class EvaluationChartPlugin extends UIPlugin<EvaluationChartState> {
4032
- static getters: readonly ["getChartRuntime", "getBackgroundOfSingleCellChart"];
4037
+ static getters: readonly ["getChartRuntime", "getStyleOfSingleCellChart"];
4033
4038
  charts: Record<UID, ChartRuntime | undefined>;
4034
4039
  private createRuntimeChart;
4035
4040
  handle(cmd: CoreViewCommand): void;
4036
4041
  getChartRuntime(figureId: UID): ChartRuntime;
4037
4042
  /**
4038
- * Get the background color of a chart based on the color of the first cell of the main range
4039
- * of the chart. In order of priority, it will return :
4040
- *
4041
- * - the chart background color if one is defined
4042
- * - the fill color of the cell if one is defined
4043
- * - the fill color of the cell from conditional formats if one is defined
4044
- * - the default chart color if no other color is defined
4043
+ * Get the background and textColor of a chart based on the color of the first cell of the main range of the chart.
4045
4044
  */
4046
- getBackgroundOfSingleCellChart(chartBackground: Color | undefined, mainRange: Range | undefined): Color;
4045
+ getStyleOfSingleCellChart(chartBackground: Color | undefined, mainRange: Range | undefined): EvaluationChartStyle;
4047
4046
  exportForExcel(data: ExcelWorkbookData): void;
4048
4047
  }
4049
4048
 
@@ -6407,8 +6406,8 @@ interface Props$m {
6407
6406
  onCellHovered: (position: Partial<Position$1>) => void;
6408
6407
  onCellDoubleClicked: (col: HeaderIndex, row: HeaderIndex) => void;
6409
6408
  onCellClicked: (col: HeaderIndex, row: HeaderIndex, modifiers: {
6410
- ctrlKey: boolean;
6411
- shiftKey: boolean;
6409
+ addZone: boolean;
6410
+ expandZone: boolean;
6412
6411
  }) => void;
6413
6412
  onCellRightClicked: (col: HeaderIndex, row: HeaderIndex, coordinates: DOMCoordinates) => void;
6414
6413
  onGridResized: (dimension: Rect) => void;
@@ -6714,6 +6713,7 @@ declare namespace ACTION_EDIT {
6714
6713
  }
6715
6714
 
6716
6715
  declare const formatNumberAutomatic: ActionSpec;
6716
+ declare const formatNumberPlainText: ActionSpec;
6717
6717
  declare const formatNumberNumber: ActionSpec;
6718
6718
  declare const formatPercent: ActionSpec;
6719
6719
  declare const formatNumberPercent: ActionSpec;
@@ -6788,6 +6788,7 @@ declare const ACTION_FORMAT_formatNumberFullMonth: typeof formatNumberFullMonth;
6788
6788
  declare const ACTION_FORMAT_formatNumberFullWeekDayAndMonth: typeof formatNumberFullWeekDayAndMonth;
6789
6789
  declare const ACTION_FORMAT_formatNumberNumber: typeof formatNumberNumber;
6790
6790
  declare const ACTION_FORMAT_formatNumberPercent: typeof formatNumberPercent;
6791
+ declare const ACTION_FORMAT_formatNumberPlainText: typeof formatNumberPlainText;
6791
6792
  declare const ACTION_FORMAT_formatNumberShortMonth: typeof formatNumberShortMonth;
6792
6793
  declare const ACTION_FORMAT_formatNumberShortWeekDay: typeof formatNumberShortWeekDay;
6793
6794
  declare const ACTION_FORMAT_formatNumberTime: typeof formatNumberTime;
@@ -6834,6 +6835,7 @@ declare namespace ACTION_FORMAT {
6834
6835
  ACTION_FORMAT_formatNumberFullWeekDayAndMonth as formatNumberFullWeekDayAndMonth,
6835
6836
  ACTION_FORMAT_formatNumberNumber as formatNumberNumber,
6836
6837
  ACTION_FORMAT_formatNumberPercent as formatNumberPercent,
6838
+ ACTION_FORMAT_formatNumberPlainText as formatNumberPlainText,
6837
6839
  ACTION_FORMAT_formatNumberShortMonth as formatNumberShortMonth,
6838
6840
  ACTION_FORMAT_formatNumberShortWeekDay as formatNumberShortWeekDay,
6839
6841
  ACTION_FORMAT_formatNumberTime as formatNumberTime,
@@ -7432,7 +7434,7 @@ declare abstract class AbstractResizer extends Component<ResizerProps, Spreadshe
7432
7434
  abstract _getMaxSize(): Pixel;
7433
7435
  abstract _updateSize(): void;
7434
7436
  abstract _moveElements(): void;
7435
- abstract _selectElement(index: HeaderIndex, ctrlKey: boolean): void;
7437
+ abstract _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
7436
7438
  abstract _increaseSelection(index: HeaderIndex): void;
7437
7439
  abstract _fitElementSize(index: HeaderIndex): void;
7438
7440
  abstract _getType(): ContextMenuType;
@@ -7466,7 +7468,7 @@ declare class ColResizer extends AbstractResizer {
7466
7468
  _getMaxSize(): Pixel;
7467
7469
  _updateSize(): void;
7468
7470
  _moveElements(): void;
7469
- _selectElement(index: HeaderIndex, ctrlKey: boolean): void;
7471
+ _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
7470
7472
  _increaseSelection(index: HeaderIndex): void;
7471
7473
  _fitElementSize(index: HeaderIndex): void;
7472
7474
  _getType(): ContextMenuType;
@@ -7491,7 +7493,7 @@ declare class RowResizer extends AbstractResizer {
7491
7493
  _getMaxSize(): Pixel;
7492
7494
  _updateSize(): void;
7493
7495
  _moveElements(): void;
7494
- _selectElement(index: HeaderIndex, ctrlKey: boolean): void;
7496
+ _selectElement(index: HeaderIndex, addDistinctHeader: boolean): void;
7495
7497
  _increaseSelection(index: HeaderIndex): void;
7496
7498
  _fitElementSize(index: HeaderIndex): void;
7497
7499
  _getType(): ContextMenuType;
@@ -7618,9 +7620,9 @@ declare class Grid extends Component<Props$1, SpreadsheetChildEnv> {
7618
7620
  getClientPositionKey(client: Client): string;
7619
7621
  isCellHovered(col: HeaderIndex, row: HeaderIndex): boolean;
7620
7622
  private getGridRect;
7621
- onCellClicked(col: HeaderIndex, row: HeaderIndex, { ctrlKey, shiftKey }: {
7622
- ctrlKey: boolean;
7623
- shiftKey: boolean;
7623
+ onCellClicked(col: HeaderIndex, row: HeaderIndex, { addZone, expandZone }: {
7624
+ addZone: boolean;
7625
+ expandZone: boolean;
7624
7626
  }): void;
7625
7627
  onCellDoubleClicked(col: HeaderIndex, row: HeaderIndex): void;
7626
7628
  closeOpenedPopover(): void;
@@ -7834,6 +7836,7 @@ declare const helpers: {
7834
7836
  colorToRGBA: typeof colorToRGBA;
7835
7837
  positionToZone: typeof positionToZone;
7836
7838
  isDefined: typeof isDefined;
7839
+ isMatrix: typeof isMatrix;
7837
7840
  lazy: typeof lazy;
7838
7841
  genericRepeat: typeof genericRepeat;
7839
7842
  createAction: typeof createAction;