@odoo/o-spreadsheet 19.5.0-alpha.18 → 19.5.0-alpha.19

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.
@@ -1,5 +1,5 @@
1
1
  import { EvaluationError } from "../types/errors";
2
- import { Arg, FunctionResultNumber, FunctionResultObject, Maybe } from "../types/misc";
2
+ import { Arg, FunctionResultObject, Maybe } from "../types/misc";
3
3
  export declare const CHAR: {
4
4
  description: string;
5
5
  args: import("..").ArgDefinition[];
@@ -43,7 +43,10 @@ export declare const FIND: {
43
43
  export declare const FORMAT_LARGE_NUMBER: {
44
44
  description: string;
45
45
  args: import("..").ArgDefinition[];
46
- compute: (this: import("..").EvalContext, value: Maybe<FunctionResultObject>, unite: Maybe<FunctionResultObject>) => FunctionResultNumber;
46
+ compute: (this: import("..").EvalContext, value: Maybe<FunctionResultObject>, unite: Maybe<FunctionResultObject>) => EvaluationError | {
47
+ value: number;
48
+ format: string;
49
+ };
47
50
  };
48
51
  export declare const JOIN: {
49
52
  description: string;
@@ -28,4 +28,5 @@ export declare class SpreadsheetChart {
28
28
  getFormulas(getters: CoreGetters): CompiledFormula[];
29
29
  getRuntime(getters: EvaluationGetters, chartId: UID, colorThemeName: ColorThemeName): import("../..").ChartRuntime;
30
30
  static deleteInvalidKeys(definition: ChartDefinition<any>): ChartDefinition<any>;
31
+ loadDataForExport(getters: EvaluationGetters): Promise<void | undefined>;
31
32
  }
@@ -251,6 +251,7 @@ import { getFirstPivotFunction, getNumberOfPivotFunctions } from "./helpers/pivo
251
251
  import { domainToColRowDomain } from "./helpers/pivot/pivot_domain_helpers";
252
252
  import { drawHighlight } from "./helpers/rendering";
253
253
  import { fuzzyLookup } from "./helpers/search";
254
+ import { ClipboardStore } from "./stores/clipboard_store";
254
255
  import { ViewportsStore } from "./stores/viewports_store";
255
256
  export declare const helpers: {
256
257
  arg: typeof arg;
@@ -444,6 +445,7 @@ export declare const stores: {
444
445
  ClientFocusStore: typeof ClientFocusStore;
445
446
  GridRenderer: typeof GridRenderer;
446
447
  ViewportsStore: typeof ViewportsStore;
448
+ ClipboardStore: typeof ClipboardStore;
447
449
  ZoomStore: typeof ZoomStore;
448
450
  globalStores: import(".").Registry<import(".").StoreConstructor<SpreadsheetStore, any[]>>;
449
451
  };
@@ -10,7 +10,7 @@ export declare class CarouselPlugin extends CorePlugin<CarouselState> implements
10
10
  static getters: readonly ["getCarousel", "doesCarouselExist", "carouselToCarouselData"];
11
11
  readonly carousels: Record<UID, Record<UID, Carousel | undefined> | undefined>;
12
12
  adaptRanges(rangeAdapterFunctions: RangeAdapterFunctions): void;
13
- allowDispatch(cmd: CoreCommand): CommandResult.Success | CommandResult.InvalidRange | CommandResult.InvalidFigureId | CommandResult.DuplicatedFigureId;
13
+ allowDispatch(cmd: CoreCommand): CommandResult.Success | CommandResult.InvalidRange | CommandResult.InvalidFigureId | CommandResult.DuplicatedFigureId | CommandResult.ChartDoesNotExist;
14
14
  handle(cmd: CoreCommand): void;
15
15
  doesCarouselExist(figureId: UID): boolean;
16
16
  getCarousel(figureId: UID): Carousel;
@@ -9,7 +9,7 @@ interface ImageState {
9
9
  readonly images: Record<UID, Record<UID, Image | undefined> | undefined>;
10
10
  }
11
11
  export declare class ImagePlugin extends CorePlugin<ImageState> implements ImageState {
12
- static getters: readonly ["getImage", "getImagePath", "getImageSize"];
12
+ static getters: readonly ["getImage", "getImagePath", "getImageSize", "getImageFile"];
13
13
  readonly fileStore?: FileStore;
14
14
  readonly images: Record<UID, Record<UID, Image | undefined> | undefined>;
15
15
  /**
@@ -22,6 +22,7 @@ export declare class ImagePlugin extends CorePlugin<ImageState> implements Image
22
22
  getImage(figureId: UID): Image;
23
23
  getImagePath(figureId: UID): string;
24
24
  getImageSize(figureId: UID): FigureSize;
25
+ getImageFile(figureId: UID): Promise<Blob | File | undefined>;
25
26
  private addFigure;
26
27
  import(data: WorkbookData): void;
27
28
  export(data: WorkbookData): void;
@@ -1,7 +1,7 @@
1
1
  import { GeoChartRegion } from "../../types/chart/geo_chart";
2
2
  import { EvaluationPlugin, EvaluationPluginConfig } from "../evaluation_plugin";
3
3
  export declare class GeoLoaderEvaluation extends EvaluationPlugin {
4
- static getters: readonly ["getGeoJsonFeatures", "geoFeatureNameToId", "getGeoChartAvailableRegions"];
4
+ static getters: readonly ["getGeoJsonFeatures", "geoFeatureNameToId", "getGeoChartAvailableRegions", "loadUsedGeoJsonFeatures"];
5
5
  private readonly geoJsonService;
6
6
  private geoJsonCache;
7
7
  constructor(config: EvaluationPluginConfig);
@@ -9,4 +9,5 @@ export declare class GeoLoaderEvaluation extends EvaluationPlugin {
9
9
  getGeoJsonFeatures(region: string): GeoJSON.Feature[] | undefined;
10
10
  geoFeatureNameToId(region: string, featureName: string): string | undefined;
11
11
  private convertToGeoJson;
12
+ loadUsedGeoJsonFeatures(): Promise<void>;
12
13
  }
@@ -52,6 +52,7 @@ export interface ChartTypeBuilder<T extends ChartType> {
52
52
  allowedDefinitionKeys: readonly string[];
53
53
  sequence: number;
54
54
  dataSeriesLimit?: number;
55
+ loadDataForExport?: (getters: EvaluationGetters) => Promise<void>;
55
56
  }
56
57
  interface ChartDataExtractors {
57
58
  extractData(): ChartData;
@@ -9,7 +9,7 @@ export declare class CellHoverOverlayStore extends SpreadsheetStore {
9
9
  storeGetters: readonly ["getCellHoverOverlayColor"];
10
10
  private providers;
11
11
  overlayColors: PositionMap<Color>;
12
- hover(hoveredPosition: CellPosition | undefined): void;
12
+ hover(hoveredPosition: CellPosition | undefined): "noStateChange" | undefined;
13
13
  register(highlightProvider: CellHoverOverlayProvider): void;
14
14
  unRegister(highlightProvider: CellHoverOverlayProvider): void;
15
15
  }
@@ -1,25 +1,25 @@
1
- import { OSClipboardContent } from "../../types/clipboard";
2
- import { Command, CommandResult, LocalCommand } from "../../types/commands";
3
- import { GridRenderingContext } from "../../types/rendering";
4
- import { UIPlugin, UIPluginConfig } from "../ui_plugin";
1
+ import { OSClipboardContent } from "../types/clipboard";
2
+ import { Command, DispatchResult } from "../types/commands";
3
+ import { GridRenderingContext } from "../types/rendering";
4
+ import { SpreadsheetStore } from "./spreadsheet_store";
5
5
  export declare const MAX_FILE_SIZE: number;
6
6
  /**
7
- * Clipboard Plugin
7
+ * Clipboard Store
8
8
  *
9
9
  * This clipboard manages all cut/copy/paste interactions internal to the
10
10
  * application, and with the OS clipboard as well.
11
11
  */
12
- export declare class ClipboardPlugin extends UIPlugin {
13
- static layers: readonly ["Clipboard"];
14
- static getters: readonly ["getClipboardTextAndImageContent", "getClipboardId", "getClipboardTextContent", "isCutOperation"];
12
+ export declare class ClipboardStore extends SpreadsheetStore {
13
+ storeGetters: readonly ["getClipboardTextAndImageContent", "getClipboardId", "getClipboardTextContent", "isCutOperation", "isCommandValid"];
15
14
  private status;
16
15
  private originSheetId?;
17
16
  private copiedData?;
18
17
  private _isCutOperation;
19
18
  private clipboardId;
20
- private fileStore?;
21
- constructor(config: UIPluginConfig);
22
- allowDispatch(cmd: LocalCommand): CommandResult;
19
+ private notificationStore;
20
+ get renderingLayers(): readonly ["Clipboard"];
21
+ isCommandValid(cmd: Command): DispatchResult;
22
+ private getCommandResult;
23
23
  handle(cmd: Command): void;
24
24
  private getCopiedDataAbove;
25
25
  private getCopiedDataOnLeft;
@@ -48,7 +48,6 @@ import { UIOptionsPlugin } from "../plugins/ui_feature/ui_options";
48
48
  import { SheetUIPlugin } from "../plugins/ui_feature/ui_sheet";
49
49
  import { CarouselUIPlugin } from "../plugins/ui_stateful/carousel_ui";
50
50
  import { CellIconPlugin } from "../plugins/ui_stateful/cell_icon_plugin";
51
- import { ClipboardPlugin } from "../plugins/ui_stateful/clipboard";
52
51
  import { FigureUIPlugin } from "../plugins/ui_stateful/figure";
53
52
  import { HeaderPositionsUIPlugin } from "../plugins/ui_stateful/header_positions";
54
53
  import { GridSelectionPlugin } from "../plugins/ui_stateful/selection";
@@ -119,7 +118,7 @@ export type EvaluationGetters = {
119
118
  export type RenderingGetters = {
120
119
  isReadonly: () => boolean;
121
120
  isDashboard: () => boolean;
122
- } & CoreGetters & EvaluationGetters & PluginGetters<typeof HistoryPlugin> & PluginGetters<typeof ClipboardPlugin> & PluginGetters<typeof CollaborativePlugin> & PluginGetters<typeof SortPlugin> & PluginGetters<typeof UIOptionsPlugin> & PluginGetters<typeof SheetUIPlugin> & PluginGetters<typeof HeaderPositionsUIPlugin> & PluginGetters<typeof PivotUIPlugin> & PluginGetters<typeof CellIconPlugin> & PluginGetters<typeof GeoFeaturePlugin> & PluginGetters<typeof LockSheetPlugin> & PluginGetters<typeof CarouselUIPlugin> & PluginGetters<typeof ColorThemeUIPlugin> & PluginGetters<typeof ChartUIPlugin> & PluginGetters<typeof FigureUIPlugin>;
121
+ } & CoreGetters & EvaluationGetters & PluginGetters<typeof HistoryPlugin> & PluginGetters<typeof CollaborativePlugin> & PluginGetters<typeof SortPlugin> & PluginGetters<typeof UIOptionsPlugin> & PluginGetters<typeof SheetUIPlugin> & PluginGetters<typeof HeaderPositionsUIPlugin> & PluginGetters<typeof PivotUIPlugin> & PluginGetters<typeof CellIconPlugin> & PluginGetters<typeof GeoFeaturePlugin> & PluginGetters<typeof LockSheetPlugin> & PluginGetters<typeof CarouselUIPlugin> & PluginGetters<typeof ColorThemeUIPlugin> & PluginGetters<typeof ChartUIPlugin> & PluginGetters<typeof FigureUIPlugin>;
123
122
  export type Getters = RenderingGetters & PluginGetters<typeof GridSelectionPlugin>;
124
123
  export interface ViewportsGetters {
125
124
  getColDimensions: Getters["getColDimensions"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/o-spreadsheet",
3
- "version": "19.5.0-alpha.18",
3
+ "version": "19.5.0-alpha.19",
4
4
  "description": "A spreadsheet component",
5
5
  "type": "module",
6
6
  "main": "dist/o_spreadsheet.cjs",
@@ -143,7 +143,7 @@
143
143
  "xmlSelfClosingSpace": false
144
144
  },
145
145
  "dependencies": {
146
- "@odoo/owl": "3.0.0-alpha.47",
146
+ "@odoo/owl": "3.0.0-alpha.49",
147
147
  "bootstrap": "5.3.3",
148
148
  "rbush": "^3.0.1"
149
149
  },