@odoo/o-spreadsheet 17.0.85 → 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.
Files changed (398) hide show
  1. package/dist/o-spreadsheet.cjs.js +45990 -53385
  2. package/dist/o-spreadsheet.esm.js +45805 -53384
  3. package/dist/o-spreadsheet.iife.js +50220 -57798
  4. package/dist/o-spreadsheet.iife.min.js +534 -505
  5. package/dist/o_spreadsheet.xml +3 -3
  6. package/dist/types/actions/action.d.ts +73 -0
  7. package/dist/types/actions/data_actions.d.ts +9 -0
  8. package/dist/types/actions/edit_actions.d.ts +21 -0
  9. package/dist/types/actions/format_actions.d.ts +45 -0
  10. package/dist/types/actions/insert_actions.d.ts +28 -0
  11. package/dist/types/actions/menu_items_actions.d.ts +32 -0
  12. package/dist/types/actions/sheet_actions.d.ts +10 -0
  13. package/dist/types/actions/view_actions.d.ts +28 -0
  14. package/dist/types/collaborative/local_transport_service.d.ts +8 -0
  15. package/dist/types/collaborative/ot/ot.d.ts +22 -0
  16. package/dist/types/collaborative/ot/ot_helpers.d.ts +3 -0
  17. package/dist/types/collaborative/ot/ot_specific.d.ts +1 -0
  18. package/dist/types/collaborative/revisions.d.ts +22 -0
  19. package/dist/types/collaborative/session.d.ts +100 -0
  20. package/dist/types/components/action_button/action_button.d.ts +23 -0
  21. package/dist/types/components/animation/ripple.d.ts +53 -0
  22. package/dist/types/components/autofill/autofill.d.ts +25 -0
  23. package/dist/types/components/border_editor/border_editor.d.ts +41 -0
  24. package/dist/types/components/border_editor/border_editor_widget.d.ts +31 -0
  25. package/dist/types/components/bottom_bar/bottom_bar.d.ts +56 -0
  26. package/dist/types/components/bottom_bar_sheet/bottom_bar_sheet.d.ts +44 -0
  27. package/dist/types/components/bottom_bar_statistic/bottom_bar_statistic.d.ts +21 -0
  28. package/dist/types/components/collaborative_client_tag/collaborative_client_tag.d.ts +14 -0
  29. package/dist/types/components/color_picker/color_picker.d.ts +41 -0
  30. package/dist/types/components/color_picker/color_picker_widget.d.ts +27 -0
  31. package/dist/types/components/composer/autocomplete_dropdown/autocomplete_dropdown.d.ts +15 -0
  32. package/dist/types/components/composer/composer/composer.d.ts +135 -0
  33. package/dist/types/components/composer/content_editable_helper.d.ts +60 -0
  34. package/dist/types/components/composer/formula_assistant/formula_assistant.d.ts +20 -0
  35. package/dist/types/components/composer/grid_composer/grid_composer.d.ts +39 -0
  36. package/dist/types/components/composer/top_bar_composer/top_bar_composer.d.ts +18 -0
  37. package/dist/types/components/dashboard/dashboard.d.ts +50 -0
  38. package/dist/types/components/data_validation_overlay/data_validation_overlay.d.ts +15 -0
  39. package/dist/types/components/data_validation_overlay/dv_checkbox/dv_checkbox.d.ts +12 -0
  40. package/dist/types/components/data_validation_overlay/dv_list_icon/dv_list_icon.d.ts +10 -0
  41. package/dist/types/components/error_tooltip/error_tooltip.d.ts +18 -0
  42. package/dist/types/components/figures/chart/chartJs/chartjs.d.ts +18 -0
  43. package/dist/types/components/figures/chart/scorecard/chart_scorecard.d.ts +14 -0
  44. package/dist/types/components/figures/figure/figure.d.ts +41 -0
  45. package/dist/types/components/figures/figure_chart/figure_chart.d.ts +14 -0
  46. package/dist/types/components/figures/figure_container/figure_container.d.ts +117 -0
  47. package/dist/types/components/figures/figure_image/figure_image.d.ts +13 -0
  48. package/dist/types/components/filters/filter_icon/filter_icon.d.ts +12 -0
  49. package/dist/types/components/filters/filter_icons_overlay/filter_icons_overlay.d.ts +22 -0
  50. package/dist/types/components/filters/filter_menu/filter_menu.d.ts +43 -0
  51. package/dist/types/components/filters/filter_menu_item/filter_menu_value_item.d.ts +17 -0
  52. package/dist/types/components/font_size_editor/font_size_editor.d.ts +29 -0
  53. package/dist/types/components/grid/grid.d.ts +99 -0
  54. package/dist/types/components/grid_add_rows_footer/grid_add_rows_footer.d.ts +27 -0
  55. package/dist/types/components/grid_cell_icon/grid_cell_icon.d.ts +16 -0
  56. package/dist/types/components/grid_overlay/grid_overlay.d.ts +45 -0
  57. package/dist/types/components/grid_popover/grid_popover.d.ts +20 -0
  58. package/dist/types/components/header_group/header_group.d.ts +41 -0
  59. package/dist/types/components/header_group/header_group_container.d.ts +29 -0
  60. package/dist/types/components/headers_overlay/headers_overlay.d.ts +117 -0
  61. package/dist/types/components/helpers/css.d.ts +40 -0
  62. package/dist/types/components/helpers/dom_helpers.d.ts +34 -0
  63. package/dist/types/components/helpers/drag_and_drop.d.ts +20 -0
  64. package/dist/types/components/helpers/drag_and_drop_hook.d.ts +24 -0
  65. package/dist/types/components/helpers/draw_grid_hook.d.ts +3 -0
  66. package/dist/types/components/helpers/figure_container_helper.d.ts +14 -0
  67. package/dist/types/components/helpers/figure_drag_helper.d.ts +6 -0
  68. package/dist/types/components/helpers/figure_snap_helper.d.ts +25 -0
  69. package/dist/types/components/helpers/html_content_helpers.d.ts +2 -0
  70. package/dist/types/components/helpers/index.d.ts +1 -0
  71. package/dist/types/components/helpers/listener_hook.d.ts +10 -0
  72. package/dist/types/components/helpers/position_hook.d.ts +25 -0
  73. package/dist/types/components/helpers/selection_helpers.d.ts +2 -0
  74. package/dist/types/components/helpers/time_hooks.d.ts +9 -0
  75. package/dist/types/components/helpers/wheel_hook.d.ts +1 -0
  76. package/dist/types/components/highlight/border/border.d.ts +15 -0
  77. package/dist/types/components/highlight/corner/corner.d.ts +18 -0
  78. package/dist/types/components/highlight/highlight/highlight.d.ts +22 -0
  79. package/dist/types/components/icon_picker/icon_picker.d.ts +65 -0
  80. package/dist/types/components/icons/icons.d.ts +56 -0
  81. package/dist/types/components/index.d.ts +1 -0
  82. package/dist/types/components/link/index.d.ts +2 -0
  83. package/dist/types/components/link/link_display/link_display.d.ts +21 -0
  84. package/dist/types/components/link/link_editor/link_editor.d.ts +39 -0
  85. package/dist/types/components/menu/menu.d.ts +58 -0
  86. package/dist/types/components/paint_format_button/paint_format_button.d.ts +12 -0
  87. package/dist/types/components/popover/popover.d.ts +40 -0
  88. package/dist/types/components/scrollbar/index.d.ts +2 -0
  89. package/dist/types/components/scrollbar/scrollbar.d.ts +25 -0
  90. package/dist/types/components/scrollbar/scrollbar_horizontal.d.ts +26 -0
  91. package/dist/types/components/scrollbar/scrollbar_vertical.d.ts +26 -0
  92. package/dist/types/components/scrollbar.d.ts +9 -0
  93. package/dist/types/components/selection_input/selection_input.d.ts +54 -0
  94. package/dist/types/components/side_panel/chart/bar_chart/bar_chart_config_panel.d.ts +6 -0
  95. package/dist/types/components/side_panel/chart/bar_chart/bar_chart_design_panel.d.ts +4 -0
  96. package/dist/types/components/side_panel/chart/gauge_chart_panel/gauge_chart_config_panel.d.ts +26 -0
  97. package/dist/types/components/side_panel/chart/gauge_chart_panel/gauge_chart_design_panel.d.ts +34 -0
  98. package/dist/types/components/side_panel/chart/index.d.ts +17 -0
  99. package/dist/types/components/side_panel/chart/line_bar_pie_panel/config_panel.d.ts +45 -0
  100. package/dist/types/components/side_panel/chart/line_bar_pie_panel/design_panel.d.ts +26 -0
  101. package/dist/types/components/side_panel/chart/line_chart/line_chart_config_panel.d.ts +9 -0
  102. package/dist/types/components/side_panel/chart/line_chart/line_chart_design_panel.d.ts +4 -0
  103. package/dist/types/components/side_panel/chart/main_chart_panel/main_chart_panel.d.ts +20 -0
  104. package/dist/types/components/side_panel/chart/scorecard_chart_panel/scorecard_chart_config_panel.d.ts +32 -0
  105. package/dist/types/components/side_panel/chart/scorecard_chart_panel/scorecard_chart_design_panel.d.ts +26 -0
  106. package/dist/types/components/side_panel/conditional_formatting/cf_editor/cf_editor.d.ts +137 -0
  107. package/dist/types/components/side_panel/conditional_formatting/cf_preview_list/cf_preview_list.d.ts +58 -0
  108. package/dist/types/components/side_panel/conditional_formatting/conditional_formatting.d.ts +23 -0
  109. package/dist/types/components/side_panel/custom_currency/custom_currency.d.ts +27 -0
  110. package/dist/types/components/side_panel/data_validation/data_validation_panel.d.ts +25 -0
  111. package/dist/types/components/side_panel/data_validation/data_validation_panel_helper.d.ts +14 -0
  112. package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_criterion_form.d.ts +11 -0
  113. package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_date_criterion/dv_date_criterion.d.ts +16 -0
  114. package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_double_input_criterion/dv_double_input_criterion.d.ts +10 -0
  115. package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_input/dv_input.d.ts +30 -0
  116. package/dist/types/components/side_panel/data_validation/dv_criterion_form/dv_single_input_criterion/dv_single_input_criterion.d.ts +9 -0
  117. 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
  118. 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
  119. package/dist/types/components/side_panel/data_validation/dv_editor/dv_editor.d.ts +34 -0
  120. package/dist/types/components/side_panel/data_validation/dv_preview/dv_preview.d.ts +13 -0
  121. package/dist/types/components/side_panel/find_and_replace/find_and_replace.d.ts +27 -0
  122. package/dist/types/components/side_panel/more_formats/more_formats.d.ts +10 -0
  123. package/dist/types/components/side_panel/remove_duplicates/remove_duplicates.d.ts +32 -0
  124. package/dist/types/components/side_panel/select_menu/select_menu.d.ts +29 -0
  125. package/dist/types/components/side_panel/settings/settings_panel.d.ts +18 -0
  126. package/dist/types/components/side_panel/side_panel/side_panel.d.ts +18 -0
  127. package/dist/types/components/side_panel/split_to_columns_panel/split_to_columns_panel.d.ts +35 -0
  128. package/dist/types/components/spreadsheet/spreadsheet.d.ts +64 -0
  129. package/dist/types/components/top_bar/top_bar.d.ts +65 -0
  130. package/dist/types/components/translations_terms.d.ts +104 -0
  131. package/dist/types/components/validation_messages/validation_messages.d.ts +11 -0
  132. package/dist/types/constants.d.ts +137 -0
  133. package/dist/types/formulas/code_builder.d.ts +28 -0
  134. package/dist/types/formulas/compiler.d.ts +7 -0
  135. package/dist/types/formulas/composer_tokenizer.d.ts +31 -0
  136. package/dist/types/formulas/helpers.d.ts +2 -0
  137. package/dist/types/formulas/index.d.ts +16 -0
  138. package/dist/types/formulas/parser.d.ts +72 -0
  139. package/dist/types/formulas/range_tokenizer.d.ts +8 -0
  140. package/dist/types/formulas/tokenizer.d.ts +25 -0
  141. package/dist/types/functions/arguments.d.ts +10 -0
  142. package/dist/types/functions/helper_assert.d.ts +6 -0
  143. package/dist/types/functions/helper_financial.d.ts +49 -0
  144. package/dist/types/functions/helper_matrices.d.ts +23 -0
  145. package/dist/types/functions/helper_statistical.d.ts +3 -0
  146. package/dist/types/functions/helpers.d.ts +101 -0
  147. package/dist/types/functions/index.d.ts +10 -0
  148. package/dist/types/functions/module_array.d.ts +141 -0
  149. package/dist/types/functions/module_custom.d.ts +8 -0
  150. package/dist/types/functions/module_database.d.ts +85 -0
  151. package/dist/types/functions/module_date.d.ts +231 -0
  152. package/dist/types/functions/module_engineering.d.ts +8 -0
  153. package/dist/types/functions/module_filter.d.ts +17 -0
  154. package/dist/types/functions/module_financial.d.ts +358 -0
  155. package/dist/types/functions/module_info.d.ts +64 -0
  156. package/dist/types/functions/module_logical.d.ts +59 -0
  157. package/dist/types/functions/module_lookup.d.ts +72 -0
  158. package/dist/types/functions/module_math.d.ts +424 -0
  159. package/dist/types/functions/module_operators.d.ts +98 -0
  160. package/dist/types/functions/module_statistical.d.ts +296 -0
  161. package/dist/types/functions/module_text.d.ts +147 -0
  162. package/dist/types/functions/module_web.d.ts +8 -0
  163. package/dist/types/helpers/cells/cell_evaluation.d.ts +6 -0
  164. package/dist/types/helpers/cells/index.d.ts +2 -0
  165. package/dist/types/helpers/chart_date.d.ts +8 -0
  166. package/dist/types/helpers/clipboard/clipboard_abstract_cell_state.d.ts +26 -0
  167. package/dist/types/helpers/clipboard/clipboard_cells_state.d.ts +70 -0
  168. package/dist/types/helpers/clipboard/clipboard_figure_state.d.ts +41 -0
  169. package/dist/types/helpers/clipboard/clipboard_os_state.d.ts +12 -0
  170. package/dist/types/helpers/clipboard/navigator_clipboard_wrapper.d.ts +13 -0
  171. package/dist/types/helpers/color.d.ts +68 -0
  172. package/dist/types/helpers/coordinates.d.ts +40 -0
  173. package/dist/types/helpers/data_validation_helpers.d.ts +5 -0
  174. package/dist/types/helpers/dates.d.ts +90 -0
  175. package/dist/types/helpers/edge_scrolling.d.ts +9 -0
  176. package/dist/types/helpers/event_bus.d.ts +45 -0
  177. package/dist/types/helpers/figures/charts/abstract_chart.d.ts +56 -0
  178. package/dist/types/helpers/figures/charts/bar_chart.d.ts +29 -0
  179. package/dist/types/helpers/figures/charts/chart_common.d.ts +62 -0
  180. package/dist/types/helpers/figures/charts/chart_factory.d.ts +40 -0
  181. package/dist/types/helpers/figures/charts/chart_js_gauge_controller.d.ts +1 -0
  182. package/dist/types/helpers/figures/charts/chart_ui_common.d.ts +41 -0
  183. package/dist/types/helpers/figures/charts/gauge_chart.d.ts +23 -0
  184. package/dist/types/helpers/figures/charts/index.d.ts +10 -0
  185. package/dist/types/helpers/figures/charts/line_chart.d.ts +32 -0
  186. package/dist/types/helpers/figures/charts/pie_chart.d.ts +27 -0
  187. package/dist/types/helpers/figures/charts/scorecard_chart.d.ts +30 -0
  188. package/dist/types/helpers/figures/charts/scorecard_chart_config_builder.d.ts +35 -0
  189. package/dist/types/helpers/figures/figure/figure.d.ts +6 -0
  190. package/dist/types/helpers/figures/images/image_provider.d.ts +10 -0
  191. package/dist/types/helpers/filters.d.ts +19 -0
  192. package/dist/types/helpers/focus_manager.d.ts +5 -0
  193. package/dist/types/helpers/format.d.ts +32 -0
  194. package/dist/types/helpers/index.d.ts +15 -0
  195. package/dist/types/helpers/internal_viewport.d.ts +83 -0
  196. package/dist/types/helpers/inverse_commands.d.ts +2 -0
  197. package/dist/types/helpers/links.d.ts +23 -0
  198. package/dist/types/helpers/locale.d.ts +58 -0
  199. package/dist/types/helpers/misc.d.ts +178 -0
  200. package/dist/types/helpers/numbers.d.ts +25 -0
  201. package/dist/types/helpers/range.d.ts +59 -0
  202. package/dist/types/helpers/recompute_zones.d.ts +136 -0
  203. package/dist/types/helpers/rectangle.d.ts +7 -0
  204. package/dist/types/helpers/reference_type.d.ts +9 -0
  205. package/dist/types/helpers/references.d.ts +23 -0
  206. package/dist/types/helpers/search.d.ts +19 -0
  207. package/dist/types/helpers/sheet.d.ts +7 -0
  208. package/dist/types/helpers/sort.d.ts +16 -0
  209. package/dist/types/helpers/state_manager_helpers.d.ts +6 -0
  210. package/dist/types/helpers/text_helper.d.ts +28 -0
  211. package/dist/types/helpers/ui/cut_interactive.d.ts +2 -0
  212. package/dist/types/helpers/ui/filter_interactive.d.ts +7 -0
  213. package/dist/types/helpers/ui/freeze_interactive.d.ts +2 -0
  214. package/dist/types/helpers/ui/merge_interactive.d.ts +6 -0
  215. package/dist/types/helpers/ui/paste_interactive.d.ts +10 -0
  216. package/dist/types/helpers/ui/sheet_interactive.d.ts +2 -0
  217. package/dist/types/helpers/ui/split_to_columns_interactive.d.ts +6 -0
  218. package/dist/types/helpers/ui/stop_edition_interactive.d.ts +2 -0
  219. package/dist/types/helpers/ui/toggle_group_interactive.d.ts +6 -0
  220. package/dist/types/helpers/uuid.d.ts +20 -0
  221. package/dist/types/helpers/zones.d.ts +173 -0
  222. package/dist/types/history/branch.d.ts +62 -0
  223. package/dist/types/history/factory.d.ts +9 -0
  224. package/dist/types/history/operation.d.ts +17 -0
  225. package/dist/types/history/operation_sequence.d.ts +31 -0
  226. package/dist/types/history/repeat_commands/repeat_commands_generic.d.ts +6 -0
  227. package/dist/types/history/repeat_commands/repeat_commands_specific.d.ts +13 -0
  228. package/dist/types/history/repeat_commands/repeat_revision.d.ts +5 -0
  229. package/dist/types/history/selective_history.d.ts +81 -0
  230. package/dist/types/history/tree.d.ts +175 -0
  231. package/dist/types/index.d.ts +189 -0
  232. package/dist/types/migrations/data.d.ts +30 -0
  233. package/dist/types/migrations/legacy_tools.d.ts +15 -0
  234. package/dist/types/model.d.ts +192 -0
  235. package/dist/types/plugins/base_plugin.d.ts +63 -0
  236. package/dist/types/plugins/core/borders.d.ts +127 -0
  237. package/dist/types/plugins/core/cell.d.ts +103 -0
  238. package/dist/types/plugins/core/chart.d.ts +41 -0
  239. package/dist/types/plugins/core/conditional_format.d.ts +52 -0
  240. package/dist/types/plugins/core/data_validation.d.ts +31 -0
  241. package/dist/types/plugins/core/figures.d.ts +34 -0
  242. package/dist/types/plugins/core/filters.d.ts +43 -0
  243. package/dist/types/plugins/core/header_grouping.d.ts +82 -0
  244. package/dist/types/plugins/core/header_size.d.ts +23 -0
  245. package/dist/types/plugins/core/header_visibility.d.ts +20 -0
  246. package/dist/types/plugins/core/image.d.ts +32 -0
  247. package/dist/types/plugins/core/index.d.ts +13 -0
  248. package/dist/types/plugins/core/merge.d.ts +83 -0
  249. package/dist/types/plugins/core/range.d.ts +59 -0
  250. package/dist/types/plugins/core/settings.d.ts +12 -0
  251. package/dist/types/plugins/core/sheet.d.ts +151 -0
  252. package/dist/types/plugins/core_plugin.d.ts +49 -0
  253. package/dist/types/plugins/index.d.ts +7 -0
  254. package/dist/types/plugins/ui_core_views/cell_evaluation/compilation_parameters.d.ts +10 -0
  255. package/dist/types/plugins/ui_core_views/cell_evaluation/evaluation_plugin.d.ts +43 -0
  256. package/dist/types/plugins/ui_core_views/cell_evaluation/evaluator.d.ts +90 -0
  257. package/dist/types/plugins/ui_core_views/cell_evaluation/formula_dependency_graph.d.ts +23 -0
  258. package/dist/types/plugins/ui_core_views/cell_evaluation/index.d.ts +1 -0
  259. package/dist/types/plugins/ui_core_views/cell_evaluation/r_tree.d.ts +108 -0
  260. package/dist/types/plugins/ui_core_views/cell_evaluation/spreading_relation.d.ts +60 -0
  261. package/dist/types/plugins/ui_core_views/custom_colors.d.ts +24 -0
  262. package/dist/types/plugins/ui_core_views/evaluation_chart.d.ts +24 -0
  263. package/dist/types/plugins/ui_core_views/evaluation_conditional_format.d.ts +37 -0
  264. package/dist/types/plugins/ui_core_views/evaluation_data_validation.d.ts +38 -0
  265. package/dist/types/plugins/ui_core_views/header_sizes_ui.d.ts +32 -0
  266. package/dist/types/plugins/ui_core_views/index.d.ts +5 -0
  267. package/dist/types/plugins/ui_feature/autofill.d.ts +60 -0
  268. package/dist/types/plugins/ui_feature/automatic_sum.d.ts +101 -0
  269. package/dist/types/plugins/ui_feature/cell_popovers.d.ts +16 -0
  270. package/dist/types/plugins/ui_feature/collaborative.d.ts +25 -0
  271. package/dist/types/plugins/ui_feature/data_cleanup.d.ts +16 -0
  272. package/dist/types/plugins/ui_feature/find_and_replace.d.ts +76 -0
  273. package/dist/types/plugins/ui_feature/format.d.ts +23 -0
  274. package/dist/types/plugins/ui_feature/header_visibility_ui.d.ts +21 -0
  275. package/dist/types/plugins/ui_feature/highlight.d.ts +12 -0
  276. package/dist/types/plugins/ui_feature/index.d.ts +15 -0
  277. package/dist/types/plugins/ui_feature/local_history.d.ts +36 -0
  278. package/dist/types/plugins/ui_feature/renderer.d.ts +45 -0
  279. package/dist/types/plugins/ui_feature/selection_input.d.ts +67 -0
  280. package/dist/types/plugins/ui_feature/selection_inputs_manager.d.ts +33 -0
  281. package/dist/types/plugins/ui_feature/sort.d.ts +75 -0
  282. package/dist/types/plugins/ui_feature/split_to_columns.d.ts +21 -0
  283. package/dist/types/plugins/ui_feature/ui_options.d.ts +8 -0
  284. package/dist/types/plugins/ui_feature/ui_sheet.d.ts +30 -0
  285. package/dist/types/plugins/ui_plugin.d.ts +36 -0
  286. package/dist/types/plugins/ui_stateful/clipboard.d.ts +43 -0
  287. package/dist/types/plugins/ui_stateful/edition.d.ts +117 -0
  288. package/dist/types/plugins/ui_stateful/filter_evaluation.d.ts +26 -0
  289. package/dist/types/plugins/ui_stateful/header_positions.d.ts +28 -0
  290. package/dist/types/plugins/ui_stateful/index.d.ts +5 -0
  291. package/dist/types/plugins/ui_stateful/selection.d.ts +78 -0
  292. package/dist/types/plugins/ui_stateful/sheetview.d.ts +164 -0
  293. package/dist/types/registries/autofill_modifiers.d.ts +7 -0
  294. package/dist/types/registries/autofill_rules.d.ts +15 -0
  295. package/dist/types/registries/cell_clickable_registry.d.ts +8 -0
  296. package/dist/types/registries/cell_popovers_registry.d.ts +3 -0
  297. package/dist/types/registries/chart_types.d.ts +28 -0
  298. package/dist/types/registries/currencies_registry.d.ts +7 -0
  299. package/dist/types/registries/data_validation_registry.d.ts +32 -0
  300. package/dist/types/registries/figure_registry.d.ts +18 -0
  301. package/dist/types/registries/index.d.ts +11 -0
  302. package/dist/types/registries/inverse_command_registry.d.ts +5 -0
  303. package/dist/types/registries/menu_items_registry.d.ts +19 -0
  304. package/dist/types/registries/menus/cell_menu_registry.d.ts +2 -0
  305. package/dist/types/registries/menus/col_menu_registry.d.ts +2 -0
  306. package/dist/types/registries/menus/header_group_registry.d.ts +7 -0
  307. package/dist/types/registries/menus/index.d.ts +7 -0
  308. package/dist/types/registries/menus/link_menu_registry.d.ts +2 -0
  309. package/dist/types/registries/menus/number_format_menu_registry.d.ts +4 -0
  310. package/dist/types/registries/menus/row_menu_registry.d.ts +2 -0
  311. package/dist/types/registries/menus/sheet_menu_registry.d.ts +4 -0
  312. package/dist/types/registries/menus/topbar_menu_registry.d.ts +2 -0
  313. package/dist/types/registries/ot_registry.d.ts +21 -0
  314. package/dist/types/registries/registry.d.ts +44 -0
  315. package/dist/types/registries/repeat_commands_registry.d.ts +20 -0
  316. package/dist/types/registries/side_panel_registry.d.ts +8 -0
  317. package/dist/types/registries/topbar_component_registry.d.ts +18 -0
  318. package/dist/types/selection_stream/event_stream.d.ts +64 -0
  319. package/dist/types/selection_stream/selection_stream_processor.d.ts +167 -0
  320. package/dist/types/state_observer.d.ts +15 -0
  321. package/dist/types/translation.d.ts +21 -0
  322. package/dist/types/types/autofill.d.ts +62 -0
  323. package/dist/types/types/cell_popovers.d.ts +44 -0
  324. package/dist/types/types/cells.d.ts +64 -0
  325. package/dist/types/types/chart/bar_chart.d.ts +19 -0
  326. package/dist/types/types/chart/chart.d.ts +48 -0
  327. package/dist/types/types/chart/common_chart.d.ts +2 -0
  328. package/dist/types/types/chart/gauge_chart.d.ts +73 -0
  329. package/dist/types/types/chart/index.d.ts +7 -0
  330. package/dist/types/types/chart/line_chart.d.ts +21 -0
  331. package/dist/types/types/chart/pie_chart.d.ts +17 -0
  332. package/dist/types/types/chart/scorecard_chart.d.ts +26 -0
  333. package/dist/types/types/clipboard.d.ts +31 -0
  334. package/dist/types/types/collaborative/revisions.d.ts +7 -0
  335. package/dist/types/types/collaborative/session.d.ts +46 -0
  336. package/dist/types/types/collaborative/transport_service.d.ts +91 -0
  337. package/dist/types/types/commands.d.ts +873 -0
  338. package/dist/types/types/conditional_formatting.d.ts +103 -0
  339. package/dist/types/types/currency.d.ts +7 -0
  340. package/dist/types/types/data_validation.d.ts +121 -0
  341. package/dist/types/types/env.d.ts +33 -0
  342. package/dist/types/types/errors.d.ts +33 -0
  343. package/dist/types/types/event_stream/index.d.ts +1 -0
  344. package/dist/types/types/event_stream/selection_events.d.ts +11 -0
  345. package/dist/types/types/figure.d.ts +14 -0
  346. package/dist/types/types/files.d.ts +27 -0
  347. package/dist/types/types/format.d.ts +8 -0
  348. package/dist/types/types/functions.d.ts +49 -0
  349. package/dist/types/types/getters.d.ts +101 -0
  350. package/dist/types/types/history.d.ts +43 -0
  351. package/dist/types/types/image.d.ts +12 -0
  352. package/dist/types/types/index.d.ts +30 -0
  353. package/dist/types/types/locale.d.ts +13 -0
  354. package/dist/types/types/misc.d.ts +276 -0
  355. package/dist/types/types/range.d.ts +21 -0
  356. package/dist/types/types/rendering.d.ts +86 -0
  357. package/dist/types/types/validator.d.ts +16 -0
  358. package/dist/types/types/workbook_data.d.ts +112 -0
  359. package/dist/types/types/xlsx.d.ts +441 -0
  360. package/dist/types/xlsx/constants.d.ts +74 -0
  361. package/dist/types/xlsx/conversion/cf_conversion.d.ts +4 -0
  362. package/dist/types/xlsx/conversion/color_conversion.d.ts +24 -0
  363. package/dist/types/xlsx/conversion/conversion_maps.d.ts +167 -0
  364. package/dist/types/xlsx/conversion/figure_conversion.d.ts +3 -0
  365. package/dist/types/xlsx/conversion/format_conversion.d.ts +8 -0
  366. package/dist/types/xlsx/conversion/formula_conversion.d.ts +9 -0
  367. package/dist/types/xlsx/conversion/index.d.ts +7 -0
  368. package/dist/types/xlsx/conversion/sheet_conversion.d.ts +4 -0
  369. package/dist/types/xlsx/conversion/style_conversion.d.ts +19 -0
  370. package/dist/types/xlsx/conversion/table_conversion.d.ts +14 -0
  371. package/dist/types/xlsx/extraction/base_extractor.d.ts +142 -0
  372. package/dist/types/xlsx/extraction/cf_extractor.d.ts +14 -0
  373. package/dist/types/xlsx/extraction/chart_extractor.d.ts +11 -0
  374. package/dist/types/xlsx/extraction/external_book_extractor.d.ts +6 -0
  375. package/dist/types/xlsx/extraction/figure_extractor.d.ts +8 -0
  376. package/dist/types/xlsx/extraction/index.d.ts +3 -0
  377. package/dist/types/xlsx/extraction/misc_extractor.d.ts +18 -0
  378. package/dist/types/xlsx/extraction/pivot_extractor.d.ts +8 -0
  379. package/dist/types/xlsx/extraction/sheet_extractor.d.ts +23 -0
  380. package/dist/types/xlsx/extraction/style_extractor.d.ts +19 -0
  381. package/dist/types/xlsx/extraction/table_extractor.d.ts +10 -0
  382. package/dist/types/xlsx/functions/cells.d.ts +11 -0
  383. package/dist/types/xlsx/functions/charts.d.ts +3 -0
  384. package/dist/types/xlsx/functions/conditional_formatting.d.ts +3 -0
  385. package/dist/types/xlsx/functions/drawings.d.ts +5 -0
  386. package/dist/types/xlsx/functions/styles.d.ts +10 -0
  387. package/dist/types/xlsx/functions/table.d.ts +2 -0
  388. package/dist/types/xlsx/functions/worksheet.d.ts +9 -0
  389. package/dist/types/xlsx/helpers/colors.d.ts +8 -0
  390. package/dist/types/xlsx/helpers/content_helpers.d.ts +48 -0
  391. package/dist/types/xlsx/helpers/misc.d.ts +29 -0
  392. package/dist/types/xlsx/helpers/xlsx_helper.d.ts +10 -0
  393. package/dist/types/xlsx/helpers/xlsx_parser_error_manager.d.ts +34 -0
  394. package/dist/types/xlsx/helpers/xml_helpers.d.ts +36 -0
  395. package/dist/types/xlsx/xlsx_reader.d.ts +13 -0
  396. package/dist/types/xlsx/xlsx_writer.d.ts +8 -0
  397. package/package.json +42 -25
  398. package/dist/o-spreadsheet.d.ts +0 -8046
@@ -0,0 +1,68 @@
1
+ import { Color, HSLA, RGBA } from "../types";
2
+ export declare const colors: string[];
3
+ export declare function colorNumberString(color: number): Color;
4
+ /**
5
+ * Converts any CSS color value to a standardized hex6 value.
6
+ * Accepts: hex3, hex6, hex8, rgb[1] and rgba[1].
7
+ *
8
+ * [1] under the form rgb(r, g, b, a?) or rgba(r, g, b, a?)
9
+ * with r,g,b ∈ [0, 255] and a ∈ [0, 1]
10
+ *
11
+ * toHex("#ABC")
12
+ * >> "#AABBCC"
13
+ *
14
+ * toHex("#AAAFFF")
15
+ * >> "#AAAFFF"
16
+ *
17
+ * toHex("rgb(30, 80, 16)")
18
+ * >> "#1E5010"
19
+ *
20
+ * * toHex("rgb(30, 80, 16, 0.5)")
21
+ * >> "#1E501080"
22
+ *
23
+ */
24
+ export declare function toHex(color: Color): Color;
25
+ export declare function isColorValid(color: Color): boolean;
26
+ export declare function isHSLAValid(color: HSLA): boolean;
27
+ export declare function rgba(r: number, g: number, b: number, a?: number): RGBA;
28
+ /**
29
+ * The relative brightness of a point in the colorspace, normalized to 0 for
30
+ * darkest black and 1 for lightest white.
31
+ * https://www.w3.org/TR/WCAG20/#relativeluminancedef
32
+ */
33
+ export declare function relativeLuminance(color: Color): number;
34
+ /**
35
+ * RGBA to HEX representation (#RRGGBBAA).
36
+ *
37
+ * https://css-tricks.com/converting-color-spaces-in-javascript/
38
+ */
39
+ export declare function rgbaToHex(rgba: RGBA): Color;
40
+ /**
41
+ * Color string to RGBA representation
42
+ */
43
+ export declare function colorToRGBA(color: Color): RGBA;
44
+ /**
45
+ * HSLA to RGBA.
46
+ *
47
+ * https://css-tricks.com/converting-color-spaces-in-javascript/
48
+ */
49
+ export declare function hslaToRGBA(hsla: HSLA): RGBA;
50
+ /**
51
+ * HSLA to RGBA.
52
+ *
53
+ * https://css-tricks.com/converting-color-spaces-in-javascript/
54
+ */
55
+ export declare function rgbaToHSLA(rgba: RGBA): HSLA;
56
+ export declare function hslaToHex(hsla: HSLA): Color;
57
+ export declare function hexToHSLA(hex: Color): HSLA;
58
+ /**
59
+ * Will compare two color strings
60
+ * A tolerance can be provided to account for small differences that could
61
+ * be introduced by non-bijective transformations between color spaces.
62
+ *
63
+ * E.g. HSV <-> RGB is not a bijection
64
+ *
65
+ * Note that the tolerance is applied on the euclidean distance between
66
+ * the two **normalized** color values.
67
+ */
68
+ export declare function isSameColor(color1: Color, color2: Color, tolerance?: number): boolean;
@@ -0,0 +1,40 @@
1
+ import { HeaderIndex, Position, RangePart } from "../types";
2
+ /**
3
+ * Convert a (col) number to the corresponding letter.
4
+ *
5
+ * Examples:
6
+ * 0 => 'A'
7
+ * 25 => 'Z'
8
+ * 26 => 'AA'
9
+ * 27 => 'AB'
10
+ */
11
+ export declare function numberToLetters(n: number): string;
12
+ /**
13
+ * Convert a string (describing a column) to its number value.
14
+ *
15
+ * Examples:
16
+ * 'A' => 0
17
+ * 'Z' => 25
18
+ * 'AA' => 26
19
+ */
20
+ export declare function lettersToNumber(letters: string): number;
21
+ /**
22
+ * Convert a "XC" coordinate to cartesian coordinates.
23
+ *
24
+ * Examples:
25
+ * A1 => [0,0]
26
+ * B3 => [1,2]
27
+ *
28
+ * Note: it also accepts lowercase coordinates, but not fixed references
29
+ */
30
+ export declare function toCartesian(xc: string): Position;
31
+ /**
32
+ * Convert from cartesian coordinate to the "XC" coordinate system.
33
+ *
34
+ * Examples:
35
+ * - 0,0 => A1
36
+ * - 1,2 => B3
37
+ * - 0,0, {colFixed: false, rowFixed: true} => A$1
38
+ * - 1,2, {colFixed: true, rowFixed: false} => $B3
39
+ */
40
+ export declare function toXC(col: HeaderIndex, row: HeaderIndex, rangePart?: RangePart): string;
@@ -0,0 +1,5 @@
1
+ import { DataValidationCriterion, Locale } from "../types";
2
+ /** Get all the dates values of a criterion converted to numbers, converting date values such as "today" to actual dates */
3
+ export declare function getDateNumberCriterionValues(criterion: DataValidationCriterion, locale: Locale): (number | undefined)[];
4
+ /** Convert the criterion values to numbers. Return undefined values if they cannot be converted to numbers. */
5
+ export declare function getCriterionValuesAsNumber(criterion: DataValidationCriterion, locale: Locale): (number | undefined)[];
@@ -0,0 +1,90 @@
1
+ import { CellValue, Format, Locale } from "../types";
2
+ /**
3
+ * All Spreadsheet dates are internally stored as an object with two values:
4
+ * - value (number), which represent the number of day till 30/12/1899
5
+ * - format (string), which keep the information on how the date was defined
6
+ */
7
+ export interface InternalDate {
8
+ readonly value: number;
9
+ readonly format: Format;
10
+ readonly jsDate?: ReadonlyDateTime;
11
+ }
12
+ /**
13
+ * A DateTime object that can be used to manipulate spreadsheet dates.
14
+ * Conceptually, a spreadsheet date is simply a number with a date format,
15
+ * and it is timezone-agnostic.
16
+ * This DateTime object consistently uses UTC time to represent a naive date and time.
17
+ */
18
+ export declare class DateTime {
19
+ private jsDate;
20
+ constructor(year: number, month: number, day: number, hours?: number, minutes?: number, seconds?: number);
21
+ static fromTimestamp(timestamp: number): DateTime;
22
+ static now(): DateTime;
23
+ toString(): string;
24
+ toLocaleDateString(): string;
25
+ getTime(): number;
26
+ getFullYear(): number;
27
+ getMonth(): number;
28
+ getDate(): number;
29
+ getDay(): number;
30
+ getHours(): number;
31
+ getMinutes(): number;
32
+ getSeconds(): number;
33
+ setFullYear(year: number): number;
34
+ setMonth(month: number): number;
35
+ setDate(date: number): number;
36
+ setHours(hours: number): number;
37
+ setMinutes(minutes: number): number;
38
+ setSeconds(seconds: number): number;
39
+ }
40
+ type ReadonlyDateTime = Readonly<Omit<DateTime, "setSeconds" | "setMinutes" | "setHours" | "setDate" | "setMonth" | "setFullYear">>;
41
+ export declare const INITIAL_1900_DAY: DateTime;
42
+ export declare const MS_PER_DAY: number;
43
+ export declare const mdyDateRegexp: RegExp;
44
+ export declare const ymdDateRegexp: RegExp;
45
+ export declare const timeRegexp: RegExp;
46
+ /** Convert a value number representing a date, or return undefined if it isn't possible */
47
+ export declare function valueToDateNumber(value: CellValue, locale: Locale): number | undefined;
48
+ export declare function isDateTime(str: string, locale: Locale): boolean;
49
+ export declare function parseDateTime(str: string, locale: Locale): InternalDate | null;
50
+ export declare function numberToJsDate(value: number): DateTime;
51
+ export declare function jsDateToRoundNumber(date: DateTime): number;
52
+ export declare function jsDateToNumber(date: DateTime): number;
53
+ /** Return the number of days in the current month of the given date */
54
+ export declare function getDaysInMonth(date: DateTime): number;
55
+ export declare function isLastDayOfMonth(date: DateTime): boolean;
56
+ /**
57
+ * Add a certain number of months to a date. This will adapt the month number, and possibly adapt
58
+ * the day of the month to keep it in the month.
59
+ *
60
+ * For example "31/12/2020" minus one month will be "30/11/2020", and not "31/11/2020"
61
+ *
62
+ * @param keepEndOfMonth if true, if the given date was the last day of a month, the returned date will
63
+ * also always be the last day of a month.
64
+ */
65
+ export declare function addMonthsToDate(date: DateTime, months: number, keepEndOfMonth: boolean): DateTime;
66
+ export declare function getYearFrac(startDate: number, endDate: number, _dayCountConvention: number): number;
67
+ /**
68
+ * Get the number of whole months between two dates.
69
+ * e.g.
70
+ * 2002/01/01 -> 2002/02/01 = 1 month,
71
+ * 2002/01/01 -> 2003/02/01 = 13 months
72
+ * @param startDate
73
+ * @param endDate
74
+ * @returns
75
+ */
76
+ export declare function getTimeDifferenceInWholeMonths(startDate: DateTime, endDate: DateTime): number;
77
+ export declare function getTimeDifferenceInWholeDays(startDate: DateTime, endDate: DateTime): number;
78
+ export declare function getTimeDifferenceInWholeYears(startDate: DateTime, endDate: DateTime): number;
79
+ export declare function areTwoDatesWithinOneYear(startDate: number, endDate: number): boolean;
80
+ export declare function areDatesSameDay(startDate: number, endDate: number): boolean;
81
+ export declare function isDateBetween(date: number, startDate: number, endDate: number): boolean;
82
+ /** Check if the first date is strictly before the second date */
83
+ export declare function isDateStrictlyBefore(date: number, dateBefore: number): boolean;
84
+ /** Check if the first date is before or equal to the second date */
85
+ export declare function isDateBefore(date: number, dateBefore: number): boolean;
86
+ /** Check if the first date is strictly after the second date */
87
+ export declare function isDateStrictlyAfter(date: number, dateAfter: number): boolean;
88
+ /** Check if the first date is after or equal to the second date */
89
+ export declare function isDateAfter(date: number, dateAfter: number): boolean;
90
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const MAX_DELAY = 140;
2
+ export declare const MIN_DELAY = 20;
3
+ /**
4
+ * Decreasing exponential function used to determine the "speed" of edge-scrolling
5
+ * as the timeout delay.
6
+ *
7
+ * Returns a timeout delay in milliseconds.
8
+ */
9
+ export declare function scrollDelay(value: number): number;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * This is a generic event bus based on the Owl event bus.
3
+ * This bus however ensures type safety across events and subscription callbacks.
4
+ */
5
+ export declare class EventBus<Event extends {
6
+ type: string;
7
+ }> {
8
+ subscriptions: {
9
+ [eventType: string]: Subscription[];
10
+ };
11
+ /**
12
+ * Add a listener for the 'eventType' events.
13
+ *
14
+ * Note that the 'owner' of this event can be anything, but will more likely
15
+ * be a component or a class. The idea is that the callback will be called with
16
+ * the proper owner bound.
17
+ *
18
+ * Also, the owner should be kind of unique. This will be used to remove the
19
+ * listener.
20
+ */
21
+ on<T extends Event["type"], E extends Extract<Event, {
22
+ type: T;
23
+ }>>(type: T, owner: any, callback: (r: Omit<E, "type">) => void): void;
24
+ /**
25
+ * Emit an event of type 'eventType'. Any extra arguments will be passed to
26
+ * the listeners callback.
27
+ */
28
+ trigger<T extends Event["type"], E extends Extract<Event, {
29
+ type: T;
30
+ }>>(type: T, payload?: Omit<E, "type">): void;
31
+ /**
32
+ * Remove a listener
33
+ */
34
+ off<T extends Event["type"]>(eventType: T, owner: any): void;
35
+ /**
36
+ * Remove all subscriptions.
37
+ */
38
+ clear(): void;
39
+ }
40
+ type Callback = (...args: any[]) => void;
41
+ interface Subscription {
42
+ owner: any;
43
+ callback: Callback;
44
+ }
45
+ export {};
@@ -0,0 +1,56 @@
1
+ import { AddColumnsRowsCommand, ApplyRangeChange, CommandResult, CoreGetters, RemoveColumnsRowsCommand, UID } from "../../../types";
2
+ import { ChartCreationContext, ChartDefinition, ChartType, ExcelChartDefinition } from "../../../types/chart/chart";
3
+ import { Validator } from "../../../types/validator";
4
+ /**
5
+ * AbstractChart is the class from which every Chart should inherit.
6
+ * The role of this class is to maintain the state of each chart.
7
+ */
8
+ export declare abstract class AbstractChart {
9
+ readonly sheetId: UID;
10
+ readonly title: string;
11
+ abstract readonly type: ChartType;
12
+ protected readonly getters: CoreGetters;
13
+ constructor(definition: ChartDefinition, sheetId: UID, getters: CoreGetters);
14
+ /**
15
+ * Validate the chart definition given as arguments. This function will be
16
+ * called from allowDispatch function
17
+ */
18
+ static validateChartDefinition(validator: Validator, definition: ChartDefinition): CommandResult | CommandResult[];
19
+ /**
20
+ * Get a new chart definition transformed with the executed command. This
21
+ * functions will be called during operational transform process
22
+ */
23
+ static transformDefinition(definition: ChartDefinition, executed: AddColumnsRowsCommand | RemoveColumnsRowsCommand): ChartDefinition;
24
+ /**
25
+ * Get an empty definition based on the given context
26
+ */
27
+ static getDefinitionFromContextCreation(context: ChartCreationContext): ChartDefinition;
28
+ /**
29
+ * Get the definition of the chart
30
+ */
31
+ abstract getDefinition(): ChartDefinition;
32
+ /**
33
+ * Get the definition of the chart that will be used for excel export.
34
+ * If the chart is not supported by Excel, this function returns undefined.
35
+ */
36
+ abstract getDefinitionForExcel(): ExcelChartDefinition | undefined;
37
+ /**
38
+ * This function should be used to update all the ranges of the chart after
39
+ * a grid change (add/remove col/row, rename sheet, ...)
40
+ */
41
+ abstract updateRanges(applyChange: ApplyRangeChange): AbstractChart;
42
+ /**
43
+ * Get a copy a the chart adapted to the given sheetId.
44
+ * The ranges that are in the same sheet as the chart will be adapted to the given sheetId.
45
+ */
46
+ abstract copyForSheetId(sheetId: UID): AbstractChart;
47
+ /**
48
+ * Get a copy a the chart in the given sheetId.
49
+ * The ranges of the chart will stay the same as the copied chart.
50
+ */
51
+ abstract copyInSheetId(sheetId: UID): AbstractChart;
52
+ /**
53
+ * Extract the ChartCreationContext of the chart
54
+ */
55
+ abstract getContextCreation(): ChartCreationContext;
56
+ }
@@ -0,0 +1,29 @@
1
+ import { AddColumnsRowsCommand, ApplyRangeChange, Color, CommandResult, CoreGetters, Getters, Range, RemoveColumnsRowsCommand, UID } from "../../../types";
2
+ import { BarChartDefinition, BarChartRuntime } from "../../../types/chart/bar_chart";
3
+ import { ChartCreationContext, DataSet, ExcelChartDefinition } from "../../../types/chart/chart";
4
+ import { LegendPosition, VerticalAxisPosition } from "../../../types/chart/common_chart";
5
+ import { Validator } from "../../../types/validator";
6
+ import { AbstractChart } from "./abstract_chart";
7
+ export declare class BarChart extends AbstractChart {
8
+ readonly dataSets: DataSet[];
9
+ readonly labelRange?: Range | undefined;
10
+ readonly background?: Color;
11
+ readonly verticalAxisPosition: VerticalAxisPosition;
12
+ readonly legendPosition: LegendPosition;
13
+ readonly stacked: boolean;
14
+ readonly aggregated?: boolean;
15
+ readonly type = "bar";
16
+ readonly dataSetsHaveTitle: boolean;
17
+ constructor(definition: BarChartDefinition, sheetId: UID, getters: CoreGetters);
18
+ static transformDefinition(definition: BarChartDefinition, executed: AddColumnsRowsCommand | RemoveColumnsRowsCommand): BarChartDefinition;
19
+ static validateChartDefinition(validator: Validator, definition: BarChartDefinition): CommandResult | CommandResult[];
20
+ static getDefinitionFromContextCreation(context: ChartCreationContext): BarChartDefinition;
21
+ getContextCreation(): ChartCreationContext;
22
+ copyForSheetId(sheetId: UID): BarChart;
23
+ copyInSheetId(sheetId: UID): BarChart;
24
+ getDefinition(): BarChartDefinition;
25
+ private getDefinitionWithSpecificDataSets;
26
+ getDefinitionForExcel(): ExcelChartDefinition | undefined;
27
+ updateRanges(applyChange: ApplyRangeChange): BarChart;
28
+ }
29
+ export declare function createBarChartRuntime(chart: BarChart, getters: Getters): BarChartRuntime;
@@ -0,0 +1,62 @@
1
+ import { AddColumnsRowsCommand, ApplyRangeChange, Color, CommandResult, CoreGetters, DOMCoordinates, DOMDimension, EvaluatedCell, Getters, Locale, Range, RemoveColumnsRowsCommand, UID } from "../../../types";
2
+ import { BarChartDefinition } from "../../../types/chart/bar_chart";
3
+ import { DataSet, ExcelChartDataset } from "../../../types/chart/chart";
4
+ import { LineChartDefinition } from "../../../types/chart/line_chart";
5
+ import { PieChartDefinition } from "../../../types/chart/pie_chart";
6
+ import { BaselineArrowDirection, BaselineMode } from "../../../types/chart/scorecard_chart";
7
+ /**
8
+ * This file contains helpers that are common to different charts (mainly
9
+ * line, bar and pie charts)
10
+ */
11
+ /**
12
+ * Adapt ranges of a chart which support DataSet (dataSets and LabelRange).
13
+ */
14
+ export declare function updateChartRangesWithDataSets(getters: CoreGetters, applyChange: ApplyRangeChange, chartDataSets: DataSet[], chartLabelRange?: Range): {
15
+ isStale: boolean;
16
+ dataSets: DataSet[];
17
+ labelRange: Range | undefined;
18
+ };
19
+ /**
20
+ * Copy the dataSets given. All the ranges which are on sheetIdFrom will target
21
+ * sheetIdTo.
22
+ */
23
+ export declare function copyDataSetsWithNewSheetId(sheetIdFrom: UID, sheetIdTo: UID, dataSets: DataSet[]): DataSet[];
24
+ /**
25
+ * Copy a range. If the range is on the sheetIdFrom, the range will target
26
+ * sheetIdTo.
27
+ */
28
+ export declare function copyLabelRangeWithNewSheetId(sheetIdFrom: UID, sheetIdTo: UID, range?: Range): Range | undefined;
29
+ /**
30
+ * Adapt a single range of a chart
31
+ */
32
+ export declare function adaptChartRange(range: Range | undefined, applyChange: ApplyRangeChange): Range | undefined;
33
+ /**
34
+ * Create the dataSet objects from xcs
35
+ */
36
+ export declare function createDataSets(getters: CoreGetters, dataSetsString: string[], sheetId: UID, dataSetsHaveTitle: boolean): DataSet[];
37
+ /**
38
+ * Transform a dataSet to a ExcelDataSet
39
+ */
40
+ export declare function toExcelDataset(getters: CoreGetters, ds: DataSet): ExcelChartDataset;
41
+ export declare function toExcelLabelRange(getters: CoreGetters, labelRange: Range | undefined, shouldRemoveFirstLabel?: boolean): string | undefined;
42
+ /**
43
+ * Transform a chart definition which supports dataSets (dataSets and LabelRange)
44
+ * with an executed command
45
+ */
46
+ export declare function transformChartDefinitionWithDataSetsWithZone<T extends LineChartDefinition | BarChartDefinition | PieChartDefinition>(definition: T, executed: AddColumnsRowsCommand | RemoveColumnsRowsCommand): T;
47
+ export declare class ChartColors {
48
+ private graphColorIndex;
49
+ next(): string;
50
+ }
51
+ /**
52
+ * Choose a font color based on a background color.
53
+ * The font is white with a dark background.
54
+ */
55
+ export declare function chartFontColor(backgroundColor: Color | undefined): Color;
56
+ export declare function checkDataset(definition: LineChartDefinition | BarChartDefinition | PieChartDefinition): CommandResult;
57
+ export declare function checkLabelRange(definition: LineChartDefinition | BarChartDefinition | PieChartDefinition): CommandResult;
58
+ export declare function shouldRemoveFirstLabel(labelRange: Range | undefined, dataset: DataSet | undefined, dataSetsHaveTitle: boolean): boolean;
59
+ export declare function getBaselineText(baseline: EvaluatedCell | undefined, keyValue: EvaluatedCell | undefined, baselineMode: BaselineMode, locale: Locale): string;
60
+ export declare function getBaselineColor(baseline: EvaluatedCell | undefined, baselineMode: BaselineMode, keyValue: EvaluatedCell | undefined, colorUp: Color, colorDown: Color): Color | undefined;
61
+ export declare function getBaselineArrowDirection(baseline: EvaluatedCell | undefined, keyValue: EvaluatedCell | undefined, baselineMode: BaselineMode): BaselineArrowDirection;
62
+ export declare function getChartPositionAtCenterOfViewport(getters: Getters, chartSize: DOMDimension): DOMCoordinates;
@@ -0,0 +1,40 @@
1
+ import { AddColumnsRowsCommand, CommandResult, RemoveColumnsRowsCommand, UID, Zone } from "../../../types";
2
+ import { ChartCreationContext, ChartDefinition, ChartRuntime, ChartType } from "../../../types/chart/chart";
3
+ import { CoreGetters, Getters } from "../../../types/getters";
4
+ import { Validator } from "../../../types/validator";
5
+ import { AbstractChart } from "./abstract_chart";
6
+ /**
7
+ * Create a function used to create a Chart based on the definition
8
+ */
9
+ export declare function chartFactory(getters: CoreGetters): (id: UID, definition: ChartDefinition, sheetId: UID) => AbstractChart;
10
+ /**
11
+ * Create a function used to create a Chart Runtime based on the chart class
12
+ * instance
13
+ */
14
+ export declare function chartRuntimeFactory(getters: Getters): (chart: AbstractChart) => ChartRuntime;
15
+ /**
16
+ * Validate the chart definition given in arguments
17
+ */
18
+ export declare function validateChartDefinition(validator: Validator, definition: ChartDefinition): CommandResult | CommandResult[];
19
+ /**
20
+ * Get a new chart definition transformed with the executed command. This
21
+ * functions will be called during operational transform process
22
+ */
23
+ export declare function transformDefinition(definition: ChartDefinition, executed: AddColumnsRowsCommand | RemoveColumnsRowsCommand): ChartDefinition;
24
+ /**
25
+ * Get an empty definition based on the given context and the given type
26
+ */
27
+ export declare function getChartDefinitionFromContextCreation(context: ChartCreationContext, type: ChartType): ChartDefinition;
28
+ export declare function getChartTypes(): Record<string, string>;
29
+ /**
30
+ * Return a "smart" chart definition in the given zone. The definition is "smart" because it will
31
+ * use the best type of chart to display the data of the zone.
32
+ *
33
+ * It will also try to find labels and datasets in the range, and try to find title for the datasets.
34
+ *
35
+ * The type of chart will be :
36
+ * - If the zone is a single non-empty cell, returns a scorecard
37
+ * - If the all the labels are numbers/date, returns a line chart
38
+ * - Else returns a bar chart
39
+ */
40
+ export declare function getSmartChartDefinition(zone: Zone, getters: Getters): ChartDefinition;
@@ -0,0 +1,41 @@
1
+ import type { ChartConfiguration } from "chart.js";
2
+ import { Color, Figure, Format, Getters, LocaleFormat, Range } from "../../../types";
3
+ import { ChartRuntime, DataSet, DatasetValues, LabelValues } from "../../../types/chart/chart";
4
+ import { AbstractChart } from "./abstract_chart";
5
+ /**
6
+ * This file contains helpers that are common to different runtime charts (mainly
7
+ * line, bar and pie charts)
8
+ */
9
+ /**
10
+ * Get the data from a dataSet
11
+ */
12
+ export declare function getData(getters: Getters, ds: DataSet): any[];
13
+ export declare function filterEmptyDataPoints(labels: string[], datasets: DatasetValues[]): {
14
+ labels: string[];
15
+ dataSetsValues: DatasetValues[];
16
+ };
17
+ /**
18
+ * Aggregates data based on labels
19
+ */
20
+ export declare function aggregateDataForLabels(labels: string[], datasets: DatasetValues[]): {
21
+ labels: string[];
22
+ dataSetsValues: DatasetValues[];
23
+ };
24
+ export declare function truncateLabel(label: string | undefined): string;
25
+ /**
26
+ * Get a default chart js configuration
27
+ */
28
+ export declare function getDefaultChartJsRuntime(chart: AbstractChart, labels: string[], fontColor: Color, { format, locale, truncateLabels }: LocaleFormat & {
29
+ truncateLabels?: boolean;
30
+ }): Required<ChartConfiguration>;
31
+ export declare function getChartLabelFormat(getters: Getters, range: Range | undefined, shouldRemoveFirstLabel: boolean): Format | undefined;
32
+ export declare function getChartLabelValues(getters: Getters, dataSets: DataSet[], labelRange?: Range): LabelValues;
33
+ /**
34
+ * Get the format to apply to the the dataset values. This format is defined as the first format
35
+ * found in the dataset ranges that isn't a date format.
36
+ */
37
+ export declare function getChartDatasetFormat(getters: Getters, dataSets: DataSet[]): Format | undefined;
38
+ export declare function getChartDatasetValues(getters: Getters, dataSets: DataSet[]): DatasetValues[];
39
+ /** See https://www.chartjs.org/docs/latest/charts/area.html#filling-modes */
40
+ export declare function getFillingMode(index: number): "origin" | number;
41
+ export declare function chartToImage(runtime: ChartRuntime, figure: Figure, type: string): any;
@@ -0,0 +1,23 @@
1
+ import { AddColumnsRowsCommand, ApplyRangeChange, Color, CommandResult, CoreGetters, Getters, Range, RemoveColumnsRowsCommand, UID } from "../../../types";
2
+ import { ChartCreationContext } from "../../../types/chart/chart";
3
+ import { GaugeChartDefinition, GaugeChartRuntime, SectionRule } from "../../../types/chart/gauge_chart";
4
+ import { Validator } from "../../../types/validator";
5
+ import { AbstractChart } from "./abstract_chart";
6
+ export declare class GaugeChart extends AbstractChart {
7
+ readonly dataRange?: Range;
8
+ readonly sectionRule: SectionRule;
9
+ readonly background?: Color;
10
+ readonly type = "gauge";
11
+ constructor(definition: GaugeChartDefinition, sheetId: UID, getters: CoreGetters);
12
+ static validateChartDefinition(validator: Validator, definition: GaugeChartDefinition): CommandResult | CommandResult[];
13
+ static transformDefinition(definition: GaugeChartDefinition, executed: AddColumnsRowsCommand | RemoveColumnsRowsCommand): GaugeChartDefinition;
14
+ static getDefinitionFromContextCreation(context: ChartCreationContext): GaugeChartDefinition;
15
+ copyForSheetId(sheetId: UID): GaugeChart;
16
+ copyInSheetId(sheetId: UID): GaugeChart;
17
+ getDefinition(): GaugeChartDefinition;
18
+ private getDefinitionWithSpecificRanges;
19
+ getDefinitionForExcel(): undefined;
20
+ getContextCreation(): ChartCreationContext;
21
+ updateRanges(applyChange: ApplyRangeChange): GaugeChart;
22
+ }
23
+ export declare function createGaugeChartRuntime(chart: GaugeChart, getters: Getters): GaugeChartRuntime;
@@ -0,0 +1,10 @@
1
+ export * from "./abstract_chart";
2
+ export * from "./bar_chart";
3
+ export * from "./chart_common";
4
+ export * from "./chart_factory";
5
+ export * from "./chart_ui_common";
6
+ export * from "./gauge_chart";
7
+ export * from "./line_chart";
8
+ export * from "./pie_chart";
9
+ export * from "./scorecard_chart";
10
+ import "./chart_js_gauge_controller";
@@ -0,0 +1,32 @@
1
+ import { AddColumnsRowsCommand, ApplyRangeChange, Color, CommandResult, CoreGetters, Getters, Range, RemoveColumnsRowsCommand, UID } from "../../../types";
2
+ import { ChartCreationContext, DataSet, ExcelChartDefinition } from "../../../types/chart/chart";
3
+ import { LegendPosition, VerticalAxisPosition } from "../../../types/chart/common_chart";
4
+ import { LineChartDefinition, LineChartRuntime } from "../../../types/chart/line_chart";
5
+ import { Validator } from "../../../types/validator";
6
+ import { AbstractChart } from "./abstract_chart";
7
+ export declare class LineChart extends AbstractChart {
8
+ readonly dataSets: DataSet[];
9
+ readonly labelRange?: Range | undefined;
10
+ readonly background?: Color;
11
+ readonly verticalAxisPosition: VerticalAxisPosition;
12
+ readonly legendPosition: LegendPosition;
13
+ readonly labelsAsText: boolean;
14
+ readonly stacked: boolean;
15
+ readonly aggregated?: boolean;
16
+ readonly type = "line";
17
+ readonly dataSetsHaveTitle: boolean;
18
+ readonly cumulative: boolean;
19
+ constructor(definition: LineChartDefinition, sheetId: UID, getters: CoreGetters);
20
+ static validateChartDefinition(validator: Validator, definition: LineChartDefinition): CommandResult | CommandResult[];
21
+ static transformDefinition(definition: LineChartDefinition, executed: AddColumnsRowsCommand | RemoveColumnsRowsCommand): LineChartDefinition;
22
+ static getDefinitionFromContextCreation(context: ChartCreationContext): LineChartDefinition;
23
+ getDefinition(): LineChartDefinition;
24
+ private getDefinitionWithSpecificDataSets;
25
+ getContextCreation(): ChartCreationContext;
26
+ updateRanges(applyChange: ApplyRangeChange): LineChart;
27
+ getDefinitionForExcel(): ExcelChartDefinition | undefined;
28
+ copyForSheetId(sheetId: UID): LineChart;
29
+ copyInSheetId(sheetId: UID): LineChart;
30
+ }
31
+ export declare function canChartParseLabels(chart: LineChart, getters: Getters): boolean;
32
+ export declare function createLineChartRuntime(chart: LineChart, getters: Getters): LineChartRuntime;
@@ -0,0 +1,27 @@
1
+ import { AddColumnsRowsCommand, ApplyRangeChange, Color, CommandResult, CoreGetters, Getters, Range, RemoveColumnsRowsCommand, UID } from "../../../types";
2
+ import { ChartCreationContext, DataSet, ExcelChartDefinition } from "../../../types/chart/chart";
3
+ import { LegendPosition } from "../../../types/chart/common_chart";
4
+ import { PieChartDefinition, PieChartRuntime } from "../../../types/chart/pie_chart";
5
+ import { Validator } from "../../../types/validator";
6
+ import { AbstractChart } from "./abstract_chart";
7
+ export declare class PieChart extends AbstractChart {
8
+ readonly dataSets: DataSet[];
9
+ readonly labelRange?: Range | undefined;
10
+ readonly background?: Color;
11
+ readonly legendPosition: LegendPosition;
12
+ readonly type = "pie";
13
+ readonly aggregated?: boolean;
14
+ readonly dataSetsHaveTitle: boolean;
15
+ constructor(definition: PieChartDefinition, sheetId: UID, getters: CoreGetters);
16
+ static transformDefinition(definition: PieChartDefinition, executed: AddColumnsRowsCommand | RemoveColumnsRowsCommand): PieChartDefinition;
17
+ static validateChartDefinition(validator: Validator, definition: PieChartDefinition): CommandResult | CommandResult[];
18
+ static getDefinitionFromContextCreation(context: ChartCreationContext): PieChartDefinition;
19
+ getDefinition(): PieChartDefinition;
20
+ getContextCreation(): ChartCreationContext;
21
+ private getDefinitionWithSpecificDataSets;
22
+ copyForSheetId(sheetId: UID): PieChart;
23
+ copyInSheetId(sheetId: UID): PieChart;
24
+ getDefinitionForExcel(): ExcelChartDefinition | undefined;
25
+ updateRanges(applyChange: ApplyRangeChange): PieChart;
26
+ }
27
+ export declare function createPieChartRuntime(chart: PieChart, getters: Getters): PieChartRuntime;
@@ -0,0 +1,30 @@
1
+ import { AddColumnsRowsCommand, ApplyRangeChange, Color, CommandResult, CoreGetters, Getters, Range, RemoveColumnsRowsCommand, UID } from "../../../types";
2
+ import { ChartCreationContext } from "../../../types/chart/chart";
3
+ import { BaselineMode, ScorecardChartDefinition, ScorecardChartRuntime } from "../../../types/chart/scorecard_chart";
4
+ import { Validator } from "../../../types/validator";
5
+ import { AbstractChart } from "./abstract_chart";
6
+ import { ScorecardChartConfig } from "./scorecard_chart_config_builder";
7
+ export declare class ScorecardChart extends AbstractChart {
8
+ readonly keyValue?: Range;
9
+ readonly baseline?: Range;
10
+ readonly baselineMode: BaselineMode;
11
+ readonly baselineDescr?: string;
12
+ readonly background?: Color;
13
+ readonly baselineColorUp: Color;
14
+ readonly baselineColorDown: Color;
15
+ readonly fontColor?: Color;
16
+ readonly type = "scorecard";
17
+ constructor(definition: ScorecardChartDefinition, sheetId: UID, getters: CoreGetters);
18
+ static validateChartDefinition(validator: Validator, definition: ScorecardChartDefinition): CommandResult | CommandResult[];
19
+ static getDefinitionFromContextCreation(context: ChartCreationContext): ScorecardChartDefinition;
20
+ static transformDefinition(definition: ScorecardChartDefinition, executed: AddColumnsRowsCommand | RemoveColumnsRowsCommand): ScorecardChartDefinition;
21
+ copyForSheetId(sheetId: UID): ScorecardChart;
22
+ copyInSheetId(sheetId: UID): ScorecardChart;
23
+ getDefinition(): ScorecardChartDefinition;
24
+ getContextCreation(): ChartCreationContext;
25
+ private getDefinitionWithSpecificRanges;
26
+ getDefinitionForExcel(): undefined;
27
+ updateRanges(applyChange: ApplyRangeChange): ScorecardChart;
28
+ }
29
+ export declare function drawScoreChart(structure: ScorecardChartConfig, canvas: HTMLCanvasElement): void;
30
+ export declare function createScorecardChartRuntime(chart: ScorecardChart, getters: Getters): ScorecardChartRuntime;