@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
@@ -0,0 +1,229 @@
1
+ /* *
2
+ *
3
+ * Grid Responsive composition
4
+ *
5
+ * (c) 2020-2026 Highsoft AS
6
+ *
7
+ * A commercial license may be required depending on use.
8
+ * See www.highcharts.com/license
9
+ *
10
+ *
11
+ * Authors:
12
+ * - Dawid Dragula
13
+ *
14
+ * */
15
+ 'use strict';
16
+ import Globals from '../../Core/Globals.js';
17
+ import { addEvent, defined, diffObjects, merge, pushUnique } from '../../../Shared/Utilities.js';
18
+ import { uniqueKey } from '../../../Core/Utilities.js';
19
+ /* *
20
+ *
21
+ * Composition
22
+ *
23
+ * */
24
+ /**
25
+ * Extends the grid classes with responsive options.
26
+ *
27
+ * @param GridClass
28
+ * The class to extend.
29
+ *
30
+ */
31
+ export function compose(GridClass) {
32
+ if (!pushUnique(Globals.composed, 'Responsive')) {
33
+ return;
34
+ }
35
+ addEvent(GridClass, 'beforeRenderViewport', initResizeObserver);
36
+ addEvent(GridClass, 'beforeDestroy', destroyResizeObserver);
37
+ }
38
+ /**
39
+ * Initializes the resize observer.
40
+ *
41
+ * @param this
42
+ * Reference to Grid.
43
+ */
44
+ function initResizeObserver() {
45
+ destroyResizeObserver.call(this);
46
+ if (!this.container) {
47
+ return;
48
+ }
49
+ this.activeRules = new Set();
50
+ this.resizeObserver = new ResizeObserver((entries) => {
51
+ onResize.call(this, entries[0]);
52
+ });
53
+ this.resizeObserver.observe(this.container);
54
+ }
55
+ /**
56
+ * Destroys the resize observer.
57
+ *
58
+ * @param this
59
+ * Reference to Grid.
60
+ */
61
+ function destroyResizeObserver() {
62
+ this.resizeObserver?.disconnect();
63
+ delete this.activeRules;
64
+ }
65
+ /**
66
+ * Checks if the responsive rule matches the current grid size.
67
+ *
68
+ * @param this
69
+ * Reference to Grid.
70
+ *
71
+ * @param rule
72
+ * The responsive rule to check.
73
+ *
74
+ * @param entry
75
+ * The resize observer entry.
76
+ */
77
+ function matchResponsiveRule(rule, entry) {
78
+ const { maxWidth, maxHeight, minWidth, minHeight, callback } = rule.condition;
79
+ return ((!defined(callback) || callback?.call(this, this)) &&
80
+ (!defined(maxWidth) || entry.contentRect.width <= maxWidth) &&
81
+ (!defined(maxHeight) || entry.contentRect.height <= maxHeight) &&
82
+ (!defined(minWidth) || entry.contentRect.width >= minWidth) &&
83
+ (!defined(minHeight) || entry.contentRect.height >= minHeight));
84
+ }
85
+ /**
86
+ * Updates the grid based on the currently active responsive rules.
87
+ *
88
+ * @param this
89
+ * Reference to Grid.
90
+ *
91
+ * @param matchingRules
92
+ * Active responsive rules.
93
+ */
94
+ function setResponsive(matchingRules) {
95
+ const ruleIds = matchingRules.map((rule) => rule._id);
96
+ const ruleIdsString = (ruleIds.toString() || void 0);
97
+ const currentRuleIds = this.currentResponsive?.ruleIds;
98
+ if (ruleIdsString === currentRuleIds) {
99
+ return;
100
+ }
101
+ if (this.currentResponsive) {
102
+ const undoOptions = this.currentResponsive.undoOptions;
103
+ this.currentResponsive = void 0;
104
+ this.updatingResponsive = true;
105
+ void this.update(undoOptions, true);
106
+ this.updatingResponsive = false;
107
+ }
108
+ if (ruleIdsString) {
109
+ const mergedOptions = merge(...matchingRules.map((rule) => rule.gridOptions));
110
+ const undoOptions = diffObjects(mergedOptions, this.options || {}, true);
111
+ const columnUndoOptions = getColumnUndoOptions.call(this, mergedOptions);
112
+ if (columnUndoOptions) {
113
+ undoOptions.columns = columnUndoOptions;
114
+ }
115
+ else {
116
+ syncColumnIds(undoOptions, mergedOptions);
117
+ }
118
+ this.currentResponsive = {
119
+ ruleIds: ruleIdsString,
120
+ mergedOptions,
121
+ undoOptions
122
+ };
123
+ if (!this.updatingResponsive) {
124
+ void this.update(mergedOptions, true);
125
+ }
126
+ }
127
+ }
128
+ /**
129
+ * Builds undo options for columns by matching them by id.
130
+ *
131
+ * @param this
132
+ * Reference to Grid.
133
+ *
134
+ * @param mergedOptions
135
+ * The merged responsive options used to apply updates.
136
+ */
137
+ function getColumnUndoOptions(mergedOptions) {
138
+ const mergedColumns = mergedOptions.columns;
139
+ const currentColumns = this.options?.columns;
140
+ if (!mergedColumns || !currentColumns) {
141
+ return;
142
+ }
143
+ const result = [];
144
+ const columnMap = new Map();
145
+ for (let i = 0, iEnd = currentColumns.length; i < iEnd; ++i) {
146
+ const column = currentColumns[i];
147
+ if (typeof column.id === 'string') {
148
+ columnMap.set(column.id, column);
149
+ }
150
+ }
151
+ for (let i = 0, iEnd = mergedColumns.length; i < iEnd; ++i) {
152
+ const mergedColumn = mergedColumns[i];
153
+ const columnId = (typeof mergedColumn?.id === 'string') ?
154
+ mergedColumn.id :
155
+ void 0;
156
+ if (!mergedColumn || !columnId) {
157
+ continue;
158
+ }
159
+ const currentColumn = columnMap.get(columnId);
160
+ if (!currentColumn) {
161
+ continue;
162
+ }
163
+ const columnUndo = diffObjects(mergedColumn, currentColumn, true);
164
+ if (Object.keys(columnUndo).length > 0) {
165
+ columnUndo.id = columnId;
166
+ result.push(columnUndo);
167
+ }
168
+ }
169
+ if (result.length) {
170
+ return result;
171
+ }
172
+ }
173
+ /**
174
+ * Ensures column options keep their ids when undoing responsive updates.
175
+ *
176
+ * @param undoOptions
177
+ * The undo options to be updated.
178
+ *
179
+ * @param mergedOptions
180
+ * The merged responsive options used to apply updates.
181
+ */
182
+ function syncColumnIds(undoOptions, mergedOptions) {
183
+ const mergedColumns = mergedOptions.columns;
184
+ const undoColumns = undoOptions.columns;
185
+ if (!mergedColumns || !undoColumns) {
186
+ return;
187
+ }
188
+ for (let i = 0, iEnd = Math.min(mergedColumns.length, undoColumns.length); i < iEnd; ++i) {
189
+ const mergedColumn = mergedColumns[i];
190
+ const undoColumn = undoColumns[i];
191
+ if (mergedColumn && undoColumn && !('id' in undoColumn)) {
192
+ undoColumn.id = mergedColumn.id;
193
+ }
194
+ }
195
+ }
196
+ /**
197
+ * Handles the resize event.
198
+ *
199
+ * @param this
200
+ * Reference to Grid.
201
+ *
202
+ * @param entry
203
+ * The resize observer entry.
204
+ */
205
+ function onResize(entry) {
206
+ if (!this.activeRules) {
207
+ return;
208
+ }
209
+ const rules = this.options?.responsive?.rules || [];
210
+ const matchingRules = [];
211
+ for (const rule of rules) {
212
+ if (typeof rule._id === 'undefined') {
213
+ rule._id = uniqueKey();
214
+ }
215
+ if (matchResponsiveRule.call(this, rule, entry)) {
216
+ matchingRules.push(rule);
217
+ }
218
+ }
219
+ this.activeRules = new Set(matchingRules);
220
+ setResponsive.call(this, matchingRules);
221
+ }
222
+ /* *
223
+ *
224
+ * Default Export
225
+ *
226
+ * */
227
+ export default {
228
+ compose
229
+ };
@@ -0,0 +1,58 @@
1
+ import type { DeepPartial } from '../../../Shared/Types';
2
+ import type { Options } from '../Options';
3
+ import type Grid from '../Grid';
4
+ /**
5
+ * Options for the responsive behavior of the grid.
6
+ */
7
+ export interface ResponsiveOptions {
8
+ /**
9
+ * A set of rules for responsive settings. The rules are executed from
10
+ * the top down.
11
+ */
12
+ rules?: Array<RuleOptions>;
13
+ }
14
+ /**
15
+ * A rule for the responsive behavior of the grid.
16
+ */
17
+ export interface RuleOptions {
18
+ /**
19
+ * A full set of grid options to apply as overrides to the general grid
20
+ * options. The grid options are applied when the given rule is active.
21
+ */
22
+ gridOptions: DeepPartial<Exclude<Options, 'responsive' | 'id'>>;
23
+ /**
24
+ * Under which conditions the rule applies.
25
+ */
26
+ condition: RuleConditionOptions;
27
+ }
28
+ /**
29
+ * Conditions for the responsive rule.
30
+ */
31
+ export interface RuleConditionOptions {
32
+ /**
33
+ * A callback function to gain complete control on when the responsive
34
+ * rule applies. Return `true` if it applies. This opens for checking
35
+ * against other metrics than the grid size, for example the document
36
+ * size or other elements.
37
+ */
38
+ callback?: (this: Grid, grid: Grid) => boolean;
39
+ /**
40
+ * The responsive rule applies if the grid width is less or equal to this.
41
+ */
42
+ maxWidth?: number;
43
+ /**
44
+ * The responsive rule applies if the grid height is less or equal to this.
45
+ */
46
+ maxHeight?: number;
47
+ /**
48
+ * The responsive rule applies if the grid width is greater or equal to
49
+ * this.
50
+ */
51
+ minWidth?: number;
52
+ /**
53
+ * The responsive rule applies if the grid height is greater or equal to
54
+ * this.
55
+ */
56
+ minHeight?: number;
57
+ }
58
+ export default ResponsiveOptions;
@@ -0,0 +1,15 @@
1
+ /* *
2
+ *
3
+ * Grid responsive options
4
+ *
5
+ * (c) 2020-2026 Highsoft AS
6
+ *
7
+ * A commercial license may be required depending on use.
8
+ * See www.highcharts.com/license
9
+ *
10
+ *
11
+ * Authors:
12
+ * - Dawid Dragula
13
+ *
14
+ * */
15
+ export {};
@@ -15,11 +15,10 @@
15
15
  *
16
16
  * */
17
17
  'use strict';
18
- import U from '../../../../../Core/Utilities.js';
19
18
  import GU from '../../../GridUtils.js';
20
19
  import Globals from '../../../Globals.js';
21
20
  import { conditionsMap } from './FilteringTypes.js';
22
- const { defined, fireEvent } = U;
21
+ import { defined, fireEvent } from '../../../../../Shared/Utilities.js';
23
22
  const { makeHTMLElement } = GU;
24
23
  /* *
25
24
  *
@@ -328,7 +327,7 @@ class ColumnFiltering {
328
327
  renderClearButton(inputWrapper) {
329
328
  this.clearButton = makeHTMLElement('button', {
330
329
  className: Globals.getClassName('clearFilterButton'),
331
- innerText: 'Clear filter' // TODO: Lang
330
+ innerText: 'Clear filter' // TODO(lang): Lang
332
331
  }, inputWrapper);
333
332
  this.clearButton.setAttribute('tabindex', '-1');
334
333
  this.clearButton.disabled = !this.isFilteringApplied();
@@ -7,7 +7,7 @@ import HeaderCell from '../../Header/HeaderCell.js';
7
7
  declare class FilterCell extends HeaderCell {
8
8
  column: Column;
9
9
  constructor(row: Row, column: Column);
10
- render(): void;
10
+ render(): Promise<void>;
11
11
  onKeyDown(e: KeyboardEvent): void;
12
12
  onClick(e: MouseEvent): void;
13
13
  }
@@ -14,8 +14,7 @@
14
14
  * */
15
15
  'use strict';
16
16
  import HeaderCell from '../../Header/HeaderCell.js';
17
- import U from '../../../../../Core/Utilities.js';
18
- const { fireEvent } = U;
17
+ import { fireEvent } from '../../../../../Shared/Utilities.js';
19
18
  /* *
20
19
  *
21
20
  * Class
@@ -40,10 +39,10 @@ class FilterCell extends HeaderCell {
40
39
  * Methods
41
40
  *
42
41
  * */
43
- render() {
42
+ async render() {
44
43
  const { column } = this;
45
44
  if (!column) {
46
- return;
45
+ return Promise.resolve();
47
46
  }
48
47
  // Render content of th element
49
48
  this.row.htmlElement.appendChild(this.htmlElement);
@@ -14,6 +14,6 @@ declare class FilterRow extends HeaderRow {
14
14
  */
15
15
  constructor(viewport: Table);
16
16
  createCell(column: Column): FilterCell;
17
- renderContent(): void;
17
+ renderContent(): Promise<void>;
18
18
  }
19
19
  export default FilterRow;
@@ -48,7 +48,7 @@ class FilterRow extends HeaderRow {
48
48
  createCell(column) {
49
49
  return new FilterCell(this, column);
50
50
  }
51
- renderContent() {
51
+ async renderContent() {
52
52
  const vp = this.viewport;
53
53
  const enabledColumns = vp.grid.enabledColumns || [];
54
54
  vp.theadElement?.appendChild(this.htmlElement);
@@ -59,7 +59,7 @@ class FilterRow extends HeaderRow {
59
59
  continue;
60
60
  }
61
61
  const cell = this.createCell(column);
62
- cell.render();
62
+ await cell.render();
63
63
  if (column.options.filtering?.inline) {
64
64
  column.filtering?.renderFilteringContent(cell.htmlElement);
65
65
  }
@@ -12,6 +12,10 @@ declare class ColumnSorting {
12
12
  * The head element of the column.
13
13
  */
14
14
  headerCellElement: HTMLElement;
15
+ /**
16
+ * Last index used from the configured order sequence.
17
+ */
18
+ private lastOrderSequenceIndex?;
15
19
  /**
16
20
  * Constructs sorting for a dedicated column.
17
21
  *
@@ -37,6 +41,17 @@ declare class ColumnSorting {
37
41
  * The column to update.
38
42
  */
39
43
  private updateColumnOptions;
44
+ /**
45
+ * Returns sorting order sequence for this column.
46
+ */
47
+ private getOrderSequence;
48
+ /**
49
+ * Normalizes arbitrary sorting values to valid order states.
50
+ *
51
+ * @param order
52
+ * Value to normalize.
53
+ */
54
+ private normalizeOrder;
40
55
  /**
41
56
  * Set sorting order for the column. It will modify the presentation data
42
57
  * and rerender the rows.
@@ -50,7 +65,8 @@ declare class ColumnSorting {
50
65
  */
51
66
  setOrder(order: ColumnSortingOrder, additive?: boolean): Promise<void>;
52
67
  /**
53
- * Toggle sorting order for the column in the order: asc -> desc -> none
68
+ * Toggle sorting order for the column according to the configured
69
+ * sorting order sequence.
54
70
  *
55
71
  * @param e
56
72
  * Optional mouse or keyboard event.
@@ -15,8 +15,7 @@
15
15
  * */
16
16
  'use strict';
17
17
  import Globals from '../../Globals.js';
18
- import U from '../../../../Core/Utilities.js';
19
- const { fireEvent } = U;
18
+ import { fireEvent } from '../../../../Shared/Utilities.js';
20
19
  /* *
21
20
  *
22
21
  * Class
@@ -42,7 +41,8 @@ class ColumnSorting {
42
41
  */
43
42
  constructor(column, headerCellElement) {
44
43
  /**
45
- * Toggle sorting order for the column in the order: asc -> desc -> none
44
+ * Toggle sorting order for the column according to the configured
45
+ * sorting order sequence.
46
46
  *
47
47
  * @param e
48
48
  * Optional mouse or keyboard event.
@@ -52,18 +52,40 @@ class ColumnSorting {
52
52
  const querying = viewport.grid.querying;
53
53
  const sortingController = querying.sorting;
54
54
  const additive = !!e?.shiftKey;
55
- const currentOrder = (additive ?
56
- sortingController.currentSortings?.find((sorting) => sorting.columnId === this.column.id)?.order :
57
- (sortingController.currentSorting?.columnId ===
58
- this.column.id ?
59
- sortingController.currentSorting.order :
60
- null)) || 'none';
61
- const consequents = {
62
- none: 'asc',
63
- asc: 'desc',
64
- desc: null
65
- };
66
- void this.setOrder(consequents[currentOrder], additive);
55
+ let hasCurrentColumnSorting = false;
56
+ const currentOrder = (() => {
57
+ if (additive) {
58
+ const currentSorting = sortingController.currentSortings?.find((sorting) => sorting.columnId === this.column.id);
59
+ hasCurrentColumnSorting = !!currentSorting;
60
+ return this.normalizeOrder(currentSorting?.order);
61
+ }
62
+ const currentSorting = sortingController.currentSorting;
63
+ hasCurrentColumnSorting =
64
+ currentSorting?.columnId === this.column.id;
65
+ return hasCurrentColumnSorting ?
66
+ this.normalizeOrder(currentSorting?.order) :
67
+ null;
68
+ })();
69
+ const orderSequence = this.getOrderSequence();
70
+ if (orderSequence.length < 1) {
71
+ return;
72
+ }
73
+ let nextOrderIndex = 0;
74
+ const lastIndex = this.lastOrderSequenceIndex;
75
+ if (hasCurrentColumnSorting &&
76
+ typeof lastIndex === 'number' &&
77
+ orderSequence[lastIndex] === currentOrder) {
78
+ nextOrderIndex = (lastIndex + 1) % orderSequence.length;
79
+ }
80
+ else {
81
+ const currentOrderIndex = orderSequence.indexOf(currentOrder);
82
+ nextOrderIndex = (currentOrderIndex === -1 ?
83
+ 0 :
84
+ (currentOrderIndex + 1) % orderSequence.length);
85
+ }
86
+ this.lastOrderSequenceIndex = nextOrderIndex;
87
+ const nextOrder = orderSequence[nextOrderIndex];
88
+ void this.setOrder(nextOrder, additive);
67
89
  };
68
90
  this.column = column;
69
91
  this.headerCellElement = headerCellElement;
@@ -155,6 +177,27 @@ class ColumnSorting {
155
177
  }
156
178
  }
157
179
  }
180
+ /**
181
+ * Returns sorting order sequence for this column.
182
+ */
183
+ getOrderSequence() {
184
+ return this.column.options.sorting?.orderSequence || [
185
+ 'asc',
186
+ 'desc',
187
+ null
188
+ ];
189
+ }
190
+ /**
191
+ * Normalizes arbitrary sorting values to valid order states.
192
+ *
193
+ * @param order
194
+ * Value to normalize.
195
+ */
196
+ normalizeOrder(order) {
197
+ return order === 'asc' || order === 'desc' ?
198
+ order :
199
+ null;
200
+ }
158
201
  /**
159
202
  * Set sorting order for the column. It will modify the presentation data
160
203
  * and rerender the rows.
@@ -16,9 +16,8 @@
16
16
  'use strict';
17
17
  import GridUtils from '../../GridUtils.js';
18
18
  import Globals from '../../Globals.js';
19
- import Utils from '../../../../Core/Utilities.js';
19
+ import { fireEvent } from '../../../../Shared/Utilities.js';
20
20
  const { makeHTMLElement } = GridUtils;
21
- const { fireEvent } = Utils;
22
21
  /* *
23
22
  *
24
23
  * Class
@@ -58,7 +57,6 @@ class ColumnsResizer {
58
57
  const vp = this.viewport;
59
58
  vp.columnResizing.resize(this, diff);
60
59
  vp.reflow();
61
- vp.rowsVirtualizer.adjustRowHeights();
62
60
  fireEvent(this.draggedColumn, 'afterResize', {
63
61
  target: this.draggedColumn,
64
62
  originalEvent: e
@@ -7,7 +7,7 @@ declare class RowsVirtualizer {
7
7
  /**
8
8
  * The default height of a row.
9
9
  */
10
- readonly defaultRowHeight: number;
10
+ defaultRowHeight: number;
11
11
  /**
12
12
  * The index of the first visible row.
13
13
  */
@@ -35,6 +35,34 @@ declare class RowsVirtualizer {
35
35
  * Rendering row settings.
36
36
  */
37
37
  rowSettings?: RowsSettings;
38
+ /**
39
+ * Cached max element height in CSS pixels.
40
+ */
41
+ private static maxElementHeight?;
42
+ /**
43
+ * The maximum height of a HTML element in most browsers.
44
+ * Firefox has a lower limit than other browsers.
45
+ */
46
+ private static getMaxElementHeight;
47
+ /**
48
+ * The maximum height of the scrollable element in CSS pixels.
49
+ */
50
+ private maxElementHeight;
51
+ /**
52
+ * The total height of the grid, used when the Grid height
53
+ * exceeds the max element height.
54
+ */
55
+ private totalGridHeight;
56
+ /**
57
+ * The overflow height of the grid, used when the Grid height
58
+ * exceeds the max element height.
59
+ */
60
+ private gridHeightOverflow;
61
+ /**
62
+ * The scroll offset in pixels used to adjust the row positions when
63
+ * the Grid height exceeds the max element height.
64
+ */
65
+ private scrollOffset;
38
66
  /**
39
67
  * Reuse pool for rows that are currently out of viewport.
40
68
  */
@@ -48,6 +76,16 @@ declare class RowsVirtualizer {
48
76
  * frame.
49
77
  */
50
78
  private scrollQueued;
79
+ /**
80
+ * Flag indicating if rows are currently being rendered to prevent
81
+ * concurrent render operations.
82
+ */
83
+ private isRendering;
84
+ /**
85
+ * Pending row cursor to render after current render completes.
86
+ * Used to ensure the final scroll position is rendered.
87
+ */
88
+ private pendingRowCursor;
51
89
  /**
52
90
  * Constructs an instance of the rows virtualizer.
53
91
  *
@@ -58,12 +96,17 @@ declare class RowsVirtualizer {
58
96
  /**
59
97
  * Renders the rows in the viewport for the first time.
60
98
  */
61
- initialRender(): void;
99
+ initialRender(): Promise<void>;
62
100
  /**
63
101
  * Renders the rows in the viewport. It is called when the rows need to be
64
102
  * re-rendered, e.g., after a sort or filter operation.
65
103
  */
66
- rerender(): void;
104
+ rerender(): Promise<void>;
105
+ /**
106
+ * Refreshes the rendered rows without a full teardown.
107
+ * It updates the row range and reuses existing rows when possible.
108
+ */
109
+ refreshRows(): Promise<void>;
67
110
  /**
68
111
  * Method called on the viewport scroll event, only when the virtualization
69
112
  * is enabled.
@@ -120,5 +163,16 @@ declare class RowsVirtualizer {
120
163
  * The default height of a row.
121
164
  */
122
165
  private getDefaultRowHeight;
166
+ /**
167
+ * Updates cached row count and derived grid height metrics used for
168
+ * overflow-aware scrolling.
169
+ */
170
+ private updateGridMetrics;
171
+ /**
172
+ * Updates row translate offsets based on scroll scaling. When the grid
173
+ * exceeds the max element height, it keeps the bottom rows aligned to the
174
+ * maximum scrollable height.
175
+ */
176
+ private adjustRowOffsets;
123
177
  }
124
178
  export default RowsVirtualizer;