@odoo/o-spreadsheet 15.0.0 → 15.0.1

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.
@@ -458,6 +458,7 @@ interface WorkbookData {
458
458
  };
459
459
  };
460
460
  revisionId: UID;
461
+ uniqueFigureIds: boolean;
461
462
  }
462
463
  interface ExcelWorkbookData extends WorkbookData {
463
464
  sheets: ExcelSheetData[];
@@ -1329,7 +1330,7 @@ interface UpdateChartCommand extends BaseCommand, SheetDependentCommand {
1329
1330
  id: UID;
1330
1331
  definition: ChartUIDefinitionUpdate;
1331
1332
  }
1332
- interface RefreshChartCommand extends BaseCommand, SheetDependentCommand {
1333
+ interface RefreshChartCommand extends BaseCommand {
1333
1334
  type: "REFRESH_CHART";
1334
1335
  id: UID;
1335
1336
  }
@@ -1820,7 +1821,8 @@ declare const enum CommandResult {
1820
1821
  InvalidViewportSize = 54,
1821
1822
  FigureDoesNotExist = 55,
1822
1823
  DuplicatedFigureId = 56,
1823
- DuplicatedChartId = 57
1824
+ DuplicatedChartId = 57,
1825
+ ChartDoesNotExist = 58
1824
1826
  }
1825
1827
  interface CommandHandler<T> {
1826
1828
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -2416,21 +2418,19 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
2416
2418
  * This plugin creates and displays charts
2417
2419
  * */
2418
2420
  interface ChartState {
2419
- readonly chartFigures: {
2420
- [sheetId: UID]: Record<UID, ChartDefinition | undefined> | undefined;
2421
- };
2421
+ readonly chartFigures: Record<UID, ChartDefinition | undefined>;
2422
2422
  }
2423
2423
  declare class ChartPlugin extends CorePlugin<ChartState> implements ChartState {
2424
2424
  static getters: string[];
2425
- readonly chartFigures: ChartState["chartFigures"];
2425
+ readonly chartFigures: Record<UID, ChartDefinition>;
2426
2426
  adaptRanges(applyChange: ApplyRangeChange): void;
2427
2427
  private adaptDataSetRanges;
2428
2428
  private adaptLabelRanges;
2429
2429
  allowDispatch(cmd: Command): CommandResult | CommandResult[];
2430
2430
  handle(cmd: CoreCommand): void;
2431
- getChartDefinition(sheetId: UID, figureId: UID): ChartDefinition | undefined;
2432
- getChartDefinitionsBySheet(sheetId: UID): ChartDefinition[];
2433
- getChartDefinitionUI(sheetId: UID, figureId: UID, forceSheetName?: boolean): ChartUIDefinition;
2431
+ getChartDefinition(figureId: UID): ChartDefinition | undefined;
2432
+ getChartsIdBySheet(sheetId: UID): string[];
2433
+ getChartDefinitionUI(sheetId: UID, figureId: UID): ChartUIDefinition | undefined;
2434
2434
  private getChartDefinitionExcel;
2435
2435
  private toExcelDataset;
2436
2436
  import(data: WorkbookData): void;
@@ -2452,6 +2452,7 @@ declare class ChartPlugin extends CorePlugin<ChartState> implements ChartState {
2452
2452
  private checkDataset;
2453
2453
  private checkLabelRange;
2454
2454
  private checkChartDuplicate;
2455
+ private checkChartExists;
2455
2456
  }
2456
2457
 
2457
2458
  interface ConditionalFormatState {
@@ -2500,12 +2501,14 @@ declare class ConditionalFormatPlugin extends CorePlugin<ConditionalFormatState>
2500
2501
 
2501
2502
  interface FigureState {
2502
2503
  readonly figures: {
2503
- [sheet: UID]: Record<UID, Figure | undefined> | undefined;
2504
+ [sheet: string]: Record<UID, Figure | undefined> | undefined;
2504
2505
  };
2505
2506
  }
2506
2507
  declare class FigurePlugin extends CorePlugin<FigureState> implements FigureState {
2507
2508
  static getters: string[];
2508
- readonly figures: FigureState["figures"];
2509
+ readonly figures: {
2510
+ [sheet: string]: Record<UID, Figure | undefined> | undefined;
2511
+ };
2509
2512
  allowDispatch(cmd: CoreCommand): CommandResult;
2510
2513
  handle(cmd: CoreCommand): void;
2511
2514
  private updateFigure;
@@ -2516,6 +2519,7 @@ declare class FigurePlugin extends CorePlugin<FigureState> implements FigureStat
2516
2519
  private checkFigureDuplicate;
2517
2520
  getFigures(sheetId: UID): Figure[];
2518
2521
  getFigure(sheetId: string, figureId: string): Figure | undefined;
2522
+ getFigureSheetId(figureId: string): UID | undefined;
2519
2523
  import(data: WorkbookData): void;
2520
2524
  export(data: WorkbookData): void;
2521
2525
  exportForExcel(data: ExcelWorkbookData): void;
@@ -3029,13 +3033,11 @@ declare class EvaluationChartPlugin extends UIPlugin {
3029
3033
  static getters: string[];
3030
3034
  static modes: Mode[];
3031
3035
  readonly chartRuntime: {
3032
- [sheetId: UID]: {
3033
- [figureId: UID]: ChartConfiguration;
3034
- } | undefined;
3036
+ [figureId: string]: ChartConfiguration;
3035
3037
  };
3036
3038
  private outOfDate;
3037
3039
  handle(cmd: Command): void;
3038
- getChartRuntime(sheetId: UID, figureId: string): ChartConfiguration | undefined;
3040
+ getChartRuntime(figureId: string): ChartConfiguration | undefined;
3039
3041
  private truncateLabel;
3040
3042
  private getDefaultConfiguration;
3041
3043
  private getSheetIdsUsedInChart;
@@ -3554,9 +3556,10 @@ interface CoreGetters {
3554
3556
  getRulesByCell: ConditionalFormatPlugin["getRulesByCell"];
3555
3557
  getFigures: FigurePlugin["getFigures"];
3556
3558
  getFigure: FigurePlugin["getFigure"];
3559
+ getFigureSheetId: FigurePlugin["getFigureSheetId"];
3557
3560
  getCellBorder: BordersPlugin["getCellBorder"];
3558
3561
  getChartDefinition: ChartPlugin["getChartDefinition"];
3559
- getChartDefinitionsBySheet: ChartPlugin["getChartDefinitionsBySheet"];
3562
+ getChartsIdBySheet: ChartPlugin["getChartsIdBySheet"];
3560
3563
  getChartDefinitionUI: ChartPlugin["getChartDefinitionUI"];
3561
3564
  getRangeString: RangeAdapter["getRangeString"];
3562
3565
  getRangeFromSheetXC: RangeAdapter["getRangeFromSheetXC"];