@odoo/o-spreadsheet 16.1.5 → 16.1.7

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.
@@ -290,10 +290,10 @@ declare function toZone(xc: string): Zone;
290
290
  */
291
291
  declare function findCellInNewZone(oldZone: Zone, currentZone: Zone): Position$1;
292
292
  declare function positionToZone(position: Position$1): {
293
- left: number;
294
- right: number;
295
- top: number;
296
- bottom: number;
293
+ left: HeaderIndex;
294
+ right: HeaderIndex;
295
+ top: HeaderIndex;
296
+ bottom: HeaderIndex;
297
297
  };
298
298
 
299
299
  interface SelectionEventPayload {
@@ -521,9 +521,9 @@ interface SectionRule {
521
521
  readonly upperInflectionPoint: SectionThreshold;
522
522
  }
523
523
  interface ColorSet {
524
- readonly lowerColor: string;
525
- readonly middleColor: string;
526
- readonly upperColor: string;
524
+ readonly lowerColor: Color;
525
+ readonly middleColor: Color;
526
+ readonly upperColor: Color;
527
527
  }
528
528
  interface SectionThreshold {
529
529
  readonly type: "number" | "percentage";
@@ -550,13 +550,13 @@ interface GaugeChartOptions extends ChartOptions {
550
550
  radiusPercentage: number;
551
551
  widthPercentage: number;
552
552
  lengthPercentage: number;
553
- color: string;
553
+ color: Color;
554
554
  };
555
555
  valueLabel?: {
556
556
  formatter: (() => string) | null;
557
557
  display: boolean;
558
- color: string;
559
- backgroundColor: string;
558
+ color: Color;
559
+ backgroundColor: Color;
560
560
  borderRadius: number;
561
561
  fontSize: number;
562
562
  padding: {
@@ -1741,8 +1741,8 @@ interface CreateChartCommand extends SheetDependentCommand {
1741
1741
  type: "CREATE_CHART";
1742
1742
  id: UID;
1743
1743
  position?: {
1744
- x: number;
1745
- y: number;
1744
+ x: Pixel;
1745
+ y: Pixel;
1746
1746
  };
1747
1747
  size?: FigureSize;
1748
1748
  definition: ChartDefinition;
@@ -1756,8 +1756,8 @@ interface CreateImageOverCommand extends SheetDependentCommand {
1756
1756
  type: "CREATE_IMAGE";
1757
1757
  figureId: UID;
1758
1758
  position: {
1759
- x: number;
1760
- y: number;
1759
+ x: Pixel;
1760
+ y: Pixel;
1761
1761
  };
1762
1762
  size: FigureSize;
1763
1763
  definition: Image;
@@ -1861,7 +1861,7 @@ interface StopSelectionCommand {
1861
1861
  */
1862
1862
  interface SetColorCommand {
1863
1863
  type: "SET_HIGHLIGHT_COLOR";
1864
- color: string;
1864
+ color: Color;
1865
1865
  }
1866
1866
  interface EvaluateCellsCommand {
1867
1867
  type: "EVALUATE_CELLS";
@@ -2286,7 +2286,7 @@ declare type CoreCommandTypes = CoreCommand["type"];
2286
2286
  * Intellisense from resolving it.
2287
2287
  * See https://github.com/microsoft/TypeScript/issues/31940#issuecomment-841712377
2288
2288
  */
2289
- declare type Alias = {};
2289
+ declare type Alias = {} & {};
2290
2290
  declare type HeaderIndex = number & Alias;
2291
2291
  declare type Pixel = number & Alias;
2292
2292
  declare type UID = string & Alias;
@@ -2350,8 +2350,8 @@ interface Style {
2350
2350
  align?: Align;
2351
2351
  wrapping?: Wrapping;
2352
2352
  verticalAlign?: VerticalAlign;
2353
- fillColor?: string;
2354
- textColor?: string;
2353
+ fillColor?: Color;
2354
+ textColor?: Color;
2355
2355
  fontSize?: number;
2356
2356
  }
2357
2357
  interface UpdateCellData {
@@ -2430,7 +2430,7 @@ interface Merge extends Zone {
2430
2430
  interface Highlight$1 {
2431
2431
  zone: Zone;
2432
2432
  sheetId: UID;
2433
- color: string | null;
2433
+ color: Color | null;
2434
2434
  }
2435
2435
  interface PaneDivision {
2436
2436
  /** Represents the number of frozen columns */
@@ -2978,6 +2978,7 @@ declare class RangeAdapter implements CommandHandler<CoreCommand> {
2978
2978
  * Get a Xc string that represent a part of a range
2979
2979
  */
2980
2980
  private getRangePartString;
2981
+ private getInvalidRange;
2981
2982
  }
2982
2983
 
2983
2984
  interface CorePluginConfig {
@@ -3410,7 +3411,7 @@ declare class Filter {
3410
3411
  readonly id: UID;
3411
3412
  readonly zoneWithHeaders: Zone;
3412
3413
  constructor(id: UID, zone: Zone);
3413
- get col(): number;
3414
+ get col(): HeaderIndex;
3414
3415
  /** Filtered zone, ie. zone of the filter without the header */
3415
3416
  get filteredZone(): Zone | undefined;
3416
3417
  }
@@ -3912,8 +3913,8 @@ declare class InternalViewport {
3912
3913
  offsetScrollbarY: Pixel;
3913
3914
  canScrollVertically: boolean;
3914
3915
  canScrollHorizontally: boolean;
3915
- width: Pixel;
3916
- height: Pixel;
3916
+ viewportWidth: Pixel;
3917
+ viewportHeight: Pixel;
3917
3918
  offsetCorrectionX: Pixel;
3918
3919
  offsetCorrectionY: Pixel;
3919
3920
  constructor(getters: Getters, sheetId: UID, boundaries: Zone, sizeInGrid: {
@@ -3926,7 +3927,14 @@ declare class InternalViewport {
3926
3927
  x: Pixel;
3927
3928
  y: Pixel;
3928
3929
  });
3929
- getMaxSize(): ZoneDimension;
3930
+ /** Returns the maximum size (in Pixels) of the viewport relative to its allocated client size
3931
+ * When the viewport grid size is smaller than its client width (resp. height), it will return
3932
+ * the client width (resp. height).
3933
+ */
3934
+ getMaxSize(): {
3935
+ width: Pixel;
3936
+ height: Pixel;
3937
+ };
3930
3938
  /**
3931
3939
  * Return the index of a column given an offset x, based on the pane left
3932
3940
  * visible cell.
@@ -4071,8 +4079,7 @@ declare class SheetViewPlugin extends UIPlugin {
4071
4079
  getSheetViewVisibleCols(): HeaderIndex[];
4072
4080
  getSheetViewVisibleRows(): HeaderIndex[];
4073
4081
  /**
4074
- * Return the main viewport maximum size. That is the zone dimension
4075
- * with some bottom and right padding.
4082
+ * Return the main viewport maximum size relative to the client size.
4076
4083
  */
4077
4084
  getMainViewportRect(): Rect;
4078
4085
  private getMaximumSheetOffset;
@@ -4366,7 +4373,7 @@ declare class RendererPlugin extends UIPlugin {
4366
4373
  interface RangeInputValue {
4367
4374
  id: UID;
4368
4375
  xc: string;
4369
- color: string;
4376
+ color: Color;
4370
4377
  }
4371
4378
  /**
4372
4379
  * Selection input Plugin
@@ -4464,7 +4471,7 @@ declare class SelectionInputsManagerPlugin extends UIPlugin {
4464
4471
  }
4465
4472
 
4466
4473
  interface ClientToDisplay extends Required<Client> {
4467
- color: string;
4474
+ color: Color;
4468
4475
  }
4469
4476
  declare class SelectionMultiUserPlugin extends UIPlugin {
4470
4477
  static getters: readonly ["getClientsToDisplay"];
@@ -4970,7 +4977,7 @@ interface Props$x {
4970
4977
  interface SelectionRange extends Omit<RangeInputValue, "color"> {
4971
4978
  isFocused: boolean;
4972
4979
  isValidRange: boolean;
4973
- color?: string;
4980
+ color?: Color;
4974
4981
  }
4975
4982
  /**
4976
4983
  * This component can be used when the user needs to input some
@@ -5054,7 +5061,7 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
5054
5061
  static defaultProps: {
5055
5062
  currentColor: string;
5056
5063
  };
5057
- COLORS: string[];
5064
+ COLORS: Color[];
5058
5065
  private state;
5059
5066
  get colorPickerStyle(): string;
5060
5067
  onColorClick(color: Color): void;
@@ -5067,6 +5074,7 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
5067
5074
  showMagnifier(_ev: MouseEvent): void;
5068
5075
  moveMagnifier(ev: MouseEvent): void;
5069
5076
  get magnifyingGlassStyle(): string;
5077
+ isSameColor(color1: Color, color2: Color): boolean;
5070
5078
  }
5071
5079
 
5072
5080
  interface Props$v {
@@ -5083,7 +5091,7 @@ declare class LineBarPieDesignPanel extends Component<Props$v, SpreadsheetChildE
5083
5091
  onClick(ev: MouseEvent): void;
5084
5092
  setup(): void;
5085
5093
  toggleColorPicker(): void;
5086
- updateBackgroundColor(color: string): void;
5094
+ updateBackgroundColor(color: Color): void;
5087
5095
  updateTitle(ev: any): void;
5088
5096
  updateSelect(attr: string, ev: any): void;
5089
5097
  }
@@ -5119,7 +5127,9 @@ declare class GaugeChartDesignPanel extends Component<Props$t, SpreadsheetChildE
5119
5127
  };
5120
5128
  private state;
5121
5129
  get designErrorMessages(): string[];
5122
- updateBackgroundColor(color: string): void;
5130
+ onClick(ev: MouseEvent): void;
5131
+ setup(): void;
5132
+ updateBackgroundColor(color: Color): void;
5123
5133
  updateTitle(ev: any): void;
5124
5134
  isRangeMinInvalid(): boolean;
5125
5135
  isRangeMaxInvalid(): boolean;
@@ -5127,7 +5137,7 @@ declare class GaugeChartDesignPanel extends Component<Props$t, SpreadsheetChildE
5127
5137
  get isUpperInflectionPointInvalid(): boolean;
5128
5138
  updateInflectionPointValue(attr: string, ev: any): void;
5129
5139
  updateInflectionPointType(attr: string, ev: any): void;
5130
- updateSectionColor(target: string, color: string): void;
5140
+ updateSectionColor(target: string, color: Color): void;
5131
5141
  updateRangeMin(ev: any): void;
5132
5142
  updateRangeMax(ev: any): void;
5133
5143
  toggleMenu(menu: GaugeMenu): void;
@@ -5178,10 +5188,12 @@ declare class ScorecardChartDesignPanel extends Component<Props$r, SpreadsheetCh
5178
5188
  ColorPicker: typeof ColorPicker;
5179
5189
  };
5180
5190
  private state;
5191
+ onClick(ev: MouseEvent): void;
5192
+ setup(): void;
5181
5193
  updateTitle(ev: any): void;
5182
5194
  updateBaselineDescr(ev: any): void;
5183
5195
  openColorPicker(colorPickerId: ColorPickerId): void;
5184
- setColor(color: string, colorPickerId: ColorPickerId): void;
5196
+ setColor(color: Color, colorPickerId: ColorPickerId): void;
5185
5197
  }
5186
5198
 
5187
5199
  interface ChartSidePanel {
@@ -5240,7 +5252,7 @@ interface MenuItem {
5240
5252
  children?: menuChildren;
5241
5253
  separator?: boolean;
5242
5254
  icon?: string;
5243
- textColor?: string;
5255
+ textColor?: Color;
5244
5256
  }
5245
5257
  declare type FullMenuItem = Required<MenuItem>;
5246
5258
  declare type MenuItemsBuilder = (env: SpreadsheetChildEnv) => FullMenuItem[];
@@ -5308,8 +5320,8 @@ declare class ScorecardChart extends Component<Props$p, SpreadsheetChildEnv> {
5308
5320
  get baseline(): string;
5309
5321
  get baselineDescr(): string;
5310
5322
  get baselineArrowDirection(): BaselineArrowDirection;
5311
- get backgroundColor(): string;
5312
- get primaryFontColor(): string;
5323
+ get backgroundColor(): Color;
5324
+ get primaryFontColor(): Color;
5313
5325
  get secondaryFontColor(): "#525252" | "#C8C8C8";
5314
5326
  get figure(): Figure;
5315
5327
  get chartStyle(): string;
@@ -5330,6 +5342,22 @@ declare class ScorecardChart extends Component<Props$p, SpreadsheetChildEnv> {
5330
5342
  private getWidestElement;
5331
5343
  }
5332
5344
 
5345
+ declare const DATETIME_FORMAT: RegExp;
5346
+ declare enum ComponentsImportance {
5347
+ Grid = 0,
5348
+ Highlight = 5,
5349
+ Figure = 10,
5350
+ ScrollBar = 15,
5351
+ GridPopover = 19,
5352
+ GridComposer = 20,
5353
+ Dropdown = 21,
5354
+ ColorPicker = 25,
5355
+ IconPicker = 25,
5356
+ TopBarComposer = 30,
5357
+ Popover = 35,
5358
+ ChartAnchor = 1000
5359
+ }
5360
+
5333
5361
  interface PopoverProps {
5334
5362
  /**
5335
5363
  * Rectangle around which the popover is displayed.
@@ -5345,6 +5373,8 @@ interface PopoverProps {
5345
5373
  onMouseWheel?: () => void;
5346
5374
  onPopoverMoved?: () => void;
5347
5375
  onPopoverHidden?: () => void;
5376
+ /** Setting popover to allow dynamic zIndex */
5377
+ zIndex?: Number;
5348
5378
  }
5349
5379
  declare class Popover extends Component<PopoverProps, SpreadsheetChildEnv> {
5350
5380
  static template: string;
@@ -5354,6 +5384,7 @@ declare class Popover extends Component<PopoverProps, SpreadsheetChildEnv> {
5354
5384
  onMouseWheel: () => void;
5355
5385
  onPopoverMoved: () => void;
5356
5386
  onPopoverHidden: () => void;
5387
+ zIndex: ComponentsImportance;
5357
5388
  };
5358
5389
  private popoverRef;
5359
5390
  private currentPosition;
@@ -5361,6 +5392,7 @@ declare class Popover extends Component<PopoverProps, SpreadsheetChildEnv> {
5361
5392
  private spreadsheetRect;
5362
5393
  private containerRect;
5363
5394
  setup(): void;
5395
+ get popoverStyle(): string;
5364
5396
  }
5365
5397
 
5366
5398
  interface Props$o {
@@ -5467,7 +5499,7 @@ declare class Autofill extends Component<Props$m, SpreadsheetChildEnv> {
5467
5499
  interface ClientTagProps {
5468
5500
  active: boolean;
5469
5501
  name: string;
5470
- color: string;
5502
+ color: Color;
5471
5503
  col: HeaderIndex;
5472
5504
  row: HeaderIndex;
5473
5505
  }
@@ -5543,7 +5575,7 @@ declare class FunctionDescriptionProvider extends Component<Props$k> {
5543
5575
 
5544
5576
  declare type HtmlContent = {
5545
5577
  value: string;
5546
- color?: string;
5578
+ color?: Color;
5547
5579
  class?: string;
5548
5580
  };
5549
5581
  interface AutocompleteValue {
@@ -5855,6 +5887,7 @@ declare class GridPopover extends Component<Props$c, SpreadsheetChildEnv> {
5855
5887
  static components: {
5856
5888
  Popover: typeof Popover;
5857
5889
  };
5890
+ zIndex: ComponentsImportance;
5858
5891
  get cellPopover(): PositionedCellPopover | ClosedCellPopover;
5859
5892
  }
5860
5893
 
@@ -5985,7 +6018,7 @@ declare class Border extends Component<Props$b, SpreadsheetChildEnv> {
5985
6018
  declare type Orientation = "nw" | "ne" | "sw" | "se";
5986
6019
  interface Props$a {
5987
6020
  zone: Zone;
5988
- color: string;
6021
+ color: Color;
5989
6022
  orientation: Orientation;
5990
6023
  isResizing: boolean;
5991
6024
  onResizeHighlight: (isLeft: boolean, isRight: boolean) => void;
@@ -6000,7 +6033,7 @@ declare class Corner extends Component<Props$a, SpreadsheetChildEnv> {
6000
6033
 
6001
6034
  interface Props$9 {
6002
6035
  zone: Zone;
6003
- color: string;
6036
+ color: Color;
6004
6037
  }
6005
6038
  interface HighlightState {
6006
6039
  shiftingMode: "isMoving" | "isResizing" | "none";
@@ -6051,8 +6084,8 @@ declare class HorizontalScrollBar extends Component<Props$7, SpreadsheetChildEnv
6051
6084
  static defaultProps: {
6052
6085
  leftOffset: number;
6053
6086
  };
6054
- get offset(): number;
6055
- get width(): number;
6087
+ get offset(): Pixel;
6088
+ get width(): Pixel;
6056
6089
  get isDisplayed(): boolean;
6057
6090
  get position(): {
6058
6091
  left: string;
@@ -6074,8 +6107,8 @@ declare class VerticalScrollBar extends Component<Props$6, SpreadsheetChildEnv>
6074
6107
  static defaultProps: {
6075
6108
  topOffset: number;
6076
6109
  };
6077
- get offset(): number;
6078
- get height(): number;
6110
+ get offset(): Pixel;
6111
+ get height(): Pixel;
6079
6112
  get isDisplayed(): boolean;
6080
6113
  get position(): {
6081
6114
  top: string;
@@ -6226,8 +6259,8 @@ declare class TopBar extends Component<Props$2, SpreadsheetChildEnv> {
6226
6259
  undoTool: boolean;
6227
6260
  redoTool: boolean;
6228
6261
  paintFormatTool: boolean;
6229
- fillColor: string;
6230
- textColor: string;
6262
+ fillColor: Color;
6263
+ textColor: Color;
6231
6264
  menus: FullMenuItem[];
6232
6265
  composerStyle: string;
6233
6266
  setup(): void;
@@ -6245,7 +6278,7 @@ declare class TopBar extends Component<Props$2, SpreadsheetChildEnv> {
6245
6278
  updateCellState(): void;
6246
6279
  getMenuName(menu: FullMenuItem): string;
6247
6280
  toggleMerge(): void;
6248
- setColor(target: string, color: string): void;
6281
+ setColor(target: string, color: Color): void;
6249
6282
  setBorder(command: BorderCommand): void;
6250
6283
  setFormat(format: Format, custom: boolean): void;
6251
6284
  openCustomFormatSidePanel(custom: string): void;
@@ -6456,8 +6489,6 @@ declare function createEmptyExcelSheet(sheetId: UID, name: string): ExcelSheetDa
6456
6489
 
6457
6490
  declare function getMenuChildren(node: FullMenuItem, env: SpreadsheetChildEnv): FullMenuItem[];
6458
6491
 
6459
- declare const DATETIME_FORMAT: RegExp;
6460
-
6461
6492
  /**
6462
6493
  * We export here all entities that needs to be accessed publicly by Odoo.
6463
6494
  *