@highcharts/grid-pro 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/LICENSE.txt +6 -0
  2. package/README.md +15 -9
  3. package/css/grid-pro.css +1262 -1122
  4. package/css/modules/grid-base-variables.css +131 -0
  5. package/css/modules/grid-button-variables.css +140 -0
  6. package/css/modules/grid-caption-variables.css +11 -0
  7. package/css/modules/grid-description-variables.css +11 -0
  8. package/css/modules/grid-input-variables.css +114 -0
  9. package/css/modules/grid-link-variables.css +18 -0
  10. package/css/modules/grid-menu-variables.css +50 -0
  11. package/css/modules/grid-pagination-variables.css +12 -0
  12. package/css/modules/grid-popup-variables.css +24 -0
  13. package/css/modules/grid-pro.css +234 -0
  14. package/css/modules/grid-table-variables.css +385 -0
  15. package/css/modules/grid-theme-default.css +55 -0
  16. package/es-modules/Accessibility/A11yI18n.js +1 -2
  17. package/es-modules/Accessibility/Accessibility.js +1 -2
  18. package/es-modules/Accessibility/AccessibilityComponent.d.ts +2 -2
  19. package/es-modules/Accessibility/Components/InfoRegionsComponent.js +5 -6
  20. package/es-modules/Accessibility/Components/LegendComponent.js +1 -2
  21. package/es-modules/Accessibility/Components/MenuComponent.js +1 -2
  22. package/es-modules/Accessibility/Components/NavigatorComponent.js +3 -4
  23. package/es-modules/Accessibility/Components/RangeSelectorComponent.js +1 -2
  24. package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +1 -2
  25. package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +3 -4
  26. package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +3 -4
  27. package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +1 -2
  28. package/es-modules/Accessibility/Components/ZoomComponent.js +1 -2
  29. package/es-modules/Accessibility/FocusBorder.js +1 -2
  30. package/es-modules/Accessibility/KeyboardNavigation.js +1 -2
  31. package/es-modules/Accessibility/KeyboardNavigationHandler.js +1 -2
  32. package/es-modules/Accessibility/Options/A11yDefaults.d.ts +11 -0
  33. package/es-modules/Accessibility/Options/A11yDefaults.js +11 -0
  34. package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +58 -0
  35. package/es-modules/Accessibility/Options/DeprecatedOptions.js +7 -2
  36. package/es-modules/Accessibility/Options/LangDefaults.js +9 -0
  37. package/es-modules/Accessibility/ProxyElement.js +2 -5
  38. package/es-modules/Accessibility/ProxyProvider.js +1 -2
  39. package/es-modules/Accessibility/Utils/Announcer.js +2 -3
  40. package/es-modules/Accessibility/Utils/ChartUtilities.js +1 -2
  41. package/es-modules/Accessibility/Utils/EventProvider.d.ts +2 -2
  42. package/es-modules/Accessibility/Utils/EventProvider.js +6 -2
  43. package/es-modules/Accessibility/Utils/HTMLUtilities.js +1 -2
  44. package/es-modules/Core/Animation/AnimationUtilities.js +1 -2
  45. package/es-modules/Core/Animation/Fx.js +1 -2
  46. package/es-modules/Core/Callback.d.ts +9 -2
  47. package/es-modules/Core/Chart/Chart.js +48 -41
  48. package/es-modules/Core/Chart/Chart3D.js +1 -2
  49. package/es-modules/Core/Chart/ChartDefaults.js +11 -0
  50. package/es-modules/Core/Chart/ChartOptions.d.ts +8 -0
  51. package/es-modules/Core/Chart/GanttChart.js +1 -2
  52. package/es-modules/Core/Chart/MapChart.js +1 -2
  53. package/es-modules/Core/Chart/StockChart.js +2 -3
  54. package/es-modules/Core/Color/Color.js +1 -2
  55. package/es-modules/Core/Defaults.js +36 -9
  56. package/es-modules/Core/Delaunay.d.ts +52 -0
  57. package/es-modules/Core/Delaunay.js +310 -0
  58. package/es-modules/Core/Foundation.js +1 -2
  59. package/es-modules/Core/Geometry/CircleUtilities.js +1 -2
  60. package/es-modules/Core/Globals.js +1 -1
  61. package/es-modules/Core/HttpUtilities.js +1 -2
  62. package/es-modules/Core/MSPointer.js +1 -2
  63. package/es-modules/Core/Math3D.js +1 -2
  64. package/es-modules/Core/Options.d.ts +6 -2
  65. package/es-modules/Core/Pointer.js +23 -4
  66. package/es-modules/Core/PointerEvent.d.ts +2 -0
  67. package/es-modules/Core/Renderer/HTML/AST.js +2 -2
  68. package/es-modules/Core/Renderer/HTML/HTMLElement.js +1 -2
  69. package/es-modules/Core/Renderer/RendererUtilities.js +34 -19
  70. package/es-modules/Core/Responsive.d.ts +4 -2
  71. package/es-modules/Core/Responsive.js +10 -4
  72. package/es-modules/Core/Templating.d.ts +1 -1
  73. package/es-modules/Core/Templating.js +3 -4
  74. package/es-modules/Core/Time.d.ts +8 -0
  75. package/es-modules/Core/Time.js +2 -2
  76. package/es-modules/Core/Tooltip.d.ts +4 -8
  77. package/es-modules/Core/Tooltip.js +100 -81
  78. package/es-modules/Core/TooltipOptions.d.ts +44 -1
  79. package/es-modules/Core/Utilities.d.ts +25 -665
  80. package/es-modules/Core/Utilities.js +17 -1398
  81. package/es-modules/Data/ColumnUtils.d.ts +83 -80
  82. package/es-modules/Data/ColumnUtils.js +103 -113
  83. package/es-modules/Data/Connectors/CSVConnector.d.ts +9 -14
  84. package/es-modules/Data/Connectors/CSVConnector.js +3 -4
  85. package/es-modules/Data/Connectors/DataConnector.d.ts +52 -54
  86. package/es-modules/Data/Connectors/DataConnector.js +33 -52
  87. package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +40 -42
  88. package/es-modules/Data/Connectors/GoogleSheetsConnector.js +73 -88
  89. package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +4 -2
  90. package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +23 -28
  91. package/es-modules/Data/Connectors/HTMLTableConnector.js +3 -4
  92. package/es-modules/Data/Connectors/JSONConnector.d.ts +9 -14
  93. package/es-modules/Data/Connectors/JSONConnector.js +3 -4
  94. package/es-modules/Data/Converters/CSVConverter.d.ts +5 -5
  95. package/es-modules/Data/Converters/CSVConverter.js +3 -4
  96. package/es-modules/Data/Converters/CSVConverterOptions.d.ts +2 -2
  97. package/es-modules/Data/Converters/DataConverter.d.ts +76 -78
  98. package/es-modules/Data/Converters/DataConverter.js +26 -53
  99. package/es-modules/Data/Converters/DataConverterUtils.d.ts +88 -81
  100. package/es-modules/Data/Converters/DataConverterUtils.js +169 -181
  101. package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +4 -4
  102. package/es-modules/Data/Converters/GoogleSheetsConverter.js +3 -3
  103. package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +2 -2
  104. package/es-modules/Data/Converters/HTMLTableConverter.d.ts +4 -4
  105. package/es-modules/Data/Converters/HTMLTableConverter.js +2 -3
  106. package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +2 -2
  107. package/es-modules/Data/Converters/JSONConverter.d.ts +7 -7
  108. package/es-modules/Data/Converters/JSONConverter.js +6 -6
  109. package/es-modules/Data/Converters/JSONConverterOptions.d.ts +2 -2
  110. package/es-modules/Data/DataCursor.d.ts +65 -70
  111. package/es-modules/Data/DataCursor.js +119 -139
  112. package/es-modules/Data/DataEvent.d.ts +55 -57
  113. package/es-modules/Data/DataPool.d.ts +10 -17
  114. package/es-modules/Data/DataPool.js +20 -9
  115. package/es-modules/Data/DataTable.d.ts +111 -113
  116. package/es-modules/Data/DataTable.js +3 -3
  117. package/es-modules/Data/DataTableCore.d.ts +9 -9
  118. package/es-modules/Data/DataTableCore.js +2 -2
  119. package/es-modules/Data/Formula/FormulaParser.js +1 -2
  120. package/es-modules/Data/Formula/FormulaProcessor.js +1 -2
  121. package/es-modules/Data/Modifiers/ChainModifier.d.ts +29 -34
  122. package/es-modules/Data/Modifiers/ChainModifier.js +7 -8
  123. package/es-modules/Data/Modifiers/DataModifier.d.ts +36 -41
  124. package/es-modules/Data/Modifiers/DataModifier.js +31 -53
  125. package/es-modules/Data/Modifiers/FilterModifier.d.ts +4 -4
  126. package/es-modules/Data/Modifiers/FilterModifier.js +3 -4
  127. package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +3 -2
  128. package/es-modules/Data/Modifiers/InvertModifier.d.ts +4 -4
  129. package/es-modules/Data/Modifiers/InvertModifier.js +3 -4
  130. package/es-modules/Data/Modifiers/MathModifier.d.ts +5 -4
  131. package/es-modules/Data/Modifiers/RangeModifier.d.ts +4 -4
  132. package/es-modules/Data/Modifiers/RangeModifier.js +3 -4
  133. package/es-modules/Data/Modifiers/SortModifier.d.ts +6 -11
  134. package/es-modules/Data/Modifiers/SortModifier.js +3 -4
  135. package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +3 -3
  136. package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +1 -1
  137. package/es-modules/Grid/Core/Accessibility/Accessibility.js +5 -6
  138. package/es-modules/Grid/Core/Data/DataProvider.d.ts +97 -0
  139. package/es-modules/Grid/Core/Data/DataProvider.js +89 -0
  140. package/es-modules/Grid/Core/Data/DataProviderRegistry.d.ts +20 -0
  141. package/es-modules/Grid/Core/Data/DataProviderRegistry.js +52 -0
  142. package/es-modules/Grid/Core/Data/DataProviderType.d.ts +19 -0
  143. package/es-modules/Grid/Core/Data/DataProviderType.js +15 -0
  144. package/es-modules/Grid/Core/Data/LocalDataProvider.d.ts +165 -0
  145. package/es-modules/Grid/Core/Data/LocalDataProvider.js +341 -0
  146. package/es-modules/Grid/Core/Defaults.js +4 -2
  147. package/es-modules/Grid/Core/Globals.d.ts +20 -16
  148. package/es-modules/Grid/Core/Globals.js +10 -8
  149. package/es-modules/Grid/Core/Grid.d.ts +31 -22
  150. package/es-modules/Grid/Core/Grid.js +214 -136
  151. package/es-modules/Grid/Core/GridUtils.d.ts +33 -0
  152. package/es-modules/Grid/Core/GridUtils.js +50 -3
  153. package/es-modules/Grid/Core/Options.d.ts +145 -4
  154. package/es-modules/Grid/Core/Pagination/Pagination.d.ts +3 -0
  155. package/es-modules/Grid/Core/Pagination/Pagination.js +63 -23
  156. package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +4 -0
  157. package/es-modules/Grid/Core/Querying/FilteringController.js +1 -2
  158. package/es-modules/Grid/Core/Querying/PaginationController.d.ts +2 -2
  159. package/es-modules/Grid/Core/Querying/PaginationController.js +3 -3
  160. package/es-modules/Grid/Core/Querying/QueryingController.d.ts +1 -1
  161. package/es-modules/Grid/Core/Querying/QueryingController.js +2 -26
  162. package/es-modules/Grid/Core/Responsive/ResponsiveComposition.d.ts +53 -0
  163. package/es-modules/Grid/Core/Responsive/ResponsiveComposition.js +229 -0
  164. package/es-modules/Grid/Core/Responsive/ResponsiveOptions.d.ts +58 -0
  165. package/es-modules/Grid/Core/Responsive/ResponsiveOptions.js +15 -0
  166. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +2 -3
  167. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +1 -1
  168. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +3 -4
  169. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +1 -1
  170. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +2 -2
  171. package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +17 -1
  172. package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +58 -15
  173. package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +1 -3
  174. package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +57 -3
  175. package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +397 -118
  176. package/es-modules/Grid/Core/Table/Body/CellContextMenu.d.ts +11 -0
  177. package/es-modules/Grid/Core/Table/Body/CellContextMenu.js +84 -0
  178. package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +27 -13
  179. package/es-modules/Grid/Core/Table/Body/TableCell.js +74 -25
  180. package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +7 -15
  181. package/es-modules/Grid/Core/Table/Body/TableRow.js +24 -19
  182. package/es-modules/Grid/Core/Table/Cell.d.ts +16 -3
  183. package/es-modules/Grid/Core/Table/Cell.js +36 -3
  184. package/es-modules/Grid/Core/Table/CellContent/TextContent.js +3 -8
  185. package/es-modules/Grid/Core/Table/Column.d.ts +10 -4
  186. package/es-modules/Grid/Core/Table/Column.js +23 -34
  187. package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +9 -8
  188. package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +4 -3
  189. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +5 -0
  190. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +7 -2
  191. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +1 -2
  192. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +1 -2
  193. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +2 -3
  194. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +1 -2
  195. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +1 -2
  196. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +0 -1
  197. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +4 -14
  198. package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +6 -1
  199. package/es-modules/Grid/Core/Table/Header/HeaderCell.js +33 -13
  200. package/es-modules/Grid/Core/Table/Header/HeaderRow.js +4 -5
  201. package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +1 -1
  202. package/es-modules/Grid/Core/Table/Header/TableHeader.js +3 -3
  203. package/es-modules/Grid/Core/Table/Row.d.ts +1 -1
  204. package/es-modules/Grid/Core/Table/Row.js +2 -2
  205. package/es-modules/Grid/Core/Table/Table.d.ts +38 -12
  206. package/es-modules/Grid/Core/Table/Table.js +184 -91
  207. package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +6 -7
  208. package/es-modules/Grid/Core/UI/ContextMenuButton.js +5 -3
  209. package/es-modules/Grid/Core/UI/Popup.js +7 -9
  210. package/es-modules/Grid/Core/UI/SvgIcons.d.ts +42 -7
  211. package/es-modules/Grid/Core/UI/SvgIcons.js +206 -33
  212. package/es-modules/Grid/Core/UI/Toolbar.d.ts +5 -0
  213. package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +4 -12
  214. package/es-modules/Grid/Core/UI/ToolbarButton.js +8 -26
  215. package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +2 -2
  216. package/es-modules/Grid/Pro/CellEditing/CellEditing.js +10 -10
  217. package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +1 -2
  218. package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +1 -1
  219. package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +4 -2
  220. package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +2 -2
  221. package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +1 -2
  222. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +2 -2
  223. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +1 -2
  224. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +2 -2
  225. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +1 -2
  226. package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +1 -2
  227. package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +1 -2
  228. package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +1 -2
  229. package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +1 -2
  230. package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +1 -2
  231. package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +2 -2
  232. package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +1 -2
  233. package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +1 -2
  234. package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +1 -2
  235. package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +1 -2
  236. package/es-modules/Grid/Pro/ColumnTypes/Validator.js +34 -32
  237. package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +1 -1
  238. package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +3 -4
  239. package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +1 -3
  240. package/es-modules/Grid/Pro/Data/DataSourceHelper.d.ts +74 -0
  241. package/es-modules/Grid/Pro/Data/DataSourceHelper.js +246 -0
  242. package/es-modules/Grid/Pro/Data/QuerySerializer.d.ts +46 -0
  243. package/es-modules/Grid/Pro/Data/QuerySerializer.js +169 -0
  244. package/es-modules/Grid/Pro/Data/RemoteDataProvider.d.ts +187 -0
  245. package/es-modules/Grid/Pro/Data/RemoteDataProvider.js +500 -0
  246. package/es-modules/Grid/Pro/Export/Exporting.js +1 -2
  247. package/es-modules/Grid/Pro/Export/ExportingComposition.js +1 -2
  248. package/es-modules/Grid/Pro/GridEvents.js +1 -2
  249. package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +0 -1
  250. package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +1 -2
  251. package/es-modules/Shared/BaseForm.js +1 -2
  252. package/es-modules/Shared/DownloadURL.js +1 -2
  253. package/es-modules/Shared/TimeBase.js +3 -3
  254. package/es-modules/Shared/Types.d.ts +7 -0
  255. package/es-modules/Shared/Utilities.d.ts +576 -0
  256. package/es-modules/Shared/Utilities.js +1368 -0
  257. package/es-modules/masters/grid-pro.src.d.ts +15 -11
  258. package/es-modules/masters/grid-pro.src.js +12 -5
  259. package/grid-pro.d.ts +15 -11
  260. package/grid-pro.js +3 -3
  261. package/grid-pro.js.map +1 -1
  262. package/grid-pro.src.d.ts +15 -11
  263. package/grid-pro.src.js +10408 -8009
  264. package/package.json +1 -1
  265. package/es-modules/Grid/Core/Pagination/Icons.d.ts +0 -7
  266. package/es-modules/Grid/Core/Pagination/Icons.js +0 -7
@@ -63,6 +63,14 @@ declare namespace Time {
63
63
  * The count of the interval.
64
64
  */
65
65
  count: number;
66
+ /**
67
+ * A value for how well the returned tick interval fits the input
68
+ * interval. Ranges close to but above 1 indicate that the fit is bad,
69
+ * where 1 is a perfect fit for the _next_ higher interval. For example,
70
+ * if the algorithm lands on weekly ticks but the match is 1.01, it is
71
+ * very close to monthly ticks.
72
+ */
73
+ match?: number;
66
74
  /**
67
75
  * The name of the time unit.
68
76
  */
@@ -10,8 +10,8 @@
10
10
  * */
11
11
  'use strict';
12
12
  import TimeBase from '../Shared/TimeBase.js';
13
- import U from '../Core/Utilities.js';
14
- const { defined, extend, timeUnits } = U;
13
+ import { defined, extend } from '../Shared/Utilities.js';
14
+ import { timeUnits } from './Utilities.js';
15
15
  /* *
16
16
  *
17
17
  * Constants
@@ -23,11 +23,6 @@ declare module './Series/SeriesBase' {
23
23
  tt?: SVGElement;
24
24
  }
25
25
  }
26
- declare module './Series/SeriesOptions' {
27
- interface SeriesOptions {
28
- tooltip?: Partial<TooltipOptions>;
29
- }
30
- }
31
26
  /**
32
27
  * Tooltip of a chart.
33
28
  *
@@ -65,6 +60,7 @@ declare class Tooltip {
65
60
  distance: number;
66
61
  followPointer?: boolean;
67
62
  hideTimer?: number;
63
+ showTimer?: number;
68
64
  isSticky: boolean;
69
65
  label?: SVGElement;
70
66
  len?: number;
@@ -133,7 +129,7 @@ declare class Tooltip {
133
129
  *
134
130
  * @function Highcharts.Tooltip#defaultFormatter
135
131
  *
136
- * @param {Highcharts.Tooltip} tooltip
132
+ * @param {Highcharts.Tooltip} tooltip The tooltip instance.
137
133
  *
138
134
  * @return {string|Array<string>}
139
135
  * Returns a string (single tooltip and shared)
@@ -221,7 +217,7 @@ declare class Tooltip {
221
217
  }
222
218
  declare namespace Tooltip {
223
219
  interface FormatterCallbackFunction {
224
- (this: Point, tooltip: Tooltip): (false | string | Array<string>);
220
+ (this: Point, tooltip: Tooltip, ctx?: Point): (false | string | Array<string>);
225
221
  }
226
222
  interface HeaderFormatterEventObject {
227
223
  isFooter?: boolean;
@@ -229,7 +225,7 @@ declare namespace Tooltip {
229
225
  text?: string;
230
226
  }
231
227
  interface PositionerCallbackFunction {
232
- (this: Tooltip, labelWidth: number, labelHeight: number, point: (Point | PositionerPointObject), anchor?: [number, number], alignLeft?: boolean): PositionObject;
228
+ (this: Tooltip, labelWidth: number, labelHeight: number, point: (Point | PositionerPointObject), ctx?: Tooltip, anchor?: [number, number], alignLeft?: boolean): PositionObject;
233
229
  }
234
230
  interface PositionerPointObject {
235
231
  isHeader?: boolean;
@@ -18,8 +18,16 @@ const { composed, dateFormats, doc, isSafari } = H;
18
18
  import R from './Renderer/RendererUtilities.js';
19
19
  const { distribute } = R;
20
20
  import RendererRegistry from './Renderer/RendererRegistry.js';
21
- import U from './Utilities.js';
22
- const { addEvent, clamp, css, clearTimeout, discardElement, extend, fireEvent, getAlignFactor, isArray, isNumber, isObject, isString, merge, pick, pushUnique, splat, syncTimeout } = U;
21
+ import { addEvent, clamp, css, discardElement, extend, fireEvent, getAlignFactor, internalClearTimeout, isArray, isNumber, isObject, isString, merge, pick, pushUnique, splat, syncTimeout } from '../Shared/Utilities.js';
22
+ /**
23
+ * Clear all timeouts for showing and hiding the tooltip.
24
+ *
25
+ * @internal
26
+ */
27
+ const clearTimeouts = (tooltip) => {
28
+ clearTimeout(tooltip.hideTimer);
29
+ clearTimeout(tooltip.showTimer);
30
+ };
23
31
  /* *
24
32
  *
25
33
  * Class
@@ -118,7 +126,7 @@ class Tooltip {
118
126
  return points.map((point) => {
119
127
  const tooltipOptions = point.series.tooltipOptions, formatPrefix = point.formatPrefix || 'point';
120
128
  return (tooltipOptions[formatPrefix + 'Formatter'] ||
121
- point.tooltipFormatter).call(point, tooltipOptions[formatPrefix + 'Format'] || '');
129
+ point.tooltipFormatter).call(point, tooltipOptions[formatPrefix + 'Format'] || '', point);
122
130
  });
123
131
  }
124
132
  /**
@@ -150,7 +158,7 @@ class Tooltip {
150
158
  *
151
159
  * @function Highcharts.Tooltip#defaultFormatter
152
160
  *
153
- * @param {Highcharts.Tooltip} tooltip
161
+ * @param {Highcharts.Tooltip} tooltip The tooltip instance.
154
162
  *
155
163
  * @return {string|Array<string>}
156
164
  * Returns a string (single tooltip and shared)
@@ -187,7 +195,8 @@ class Tooltip {
187
195
  this.renderer = this.renderer.destroy();
188
196
  discardElement(this.container);
189
197
  }
190
- clearTimeout(this.hideTimer);
198
+ internalClearTimeout(this.hideTimer);
199
+ clearTimeouts(this);
191
200
  }
192
201
  /**
193
202
  * Extendable method to get the anchor position of the tooltip
@@ -568,7 +577,7 @@ class Tooltip {
568
577
  hide(delay) {
569
578
  const tooltip = this;
570
579
  // Disallow duplicate timers (#1728, #1766)
571
- clearTimeout(this.hideTimer);
580
+ clearTimeouts(this);
572
581
  delay = pick(delay, this.options.hideDelay);
573
582
  if (!this.isHidden) {
574
583
  this.hideTimer = syncTimeout(function () {
@@ -727,7 +736,7 @@ class Tooltip {
727
736
  if (!options.enabled || !point.series) { // #16820
728
737
  return;
729
738
  }
730
- clearTimeout(this.hideTimer);
739
+ clearTimeouts(this);
731
740
  // A switch saying if this specific tooltip configuration allows shared
732
741
  // or split modes
733
742
  tooltip.allowShared = !(!isArray(pointOrPoints) &&
@@ -747,7 +756,7 @@ class Tooltip {
747
756
  this.len = points.length; // #6128
748
757
  const text = isString(formatString) ?
749
758
  format(formatString, point, chart) :
750
- formatter.call(point, tooltip);
759
+ formatter.call(point, tooltip, point);
751
760
  // Reset the preliminary circular references
752
761
  point.points = void 0;
753
762
  // Register the current series
@@ -758,79 +767,83 @@ class Tooltip {
758
767
  this.hide();
759
768
  }
760
769
  else {
761
- // Update text
762
- if (tooltip.split && tooltip.allowShared) { // #13868
763
- this.renderSplit(text, points);
764
- }
765
- else {
766
- let checkX = x;
767
- let checkY = y;
768
- if (mouseEvent && pointer.isDirectTouch) {
769
- checkX = mouseEvent.chartX - chart.plotLeft;
770
- checkY = mouseEvent.chartY - chart.plotTop;
770
+ this.showTimer = syncTimeout(() => {
771
+ // Update text
772
+ if (tooltip.split && tooltip.allowShared) { // #13868
773
+ tooltip.renderSplit(text, points);
771
774
  }
772
- // #11493, #13095
773
- if (chart.polar ||
774
- currentSeries.options.clip === false ||
775
- points.some((p) => // #16004
776
- pointer.isDirectTouch || // ##17929
777
- p.series.shouldShowTooltip(checkX, checkY))) {
778
- const label = tooltip.getLabel(wasShared && tooltip.tt || {});
779
- // Prevent the tooltip from flowing over the chart box
780
- // (#6659)
781
- if (!options.style.width || styledMode) {
782
- label.css({
783
- width: (this.outside ?
784
- this.getPlayingField() :
785
- chart.spacingBox).width + 'px'
786
- });
775
+ else {
776
+ let checkX = x;
777
+ let checkY = y;
778
+ if (mouseEvent && pointer.isDirectTouch) {
779
+ checkX = mouseEvent.chartX - chart.plotLeft;
780
+ checkY = mouseEvent.chartY - chart.plotTop;
787
781
  }
788
- label.attr({
789
- // Add class before the label BBox calculation (#21035)
790
- 'class': tooltip.getClassName(point),
791
- text: text && text.join ?
792
- text.join('') :
793
- text
794
- });
795
- // When the length of the label has increased, immediately
796
- // update the x position to prevent tooltip from flowing
797
- // outside the viewport during animation (#21371)
798
- if (this.outside) {
782
+ // #11493, #13095
783
+ if (chart.polar ||
784
+ currentSeries.options.clip === false ||
785
+ points.some((p) => // #16004
786
+ pointer.isDirectTouch || // ##17929
787
+ p.series.shouldShowTooltip(checkX, checkY))) {
788
+ const label = tooltip.getLabel(wasShared && tooltip.tt || {});
789
+ // Prevent the tooltip from flowing over the chart box
790
+ // (#6659)
791
+ if (!options.style.width || styledMode) {
792
+ label.css({
793
+ width: (this.outside ?
794
+ this.getPlayingField() :
795
+ chart.spacingBox).width + 'px'
796
+ });
797
+ }
799
798
  label.attr({
800
- x: clamp(label.x || 0, 0, this.getPlayingField().width -
801
- (label.width || 0) -
802
- 1)
799
+ // Add class before the label BBox calculation
800
+ // (#21035)
801
+ 'class': tooltip.getClassName(point),
802
+ text: isArray(text) ?
803
+ text.join('') :
804
+ text
803
805
  });
804
- }
805
- if (!styledMode) {
806
- label.attr({
807
- stroke: (options.borderColor ||
808
- point.color ||
809
- currentSeries.color ||
810
- "#666666" /* Palette.neutralColor60 */)
806
+ // When the length of the label has increased,
807
+ // immediately update the x position to prevent
808
+ // tooltip from flowing outside the viewport
809
+ // during animation (#21371)
810
+ if (this.outside) {
811
+ label.attr({
812
+ x: clamp(label.x || 0, 0, this.getPlayingField().width -
813
+ (label.width || 0) -
814
+ 1)
815
+ });
816
+ }
817
+ if (!styledMode) {
818
+ label.attr({
819
+ stroke: (options.borderColor ||
820
+ point.color ||
821
+ currentSeries.color ||
822
+ "#666666" /* Palette.neutralColor60 */)
823
+ });
824
+ }
825
+ tooltip.updatePosition({
826
+ plotX: x,
827
+ plotY: y,
828
+ negative: point.negative,
829
+ ttBelow: point.ttBelow,
830
+ series: currentSeries,
831
+ h: anchor[2] || 0
811
832
  });
812
833
  }
813
- tooltip.updatePosition({
814
- plotX: x,
815
- plotY: y,
816
- negative: point.negative,
817
- ttBelow: point.ttBelow,
818
- series: currentSeries,
819
- h: anchor[2] || 0
820
- });
834
+ else {
835
+ tooltip.hide();
836
+ return;
837
+ }
821
838
  }
822
- else {
823
- tooltip.hide();
824
- return;
839
+ // Show it
840
+ if (tooltip.isHidden && tooltip.label) {
841
+ tooltip.label.attr({
842
+ opacity: 1
843
+ }).show();
825
844
  }
826
- }
827
- // Show it
828
- if (tooltip.isHidden && tooltip.label) {
829
- tooltip.label.attr({
830
- opacity: 1
831
- }).show();
832
- }
833
- tooltip.isHidden = false;
845
+ tooltip.isHidden = false;
846
+ }, tooltip.isHidden ? options.showDelay || 0 : 0);
834
847
  }
835
848
  fireEvent(this, 'refresh');
836
849
  }
@@ -905,7 +918,7 @@ class Tooltip {
905
918
  * Calculate the position of the partial tooltip
906
919
  * @internal
907
920
  */
908
- const defaultPositioner = function (boxWidth, boxHeight, point, anchor = [0, 0], alignedLeft = true) {
921
+ const defaultPositioner = function (boxWidth, boxHeight, point, ctx, anchor = [0, 0], alignedLeft = true) {
909
922
  let x, y;
910
923
  if (point.isHeader) {
911
924
  y = headerTop ? 0 : adjustedPlotHeight;
@@ -1005,7 +1018,7 @@ class Tooltip {
1005
1018
  }
1006
1019
  const { anchorX, anchorY } = getAnchor(point);
1007
1020
  if (typeof anchorY === 'number') {
1008
- const size = bBox.height + 1, boxPosition = (positioner || defaultPositioner).call(tooltip, boxWidth, size, point, [anchorX, anchorY]);
1021
+ const size = bBox.height + 1, boxPosition = (positioner || defaultPositioner).call(tooltip, boxWidth, size, point, tooltip, [anchorX, anchorY]);
1009
1022
  boxes.push({
1010
1023
  // 0-align to the top, 1-align to the bottom
1011
1024
  align: hasFixedPosition ? 0 : void 0,
@@ -1043,7 +1056,7 @@ class Tooltip {
1043
1056
  bounds.right - boxStart > boxStart;
1044
1057
  })) {
1045
1058
  boxes = boxes.map((box) => {
1046
- const { x, y } = defaultPositioner.call(this, box.boxWidth, box.size, box.point, [box.anchorX, box.anchorY], false);
1059
+ const { x, y } = defaultPositioner.call(this, box.boxWidth, box.size, box.point, void 0, [box.anchorX, box.anchorY], false);
1047
1060
  return extend(box, {
1048
1061
  target: y,
1049
1062
  x
@@ -1180,9 +1193,7 @@ class Tooltip {
1180
1193
  .add(label);
1181
1194
  // For a rapid move going outside of the elements keeping the
1182
1195
  // tooltip visible, cancel the hide (#23512).
1183
- addEvent(tooltip.tracker.element, 'mouseenter', () => {
1184
- clearTimeout(tooltip.hideTimer);
1185
- });
1196
+ addEvent(tooltip.tracker.element, 'mouseenter', () => clearTimeouts(tooltip));
1186
1197
  if (!chart.styledMode) {
1187
1198
  tooltip.tracker.attr({
1188
1199
  fill: 'rgba(0,0,0,0)'
@@ -1254,14 +1265,14 @@ class Tooltip {
1254
1265
  * @internal
1255
1266
  * @function Highcharts.Tooltip#updatePosition
1256
1267
  *
1257
- * @param {Highcharts.Point} point
1268
+ * @param {Highcharts.Point} point The point object.
1258
1269
  */
1259
1270
  updatePosition(point) {
1260
1271
  const { chart, container, distance, options, pointer, renderer } = this, label = this.getLabel(), { height = 0, width = 0 } = label, { fixed, positioner } = options,
1261
1272
  // Needed for outside: true (#11688)
1262
1273
  { left, top, scaleX, scaleY } = pointer.getChartPosition(), pos = (positioner ||
1263
1274
  (fixed && this.getFixedPosition) ||
1264
- this.getPosition).call(this, width, height, point), doc = H.doc;
1275
+ this.getPosition).call(this, width, height, point, this), doc = H.doc;
1265
1276
  let anchorX = (point.plotX || 0) + chart.plotLeft, anchorY = (point.plotY || 0) + chart.plotTop, pad;
1266
1277
  // Set the renderer size dynamically to prevent document size to change.
1267
1278
  // Renderer only exists when tooltip is outside.
@@ -1360,6 +1371,10 @@ export default Tooltip;
1360
1371
  * @param {Highcharts.Tooltip} tooltip
1361
1372
  * The tooltip instance
1362
1373
  *
1374
+ * @param {Highcharts.Point} [ctx]
1375
+ * Since v12.5.0, the point context passed as an extra argument for arrow
1376
+ * functions.
1377
+ *
1363
1378
  * @return {false|string|Array<(string|null|undefined)>|null|undefined}
1364
1379
  * Formatted text or false
1365
1380
  */
@@ -1380,6 +1395,10 @@ export default Tooltip;
1380
1395
  * @param {Highcharts.TooltipPositionerPointObject} point
1381
1396
  * Point information for positioning a tooltip.
1382
1397
  *
1398
+ * @param {Highcharts.Tooltip} [ctx]
1399
+ * Since v12.5.0, the tooltip context passed as an extra argument for arrow
1400
+ * functions.
1401
+ *
1383
1402
  * @return {Highcharts.PositionObject}
1384
1403
  * New position for the tooltip.
1385
1404
  */
@@ -14,9 +14,42 @@ declare module './Options' {
14
14
  }
15
15
  declare module './Series/SeriesOptions' {
16
16
  interface SeriesOptions {
17
- tooltip?: Partial<TooltipOptions>;
17
+ /**
18
+ * A configuration object for the tooltip rendering of each single
19
+ * series. Properties are inherited from [tooltip](#tooltip), but only
20
+ * the following properties can be defined on a series level.
21
+ *
22
+ * @since 2.3
23
+ */
24
+ tooltip?: SeriesTooltipOptions;
18
25
  }
19
26
  }
27
+ export interface SeriesTooltipOptions extends Partial<TooltipOptions> {
28
+ animation?: undefined;
29
+ backgroundColor?: undefined;
30
+ borderColor?: undefined;
31
+ borderRadius?: undefined;
32
+ borderWidth?: undefined;
33
+ className?: undefined;
34
+ crosshairs?: undefined;
35
+ enabled?: undefined;
36
+ fixed?: undefined;
37
+ formatter?: undefined;
38
+ headerShape?: undefined;
39
+ hideDelay?: undefined;
40
+ outside?: undefined;
41
+ padding?: undefined;
42
+ positioner?: undefined;
43
+ shadow?: undefined;
44
+ shape?: undefined;
45
+ shared?: undefined;
46
+ showDelay?: number;
47
+ snap?: undefined;
48
+ split?: undefined;
49
+ stickOnContact?: undefined;
50
+ style?: undefined;
51
+ useHTML?: undefined;
52
+ }
20
53
  /**
21
54
  * Options for the tooltip that appears when the user hovers over a
22
55
  * series or point.
@@ -532,6 +565,16 @@ export interface TooltipOptions {
532
565
  * @product highcharts highstock
533
566
  */
534
567
  shared: boolean;
568
+ /**
569
+ * The number of milliseconds to wait until the crosshair is shown when
570
+ * mouse over a point. Works on initial hover.
571
+ *
572
+ * @sample {highcharts|highstock} highcharts/tooltip/showdelay/
573
+ *
574
+ * @default 0
575
+ * @since next
576
+ */
577
+ showDelay?: number;
535
578
  /**
536
579
  * Proximity snap for graphs or single points. It defaults to 10 for
537
580
  * mouse-powered devices and 25 for touch devices.