@odoo/o-spreadsheet 19.5.0-alpha.9 → 20.1.0-alpha.0
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.
- package/dist/material_symbols_outlined.css +9 -0
- package/dist/o_spreadsheet.cjs +34889 -32633
- package/dist/o_spreadsheet.css +271 -127
- package/dist/o_spreadsheet.esm.js +29707 -27456
- package/dist/o_spreadsheet.iife.js +30429 -28173
- package/dist/o_spreadsheet.min.iife.js +408 -354
- package/dist/o_spreadsheet.xml +303 -239
- package/dist/types/actions/data_actions.d.ts +1 -0
- package/dist/types/actions/menu_items_actions.d.ts +3 -2
- package/dist/types/collaborative/command_squisher.d.ts +1 -1
- package/dist/types/collaborative/session.d.ts +3 -1
- package/dist/types/components/autofill/autofill.d.ts +1 -1
- package/dist/types/components/autofill/autofill_store.d.ts +1 -1
- package/dist/types/components/bottom_bar/bottom_bar_statistic/bottom_bar_statistic.d.ts +3 -0
- package/dist/types/components/dashboard/clickable_cell_sort_icon/clickable_cell_sort_icon.d.ts +1 -1
- package/dist/types/components/dashboard/dashboard.d.ts +1 -0
- package/dist/types/components/figures/chart/chartJs/chartjs_geo_projection_plugin.d.ts +12 -0
- package/dist/types/components/figures/chart/chartJs/zoomable_chart/zoomable_chartjs.d.ts +1 -0
- package/dist/types/components/figures/chart/gauge/gauge_chart_component.d.ts +1 -1
- package/dist/types/components/figures/chart/scorecard/chart_scorecard.d.ts +1 -1
- package/dist/types/components/figures/figure/figure.d.ts +7 -3
- package/dist/types/components/figures/figure_carousel/figure_carousel.d.ts +10 -2
- package/dist/types/components/figures/figure_container/figure_container.d.ts +8 -4
- package/dist/types/components/full_screen_figure/full_screen_figure.d.ts +12 -1
- package/dist/types/components/grid/grid.d.ts +3 -0
- package/dist/types/components/grid_overlay/grid_overlay.d.ts +2 -0
- package/dist/types/components/grid_popover/grid_popover.d.ts +1 -1
- package/dist/types/components/headers_overlay/headers_overlay.d.ts +2 -0
- package/dist/types/components/helpers/chart_drag_and_drop.d.ts +15 -0
- package/dist/types/components/helpers/dom_helpers.d.ts +3 -2
- package/dist/types/components/helpers/draw_grid_hook.d.ts +1 -2
- package/dist/types/components/helpers/figure_drag_helper.d.ts +3 -3
- package/dist/types/components/helpers/figure_snap_helper.d.ts +8 -3
- package/dist/types/components/helpers/zoom.d.ts +0 -14
- package/dist/types/components/highlight/highlight/highlight.d.ts +1 -0
- package/dist/types/components/link/link_editor/link_editor.d.ts +2 -1
- package/dist/types/components/popover/popover.d.ts +0 -1
- package/dist/types/components/popover/popover_container_owl_plugin.d.ts +5 -0
- package/dist/types/components/scrollbar/scrollbar_horizontal.d.ts +1 -0
- package/dist/types/components/scrollbar/scrollbar_vertical.d.ts +1 -0
- package/dist/types/components/side_panel/carousel_panel/carousel_panel.d.ts +1 -1
- package/dist/types/components/side_panel/chart/building_blocks/chart_title/chart_title.d.ts +1 -0
- package/dist/types/components/side_panel/chart/building_blocks/color_scale/color_scale_picker.d.ts +1 -1
- package/dist/types/components/side_panel/chart/calendar_chart/calendar_chart_config_panel.d.ts +0 -2
- package/dist/types/components/side_panel/chart/chart_type_picker_popover/chart_type_picker_popover.d.ts +0 -1
- package/dist/types/components/side_panel/chart/scorecard_chart_panel/scorecard_chart_config_panel.d.ts +6 -10
- package/dist/types/components/side_panel/components/radio_selection/radio_selection.d.ts +1 -1
- package/dist/types/components/side_panel/data_analysis/chart_suggestion_preview.d.ts +19 -0
- package/dist/types/components/side_panel/data_analysis/data_analysis_panel.d.ts +17 -0
- package/dist/types/components/side_panel/data_analysis/data_analysis_store.d.ts +15 -0
- package/dist/types/components/side_panel/find_and_replace/find_and_replace.d.ts +1 -0
- package/dist/types/components/side_panel/find_and_replace/find_and_replace_store.d.ts +2 -1
- package/dist/types/components/side_panel/pivot/pivot_layout_configurator/pivot_layout_configurator.d.ts +1 -6
- package/dist/types/components/side_panel/side_panel/side_panel_store.d.ts +2 -1
- package/dist/types/components/side_panel/table_panel/table_panel.d.ts +6 -0
- package/dist/types/components/side_panel/table_style_editor_panel/table_style_editor_panel.d.ts +2 -0
- package/dist/types/components/spreadsheet/spreadsheet.d.ts +11 -5
- package/dist/types/components/spreadsheet_print/print_iframe.d.ts +15 -0
- package/dist/types/components/spreadsheet_print/spreadsheet_print.d.ts +4 -0
- package/dist/types/components/standalone_grid_canvas/carousel_data_view_print.d.ts +32 -0
- package/dist/types/components/standalone_grid_canvas/standalone_grid_canvas.d.ts +395 -1
- package/dist/types/components/standalone_viewport/standalone_viewport.d.ts +8 -4
- package/dist/types/components/standalone_viewport/standalone_viewport_store.d.ts +2 -1
- package/dist/types/components/tables/hovered_table_store.d.ts +6 -7
- package/dist/types/components/tables/table_resizer/table_resizer.d.ts +1 -0
- package/dist/types/components/tables/table_styles_popover/table_styles_popover.d.ts +0 -1
- package/dist/types/components/top_bar/color_editor/color_editor.d.ts +1 -1
- package/dist/types/components/top_bar/zoom_editor/zoom_editor.d.ts +1 -1
- package/dist/types/constants.d.ts +17 -2
- package/dist/types/formulas/compiler.d.ts +1 -1
- package/dist/types/functions/function_registry.d.ts +3 -0
- package/dist/types/functions/helper_lookup.d.ts +1 -1
- package/dist/types/functions/helpers.d.ts +4 -0
- package/dist/types/functions/module_operators.d.ts +1 -1
- package/dist/types/functions/module_text.d.ts +16 -13
- package/dist/types/functions/module_web.d.ts +1 -1
- package/dist/types/helpers/carousel_helpers.d.ts +8 -1
- package/dist/types/helpers/cells/cell_evaluation.d.ts +1 -1
- package/dist/types/helpers/color.d.ts +1 -1
- package/dist/types/helpers/color_themes.d.ts +2 -0
- package/dist/types/helpers/data_analysis.d.ts +17 -0
- package/dist/types/helpers/figures/chart.d.ts +7 -6
- package/dist/types/helpers/figures/charts/chart_common.d.ts +3 -3
- package/dist/types/helpers/figures/charts/chart_data_source_helpers.d.ts +10 -0
- package/dist/types/helpers/figures/charts/chart_data_sources.d.ts +3 -3
- package/dist/types/helpers/figures/charts/chart_suggestion_engine.d.ts +8 -0
- package/dist/types/helpers/figures/charts/chart_ui_common.d.ts +11 -4
- package/dist/types/helpers/figures/charts/charts_suggestions_constants.d.ts +37 -0
- package/dist/types/helpers/figures/charts/gauge_chart_rendering.d.ts +6 -2
- package/dist/types/helpers/figures/charts/runtime/chart_data_extractor.d.ts +13 -12
- package/dist/types/helpers/figures/charts/runtime/chartjs_title.d.ts +2 -2
- package/dist/types/helpers/filter_helpers.d.ts +2 -2
- package/dist/types/helpers/links.d.ts +1 -1
- package/dist/types/helpers/owl3_helpers.d.ts +4 -0
- package/dist/types/helpers/pivot/pivot_composer_helpers.d.ts +1 -1
- package/dist/types/helpers/pivot/pivot_presentation.d.ts +2 -2
- package/dist/types/helpers/pivot/pivot_registry.d.ts +4 -5
- package/dist/types/helpers/pivot/spreadsheet_pivot/runtime_definition_spreadsheet_pivot.d.ts +2 -2
- package/dist/types/helpers/range.d.ts +1 -1
- package/dist/types/helpers/rectangle.d.ts +4 -0
- package/dist/types/helpers/text_helper.d.ts +1 -1
- package/dist/types/helpers/viewport_collection.d.ts +2 -6
- package/dist/types/index.d.ts +22 -10
- package/dist/types/model.d.ts +17 -10
- package/dist/types/owl3_compatibility_layer.d.ts +1 -14
- package/dist/types/plugins/core/carousel.d.ts +1 -1
- package/dist/types/plugins/core/image.d.ts +2 -1
- package/dist/types/plugins/core/range.d.ts +4 -2
- package/dist/types/plugins/core/squisher.d.ts +6 -2
- package/dist/types/plugins/core/tables.d.ts +2 -1
- package/dist/types/plugins/core/unsquisher.d.ts +1 -1
- package/dist/types/plugins/core_plugin.d.ts +1 -1
- package/dist/types/plugins/{ui_stateful → evaluation}/cell_computed_style.d.ts +4 -4
- package/dist/types/plugins/{ui_core_views/cell_evaluation/evaluation_plugin.d.ts → evaluation/cell_evaluation/cell_evaluation_plugin.d.ts} +7 -7
- package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/compilation_parameters.d.ts +2 -2
- package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/evaluator.d.ts +2 -2
- package/dist/types/plugins/{ui_core_views → evaluation}/custom_colors.d.ts +5 -5
- package/dist/types/plugins/{ui_core_views → evaluation}/dynamic_tables.d.ts +4 -4
- package/dist/types/plugins/{ui_feature → evaluation}/dynamic_translate.d.ts +2 -2
- package/dist/types/plugins/evaluation/evaluation_chart.d.ts +27 -0
- package/dist/types/plugins/{ui_core_views → evaluation}/evaluation_conditional_format.d.ts +4 -4
- package/dist/types/plugins/{ui_core_views → evaluation}/evaluation_data_validation.d.ts +4 -4
- package/dist/types/plugins/{ui_stateful → evaluation}/filter_evaluation.d.ts +5 -5
- package/dist/types/plugins/{ui_core_views → evaluation}/fingerprint.d.ts +2 -2
- package/dist/types/plugins/evaluation/formula_tracker.d.ts +8 -0
- package/dist/types/plugins/evaluation/geo_loader.d.ts +13 -0
- package/dist/types/plugins/{ui_core_views → evaluation}/header_sizes_ui.d.ts +5 -5
- package/dist/types/plugins/{ui_stateful/header_visibility_ui.d.ts → evaluation/header_visibility_evaluation.d.ts} +2 -2
- package/dist/types/plugins/evaluation/pivot_presence_plugin.d.ts +12 -0
- package/dist/types/plugins/{ui_core_views → evaluation}/pivot_ui.d.ts +6 -6
- package/dist/types/plugins/evaluation/subtotal_evaluation.d.ts +5 -0
- package/dist/types/plugins/{ui_stateful → evaluation}/table_computed_style.d.ts +7 -7
- package/dist/types/plugins/evaluation_plugin.d.ts +31 -0
- package/dist/types/plugins/plugin_registries.d.ts +11 -5
- package/dist/types/plugins/ui_feature/chart_ui.d.ts +6 -0
- package/dist/types/plugins/ui_feature/color_theme.d.ts +0 -3
- package/dist/types/plugins/ui_feature/geo_features.d.ts +1 -6
- package/dist/types/plugins/ui_plugin.d.ts +1 -4
- package/dist/types/plugins/{ui_core_views → ui_stateful}/cell_icon_plugin.d.ts +2 -2
- package/dist/types/registries/chart_data_source_registry.d.ts +4 -5
- package/dist/types/registries/chart_registry.d.ts +5 -5
- package/dist/types/registries/criterion_registry.d.ts +4 -4
- package/dist/types/registries/evaluation_registry.d.ts +2 -2
- package/dist/types/registries/figures_registry.d.ts +6 -2
- package/dist/types/stores/cell_hover_overlay_store.d.ts +15 -0
- package/dist/types/stores/chart_drag_store.d.ts +10 -0
- package/dist/types/{plugins/ui_stateful/clipboard.d.ts → stores/clipboard_store.d.ts} +11 -11
- package/dist/types/stores/grid_renderer_store.d.ts +3 -2
- package/dist/types/stores/main_viewport_store.d.ts +3 -0
- package/dist/types/stores/viewports_store.d.ts +3 -6
- package/dist/types/stores/zoom_store.d.ts +27 -0
- package/dist/types/types/chart/chart.d.ts +3 -1
- package/dist/types/types/chart/chart_suggestion.d.ts +137 -0
- package/dist/types/types/chart/scorecard_chart.d.ts +3 -4
- package/dist/types/types/collaborative/transport_service.d.ts +4 -1
- package/dist/types/types/commands.d.ts +39 -19
- package/dist/types/types/functions.d.ts +2 -2
- package/dist/types/types/getters.d.ts +102 -21
- package/dist/types/types/model.d.ts +2 -4
- package/dist/types/types/rendering.d.ts +20 -1
- package/package.json +6 -5
- package/dist/types/plugins/core_view_plugin.d.ts +0 -29
- package/dist/types/plugins/ui_core_views/evaluation_chart.d.ts +0 -26
- package/dist/types/plugins/ui_core_views/formula_tracker.d.ts +0 -8
- package/dist/types/plugins/ui_feature/pivot_presence_plugin.d.ts +0 -11
- package/dist/types/plugins/ui_feature/subtotal_evaluation.d.ts +0 -5
- package/dist/types/types/core_getters.d.ts +0 -77
- /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/binary_grid.d.ts +0 -0
- /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/formula_dependency_graph.d.ts +0 -0
- /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/interval_tree.d.ts +0 -0
- /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/position_set.d.ts +0 -0
- /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/r_tree.d.ts +0 -0
- /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/range_set.d.ts +0 -0
- /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/spreading_relation.d.ts +0 -0
- /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/zone_set.d.ts +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandResult, EvaluationCommand } from "../../types/commands";
|
|
2
2
|
import { CellPosition, UID } from "../../types/misc";
|
|
3
3
|
import { CriterionFilter, DataFilterValue } from "../../types/table";
|
|
4
4
|
import { ExcelWorkbookData } from "../../types/workbook_data";
|
|
5
|
-
import {
|
|
6
|
-
export declare class FilterEvaluationPlugin extends
|
|
5
|
+
import { EvaluationPlugin } from "../evaluation_plugin";
|
|
6
|
+
export declare class FilterEvaluationPlugin extends EvaluationPlugin {
|
|
7
7
|
static getters: readonly ["getFilterValue", "getFilterHiddenValues", "getFilterCriterionValue", "isRowFiltered", "isFilterActive"];
|
|
8
8
|
private filterValues;
|
|
9
9
|
hiddenRows: Record<UID, Set<number> | undefined>;
|
|
10
10
|
isEvaluationDirty: boolean;
|
|
11
|
-
allowDispatch(cmd:
|
|
12
|
-
handle(cmd:
|
|
11
|
+
allowDispatch(cmd: EvaluationCommand): CommandResult;
|
|
12
|
+
handle(cmd: EvaluationCommand): void;
|
|
13
13
|
finalize(): void;
|
|
14
14
|
isRowFiltered(sheetId: UID, row: number): boolean;
|
|
15
15
|
getFilterValue(position: CellPosition): DataFilterValue | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Cell } from "../../types/cells";
|
|
2
|
-
import {
|
|
2
|
+
import { EvaluationPlugin } from "../evaluation_plugin";
|
|
3
3
|
/**
|
|
4
4
|
* A string that represents the shape of a formula.
|
|
5
5
|
*/
|
|
6
6
|
export type Fingerprint = string;
|
|
7
|
-
export declare class FingerprintPlugin extends
|
|
7
|
+
export declare class FingerprintPlugin extends EvaluationPlugin {
|
|
8
8
|
static getters: readonly ["getCellFingerprint"];
|
|
9
9
|
getCellFingerprint(cell: Cell): Fingerprint | undefined;
|
|
10
10
|
private computeFormulaFingerprint;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EvaluationCommand } from "../../types/commands";
|
|
2
|
+
import { EvaluationPlugin } from "../evaluation_plugin";
|
|
3
|
+
export declare class FormulaTrackerPlugin extends EvaluationPlugin {
|
|
4
|
+
static getters: readonly ["getCellsWithTrackedFormula"];
|
|
5
|
+
private trackedCells;
|
|
6
|
+
handle(cmd: EvaluationCommand): void;
|
|
7
|
+
getCellsWithTrackedFormula(formula: string): number[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GeoChartRegion } from "../../types/chart/geo_chart";
|
|
2
|
+
import { EvaluationPlugin, EvaluationPluginConfig } from "../evaluation_plugin";
|
|
3
|
+
export declare class GeoLoaderEvaluation extends EvaluationPlugin {
|
|
4
|
+
static getters: readonly ["getGeoJsonFeatures", "geoFeatureNameToId", "getGeoChartAvailableRegions", "loadUsedGeoJsonFeatures"];
|
|
5
|
+
private readonly geoJsonService;
|
|
6
|
+
private geoJsonCache;
|
|
7
|
+
constructor(config: EvaluationPluginConfig);
|
|
8
|
+
getGeoChartAvailableRegions(): GeoChartRegion[];
|
|
9
|
+
getGeoJsonFeatures(region: string): GeoJSON.Feature[] | undefined;
|
|
10
|
+
geoFeatureNameToId(region: string, featureName: string): string | undefined;
|
|
11
|
+
private convertToGeoJson;
|
|
12
|
+
loadUsedGeoJsonFeatures(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Canvas2DContext } from "../../types/canvas";
|
|
2
|
-
import {
|
|
2
|
+
import { EvaluationCommand } from "../../types/commands";
|
|
3
3
|
import { AnchorOffset } from "../../types/figure";
|
|
4
4
|
import { CellPosition, Dimension, HeaderIndex, Immutable, Pixel, UID } from "../../types/misc";
|
|
5
|
-
import {
|
|
5
|
+
import { EvaluationPlugin } from "../evaluation_plugin";
|
|
6
6
|
interface HeaderSizeState {
|
|
7
7
|
tallestCellInRow: Immutable<Record<UID, Array<CellWithSize | undefined>>>;
|
|
8
8
|
}
|
|
@@ -10,12 +10,12 @@ interface CellWithSize {
|
|
|
10
10
|
cell: CellPosition;
|
|
11
11
|
size: Pixel;
|
|
12
12
|
}
|
|
13
|
-
export declare class HeaderSizeUIPlugin extends
|
|
13
|
+
export declare class HeaderSizeUIPlugin extends EvaluationPlugin<HeaderSizeState> implements HeaderSizeState {
|
|
14
14
|
static getters: readonly ["getRowSize", "getHeaderSize", "getMaxAnchorOffset"];
|
|
15
15
|
readonly tallestCellInRow: Immutable<Record<UID, Array<CellWithSize | undefined>>>;
|
|
16
16
|
ctx: Canvas2DContext;
|
|
17
|
-
beforeHandle(cmd:
|
|
18
|
-
handle(cmd:
|
|
17
|
+
beforeHandle(cmd: EvaluationCommand): void;
|
|
18
|
+
handle(cmd: EvaluationCommand): void;
|
|
19
19
|
getRowSize(sheetId: UID, row: HeaderIndex): Pixel;
|
|
20
20
|
getMaxAnchorOffset(sheetId: UID, height: Pixel, width: Pixel): AnchorOffset;
|
|
21
21
|
getHeaderSize(sheetId: UID, dimension: Dimension, index: HeaderIndex): Pixel;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CellPosition, Dimension, HeaderIndex, UID } from "../../types/misc";
|
|
2
2
|
import { ExcelWorkbookData } from "../../types/workbook_data";
|
|
3
|
-
import {
|
|
4
|
-
export declare class
|
|
3
|
+
import { EvaluationPlugin } from "../evaluation_plugin";
|
|
4
|
+
export declare class HeaderVisibilityEvaluationPlugin extends EvaluationPlugin {
|
|
5
5
|
static getters: readonly ["getNextVisibleCellPosition", "findVisibleHeader", "findLastVisibleColRowIndex", "findFirstVisibleColRowIndex", "isRowHidden", "isColHidden", "isHeaderHidden"];
|
|
6
6
|
isRowHidden(sheetId: UID, index: number): boolean;
|
|
7
7
|
isColHidden(sheetId: UID, index: number): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PivotPresenceTracker } from "../../helpers/pivot/pivot_presence_tracker";
|
|
2
|
+
import { EvaluationCommand } from "../../types/commands";
|
|
3
|
+
import { UID } from "../../types/misc";
|
|
4
|
+
import { EvaluationPlugin } from "../evaluation_plugin";
|
|
5
|
+
export declare class PivotPresencePlugin extends EvaluationPlugin {
|
|
6
|
+
static getters: readonly ["getPivotPresenceTracker"];
|
|
7
|
+
private trackPresencePivotId?;
|
|
8
|
+
private sheetId?;
|
|
9
|
+
private tracker?;
|
|
10
|
+
handle(cmd: EvaluationCommand): void;
|
|
11
|
+
getPivotPresenceTracker(pivotId: UID, sheetId: UID): PivotPresenceTracker | undefined;
|
|
12
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { CompiledFormula } from "../../formulas/compiler";
|
|
2
2
|
import { CellValue } from "../../types/cells";
|
|
3
|
-
import {
|
|
3
|
+
import { EvaluationCommand } from "../../types/commands";
|
|
4
4
|
import { CellPosition, Matrix, SortDirection, UID } from "../../types/misc";
|
|
5
5
|
import { PivotCoreMeasure, PivotStyle, PivotTableCell } from "../../types/pivot";
|
|
6
6
|
import { Pivot } from "../../types/pivot_runtime";
|
|
7
|
-
import {
|
|
7
|
+
import { EvaluationPlugin, EvaluationPluginConfig } from "../evaluation_plugin";
|
|
8
8
|
export declare const UNDO_REDO_PIVOT_COMMANDS: string[];
|
|
9
9
|
interface PivotEvaluatedArgs {
|
|
10
10
|
functionName: string;
|
|
11
11
|
args: (CellValue | Matrix<CellValue> | undefined)[];
|
|
12
12
|
}
|
|
13
|
-
export declare class PivotUIPlugin extends
|
|
13
|
+
export declare class PivotUIPlugin extends EvaluationPlugin {
|
|
14
14
|
static getters: readonly ["getPivot", "getFirstPivotFunction", "getPivotCellSortDirection", "getPivotIdFromPosition", "getPivotIdsFromPosition", "getPivotCellFromPosition", "generateNewCalculatedMeasureName", "isPivotUnused", "isSpillPivotFormula", "getAllPivotArrayFormulas", "getPivotStyleAtPosition"];
|
|
15
15
|
private pivots;
|
|
16
16
|
private unusedPivotsInFormulas?;
|
|
17
17
|
private custom;
|
|
18
18
|
private pivotPositionCache;
|
|
19
19
|
private shouldInvalidateCache;
|
|
20
|
-
constructor(config:
|
|
21
|
-
beforeHandle(cmd:
|
|
22
|
-
handle(cmd:
|
|
20
|
+
constructor(config: EvaluationPluginConfig);
|
|
21
|
+
beforeHandle(cmd: EvaluationCommand): void;
|
|
22
|
+
handle(cmd: EvaluationCommand): void;
|
|
23
23
|
finalize(): void;
|
|
24
24
|
/**
|
|
25
25
|
* Get the id of the first pivot in the formula at the given position. Returns undefined if there
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Command } from "../../types/commands";
|
|
1
|
+
import { Command, EvaluationCommand } from "../../types/commands";
|
|
2
2
|
import { Border, CellPosition, Style } from "../../types/misc";
|
|
3
|
-
import {
|
|
4
|
-
export declare class TableComputedStylePlugin extends
|
|
3
|
+
import { EvaluationPlugin } from "../evaluation_plugin";
|
|
4
|
+
export declare class TableComputedStylePlugin extends EvaluationPlugin {
|
|
5
5
|
static getters: readonly ["getCellTableStyle", "getCellTableBorder"];
|
|
6
6
|
private tableStyles;
|
|
7
|
-
handle(cmd:
|
|
7
|
+
handle(cmd: EvaluationCommand): void;
|
|
8
8
|
finalize(): void;
|
|
9
9
|
getCellTableStyle(position: CellPosition): Style | undefined;
|
|
10
10
|
getCellTableBorder(position: CellPosition): Border | undefined;
|
|
@@ -21,8 +21,8 @@ export declare class TableComputedStylePlugin extends UIPlugin {
|
|
|
21
21
|
*/
|
|
22
22
|
private getTableMapping;
|
|
23
23
|
}
|
|
24
|
-
declare const invalidateTableStyleCommands: readonly ["HIDE_COLUMNS_ROWS", "UNHIDE_COLUMNS_ROWS", "UNFOLD_HEADER_GROUP", "UNGROUP_HEADERS", "FOLD_HEADER_GROUP", "FOLD_ALL_HEADER_GROUPS", "UNFOLD_ALL_HEADER_GROUPS", "FOLD_HEADER_GROUPS_IN_ZONE", "UNFOLD_HEADER_GROUPS_IN_ZONE", "CREATE_TABLE", "UPDATE_TABLE", "UPDATE_FILTER", "REMOVE_TABLE", "
|
|
25
|
-
export declare function doesCommandInvalidatesTableStyle(cmd:
|
|
24
|
+
declare const invalidateTableStyleCommands: readonly ["HIDE_COLUMNS_ROWS", "UNHIDE_COLUMNS_ROWS", "UNFOLD_HEADER_GROUP", "UNGROUP_HEADERS", "FOLD_HEADER_GROUP", "FOLD_ALL_HEADER_GROUPS", "UNFOLD_ALL_HEADER_GROUPS", "FOLD_HEADER_GROUPS_IN_ZONE", "UNFOLD_HEADER_GROUPS_IN_ZONE", "CREATE_TABLE", "UPDATE_TABLE", "UPDATE_FILTER", "REMOVE_TABLE", "CREATE_TABLE_STYLE", "REMOVE_TABLE_STYLE", "DELETE_CONTENT"];
|
|
25
|
+
export declare function doesCommandInvalidatesTableStyle<C extends Command>(cmd: C): cmd is Extract<C, {
|
|
26
26
|
type: (typeof invalidateTableStyleCommands)[number];
|
|
27
|
-
}
|
|
27
|
+
}>;
|
|
28
28
|
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Session } from "../collaborative/session";
|
|
2
|
+
import { StateObserver } from "../state_observer";
|
|
3
|
+
import { EvaluationCommand, EvaluationCommandDispatcher } from "../types/commands";
|
|
4
|
+
import { Currency } from "../types/currency";
|
|
5
|
+
import { EvaluationGetters } from "../types/getters";
|
|
6
|
+
import { Color } from "../types/misc";
|
|
7
|
+
import { ModelConfig } from "../types/model";
|
|
8
|
+
import { BasePlugin } from "./base_plugin";
|
|
9
|
+
export interface EvaluationPluginConfig {
|
|
10
|
+
readonly getters: EvaluationGetters;
|
|
11
|
+
readonly stateObserver: StateObserver;
|
|
12
|
+
readonly custom: ModelConfig["custom"];
|
|
13
|
+
readonly session: Session;
|
|
14
|
+
readonly dispatch: EvaluationCommandDispatcher["dispatch"];
|
|
15
|
+
readonly defaultCurrency?: Partial<Currency>;
|
|
16
|
+
readonly customColors: Color[];
|
|
17
|
+
readonly external: ModelConfig["external"];
|
|
18
|
+
}
|
|
19
|
+
export interface EvaluationPluginConstructor {
|
|
20
|
+
new (config: EvaluationPluginConfig): EvaluationPlugin;
|
|
21
|
+
getters: readonly string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Evaluation plugins handle any data derived from core data (i.e. evaluation).
|
|
25
|
+
* They cannot impact the model data (i.e. cannot dispatch core commands).
|
|
26
|
+
*/
|
|
27
|
+
export declare class EvaluationPlugin<State = any> extends BasePlugin<State, EvaluationCommand> {
|
|
28
|
+
protected getters: EvaluationGetters;
|
|
29
|
+
protected dispatch: EvaluationCommandDispatcher["dispatch"];
|
|
30
|
+
constructor({ getters, stateObserver, dispatch }: EvaluationPluginConfig);
|
|
31
|
+
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { Registry } from "../registries/registry";
|
|
2
2
|
import { CorePluginConstructor } from "./core_plugin";
|
|
3
|
-
import {
|
|
3
|
+
import { EvaluationPluginConstructor } from "./evaluation_plugin";
|
|
4
4
|
import { UIPluginConstructor } from "./ui_plugin";
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export declare class PluginRegistry<T extends new (config: any) => any> extends Registry<T> {
|
|
6
|
+
private readonly PluginClass;
|
|
7
|
+
constructor(PluginClass: new (config: any) => any);
|
|
8
|
+
add(key: string, value: T): this;
|
|
9
|
+
replace(key: string, value: T): this;
|
|
10
|
+
}
|
|
11
|
+
export declare const corePluginRegistry: PluginRegistry<CorePluginConstructor>;
|
|
12
|
+
export declare const featurePluginRegistry: PluginRegistry<UIPluginConstructor>;
|
|
13
|
+
export declare const statefulUIPluginRegistry: PluginRegistry<UIPluginConstructor>;
|
|
14
|
+
export declare const evaluationPluginRegistry: PluginRegistry<EvaluationPluginConstructor>;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Command } from "../../types/commands";
|
|
2
2
|
import { GridRenderingTheme } from "../../types/rendering";
|
|
3
3
|
import { UIPlugin, UIPluginConfig } from "../ui_plugin";
|
|
4
|
-
export declare const BACKGROUND_HEADER_SELECTED_COLOR = "#E8EAED";
|
|
5
|
-
export declare const BACKGROUND_HEADER_ACTIVE_COLOR = "#595959";
|
|
6
|
-
export declare const COLOR_THEMES: Record<string, GridRenderingTheme>;
|
|
7
4
|
export declare class ColorThemeUIPlugin extends UIPlugin {
|
|
8
5
|
static getters: readonly ["isDarkMode", "getSpreadsheetTheme"];
|
|
9
6
|
private colorScheme?;
|
|
@@ -3,21 +3,16 @@ import { Command } from "../../types/commands";
|
|
|
3
3
|
import { UID } from "../../types/misc";
|
|
4
4
|
import { UIPlugin, UIPluginConfig } from "../ui_plugin";
|
|
5
5
|
export declare class GeoFeaturePlugin extends UIPlugin {
|
|
6
|
-
static getters: readonly ["
|
|
6
|
+
static getters: readonly ["getAvailableChartRegions"];
|
|
7
7
|
private readonly geoJsonService;
|
|
8
|
-
private geoJsonCache;
|
|
9
8
|
/** Stores the initial region of each geo chart at the time of the START command */
|
|
10
9
|
private initialRegions;
|
|
11
10
|
constructor(config: UIPluginConfig);
|
|
12
11
|
handle(cmd: Command): void;
|
|
13
12
|
private trackInitialRegion;
|
|
14
|
-
getGeoChartAvailableRegions(): GeoChartRegion[];
|
|
15
13
|
/**
|
|
16
14
|
* Returns the regions that can be selected as an alternative for a given geo chart in dashboard mode.
|
|
17
15
|
* The available alternatives are based on the initial region of the chart (before any dashboard-level change).
|
|
18
16
|
*/
|
|
19
17
|
getAvailableChartRegions(chartId: UID): GeoChartRegion[];
|
|
20
|
-
getGeoJsonFeatures(region: string): GeoJSON.Feature[] | undefined;
|
|
21
|
-
geoFeatureNameToId(region: string, featureName: string): string | undefined;
|
|
22
|
-
private convertToGeoJson;
|
|
23
18
|
}
|
|
@@ -9,7 +9,6 @@ import { ModelConfig } from "../types/model";
|
|
|
9
9
|
import { GridRenderingContext, LayerName } from "../types/rendering";
|
|
10
10
|
import { SelectionStreamProcessor } from "../types/selection_stream_processor";
|
|
11
11
|
import { BasePlugin } from "./base_plugin";
|
|
12
|
-
export type UIActions = Pick<ModelConfig, "notifyUI" | "raiseBlockingErrorUI">;
|
|
13
12
|
export interface UIPluginConfig {
|
|
14
13
|
readonly getters: Getters;
|
|
15
14
|
readonly stateObserver: StateObserver;
|
|
@@ -17,7 +16,6 @@ export interface UIPluginConfig {
|
|
|
17
16
|
readonly canDispatch: CommandDispatcher["dispatch"];
|
|
18
17
|
readonly selection: SelectionStreamProcessor;
|
|
19
18
|
readonly moveClient: (position: ClientPosition) => void;
|
|
20
|
-
readonly uiActions: UIActions;
|
|
21
19
|
readonly custom: ModelConfig["custom"];
|
|
22
20
|
readonly session: Session;
|
|
23
21
|
readonly defaultCurrency?: Partial<Currency>;
|
|
@@ -37,10 +35,9 @@ export interface UIPluginConstructor {
|
|
|
37
35
|
export declare class UIPlugin<State = any> extends BasePlugin<State, Command> {
|
|
38
36
|
static layers: Readonly<LayerName[]>;
|
|
39
37
|
protected getters: Getters;
|
|
40
|
-
protected ui: UIActions;
|
|
41
38
|
protected selection: SelectionStreamProcessor;
|
|
42
39
|
protected dispatch: CommandDispatcher["dispatch"];
|
|
43
40
|
protected canDispatch: CommandDispatcher["dispatch"];
|
|
44
|
-
constructor({ getters, stateObserver, dispatch, canDispatch,
|
|
41
|
+
constructor({ getters, stateObserver, dispatch, canDispatch, selection }: UIPluginConfig);
|
|
45
42
|
drawLayer(ctx: GridRenderingContext, layer: LayerName): void;
|
|
46
43
|
}
|
|
@@ -2,8 +2,8 @@ import { GridIcon } from "../../registries/icons_on_cell_registry";
|
|
|
2
2
|
import { Command } from "../../types/commands";
|
|
3
3
|
import { CellPosition } from "../../types/misc";
|
|
4
4
|
import { Rect } from "../../types/rendering";
|
|
5
|
-
import {
|
|
6
|
-
export declare class CellIconPlugin extends
|
|
5
|
+
import { UIPlugin } from "../ui_plugin";
|
|
6
|
+
export declare class CellIconPlugin extends UIPlugin {
|
|
7
7
|
static getters: readonly ["doesCellHaveGridIcon", "getCellIcons", "getCellIconRect"];
|
|
8
8
|
private cellIconsCache;
|
|
9
9
|
handle(cmd: Command): void;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type * as ChartJS from "chart.js";
|
|
2
2
|
import { ChartCreationContext, ChartData, ChartDataSource, ChartDataSourceType, ChartType, DataSetStyle, ExcelChartDefinition } from "../types/chart/chart";
|
|
3
3
|
import { CommandResult } from "../types/commands";
|
|
4
|
-
import { CoreGetters } from "../types/
|
|
5
|
-
import { Getters } from "../types/getters";
|
|
4
|
+
import { CoreGetters, EvaluationGetters } from "../types/getters";
|
|
6
5
|
import { RangeAdapterFunctions, UID } from "../types/misc";
|
|
7
6
|
import { Validator } from "../types/validator";
|
|
8
7
|
import { Registry } from "./registry";
|
|
@@ -13,15 +12,15 @@ export interface ChartDataSourceBuilder<TExternal, TInternal> {
|
|
|
13
12
|
fromHierarchicalContextCreation: (context: ChartCreationContext) => ChartDataSource<string>;
|
|
14
13
|
validate: (dataSource: TExternal, validator: Validator) => CommandResult | CommandResult[];
|
|
15
14
|
transform(dataSource: TExternal, defaultSheetId: UID, rangeAdapters: RangeAdapterFunctions): TExternal;
|
|
16
|
-
extractData(dataSource: TInternal, chartId: UID, getters:
|
|
17
|
-
extractHierarchicalData(dataSource: TInternal, chartId: UID, getters:
|
|
15
|
+
extractData(dataSource: TInternal, chartId: UID, getters: EvaluationGetters): ChartData;
|
|
16
|
+
extractHierarchicalData(dataSource: TInternal, chartId: UID, getters: EvaluationGetters): ChartData;
|
|
18
17
|
adaptRanges(dataSource: TInternal, rangeAdapters: RangeAdapterFunctions): TInternal;
|
|
19
18
|
duplicateInDuplicatedSheet(dataSource: TInternal, sheetIdFrom: UID, sheetIdTo: UID, getters: CoreGetters): TInternal;
|
|
20
19
|
getDefinition(dataSource: TInternal, defaultSheetId: UID, getters: CoreGetters): TExternal;
|
|
21
20
|
getContextCreation(dataSource: TExternal): ChartCreationContext;
|
|
22
21
|
getHierarchicalContextCreation(dataSource: TExternal): ChartCreationContext;
|
|
23
22
|
toExcelDataSets(dataSource: TInternal, dataSetStyles: DataSetStyle, getters: CoreGetters): Pick<ExcelChartDefinition, "dataSets" | "labelRange"> | undefined;
|
|
24
|
-
onDataSetClick?: (chartType: ChartType, chartId: UID, event: ChartJS.ChartEvent, items: ChartJS.ActiveElement[], chartJsChart: ChartJS.Chart, getters:
|
|
23
|
+
onDataSetClick?: (chartType: ChartType, chartId: UID, event: ChartJS.ChartEvent, items: ChartJS.ActiveElement[], chartJsChart: ChartJS.Chart, getters: EvaluationGetters) => void;
|
|
25
24
|
onDataSetHover?: (chartType: ChartType, chartId: UID, event: ChartJS.ChartEvent, items: ChartJS.ActiveElement[], chartJsChart: ChartJS.Chart) => void;
|
|
26
25
|
}
|
|
27
26
|
export interface ChartDataSourceRegistry extends Registry<ChartDataSourceBuilder<unknown, unknown>> {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CoreChartOptions } from "chart.js";
|
|
2
|
-
import { CompiledFormula } from "..";
|
|
2
|
+
import { ColorThemeName, CompiledFormula } from "..";
|
|
3
3
|
import { ChartCreationContext, ChartData, ChartRuntime, ChartType, ChartTypeDefinition, ExcelChartDefinition } from "../types/chart/chart";
|
|
4
4
|
import { CommandResult } from "../types/commands";
|
|
5
|
-
import { CoreGetters } from "../types/
|
|
6
|
-
import { Getters } from "../types/getters";
|
|
5
|
+
import { CoreGetters, EvaluationGetters } from "../types/getters";
|
|
7
6
|
import { RangeAdapterFunctions, UID } from "../types/misc";
|
|
8
7
|
import { Range } from "../types/range";
|
|
9
8
|
import { Validator } from "../types/validator";
|
|
@@ -46,13 +45,14 @@ export interface ChartTypeBuilder<T extends ChartType> {
|
|
|
46
45
|
* Get the definition of the chart used for excel export.
|
|
47
46
|
* If the chart is not supported by Excel, this function returns undefined.
|
|
48
47
|
*/
|
|
49
|
-
getDefinitionForExcel(getters:
|
|
50
|
-
getRuntime(getters:
|
|
48
|
+
getDefinitionForExcel(getters: EvaluationGetters, definition: ChartTypeDefinition<T, Range>, params: Pick<ExcelChartDefinition, "dataSets" | "labelRange">): ExcelChartDefinition | undefined;
|
|
49
|
+
getRuntime(getters: EvaluationGetters, definition: ChartTypeDefinition<T, Range>, chartDataExtractors: ChartDataExtractors, sheetId: UID, eventHandlers: ChartJsEventHandlers, colorThemeName: ColorThemeName): ChartRuntime;
|
|
51
50
|
/** Get all the formulas used in the chart */
|
|
52
51
|
getFormulas(getters: CoreGetters, sheetId: UID, definition: ChartTypeDefinition<T, Range>): CompiledFormula[];
|
|
53
52
|
allowedDefinitionKeys: readonly string[];
|
|
54
53
|
sequence: number;
|
|
55
54
|
dataSeriesLimit?: number;
|
|
55
|
+
loadDataForExport?: (getters: EvaluationGetters) => Promise<void>;
|
|
56
56
|
}
|
|
57
57
|
interface ChartDataExtractors {
|
|
58
58
|
extractData(): ChartData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CellValue } from "../types/cells";
|
|
2
2
|
import { EvaluatedCriterion, GenericCriterion, GenericCriterionType } from "../types/generic_criterion";
|
|
3
|
-
import {
|
|
3
|
+
import { EvaluationGetters } from "../types/getters";
|
|
4
4
|
import { UID } from "../types/misc";
|
|
5
5
|
import { Range } from "../types/range";
|
|
6
6
|
import { Registry } from "./registry";
|
|
@@ -20,13 +20,13 @@ export type CriterionEvaluator<T = unknown> = {
|
|
|
20
20
|
* For more complex criteria (like "top10"), we might want to pre-compute some data before evaluating the criterion for
|
|
21
21
|
* each cell, to avoid recomputing everything each time.
|
|
22
22
|
*/
|
|
23
|
-
preComputeCriterion?: (criterion: GenericCriterion, criterionRanges: Range[], getters:
|
|
23
|
+
preComputeCriterion?: (criterion: GenericCriterion, criterionRanges: Range[], getters: EvaluationGetters) => T;
|
|
24
24
|
/**
|
|
25
25
|
* Returns the error string to display when the value is not valid.
|
|
26
26
|
*
|
|
27
27
|
* The criterion values should be in canonical form (non-localized), and formulas should be evaluated.
|
|
28
28
|
*/
|
|
29
|
-
getErrorString: (criterion: EvaluatedCriterion, getters:
|
|
29
|
+
getErrorString: (criterion: EvaluatedCriterion, getters: EvaluationGetters, sheetId: UID) => string;
|
|
30
30
|
/**
|
|
31
31
|
* Checks if a criterion value is valid.
|
|
32
32
|
*
|
|
@@ -36,7 +36,7 @@ export type CriterionEvaluator<T = unknown> = {
|
|
|
36
36
|
/** Return the number of values that the criterion must contains. Return undefined if the criterion can have any number of values */
|
|
37
37
|
numberOfValues: (criterion: GenericCriterion) => number | undefined;
|
|
38
38
|
name: string;
|
|
39
|
-
getPreview: (criterion: GenericCriterion, getters:
|
|
39
|
+
getPreview: (criterion: GenericCriterion, getters: EvaluationGetters) => string;
|
|
40
40
|
/** Error string when a criterion value is invalid */
|
|
41
41
|
criterionValueErrorString: string;
|
|
42
42
|
allowedValues?: "onlyLiterals" | "onlyFormulas";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EvaluationGetters } from "../types/getters";
|
|
2
2
|
import { Registry } from "./registry";
|
|
3
3
|
/**
|
|
4
4
|
* This registry is used to register functions that should be called after each iteration of the evaluation.
|
|
@@ -6,4 +6,4 @@ import { Registry } from "./registry";
|
|
|
6
6
|
* to avoid to reload the data of the pivot at each function call (PIVOT.VALUE and PIVOT.HEADER). After each
|
|
7
7
|
* evaluation iteration, the pivot has to be re-evaluated during the next iteration.
|
|
8
8
|
*/
|
|
9
|
-
export declare const onIterationEndEvaluationRegistry: Registry<(getters:
|
|
9
|
+
export declare const onIterationEndEvaluationRegistry: Registry<(getters: EvaluationGetters) => void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Action } from "../actions/action";
|
|
2
|
+
import { Getters } from "../types/getters";
|
|
2
3
|
import { UID } from "../types/misc";
|
|
3
4
|
import { SpreadsheetChildEnv } from "../types/spreadsheet_env";
|
|
4
5
|
import { Registry } from "./registry";
|
|
@@ -11,9 +12,12 @@ import { Registry } from "./registry";
|
|
|
11
12
|
export interface FigureContent {
|
|
12
13
|
Component: any;
|
|
13
14
|
menuBuilder: (figureId: UID, env: SpreadsheetChildEnv) => Action[];
|
|
15
|
+
isThemeDependant: boolean;
|
|
14
16
|
SidePanelComponent?: string;
|
|
15
17
|
keepRatio?: boolean;
|
|
16
|
-
minFigSize
|
|
17
|
-
borderWidth
|
|
18
|
+
minFigSize: number;
|
|
19
|
+
borderWidth: (getters: Getters) => number;
|
|
20
|
+
hasShadow: (getters: Getters) => boolean;
|
|
21
|
+
isRounded: (getters: Getters) => boolean;
|
|
18
22
|
}
|
|
19
23
|
export declare const figureRegistry: Registry<FigureContent>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PositionMap } from "../helpers/cells/position_map";
|
|
2
|
+
import { CellPosition, Color } from "../types/misc";
|
|
3
|
+
import { SpreadsheetStore } from "./spreadsheet_store";
|
|
4
|
+
export interface CellHoverOverlayProvider {
|
|
5
|
+
getHighlightedPositions: (hoveredPosition: CellPosition) => CellPosition[];
|
|
6
|
+
}
|
|
7
|
+
export declare class CellHoverOverlayStore extends SpreadsheetStore {
|
|
8
|
+
mutators: readonly ["hover", "register", "unRegister"];
|
|
9
|
+
storeGetters: readonly ["getCellHoverOverlayColor"];
|
|
10
|
+
private providers;
|
|
11
|
+
overlayColors: PositionMap<Color>;
|
|
12
|
+
hover(hoveredPosition: CellPosition | undefined): "noStateChange" | undefined;
|
|
13
|
+
register(highlightProvider: CellHoverOverlayProvider): void;
|
|
14
|
+
unRegister(highlightProvider: CellHoverOverlayProvider): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UID } from "../types/misc";
|
|
2
|
+
/**
|
|
3
|
+
* Holds the id of the figure that a dragged chart suggestion is currently
|
|
4
|
+
* hovering over, so it can be highlighted reactively instead of through direct DOM manipulation.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ChartDragStore {
|
|
7
|
+
mutators: readonly ["setHighlightedFigure"];
|
|
8
|
+
highlightedFigureId: UID | undefined;
|
|
9
|
+
setHighlightedFigure(figureId: UID | undefined): void;
|
|
10
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { OSClipboardContent } from "
|
|
2
|
-
import { Command,
|
|
3
|
-
import { GridRenderingContext } from "
|
|
4
|
-
import {
|
|
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
|
|
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
|
|
13
|
-
|
|
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
|
|
21
|
-
|
|
22
|
-
|
|
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;
|
|
@@ -8,8 +8,9 @@ export declare const CELL_BACKGROUND_GRIDLINE_STROKE_STYLE = "#111";
|
|
|
8
8
|
export declare const CELL_ANIMATION_DURATION = 200;
|
|
9
9
|
export declare class GridRenderer extends DisposableStore {
|
|
10
10
|
private renderer;
|
|
11
|
+
storeGetters: readonly ["drawLayer"];
|
|
11
12
|
private fingerprints;
|
|
12
|
-
private
|
|
13
|
+
private cellHoverOverlayStore;
|
|
13
14
|
private hoveredIcon;
|
|
14
15
|
private lastRenderSheetId;
|
|
15
16
|
private lastRenderBoxes;
|
|
@@ -17,7 +18,7 @@ export declare class GridRenderer extends DisposableStore {
|
|
|
17
18
|
private zonesWithPreventedAnimationsInNextFrame;
|
|
18
19
|
private animations;
|
|
19
20
|
protected getters: RenderingGetters;
|
|
20
|
-
constructor(get: Get, renderer?: Store<RendererStore>);
|
|
21
|
+
constructor(get: Get, renderer?: Store<RendererStore> | null);
|
|
21
22
|
handle(cmd: Command): void;
|
|
22
23
|
finalize(): void;
|
|
23
24
|
get renderingLayers(): readonly ["Background", "Headers"];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from "../types/commands";
|
|
2
|
+
import { Get } from "../types/store_engine";
|
|
2
3
|
import { SpreadsheetStore } from "./spreadsheet_store";
|
|
3
4
|
/**
|
|
4
5
|
* The goal of this store is to make its attached viewport store follow the active sheet
|
|
@@ -6,6 +7,8 @@ import { SpreadsheetStore } from "./spreadsheet_store";
|
|
|
6
7
|
export declare class MainViewportStore extends SpreadsheetStore {
|
|
7
8
|
private viewStore;
|
|
8
9
|
private sheetIdAtFinalize;
|
|
10
|
+
constructor(get: Get);
|
|
11
|
+
private handleEvent;
|
|
9
12
|
protected handle(cmd: Command): void;
|
|
10
13
|
protected finalize(): void;
|
|
11
14
|
}
|
|
@@ -12,16 +12,16 @@ type getHeaderDimensionsCallback = (sheetId: UID, dimension: "COL" | "ROW", inde
|
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
14
|
export declare class ViewportsStore extends SpreadsheetStore {
|
|
15
|
-
mutators: readonly ["setViewportOffset", "resizeSheetView", "
|
|
15
|
+
mutators: readonly ["setViewportOffset", "resizeSheetView", "shiftViewportDown", "shiftViewportUp", "scrollToCell", "setDisplayedSheetId", "setViewportArgs", "rebuildViewports"];
|
|
16
|
+
private zoomStore;
|
|
16
17
|
private getHeaderDimensionsCallback;
|
|
17
18
|
private getFooterSizeCallback;
|
|
19
|
+
private getZoomLevelCallback;
|
|
18
20
|
private zoneToDisplay;
|
|
19
21
|
viewports: ViewportCollection;
|
|
20
22
|
private sheetsWithDirtyViewports;
|
|
21
|
-
private shouldRepositionViewports;
|
|
22
23
|
displayedSheetId: UID;
|
|
23
24
|
constructor(get: Get);
|
|
24
|
-
private handleEvent;
|
|
25
25
|
handle(cmd: Command): void;
|
|
26
26
|
finalize(): void;
|
|
27
27
|
private setViewports;
|
|
@@ -32,7 +32,6 @@ export declare class ViewportsStore extends SpreadsheetStore {
|
|
|
32
32
|
offsetY: Pixel;
|
|
33
33
|
}): "noStateChange" | undefined;
|
|
34
34
|
resizeSheetView(dimensions: SheetViewDimensions): "noStateChange" | undefined;
|
|
35
|
-
setZoom(zoom: number): "noStateChange" | undefined;
|
|
36
35
|
shiftViewportDown(): void;
|
|
37
36
|
shiftViewportUp(): void;
|
|
38
37
|
scrollToCell(sheetId: UID, col: HeaderIndex, row: HeaderIndex): void;
|
|
@@ -60,14 +59,12 @@ export declare class ViewportsStore extends SpreadsheetStore {
|
|
|
60
59
|
maxOffsetX: Pixel;
|
|
61
60
|
maxOffsetY: Pixel;
|
|
62
61
|
};
|
|
63
|
-
get scrollBarWidth(): Pixel;
|
|
64
62
|
/**
|
|
65
63
|
* Returns the position of the MainViewport relatively to the start of the grid (without headers)
|
|
66
64
|
* It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)
|
|
67
65
|
* situated before the pane divisions.
|
|
68
66
|
*/
|
|
69
67
|
get mainViewportCoordinates(): DOMCoordinates;
|
|
70
|
-
get zoomLevel(): number;
|
|
71
68
|
get visibleFigures(): FigureUI[];
|
|
72
69
|
/**
|
|
73
70
|
* Shift the viewport vertically and move the selection anchor
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ZoomedMouseEvent } from "../components/helpers/zoom";
|
|
2
|
+
import { Pixel } from "../types/misc";
|
|
3
|
+
import { DOMCoordinates, Rect } from "../types/rendering";
|
|
4
|
+
/**
|
|
5
|
+
* Holds the zoom level of the spreadsheet UI, and everything derived purely from it.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ZoomStore {
|
|
8
|
+
mutators: readonly ["setZoom"];
|
|
9
|
+
storeGetters: readonly ["getZoomedRect", "getZoomedEvent"];
|
|
10
|
+
zoomLevel: number;
|
|
11
|
+
setZoom(zoom: number): "noStateChange" | undefined;
|
|
12
|
+
getZoomedRect(rect: Rect): Rect;
|
|
13
|
+
/**
|
|
14
|
+
* Return a POJO containing the original event as well as the client position and the client offset
|
|
15
|
+
* where the event would target if the spreadsheet was not zoomed
|
|
16
|
+
* @param ev unzoomed mouse event
|
|
17
|
+
* @param originalTargetPosition The original target bounding rect the resulting ZoomedMouseEvent offset must refer to
|
|
18
|
+
* @returns a ZoomedMouseEvent
|
|
19
|
+
*/
|
|
20
|
+
getZoomedEvent<T extends MouseEvent>(ev: T, originalTargetPosition?: DOMCoordinates | null): ZoomedMouseEvent<T>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the bounding rect of the closest or self element who is targetable by a ZoomedMouseEvent
|
|
23
|
+
*/
|
|
24
|
+
private getZoomTargetPosition;
|
|
25
|
+
get scrollBarWidth(): Pixel;
|
|
26
|
+
get cssZoom(): string;
|
|
27
|
+
}
|