@odoo/o-spreadsheet 16.1.8 → 16.1.10

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.
@@ -800,6 +800,7 @@ interface ExcelWorkbookData extends WorkbookData {
800
800
  interface ExcelCellData extends CellData {
801
801
  value: CellValue;
802
802
  isFormula: Boolean;
803
+ computedFormat?: Format;
803
804
  }
804
805
  interface ExcelSheetData extends Omit<SheetData, "figureTables"> {
805
806
  cells: {
@@ -1098,9 +1099,9 @@ declare class Model extends EventBus<any> implements CommandDispatcher {
1098
1099
  */
1099
1100
  private coreGetters;
1100
1101
  uuidGenerator: UuidGenerator;
1102
+ private readonly handlers;
1103
+ private readonly coreHandlers;
1101
1104
  constructor(data?: any, config?: Partial<ModelConfig>, stateUpdateMessages?: StateUpdateMessage[], uuidGenerator?: UuidGenerator, verboseImport?: boolean);
1102
- get handlers(): CommandHandler<Command>[];
1103
- get allUIPlugins(): UIPlugin[];
1104
1105
  joinSession(): void;
1105
1106
  leaveSession(): void;
1106
1107
  private setupUiPlugin;
@@ -2254,7 +2255,9 @@ declare const enum CommandResult {
2254
2255
  DuplicatedFigureId = 82,
2255
2256
  InvalidSelectionStep = 83,
2256
2257
  DuplicatedChartId = 84,
2257
- ChartDoesNotExist = 85
2258
+ ChartDoesNotExist = 85,
2259
+ InvalidHeaderIndex = 86,
2260
+ InvalidQuantity = 87
2258
2261
  }
2259
2262
  interface CommandHandler<T> {
2260
2263
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -3494,14 +3497,16 @@ declare class HeaderSizePlugin extends CorePlugin<HeaderSizeState> implements He
3494
3497
  }
3495
3498
 
3496
3499
  declare class HeaderVisibilityPlugin extends CorePlugin {
3497
- static getters: readonly ["getHiddenColsGroups", "getHiddenRowsGroups", "isRowHiddenByUser", "isColHiddenByUser"];
3500
+ static getters: readonly ["canRemoveHeaders", "getHiddenColsGroups", "getHiddenRowsGroups", "isRowHiddenByUser", "isColHiddenByUser"];
3498
3501
  private readonly hiddenHeaders;
3499
- allowDispatch(cmd: Command): CommandResult.Success | CommandResult.InvalidSheetId | CommandResult.TooManyHiddenElements;
3502
+ allowDispatch(cmd: Command): CommandResult.Success | CommandResult.NotEnoughElements | CommandResult.InvalidSheetId | CommandResult.TooManyHiddenElements | CommandResult.InvalidHeaderIndex;
3500
3503
  handle(cmd: Command): void;
3504
+ canRemoveHeaders(sheetId: UID, dimension: Dimension, elements: HeaderIndex[]): boolean;
3501
3505
  isRowHiddenByUser(sheetId: UID, index: HeaderIndex): boolean;
3502
3506
  isColHiddenByUser(sheetId: UID, index: HeaderIndex): boolean;
3503
3507
  getHiddenColsGroups(sheetId: UID): ConsecutiveIndexes[];
3504
3508
  getHiddenRowsGroups(sheetId: UID): ConsecutiveIndexes[];
3509
+ private getAllVisibleHeaders;
3505
3510
  import(data: WorkbookData): void;
3506
3511
  exportForExcel(data: ExcelWorkbookData): void;
3507
3512
  export(data: WorkbookData): void;
@@ -4308,7 +4313,12 @@ declare class HeaderVisibilityUIPlugin extends UIPlugin {
4308
4313
  isColHidden(sheetId: UID, index: number): boolean;
4309
4314
  isHeaderHidden(sheetId: UID, dimension: Dimension, index: number): boolean;
4310
4315
  getNextVisibleCellPosition({ sheetId, col, row }: CellPosition): CellPosition;
4311
- findVisibleHeader(sheetId: UID, dimension: Dimension, indexes: number[]): number | undefined;
4316
+ /**
4317
+ * Find the first visible header in the range [`from` => `to`].
4318
+ *
4319
+ * Both `from` and `to` are inclusive.
4320
+ */
4321
+ findVisibleHeader(sheetId: UID, dimension: Dimension, from: number, to: number): number | undefined;
4312
4322
  findLastVisibleColRowIndex(sheetId: UID, dimension: Dimension, { last, first }: {
4313
4323
  first: HeaderIndex;
4314
4324
  last: HeaderIndex;
@@ -5423,6 +5433,7 @@ declare class Menu extends Component<Props$o, SpreadsheetChildEnv> {
5423
5433
  private menuRef;
5424
5434
  private position;
5425
5435
  setup(): void;
5436
+ get visibleMenuItems(): MenuItem[];
5426
5437
  get subMenuPosition(): DOMCoordinates;
5427
5438
  get menuHeight(): Pixel;
5428
5439
  get popoverProps(): PopoverProps;
@@ -5552,7 +5563,24 @@ declare class ContentEditableHelper {
5552
5563
  start: number;
5553
5564
  end: number;
5554
5565
  };
5555
- private findSizeBeforeElement;
5566
+ /**
5567
+ * Computes the text 'index' inside this.el based on the currently selected node and its offset.
5568
+ * The selected node is either a Text node or an Element node.
5569
+ *
5570
+ * case 1 -Text node:
5571
+ * the offset is the number of characters from the start of the node. We have to add this offset to the
5572
+ * content length of all previous nodes.
5573
+ *
5574
+ * case 2 - Element node:
5575
+ * the offset is the number of child nodes before the selected node. We have to add the content length of
5576
+ * all the bnodes prior to the selected node as well as the content of the child node before the offset.
5577
+ *
5578
+ * See the MDN documentation for more details.
5579
+ * https://developer.mozilla.org/en-US/docs/Web/API/Range/startOffset
5580
+ * https://developer.mozilla.org/en-US/docs/Web/API/Range/endOffset
5581
+ *
5582
+ */
5583
+ private findSelectionIndex;
5556
5584
  private getStartAndEndSelection;
5557
5585
  }
5558
5586