@highcharts/grid-pro 2.1.1 → 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 (455) hide show
  1. package/LICENSE.txt +6 -0
  2. package/README.md +15 -9
  3. package/css/grid-pro.css +1289 -1153
  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 +4 -5
  17. package/es-modules/Accessibility/Accessibility.js +5 -5
  18. package/es-modules/Accessibility/AccessibilityComponent.d.ts +3 -3
  19. package/es-modules/Accessibility/AccessibilityComponent.js +4 -3
  20. package/es-modules/Accessibility/Components/AnnotationsA11y.js +4 -3
  21. package/es-modules/Accessibility/Components/ContainerComponent.js +4 -3
  22. package/es-modules/Accessibility/Components/InfoRegionsComponent.js +9 -9
  23. package/es-modules/Accessibility/Components/LegendComponent.js +5 -5
  24. package/es-modules/Accessibility/Components/MenuComponent.js +5 -5
  25. package/es-modules/Accessibility/Components/NavigatorComponent.js +6 -7
  26. package/es-modules/Accessibility/Components/RangeSelectorComponent.js +5 -5
  27. package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +15 -5
  28. package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +7 -7
  29. package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +4 -3
  30. package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +7 -7
  31. package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +5 -5
  32. package/es-modules/Accessibility/Components/ZoomComponent.js +5 -5
  33. package/es-modules/Accessibility/FocusBorder.js +5 -5
  34. package/es-modules/Accessibility/HighContrastMode.js +4 -3
  35. package/es-modules/Accessibility/HighContrastTheme.js +4 -3
  36. package/es-modules/Accessibility/KeyboardNavigation.js +5 -5
  37. package/es-modules/Accessibility/KeyboardNavigationHandler.js +5 -5
  38. package/es-modules/Accessibility/Options/A11yDefaults.d.ts +11 -0
  39. package/es-modules/Accessibility/Options/A11yDefaults.js +15 -3
  40. package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +58 -0
  41. package/es-modules/Accessibility/Options/DeprecatedOptions.js +11 -5
  42. package/es-modules/Accessibility/Options/LangDefaults.js +13 -3
  43. package/es-modules/Accessibility/ProxyElement.js +6 -8
  44. package/es-modules/Accessibility/ProxyProvider.js +5 -5
  45. package/es-modules/Accessibility/Utils/Announcer.js +6 -6
  46. package/es-modules/Accessibility/Utils/ChartUtilities.js +5 -5
  47. package/es-modules/Accessibility/Utils/DOMElementProvider.js +4 -3
  48. package/es-modules/Accessibility/Utils/EventProvider.d.ts +3 -3
  49. package/es-modules/Accessibility/Utils/EventProvider.js +10 -5
  50. package/es-modules/Accessibility/Utils/HTMLUtilities.js +5 -5
  51. package/es-modules/Core/Animation/AnimationOptions.d.ts +42 -0
  52. package/es-modules/Core/Animation/AnimationOptions.js +10 -0
  53. package/es-modules/Core/Animation/AnimationUtilities.js +40 -5
  54. package/es-modules/Core/Animation/Fx.d.ts +1 -130
  55. package/es-modules/Core/Animation/Fx.js +14 -8
  56. package/es-modules/Core/Animation/FxBase.d.ts +1 -0
  57. package/es-modules/Core/Animation/FxBase.js +11 -0
  58. package/es-modules/Core/Callback.d.ts +56 -0
  59. package/es-modules/Core/Callback.js +10 -0
  60. package/es-modules/Core/Chart/Chart.d.ts +659 -400
  61. package/es-modules/Core/Chart/Chart.js +112 -95
  62. package/es-modules/Core/Chart/Chart3D.d.ts +123 -233
  63. package/es-modules/Core/Chart/Chart3D.js +23 -37
  64. package/es-modules/Core/Chart/ChartBase.d.ts +3 -0
  65. package/es-modules/Core/Chart/ChartBase.js +11 -0
  66. package/es-modules/Core/Chart/ChartDefaults.js +18 -12
  67. package/es-modules/Core/Chart/ChartNavigationComposition.d.ts +1 -55
  68. package/es-modules/Core/Chart/ChartNavigationComposition.js +13 -13
  69. package/es-modules/Core/Chart/ChartOptions.d.ts +1225 -0
  70. package/es-modules/Core/Chart/ChartOptions.js +10 -0
  71. package/es-modules/Core/Chart/GanttChart.d.ts +0 -38
  72. package/es-modules/Core/Chart/GanttChart.js +5 -5
  73. package/es-modules/Core/Chart/MapChart.d.ts +9 -4
  74. package/es-modules/Core/Chart/MapChart.js +14 -5
  75. package/es-modules/Core/Chart/StockChart.d.ts +0 -85
  76. package/es-modules/Core/Chart/StockChart.js +35 -18
  77. package/es-modules/Core/Color/Color.d.ts +16 -24
  78. package/es-modules/Core/Color/Color.js +27 -10
  79. package/es-modules/Core/Color/ColorString.d.ts +0 -23
  80. package/es-modules/Core/Color/ColorString.js +11 -0
  81. package/es-modules/Core/Color/ColorType.d.ts +0 -33
  82. package/es-modules/Core/Color/ColorType.js +11 -0
  83. package/es-modules/Core/Color/GradientColor.d.ts +0 -33
  84. package/es-modules/Core/Color/GradientColor.js +11 -0
  85. package/es-modules/Core/Color/Palettes.d.ts +1 -84
  86. package/es-modules/Core/Color/Palettes.js +2 -1
  87. package/es-modules/Core/Defaults.d.ts +6 -0
  88. package/es-modules/Core/Defaults.js +66 -75
  89. package/es-modules/Core/Delaunay.d.ts +52 -0
  90. package/es-modules/Core/Delaunay.js +310 -0
  91. package/es-modules/Core/Foundation.d.ts +1 -19
  92. package/es-modules/Core/Foundation.js +8 -6
  93. package/es-modules/Core/Geometry/CircleObject.d.ts +5 -0
  94. package/es-modules/Core/Geometry/CircleObject.js +10 -0
  95. package/es-modules/Core/Geometry/CircleUtilities.d.ts +1 -189
  96. package/es-modules/Core/Geometry/CircleUtilities.js +18 -17
  97. package/es-modules/Core/Geometry/GeometryObject.d.ts +7 -0
  98. package/es-modules/Core/Geometry/GeometryObject.js +10 -0
  99. package/es-modules/Core/Geometry/GeometryUtilities.d.ts +1 -48
  100. package/es-modules/Core/Geometry/GeometryUtilities.js +9 -7
  101. package/es-modules/Core/Geometry/IntersectionObject.d.ts +7 -0
  102. package/es-modules/Core/Geometry/IntersectionObject.js +10 -0
  103. package/es-modules/Core/Geometry/PolygonClip.d.ts +1 -19
  104. package/es-modules/Core/Geometry/PolygonClip.js +9 -7
  105. package/es-modules/Core/Globals.d.ts +9 -31
  106. package/es-modules/Core/Globals.js +9 -10
  107. package/es-modules/Core/GlobalsBase.d.ts +35 -0
  108. package/es-modules/Core/GlobalsBase.js +11 -0
  109. package/es-modules/Core/HttpUtilities.d.ts +54 -17
  110. package/es-modules/Core/HttpUtilities.js +16 -16
  111. package/es-modules/Core/JSON.d.ts +29 -0
  112. package/es-modules/Core/JSON.js +13 -0
  113. package/es-modules/Core/KeyboardEvent.d.ts +1 -0
  114. package/es-modules/Core/KeyboardEvent.js +11 -0
  115. package/es-modules/Core/MSPointer.d.ts +1 -74
  116. package/es-modules/Core/MSPointer.js +24 -15
  117. package/es-modules/Core/Math3D.d.ts +1 -117
  118. package/es-modules/Core/Math3D.js +14 -12
  119. package/es-modules/Core/Options.d.ts +338 -0
  120. package/es-modules/Core/Options.js +10 -0
  121. package/es-modules/Core/Pointer.d.ts +71 -445
  122. package/es-modules/Core/Pointer.js +74 -69
  123. package/es-modules/Core/PointerEvent.d.ts +20 -0
  124. package/es-modules/Core/PointerEvent.js +11 -0
  125. package/es-modules/Core/Renderer/AlignObject.d.ts +25 -27
  126. package/es-modules/Core/Renderer/AlignObject.js +11 -0
  127. package/es-modules/Core/Renderer/BBoxObject.d.ts +20 -31
  128. package/es-modules/Core/Renderer/BBoxObject.js +11 -0
  129. package/es-modules/Core/Renderer/CSSObject.d.ts +268 -59
  130. package/es-modules/Core/Renderer/CSSObject.js +10 -0
  131. package/es-modules/Core/Renderer/DOMElementType.d.ts +1 -33
  132. package/es-modules/Core/Renderer/DOMElementType.js +11 -0
  133. package/es-modules/Core/Renderer/DashStyleValue.d.ts +1 -27
  134. package/es-modules/Core/Renderer/DashStyleValue.js +11 -0
  135. package/es-modules/Core/Renderer/FontMetricsObject.d.ts +6 -26
  136. package/es-modules/Core/Renderer/FontMetricsObject.js +11 -0
  137. package/es-modules/Core/Renderer/HTML/AST.d.ts +3 -15
  138. package/es-modules/Core/Renderer/HTML/AST.js +24 -15
  139. package/es-modules/Core/Renderer/HTML/HTMLAttributes.d.ts +1 -25
  140. package/es-modules/Core/Renderer/HTML/HTMLAttributes.js +11 -0
  141. package/es-modules/Core/Renderer/HTML/HTMLElement.d.ts +0 -54
  142. package/es-modules/Core/Renderer/HTML/HTMLElement.js +28 -24
  143. package/es-modules/Core/Renderer/PolygonBoxObject.d.ts +15 -12
  144. package/es-modules/Core/Renderer/PolygonBoxObject.js +11 -0
  145. package/es-modules/Core/Renderer/Position3DObject.d.ts +6 -30
  146. package/es-modules/Core/Renderer/Position3DObject.js +11 -0
  147. package/es-modules/Core/Renderer/PositionObject.d.ts +9 -23
  148. package/es-modules/Core/Renderer/PositionObject.js +11 -0
  149. package/es-modules/Core/Renderer/RectangleObject.d.ts +6 -30
  150. package/es-modules/Core/Renderer/RectangleObject.js +11 -0
  151. package/es-modules/Core/Renderer/RendererRegistry.d.ts +1 -29
  152. package/es-modules/Core/Renderer/RendererRegistry.js +6 -3
  153. package/es-modules/Core/Renderer/RendererType.d.ts +1 -53
  154. package/es-modules/Core/Renderer/RendererType.js +11 -0
  155. package/es-modules/Core/Renderer/RendererUtilities.d.ts +1 -26
  156. package/es-modules/Core/Renderer/RendererUtilities.js +41 -23
  157. package/es-modules/Core/Renderer/SVG/ButtonThemeObject.d.ts +26 -31
  158. package/es-modules/Core/Renderer/SVG/SVGArc3D.d.ts +1 -44
  159. package/es-modules/Core/Renderer/SVG/SVGAttributes.d.ts +15 -51
  160. package/es-modules/Core/Renderer/SVG/SVGAttributes3D.d.ts +1 -42
  161. package/es-modules/Core/Renderer/SVG/SVGCuboid.d.ts +1 -42
  162. package/es-modules/Core/Renderer/SVG/SVGElement.d.ts +459 -0
  163. package/es-modules/Core/Renderer/SVG/SVGElement3D.d.ts +1 -0
  164. package/es-modules/Core/Renderer/SVG/SVGElementBase.d.ts +0 -23
  165. package/es-modules/Core/Renderer/SVG/SVGLabel.d.ts +14 -0
  166. package/es-modules/Core/Renderer/SVG/SVGPath.d.ts +18 -56
  167. package/es-modules/Core/Renderer/SVG/SVGPath3D.d.ts +0 -30
  168. package/es-modules/Core/Renderer/SVG/SVGRenderer.d.ts +652 -0
  169. package/es-modules/Core/Renderer/SVG/SVGRenderer3D.d.ts +1 -0
  170. package/es-modules/Core/Renderer/SVG/SVGRendererBase.d.ts +0 -24
  171. package/es-modules/Core/Renderer/SVG/SymbolOptions.d.ts +3 -26
  172. package/es-modules/Core/Renderer/SVG/SymbolType.d.ts +1 -41
  173. package/es-modules/Core/Renderer/SVG/Symbols.d.ts +146 -0
  174. package/es-modules/Core/Renderer/SVG/TextBuilder.d.ts +1 -0
  175. package/es-modules/Core/Renderer/ShadowOptionsObject.d.ts +21 -30
  176. package/es-modules/Core/Renderer/ShadowOptionsObject.js +11 -0
  177. package/es-modules/Core/Renderer/SizeObject.d.ts +0 -23
  178. package/es-modules/Core/Renderer/SizeObject.js +11 -0
  179. package/es-modules/Core/Responsive.d.ts +94 -29
  180. package/es-modules/Core/Responsive.js +17 -12
  181. package/es-modules/Core/Templating.d.ts +17 -1
  182. package/es-modules/Core/Templating.js +12 -8
  183. package/es-modules/Core/Time.d.ts +18 -1
  184. package/es-modules/Core/Time.js +6 -5
  185. package/es-modules/Core/Tooltip.d.ts +67 -123
  186. package/es-modules/Core/Tooltip.js +161 -108
  187. package/es-modules/Core/TooltipOptions.d.ts +724 -0
  188. package/es-modules/Core/TooltipOptions.js +10 -0
  189. package/es-modules/Core/Utilities.d.ts +32 -703
  190. package/es-modules/Core/Utilities.js +28 -1443
  191. package/es-modules/Data/ColumnUtils.d.ts +83 -80
  192. package/es-modules/Data/ColumnUtils.js +106 -116
  193. package/es-modules/Data/Connectors/CSVConnector.d.ts +9 -14
  194. package/es-modules/Data/Connectors/CSVConnector.js +6 -7
  195. package/es-modules/Data/Connectors/CSVConnectorOptions.d.ts +3 -3
  196. package/es-modules/Data/Connectors/DataConnector.d.ts +63 -54
  197. package/es-modules/Data/Connectors/DataConnector.js +67 -56
  198. package/es-modules/Data/Connectors/DataConnectorOptions.d.ts +3 -3
  199. package/es-modules/Data/Connectors/DataConnectorType.d.ts +3 -3
  200. package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +40 -42
  201. package/es-modules/Data/Connectors/GoogleSheetsConnector.js +76 -91
  202. package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +7 -5
  203. package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +23 -28
  204. package/es-modules/Data/Connectors/HTMLTableConnector.js +6 -7
  205. package/es-modules/Data/Connectors/HTMLTableConnectorOptions.d.ts +3 -3
  206. package/es-modules/Data/Connectors/JSONConnector.d.ts +9 -14
  207. package/es-modules/Data/Connectors/JSONConnector.js +6 -7
  208. package/es-modules/Data/Connectors/JSONConnectorOptions.d.ts +3 -3
  209. package/es-modules/Data/Converters/CSVConverter.d.ts +5 -5
  210. package/es-modules/Data/Converters/CSVConverter.js +6 -7
  211. package/es-modules/Data/Converters/CSVConverterOptions.d.ts +5 -5
  212. package/es-modules/Data/Converters/DataConverter.d.ts +76 -78
  213. package/es-modules/Data/Converters/DataConverter.js +29 -56
  214. package/es-modules/Data/Converters/DataConverterType.d.ts +3 -3
  215. package/es-modules/Data/Converters/DataConverterUtils.d.ts +88 -81
  216. package/es-modules/Data/Converters/DataConverterUtils.js +172 -184
  217. package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +4 -4
  218. package/es-modules/Data/Converters/GoogleSheetsConverter.js +6 -6
  219. package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +5 -5
  220. package/es-modules/Data/Converters/HTMLTableConverter.d.ts +4 -4
  221. package/es-modules/Data/Converters/HTMLTableConverter.js +5 -6
  222. package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +5 -5
  223. package/es-modules/Data/Converters/JSONConverter.d.ts +7 -7
  224. package/es-modules/Data/Converters/JSONConverter.js +9 -9
  225. package/es-modules/Data/Converters/JSONConverterOptions.d.ts +5 -5
  226. package/es-modules/Data/DataCursor.d.ts +65 -70
  227. package/es-modules/Data/DataCursor.js +122 -142
  228. package/es-modules/Data/DataEvent.d.ts +55 -57
  229. package/es-modules/Data/DataEvent.js +3 -3
  230. package/es-modules/Data/DataPool.d.ts +10 -17
  231. package/es-modules/Data/DataPool.js +23 -12
  232. package/es-modules/Data/DataPoolOptions.d.ts +3 -3
  233. package/es-modules/Data/DataTable.d.ts +115 -117
  234. package/es-modules/Data/DataTable.js +67 -33
  235. package/es-modules/Data/DataTableCore.d.ts +11 -11
  236. package/es-modules/Data/DataTableCore.js +7 -7
  237. package/es-modules/Data/DataTableOptions.js +3 -3
  238. package/es-modules/Data/Formula/Formula.js +3 -3
  239. package/es-modules/Data/Formula/FormulaParser.js +4 -5
  240. package/es-modules/Data/Formula/FormulaProcessor.js +4 -5
  241. package/es-modules/Data/Formula/FormulaTypes.js +3 -3
  242. package/es-modules/Data/Formula/Functions/ABS.js +3 -3
  243. package/es-modules/Data/Formula/Functions/AND.js +3 -3
  244. package/es-modules/Data/Formula/Functions/AVERAGE.js +3 -3
  245. package/es-modules/Data/Formula/Functions/AVERAGEA.js +3 -3
  246. package/es-modules/Data/Formula/Functions/COUNT.js +3 -3
  247. package/es-modules/Data/Formula/Functions/COUNTA.js +3 -3
  248. package/es-modules/Data/Formula/Functions/IF.js +3 -3
  249. package/es-modules/Data/Formula/Functions/ISNA.js +3 -3
  250. package/es-modules/Data/Formula/Functions/MAX.js +3 -3
  251. package/es-modules/Data/Formula/Functions/MEDIAN.js +3 -3
  252. package/es-modules/Data/Formula/Functions/MIN.js +3 -3
  253. package/es-modules/Data/Formula/Functions/MOD.js +3 -3
  254. package/es-modules/Data/Formula/Functions/MODE.js +3 -3
  255. package/es-modules/Data/Formula/Functions/NOT.js +3 -3
  256. package/es-modules/Data/Formula/Functions/OR.js +3 -3
  257. package/es-modules/Data/Formula/Functions/PRODUCT.js +3 -3
  258. package/es-modules/Data/Formula/Functions/SUM.js +3 -3
  259. package/es-modules/Data/Formula/Functions/XOR.js +3 -3
  260. package/es-modules/Data/Modifiers/ChainModifier.d.ts +29 -34
  261. package/es-modules/Data/Modifiers/ChainModifier.js +10 -11
  262. package/es-modules/Data/Modifiers/ChainModifierOptions.js +3 -3
  263. package/es-modules/Data/Modifiers/DataModifier.d.ts +36 -41
  264. package/es-modules/Data/Modifiers/DataModifier.js +34 -56
  265. package/es-modules/Data/Modifiers/DataModifierEvent.js +3 -3
  266. package/es-modules/Data/Modifiers/DataModifierOptions.js +3 -3
  267. package/es-modules/Data/Modifiers/DataModifierType.d.ts +3 -3
  268. package/es-modules/Data/Modifiers/FilterModifier.d.ts +4 -4
  269. package/es-modules/Data/Modifiers/FilterModifier.js +6 -7
  270. package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +3 -2
  271. package/es-modules/Data/Modifiers/FilterModifierOptions.js +3 -3
  272. package/es-modules/Data/Modifiers/InvertModifier.d.ts +4 -4
  273. package/es-modules/Data/Modifiers/InvertModifier.js +6 -7
  274. package/es-modules/Data/Modifiers/InvertModifierOptions.js +3 -3
  275. package/es-modules/Data/Modifiers/MathModifier.d.ts +5 -4
  276. package/es-modules/Data/Modifiers/MathModifier.js +3 -3
  277. package/es-modules/Data/Modifiers/MathModifierOptions.js +3 -3
  278. package/es-modules/Data/Modifiers/RangeModifier.d.ts +4 -4
  279. package/es-modules/Data/Modifiers/RangeModifier.js +6 -7
  280. package/es-modules/Data/Modifiers/RangeModifierOptions.js +3 -3
  281. package/es-modules/Data/Modifiers/SortModifier.d.ts +6 -11
  282. package/es-modules/Data/Modifiers/SortModifier.js +35 -10
  283. package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +43 -6
  284. package/es-modules/Data/Modifiers/SortModifierOptions.js +3 -3
  285. package/es-modules/Grid/Core/Accessibility/A11yOptions.d.ts +77 -0
  286. package/es-modules/Grid/Core/Accessibility/A11yOptions.js +4 -3
  287. package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +68 -1
  288. package/es-modules/Grid/Core/Accessibility/Accessibility.js +179 -7
  289. package/es-modules/Grid/Core/Credits.js +3 -3
  290. package/es-modules/Grid/Core/Data/DataProvider.d.ts +97 -0
  291. package/es-modules/Grid/Core/Data/DataProvider.js +89 -0
  292. package/es-modules/Grid/Core/Data/DataProviderRegistry.d.ts +20 -0
  293. package/es-modules/Grid/Core/Data/DataProviderRegistry.js +52 -0
  294. package/es-modules/Grid/Core/Data/DataProviderType.d.ts +19 -0
  295. package/es-modules/Grid/Core/Data/DataProviderType.js +15 -0
  296. package/es-modules/Grid/Core/Data/LocalDataProvider.d.ts +165 -0
  297. package/es-modules/Grid/Core/Data/LocalDataProvider.js +341 -0
  298. package/es-modules/Grid/Core/Defaults.js +21 -7
  299. package/es-modules/Grid/Core/Globals.d.ts +20 -16
  300. package/es-modules/Grid/Core/Globals.js +13 -11
  301. package/es-modules/Grid/Core/Grid.d.ts +43 -23
  302. package/es-modules/Grid/Core/Grid.js +316 -136
  303. package/es-modules/Grid/Core/GridUtils.d.ts +33 -0
  304. package/es-modules/Grid/Core/GridUtils.js +53 -6
  305. package/es-modules/Grid/Core/Options.d.ts +162 -5
  306. package/es-modules/Grid/Core/Options.js +3 -3
  307. package/es-modules/Grid/Core/Pagination/Pagination.d.ts +3 -0
  308. package/es-modules/Grid/Core/Pagination/Pagination.js +66 -26
  309. package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +4 -40
  310. package/es-modules/Grid/Core/Pagination/PaginationOptions.js +11 -0
  311. package/es-modules/Grid/Core/Querying/FilteringController.js +4 -5
  312. package/es-modules/Grid/Core/Querying/PaginationController.d.ts +2 -2
  313. package/es-modules/Grid/Core/Querying/PaginationController.js +6 -6
  314. package/es-modules/Grid/Core/Querying/QueryingController.d.ts +1 -1
  315. package/es-modules/Grid/Core/Querying/QueryingController.js +5 -29
  316. package/es-modules/Grid/Core/Querying/SortingController.d.ts +15 -0
  317. package/es-modules/Grid/Core/Querying/SortingController.js +89 -51
  318. package/es-modules/Grid/Core/Responsive/ResponsiveComposition.d.ts +53 -0
  319. package/es-modules/Grid/Core/Responsive/ResponsiveComposition.js +229 -0
  320. package/es-modules/Grid/Core/Responsive/ResponsiveOptions.d.ts +58 -0
  321. package/es-modules/Grid/Core/Responsive/ResponsiveOptions.js +15 -0
  322. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +5 -6
  323. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +3 -3
  324. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +6 -7
  325. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +1 -1
  326. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +5 -5
  327. package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.js +3 -3
  328. package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +29 -3
  329. package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +136 -26
  330. package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +4 -6
  331. package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +94 -3
  332. package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +481 -91
  333. package/es-modules/Grid/Core/Table/Body/CellContextMenu.d.ts +11 -0
  334. package/es-modules/Grid/Core/Table/Body/CellContextMenu.js +84 -0
  335. package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +36 -15
  336. package/es-modules/Grid/Core/Table/Body/TableCell.js +89 -33
  337. package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +15 -5
  338. package/es-modules/Grid/Core/Table/Body/TableRow.js +70 -19
  339. package/es-modules/Grid/Core/Table/Cell.d.ts +16 -10
  340. package/es-modules/Grid/Core/Table/Cell.js +41 -6
  341. package/es-modules/Grid/Core/Table/CellContent/CellContent.js +3 -3
  342. package/es-modules/Grid/Core/Table/CellContent/TextContent.js +7 -12
  343. package/es-modules/Grid/Core/Table/Column.d.ts +11 -5
  344. package/es-modules/Grid/Core/Table/Column.js +26 -37
  345. package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.js +3 -3
  346. package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.js +3 -3
  347. package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.js +3 -3
  348. package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +12 -11
  349. package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +7 -6
  350. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +5 -0
  351. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +21 -7
  352. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +4 -5
  353. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +4 -5
  354. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.d.ts +9 -0
  355. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +37 -9
  356. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuPopup.js +5 -4
  357. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.js +11 -7
  358. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +4 -5
  359. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +4 -5
  360. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +4 -1
  361. package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +88 -15
  362. package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +8 -3
  363. package/es-modules/Grid/Core/Table/Header/HeaderCell.js +36 -15
  364. package/es-modules/Grid/Core/Table/Header/HeaderRow.js +7 -8
  365. package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +1 -1
  366. package/es-modules/Grid/Core/Table/Header/TableHeader.js +6 -6
  367. package/es-modules/Grid/Core/Table/Row.d.ts +1 -1
  368. package/es-modules/Grid/Core/Table/Row.js +5 -5
  369. package/es-modules/Grid/Core/Table/Table.d.ts +68 -12
  370. package/es-modules/Grid/Core/Table/Table.js +296 -92
  371. package/es-modules/Grid/Core/UI/Button.js +3 -3
  372. package/es-modules/Grid/Core/UI/ContextMenu.js +3 -3
  373. package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +6 -7
  374. package/es-modules/Grid/Core/UI/ContextMenuButton.js +8 -6
  375. package/es-modules/Grid/Core/UI/Popup.js +10 -12
  376. package/es-modules/Grid/Core/UI/SvgIcons.d.ts +42 -7
  377. package/es-modules/Grid/Core/UI/SvgIcons.js +209 -36
  378. package/es-modules/Grid/Core/UI/Toolbar.d.ts +5 -0
  379. package/es-modules/Grid/Core/UI/Toolbar.js +3 -3
  380. package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +4 -12
  381. package/es-modules/Grid/Core/UI/ToolbarButton.js +11 -29
  382. package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +4 -45
  383. package/es-modules/Grid/Pro/CellEditing/CellEditMode.js +16 -0
  384. package/es-modules/Grid/Pro/CellEditing/CellEditing.js +13 -13
  385. package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +4 -5
  386. package/es-modules/Grid/Pro/CellRendering/CellContentPro.js +3 -3
  387. package/es-modules/Grid/Pro/CellRendering/CellRenderer.js +3 -3
  388. package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.js +3 -3
  389. package/es-modules/Grid/Pro/CellRendering/CellRendererType.d.ts +1 -34
  390. package/es-modules/Grid/Pro/CellRendering/CellRendererType.js +15 -0
  391. package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +1 -1
  392. package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +7 -5
  393. package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +2 -2
  394. package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.js +3 -3
  395. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.js +3 -3
  396. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.js +3 -3
  397. package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.js +3 -3
  398. package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +4 -5
  399. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +2 -2
  400. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.js +3 -3
  401. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.d.ts +7 -5
  402. package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +4 -5
  403. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +2 -2
  404. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +4 -5
  405. package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.js +3 -3
  406. package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +4 -5
  407. package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +4 -5
  408. package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.js +3 -3
  409. package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +4 -5
  410. package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +4 -5
  411. package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +4 -5
  412. package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +4 -4
  413. package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +4 -5
  414. package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +4 -5
  415. package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +4 -5
  416. package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +4 -5
  417. package/es-modules/Grid/Pro/ColumnTypes/Validator.d.ts +10 -1
  418. package/es-modules/Grid/Pro/ColumnTypes/Validator.js +56 -12
  419. package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +1 -1
  420. package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +6 -7
  421. package/es-modules/Grid/Pro/Credits/CreditsPro.js +3 -3
  422. package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +4 -6
  423. package/es-modules/Grid/Pro/Data/DataSourceHelper.d.ts +74 -0
  424. package/es-modules/Grid/Pro/Data/DataSourceHelper.js +246 -0
  425. package/es-modules/Grid/Pro/Data/QuerySerializer.d.ts +46 -0
  426. package/es-modules/Grid/Pro/Data/QuerySerializer.js +169 -0
  427. package/es-modules/Grid/Pro/Data/RemoteDataProvider.d.ts +187 -0
  428. package/es-modules/Grid/Pro/Data/RemoteDataProvider.js +500 -0
  429. package/es-modules/Grid/Pro/Export/Exporting.js +5 -7
  430. package/es-modules/Grid/Pro/Export/ExportingComposition.js +4 -5
  431. package/es-modules/Grid/Pro/GridEvents.d.ts +1 -0
  432. package/es-modules/Grid/Pro/GridEvents.js +4 -5
  433. package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +0 -1
  434. package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +4 -5
  435. package/es-modules/Grid/index.js +3 -3
  436. package/es-modules/Shared/BaseForm.js +4 -5
  437. package/es-modules/Shared/DownloadURL.d.ts +1 -85
  438. package/es-modules/Shared/DownloadURL.js +15 -13
  439. package/es-modules/Shared/LangOptionsCore.d.ts +4 -3
  440. package/es-modules/Shared/TimeBase.d.ts +1 -46
  441. package/es-modules/Shared/TimeBase.js +11 -10
  442. package/es-modules/Shared/Types.d.ts +11 -3
  443. package/es-modules/Shared/Utilities.d.ts +576 -0
  444. package/es-modules/Shared/Utilities.js +1368 -0
  445. package/es-modules/masters/grid-pro.src.d.ts +18 -19
  446. package/es-modules/masters/grid-pro.src.js +24 -9
  447. package/grid-pro.d.ts +18 -19
  448. package/grid-pro.js +6 -5
  449. package/grid-pro.js.map +1 -1
  450. package/grid-pro.src.d.ts +18 -19
  451. package/grid-pro.src.js +8132 -4531
  452. package/package.json +1 -1
  453. package/es-modules/Grid/Core/Pagination/Icons.d.ts +0 -7
  454. package/es-modules/Grid/Core/Pagination/Icons.js +0 -7
  455. package/es-modules/Grid/Pro/highcharts.d.ts +0 -7
@@ -2,11 +2,11 @@
2
2
  *
3
3
  * Grid Rows Renderer class.
4
4
  *
5
- * (c) 2020-2025 Highsoft AS
5
+ * (c) 2020-2026 Highsoft AS
6
6
  *
7
- * License: www.highcharts.com/license
7
+ * A commercial license may be required depending on use.
8
+ * See www.highcharts.com/license
8
9
  *
9
- * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
10
10
  *
11
11
  * Authors:
12
12
  * - Dawid Dragula
@@ -15,6 +15,7 @@
15
15
  'use strict';
16
16
  import TableRow from '../Body/TableRow.js';
17
17
  import Globals from '../../Globals.js';
18
+ import { defined } from '../../../../Shared/Utilities.js';
18
19
  /* *
19
20
  *
20
21
  * Class
@@ -24,6 +25,40 @@ import Globals from '../../Globals.js';
24
25
  * Represents a virtualized rows renderer for the data grid.
25
26
  */
26
27
  class RowsVirtualizer {
28
+ /**
29
+ * The maximum height of a HTML element in most browsers.
30
+ * Firefox has a lower limit than other browsers.
31
+ */
32
+ static getMaxElementHeight() {
33
+ if (RowsVirtualizer.maxElementHeight !== void 0) {
34
+ return RowsVirtualizer.maxElementHeight;
35
+ }
36
+ const isFirefox = Globals.userAgent.indexOf('Firefox') > -1;
37
+ const fallbackMax = ((isFirefox ? 6000000 : 31000000) /
38
+ (window.devicePixelRatio || 1));
39
+ if (!document.body) {
40
+ RowsVirtualizer.maxElementHeight = fallbackMax;
41
+ return RowsVirtualizer.maxElementHeight;
42
+ }
43
+ let res = 1000000;
44
+ const testUpTo = isFirefox ? 6000000 : 1000000000;
45
+ const div = document.createElement('div');
46
+ document.body.appendChild(div);
47
+ let done = false;
48
+ while (!done) {
49
+ const test = res * 2;
50
+ div.style.height = test + 'px';
51
+ if (test > testUpTo || div.clientHeight !== test) {
52
+ done = true;
53
+ continue;
54
+ }
55
+ res = test;
56
+ }
57
+ div.remove();
58
+ const safeMax = 16000000;
59
+ RowsVirtualizer.maxElementHeight = Math.min(res || fallbackMax, safeMax);
60
+ return RowsVirtualizer.maxElementHeight;
61
+ }
27
62
  /* *
28
63
  *
29
64
  * Constructor
@@ -36,6 +71,15 @@ class RowsVirtualizer {
36
71
  * The viewport of the data grid to render rows in.
37
72
  */
38
73
  constructor(viewport) {
74
+ /* *
75
+ *
76
+ * Properties
77
+ *
78
+ * */
79
+ /**
80
+ * The default height of a row.
81
+ */
82
+ this.defaultRowHeight = 49;
39
83
  /**
40
84
  * The index of the first visible row.
41
85
  */
@@ -45,12 +89,47 @@ class RowsVirtualizer {
45
89
  * flickering loops when scrolling to the last row.
46
90
  */
47
91
  this.preventScroll = false;
92
+ /**
93
+ * The total height of the grid, used when the Grid height
94
+ * exceeds the max element height.
95
+ */
96
+ this.totalGridHeight = 0;
97
+ /**
98
+ * The overflow height of the grid, used when the Grid height
99
+ * exceeds the max element height.
100
+ */
101
+ this.gridHeightOverflow = 0;
102
+ /**
103
+ * The scroll offset in pixels used to adjust the row positions when
104
+ * the Grid height exceeds the max element height.
105
+ */
106
+ this.scrollOffset = 0;
107
+ /**
108
+ * Reuse pool for rows that are currently out of viewport.
109
+ */
110
+ this.rowPool = [];
111
+ /**
112
+ * Flag indicating if a scroll update is queued for the next animation
113
+ * frame.
114
+ */
115
+ this.scrollQueued = false;
116
+ /**
117
+ * Flag indicating if rows are currently being rendered to prevent
118
+ * concurrent render operations.
119
+ */
120
+ this.isRendering = false;
121
+ /**
122
+ * Pending row cursor to render after current render completes.
123
+ * Used to ensure the final scroll position is rendered.
124
+ */
125
+ this.pendingRowCursor = null;
48
126
  this.rowSettings =
49
127
  viewport.grid.options?.rendering?.rows;
50
128
  this.viewport = viewport;
129
+ this.rowCount = 0;
51
130
  this.strictRowHeights = this.rowSettings.strictHeights;
52
131
  this.buffer = Math.max(this.rowSettings.bufferSize, 0);
53
- this.defaultRowHeight = this.getDefaultRowHeight();
132
+ this.maxElementHeight = RowsVirtualizer.getMaxElementHeight();
54
133
  if (this.strictRowHeights) {
55
134
  viewport.tbodyElement.classList.add(Globals.getClassName('rowsContentNowrap'));
56
135
  }
@@ -63,24 +142,36 @@ class RowsVirtualizer {
63
142
  /**
64
143
  * Renders the rows in the viewport for the first time.
65
144
  */
66
- initialRender() {
145
+ async initialRender() {
146
+ this.defaultRowHeight = await this.getDefaultRowHeight();
67
147
  // Initial reflow to set the viewport height
68
148
  if (this.viewport.virtualRows) {
69
149
  this.viewport.reflow();
70
150
  }
151
+ await this.updateGridMetrics();
71
152
  // Load & render rows
72
- this.renderRows(this.rowCursor);
153
+ await this.renderRows(this.rowCursor);
73
154
  this.adjustRowHeights();
155
+ if (this.viewport.virtualRows) {
156
+ this.adjustRowOffsets();
157
+ }
74
158
  }
75
159
  /**
76
160
  * Renders the rows in the viewport. It is called when the rows need to be
77
161
  * re-rendered, e.g., after a sort or filter operation.
78
162
  */
79
- rerender() {
163
+ async rerender() {
164
+ await this.updateGridMetrics();
80
165
  const tbody = this.viewport.tbodyElement;
81
166
  let rows = this.viewport.rows;
82
167
  const oldScrollLeft = tbody.scrollLeft;
83
168
  let oldScrollTop;
169
+ if (this.rowPool.length) {
170
+ for (let i = this.rowPool.length - 1; i >= 0; --i) {
171
+ this.rowPool[i].destroy();
172
+ }
173
+ this.rowPool.length = 0;
174
+ }
84
175
  if (rows.length) {
85
176
  oldScrollTop = tbody.scrollTop;
86
177
  for (let i = 0, iEnd = rows.length; i < iEnd; ++i) {
@@ -88,12 +179,11 @@ class RowsVirtualizer {
88
179
  }
89
180
  rows.length = 0;
90
181
  }
91
- this.renderRows(this.rowCursor);
182
+ await this.renderRows(this.rowCursor);
92
183
  if (this.viewport.virtualRows) {
93
- if (oldScrollTop !== void 0) {
184
+ if (defined(oldScrollTop)) {
94
185
  tbody.scrollTop = oldScrollTop;
95
186
  }
96
- this.scroll();
97
187
  }
98
188
  rows = this.viewport.rows;
99
189
  // Reflow the rendered row cells widths (check redundancy)
@@ -102,14 +192,60 @@ class RowsVirtualizer {
102
192
  }
103
193
  tbody.scrollLeft = oldScrollLeft;
104
194
  }
195
+ /**
196
+ * Refreshes the rendered rows without a full teardown.
197
+ * It updates the row range and reuses existing rows when possible.
198
+ */
199
+ async refreshRows() {
200
+ await this.updateGridMetrics();
201
+ const tbody = this.viewport.tbodyElement;
202
+ const oldScrollLeft = tbody.scrollLeft;
203
+ const oldScrollTop = this.viewport.virtualRows ?
204
+ tbody.scrollTop :
205
+ void 0;
206
+ const maxRowCursor = Math.max(0, this.rowCount - 1);
207
+ if (this.rowCursor > maxRowCursor) {
208
+ this.rowCursor = maxRowCursor;
209
+ }
210
+ // Render missing rows, drop out-of-range ones, and ensure last row.
211
+ await this.renderRows(this.rowCursor);
212
+ const rows = this.viewport.rows;
213
+ for (let i = 0, iEnd = rows.length; i < iEnd; ++i) {
214
+ // Update row data so indices map to fresh provider values.
215
+ await rows[i].update();
216
+ }
217
+ if (this.viewport.virtualRows && defined(oldScrollTop)) {
218
+ tbody.scrollTop = oldScrollTop;
219
+ }
220
+ tbody.scrollLeft = oldScrollLeft;
221
+ }
105
222
  /**
106
223
  * Method called on the viewport scroll event, only when the virtualization
107
224
  * is enabled.
108
225
  */
109
226
  scroll() {
227
+ if (this.scrollQueued) {
228
+ return;
229
+ }
230
+ this.scrollQueued = true;
231
+ requestAnimationFrame(() => {
232
+ this.scrollQueued = false;
233
+ void this.applyScroll();
234
+ });
235
+ }
236
+ /**
237
+ * Applies the scroll logic for virtualized rows.
238
+ */
239
+ async applyScroll() {
110
240
  const target = this.viewport.tbodyElement;
111
241
  const { defaultRowHeight: rowHeight } = this;
112
242
  const lastScrollTop = target.scrollTop;
243
+ const scrollDenominator = this.maxElementHeight -
244
+ target.clientHeight;
245
+ const scrollPercentage = scrollDenominator > 0 ?
246
+ lastScrollTop / scrollDenominator :
247
+ 0;
248
+ this.scrollOffset = Math.floor(scrollPercentage * this.gridHeightOverflow);
113
249
  if (this.preventScroll) {
114
250
  if (lastScrollTop <= target.scrollTop) {
115
251
  this.preventScroll = false;
@@ -118,12 +254,16 @@ class RowsVirtualizer {
118
254
  return;
119
255
  }
120
256
  // Do vertical virtual scrolling
121
- const rowCursor = Math.floor(target.scrollTop / rowHeight);
257
+ let rowCursor = Math.floor((target.scrollTop / rowHeight) +
258
+ (this.scrollOffset / rowHeight));
259
+ const maxRowCursor = Math.max(0, this.rowCount - 1);
260
+ rowCursor = Math.min(rowCursor, maxRowCursor);
122
261
  if (this.rowCursor !== rowCursor) {
123
- this.renderRows(rowCursor);
262
+ await this.renderRows(rowCursor);
124
263
  }
125
264
  this.rowCursor = rowCursor;
126
265
  this.adjustRowHeights();
266
+ this.adjustRowOffsets();
127
267
  if (!this.strictRowHeights &&
128
268
  lastScrollTop > target.scrollTop &&
129
269
  !this.preventScroll) {
@@ -137,7 +277,16 @@ class RowsVirtualizer {
137
277
  adjustBottomRowHeights() {
138
278
  const rows = this.viewport.rows;
139
279
  const rowsLn = rows.length;
280
+ if (rowsLn < 1) {
281
+ return;
282
+ }
140
283
  const lastRow = rows[rowsLn - 1];
284
+ // Skip if row is not fully rendered or has no cells
285
+ if (!lastRow.rendered ||
286
+ !lastRow.cells.length ||
287
+ !lastRow.cells[0]?.htmlElement) {
288
+ return;
289
+ }
141
290
  let rowTop = lastRow.translateY;
142
291
  const rowBottom = rowTop + lastRow.htmlElement.offsetHeight;
143
292
  let newHeight = lastRow.cells[0].htmlElement.offsetHeight;
@@ -145,16 +294,28 @@ class RowsVirtualizer {
145
294
  lastRow.htmlElement.style.height = newHeight + 'px';
146
295
  lastRow.setTranslateY(rowTop);
147
296
  for (let j = 0, jEnd = lastRow.cells.length; j < jEnd; ++j) {
148
- lastRow.cells[j].htmlElement.style.transform = '';
297
+ const cell = lastRow.cells[j];
298
+ if (cell?.htmlElement) {
299
+ cell.htmlElement.style.transform = '';
300
+ }
149
301
  }
150
302
  for (let i = rowsLn - 2; i >= 0; i--) {
151
303
  const row = rows[i];
304
+ // Skip if row is not fully rendered or has no cells
305
+ if (!row.rendered ||
306
+ !row.cells.length ||
307
+ !row.cells[0]?.htmlElement) {
308
+ continue;
309
+ }
152
310
  newHeight = row.cells[0].htmlElement.offsetHeight;
153
311
  rowTop -= newHeight;
154
312
  row.htmlElement.style.height = newHeight + 'px';
155
313
  row.setTranslateY(rowTop);
156
314
  for (let j = 0, jEnd = row.cells.length; j < jEnd; ++j) {
157
- row.cells[j].htmlElement.style.transform = '';
315
+ const cell = row.cells[j];
316
+ if (cell?.htmlElement) {
317
+ cell.htmlElement.style.transform = '';
318
+ }
158
319
  }
159
320
  }
160
321
  }
@@ -165,87 +326,197 @@ class RowsVirtualizer {
165
326
  * @param rowCursor
166
327
  * The index of the first visible row.
167
328
  */
168
- renderRows(rowCursor) {
169
- const { viewport: vp, buffer } = this;
170
- const rowCount = vp.dataTable.getRowCount();
171
- // Stop rendering if there are no rows to render.
172
- if (rowCount < 1) {
329
+ async renderRows(rowCursor) {
330
+ // Prevent concurrent render operations - queue the latest cursor
331
+ if (this.isRendering) {
332
+ this.pendingRowCursor = rowCursor;
173
333
  return;
174
334
  }
175
- const isVirtualization = this.viewport.virtualRows;
176
- const rowsPerPage = isVirtualization ? Math.ceil((vp.grid.tableElement?.clientHeight || 0) /
177
- this.defaultRowHeight) : Infinity; // Need to be refactored when add pagination
178
- let rows = vp.rows;
179
- if (!isVirtualization && rows.length > 50) {
180
- // eslint-disable-next-line no-console
181
- console.warn('Grid: a large dataset can cause performance issues when ' +
182
- 'virtualization is disabled. Consider enabling ' +
183
- 'virtualization in the rows settings.');
184
- }
185
- if (!rows.length) {
186
- const last = new TableRow(vp, rowCount - 1);
187
- vp.tbodyElement.appendChild(last.htmlElement);
188
- last.render();
189
- rows.push(last);
190
- if (isVirtualization) {
191
- last.setTranslateY(last.getDefaultTopOffset());
335
+ this.isRendering = true;
336
+ try {
337
+ const { viewport: vp, buffer } = this;
338
+ await this.updateGridMetrics();
339
+ const rowCount = this.rowCount;
340
+ if (!defined(rowCount)) {
341
+ return;
192
342
  }
193
- }
194
- const from = Math.max(0, Math.min(rowCursor - buffer, rowCount - rowsPerPage));
195
- const to = Math.min(rowCursor + rowsPerPage + buffer, rows[rows.length - 1].index - 1);
196
- const alwaysLastRow = rows.pop();
197
- const tempRows = [];
198
- // Remove rows that are out of the range except the last row.
199
- for (let i = 0, iEnd = rows.length; i < iEnd; ++i) {
200
- const row = rows[i];
201
- const rowIndex = row.index;
202
- if (rowIndex < from || rowIndex > to) {
203
- row.destroy();
343
+ if (rowCount === 0) {
344
+ if (vp.rows.length) {
345
+ for (let i = 0, iEnd = vp.rows.length; i < iEnd; ++i) {
346
+ vp.rows[i].destroy();
347
+ }
348
+ vp.rows.length = 0;
349
+ }
350
+ vp.tbodyElement.innerHTML = '';
351
+ this.rowCursor = 0;
352
+ return;
204
353
  }
205
- else {
206
- tempRows.push(row);
354
+ // Stop rendering if there are no rows to render.
355
+ if (rowCount < 1) {
356
+ return;
207
357
  }
208
- }
209
- rows = tempRows;
210
- vp.rows = rows;
211
- for (let i = from; i <= to; ++i) {
212
- const row = rows[i - (rows[0]?.index || 0)];
213
- // Recreate row when it is destroyed and it is in the range.
214
- if (!row) {
215
- const newRow = new TableRow(vp, i);
216
- rows.push(newRow);
217
- newRow.rendered = false;
358
+ const isVirtualization = this.viewport.virtualRows;
359
+ const rowsPerPage = isVirtualization ? Math.ceil((vp.grid.tableElement?.clientHeight || 0) /
360
+ this.defaultRowHeight) : Infinity; // Need to be refactored when add pagination
361
+ let rows = vp.rows;
362
+ if (!isVirtualization && rows.length > 50) {
363
+ // eslint-disable-next-line no-console
364
+ console.warn('Grid: a large dataset can cause performance issues when ' +
365
+ 'virtualization is disabled. Consider enabling ' +
366
+ 'virtualization in the rows settings.');
367
+ }
368
+ if (!rows.length && rowCount > 0) {
369
+ const last = new TableRow(vp, rowCount - 1);
370
+ await last.init();
371
+ vp.tbodyElement.appendChild(last.htmlElement);
372
+ await last.render();
373
+ rows.push(last);
218
374
  if (isVirtualization) {
219
- newRow.setTranslateY(newRow.getDefaultTopOffset());
375
+ const topOffset = Math.min(last.getDefaultTopOffset(), this.maxElementHeight -
376
+ last.htmlElement.offsetHeight);
377
+ last.setTranslateY(topOffset);
220
378
  }
221
379
  }
222
- }
223
- rows.sort((a, b) => a.index - b.index);
224
- for (let i = 0, iEnd = rows.length; i < iEnd; ++i) {
225
- if (!rows[i].rendered) {
226
- vp.tbodyElement.insertBefore(rows[i].htmlElement, vp.tbodyElement.lastChild);
227
- rows[i].render();
380
+ // The last row is always kept rendered for bottom alignment
381
+ let alwaysLastRow = rows.length > 0 ? rows.pop() : void 0;
382
+ if (alwaysLastRow && alwaysLastRow.index !== rowCount - 1) {
383
+ this.poolRow(alwaysLastRow);
384
+ alwaysLastRow = void 0;
228
385
  }
229
- }
230
- if (alwaysLastRow) {
231
- rows.push(alwaysLastRow);
232
- }
233
- // Focus the cell if the focus cursor is set
234
- if (vp.focusCursor) {
235
- const [rowIndex, columnIndex] = vp.focusCursor;
236
- const row = rows.find((row) => row.index === rowIndex);
237
- if (row) {
238
- row.cells[columnIndex]?.htmlElement.focus({
239
- preventScroll: true
240
- });
386
+ const from = Math.max(0, Math.min(rowCursor - buffer, rowCount - rowsPerPage));
387
+ // `to` should not include the alwaysLastRow index (rowCount - 1)
388
+ const to = Math.min(rowCursor + rowsPerPage + buffer, rowCount - 2 // -2 because alwaysLastRow is at rowCount - 1
389
+ );
390
+ const tempRows = [];
391
+ const currentFrom = rows[0]?.index;
392
+ const currentTo = rows[rows.length - 1]?.index;
393
+ const hasOverlap = (rows.length > 0 &&
394
+ defined(currentFrom) &&
395
+ defined(currentTo) &&
396
+ !(to < currentFrom || from > currentTo));
397
+ if (!hasOverlap) {
398
+ // Remove rows that are out of the range except the last row.
399
+ for (let i = 0, iEnd = rows.length; i < iEnd; ++i) {
400
+ const row = rows[i];
401
+ const rowIndex = row.index;
402
+ if (rowIndex < from || rowIndex > to) {
403
+ this.poolRow(row);
404
+ }
405
+ else {
406
+ tempRows.push(row);
407
+ }
408
+ }
409
+ rows = tempRows;
410
+ vp.rows = rows;
411
+ for (let i = from; i <= to; ++i) {
412
+ const firstRowIndex = rows.length > 0 ? rows[0].index : from;
413
+ const row = rows[i - firstRowIndex];
414
+ // Recreate row when it is destroyed and it is in the range.
415
+ if (!row) {
416
+ const newRow = await this.getOrCreateRow(i);
417
+ rows.push(newRow);
418
+ }
419
+ }
420
+ rows.sort((a, b) => a.index - b.index);
421
+ }
422
+ else {
423
+ // Remove rows outside the range from the start.
424
+ while (rows.length && rows[0].index < from) {
425
+ this.poolRow(rows.shift());
426
+ }
427
+ // Remove rows outside the range from the end.
428
+ while (rows.length && rows[rows.length - 1].index > to) {
429
+ this.poolRow(rows.pop());
430
+ }
431
+ if (!rows.length) {
432
+ for (let i = from; i <= to; ++i) {
433
+ rows.push(await this.getOrCreateRow(i));
434
+ }
435
+ }
436
+ else {
437
+ // Add rows before the current range.
438
+ for (let i = rows[0].index - 1; i >= from; --i) {
439
+ rows.unshift(await this.getOrCreateRow(i));
440
+ }
441
+ // Add rows after the current range.
442
+ const lastRowIndex = rows[rows.length - 1].index + 1;
443
+ for (let i = lastRowIndex; i <= to; ++i) {
444
+ rows.push(await this.getOrCreateRow(i));
445
+ }
446
+ }
447
+ vp.rows = rows;
448
+ }
449
+ for (let i = 0, iEnd = rows.length; i < iEnd; ++i) {
450
+ const row = rows[i];
451
+ if (!row.rendered) {
452
+ // Ensure row is initialized before rendering
453
+ if (!row.htmlElement.hasAttribute('data-row-index')) {
454
+ await row.init();
455
+ }
456
+ vp.tbodyElement.insertBefore(row.htmlElement, vp.tbodyElement.lastChild);
457
+ await row.render();
458
+ if (isVirtualization) {
459
+ const topOffset = Math.min(row.getDefaultTopOffset(), this.maxElementHeight -
460
+ row.htmlElement.offsetHeight);
461
+ row.setTranslateY(topOffset);
462
+ }
463
+ continue;
464
+ }
465
+ if (!row.htmlElement.isConnected) {
466
+ vp.tbodyElement.insertBefore(row.htmlElement, vp.tbodyElement.lastChild);
467
+ }
468
+ }
469
+ if (!alwaysLastRow && rowCount > 0) {
470
+ alwaysLastRow = await this.getOrCreateRow(rowCount - 1);
471
+ }
472
+ if (alwaysLastRow) {
473
+ if (!alwaysLastRow.rendered) {
474
+ if (!alwaysLastRow.htmlElement
475
+ .hasAttribute('data-row-index')) {
476
+ await alwaysLastRow.init();
477
+ }
478
+ vp.tbodyElement.appendChild(alwaysLastRow.htmlElement);
479
+ await alwaysLastRow.render();
480
+ if (isVirtualization) {
481
+ const topOffset = Math.min(alwaysLastRow.getDefaultTopOffset(), this.maxElementHeight -
482
+ alwaysLastRow.htmlElement.offsetHeight);
483
+ alwaysLastRow.setTranslateY(topOffset);
484
+ }
485
+ }
486
+ else if (!alwaysLastRow.htmlElement.isConnected) {
487
+ vp.tbodyElement.appendChild(alwaysLastRow.htmlElement);
488
+ }
489
+ rows.push(alwaysLastRow);
490
+ }
491
+ // Focus the cell if the focus cursor is set
492
+ if (vp.focusCursor) {
493
+ const [rowIndex, columnIndex] = vp.focusCursor;
494
+ const row = rows.find((row) => row.index === rowIndex);
495
+ if (row) {
496
+ row.cells[columnIndex]?.htmlElement.focus({
497
+ preventScroll: true
498
+ });
499
+ }
500
+ }
501
+ // Set the focus anchor cell
502
+ if ((!vp.focusCursor || !vp.focusAnchorCell?.row.rendered) &&
503
+ rows.length > 0) {
504
+ const rowIndex = rowCursor - rows[0].index;
505
+ const targetRow = rows[rowIndex];
506
+ if (targetRow &&
507
+ targetRow.cells.length > 0 &&
508
+ targetRow.cells[0]) {
509
+ vp.setFocusAnchorCell(targetRow.cells[0]);
510
+ }
241
511
  }
242
512
  }
243
- // Set the focus anchor cell
244
- if ((!vp.focusCursor || !vp.focusAnchorCell?.row.rendered) &&
245
- rows.length > 0) {
246
- const rowIndex = rowCursor - rows[0].index;
247
- if (rows[rowIndex]) {
248
- vp.setFocusAnchorCell(rows[rowIndex].cells[0]);
513
+ finally {
514
+ this.isRendering = false;
515
+ // If there's a pending render request, process it
516
+ if (this.pendingRowCursor !== null) {
517
+ const pendingCursor = this.pendingRowCursor;
518
+ this.pendingRowCursor = null;
519
+ await this.renderRows(pendingCursor);
249
520
  }
250
521
  }
251
522
  }
@@ -262,18 +533,27 @@ class RowsVirtualizer {
262
533
  const { rowCursor: cursor, defaultRowHeight: defaultH } = this;
263
534
  const { rows, tbodyElement } = this.viewport;
264
535
  const rowsLn = rows.length;
265
- if (rowsLn < 1) {
536
+ if (rowsLn < 1 || !defaultH) {
266
537
  return;
267
538
  }
268
539
  let translateBuffer = rows[0].getDefaultTopOffset();
269
540
  for (let i = 0; i < rowsLn; ++i) {
270
541
  const row = rows[i];
542
+ // Skip if row is not fully rendered or has no cells
543
+ if (!row.rendered ||
544
+ !row.cells.length ||
545
+ !row.cells[0]?.htmlElement) {
546
+ row.htmlElement.style.height = defaultH + 'px';
547
+ continue;
548
+ }
271
549
  // Reset row height and cell transforms
272
550
  row.htmlElement.style.height = '';
273
551
  if (row.cells[0].htmlElement.style.transform) {
274
552
  for (let j = 0, jEnd = row.cells.length; j < jEnd; ++j) {
275
553
  const cell = row.cells[j];
276
- cell.htmlElement.style.transform = '';
554
+ if (cell?.htmlElement) {
555
+ cell.htmlElement.style.transform = '';
556
+ }
277
557
  }
278
558
  }
279
559
  // Rows above the first visible row
@@ -289,11 +569,13 @@ class RowsVirtualizer {
289
569
  }
290
570
  // First visible row
291
571
  if (row.htmlElement.offsetHeight > defaultH) {
292
- const newHeight = Math.floor(cellHeight - (cellHeight - defaultH) * (tbodyElement.scrollTop / defaultH - cursor));
572
+ const newHeight = Math.floor(cellHeight - (cellHeight - defaultH) * (tbodyElement.scrollTop / defaultH - Math.floor(cursor - this.scrollOffset / defaultH)));
293
573
  row.htmlElement.style.height = newHeight + 'px';
294
574
  for (let j = 0, jEnd = row.cells.length; j < jEnd; ++j) {
295
575
  const cell = row.cells[j];
296
- cell.htmlElement.style.transform = `translateY(${newHeight - cellHeight}px)`;
576
+ if (cell?.htmlElement) {
577
+ cell.htmlElement.style.transform = `translateY(${newHeight - cellHeight}px)`;
578
+ }
297
579
  }
298
580
  }
299
581
  }
@@ -321,23 +603,131 @@ class RowsVirtualizer {
321
603
  rows[i].reflow();
322
604
  }
323
605
  this.adjustRowHeights();
606
+ if (this.viewport.virtualRows) {
607
+ this.adjustRowOffsets();
608
+ }
609
+ }
610
+ /**
611
+ * Gets a row from the pool or creates a new one for the given index.
612
+ *
613
+ * @param index
614
+ * The row index in the data table.
615
+ *
616
+ * @returns
617
+ * A TableRow instance ready for use.
618
+ */
619
+ async getOrCreateRow(index) {
620
+ const vp = this.viewport;
621
+ const isVirtualization = vp.virtualRows;
622
+ const pooledRow = this.rowPool.pop();
623
+ if (pooledRow) {
624
+ await pooledRow.reuse(index);
625
+ if (isVirtualization) {
626
+ pooledRow.setTranslateY(pooledRow.getDefaultTopOffset());
627
+ }
628
+ return pooledRow;
629
+ }
630
+ const newRow = new TableRow(vp, index);
631
+ newRow.rendered = false;
632
+ await newRow.init();
633
+ if (isVirtualization) {
634
+ newRow.setTranslateY(newRow.getDefaultTopOffset());
635
+ }
636
+ return newRow;
637
+ }
638
+ /**
639
+ * Adds a row to the reuse pool, or destroys it if the pool is full.
640
+ *
641
+ * @param row
642
+ * The row to pool.
643
+ */
644
+ poolRow(row) {
645
+ row.htmlElement.remove();
646
+ if (this.rowPool.length < RowsVirtualizer.MAX_POOL_SIZE) {
647
+ this.rowPool.push(row);
648
+ }
649
+ else {
650
+ row.destroy();
651
+ }
324
652
  }
325
653
  /**
326
654
  * Returns the default height of a row. This method should be called only
327
655
  * once on initialization.
656
+ *
657
+ * @returns
658
+ * The default height of a row.
328
659
  */
329
- getDefaultRowHeight() {
660
+ async getDefaultRowHeight() {
330
661
  const vp = this.viewport;
331
662
  const mockRow = new TableRow(vp, 0);
663
+ await mockRow.init();
332
664
  mockRow.htmlElement.style.position = 'absolute';
333
665
  mockRow.htmlElement.classList.add(Globals.getClassName('mockedRow'));
334
- this.viewport.tbodyElement.appendChild(mockRow.htmlElement);
335
- mockRow.render();
666
+ vp.tbodyElement.appendChild(mockRow.htmlElement);
667
+ await mockRow.render();
336
668
  const defaultRowHeight = mockRow.htmlElement.offsetHeight;
337
669
  mockRow.destroy();
338
670
  return defaultRowHeight;
339
671
  }
672
+ /**
673
+ * Updates cached row count and derived grid height metrics used for
674
+ * overflow-aware scrolling.
675
+ */
676
+ async updateGridMetrics() {
677
+ const rowCount = await this.viewport.grid.dataProvider?.getRowCount();
678
+ if (!defined(rowCount)) {
679
+ return;
680
+ }
681
+ this.rowCount = rowCount;
682
+ this.totalGridHeight = this.rowCount * this.defaultRowHeight;
683
+ this.gridHeightOverflow = Math.max(this.totalGridHeight - this.maxElementHeight, 0);
684
+ }
685
+ /**
686
+ * Updates row translate offsets based on scroll scaling. When the grid
687
+ * exceeds the max element height, it keeps the bottom rows aligned to the
688
+ * maximum scrollable height.
689
+ */
690
+ adjustRowOffsets() {
691
+ const { rows } = this.viewport;
692
+ const rowsLn = rows.length;
693
+ if (rowsLn < 2) {
694
+ return;
695
+ }
696
+ const lastRow = rows[rowsLn - 1];
697
+ const preLastRow = rows[rowsLn - 2];
698
+ const isSecondToLastRowVisible = preLastRow &&
699
+ preLastRow.index === lastRow.index - 1;
700
+ let translateBuffer = rows[0].getDefaultTopOffset();
701
+ translateBuffer = Math.floor(translateBuffer - this.scrollOffset);
702
+ if (isSecondToLastRowVisible && this.gridHeightOverflow > 0) {
703
+ lastRow.setTranslateY(this.maxElementHeight -
704
+ lastRow.htmlElement.offsetHeight);
705
+ let bottomOffset = this.maxElementHeight -
706
+ lastRow.htmlElement.offsetHeight;
707
+ for (let i = rowsLn - 2; i >= 0; i--) {
708
+ bottomOffset -= rows[i].htmlElement.offsetHeight;
709
+ rows[i].setTranslateY(bottomOffset);
710
+ }
711
+ return;
712
+ }
713
+ rows[0].setTranslateY(translateBuffer);
714
+ for (let i = 1, iEnd = rowsLn - 1; i < iEnd; ++i) {
715
+ translateBuffer += rows[i - 1].htmlElement.offsetHeight;
716
+ rows[i].setTranslateY(translateBuffer);
717
+ }
718
+ if (this.gridHeightOverflow > 0) {
719
+ lastRow.setTranslateY(this.maxElementHeight);
720
+ return;
721
+ }
722
+ if (preLastRow && preLastRow.index === lastRow.index - 1) {
723
+ lastRow.setTranslateY(preLastRow.htmlElement.offsetHeight + translateBuffer);
724
+ }
725
+ }
340
726
  }
727
+ /**
728
+ * Maximum number of rows to keep in the reuse pool.
729
+ */
730
+ RowsVirtualizer.MAX_POOL_SIZE = 100;
341
731
  /* *
342
732
  *
343
733
  * Default Export