@odoo/o-spreadsheet 17.2.0-alpha.1 → 17.2.0-alpha.2

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.
@@ -446,6 +446,11 @@ type PieChartRuntime = {
446
446
  background: Color;
447
447
  };
448
448
 
449
+ interface ScatterChartDefinition extends Omit<LineChartDefinition, "type" | "stacked" | "cumulative"> {
450
+ readonly type: "scatter";
451
+ }
452
+ type ScatterChartRuntime = LineChartRuntime;
453
+
449
454
  interface ScorecardChartDefinition {
450
455
  readonly type: "scorecard";
451
456
  readonly title: string;
@@ -472,9 +477,9 @@ interface ScorecardChartRuntime {
472
477
  readonly baselineStyle?: Style;
473
478
  }
474
479
 
475
- type ChartType = "line" | "bar" | "pie" | "scorecard" | "gauge";
476
- type ChartDefinition = LineChartDefinition | PieChartDefinition | BarChartDefinition | ScorecardChartDefinition | GaugeChartDefinition;
477
- type ChartJSRuntime = LineChartRuntime | PieChartRuntime | BarChartRuntime | GaugeChartRuntime;
480
+ type ChartType = "line" | "bar" | "pie" | "scorecard" | "gauge" | "scatter";
481
+ type ChartDefinition = LineChartDefinition | PieChartDefinition | BarChartDefinition | ScorecardChartDefinition | GaugeChartDefinition | ScatterChartDefinition;
482
+ type ChartJSRuntime = LineChartRuntime | PieChartRuntime | BarChartRuntime | GaugeChartRuntime | ScatterChartRuntime;
478
483
  type ChartRuntime = ChartJSRuntime | ScorecardChartRuntime;
479
484
  interface ExcelChartDataset {
480
485
  readonly label?: string;
@@ -653,13 +658,23 @@ interface ExcelCellData extends CellData {
653
658
  isFormula: Boolean;
654
659
  computedFormat?: Format;
655
660
  }
656
- interface ExcelSheetData extends Omit<SheetData, "figureTables"> {
661
+ interface ExcelSheetData extends Omit<SheetData, "figureTables" | "cols" | "rows"> {
657
662
  cells: {
658
663
  [key: string]: ExcelCellData | undefined;
659
664
  };
660
665
  charts: FigureData<ExcelChartDefinition>[];
661
666
  images: FigureData<Image>[];
662
667
  filterTables: ExcelFilterTableData[];
668
+ cols: {
669
+ [key: number]: ExcelHeaderData;
670
+ };
671
+ rows: {
672
+ [key: number]: ExcelHeaderData;
673
+ };
674
+ }
675
+ interface ExcelHeaderData extends HeaderData {
676
+ outlineLevel?: number;
677
+ collapsed?: boolean;
663
678
  }
664
679
  interface FilterTableData {
665
680
  range: string;
@@ -2448,7 +2463,8 @@ declare const enum CommandResult {
2448
2463
  InvalidNumberOfCriterionValues = "InvalidNumberOfCriterionValues",
2449
2464
  BlockingValidationRule = "BlockingValidationRule",
2450
2465
  InvalidCopyPasteSelection = "InvalidCopyPasteSelection",
2451
- NoChanges = "NoChanges"
2466
+ NoChanges = "NoChanges",
2467
+ InvalidInputId = "InvalidInputId"
2452
2468
  }
2453
2469
  interface CommandHandler<T> {
2454
2470
  allowDispatch(command: T): CommandResult | CommandResult[];
@@ -3263,6 +3279,7 @@ declare class CellPlugin extends CorePlugin<CoreState> implements CoreState {
3263
3279
  adaptRanges(applyChange: ApplyRangeChange, sheetId?: UID): void;
3264
3280
  allowDispatch(cmd: CoreCommand): CommandResult | CommandResult[];
3265
3281
  handle(cmd: CoreCommand): void;
3282
+ private clearZones;
3266
3283
  /**
3267
3284
  * Set a format to all the cells in a zone
3268
3285
  */
@@ -3673,6 +3690,7 @@ declare class HeaderGroupingPlugin extends CorePlugin<State$7> {
3673
3690
  private getGroupIndex;
3674
3691
  import(data: WorkbookData): void;
3675
3692
  export(data: WorkbookData): void;
3693
+ exportForExcel(data: ExcelWorkbookData): void;
3676
3694
  }
3677
3695
 
3678
3696
  interface HeaderSizeState$1 {
@@ -3909,7 +3927,6 @@ declare class SheetPlugin extends CorePlugin<SheetState> implements SheetState {
3909
3927
  */
3910
3928
  private clearPosition;
3911
3929
  private setGridLinesVisibility;
3912
- private clearZones;
3913
3930
  private createSheet;
3914
3931
  private moveSheet;
3915
3932
  private findIndexOfTargetSheet;
@@ -4115,6 +4132,7 @@ declare class EvaluationDataValidationPlugin extends UIPlugin {
4115
4132
  static getters: readonly ["getDataValidationInvalidCriterionValueMessage", "getDataValidationCheckBoxCellPositions", "getDataValidationListCellsPositions", "getInvalidDataValidationMessage", "getValidationResultForCellValue", "isCellValidCheckbox", "isDataValidationInvalid"];
4116
4133
  validationResults: Record<UID, SheetValidationResult>;
4117
4134
  handle(cmd: CoreViewCommand): void;
4135
+ private setContentToBooleanCells;
4118
4136
  isDataValidationInvalid(cellPosition: CellPosition): boolean;
4119
4137
  getInvalidDataValidationMessage(cellPosition: CellPosition): string | undefined;
4120
4138
  /**
@@ -4548,14 +4566,13 @@ interface RangeInputValue {
4548
4566
  * This plugin handles this internal state.
4549
4567
  */
4550
4568
  declare class SelectionInputPlugin extends UIPlugin implements StreamCallbacks<SelectionEvent> {
4551
- private readonly inputHasSingleRange;
4569
+ readonly inputHasSingleRange: boolean;
4552
4570
  static layers: LAYERS[];
4553
4571
  static getters: never[];
4554
4572
  ranges: RangeInputValue[];
4555
4573
  focusedRangeIndex: number | null;
4556
4574
  private inputSheetId;
4557
4575
  constructor(config: UIPluginConfig, initialRanges: string[], inputHasSingleRange: boolean);
4558
- allowDispatch(cmd: LocalCommand): CommandResult;
4559
4576
  handleEvent(event: SelectionEvent): void;
4560
4577
  handle(cmd: Command): void;
4561
4578
  getSelectionInputValue(): string[];
@@ -5193,7 +5210,7 @@ interface AddFunctionDescription {
5193
5210
  description: string;
5194
5211
  category?: string;
5195
5212
  args: ArgDefinition[];
5196
- returns: [ArgType];
5213
+ returns: ArgType[];
5197
5214
  isExported?: boolean;
5198
5215
  hidden?: boolean;
5199
5216
  }
@@ -5578,7 +5595,7 @@ interface Props$L {
5578
5595
  name: string;
5579
5596
  label: string;
5580
5597
  value: boolean;
5581
- update: (value: boolean) => void;
5598
+ onChange: (value: boolean) => void;
5582
5599
  }>;
5583
5600
  }
5584
5601
  declare class ChartLabelRange extends Component<Props$L, SpreadsheetChildEnv> {
@@ -5894,7 +5911,6 @@ interface Props$H {
5894
5911
  declare class ChartTitle extends Component<Props$H, SpreadsheetChildEnv> {
5895
5912
  static template: string;
5896
5913
  static components: {
5897
- ColorPickerWidget: typeof ColorPickerWidget;
5898
5914
  Section: typeof Section;
5899
5915
  };
5900
5916
  static props: {
@@ -5914,7 +5930,6 @@ declare class LineBarPieDesignPanel extends Component<Props$G, SpreadsheetChildE
5914
5930
  static template: string;
5915
5931
  static components: {
5916
5932
  ChartColor: typeof ChartColor;
5917
- ColorPickerWidget: typeof ColorPickerWidget;
5918
5933
  ChartTitle: typeof ChartTitle;
5919
5934
  Section: typeof Section;
5920
5935
  };
@@ -5939,7 +5954,6 @@ interface Props$F {
5939
5954
  declare class GaugeChartConfigPanel extends Component<Props$F, SpreadsheetChildEnv> {
5940
5955
  static template: string;
5941
5956
  static components: {
5942
- SelectionInput: typeof SelectionInput;
5943
5957
  ChartErrorSection: typeof ChartErrorSection;
5944
5958
  ChartDataSeries: typeof ChartDataSeries;
5945
5959
  };
@@ -6024,7 +6038,6 @@ declare class ScorecardChartConfigPanel extends Component<Props$D, SpreadsheetCh
6024
6038
  static template: string;
6025
6039
  static components: {
6026
6040
  SelectionInput: typeof SelectionInput;
6027
- ValidationMessages: typeof ValidationMessages;
6028
6041
  ChartErrorSection: typeof ChartErrorSection;
6029
6042
  Section: typeof Section;
6030
6043
  };
@@ -8479,6 +8492,19 @@ declare function toJsDate(data: FPayload | CellValue | undefined, locale: Locale
8479
8492
 
8480
8493
  declare function arg(definition: string, description?: string): ArgDefinition;
8481
8494
 
8495
+ interface FunctionRegistry extends Registry<FunctionDescription> {
8496
+ add(functionName: string, addDescr: AddFunctionDescription): FunctionRegistry;
8497
+ get(functionName: string): FunctionDescription;
8498
+ mapping: {
8499
+ [functionName: string]: ComputeFunction<Matrix<FPayload> | FPayload>;
8500
+ };
8501
+ }
8502
+ declare class FunctionRegistry extends Registry<FunctionDescription> {
8503
+ mapping: {
8504
+ [key: string]: ComputeFunction<Matrix<FPayload> | FPayload>;
8505
+ };
8506
+ }
8507
+
8482
8508
  declare class ChartColors {
8483
8509
  private graphColorIndex;
8484
8510
  next(): string;
@@ -8560,20 +8586,7 @@ declare const registries: {
8560
8586
  colMenuRegistry: MenuItemRegistry;
8561
8587
  errorTypes: Set<string>;
8562
8588
  linkMenuRegistry: MenuItemRegistry;
8563
- functionRegistry: {
8564
- mapping: {
8565
- [key: string]: ComputeFunction<FPayload | Matrix<FPayload>>;
8566
- };
8567
- add(name: string, addDescr: AddFunctionDescription): any;
8568
- content: {
8569
- [key: string]: FunctionDescription;
8570
- };
8571
- get(key: string): FunctionDescription;
8572
- contains(key: string): boolean;
8573
- getAll(): FunctionDescription[];
8574
- getKeys(): string[];
8575
- remove(key: string): void;
8576
- };
8589
+ functionRegistry: FunctionRegistry;
8577
8590
  featurePluginRegistry: Registry<UIPluginConstructor>;
8578
8591
  statefulUIPluginRegistry: Registry<UIPluginConstructor>;
8579
8592
  coreViewsPluginRegistry: Registry<UIPluginConstructor>;
@@ -8652,6 +8665,13 @@ declare const links: {
8652
8665
  urlRepresentation: typeof urlRepresentation;
8653
8666
  };
8654
8667
  declare const components: {
8668
+ Checkbox: typeof Checkbox;
8669
+ Section: typeof Section;
8670
+ ChartColor: typeof ChartColor;
8671
+ ChartDataSeries: typeof ChartDataSeries;
8672
+ ChartErrorSection: typeof ChartErrorSection;
8673
+ ChartLabelRange: typeof ChartLabelRange;
8674
+ ChartTitle: typeof ChartTitle;
8655
8675
  ChartPanel: typeof ChartPanel;
8656
8676
  ChartFigure: typeof ChartFigure;
8657
8677
  ChartJsComponent: typeof ChartJsComponent;
@@ -8681,4 +8701,4 @@ declare const constants: {
8681
8701
  DEFAULT_LOCALE: Locale;
8682
8702
  };
8683
8703
 
8684
- export { AbstractChart, CancelledReason, CellErrorType, Client, ClientJoinedMessage, ClientLeftMessage, ClientMovedMessage, CollaborationMessage, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, RemoteRevisionMessage, Revision, RevisionRedoneMessage, RevisionUndoneMessage, SPREADSHEET_DIMENSIONS, Spreadsheet, TransportService, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
8704
+ export { AST, ASTFuncall, AbstractChart, AddFunctionDescription, Arg, CancelledReason, Cell, CellErrorType, CellPosition, Client, ClientJoinedMessage, ClientLeftMessage, ClientMovedMessage, CollaborationMessage, CommandResult, CorePlugin, DispatchResult, EnrichedToken, EvalContext, EvaluationError, FPayload, FunctionRegistry, Model, Registry, RemoteRevisionMessage, Revision, RevisionRedoneMessage, RevisionUndoneMessage, SPREADSHEET_DIMENSIONS, Spreadsheet, Token, TransportService, UIPlugin, __info__, addFunction, astToFormula, compile, compileTokens, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, hooks, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };