@odoo/o-spreadsheet 17.0.84 → 17.0.96
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.js +46071 -53455
- package/dist/o-spreadsheet.esm.js +45886 -53454
- package/dist/o-spreadsheet.iife.js +50220 -57787
- package/dist/o-spreadsheet.iife.min.js +534 -505
- package/dist/o_spreadsheet.xml +3 -3
- package/dist/types/actions/action.d.ts +73 -0
- package/dist/types/actions/data_actions.d.ts +9 -0
- package/dist/types/actions/edit_actions.d.ts +21 -0
- package/dist/types/actions/format_actions.d.ts +45 -0
- package/dist/types/actions/insert_actions.d.ts +28 -0
- package/dist/types/actions/menu_items_actions.d.ts +32 -0
- package/dist/types/actions/sheet_actions.d.ts +10 -0
- package/dist/types/actions/view_actions.d.ts +28 -0
- package/dist/types/collaborative/local_transport_service.d.ts +8 -0
- package/dist/types/collaborative/ot/ot.d.ts +22 -0
- package/dist/types/collaborative/ot/ot_helpers.d.ts +3 -0
- package/dist/types/collaborative/ot/ot_specific.d.ts +1 -0
- package/dist/types/collaborative/revisions.d.ts +22 -0
- package/dist/types/collaborative/session.d.ts +100 -0
- package/dist/types/components/action_button/action_button.d.ts +23 -0
- package/dist/types/components/animation/ripple.d.ts +53 -0
- package/dist/types/components/autofill/autofill.d.ts +25 -0
- package/dist/types/components/border_editor/border_editor.d.ts +41 -0
- package/dist/types/components/border_editor/border_editor_widget.d.ts +31 -0
- package/dist/types/components/bottom_bar/bottom_bar.d.ts +56 -0
- package/dist/types/components/bottom_bar_sheet/bottom_bar_sheet.d.ts +44 -0
- package/dist/types/components/bottom_bar_statistic/bottom_bar_statistic.d.ts +21 -0
- package/dist/types/components/collaborative_client_tag/collaborative_client_tag.d.ts +14 -0
- package/dist/types/components/color_picker/color_picker.d.ts +41 -0
- package/dist/types/components/color_picker/color_picker_widget.d.ts +27 -0
- package/dist/types/components/composer/autocomplete_dropdown/autocomplete_dropdown.d.ts +15 -0
- package/dist/types/components/composer/composer/composer.d.ts +135 -0
- package/dist/types/components/composer/content_editable_helper.d.ts +60 -0
- package/dist/types/components/composer/formula_assistant/formula_assistant.d.ts +20 -0
- package/dist/types/components/composer/grid_composer/grid_composer.d.ts +39 -0
- package/dist/types/components/composer/top_bar_composer/top_bar_composer.d.ts +18 -0
- package/dist/types/components/dashboard/dashboard.d.ts +50 -0
- package/dist/types/components/data_validation_overlay/data_validation_overlay.d.ts +15 -0
- package/dist/types/components/data_validation_overlay/dv_checkbox/dv_checkbox.d.ts +12 -0
- package/dist/types/components/data_validation_overlay/dv_list_icon/dv_list_icon.d.ts +10 -0
- package/dist/types/components/error_tooltip/error_tooltip.d.ts +18 -0
- package/dist/types/components/figures/chart/chartJs/chartjs.d.ts +18 -0
- package/dist/types/components/figures/chart/scorecard/chart_scorecard.d.ts +14 -0
- package/dist/types/components/figures/figure/figure.d.ts +41 -0
- package/dist/types/components/figures/figure_chart/figure_chart.d.ts +14 -0
- package/dist/types/components/figures/figure_container/figure_container.d.ts +117 -0
- package/dist/types/components/figures/figure_image/figure_image.d.ts +13 -0
- package/dist/types/components/filters/filter_icon/filter_icon.d.ts +12 -0
- package/dist/types/components/filters/filter_icons_overlay/filter_icons_overlay.d.ts +22 -0
- package/dist/types/components/filters/filter_menu/filter_menu.d.ts +43 -0
- package/dist/types/components/filters/filter_menu_item/filter_menu_value_item.d.ts +17 -0
- package/dist/types/components/font_size_editor/font_size_editor.d.ts +29 -0
- package/dist/types/components/grid/grid.d.ts +99 -0
- package/dist/types/components/grid_add_rows_footer/grid_add_rows_footer.d.ts +27 -0
- package/dist/types/components/grid_cell_icon/grid_cell_icon.d.ts +16 -0
- package/dist/types/components/grid_overlay/grid_overlay.d.ts +45 -0
- package/dist/types/components/grid_popover/grid_popover.d.ts +20 -0
- package/dist/types/components/header_group/header_group.d.ts +41 -0
- package/dist/types/components/header_group/header_group_container.d.ts +29 -0
- package/dist/types/components/headers_overlay/headers_overlay.d.ts +117 -0
- package/dist/types/components/helpers/css.d.ts +40 -0
- package/dist/types/components/helpers/dom_helpers.d.ts +34 -0
- package/dist/types/components/helpers/drag_and_drop.d.ts +20 -0
- package/dist/types/components/helpers/drag_and_drop_hook.d.ts +24 -0
- package/dist/types/components/helpers/draw_grid_hook.d.ts +3 -0
- package/dist/types/components/helpers/figure_container_helper.d.ts +14 -0
- package/dist/types/components/helpers/figure_drag_helper.d.ts +6 -0
- package/dist/types/components/helpers/figure_snap_helper.d.ts +25 -0
- package/dist/types/components/helpers/html_content_helpers.d.ts +2 -0
- package/dist/types/components/helpers/index.d.ts +1 -0
- package/dist/types/components/helpers/listener_hook.d.ts +10 -0
- package/dist/types/components/helpers/position_hook.d.ts +25 -0
- package/dist/types/components/helpers/selection_helpers.d.ts +2 -0
- package/dist/types/components/helpers/time_hooks.d.ts +9 -0
- package/dist/types/components/helpers/wheel_hook.d.ts +1 -0
- package/dist/types/components/highlight/border/border.d.ts +15 -0
- package/dist/types/components/highlight/corner/corner.d.ts +18 -0
- package/dist/types/components/highlight/highlight/highlight.d.ts +22 -0
- package/dist/types/components/icon_picker/icon_picker.d.ts +65 -0
- package/dist/types/components/icons/icons.d.ts +56 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/link/index.d.ts +2 -0
- package/dist/types/components/link/link_display/link_display.d.ts +21 -0
- package/dist/types/components/link/link_editor/link_editor.d.ts +39 -0
- package/dist/types/components/menu/menu.d.ts +58 -0
- package/dist/types/components/paint_format_button/paint_format_button.d.ts +12 -0
- package/dist/types/components/popover/popover.d.ts +40 -0
- package/dist/types/components/scrollbar/index.d.ts +2 -0
- package/dist/types/components/scrollbar/scrollbar.d.ts +25 -0
- package/dist/types/components/scrollbar/scrollbar_horizontal.d.ts +26 -0
- package/dist/types/components/scrollbar/scrollbar_vertical.d.ts +26 -0
- package/dist/types/components/scrollbar.d.ts +9 -0
- package/dist/types/components/selection_input/selection_input.d.ts +54 -0
- package/dist/types/components/side_panel/chart/bar_chart/bar_chart_config_panel.d.ts +6 -0
- package/dist/types/components/side_panel/chart/bar_chart/bar_chart_design_panel.d.ts +4 -0
- package/dist/types/components/side_panel/chart/gauge_chart_panel/gauge_chart_config_panel.d.ts +26 -0
- package/dist/types/components/side_panel/chart/gauge_chart_panel/gauge_chart_design_panel.d.ts +34 -0
- package/dist/types/components/side_panel/chart/index.d.ts +17 -0
- package/dist/types/components/side_panel/chart/line_bar_pie_panel/config_panel.d.ts +45 -0
- package/dist/types/components/side_panel/chart/line_bar_pie_panel/design_panel.d.ts +26 -0
- package/dist/types/components/side_panel/chart/line_chart/line_chart_config_panel.d.ts +9 -0
- package/dist/types/components/side_panel/chart/line_chart/line_chart_design_panel.d.ts +4 -0
- package/dist/types/components/side_panel/chart/main_chart_panel/main_chart_panel.d.ts +20 -0
- package/dist/types/components/side_panel/chart/scorecard_chart_panel/scorecard_chart_config_panel.d.ts +32 -0
- package/dist/types/components/side_panel/chart/scorecard_chart_panel/scorecard_chart_design_panel.d.ts +26 -0
- package/dist/types/components/side_panel/conditional_formatting/cf_editor/cf_editor.d.ts +137 -0
- package/dist/types/components/side_panel/conditional_formatting/cf_preview_list/cf_preview_list.d.ts +58 -0
- package/dist/types/components/side_panel/conditional_formatting/conditional_formatting.d.ts +23 -0
- package/dist/types/components/side_panel/custom_currency/custom_currency.d.ts +27 -0
- package/dist/types/components/side_panel/data_validation/data_validation_panel.d.ts +25 -0
- package/dist/types/components/side_panel/data_validation/data_validation_panel_helper.d.ts +14 -0
- package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_criterion_form.d.ts +11 -0
- package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_date_criterion/dv_date_criterion.d.ts +16 -0
- package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_double_input_criterion/dv_double_input_criterion.d.ts +10 -0
- package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_input/dv_input.d.ts +30 -0
- package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_single_input_criterion/dv_single_input_criterion.d.ts +9 -0
- package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_value_in_list_criterion/dv_value_in_list_criterion.d.ts +23 -0
- package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_value_in_range_criterion/dv_value_in_range_criterion.d.ts +12 -0
- package/dist/types/components/side_panel/data_validation/dv_editor/dv_editor.d.ts +34 -0
- package/dist/types/components/side_panel/data_validation/dv_preview/dv_preview.d.ts +13 -0
- package/dist/types/components/side_panel/find_and_replace/find_and_replace.d.ts +27 -0
- package/dist/types/components/side_panel/more_formats/more_formats.d.ts +10 -0
- package/dist/types/components/side_panel/remove_duplicates/remove_duplicates.d.ts +32 -0
- package/dist/types/components/side_panel/select_menu/select_menu.d.ts +29 -0
- package/dist/types/components/side_panel/settings/settings_panel.d.ts +18 -0
- package/dist/types/components/side_panel/side_panel/side_panel.d.ts +18 -0
- package/dist/types/components/side_panel/split_to_columns_panel/split_to_columns_panel.d.ts +35 -0
- package/dist/types/components/spreadsheet/spreadsheet.d.ts +64 -0
- package/dist/types/components/top_bar/top_bar.d.ts +65 -0
- package/dist/types/components/translations_terms.d.ts +104 -0
- package/dist/types/components/validation_messages/validation_messages.d.ts +11 -0
- package/dist/types/constants.d.ts +137 -0
- package/dist/types/formulas/code_builder.d.ts +28 -0
- package/dist/types/formulas/compiler.d.ts +7 -0
- package/dist/types/formulas/composer_tokenizer.d.ts +31 -0
- package/dist/types/formulas/helpers.d.ts +2 -0
- package/dist/types/formulas/index.d.ts +16 -0
- package/dist/types/formulas/parser.d.ts +72 -0
- package/dist/types/formulas/range_tokenizer.d.ts +8 -0
- package/dist/types/formulas/tokenizer.d.ts +25 -0
- package/dist/types/functions/arguments.d.ts +10 -0
- package/dist/types/functions/helper_assert.d.ts +6 -0
- package/dist/types/functions/helper_financial.d.ts +49 -0
- package/dist/types/functions/helper_matrices.d.ts +23 -0
- package/dist/types/functions/helper_statistical.d.ts +3 -0
- package/dist/types/functions/helpers.d.ts +101 -0
- package/dist/types/functions/index.d.ts +10 -0
- package/dist/types/functions/module_array.d.ts +141 -0
- package/dist/types/functions/module_custom.d.ts +8 -0
- package/dist/types/functions/module_database.d.ts +85 -0
- package/dist/types/functions/module_date.d.ts +231 -0
- package/dist/types/functions/module_engineering.d.ts +8 -0
- package/dist/types/functions/module_filter.d.ts +17 -0
- package/dist/types/functions/module_financial.d.ts +358 -0
- package/dist/types/functions/module_info.d.ts +64 -0
- package/dist/types/functions/module_logical.d.ts +59 -0
- package/dist/types/functions/module_lookup.d.ts +72 -0
- package/dist/types/functions/module_math.d.ts +424 -0
- package/dist/types/functions/module_operators.d.ts +98 -0
- package/dist/types/functions/module_statistical.d.ts +296 -0
- package/dist/types/functions/module_text.d.ts +147 -0
- package/dist/types/functions/module_web.d.ts +8 -0
- package/dist/types/helpers/cells/cell_evaluation.d.ts +6 -0
- package/dist/types/helpers/cells/index.d.ts +2 -0
- package/dist/types/helpers/chart_date.d.ts +8 -0
- package/dist/types/helpers/clipboard/clipboard_abstract_cell_state.d.ts +26 -0
- package/dist/types/helpers/clipboard/clipboard_cells_state.d.ts +70 -0
- package/dist/types/helpers/clipboard/clipboard_figure_state.d.ts +41 -0
- package/dist/types/helpers/clipboard/clipboard_os_state.d.ts +12 -0
- package/dist/types/helpers/clipboard/navigator_clipboard_wrapper.d.ts +13 -0
- package/dist/types/helpers/color.d.ts +68 -0
- package/dist/types/helpers/coordinates.d.ts +40 -0
- package/dist/types/helpers/data_validation_helpers.d.ts +5 -0
- package/dist/types/helpers/dates.d.ts +90 -0
- package/dist/types/helpers/edge_scrolling.d.ts +9 -0
- package/dist/types/helpers/event_bus.d.ts +45 -0
- package/dist/types/helpers/figures/charts/abstract_chart.d.ts +56 -0
- package/dist/types/helpers/figures/charts/bar_chart.d.ts +29 -0
- package/dist/types/helpers/figures/charts/chart_common.d.ts +62 -0
- package/dist/types/helpers/figures/charts/chart_factory.d.ts +40 -0
- package/dist/types/helpers/figures/charts/chart_js_gauge_controller.d.ts +1 -0
- package/dist/types/helpers/figures/charts/chart_ui_common.d.ts +41 -0
- package/dist/types/helpers/figures/charts/gauge_chart.d.ts +23 -0
- package/dist/types/helpers/figures/charts/index.d.ts +10 -0
- package/dist/types/helpers/figures/charts/line_chart.d.ts +32 -0
- package/dist/types/helpers/figures/charts/pie_chart.d.ts +27 -0
- package/dist/types/helpers/figures/charts/scorecard_chart.d.ts +30 -0
- package/dist/types/helpers/figures/charts/scorecard_chart_config_builder.d.ts +35 -0
- package/dist/types/helpers/figures/figure/figure.d.ts +6 -0
- package/dist/types/helpers/figures/images/image_provider.d.ts +10 -0
- package/dist/types/helpers/filters.d.ts +19 -0
- package/dist/types/helpers/focus_manager.d.ts +5 -0
- package/dist/types/helpers/format.d.ts +32 -0
- package/dist/types/helpers/index.d.ts +15 -0
- package/dist/types/helpers/internal_viewport.d.ts +83 -0
- package/dist/types/helpers/inverse_commands.d.ts +2 -0
- package/dist/types/helpers/links.d.ts +23 -0
- package/dist/types/helpers/locale.d.ts +58 -0
- package/dist/types/helpers/misc.d.ts +178 -0
- package/dist/types/helpers/numbers.d.ts +25 -0
- package/dist/types/helpers/range.d.ts +59 -0
- package/dist/types/helpers/recompute_zones.d.ts +136 -0
- package/dist/types/helpers/rectangle.d.ts +7 -0
- package/dist/types/helpers/reference_type.d.ts +9 -0
- package/dist/types/helpers/references.d.ts +23 -0
- package/dist/types/helpers/search.d.ts +19 -0
- package/dist/types/helpers/sheet.d.ts +7 -0
- package/dist/types/helpers/sort.d.ts +16 -0
- package/dist/types/helpers/state_manager_helpers.d.ts +6 -0
- package/dist/types/helpers/text_helper.d.ts +28 -0
- package/dist/types/helpers/ui/cut_interactive.d.ts +2 -0
- package/dist/types/helpers/ui/filter_interactive.d.ts +7 -0
- package/dist/types/helpers/ui/freeze_interactive.d.ts +2 -0
- package/dist/types/helpers/ui/merge_interactive.d.ts +6 -0
- package/dist/types/helpers/ui/paste_interactive.d.ts +10 -0
- package/dist/types/helpers/ui/sheet_interactive.d.ts +2 -0
- package/dist/types/helpers/ui/split_to_columns_interactive.d.ts +6 -0
- package/dist/types/helpers/ui/stop_edition_interactive.d.ts +2 -0
- package/dist/types/helpers/ui/toggle_group_interactive.d.ts +6 -0
- package/dist/types/helpers/uuid.d.ts +20 -0
- package/dist/types/helpers/zones.d.ts +173 -0
- package/dist/types/history/branch.d.ts +62 -0
- package/dist/types/history/factory.d.ts +9 -0
- package/dist/types/history/operation.d.ts +17 -0
- package/dist/types/history/operation_sequence.d.ts +31 -0
- package/dist/types/history/repeat_commands/repeat_commands_generic.d.ts +6 -0
- package/dist/types/history/repeat_commands/repeat_commands_specific.d.ts +13 -0
- package/dist/types/history/repeat_commands/repeat_revision.d.ts +5 -0
- package/dist/types/history/selective_history.d.ts +81 -0
- package/dist/types/history/tree.d.ts +175 -0
- package/dist/types/index.d.ts +189 -0
- package/dist/types/migrations/data.d.ts +30 -0
- package/dist/types/migrations/legacy_tools.d.ts +15 -0
- package/dist/types/model.d.ts +192 -0
- package/dist/types/plugins/base_plugin.d.ts +63 -0
- package/dist/types/plugins/core/borders.d.ts +127 -0
- package/dist/types/plugins/core/cell.d.ts +103 -0
- package/dist/types/plugins/core/chart.d.ts +41 -0
- package/dist/types/plugins/core/conditional_format.d.ts +52 -0
- package/dist/types/plugins/core/data_validation.d.ts +31 -0
- package/dist/types/plugins/core/figures.d.ts +34 -0
- package/dist/types/plugins/core/filters.d.ts +43 -0
- package/dist/types/plugins/core/header_grouping.d.ts +82 -0
- package/dist/types/plugins/core/header_size.d.ts +23 -0
- package/dist/types/plugins/core/header_visibility.d.ts +20 -0
- package/dist/types/plugins/core/image.d.ts +32 -0
- package/dist/types/plugins/core/index.d.ts +13 -0
- package/dist/types/plugins/core/merge.d.ts +83 -0
- package/dist/types/plugins/core/range.d.ts +59 -0
- package/dist/types/plugins/core/settings.d.ts +12 -0
- package/dist/types/plugins/core/sheet.d.ts +151 -0
- package/dist/types/plugins/core_plugin.d.ts +49 -0
- package/dist/types/plugins/index.d.ts +7 -0
- package/dist/types/plugins/ui_core_views/cell_evaluation/compilation_parameters.d.ts +10 -0
- package/dist/types/plugins/ui_core_views/cell_evaluation/evaluation_plugin.d.ts +43 -0
- package/dist/types/plugins/ui_core_views/cell_evaluation/evaluator.d.ts +90 -0
- package/dist/types/plugins/ui_core_views/cell_evaluation/formula_dependency_graph.d.ts +23 -0
- package/dist/types/plugins/ui_core_views/cell_evaluation/index.d.ts +1 -0
- package/dist/types/plugins/ui_core_views/cell_evaluation/r_tree.d.ts +108 -0
- package/dist/types/plugins/ui_core_views/cell_evaluation/spreading_relation.d.ts +60 -0
- package/dist/types/plugins/ui_core_views/custom_colors.d.ts +24 -0
- package/dist/types/plugins/ui_core_views/evaluation_chart.d.ts +24 -0
- package/dist/types/plugins/ui_core_views/evaluation_conditional_format.d.ts +37 -0
- package/dist/types/plugins/ui_core_views/evaluation_data_validation.d.ts +38 -0
- package/dist/types/plugins/ui_core_views/header_sizes_ui.d.ts +32 -0
- package/dist/types/plugins/ui_core_views/index.d.ts +5 -0
- package/dist/types/plugins/ui_feature/autofill.d.ts +60 -0
- package/dist/types/plugins/ui_feature/automatic_sum.d.ts +101 -0
- package/dist/types/plugins/ui_feature/cell_popovers.d.ts +16 -0
- package/dist/types/plugins/ui_feature/collaborative.d.ts +25 -0
- package/dist/types/plugins/ui_feature/data_cleanup.d.ts +16 -0
- package/dist/types/plugins/ui_feature/find_and_replace.d.ts +76 -0
- package/dist/types/plugins/ui_feature/format.d.ts +23 -0
- package/dist/types/plugins/ui_feature/header_visibility_ui.d.ts +21 -0
- package/dist/types/plugins/ui_feature/highlight.d.ts +12 -0
- package/dist/types/plugins/ui_feature/index.d.ts +15 -0
- package/dist/types/plugins/ui_feature/local_history.d.ts +36 -0
- package/dist/types/plugins/ui_feature/renderer.d.ts +45 -0
- package/dist/types/plugins/ui_feature/selection_input.d.ts +67 -0
- package/dist/types/plugins/ui_feature/selection_inputs_manager.d.ts +33 -0
- package/dist/types/plugins/ui_feature/sort.d.ts +75 -0
- package/dist/types/plugins/ui_feature/split_to_columns.d.ts +21 -0
- package/dist/types/plugins/ui_feature/ui_options.d.ts +8 -0
- package/dist/types/plugins/ui_feature/ui_sheet.d.ts +30 -0
- package/dist/types/plugins/ui_plugin.d.ts +36 -0
- package/dist/types/plugins/ui_stateful/clipboard.d.ts +43 -0
- package/dist/types/plugins/ui_stateful/edition.d.ts +117 -0
- package/dist/types/plugins/ui_stateful/filter_evaluation.d.ts +26 -0
- package/dist/types/plugins/ui_stateful/header_positions.d.ts +28 -0
- package/dist/types/plugins/ui_stateful/index.d.ts +5 -0
- package/dist/types/plugins/ui_stateful/selection.d.ts +78 -0
- package/dist/types/plugins/ui_stateful/sheetview.d.ts +164 -0
- package/dist/types/registries/autofill_modifiers.d.ts +7 -0
- package/dist/types/registries/autofill_rules.d.ts +15 -0
- package/dist/types/registries/cell_clickable_registry.d.ts +8 -0
- package/dist/types/registries/cell_popovers_registry.d.ts +3 -0
- package/dist/types/registries/chart_types.d.ts +28 -0
- package/dist/types/registries/currencies_registry.d.ts +7 -0
- package/dist/types/registries/data_validation_registry.d.ts +32 -0
- package/dist/types/registries/figure_registry.d.ts +18 -0
- package/dist/types/registries/index.d.ts +11 -0
- package/dist/types/registries/inverse_command_registry.d.ts +5 -0
- package/dist/types/registries/menu_items_registry.d.ts +19 -0
- package/dist/types/registries/menus/cell_menu_registry.d.ts +2 -0
- package/dist/types/registries/menus/col_menu_registry.d.ts +2 -0
- package/dist/types/registries/menus/header_group_registry.d.ts +7 -0
- package/dist/types/registries/menus/index.d.ts +7 -0
- package/dist/types/registries/menus/link_menu_registry.d.ts +2 -0
- package/dist/types/registries/menus/number_format_menu_registry.d.ts +4 -0
- package/dist/types/registries/menus/row_menu_registry.d.ts +2 -0
- package/dist/types/registries/menus/sheet_menu_registry.d.ts +4 -0
- package/dist/types/registries/menus/topbar_menu_registry.d.ts +2 -0
- package/dist/types/registries/ot_registry.d.ts +21 -0
- package/dist/types/registries/registry.d.ts +44 -0
- package/dist/types/registries/repeat_commands_registry.d.ts +20 -0
- package/dist/types/registries/side_panel_registry.d.ts +8 -0
- package/dist/types/registries/topbar_component_registry.d.ts +18 -0
- package/dist/types/selection_stream/event_stream.d.ts +64 -0
- package/dist/types/selection_stream/selection_stream_processor.d.ts +167 -0
- package/dist/types/state_observer.d.ts +15 -0
- package/dist/types/translation.d.ts +21 -0
- package/dist/types/types/autofill.d.ts +62 -0
- package/dist/types/types/cell_popovers.d.ts +44 -0
- package/dist/types/types/cells.d.ts +64 -0
- package/dist/types/types/chart/bar_chart.d.ts +19 -0
- package/dist/types/types/chart/chart.d.ts +48 -0
- package/dist/types/types/chart/common_chart.d.ts +2 -0
- package/dist/types/types/chart/gauge_chart.d.ts +73 -0
- package/dist/types/types/chart/index.d.ts +7 -0
- package/dist/types/types/chart/line_chart.d.ts +21 -0
- package/dist/types/types/chart/pie_chart.d.ts +17 -0
- package/dist/types/types/chart/scorecard_chart.d.ts +26 -0
- package/dist/types/types/clipboard.d.ts +31 -0
- package/dist/types/types/collaborative/revisions.d.ts +7 -0
- package/dist/types/types/collaborative/session.d.ts +46 -0
- package/dist/types/types/collaborative/transport_service.d.ts +91 -0
- package/dist/types/types/commands.d.ts +873 -0
- package/dist/types/types/conditional_formatting.d.ts +103 -0
- package/dist/types/types/currency.d.ts +7 -0
- package/dist/types/types/data_validation.d.ts +121 -0
- package/dist/types/types/env.d.ts +33 -0
- package/dist/types/types/errors.d.ts +33 -0
- package/dist/types/types/event_stream/index.d.ts +1 -0
- package/dist/types/types/event_stream/selection_events.d.ts +11 -0
- package/dist/types/types/figure.d.ts +14 -0
- package/dist/types/types/files.d.ts +27 -0
- package/dist/types/types/format.d.ts +8 -0
- package/dist/types/types/functions.d.ts +49 -0
- package/dist/types/types/getters.d.ts +101 -0
- package/dist/types/types/history.d.ts +43 -0
- package/dist/types/types/image.d.ts +12 -0
- package/dist/types/types/index.d.ts +30 -0
- package/dist/types/types/locale.d.ts +13 -0
- package/dist/types/types/misc.d.ts +276 -0
- package/dist/types/types/range.d.ts +21 -0
- package/dist/types/types/rendering.d.ts +86 -0
- package/dist/types/types/validator.d.ts +16 -0
- package/dist/types/types/workbook_data.d.ts +112 -0
- package/dist/types/types/xlsx.d.ts +441 -0
- package/dist/types/xlsx/constants.d.ts +74 -0
- package/dist/types/xlsx/conversion/cf_conversion.d.ts +4 -0
- package/dist/types/xlsx/conversion/color_conversion.d.ts +24 -0
- package/dist/types/xlsx/conversion/conversion_maps.d.ts +167 -0
- package/dist/types/xlsx/conversion/figure_conversion.d.ts +3 -0
- package/dist/types/xlsx/conversion/format_conversion.d.ts +8 -0
- package/dist/types/xlsx/conversion/formula_conversion.d.ts +9 -0
- package/dist/types/xlsx/conversion/index.d.ts +7 -0
- package/dist/types/xlsx/conversion/sheet_conversion.d.ts +4 -0
- package/dist/types/xlsx/conversion/style_conversion.d.ts +19 -0
- package/dist/types/xlsx/conversion/table_conversion.d.ts +14 -0
- package/dist/types/xlsx/extraction/base_extractor.d.ts +142 -0
- package/dist/types/xlsx/extraction/cf_extractor.d.ts +14 -0
- package/dist/types/xlsx/extraction/chart_extractor.d.ts +11 -0
- package/dist/types/xlsx/extraction/external_book_extractor.d.ts +6 -0
- package/dist/types/xlsx/extraction/figure_extractor.d.ts +8 -0
- package/dist/types/xlsx/extraction/index.d.ts +3 -0
- package/dist/types/xlsx/extraction/misc_extractor.d.ts +18 -0
- package/dist/types/xlsx/extraction/pivot_extractor.d.ts +8 -0
- package/dist/types/xlsx/extraction/sheet_extractor.d.ts +23 -0
- package/dist/types/xlsx/extraction/style_extractor.d.ts +19 -0
- package/dist/types/xlsx/extraction/table_extractor.d.ts +10 -0
- package/dist/types/xlsx/functions/cells.d.ts +11 -0
- package/dist/types/xlsx/functions/charts.d.ts +3 -0
- package/dist/types/xlsx/functions/conditional_formatting.d.ts +3 -0
- package/dist/types/xlsx/functions/drawings.d.ts +5 -0
- package/dist/types/xlsx/functions/styles.d.ts +10 -0
- package/dist/types/xlsx/functions/table.d.ts +2 -0
- package/dist/types/xlsx/functions/worksheet.d.ts +9 -0
- package/dist/types/xlsx/helpers/colors.d.ts +8 -0
- package/dist/types/xlsx/helpers/content_helpers.d.ts +48 -0
- package/dist/types/xlsx/helpers/misc.d.ts +29 -0
- package/dist/types/xlsx/helpers/xlsx_helper.d.ts +10 -0
- package/dist/types/xlsx/helpers/xlsx_parser_error_manager.d.ts +34 -0
- package/dist/types/xlsx/helpers/xml_helpers.d.ts +36 -0
- package/dist/types/xlsx/xlsx_reader.d.ts +13 -0
- package/dist/types/xlsx/xlsx_writer.d.ts +8 -0
- package/package.json +42 -25
- package/dist/o-spreadsheet.d.ts +0 -8046
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export declare const CfTerms: {
|
|
2
|
+
Errors: {
|
|
3
|
+
InvalidRange: string;
|
|
4
|
+
FirstArgMissing: string;
|
|
5
|
+
SecondArgMissing: string;
|
|
6
|
+
MinNaN: string;
|
|
7
|
+
MidNaN: string;
|
|
8
|
+
MaxNaN: string;
|
|
9
|
+
ValueUpperInflectionNaN: string;
|
|
10
|
+
ValueLowerInflectionNaN: string;
|
|
11
|
+
MinBiggerThanMax: string;
|
|
12
|
+
MinBiggerThanMid: string;
|
|
13
|
+
MidBiggerThanMax: string;
|
|
14
|
+
LowerBiggerThanUpper: string;
|
|
15
|
+
MinInvalidFormula: string;
|
|
16
|
+
MaxInvalidFormula: string;
|
|
17
|
+
MidInvalidFormula: string;
|
|
18
|
+
ValueUpperInvalidFormula: string;
|
|
19
|
+
ValueLowerInvalidFormula: string;
|
|
20
|
+
EmptyRange: string;
|
|
21
|
+
Unexpected: string;
|
|
22
|
+
};
|
|
23
|
+
ColorScale: string;
|
|
24
|
+
IconSet: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const CellIsOperators: {
|
|
27
|
+
IsEmpty: string;
|
|
28
|
+
IsNotEmpty: string;
|
|
29
|
+
ContainsText: string;
|
|
30
|
+
NotContains: string;
|
|
31
|
+
BeginsWith: string;
|
|
32
|
+
EndsWith: string;
|
|
33
|
+
Equal: string;
|
|
34
|
+
NotEqual: string;
|
|
35
|
+
GreaterThan: string;
|
|
36
|
+
GreaterThanOrEqual: string;
|
|
37
|
+
LessThan: string;
|
|
38
|
+
LessThanOrEqual: string;
|
|
39
|
+
Between: string;
|
|
40
|
+
NotBetween: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const ChartTerms: {
|
|
43
|
+
Series: string;
|
|
44
|
+
Errors: {
|
|
45
|
+
Unexpected: string;
|
|
46
|
+
InvalidDataSet: string;
|
|
47
|
+
InvalidLabelRange: string;
|
|
48
|
+
InvalidScorecardKeyValue: string;
|
|
49
|
+
InvalidScorecardBaseline: string;
|
|
50
|
+
InvalidGaugeDataRange: string;
|
|
51
|
+
EmptyGaugeRangeMin: string;
|
|
52
|
+
GaugeRangeMinNaN: string;
|
|
53
|
+
EmptyGaugeRangeMax: string;
|
|
54
|
+
GaugeRangeMaxNaN: string;
|
|
55
|
+
GaugeRangeMinBiggerThanRangeMax: string;
|
|
56
|
+
GaugeLowerInflectionPointNaN: string;
|
|
57
|
+
GaugeUpperInflectionPointNaN: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare const CustomCurrencyTerms: {
|
|
61
|
+
Custom: string;
|
|
62
|
+
};
|
|
63
|
+
export declare const MergeErrorMessage: string;
|
|
64
|
+
export declare const SplitToColumnsTerms: {
|
|
65
|
+
Errors: {
|
|
66
|
+
Unexpected: string;
|
|
67
|
+
NoSplitSeparatorInSelection: string;
|
|
68
|
+
MoreThanOneColumnSelected: string;
|
|
69
|
+
SplitWillOverwriteContent: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export declare const RemoveDuplicateTerms: {
|
|
73
|
+
Errors: {
|
|
74
|
+
Unexpected: string;
|
|
75
|
+
MoreThanOneRangeSelected: string;
|
|
76
|
+
EmptyTarget: string;
|
|
77
|
+
NoColumnsProvided: string;
|
|
78
|
+
WillRemoveExistingMerge: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export declare const DVTerms: {
|
|
82
|
+
DateIs: {
|
|
83
|
+
today: string;
|
|
84
|
+
yesterday: string;
|
|
85
|
+
tomorrow: string;
|
|
86
|
+
lastWeek: string;
|
|
87
|
+
lastMonth: string;
|
|
88
|
+
lastYear: string;
|
|
89
|
+
};
|
|
90
|
+
DateIsBefore: {
|
|
91
|
+
today: string;
|
|
92
|
+
yesterday: string;
|
|
93
|
+
tomorrow: string;
|
|
94
|
+
lastWeek: string;
|
|
95
|
+
lastMonth: string;
|
|
96
|
+
lastYear: string;
|
|
97
|
+
};
|
|
98
|
+
CriterionError: {
|
|
99
|
+
notEmptyValue: string;
|
|
100
|
+
numberValue: string;
|
|
101
|
+
dateValue: string;
|
|
102
|
+
validRange: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from "@odoo/owl";
|
|
2
|
+
import { SpreadsheetChildEnv } from "../../types/index";
|
|
3
|
+
interface Props {
|
|
4
|
+
messages: string[];
|
|
5
|
+
msgType: "warning" | "error";
|
|
6
|
+
}
|
|
7
|
+
export declare class ValidationMessages extends Component<Props, SpreadsheetChildEnv> {
|
|
8
|
+
static template: string;
|
|
9
|
+
get divClasses(): "o-validation-warning text-warning" | "o-validation-error text-danger";
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { BorderDescr, Color } from "./types";
|
|
2
|
+
import { CellErrorType } from "./types/errors";
|
|
3
|
+
export declare const CANVAS_SHIFT = 0.5;
|
|
4
|
+
export declare const BACKGROUND_GRAY_COLOR = "#f5f5f5";
|
|
5
|
+
export declare const BACKGROUND_HEADER_COLOR = "#F8F9FA";
|
|
6
|
+
export declare const BACKGROUND_HEADER_SELECTED_COLOR = "#E8EAED";
|
|
7
|
+
export declare const BACKGROUND_HEADER_ACTIVE_COLOR = "#595959";
|
|
8
|
+
export declare const TEXT_HEADER_COLOR = "#666666";
|
|
9
|
+
export declare const FIGURE_BORDER_COLOR = "#c9ccd2";
|
|
10
|
+
export declare const SELECTION_BORDER_COLOR = "#3266ca";
|
|
11
|
+
export declare const HEADER_BORDER_COLOR = "#C0C0C0";
|
|
12
|
+
export declare const CELL_BORDER_COLOR = "#E2E3E3";
|
|
13
|
+
export declare const BACKGROUND_CHART_COLOR = "#FFFFFF";
|
|
14
|
+
export declare const BG_HOVER_COLOR = "#EBEBEB";
|
|
15
|
+
export declare const DISABLED_TEXT_COLOR = "#CACACA";
|
|
16
|
+
export declare const DEFAULT_COLOR_SCALE_MIDPOINT_COLOR = 11982760;
|
|
17
|
+
export declare const LINK_COLOR = "#01666b";
|
|
18
|
+
export declare const FILTERS_COLOR = "#188038";
|
|
19
|
+
export declare const BACKGROUND_HEADER_FILTER_COLOR = "#E6F4EA";
|
|
20
|
+
export declare const BACKGROUND_HEADER_SELECTED_FILTER_COLOR = "#CEEAD6";
|
|
21
|
+
export declare const SEPARATOR_COLOR = "#E0E2E4";
|
|
22
|
+
export declare const ICONS_COLOR = "#4A4F59";
|
|
23
|
+
export declare const HEADER_GROUPING_BACKGROUND_COLOR = "#F5F5F5";
|
|
24
|
+
export declare const HEADER_GROUPING_BORDER_COLOR = "#999";
|
|
25
|
+
export declare const GRID_BORDER_COLOR = "#E2E3E3";
|
|
26
|
+
export declare const FROZEN_PANE_HEADER_BORDER_COLOR = "#BCBCBC";
|
|
27
|
+
export declare const FROZEN_PANE_BORDER_COLOR = "#DADFE8";
|
|
28
|
+
export declare const COMPOSER_ASSISTANT_COLOR = "#9B359B";
|
|
29
|
+
export declare const COLOR_PICKER_DEFAULTS: Color[];
|
|
30
|
+
export declare const MIN_ROW_HEIGHT = 10;
|
|
31
|
+
export declare const MIN_COL_WIDTH = 5;
|
|
32
|
+
export declare const HEADER_HEIGHT = 26;
|
|
33
|
+
export declare const HEADER_WIDTH = 48;
|
|
34
|
+
export declare const TOPBAR_HEIGHT = 63;
|
|
35
|
+
export declare const TOPBAR_TOOLBAR_HEIGHT = 34;
|
|
36
|
+
export declare const BOTTOMBAR_HEIGHT = 36;
|
|
37
|
+
export declare const DEFAULT_CELL_WIDTH = 96;
|
|
38
|
+
export declare const DEFAULT_CELL_HEIGHT = 23;
|
|
39
|
+
export declare const SCROLLBAR_WIDTH = 15;
|
|
40
|
+
export declare const AUTOFILL_EDGE_LENGTH = 8;
|
|
41
|
+
export declare const ICON_EDGE_LENGTH = 18;
|
|
42
|
+
export declare const UNHIDE_ICON_EDGE_LENGTH = 14;
|
|
43
|
+
export declare const MIN_CF_ICON_MARGIN = 4;
|
|
44
|
+
export declare const MIN_CELL_TEXT_MARGIN = 4;
|
|
45
|
+
export declare const CF_ICON_EDGE_LENGTH = 15;
|
|
46
|
+
export declare const PADDING_AUTORESIZE_VERTICAL = 3;
|
|
47
|
+
export declare const PADDING_AUTORESIZE_HORIZONTAL = 4;
|
|
48
|
+
export declare const GROUP_LAYER_WIDTH = 21;
|
|
49
|
+
export declare const GRID_ICON_MARGIN = 2;
|
|
50
|
+
export declare const GRID_ICON_EDGE_LENGTH = 17;
|
|
51
|
+
export declare const FILTER_ICON_MARGIN = 2;
|
|
52
|
+
export declare const FILTER_ICON_EDGE_LENGTH = 17;
|
|
53
|
+
export declare const FOOTER_HEIGHT: number;
|
|
54
|
+
export declare const MENU_WIDTH = 250;
|
|
55
|
+
export declare const MENU_VERTICAL_PADDING = 6;
|
|
56
|
+
export declare const MENU_ITEM_HEIGHT = 26;
|
|
57
|
+
export declare const MENU_ITEM_PADDING_HORIZONTAL = 11;
|
|
58
|
+
export declare const MENU_ITEM_PADDING_VERTICAL = 4;
|
|
59
|
+
export declare const MENU_SEPARATOR_BORDER_WIDTH = 1;
|
|
60
|
+
export declare const MENU_SEPARATOR_PADDING = 5;
|
|
61
|
+
export declare const MENU_SEPARATOR_HEIGHT: number;
|
|
62
|
+
export declare const DEFAULT_STYLE: {
|
|
63
|
+
align: "left";
|
|
64
|
+
verticalAlign: "bottom";
|
|
65
|
+
wrapping: "overflow";
|
|
66
|
+
bold: false;
|
|
67
|
+
italic: false;
|
|
68
|
+
strikethrough: false;
|
|
69
|
+
underline: false;
|
|
70
|
+
fontSize: number;
|
|
71
|
+
fillColor: string;
|
|
72
|
+
textColor: string;
|
|
73
|
+
};
|
|
74
|
+
export declare const DEFAULT_NUMBER_STYLE: {
|
|
75
|
+
align: "right";
|
|
76
|
+
verticalAlign: "bottom";
|
|
77
|
+
wrapping: "overflow";
|
|
78
|
+
bold: false;
|
|
79
|
+
italic: false;
|
|
80
|
+
strikethrough: false;
|
|
81
|
+
underline: false;
|
|
82
|
+
fontSize: number;
|
|
83
|
+
fillColor: string;
|
|
84
|
+
textColor: string;
|
|
85
|
+
};
|
|
86
|
+
export declare const DEFAULT_VERTICAL_ALIGN: "bottom";
|
|
87
|
+
export declare const DEFAULT_WRAPPING_MODE: "overflow";
|
|
88
|
+
export declare const DEFAULT_FONT_WEIGHT = "400";
|
|
89
|
+
export declare const DEFAULT_FONT_SIZE: number;
|
|
90
|
+
export declare const HEADER_FONT_SIZE = 11;
|
|
91
|
+
export declare const DEFAULT_FONT = "'Roboto', arial";
|
|
92
|
+
export declare const DEFAULT_BORDER_DESC: BorderDescr;
|
|
93
|
+
export declare const DEFAULT_FILTER_BORDER_DESC: BorderDescr;
|
|
94
|
+
export declare const INCORRECT_RANGE_STRING = CellErrorType.InvalidReference;
|
|
95
|
+
export declare const MAX_HISTORY_STEPS = 99;
|
|
96
|
+
export declare const DEFAULT_REVISION_ID = "START_REVISION";
|
|
97
|
+
export declare const DEFAULT_FIGURE_HEIGHT = 335;
|
|
98
|
+
export declare const DEFAULT_FIGURE_WIDTH = 536;
|
|
99
|
+
export declare const FIGURE_BORDER_WIDTH = 1;
|
|
100
|
+
export declare const ACTIVE_BORDER_WIDTH = 2;
|
|
101
|
+
export declare const MIN_FIG_SIZE = 80;
|
|
102
|
+
export declare const MAX_CHAR_LABEL = 20;
|
|
103
|
+
export declare const FIGURE_ID_SPLITTER = "??";
|
|
104
|
+
export declare const DEFAULT_GAUGE_LOWER_COLOR = "#cc0000";
|
|
105
|
+
export declare const DEFAULT_GAUGE_MIDDLE_COLOR = "#f1c232";
|
|
106
|
+
export declare const DEFAULT_GAUGE_UPPER_COLOR = "#6aa84f";
|
|
107
|
+
export declare const DEFAULT_SCORECARD_BASELINE_MODE = "difference";
|
|
108
|
+
export declare const DEFAULT_SCORECARD_BASELINE_COLOR_UP = "#00A04A";
|
|
109
|
+
export declare const DEFAULT_SCORECARD_BASELINE_COLOR_DOWN = "#DC6965";
|
|
110
|
+
export declare const LINE_FILL_TRANSPARENCY = 0.4;
|
|
111
|
+
export declare const DEBOUNCE_TIME = 200;
|
|
112
|
+
export declare const MESSAGE_VERSION = 1;
|
|
113
|
+
export declare const FORBIDDEN_SHEET_CHARS: readonly ["'", "*", "?", "/", "\\", "[", "]"];
|
|
114
|
+
export declare const FORBIDDEN_IN_EXCEL_REGEX: RegExp;
|
|
115
|
+
export declare const FORMULA_REF_IDENTIFIER = "|";
|
|
116
|
+
export declare const LOADING = "Loading...";
|
|
117
|
+
export declare const DEFAULT_ERROR_MESSAGE: string;
|
|
118
|
+
export declare enum ComponentsImportance {
|
|
119
|
+
Grid = 0,
|
|
120
|
+
Highlight = 5,
|
|
121
|
+
HeaderGroupingButton = 6,
|
|
122
|
+
Figure = 10,
|
|
123
|
+
ScrollBar = 15,
|
|
124
|
+
GridPopover = 19,
|
|
125
|
+
GridComposer = 20,
|
|
126
|
+
Dropdown = 21,
|
|
127
|
+
IconPicker = 25,
|
|
128
|
+
TopBarComposer = 30,
|
|
129
|
+
Popover = 35,
|
|
130
|
+
FigureAnchor = 1000,
|
|
131
|
+
FigureSnapLine = 1001
|
|
132
|
+
}
|
|
133
|
+
export declare function getDefaultSheetViewSize(): number;
|
|
134
|
+
export declare function setDefaultSheetViewSize(size: number): void;
|
|
135
|
+
export declare const MAXIMAL_FREEZABLE_RATIO = 0.85;
|
|
136
|
+
export declare const NEWLINE = "\n";
|
|
137
|
+
export declare const FONT_SIZES: number[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Block of code that produces a value.
|
|
3
|
+
*/
|
|
4
|
+
export interface FunctionCode {
|
|
5
|
+
readonly returnExpression: string;
|
|
6
|
+
/**
|
|
7
|
+
* Return the same function code but wrapped in a closure.
|
|
8
|
+
*/
|
|
9
|
+
wrapInClosure(): FunctionCode;
|
|
10
|
+
/**
|
|
11
|
+
* Return the same function code but with the return expression assigned to a variable.
|
|
12
|
+
*/
|
|
13
|
+
assignResultToVariable(): FunctionCode;
|
|
14
|
+
}
|
|
15
|
+
export declare class FunctionCodeBuilder {
|
|
16
|
+
private scope;
|
|
17
|
+
private code;
|
|
18
|
+
constructor(scope?: Scope);
|
|
19
|
+
append(...lines: (string | FunctionCode)[]): void;
|
|
20
|
+
return(expression: string): FunctionCode;
|
|
21
|
+
toString(): string;
|
|
22
|
+
}
|
|
23
|
+
export declare class Scope {
|
|
24
|
+
private nextId;
|
|
25
|
+
private declaredVariables;
|
|
26
|
+
nextVariableName(): string;
|
|
27
|
+
isAlreadyDeclared(name: string): boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Token } from ".";
|
|
2
|
+
import { CompiledFormula } from "../types";
|
|
3
|
+
export declare const functionCache: {
|
|
4
|
+
[key: string]: Omit<CompiledFormula, "dependencies" | "tokens">;
|
|
5
|
+
};
|
|
6
|
+
export declare function compile(formula: string): CompiledFormula;
|
|
7
|
+
export declare function compileTokens(tokens: Token[]): CompiledFormula;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Locale } from "../types";
|
|
2
|
+
import { Token } from "./index";
|
|
3
|
+
interface FunctionContext {
|
|
4
|
+
parent: string;
|
|
5
|
+
argPosition: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Enriched Token is used by the composer to add information on the tokens that
|
|
9
|
+
* are only needed during the edition of a formula.
|
|
10
|
+
*
|
|
11
|
+
* The information added are:
|
|
12
|
+
* - start, end and length of each token
|
|
13
|
+
* - range detection (replaces the tokens that composes the range with 1 token)
|
|
14
|
+
* - parenthesis matching (only for parenthesis tokens)
|
|
15
|
+
* - parent function (only for tokens surrounded by a function)
|
|
16
|
+
* - arg position (only for tokens surrounded by a function)
|
|
17
|
+
*/
|
|
18
|
+
export interface EnrichedToken extends Token {
|
|
19
|
+
start: number;
|
|
20
|
+
end: number;
|
|
21
|
+
length: number;
|
|
22
|
+
parenIndex?: number;
|
|
23
|
+
functionContext?: FunctionContext;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Take the result of the tokenizer and transform it to be usable in the composer.
|
|
27
|
+
*
|
|
28
|
+
* @param formula
|
|
29
|
+
*/
|
|
30
|
+
export declare function composerTokenize(formula: string, locale: Locale): EnrichedToken[];
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The formulas module provides all functionality related to manipulating
|
|
3
|
+
* formulas:
|
|
4
|
+
*
|
|
5
|
+
* - tokenization (transforming a string into a list of tokens)
|
|
6
|
+
* - parsing (same, but into an AST (Abstract Syntax Tree))
|
|
7
|
+
* - compiler (getting an executable function representing a formula)
|
|
8
|
+
*/
|
|
9
|
+
export { compile } from "./compiler";
|
|
10
|
+
export { composerTokenize } from "./composer_tokenizer";
|
|
11
|
+
export type { EnrichedToken } from "./composer_tokenizer";
|
|
12
|
+
export * from "./helpers";
|
|
13
|
+
export { parse } from "./parser";
|
|
14
|
+
export { rangeTokenize } from "./range_tokenizer";
|
|
15
|
+
export { tokenize } from "./tokenizer";
|
|
16
|
+
export type { Token } from "./tokenizer";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Token } from "./tokenizer";
|
|
2
|
+
interface ASTBase {
|
|
3
|
+
debug?: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface ASTNumber extends ASTBase {
|
|
6
|
+
type: "NUMBER";
|
|
7
|
+
value: number;
|
|
8
|
+
}
|
|
9
|
+
interface ASTReference extends ASTBase {
|
|
10
|
+
type: "REFERENCE";
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ASTString extends ASTBase {
|
|
14
|
+
type: "STRING";
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
interface ASTBoolean extends ASTBase {
|
|
18
|
+
type: "BOOLEAN";
|
|
19
|
+
value: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface ASTUnaryOperation extends ASTBase {
|
|
22
|
+
type: "UNARY_OPERATION";
|
|
23
|
+
value: any;
|
|
24
|
+
operand: AST;
|
|
25
|
+
postfix?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface ASTOperation extends ASTBase {
|
|
28
|
+
type: "BIN_OPERATION";
|
|
29
|
+
value: any;
|
|
30
|
+
left: AST;
|
|
31
|
+
right: AST;
|
|
32
|
+
}
|
|
33
|
+
export interface ASTFuncall extends ASTBase {
|
|
34
|
+
type: "FUNCALL";
|
|
35
|
+
value: string;
|
|
36
|
+
args: AST[];
|
|
37
|
+
}
|
|
38
|
+
interface ASTEmpty extends ASTBase {
|
|
39
|
+
type: "EMPTY";
|
|
40
|
+
value: "";
|
|
41
|
+
}
|
|
42
|
+
export type AST = ASTOperation | ASTUnaryOperation | ASTFuncall | ASTNumber | ASTBoolean | ASTString | ASTReference | ASTEmpty;
|
|
43
|
+
/**
|
|
44
|
+
* Parse an expression (as a string) into an AST.
|
|
45
|
+
*/
|
|
46
|
+
export declare function parse(str: string): AST;
|
|
47
|
+
export declare function parseTokens(tokens: Token[]): AST;
|
|
48
|
+
/**
|
|
49
|
+
* Allows to visit all nodes of an AST and apply a mapping function
|
|
50
|
+
* to nodes of a specific type.
|
|
51
|
+
* Useful if you want to convert some part of a formula.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* convertAstNodes(ast, "FUNCALL", convertFormulaToExcel)
|
|
55
|
+
*
|
|
56
|
+
* function convertFormulaToExcel(ast: ASTFuncall) {
|
|
57
|
+
* // ...
|
|
58
|
+
* return modifiedAst
|
|
59
|
+
* }
|
|
60
|
+
*/
|
|
61
|
+
export declare function convertAstNodes<T extends AST["type"]>(ast: AST, type: T, fn: (ast: Extract<AST, {
|
|
62
|
+
type: T;
|
|
63
|
+
}>) => AST): AST;
|
|
64
|
+
export declare function iterateAstNodes(ast: AST): AST[];
|
|
65
|
+
export declare function mapAst<T extends AST["type"]>(ast: AST, fn: (ast: Extract<AST, {
|
|
66
|
+
type: T;
|
|
67
|
+
}>) => AST): AST;
|
|
68
|
+
/**
|
|
69
|
+
* Converts an ast formula to the corresponding string
|
|
70
|
+
*/
|
|
71
|
+
export declare function astToFormula(ast: AST): string;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Token } from "./tokenizer";
|
|
2
|
+
/**
|
|
3
|
+
* Take the result of the tokenizer and transform it to be usable in the
|
|
4
|
+
* manipulations of range
|
|
5
|
+
*
|
|
6
|
+
* @param formula
|
|
7
|
+
*/
|
|
8
|
+
export declare function rangeTokenize(formula: string, locale?: import("../types").Locale): Token[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Locale } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Tokenizer
|
|
4
|
+
*
|
|
5
|
+
* A tokenizer is a piece of code whose job is to transform a string into a list
|
|
6
|
+
* of "tokens". For example, "(12+" is converted into:
|
|
7
|
+
* [{type: "LEFT_PAREN", value: "("},
|
|
8
|
+
* {type: "NUMBER", value: "12"},
|
|
9
|
+
* {type: "OPERATOR", value: "+"}]
|
|
10
|
+
*
|
|
11
|
+
* As the example shows, a tokenizer does not care about the meaning behind those
|
|
12
|
+
* tokens. It only cares about the structure.
|
|
13
|
+
*
|
|
14
|
+
* The tokenizer is usually the first step in a compilation pipeline. Also, it
|
|
15
|
+
* is useful for the composer, which needs to be able to work with incomplete
|
|
16
|
+
* formulas.
|
|
17
|
+
*/
|
|
18
|
+
export declare const POSTFIX_UNARY_OPERATORS: string[];
|
|
19
|
+
type TokenType = "OPERATOR" | "NUMBER" | "STRING" | "SYMBOL" | "SPACE" | "DEBUGGER" | "ARG_SEPARATOR" | "LEFT_PAREN" | "RIGHT_PAREN" | "REFERENCE" | "INVALID_REFERENCE" | "UNKNOWN";
|
|
20
|
+
export interface Token {
|
|
21
|
+
readonly type: TokenType;
|
|
22
|
+
readonly value: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function tokenize(str: string, locale?: Locale): Token[];
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AddFunctionDescription, ArgDefinition, FunctionDescription } from "../types";
|
|
2
|
+
export declare function arg(definition: string, description?: string): ArgDefinition;
|
|
3
|
+
/**
|
|
4
|
+
* This function adds on description more general information derived from the
|
|
5
|
+
* arguments.
|
|
6
|
+
*
|
|
7
|
+
* This information is useful during compilation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function addMetaInfoFromArg(addDescr: AddFunctionDescription): FunctionDescription;
|
|
10
|
+
export declare function validateArguments(args: ArgDefinition[]): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ArgValue, CellValue, Matrix } from "../types";
|
|
2
|
+
export declare function assertSingleColOrRow(errorStr: string, arg: Matrix): void;
|
|
3
|
+
export declare function assertSameDimensions(errorStr: string, ...args: ArgValue[]): void;
|
|
4
|
+
export declare function assertPositive(errorStr: string, arg: number): void;
|
|
5
|
+
export declare function assertSquareMatrix(errorStr: string, arg: Matrix<CellValue>): void;
|
|
6
|
+
export declare function isNumberMatrix(arg: Matrix<CellValue>): arg is Matrix<number>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Locale } from "../types";
|
|
2
|
+
/** Assert maturity date > settlement date */
|
|
3
|
+
export declare function assertMaturityAndSettlementDatesAreValid(settlement: number, maturity: number): void;
|
|
4
|
+
/** Assert settlement date > issue date */
|
|
5
|
+
export declare function assertSettlementAndIssueDatesAreValid(settlement: number, issue: number): void;
|
|
6
|
+
/** Assert coupon frequency is in [1, 2, 4] */
|
|
7
|
+
export declare function assertCouponFrequencyIsValid(frequency: number): void;
|
|
8
|
+
/** Assert dayCountConvention is between 0 and 4 */
|
|
9
|
+
export declare function assertDayCountConventionIsValid(dayCountConvention: number): void;
|
|
10
|
+
export declare function assertRedemptionStrictlyPositive(redemption: number): void;
|
|
11
|
+
export declare function assertPriceStrictlyPositive(price: number): void;
|
|
12
|
+
export declare function assertNumberOfPeriodsStrictlyPositive(nPeriods: number): void;
|
|
13
|
+
export declare function assertRateStrictlyPositive(rate: number): void;
|
|
14
|
+
export declare function assertLifeStrictlyPositive(life: number): void;
|
|
15
|
+
export declare function assertCostStrictlyPositive(cost: number): void;
|
|
16
|
+
export declare function assertCostPositiveOrZero(cost: number): void;
|
|
17
|
+
export declare function assertPeriodStrictlyPositive(period: number): void;
|
|
18
|
+
export declare function assertPeriodPositiveOrZero(period: number): void;
|
|
19
|
+
export declare function assertSalvagePositiveOrZero(salvage: number): void;
|
|
20
|
+
export declare function assertSalvageSmallerOrEqualThanCost(salvage: number, cost: number): void;
|
|
21
|
+
export declare function assertPresentValueStrictlyPositive(pv: number): void;
|
|
22
|
+
export declare function assertPeriodSmallerOrEqualToLife(period: number, life: number): void;
|
|
23
|
+
export declare function assertInvestmentStrictlyPositive(investment: number): void;
|
|
24
|
+
export declare function assertDiscountStrictlyPositive(discount: number): void;
|
|
25
|
+
export declare function assertDiscountStrictlySmallerThanOne(discount: number): void;
|
|
26
|
+
export declare function assertDeprecationFactorStrictlyPositive(factor: number): void;
|
|
27
|
+
export declare function assertSettlementLessThanOneYearBeforeMaturity(settlement: number, maturity: number, locale: Locale): void;
|
|
28
|
+
/**
|
|
29
|
+
* Check if the given periods are valid. This will assert :
|
|
30
|
+
*
|
|
31
|
+
* - 0 < numberOfPeriods
|
|
32
|
+
* - 0 < firstPeriod <= lastPeriod
|
|
33
|
+
* - 0 < lastPeriod <= numberOfPeriods
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export declare function assertFirstAndLastPeriodsAreValid(firstPeriod: number, lastPeriod: number, numberOfPeriods: number): void;
|
|
37
|
+
/**
|
|
38
|
+
* Check if the given periods are valid. This will assert :
|
|
39
|
+
*
|
|
40
|
+
* - 0 < life
|
|
41
|
+
* - 0 <= startPeriod <= endPeriod
|
|
42
|
+
* - 0 <= endPeriod <= life
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
export declare function assertStartAndEndPeriodAreValid(startPeriod: number, endPeriod: number, life: number): void;
|
|
46
|
+
export declare function assertRateGuessStrictlyGreaterThanMinusOne(guess: number): void;
|
|
47
|
+
export declare function assertCashFlowsAndDatesHaveSameDimension(cashFlows: any[][], dates: any[][]): void;
|
|
48
|
+
export declare function assertCashFlowsHavePositiveAndNegativesValues(cashFlow: number[]): void;
|
|
49
|
+
export declare function assertEveryDateGreaterThanFirstDateOfCashFlowDates(dates: number[]): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Matrix } from "../types";
|
|
2
|
+
export declare function getUnitMatrix(n: number): Matrix<number>;
|
|
3
|
+
/**
|
|
4
|
+
* Invert a matrix and compute its determinant using Gaussian Elimination.
|
|
5
|
+
*
|
|
6
|
+
* The Matrix should be a square matrix, and should be indexed [col][row] instead of the
|
|
7
|
+
* standard mathematical indexing [row][col].
|
|
8
|
+
*/
|
|
9
|
+
export declare function invertMatrix(M: Matrix<number>): {
|
|
10
|
+
inverted?: Matrix<number>;
|
|
11
|
+
determinant: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Matrix multiplication of 2 matrices.
|
|
15
|
+
* ex: matrix1 : n x l, matrix2 : m x n => result : m x l
|
|
16
|
+
*
|
|
17
|
+
* Note: we use indexing [col][row] instead of the standard mathematical notation [row][col]
|
|
18
|
+
*/
|
|
19
|
+
export declare function multiplyMatrices(matrix1: Matrix<number>, matrix2: Matrix<number>): Matrix<number>;
|
|
20
|
+
/**
|
|
21
|
+
* Return the input if it's a scalar or the first element of the input if it's a matrix.
|
|
22
|
+
*/
|
|
23
|
+
export declare function toScalar<T>(matrix: Matrix<T> | T): T;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { DateTime } from "../helpers/dates";
|
|
2
|
+
import { ArgValue, CellValue, Locale, Matrix, Maybe, ValueAndFormat } from "../types";
|
|
3
|
+
export declare function assert(condition: () => boolean, message: string): void;
|
|
4
|
+
export declare const expectNumberRangeError: (lowerBound: number, upperBound: number, value: number) => string;
|
|
5
|
+
export declare const expectStringSetError: (stringSet: string[], value: string) => string;
|
|
6
|
+
export declare function toNumber(value: string | number | boolean | null | undefined, locale: Locale): number;
|
|
7
|
+
export declare function tryToNumber(value: string | number | boolean | null | undefined, locale: Locale): number | undefined;
|
|
8
|
+
export declare function tryCastAsNumberMatrix(data: Matrix<any>, argName: string): Matrix<number>;
|
|
9
|
+
export declare function strictToNumber(value: string | number | boolean | null | undefined, locale: Locale): number;
|
|
10
|
+
export declare function toInteger(value: string | number | boolean | null | undefined, locale: Locale): number;
|
|
11
|
+
export declare function strictToInteger(value: string | number | boolean | null | undefined, locale: Locale): number;
|
|
12
|
+
export declare function assertNumberGreaterThanOrEqualToOne(value: number): void;
|
|
13
|
+
export declare function toString(value: string | number | boolean | null | undefined): string;
|
|
14
|
+
/**
|
|
15
|
+
* Normalize range by setting all the string in the range to lowercase and replacing
|
|
16
|
+
* accent letters with plain letters
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeRange<T>(range: T[]): (string | T)[];
|
|
19
|
+
export declare function toBoolean(value: string | number | boolean | null | undefined): boolean;
|
|
20
|
+
export declare function toJsDate(value: string | number | boolean | null | undefined, locale: Locale): DateTime;
|
|
21
|
+
export declare function visitAny<T extends ValueAndFormat | CellValue>(args: (T | Matrix<T> | undefined)[], cb: (a: T) => void): void;
|
|
22
|
+
export declare function visitNumbers(args: ArgValue[], cb: (arg: number) => void, locale: Locale): void;
|
|
23
|
+
export declare function reduceAny<T, M>(args: (T | Matrix<T>)[], cb: (acc: M, a: T) => M, initialValue: M, dir?: "rowFirst" | "colFirst"): M;
|
|
24
|
+
export declare function reduceNumbers(args: ArgValue[], cb: (acc: number, a: number) => number, initialValue: number, locale: Locale): number;
|
|
25
|
+
export declare function reduceNumbersTextAs0(args: ArgValue[], cb: (acc: number, a: number) => number, initialValue: number, locale: Locale): number;
|
|
26
|
+
/**
|
|
27
|
+
* Generate a matrix of size nColumns x nRows and apply a callback on each position
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateMatrix<T>(nColumns: number, nRows: number, callback: (col: number, row: number) => T): Matrix<T>;
|
|
30
|
+
export declare function matrixMap<T, M>(matrix: Matrix<T>, fn: (value: T) => M): Matrix<M>;
|
|
31
|
+
export declare function transposeMatrix<T>(matrix: Matrix<T>): Matrix<T>;
|
|
32
|
+
export declare function conditionalVisitBoolean(args: ArgValue[], cb: (a: boolean) => boolean): void;
|
|
33
|
+
/**
|
|
34
|
+
* Functions used especially for predicate evaluation on ranges.
|
|
35
|
+
*
|
|
36
|
+
* Take ranges with same dimensions and take predicates, one for each range.
|
|
37
|
+
* For (i, j) coordinates, if all elements with coordinates (i, j) of each
|
|
38
|
+
* range correspond to the associated predicate, then the function uses a callback
|
|
39
|
+
* function with the parameters "i" and "j".
|
|
40
|
+
*
|
|
41
|
+
* Syntax:
|
|
42
|
+
* visitMatchingRanges([range1, predicate1, range2, predicate2, ...], cb(i,j), likeSelection)
|
|
43
|
+
*
|
|
44
|
+
* - range1 (range): The range to check against predicate1.
|
|
45
|
+
* - predicate1 (string): The pattern or test to apply to range1.
|
|
46
|
+
* - range2: (range, repeatable) ranges to check.
|
|
47
|
+
* - predicate2 (string, repeatable): Additional pattern or test to apply to range2.
|
|
48
|
+
*
|
|
49
|
+
* - cb(i: number, j: number) => void: the callback function.
|
|
50
|
+
*
|
|
51
|
+
* - isQuery (boolean) indicates if the comparison with a string should be done as a SQL-like query.
|
|
52
|
+
* (Ex1 isQuery = true, predicate = "abc", element = "abcde": predicate match the element),
|
|
53
|
+
* (Ex2 isQuery = false, predicate = "abc", element = "abcde": predicate not match the element).
|
|
54
|
+
* (Ex3 isQuery = true, predicate = "abc", element = "abc": predicate match the element),
|
|
55
|
+
* (Ex4 isQuery = false, predicate = "abc", element = "abc": predicate match the element).
|
|
56
|
+
*/
|
|
57
|
+
export declare function visitMatchingRanges(args: ArgValue[], cb: (i: number, j: number) => void, locale: Locale, isQuery?: boolean): void;
|
|
58
|
+
/**
|
|
59
|
+
* Perform a dichotomic search on an array and return the index of the nearest match.
|
|
60
|
+
*
|
|
61
|
+
* The array should be sorted, if not an incorrect value might be returned. In the case where multiple
|
|
62
|
+
* element of the array match the target, the method will return the first match if the array is sorted
|
|
63
|
+
* in descending order, and the last match if the array is in ascending order.
|
|
64
|
+
*
|
|
65
|
+
*
|
|
66
|
+
* @param data the array in which to search.
|
|
67
|
+
* @param target the value to search.
|
|
68
|
+
* @param mode "nextGreater/nextSmaller" : return next greater/smaller value if no exact match is found.
|
|
69
|
+
* @param sortOrder whether the array is sorted in ascending or descending order.
|
|
70
|
+
* @param rangeLength the number of elements to consider in the search array.
|
|
71
|
+
* @param getValueInData function returning the element at index i in the search array.
|
|
72
|
+
*/
|
|
73
|
+
export declare function dichotomicSearch<T>(data: T, target: Maybe<CellValue>, mode: "nextGreater" | "nextSmaller" | "strict", sortOrder: "asc" | "desc", rangeLength: number, getValueInData: (range: T, index: number) => CellValue | undefined): number;
|
|
74
|
+
/**
|
|
75
|
+
* Perform a linear search and return the index of the match.
|
|
76
|
+
* -1 is returned if no value is found.
|
|
77
|
+
*
|
|
78
|
+
* Example:
|
|
79
|
+
* - [3, 6, 10], 3 => 0
|
|
80
|
+
* - [3, 6, 10], 6 => 1
|
|
81
|
+
* - [3, 6, 10], 9 => -1
|
|
82
|
+
* - [3, 6, 10], 2 => -1
|
|
83
|
+
*
|
|
84
|
+
* @param data the array to search in.
|
|
85
|
+
* @param target the value to search in the array.
|
|
86
|
+
* @param mode if "strict" return exact match index. "nextGreater" returns the next greater
|
|
87
|
+
* element from the target and "nextSmaller" the next smaller
|
|
88
|
+
* @param numberOfValues the number of elements to consider in the search array.
|
|
89
|
+
* @param getValueInData function returning the element at index i in the search array.
|
|
90
|
+
* @param reverseSearch if true, search in the array starting from the end.
|
|
91
|
+
|
|
92
|
+
*/
|
|
93
|
+
export declare function linearSearch<T>(data: T, target: Maybe<CellValue> | undefined, mode: "nextSmaller" | "nextGreater" | "strict", numberOfValues: number, getValueInData: (data: T, index: number) => CellValue | undefined, reverseSearch?: boolean): number;
|
|
94
|
+
export declare function toMatrix<T>(data: T | Matrix<T> | undefined): Matrix<T>;
|
|
95
|
+
/**
|
|
96
|
+
* Flatten an array of items, where each item can be a single value or a 2D array, and apply the
|
|
97
|
+
* callback to each element.
|
|
98
|
+
*
|
|
99
|
+
* The 2D array are flattened row first.
|
|
100
|
+
*/
|
|
101
|
+
export declare function flattenRowFirst<T, K>(items: Array<T | Matrix<T>>, callback: (val: T) => K): K[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Registry } from "../registries/registry";
|
|
2
|
+
import { AddFunctionDescription, Arg, ComputeFunction, FunctionDescription, Matrix, ValueAndFormat } from "../types";
|
|
3
|
+
export { arg } from "./arguments";
|
|
4
|
+
declare class FunctionRegistry extends Registry<FunctionDescription> {
|
|
5
|
+
mapping: {
|
|
6
|
+
[key: string]: ComputeFunction<Arg, Matrix<ValueAndFormat> | ValueAndFormat>;
|
|
7
|
+
};
|
|
8
|
+
add(name: string, addDescr: AddFunctionDescription): this;
|
|
9
|
+
}
|
|
10
|
+
export declare const functionRegistry: FunctionRegistry;
|