@odoo/o-spreadsheet 16.1.6 → 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 */
@@ -3411,7 +3411,7 @@ declare class Filter {
3411
3411
  readonly id: UID;
3412
3412
  readonly zoneWithHeaders: Zone;
3413
3413
  constructor(id: UID, zone: Zone);
3414
- get col(): number;
3414
+ get col(): HeaderIndex;
3415
3415
  /** Filtered zone, ie. zone of the filter without the header */
3416
3416
  get filteredZone(): Zone | undefined;
3417
3417
  }
@@ -3913,8 +3913,8 @@ declare class InternalViewport {
3913
3913
  offsetScrollbarY: Pixel;
3914
3914
  canScrollVertically: boolean;
3915
3915
  canScrollHorizontally: boolean;
3916
- width: Pixel;
3917
- height: Pixel;
3916
+ viewportWidth: Pixel;
3917
+ viewportHeight: Pixel;
3918
3918
  offsetCorrectionX: Pixel;
3919
3919
  offsetCorrectionY: Pixel;
3920
3920
  constructor(getters: Getters, sheetId: UID, boundaries: Zone, sizeInGrid: {
@@ -3927,7 +3927,14 @@ declare class InternalViewport {
3927
3927
  x: Pixel;
3928
3928
  y: Pixel;
3929
3929
  });
3930
- 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
+ };
3931
3938
  /**
3932
3939
  * Return the index of a column given an offset x, based on the pane left
3933
3940
  * visible cell.
@@ -4072,8 +4079,7 @@ declare class SheetViewPlugin extends UIPlugin {
4072
4079
  getSheetViewVisibleCols(): HeaderIndex[];
4073
4080
  getSheetViewVisibleRows(): HeaderIndex[];
4074
4081
  /**
4075
- * Return the main viewport maximum size. That is the zone dimension
4076
- * with some bottom and right padding.
4082
+ * Return the main viewport maximum size relative to the client size.
4077
4083
  */
4078
4084
  getMainViewportRect(): Rect;
4079
4085
  private getMaximumSheetOffset;
@@ -4367,7 +4373,7 @@ declare class RendererPlugin extends UIPlugin {
4367
4373
  interface RangeInputValue {
4368
4374
  id: UID;
4369
4375
  xc: string;
4370
- color: string;
4376
+ color: Color;
4371
4377
  }
4372
4378
  /**
4373
4379
  * Selection input Plugin
@@ -4465,7 +4471,7 @@ declare class SelectionInputsManagerPlugin extends UIPlugin {
4465
4471
  }
4466
4472
 
4467
4473
  interface ClientToDisplay extends Required<Client> {
4468
- color: string;
4474
+ color: Color;
4469
4475
  }
4470
4476
  declare class SelectionMultiUserPlugin extends UIPlugin {
4471
4477
  static getters: readonly ["getClientsToDisplay"];
@@ -4971,7 +4977,7 @@ interface Props$x {
4971
4977
  interface SelectionRange extends Omit<RangeInputValue, "color"> {
4972
4978
  isFocused: boolean;
4973
4979
  isValidRange: boolean;
4974
- color?: string;
4980
+ color?: Color;
4975
4981
  }
4976
4982
  /**
4977
4983
  * This component can be used when the user needs to input some
@@ -5055,7 +5061,7 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
5055
5061
  static defaultProps: {
5056
5062
  currentColor: string;
5057
5063
  };
5058
- COLORS: string[];
5064
+ COLORS: Color[];
5059
5065
  private state;
5060
5066
  get colorPickerStyle(): string;
5061
5067
  onColorClick(color: Color): void;
@@ -5068,6 +5074,7 @@ declare class ColorPicker extends Component<ColorPickerProps, SpreadsheetChildEn
5068
5074
  showMagnifier(_ev: MouseEvent): void;
5069
5075
  moveMagnifier(ev: MouseEvent): void;
5070
5076
  get magnifyingGlassStyle(): string;
5077
+ isSameColor(color1: Color, color2: Color): boolean;
5071
5078
  }
5072
5079
 
5073
5080
  interface Props$v {
@@ -5084,7 +5091,7 @@ declare class LineBarPieDesignPanel extends Component<Props$v, SpreadsheetChildE
5084
5091
  onClick(ev: MouseEvent): void;
5085
5092
  setup(): void;
5086
5093
  toggleColorPicker(): void;
5087
- updateBackgroundColor(color: string): void;
5094
+ updateBackgroundColor(color: Color): void;
5088
5095
  updateTitle(ev: any): void;
5089
5096
  updateSelect(attr: string, ev: any): void;
5090
5097
  }
@@ -5120,7 +5127,9 @@ declare class GaugeChartDesignPanel extends Component<Props$t, SpreadsheetChildE
5120
5127
  };
5121
5128
  private state;
5122
5129
  get designErrorMessages(): string[];
5123
- updateBackgroundColor(color: string): void;
5130
+ onClick(ev: MouseEvent): void;
5131
+ setup(): void;
5132
+ updateBackgroundColor(color: Color): void;
5124
5133
  updateTitle(ev: any): void;
5125
5134
  isRangeMinInvalid(): boolean;
5126
5135
  isRangeMaxInvalid(): boolean;
@@ -5128,7 +5137,7 @@ declare class GaugeChartDesignPanel extends Component<Props$t, SpreadsheetChildE
5128
5137
  get isUpperInflectionPointInvalid(): boolean;
5129
5138
  updateInflectionPointValue(attr: string, ev: any): void;
5130
5139
  updateInflectionPointType(attr: string, ev: any): void;
5131
- updateSectionColor(target: string, color: string): void;
5140
+ updateSectionColor(target: string, color: Color): void;
5132
5141
  updateRangeMin(ev: any): void;
5133
5142
  updateRangeMax(ev: any): void;
5134
5143
  toggleMenu(menu: GaugeMenu): void;
@@ -5179,10 +5188,12 @@ declare class ScorecardChartDesignPanel extends Component<Props$r, SpreadsheetCh
5179
5188
  ColorPicker: typeof ColorPicker;
5180
5189
  };
5181
5190
  private state;
5191
+ onClick(ev: MouseEvent): void;
5192
+ setup(): void;
5182
5193
  updateTitle(ev: any): void;
5183
5194
  updateBaselineDescr(ev: any): void;
5184
5195
  openColorPicker(colorPickerId: ColorPickerId): void;
5185
- setColor(color: string, colorPickerId: ColorPickerId): void;
5196
+ setColor(color: Color, colorPickerId: ColorPickerId): void;
5186
5197
  }
5187
5198
 
5188
5199
  interface ChartSidePanel {
@@ -5241,7 +5252,7 @@ interface MenuItem {
5241
5252
  children?: menuChildren;
5242
5253
  separator?: boolean;
5243
5254
  icon?: string;
5244
- textColor?: string;
5255
+ textColor?: Color;
5245
5256
  }
5246
5257
  declare type FullMenuItem = Required<MenuItem>;
5247
5258
  declare type MenuItemsBuilder = (env: SpreadsheetChildEnv) => FullMenuItem[];
@@ -5309,8 +5320,8 @@ declare class ScorecardChart extends Component<Props$p, SpreadsheetChildEnv> {
5309
5320
  get baseline(): string;
5310
5321
  get baselineDescr(): string;
5311
5322
  get baselineArrowDirection(): BaselineArrowDirection;
5312
- get backgroundColor(): string;
5313
- get primaryFontColor(): string;
5323
+ get backgroundColor(): Color;
5324
+ get primaryFontColor(): Color;
5314
5325
  get secondaryFontColor(): "#525252" | "#C8C8C8";
5315
5326
  get figure(): Figure;
5316
5327
  get chartStyle(): string;
@@ -5331,6 +5342,22 @@ declare class ScorecardChart extends Component<Props$p, SpreadsheetChildEnv> {
5331
5342
  private getWidestElement;
5332
5343
  }
5333
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
+
5334
5361
  interface PopoverProps {
5335
5362
  /**
5336
5363
  * Rectangle around which the popover is displayed.
@@ -5346,6 +5373,8 @@ interface PopoverProps {
5346
5373
  onMouseWheel?: () => void;
5347
5374
  onPopoverMoved?: () => void;
5348
5375
  onPopoverHidden?: () => void;
5376
+ /** Setting popover to allow dynamic zIndex */
5377
+ zIndex?: Number;
5349
5378
  }
5350
5379
  declare class Popover extends Component<PopoverProps, SpreadsheetChildEnv> {
5351
5380
  static template: string;
@@ -5355,6 +5384,7 @@ declare class Popover extends Component<PopoverProps, SpreadsheetChildEnv> {
5355
5384
  onMouseWheel: () => void;
5356
5385
  onPopoverMoved: () => void;
5357
5386
  onPopoverHidden: () => void;
5387
+ zIndex: ComponentsImportance;
5358
5388
  };
5359
5389
  private popoverRef;
5360
5390
  private currentPosition;
@@ -5362,6 +5392,7 @@ declare class Popover extends Component<PopoverProps, SpreadsheetChildEnv> {
5362
5392
  private spreadsheetRect;
5363
5393
  private containerRect;
5364
5394
  setup(): void;
5395
+ get popoverStyle(): string;
5365
5396
  }
5366
5397
 
5367
5398
  interface Props$o {
@@ -5468,7 +5499,7 @@ declare class Autofill extends Component<Props$m, SpreadsheetChildEnv> {
5468
5499
  interface ClientTagProps {
5469
5500
  active: boolean;
5470
5501
  name: string;
5471
- color: string;
5502
+ color: Color;
5472
5503
  col: HeaderIndex;
5473
5504
  row: HeaderIndex;
5474
5505
  }
@@ -5544,7 +5575,7 @@ declare class FunctionDescriptionProvider extends Component<Props$k> {
5544
5575
 
5545
5576
  declare type HtmlContent = {
5546
5577
  value: string;
5547
- color?: string;
5578
+ color?: Color;
5548
5579
  class?: string;
5549
5580
  };
5550
5581
  interface AutocompleteValue {
@@ -5856,6 +5887,7 @@ declare class GridPopover extends Component<Props$c, SpreadsheetChildEnv> {
5856
5887
  static components: {
5857
5888
  Popover: typeof Popover;
5858
5889
  };
5890
+ zIndex: ComponentsImportance;
5859
5891
  get cellPopover(): PositionedCellPopover | ClosedCellPopover;
5860
5892
  }
5861
5893
 
@@ -5986,7 +6018,7 @@ declare class Border extends Component<Props$b, SpreadsheetChildEnv> {
5986
6018
  declare type Orientation = "nw" | "ne" | "sw" | "se";
5987
6019
  interface Props$a {
5988
6020
  zone: Zone;
5989
- color: string;
6021
+ color: Color;
5990
6022
  orientation: Orientation;
5991
6023
  isResizing: boolean;
5992
6024
  onResizeHighlight: (isLeft: boolean, isRight: boolean) => void;
@@ -6001,7 +6033,7 @@ declare class Corner extends Component<Props$a, SpreadsheetChildEnv> {
6001
6033
 
6002
6034
  interface Props$9 {
6003
6035
  zone: Zone;
6004
- color: string;
6036
+ color: Color;
6005
6037
  }
6006
6038
  interface HighlightState {
6007
6039
  shiftingMode: "isMoving" | "isResizing" | "none";
@@ -6052,8 +6084,8 @@ declare class HorizontalScrollBar extends Component<Props$7, SpreadsheetChildEnv
6052
6084
  static defaultProps: {
6053
6085
  leftOffset: number;
6054
6086
  };
6055
- get offset(): number;
6056
- get width(): number;
6087
+ get offset(): Pixel;
6088
+ get width(): Pixel;
6057
6089
  get isDisplayed(): boolean;
6058
6090
  get position(): {
6059
6091
  left: string;
@@ -6075,8 +6107,8 @@ declare class VerticalScrollBar extends Component<Props$6, SpreadsheetChildEnv>
6075
6107
  static defaultProps: {
6076
6108
  topOffset: number;
6077
6109
  };
6078
- get offset(): number;
6079
- get height(): number;
6110
+ get offset(): Pixel;
6111
+ get height(): Pixel;
6080
6112
  get isDisplayed(): boolean;
6081
6113
  get position(): {
6082
6114
  top: string;
@@ -6227,8 +6259,8 @@ declare class TopBar extends Component<Props$2, SpreadsheetChildEnv> {
6227
6259
  undoTool: boolean;
6228
6260
  redoTool: boolean;
6229
6261
  paintFormatTool: boolean;
6230
- fillColor: string;
6231
- textColor: string;
6262
+ fillColor: Color;
6263
+ textColor: Color;
6232
6264
  menus: FullMenuItem[];
6233
6265
  composerStyle: string;
6234
6266
  setup(): void;
@@ -6246,7 +6278,7 @@ declare class TopBar extends Component<Props$2, SpreadsheetChildEnv> {
6246
6278
  updateCellState(): void;
6247
6279
  getMenuName(menu: FullMenuItem): string;
6248
6280
  toggleMerge(): void;
6249
- setColor(target: string, color: string): void;
6281
+ setColor(target: string, color: Color): void;
6250
6282
  setBorder(command: BorderCommand): void;
6251
6283
  setFormat(format: Format, custom: boolean): void;
6252
6284
  openCustomFormatSidePanel(custom: string): void;
@@ -6457,8 +6489,6 @@ declare function createEmptyExcelSheet(sheetId: UID, name: string): ExcelSheetDa
6457
6489
 
6458
6490
  declare function getMenuChildren(node: FullMenuItem, env: SpreadsheetChildEnv): FullMenuItem[];
6459
6491
 
6460
- declare const DATETIME_FORMAT: RegExp;
6461
-
6462
6492
  /**
6463
6493
  * We export here all entities that needs to be accessed publicly by Odoo.
6464
6494
  *