@odoo/o-spreadsheet 19.5.0-alpha.0 → 19.5.0-alpha.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.
- package/dist/o_spreadsheet.cjs +54635 -52850
- package/dist/o_spreadsheet.css +95 -44
- package/dist/o_spreadsheet.esm.js +54380 -52595
- package/dist/o_spreadsheet.iife.js +54407 -52622
- package/dist/o_spreadsheet.min.iife.js +403 -403
- package/dist/o_spreadsheet.xml +290 -167
- package/dist/types/actions/action.d.ts +1 -7
- package/dist/types/actions/data_actions.d.ts +1 -0
- package/dist/types/actions/menu_items_actions.d.ts +2 -0
- package/dist/types/clipboard_handlers/default_clipboard.d.ts +1 -1
- package/dist/types/collaborative/ot/ot_helpers.d.ts +3 -1
- package/dist/types/components/autofill/autofill.d.ts +3 -0
- package/dist/types/{plugins/ui_feature/autofill.d.ts → components/autofill/autofill_store.d.ts} +7 -12
- package/dist/types/components/autofill/table_autofill_store.d.ts +6 -0
- package/dist/types/components/border_editor/border_editor_widget.d.ts +1 -0
- package/dist/types/components/clickable_cells_overlay/clickable_cells_overlay.d.ts +20 -0
- package/dist/types/components/collaborative_client_tag/collaborative_client_tag.d.ts +2 -0
- package/dist/types/components/composer/composer/abstract_composer_store.d.ts +3 -2
- package/dist/types/components/composer/composer/composer.d.ts +2 -1
- package/dist/types/components/composer/grid_composer/grid_composer.d.ts +1 -0
- package/dist/types/components/dashboard/clickable_cell_store.d.ts +1 -0
- package/dist/types/components/dashboard/dashboard.d.ts +7 -12
- package/dist/types/components/error_tooltip/error_tooltip.d.ts +2 -0
- package/dist/types/components/figures/chart/chartJs/chartjs_geo_projection_plugin.d.ts +12 -0
- package/dist/types/components/figures/chart/gauge/gauge_chart_component.d.ts +1 -0
- package/dist/types/components/figures/chart/scorecard/chart_scorecard.d.ts +3 -0
- package/dist/types/components/figures/figure/figure.d.ts +8 -9
- package/dist/types/components/figures/figure_carousel/figure_carousel.d.ts +7 -2
- package/dist/types/components/figures/figure_chart/figure_chart.d.ts +1 -2
- package/dist/types/components/figures/figure_container/figure_container.d.ts +4 -2
- package/dist/types/components/figures/figure_image/figure_image.d.ts +1 -2
- package/dist/types/components/filters/filter_menu/filter_menu.d.ts +1 -0
- package/dist/types/components/grid/grid.d.ts +8 -0
- package/dist/types/components/grid_add_rows_footer/grid_add_rows_footer.d.ts +1 -0
- package/dist/types/components/grid_overlay/grid_overlay.d.ts +6 -4
- package/dist/types/components/grid_popover/grid_popover.d.ts +1 -0
- package/dist/types/components/header_group/header_group_container.d.ts +2 -0
- package/dist/types/components/headers_overlay/headers_overlay.d.ts +3 -0
- package/dist/types/components/headers_overlay/unhide_headers.d.ts +4 -0
- package/dist/types/components/helpers/dom_helpers.d.ts +2 -0
- package/dist/types/components/helpers/figure_snap_helper.d.ts +3 -3
- package/dist/types/components/helpers/wheel_hook.d.ts +1 -1
- package/dist/types/components/helpers/zoom.d.ts +1 -5
- package/dist/types/components/highlight/border/border.d.ts +2 -0
- package/dist/types/components/highlight/corner/corner.d.ts +1 -0
- package/dist/types/components/highlight/highlight/highlight.d.ts +3 -0
- package/dist/types/components/link/link_display/link_display.d.ts +1 -0
- package/dist/types/components/link/link_editor/link_editor.d.ts +1 -0
- package/dist/types/components/paint_format_button/paint_format_store.d.ts +1 -1
- package/dist/types/components/popover/cell_popover_store.d.ts +2 -1
- package/dist/types/components/props_validation.d.ts +7 -7
- package/dist/types/components/scrollbar/scrollbar_horizontal.d.ts +3 -0
- package/dist/types/components/scrollbar/scrollbar_vertical.d.ts +5 -1
- package/dist/types/components/selection_input/selection_input_store.d.ts +1 -1
- package/dist/types/components/side_panel/carousel_panel/carousel_panel.d.ts +20 -2
- package/dist/types/components/side_panel/chart/building_blocks/chart_title/chart_title.d.ts +1 -0
- package/dist/types/components/side_panel/chart/chart_type_picker/chart_type_picker.d.ts +5 -18
- package/dist/types/components/side_panel/chart/chart_type_picker_popover/chart_type_picker_popover.d.ts +64 -0
- package/dist/types/components/side_panel/chart/common.d.ts +1 -1
- package/dist/types/components/side_panel/conditional_formatting/cf_editor/cell_is_rule_editor.d.ts +1 -1
- package/dist/types/components/side_panel/conditional_formatting/cf_editor/color_scale_rule_editor.d.ts +1 -1
- package/dist/types/components/side_panel/conditional_formatting/cf_editor/color_scale_rule_editor_threshold.d.ts +1 -1
- package/dist/types/components/side_panel/conditional_formatting/cf_editor/data_bar_rule_editor.d.ts +1 -1
- package/dist/types/components/side_panel/conditional_formatting/cf_editor/icon_set_rule_editor.d.ts +1 -1
- package/dist/types/components/side_panel/criterion_form/calendar_button/calendar_button.d.ts +13 -0
- package/dist/types/components/side_panel/criterion_form/date_criterion/date_criterion.d.ts +2 -0
- package/dist/types/components/side_panel/criterion_form/double_input_criterion/double_input_criterion.d.ts +3 -0
- package/dist/types/components/side_panel/data_sources_cleanup/data_sources_cleanup.d.ts +28 -0
- package/dist/types/components/side_panel/data_sources_cleanup/data_sources_cleanup_store.d.ts +13 -0
- package/dist/types/components/side_panel/find_and_replace/find_and_replace_store.d.ts +1 -0
- package/dist/types/components/side_panel/pivot/pivot_layout_configurator/pivot_layout_configurator.d.ts +0 -2
- package/dist/types/components/side_panel/pivot/pivot_side_panel/pivot_side_panel_store.d.ts +1 -0
- package/dist/types/components/side_panel/remove_duplicates/remove_duplicates.d.ts +3 -10
- package/dist/types/components/side_panel/side_panel/side_panel_store.d.ts +1 -1
- package/dist/types/components/side_panel/split_to_columns_panel/split_to_columns_panel.d.ts +4 -11
- package/dist/types/components/side_panel/split_to_columns_panel/split_to_columns_store.d.ts +33 -0
- package/dist/types/components/small_bottom_bar/small_bottom_bar.d.ts +1 -0
- package/dist/types/components/spreadsheet/spreadsheet.d.ts +2 -0
- package/dist/types/components/standalone_grid_canvas/standalone_grid_canvas.d.ts +2 -1
- package/dist/types/components/standalone_viewport/standalone_viewport.d.ts +56 -0
- package/dist/types/components/standalone_viewport/standalone_viewport_store.d.ts +28 -0
- package/dist/types/components/tables/hovered_table_store.d.ts +3 -6
- package/dist/types/components/tables/table_resizer/table_resizer.d.ts +1 -0
- package/dist/types/components/top_bar/zoom_editor/zoom_editor.d.ts +2 -1
- package/dist/types/constants.d.ts +4 -0
- package/dist/types/formulas/code_builder.d.ts +2 -1
- package/dist/types/formulas/compiler.d.ts +7 -0
- package/dist/types/functions/create_compute_function.d.ts +4 -3
- package/dist/types/functions/function_registry.d.ts +1 -5
- package/dist/types/functions/helper_matrices.d.ts +1 -0
- package/dist/types/functions/helper_statistical.d.ts +6 -0
- package/dist/types/functions/module_array.d.ts +41 -23
- package/dist/types/functions/module_database.d.ts +18 -6
- package/dist/types/functions/module_date.d.ts +70 -22
- package/dist/types/functions/module_engineering.d.ts +3 -1
- package/dist/types/functions/module_filter.d.ts +2 -2
- package/dist/types/functions/module_financial.d.ts +105 -35
- package/dist/types/functions/module_info.d.ts +33 -11
- package/dist/types/functions/module_logical.d.ts +16 -8
- package/dist/types/functions/module_lookup.d.ts +23 -15
- package/dist/types/functions/module_math.d.ts +125 -43
- package/dist/types/functions/module_operators.d.ts +7 -3
- package/dist/types/functions/module_statistical.d.ts +78 -22
- package/dist/types/functions/module_text.d.ts +70 -24
- package/dist/types/functions/module_web.d.ts +3 -1
- package/dist/types/helpers/carousel_helpers.d.ts +8 -3
- package/dist/types/helpers/figures/chart.d.ts +2 -0
- package/dist/types/helpers/figures/charts/chart_common.d.ts +0 -2
- package/dist/types/helpers/figures/charts/scorecard_chart_config_builder.d.ts +2 -0
- package/dist/types/helpers/figures/figure/figure.d.ts +3 -2
- package/dist/types/helpers/internal_viewport.d.ts +20 -10
- package/dist/types/helpers/misc.d.ts +2 -0
- package/dist/types/helpers/pivot/pivot_helpers.d.ts +2 -2
- package/dist/types/helpers/pivot/pivot_highlight.d.ts +2 -2
- package/dist/types/helpers/rectangle.d.ts +4 -0
- package/dist/types/helpers/text_helper.d.ts +6 -1
- package/dist/types/helpers/ui/split_to_columns_interactive.d.ts +1 -1
- package/dist/types/helpers/viewport_collection.d.ts +51 -21
- package/dist/types/helpers/zones.d.ts +1 -0
- package/dist/types/index.d.ts +29 -3
- package/dist/types/model.d.ts +1 -0
- package/dist/types/plugins/core/carousel.d.ts +8 -4
- package/dist/types/plugins/core/cell.d.ts +1 -0
- package/dist/types/plugins/core/chart.d.ts +2 -0
- package/dist/types/plugins/core/conditional_format.d.ts +2 -0
- package/dist/types/plugins/core/data_validation.d.ts +2 -0
- package/dist/types/plugins/core/formulas_provider.d.ts +8 -0
- package/dist/types/plugins/core/pivot.d.ts +1 -0
- package/dist/types/plugins/core/squisher.d.ts +1 -0
- package/dist/types/plugins/core_plugin.d.ts +7 -3
- package/dist/types/plugins/ui_core_views/cell_evaluation/evaluation_plugin.d.ts +10 -3
- package/dist/types/plugins/ui_core_views/pivot_ui.d.ts +3 -0
- package/dist/types/plugins/ui_feature/collaborative.d.ts +2 -1
- package/dist/types/plugins/ui_feature/ui_options.d.ts +1 -7
- package/dist/types/plugins/ui_feature/ui_sheet.d.ts +2 -1
- package/dist/types/plugins/ui_stateful/carousel_ui.d.ts +2 -2
- package/dist/types/plugins/{ui_feature → ui_stateful}/figure.d.ts +4 -0
- package/dist/types/plugins/ui_stateful/filter_evaluation.d.ts +2 -3
- package/dist/types/plugins/ui_stateful/header_positions.d.ts +2 -1
- package/dist/types/registries/chart_registry.d.ts +3 -0
- package/dist/types/registries/data_source_registry.d.ts +15 -0
- package/dist/types/registries/figures_registry.d.ts +4 -1
- package/dist/types/store_engine/dependency_container.d.ts +5 -0
- package/dist/types/store_engine/store_hooks.d.ts +6 -0
- package/dist/types/store_engine/store_registries.d.ts +4 -0
- package/dist/types/stores/array_formula_highlight.d.ts +1 -1
- package/dist/types/{plugins/ui_feature/automatic_sum.d.ts → stores/automatic_sum_store.d.ts} +5 -4
- package/dist/types/stores/checkbox_toggle.d.ts +9 -0
- package/dist/types/stores/client_focus_store.d.ts +1 -0
- package/dist/types/stores/data_cleanup_store.d.ts +31 -0
- package/dist/types/stores/main_viewport_store.d.ts +11 -0
- package/dist/types/stores/spreadsheet_store.d.ts +1 -1
- package/dist/types/stores/table_resize_store.d.ts +6 -0
- package/dist/types/stores/trim_whitespace_store.d.ts +9 -0
- package/dist/types/stores/viewports_store.d.ts +87 -0
- package/dist/types/stores/zoom_store.d.ts +14 -0
- package/dist/types/types/chart/radar_chart.d.ts +1 -1
- package/dist/types/types/chart/scorecard_chart.d.ts +2 -0
- package/dist/types/types/commands.d.ts +25 -58
- package/dist/types/types/core_getters.d.ts +3 -1
- package/dist/types/types/figure.d.ts +26 -3
- package/dist/types/types/functions.d.ts +14 -4
- package/dist/types/types/getters.d.ts +28 -11
- package/dist/types/types/misc.d.ts +19 -1
- package/dist/types/types/range.d.ts +1 -0
- package/dist/types/types/rendering.d.ts +1 -0
- package/dist/types/types/store_engine.d.ts +10 -3
- package/package.json +2 -2
- package/dist/types/plugins/ui_feature/checkbox_toggle.d.ts +0 -9
- package/dist/types/plugins/ui_feature/data_cleanup.d.ts +0 -16
- package/dist/types/plugins/ui_feature/split_to_columns.d.ts +0 -21
- package/dist/types/plugins/ui_feature/table_autofill.d.ts +0 -6
- package/dist/types/plugins/ui_feature/table_resize_ui.d.ts +0 -6
- package/dist/types/plugins/ui_stateful/sheetview.d.ts +0 -123
- /package/dist/types/plugins/{ui_feature → ui_stateful}/cell_computed_style.d.ts +0 -0
- /package/dist/types/plugins/{ui_feature → ui_stateful}/header_visibility_ui.d.ts +0 -0
- /package/dist/types/plugins/{ui_feature → ui_stateful}/table_computed_style.d.ts +0 -0
|
@@ -10,31 +10,26 @@ import { FingerprintPlugin } from "../plugins/ui_core_views/fingerprint";
|
|
|
10
10
|
import { FormulaTrackerPlugin } from "../plugins/ui_core_views/formula_tracker";
|
|
11
11
|
import { HeaderSizeUIPlugin } from "../plugins/ui_core_views/header_sizes_ui";
|
|
12
12
|
import { PivotUIPlugin } from "../plugins/ui_core_views/pivot_ui";
|
|
13
|
-
import { AutofillPlugin } from "../plugins/ui_feature/autofill";
|
|
14
|
-
import { AutomaticSumPlugin } from "../plugins/ui_feature/automatic_sum";
|
|
15
|
-
import { CellComputedStylePlugin } from "../plugins/ui_feature/cell_computed_style";
|
|
16
|
-
import { CheckboxTogglePlugin } from "../plugins/ui_feature/checkbox_toggle";
|
|
17
13
|
import { CollaborativePlugin } from "../plugins/ui_feature/collaborative";
|
|
18
14
|
import { ColorThemeUIPlugin } from "../plugins/ui_feature/color_theme";
|
|
19
15
|
import { DynamicTranslate } from "../plugins/ui_feature/dynamic_translate";
|
|
20
|
-
import { FigureUIPlugin } from "../plugins/ui_feature/figure";
|
|
21
16
|
import { GeoFeaturePlugin } from "../plugins/ui_feature/geo_features";
|
|
22
|
-
import { HeaderVisibilityUIPlugin } from "../plugins/ui_feature/header_visibility_ui";
|
|
23
17
|
import { HistoryPlugin } from "../plugins/ui_feature/local_history";
|
|
24
18
|
import { LockSheetPlugin } from "../plugins/ui_feature/lock_sheet";
|
|
25
19
|
import { PivotPresencePlugin } from "../plugins/ui_feature/pivot_presence_plugin";
|
|
26
20
|
import { SortPlugin } from "../plugins/ui_feature/sort";
|
|
27
|
-
import { SplitToColumnsPlugin } from "../plugins/ui_feature/split_to_columns";
|
|
28
21
|
import { SubtotalEvaluationPlugin } from "../plugins/ui_feature/subtotal_evaluation";
|
|
29
|
-
import { TableComputedStylePlugin } from "../plugins/ui_feature/table_computed_style";
|
|
30
22
|
import { UIOptionsPlugin } from "../plugins/ui_feature/ui_options";
|
|
31
23
|
import { SheetUIPlugin } from "../plugins/ui_feature/ui_sheet";
|
|
32
24
|
import { CarouselUIPlugin } from "../plugins/ui_stateful/carousel_ui";
|
|
25
|
+
import { CellComputedStylePlugin } from "../plugins/ui_stateful/cell_computed_style";
|
|
33
26
|
import { ClipboardPlugin } from "../plugins/ui_stateful/clipboard";
|
|
27
|
+
import { FigureUIPlugin } from "../plugins/ui_stateful/figure";
|
|
34
28
|
import { FilterEvaluationPlugin } from "../plugins/ui_stateful/filter_evaluation";
|
|
35
29
|
import { HeaderPositionsUIPlugin } from "../plugins/ui_stateful/header_positions";
|
|
30
|
+
import { HeaderVisibilityUIPlugin } from "../plugins/ui_stateful/header_visibility_ui";
|
|
36
31
|
import { GridSelectionPlugin } from "../plugins/ui_stateful/selection";
|
|
37
|
-
import {
|
|
32
|
+
import { TableComputedStylePlugin } from "../plugins/ui_stateful/table_computed_style";
|
|
38
33
|
import { CoreGetters, PluginGetters } from "./core_getters";
|
|
39
34
|
/**
|
|
40
35
|
* The getters that can be used in the rendering-related stores and helpers. The SheetView and Selection getters should
|
|
@@ -43,5 +38,27 @@ import { CoreGetters, PluginGetters } from "./core_getters";
|
|
|
43
38
|
export type RenderingGetters = {
|
|
44
39
|
isReadonly: () => boolean;
|
|
45
40
|
isDashboard: () => boolean;
|
|
46
|
-
} & CoreGetters & PluginGetters<typeof
|
|
47
|
-
export type Getters = RenderingGetters & PluginGetters<typeof
|
|
41
|
+
} & CoreGetters & PluginGetters<typeof HistoryPlugin> & PluginGetters<typeof ClipboardPlugin> & PluginGetters<typeof EvaluationPlugin> & PluginGetters<typeof EvaluationChartPlugin> & PluginGetters<typeof EvaluationConditionalFormatPlugin> & PluginGetters<typeof HeaderVisibilityUIPlugin> & PluginGetters<typeof CustomColorsPlugin> & PluginGetters<typeof CollaborativePlugin> & PluginGetters<typeof SortPlugin> & PluginGetters<typeof UIOptionsPlugin> & PluginGetters<typeof SheetUIPlugin> & PluginGetters<typeof FilterEvaluationPlugin> & PluginGetters<typeof FingerprintPlugin> & PluginGetters<typeof SubtotalEvaluationPlugin> & PluginGetters<typeof HeaderSizeUIPlugin> & PluginGetters<typeof EvaluationDataValidationPlugin> & PluginGetters<typeof HeaderPositionsUIPlugin> & PluginGetters<typeof TableStylePlugin> & PluginGetters<typeof CellComputedStylePlugin> & PluginGetters<typeof DynamicTablesPlugin> & PluginGetters<typeof PivotUIPlugin> & PluginGetters<typeof TableComputedStylePlugin> & PluginGetters<typeof GeoFeaturePlugin> & PluginGetters<typeof PivotPresencePlugin> & PluginGetters<typeof TableComputedStylePlugin> & PluginGetters<typeof CellIconPlugin> & PluginGetters<typeof DynamicTranslate> & PluginGetters<typeof FormulaTrackerPlugin> & PluginGetters<typeof LockSheetPlugin> & PluginGetters<typeof CarouselUIPlugin> & PluginGetters<typeof ColorThemeUIPlugin> & PluginGetters<typeof FigureUIPlugin>;
|
|
42
|
+
export type Getters = RenderingGetters & PluginGetters<typeof GridSelectionPlugin>;
|
|
43
|
+
export interface ViewportsGetters {
|
|
44
|
+
getColDimensions: Getters["getColDimensions"];
|
|
45
|
+
getRowDimensions: Getters["getRowDimensions"];
|
|
46
|
+
findLastVisibleColRowIndex: Getters["findLastVisibleColRowIndex"];
|
|
47
|
+
isReadonly: Getters["isReadonly"];
|
|
48
|
+
getMainCellPosition: Getters["getMainCellPosition"];
|
|
49
|
+
getNextVisibleCellPosition: Getters["getNextVisibleCellPosition"];
|
|
50
|
+
getColRowOffset: Getters["getColRowOffset"];
|
|
51
|
+
isColHidden: Getters["isColHidden"];
|
|
52
|
+
isRowHidden: Getters["isRowHidden"];
|
|
53
|
+
isHeaderHidden: Getters["isHeaderHidden"];
|
|
54
|
+
getNumberHeaders: Getters["getNumberHeaders"];
|
|
55
|
+
getHeaderSize: Getters["getHeaderSize"];
|
|
56
|
+
getColSize: Getters["getColSize"];
|
|
57
|
+
getRowSize: Getters["getRowSize"];
|
|
58
|
+
getSheetIds: Getters["getSheetIds"];
|
|
59
|
+
tryGetSheet: Getters["tryGetSheet"];
|
|
60
|
+
getNumberCols: Getters["getNumberCols"];
|
|
61
|
+
getNumberRows: Getters["getNumberRows"];
|
|
62
|
+
getSheetZone: Getters["getSheetZone"];
|
|
63
|
+
getFigures: Getters["getFigures"];
|
|
64
|
+
}
|
|
@@ -2,6 +2,7 @@ import { CellValue, EvaluatedCell } from "./cells";
|
|
|
2
2
|
import { CompiledFormula } from "../formulas/compiler";
|
|
3
3
|
import { CommandResult } from "./commands";
|
|
4
4
|
import { Format } from "./format";
|
|
5
|
+
import { ComputeFunction } from "./functions";
|
|
5
6
|
import { Range } from "./range";
|
|
6
7
|
/**
|
|
7
8
|
* The following type is meant to be used in union with other aliases to prevent
|
|
@@ -142,7 +143,7 @@ export interface Border {
|
|
|
142
143
|
export type ReferenceDenormalizer = (range: Range) => FunctionResultObject;
|
|
143
144
|
export type EnsureRange = (range: Range) => Matrix<FunctionResultObject>;
|
|
144
145
|
export type GetSymbolValue = (symbolName: string, isRange: boolean) => Arg;
|
|
145
|
-
export type FormulaToExecute = (deps: Range[], refFn: ReferenceDenormalizer, range: EnsureRange, getSymbolValue: GetSymbolValue, ctx: object) => Matrix<FunctionResultObject> | FunctionResultObject;
|
|
146
|
+
export type FormulaToExecute = (deps: Range[], refFn: ReferenceDenormalizer, range: EnsureRange, getSymbolValue: GetSymbolValue, ctx: object, functions: ComputeFunction[]) => Matrix<FunctionResultObject> | FunctionResultObject;
|
|
146
147
|
export interface LiteralValues {
|
|
147
148
|
numbers: {
|
|
148
149
|
value: number;
|
|
@@ -200,6 +201,10 @@ export interface PixelPosition {
|
|
|
200
201
|
x: Pixel;
|
|
201
202
|
y: Pixel;
|
|
202
203
|
}
|
|
204
|
+
export interface PixelDimension {
|
|
205
|
+
width: Pixel;
|
|
206
|
+
height: Pixel;
|
|
207
|
+
}
|
|
203
208
|
export interface Merge extends Zone {
|
|
204
209
|
id: number;
|
|
205
210
|
}
|
|
@@ -259,6 +264,9 @@ export type ConsecutiveIndexes = HeaderIndex[];
|
|
|
259
264
|
export interface RangeProvider {
|
|
260
265
|
adaptRanges: (adapterFunctions: RangeAdapterFunctions) => void;
|
|
261
266
|
}
|
|
267
|
+
export interface FormulaProvider {
|
|
268
|
+
getFormulas: () => CompiledFormula[];
|
|
269
|
+
}
|
|
262
270
|
export type Validation<T> = (toValidate: T) => CommandResult | CommandResult[];
|
|
263
271
|
export type Increment = 1 | -1 | 0;
|
|
264
272
|
export interface Ref<T> {
|
|
@@ -324,6 +332,10 @@ export interface Offset {
|
|
|
324
332
|
col: number;
|
|
325
333
|
row: number;
|
|
326
334
|
}
|
|
335
|
+
export interface PixelOffset {
|
|
336
|
+
offsetX: Pixel;
|
|
337
|
+
offsetY: Pixel;
|
|
338
|
+
}
|
|
327
339
|
export type DebouncedFunction<T> = T & {
|
|
328
340
|
stopDebounce: () => void;
|
|
329
341
|
isDebouncePending: () => boolean;
|
|
@@ -345,4 +357,10 @@ export interface NamedRange {
|
|
|
345
357
|
name: string;
|
|
346
358
|
range: Range;
|
|
347
359
|
}
|
|
360
|
+
export interface SheetViewDimensions {
|
|
361
|
+
height: Pixel;
|
|
362
|
+
width: Pixel;
|
|
363
|
+
gridOffsetX?: Pixel;
|
|
364
|
+
gridOffsetY?: Pixel;
|
|
365
|
+
}
|
|
348
366
|
export {};
|
|
@@ -28,9 +28,16 @@ export type SkipFirst<T extends any[]> = T extends [any, ...infer U] ? U : never
|
|
|
28
28
|
export type OmitFunctions<T> = {
|
|
29
29
|
[K in keyof T as T[K] extends Function ? never : K]: T[K];
|
|
30
30
|
};
|
|
31
|
-
export type
|
|
32
|
-
|
|
33
|
-
}
|
|
31
|
+
export type FunctionKeys<T> = {
|
|
32
|
+
[K in keyof T]: T[K] extends Function ? K : never;
|
|
33
|
+
}[keyof T];
|
|
34
|
+
export type MutatorKeys<S> = S extends {
|
|
35
|
+
mutators: readonly FunctionKeys<S>[];
|
|
36
|
+
} ? S["mutators"][number] : never;
|
|
37
|
+
export type GetterKeys<S> = S extends {
|
|
38
|
+
storeGetters: readonly FunctionKeys<S>[];
|
|
39
|
+
} ? S["storeGetters"][number] : never;
|
|
40
|
+
export type Store<S> = CQS<Pick<S, MutatorKeys<S>> & OmitFunctions<S>> & Pick<S, GetterKeys<S>>;
|
|
34
41
|
/**
|
|
35
42
|
* Command Query Separation [1,2] implementation with types.
|
|
36
43
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odoo/o-spreadsheet",
|
|
3
|
-
"version": "19.5.0-alpha.
|
|
3
|
+
"version": "19.5.0-alpha.10",
|
|
4
4
|
"description": "A spreadsheet component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/o_spreadsheet.cjs",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"xmlSelfClosingSpace": false
|
|
142
142
|
},
|
|
143
143
|
"dependencies": {
|
|
144
|
-
"@odoo/owl": "3.0.0-alpha.
|
|
144
|
+
"@odoo/owl": "3.0.0-alpha.45",
|
|
145
145
|
"bootstrap": "5.3.3",
|
|
146
146
|
"font-awesome": "^4.7.0",
|
|
147
147
|
"rbush": "^3.0.1"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Command } from "../../types/commands";
|
|
2
|
-
import { Zone } from "../../types/misc";
|
|
3
|
-
import { UIPlugin } from "../ui_plugin";
|
|
4
|
-
export declare class CheckboxTogglePlugin extends UIPlugin {
|
|
5
|
-
static getters: readonly ["hasBooleanValidationInZones"];
|
|
6
|
-
handle(cmd: Command): void;
|
|
7
|
-
hasBooleanValidationInZones(zones: Zone[]): boolean;
|
|
8
|
-
private toggleCheckbox;
|
|
9
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Command, CommandResult } from "../../types/commands";
|
|
2
|
-
import { UIPlugin } from "../ui_plugin";
|
|
3
|
-
export declare class DataCleanupPlugin extends UIPlugin {
|
|
4
|
-
allowDispatch(cmd: Command): CommandResult | CommandResult[];
|
|
5
|
-
handle(cmd: Command): void;
|
|
6
|
-
private removeDuplicates;
|
|
7
|
-
private getUniqueRowsIndexes;
|
|
8
|
-
private notifyRowsRemovedAndRemaining;
|
|
9
|
-
private checkSingleRangeSelected;
|
|
10
|
-
private checkNoMergeInZone;
|
|
11
|
-
private checkRangeContainsValues;
|
|
12
|
-
private checkNoColumnProvided;
|
|
13
|
-
private checkColumnsIncludedInZone;
|
|
14
|
-
private checkColumnsAreUnique;
|
|
15
|
-
private trimWhitespace;
|
|
16
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Command, CommandResult } from "../../types/commands";
|
|
2
|
-
import { UIPlugin } from "../ui_plugin";
|
|
3
|
-
export declare class SplitToColumnsPlugin extends UIPlugin {
|
|
4
|
-
static getters: readonly ["getAutomaticSeparator"];
|
|
5
|
-
allowDispatch(cmd: Command): CommandResult | CommandResult[];
|
|
6
|
-
handle(cmd: Command): void;
|
|
7
|
-
getAutomaticSeparator(): string;
|
|
8
|
-
private getAutoSeparatorForString;
|
|
9
|
-
private splitIntoColumns;
|
|
10
|
-
private getSplittedCols;
|
|
11
|
-
private splitAndRemoveTrailingEmpty;
|
|
12
|
-
private willSplittedColsOverwriteContent;
|
|
13
|
-
private removeMergesInSplitZone;
|
|
14
|
-
private addColsToAvoidCollisions;
|
|
15
|
-
private getColsToAddToAvoidCollision;
|
|
16
|
-
private addColumnsToNotOverflowSheet;
|
|
17
|
-
private checkSingleColSelected;
|
|
18
|
-
private checkNonEmptySelector;
|
|
19
|
-
private checkNotOverwritingContent;
|
|
20
|
-
private checkSeparatorInSelection;
|
|
21
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { ViewportCollection } from "../../helpers/viewport_collection";
|
|
2
|
-
import { Command, CommandResult, LocalCommand } from "../../types/commands";
|
|
3
|
-
import { AnchorOffset, Figure, FigureUI } from "../../types/figure";
|
|
4
|
-
import { CellPosition, Dimension, HeaderDimensions, HeaderIndex, Pixel, PixelPosition, UID, Zone } from "../../types/misc";
|
|
5
|
-
import { DOMCoordinates, DOMDimension, EdgeScrollInfo, Rect, SheetDOMScrollInfo, Viewport } from "../../types/rendering";
|
|
6
|
-
import { UIPlugin } from "../ui_plugin";
|
|
7
|
-
/**
|
|
8
|
-
* Viewport plugin.
|
|
9
|
-
*
|
|
10
|
-
* This plugin manages all things related to all viewport states.
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
export declare class SheetViewPlugin extends UIPlugin {
|
|
14
|
-
static getters: readonly ["getColIndex", "getRowIndex", "getActiveMainViewport", "getSheetViewDimension", "getSheetViewDimensionWithHeaders", "getMainViewportRect", "isVisibleInViewport", "getEdgeScrollCol", "getEdgeScrollRow", "getVisibleFigures", "getVisibleRect", "getVisibleRectWithoutHeaders", "getVisibleRectWithZoom", "getVisibleCellPositions", "getColRowOffsetInViewport", "getMainViewportCoordinates", "getActiveSheetScrollInfo", "getSheetViewVisibleCols", "getSheetViewVisibleRows", "getFrozenSheetViewRatio", "isPixelPositionVisible", "getColDimensionsInViewport", "getRowDimensionsInViewport", "getRect", "getFigureUI", "getPositionAnchorOffset", "getGridOffset", "getViewportZoomLevel", "getScrollBarWidth", "getMaximumSheetOffset", "getViewportCollection"];
|
|
15
|
-
private viewports;
|
|
16
|
-
private sheetsWithDirtyViewports;
|
|
17
|
-
private shouldRepositionViewports;
|
|
18
|
-
allowDispatch(cmd: LocalCommand): CommandResult | CommandResult[];
|
|
19
|
-
private handleEvent;
|
|
20
|
-
handle(cmd: Command): void;
|
|
21
|
-
finalize(): void;
|
|
22
|
-
private setViewports;
|
|
23
|
-
private syncPaneDivision;
|
|
24
|
-
/**
|
|
25
|
-
* Return the index of a column given an offset x, based on the viewport left
|
|
26
|
-
* visible cell.
|
|
27
|
-
* It returns -1 if no column is found.
|
|
28
|
-
*/
|
|
29
|
-
getColIndex(x: Pixel): HeaderIndex;
|
|
30
|
-
/**
|
|
31
|
-
* Return the index of a row given an offset y, based on the viewport top
|
|
32
|
-
* visible cell.
|
|
33
|
-
* It returns -1 if no row is found.
|
|
34
|
-
*/
|
|
35
|
-
getRowIndex(y: Pixel): HeaderIndex;
|
|
36
|
-
getSheetViewDimensionWithHeaders(): DOMDimension;
|
|
37
|
-
getSheetViewDimension(): DOMDimension;
|
|
38
|
-
getGridOffset(): DOMCoordinates;
|
|
39
|
-
/** type as pane, not viewport but basically pane extends viewport */
|
|
40
|
-
getActiveMainViewport(): Viewport;
|
|
41
|
-
/**
|
|
42
|
-
* Return the DOM scroll info of the active sheet, ie. the offset between the viewport left/top side and
|
|
43
|
-
* the grid left/top side, corresponding to the scroll of the scrollbars and not snapped to the grid.
|
|
44
|
-
*/
|
|
45
|
-
getActiveSheetScrollInfo(): SheetDOMScrollInfo;
|
|
46
|
-
getSheetViewVisibleCols(): HeaderIndex[];
|
|
47
|
-
getSheetViewVisibleRows(): HeaderIndex[];
|
|
48
|
-
/**
|
|
49
|
-
* Get the positions of all the cells that are visible in the viewport, taking merges into account.
|
|
50
|
-
*/
|
|
51
|
-
getVisibleCellPositions(): CellPosition[];
|
|
52
|
-
/**
|
|
53
|
-
* Return the main viewport maximum size relative to the client size.
|
|
54
|
-
*/
|
|
55
|
-
getMainViewportRect(): Rect;
|
|
56
|
-
getMaximumSheetOffset(): {
|
|
57
|
-
maxOffsetX: Pixel;
|
|
58
|
-
maxOffsetY: Pixel;
|
|
59
|
-
};
|
|
60
|
-
getColRowOffsetInViewport(dimension: Dimension, referenceHeaderIndex: HeaderIndex, targetHeaderIndex: HeaderIndex): Pixel;
|
|
61
|
-
/**
|
|
62
|
-
* Check if a given position is visible in the viewport.
|
|
63
|
-
*/
|
|
64
|
-
isVisibleInViewport(cellPosition: CellPosition): boolean;
|
|
65
|
-
getScrollBarWidth(): Pixel;
|
|
66
|
-
getEdgeScrollCol(x: number, previousX: number, startingX: number): EdgeScrollInfo;
|
|
67
|
-
getEdgeScrollRow(y: number, previousY: number, startingY: number): EdgeScrollInfo;
|
|
68
|
-
/**
|
|
69
|
-
* Computes the coordinates and size to draw the zone on the canvas
|
|
70
|
-
*/
|
|
71
|
-
getVisibleRect(zone: Zone): Rect;
|
|
72
|
-
/**
|
|
73
|
-
* Computes the coordinates and size to draw the zone on the canvas after it has been zoomed
|
|
74
|
-
*/
|
|
75
|
-
getVisibleRectWithZoom(zone: Zone): Rect;
|
|
76
|
-
/**
|
|
77
|
-
* Computes the coordinates and size to draw the zone without taking the grid offset into account
|
|
78
|
-
*/
|
|
79
|
-
getVisibleRectWithoutHeaders(zone: Zone): Rect;
|
|
80
|
-
/**
|
|
81
|
-
* Computes the actual size and position (:Rect) of the zone on the canvas
|
|
82
|
-
* regardless of the viewport dimensions.
|
|
83
|
-
*/
|
|
84
|
-
getRect(zone: Zone): Rect;
|
|
85
|
-
/**
|
|
86
|
-
* Computes the actual size and position (:Rect) of the zone on the canvas
|
|
87
|
-
* regardless of the viewport dimensions.
|
|
88
|
-
*/
|
|
89
|
-
getRectWithoutHeaders(zone: Zone): Rect;
|
|
90
|
-
/**
|
|
91
|
-
* Returns the position of the MainViewport relatively to the start of the grid (without headers)
|
|
92
|
-
* It corresponds to the summed dimensions of the visible cols/rows (in x/y respectively)
|
|
93
|
-
* situated before the pane divisions.
|
|
94
|
-
*/
|
|
95
|
-
getMainViewportCoordinates(): DOMCoordinates;
|
|
96
|
-
/**
|
|
97
|
-
* Returns the size, start and end coordinates of a column relative to the left
|
|
98
|
-
* column of the current viewport
|
|
99
|
-
*/
|
|
100
|
-
getColDimensionsInViewport(sheetId: UID, col: HeaderIndex): HeaderDimensions;
|
|
101
|
-
/**
|
|
102
|
-
* Returns the size, start and end coordinates of a row relative to the top row
|
|
103
|
-
* of the current viewport
|
|
104
|
-
*/
|
|
105
|
-
getRowDimensionsInViewport(sheetId: UID, row: HeaderIndex): HeaderDimensions;
|
|
106
|
-
getViewportZoomLevel(): number;
|
|
107
|
-
/**
|
|
108
|
-
* Shift the viewport vertically and move the selection anchor
|
|
109
|
-
* such that it remains at the same place relative to the
|
|
110
|
-
* viewport top.
|
|
111
|
-
*/
|
|
112
|
-
private shiftVertically;
|
|
113
|
-
getVisibleFigures(): FigureUI[];
|
|
114
|
-
getFigureUI(sheetId: UID, figure: Figure): FigureUI;
|
|
115
|
-
getPositionAnchorOffset(position: PixelPosition): AnchorOffset;
|
|
116
|
-
isPixelPositionVisible(position: PixelPosition): boolean;
|
|
117
|
-
getFrozenSheetViewRatio(sheetId: UID): {
|
|
118
|
-
xRatio: number;
|
|
119
|
-
yRatio: number;
|
|
120
|
-
};
|
|
121
|
-
getViewportCollection(): ViewportCollection;
|
|
122
|
-
private getPaneDivisions;
|
|
123
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|